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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8611bcb3b67a7fdd7dad4cb3d461e15f203d219c
| 12,696
|
py
|
Python
|
source/inputs/proc_cde.py
|
ripl-org/predict-medicaid-ed
|
ba0467eed3579989cde2aaa4710751544c601bdd
|
[
"FSFAP"
] | null | null | null |
source/inputs/proc_cde.py
|
ripl-org/predict-medicaid-ed
|
ba0467eed3579989cde2aaa4710751544c601bdd
|
[
"FSFAP"
] | null | null | null |
source/inputs/proc_cde.py
|
ripl-org/predict-medicaid-ed
|
ba0467eed3579989cde2aaa4710751544c601bdd
|
[
"FSFAP"
] | null | null | null |
import sys
from riipl import Connection
enc_837_inst, ffs_inst, ffs_instx, \
enc_837_prof, ffs_prof, ffs_profx, \
ed_mc_inst, ed_mc_prof, ed_rhp_prof, \
recip_x_ssn, table = sys.argv[1:]
sql = """
CREATE TABLE %table% PCTFREE 0 NOLOGGING PARALLEL AS
SELECT DISTINCT
rxn.riipl_id,
claims.claim_id,
claims.claim_dt,
claims.proc_cde,
claims.source
FROM (
--- Source #1: ENC_837_INST
SELECT re_unique_id,
re_unique_id*100000000000 + cl_id_sak*100 + 1 AS claim_id,
cl_from_dte_svc AS claim_dt,
proc_cde,
'INST' AS source
FROM %enc_837_inst%
WHERE proc_cde IS NOT NULL
UNION
--- Source #2: FFS_INST
SELECT re_unique_id,
re_unique_id*100000000000 + cl_id_sak*100 + 2 AS claim_id,
cl_from_dte_svc AS claim_dt,
proc_cde,
'INST' AS source
FROM %ffs_inst%
WHERE proc_cde IS NOT NULL
UNION
--- Source #3: FFS_INSTX
SELECT re_unique_id,
re_unique_id*100000000000 + cl_id_sak*100 + 3 AS claim_id,
cl_from_dte_svc AS claim_dt,
proc_cde,
'INST' AS source
FROM %ffs_instx%
WHERE proc_cde IS NOT NULL
UNION
--- Source #4: ENC_837_PROF
SELECT re_unique_id,
re_unique_id*100000000000 + cl_id_sak*100 + 4 AS claim_id,
cl_from_dte_svc AS claim_dt,
proc_cde,
'PROF' AS source
FROM %enc_837_prof%
WHERE proc_cde IS NOT NULL
UNION
--- Source #5: FFS_PROF
SELECT re_unique_id,
re_unique_id*100000000000 + cl_id_sak*100 + 5 AS claim_id,
cl_from_dte_svc AS claim_dt,
proc_cde,
'PROF' AS source
FROM %ffs_prof%
WHERE proc_cde IS NOT NULL
UNION
--- Source #6: FFS_PROFX
SELECT re_unique_id,
re_unique_id*100000000000 + cl_id_sak*100 + 6 AS claim_id,
cl_from_dte_svc AS claim_dt,
proc_cde,
'PROF' AS source
FROM %ffs_profx%
WHERE proc_cde IS NOT NULL
UNION
--- Source #9: ED_MC_INST
SELECT recipient_unique_id AS re_unique_id,
recipient_unique_id*100000000000 + record_id*100 + 9 AS claim_id,
admission_date AS claim_dt,
proc_code_1 AS proc_cde,
'INST' AS source
FROM %ed_mc_inst%
WHERE proc_code_1 IS NOT NULL
UNION
SELECT recipient_unique_id AS re_unique_id,
recipient_unique_id*100000000000 + record_id*100 + 9 AS claim_id,
admission_date AS claim_dt,
proc_code_2 AS proc_cde,
'INST' AS source
FROM %ed_mc_inst%
WHERE proc_code_2 IS NOT NULL
UNION
SELECT recipient_unique_id AS re_unique_id,
recipient_unique_id*100000000000 + record_id*100 + 9 AS claim_id,
admission_date AS claim_dt,
proc_code_3 AS proc_cde,
'INST' AS source
FROM %ed_mc_inst%
WHERE proc_code_3 IS NOT NULL
UNION
SELECT recipient_unique_id AS re_unique_id,
recipient_unique_id*100000000000 + record_id*100 + 9 AS claim_id,
admission_date AS claim_dt,
proc_code_4 AS proc_cde,
'INST' AS source
FROM %ed_mc_inst%
WHERE proc_code_4 IS NOT NULL
UNION
SELECT recipient_unique_id AS re_unique_id,
recipient_unique_id*100000000000 + record_id*100 + 9 AS claim_id,
admission_date AS claim_dt,
proc_code_5 AS proc_cde,
'INST' AS source
FROM %ed_mc_inst%
WHERE proc_code_5 IS NOT NULL
UNION
SELECT recipient_unique_id AS re_unique_id,
recipient_unique_id*100000000000 + record_id*100 + 9 AS claim_id,
admission_date AS claim_dt,
proc_code_6 AS proc_cde,
'INST' AS source
FROM %ed_mc_inst%
WHERE proc_code_6 IS NOT NULL
UNION
--- Source #10: ED_MC_PROF
SELECT recipient_unique_id AS re_unique_id,
recipient_unique_id*100000000000 + record_id*100 + 10 AS claim_id,
service_date AS claim_dt,
proc_code_1 AS proc_cde,
'PROF' AS source
FROM %ed_mc_prof%
WHERE proc_code_1 IS NOT NULL
UNION
SELECT recipient_unique_id AS re_unique_id,
recipient_unique_id*100000000000 + record_id*100 + 10 AS claim_id,
service_date AS claim_dt,
proc_code_2 AS proc_cde,
'PROF' AS source
FROM %ed_mc_prof%
WHERE proc_code_2 IS NOT NULL
UNION
SELECT recipient_unique_id AS re_unique_id,
recipient_unique_id*100000000000 + record_id*100 + 10 AS claim_id,
service_date AS claim_dt,
proc_code_3 AS proc_cde,
'PROF' AS source
FROM %ed_mc_prof%
WHERE proc_code_3 IS NOT NULL
UNION
SELECT recipient_unique_id AS re_unique_id,
recipient_unique_id*100000000000 + record_id*100 + 10 AS claim_id,
service_date AS claim_dt,
proc_code_4 AS proc_cde,
'PROF' AS source
FROM %ed_mc_prof%
WHERE proc_code_4 IS NOT NULL
UNION
SELECT recipient_unique_id AS re_unique_id,
recipient_unique_id*100000000000 + record_id*100 + 10 AS claim_id,
service_date AS claim_dt,
proc_code_5 AS proc_cde,
'PROF' AS source
FROM %ed_mc_prof%
WHERE proc_code_5 IS NOT NULL
UNION
--- Source #11: ED_RHP_PROF
SELECT recipient_unique_id AS re_unique_id,
recipient_unique_id*100000000000 + record_id*100 + 11 AS claim_id,
service_date AS claim_dt,
proc_code_1 AS proc_cde,
'PROF' AS source
FROM %ed_rhp_prof%
WHERE proc_code_1 IS NOT NULL
UNION
SELECT recipient_unique_id AS re_unique_id,
recipient_unique_id*100000000000 + record_id*100 + 11 AS claim_id,
service_date AS claim_dt,
proc_code_2 AS proc_cde,
'PROF' AS source
FROM %ed_rhp_prof%
WHERE proc_code_2 IS NOT NULL
UNION
SELECT recipient_unique_id AS re_unique_id,
recipient_unique_id*100000000000 + record_id*100 + 11 AS claim_id,
service_date AS claim_dt,
proc_code_3 AS proc_cde,
'PROF' AS source
FROM %ed_rhp_prof%
WHERE proc_code_3 IS NOT NULL
UNION
SELECT recipient_unique_id AS re_unique_id,
recipient_unique_id*100000000000 + record_id*100 + 11 AS claim_id,
service_date AS claim_dt,
proc_code_4 AS proc_cde,
'PROF' AS source
FROM %ed_rhp_prof%
WHERE proc_code_4 IS NOT NULL
UNION
SELECT recipient_unique_id AS re_unique_id,
recipient_unique_id*100000000000 + record_id*100 + 11 AS claim_id,
service_date AS claim_dt,
proc_code_5 AS proc_cde,
'PROF' AS source
FROM %ed_rhp_prof%
WHERE proc_code_5 IS NOT NULL
) claims
LEFT JOIN %recip_x_ssn% rxn
ON claims.re_unique_id = rxn.recipient_id
"""
with Connection() as cxn:
cxn.clear_tables(table)
cxn.execute(sql)
cxn.save_table(table)
# vim: expandtab sw=4 ts=4
| 47.909434
| 91
| 0.360665
| 1,088
| 12,696
| 3.841912
| 0.071691
| 0.116746
| 0.130144
| 0.068421
| 0.883732
| 0.874641
| 0.874641
| 0.874641
| 0.85311
| 0.81866
| 0
| 0.086315
| 0.61035
| 12,696
| 264
| 92
| 48.090909
| 0.758642
| 0.00189
| 0
| 0.777778
| 0
| 0
| 0.975848
| 0.052249
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.009662
| 0
| 0.009662
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 9
|
863171bad53361b5a726721b50bdfb8889e3e591
| 29,994
|
py
|
Python
|
sdk/python/pulumi_openstack/blockstorage/quote_set_v3.py
|
pulumi/pulumi-openstack
|
945eed22a82784e9f0b3aa56168b2397c2f503e8
|
[
"ECL-2.0",
"Apache-2.0"
] | 34
|
2018-09-12T12:37:51.000Z
|
2022-02-04T19:32:13.000Z
|
sdk/python/pulumi_openstack/blockstorage/quote_set_v3.py
|
pulumi/pulumi-openstack
|
945eed22a82784e9f0b3aa56168b2397c2f503e8
|
[
"ECL-2.0",
"Apache-2.0"
] | 72
|
2018-08-15T13:04:57.000Z
|
2022-03-31T15:39:49.000Z
|
sdk/python/pulumi_openstack/blockstorage/quote_set_v3.py
|
pulumi/pulumi-openstack
|
945eed22a82784e9f0b3aa56168b2397c2f503e8
|
[
"ECL-2.0",
"Apache-2.0"
] | 7
|
2019-03-14T08:28:49.000Z
|
2021-12-29T04:23: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__ = ['QuoteSetV3Args', 'QuoteSetV3']
@pulumi.input_type
class QuoteSetV3Args:
def __init__(__self__, *,
project_id: pulumi.Input[str],
backup_gigabytes: Optional[pulumi.Input[int]] = None,
backups: Optional[pulumi.Input[int]] = None,
gigabytes: Optional[pulumi.Input[int]] = None,
groups: Optional[pulumi.Input[int]] = None,
per_volume_gigabytes: Optional[pulumi.Input[int]] = None,
region: Optional[pulumi.Input[str]] = None,
snapshots: Optional[pulumi.Input[int]] = None,
volume_type_quota: Optional[pulumi.Input[Mapping[str, Any]]] = None,
volumes: Optional[pulumi.Input[int]] = None):
"""
The set of arguments for constructing a QuoteSetV3 resource.
:param pulumi.Input[str] project_id: ID of the project to manage quotas. Changing this
creates a new quotaset.
:param pulumi.Input[int] backup_gigabytes: Quota value for backup gigabytes. Changing
this updates the existing quotaset.
:param pulumi.Input[int] backups: Quota value for backups. Changing this updates the
existing quotaset.
:param pulumi.Input[int] gigabytes: Quota value for gigabytes. Changing this updates the
existing quotaset.
:param pulumi.Input[int] groups: Quota value for groups. Changing this updates the
existing quotaset.
:param pulumi.Input[int] per_volume_gigabytes: Quota value for gigabytes per volume .
Changing this updates the existing quotaset.
:param pulumi.Input[str] region: The region in which to create the volume. If
omitted, the `region` argument of the provider is used. Changing this
creates a new quotaset.
:param pulumi.Input[int] snapshots: Quota value for snapshots. Changing this updates the
existing quotaset.
:param pulumi.Input[Mapping[str, Any]] volume_type_quota: Key/Value pairs for setting quota for
volumes types. Possible keys are `snapshots_<volume_type_name>`,
`volumes_<volume_type_name>` and `gigabytes_<volume_type_name>`.
:param pulumi.Input[int] volumes: Quota value for volumes. Changing this updates the
existing quotaset.
"""
pulumi.set(__self__, "project_id", project_id)
if backup_gigabytes is not None:
pulumi.set(__self__, "backup_gigabytes", backup_gigabytes)
if backups is not None:
pulumi.set(__self__, "backups", backups)
if gigabytes is not None:
pulumi.set(__self__, "gigabytes", gigabytes)
if groups is not None:
pulumi.set(__self__, "groups", groups)
if per_volume_gigabytes is not None:
pulumi.set(__self__, "per_volume_gigabytes", per_volume_gigabytes)
if region is not None:
pulumi.set(__self__, "region", region)
if snapshots is not None:
pulumi.set(__self__, "snapshots", snapshots)
if volume_type_quota is not None:
pulumi.set(__self__, "volume_type_quota", volume_type_quota)
if volumes is not None:
pulumi.set(__self__, "volumes", volumes)
@property
@pulumi.getter(name="projectId")
def project_id(self) -> pulumi.Input[str]:
"""
ID of the project to manage quotas. Changing this
creates a new quotaset.
"""
return pulumi.get(self, "project_id")
@project_id.setter
def project_id(self, value: pulumi.Input[str]):
pulumi.set(self, "project_id", value)
@property
@pulumi.getter(name="backupGigabytes")
def backup_gigabytes(self) -> Optional[pulumi.Input[int]]:
"""
Quota value for backup gigabytes. Changing
this updates the existing quotaset.
"""
return pulumi.get(self, "backup_gigabytes")
@backup_gigabytes.setter
def backup_gigabytes(self, value: Optional[pulumi.Input[int]]):
pulumi.set(self, "backup_gigabytes", value)
@property
@pulumi.getter
def backups(self) -> Optional[pulumi.Input[int]]:
"""
Quota value for backups. Changing this updates the
existing quotaset.
"""
return pulumi.get(self, "backups")
@backups.setter
def backups(self, value: Optional[pulumi.Input[int]]):
pulumi.set(self, "backups", value)
@property
@pulumi.getter
def gigabytes(self) -> Optional[pulumi.Input[int]]:
"""
Quota value for gigabytes. Changing this updates the
existing quotaset.
"""
return pulumi.get(self, "gigabytes")
@gigabytes.setter
def gigabytes(self, value: Optional[pulumi.Input[int]]):
pulumi.set(self, "gigabytes", value)
@property
@pulumi.getter
def groups(self) -> Optional[pulumi.Input[int]]:
"""
Quota value for groups. Changing this updates the
existing quotaset.
"""
return pulumi.get(self, "groups")
@groups.setter
def groups(self, value: Optional[pulumi.Input[int]]):
pulumi.set(self, "groups", value)
@property
@pulumi.getter(name="perVolumeGigabytes")
def per_volume_gigabytes(self) -> Optional[pulumi.Input[int]]:
"""
Quota value for gigabytes per volume .
Changing this updates the existing quotaset.
"""
return pulumi.get(self, "per_volume_gigabytes")
@per_volume_gigabytes.setter
def per_volume_gigabytes(self, value: Optional[pulumi.Input[int]]):
pulumi.set(self, "per_volume_gigabytes", value)
@property
@pulumi.getter
def region(self) -> Optional[pulumi.Input[str]]:
"""
The region in which to create the volume. If
omitted, the `region` argument of the provider is used. Changing this
creates a new quotaset.
"""
return pulumi.get(self, "region")
@region.setter
def region(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "region", value)
@property
@pulumi.getter
def snapshots(self) -> Optional[pulumi.Input[int]]:
"""
Quota value for snapshots. Changing this updates the
existing quotaset.
"""
return pulumi.get(self, "snapshots")
@snapshots.setter
def snapshots(self, value: Optional[pulumi.Input[int]]):
pulumi.set(self, "snapshots", value)
@property
@pulumi.getter(name="volumeTypeQuota")
def volume_type_quota(self) -> Optional[pulumi.Input[Mapping[str, Any]]]:
"""
Key/Value pairs for setting quota for
volumes types. Possible keys are `snapshots_<volume_type_name>`,
`volumes_<volume_type_name>` and `gigabytes_<volume_type_name>`.
"""
return pulumi.get(self, "volume_type_quota")
@volume_type_quota.setter
def volume_type_quota(self, value: Optional[pulumi.Input[Mapping[str, Any]]]):
pulumi.set(self, "volume_type_quota", value)
@property
@pulumi.getter
def volumes(self) -> Optional[pulumi.Input[int]]:
"""
Quota value for volumes. Changing this updates the
existing quotaset.
"""
return pulumi.get(self, "volumes")
@volumes.setter
def volumes(self, value: Optional[pulumi.Input[int]]):
pulumi.set(self, "volumes", value)
@pulumi.input_type
class _QuoteSetV3State:
def __init__(__self__, *,
backup_gigabytes: Optional[pulumi.Input[int]] = None,
backups: Optional[pulumi.Input[int]] = None,
gigabytes: Optional[pulumi.Input[int]] = None,
groups: Optional[pulumi.Input[int]] = None,
per_volume_gigabytes: Optional[pulumi.Input[int]] = None,
project_id: Optional[pulumi.Input[str]] = None,
region: Optional[pulumi.Input[str]] = None,
snapshots: Optional[pulumi.Input[int]] = None,
volume_type_quota: Optional[pulumi.Input[Mapping[str, Any]]] = None,
volumes: Optional[pulumi.Input[int]] = None):
"""
Input properties used for looking up and filtering QuoteSetV3 resources.
:param pulumi.Input[int] backup_gigabytes: Quota value for backup gigabytes. Changing
this updates the existing quotaset.
:param pulumi.Input[int] backups: Quota value for backups. Changing this updates the
existing quotaset.
:param pulumi.Input[int] gigabytes: Quota value for gigabytes. Changing this updates the
existing quotaset.
:param pulumi.Input[int] groups: Quota value for groups. Changing this updates the
existing quotaset.
:param pulumi.Input[int] per_volume_gigabytes: Quota value for gigabytes per volume .
Changing this updates the existing quotaset.
:param pulumi.Input[str] project_id: ID of the project to manage quotas. Changing this
creates a new quotaset.
:param pulumi.Input[str] region: The region in which to create the volume. If
omitted, the `region` argument of the provider is used. Changing this
creates a new quotaset.
:param pulumi.Input[int] snapshots: Quota value for snapshots. Changing this updates the
existing quotaset.
:param pulumi.Input[Mapping[str, Any]] volume_type_quota: Key/Value pairs for setting quota for
volumes types. Possible keys are `snapshots_<volume_type_name>`,
`volumes_<volume_type_name>` and `gigabytes_<volume_type_name>`.
:param pulumi.Input[int] volumes: Quota value for volumes. Changing this updates the
existing quotaset.
"""
if backup_gigabytes is not None:
pulumi.set(__self__, "backup_gigabytes", backup_gigabytes)
if backups is not None:
pulumi.set(__self__, "backups", backups)
if gigabytes is not None:
pulumi.set(__self__, "gigabytes", gigabytes)
if groups is not None:
pulumi.set(__self__, "groups", groups)
if per_volume_gigabytes is not None:
pulumi.set(__self__, "per_volume_gigabytes", per_volume_gigabytes)
if project_id is not None:
pulumi.set(__self__, "project_id", project_id)
if region is not None:
pulumi.set(__self__, "region", region)
if snapshots is not None:
pulumi.set(__self__, "snapshots", snapshots)
if volume_type_quota is not None:
pulumi.set(__self__, "volume_type_quota", volume_type_quota)
if volumes is not None:
pulumi.set(__self__, "volumes", volumes)
@property
@pulumi.getter(name="backupGigabytes")
def backup_gigabytes(self) -> Optional[pulumi.Input[int]]:
"""
Quota value for backup gigabytes. Changing
this updates the existing quotaset.
"""
return pulumi.get(self, "backup_gigabytes")
@backup_gigabytes.setter
def backup_gigabytes(self, value: Optional[pulumi.Input[int]]):
pulumi.set(self, "backup_gigabytes", value)
@property
@pulumi.getter
def backups(self) -> Optional[pulumi.Input[int]]:
"""
Quota value for backups. Changing this updates the
existing quotaset.
"""
return pulumi.get(self, "backups")
@backups.setter
def backups(self, value: Optional[pulumi.Input[int]]):
pulumi.set(self, "backups", value)
@property
@pulumi.getter
def gigabytes(self) -> Optional[pulumi.Input[int]]:
"""
Quota value for gigabytes. Changing this updates the
existing quotaset.
"""
return pulumi.get(self, "gigabytes")
@gigabytes.setter
def gigabytes(self, value: Optional[pulumi.Input[int]]):
pulumi.set(self, "gigabytes", value)
@property
@pulumi.getter
def groups(self) -> Optional[pulumi.Input[int]]:
"""
Quota value for groups. Changing this updates the
existing quotaset.
"""
return pulumi.get(self, "groups")
@groups.setter
def groups(self, value: Optional[pulumi.Input[int]]):
pulumi.set(self, "groups", value)
@property
@pulumi.getter(name="perVolumeGigabytes")
def per_volume_gigabytes(self) -> Optional[pulumi.Input[int]]:
"""
Quota value for gigabytes per volume .
Changing this updates the existing quotaset.
"""
return pulumi.get(self, "per_volume_gigabytes")
@per_volume_gigabytes.setter
def per_volume_gigabytes(self, value: Optional[pulumi.Input[int]]):
pulumi.set(self, "per_volume_gigabytes", value)
@property
@pulumi.getter(name="projectId")
def project_id(self) -> Optional[pulumi.Input[str]]:
"""
ID of the project to manage quotas. Changing this
creates a new quotaset.
"""
return pulumi.get(self, "project_id")
@project_id.setter
def project_id(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "project_id", value)
@property
@pulumi.getter
def region(self) -> Optional[pulumi.Input[str]]:
"""
The region in which to create the volume. If
omitted, the `region` argument of the provider is used. Changing this
creates a new quotaset.
"""
return pulumi.get(self, "region")
@region.setter
def region(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "region", value)
@property
@pulumi.getter
def snapshots(self) -> Optional[pulumi.Input[int]]:
"""
Quota value for snapshots. Changing this updates the
existing quotaset.
"""
return pulumi.get(self, "snapshots")
@snapshots.setter
def snapshots(self, value: Optional[pulumi.Input[int]]):
pulumi.set(self, "snapshots", value)
@property
@pulumi.getter(name="volumeTypeQuota")
def volume_type_quota(self) -> Optional[pulumi.Input[Mapping[str, Any]]]:
"""
Key/Value pairs for setting quota for
volumes types. Possible keys are `snapshots_<volume_type_name>`,
`volumes_<volume_type_name>` and `gigabytes_<volume_type_name>`.
"""
return pulumi.get(self, "volume_type_quota")
@volume_type_quota.setter
def volume_type_quota(self, value: Optional[pulumi.Input[Mapping[str, Any]]]):
pulumi.set(self, "volume_type_quota", value)
@property
@pulumi.getter
def volumes(self) -> Optional[pulumi.Input[int]]:
"""
Quota value for volumes. Changing this updates the
existing quotaset.
"""
return pulumi.get(self, "volumes")
@volumes.setter
def volumes(self, value: Optional[pulumi.Input[int]]):
pulumi.set(self, "volumes", value)
class QuoteSetV3(pulumi.CustomResource):
@overload
def __init__(__self__,
resource_name: str,
opts: Optional[pulumi.ResourceOptions] = None,
backup_gigabytes: Optional[pulumi.Input[int]] = None,
backups: Optional[pulumi.Input[int]] = None,
gigabytes: Optional[pulumi.Input[int]] = None,
groups: Optional[pulumi.Input[int]] = None,
per_volume_gigabytes: Optional[pulumi.Input[int]] = None,
project_id: Optional[pulumi.Input[str]] = None,
region: Optional[pulumi.Input[str]] = None,
snapshots: Optional[pulumi.Input[int]] = None,
volume_type_quota: Optional[pulumi.Input[Mapping[str, Any]]] = None,
volumes: Optional[pulumi.Input[int]] = None,
__props__=None):
"""
Manages a V3 block storage quotaset resource within OpenStack.
> **Note:** This usually requires admin privileges.
> **Note:** This resource has a no-op deletion so no actual actions will be done against the OpenStack API
in case of delete call.
> **Note:** This resource has all-in creation so all optional quota arguments that were not specified are
created with zero value. This excludes volume type quota.
## Example Usage
```python
import pulumi
import pulumi_openstack as openstack
project1 = openstack.identity.Project("project1")
quotaset1 = openstack.blockstorage.QuoteSetV3("quotaset1",
project_id=project1.id,
volumes=10,
snapshots=4,
gigabytes=100,
per_volume_gigabytes=10,
backups=4,
backup_gigabytes=10,
groups=100,
volume_type_quota={
"volumes_ssd": 30,
"gigabytes_ssd": 500,
"snapshots_ssd": 10,
})
```
## Import
Quotasets can be imported using the `project_id/region`, e.g.
```sh
$ pulumi import openstack:blockstorage/quoteSetV3:QuoteSetV3 quotaset_1 2a0f2240-c5e6-41de-896d-e80d97428d6b/region_1
```
:param str resource_name: The name of the resource.
:param pulumi.ResourceOptions opts: Options for the resource.
:param pulumi.Input[int] backup_gigabytes: Quota value for backup gigabytes. Changing
this updates the existing quotaset.
:param pulumi.Input[int] backups: Quota value for backups. Changing this updates the
existing quotaset.
:param pulumi.Input[int] gigabytes: Quota value for gigabytes. Changing this updates the
existing quotaset.
:param pulumi.Input[int] groups: Quota value for groups. Changing this updates the
existing quotaset.
:param pulumi.Input[int] per_volume_gigabytes: Quota value for gigabytes per volume .
Changing this updates the existing quotaset.
:param pulumi.Input[str] project_id: ID of the project to manage quotas. Changing this
creates a new quotaset.
:param pulumi.Input[str] region: The region in which to create the volume. If
omitted, the `region` argument of the provider is used. Changing this
creates a new quotaset.
:param pulumi.Input[int] snapshots: Quota value for snapshots. Changing this updates the
existing quotaset.
:param pulumi.Input[Mapping[str, Any]] volume_type_quota: Key/Value pairs for setting quota for
volumes types. Possible keys are `snapshots_<volume_type_name>`,
`volumes_<volume_type_name>` and `gigabytes_<volume_type_name>`.
:param pulumi.Input[int] volumes: Quota value for volumes. Changing this updates the
existing quotaset.
"""
...
@overload
def __init__(__self__,
resource_name: str,
args: QuoteSetV3Args,
opts: Optional[pulumi.ResourceOptions] = None):
"""
Manages a V3 block storage quotaset resource within OpenStack.
> **Note:** This usually requires admin privileges.
> **Note:** This resource has a no-op deletion so no actual actions will be done against the OpenStack API
in case of delete call.
> **Note:** This resource has all-in creation so all optional quota arguments that were not specified are
created with zero value. This excludes volume type quota.
## Example Usage
```python
import pulumi
import pulumi_openstack as openstack
project1 = openstack.identity.Project("project1")
quotaset1 = openstack.blockstorage.QuoteSetV3("quotaset1",
project_id=project1.id,
volumes=10,
snapshots=4,
gigabytes=100,
per_volume_gigabytes=10,
backups=4,
backup_gigabytes=10,
groups=100,
volume_type_quota={
"volumes_ssd": 30,
"gigabytes_ssd": 500,
"snapshots_ssd": 10,
})
```
## Import
Quotasets can be imported using the `project_id/region`, e.g.
```sh
$ pulumi import openstack:blockstorage/quoteSetV3:QuoteSetV3 quotaset_1 2a0f2240-c5e6-41de-896d-e80d97428d6b/region_1
```
:param str resource_name: The name of the resource.
:param QuoteSetV3Args 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(QuoteSetV3Args, 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,
backup_gigabytes: Optional[pulumi.Input[int]] = None,
backups: Optional[pulumi.Input[int]] = None,
gigabytes: Optional[pulumi.Input[int]] = None,
groups: Optional[pulumi.Input[int]] = None,
per_volume_gigabytes: Optional[pulumi.Input[int]] = None,
project_id: Optional[pulumi.Input[str]] = None,
region: Optional[pulumi.Input[str]] = None,
snapshots: Optional[pulumi.Input[int]] = None,
volume_type_quota: Optional[pulumi.Input[Mapping[str, Any]]] = None,
volumes: Optional[pulumi.Input[int]] = 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__ = QuoteSetV3Args.__new__(QuoteSetV3Args)
__props__.__dict__["backup_gigabytes"] = backup_gigabytes
__props__.__dict__["backups"] = backups
__props__.__dict__["gigabytes"] = gigabytes
__props__.__dict__["groups"] = groups
__props__.__dict__["per_volume_gigabytes"] = per_volume_gigabytes
if project_id is None and not opts.urn:
raise TypeError("Missing required property 'project_id'")
__props__.__dict__["project_id"] = project_id
__props__.__dict__["region"] = region
__props__.__dict__["snapshots"] = snapshots
__props__.__dict__["volume_type_quota"] = volume_type_quota
__props__.__dict__["volumes"] = volumes
super(QuoteSetV3, __self__).__init__(
'openstack:blockstorage/quoteSetV3:QuoteSetV3',
resource_name,
__props__,
opts)
@staticmethod
def get(resource_name: str,
id: pulumi.Input[str],
opts: Optional[pulumi.ResourceOptions] = None,
backup_gigabytes: Optional[pulumi.Input[int]] = None,
backups: Optional[pulumi.Input[int]] = None,
gigabytes: Optional[pulumi.Input[int]] = None,
groups: Optional[pulumi.Input[int]] = None,
per_volume_gigabytes: Optional[pulumi.Input[int]] = None,
project_id: Optional[pulumi.Input[str]] = None,
region: Optional[pulumi.Input[str]] = None,
snapshots: Optional[pulumi.Input[int]] = None,
volume_type_quota: Optional[pulumi.Input[Mapping[str, Any]]] = None,
volumes: Optional[pulumi.Input[int]] = None) -> 'QuoteSetV3':
"""
Get an existing QuoteSetV3 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[int] backup_gigabytes: Quota value for backup gigabytes. Changing
this updates the existing quotaset.
:param pulumi.Input[int] backups: Quota value for backups. Changing this updates the
existing quotaset.
:param pulumi.Input[int] gigabytes: Quota value for gigabytes. Changing this updates the
existing quotaset.
:param pulumi.Input[int] groups: Quota value for groups. Changing this updates the
existing quotaset.
:param pulumi.Input[int] per_volume_gigabytes: Quota value for gigabytes per volume .
Changing this updates the existing quotaset.
:param pulumi.Input[str] project_id: ID of the project to manage quotas. Changing this
creates a new quotaset.
:param pulumi.Input[str] region: The region in which to create the volume. If
omitted, the `region` argument of the provider is used. Changing this
creates a new quotaset.
:param pulumi.Input[int] snapshots: Quota value for snapshots. Changing this updates the
existing quotaset.
:param pulumi.Input[Mapping[str, Any]] volume_type_quota: Key/Value pairs for setting quota for
volumes types. Possible keys are `snapshots_<volume_type_name>`,
`volumes_<volume_type_name>` and `gigabytes_<volume_type_name>`.
:param pulumi.Input[int] volumes: Quota value for volumes. Changing this updates the
existing quotaset.
"""
opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))
__props__ = _QuoteSetV3State.__new__(_QuoteSetV3State)
__props__.__dict__["backup_gigabytes"] = backup_gigabytes
__props__.__dict__["backups"] = backups
__props__.__dict__["gigabytes"] = gigabytes
__props__.__dict__["groups"] = groups
__props__.__dict__["per_volume_gigabytes"] = per_volume_gigabytes
__props__.__dict__["project_id"] = project_id
__props__.__dict__["region"] = region
__props__.__dict__["snapshots"] = snapshots
__props__.__dict__["volume_type_quota"] = volume_type_quota
__props__.__dict__["volumes"] = volumes
return QuoteSetV3(resource_name, opts=opts, __props__=__props__)
@property
@pulumi.getter(name="backupGigabytes")
def backup_gigabytes(self) -> pulumi.Output[int]:
"""
Quota value for backup gigabytes. Changing
this updates the existing quotaset.
"""
return pulumi.get(self, "backup_gigabytes")
@property
@pulumi.getter
def backups(self) -> pulumi.Output[int]:
"""
Quota value for backups. Changing this updates the
existing quotaset.
"""
return pulumi.get(self, "backups")
@property
@pulumi.getter
def gigabytes(self) -> pulumi.Output[int]:
"""
Quota value for gigabytes. Changing this updates the
existing quotaset.
"""
return pulumi.get(self, "gigabytes")
@property
@pulumi.getter
def groups(self) -> pulumi.Output[int]:
"""
Quota value for groups. Changing this updates the
existing quotaset.
"""
return pulumi.get(self, "groups")
@property
@pulumi.getter(name="perVolumeGigabytes")
def per_volume_gigabytes(self) -> pulumi.Output[int]:
"""
Quota value for gigabytes per volume .
Changing this updates the existing quotaset.
"""
return pulumi.get(self, "per_volume_gigabytes")
@property
@pulumi.getter(name="projectId")
def project_id(self) -> pulumi.Output[str]:
"""
ID of the project to manage quotas. Changing this
creates a new quotaset.
"""
return pulumi.get(self, "project_id")
@property
@pulumi.getter
def region(self) -> pulumi.Output[str]:
"""
The region in which to create the volume. If
omitted, the `region` argument of the provider is used. Changing this
creates a new quotaset.
"""
return pulumi.get(self, "region")
@property
@pulumi.getter
def snapshots(self) -> pulumi.Output[int]:
"""
Quota value for snapshots. Changing this updates the
existing quotaset.
"""
return pulumi.get(self, "snapshots")
@property
@pulumi.getter(name="volumeTypeQuota")
def volume_type_quota(self) -> pulumi.Output[Optional[Mapping[str, Any]]]:
"""
Key/Value pairs for setting quota for
volumes types. Possible keys are `snapshots_<volume_type_name>`,
`volumes_<volume_type_name>` and `gigabytes_<volume_type_name>`.
"""
return pulumi.get(self, "volume_type_quota")
@property
@pulumi.getter
def volumes(self) -> pulumi.Output[int]:
"""
Quota value for volumes. Changing this updates the
existing quotaset.
"""
return pulumi.get(self, "volumes")
| 40.86376
| 134
| 0.629259
| 3,396
| 29,994
| 5.363074
| 0.062721
| 0.080931
| 0.06995
| 0.076099
| 0.908033
| 0.899522
| 0.88942
| 0.881568
| 0.874705
| 0.867293
| 0
| 0.005842
| 0.275188
| 29,994
| 733
| 135
| 40.919509
| 0.831923
| 0.378409
| 0
| 0.833333
| 1
| 0
| 0.086367
| 0.002701
| 0
| 0
| 0
| 0
| 0
| 1
| 0.163793
| false
| 0.002874
| 0.014368
| 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
|
8631a428a4c54d253ad2e89a2110667da98650a2
| 81,919
|
py
|
Python
|
autotest/gdrivers/vrtpansharpen.py
|
roman0yurin/gdal
|
349a0992c7ebd0c71e8014e00897b098e4ca16fb
|
[
"MIT"
] | 1
|
2017-08-23T13:32:41.000Z
|
2017-08-23T13:32:41.000Z
|
autotest/gdrivers/vrtpansharpen.py
|
norBIT/gdal
|
64855dbee2cd0dff47da11d916c8d2703b4e99b8
|
[
"MIT"
] | null | null | null |
autotest/gdrivers/vrtpansharpen.py
|
norBIT/gdal
|
64855dbee2cd0dff47da11d916c8d2703b4e99b8
|
[
"MIT"
] | 2
|
2018-05-03T15:34:36.000Z
|
2020-07-13T15:30:20.000Z
|
#!/usr/bin/env python
###############################################################################
# $Id$
#
# Project: GDAL/OGR Test Suite
# Purpose: Test VRTPansharpenedDataset support.
# Author: Even Rouault <even.rouault at spatialys.com>
#
###############################################################################
# Copyright (c) 2015, Even Rouault <even.rouault at spatialys.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
###############################################################################
import sys
import shutil
from osgeo import gdal
sys.path.append( '../pymod' )
import gdaltest
###############################################################################
# Error cases
def vrtpansharpen_1():
src_ds = gdal.Open('data/small_world.tif')
src_data = src_ds.GetRasterBand(1).ReadRaster()
gt = src_ds.GetGeoTransform()
wkt = src_ds.GetProjectionRef()
src_ds = None
pan_ds = gdal.GetDriverByName('GTiff').Create('tmp/small_world_pan.tif', 800, 400)
gt = [ gt[i] for i in range(len(gt)) ]
gt[1] *= 0.5
gt[5] *= 0.5
pan_ds.SetGeoTransform(gt)
pan_ds.SetProjection(wkt)
pan_ds.GetRasterBand(1).WriteRaster(0,0,800,400,src_data,400,200)
pan_ds = None
# Missing PansharpeningOptions
gdal.PushErrorHandler()
vrt_ds = gdal.Open("""<VRTDataset rasterXSize="800" rasterYSize="400" subClass="VRTPansharpenedDataset">
<VRTRasterBand dataType="Byte" band="1" subClass="VRTPansharpenedRasterBand">
<ColorInterp>Red</ColorInterp>
</VRTRasterBand>
<VRTRasterBand dataType="Byte" band="2" subClass="VRTPansharpenedRasterBand">
<ColorInterp>Green</ColorInterp>
</VRTRasterBand>
<VRTRasterBand dataType="Byte" band="3" subClass="VRTPansharpenedRasterBand">
<ColorInterp>Blue</ColorInterp>
</VRTRasterBand>
</VRTDataset>""")
gdal.PopErrorHandler()
if vrt_ds is not None:
gdaltest.post_reason('fail')
return 'fail'
# PanchroBand missing
gdal.PushErrorHandler()
vrt_ds = gdal.Open("""<VRTDataset rasterXSize="800" rasterYSize="400" subClass="VRTPansharpenedDataset">
<VRTRasterBand dataType="Byte" band="1" subClass="VRTPansharpenedRasterBand">
<ColorInterp>Red</ColorInterp>
</VRTRasterBand>
<VRTRasterBand dataType="Byte" band="2" subClass="VRTPansharpenedRasterBand">
<ColorInterp>Green</ColorInterp>
</VRTRasterBand>
<VRTRasterBand dataType="Byte" band="3" subClass="VRTPansharpenedRasterBand">
<ColorInterp>Blue</ColorInterp>
</VRTRasterBand>
<PansharpeningOptions>
<Algorithm>WeightedBrovey</Algorithm>
<AlgorithmOptions>
<Weights>0.33333,0.333333,0.333333</Weights>
</AlgorithmOptions>
<Resampling>Cubic</Resampling>
<NumThreads>ALL_CPUS</NumThreads>
<BitDepth>8</BitDepth>
<SpectralBand dstBand="1">
<SourceFilename relativeToVRT="1">data/small_world.tif</SourceFilename>
<SourceBand>1</SourceBand>
</SpectralBand>
<SpectralBand dstBand="2">
<SourceFilename relativeToVRT="1">data/small_world.tif</SourceFilename>
<SourceBand>2</SourceBand>
</SpectralBand>
<SpectralBand dstBand="3">
<SourceFilename relativeToVRT="1">data/small_world.tif</SourceFilename>
<SourceBand>3</SourceBand>
</SpectralBand>
</PansharpeningOptions>
</VRTDataset>""")
gdal.PopErrorHandler()
if vrt_ds is not None:
gdaltest.post_reason('fail')
return 'fail'
# PanchroBand.SourceFilename missing
gdal.PushErrorHandler()
vrt_ds = gdal.Open("""<VRTDataset rasterXSize="800" rasterYSize="400" subClass="VRTPansharpenedDataset">
<VRTRasterBand dataType="Byte" band="1" subClass="VRTPansharpenedRasterBand">
<ColorInterp>Red</ColorInterp>
</VRTRasterBand>
<VRTRasterBand dataType="Byte" band="2" subClass="VRTPansharpenedRasterBand">
<ColorInterp>Green</ColorInterp>
</VRTRasterBand>
<VRTRasterBand dataType="Byte" band="3" subClass="VRTPansharpenedRasterBand">
<ColorInterp>Blue</ColorInterp>
</VRTRasterBand>
<PansharpeningOptions>
<Algorithm>WeightedBrovey</Algorithm>
<AlgorithmOptions>
<Weights>0.33333,0.333333,0.333333</Weights>
</AlgorithmOptions>
<Resampling>Cubic</Resampling>
<NumThreads>ALL_CPUS</NumThreads>
<BitDepth>8</BitDepth>
<PanchroBand>
</PanchroBand>
<SpectralBand dstBand="1">
<SourceFilename relativeToVRT="1">data/small_world.tif</SourceFilename>
<SourceBand>1</SourceBand>
</SpectralBand>
<SpectralBand dstBand="2">
<SourceFilename relativeToVRT="1">data/small_world.tif</SourceFilename>
<SourceBand>2</SourceBand>
</SpectralBand>
<SpectralBand dstBand="3">
<SourceFilename relativeToVRT="1">data/small_world.tif</SourceFilename>
<SourceBand>3</SourceBand>
</SpectralBand>
</PansharpeningOptions>
</VRTDataset>""")
gdal.PopErrorHandler()
if vrt_ds is not None:
gdaltest.post_reason('fail')
return 'fail'
# Invalid dataset name
gdal.PushErrorHandler()
vrt_ds = gdal.Open("""<VRTDataset rasterXSize="800" rasterYSize="400" subClass="VRTPansharpenedDataset">
<VRTRasterBand dataType="Byte" band="1" subClass="VRTPansharpenedRasterBand">
<ColorInterp>Red</ColorInterp>
</VRTRasterBand>
<VRTRasterBand dataType="Byte" band="2" subClass="VRTPansharpenedRasterBand">
<ColorInterp>Green</ColorInterp>
</VRTRasterBand>
<VRTRasterBand dataType="Byte" band="3" subClass="VRTPansharpenedRasterBand">
<ColorInterp>Blue</ColorInterp>
</VRTRasterBand>
<PansharpeningOptions>
<Algorithm>WeightedBrovey</Algorithm>
<AlgorithmOptions>
<Weights>0.33333,0.333333,0.333333</Weights>
</AlgorithmOptions>
<Resampling>Cubic</Resampling>
<NumThreads>ALL_CPUS</NumThreads>
<BitDepth>8</BitDepth>
<PanchroBand>
<SourceFilename relativeToVRT="0">/does/not/exist</SourceFilename>
<SourceBand>1</SourceBand>
</PanchroBand>
<SpectralBand dstBand="1">
<SourceFilename relativeToVRT="1">data/small_world.tif</SourceFilename>
<SourceBand>1</SourceBand>
</SpectralBand>
<SpectralBand dstBand="2">
<SourceFilename relativeToVRT="1">data/small_world.tif</SourceFilename>
<SourceBand>2</SourceBand>
</SpectralBand>
<SpectralBand dstBand="3">
<SourceFilename relativeToVRT="1">data/small_world.tif</SourceFilename>
<SourceBand>3</SourceBand>
</SpectralBand>
</PansharpeningOptions>
</VRTDataset>""")
gdal.PopErrorHandler()
if vrt_ds is not None:
gdaltest.post_reason('fail')
return 'fail'
# Inconsistent declared VRT dimensions with panchro dataset.
gdal.PushErrorHandler()
vrt_ds = gdal.Open("""<VRTDataset rasterXSize="1800" rasterYSize="400" subClass="VRTPansharpenedDataset">
<VRTRasterBand dataType="Byte" band="1" subClass="VRTPansharpenedRasterBand">
<ColorInterp>Red</ColorInterp>
</VRTRasterBand>
<VRTRasterBand dataType="Byte" band="2" subClass="VRTPansharpenedRasterBand">
<ColorInterp>Green</ColorInterp>
</VRTRasterBand>
<VRTRasterBand dataType="Byte" band="3" subClass="VRTPansharpenedRasterBand">
<ColorInterp>Blue</ColorInterp>
</VRTRasterBand>
<PansharpeningOptions>
<Algorithm>WeightedBrovey</Algorithm>
<AlgorithmOptions>
<Weights>0.33333,0.333333,0.333333</Weights>
</AlgorithmOptions>
<Resampling>Cubic</Resampling>
<NumThreads>ALL_CPUS</NumThreads>
<BitDepth>8</BitDepth>
<PanchroBand>
<SourceFilename relativeToVRT="1">tmp/small_world_pan.tif</SourceFilename>
<SourceBand>1</SourceBand>
</PanchroBand>
<SpectralBand dstBand="1">
<SourceFilename relativeToVRT="1">data/small_world.tif</SourceFilename>
<SourceBand>1</SourceBand>
</SpectralBand>
<SpectralBand dstBand="2">
<SourceFilename relativeToVRT="1">data/small_world.tif</SourceFilename>
<SourceBand>2</SourceBand>
</SpectralBand>
<SpectralBand dstBand="3">
<SourceFilename relativeToVRT="1">data/small_world.tif</SourceFilename>
<SourceBand>3</SourceBand>
</SpectralBand>
</PansharpeningOptions>
</VRTDataset>""")
gdal.PopErrorHandler()
if vrt_ds is not None:
gdaltest.post_reason('fail')
return 'fail'
# VRTRasterBand of unrecognized subclass 'blabla'
gdal.PushErrorHandler()
vrt_ds = gdal.Open("""<VRTDataset rasterXSize="800" rasterYSize="400" subClass="VRTPansharpenedDataset">
<VRTRasterBand dataType="Byte" band="1" subClass="blabla">
<ColorInterp>Red</ColorInterp>
</VRTRasterBand>
<VRTRasterBand dataType="Byte" band="2" subClass="VRTPansharpenedRasterBand">
<ColorInterp>Green</ColorInterp>
</VRTRasterBand>
<VRTRasterBand dataType="Byte" band="3" subClass="VRTPansharpenedRasterBand">
<ColorInterp>Blue</ColorInterp>
</VRTRasterBand>
<PansharpeningOptions>
<Algorithm>WeightedBrovey</Algorithm>
<AlgorithmOptions>
<Weights>0.33333,0.333333,0.333333</Weights>
</AlgorithmOptions>
<Resampling>Cubic</Resampling>
<NumThreads>ALL_CPUS</NumThreads>
<BitDepth>8</BitDepth>
<PanchroBand>
<SourceFilename relativeToVRT="1">tmp/small_world_pan.tif</SourceFilename>
<SourceBand>1</SourceBand>
</PanchroBand>
<SpectralBand dstBand="1">
<SourceFilename relativeToVRT="1">data/small_world.tif</SourceFilename>
<SourceBand>1</SourceBand>
</SpectralBand>
<SpectralBand dstBand="2">
<SourceFilename relativeToVRT="1">data/small_world.tif</SourceFilename>
<SourceBand>2</SourceBand>
</SpectralBand>
<SpectralBand dstBand="3">
<SourceFilename relativeToVRT="1">data/small_world.tif</SourceFilename>
<SourceBand>3</SourceBand>
</SpectralBand>
</PansharpeningOptions>
</VRTDataset>""")
gdal.PopErrorHandler()
if vrt_ds is not None:
gdaltest.post_reason('fail')
return 'fail'
# Algorithm unsupported_alg unsupported
gdal.PushErrorHandler()
vrt_ds = gdal.Open("""<VRTDataset rasterXSize="800" rasterYSize="400" subClass="VRTPansharpenedDataset">
<VRTRasterBand dataType="Byte" band="1" subClass="VRTPansharpenedRasterBand">
<ColorInterp>Red</ColorInterp>
</VRTRasterBand>
<VRTRasterBand dataType="Byte" band="2" subClass="VRTPansharpenedRasterBand">
<ColorInterp>Green</ColorInterp>
</VRTRasterBand>
<VRTRasterBand dataType="Byte" band="3" subClass="VRTPansharpenedRasterBand">
<ColorInterp>Blue</ColorInterp>
</VRTRasterBand>
<PansharpeningOptions>
<Algorithm>unsupported_alg</Algorithm>
<AlgorithmOptions>
<Weights>0.33333,0.333333,0.333333</Weights>
</AlgorithmOptions>
<Resampling>Cubic</Resampling>
<NumThreads>ALL_CPUS</NumThreads>
<BitDepth>8</BitDepth>
<PanchroBand>
<SourceFilename relativeToVRT="1">tmp/small_world_pan.tif</SourceFilename>
<SourceBand>1</SourceBand>
</PanchroBand>
<SpectralBand dstBand="1">
<SourceFilename relativeToVRT="1">data/small_world.tif</SourceFilename>
<SourceBand>1</SourceBand>
</SpectralBand>
<SpectralBand dstBand="2">
<SourceFilename relativeToVRT="1">data/small_world.tif</SourceFilename>
<SourceBand>2</SourceBand>
</SpectralBand>
<SpectralBand dstBand="3">
<SourceFilename relativeToVRT="1">data/small_world.tif</SourceFilename>
<SourceBand>3</SourceBand>
</SpectralBand>
</PansharpeningOptions>
</VRTDataset>""")
gdal.PopErrorHandler()
if vrt_ds is not None:
gdaltest.post_reason('fail')
return 'fail'
# 10 invalid band of tmp/small_world_pan.tif
gdal.PushErrorHandler()
vrt_ds = gdal.Open("""<VRTDataset rasterXSize="800" rasterYSize="400" subClass="VRTPansharpenedDataset">
<VRTRasterBand dataType="Byte" band="1" subClass="VRTPansharpenedRasterBand">
<ColorInterp>Red</ColorInterp>
</VRTRasterBand>
<VRTRasterBand dataType="Byte" band="2" subClass="VRTPansharpenedRasterBand">
<ColorInterp>Green</ColorInterp>
</VRTRasterBand>
<VRTRasterBand dataType="Byte" band="3" subClass="VRTPansharpenedRasterBand">
<ColorInterp>Blue</ColorInterp>
</VRTRasterBand>
<PansharpeningOptions>
<Algorithm>WeightedBrovey</Algorithm>
<AlgorithmOptions>
<Weights>0.33333,0.333333,0.333333</Weights>
</AlgorithmOptions>
<Resampling>Cubic</Resampling>
<NumThreads>ALL_CPUS</NumThreads>
<BitDepth>8</BitDepth>
<PanchroBand>
<SourceFilename relativeToVRT="1">tmp/small_world_pan.tif</SourceFilename>
<SourceBand>10</SourceBand>
</PanchroBand>
<SpectralBand dstBand="1">
<SourceFilename relativeToVRT="1">data/small_world.tif</SourceFilename>
<SourceBand>1</SourceBand>
</SpectralBand>
<SpectralBand dstBand="2">
<SourceFilename relativeToVRT="1">data/small_world.tif</SourceFilename>
<SourceBand>2</SourceBand>
</SpectralBand>
<SpectralBand dstBand="3">
<SourceFilename relativeToVRT="1">data/small_world.tif</SourceFilename>
<SourceBand>3</SourceBand>
</SpectralBand>
</PansharpeningOptions>
</VRTDataset>""")
gdal.PopErrorHandler()
if vrt_ds is not None:
gdaltest.post_reason('fail')
return 'fail'
# SpectralBand.dstBand = '-1' invalid
gdal.PushErrorHandler()
vrt_ds = gdal.Open("""<VRTDataset rasterXSize="800" rasterYSize="400" subClass="VRTPansharpenedDataset">
<VRTRasterBand dataType="Byte" band="1" subClass="VRTPansharpenedRasterBand">
<ColorInterp>Red</ColorInterp>
</VRTRasterBand>
<VRTRasterBand dataType="Byte" band="2" subClass="VRTPansharpenedRasterBand">
<ColorInterp>Green</ColorInterp>
</VRTRasterBand>
<VRTRasterBand dataType="Byte" band="3" subClass="VRTPansharpenedRasterBand">
<ColorInterp>Blue</ColorInterp>
</VRTRasterBand>
<PansharpeningOptions>
<Algorithm>WeightedBrovey</Algorithm>
<AlgorithmOptions>
<Weights>0.33333,0.333333,0.333333</Weights>
</AlgorithmOptions>
<Resampling>Cubic</Resampling>
<NumThreads>ALL_CPUS</NumThreads>
<BitDepth>8</BitDepth>
<PanchroBand>
<SourceFilename relativeToVRT="1">tmp/small_world_pan.tif</SourceFilename>
<SourceBand>1</SourceBand>
</PanchroBand>
<SpectralBand dstBand="-1">
<SourceFilename relativeToVRT="1">data/small_world.tif</SourceFilename>
<SourceBand>1</SourceBand>
</SpectralBand>
<SpectralBand dstBand="2">
<SourceFilename relativeToVRT="1">data/small_world.tif</SourceFilename>
<SourceBand>2</SourceBand>
</SpectralBand>
<SpectralBand dstBand="3">
<SourceFilename relativeToVRT="1">data/small_world.tif</SourceFilename>
<SourceBand>3</SourceBand>
</SpectralBand>
</PansharpeningOptions>
</VRTDataset>""")
gdal.PopErrorHandler()
if vrt_ds is not None:
gdaltest.post_reason('fail')
return 'fail'
# SpectralBand.SourceFilename missing
gdal.PushErrorHandler()
vrt_ds = gdal.Open("""<VRTDataset rasterXSize="800" rasterYSize="400" subClass="VRTPansharpenedDataset">
<VRTRasterBand dataType="Byte" band="1" subClass="VRTPansharpenedRasterBand">
<ColorInterp>Red</ColorInterp>
</VRTRasterBand>
<VRTRasterBand dataType="Byte" band="2" subClass="VRTPansharpenedRasterBand">
<ColorInterp>Green</ColorInterp>
</VRTRasterBand>
<VRTRasterBand dataType="Byte" band="3" subClass="VRTPansharpenedRasterBand">
<ColorInterp>Blue</ColorInterp>
</VRTRasterBand>
<PansharpeningOptions>
<Algorithm>WeightedBrovey</Algorithm>
<AlgorithmOptions>
<Weights>0.33333,0.333333,0.333333</Weights>
</AlgorithmOptions>
<Resampling>Cubic</Resampling>
<NumThreads>ALL_CPUS</NumThreads>
<BitDepth>8</BitDepth>
<PanchroBand>
<SourceFilename relativeToVRT="1">tmp/small_world_pan.tif</SourceFilename>
<SourceBand>1</SourceBand>
</PanchroBand>
<SpectralBand dstBand="1">
<SourceBand>1</SourceBand>
</SpectralBand>
<SpectralBand dstBand="2">
<SourceFilename relativeToVRT="1">data/small_world.tif</SourceFilename>
<SourceBand>2</SourceBand>
</SpectralBand>
<SpectralBand dstBand="3">
<SourceFilename relativeToVRT="1">data/small_world.tif</SourceFilename>
<SourceBand>3</SourceBand>
</SpectralBand>
</PansharpeningOptions>
</VRTDataset>""")
gdal.PopErrorHandler()
if vrt_ds is not None:
gdaltest.post_reason('fail')
return 'fail'
# Invalid dataset name
gdal.PushErrorHandler()
vrt_ds = gdal.Open("""<VRTDataset rasterXSize="800" rasterYSize="400" subClass="VRTPansharpenedDataset">
<VRTRasterBand dataType="Byte" band="1" subClass="VRTPansharpenedRasterBand">
<ColorInterp>Red</ColorInterp>
</VRTRasterBand>
<VRTRasterBand dataType="Byte" band="2" subClass="VRTPansharpenedRasterBand">
<ColorInterp>Green</ColorInterp>
</VRTRasterBand>
<VRTRasterBand dataType="Byte" band="3" subClass="VRTPansharpenedRasterBand">
<ColorInterp>Blue</ColorInterp>
</VRTRasterBand>
<PansharpeningOptions>
<Algorithm>WeightedBrovey</Algorithm>
<AlgorithmOptions>
<Weights>0.33333,0.333333,0.333333</Weights>
</AlgorithmOptions>
<Resampling>Cubic</Resampling>
<NumThreads>ALL_CPUS</NumThreads>
<BitDepth>8</BitDepth>
<PanchroBand>
<SourceFilename relativeToVRT="1">tmp/small_world_pan.tif</SourceFilename>
<SourceBand>1</SourceBand>
</PanchroBand>
<SpectralBand dstBand="1">
<SourceFilename relativeToVRT="1">/does/not/exist</SourceFilename>
<SourceBand>1</SourceBand>
</SpectralBand>
<SpectralBand dstBand="2">
<SourceFilename relativeToVRT="1">data/small_world.tif</SourceFilename>
<SourceBand>2</SourceBand>
</SpectralBand>
<SpectralBand dstBand="3">
<SourceFilename relativeToVRT="1">data/small_world.tif</SourceFilename>
<SourceBand>3</SourceBand>
</SpectralBand>
</PansharpeningOptions>
</VRTDataset>""")
gdal.PopErrorHandler()
if vrt_ds is not None:
gdaltest.post_reason('fail')
return 'fail'
# 10 invalid band of data/small_world.tif
gdal.PushErrorHandler()
vrt_ds = gdal.Open("""<VRTDataset rasterXSize="800" rasterYSize="400" subClass="VRTPansharpenedDataset">
<VRTRasterBand dataType="Byte" band="1" subClass="VRTPansharpenedRasterBand">
<ColorInterp>Red</ColorInterp>
</VRTRasterBand>
<VRTRasterBand dataType="Byte" band="2" subClass="VRTPansharpenedRasterBand">
<ColorInterp>Green</ColorInterp>
</VRTRasterBand>
<VRTRasterBand dataType="Byte" band="3" subClass="VRTPansharpenedRasterBand">
<ColorInterp>Blue</ColorInterp>
</VRTRasterBand>
<PansharpeningOptions>
<Algorithm>WeightedBrovey</Algorithm>
<AlgorithmOptions>
<Weights>0.33333,0.333333,0.333333</Weights>
</AlgorithmOptions>
<Resampling>Cubic</Resampling>
<NumThreads>ALL_CPUS</NumThreads>
<BitDepth>8</BitDepth>
<PanchroBand>
<SourceFilename relativeToVRT="1">tmp/small_world_pan.tif</SourceFilename>
<SourceBand>1</SourceBand>
</PanchroBand>
<SpectralBand dstBand="1">
<SourceFilename relativeToVRT="1">data/small_world.tif</SourceFilename>
<SourceBand>10</SourceBand>
</SpectralBand>
<SpectralBand dstBand="2">
<SourceFilename relativeToVRT="1">data/small_world.tif</SourceFilename>
<SourceBand>2</SourceBand>
</SpectralBand>
<SpectralBand dstBand="3">
<SourceFilename relativeToVRT="1">data/small_world.tif</SourceFilename>
<SourceBand>3</SourceBand>
</SpectralBand>
</PansharpeningOptions>
</VRTDataset>""")
gdal.PopErrorHandler()
if vrt_ds is not None:
gdaltest.post_reason('fail')
return 'fail'
# Another spectral band is already mapped to output band 1
gdal.PushErrorHandler()
vrt_ds = gdal.Open("""<VRTDataset rasterXSize="800" rasterYSize="400" subClass="VRTPansharpenedDataset">
<VRTRasterBand dataType="Byte" band="1" subClass="VRTPansharpenedRasterBand">
<ColorInterp>Red</ColorInterp>
</VRTRasterBand>
<VRTRasterBand dataType="Byte" band="2" subClass="VRTPansharpenedRasterBand">
<ColorInterp>Green</ColorInterp>
</VRTRasterBand>
<VRTRasterBand dataType="Byte" band="3" subClass="VRTPansharpenedRasterBand">
<ColorInterp>Blue</ColorInterp>
</VRTRasterBand>
<PansharpeningOptions>
<Algorithm>WeightedBrovey</Algorithm>
<AlgorithmOptions>
<Weights>0.33333,0.333333,0.333333</Weights>
</AlgorithmOptions>
<Resampling>Cubic</Resampling>
<NumThreads>ALL_CPUS</NumThreads>
<BitDepth>8</BitDepth>
<PanchroBand>
<SourceFilename relativeToVRT="1">tmp/small_world_pan.tif</SourceFilename>
<SourceBand>1</SourceBand>
</PanchroBand>
<SpectralBand dstBand="1">
<SourceFilename relativeToVRT="1">data/small_world.tif</SourceFilename>
<SourceBand>1</SourceBand>
</SpectralBand>
<SpectralBand dstBand="1">
<SourceFilename relativeToVRT="1">data/small_world.tif</SourceFilename>
<SourceBand>2</SourceBand>
</SpectralBand>
<SpectralBand dstBand="3">
<SourceFilename relativeToVRT="1">data/small_world.tif</SourceFilename>
<SourceBand>3</SourceBand>
</SpectralBand>
</PansharpeningOptions>
</VRTDataset>""")
gdal.PopErrorHandler()
if vrt_ds is not None:
gdaltest.post_reason('fail')
return 'fail'
# No spectral band defined
gdal.PushErrorHandler()
vrt_ds = gdal.Open("""<VRTDataset rasterXSize="800" rasterYSize="400" subClass="VRTPansharpenedDataset">
<VRTRasterBand dataType="Byte" band="1" subClass="VRTPansharpenedRasterBand">
<ColorInterp>Red</ColorInterp>
</VRTRasterBand>
<VRTRasterBand dataType="Byte" band="2" subClass="VRTPansharpenedRasterBand">
<ColorInterp>Green</ColorInterp>
</VRTRasterBand>
<VRTRasterBand dataType="Byte" band="3" subClass="VRTPansharpenedRasterBand">
<ColorInterp>Blue</ColorInterp>
</VRTRasterBand>
<PansharpeningOptions>
<Algorithm>WeightedBrovey</Algorithm>
<AlgorithmOptions>
<Weights>0.33333,0.333333,0.333333</Weights>
</AlgorithmOptions>
<Resampling>Cubic</Resampling>
<NumThreads>ALL_CPUS</NumThreads>
<BitDepth>8</BitDepth>
<PanchroBand>
<SourceFilename relativeToVRT="1">tmp/small_world_pan.tif</SourceFilename>
<SourceBand>1</SourceBand>
</PanchroBand>
</PansharpeningOptions>
</VRTDataset>""")
gdal.PopErrorHandler()
if vrt_ds is not None:
gdaltest.post_reason('fail')
return 'fail'
# Hole in SpectralBand.dstBand numbering
gdal.PushErrorHandler()
vrt_ds = gdal.Open("""<VRTDataset subClass="VRTPansharpenedDataset">
<PansharpeningOptions>
<Algorithm>WeightedBrovey</Algorithm>
<AlgorithmOptions>
<Weights>0.33333,0.333333,0.333333</Weights>
</AlgorithmOptions>
<Resampling>Cubic</Resampling>
<NumThreads>ALL_CPUS</NumThreads>
<BitDepth>8</BitDepth>
<PanchroBand>
<SourceFilename relativeToVRT="1">tmp/small_world_pan.tif</SourceFilename>
<SourceBand>1</SourceBand>
</PanchroBand>
<SpectralBand dstBand="1">
<SourceFilename relativeToVRT="1">data/small_world.tif</SourceFilename>
<SourceBand>1</SourceBand>
</SpectralBand>
<SpectralBand dstBand="2">
<SourceFilename relativeToVRT="1">data/small_world.tif</SourceFilename>
<SourceBand>2</SourceBand>
</SpectralBand>
<SpectralBand dstBand="4">
<SourceFilename relativeToVRT="1">data/small_world.tif</SourceFilename>
<SourceBand>3</SourceBand>
</SpectralBand>
</PansharpeningOptions>
</VRTDataset>""")
gdal.PopErrorHandler()
if vrt_ds is not None:
gdaltest.post_reason('fail')
return 'fail'
# Band 4 of type VRTPansharpenedRasterBand, but no corresponding SpectralBand
gdal.PushErrorHandler()
vrt_ds = gdal.Open("""<VRTDataset rasterXSize="800" rasterYSize="400" subClass="VRTPansharpenedDataset">
<VRTRasterBand dataType="Byte" band="1" subClass="VRTPansharpenedRasterBand">
<ColorInterp>Red</ColorInterp>
</VRTRasterBand>
<VRTRasterBand dataType="Byte" band="2" subClass="VRTPansharpenedRasterBand">
<ColorInterp>Green</ColorInterp>
</VRTRasterBand>
<VRTRasterBand dataType="Byte" band="3" subClass="VRTPansharpenedRasterBand">
<ColorInterp>Blue</ColorInterp>
</VRTRasterBand>
<VRTRasterBand dataType="Byte" band="4" subClass="VRTPansharpenedRasterBand">
</VRTRasterBand>
<PansharpeningOptions>
<Algorithm>WeightedBrovey</Algorithm>
<AlgorithmOptions>
<Weights>0.33333,0.333333,0.333333</Weights>
</AlgorithmOptions>
<Resampling>Cubic</Resampling>
<NumThreads>ALL_CPUS</NumThreads>
<BitDepth>8</BitDepth>
<PanchroBand>
<SourceFilename relativeToVRT="1">tmp/small_world_pan.tif</SourceFilename>
<SourceBand>1</SourceBand>
</PanchroBand>
<SpectralBand dstBand="1">
<SourceFilename relativeToVRT="1">data/small_world.tif</SourceFilename>
<SourceBand>1</SourceBand>
</SpectralBand>
<SpectralBand dstBand="2">
<SourceFilename relativeToVRT="1">data/small_world.tif</SourceFilename>
<SourceBand>2</SourceBand>
</SpectralBand>
<SpectralBand dstBand="3">
<SourceFilename relativeToVRT="1">data/small_world.tif</SourceFilename>
<SourceBand>3</SourceBand>
</SpectralBand>
</PansharpeningOptions>
</VRTDataset>""")
gdal.PopErrorHandler()
if vrt_ds is not None:
gdaltest.post_reason('fail')
return 'fail'
# SpectralBand.dstBand = '3' invalid
gdal.PushErrorHandler()
vrt_ds = gdal.Open("""<VRTDataset rasterXSize="800" rasterYSize="400" subClass="VRTPansharpenedDataset">
<VRTRasterBand dataType="Byte" band="1" subClass="VRTPansharpenedRasterBand">
<ColorInterp>Red</ColorInterp>
</VRTRasterBand>
<VRTRasterBand dataType="Byte" band="2" subClass="VRTPansharpenedRasterBand">
<ColorInterp>Green</ColorInterp>
</VRTRasterBand>
<PansharpeningOptions>
<Algorithm>WeightedBrovey</Algorithm>
<AlgorithmOptions>
<Weights>0.33333,0.333333,0.333333</Weights>
</AlgorithmOptions>
<Resampling>Cubic</Resampling>
<NumThreads>ALL_CPUS</NumThreads>
<BitDepth>8</BitDepth>
<PanchroBand>
<SourceFilename relativeToVRT="1">tmp/small_world_pan.tif</SourceFilename>
<SourceBand>1</SourceBand>
</PanchroBand>
<SpectralBand dstBand="1">
<SourceFilename relativeToVRT="1">data/small_world.tif</SourceFilename>
<SourceBand>1</SourceBand>
</SpectralBand>
<SpectralBand dstBand="2">
<SourceFilename relativeToVRT="1">data/small_world.tif</SourceFilename>
<SourceBand>2</SourceBand>
</SpectralBand>
<SpectralBand dstBand="3">
<SourceFilename relativeToVRT="1">data/small_world.tif</SourceFilename>
<SourceBand>3</SourceBand>
</SpectralBand>
</PansharpeningOptions>
</VRTDataset>""")
gdal.PopErrorHandler()
if vrt_ds is not None:
gdaltest.post_reason('fail')
return 'fail'
# 2 weights defined, but 3 input spectral bands
gdal.PushErrorHandler()
vrt_ds = gdal.Open("""<VRTDataset rasterXSize="800" rasterYSize="400" subClass="VRTPansharpenedDataset">
<VRTRasterBand dataType="Byte" band="1" subClass="VRTPansharpenedRasterBand">
<ColorInterp>Red</ColorInterp>
</VRTRasterBand>
<VRTRasterBand dataType="Byte" band="2" subClass="VRTPansharpenedRasterBand">
<ColorInterp>Green</ColorInterp>
</VRTRasterBand>
<VRTRasterBand dataType="Byte" band="3" subClass="VRTPansharpenedRasterBand">
<ColorInterp>Blue</ColorInterp>
</VRTRasterBand>
<PansharpeningOptions>
<Algorithm>WeightedBrovey</Algorithm>
<AlgorithmOptions>
<Weights>0.33333,0.333333</Weights>
</AlgorithmOptions>
<Resampling>Cubic</Resampling>
<NumThreads>ALL_CPUS</NumThreads>
<BitDepth>8</BitDepth>
<PanchroBand>
<SourceFilename relativeToVRT="1">tmp/small_world_pan.tif</SourceFilename>
<SourceBand>1</SourceBand>
</PanchroBand>
<SpectralBand dstBand="1">
<SourceFilename relativeToVRT="1">data/small_world.tif</SourceFilename>
<SourceBand>1</SourceBand>
</SpectralBand>
<SpectralBand dstBand="2">
<SourceFilename relativeToVRT="1">data/small_world.tif</SourceFilename>
<SourceBand>2</SourceBand>
</SpectralBand>
<SpectralBand dstBand="3">
<SourceFilename relativeToVRT="1">data/small_world.tif</SourceFilename>
<SourceBand>3</SourceBand>
</SpectralBand>
</PansharpeningOptions>
</VRTDataset>""")
gdal.PopErrorHandler()
if vrt_ds is not None:
gdaltest.post_reason('fail')
return 'fail'
# Dimensions of input spectral band 1 different from first spectral band
gdal.PushErrorHandler()
vrt_ds = gdal.Open("""<VRTDataset subClass="VRTPansharpenedDataset">
<PansharpeningOptions>
<PanchroBand>
<SourceFilename relativeToVRT="1">tmp/small_world_pan.tif</SourceFilename>
<SourceBand>1</SourceBand>
</PanchroBand>
<SpectralBand dstBand="1">
<SourceFilename relativeToVRT="1">data/small_world.tif</SourceFilename>
<SourceBand>1</SourceBand>
</SpectralBand>
<SpectralBand dstBand="2">
<SourceFilename relativeToVRT="1">tmp/small_world_pan.tif</SourceFilename>
<SourceBand>1</SourceBand>
</SpectralBand>
</PansharpeningOptions>
</VRTDataset>""")
gdal.PopErrorHandler()
if vrt_ds is not None:
gdaltest.post_reason('fail')
return 'fail'
# Just warnings
# Warning 1: Pan dataset and data/byte.tif do not seem to have same projection. Results might be incorrect
# Georeferencing of top-left corner of pan dataset and data/byte.tif do not match
# Georeferencing of bottom-right corner of pan dataset and data/byte.tif do not match
gdal.ErrorReset()
gdal.PushErrorHandler()
vrt_ds = gdal.Open("""<VRTDataset subClass="VRTPansharpenedDataset">
<PansharpeningOptions>
<SpatialExtentAdjustment>None</SpatialExtentAdjustment>
<PanchroBand>
<SourceFilename relativeToVRT="1">tmp/small_world_pan.tif</SourceFilename>
<SourceBand>1</SourceBand>
</PanchroBand>
<SpectralBand dstBand="1">
<SourceFilename relativeToVRT="1">data/byte.tif</SourceFilename>
<SourceBand>1</SourceBand>
</SpectralBand>
</PansharpeningOptions>
</VRTDataset>""")
gdal.PopErrorHandler()
if vrt_ds is None:
gdaltest.post_reason('fail')
return 'fail'
if gdal.GetLastErrorMsg() == '':
gdaltest.post_reason('fail')
return 'fail'
# Just warnings
# No spectral band is mapped to an output band
# No output pansharpened band defined
gdal.ErrorReset()
gdal.PushErrorHandler()
vrt_ds = gdal.Open("""<VRTDataset rasterXSize="800" rasterYSize="400" subClass="VRTPansharpenedDataset">
<PansharpeningOptions>
<Algorithm>WeightedBrovey</Algorithm>
<AlgorithmOptions>
<Weights>0.33333,0.333333,0.333333</Weights>
</AlgorithmOptions>
<Resampling>Cubic</Resampling>
<NumThreads>ALL_CPUS</NumThreads>
<BitDepth>8</BitDepth>
<PanchroBand>
<SourceFilename relativeToVRT="1">tmp/small_world_pan.tif</SourceFilename>
<SourceBand>1</SourceBand>
</PanchroBand>
<SpectralBand>
<SourceFilename relativeToVRT="1">data/small_world.tif</SourceFilename>
<SourceBand>1</SourceBand>
</SpectralBand>
<SpectralBand>
<SourceFilename relativeToVRT="1">data/small_world.tif</SourceFilename>
<SourceBand>2</SourceBand>
</SpectralBand>
<SpectralBand>
<SourceFilename relativeToVRT="1">data/small_world.tif</SourceFilename>
<SourceBand>3</SourceBand>
</SpectralBand>
</PansharpeningOptions>
</VRTDataset>""")
gdal.PopErrorHandler()
if vrt_ds is None:
gdaltest.post_reason('fail')
return 'fail'
if gdal.GetLastErrorMsg() == '':
gdaltest.post_reason('fail')
return 'fail'
# Unsupported
gdal.PushErrorHandler()
ret = vrt_ds.AddBand(gdal.GDT_Byte)
gdal.PopErrorHandler()
if ret == 0:
gdaltest.post_reason('fail')
return 'fail'
return 'success'
###############################################################################
# Nominal cases
def vrtpansharpen_2():
shutil.copy('data/small_world.tif', 'tmp/small_world.tif')
# Super verbose case
vrt_ds = gdal.Open("""<VRTDataset rasterXSize="800" rasterYSize="400" subClass="VRTPansharpenedDataset">
<SRS>GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433],AUTHORITY["EPSG","4326"]]</SRS>
<GeoTransform> -1.8000000000000000e+02, 4.5000000000000001e-01, 0.0000000000000000e+00, 9.0000000000000000e+01, 0.0000000000000000e+00, -4.5000000000000001e-01</GeoTransform>
<VRTRasterBand dataType="Byte" band="1" subClass="VRTPansharpenedRasterBand">
<ColorInterp>Red</ColorInterp>
</VRTRasterBand>
<VRTRasterBand dataType="Byte" band="2" subClass="VRTPansharpenedRasterBand">
<ColorInterp>Green</ColorInterp>
</VRTRasterBand>
<VRTRasterBand dataType="Byte" band="3" subClass="VRTPansharpenedRasterBand">
<ColorInterp>Blue</ColorInterp>
</VRTRasterBand>
<PansharpeningOptions>
<Algorithm>WeightedBrovey</Algorithm>
<AlgorithmOptions>
<Weights>0.33333333333333333,0.33333333333333333,0.33333333333333333</Weights>
</AlgorithmOptions>
<Resampling>Cubic</Resampling>
<NumThreads>ALL_CPUS</NumThreads>
<BitDepth>8</BitDepth>
<PanchroBand>
<SourceFilename relativeToVRT="1">tmp/small_world_pan.tif</SourceFilename>
<SourceBand>1</SourceBand>
</PanchroBand>
<SpectralBand dstBand="1">
<SourceFilename relativeToVRT="1">data/small_world.tif</SourceFilename>
<SourceBand>1</SourceBand>
</SpectralBand>
<SpectralBand dstBand="2">
<SourceFilename relativeToVRT="1">data/small_world.tif</SourceFilename>
<SourceBand>2</SourceBand>
</SpectralBand>
<SpectralBand dstBand="3">
<SourceFilename relativeToVRT="1">data/small_world.tif</SourceFilename>
<SourceBand>3</SourceBand>
</SpectralBand>
</PansharpeningOptions>
</VRTDataset>""")
if vrt_ds is None:
gdaltest.post_reason('fail')
return 'fail'
if vrt_ds.GetFileList() != [ 'tmp/small_world_pan.tif', 'data/small_world.tif' ]:
gdaltest.post_reason('fail')
print(vrt_ds.GetFileList())
return 'fail'
if vrt_ds.GetRasterBand(1).GetMetadataItem('NBITS', 'IMAGE_STRUCTURE') is not None:
gdaltest.post_reason('fail')
return 'fail'
cs = [ vrt_ds.GetRasterBand(i+1).Checksum() for i in range(vrt_ds.RasterCount) ]
if cs not in ( [4735, 10000, 9742], [4731, 9991, 9734] ):
gdaltest.post_reason('fail')
print(cs)
return 'fail'
if vrt_ds.GetRasterBand(1).GetOverviewCount() != 0:
gdaltest.post_reason('fail')
return 'fail'
if vrt_ds.GetRasterBand(1).GetOverview(-1) is not None:
gdaltest.post_reason('fail')
return 'fail'
if vrt_ds.GetRasterBand(1).GetOverview(0) is not None:
gdaltest.post_reason('fail')
return 'fail'
# Check VRTPansharpenedDataset::IRasterIO() in non-resampling case
data = vrt_ds.ReadRaster()
tmp_ds = gdal.GetDriverByName('MEM').Create('',800,400,3)
tmp_ds.WriteRaster(0,0,800,400,data)
cs = [ tmp_ds.GetRasterBand(i+1).Checksum() for i in range(tmp_ds.RasterCount) ]
if cs not in ( [4735, 10000, 9742], [4731, 9991, 9734] ):
gdaltest.post_reason('fail')
print(cs)
return 'fail'
# Check VRTPansharpenedDataset::IRasterIO() in resampling case
data = vrt_ds.ReadRaster(0,0,800,400,400,200)
ref_data = tmp_ds.ReadRaster(0,0,800,400,400,200)
if data != ref_data:
gdaltest.post_reason('fail')
return 'fail'
# Compact case
vrt_ds = gdal.Open("""<VRTDataset subClass="VRTPansharpenedDataset">
<PansharpeningOptions>
<PanchroBand>
<SourceFilename relativeToVRT="1">tmp/small_world_pan.tif</SourceFilename>
<SourceBand>1</SourceBand>
</PanchroBand>
<SpectralBand dstBand="1">
<SourceFilename relativeToVRT="1">data/small_world.tif</SourceFilename>
<SourceBand>1</SourceBand>
</SpectralBand>
<SpectralBand dstBand="2">
<SourceFilename relativeToVRT="1">data/small_world.tif</SourceFilename>
<SourceBand>2</SourceBand>
</SpectralBand>
<SpectralBand dstBand="3">
<SourceFilename relativeToVRT="1">data/small_world.tif</SourceFilename>
<SourceBand>3</SourceBand>
</SpectralBand>
</PansharpeningOptions>
</VRTDataset>""")
if vrt_ds is None:
gdaltest.post_reason('fail')
return 'fail'
cs = [ vrt_ds.GetRasterBand(i+1).Checksum() for i in range(vrt_ds.RasterCount) ]
if cs not in ( [4735, 10000, 9742], [4731, 9991, 9734] ):
gdaltest.post_reason('fail')
print(cs)
return 'fail'
# Expose pan band too
vrt_ds = gdal.Open("""<VRTDataset rasterXSize="800" rasterYSize="400" subClass="VRTPansharpenedDataset">
<SRS>GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433],AUTHORITY["EPSG","4326"]]</SRS>
<GeoTransform> -1.8000000000000000e+02, 4.5000000000000001e-01, 0.0000000000000000e+00, 9.0000000000000000e+01, 0.0000000000000000e+00, -4.5000000000000001e-01</GeoTransform>
<VRTRasterBand dataType="Byte" band="1">
<SimpleSource>
<SourceFilename relativeToVRT="1">tmp/small_world_pan.tif</SourceFilename>
<SourceBand>1</SourceBand>
</SimpleSource>
</VRTRasterBand>
<VRTRasterBand dataType="Byte" band="2" subClass="VRTPansharpenedRasterBand">
<ColorInterp>Red</ColorInterp>
</VRTRasterBand>
<VRTRasterBand dataType="Byte" band="3" subClass="VRTPansharpenedRasterBand">
<ColorInterp>Green</ColorInterp>
</VRTRasterBand>
<VRTRasterBand dataType="Byte" band="4" subClass="VRTPansharpenedRasterBand">
<ColorInterp>Blue</ColorInterp>
</VRTRasterBand>
<PansharpeningOptions>
<Algorithm>WeightedBrovey</Algorithm>
<AlgorithmOptions>
<Weights>0.33333333333333333,0.33333333333333333,0.33333333333333333</Weights>
</AlgorithmOptions>
<Resampling>Cubic</Resampling>
<NumThreads>ALL_CPUS</NumThreads>
<BitDepth>8</BitDepth>
<PanchroBand>
<SourceFilename relativeToVRT="1">tmp/small_world_pan.tif</SourceFilename>
<SourceBand>1</SourceBand>
</PanchroBand>
<SpectralBand dstBand="2">
<SourceFilename relativeToVRT="1">data/small_world.tif</SourceFilename>
<SourceBand>1</SourceBand>
</SpectralBand>
<SpectralBand dstBand="3">
<SourceFilename relativeToVRT="1">data/small_world.tif</SourceFilename>
<SourceBand>2</SourceBand>
</SpectralBand>
<SpectralBand dstBand="4">
<SourceFilename relativeToVRT="1">data/small_world.tif</SourceFilename>
<SourceBand>3</SourceBand>
</SpectralBand>
</PansharpeningOptions>
</VRTDataset>""")
if vrt_ds is None:
gdaltest.post_reason('fail')
return 'fail'
#gdal.GetDriverByName('GTiff').CreateCopy('out1.tif', vrt_ds)
cs = [ vrt_ds.GetRasterBand(i+1).Checksum() for i in range(vrt_ds.RasterCount) ]
if cs not in ( [50261, 4735, 10000, 9742], [50261, 4731, 9991, 9734]):
gdaltest.post_reason('fail')
print(cs)
return 'fail'
# Same, but everything scrambled, and with spectral bands not in
# the same dataset
vrt_ds = gdal.Open("""<VRTDataset rasterXSize="800" rasterYSize="400" subClass="VRTPansharpenedDataset">
<SRS>GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433],AUTHORITY["EPSG","4326"]]</SRS>
<GeoTransform> -1.8000000000000000e+02, 4.5000000000000001e-01, 0.0000000000000000e+00, 9.0000000000000000e+01, 0.0000000000000000e+00, -4.5000000000000001e-01</GeoTransform>
<VRTRasterBand dataType="Byte" band="1">
<SimpleSource>
<SourceFilename relativeToVRT="1">tmp/small_world_pan.tif</SourceFilename>
<SourceBand>1</SourceBand>
</SimpleSource>
</VRTRasterBand>
<VRTRasterBand dataType="Byte" band="2" subClass="VRTPansharpenedRasterBand">
<ColorInterp>Red</ColorInterp>
</VRTRasterBand>
<VRTRasterBand dataType="Byte" band="3" subClass="VRTPansharpenedRasterBand">
<ColorInterp>Green</ColorInterp>
</VRTRasterBand>
<VRTRasterBand dataType="Byte" band="4" subClass="VRTPansharpenedRasterBand">
<ColorInterp>Blue</ColorInterp>
</VRTRasterBand>
<PansharpeningOptions>
<Algorithm>WeightedBrovey</Algorithm>
<AlgorithmOptions>
<Weights>0.33333333333333333,0.33333333333333333,0.33333333333333333</Weights>
</AlgorithmOptions>
<Resampling>Cubic</Resampling>
<NumThreads>ALL_CPUS</NumThreads>
<BitDepth>8</BitDepth>
<PanchroBand>
<SourceFilename relativeToVRT="1">tmp/small_world_pan.tif</SourceFilename>
<SourceBand>1</SourceBand>
</PanchroBand>
<SpectralBand dstBand="3">
<SourceFilename relativeToVRT="1">data/small_world.tif</SourceFilename>
<SourceBand>2</SourceBand>
</SpectralBand>
<SpectralBand dstBand="2">
<SourceFilename relativeToVRT="1">data/small_world.tif</SourceFilename>
<SourceBand>1</SourceBand>
</SpectralBand>
<SpectralBand dstBand="4">
<SourceFilename relativeToVRT="1">tmp/small_world.tif</SourceFilename>
<SourceBand>3</SourceBand>
</SpectralBand>
</PansharpeningOptions>
</VRTDataset>""")
if vrt_ds is None:
gdaltest.post_reason('fail')
return 'fail'
#gdal.GetDriverByName('GTiff').CreateCopy('out2.tif', vrt_ds)
cs = [ vrt_ds.GetRasterBand(i+1).Checksum() for i in range(vrt_ds.RasterCount) ]
if cs not in ( [50261, 4735, 10000, 9742], [50261, 4727, 9998, 9732]):
gdaltest.post_reason('fail')
print(cs)
return 'fail'
return 'success'
###############################################################################
# Test with overviews
def vrtpansharpen_3():
ds = gdal.Open('tmp/small_world_pan.tif')
ds.BuildOverviews('CUBIC', [2])
ds = None
xml = """<VRTDataset subClass="VRTPansharpenedDataset">
<PansharpeningOptions>
<PanchroBand>
<SourceFilename relativeToVRT="1">tmp/small_world_pan.tif</SourceFilename>
<SourceBand>1</SourceBand>
</PanchroBand>
<SpectralBand dstBand="1">
<SourceFilename relativeToVRT="1">tmp/small_world.tif</SourceFilename>
<SourceBand>1</SourceBand>
</SpectralBand>
<SpectralBand dstBand="2">
<SourceFilename relativeToVRT="1">tmp/small_world.tif</SourceFilename>
<SourceBand>2</SourceBand>
</SpectralBand>
<SpectralBand dstBand="3">
<SourceFilename relativeToVRT="1">tmp/small_world.tif</SourceFilename>
<SourceBand>3</SourceBand>
</SpectralBand>
</PansharpeningOptions>
</VRTDataset>"""
# Test when only Pan band has overviews
vrt_ds = gdal.Open(xml)
if vrt_ds.GetRasterBand(1).GetOverviewCount() != 1:
gdaltest.post_reason('fail')
return 'fail'
if vrt_ds.GetRasterBand(1).GetOverview(0) is None:
gdaltest.post_reason('fail')
return 'fail'
cs = [ vrt_ds.GetRasterBand(i+1).GetOverview(0).Checksum() for i in range(vrt_ds.RasterCount) ]
if cs not in ( [7123,7445,5025], [7120, 7440, 5025]):
gdaltest.post_reason('fail')
print(cs)
return 'fail'
# Check VRTPansharpenedDataset::IRasterIO() in resampling case with overviews
data = vrt_ds.ReadRaster(0,0,800,400,400,200)
data2 = vrt_ds.GetRasterBand(1).ReadRaster(0,0,800,400,400,200)
data2 += vrt_ds.GetRasterBand(2).ReadRaster(0,0,800,400,400,200)
data2 += vrt_ds.GetRasterBand(3).ReadRaster(0,0,800,400,400,200)
if data != data2:
gdaltest.post_reason('fail')
return 'fail'
tmp_ds = gdal.GetDriverByName('MEM').Create('',400,200,3)
tmp_ds.WriteRaster(0,0,400,200,data)
cs = [ tmp_ds.GetRasterBand(i+1).Checksum() for i in range(tmp_ds.RasterCount) ]
if cs not in ( [7123,7445,5025], [7120, 7440, 5025]):
gdaltest.post_reason('fail')
print(cs)
return 'fail'
vrt_ds = None
ds = gdal.Open('tmp/small_world.tif')
ds.BuildOverviews('CUBIC', [2])
ds = None
# Test when both Pan and spectral bands have overviews
vrt_ds = gdal.Open(xml)
if vrt_ds.GetRasterBand(1).GetOverviewCount() != 1:
gdaltest.post_reason('fail')
return 'fail'
if vrt_ds.GetRasterBand(1).GetOverview(0) is None:
gdaltest.post_reason('fail')
return 'fail'
cs = [ vrt_ds.GetRasterBand(i+1).GetOverview(0).Checksum() for i in range(vrt_ds.RasterCount) ]
if cs not in ( [18033, 18395, 16824], [18033, 18395, 16822]):
gdaltest.post_reason('fail')
print(cs)
return 'fail'
vrt_ds = None
return 'success'
###############################################################################
# Test RasterIO() with various buffer datatypes
def vrtpansharpen_4():
xml = """<VRTDataset subClass="VRTPansharpenedDataset">
<PansharpeningOptions>
<PanchroBand>
<SourceFilename relativeToVRT="1">tmp/small_world_pan.tif</SourceFilename>
<SourceBand>1</SourceBand>
</PanchroBand>
<SpectralBand dstBand="1">
<SourceFilename relativeToVRT="1">tmp/small_world.tif</SourceFilename>
<SourceBand>1</SourceBand>
</SpectralBand>
<SpectralBand dstBand="2">
<SourceFilename relativeToVRT="1">tmp/small_world.tif</SourceFilename>
<SourceBand>2</SourceBand>
</SpectralBand>
<SpectralBand dstBand="3">
<SourceFilename relativeToVRT="1">tmp/small_world.tif</SourceFilename>
<SourceBand>3</SourceBand>
</SpectralBand>
</PansharpeningOptions>
</VRTDataset>"""
vrt_ds = gdal.Open(xml)
for dt in [ gdal.GDT_Int16, gdal.GDT_UInt16, gdal.GDT_Int32, gdal.GDT_UInt32, gdal.GDT_Float32, gdal.GDT_Float64, gdal.GDT_CFloat64 ]:
data = vrt_ds.GetRasterBand(1).ReadRaster(buf_type = dt)
tmp_ds = gdal.GetDriverByName('MEM').Create('',800,400,1,dt)
tmp_ds.WriteRaster(0,0,800,400,data)
cs = tmp_ds.GetRasterBand(1).Checksum()
if dt == gdal.GDT_CFloat64:
expected_cs = [4724, 4720]
else:
expected_cs = [4735, 4731]
if cs not in expected_cs:
gdaltest.post_reason('fail')
print(gdal.GetDataTypeName(dt))
print(cs)
return 'fail'
return 'success'
###############################################################################
# Test RasterIO() with various band datatypes
def vrtpansharpen_5():
for dt in [ gdal.GDT_Int16, gdal.GDT_UInt16, gdal.GDT_Int32, gdal.GDT_UInt32, gdal.GDT_Float32, gdal.GDT_Float64, gdal.GDT_CFloat64 ]:
spectral_xml = """<VRTDataset rasterXSize="400" rasterYSize="200">
<SRS>GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433],AUTHORITY["EPSG","4326"]]</SRS>
<GeoTransform> -1.8000000000000000e+02, 9.0000000000000002e-01, 0.0000000000000000e+00, 9.0000000000000000e+01, 0.0000000000000000e+00, -9.0000000000000002e-01</GeoTransform>
<VRTRasterBand dataType="%s" band="1">
<ColorInterp>Red</ColorInterp>
<SimpleSource>
<SourceFilename relativeToVRT="0">data/small_world.tif</SourceFilename>
<SourceBand>1</SourceBand>
</SimpleSource>
</VRTRasterBand>
<VRTRasterBand dataType="%s" band="2">
<ColorInterp>Green</ColorInterp>
<SimpleSource>
<SourceFilename relativeToVRT="0">data/small_world.tif</SourceFilename>
<SourceBand>2</SourceBand>
</SimpleSource>
</VRTRasterBand>
<VRTRasterBand dataType="%s" band="3">
<ColorInterp>Blue</ColorInterp>
<SimpleSource>
<SourceFilename relativeToVRT="0">data/small_world.tif</SourceFilename>
<SourceBand>3</SourceBand>
</SimpleSource>
</VRTRasterBand>
</VRTDataset>""" % (gdal.GetDataTypeName(dt), gdal.GetDataTypeName(dt), gdal.GetDataTypeName(dt))
xml = """<VRTDataset subClass="VRTPansharpenedDataset">
<PansharpeningOptions>
<PanchroBand>
<SourceFilename relativeToVRT="1"><![CDATA[<VRTDataset rasterXSize="800" rasterYSize="400">
<SRS>GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433],AUTHORITY["EPSG","4326"]]</SRS>
<GeoTransform> -1.8000000000000000e+02, 4.5000000000000001e-01, 0.0000000000000000e+00, 9.0000000000000000e+01, 0.0000000000000000e+00, -4.5000000000000001e-01</GeoTransform>
<VRTRasterBand dataType="%s" band="1">
<SimpleSource>
<SourceFilename relativeToVRT="1">tmp/small_world_pan.tif</SourceFilename>
<SourceBand>1</SourceBand>
</SimpleSource>
</VRTRasterBand>
</VRTDataset>]]></SourceFilename>
<SourceBand>1</SourceBand>
</PanchroBand>
<SpectralBand dstBand="1">
<SourceFilename relativeToVRT="1"><![CDATA[%s]]></SourceFilename>
<SourceBand>1</SourceBand>
</SpectralBand>
<SpectralBand dstBand="2">
<SourceFilename relativeToVRT="1"><![CDATA[%s]]></SourceFilename>
<SourceBand>2</SourceBand>
</SpectralBand>
<SpectralBand dstBand="3">
<SourceFilename relativeToVRT="1"><![CDATA[%s]]></SourceFilename>
<SourceBand>3</SourceBand>
</SpectralBand>
</PansharpeningOptions>
</VRTDataset>""" % (gdal.GetDataTypeName(dt), spectral_xml, spectral_xml, spectral_xml)
vrt_ds = gdal.Open(xml)
data = vrt_ds.GetRasterBand(1).ReadRaster(buf_type = gdal.GDT_Byte)
tmp_ds = gdal.GetDriverByName('MEM').Create('',800,400,1)
tmp_ds.WriteRaster(0,0,800,400,data)
cs = tmp_ds.GetRasterBand(1).Checksum()
if dt == gdal.GDT_UInt16:
if cs not in ( 4553, 4549 ):
gdaltest.post_reason('fail')
print(gdal.GetDataTypeName(dt))
print(cs)
return 'fail'
else:
if cs != 4450:
gdaltest.post_reason('fail')
print(gdal.GetDataTypeName(dt))
print(cs)
return 'fail'
return 'success'
###############################################################################
# Test BitDepth limitations
def vrtpansharpen_6():
try:
from osgeo import gdalnumeric
gdalnumeric.zeros
import numpy
except:
return 'skip'
# i = 0: VRT has <BitDepth>7</BitDepth>
# i = 1: bands have NBITS=7 and VRT <BitDepth>7</BitDepth>
# i = 2: bands have NBITS=7
for dt in [ gdal.GDT_Byte, gdal.GDT_UInt16 ]:
if dt == gdal.GDT_Byte:
nbits = 7
elif dt == gdal.GDT_UInt16:
nbits = 12
else:
nbits = 17
for i in range(3):
if i > 0:
options = ['NBITS=%d' % nbits]
else:
options = []
mem_ds = gdal.GetDriverByName('GTiff').Create('/vsimem/ms.tif', 4, 1, 1, dt, options = options)
ar = numpy.array([[80,125,125,80]])
if dt == gdal.GDT_UInt16:
ar = ar << (12-7)
elif dt == gdal.GDT_UInt32:
ar = ar << (17-7)
mem_ds.GetRasterBand(1).WriteArray(ar)
mem_ds = None
mem_ds = gdal.GetDriverByName('GTiff').Create('/vsimem/pan.tif', 8, 2, 1, dt, options = options)
ar = numpy.array([[ 76, 89, 115, 127, 127, 115, 89, 76],
[ 76, 89, 115, 127, 127, 115, 89, 76]])
if dt == gdal.GDT_UInt16:
ar = ar << (12-7)
elif dt == gdal.GDT_UInt32:
ar = ar << (17-7)
mem_ds.GetRasterBand(1).WriteArray(ar)
mem_ds = None
xml = """<VRTDataset subClass="VRTPansharpenedDataset">
<PansharpeningOptions>"""
if i < 2:
xml += """ <BitDepth>%d</BitDepth>""" % nbits
xml += """ <AlgorithmOptions><Weights>0.8</Weights></AlgorithmOptions>
<PanchroBand>
<SourceFilename>/vsimem/pan.tif</SourceFilename>
<SourceBand>1</SourceBand>
</PanchroBand>
<SpectralBand dstBand="1">
<SourceFilename>/vsimem/ms.tif</SourceFilename>
<SourceBand>1</SourceBand>
</SpectralBand>
</PansharpeningOptions>
</VRTDataset>"""
vrt_ds = gdal.Open(xml)
if vrt_ds.GetRasterBand(1).GetMetadataItem('NBITS', 'IMAGE_STRUCTURE') != str(nbits):
gdaltest.post_reason('fail')
return 'fail'
ar = vrt_ds.GetRasterBand(1).ReadAsArray()
if dt == gdal.GDT_Byte:
expected_ar = [95, 111, 127, 127, 127, 127, 111, 95]
elif dt == gdal.GDT_UInt16:
expected_ar = [3040, 3560, 4095, 4095, 4095, 4095, 3560, 3040]
else:
expected_ar = [97280, 113920, 131071, 131071, 131071, 131071, 113920, 97280]
if list(ar[0]) != expected_ar:
gdaltest.post_reason('fail')
print(gdal.GetDataTypeName(dt))
print(i)
print(list(ar[0]))
return 'fail'
vrt_ds = None
gdal.Unlink('/vsimem/ms.tif')
gdal.Unlink('/vsimem/pan.tif')
return 'success'
###############################################################################
# Test bands with different extents
def vrtpansharpen_7():
ds = gdal.GetDriverByName('GTiff').Create('/vsimem/vrtpansharpen_7_pan.tif', 20, 40 )
ds.SetGeoTransform([120,1,0,80,0,-1])
ds = None
ds = gdal.GetDriverByName('GTiff').Create('/vsimem/vrtpansharpen_7_ms.tif', 15, 30 )
ds.SetGeoTransform([100,2,0,100,0,-2])
ds = None
xml = """<VRTDataset subClass="VRTPansharpenedDataset">
<PansharpeningOptions>
<PanchroBand>
<SourceFilename>/vsimem/vrtpansharpen_7_pan.tif</SourceFilename>
</PanchroBand>
<SpectralBand dstBand="1">
<SourceFilename>/vsimem/vrtpansharpen_7_ms.tif</SourceFilename>
</SpectralBand>
</PansharpeningOptions>
</VRTDataset>"""
ds = gdal.Open(xml)
if ds.GetGeoTransform() != (100.0, 1.0, 0.0, 100.0, 0.0, -1.0) or ds.RasterXSize != 40 or ds.RasterYSize != 60:
gdaltest.post_reason('fail')
print(ds.GetGeoTransform())
print(ds.RasterXSize)
print(ds.RasterYSize)
return 'fail'
ds = None
xml = """<VRTDataset subClass="VRTPansharpenedDataset">
<PansharpeningOptions>
<SpatialExtentAdjustment>Union</SpatialExtentAdjustment>
<PanchroBand>
<SourceFilename>/vsimem/vrtpansharpen_7_pan.tif</SourceFilename>
</PanchroBand>
<SpectralBand dstBand="1">
<SourceFilename>/vsimem/vrtpansharpen_7_ms.tif</SourceFilename>
</SpectralBand>
</PansharpeningOptions>
</VRTDataset>"""
ds = gdal.Open(xml)
if ds.GetGeoTransform() != (100.0, 1.0, 0.0, 100.0, 0.0, -1.0) or ds.RasterXSize != 40 or ds.RasterYSize != 60:
gdaltest.post_reason('fail')
print(ds.GetGeoTransform())
print(ds.RasterXSize)
print(ds.RasterYSize)
return 'fail'
ds = None
xml = """<VRTDataset subClass="VRTPansharpenedDataset">
<PansharpeningOptions>
<SpatialExtentAdjustment>BlaBla</SpatialExtentAdjustment>
<PanchroBand>
<SourceFilename>/vsimem/vrtpansharpen_7_pan.tif</SourceFilename>
</PanchroBand>
<SpectralBand dstBand="1">
<SourceFilename>/vsimem/vrtpansharpen_7_ms.tif</SourceFilename>
</SpectralBand>
</PansharpeningOptions>
</VRTDataset>"""
gdal.ErrorReset()
gdal.PushErrorHandler()
ds = gdal.Open(xml)
gdal.PopErrorHandler()
if ds.GetGeoTransform() != (100.0, 1.0, 0.0, 100.0, 0.0, -1.0) or ds.RasterXSize != 40 or ds.RasterYSize != 60:
gdaltest.post_reason('fail')
print(ds.GetGeoTransform())
print(ds.RasterXSize)
print(ds.RasterYSize)
return 'fail'
if gdal.GetLastErrorMsg() != '':
gdaltest.post_reason('fail')
return 'fail'
ds = None
xml = """<VRTDataset subClass="VRTPansharpenedDataset">
<PansharpeningOptions>
<SpatialExtentAdjustment>Intersection</SpatialExtentAdjustment>
<PanchroBand>
<SourceFilename>/vsimem/vrtpansharpen_7_pan.tif</SourceFilename>
</PanchroBand>
<SpectralBand dstBand="1">
<SourceFilename>/vsimem/vrtpansharpen_7_ms.tif</SourceFilename>
</SpectralBand>
</PansharpeningOptions>
</VRTDataset>"""
ds = gdal.Open(xml)
if ds.GetGeoTransform() != (120.0, 1.0, 0.0, 80.0, 0.0, -1.0) or ds.RasterXSize != 10 or ds.RasterYSize != 40:
gdaltest.post_reason('fail')
print(ds.GetGeoTransform())
print(ds.RasterXSize)
print(ds.RasterYSize)
return 'fail'
ds = None
xml = """<VRTDataset subClass="VRTPansharpenedDataset">
<PansharpeningOptions>
<SpatialExtentAdjustment>None</SpatialExtentAdjustment>
<PanchroBand>
<SourceFilename>/vsimem/vrtpansharpen_7_pan.tif</SourceFilename>
</PanchroBand>
<SpectralBand dstBand="1">
<SourceFilename>/vsimem/vrtpansharpen_7_ms.tif</SourceFilename>
</SpectralBand>
</PansharpeningOptions>
</VRTDataset>"""
gdal.ErrorReset()
gdal.PushErrorHandler()
ds = gdal.Open(xml)
gdal.PopErrorHandler()
if ds.GetGeoTransform() != (120.0, 1.0, 0.0, 80.0, 0.0, -1.0) or ds.RasterXSize != 20 or ds.RasterYSize != 40:
gdaltest.post_reason('fail')
print(ds.GetGeoTransform())
print(ds.RasterXSize)
print(ds.RasterYSize)
return 'fail'
if gdal.GetLastErrorMsg() == '':
gdaltest.post_reason('fail')
return 'fail'
ds = None
xml = """<VRTDataset subClass="VRTPansharpenedDataset">
<PansharpeningOptions>
<SpatialExtentAdjustment>NoneWithoutWarning</SpatialExtentAdjustment>
<PanchroBand>
<SourceFilename>/vsimem/vrtpansharpen_7_pan.tif</SourceFilename>
</PanchroBand>
<SpectralBand dstBand="1">
<SourceFilename>/vsimem/vrtpansharpen_7_ms.tif</SourceFilename>
</SpectralBand>
</PansharpeningOptions>
</VRTDataset>"""
gdal.ErrorReset()
ds = gdal.Open(xml)
if ds.GetGeoTransform() != (120.0, 1.0, 0.0, 80.0, 0.0, -1.0) or ds.RasterXSize != 20 or ds.RasterYSize != 40:
gdaltest.post_reason('fail')
print(ds.GetGeoTransform())
print(ds.RasterXSize)
print(ds.RasterYSize)
return 'fail'
if gdal.GetLastErrorMsg() != '':
gdaltest.post_reason('fail')
return 'fail'
ds = None
# Empty intersection
ds = gdal.GetDriverByName('GTiff').Create('/vsimem/vrtpansharpen_7_ms.tif', 15, 30 )
ds.SetGeoTransform([-100,2,0,-100,0,-2])
ds = None
xml = """<VRTDataset subClass="VRTPansharpenedDataset">
<PansharpeningOptions>
<SpatialExtentAdjustment>Intersection</SpatialExtentAdjustment>
<PanchroBand>
<SourceFilename>/vsimem/vrtpansharpen_7_pan.tif</SourceFilename>
</PanchroBand>
<SpectralBand dstBand="1">
<SourceFilename>/vsimem/vrtpansharpen_7_ms.tif</SourceFilename>
</SpectralBand>
</PansharpeningOptions>
</VRTDataset>"""
gdal.PushErrorHandler()
ds = gdal.Open(xml)
gdal.PopErrorHandler()
if ds is not None:
gdaltest.post_reason('fail')
return 'fail'
ds = None
gdal.GetDriverByName('GTiff').Delete('/vsimem/vrtpansharpen_7_pan.tif')
gdal.GetDriverByName('GTiff').Delete('/vsimem/vrtpansharpen_7_ms.tif')
return 'success'
###############################################################################
# Test SerializeToXML()
def vrtpansharpen_8():
xml = """<VRTDataset subClass="VRTPansharpenedDataset">
<VRTRasterBand dataType="Byte" band="1" subClass="VRTPansharpenedRasterBand">
</VRTRasterBand>
<VRTRasterBand dataType="Byte" band="2">
</VRTRasterBand>
<VRTRasterBand dataType="Byte" band="3" subClass="VRTPansharpenedRasterBand">
</VRTRasterBand>
<NoData>123</NoData>
<PansharpeningOptions>
<PanchroBand>
<SourceFilename relativeToVRT="1">small_world_pan.tif</SourceFilename>
</PanchroBand>
<SpectralBand dstBand="3">
<SourceFilename>data/small_world.tif</SourceFilename>
</SpectralBand>
<SpectralBand dstBand="1">
<SourceFilename>data/small_world.tif</SourceFilename>
<SourceBand>2</SourceBand>
</SpectralBand>
</PansharpeningOptions>
</VRTDataset>"""
open('tmp/vrtpansharpen_8.vrt', 'wt').write(xml)
ds = gdal.Open('tmp/vrtpansharpen_8.vrt', gdal.GA_Update)
expected_cs1 = ds.GetRasterBand(1).Checksum()
expected_cs2 = ds.GetRasterBand(2).Checksum()
expected_cs3 = ds.GetRasterBand(3).Checksum()
# Force update
ds.SetMetadata(ds.GetMetadata())
ds = None
ds = gdal.Open('tmp/vrtpansharpen_8.vrt')
cs1 = ds.GetRasterBand(1).Checksum()
cs2 = ds.GetRasterBand(2).Checksum()
cs3 = ds.GetRasterBand(3).Checksum()
ds = None
gdal.Unlink('tmp/vrtpansharpen_8.vrt')
if cs1 != expected_cs1 or cs2 != expected_cs2 or cs3 != expected_cs3:
gdaltest.post_reason('fail')
print(cs1)
print(expected_cs1)
print(cs2)
print(expected_cs2)
print(cs3)
print(expected_cs3)
return 'fail'
return 'success'
###############################################################################
# Test NoData support
def vrtpansharpen_9():
# Explicit nodata
vrt_ds = gdal.Open("""<VRTDataset subClass="VRTPansharpenedDataset">
<PansharpeningOptions>
<NoData>0</NoData>
<PanchroBand>
<SourceFilename relativeToVRT="1">tmp/small_world_pan.tif</SourceFilename>
<SourceBand>1</SourceBand>
</PanchroBand>
<SpectralBand dstBand="1">
<SourceFilename relativeToVRT="1">data/small_world.tif</SourceFilename>
<SourceBand>1</SourceBand>
</SpectralBand>
<SpectralBand dstBand="2">
<SourceFilename relativeToVRT="1">data/small_world.tif</SourceFilename>
<SourceBand>2</SourceBand>
</SpectralBand>
<SpectralBand dstBand="3">
<SourceFilename relativeToVRT="1">data/small_world.tif</SourceFilename>
<SourceBand>3</SourceBand>
</SpectralBand>
</PansharpeningOptions>
</VRTDataset>""")
if vrt_ds is None:
gdaltest.post_reason('fail')
return 'fail'
cs = [ vrt_ds.GetRasterBand(i+1).Checksum() for i in range(vrt_ds.RasterCount) ]
if cs not in( [4179, 8767, 52257], [4175, 8758, 52249]):
gdaltest.post_reason('fail')
print(cs)
return 'fail'
# Implicit nodata
ds = gdal.GetDriverByName('GTiff').Create('/vsimem/small_world_pan_nodata.tif', 800, 400)
ds.GetRasterBand(1).SetNoDataValue(0)
ds.WriteRaster(0,0,800,400,gdal.Open('tmp/small_world_pan.tif').ReadRaster())
ds = None
ds = gdal.GetDriverByName('GTiff').Create('/vsimem/small_world_nodata.tif', 400, 200,3)
ds.GetRasterBand(1).SetNoDataValue(0)
ds.GetRasterBand(2).SetNoDataValue(0)
ds.GetRasterBand(3).SetNoDataValue(0)
ds.WriteRaster(0,0,400,200,gdal.Open('data/small_world.tif').ReadRaster())
ds = None
vrt_ds = gdal.Open("""<VRTDataset subClass="VRTPansharpenedDataset">
<PansharpeningOptions>
<PanchroBand>
<SourceFilename>/vsimem/small_world_pan_nodata.tif</SourceFilename>
<SourceBand>1</SourceBand>
</PanchroBand>
<SpectralBand dstBand="1">
<SourceFilename>/vsimem/small_world_nodata.tif</SourceFilename>
<SourceBand>1</SourceBand>
</SpectralBand>
<SpectralBand dstBand="2">
<SourceFilename>/vsimem/small_world_nodata.tif</SourceFilename>
<SourceBand>2</SourceBand>
</SpectralBand>
<SpectralBand dstBand="3">
<SourceFilename>/vsimem/small_world_nodata.tif</SourceFilename>
<SourceBand>3</SourceBand>
</SpectralBand>
</PansharpeningOptions>
</VRTDataset>""")
if vrt_ds is None:
gdaltest.post_reason('fail')
return 'fail'
cs = [ vrt_ds.GetRasterBand(i+1).Checksum() for i in range(vrt_ds.RasterCount) ]
if cs not in( [4179, 8767, 52257], [4175, 8758, 52249]):
gdaltest.post_reason('fail')
print(cs)
return 'fail'
return 'success'
###############################################################################
# Test UInt16 optimizations
def vrtpansharpen_10():
ds = gdal.GetDriverByName('GTiff').Create('/vsimem/pan.tif',1023,1023,1,gdal.GDT_UInt16)
ds.GetRasterBand(1).Fill(1000)
ds = None
ds = gdal.GetDriverByName('GTiff').Create('/vsimem/ms.tif',256,256,4,gdal.GDT_UInt16)
for i in range(4):
ds.GetRasterBand(i+1).Fill(1000)
ds = None
# 4 bands
vrt_ds = gdal.Open("""<VRTDataset subClass="VRTPansharpenedDataset">
<PansharpeningOptions>
<NumThreads>ALL_CPUS</NumThreads>
<PanchroBand>
<SourceFilename relativeToVRT="1">/vsimem/pan.tif</SourceFilename>
<SourceBand>1</SourceBand>
</PanchroBand>
<SpectralBand dstBand="1">
<SourceFilename relativeToVRT="1">/vsimem/ms.tif</SourceFilename>
<SourceBand>1</SourceBand>
</SpectralBand>
<SpectralBand dstBand="2">
<SourceFilename relativeToVRT="1">/vsimem/ms.tif</SourceFilename>
<SourceBand>2</SourceBand>
</SpectralBand>
<SpectralBand dstBand="3">
<SourceFilename relativeToVRT="1">/vsimem/ms.tif</SourceFilename>
<SourceBand>3</SourceBand>
</SpectralBand>
<SpectralBand dstBand="4">
<SourceFilename relativeToVRT="1">/vsimem/ms.tif</SourceFilename>
<SourceBand>4</SourceBand>
</SpectralBand>
</PansharpeningOptions>
</VRTDataset>""")
cs = [ vrt_ds.GetRasterBand(i+1).Checksum() for i in range(vrt_ds.RasterCount) ]
if cs != [62009, 62009, 62009, 62009]:
gdaltest.post_reason('fail')
print(cs)
return 'fail'
# Actually go through the optimized impl
data = vrt_ds.ReadRaster()
# And check
data_int32 = vrt_ds.ReadRaster(buf_type = gdal.GDT_Int32)
tmp_ds = gdal.GetDriverByName('MEM').Create('', vrt_ds.RasterXSize, vrt_ds.RasterYSize, vrt_ds.RasterCount, gdal.GDT_Int32)
tmp_ds.WriteRaster(0, 0, vrt_ds.RasterXSize, vrt_ds.RasterYSize, data_int32)
ref_data = tmp_ds.ReadRaster(buf_type = gdal.GDT_UInt16)
if data != ref_data:
gdaltest.post_reason('fail')
return 'fail'
# 4 bands -> 3 bands
vrt_ds = gdal.Open("""<VRTDataset subClass="VRTPansharpenedDataset">
<PansharpeningOptions>
<NumThreads>ALL_CPUS</NumThreads>
<PanchroBand>
<SourceFilename relativeToVRT="1">/vsimem/pan.tif</SourceFilename>
<SourceBand>1</SourceBand>
</PanchroBand>
<SpectralBand dstBand="1">
<SourceFilename relativeToVRT="1">/vsimem/ms.tif</SourceFilename>
<SourceBand>1</SourceBand>
</SpectralBand>
<SpectralBand dstBand="2">
<SourceFilename relativeToVRT="1">/vsimem/ms.tif</SourceFilename>
<SourceBand>2</SourceBand>
</SpectralBand>
<SpectralBand dstBand="3">
<SourceFilename relativeToVRT="1">/vsimem/ms.tif</SourceFilename>
<SourceBand>3</SourceBand>
</SpectralBand>
<SpectralBand>
<SourceFilename relativeToVRT="1">/vsimem/ms.tif</SourceFilename>
<SourceBand>4</SourceBand>
</SpectralBand>
</PansharpeningOptions>
</VRTDataset>""")
cs = [ vrt_ds.GetRasterBand(i+1).Checksum() for i in range(vrt_ds.RasterCount) ]
if cs != [62009, 62009, 62009]:
gdaltest.post_reason('fail')
print(cs)
return 'fail'
# Actually go through the optimized impl
data = vrt_ds.ReadRaster()
# And check
data_int32 = vrt_ds.ReadRaster(buf_type = gdal.GDT_Int32)
tmp_ds = gdal.GetDriverByName('MEM').Create('', vrt_ds.RasterXSize, vrt_ds.RasterYSize, vrt_ds.RasterCount, gdal.GDT_Int32)
tmp_ds.WriteRaster(0, 0, vrt_ds.RasterXSize, vrt_ds.RasterYSize, data_int32)
ref_data = tmp_ds.ReadRaster(buf_type = gdal.GDT_UInt16)
if data != ref_data:
gdaltest.post_reason('fail')
return 'fail'
# 3 bands
vrt_ds = gdal.Open("""<VRTDataset subClass="VRTPansharpenedDataset">
<PansharpeningOptions>
<NumThreads>ALL_CPUS</NumThreads>
<PanchroBand>
<SourceFilename relativeToVRT="1">/vsimem/pan.tif</SourceFilename>
<SourceBand>1</SourceBand>
</PanchroBand>
<SpectralBand dstBand="1">
<SourceFilename relativeToVRT="1">/vsimem/ms.tif</SourceFilename>
<SourceBand>1</SourceBand>
</SpectralBand>
<SpectralBand dstBand="2">
<SourceFilename relativeToVRT="1">/vsimem/ms.tif</SourceFilename>
<SourceBand>2</SourceBand>
</SpectralBand>
<SpectralBand dstBand="3">
<SourceFilename relativeToVRT="1">/vsimem/ms.tif</SourceFilename>
<SourceBand>3</SourceBand>
</SpectralBand>
</PansharpeningOptions>
</VRTDataset>""")
cs = [ vrt_ds.GetRasterBand(i+1).Checksum() for i in range(vrt_ds.RasterCount) ]
if cs != [62009, 62009, 62009]:
gdaltest.post_reason('fail')
print(cs)
return 'fail'
# Actually go through the optimized impl
data = vrt_ds.ReadRaster()
# And check
data_int32 = vrt_ds.ReadRaster(buf_type = gdal.GDT_Int32)
tmp_ds = gdal.GetDriverByName('MEM').Create('', vrt_ds.RasterXSize, vrt_ds.RasterYSize, vrt_ds.RasterCount, gdal.GDT_Int32)
tmp_ds.WriteRaster(0, 0, vrt_ds.RasterXSize, vrt_ds.RasterYSize, data_int32)
ref_data = tmp_ds.ReadRaster(buf_type = gdal.GDT_UInt16)
if data != ref_data:
gdaltest.post_reason('fail')
return 'fail'
return 'success'
###############################################################################
# Test gdal.CreatePansharpenedVRT()
def vrtpansharpen_11():
pan_ds = gdal.Open('tmp/small_world_pan.tif')
ms_ds = gdal.Open('data/small_world.tif')
vrt_ds = gdal.CreatePansharpenedVRT("""<VRTDataset subClass="VRTPansharpenedDataset">
<PansharpeningOptions>
<SpectralBand dstBand="1">
</SpectralBand>
<SpectralBand dstBand="2">
</SpectralBand>
<SpectralBand dstBand="3">
</SpectralBand>
</PansharpeningOptions>
</VRTDataset>""", pan_ds.GetRasterBand(1), [ ms_ds.GetRasterBand(i+1) for i in range(3)] )
if vrt_ds is None:
gdaltest.post_reason('fail')
return 'fail'
cs = [ vrt_ds.GetRasterBand(i+1).Checksum() for i in range(vrt_ds.RasterCount) ]
if cs not in( [4735, 10000, 9742], [4731, 9991, 9734]):
gdaltest.post_reason('fail')
print(cs)
return 'fail'
# Also test with completely anonymous datasets
pan_mem_ds = gdal.GetDriverByName('MEM').CreateCopy('', pan_ds)
ms_mem_ds = gdal.GetDriverByName('MEM').CreateCopy('', ms_ds)
pan_ds = None
ms_ds = None
vrt_ds = gdal.CreatePansharpenedVRT("""<VRTDataset subClass="VRTPansharpenedDataset">
<PansharpeningOptions>
<SpectralBand dstBand="1">
</SpectralBand>
<SpectralBand dstBand="2">
</SpectralBand>
<SpectralBand dstBand="3">
</SpectralBand>
</PansharpeningOptions>
</VRTDataset>""", pan_mem_ds.GetRasterBand(1), [ ms_mem_ds.GetRasterBand(i+1) for i in range(3)] )
if vrt_ds is None:
gdaltest.post_reason('fail')
return 'fail'
cs = [ vrt_ds.GetRasterBand(i+1).Checksum() for i in range(vrt_ds.RasterCount) ]
if cs not in( [4735, 10000, 9742], [4731, 9991, 9734]):
gdaltest.post_reason('fail')
print(cs)
return 'fail'
vrt_ds = None
# Check that wrapping with VRT works (when gt are not compatible)
pan_mem_ds = gdal.GetDriverByName('MEM').Create('', 20, 40, 1)
ms_mem_ds = gdal.GetDriverByName('MEM').Create('', 15, 30, 3)
pan_mem_ds.SetGeoTransform([120,1,0,80,0,-1])
ms_mem_ds.SetGeoTransform([100,2,0,100,0,-2])
vrt_ds = gdal.CreatePansharpenedVRT("""<VRTDataset subClass="VRTPansharpenedDataset">
<PansharpeningOptions>
<SpectralBand dstBand="1">
</SpectralBand>
<SpectralBand dstBand="2">
</SpectralBand>
<SpectralBand dstBand="3">
</SpectralBand>
</PansharpeningOptions>
</VRTDataset>""", pan_mem_ds.GetRasterBand(1), [ ms_mem_ds.GetRasterBand(i+1) for i in range(3)] )
if vrt_ds.GetGeoTransform() != (100.0, 1.0, 0.0, 100.0, 0.0, -1.0) or vrt_ds.RasterXSize != 40 or vrt_ds.RasterYSize != 60:
gdaltest.post_reason('fail')
print(vrt_ds.GetGeoTransform())
print(vrt_ds.RasterXSize)
print(vrt_ds.RasterYSize)
return 'fail'
vrt_ds = None
# Test error cases as well
gdal.PushErrorHandler()
vrt_ds = gdal.CreatePansharpenedVRT("""<invalid_xml""", pan_mem_ds.GetRasterBand(1), [ ms_mem_ds.GetRasterBand(i+1) for i in range(3)] )
gdal.PopErrorHandler()
if vrt_ds is not None:
gdaltest.post_reason('fail')
return 'fail'
# Not enough bands
gdal.PushErrorHandler()
vrt_ds = gdal.CreatePansharpenedVRT("""<VRTDataset subClass="VRTPansharpenedDataset">
<PansharpeningOptions>
<SpectralBand dstBand="1">
</SpectralBand>
<SpectralBand dstBand="2">
</SpectralBand>
</PansharpeningOptions>
</VRTDataset>""", pan_mem_ds.GetRasterBand(1), [ ms_mem_ds.GetRasterBand(i+1) for i in range(3)] )
gdal.PopErrorHandler()
if vrt_ds is not None:
gdaltest.post_reason('fail')
return 'fail'
# Too many bands
gdal.PushErrorHandler()
vrt_ds = gdal.CreatePansharpenedVRT("""<VRTDataset subClass="VRTPansharpenedDataset">
<PansharpeningOptions>
<SpectralBand dstBand="1">
</SpectralBand>
<SpectralBand dstBand="2">
</SpectralBand>
<SpectralBand dstBand="3">
</SpectralBand>
<SpectralBand dstBand="4">
</SpectralBand>
</PansharpeningOptions>
</VRTDataset>""", pan_mem_ds.GetRasterBand(1), [ ms_mem_ds.GetRasterBand(i+1) for i in range(3)] )
gdal.PopErrorHandler()
if vrt_ds is not None:
gdaltest.post_reason('fail')
return 'fail'
return 'success'
###############################################################################
# Cleanup
def vrtpansharpen_cleanup():
gdal.GetDriverByName('GTiff').Delete('tmp/small_world_pan.tif')
gdal.GetDriverByName('GTiff').Delete('tmp/small_world.tif')
gdal.GetDriverByName('GTiff').Delete('/vsimem/pan.tif')
gdal.GetDriverByName('GTiff').Delete('/vsimem/ms.tif')
return 'success'
gdaltest_list = [
vrtpansharpen_1,
vrtpansharpen_2,
vrtpansharpen_3,
vrtpansharpen_4,
vrtpansharpen_5,
vrtpansharpen_6,
vrtpansharpen_7,
vrtpansharpen_8,
vrtpansharpen_9,
vrtpansharpen_10,
vrtpansharpen_11,
vrtpansharpen_cleanup,
]
#gdaltest_list= [ vrtpansharpen_1, vrtpansharpen_8 ]
if __name__ == '__main__':
gdaltest.setup_run( 'vrtpansharpen' )
gdaltest.run_tests( gdaltest_list )
gdaltest.summarize()
| 40.453827
| 221
| 0.626888
| 7,783
| 81,919
| 6.510215
| 0.059617
| 0.015197
| 0.066076
| 0.035169
| 0.906748
| 0.891492
| 0.872269
| 0.855651
| 0.831672
| 0.814818
| 0
| 0.051794
| 0.2319
| 81,919
| 2,024
| 222
| 40.473814
| 0.753473
| 0.046912
| 0
| 0.889768
| 0
| 0.005653
| 0.69377
| 0.335803
| 0
| 0
| 0
| 0
| 0
| 1
| 0.006783
| false
| 0
| 0.003392
| 0
| 0.063313
| 0.029395
| 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
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 8
|
86702322a1af15c747cfbcda570b3b7422f4bc2a
| 34,054
|
py
|
Python
|
tensorflow_model_analysis/extractors/predictions_extractor_test.py
|
josephw-ml/model-analysis
|
3105200fd39aa46e4c4d83aa460d92aa08a4b784
|
[
"Apache-2.0"
] | null | null | null |
tensorflow_model_analysis/extractors/predictions_extractor_test.py
|
josephw-ml/model-analysis
|
3105200fd39aa46e4c4d83aa460d92aa08a4b784
|
[
"Apache-2.0"
] | null | null | null |
tensorflow_model_analysis/extractors/predictions_extractor_test.py
|
josephw-ml/model-analysis
|
3105200fd39aa46e4c4d83aa460d92aa08a4b784
|
[
"Apache-2.0"
] | null | null | null |
# Copyright 2020 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
#
# https://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.
"""Test for batched predict extractor."""
import os
import apache_beam as beam
from apache_beam.testing import util
import numpy as np
import tensorflow as tf
from tensorflow_model_analysis import constants
from tensorflow_model_analysis.api import model_eval_lib
from tensorflow_model_analysis.eval_saved_model import testutil
from tensorflow_model_analysis.eval_saved_model.example_trainers import batch_size_limited_classifier
from tensorflow_model_analysis.eval_saved_model.example_trainers import dnn_classifier
from tensorflow_model_analysis.eval_saved_model.example_trainers import fixed_prediction_estimator_extra_fields
from tensorflow_model_analysis.eval_saved_model.example_trainers import multi_head
from tensorflow_model_analysis.extractors import features_extractor
from tensorflow_model_analysis.extractors import predictions_extractor
from tensorflow_model_analysis.proto import config_pb2
from tfx_bsl.tfxio import tensor_adapter
from tfx_bsl.tfxio import test_util
from google.protobuf import text_format
from tensorflow_metadata.proto.v0 import schema_pb2
class PredictionsExtractorTest(testutil.TensorflowModelAnalysisTest):
def _getExportDir(self):
return os.path.join(self._getTempDir(), 'export_dir')
def testPredictionsExtractorWithRegressionModel(self):
temp_export_dir = self._getExportDir()
export_dir, _ = (
fixed_prediction_estimator_extra_fields
.simple_fixed_prediction_estimator_extra_fields(temp_export_dir, None))
eval_config = config_pb2.EvalConfig(model_specs=[config_pb2.ModelSpec()])
eval_shared_model = self.createTestEvalSharedModel(
eval_saved_model_path=export_dir, tags=[tf.saved_model.SERVING])
schema = text_format.Parse(
"""
feature {
name: "prediction"
type: FLOAT
}
feature {
name: "label"
type: FLOAT
}
feature {
name: "fixed_int"
type: INT
}
feature {
name: "fixed_float"
type: FLOAT
}
feature {
name: "fixed_string"
type: BYTES
}
""", schema_pb2.Schema())
tfx_io = test_util.InMemoryTFExampleRecord(
schema=schema, raw_record_column_name=constants.ARROW_INPUT_COLUMN)
tensor_adapter_config = tensor_adapter.TensorAdapterConfig(
arrow_schema=tfx_io.ArrowSchema(),
tensor_representations=tfx_io.TensorRepresentations())
feature_extractor = features_extractor.FeaturesExtractor(eval_config)
prediction_extractor = predictions_extractor.PredictionsExtractor(
eval_config=eval_config,
eval_shared_model=eval_shared_model,
tensor_adapter_config=tensor_adapter_config)
examples = [
self._makeExample(
prediction=0.2,
label=1.0,
fixed_int=1,
fixed_float=1.0,
fixed_string='fixed_string1'),
self._makeExample(
prediction=0.8,
label=0.0,
fixed_int=1,
fixed_float=1.0,
fixed_string='fixed_string2'),
self._makeExample(
prediction=0.5,
label=0.0,
fixed_int=2,
fixed_float=1.0,
fixed_string='fixed_string3')
]
with beam.Pipeline() as pipeline:
# pylint: disable=no-value-for-parameter
result = (
pipeline
| 'Create' >> beam.Create([e.SerializeToString() for e in examples],
reshuffle=False)
| 'BatchExamples' >> tfx_io.BeamSource(batch_size=3)
| 'InputsToExtracts' >> model_eval_lib.BatchedInputsToExtracts()
| feature_extractor.stage_name >> feature_extractor.ptransform
| prediction_extractor.stage_name >> prediction_extractor.ptransform)
# pylint: enable=no-value-for-parameter
def check_result(got):
try:
self.assertLen(got, 1)
self.assertIn(constants.PREDICTIONS_KEY, got[0])
expected_preds = [0.2, 0.8, 0.5]
self.assertAlmostEqual(got[0][constants.PREDICTIONS_KEY],
expected_preds)
except AssertionError as err:
raise util.BeamAssertException(err)
util.assert_that(result, check_result, label='result')
def testPredictionsExtractorWithBinaryClassificationModel(self):
temp_export_dir = self._getExportDir()
export_dir, _ = dnn_classifier.simple_dnn_classifier(
temp_export_dir, None, n_classes=2)
eval_config = config_pb2.EvalConfig(model_specs=[config_pb2.ModelSpec()])
eval_shared_model = self.createTestEvalSharedModel(
eval_saved_model_path=export_dir, tags=[tf.saved_model.SERVING])
schema = text_format.Parse(
"""
feature {
name: "age"
type: FLOAT
}
feature {
name: "langauge"
type: BYTES
}
feature {
name: "label"
type: INT
}
""", schema_pb2.Schema())
tfx_io = test_util.InMemoryTFExampleRecord(
schema=schema, raw_record_column_name=constants.ARROW_INPUT_COLUMN)
tensor_adapter_config = tensor_adapter.TensorAdapterConfig(
arrow_schema=tfx_io.ArrowSchema(),
tensor_representations=tfx_io.TensorRepresentations())
feature_extractor = features_extractor.FeaturesExtractor(eval_config)
prediction_extractor = predictions_extractor.PredictionsExtractor(
eval_config=eval_config,
eval_shared_model=eval_shared_model,
tensor_adapter_config=tensor_adapter_config)
examples = [
self._makeExample(age=1.0, language='english', label=0),
self._makeExample(age=2.0, language='chinese', label=1),
self._makeExample(age=3.0, language='chinese', label=0),
]
with beam.Pipeline() as pipeline:
# pylint: disable=no-value-for-parameter
result = (
pipeline
| 'Create' >> beam.Create([e.SerializeToString() for e in examples],
reshuffle=False)
| 'BatchExamples' >> tfx_io.BeamSource(batch_size=3)
| 'InputsToExtracts' >> model_eval_lib.BatchedInputsToExtracts()
| feature_extractor.stage_name >> feature_extractor.ptransform
| prediction_extractor.stage_name >> prediction_extractor.ptransform)
# pylint: enable=no-value-for-parameter
def check_result(got):
try:
self.assertLen(got, 1)
# We can't verify the actual predictions, but we can verify the keys.
for item in got:
self.assertIn(constants.PREDICTIONS_KEY, item)
for pred in item[constants.PREDICTIONS_KEY]:
for pred_key in ('logistic', 'probabilities', 'all_classes'):
self.assertIn(pred_key, pred)
except AssertionError as err:
raise util.BeamAssertException(err)
util.assert_that(result, check_result, label='result')
def testPredictionsExtractorWithMultiClassModel(self):
temp_export_dir = self._getExportDir()
export_dir, _ = dnn_classifier.simple_dnn_classifier(
temp_export_dir, None, n_classes=3)
eval_config = config_pb2.EvalConfig(model_specs=[config_pb2.ModelSpec()])
eval_shared_model = self.createTestEvalSharedModel(
eval_saved_model_path=export_dir, tags=[tf.saved_model.SERVING])
schema = text_format.Parse(
"""
feature {
name: "age"
type: FLOAT
}
feature {
name: "langauge"
type: BYTES
}
feature {
name: "label"
type: INT
}
""", schema_pb2.Schema())
tfx_io = test_util.InMemoryTFExampleRecord(
schema=schema, raw_record_column_name=constants.ARROW_INPUT_COLUMN)
tensor_adapter_config = tensor_adapter.TensorAdapterConfig(
arrow_schema=tfx_io.ArrowSchema(),
tensor_representations=tfx_io.TensorRepresentations())
feature_extractor = features_extractor.FeaturesExtractor(eval_config)
prediction_extractor = predictions_extractor.PredictionsExtractor(
eval_config=eval_config,
eval_shared_model=eval_shared_model,
tensor_adapter_config=tensor_adapter_config)
examples = [
self._makeExample(age=1.0, language='english', label=0),
self._makeExample(age=2.0, language='chinese', label=1),
self._makeExample(age=3.0, language='english', label=2),
self._makeExample(age=4.0, language='chinese', label=1),
]
with beam.Pipeline() as pipeline:
# pylint: disable=no-value-for-parameter
result = (
pipeline
| 'Create' >> beam.Create([e.SerializeToString() for e in examples],
reshuffle=False)
| 'BatchExamples' >> tfx_io.BeamSource(batch_size=4)
| 'InputsToExtracts' >> model_eval_lib.BatchedInputsToExtracts()
| feature_extractor.stage_name >> feature_extractor.ptransform
| prediction_extractor.stage_name >> prediction_extractor.ptransform)
# pylint: enable=no-value-for-parameter
def check_result(got):
try:
self.assertLen(got, 1)
# We can't verify the actual predictions, but we can verify the keys.
for item in got:
self.assertIn(constants.PREDICTIONS_KEY, item)
for pred in item[constants.PREDICTIONS_KEY]:
for pred_key in ('probabilities', 'all_classes'):
self.assertIn(pred_key, pred)
except AssertionError as err:
raise util.BeamAssertException(err)
util.assert_that(result, check_result, label='result')
def testPredictionsExtractorWithMultiOutputModel(self):
temp_export_dir = self._getExportDir()
export_dir, _ = multi_head.simple_multi_head(temp_export_dir, None)
eval_config = config_pb2.EvalConfig(model_specs=[config_pb2.ModelSpec()])
eval_shared_model = self.createTestEvalSharedModel(
eval_saved_model_path=export_dir, tags=[tf.saved_model.SERVING])
schema = text_format.Parse(
"""
feature {
name: "age"
type: FLOAT
}
feature {
name: "langauge"
type: BYTES
}
feature {
name: "english_label"
type: FLOAT
}
feature {
name: "chinese_label"
type: FLOAT
}
feature {
name: "other_label"
type: FLOAT
}
""", schema_pb2.Schema())
tfx_io = test_util.InMemoryTFExampleRecord(
schema=schema, raw_record_column_name=constants.ARROW_INPUT_COLUMN)
tensor_adapter_config = tensor_adapter.TensorAdapterConfig(
arrow_schema=tfx_io.ArrowSchema(),
tensor_representations=tfx_io.TensorRepresentations())
feature_extractor = features_extractor.FeaturesExtractor(eval_config)
prediction_extractor = predictions_extractor.PredictionsExtractor(
eval_config=eval_config,
eval_shared_model=eval_shared_model,
tensor_adapter_config=tensor_adapter_config)
examples = [
self._makeExample(
age=1.0,
language='english',
english_label=1.0,
chinese_label=0.0,
other_label=0.0),
self._makeExample(
age=1.0,
language='chinese',
english_label=0.0,
chinese_label=1.0,
other_label=0.0),
self._makeExample(
age=2.0,
language='english',
english_label=1.0,
chinese_label=0.0,
other_label=0.0),
self._makeExample(
age=2.0,
language='other',
english_label=0.0,
chinese_label=1.0,
other_label=1.0)
]
with beam.Pipeline() as pipeline:
# pylint: disable=no-value-for-parameter
result = (
pipeline
| 'Create' >> beam.Create([e.SerializeToString() for e in examples],
reshuffle=False)
| 'BatchExamples' >> tfx_io.BeamSource(batch_size=4)
| 'InputsToExtracts' >> model_eval_lib.BatchedInputsToExtracts()
| feature_extractor.stage_name >> feature_extractor.ptransform
| prediction_extractor.stage_name >> prediction_extractor.ptransform)
# pylint: enable=no-value-for-parameter
def check_result(got):
try:
self.assertLen(got, 1)
# We can't verify the actual predictions, but we can verify the keys.
for item in got:
self.assertIn(constants.PREDICTIONS_KEY, item)
for pred in item[constants.PREDICTIONS_KEY]:
for output_name in ('chinese_head', 'english_head', 'other_head'):
for pred_key in ('logistic', 'probabilities', 'all_classes'):
self.assertIn(f'{output_name}/{pred_key}', pred)
except AssertionError as err:
raise util.BeamAssertException(err)
util.assert_that(result, check_result, label='result')
def testPredictionsExtractorWithMultiModels(self):
temp_export_dir = self._getExportDir()
export_dir1, _ = multi_head.simple_multi_head(temp_export_dir, None)
export_dir2, _ = multi_head.simple_multi_head(temp_export_dir, None)
eval_config = config_pb2.EvalConfig(model_specs=[
config_pb2.ModelSpec(name='model1'),
config_pb2.ModelSpec(name='model2')
])
eval_shared_model1 = self.createTestEvalSharedModel(
eval_saved_model_path=export_dir1, tags=[tf.saved_model.SERVING])
eval_shared_model2 = self.createTestEvalSharedModel(
eval_saved_model_path=export_dir2, tags=[tf.saved_model.SERVING])
schema = text_format.Parse(
"""
feature {
name: "age"
type: FLOAT
}
feature {
name: "langauge"
type: BYTES
}
feature {
name: "english_label"
type: FLOAT
}
feature {
name: "chinese_label"
type: FLOAT
}
feature {
name: "other_label"
type: FLOAT
}
""", schema_pb2.Schema())
tfx_io = test_util.InMemoryTFExampleRecord(
schema=schema, raw_record_column_name=constants.ARROW_INPUT_COLUMN)
tensor_adapter_config = tensor_adapter.TensorAdapterConfig(
arrow_schema=tfx_io.ArrowSchema(),
tensor_representations=tfx_io.TensorRepresentations())
feature_extractor = features_extractor.FeaturesExtractor(eval_config)
prediction_extractor = predictions_extractor.PredictionsExtractor(
eval_config=eval_config,
eval_shared_model={
'model1': eval_shared_model1,
'model2': eval_shared_model2
},
tensor_adapter_config=tensor_adapter_config)
examples = [
self._makeExample(
age=1.0,
language='english',
english_label=1.0,
chinese_label=0.0,
other_label=0.0),
self._makeExample(
age=1.0,
language='chinese',
english_label=0.0,
chinese_label=1.0,
other_label=0.0),
self._makeExample(
age=2.0,
language='english',
english_label=1.0,
chinese_label=0.0,
other_label=0.0),
self._makeExample(
age=2.0,
language='other',
english_label=0.0,
chinese_label=1.0,
other_label=1.0)
]
with beam.Pipeline() as pipeline:
# pylint: disable=no-value-for-parameter
result = (
pipeline
| 'Create' >> beam.Create([e.SerializeToString() for e in examples],
reshuffle=False)
| 'BatchExamples' >> tfx_io.BeamSource(batch_size=4)
| 'InputsToExtracts' >> model_eval_lib.BatchedInputsToExtracts()
| feature_extractor.stage_name >> feature_extractor.ptransform
| prediction_extractor.stage_name >> prediction_extractor.ptransform)
# pylint: enable=no-value-for-parameter
def check_result(got):
try:
self.assertLen(got, 1)
for item in got:
# We can't verify the actual predictions, but we can verify the keys
self.assertIn(constants.PREDICTIONS_KEY, item)
for pred in item[constants.PREDICTIONS_KEY]:
for model_name in ('model1', 'model2'):
self.assertIn(model_name, pred)
for output_name in ('chinese_head', 'english_head',
'other_head'):
for pred_key in ('logistic', 'probabilities', 'all_classes'):
self.assertIn(f'{output_name}/{pred_key}', pred[model_name])
except AssertionError as err:
raise util.BeamAssertException(err)
util.assert_that(result, check_result, label='result')
def testPredictionsExtractorWithKerasModel(self):
input1 = tf.keras.layers.Input(shape=(2,), name='input1')
input2 = tf.keras.layers.Input(shape=(2,), name='input2')
inputs = [input1, input2]
input_layer = tf.keras.layers.concatenate(inputs)
output_layer = tf.keras.layers.Dense(
1, activation=tf.nn.sigmoid, name='output')(
input_layer)
model = tf.keras.models.Model(inputs, output_layer)
model.compile(
optimizer=tf.keras.optimizers.Adam(lr=.001),
loss=tf.keras.losses.binary_crossentropy,
metrics=['accuracy'])
train_features = {
'input1': [[0.0, 0.0], [1.0, 1.0]],
'input2': [[1.0, 1.0], [0.0, 0.0]]
}
labels = [[1], [0]]
example_weights = [1.0, 0.5]
dataset = tf.data.Dataset.from_tensor_slices(
(train_features, labels, example_weights))
dataset = dataset.shuffle(buffer_size=1).repeat().batch(2)
model.fit(dataset, steps_per_epoch=1)
export_dir = self._getExportDir()
model.save(export_dir, save_format='tf')
eval_config = config_pb2.EvalConfig(model_specs=[config_pb2.ModelSpec()])
eval_shared_model = self.createTestEvalSharedModel(
eval_saved_model_path=export_dir, tags=[tf.saved_model.SERVING])
schema = text_format.Parse(
"""
tensor_representation_group {
key: ""
value {
tensor_representation {
key: "input1"
value {
dense_tensor {
column_name: "input1"
shape { dim { size: 2 } }
}
}
}
tensor_representation {
key: "input2"
value {
dense_tensor {
column_name: "input2"
shape { dim { size: 2 } }
}
}
}
}
}
feature {
name: "input1"
type: FLOAT
}
feature {
name: "input2"
type: FLOAT
}
feature {
name: "non_model_feature"
type: INT
}
""", schema_pb2.Schema())
tfx_io = test_util.InMemoryTFExampleRecord(
schema=schema, raw_record_column_name=constants.ARROW_INPUT_COLUMN)
tensor_adapter_config = tensor_adapter.TensorAdapterConfig(
arrow_schema=tfx_io.ArrowSchema(),
tensor_representations=tfx_io.TensorRepresentations())
feature_extractor = features_extractor.FeaturesExtractor(eval_config)
prediction_extractor = predictions_extractor.PredictionsExtractor(
eval_config=eval_config,
eval_shared_model=eval_shared_model,
tensor_adapter_config=tensor_adapter_config)
examples = [
self._makeExample(
input1=[0.0, 0.0], input2=[1.0, 1.0],
non_model_feature=0), # should be ignored by model
self._makeExample(
input1=[1.0, 1.0], input2=[0.0, 0.0],
non_model_feature=1), # should be ignored by model
]
with beam.Pipeline() as pipeline:
# pylint: disable=no-value-for-parameter
result = (
pipeline
| 'Create' >> beam.Create([e.SerializeToString() for e in examples],
reshuffle=False)
| 'BatchExamples' >> tfx_io.BeamSource(batch_size=2)
| 'InputsToExtracts' >> model_eval_lib.BatchedInputsToExtracts()
| feature_extractor.stage_name >> feature_extractor.ptransform
| prediction_extractor.stage_name >> prediction_extractor.ptransform)
# pylint: enable=no-value-for-parameter
def check_result(got):
try:
self.assertLen(got, 1)
# We can't verify the actual predictions, but we can verify the keys.
for item in got:
self.assertIn(constants.PREDICTIONS_KEY, item)
except AssertionError as err:
raise util.BeamAssertException(err)
util.assert_that(result, check_result, label='result')
def testPredictionsExtractorWithSequentialKerasModel(self):
# Note that the input will be called 'test_input'
model = tf.keras.models.Sequential([
tf.keras.layers.Dense(
1, activation=tf.nn.sigmoid, input_shape=(2,), name='test')
])
model.compile(
optimizer=tf.keras.optimizers.Adam(lr=.001),
loss=tf.keras.losses.binary_crossentropy,
metrics=['accuracy'])
train_features = {'test_input': [[0.0, 0.0], [1.0, 1.0]]}
labels = [[1], [0]]
example_weights = [1.0, 0.5]
dataset = tf.data.Dataset.from_tensor_slices(
(train_features, labels, example_weights))
dataset = dataset.shuffle(buffer_size=1).repeat().batch(2)
model.fit(dataset, steps_per_epoch=1)
export_dir = self._getExportDir()
model.save(export_dir, save_format='tf')
eval_config = config_pb2.EvalConfig(model_specs=[config_pb2.ModelSpec()])
eval_shared_model = self.createTestEvalSharedModel(
eval_saved_model_path=export_dir, tags=[tf.saved_model.SERVING])
schema = text_format.Parse(
"""
tensor_representation_group {
key: ""
value {
tensor_representation {
key: "test"
value {
dense_tensor {
column_name: "test"
shape { dim { size: 2 } }
}
}
}
}
}
feature {
name: "test"
type: FLOAT
}
feature {
name: "non_model_feature"
type: INT
}
""", schema_pb2.Schema())
tfx_io = test_util.InMemoryTFExampleRecord(
schema=schema, raw_record_column_name=constants.ARROW_INPUT_COLUMN)
tensor_adapter_config = tensor_adapter.TensorAdapterConfig(
arrow_schema=tfx_io.ArrowSchema(),
tensor_representations=tfx_io.TensorRepresentations())
feature_extractor = features_extractor.FeaturesExtractor(eval_config)
prediction_extractor = predictions_extractor.PredictionsExtractor(
eval_config=eval_config,
eval_shared_model=eval_shared_model,
tensor_adapter_config=tensor_adapter_config)
# Notice that the features are 'test' but the model expects 'test_input'.
# This tests that the PredictExtractor properly handles this case.
examples = [
self._makeExample(test=[0.0, 0.0],
non_model_feature=0), # should be ignored by model
self._makeExample(test=[1.0, 1.0],
non_model_feature=1), # should be ignored by model
]
with beam.Pipeline() as pipeline:
# pylint: disable=no-value-for-parameter
result = (
pipeline
| 'Create' >> beam.Create([e.SerializeToString() for e in examples],
reshuffle=False)
| 'BatchExamples' >> tfx_io.BeamSource(batch_size=2)
| 'InputsToExtracts' >> model_eval_lib.BatchedInputsToExtracts()
| feature_extractor.stage_name >> feature_extractor.ptransform
| prediction_extractor.stage_name >> prediction_extractor.ptransform)
# pylint: enable=no-value-for-parameter
def check_result(got):
try:
self.assertLen(got, 1)
# We can't verify the actual predictions, but we can verify the keys.
for item in got:
self.assertIn(constants.PREDICTIONS_KEY, item)
except AssertionError as err:
raise util.BeamAssertException(err)
util.assert_that(result, check_result, label='result')
def testBatchSizeLimitWithKerasModel(self):
input1 = tf.keras.layers.Input(shape=(1,), batch_size=1, name='input1')
input2 = tf.keras.layers.Input(shape=(1,), batch_size=1, name='input2')
inputs = [input1, input2]
input_layer = tf.keras.layers.concatenate(inputs)
def add_1(tensor):
return tf.add_n([tensor, tf.constant(1.0, shape=(1, 2))])
assert_layer = tf.keras.layers.Lambda(add_1)(input_layer)
model = tf.keras.models.Model(inputs, assert_layer)
model.compile(
optimizer=tf.keras.optimizers.Adam(lr=.001),
loss=tf.keras.losses.binary_crossentropy,
metrics=['accuracy'])
export_dir = self._getExportDir()
model.save(export_dir, save_format='tf')
eval_config = config_pb2.EvalConfig(model_specs=[config_pb2.ModelSpec()])
eval_shared_model = self.createTestEvalSharedModel(
eval_saved_model_path=export_dir, tags=[tf.saved_model.SERVING])
schema = text_format.Parse(
"""
tensor_representation_group {
key: ""
value {
tensor_representation {
key: "input1"
value {
dense_tensor {
column_name: "input1"
shape { dim { size: 1 } }
}
}
}
tensor_representation {
key: "input2"
value {
dense_tensor {
column_name: "input2"
shape { dim { size: 1 } }
}
}
}
}
}
feature {
name: "input1"
type: FLOAT
}
feature {
name: "input2"
type: FLOAT
}
""", schema_pb2.Schema())
tfx_io = test_util.InMemoryTFExampleRecord(
schema=schema, raw_record_column_name=constants.ARROW_INPUT_COLUMN)
tensor_adapter_config = tensor_adapter.TensorAdapterConfig(
arrow_schema=tfx_io.ArrowSchema(),
tensor_representations=tfx_io.TensorRepresentations())
feature_extractor = features_extractor.FeaturesExtractor(eval_config)
prediction_extractor = predictions_extractor.PredictionsExtractor(
eval_config=eval_config,
eval_shared_model=eval_shared_model,
tensor_adapter_config=tensor_adapter_config)
examples = []
for _ in range(4):
examples.append(self._makeExample(input1=0.0, input2=1.0))
with beam.Pipeline() as pipeline:
predict_extracts = (
pipeline
| 'Create' >> beam.Create([e.SerializeToString() for e in examples],
reshuffle=False)
| 'BatchExamples' >> tfx_io.BeamSource(batch_size=1)
| 'InputsToExtracts' >> model_eval_lib.BatchedInputsToExtracts()
| feature_extractor.stage_name >> feature_extractor.ptransform
| prediction_extractor.stage_name >> prediction_extractor.ptransform)
# pylint: enable=no-value-for-parameter
def check_result(got):
try:
self.assertLen(got, 4)
# We can't verify the actual predictions, but we can verify the keys.
for item in got:
self.assertIn(constants.PREDICTIONS_KEY, item)
except AssertionError as err:
raise util.BeamAssertException(err)
util.assert_that(predict_extracts, check_result, label='result')
def testBatchSizeLimit(self):
temp_export_dir = self._getExportDir()
_, export_dir = batch_size_limited_classifier.simple_batch_size_limited_classifier(
None, temp_export_dir)
eval_shared_model = self.createTestEvalSharedModel(
eval_saved_model_path=export_dir, tags=[tf.saved_model.SERVING])
eval_config = config_pb2.EvalConfig(model_specs=[config_pb2.ModelSpec()])
schema = text_format.Parse(
"""
feature {
name: "classes"
type: BYTES
}
feature {
name: "scores"
type: FLOAT
}
feature {
name: "labels"
type: BYTES
}
""", schema_pb2.Schema())
tfx_io = test_util.InMemoryTFExampleRecord(
schema=schema, raw_record_column_name=constants.ARROW_INPUT_COLUMN)
tensor_adapter_config = tensor_adapter.TensorAdapterConfig(
arrow_schema=tfx_io.ArrowSchema(),
tensor_representations=tfx_io.TensorRepresentations())
feature_extractor = features_extractor.FeaturesExtractor(eval_config)
prediction_extractor = predictions_extractor.PredictionsExtractor(
eval_config=eval_config,
eval_shared_model=eval_shared_model,
tensor_adapter_config=tensor_adapter_config)
examples = []
for _ in range(4):
examples.append(
self._makeExample(classes='first', scores=0.0, labels='third'))
with beam.Pipeline() as pipeline:
predict_extracts = (
pipeline
| 'Create' >> beam.Create([e.SerializeToString() for e in examples],
reshuffle=False)
| 'BatchExamples' >> tfx_io.BeamSource(batch_size=1)
| 'InputsToExtracts' >> model_eval_lib.BatchedInputsToExtracts()
| feature_extractor.stage_name >> feature_extractor.ptransform
| prediction_extractor.stage_name >> prediction_extractor.ptransform)
def check_result(got):
try:
self.assertLen(got, 4)
# We can't verify the actual predictions, but we can verify the keys.
for item in got:
self.assertIn(constants.PREDICTIONS_KEY, item)
except AssertionError as err:
raise util.BeamAssertException(err)
util.assert_that(predict_extracts, check_result, label='result')
def testPredictionsExtractorWithoutEvalSharedModel(self):
model_spec1 = config_pb2.ModelSpec(
name='model1', prediction_key='prediction')
model_spec2 = config_pb2.ModelSpec(
name='model2',
prediction_keys={
'output1': 'prediction1',
'output2': 'prediction2'
})
eval_config = config_pb2.EvalConfig(model_specs=[model_spec1, model_spec2])
feature_extractor = features_extractor.FeaturesExtractor(eval_config)
prediction_extractor = predictions_extractor.PredictionsExtractor(
eval_config)
schema = text_format.Parse(
"""
feature {
name: "prediction"
type: FLOAT
}
feature {
name: "prediction1"
type: FLOAT
}
feature {
name: "prediction2"
type: FLOAT
}
feature {
name: "fixed_int"
type: INT
}
""", schema_pb2.Schema())
tfx_io = test_util.InMemoryTFExampleRecord(
schema=schema, raw_record_column_name=constants.ARROW_INPUT_COLUMN)
examples = [
self._makeExample(
prediction=1.0, prediction1=1.0, prediction2=0.0, fixed_int=1),
self._makeExample(
prediction=1.0, prediction1=1.0, prediction2=1.0, fixed_int=1)
]
with beam.Pipeline() as pipeline:
# pylint: disable=no-value-for-parameter
result = (
pipeline
| 'Create' >> beam.Create([e.SerializeToString() for e in examples],
reshuffle=False)
| 'BatchExamples' >> tfx_io.BeamSource(batch_size=2)
| 'InputsToExtracts' >> model_eval_lib.BatchedInputsToExtracts()
| feature_extractor.stage_name >> feature_extractor.ptransform
| prediction_extractor.stage_name >> prediction_extractor.ptransform)
# pylint: enable=no-value-for-parameter
def check_result(got):
try:
self.assertLen(got, 1)
for model_name in ('model1', 'model2'):
self.assertIn(model_name, got[0][constants.PREDICTIONS_KEY][0])
self.assertAlmostEqual(got[0][constants.PREDICTIONS_KEY][0]['model1'],
np.array([1.0]))
self.assertDictElementsAlmostEqual(
got[0][constants.PREDICTIONS_KEY][0]['model2'], {
'output1': np.array([1.0]),
'output2': np.array([0.0])
})
for model_name in ('model1', 'model2'):
self.assertIn(model_name, got[0][constants.PREDICTIONS_KEY][1])
self.assertAlmostEqual(got[0][constants.PREDICTIONS_KEY][1]['model1'],
np.array([1.0]))
self.assertDictElementsAlmostEqual(
got[0][constants.PREDICTIONS_KEY][1]['model2'], {
'output1': np.array([1.0]),
'output2': np.array([1.0])
})
except AssertionError as err:
raise util.BeamAssertException(err)
util.assert_that(result, check_result, label='result')
if __name__ == '__main__':
tf.compat.v1.enable_v2_behavior()
tf.test.main()
| 36.617204
| 111
| 0.627768
| 3,614
| 34,054
| 5.664361
| 0.088545
| 0.00469
| 0.02506
| 0.018563
| 0.880367
| 0.85692
| 0.847492
| 0.825216
| 0.808949
| 0.794539
| 0
| 0.016361
| 0.276678
| 34,054
| 929
| 112
| 36.65662
| 0.814713
| 0.060933
| 0
| 0.773196
| 0
| 0
| 0.038838
| 0.001742
| 0
| 0
| 0
| 0
| 0.108247
| 1
| 0.037801
| false
| 0
| 0.032646
| 0.003436
| 0.075601
| 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
|
86790e9ce03ed34cee383de5ae0b8a554f7fdf64
| 2,588
|
py
|
Python
|
incidents/migrations/0014_auto_20150409_0917.py
|
SINTEF-Infosec/Incident-Information-Sharing-Tool
|
9845ab75839ac49429e936ecc42a8d816a5b4040
|
[
"Apache-2.0"
] | null | null | null |
incidents/migrations/0014_auto_20150409_0917.py
|
SINTEF-Infosec/Incident-Information-Sharing-Tool
|
9845ab75839ac49429e936ecc42a8d816a5b4040
|
[
"Apache-2.0"
] | null | null | null |
incidents/migrations/0014_auto_20150409_0917.py
|
SINTEF-Infosec/Incident-Information-Sharing-Tool
|
9845ab75839ac49429e936ecc42a8d816a5b4040
|
[
"Apache-2.0"
] | null | null | null |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import uuid
class Migration(migrations.Migration):
dependencies = [
('incidents', '0013_auto_20150408_1227'),
]
operations = [
migrations.AlterField(
model_name='attachment',
name='id',
field=models.UUIDField(serialize=False, primary_key=True, default=uuid.uuid4),
),
migrations.AlterField(
model_name='customfield',
name='id',
field=models.UUIDField(serialize=False, primary_key=True, default=uuid.uuid4),
),
migrations.AlterField(
model_name='customfieldvalue',
name='id',
field=models.UUIDField(serialize=False, primary_key=True, default=uuid.uuid4),
),
migrations.AlterField(
model_name='incident',
name='id',
field=models.UUIDField(serialize=False, primary_key=True, default=uuid.uuid4),
),
migrations.AlterField(
model_name='incidenttype',
name='id',
field=models.UUIDField(serialize=False, primary_key=True, default=uuid.uuid4),
),
migrations.AlterField(
model_name='liaison',
name='id',
field=models.UUIDField(serialize=False, primary_key=True, default=uuid.uuid4),
),
migrations.AlterField(
model_name='notification',
name='hmac',
field=models.CharField(blank=True, max_length=255),
),
migrations.AlterField(
model_name='notification',
name='id',
field=models.UUIDField(serialize=False, primary_key=True, default=uuid.uuid4),
),
migrations.AlterField(
model_name='notificationincident',
name='id',
field=models.UUIDField(serialize=False, primary_key=True, default=uuid.uuid4),
),
migrations.AlterField(
model_name='notificationtrigger',
name='id',
field=models.UUIDField(serialize=False, primary_key=True, default=uuid.uuid4),
),
migrations.AlterField(
model_name='notificationtype',
name='id',
field=models.UUIDField(serialize=False, primary_key=True, default=uuid.uuid4),
),
migrations.AlterField(
model_name='triggertype',
name='id',
field=models.UUIDField(serialize=False, primary_key=True, default=uuid.uuid4),
),
]
| 34.052632
| 90
| 0.588099
| 240
| 2,588
| 6.208333
| 0.216667
| 0.161074
| 0.201342
| 0.233557
| 0.749664
| 0.749664
| 0.711409
| 0.711409
| 0.711409
| 0.711409
| 0
| 0.016996
| 0.295209
| 2,588
| 75
| 91
| 34.506667
| 0.79989
| 0.008114
| 0
| 0.695652
| 0
| 0
| 0.082651
| 0.008967
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.043478
| 0
| 0.086957
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
867f8117a0f0694bc19eefddc8fab3a93857df40
| 140
|
py
|
Python
|
7KYU/longest.py
|
yaznasivasai/python_codewars
|
25493591dde4649dc9c1ec3bece8191a3bed6818
|
[
"MIT"
] | 4
|
2021-07-17T22:48:03.000Z
|
2022-03-25T14:10:58.000Z
|
7KYU/longest.py
|
yaznasivasai/python_codewars
|
25493591dde4649dc9c1ec3bece8191a3bed6818
|
[
"MIT"
] | null | null | null |
7KYU/longest.py
|
yaznasivasai/python_codewars
|
25493591dde4649dc9c1ec3bece8191a3bed6818
|
[
"MIT"
] | 3
|
2021-06-14T14:18:16.000Z
|
2022-03-16T06:02:02.000Z
|
def longest(a1: str, a2: str) -> str:
if a1 is a2:
return ''.join(sorted(set(a1)))
return ''.join(sorted(set(a1 + a2)))
| 28
| 40
| 0.535714
| 22
| 140
| 3.409091
| 0.5
| 0.266667
| 0.426667
| 0.506667
| 0.56
| 0
| 0
| 0
| 0
| 0
| 0
| 0.067961
| 0.264286
| 140
| 5
| 41
| 28
| 0.660194
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0
| 0
| 0.75
| 0
| 1
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 7
|
8691a5cae79b77d814920b92f008541210b01eb0
| 150
|
py
|
Python
|
point_gcn/models/__init__.py
|
gyshgx868/pc-classification
|
1667f08785e89bbe475fe7b4dbf8141a29d8c371
|
[
"MIT"
] | 7
|
2020-10-23T10:23:14.000Z
|
2021-10-06T02:04:02.000Z
|
point_gcn/models/__init__.py
|
gyshgx868/pc-classification
|
1667f08785e89bbe475fe7b4dbf8141a29d8c371
|
[
"MIT"
] | null | null | null |
point_gcn/models/__init__.py
|
gyshgx868/pc-classification
|
1667f08785e89bbe475fe7b4dbf8141a29d8c371
|
[
"MIT"
] | null | null | null |
from point_gcn.models.layers import GlobalPooling
from point_gcn.models.layers import GraphConvolution
from point_gcn.models.net import MultiLayerGCN
| 37.5
| 52
| 0.88
| 21
| 150
| 6.142857
| 0.47619
| 0.209302
| 0.27907
| 0.418605
| 0.465116
| 0.465116
| 0
| 0
| 0
| 0
| 0
| 0
| 0.08
| 150
| 3
| 53
| 50
| 0.934783
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 8
|
8699076053e3288fbc642932f5830bb60646bb37
| 11,376
|
py
|
Python
|
hbaselines/multi_fcnet/replay_buffer.py
|
jesbu1/h-baselines
|
f6f775bb18de22527f2d01d73bd733ed2e435ba3
|
[
"MIT"
] | null | null | null |
hbaselines/multi_fcnet/replay_buffer.py
|
jesbu1/h-baselines
|
f6f775bb18de22527f2d01d73bd733ed2e435ba3
|
[
"MIT"
] | null | null | null |
hbaselines/multi_fcnet/replay_buffer.py
|
jesbu1/h-baselines
|
f6f775bb18de22527f2d01d73bd733ed2e435ba3
|
[
"MIT"
] | null | null | null |
"""Script contain the MultiReplayBuffer object."""
import numpy as np
class MultiReplayBuffer(object):
"""Experience replay buffer for independent multi-agent settings.
This replay buffer supports centralized training by including a full-states
term for training centralized critics.
"""
def __init__(self,
buffer_size,
batch_size,
obs_dim,
ac_dim,
all_obs_dim,
all_ac_dim):
"""Instantiate a buffer.
Parameters
----------
buffer_size : int
Max number of transitions to store in the buffer. When the buffer
overflows the old memories are dropped.
batch_size : int
number of elements that are to be returned as a batch
obs_dim : int
number of elements in the observations of a single agent
ac_dim : int
number of elements in the actions of a single agent
all_obs_dim : int
number of elements in the full state observations
all_ac_dim : int
number of elements in the actions of all agents
"""
self._maxsize = buffer_size
self._size = 0
self._next_idx = 0
self._batch_size = batch_size
self.obs_t = np.zeros(
(buffer_size, obs_dim), dtype=np.float32)
self.action_t = np.zeros(
(buffer_size, ac_dim), dtype=np.float32)
self.reward = np.zeros(
buffer_size, dtype=np.float32)
self.obs_tp1 = np.zeros(
(buffer_size, obs_dim), dtype=np.float32)
self.done = np.zeros(
buffer_size, dtype=np.float32)
self.all_obs_t = np.zeros(
(buffer_size, all_obs_dim), dtype=np.float32)
self.all_action_t = np.zeros(
(buffer_size, all_ac_dim), dtype=np.float32)
self.all_obs_tp1 = np.zeros(
(buffer_size, all_obs_dim), dtype=np.float32)
def __len__(self):
"""Return the number of elements stored."""
return self._size
@property
def buffer_size(self):
"""Return the (float) max capacity of the buffer."""
return self._maxsize
def can_sample(self):
"""Check if n_samples samples can be sampled from the buffer.
Returns
-------
bool
True if enough sample exist, False otherwise
"""
return len(self) >= self._batch_size
def is_full(self):
"""Check whether the replay buffer is full or not.
Returns
-------
bool
True if it is full, False otherwise
"""
return len(self) == self.buffer_size
def add(self,
obs_t,
action,
reward,
obs_tp1,
done,
all_obs_t,
all_action_t,
all_obs_tp1):
"""Add a new transition to the buffer.
Parameters
----------
obs_t : array_like
the last observation of an individual agent
action : array_like
the action of an individual agent
reward : float
the reward of an individual agent
obs_tp1 : array_like
the current observation of an individual agent
done : float
the done mask of an individual agent
all_obs_t : array_like
the last full state observation
all_action_t : array_like
the actions of all agents, sorted by the agent IDs
all_obs_tp1 : array_like
the current full state observation
"""
for i in range(len(obs_t)):
self.obs_t[self._next_idx, :] = obs_t
self.action_t[self._next_idx, :] = action
self.reward[self._next_idx] = reward
self.obs_tp1[self._next_idx, :] = obs_tp1
self.done[self._next_idx] = done
self.all_obs_t[self._next_idx, :] = all_obs_t
self.all_action_t[self._next_idx, :] = all_action_t
self.all_obs_tp1[self._next_idx, :] = all_obs_tp1
# Increment the next index and size terms
self._next_idx = (self._next_idx + 1) % self._maxsize
self._size = min(self._size + 1, self._maxsize)
def _encode_sample(self, idxes):
"""Convert the indices to appropriate samples."""
return self.obs_t[idxes, :], \
self.action_t[idxes, :], \
self.reward[idxes], \
self.obs_tp1[idxes, :], \
self.done[idxes], \
self.all_obs_t[idxes, :], \
self.all_action_t[idxes, :], \
self.all_obs_tp1[idxes, :]
def sample(self, **_kwargs):
"""Sample a batch of experiences.
Returns
-------
array_like
(batch_size, obs_dim) batch of observations
array_like
(batch_size, ac_dim) batch of actions executed given obs_batch
array_like
(batch_size,) vector of rewards received as results of executing
act_batch
array_like
(batch_size, obs_dim) batch of next step observations seen after
executing act_batch
list of bool
done_mask[i] = 1 if executing act_batch[i] resulted in the end of
an episode and 0 otherwise.
array_like
(batch_size, all_obs_dim) batch of full-state observations
array_like
(batch_size, all_ac_dim) batch of the actions of all agents, sorted
by the agent IDs.
array_like
(batch_size, all_obs_dim) batch of next step full-state
observations
"""
indices = np.random.randint(0, self._size, size=self._batch_size)
return self._encode_sample(indices)
class SharedReplayBuffer(object):
"""Experience replay buffer for shared multi-agent settings.
This replay buffer supports centralized training by including a full-states
term for training centralized critics. In addition, information from all
agents are stored under the same replay buffer.
"""
def __init__(self,
buffer_size,
batch_size,
obs_dim,
ac_dim,
n_agents,
all_obs_dim):
"""Instantiate a buffer.
Parameters
----------
buffer_size : int
Max number of transitions to store in the buffer. When the buffer
overflows the old memories are dropped.
batch_size : int
number of elements that are to be returned as a batch
obs_dim : int
number of elements in the observation
ac_dim : int
number of elements in the action
n_agents : int
maximum number of agents in the network
all_obs_dim : int
number of elements in the full state observations
"""
self._maxsize = buffer_size
self._size = 0
self._next_idx = 0
self._batch_size = batch_size
self.obs_t = [
np.zeros((buffer_size, obs_dim), dtype=np.float32)
for _ in range(n_agents)]
self.action = [
np.zeros((buffer_size, ac_dim), dtype=np.float32)
for _ in range(n_agents)]
self.reward = np.zeros(
buffer_size, dtype=np.float32)
self.obs_tp1 = [
np.zeros((buffer_size, obs_dim), dtype=np.float32)
for _ in range(n_agents)]
self.done = np.zeros(
buffer_size, dtype=np.float32)
self.all_obs_t = np.zeros(
(buffer_size, all_obs_dim), dtype=np.float32)
self.all_obs_tp1 = np.zeros(
(buffer_size, all_obs_dim), dtype=np.float32)
def __len__(self):
"""Return the number of elements stored."""
return self._size
@property
def buffer_size(self):
"""Return the (float) max capacity of the buffer."""
return self._maxsize
def can_sample(self):
"""Check if n_samples samples can be sampled from the buffer.
Returns
-------
bool
True if enough sample exist, False otherwise
"""
return len(self) >= self._batch_size
def is_full(self):
"""Check whether the replay buffer is full or not.
Returns
-------
bool
True if it is full, False otherwise
"""
return len(self) == self.buffer_size
def add(self,
obs_t,
action,
reward,
obs_tp1,
done,
all_obs_t,
all_obs_tp1):
"""Add a new transition to the buffer.
Parameters
----------
obs_t : list of array_like
the last observation of each agent
action : list of array_like
the action of each agent
reward : float
the shared reward of the transition
obs_tp1 : list of array_like
the current observation of each agent
done : float
the shared episode done mask
all_obs_t : array_like
the last full state observation
all_obs_tp1 : array_like
the current full state observation
"""
for i in range(len(obs_t)):
self.obs_t[i][self._next_idx, :] = obs_t[i]
self.action[i][self._next_idx, :] = action[i]
self.reward[self._next_idx] = reward
self.obs_tp1[i][self._next_idx, :] = obs_tp1[i]
self.done[self._next_idx] = done
self.all_obs_t[self._next_idx, :] = all_obs_t
self.all_obs_tp1[self._next_idx, :] = all_obs_tp1
# Increment the next index and size terms
self._next_idx = (self._next_idx + 1) % self._maxsize
self._size = min(self._size + 1, self._maxsize)
def _encode_sample(self, idxes):
"""Convert the indices to appropriate samples."""
return [obs_t[idxes, :] for obs_t in self.obs_t], \
[action[idxes, :] for action in self.action], \
self.reward[idxes], \
[obs_tp1[idxes, :] for obs_tp1 in self.obs_tp1], \
self.done[idxes], \
self.all_obs_t[idxes, :], \
self.all_obs_tp1[idxes, :]
def sample(self, **_kwargs):
"""Sample a batch of experiences.
Returns
-------
list of array_like
(batch_size, obs_dim) batch of observations for each agent
array_like
(batch_size, ac_dim) batch of actions executed given obs_batch for
each agent
array_like
(batch_size,) vector of rewards received as results of executing
act_batch
list of array_like
(batch_size, obs_dim) batch of next step observations seen after
executing act_batch for each agent
list of bool
done_mask[i] = 1 if executing act_batch[i] resulted in the end of
an episode and 0 otherwise.
array_like
(batch_size, all_obs_dim) batch of full-state observations
array_like
(batch_size, all_obs_dim) batch of next step full-state
observations
"""
indices = np.random.randint(0, self._size, size=self._batch_size)
return self._encode_sample(indices)
| 33.857143
| 79
| 0.57384
| 1,448
| 11,376
| 4.276934
| 0.107044
| 0.034878
| 0.0373
| 0.041176
| 0.871791
| 0.828516
| 0.802035
| 0.798159
| 0.793477
| 0.763766
| 0
| 0.009431
| 0.347574
| 11,376
| 335
| 80
| 33.958209
| 0.82498
| 0.427215
| 0
| 0.766423
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.116788
| false
| 0
| 0.007299
| 0
| 0.226277
| 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
|
86c83f9858afa151a4255da3ca2dc0d444e04141
| 4,160
|
py
|
Python
|
src/lk_heuristic/utils/plot_funcs.py
|
kikocastroneto/lk_heuristic
|
d4f15d5fe88223d98dea9af61b5f4202934ddd1a
|
[
"MIT"
] | null | null | null |
src/lk_heuristic/utils/plot_funcs.py
|
kikocastroneto/lk_heuristic
|
d4f15d5fe88223d98dea9af61b5f4202934ddd1a
|
[
"MIT"
] | null | null | null |
src/lk_heuristic/utils/plot_funcs.py
|
kikocastroneto/lk_heuristic
|
d4f15d5fe88223d98dea9af61b5f4202934ddd1a
|
[
"MIT"
] | null | null | null |
import os
import plotly.graph_objects as go
from lk_heuristic.utils.io_funcs import import_tsp_file
# get the directory of this file and setup the "plots" dir
file_dir = os.path.dirname(os.path.realpath(__file__))
plots_dir = os.path.abspath(os.path.join(file_dir, "../", "plots"))
def plot_tsp_2d(tsp_file):
"""
Plot a tsp tour in a 2D graph using plotly library and save the plot at "plots" folder
:param tsp_file: the tsp file to be plot
:type tour: str
"""
# get the file name and extension
file_name, file_ext = os.path.splitext(os.path.basename(tsp_file))
# import the tsp file
tsp_header, nodes = import_tsp_file(tsp_file)
# create an empty figure
fig = go.Figure()
# set up layout configs
# title as tsp name and centered
# fig template scheme
fig.update_layout(title={
'text': tsp_header["NAME"],
'y': 1.0,
'x': 0.5},
template="plotly_white")
# remove grid lines
fig.update_xaxes(showgrid=False, zeroline=False, showticklabels=False)
fig.update_yaxes(showgrid=False, zeroline=False, showticklabels=False)
# lists to colect the plotting data in 2D
x_coords = []
y_coords = []
# loop through each tour node
for node in nodes:
# append the x and y coords
x_coords.append(node.x)
y_coords.append(node.y)
# append last edge to close the tour
x_coords.append(x_coords[0])
y_coords.append(y_coords[0])
# plot the line between two nodes
fig.add_trace(go.Scatter(
x=x_coords,
y=y_coords,
mode='lines',
line=dict(color="rgb(192,192,192,0.2)",
width=1),
showlegend=False))
# plot the scatter of current node
fig.add_trace(go.Scatter(
x=x_coords,
y=y_coords,
mode='markers',
line=dict(color="rgb(0,114,228,0.5)",
width=10),
showlegend=False))
# export the plot into a html file
fig.write_html(os.path.join(plots_dir, f"{file_name}.html"))
def plot_tsp_3d(tsp_file):
"""
Plot a tsp tour in a 3D graph using plotly library and save the plot at "plots" folder
:param tsp_file: the tsp file to be plot
:type tour: str
"""
# get the file name and extension
file_name, file_ext = os.path.splitext(os.path.basename(tsp_file))
# import the tsp file
tsp_header, nodes = import_tsp_file(tsp_file)
# create an empty figure
fig = go.Figure()
# set up layout configs
# title as tsp name and centered
# fig template scheme
fig.update_layout(title={
'text': tsp_header["NAME"],
'y': 1.0,
'x': 0.5},
template="plotly_white")
# remove grid lines
fig.update_layout(
scene=dict(
xaxis_title='',
yaxis_title='',
zaxis_title='',
xaxis=dict(showgrid=False, zeroline=False, showticklabels=False),
yaxis=dict(showgrid=False, zeroline=False, showticklabels=False),
zaxis=dict(showgrid=False, zeroline=False, showticklabels=False)))
# lists to colect the plotting data in 3D
x_coords = []
y_coords = []
z_coords = []
# loop through each tour node
for node in nodes:
# append the x, y and z coords
x_coords.append(node.x)
y_coords.append(node.y)
z_coords.append(node.z)
# append last edge to close the tour
x_coords.append(x_coords[0])
y_coords.append(y_coords[0])
z_coords.append(z_coords[0])
# plot the line between two nodes
fig.add_trace(go.Scatter3d(
x=x_coords,
y=y_coords,
z=z_coords,
mode='lines',
line=dict(color="rgb(192,192,192,0.2)",
width=2),
showlegend=False))
# plot the scatter of current node
fig.add_trace(go.Scatter3d(
x=x_coords,
y=y_coords,
z=z_coords,
mode='markers',
line=dict(color="rgb(0,114,228,0.5)",
width=4),
showlegend=False))
# export the plot into a html file
fig.write_html(os.path.join(plots_dir, f"{file_name}.html"))
| 27.549669
| 90
| 0.617548
| 612
| 4,160
| 4.05719
| 0.20915
| 0.042288
| 0.019331
| 0.052356
| 0.84414
| 0.84414
| 0.826017
| 0.784938
| 0.767217
| 0.767217
| 0
| 0.021833
| 0.273317
| 4,160
| 150
| 91
| 27.733333
| 0.799537
| 0.273077
| 0
| 0.707317
| 0
| 0
| 0.062394
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.02439
| false
| 0
| 0.060976
| 0
| 0.085366
| 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
|
86c9498865910e8a800544d672551931f800397d
| 151
|
py
|
Python
|
short_url/context_processors.py
|
artcom-net/ShortURL
|
e45a406161af655be14a71b21499b932a9f999ae
|
[
"MIT"
] | null | null | null |
short_url/context_processors.py
|
artcom-net/ShortURL
|
e45a406161af655be14a71b21499b932a9f999ae
|
[
"MIT"
] | null | null | null |
short_url/context_processors.py
|
artcom-net/ShortURL
|
e45a406161af655be14a71b21499b932a9f999ae
|
[
"MIT"
] | null | null | null |
from django.conf import settings
TITLE = getattr(settings, 'TITLE', 'ShortenerURL')
def pass_title_processor(request):
return {'title': TITLE}
| 16.777778
| 50
| 0.735099
| 18
| 151
| 6.055556
| 0.722222
| 0.238532
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.145695
| 151
| 8
| 51
| 18.875
| 0.844961
| 0
| 0
| 0
| 0
| 0
| 0.145695
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0.25
| 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
| 0
| 1
| 0
| 1
| 1
| 0
|
0
| 7
|
8111794684210af6ce08f1273fa6f52e52799034
| 49,102
|
py
|
Python
|
research/object_detection/builders/box_predictor_builder.py
|
hjkim-haga/TF-OD-API
|
22ac477ff4dfb93fe7a32c94b5f0b1e74330902b
|
[
"Apache-2.0"
] | 1
|
2021-05-22T12:50:50.000Z
|
2021-05-22T12:50:50.000Z
|
object_detection/builders/box_predictor_builder.py
|
DemonDamon/mask-detection-based-on-tf2odapi
|
192ae544169c1230c21141c033800aa1bd94e9b6
|
[
"MIT"
] | null | null | null |
object_detection/builders/box_predictor_builder.py
|
DemonDamon/mask-detection-based-on-tf2odapi
|
192ae544169c1230c21141c033800aa1bd94e9b6
|
[
"MIT"
] | null | null | null |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Function to build box predictor from configuration."""
import collections
import tensorflow.compat.v1 as tf
from object_detection.predictors import convolutional_box_predictor
from object_detection.predictors import convolutional_keras_box_predictor
from object_detection.predictors import mask_rcnn_box_predictor
from object_detection.predictors import mask_rcnn_keras_box_predictor
from object_detection.predictors import rfcn_box_predictor
from object_detection.predictors import rfcn_keras_box_predictor
from object_detection.predictors.heads import box_head
from object_detection.predictors.heads import class_head
from object_detection.predictors.heads import keras_box_head
from object_detection.predictors.heads import keras_class_head
from object_detection.predictors.heads import keras_mask_head
from object_detection.predictors.heads import mask_head
from object_detection.protos import box_predictor_pb2
def build_convolutional_box_predictor(is_training,
num_classes,
conv_hyperparams_fn,
min_depth,
max_depth,
num_layers_before_predictor,
use_dropout,
dropout_keep_prob,
kernel_size,
box_code_size,
apply_sigmoid_to_scores=False,
add_background_class=True,
class_prediction_bias_init=0.0,
use_depthwise=False,
box_encodings_clip_range=None):
"""Builds the ConvolutionalBoxPredictor from the arguments.
Args:
is_training: Indicates whether the BoxPredictor is in training mode.
num_classes: number of classes. Note that num_classes *does not*
include the background category, so if groundtruth labels take values
in {0, 1, .., K-1}, num_classes=K (and not K+1, even though the
assigned classification targets can range from {0,... K}).
conv_hyperparams_fn: A function to generate tf-slim arg_scope with
hyperparameters for convolution ops.
min_depth: Minimum feature depth prior to predicting box encodings
and class predictions.
max_depth: Maximum feature depth prior to predicting box encodings
and class predictions. If max_depth is set to 0, no additional
feature map will be inserted before location and class predictions.
num_layers_before_predictor: Number of the additional conv layers before
the predictor.
use_dropout: Option to use dropout or not. Note that a single dropout
op is applied here prior to both box and class predictions, which stands
in contrast to the ConvolutionalBoxPredictor below.
dropout_keep_prob: Keep probability for dropout.
This is only used if use_dropout is True.
kernel_size: Size of final convolution kernel. If the
spatial resolution of the feature map is smaller than the kernel size,
then the kernel size is automatically set to be
min(feature_width, feature_height).
box_code_size: Size of encoding for each box.
apply_sigmoid_to_scores: If True, apply the sigmoid on the output
class_predictions.
add_background_class: Whether to add an implicit background class.
class_prediction_bias_init: Constant value to initialize bias of the last
conv2d layer before class prediction.
use_depthwise: Whether to use depthwise convolutions for prediction
steps. Default is False.
box_encodings_clip_range: Min and max values for clipping the box_encodings.
Returns:
A ConvolutionalBoxPredictor class.
"""
box_prediction_head = box_head.ConvolutionalBoxHead(
is_training=is_training,
box_code_size=box_code_size,
kernel_size=kernel_size,
use_depthwise=use_depthwise,
box_encodings_clip_range=box_encodings_clip_range)
class_prediction_head = class_head.ConvolutionalClassHead(
is_training=is_training,
num_class_slots=num_classes + 1 if add_background_class else num_classes,
use_dropout=use_dropout,
dropout_keep_prob=dropout_keep_prob,
kernel_size=kernel_size,
apply_sigmoid_to_scores=apply_sigmoid_to_scores,
class_prediction_bias_init=class_prediction_bias_init,
use_depthwise=use_depthwise)
other_heads = {}
return convolutional_box_predictor.ConvolutionalBoxPredictor(
is_training=is_training,
num_classes=num_classes,
box_prediction_head=box_prediction_head,
class_prediction_head=class_prediction_head,
other_heads=other_heads,
conv_hyperparams_fn=conv_hyperparams_fn,
num_layers_before_predictor=num_layers_before_predictor,
min_depth=min_depth,
max_depth=max_depth)
def build_convolutional_keras_box_predictor(is_training,
num_classes,
conv_hyperparams,
freeze_batchnorm,
inplace_batchnorm_update,
num_predictions_per_location_list,
min_depth,
max_depth,
num_layers_before_predictor,
use_dropout,
dropout_keep_prob,
kernel_size,
box_code_size,
add_background_class=True,
class_prediction_bias_init=0.0,
use_depthwise=False,
box_encodings_clip_range=None,
name='BoxPredictor'):
"""Builds the Keras ConvolutionalBoxPredictor from the arguments.
Args:
is_training: Indicates whether the BoxPredictor is in training mode.
num_classes: number of classes. Note that num_classes *does not*
include the background category, so if groundtruth labels take values
in {0, 1, .., K-1}, num_classes=K (and not K+1, even though the
assigned classification targets can range from {0,... K}).
conv_hyperparams: A `hyperparams_builder.KerasLayerHyperparams` object
containing hyperparameters for convolution ops.
freeze_batchnorm: Whether to freeze batch norm parameters during
training or not. When training with a small batch size (e.g. 1), it is
desirable to freeze batch norm update and use pretrained batch norm
params.
inplace_batchnorm_update: Whether to update batch norm moving average
values inplace. When this is false train op must add a control
dependency on tf.graphkeys.UPDATE_OPS collection in order to update
batch norm statistics.
num_predictions_per_location_list: A list of integers representing the
number of box predictions to be made per spatial location for each
feature map.
min_depth: Minimum feature depth prior to predicting box encodings
and class predictions.
max_depth: Maximum feature depth prior to predicting box encodings
and class predictions. If max_depth is set to 0, no additional
feature map will be inserted before location and class predictions.
num_layers_before_predictor: Number of the additional conv layers before
the predictor.
use_dropout: Option to use dropout or not. Note that a single dropout
op is applied here prior to both box and class predictions, which stands
in contrast to the ConvolutionalBoxPredictor below.
dropout_keep_prob: Keep probability for dropout.
This is only used if use_dropout is True.
kernel_size: Size of final convolution kernel. If the
spatial resolution of the feature map is smaller than the kernel size,
then the kernel size is automatically set to be
min(feature_width, feature_height).
box_code_size: Size of encoding for each box.
add_background_class: Whether to add an implicit background class.
class_prediction_bias_init: constant value to initialize bias of the last
conv2d layer before class prediction.
use_depthwise: Whether to use depthwise convolutions for prediction
steps. Default is False.
box_encodings_clip_range: Min and max values for clipping the box_encodings.
name: A string name scope to assign to the box predictor. If `None`, Keras
will auto-generate one from the class name.
Returns:
A Keras ConvolutionalBoxPredictor class.
"""
box_prediction_heads = []
class_prediction_heads = []
other_heads = {}
for stack_index, num_predictions_per_location in enumerate(
num_predictions_per_location_list):
box_prediction_heads.append(
keras_box_head.ConvolutionalBoxHead(
is_training=is_training,
box_code_size=box_code_size,
kernel_size=kernel_size,
conv_hyperparams=conv_hyperparams,
freeze_batchnorm=freeze_batchnorm,
num_predictions_per_location=num_predictions_per_location,
use_depthwise=use_depthwise,
box_encodings_clip_range=box_encodings_clip_range,
name='ConvolutionalBoxHead_%d' % stack_index))
class_prediction_heads.append(
keras_class_head.ConvolutionalClassHead(
is_training=is_training,
num_class_slots=(
num_classes + 1 if add_background_class else num_classes),
use_dropout=use_dropout,
dropout_keep_prob=dropout_keep_prob,
kernel_size=kernel_size,
conv_hyperparams=conv_hyperparams,
freeze_batchnorm=freeze_batchnorm,
num_predictions_per_location=num_predictions_per_location,
class_prediction_bias_init=class_prediction_bias_init,
use_depthwise=use_depthwise,
name='ConvolutionalClassHead_%d' % stack_index))
return convolutional_keras_box_predictor.ConvolutionalBoxPredictor(
is_training=is_training,
num_classes=num_classes,
box_prediction_heads=box_prediction_heads,
class_prediction_heads=class_prediction_heads,
other_heads=other_heads,
conv_hyperparams=conv_hyperparams,
num_layers_before_predictor=num_layers_before_predictor,
min_depth=min_depth,
max_depth=max_depth,
freeze_batchnorm=freeze_batchnorm,
inplace_batchnorm_update=inplace_batchnorm_update,
name=name)
def build_weight_shared_convolutional_box_predictor(
is_training,
num_classes,
conv_hyperparams_fn,
depth,
num_layers_before_predictor,
box_code_size,
kernel_size=3,
add_background_class=True,
class_prediction_bias_init=0.0,
use_dropout=False,
dropout_keep_prob=0.8,
share_prediction_tower=False,
apply_batch_norm=True,
use_depthwise=False,
score_converter_fn=tf.identity,
box_encodings_clip_range=None,
keyword_args=None):
"""Builds and returns a WeightSharedConvolutionalBoxPredictor class.
Args:
is_training: Indicates whether the BoxPredictor is in training mode.
num_classes: number of classes. Note that num_classes *does not*
include the background category, so if groundtruth labels take values
in {0, 1, .., K-1}, num_classes=K (and not K+1, even though the
assigned classification targets can range from {0,... K}).
conv_hyperparams_fn: A function to generate tf-slim arg_scope with
hyperparameters for convolution ops.
depth: depth of conv layers.
num_layers_before_predictor: Number of the additional conv layers before
the predictor.
box_code_size: Size of encoding for each box.
kernel_size: Size of final convolution kernel.
add_background_class: Whether to add an implicit background class.
class_prediction_bias_init: constant value to initialize bias of the last
conv2d layer before class prediction.
use_dropout: Whether to apply dropout to class prediction head.
dropout_keep_prob: Probability of keeping activiations.
share_prediction_tower: Whether to share the multi-layer tower between box
prediction and class prediction heads.
apply_batch_norm: Whether to apply batch normalization to conv layers in
this predictor.
use_depthwise: Whether to use depthwise separable conv2d instead of conv2d.
score_converter_fn: Callable score converter to perform elementwise op on
class scores.
box_encodings_clip_range: Min and max values for clipping the box_encodings.
keyword_args: A dictionary with additional args.
Returns:
A WeightSharedConvolutionalBoxPredictor class.
"""
box_prediction_head = box_head.WeightSharedConvolutionalBoxHead(
box_code_size=box_code_size,
kernel_size=kernel_size,
use_depthwise=use_depthwise,
box_encodings_clip_range=box_encodings_clip_range)
class_prediction_head = (
class_head.WeightSharedConvolutionalClassHead(
num_class_slots=(
num_classes + 1 if add_background_class else num_classes),
kernel_size=kernel_size,
class_prediction_bias_init=class_prediction_bias_init,
use_dropout=use_dropout,
dropout_keep_prob=dropout_keep_prob,
use_depthwise=use_depthwise,
score_converter_fn=score_converter_fn))
other_heads = {}
return convolutional_box_predictor.WeightSharedConvolutionalBoxPredictor(
is_training=is_training,
num_classes=num_classes,
box_prediction_head=box_prediction_head,
class_prediction_head=class_prediction_head,
other_heads=other_heads,
conv_hyperparams_fn=conv_hyperparams_fn,
depth=depth,
num_layers_before_predictor=num_layers_before_predictor,
kernel_size=kernel_size,
apply_batch_norm=apply_batch_norm,
share_prediction_tower=share_prediction_tower,
use_depthwise=use_depthwise)
def build_weight_shared_convolutional_keras_box_predictor(
is_training,
num_classes,
conv_hyperparams,
freeze_batchnorm,
inplace_batchnorm_update,
num_predictions_per_location_list,
depth,
num_layers_before_predictor,
box_code_size,
kernel_size=3,
add_background_class=True,
class_prediction_bias_init=0.0,
use_dropout=False,
dropout_keep_prob=0.8,
share_prediction_tower=False,
apply_batch_norm=True,
use_depthwise=False,
apply_conv_hyperparams_to_heads=False,
apply_conv_hyperparams_pointwise=False,
score_converter_fn=tf.identity,
box_encodings_clip_range=None,
name='WeightSharedConvolutionalBoxPredictor',
keyword_args=None):
"""Builds the Keras WeightSharedConvolutionalBoxPredictor from the arguments.
Args:
is_training: Indicates whether the BoxPredictor is in training mode.
num_classes: number of classes. Note that num_classes *does not*
include the background category, so if groundtruth labels take values
in {0, 1, .., K-1}, num_classes=K (and not K+1, even though the
assigned classification targets can range from {0,... K}).
conv_hyperparams: A `hyperparams_builder.KerasLayerHyperparams` object
containing hyperparameters for convolution ops.
freeze_batchnorm: Whether to freeze batch norm parameters during
training or not. When training with a small batch size (e.g. 1), it is
desirable to freeze batch norm update and use pretrained batch norm
params.
inplace_batchnorm_update: Whether to update batch norm moving average
values inplace. When this is false train op must add a control
dependency on tf.graphkeys.UPDATE_OPS collection in order to update
batch norm statistics.
num_predictions_per_location_list: A list of integers representing the
number of box predictions to be made per spatial location for each
feature map.
depth: depth of conv layers.
num_layers_before_predictor: Number of the additional conv layers before
the predictor.
box_code_size: Size of encoding for each box.
kernel_size: Size of final convolution kernel.
add_background_class: Whether to add an implicit background class.
class_prediction_bias_init: constant value to initialize bias of the last
conv2d layer before class prediction.
use_dropout: Whether to apply dropout to class prediction head.
dropout_keep_prob: Probability of keeping activiations.
share_prediction_tower: Whether to share the multi-layer tower between box
prediction and class prediction heads.
apply_batch_norm: Whether to apply batch normalization to conv layers in
this predictor.
use_depthwise: Whether to use depthwise separable conv2d instead of conv2d.
apply_conv_hyperparams_to_heads: Whether to apply conv_hyperparams to
depthwise seperable convolution layers in the box and class heads. By
default, the conv_hyperparams are only applied to layers in the predictor
tower when using depthwise separable convolutions.
apply_conv_hyperparams_pointwise: Whether to apply the conv_hyperparams to
the pointwise_initializer and pointwise_regularizer when using depthwise
separable convolutions. By default, conv_hyperparams are only applied to
the depthwise initializer and regularizer when use_depthwise is true.
score_converter_fn: Callable score converter to perform elementwise op on
class scores.
box_encodings_clip_range: Min and max values for clipping the box_encodings.
name: A string name scope to assign to the box predictor. If `None`, Keras
will auto-generate one from the class name.
keyword_args: A dictionary with additional args.
Returns:
A Keras WeightSharedConvolutionalBoxPredictor class.
"""
if len(set(num_predictions_per_location_list)) > 1:
raise ValueError('num predictions per location must be same for all'
'feature maps, found: {}'.format(
num_predictions_per_location_list))
num_predictions_per_location = num_predictions_per_location_list[0]
box_prediction_head = keras_box_head.WeightSharedConvolutionalBoxHead(
box_code_size=box_code_size,
kernel_size=kernel_size,
conv_hyperparams=conv_hyperparams,
num_predictions_per_location=num_predictions_per_location,
use_depthwise=use_depthwise,
apply_conv_hyperparams_to_heads=apply_conv_hyperparams_to_heads,
box_encodings_clip_range=box_encodings_clip_range,
name='WeightSharedConvolutionalBoxHead')
class_prediction_head = keras_class_head.WeightSharedConvolutionalClassHead(
num_class_slots=(
num_classes + 1 if add_background_class else num_classes),
use_dropout=use_dropout,
dropout_keep_prob=dropout_keep_prob,
kernel_size=kernel_size,
conv_hyperparams=conv_hyperparams,
num_predictions_per_location=num_predictions_per_location,
class_prediction_bias_init=class_prediction_bias_init,
use_depthwise=use_depthwise,
apply_conv_hyperparams_to_heads=apply_conv_hyperparams_to_heads,
score_converter_fn=score_converter_fn,
name='WeightSharedConvolutionalClassHead')
other_heads = {}
return (
convolutional_keras_box_predictor.WeightSharedConvolutionalBoxPredictor(
is_training=is_training,
num_classes=num_classes,
box_prediction_head=box_prediction_head,
class_prediction_head=class_prediction_head,
other_heads=other_heads,
conv_hyperparams=conv_hyperparams,
depth=depth,
num_layers_before_predictor=num_layers_before_predictor,
freeze_batchnorm=freeze_batchnorm,
inplace_batchnorm_update=inplace_batchnorm_update,
kernel_size=kernel_size,
apply_batch_norm=apply_batch_norm,
share_prediction_tower=share_prediction_tower,
use_depthwise=use_depthwise,
apply_conv_hyperparams_pointwise=apply_conv_hyperparams_pointwise,
name=name))
def build_mask_rcnn_keras_box_predictor(is_training,
num_classes,
fc_hyperparams,
freeze_batchnorm,
use_dropout,
dropout_keep_prob,
box_code_size,
add_background_class=True,
share_box_across_classes=False,
predict_instance_masks=False,
conv_hyperparams=None,
mask_height=14,
mask_width=14,
mask_prediction_num_conv_layers=2,
mask_prediction_conv_depth=256,
masks_are_class_agnostic=False,
convolve_then_upsample_masks=False):
"""Builds and returns a MaskRCNNKerasBoxPredictor class.
Args:
is_training: Indicates whether the BoxPredictor is in training mode.
num_classes: number of classes. Note that num_classes *does not*
include the background category, so if groundtruth labels take values
in {0, 1, .., K-1}, num_classes=K (and not K+1, even though the
assigned classification targets can range from {0,... K}).
fc_hyperparams: A `hyperparams_builder.KerasLayerHyperparams` object
containing hyperparameters for fully connected dense ops.
freeze_batchnorm: Whether to freeze batch norm parameters during
training or not. When training with a small batch size (e.g. 1), it is
desirable to freeze batch norm update and use pretrained batch norm
params.
use_dropout: Option to use dropout or not. Note that a single dropout
op is applied here prior to both box and class predictions, which stands
in contrast to the ConvolutionalBoxPredictor below.
dropout_keep_prob: Keep probability for dropout.
This is only used if use_dropout is True.
box_code_size: Size of encoding for each box.
add_background_class: Whether to add an implicit background class.
share_box_across_classes: Whether to share boxes across classes rather
than use a different box for each class.
predict_instance_masks: If True, will add a third stage mask prediction
to the returned class.
conv_hyperparams: A `hyperparams_builder.KerasLayerHyperparams` object
containing hyperparameters for convolution ops.
mask_height: Desired output mask height. The default value is 14.
mask_width: Desired output mask width. The default value is 14.
mask_prediction_num_conv_layers: Number of convolution layers applied to
the image_features in mask prediction branch.
mask_prediction_conv_depth: The depth for the first conv2d_transpose op
applied to the image_features in the mask prediction branch. If set
to 0, the depth of the convolution layers will be automatically chosen
based on the number of object classes and the number of channels in the
image features.
masks_are_class_agnostic: Boolean determining if the mask-head is
class-agnostic or not.
convolve_then_upsample_masks: Whether to apply convolutions on mask
features before upsampling using nearest neighbor resizing. Otherwise,
mask features are resized to [`mask_height`, `mask_width`] using
bilinear resizing before applying convolutions.
Returns:
A MaskRCNNKerasBoxPredictor class.
"""
box_prediction_head = keras_box_head.MaskRCNNBoxHead(
is_training=is_training,
num_classes=num_classes,
fc_hyperparams=fc_hyperparams,
freeze_batchnorm=freeze_batchnorm,
use_dropout=use_dropout,
dropout_keep_prob=dropout_keep_prob,
box_code_size=box_code_size,
share_box_across_classes=share_box_across_classes)
class_prediction_head = keras_class_head.MaskRCNNClassHead(
is_training=is_training,
num_class_slots=num_classes + 1 if add_background_class else num_classes,
fc_hyperparams=fc_hyperparams,
freeze_batchnorm=freeze_batchnorm,
use_dropout=use_dropout,
dropout_keep_prob=dropout_keep_prob)
third_stage_heads = {}
if predict_instance_masks:
third_stage_heads[
mask_rcnn_box_predictor.
MASK_PREDICTIONS] = keras_mask_head.MaskRCNNMaskHead(
is_training=is_training,
num_classes=num_classes,
conv_hyperparams=conv_hyperparams,
freeze_batchnorm=freeze_batchnorm,
mask_height=mask_height,
mask_width=mask_width,
mask_prediction_num_conv_layers=mask_prediction_num_conv_layers,
mask_prediction_conv_depth=mask_prediction_conv_depth,
masks_are_class_agnostic=masks_are_class_agnostic,
convolve_then_upsample=convolve_then_upsample_masks)
return mask_rcnn_keras_box_predictor.MaskRCNNKerasBoxPredictor(
is_training=is_training,
num_classes=num_classes,
freeze_batchnorm=freeze_batchnorm,
box_prediction_head=box_prediction_head,
class_prediction_head=class_prediction_head,
third_stage_heads=third_stage_heads)
def build_mask_rcnn_box_predictor(is_training,
num_classes,
fc_hyperparams_fn,
use_dropout,
dropout_keep_prob,
box_code_size,
add_background_class=True,
share_box_across_classes=False,
predict_instance_masks=False,
conv_hyperparams_fn=None,
mask_height=14,
mask_width=14,
mask_prediction_num_conv_layers=2,
mask_prediction_conv_depth=256,
masks_are_class_agnostic=False,
convolve_then_upsample_masks=False):
"""Builds and returns a MaskRCNNBoxPredictor class.
Args:
is_training: Indicates whether the BoxPredictor is in training mode.
num_classes: number of classes. Note that num_classes *does not*
include the background category, so if groundtruth labels take values
in {0, 1, .., K-1}, num_classes=K (and not K+1, even though the
assigned classification targets can range from {0,... K}).
fc_hyperparams_fn: A function to generate tf-slim arg_scope with
hyperparameters for fully connected ops.
use_dropout: Option to use dropout or not. Note that a single dropout
op is applied here prior to both box and class predictions, which stands
in contrast to the ConvolutionalBoxPredictor below.
dropout_keep_prob: Keep probability for dropout.
This is only used if use_dropout is True.
box_code_size: Size of encoding for each box.
add_background_class: Whether to add an implicit background class.
share_box_across_classes: Whether to share boxes across classes rather
than use a different box for each class.
predict_instance_masks: If True, will add a third stage mask prediction
to the returned class.
conv_hyperparams_fn: A function to generate tf-slim arg_scope with
hyperparameters for convolution ops.
mask_height: Desired output mask height. The default value is 14.
mask_width: Desired output mask width. The default value is 14.
mask_prediction_num_conv_layers: Number of convolution layers applied to
the image_features in mask prediction branch.
mask_prediction_conv_depth: The depth for the first conv2d_transpose op
applied to the image_features in the mask prediction branch. If set
to 0, the depth of the convolution layers will be automatically chosen
based on the number of object classes and the number of channels in the
image features.
masks_are_class_agnostic: Boolean determining if the mask-head is
class-agnostic or not.
convolve_then_upsample_masks: Whether to apply convolutions on mask
features before upsampling using nearest neighbor resizing. Otherwise,
mask features are resized to [`mask_height`, `mask_width`] using
bilinear resizing before applying convolutions.
Returns:
A MaskRCNNBoxPredictor class.
"""
box_prediction_head = box_head.MaskRCNNBoxHead(
is_training=is_training,
num_classes=num_classes,
fc_hyperparams_fn=fc_hyperparams_fn,
use_dropout=use_dropout,
dropout_keep_prob=dropout_keep_prob,
box_code_size=box_code_size,
share_box_across_classes=share_box_across_classes)
class_prediction_head = class_head.MaskRCNNClassHead(
is_training=is_training,
num_class_slots=num_classes + 1 if add_background_class else num_classes,
fc_hyperparams_fn=fc_hyperparams_fn,
use_dropout=use_dropout,
dropout_keep_prob=dropout_keep_prob)
third_stage_heads = {}
if predict_instance_masks:
third_stage_heads[
mask_rcnn_box_predictor.
MASK_PREDICTIONS] = mask_head.MaskRCNNMaskHead(
num_classes=num_classes,
conv_hyperparams_fn=conv_hyperparams_fn,
mask_height=mask_height,
mask_width=mask_width,
mask_prediction_num_conv_layers=mask_prediction_num_conv_layers,
mask_prediction_conv_depth=mask_prediction_conv_depth,
masks_are_class_agnostic=masks_are_class_agnostic,
convolve_then_upsample=convolve_then_upsample_masks)
return mask_rcnn_box_predictor.MaskRCNNBoxPredictor(
is_training=is_training,
num_classes=num_classes,
box_prediction_head=box_prediction_head,
class_prediction_head=class_prediction_head,
third_stage_heads=third_stage_heads)
def build_score_converter(score_converter_config, is_training):
"""Builds score converter based on the config.
Builds one of [tf.identity, tf.sigmoid] score converters based on the config
and whether the BoxPredictor is for training or inference.
Args:
score_converter_config:
box_predictor_pb2.WeightSharedConvolutionalBoxPredictor.score_converter.
is_training: Indicates whether the BoxPredictor is in training mode.
Returns:
Callable score converter op.
Raises:
ValueError: On unknown score converter.
"""
if score_converter_config == (
box_predictor_pb2.WeightSharedConvolutionalBoxPredictor.IDENTITY):
return tf.identity
if score_converter_config == (
box_predictor_pb2.WeightSharedConvolutionalBoxPredictor.SIGMOID):
return tf.identity if is_training else tf.sigmoid
raise ValueError('Unknown score converter.')
BoxEncodingsClipRange = collections.namedtuple('BoxEncodingsClipRange',
['min', 'max'])
def build(argscope_fn, box_predictor_config, is_training, num_classes,
add_background_class=True):
"""Builds box predictor based on the configuration.
Builds box predictor based on the configuration. See box_predictor.proto for
configurable options. Also, see box_predictor.py for more details.
Args:
argscope_fn: A function that takes the following inputs:
* hyperparams_pb2.Hyperparams proto
* a boolean indicating if the model is in training mode.
and returns a tf slim argscope for Conv and FC hyperparameters.
box_predictor_config: box_predictor_pb2.BoxPredictor proto containing
configuration.
is_training: Whether the models is in training mode.
num_classes: Number of classes to predict.
add_background_class: Whether to add an implicit background class.
Returns:
box_predictor: box_predictor.BoxPredictor object.
Raises:
ValueError: On unknown box predictor.
"""
if not isinstance(box_predictor_config, box_predictor_pb2.BoxPredictor):
raise ValueError('box_predictor_config not of type '
'box_predictor_pb2.BoxPredictor.')
box_predictor_oneof = box_predictor_config.WhichOneof('box_predictor_oneof')
if box_predictor_oneof == 'convolutional_box_predictor':
config_box_predictor = box_predictor_config.convolutional_box_predictor
conv_hyperparams_fn = argscope_fn(config_box_predictor.conv_hyperparams,
is_training)
# Optionally apply clipping to box encodings, when box_encodings_clip_range
# is set.
box_encodings_clip_range = None
if config_box_predictor.HasField('box_encodings_clip_range'):
box_encodings_clip_range = BoxEncodingsClipRange(
min=config_box_predictor.box_encodings_clip_range.min,
max=config_box_predictor.box_encodings_clip_range.max)
return build_convolutional_box_predictor(
is_training=is_training,
num_classes=num_classes,
add_background_class=add_background_class,
conv_hyperparams_fn=conv_hyperparams_fn,
use_dropout=config_box_predictor.use_dropout,
dropout_keep_prob=config_box_predictor.dropout_keep_probability,
box_code_size=config_box_predictor.box_code_size,
kernel_size=config_box_predictor.kernel_size,
num_layers_before_predictor=(
config_box_predictor.num_layers_before_predictor),
min_depth=config_box_predictor.min_depth,
max_depth=config_box_predictor.max_depth,
apply_sigmoid_to_scores=config_box_predictor.apply_sigmoid_to_scores,
class_prediction_bias_init=(
config_box_predictor.class_prediction_bias_init),
use_depthwise=config_box_predictor.use_depthwise,
box_encodings_clip_range=box_encodings_clip_range)
if box_predictor_oneof == 'weight_shared_convolutional_box_predictor':
config_box_predictor = (
box_predictor_config.weight_shared_convolutional_box_predictor)
conv_hyperparams_fn = argscope_fn(config_box_predictor.conv_hyperparams,
is_training)
apply_batch_norm = config_box_predictor.conv_hyperparams.HasField(
'batch_norm')
# During training phase, logits are used to compute the loss. Only apply
# sigmoid at inference to make the inference graph TPU friendly.
score_converter_fn = build_score_converter(
config_box_predictor.score_converter, is_training)
# Optionally apply clipping to box encodings, when box_encodings_clip_range
# is set.
box_encodings_clip_range = None
if config_box_predictor.HasField('box_encodings_clip_range'):
box_encodings_clip_range = BoxEncodingsClipRange(
min=config_box_predictor.box_encodings_clip_range.min,
max=config_box_predictor.box_encodings_clip_range.max)
keyword_args = None
return build_weight_shared_convolutional_box_predictor(
is_training=is_training,
num_classes=num_classes,
add_background_class=add_background_class,
conv_hyperparams_fn=conv_hyperparams_fn,
depth=config_box_predictor.depth,
num_layers_before_predictor=(
config_box_predictor.num_layers_before_predictor),
box_code_size=config_box_predictor.box_code_size,
kernel_size=config_box_predictor.kernel_size,
class_prediction_bias_init=(
config_box_predictor.class_prediction_bias_init),
use_dropout=config_box_predictor.use_dropout,
dropout_keep_prob=config_box_predictor.dropout_keep_probability,
share_prediction_tower=config_box_predictor.share_prediction_tower,
apply_batch_norm=apply_batch_norm,
use_depthwise=config_box_predictor.use_depthwise,
score_converter_fn=score_converter_fn,
box_encodings_clip_range=box_encodings_clip_range,
keyword_args=keyword_args)
if box_predictor_oneof == 'mask_rcnn_box_predictor':
config_box_predictor = box_predictor_config.mask_rcnn_box_predictor
fc_hyperparams_fn = argscope_fn(config_box_predictor.fc_hyperparams,
is_training)
conv_hyperparams_fn = None
if config_box_predictor.HasField('conv_hyperparams'):
conv_hyperparams_fn = argscope_fn(
config_box_predictor.conv_hyperparams, is_training)
return build_mask_rcnn_box_predictor(
is_training=is_training,
num_classes=num_classes,
add_background_class=add_background_class,
fc_hyperparams_fn=fc_hyperparams_fn,
use_dropout=config_box_predictor.use_dropout,
dropout_keep_prob=config_box_predictor.dropout_keep_probability,
box_code_size=config_box_predictor.box_code_size,
share_box_across_classes=(
config_box_predictor.share_box_across_classes),
predict_instance_masks=config_box_predictor.predict_instance_masks,
conv_hyperparams_fn=conv_hyperparams_fn,
mask_height=config_box_predictor.mask_height,
mask_width=config_box_predictor.mask_width,
mask_prediction_num_conv_layers=(
config_box_predictor.mask_prediction_num_conv_layers),
mask_prediction_conv_depth=(
config_box_predictor.mask_prediction_conv_depth),
masks_are_class_agnostic=(
config_box_predictor.masks_are_class_agnostic),
convolve_then_upsample_masks=(
config_box_predictor.convolve_then_upsample_masks))
if box_predictor_oneof == 'rfcn_box_predictor':
config_box_predictor = box_predictor_config.rfcn_box_predictor
conv_hyperparams_fn = argscope_fn(config_box_predictor.conv_hyperparams,
is_training)
box_predictor_object = rfcn_box_predictor.RfcnBoxPredictor(
is_training=is_training,
num_classes=num_classes,
conv_hyperparams_fn=conv_hyperparams_fn,
crop_size=[config_box_predictor.crop_height,
config_box_predictor.crop_width],
num_spatial_bins=[config_box_predictor.num_spatial_bins_height,
config_box_predictor.num_spatial_bins_width],
depth=config_box_predictor.depth,
box_code_size=config_box_predictor.box_code_size)
return box_predictor_object
raise ValueError('Unknown box predictor: {}'.format(box_predictor_oneof))
def build_keras(hyperparams_fn, freeze_batchnorm, inplace_batchnorm_update,
num_predictions_per_location_list, box_predictor_config,
is_training, num_classes, add_background_class=True):
"""Builds a Keras-based box predictor based on the configuration.
Builds Keras-based box predictor based on the configuration.
See box_predictor.proto for configurable options. Also, see box_predictor.py
for more details.
Args:
hyperparams_fn: A function that takes a hyperparams_pb2.Hyperparams
proto and returns a `hyperparams_builder.KerasLayerHyperparams`
for Conv or FC hyperparameters.
freeze_batchnorm: Whether to freeze batch norm parameters during
training or not. When training with a small batch size (e.g. 1), it is
desirable to freeze batch norm update and use pretrained batch norm
params.
inplace_batchnorm_update: Whether to update batch norm moving average
values inplace. When this is false train op must add a control
dependency on tf.graphkeys.UPDATE_OPS collection in order to update
batch norm statistics.
num_predictions_per_location_list: A list of integers representing the
number of box predictions to be made per spatial location for each
feature map.
box_predictor_config: box_predictor_pb2.BoxPredictor proto containing
configuration.
is_training: Whether the models is in training mode.
num_classes: Number of classes to predict.
add_background_class: Whether to add an implicit background class.
Returns:
box_predictor: box_predictor.KerasBoxPredictor object.
Raises:
ValueError: On unknown box predictor, or one with no Keras box predictor.
"""
if not isinstance(box_predictor_config, box_predictor_pb2.BoxPredictor):
raise ValueError('box_predictor_config not of type '
'box_predictor_pb2.BoxPredictor.')
box_predictor_oneof = box_predictor_config.WhichOneof('box_predictor_oneof')
if box_predictor_oneof == 'convolutional_box_predictor':
config_box_predictor = box_predictor_config.convolutional_box_predictor
conv_hyperparams = hyperparams_fn(
config_box_predictor.conv_hyperparams)
# Optionally apply clipping to box encodings, when box_encodings_clip_range
# is set.
box_encodings_clip_range = None
if config_box_predictor.HasField('box_encodings_clip_range'):
box_encodings_clip_range = BoxEncodingsClipRange(
min=config_box_predictor.box_encodings_clip_range.min,
max=config_box_predictor.box_encodings_clip_range.max)
return build_convolutional_keras_box_predictor(
is_training=is_training,
num_classes=num_classes,
add_background_class=add_background_class,
conv_hyperparams=conv_hyperparams,
freeze_batchnorm=freeze_batchnorm,
inplace_batchnorm_update=inplace_batchnorm_update,
num_predictions_per_location_list=num_predictions_per_location_list,
use_dropout=config_box_predictor.use_dropout,
dropout_keep_prob=config_box_predictor.dropout_keep_probability,
box_code_size=config_box_predictor.box_code_size,
kernel_size=config_box_predictor.kernel_size,
num_layers_before_predictor=(
config_box_predictor.num_layers_before_predictor),
min_depth=config_box_predictor.min_depth,
max_depth=config_box_predictor.max_depth,
class_prediction_bias_init=(
config_box_predictor.class_prediction_bias_init),
use_depthwise=config_box_predictor.use_depthwise,
box_encodings_clip_range=box_encodings_clip_range)
if box_predictor_oneof == 'weight_shared_convolutional_box_predictor':
config_box_predictor = (
box_predictor_config.weight_shared_convolutional_box_predictor)
conv_hyperparams = hyperparams_fn(config_box_predictor.conv_hyperparams)
apply_batch_norm = config_box_predictor.conv_hyperparams.HasField(
'batch_norm')
# During training phase, logits are used to compute the loss. Only apply
# sigmoid at inference to make the inference graph TPU friendly. This is
# required because during TPU inference, model.postprocess is not called.
score_converter_fn = build_score_converter(
config_box_predictor.score_converter, is_training)
# Optionally apply clipping to box encodings, when box_encodings_clip_range
# is set.
box_encodings_clip_range = None
if config_box_predictor.HasField('box_encodings_clip_range'):
box_encodings_clip_range = BoxEncodingsClipRange(
min=config_box_predictor.box_encodings_clip_range.min,
max=config_box_predictor.box_encodings_clip_range.max)
keyword_args = None
return build_weight_shared_convolutional_keras_box_predictor(
is_training=is_training,
num_classes=num_classes,
conv_hyperparams=conv_hyperparams,
freeze_batchnorm=freeze_batchnorm,
inplace_batchnorm_update=inplace_batchnorm_update,
num_predictions_per_location_list=num_predictions_per_location_list,
depth=config_box_predictor.depth,
num_layers_before_predictor=(
config_box_predictor.num_layers_before_predictor),
box_code_size=config_box_predictor.box_code_size,
kernel_size=config_box_predictor.kernel_size,
add_background_class=add_background_class,
class_prediction_bias_init=(
config_box_predictor.class_prediction_bias_init),
use_dropout=config_box_predictor.use_dropout,
dropout_keep_prob=config_box_predictor.dropout_keep_probability,
share_prediction_tower=config_box_predictor.share_prediction_tower,
apply_batch_norm=apply_batch_norm,
use_depthwise=config_box_predictor.use_depthwise,
apply_conv_hyperparams_to_heads=(
config_box_predictor.apply_conv_hyperparams_to_heads),
apply_conv_hyperparams_pointwise=(
config_box_predictor.apply_conv_hyperparams_pointwise),
score_converter_fn=score_converter_fn,
box_encodings_clip_range=box_encodings_clip_range,
keyword_args=keyword_args)
if box_predictor_oneof == 'mask_rcnn_box_predictor':
config_box_predictor = box_predictor_config.mask_rcnn_box_predictor
fc_hyperparams = hyperparams_fn(config_box_predictor.fc_hyperparams)
conv_hyperparams = None
if config_box_predictor.HasField('conv_hyperparams'):
conv_hyperparams = hyperparams_fn(
config_box_predictor.conv_hyperparams)
return build_mask_rcnn_keras_box_predictor(
is_training=is_training,
num_classes=num_classes,
add_background_class=add_background_class,
fc_hyperparams=fc_hyperparams,
freeze_batchnorm=freeze_batchnorm,
use_dropout=config_box_predictor.use_dropout,
dropout_keep_prob=config_box_predictor.dropout_keep_probability,
box_code_size=config_box_predictor.box_code_size,
share_box_across_classes=(
config_box_predictor.share_box_across_classes),
predict_instance_masks=config_box_predictor.predict_instance_masks,
conv_hyperparams=conv_hyperparams,
mask_height=config_box_predictor.mask_height,
mask_width=config_box_predictor.mask_width,
mask_prediction_num_conv_layers=(
config_box_predictor.mask_prediction_num_conv_layers),
mask_prediction_conv_depth=(
config_box_predictor.mask_prediction_conv_depth),
masks_are_class_agnostic=(
config_box_predictor.masks_are_class_agnostic),
convolve_then_upsample_masks=(
config_box_predictor.convolve_then_upsample_masks))
if box_predictor_oneof == 'rfcn_box_predictor':
config_box_predictor = box_predictor_config.rfcn_box_predictor
conv_hyperparams = hyperparams_fn(config_box_predictor.conv_hyperparams)
box_predictor_object = rfcn_keras_box_predictor.RfcnKerasBoxPredictor(
is_training=is_training,
num_classes=num_classes,
conv_hyperparams=conv_hyperparams,
freeze_batchnorm=freeze_batchnorm,
crop_size=[config_box_predictor.crop_height,
config_box_predictor.crop_width],
num_spatial_bins=[config_box_predictor.num_spatial_bins_height,
config_box_predictor.num_spatial_bins_width],
depth=config_box_predictor.depth,
box_code_size=config_box_predictor.box_code_size)
return box_predictor_object
raise ValueError(
'Unknown box predictor for Keras: {}'.format(box_predictor_oneof))
| 49.448137
| 81
| 0.712028
| 5,925
| 49,102
| 5.53097
| 0.064473
| 0.080193
| 0.063715
| 0.030759
| 0.900919
| 0.890269
| 0.872174
| 0.856519
| 0.831009
| 0.81267
| 0
| 0.003095
| 0.24331
| 49,102
| 992
| 82
| 49.497984
| 0.878913
| 0.369659
| 0
| 0.808874
| 0
| 0
| 0.029998
| 0.017493
| 0
| 0
| 0
| 0
| 0
| 1
| 0.015358
| false
| 0
| 0.025597
| 0
| 0.068259
| 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
|
811cb816abc2ce19431a94ecc4127a0ebc68d4c6
| 18,997
|
py
|
Python
|
osmtm/tests/test_task.py
|
alejandroscf/osm-tasking-manager2
|
74d59e14de3cd805b0b5afce58bdea04e8aa56b6
|
[
"BSD-2-Clause"
] | null | null | null |
osmtm/tests/test_task.py
|
alejandroscf/osm-tasking-manager2
|
74d59e14de3cd805b0b5afce58bdea04e8aa56b6
|
[
"BSD-2-Clause"
] | null | null | null |
osmtm/tests/test_task.py
|
alejandroscf/osm-tasking-manager2
|
74d59e14de3cd805b0b5afce58bdea04e8aa56b6
|
[
"BSD-2-Clause"
] | null | null | null |
from . import BaseTestCase
class TestTaskFunctional(BaseTestCase):
def test_task(self):
self.testapp.get('/project/1/task/1', status=200, xhr=True)
def test_task__not_found(self):
self.testapp.get('/project/1/task/99', status=404, xhr=True)
def test_task__loggedin(self):
headers = self.login_as_user1()
self.testapp.get('/project/1/task/1', status=200,
headers=headers,
xhr=True)
def test_task_empty(self):
self.testapp.get('/project/1/task/empty', status=200, xhr=True)
def test_task_empty__loggedin(self):
headers = self.login_as_user1()
self.testapp.get('/project/1/task/empty', status=200,
headers=headers, xhr=True)
def test_task_done__not_loggedin(self):
self.testapp.get('/project/1/task/1/done', status=401, xhr=True)
def test_task_done__not_locked(self):
headers = self.login_as_user1()
self.testapp.get('/project/1/task/1/done', status=403,
headers=headers,
xhr=True)
def test_task_done__locked(self):
headers = self.login_as_user1()
self.testapp.get('/project/1/task/2/lock', status=200,
headers=headers,
xhr=True)
self.testapp.get('/project/1/task/2/done', status=200,
headers=headers,
xhr=True)
def test_task_lock__not_loggedin(self):
self.testapp.get('/project/1/task/3/lock', status=401, xhr=True)
def test_task_done__comment(self):
headers = self.login_as_user1()
self.testapp.get('/project/1/task/4/lock', status=200,
headers=headers,
xhr=True)
self.testapp.get('/project/1/task/4/done', status=200,
headers=headers,
params={
'comment': 'some_comment'
},
xhr=True)
def test_task_lock(self):
headers_user1 = self.login_as_user1()
res = self.testapp.get('/project/1/task/3/lock', status=200,
headers=headers_user1,
xhr=True)
self.assertTrue(res.json['success'])
headers_user2 = self.login_as_user2()
res = self.testapp.get('/project/1/task/3/lock', status=200,
headers=headers_user2,
xhr=True)
# already locked by user1
self.assertFalse(res.json['success'])
# unlock the tile for later tests
self.testapp.get('/project/1/task/3/unlock',
headers=headers_user1,
xhr=True)
def test_task_lock__other_task_locked(self):
headers = self.login_as_user1()
headers_user1 = self.login_as_user1()
self.testapp.get('/project/1/task/3/lock', status=200,
headers=headers_user1,
xhr=True)
self.testapp.get('/project/1/task/4/lock', status=400,
headers=headers,
xhr=True)
# unlock the tile for later tests
self.testapp.get('/project/1/task/3/unlock',
headers=headers_user1,
xhr=True)
def test_task_unlock(self):
headers = self.login_as_user1()
self.testapp.get('/project/1/task/3/lock', status=200,
headers=headers,
xhr=True)
res = self.testapp.get('/project/1/task/3/unlock', status=200,
headers=headers,
xhr=True)
self.assertTrue(res.json['success'])
def test_task_unlock__comment(self):
headers = self.login_as_user1()
self.testapp.get('/project/1/task/3/lock', status=200,
headers=headers,
xhr=True)
res = self.testapp.get('/project/1/task/3/unlock', status=200,
headers=headers,
params={
'comment': 'some_comment'
},
xhr=True)
self.assertTrue(res.json['success'])
def test_task_comment(self):
headers = self.login_as_user1()
res = self.testapp.get('/project/1/task/3/comment', status=200,
headers=headers,
params={
'comment': 'some_comment'
},
xhr=True)
self.assertTrue(res.json['success'])
def test_task_comment__with_mention(self):
from osmtm.models import Message, DBSession
messages_bef = DBSession.query(Message) \
.filter(Message.to_user_id == self.user2_id) \
.all()
headers = self.login_as_user1()
res = self.testapp.get('/project/1/task/3/comment', status=200,
headers=headers,
params={
'comment': 'some_comment @user2'
},
xhr=True)
self.assertTrue(res.json['success'])
messages_aft = DBSession.query(Message) \
.filter(Message.to_user_id == self.user2_id) \
.all()
self.assertEqual(len(messages_aft), (len(messages_bef) + 1))
res = self.testapp.get('/project/1/task/3', status=200, xhr=True)
# confirm that the convert_mention filter is correctly called
self.assertTrue('<a href="/user/user2">@user2</a>' in res)
def test_task_invalidation__msg(self):
from osmtm.models import Message, DBSession
user1_before_msgs = DBSession.query(Message) \
.filter(Message.to_user_id == self.user1_id).all()
user2_before_msgs = DBSession.query(Message) \
.filter(Message.to_user_id == self.user2_id).all()
headers = self.login_as_user1()
self.testapp.get('/project/1/task/5/lock',
headers=headers,
xhr=True)
self.testapp.get('/project/1/task/5/done', status=200,
headers=headers,
xhr=True)
headers = self.login_as_user2()
self.testapp.get('/project/1/task/5/lock',
headers=headers,
xhr=True)
self.testapp.get('/project/1/task/5/validate', status=200,
params={
'comment': 'a comment',
'validate': True
},
headers=headers,
xhr=True)
headers = self.login_as_project_manager()
self.testapp.get('/project/1/task/5/lock',
headers=headers,
xhr=True)
self.testapp.get('/project/1/task/5/validate', status=200,
params={
'comment': 'a comment',
'invalidate': True
},
headers=headers,
xhr=True)
user1_after_msgs = DBSession.query(Message) \
.filter(Message.to_user_id == self.user1_id).all()
user2_after_msgs = DBSession.query(Message) \
.filter(Message.to_user_id == self.user2_id).all()
self.assertEqual(len(user1_after_msgs), (len(user1_before_msgs) + 1))
self.assertEqual(len(user2_after_msgs), (len(user2_before_msgs) + 1))
def test_task_invalidate(self):
headers = self.login_as_user1()
self.testapp.get('/project/1/task/5/lock',
headers=headers,
xhr=True)
self.testapp.get('/project/1/task/5/done', status=200,
headers=headers,
xhr=True)
headers = self.login_as_user2()
self.testapp.get('/project/1/task/5/lock',
headers=headers,
xhr=True)
self.testapp.get('/project/1/task/5/validate', status=200,
params={
'comment': 'a comment',
'invalidate': True
},
headers=headers,
xhr=True)
def test_task_validate(self):
headers = self.login_as_user1()
self.testapp.get('/project/1/task/7/lock',
headers=headers,
xhr=True)
self.testapp.get('/project/1/task/7/done', status=200,
headers=headers,
xhr=True)
headers = self.login_as_user2()
self.testapp.get('/project/1/task/7/lock',
headers=headers,
xhr=True)
self.testapp.get('/project/1/task/7/validate', status=200,
params={'validate': True},
headers=headers,
xhr=True)
def test_task_split(self):
headers = self.login_as_user1()
self.testapp.get('/project/1/task/6/lock',
headers=headers,
xhr=True)
self.testapp.get('/project/1/task/6/split', status=200,
headers=headers,
xhr=True)
self.testapp.get('/project/1/task/10/lock',
headers=headers,
xhr=True)
self.testapp.get('/project/1/task/10/split', status=200,
headers=headers,
xhr=True)
self.testapp.get('/project/1/task/14/lock',
headers=headers,
xhr=True)
# can't split more than twice
self.testapp.get('/project/1/task/14/split', status=400,
headers=headers,
xhr=True)
# unlock the tile for later tests
self.testapp.get('/project/1/task/14/unlock',
headers=headers,
xhr=True)
# task has been removed
self.testapp.get('/project/1/task/6', status=404, xhr=True)
def test_task_random(self):
headers = self.login_as_user1()
res = self.testapp.get('/project/1/random', status=200,
headers=headers,
xhr=True)
self.assertTrue(res.json['success'])
def test_task_random__bordering_busy_tasks(self):
import geoalchemy2
import shapely
import transaction
from osmtm.models import Task, TaskLock, Area, Project, User, DBSession
shape = shapely.geometry.Polygon(
[(7.23, 41.25), (7.23, 41.12), (7.41, 41.20)])
geometry = geoalchemy2.shape.from_shape(shape, 4326)
area = Area(geometry)
project = Project(u'test project')
project.area = area
project.auto_fill(12)
DBSession.add(project)
DBSession.flush()
project_id = project.id
user2 = DBSession.query(User).filter(User.id == self.user2_id).one()
task = DBSession.query(Task).filter(Task.project_id == project_id) \
.first()
task.locks.append(TaskLock(user=user2, lock=True))
DBSession.add(task)
transaction.commit()
headers = self.login_as_user1()
res = self.testapp.get('/project/%d/random' % project_id, status=200,
headers=headers,
xhr=True)
self.assertTrue(res.json['success'])
def test_task_random__priority_areas(self):
import geoalchemy2
import shapely
import transaction
from osmtm.models import (
Task, TaskLock, Area, Project, PriorityArea, User, DBSession,
)
shape = shapely.geometry.Polygon(
[(7.23, 41.25), (7.23, 41.12), (7.41, 41.20)])
geometry = geoalchemy2.shape.from_shape(shape, 4326)
area = Area(geometry)
project = Project(u'test project')
project.area = area
project.auto_fill(12)
DBSession.add(project)
DBSession.flush()
project_id = project.id
shape = shapely.geometry.Polygon(
[(7.23, 41.25), (7.23, 41.12), (7.24, 41.25)])
geometry = geoalchemy2.shape.from_shape(shape, 4326)
project.priority_areas.append(PriorityArea(geometry))
transaction.commit()
# priority only
headers = self.login_as_user1()
res = self.testapp.get('/project/%d/random' % project_id, status=200,
headers=headers,
xhr=True)
self.assertTrue(res.json['success'])
# priority + busy task
user2 = DBSession.query(User).filter(User.id == self.user2_id).one()
task = DBSession.query(Task).filter(Task.project_id == project_id) \
.first()
task.locks.append(TaskLock(user=user2, lock=True))
DBSession.add(task)
transaction.commit()
headers = self.login_as_user1()
res = self.testapp.get('/project/%d/random' % project_id, status=200,
headers=headers,
xhr=True)
self.assertTrue(res.json['success'])
def test_task_random__none_available(self):
import geoalchemy2
import shapely
import transaction
from osmtm.models import Area, Project, TaskState, DBSession
shape = shapely.geometry.Polygon(
[(7.23, 41.25), (7.23, 41.12), (7.41, 41.20)])
geometry = geoalchemy2.shape.from_shape(shape, 4326)
area = Area(geometry)
project = Project(u'test project')
project.area = area
project.auto_fill(10)
DBSession.add(project)
DBSession.flush()
project_id = project.id
for task in project.tasks:
task.states.append(TaskState(state=TaskState.state_done))
DBSession.add(task)
transaction.commit()
headers = self.login_as_user1()
res = self.testapp.get('/project/%d/random' % project_id, status=200,
headers=headers,
xhr=True)
self.assertFalse(res.json['success'])
def test_task_gpx(self):
self.testapp.get('/project/1/task/1.gpx', status=200)
def test_task_assign__unauthorized(self):
headers = self.login_as_user1()
self.testapp.get('/project/1/task/1/user/user2',
headers=headers,
status=403,
xhr=True)
def test_task_assign__locked(self):
headers = self.login_as_project_manager()
self.testapp.get('/project/1/task/2/lock',
headers=headers,
xhr=True)
self.testapp.get('/project/1/task/2/user/user2',
headers=headers,
status=400,
xhr=True)
self.testapp.get('/project/1/task/2/unlock',
headers=headers,
xhr=True)
def test_task_assign(self):
headers = self.login_as_project_manager()
# assign task to user 1
self.testapp.get('/project/1/task/1/user/user1',
headers=headers,
status=200,
xhr=True)
# re-assign it to user 2
self.testapp.get('/project/1/task/1/user/user2',
headers=headers,
status=200,
xhr=True)
def test_task_assign_delete(self):
from osmtm.models import Task, DBSession
headers = self.login_as_project_manager()
# assign task to user 1
self.testapp.delete('/project/1/task/1/user',
headers=headers,
status=200,
xhr=True)
task = DBSession.query(Task).get((1, 1))
self.assertEqual(task.assigned_to_id, None)
def test_task_xhr__assigned(self):
headers = self.login_as_project_manager()
# assign task to user 1
self.testapp.get('/project/1/task/1/user/user1',
headers=headers,
status=200,
xhr=True)
# user 2 cannot lock the task assigned to user 1
headers = self.login_as_user2()
res = self.testapp.get('/project/1/task/1/lock',
headers=headers,
status=400,
xhr=True)
self.assertFalse(res.json['success'])
# user 1 can lock the task assigned to him
headers = self.login_as_user1()
res = self.testapp.get('/project/1/task/1/lock',
headers=headers,
status=200,
xhr=True)
self.assertTrue(res.json['success'])
self.testapp.get('/project/1/task/1/unlock',
headers=headers,
xhr=True)
def test_task_osm(self):
self.testapp.get('/project/1/task/1.osm', status=200)
def test_task_difficulty(self):
from osmtm.models import Task, DBSession
headers = self.login_as_project_manager()
self.testapp.put('/project/1/task/1/difficulty/3',
headers=headers,
status=200,
xhr=True)
task = DBSession.query(Task).get((1, 1))
self.assertEqual(task.difficulty, task.difficulty_hard)
def test_task_difficulty_delete(self):
from osmtm.models import Task, DBSession
import transaction
task = DBSession.query(Task).get((1, 1))
task.difficulty = task.difficulty_easy
DBSession.add(task)
DBSession.flush()
transaction.commit()
task = DBSession.query(Task).get((1, 1))
self.assertEqual(task.difficulty, task.difficulty_easy)
headers = self.login_as_project_manager()
# assign task to user 1
self.testapp.delete('/project/1/task/1/difficulty',
headers=headers,
status=200,
xhr=True)
task = DBSession.query(Task).get((1, 1))
self.assertEqual(task.difficulty, None)
| 37.767396
| 79
| 0.511818
| 2,019
| 18,997
| 4.683507
| 0.076771
| 0.07794
| 0.094755
| 0.142132
| 0.892132
| 0.865059
| 0.850994
| 0.786591
| 0.74503
| 0.699344
| 0
| 0.040789
| 0.377954
| 18,997
| 502
| 80
| 37.842629
| 0.759414
| 0.024372
| 0
| 0.731343
| 0
| 0
| 0.099314
| 0.073824
| 0
| 0
| 0
| 0
| 0.052239
| 1
| 0.08209
| false
| 0
| 0.047264
| 0
| 0.131841
| 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
|
81213e0976d4c6f93388bf12e25bb26e3d4edaf4
| 14,673
|
py
|
Python
|
pe/uno/ops.py
|
wudidaizi/RAVEN
|
10d126930ed31056e55803da4f8d606cde2b56d2
|
[
"MIT"
] | null | null | null |
pe/uno/ops.py
|
wudidaizi/RAVEN
|
10d126930ed31056e55803da4f8d606cde2b56d2
|
[
"MIT"
] | null | null | null |
pe/uno/ops.py
|
wudidaizi/RAVEN
|
10d126930ed31056e55803da4f8d606cde2b56d2
|
[
"MIT"
] | 1
|
2019-11-18T19:38:13.000Z
|
2019-11-18T19:38:13.000Z
|
import torch
import math
from RAVEN.pe.uno.utils import UNOtaylor
# This file is for UNO PE simulation from "UNO: Virtualizing and Unifying Nonlinear Operations for Emerging Neural Networks"
class UNOexp(torch.autograd.Function):
"""
UNOexp is the approximate exponentiation with the gradient for the
approximate exponentiation.
The gradient is always floating-point, regardless of approximation or
not.
A precise exponentiation example can be found here:
https://pytorch.org/docs/stable/_modules/torch/autograd/function.html
"""
# Note that both forward and backward are @staticmethods
@staticmethod
def forward(ctx, x,
cycle,
intwidth=7,
fracwidth=8,
fxp=True,
rounding="round",
keepwidth=False,
appr_grad=False,
fxp_grad=False):
# coeff is the precise coefficient, up to 10 terms are pre-stored
ctx.coeff = [1/1, 1/1, 1/2, 1/6, 1/24, 1/120, 1/720, 1/5040, 1/40320, 1/362880]
ctx.cycle = cycle - 1
ctx.intwidth = intwidth
ctx.fracwidth = fracwidth
# parameters for approximate polynomial in forward and backward pass
# both are zero because after changing floating to fixed point, the
# center of data will not have so much influence. They are not used.
# ctx.point_fw = 0
# ctx.point_bw = 0
ctx.fxp = fxp
ctx.rounding = rounding
ctx.keepwidth = keepwidth
ctx.appr_grad = appr_grad
ctx.fxp_grad = fxp_grad
int_part = x.floor()
frac_part = x - int_part
scale = torch.exp(int_part)
var = frac_part
output = UNOtaylor(scale,
ctx.coeff[0:ctx.cycle],
var,
fxp=ctx.fxp,
intwidth=ctx.intwidth,
fracwidth=ctx.fracwidth,
rounding_coeff="round",
rounding_var=ctx.rounding,
keepwidth=True)
# ctx is a context object that can be used to stash information
# for backward computation
ctx.save_for_backward(x)
return output
@staticmethod
def backward(ctx, grad_output):
# This is a pattern that is very convenient - at the top of backward
# unpack saved_tensors and initialize all gradients w.r.t. inputs to
# None. Thanks to the fact that additional trailing Nones are
# ignored, the return statement is simple even when the function has
# optional inputs.
x, = ctx.saved_tensors
grad_x = None
# Calculate the gradient according to the flag
if ctx.appr_grad is True:
int_part = x.floor()
frac_part = x - int_part
scale = torch.exp(int_part)
var = frac_part
grad = UNOtaylor(scale,
ctx.coeff[0:ctx.cycle],
var,
fxp=ctx.fxp_grad,
intwidth=ctx.intwidth,
fracwidth=ctx.fracwidth,
rounding_coeff="round",
rounding_var=ctx.rounding,
keepwidth=True)
grad_x = grad_output * grad
elif ctx.appr_grad is False:
grad_x = grad_output * torch.exp(x)
else:
raise ValueError("Input appr_grad need to be of bool type.")
# We return as many input gradients as there were arguments.
# Gradients of non-Tensor arguments to forward must be None.
return grad_x, None, None, None, None, None, None, None, None
class UNOdiv(torch.autograd.Function):
"""
UNOdiv is the approximate exponentiation with the gradient for the
approximate division (y/x).
The gradient is always floating-point, regardless of approximation or
not.
"""
# Note that both forward and backward are @staticmethods
@staticmethod
def forward(ctx, y, x,
cycle,
intwidth=7,
fracwidth=8,
fxp=True,
rounding="round",
keepwidth=False,
appr_grad=False,
fxp_grad=False):
# coeff is the precise coefficient, up to 10 terms are pre-stored
coeff = [1/1, 1/1, 1/1, 1/1, 1/1, 1/1, 1/1, 1/1, 1/1, 1/1]
point = 0.75
for idx in range(0, 10):
coeff[idx] = 1/(point**(idx+1))
ctx.coeff = coeff
ctx.cycle = cycle - 1
ctx.intwidth = intwidth
ctx.fracwidth = fracwidth
# parameters for approximate polynomial in forward and backward pass
# both are zero because after changing floating to fixed point, the
# center of data will not have so much influence. They are not used.
# ctx.point_fw = 0
# ctx.point_bw = 0
ctx.fxp = fxp
ctx.rounding = rounding
ctx.keepwidth = keepwidth
ctx.appr_grad = appr_grad
ctx.fxp_grad = fxp_grad
scale = y >> (torch.log2(x).floor() + 1)
var = point - (x >> (torch.log2(x).floor() + 1))
output = UNOtaylor(scale,
ctx.coeff[0:ctx.cycle],
var,
fxp=ctx.fxp,
intwidth=ctx.intwidth,
fracwidth=ctx.fracwidth,
rounding_coeff="round",
rounding_var=ctx.rounding,
keepwidth=True)
# ctx is a context object that can be used to stash information
# for backward computation
ctx.save_for_backward(y, x)
return output
@staticmethod
def backward(ctx, grad_output):
# This is a pattern that is very convenient - at the top of backward
# unpack saved_tensors and initialize all gradients w.r.t. inputs to
# None. Thanks to the fact that additional trailing Nones are
# ignored, the return statement is simple even when the function has
# optional inputs.
y, x = ctx.saved_tensors
grad_y = None
grad_x = None
# Calculate the gradient according to the flag
grad_y = grad_output * torch.div(1, x)
grad_x = grad_output * (0 - torch.div(y, x.mul(x)))
# We return as many input gradients as there were arguments.
# Gradients of non-Tensor arguments to forward must be None.
return grad_y, grad_x, None, None, None, None, None, None, None, None
class UNOlog(torch.autograd.Function):
"""
UNOlog is the approximate logarithm with the gradient for the
approximate.
The gradient is always floating-point, regardless of approximation or
not.
A precise exponentiation example can be found here:
https://pytorch.org/docs/stable/_modules/torch/autograd/function.html
"""
# Note that both forward and backward are @staticmethods
@staticmethod
def forward(ctx, x,
cycle,
intwidth=7,
fracwidth=8,
fxp=True,
rounding="round",
keepwidth=False,
appr_grad=False,
fxp_grad=False):
# coeff is the precise coefficient for exp, up to 10 terms are pre-stored
coeff = [1/1, 1/1, 1/1, 1/1, 1/1, 1/1, 1/1, 1/1, 1/1, 1/1]
point = 0.75
coeff[0] = 0 - math.log(point)
for idx in range(1, 9):
coeff[idx] = 1/(point**idx)/idx
ctx.coeff = coeff
ctx.cycle = cycle - 1
ctx.intwidth = intwidth
ctx.fracwidth = fracwidth
# parameters for approximate polynomial in forward and backward pass
# both are zero because after changing floating to fixed point, the
# center of data will not have so much influence. They are not used.
# ctx.point_fw = 0
# ctx.point_bw = 0
ctx.fxp = fxp
ctx.rounding = rounding
ctx.keepwidth = keepwidth
ctx.appr_grad = appr_grad
ctx.fxp_grad = fxp_grad
scale = 0 - torch.ones_like(x)
var = point - (x >> (torch.log2(x).floor() + 1))
output = UNOtaylor(scale,
ctx.coeff[0:ctx.cycle],
var,
fxp=ctx.fxp,
intwidth=ctx.intwidth,
fracwidth=ctx.fracwidth,
rounding_coeff="round",
rounding_var=ctx.rounding,
keepwidth=True)
output = output + (torch.log2(x).floor() + 1) * math.log(2.)
# ctx is a context object that can be used to stash information
# for backward computation
ctx.save_for_backward(x)
return output
@staticmethod
def backward(ctx, grad_output):
# This is a pattern that is very convenient - at the top of backward
# unpack saved_tensors and initialize all gradients w.r.t. inputs to
# None. Thanks to the fact that additional trailing Nones are
# ignored, the return statement is simple even when the function has
# optional inputs.
x, = ctx.saved_tensors
grad_x = None
# Calculate the gradient according to the flag
grad_x = grad_output * torch.div(1, x)
# We return as many input gradients as there were arguments.
# Gradients of non-Tensor arguments to forward must be None.
return grad_x, None, None, None, None, None, None, None, None
def UNOsigmoid(x,
cycle=8,
intwidth=7,
fracwidth=8,
fxp=True,
rounding="round",
keepwidth=False,
appr_grad=False,
fxp_grad=False):
exp_val = UNOexp.apply(-x,
cycle,
intwidth,
fracwidth,
fxp,
rounding,
keepwidth,
appr_grad,
fxp_grad)
div_val = UNOdiv.apply(torch.ones_like(exp_val),
1. + exp_val,
cycle,
intwidth,
fracwidth,
fxp,
rounding,
keepwidth,
appr_grad,
fxp_grad)
return div_val
def UNOtanh(x,
cycle=8,
intwidth=7,
fracwidth=8,
fxp=True,
rounding="round",
keepwidth=False,
appr_grad=False,
fxp_grad=False):
exp_val = UNOexp.apply(2*x,
cycle,
intwidth,
fracwidth,
fxp,
rounding,
keepwidth,
appr_grad,
fxp_grad)
div_val = UNOdiv.apply(exp_val - 1.,
exp_val + 1.,
cycle,
intwidth,
fracwidth,
fxp,
rounding,
keepwidth,
appr_grad,
fxp_grad)
return div_val
def UNOsoftmax(x,
dim=0,
cycle=8,
intwidth=7,
fracwidth=8,
fxp=True,
rounding="round",
keepwidth=False,
appr_grad=False,
fxp_grad=False):
# when the input is too small, one solution from software side is too convert it to larger values.
# but this might not solve the div-by-0 issule.
# offset = torch.mean(x, dim=dim)
# offset = torch.unsqueeze(offset, dim)
# exp_val = UNOexp.apply(x - offset,
exp_val = UNOexp.apply(x,
cycle,
intwidth,
fracwidth,
fxp,
rounding,
keepwidth,
appr_grad,
fxp_grad)
inf_check = torch.eq(exp_val, float('inf')).type(torch.float)
inf_check_sum = inf_check.sum()
if inf_check_sum.item() >= 1:
return inf_check.mul(1/inf_check_sum)
sum_val = exp_val.sum(dim=dim, keepdim=True)
div_val = UNOdiv.apply(exp_val,
sum_val,
cycle,
intwidth,
fracwidth,
fxp,
rounding,
keepwidth,
appr_grad,
fxp_grad)
return div_val
def UNOlogsoftmax(x,
dim=0,
cycle=8,
intwidth=7,
fracwidth=8,
fxp=True,
rounding="round",
keepwidth=False,
appr_grad=False,
fxp_grad=False):
softmax_val = UNOsoftmax(x,
dim,
cycle,
intwidth,
fracwidth,
fxp,
rounding,
keepwidth,
appr_grad,
fxp_grad)
log_val = UNOlog.apply(softmax_val,
cycle,
intwidth,
fracwidth,
fxp,
rounding,
keepwidth,
appr_grad,
fxp_grad)
log_val[torch.isnan(log_val)] = -2**intwidth
return log_val
| 36.409429
| 124
| 0.480202
| 1,540
| 14,673
| 4.483766
| 0.148052
| 0.012165
| 0.016944
| 0.020854
| 0.847212
| 0.826647
| 0.810717
| 0.810717
| 0.810717
| 0.810717
| 0
| 0.019049
| 0.4526
| 14,673
| 402
| 125
| 36.5
| 0.840637
| 0.256594
| 0
| 0.804348
| 0
| 0
| 0.009115
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.036232
| false
| 0
| 0.01087
| 0
| 0.097826
| 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
|
8138d1c506b0ba19064e3147ed339536ebb17596
| 9,225
|
py
|
Python
|
tests/components/homekit/test_type_covers.py
|
Klathmon/home-assistant
|
82770faad71c8d2a34d427fe864686f8b213b3f0
|
[
"Apache-2.0"
] | 37
|
2018-05-22T07:17:26.000Z
|
2022-03-03T13:14:46.000Z
|
tests/components/homekit/test_type_covers.py
|
Klathmon/home-assistant
|
82770faad71c8d2a34d427fe864686f8b213b3f0
|
[
"Apache-2.0"
] | 34
|
2018-05-22T07:19:40.000Z
|
2022-03-11T23:21:03.000Z
|
tests/components/homekit/test_type_covers.py
|
Klathmon/home-assistant
|
82770faad71c8d2a34d427fe864686f8b213b3f0
|
[
"Apache-2.0"
] | 8
|
2018-05-30T20:05:26.000Z
|
2021-02-19T14:17:05.000Z
|
"""Test different accessory types: Covers."""
from collections import namedtuple
import pytest
from homeassistant.components.cover import (
ATTR_CURRENT_POSITION, ATTR_POSITION, DOMAIN, SUPPORT_STOP)
from homeassistant.const import (
ATTR_ENTITY_ID, ATTR_SUPPORTED_FEATURES,
STATE_CLOSED, STATE_OPEN, STATE_UNAVAILABLE, STATE_UNKNOWN)
from tests.common import async_mock_service
from tests.components.homekit.common import patch_debounce
@pytest.fixture(scope='module')
def cls():
"""Patch debounce decorator during import of type_covers."""
patcher = patch_debounce()
patcher.start()
_import = __import__('homeassistant.components.homekit.type_covers',
fromlist=['GarageDoorOpener', 'WindowCovering,',
'WindowCoveringBasic'])
patcher_tuple = namedtuple('Cls', ['window', 'window_basic', 'garage'])
yield patcher_tuple(window=_import.WindowCovering,
window_basic=_import.WindowCoveringBasic,
garage=_import.GarageDoorOpener)
patcher.stop()
async def test_garage_door_open_close(hass, cls):
"""Test if accessory and HA are updated accordingly."""
entity_id = 'cover.garage_door'
hass.states.async_set(entity_id, None)
await hass.async_block_till_done()
acc = cls.garage(hass, 'Garage Door', entity_id, 2, None)
await hass.async_add_job(acc.run)
assert acc.aid == 2
assert acc.category == 4 # GarageDoorOpener
assert acc.char_current_state.value == 0
assert acc.char_target_state.value == 0
hass.states.async_set(entity_id, STATE_CLOSED)
await hass.async_block_till_done()
assert acc.char_current_state.value == 1
assert acc.char_target_state.value == 1
hass.states.async_set(entity_id, STATE_OPEN)
await hass.async_block_till_done()
assert acc.char_current_state.value == 0
assert acc.char_target_state.value == 0
hass.states.async_set(entity_id, STATE_UNAVAILABLE)
await hass.async_block_till_done()
assert acc.char_current_state.value == 0
assert acc.char_target_state.value == 0
hass.states.async_set(entity_id, STATE_UNKNOWN)
await hass.async_block_till_done()
assert acc.char_current_state.value == 0
assert acc.char_target_state.value == 0
# Set from HomeKit
call_close_cover = async_mock_service(hass, DOMAIN, 'close_cover')
call_open_cover = async_mock_service(hass, DOMAIN, 'open_cover')
await hass.async_add_job(acc.char_target_state.client_update_value, 1)
await hass.async_block_till_done()
assert call_close_cover
assert call_close_cover[0].data[ATTR_ENTITY_ID] == entity_id
assert acc.char_current_state.value == 2
assert acc.char_target_state.value == 1
hass.states.async_set(entity_id, STATE_CLOSED)
await hass.async_block_till_done()
await hass.async_add_job(acc.char_target_state.client_update_value, 0)
await hass.async_block_till_done()
assert call_open_cover
assert call_open_cover[0].data[ATTR_ENTITY_ID] == entity_id
assert acc.char_current_state.value == 3
assert acc.char_target_state.value == 0
async def test_window_set_cover_position(hass, cls):
"""Test if accessory and HA are updated accordingly."""
entity_id = 'cover.window'
hass.states.async_set(entity_id, None)
await hass.async_block_till_done()
acc = cls.window(hass, 'Cover', entity_id, 2, None)
await hass.async_add_job(acc.run)
assert acc.aid == 2
assert acc.category == 14 # WindowCovering
assert acc.char_current_position.value == 0
assert acc.char_target_position.value == 0
hass.states.async_set(entity_id, STATE_UNKNOWN,
{ATTR_CURRENT_POSITION: None})
await hass.async_block_till_done()
assert acc.char_current_position.value == 0
assert acc.char_target_position.value == 0
hass.states.async_set(entity_id, STATE_OPEN,
{ATTR_CURRENT_POSITION: 50})
await hass.async_block_till_done()
assert acc.char_current_position.value == 50
assert acc.char_target_position.value == 50
# Set from HomeKit
call_set_cover_position = async_mock_service(hass, DOMAIN,
'set_cover_position')
await hass.async_add_job(acc.char_target_position.client_update_value, 25)
await hass.async_block_till_done()
assert call_set_cover_position[0]
assert call_set_cover_position[0].data[ATTR_ENTITY_ID] == entity_id
assert call_set_cover_position[0].data[ATTR_POSITION] == 25
assert acc.char_current_position.value == 50
assert acc.char_target_position.value == 25
await hass.async_add_job(acc.char_target_position.client_update_value, 75)
await hass.async_block_till_done()
assert call_set_cover_position[1]
assert call_set_cover_position[1].data[ATTR_ENTITY_ID] == entity_id
assert call_set_cover_position[1].data[ATTR_POSITION] == 75
assert acc.char_current_position.value == 50
assert acc.char_target_position.value == 75
async def test_window_open_close(hass, cls):
"""Test if accessory and HA are updated accordingly."""
entity_id = 'cover.window'
hass.states.async_set(entity_id, STATE_UNKNOWN,
{ATTR_SUPPORTED_FEATURES: 0})
acc = cls.window_basic(hass, 'Cover', entity_id, 2, None)
await hass.async_add_job(acc.run)
assert acc.aid == 2
assert acc.category == 14 # WindowCovering
assert acc.char_current_position.value == 0
assert acc.char_target_position.value == 0
assert acc.char_position_state.value == 2
hass.states.async_set(entity_id, STATE_UNKNOWN)
await hass.async_block_till_done()
assert acc.char_current_position.value == 0
assert acc.char_target_position.value == 0
assert acc.char_position_state.value == 2
hass.states.async_set(entity_id, STATE_OPEN)
await hass.async_block_till_done()
assert acc.char_current_position.value == 100
assert acc.char_target_position.value == 100
assert acc.char_position_state.value == 2
hass.states.async_set(entity_id, STATE_CLOSED)
await hass.async_block_till_done()
assert acc.char_current_position.value == 0
assert acc.char_target_position.value == 0
assert acc.char_position_state.value == 2
# Set from HomeKit
call_close_cover = async_mock_service(hass, DOMAIN, 'close_cover')
call_open_cover = async_mock_service(hass, DOMAIN, 'open_cover')
await hass.async_add_job(acc.char_target_position.client_update_value, 25)
await hass.async_block_till_done()
assert call_close_cover
assert call_close_cover[0].data[ATTR_ENTITY_ID] == entity_id
assert acc.char_current_position.value == 0
assert acc.char_target_position.value == 0
assert acc.char_position_state.value == 2
await hass.async_add_job(acc.char_target_position.client_update_value, 90)
await hass.async_block_till_done()
assert call_open_cover[0]
assert call_open_cover[0].data[ATTR_ENTITY_ID] == entity_id
assert acc.char_current_position.value == 100
assert acc.char_target_position.value == 100
assert acc.char_position_state.value == 2
await hass.async_add_job(acc.char_target_position.client_update_value, 55)
await hass.async_block_till_done()
assert call_open_cover[1]
assert call_open_cover[1].data[ATTR_ENTITY_ID] == entity_id
assert acc.char_current_position.value == 100
assert acc.char_target_position.value == 100
assert acc.char_position_state.value == 2
async def test_window_open_close_stop(hass, cls):
"""Test if accessory and HA are updated accordingly."""
entity_id = 'cover.window'
hass.states.async_set(entity_id, STATE_UNKNOWN,
{ATTR_SUPPORTED_FEATURES: SUPPORT_STOP})
acc = cls.window_basic(hass, 'Cover', entity_id, 2, None)
await hass.async_add_job(acc.run)
# Set from HomeKit
call_close_cover = async_mock_service(hass, DOMAIN, 'close_cover')
call_open_cover = async_mock_service(hass, DOMAIN, 'open_cover')
call_stop_cover = async_mock_service(hass, DOMAIN, 'stop_cover')
await hass.async_add_job(acc.char_target_position.client_update_value, 25)
await hass.async_block_till_done()
assert call_close_cover
assert call_close_cover[0].data[ATTR_ENTITY_ID] == entity_id
assert acc.char_current_position.value == 0
assert acc.char_target_position.value == 0
assert acc.char_position_state.value == 2
await hass.async_add_job(acc.char_target_position.client_update_value, 90)
await hass.async_block_till_done()
assert call_open_cover
assert call_open_cover[0].data[ATTR_ENTITY_ID] == entity_id
assert acc.char_current_position.value == 100
assert acc.char_target_position.value == 100
assert acc.char_position_state.value == 2
await hass.async_add_job(acc.char_target_position.client_update_value, 55)
await hass.async_block_till_done()
assert call_stop_cover
assert call_stop_cover[0].data[ATTR_ENTITY_ID] == entity_id
assert acc.char_current_position.value == 50
assert acc.char_target_position.value == 50
assert acc.char_position_state.value == 2
| 39.088983
| 78
| 0.735827
| 1,327
| 9,225
| 4.760362
| 0.074604
| 0.07092
| 0.111129
| 0.07646
| 0.837265
| 0.829508
| 0.81716
| 0.806712
| 0.794523
| 0.79389
| 0
| 0.017226
| 0.17561
| 9,225
| 235
| 79
| 39.255319
| 0.813412
| 0.022764
| 0
| 0.679775
| 0
| 0
| 0.033835
| 0.005013
| 0
| 0
| 0
| 0
| 0.460674
| 1
| 0.005618
| false
| 0
| 0.05618
| 0
| 0.061798
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
d4a744ab47e50efb6d80d2b20b57f31e7aa117ec
| 19,359
|
py
|
Python
|
onnx/backend/test/case/node/negativeloglikelihoodloss.py
|
justinchuby/onnx
|
805ae1e634697e37b43701e585c9c253a29ce076
|
[
"Apache-2.0"
] | null | null | null |
onnx/backend/test/case/node/negativeloglikelihoodloss.py
|
justinchuby/onnx
|
805ae1e634697e37b43701e585c9c253a29ce076
|
[
"Apache-2.0"
] | null | null | null |
onnx/backend/test/case/node/negativeloglikelihoodloss.py
|
justinchuby/onnx
|
805ae1e634697e37b43701e585c9c253a29ce076
|
[
"Apache-2.0"
] | null | null | null |
# SPDX-License-Identifier: Apache-2.0
import numpy as np # type: ignore
import onnx
from ..base import Base
from . import expect
def compute_negative_log_likelihood_loss(input, target, weight=None, reduction='mean', ignore_index=None): # type: ignore
input_shape = input.shape
if len(input_shape) == 1:
raise RuntimeError("Unsupported shape")
target_shape = target.shape
N = input_shape[0]
C = input_shape[1]
# initialize the positional weights when required
gather_weight = None
if weight is not None:
# setting mode='clip' to deal with ignore_index > C or < 0 cases.
# when the target value is > C or < 0, it doesn't matter which value we are
# taking in gather_weight, since it will be set to 0 in the following if-block
# use np.int32 to make it compatible with x86 machines
gather_weight = np.take(weight, np.array(target, dtype=np.int32), mode='clip')
# set `ignore_index`'s loss weight to 0.
# The loss tensor will be multiplied by this weight tensor,
# so `ingore_index`'s loss value will be eliminated.
if ignore_index is not None:
gather_weight = np.where(target == ignore_index, 0, gather_weight).astype(dtype=np.float32)
elif ignore_index is not None:
gather_weight = np.where(target == ignore_index, 0, 1).astype(dtype=np.float32)
# if input is 4-d and above, make it 3-d
if len(input_shape) != 3:
input = input.reshape((N, C, -1))
target = target.reshape((N, -1))
# Get a dimension from the reshaped input.
# If the original input shape is [N, C, H, W],
# the D here should be H * W because we reshape
# [N, C, H, W] to [N, C, H * W].
D = input.shape[2]
neg_gather_element_input = np.zeros((N, D), dtype=np.float32)
for i in range(N):
for d in range(D):
if target[i][d] != ignore_index:
neg_gather_element_input[i][d] = -input[i][target[i][d]][d]
loss = neg_gather_element_input
# if the input was 4-d or above reshape to the right shape
if len(input_shape) != 3:
loss = loss.reshape(target_shape)
# apply the weights when required
if gather_weight is not None:
loss = gather_weight * loss
if reduction == 'mean':
loss = loss.sum() / gather_weight.sum()
return loss
if reduction == 'mean':
loss = np.mean(loss)
elif reduction == 'sum':
loss = np.sum(loss)
return loss
class NegativeLogLikelihoodLoss(Base):
@staticmethod
def export_input_shape_is_NC() -> None:
reduction = 'none'
node = onnx.helper.make_node(
'NegativeLogLikelihoodLoss',
inputs=['input', 'target'],
outputs=['loss'],
reduction=reduction
)
N, C = 3, 5
np.random.seed(0)
input = np.random.rand(N, C).astype(np.float32)
target = np.random.randint(0, high=C, size=(N, )).astype(np.int64)
negative_log_likelihood_loss = compute_negative_log_likelihood_loss(input, target, weight=None, reduction=reduction)
expect(node, inputs=[input, target], outputs=[negative_log_likelihood_loss],
name='test_nllloss_NC')
@staticmethod
def export_input_shape_is_NCd1d2() -> None:
reduction = 'none'
node = onnx.helper.make_node(
'NegativeLogLikelihoodLoss',
inputs=['input', 'target'],
outputs=['loss'],
reduction=reduction
)
N, C, dim1, dim2 = 3, 5, 6, 6
np.random.seed(0)
input = np.random.rand(N, C, dim1, dim2).astype(np.float32)
target = np.random.randint(0, high=C, size=(N, dim1, dim2)).astype(np.int64)
negative_log_likelihood_loss = compute_negative_log_likelihood_loss(input, target, weight=None, reduction=reduction)
expect(node, inputs=[input, target], outputs=[negative_log_likelihood_loss],
name='test_nllloss_NCd1d2')
@staticmethod
def export_input_shape_is_NCd1d2_reduction_mean() -> None:
reduction = 'mean'
node = onnx.helper.make_node(
'NegativeLogLikelihoodLoss',
inputs=['input', 'target'],
outputs=['loss'],
reduction=reduction
)
N, C, dim1, dim2 = 3, 5, 6, 6
np.random.seed(0)
input = np.random.rand(N, C, dim1, dim2).astype(np.float32)
target = np.random.randint(0, high=C, size=(N, dim1, dim2)).astype(np.int64)
negative_log_likelihood_loss = compute_negative_log_likelihood_loss(input, target, weight=None, reduction=reduction)
expect(node, inputs=[input, target], outputs=[negative_log_likelihood_loss],
name='test_nllloss_NCd1d2_reduction_mean')
@staticmethod
def export_input_shape_is_NCd1d2_reduction_sum() -> None:
reduction = 'sum'
node = onnx.helper.make_node(
'NegativeLogLikelihoodLoss',
inputs=['input', 'target'],
outputs=['loss'],
reduction=reduction
)
N, C, dim1, dim2 = 3, 5, 6, 6
np.random.seed(0)
input = np.random.rand(N, C, dim1, dim2).astype(np.float32)
target = np.random.randint(0, high=C, size=(N, dim1, dim2)).astype(np.int64)
negative_log_likelihood_loss = compute_negative_log_likelihood_loss(input, target, weight=None, reduction=reduction)
expect(node, inputs=[input, target], outputs=[negative_log_likelihood_loss],
name='test_nllloss_NCd1d2_reduction_sum')
@staticmethod
def export_input_shape_is_NCd1d2_with_weight() -> None:
reduction = 'none'
node = onnx.helper.make_node(
'NegativeLogLikelihoodLoss',
inputs=['input', 'target', 'weight'],
outputs=['loss'],
reduction=reduction
)
N, C, dim1, dim2 = 3, 5, 6, 6
np.random.seed(0)
input = np.random.rand(N, C, dim1, dim2).astype(np.float32)
target = np.random.randint(0, high=C, size=(N, dim1, dim2)).astype(np.int64)
weight = np.random.rand(C).astype(np.float32)
negative_log_likelihood_loss = compute_negative_log_likelihood_loss(input, target, weight=weight, reduction=reduction)
expect(node, inputs=[input, target, weight], outputs=[negative_log_likelihood_loss],
name='test_nllloss_NCd1d2_with_weight')
@staticmethod
def export_input_shape_is_NCd1d2_with_weight_reduction_mean() -> None:
reduction = 'mean'
node = onnx.helper.make_node(
'NegativeLogLikelihoodLoss',
inputs=['input', 'target', 'weight'],
outputs=['loss'],
reduction=reduction
)
N, C, dim1, dim2 = 3, 5, 6, 6
np.random.seed(0)
input = np.random.rand(N, C, dim1, dim2).astype(np.float32)
target = np.random.randint(0, high=C, size=(N, dim1, dim2)).astype(np.int64)
weight = np.random.rand(C).astype(np.float32)
negative_log_likelihood_loss = compute_negative_log_likelihood_loss(input, target, weight=weight, reduction=reduction)
expect(node, inputs=[input, target, weight], outputs=[negative_log_likelihood_loss],
name='test_nllloss_NCd1d2_with_weight_reduction_mean')
@staticmethod
def export_input_shape_is_NCd1d2_with_weight_reduction_sum() -> None:
reduction = 'sum'
node = onnx.helper.make_node(
'NegativeLogLikelihoodLoss',
inputs=['input', 'target', 'weight'],
outputs=['loss'],
reduction=reduction
)
N, C, dim1, dim2 = 3, 5, 6, 6
np.random.seed(0)
input = np.random.rand(N, C, dim1, dim2).astype(np.float32)
target = np.random.randint(0, high=C, size=(N, dim1, dim2)).astype(np.int64)
weight = np.random.rand(C).astype(np.float32)
negative_log_likelihood_loss = compute_negative_log_likelihood_loss(input, target, weight=weight, reduction=reduction)
expect(node, inputs=[input, target, weight], outputs=[negative_log_likelihood_loss],
name='test_nllloss_NCd1d2_with_weight_reduction_sum')
@staticmethod
def export_input_shape_is_NCd1d2_with_weight_reduction_sum_ii() -> None:
reduction = 'sum'
ignore_index = np.int64(0)
node = onnx.helper.make_node(
'NegativeLogLikelihoodLoss',
inputs=['input', 'target', 'weight'],
outputs=['loss'],
reduction=reduction,
ignore_index=ignore_index
)
N, C, dim1, dim2 = 3, 5, 6, 6
np.random.seed(0)
input = np.random.rand(N, C, dim1, dim2).astype(np.float32)
target = np.random.randint(0, high=C, size=(N, dim1, dim2)).astype(np.int64)
target[0][0][0] = np.int64(0)
weight = np.random.rand(C).astype(np.float32)
negative_log_likelihood_loss = compute_negative_log_likelihood_loss(input, target, weight=weight, reduction=reduction, ignore_index=ignore_index)
expect(node, inputs=[input, target, weight], outputs=[negative_log_likelihood_loss],
name='test_nllloss_NCd1d2_with_weight_reduction_sum_ii')
@staticmethod
def export_input_shape_is_NCd1d2_no_weight_reduction_mean_ii() -> None:
reduction = 'mean'
ignore_index = np.int64(1)
node = onnx.helper.make_node(
'NegativeLogLikelihoodLoss',
inputs=['input', 'target'],
outputs=['loss'],
reduction=reduction,
ignore_index=ignore_index
)
N, C, dim1, dim2 = 3, 5, 6, 6
np.random.seed(0)
input = np.random.rand(N, C, dim1, dim2).astype(np.float32)
target = np.random.randint(0, high=C, size=(N, dim1, dim2)).astype(np.int64)
target[0][0][0] = np.int64(1)
negative_log_likelihood_loss = compute_negative_log_likelihood_loss(input, target, reduction=reduction, ignore_index=ignore_index)
expect(node, inputs=[input, target], outputs=[negative_log_likelihood_loss],
name='test_nllloss_NCd1d2_no_weight_reduction_mean_ii')
@staticmethod
def export_input_shape_is_NCd1() -> None:
reduction = 'mean'
node = onnx.helper.make_node(
'NegativeLogLikelihoodLoss',
inputs=['input', 'target'],
outputs=['loss'],
reduction=reduction
)
N, C, d1 = 3, 5, 2
np.random.seed(0)
input = np.random.rand(N, C, d1).astype(np.float32)
target = np.random.randint(0, high=C, size=(N, d1)).astype(np.int64)
negative_log_likelihood_loss = compute_negative_log_likelihood_loss(input, target, weight=None, reduction=reduction)
expect(node, inputs=[input, target], outputs=[negative_log_likelihood_loss],
name='test_nllloss_NCd1')
@staticmethod
def export_input_shape_is_NCd1_weight() -> None:
reduction = 'mean'
node = onnx.helper.make_node(
'NegativeLogLikelihoodLoss',
inputs=['input', 'target', 'weight'],
outputs=['loss'],
reduction=reduction
)
N, C, d1 = 3, 5, 2
np.random.seed(0)
input = np.random.rand(N, C, d1).astype(np.float32)
target = np.random.randint(0, high=C, size=(N, d1)).astype(np.int64)
weight = np.random.rand(C).astype(np.float32)
negative_log_likelihood_loss = compute_negative_log_likelihood_loss(input, target, weight=weight, reduction=reduction)
expect(node, inputs=[input, target, weight], outputs=[negative_log_likelihood_loss],
name='test_nllloss_NCd1_weight')
@staticmethod
def export_input_shape_is_NCd1_ii() -> None:
reduction = 'mean'
ignore_index = np.int64(1)
node = onnx.helper.make_node(
'NegativeLogLikelihoodLoss',
inputs=['input', 'target'],
outputs=['loss'],
reduction=reduction,
ignore_index=ignore_index
)
N, C, d1 = 3, 5, 2
np.random.seed(0)
input = np.random.rand(N, C, d1).astype(np.float32)
target = np.random.randint(0, high=C, size=(N, d1)).astype(np.int64)
target[0][0] = np.int64(1)
negative_log_likelihood_loss = compute_negative_log_likelihood_loss(input, target, weight=None, reduction=reduction, ignore_index=ignore_index)
expect(node, inputs=[input, target], outputs=[negative_log_likelihood_loss],
name='test_nllloss_NCd1_ii')
@staticmethod
def export_input_shape_is_NCd1_weight_ii() -> None:
reduction = 'mean'
ignore_index = np.int64(1)
node = onnx.helper.make_node(
'NegativeLogLikelihoodLoss',
inputs=['input', 'target', 'weight'],
outputs=['loss'],
reduction=reduction,
ignore_index=ignore_index
)
N, C, d1 = 3, 5, 2
np.random.seed(0)
input = np.random.rand(N, C, d1).astype(np.float32)
target = np.random.randint(0, high=C, size=(N, d1)).astype(np.int64)
target[0][0] = np.int64(1)
weight = np.random.rand(C).astype(np.float32)
negative_log_likelihood_loss = compute_negative_log_likelihood_loss(input, target, weight=weight, reduction=reduction, ignore_index=ignore_index)
expect(node, inputs=[input, target, weight], outputs=[negative_log_likelihood_loss],
name='test_nllloss_NCd1_weight_ii')
@staticmethod
def export_input_shape_is_NCd1d2d3d4d5_mean_weight() -> None:
reduction = 'mean'
node = onnx.helper.make_node(
'NegativeLogLikelihoodLoss',
inputs=['input', 'target', 'weight'],
outputs=['loss'],
reduction=reduction)
N, C, dim1, dim2, dim3, dim4, dim5 = 3, 5, 6, 6, 5, 3, 4
np.random.seed(0)
input = np.random.rand(N, C, dim1, dim2, dim3, dim4, dim5).astype(np.float32)
target = np.random.randint(0, high=C, size=(N, dim1, dim2, dim3, dim4, dim5)).astype(np.int64)
weight = np.random.rand(C).astype(np.float32)
negative_log_likelihood_loss = compute_negative_log_likelihood_loss(input,
target,
weight=weight,
reduction=reduction)
expect(node, inputs=[input, target, weight], outputs=[negative_log_likelihood_loss],
name='test_nllloss_NCd1d2d3d4d5_mean_weight')
@staticmethod
def export_input_shape_is_NCd1d2d3d4d5_none_no_weight() -> None:
reduction = 'none'
node = onnx.helper.make_node(
'NegativeLogLikelihoodLoss',
inputs=['input', 'target'],
outputs=['loss'],
reduction=reduction)
N, C, dim1, dim2, dim3, dim4, dim5 = 3, 5, 6, 6, 5, 3, 4
np.random.seed(0)
input = np.random.rand(N, C, dim1, dim2, dim3, dim4, dim5).astype(np.float32)
target = np.random.randint(0, high=C, size=(N, dim1, dim2, dim3, dim4, dim5)).astype(np.int64)
negative_log_likelihood_loss = compute_negative_log_likelihood_loss(input,
target,
reduction=reduction)
expect(node, inputs=[input, target], outputs=[negative_log_likelihood_loss],
name='test_nllloss_NCd1d2d3d4d5_none_no_weight')
@staticmethod
def export_input_shape_is_NCd1_mean_weight_negative_ii() -> None:
reduction = 'mean'
ignore_index = np.int64(-1)
node = onnx.helper.make_node(
'NegativeLogLikelihoodLoss',
inputs=['input', 'target', 'weight'],
outputs=['loss'],
reduction=reduction,
ignore_index=ignore_index)
N, C, dim1 = 3, 5, 6
np.random.seed(0)
input = np.random.rand(N, C, dim1).astype(np.float32)
target = np.random.randint(0, high=C, size=(N, dim1)).astype(np.int64)
target[0][0] = -1
weight = np.random.rand(C).astype(np.float32)
negative_log_likelihood_loss = compute_negative_log_likelihood_loss(input,
target,
weight=weight,
reduction=reduction,
ignore_index=ignore_index)
expect(node, inputs=[input, target, weight], outputs=[negative_log_likelihood_loss],
name='test_nllloss_NCd1_mean_weight_negative_ii')
@staticmethod
def export_input_shape_is_NCd1d2d3_none_no_weight_negative_ii() -> None:
reduction = 'none'
ignore_index = np.int64(-5)
node = onnx.helper.make_node(
'NegativeLogLikelihoodLoss',
inputs=['input', 'target'],
outputs=['loss'],
reduction=reduction,
ignore_index=ignore_index)
N, C, dim1, dim2, dim3 = 3, 5, 6, 6, 5
np.random.seed(0)
input = np.random.rand(N, C, dim1, dim2, dim3).astype(np.float32)
target = np.random.randint(0, high=C, size=(N, dim1, dim2, dim3)).astype(np.int64)
target[0][0][0][0] = -5
negative_log_likelihood_loss = compute_negative_log_likelihood_loss(input,
target,
reduction=reduction,
ignore_index=ignore_index)
expect(node, inputs=[input, target], outputs=[negative_log_likelihood_loss],
name='test_nllloss_NCd1d2d3_none_no_weight_negative_ii')
@staticmethod
def export_input_shape_is_NCd1d2d3_sum_weight_high_ii() -> None:
reduction = 'sum'
ignore_index = np.int64(10)
node = onnx.helper.make_node(
'NegativeLogLikelihoodLoss',
inputs=['input', 'target', 'weight'],
outputs=['loss'],
reduction=reduction,
ignore_index=ignore_index)
N, C = 3, 5
np.random.seed(0)
input = np.random.rand(N, C).astype(np.float32)
target = np.random.randint(0, high=C, size=(N)).astype(np.int64)
target[0] = 10
weight = np.random.rand(C).astype(np.float32)
negative_log_likelihood_loss = compute_negative_log_likelihood_loss(input,
target,
weight=weight,
reduction=reduction,
ignore_index=ignore_index)
expect(node, inputs=[input, target, weight], outputs=[negative_log_likelihood_loss],
name='test_nllloss_NCd1d2d3_sum_weight_high_ii')
| 40.5
| 153
| 0.590991
| 2,289
| 19,359
| 4.792049
| 0.066841
| 0.045948
| 0.105297
| 0.125353
| 0.876652
| 0.858784
| 0.847479
| 0.829246
| 0.800802
| 0.792871
| 0
| 0.033634
| 0.295057
| 19,359
| 477
| 154
| 40.584906
| 0.770133
| 0.042151
| 0
| 0.721622
| 0
| 0
| 0.080436
| 0.053498
| 0
| 0
| 0
| 0
| 0
| 1
| 0.051351
| false
| 0
| 0.010811
| 0
| 0.07027
| 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
|
d4add2dcf81d6dcfa234f9f71aee57de9f2264de
| 934
|
py
|
Python
|
setup.py
|
looking-for-a-job/mac-vlc
|
0aff08dad07dea53654e9b74a97af6cc2783f74a
|
[
"Unlicense"
] | null | null | null |
setup.py
|
looking-for-a-job/mac-vlc
|
0aff08dad07dea53654e9b74a97af6cc2783f74a
|
[
"Unlicense"
] | null | null | null |
setup.py
|
looking-for-a-job/mac-vlc
|
0aff08dad07dea53654e9b74a97af6cc2783f74a
|
[
"Unlicense"
] | null | null | null |
import setuptools
setuptools.setup(
name='mac-vlc',
version='2020.12.3',
install_requires=open('requirements.txt').read().splitlines(),
packages=setuptools.find_packages(),
scripts=['scripts/.vlc-duration.applescript','scripts/.vlc-fullscreen-detect.applescript','scripts/.vlc-fullscreen-enter.applescript','scripts/.vlc-fullscreen-exit.applescript','scripts/.vlc-open.applescript','scripts/.vlc-path.applescript','scripts/.vlc-pause.applescript','scripts/.vlc-play.applescript','scripts/.vlc-playing.applescript','scripts/.vlc-time.applescript','scripts/.vlc-volume.applescript','scripts/vlc','scripts/vlc-duration','scripts/vlc-frontmost','scripts/vlc-fullscreen-detect','scripts/vlc-fullscreen-enter','scripts/vlc-fullscreen-exit','scripts/vlc-kill','scripts/vlc-open','scripts/vlc-path','scripts/vlc-pause','scripts/vlc-pid','scripts/vlc-play','scripts/vlc-playing','scripts/vlc-time','scripts/vlc-volume']
)
| 93.4
| 741
| 0.763383
| 117
| 934
| 6.076923
| 0.299145
| 0.365682
| 0.324895
| 0.130802
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.007743
| 0.03212
| 934
| 9
| 742
| 103.777778
| 0.778761
| 0
| 0
| 0
| 0
| 0
| 0.730193
| 0.503212
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.125
| 0
| 0.125
| 0
| 0
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
d4aeb01d43a1fd764836c65f73544359e2a97b3d
| 6,407
|
py
|
Python
|
loldib/getratings/models/NA/na_brand/na_brand_sup.py
|
koliupy/loldib
|
c9ab94deb07213cdc42b5a7c26467cdafaf81b7f
|
[
"Apache-2.0"
] | null | null | null |
loldib/getratings/models/NA/na_brand/na_brand_sup.py
|
koliupy/loldib
|
c9ab94deb07213cdc42b5a7c26467cdafaf81b7f
|
[
"Apache-2.0"
] | null | null | null |
loldib/getratings/models/NA/na_brand/na_brand_sup.py
|
koliupy/loldib
|
c9ab94deb07213cdc42b5a7c26467cdafaf81b7f
|
[
"Apache-2.0"
] | null | null | null |
from getratings.models.ratings import Ratings
class NA_Brand_Sup_Aatrox(Ratings):
pass
class NA_Brand_Sup_Ahri(Ratings):
pass
class NA_Brand_Sup_Akali(Ratings):
pass
class NA_Brand_Sup_Alistar(Ratings):
pass
class NA_Brand_Sup_Amumu(Ratings):
pass
class NA_Brand_Sup_Anivia(Ratings):
pass
class NA_Brand_Sup_Annie(Ratings):
pass
class NA_Brand_Sup_Ashe(Ratings):
pass
class NA_Brand_Sup_AurelionSol(Ratings):
pass
class NA_Brand_Sup_Azir(Ratings):
pass
class NA_Brand_Sup_Bard(Ratings):
pass
class NA_Brand_Sup_Blitzcrank(Ratings):
pass
class NA_Brand_Sup_Brand(Ratings):
pass
class NA_Brand_Sup_Braum(Ratings):
pass
class NA_Brand_Sup_Caitlyn(Ratings):
pass
class NA_Brand_Sup_Camille(Ratings):
pass
class NA_Brand_Sup_Cassiopeia(Ratings):
pass
class NA_Brand_Sup_Chogath(Ratings):
pass
class NA_Brand_Sup_Corki(Ratings):
pass
class NA_Brand_Sup_Darius(Ratings):
pass
class NA_Brand_Sup_Diana(Ratings):
pass
class NA_Brand_Sup_Draven(Ratings):
pass
class NA_Brand_Sup_DrMundo(Ratings):
pass
class NA_Brand_Sup_Ekko(Ratings):
pass
class NA_Brand_Sup_Elise(Ratings):
pass
class NA_Brand_Sup_Evelynn(Ratings):
pass
class NA_Brand_Sup_Ezreal(Ratings):
pass
class NA_Brand_Sup_Fiddlesticks(Ratings):
pass
class NA_Brand_Sup_Fiora(Ratings):
pass
class NA_Brand_Sup_Fizz(Ratings):
pass
class NA_Brand_Sup_Galio(Ratings):
pass
class NA_Brand_Sup_Gangplank(Ratings):
pass
class NA_Brand_Sup_Garen(Ratings):
pass
class NA_Brand_Sup_Gnar(Ratings):
pass
class NA_Brand_Sup_Gragas(Ratings):
pass
class NA_Brand_Sup_Graves(Ratings):
pass
class NA_Brand_Sup_Hecarim(Ratings):
pass
class NA_Brand_Sup_Heimerdinger(Ratings):
pass
class NA_Brand_Sup_Illaoi(Ratings):
pass
class NA_Brand_Sup_Irelia(Ratings):
pass
class NA_Brand_Sup_Ivern(Ratings):
pass
class NA_Brand_Sup_Janna(Ratings):
pass
class NA_Brand_Sup_JarvanIV(Ratings):
pass
class NA_Brand_Sup_Jax(Ratings):
pass
class NA_Brand_Sup_Jayce(Ratings):
pass
class NA_Brand_Sup_Jhin(Ratings):
pass
class NA_Brand_Sup_Jinx(Ratings):
pass
class NA_Brand_Sup_Kalista(Ratings):
pass
class NA_Brand_Sup_Karma(Ratings):
pass
class NA_Brand_Sup_Karthus(Ratings):
pass
class NA_Brand_Sup_Kassadin(Ratings):
pass
class NA_Brand_Sup_Katarina(Ratings):
pass
class NA_Brand_Sup_Kayle(Ratings):
pass
class NA_Brand_Sup_Kayn(Ratings):
pass
class NA_Brand_Sup_Kennen(Ratings):
pass
class NA_Brand_Sup_Khazix(Ratings):
pass
class NA_Brand_Sup_Kindred(Ratings):
pass
class NA_Brand_Sup_Kled(Ratings):
pass
class NA_Brand_Sup_KogMaw(Ratings):
pass
class NA_Brand_Sup_Leblanc(Ratings):
pass
class NA_Brand_Sup_LeeSin(Ratings):
pass
class NA_Brand_Sup_Leona(Ratings):
pass
class NA_Brand_Sup_Lissandra(Ratings):
pass
class NA_Brand_Sup_Lucian(Ratings):
pass
class NA_Brand_Sup_Lulu(Ratings):
pass
class NA_Brand_Sup_Lux(Ratings):
pass
class NA_Brand_Sup_Malphite(Ratings):
pass
class NA_Brand_Sup_Malzahar(Ratings):
pass
class NA_Brand_Sup_Maokai(Ratings):
pass
class NA_Brand_Sup_MasterYi(Ratings):
pass
class NA_Brand_Sup_MissFortune(Ratings):
pass
class NA_Brand_Sup_MonkeyKing(Ratings):
pass
class NA_Brand_Sup_Mordekaiser(Ratings):
pass
class NA_Brand_Sup_Morgana(Ratings):
pass
class NA_Brand_Sup_Nami(Ratings):
pass
class NA_Brand_Sup_Nasus(Ratings):
pass
class NA_Brand_Sup_Nautilus(Ratings):
pass
class NA_Brand_Sup_Nidalee(Ratings):
pass
class NA_Brand_Sup_Nocturne(Ratings):
pass
class NA_Brand_Sup_Nunu(Ratings):
pass
class NA_Brand_Sup_Olaf(Ratings):
pass
class NA_Brand_Sup_Orianna(Ratings):
pass
class NA_Brand_Sup_Ornn(Ratings):
pass
class NA_Brand_Sup_Pantheon(Ratings):
pass
class NA_Brand_Sup_Poppy(Ratings):
pass
class NA_Brand_Sup_Quinn(Ratings):
pass
class NA_Brand_Sup_Rakan(Ratings):
pass
class NA_Brand_Sup_Rammus(Ratings):
pass
class NA_Brand_Sup_RekSai(Ratings):
pass
class NA_Brand_Sup_Renekton(Ratings):
pass
class NA_Brand_Sup_Rengar(Ratings):
pass
class NA_Brand_Sup_Riven(Ratings):
pass
class NA_Brand_Sup_Rumble(Ratings):
pass
class NA_Brand_Sup_Ryze(Ratings):
pass
class NA_Brand_Sup_Sejuani(Ratings):
pass
class NA_Brand_Sup_Shaco(Ratings):
pass
class NA_Brand_Sup_Shen(Ratings):
pass
class NA_Brand_Sup_Shyvana(Ratings):
pass
class NA_Brand_Sup_Singed(Ratings):
pass
class NA_Brand_Sup_Sion(Ratings):
pass
class NA_Brand_Sup_Sivir(Ratings):
pass
class NA_Brand_Sup_Skarner(Ratings):
pass
class NA_Brand_Sup_Sona(Ratings):
pass
class NA_Brand_Sup_Soraka(Ratings):
pass
class NA_Brand_Sup_Swain(Ratings):
pass
class NA_Brand_Sup_Syndra(Ratings):
pass
class NA_Brand_Sup_TahmKench(Ratings):
pass
class NA_Brand_Sup_Taliyah(Ratings):
pass
class NA_Brand_Sup_Talon(Ratings):
pass
class NA_Brand_Sup_Taric(Ratings):
pass
class NA_Brand_Sup_Teemo(Ratings):
pass
class NA_Brand_Sup_Thresh(Ratings):
pass
class NA_Brand_Sup_Tristana(Ratings):
pass
class NA_Brand_Sup_Trundle(Ratings):
pass
class NA_Brand_Sup_Tryndamere(Ratings):
pass
class NA_Brand_Sup_TwistedFate(Ratings):
pass
class NA_Brand_Sup_Twitch(Ratings):
pass
class NA_Brand_Sup_Udyr(Ratings):
pass
class NA_Brand_Sup_Urgot(Ratings):
pass
class NA_Brand_Sup_Varus(Ratings):
pass
class NA_Brand_Sup_Vayne(Ratings):
pass
class NA_Brand_Sup_Veigar(Ratings):
pass
class NA_Brand_Sup_Velkoz(Ratings):
pass
class NA_Brand_Sup_Vi(Ratings):
pass
class NA_Brand_Sup_Viktor(Ratings):
pass
class NA_Brand_Sup_Vladimir(Ratings):
pass
class NA_Brand_Sup_Volibear(Ratings):
pass
class NA_Brand_Sup_Warwick(Ratings):
pass
class NA_Brand_Sup_Xayah(Ratings):
pass
class NA_Brand_Sup_Xerath(Ratings):
pass
class NA_Brand_Sup_XinZhao(Ratings):
pass
class NA_Brand_Sup_Yasuo(Ratings):
pass
class NA_Brand_Sup_Yorick(Ratings):
pass
class NA_Brand_Sup_Zac(Ratings):
pass
class NA_Brand_Sup_Zed(Ratings):
pass
class NA_Brand_Sup_Ziggs(Ratings):
pass
class NA_Brand_Sup_Zilean(Ratings):
pass
class NA_Brand_Sup_Zyra(Ratings):
pass
| 15.364508
| 46
| 0.761667
| 972
| 6,407
| 4.59465
| 0.151235
| 0.216301
| 0.370802
| 0.463502
| 0.797582
| 0.797582
| 0
| 0
| 0
| 0
| 0
| 0
| 0.173404
| 6,407
| 416
| 47
| 15.401442
| 0.843278
| 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
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 1
| 0
|
0
| 7
|
d4c9ea9e3e9112ee030ece70cacf1393c4b48c54
| 50,788
|
py
|
Python
|
silver/migrations/0001_initial.py
|
DocTocToc/silver
|
f1b4a8871fc4a37c8813d3c010bc70dc59c0a6e5
|
[
"Apache-2.0"
] | 222
|
2017-01-15T10:30:57.000Z
|
2022-03-08T20:34:46.000Z
|
silver/migrations/0001_initial.py
|
DocTocToc/silver
|
f1b4a8871fc4a37c8813d3c010bc70dc59c0a6e5
|
[
"Apache-2.0"
] | 141
|
2017-01-11T10:56:49.000Z
|
2021-10-12T11:51:00.000Z
|
silver/migrations/0001_initial.py
|
DocTocToc/silver
|
f1b4a8871fc4a37c8813d3c010bc70dc59c0a6e5
|
[
"Apache-2.0"
] | 76
|
2017-01-10T13:50:27.000Z
|
2022-03-25T21:37:00.000Z
|
# Copyright (c) 2015 Presslabs SRL
#
# 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.
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.db.models.deletion
import django_fsm
import livefield.fields
import silver.models
import django.core.validators
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='BillingLog',
fields=[
('id', models.AutoField(verbose_name='ID',
serialize=False, auto_created=True, primary_key=True)),
('billing_date', models.DateField(
help_text=b'The date when the invoice/proforma was issued.')),
],
options={
'ordering': ['-billing_date'],
},
),
migrations.CreateModel(
name='Customer',
fields=[
('id', models.AutoField(verbose_name='ID',
serialize=False, auto_created=True, primary_key=True)),
('live', livefield.fields.LiveField(default=True)),
('name', models.CharField(
help_text=b'The name to be used for billing purposes.', max_length=128)),
('company', models.CharField(
max_length=128, null=True, blank=True)),
('email', models.EmailField(
max_length=254, null=True, blank=True)),
('address_1', models.CharField(max_length=128)),
('address_2', models.CharField(
max_length=128, null=True, blank=True)),
('country', models.CharField(max_length=3, choices=[('AF', 'Afghanistan'), ('AL', 'Albania'), ('AQ', 'Antarctica'), ('DZ', 'Algeria'), ('AS', 'American Samoa'), ('AD', 'Andorra'), ('AO', 'Angola'), ('AG', 'Antigua and Barbuda'), ('AZ', 'Azerbaijan'), ('AR', 'Argentina'), ('AU', 'Australia'), ('AT', 'Austria'), ('BS', 'Bahamas'), ('BH', 'Bahrain'), ('BD', 'Bangladesh'), ('AM', 'Armenia'), ('BB', 'Barbados'), ('BE', 'Belgium'), ('BM', 'Bermuda'), ('BT', 'Bhutan'), ('BO', 'Bolivia'), ('BA', 'Bosnia and Herzegovina'), ('BW', 'Botswana'), ('BV', 'Bouvet Island'), ('BR', 'Brazil'), ('BZ', 'Belize'), ('IO', 'British Indian Ocean Territory'), ('SB', 'Solomon Islands'), ('VG', 'British Virgin Islands'), ('BN', 'Brunei Darussalam'), ('BG', 'Bulgaria'), ('MM', 'Myanmar'), ('BI', 'Burundi'), ('BY', 'Belarus'), ('KH', 'Cambodia'), ('CM', 'Cameroon'), ('CA', 'Canada'), ('CV', 'Cape Verde'), ('KY', 'Cayman Islands'), ('CF', 'Central African Republic'), ('LK', 'Sri Lanka'), ('TD', 'Chad'), ('CL', 'Chile'), ('CN', 'China'), ('TW', 'Taiwan'), ('CX', 'Christmas Island'), ('CC', 'Cocos'), ('CO', 'Colombia'), ('KM', 'Comoros'), ('YT', 'Mayotte'), ('CG', 'Congo'), ('CD', 'Congo'), ('CK', 'Cook Islands'), ('CR', 'Costa Rica'), ('HR', 'Croatia'), ('CU', 'Cuba'), ('CY', 'Cyprus'), ('CZ', 'Czech Republic'), ('BJ', 'Benin'), ('DK', 'Denmark'), ('DM', 'Dominica'), ('DO', 'Dominican Republic'), ('EC', 'Ecuador'), ('SV', 'El Salvador'), ('GQ', 'Equatorial Guinea'), ('ET', 'Ethiopia'), ('ER', 'Eritrea'), ('EE', 'Estonia'), ('FO', 'Faroe Islands'), ('FK', 'Falkland Islands'), ('GS', 'South Georgia and the South Sandwich Islands'), ('FJ', 'Fiji'), ('FI', 'Finland'), ('AX', '\xc5land Islands'), ('FR', 'France'), ('GF', 'French Guiana'), ('PF', 'French Polynesia'), ('TF', 'French Southern Territories'), ('DJ', 'Djibouti'), ('GA', 'Gabon'), ('GE', 'Georgia'), ('GM', 'Gambia'), ('PS', 'Palestinian Territory'), ('DE', 'Germany'), ('GH', 'Ghana'), ('GI', 'Gibraltar'), ('KI', 'Kiribati'), ('GR', 'Greece'), ('GL', 'Greenland'), ('GD', 'Grenada'), ('GP', 'Guadeloupe'), ('GU', 'Guam'), ('GT', 'Guatemala'), ('GN', 'Guinea'), ('GY', 'Guyana'), ('HT', 'Haiti'), ('HM', 'Heard Island and McDonald Islands'), ('VA', 'Holy See'), ('HN', 'Honduras'), ('HK', 'Hong Kong'), ('HU', 'Hungary'), ('IS', 'Iceland'), ('IN', 'India'), ('ID', 'Indonesia'), ('IR', 'Iran'), ('IQ', 'Iraq'), ('IE', 'Ireland'), ('IL', 'Israel'), ('IT', 'Italy'), ('CI', "Cote d'Ivoire"), ('JM', 'Jamaica'), ('JP', 'Japan'), ('KZ', 'Kazakhstan'), ('JO', 'Jordan'), ('KE', 'Kenya'), ('KP', 'Korea'), ('KR', 'Korea'), ('KW', 'Kuwait'), ('KG', 'Kyrgyz Republic'), ('LA', "Lao People's Democratic Republic"), ('LB', 'Lebanon'), ('LS', 'Lesotho'), ('LV', 'Latvia'), ('LR', 'Liberia'), ('LY', 'Libyan Arab Jamahiriya'), ('LI', 'Liechtenstein'), ('LT', 'Lithuania'), ('LU', 'Luxembourg'), ('MO', 'Macao'), (
'MG', 'Madagascar'), ('MW', 'Malawi'), ('MY', 'Malaysia'), ('MV', 'Maldives'), ('ML', 'Mali'), ('MT', 'Malta'), ('MQ', 'Martinique'), ('MR', 'Mauritania'), ('MU', 'Mauritius'), ('MX', 'Mexico'), ('MC', 'Monaco'), ('MN', 'Mongolia'), ('MD', 'Moldova'), ('ME', 'Montenegro'), ('MS', 'Montserrat'), ('MA', 'Morocco'), ('MZ', 'Mozambique'), ('OM', 'Oman'), ('NA', 'Namibia'), ('NR', 'Nauru'), ('NP', 'Nepal'), ('NL', 'Netherlands'), ('AN', 'Netherlands Antilles'), ('CW', 'Cura\xe7ao'), ('AW', 'Aruba'), ('SX', 'Sint Maarten'), ('BQ', 'Bonaire'), ('NC', 'New Caledonia'), ('VU', 'Vanuatu'), ('NZ', 'New Zealand'), ('NI', 'Nicaragua'), ('NE', 'Niger'), ('NG', 'Nigeria'), ('NU', 'Niue'), ('NF', 'Norfolk Island'), ('NO', 'Norway'), ('MP', 'Northern Mariana Islands'), ('UM', 'United States Minor Outlying Islands'), ('FM', 'Micronesia'), ('MH', 'Marshall Islands'), ('PW', 'Palau'), ('PK', 'Pakistan'), ('PA', 'Panama'), ('PG', 'Papua New Guinea'), ('PY', 'Paraguay'), ('PE', 'Peru'), ('PH', 'Philippines'), ('PN', 'Pitcairn Islands'), ('PL', 'Poland'), ('PT', 'Portugal'), ('GW', 'Guinea-Bissau'), ('TL', 'Timor-Leste'), ('PR', 'Puerto Rico'), ('QA', 'Qatar'), ('RE', 'Reunion'), ('RO', 'Romania'), ('RU', 'Russian Federation'), ('RW', 'Rwanda'), ('BL', 'Saint Barthelemy'), ('SH', 'Saint Helena'), ('KN', 'Saint Kitts and Nevis'), ('AI', 'Anguilla'), ('LC', 'Saint Lucia'), ('MF', 'Saint Martin'), ('PM', 'Saint Pierre and Miquelon'), ('VC', 'Saint Vincent and the Grenadines'), ('SM', 'San Marino'), ('ST', 'Sao Tome and Principe'), ('SA', 'Saudi Arabia'), ('SN', 'Senegal'), ('RS', 'Serbia'), ('SC', 'Seychelles'), ('SL', 'Sierra Leone'), ('SG', 'Singapore'), ('SK', 'Slovakia'), ('VN', 'Vietnam'), ('SI', 'Slovenia'), ('SO', 'Somalia'), ('ZA', 'South Africa'), ('ZW', 'Zimbabwe'), ('ES', 'Spain'), ('SS', 'South Sudan'), ('EH', 'Western Sahara'), ('SD', 'Sudan'), ('SR', 'Suriname'), ('SJ', 'Svalbard & Jan Mayen Islands'), ('SZ', 'Swaziland'), ('SE', 'Sweden'), ('CH', 'Switzerland'), ('SY', 'Syrian Arab Republic'), ('TJ', 'Tajikistan'), ('TH', 'Thailand'), ('TG', 'Togo'), ('TK', 'Tokelau'), ('TO', 'Tonga'), ('TT', 'Trinidad and Tobago'), ('AE', 'United Arab Emirates'), ('TN', 'Tunisia'), ('TR', 'Turkey'), ('TM', 'Turkmenistan'), ('TC', 'Turks and Caicos Islands'), ('TV', 'Tuvalu'), ('UG', 'Uganda'), ('UA', 'Ukraine'), ('MK', 'Macedonia'), ('EG', 'Egypt'), ('GB', 'United Kingdom'), ('GG', 'Guernsey'), ('JE', 'Jersey'), ('IM', 'Isle of Man'), ('TZ', 'Tanzania'), ('US', 'United States'), ('VI', 'United States Virgin Islands'), ('BF', 'Burkina Faso'), ('UY', 'Uruguay'), ('UZ', 'Uzbekistan'), ('VE', 'Venezuela'), ('WF', 'Wallis and Futuna'), ('WS', 'Samoa'), ('YE', 'Yemen'), ('ZM', 'Zambia'), ('XX', 'Disputed Territory'), ('XE', 'Iraq-Saudi Arabia Neutral Zone'), ('XD', 'United Nations Neutral Zone'), ('XS', 'Spratly Islands'), ('XS', 'Spratly Islands')])),
('city', models.CharField(max_length=128)),
('state', models.CharField(
max_length=128, null=True, blank=True)),
('zip_code', models.CharField(
max_length=32, null=True, blank=True)),
('extra', models.TextField(
help_text=b'Extra information to display on the invoice (markdown formatted).', null=True, blank=True)),
('payment_due_days', models.PositiveIntegerField(
default=5, help_text=b'Due days for generated proforma/invoice.')),
('consolidated_billing', models.BooleanField(
default=False, help_text=b'A flag indicating consolidated billing.')),
('customer_reference', models.CharField(
help_text=b"It's a reference to be passed between silver and clients. It usually points to an account ID.", max_length=256, null=True, blank=True)),
('sales_tax_number', models.CharField(
max_length=64, null=True, blank=True)),
('sales_tax_percent', models.DecimalField(decimal_places=2, validators=[django.core.validators.MinValueValidator(
0.0)], max_digits=4, blank=True, help_text=b"Whenever to add sales tax. If null, it won't show up on the invoice.", null=True)),
('sales_tax_name', models.CharField(
help_text=b"Sales tax name (eg. 'sales tax' or 'VAT').", max_length=64, null=True, blank=True)),
],
options={
'abstract': False,
},
),
migrations.CreateModel(
name='DocumentEntry',
fields=[
('id', models.AutoField(verbose_name='ID',
serialize=False, auto_created=True, primary_key=True)),
('description', models.CharField(max_length=255)),
('unit', models.CharField(
max_length=20, null=True, blank=True)),
('quantity', models.DecimalField(max_digits=19, decimal_places=2,
validators=[django.core.validators.MinValueValidator(0.0)])),
('unit_price', models.DecimalField(
max_digits=8, decimal_places=2)),
('start_date', models.DateField(null=True, blank=True)),
('end_date', models.DateField(null=True, blank=True)),
('prorated', models.BooleanField(default=False)),
],
options={
'verbose_name': 'Entry',
'verbose_name_plural': 'Entries',
},
),
migrations.CreateModel(
name='Invoice',
fields=[
('id', models.AutoField(verbose_name='ID',
serialize=False, auto_created=True, primary_key=True)),
('number', models.IntegerField(null=True, blank=True)),
('archived_customer',
models.JSONField(default=dict)),
('archived_provider',
models.JSONField(default=dict)),
('due_date', models.DateField(null=True, blank=True)),
('issue_date', models.DateField(null=True, blank=True)),
('paid_date', models.DateField(null=True, blank=True)),
('cancel_date', models.DateField(null=True, blank=True)),
('sales_tax_percent', models.DecimalField(blank=True, null=True, max_digits=4,
decimal_places=2, validators=[django.core.validators.MinValueValidator(
0.0)])),
('sales_tax_name', models.CharField(
max_length=64, null=True, blank=True)),
('currency', models.CharField(default=b'USD', help_text=b'The currency used for billing.', max_length=4, choices=[('USD', 'USD - United States Dollar'), ('EUR', 'EUR - Euro Members'), ('JPY', 'JPY - Japan Yen'), ('GBP', 'GBP - United Kingdom Pound'), ('CHF', 'CHF - Switzerland Franc'), ('AED', 'AED - United Arab Emirates Dirham'), ('AFN', 'AFN - Afghanistan Afghani'), ('ALL', 'ALL - Albania Lek'), ('AMD', 'AMD - Armenia Dram'), ('ANG', 'ANG - Netherlands Antilles Guilder'), ('AOA', 'AOA - Angola Kwanza'), ('ARS', 'ARS - Argentina Peso'), ('AUD', 'AUD - Australia Dollar'), ('AWG', 'AWG - Aruba Guilder'), ('AZN', 'AZN - Azerbaijan New Manat'), ('BAM', 'BAM - Bosnia and Herzegovina Convertible Marka'), ('BBD', 'BBD - Barbados Dollar'), ('BDT', 'BDT - Bangladesh Taka'), ('BGN', 'BGN - Bulgaria Lev'), ('BHD', 'BHD - Bahrain Dinar'), ('BIF', 'BIF - Burundi Franc'), ('BMD', 'BMD - Bermuda Dollar'), ('BND', 'BND - Brunei Darussalam Dollar'), ('BOB', 'BOB - Bolivia Boliviano'), ('BRL', 'BRL - Brazil Real'), ('BSD', 'BSD - Bahamas Dollar'), ('BTN', 'BTN - Bhutan Ngultrum'), ('BWP', 'BWP - Botswana Pula'), ('BYR', 'BYR - Belarus Ruble'), ('BZD', 'BZD - Belize Dollar'), ('CAD', 'CAD - Canada Dollar'), ('CDF', 'CDF - Congo/Kinshasa Franc'), ('CLP', 'CLP - Chile Peso'), ('CNY', 'CNY - China Yuan Renminbi'), ('COP', 'COP - Colombia Peso'), ('CRC', 'CRC - Costa Rica Colon'), ('CUC', 'CUC - Cuba Convertible Peso'), ('CUP', 'CUP - Cuba Peso'), ('CVE', 'CVE - Cape Verde Escudo'), ('CZK', 'CZK - Czech Republic Koruna'), ('DJF', 'DJF - Djibouti Franc'), ('DKK', 'DKK - Denmark Krone'), ('DOP', 'DOP - Dominican Republic Peso'), ('DZD', 'DZD - Algeria Dinar'), ('EGP', 'EGP - Egypt Pound'), ('ERN', 'ERN - Eritrea Nakfa'), ('ETB', 'ETB - Ethiopia Birr'), ('FJD', 'FJD - Fiji Dollar'), ('FKP', 'FKP - Falkland Islands (Malvinas) Pound'), ('GEL', 'GEL - Georgia Lari'), ('GGP', 'GGP - Guernsey Pound'), ('GHS', 'GHS - Ghana Cedi'), ('GIP', 'GIP - Gibraltar Pound'), ('GMD', 'GMD - Gambia Dalasi'), ('GNF', 'GNF - Guinea Franc'), ('GTQ', 'GTQ - Guatemala Quetzal'), ('GYD', 'GYD - Guyana Dollar'), ('HKD', 'HKD - Hong Kong Dollar'), ('HNL', 'HNL - Honduras Lempira'), ('HRK', 'HRK - Croatia Kuna'), ('HTG', 'HTG - Haiti Gourde'), ('HUF', 'HUF - Hungary Forint'), ('IDR', 'IDR - Indonesia Rupiah'), ('ILS', 'ILS - Israel Shekel'), ('IMP', 'IMP - Isle of Man Pound'), ('INR', 'INR - India Rupee'), ('IQD', 'IQD - Iraq Dinar'), ('IRR', 'IRR - Iran Rial'), ('ISK', 'ISK - Iceland Krona'), ('JEP', 'JEP - Jersey Pound'), ('JMD', 'JMD - Jamaica Dollar'), ('JOD', 'JOD - Jordan Dinar'), ('KES', 'KES - Kenya Shilling'), ('KGS', 'KGS - Kyrgyzstan Som'), ('KHR', 'KHR - Cambodia Riel'), ('KMF', 'KMF - Comoros Franc'), ('KPW', 'KPW - Korea (North) Won'), ('KRW', 'KRW - Korea (South) Won'), ('KWD', 'KWD - Kuwait Dinar'), ('KYD', 'KYD - Cayman Islands Dollar'), ('KZT', 'KZT - Kazakhstan Tenge'), ('LAK', 'LAK - Laos Kip'), ('LBP', 'LBP - Lebanon Pound'), (
'LKR', 'LKR - Sri Lanka Rupee'), ('LRD', 'LRD - Liberia Dollar'), ('LSL', 'LSL - Lesotho Loti'), ('LTL', 'LTL - Lithuania Litas'), ('LVL', 'LVL - Latvia Lat'), ('LYD', 'LYD - Libya Dinar'), ('MAD', 'MAD - Morocco Dirham'), ('MDL', 'MDL - Moldova Le'), ('MGA', 'MGA - Madagascar Ariary'), ('MKD', 'MKD - Macedonia Denar'), ('MMK', 'MMK - Myanmar (Burma) Kyat'), ('MNT', 'MNT - Mongolia Tughrik'), ('MOP', 'MOP - Macau Pataca'), ('MRO', 'MRO - Mauritania Ouguiya'), ('MUR', 'MUR - Mauritius Rupee'), ('MVR', 'MVR - Maldives (Maldive Islands) Rufiyaa'), ('MWK', 'MWK - Malawi Kwacha'), ('MXN', 'MXN - Mexico Peso'), ('MYR', 'MYR - Malaysia Ringgit'), ('MZN', 'MZN - Mozambique Metical'), ('NAD', 'NAD - Namibia Dollar'), ('NGN', 'NGN - Nigeria Naira'), ('NIO', 'NIO - Nicaragua Cordoba'), ('NOK', 'NOK - Norway Krone'), ('NPR', 'NPR - Nepal Rupee'), ('NZD', 'NZD - New Zealand Dollar'), ('OMR', 'OMR - Oman Rial'), ('PAB', 'PAB - Panama Balboa'), ('PEN', 'PEN - Peru Nuevo Sol'), ('PGK', 'PGK - Papua New Guinea Kina'), ('PHP', 'PHP - Philippines Peso'), ('PKR', 'PKR - Pakistan Rupee'), ('PLN', 'PLN - Poland Zloty'), ('PYG', 'PYG - Paraguay Guarani'), ('QAR', 'QAR - Qatar Riyal'), ('RON', 'RON - Romania New Le'), ('RSD', 'RSD - Serbia Dinar'), ('RUB', 'RUB - Russia Ruble'), ('RWF', 'RWF - Rwanda Franc'), ('SAR', 'SAR - Saudi Arabia Riyal'), ('SBD', 'SBD - Solomon Islands Dollar'), ('SCR', 'SCR - Seychelles Rupee'), ('SDG', 'SDG - Sudan Pound'), ('SEK', 'SEK - Sweden Krona'), ('SGD', 'SGD - Singapore Dollar'), ('SHP', 'SHP - Saint Helena Pound'), ('SLL', 'SLL - Sierra Leone Leone'), ('SOS', 'SOS - Somalia Shilling'), ('SPL', 'SPL - Seborga Luigino'), ('SRD', 'SRD - Suriname Dollar'), ('STD', 'STD - S\xe3o Tom\xe9 and Pr\xedncipe Dobra'), ('SVC', 'SVC - El Salvador Colon'), ('SYP', 'SYP - Syria Pound'), ('SZL', 'SZL - Swaziland Lilangeni'), ('THB', 'THB - Thailand Baht'), ('TJS', 'TJS - Tajikistan Somoni'), ('TMT', 'TMT - Turkmenistan Manat'), ('TND', 'TND - Tunisia Dinar'), ('TOP', "TOP - Tonga Pa'anga"), ('TRY', 'TRY - Turkey Lira'), ('TTD', 'TTD - Trinidad and Tobago Dollar'), ('TVD', 'TVD - Tuvalu Dollar'), ('TWD', 'TWD - Taiwan New Dollar'), ('TZS', 'TZS - Tanzania Shilling'), ('UAH', 'UAH - Ukraine Hryvna'), ('UGX', 'UGX - Uganda Shilling'), ('UYU', 'UYU - Uruguay Peso'), ('UZS', 'UZS - Uzbekistan Som'), ('VEF', 'VEF - Venezuela Bolivar'), ('VND', 'VND - Viet Nam Dong'), ('VUV', 'VUV - Vanuatu Vat'), ('WST', 'WST - Samoa Tala'), ('XAF', 'XAF - Communaut\xe9 Financi\xe8re Africaine (BEAC) CFA Franc BEAC'), ('XCD', 'XCD - East Caribbean Dollar'), ('XDR', 'XDR - International Monetary Fund (IMF) Special Drawing Rights'), ('XOF', 'XOF - Communaut\xe9 Financi\xe8re Africaine (BCEAO) Franc'), ('XPF', 'XPF - Comptoirs Fran\xe7ais du Pacifique (CFP) Franc'), ('YER', 'YER - Yemen Rial'), ('ZAR', 'ZAR - South Africa Rand'), ('ZMK', 'ZMK - Zambia Kwacha'), ('ZWD', 'ZWD - Zimbabwe Dollar')])),
('pdf', models.FileField(
upload_to=silver.models.documents.base.documents_pdf_path, null=True, editable=False, blank=True)),
('state', django_fsm.FSMField(default=b'draft', help_text=b'The state the invoice is in.', max_length=10,
verbose_name=b'State', choices=[(b'draft', b'Draft'), (b'issued', b'Issued'), (b'paid', b'Paid'), (b'canceled', b'Canceled')])),
('customer', models.ForeignKey(to='silver.Customer', on_delete=django.db.models.deletion.CASCADE)),
],
options={
'ordering': ('-issue_date', 'number'),
'abstract': False,
},
),
migrations.CreateModel(
name='MeteredFeature',
fields=[
('id', models.AutoField(verbose_name='ID',
serialize=False, auto_created=True, primary_key=True)),
('name', models.CharField(
help_text=b'The feature display name.', max_length=200)),
('unit', models.CharField(max_length=20)),
('price_per_unit', models.DecimalField(help_text=b'The price per unit.', max_digits=8,
decimal_places=2, validators=[django.core.validators.MinValueValidator(
0.0)])),
('included_units', models.DecimalField(help_text=b'The number of included units per plan interval.',
max_digits=19, decimal_places=2, validators=[django.core.validators.MinValueValidator(
0.0)])),
('included_units_during_trial', models.DecimalField(decimal_places=2, validators=[django.core.validators.MinValueValidator(
0.0)], max_digits=19, blank=True, help_text=b'The number of included units during the trial period.', null=True)),
],
),
migrations.CreateModel(
name='MeteredFeatureUnitsLog',
fields=[
('id', models.AutoField(verbose_name='ID',
serialize=False, auto_created=True, primary_key=True)),
('consumed_units', models.DecimalField(max_digits=19, decimal_places=2,
validators=[django.core.validators.MinValueValidator(0.0)])),
('start_date', models.DateField(editable=False)),
('end_date', models.DateField(editable=False)),
('metered_feature', models.ForeignKey(
related_name='consumed', to='silver.MeteredFeature', on_delete=django.db.models.deletion.CASCADE)),
],
),
migrations.CreateModel(
name='Plan',
fields=[
('id', models.AutoField(verbose_name='ID',
serialize=False, auto_created=True, primary_key=True)),
('name', models.CharField(
help_text=b'Display name of the plan.', max_length=200)),
('interval', models.CharField(default=b'month', help_text=b'The frequency with which a subscription should be billed.',
max_length=12, choices=[(
b'day', b'Day'), (b'week', b'Week'), (b'month', b'Month'), (b'year', b'Year')])),
('interval_count', models.PositiveIntegerField(
help_text=b'The number of intervals between each subscription billing')),
('amount', models.DecimalField(help_text=b'The amount in the specified currency to be charged on the interval specified.',
max_digits=8, decimal_places=2, validators=[django.core.validators.MinValueValidator(
0.0)])),
('currency', models.CharField(default=b'USD', help_text=b'The currency in which the subscription will be charged.', max_length=4, choices=[('USD', 'USD - United States Dollar'), ('EUR', 'EUR - Euro Members'), ('JPY', 'JPY - Japan Yen'), ('GBP', 'GBP - United Kingdom Pound'), ('CHF', 'CHF - Switzerland Franc'), ('AED', 'AED - United Arab Emirates Dirham'), ('AFN', 'AFN - Afghanistan Afghani'), ('ALL', 'ALL - Albania Lek'), ('AMD', 'AMD - Armenia Dram'), ('ANG', 'ANG - Netherlands Antilles Guilder'), ('AOA', 'AOA - Angola Kwanza'), ('ARS', 'ARS - Argentina Peso'), ('AUD', 'AUD - Australia Dollar'), ('AWG', 'AWG - Aruba Guilder'), ('AZN', 'AZN - Azerbaijan New Manat'), ('BAM', 'BAM - Bosnia and Herzegovina Convertible Marka'), ('BBD', 'BBD - Barbados Dollar'), ('BDT', 'BDT - Bangladesh Taka'), ('BGN', 'BGN - Bulgaria Lev'), ('BHD', 'BHD - Bahrain Dinar'), ('BIF', 'BIF - Burundi Franc'), ('BMD', 'BMD - Bermuda Dollar'), ('BND', 'BND - Brunei Darussalam Dollar'), ('BOB', 'BOB - Bolivia Boliviano'), ('BRL', 'BRL - Brazil Real'), ('BSD', 'BSD - Bahamas Dollar'), ('BTN', 'BTN - Bhutan Ngultrum'), ('BWP', 'BWP - Botswana Pula'), ('BYR', 'BYR - Belarus Ruble'), ('BZD', 'BZD - Belize Dollar'), ('CAD', 'CAD - Canada Dollar'), ('CDF', 'CDF - Congo/Kinshasa Franc'), ('CLP', 'CLP - Chile Peso'), ('CNY', 'CNY - China Yuan Renminbi'), ('COP', 'COP - Colombia Peso'), ('CRC', 'CRC - Costa Rica Colon'), ('CUC', 'CUC - Cuba Convertible Peso'), ('CUP', 'CUP - Cuba Peso'), ('CVE', 'CVE - Cape Verde Escudo'), ('CZK', 'CZK - Czech Republic Koruna'), ('DJF', 'DJF - Djibouti Franc'), ('DKK', 'DKK - Denmark Krone'), ('DOP', 'DOP - Dominican Republic Peso'), ('DZD', 'DZD - Algeria Dinar'), ('EGP', 'EGP - Egypt Pound'), ('ERN', 'ERN - Eritrea Nakfa'), ('ETB', 'ETB - Ethiopia Birr'), ('FJD', 'FJD - Fiji Dollar'), ('FKP', 'FKP - Falkland Islands (Malvinas) Pound'), ('GEL', 'GEL - Georgia Lari'), ('GGP', 'GGP - Guernsey Pound'), ('GHS', 'GHS - Ghana Cedi'), ('GIP', 'GIP - Gibraltar Pound'), ('GMD', 'GMD - Gambia Dalasi'), ('GNF', 'GNF - Guinea Franc'), ('GTQ', 'GTQ - Guatemala Quetzal'), ('GYD', 'GYD - Guyana Dollar'), ('HKD', 'HKD - Hong Kong Dollar'), ('HNL', 'HNL - Honduras Lempira'), ('HRK', 'HRK - Croatia Kuna'), ('HTG', 'HTG - Haiti Gourde'), ('HUF', 'HUF - Hungary Forint'), ('IDR', 'IDR - Indonesia Rupiah'), ('ILS', 'ILS - Israel Shekel'), ('IMP', 'IMP - Isle of Man Pound'), ('INR', 'INR - India Rupee'), ('IQD', 'IQD - Iraq Dinar'), ('IRR', 'IRR - Iran Rial'), ('ISK', 'ISK - Iceland Krona'), ('JEP', 'JEP - Jersey Pound'), ('JMD', 'JMD - Jamaica Dollar'), ('JOD', 'JOD - Jordan Dinar'), ('KES', 'KES - Kenya Shilling'), ('KGS', 'KGS - Kyrgyzstan Som'), ('KHR', 'KHR - Cambodia Riel'), ('KMF', 'KMF - Comoros Franc'), ('KPW', 'KPW - Korea (North) Won'), ('KRW', 'KRW - Korea (South) Won'), ('KWD', 'KWD - Kuwait Dinar'), ('KYD', 'KYD - Cayman Islands Dollar'), ('KZT', 'KZT - Kazakhstan Tenge'), ('LAK', 'LAK - Laos Kip'), (
'LBP', 'LBP - Lebanon Pound'), ('LKR', 'LKR - Sri Lanka Rupee'), ('LRD', 'LRD - Liberia Dollar'), ('LSL', 'LSL - Lesotho Loti'), ('LTL', 'LTL - Lithuania Litas'), ('LVL', 'LVL - Latvia Lat'), ('LYD', 'LYD - Libya Dinar'), ('MAD', 'MAD - Morocco Dirham'), ('MDL', 'MDL - Moldova Le'), ('MGA', 'MGA - Madagascar Ariary'), ('MKD', 'MKD - Macedonia Denar'), ('MMK', 'MMK - Myanmar (Burma) Kyat'), ('MNT', 'MNT - Mongolia Tughrik'), ('MOP', 'MOP - Macau Pataca'), ('MRO', 'MRO - Mauritania Ouguiya'), ('MUR', 'MUR - Mauritius Rupee'), ('MVR', 'MVR - Maldives (Maldive Islands) Rufiyaa'), ('MWK', 'MWK - Malawi Kwacha'), ('MXN', 'MXN - Mexico Peso'), ('MYR', 'MYR - Malaysia Ringgit'), ('MZN', 'MZN - Mozambique Metical'), ('NAD', 'NAD - Namibia Dollar'), ('NGN', 'NGN - Nigeria Naira'), ('NIO', 'NIO - Nicaragua Cordoba'), ('NOK', 'NOK - Norway Krone'), ('NPR', 'NPR - Nepal Rupee'), ('NZD', 'NZD - New Zealand Dollar'), ('OMR', 'OMR - Oman Rial'), ('PAB', 'PAB - Panama Balboa'), ('PEN', 'PEN - Peru Nuevo Sol'), ('PGK', 'PGK - Papua New Guinea Kina'), ('PHP', 'PHP - Philippines Peso'), ('PKR', 'PKR - Pakistan Rupee'), ('PLN', 'PLN - Poland Zloty'), ('PYG', 'PYG - Paraguay Guarani'), ('QAR', 'QAR - Qatar Riyal'), ('RON', 'RON - Romania New Le'), ('RSD', 'RSD - Serbia Dinar'), ('RUB', 'RUB - Russia Ruble'), ('RWF', 'RWF - Rwanda Franc'), ('SAR', 'SAR - Saudi Arabia Riyal'), ('SBD', 'SBD - Solomon Islands Dollar'), ('SCR', 'SCR - Seychelles Rupee'), ('SDG', 'SDG - Sudan Pound'), ('SEK', 'SEK - Sweden Krona'), ('SGD', 'SGD - Singapore Dollar'), ('SHP', 'SHP - Saint Helena Pound'), ('SLL', 'SLL - Sierra Leone Leone'), ('SOS', 'SOS - Somalia Shilling'), ('SPL', 'SPL - Seborga Luigino'), ('SRD', 'SRD - Suriname Dollar'), ('STD', 'STD - S\xe3o Tom\xe9 and Pr\xedncipe Dobra'), ('SVC', 'SVC - El Salvador Colon'), ('SYP', 'SYP - Syria Pound'), ('SZL', 'SZL - Swaziland Lilangeni'), ('THB', 'THB - Thailand Baht'), ('TJS', 'TJS - Tajikistan Somoni'), ('TMT', 'TMT - Turkmenistan Manat'), ('TND', 'TND - Tunisia Dinar'), ('TOP', "TOP - Tonga Pa'anga"), ('TRY', 'TRY - Turkey Lira'), ('TTD', 'TTD - Trinidad and Tobago Dollar'), ('TVD', 'TVD - Tuvalu Dollar'), ('TWD', 'TWD - Taiwan New Dollar'), ('TZS', 'TZS - Tanzania Shilling'), ('UAH', 'UAH - Ukraine Hryvna'), ('UGX', 'UGX - Uganda Shilling'), ('UYU', 'UYU - Uruguay Peso'), ('UZS', 'UZS - Uzbekistan Som'), ('VEF', 'VEF - Venezuela Bolivar'), ('VND', 'VND - Viet Nam Dong'), ('VUV', 'VUV - Vanuatu Vat'), ('WST', 'WST - Samoa Tala'), ('XAF', 'XAF - Communaut\xe9 Financi\xe8re Africaine (BEAC) CFA Franc BEAC'), ('XCD', 'XCD - East Caribbean Dollar'), ('XDR', 'XDR - International Monetary Fund (IMF) Special Drawing Rights'), ('XOF', 'XOF - Communaut\xe9 Financi\xe8re Africaine (BCEAO) Franc'), ('XPF', 'XPF - Comptoirs Fran\xe7ais du Pacifique (CFP) Franc'), ('YER', 'YER - Yemen Rial'), ('ZAR', 'ZAR - South Africa Rand'), ('ZMK', 'ZMK - Zambia Kwacha'), ('ZWD', 'ZWD - Zimbabwe Dollar')])),
('trial_period_days', models.PositiveIntegerField(
help_text=b'Number of trial period days granted when subscribing a customer to this plan.', null=True)),
('generate_after', models.PositiveIntegerField(
default=0, help_text=b'Number of seconds to wait after current billing cycle ends before generating the invoice. This can be used to allow systems to finish updating feature counters.')),
('enabled', models.BooleanField(
default=True, help_text=b'Whether to accept subscriptions.')),
('private', models.BooleanField(
default=False, help_text=b'Indicates if a plan is private.')),
('metered_features', models.ManyToManyField(
help_text=b"A list of the plan's metered features.", to='silver.MeteredFeature', blank=True)),
],
),
migrations.CreateModel(
name='ProductCode',
fields=[
('id', models.AutoField(verbose_name='ID',
serialize=False, auto_created=True, primary_key=True)),
('value', models.CharField(unique=True, max_length=128)),
],
),
migrations.CreateModel(
name='Proforma',
fields=[
('id', models.AutoField(verbose_name='ID',
serialize=False, auto_created=True, primary_key=True)),
('number', models.IntegerField(null=True, blank=True)),
('archived_customer',
models.JSONField(default=dict)),
('archived_provider',
models.JSONField(default=dict)),
('due_date', models.DateField(null=True, blank=True)),
('issue_date', models.DateField(null=True, blank=True)),
('paid_date', models.DateField(null=True, blank=True)),
('cancel_date', models.DateField(null=True, blank=True)),
('sales_tax_percent', models.DecimalField(blank=True, null=True, max_digits=4,
decimal_places=2, validators=[django.core.validators.MinValueValidator(
0.0)])),
('sales_tax_name', models.CharField(
max_length=64, null=True, blank=True)),
('currency', models.CharField(default=b'USD', help_text=b'The currency used for billing.', max_length=4, choices=[('USD', 'USD - United States Dollar'), ('EUR', 'EUR - Euro Members'), ('JPY', 'JPY - Japan Yen'), ('GBP', 'GBP - United Kingdom Pound'), ('CHF', 'CHF - Switzerland Franc'), ('AED', 'AED - United Arab Emirates Dirham'), ('AFN', 'AFN - Afghanistan Afghani'), ('ALL', 'ALL - Albania Lek'), ('AMD', 'AMD - Armenia Dram'), ('ANG', 'ANG - Netherlands Antilles Guilder'), ('AOA', 'AOA - Angola Kwanza'), ('ARS', 'ARS - Argentina Peso'), ('AUD', 'AUD - Australia Dollar'), ('AWG', 'AWG - Aruba Guilder'), ('AZN', 'AZN - Azerbaijan New Manat'), ('BAM', 'BAM - Bosnia and Herzegovina Convertible Marka'), ('BBD', 'BBD - Barbados Dollar'), ('BDT', 'BDT - Bangladesh Taka'), ('BGN', 'BGN - Bulgaria Lev'), ('BHD', 'BHD - Bahrain Dinar'), ('BIF', 'BIF - Burundi Franc'), ('BMD', 'BMD - Bermuda Dollar'), ('BND', 'BND - Brunei Darussalam Dollar'), ('BOB', 'BOB - Bolivia Boliviano'), ('BRL', 'BRL - Brazil Real'), ('BSD', 'BSD - Bahamas Dollar'), ('BTN', 'BTN - Bhutan Ngultrum'), ('BWP', 'BWP - Botswana Pula'), ('BYR', 'BYR - Belarus Ruble'), ('BZD', 'BZD - Belize Dollar'), ('CAD', 'CAD - Canada Dollar'), ('CDF', 'CDF - Congo/Kinshasa Franc'), ('CLP', 'CLP - Chile Peso'), ('CNY', 'CNY - China Yuan Renminbi'), ('COP', 'COP - Colombia Peso'), ('CRC', 'CRC - Costa Rica Colon'), ('CUC', 'CUC - Cuba Convertible Peso'), ('CUP', 'CUP - Cuba Peso'), ('CVE', 'CVE - Cape Verde Escudo'), ('CZK', 'CZK - Czech Republic Koruna'), ('DJF', 'DJF - Djibouti Franc'), ('DKK', 'DKK - Denmark Krone'), ('DOP', 'DOP - Dominican Republic Peso'), ('DZD', 'DZD - Algeria Dinar'), ('EGP', 'EGP - Egypt Pound'), ('ERN', 'ERN - Eritrea Nakfa'), ('ETB', 'ETB - Ethiopia Birr'), ('FJD', 'FJD - Fiji Dollar'), ('FKP', 'FKP - Falkland Islands (Malvinas) Pound'), ('GEL', 'GEL - Georgia Lari'), ('GGP', 'GGP - Guernsey Pound'), ('GHS', 'GHS - Ghana Cedi'), ('GIP', 'GIP - Gibraltar Pound'), ('GMD', 'GMD - Gambia Dalasi'), ('GNF', 'GNF - Guinea Franc'), ('GTQ', 'GTQ - Guatemala Quetzal'), ('GYD', 'GYD - Guyana Dollar'), ('HKD', 'HKD - Hong Kong Dollar'), ('HNL', 'HNL - Honduras Lempira'), ('HRK', 'HRK - Croatia Kuna'), ('HTG', 'HTG - Haiti Gourde'), ('HUF', 'HUF - Hungary Forint'), ('IDR', 'IDR - Indonesia Rupiah'), ('ILS', 'ILS - Israel Shekel'), ('IMP', 'IMP - Isle of Man Pound'), ('INR', 'INR - India Rupee'), ('IQD', 'IQD - Iraq Dinar'), ('IRR', 'IRR - Iran Rial'), ('ISK', 'ISK - Iceland Krona'), ('JEP', 'JEP - Jersey Pound'), ('JMD', 'JMD - Jamaica Dollar'), ('JOD', 'JOD - Jordan Dinar'), ('KES', 'KES - Kenya Shilling'), ('KGS', 'KGS - Kyrgyzstan Som'), ('KHR', 'KHR - Cambodia Riel'), ('KMF', 'KMF - Comoros Franc'), ('KPW', 'KPW - Korea (North) Won'), ('KRW', 'KRW - Korea (South) Won'), ('KWD', 'KWD - Kuwait Dinar'), ('KYD', 'KYD - Cayman Islands Dollar'), ('KZT', 'KZT - Kazakhstan Tenge'), ('LAK', 'LAK - Laos Kip'), ('LBP', 'LBP - Lebanon Pound'), (
'LKR', 'LKR - Sri Lanka Rupee'), ('LRD', 'LRD - Liberia Dollar'), ('LSL', 'LSL - Lesotho Loti'), ('LTL', 'LTL - Lithuania Litas'), ('LVL', 'LVL - Latvia Lat'), ('LYD', 'LYD - Libya Dinar'), ('MAD', 'MAD - Morocco Dirham'), ('MDL', 'MDL - Moldova Le'), ('MGA', 'MGA - Madagascar Ariary'), ('MKD', 'MKD - Macedonia Denar'), ('MMK', 'MMK - Myanmar (Burma) Kyat'), ('MNT', 'MNT - Mongolia Tughrik'), ('MOP', 'MOP - Macau Pataca'), ('MRO', 'MRO - Mauritania Ouguiya'), ('MUR', 'MUR - Mauritius Rupee'), ('MVR', 'MVR - Maldives (Maldive Islands) Rufiyaa'), ('MWK', 'MWK - Malawi Kwacha'), ('MXN', 'MXN - Mexico Peso'), ('MYR', 'MYR - Malaysia Ringgit'), ('MZN', 'MZN - Mozambique Metical'), ('NAD', 'NAD - Namibia Dollar'), ('NGN', 'NGN - Nigeria Naira'), ('NIO', 'NIO - Nicaragua Cordoba'), ('NOK', 'NOK - Norway Krone'), ('NPR', 'NPR - Nepal Rupee'), ('NZD', 'NZD - New Zealand Dollar'), ('OMR', 'OMR - Oman Rial'), ('PAB', 'PAB - Panama Balboa'), ('PEN', 'PEN - Peru Nuevo Sol'), ('PGK', 'PGK - Papua New Guinea Kina'), ('PHP', 'PHP - Philippines Peso'), ('PKR', 'PKR - Pakistan Rupee'), ('PLN', 'PLN - Poland Zloty'), ('PYG', 'PYG - Paraguay Guarani'), ('QAR', 'QAR - Qatar Riyal'), ('RON', 'RON - Romania New Le'), ('RSD', 'RSD - Serbia Dinar'), ('RUB', 'RUB - Russia Ruble'), ('RWF', 'RWF - Rwanda Franc'), ('SAR', 'SAR - Saudi Arabia Riyal'), ('SBD', 'SBD - Solomon Islands Dollar'), ('SCR', 'SCR - Seychelles Rupee'), ('SDG', 'SDG - Sudan Pound'), ('SEK', 'SEK - Sweden Krona'), ('SGD', 'SGD - Singapore Dollar'), ('SHP', 'SHP - Saint Helena Pound'), ('SLL', 'SLL - Sierra Leone Leone'), ('SOS', 'SOS - Somalia Shilling'), ('SPL', 'SPL - Seborga Luigino'), ('SRD', 'SRD - Suriname Dollar'), ('STD', 'STD - S\xe3o Tom\xe9 and Pr\xedncipe Dobra'), ('SVC', 'SVC - El Salvador Colon'), ('SYP', 'SYP - Syria Pound'), ('SZL', 'SZL - Swaziland Lilangeni'), ('THB', 'THB - Thailand Baht'), ('TJS', 'TJS - Tajikistan Somoni'), ('TMT', 'TMT - Turkmenistan Manat'), ('TND', 'TND - Tunisia Dinar'), ('TOP', "TOP - Tonga Pa'anga"), ('TRY', 'TRY - Turkey Lira'), ('TTD', 'TTD - Trinidad and Tobago Dollar'), ('TVD', 'TVD - Tuvalu Dollar'), ('TWD', 'TWD - Taiwan New Dollar'), ('TZS', 'TZS - Tanzania Shilling'), ('UAH', 'UAH - Ukraine Hryvna'), ('UGX', 'UGX - Uganda Shilling'), ('UYU', 'UYU - Uruguay Peso'), ('UZS', 'UZS - Uzbekistan Som'), ('VEF', 'VEF - Venezuela Bolivar'), ('VND', 'VND - Viet Nam Dong'), ('VUV', 'VUV - Vanuatu Vat'), ('WST', 'WST - Samoa Tala'), ('XAF', 'XAF - Communaut\xe9 Financi\xe8re Africaine (BEAC) CFA Franc BEAC'), ('XCD', 'XCD - East Caribbean Dollar'), ('XDR', 'XDR - International Monetary Fund (IMF) Special Drawing Rights'), ('XOF', 'XOF - Communaut\xe9 Financi\xe8re Africaine (BCEAO) Franc'), ('XPF', 'XPF - Comptoirs Fran\xe7ais du Pacifique (CFP) Franc'), ('YER', 'YER - Yemen Rial'), ('ZAR', 'ZAR - South Africa Rand'), ('ZMK', 'ZMK - Zambia Kwacha'), ('ZWD', 'ZWD - Zimbabwe Dollar')])),
('pdf', models.FileField(
upload_to=silver.models.documents.base.documents_pdf_path, null=True, editable=False, blank=True)),
('state', django_fsm.FSMField(default=b'draft', help_text=b'The state the invoice is in.', max_length=10,
verbose_name=b'State', choices=[(b'draft', b'Draft'), (b'issued', b'Issued'), (b'paid', b'Paid'), (b'canceled', b'Canceled')])),
('customer', models.ForeignKey(to='silver.Customer', on_delete=django.db.models.deletion.CASCADE)),
('invoice', models.ForeignKey(
related_name='related_invoice', blank=True, to='silver.Invoice', null=True, on_delete=django.db.models.deletion.CASCADE)),
],
options={
'ordering': ('-issue_date', 'number'),
'abstract': False,
},
),
migrations.CreateModel(
name='Provider',
fields=[
('id', models.AutoField(verbose_name='ID',
serialize=False, auto_created=True, primary_key=True)),
('live', livefield.fields.LiveField(default=True)),
('name', models.CharField(
help_text=b'The name to be used for billing purposes.', max_length=128)),
('company', models.CharField(
max_length=128, null=True, blank=True)),
('email', models.EmailField(
max_length=254, null=True, blank=True)),
('address_1', models.CharField(max_length=128)),
('address_2', models.CharField(
max_length=128, null=True, blank=True)),
('country', models.CharField(max_length=3, choices=[('AF', 'Afghanistan'), ('AL', 'Albania'), ('AQ', 'Antarctica'), ('DZ', 'Algeria'), ('AS', 'American Samoa'), ('AD', 'Andorra'), ('AO', 'Angola'), ('AG', 'Antigua and Barbuda'), ('AZ', 'Azerbaijan'), ('AR', 'Argentina'), ('AU', 'Australia'), ('AT', 'Austria'), ('BS', 'Bahamas'), ('BH', 'Bahrain'), ('BD', 'Bangladesh'), ('AM', 'Armenia'), ('BB', 'Barbados'), ('BE', 'Belgium'), ('BM', 'Bermuda'), ('BT', 'Bhutan'), ('BO', 'Bolivia'), ('BA', 'Bosnia and Herzegovina'), ('BW', 'Botswana'), ('BV', 'Bouvet Island'), ('BR', 'Brazil'), ('BZ', 'Belize'), ('IO', 'British Indian Ocean Territory'), ('SB', 'Solomon Islands'), ('VG', 'British Virgin Islands'), ('BN', 'Brunei Darussalam'), ('BG', 'Bulgaria'), ('MM', 'Myanmar'), ('BI', 'Burundi'), ('BY', 'Belarus'), ('KH', 'Cambodia'), ('CM', 'Cameroon'), ('CA', 'Canada'), ('CV', 'Cape Verde'), ('KY', 'Cayman Islands'), ('CF', 'Central African Republic'), ('LK', 'Sri Lanka'), ('TD', 'Chad'), ('CL', 'Chile'), ('CN', 'China'), ('TW', 'Taiwan'), ('CX', 'Christmas Island'), ('CC', 'Cocos'), ('CO', 'Colombia'), ('KM', 'Comoros'), ('YT', 'Mayotte'), ('CG', 'Congo'), ('CD', 'Congo'), ('CK', 'Cook Islands'), ('CR', 'Costa Rica'), ('HR', 'Croatia'), ('CU', 'Cuba'), ('CY', 'Cyprus'), ('CZ', 'Czech Republic'), ('BJ', 'Benin'), ('DK', 'Denmark'), ('DM', 'Dominica'), ('DO', 'Dominican Republic'), ('EC', 'Ecuador'), ('SV', 'El Salvador'), ('GQ', 'Equatorial Guinea'), ('ET', 'Ethiopia'), ('ER', 'Eritrea'), ('EE', 'Estonia'), ('FO', 'Faroe Islands'), ('FK', 'Falkland Islands'), ('GS', 'South Georgia and the South Sandwich Islands'), ('FJ', 'Fiji'), ('FI', 'Finland'), ('AX', '\xc5land Islands'), ('FR', 'France'), ('GF', 'French Guiana'), ('PF', 'French Polynesia'), ('TF', 'French Southern Territories'), ('DJ', 'Djibouti'), ('GA', 'Gabon'), ('GE', 'Georgia'), ('GM', 'Gambia'), ('PS', 'Palestinian Territory'), ('DE', 'Germany'), ('GH', 'Ghana'), ('GI', 'Gibraltar'), ('KI', 'Kiribati'), ('GR', 'Greece'), ('GL', 'Greenland'), ('GD', 'Grenada'), ('GP', 'Guadeloupe'), ('GU', 'Guam'), ('GT', 'Guatemala'), ('GN', 'Guinea'), ('GY', 'Guyana'), ('HT', 'Haiti'), ('HM', 'Heard Island and McDonald Islands'), ('VA', 'Holy See'), ('HN', 'Honduras'), ('HK', 'Hong Kong'), ('HU', 'Hungary'), ('IS', 'Iceland'), ('IN', 'India'), ('ID', 'Indonesia'), ('IR', 'Iran'), ('IQ', 'Iraq'), ('IE', 'Ireland'), ('IL', 'Israel'), ('IT', 'Italy'), ('CI', "Cote d'Ivoire"), ('JM', 'Jamaica'), ('JP', 'Japan'), ('KZ', 'Kazakhstan'), ('JO', 'Jordan'), ('KE', 'Kenya'), ('KP', 'Korea'), ('KR', 'Korea'), ('KW', 'Kuwait'), ('KG', 'Kyrgyz Republic'), ('LA', "Lao People's Democratic Republic"), ('LB', 'Lebanon'), ('LS', 'Lesotho'), ('LV', 'Latvia'), ('LR', 'Liberia'), ('LY', 'Libyan Arab Jamahiriya'), ('LI', 'Liechtenstein'), ('LT', 'Lithuania'), ('LU', 'Luxembourg'), ('MO', 'Macao'), (
'MG', 'Madagascar'), ('MW', 'Malawi'), ('MY', 'Malaysia'), ('MV', 'Maldives'), ('ML', 'Mali'), ('MT', 'Malta'), ('MQ', 'Martinique'), ('MR', 'Mauritania'), ('MU', 'Mauritius'), ('MX', 'Mexico'), ('MC', 'Monaco'), ('MN', 'Mongolia'), ('MD', 'Moldova'), ('ME', 'Montenegro'), ('MS', 'Montserrat'), ('MA', 'Morocco'), ('MZ', 'Mozambique'), ('OM', 'Oman'), ('NA', 'Namibia'), ('NR', 'Nauru'), ('NP', 'Nepal'), ('NL', 'Netherlands'), ('AN', 'Netherlands Antilles'), ('CW', 'Cura\xe7ao'), ('AW', 'Aruba'), ('SX', 'Sint Maarten'), ('BQ', 'Bonaire'), ('NC', 'New Caledonia'), ('VU', 'Vanuatu'), ('NZ', 'New Zealand'), ('NI', 'Nicaragua'), ('NE', 'Niger'), ('NG', 'Nigeria'), ('NU', 'Niue'), ('NF', 'Norfolk Island'), ('NO', 'Norway'), ('MP', 'Northern Mariana Islands'), ('UM', 'United States Minor Outlying Islands'), ('FM', 'Micronesia'), ('MH', 'Marshall Islands'), ('PW', 'Palau'), ('PK', 'Pakistan'), ('PA', 'Panama'), ('PG', 'Papua New Guinea'), ('PY', 'Paraguay'), ('PE', 'Peru'), ('PH', 'Philippines'), ('PN', 'Pitcairn Islands'), ('PL', 'Poland'), ('PT', 'Portugal'), ('GW', 'Guinea-Bissau'), ('TL', 'Timor-Leste'), ('PR', 'Puerto Rico'), ('QA', 'Qatar'), ('RE', 'Reunion'), ('RO', 'Romania'), ('RU', 'Russian Federation'), ('RW', 'Rwanda'), ('BL', 'Saint Barthelemy'), ('SH', 'Saint Helena'), ('KN', 'Saint Kitts and Nevis'), ('AI', 'Anguilla'), ('LC', 'Saint Lucia'), ('MF', 'Saint Martin'), ('PM', 'Saint Pierre and Miquelon'), ('VC', 'Saint Vincent and the Grenadines'), ('SM', 'San Marino'), ('ST', 'Sao Tome and Principe'), ('SA', 'Saudi Arabia'), ('SN', 'Senegal'), ('RS', 'Serbia'), ('SC', 'Seychelles'), ('SL', 'Sierra Leone'), ('SG', 'Singapore'), ('SK', 'Slovakia'), ('VN', 'Vietnam'), ('SI', 'Slovenia'), ('SO', 'Somalia'), ('ZA', 'South Africa'), ('ZW', 'Zimbabwe'), ('ES', 'Spain'), ('SS', 'South Sudan'), ('EH', 'Western Sahara'), ('SD', 'Sudan'), ('SR', 'Suriname'), ('SJ', 'Svalbard & Jan Mayen Islands'), ('SZ', 'Swaziland'), ('SE', 'Sweden'), ('CH', 'Switzerland'), ('SY', 'Syrian Arab Republic'), ('TJ', 'Tajikistan'), ('TH', 'Thailand'), ('TG', 'Togo'), ('TK', 'Tokelau'), ('TO', 'Tonga'), ('TT', 'Trinidad and Tobago'), ('AE', 'United Arab Emirates'), ('TN', 'Tunisia'), ('TR', 'Turkey'), ('TM', 'Turkmenistan'), ('TC', 'Turks and Caicos Islands'), ('TV', 'Tuvalu'), ('UG', 'Uganda'), ('UA', 'Ukraine'), ('MK', 'Macedonia'), ('EG', 'Egypt'), ('GB', 'United Kingdom'), ('GG', 'Guernsey'), ('JE', 'Jersey'), ('IM', 'Isle of Man'), ('TZ', 'Tanzania'), ('US', 'United States'), ('VI', 'United States Virgin Islands'), ('BF', 'Burkina Faso'), ('UY', 'Uruguay'), ('UZ', 'Uzbekistan'), ('VE', 'Venezuela'), ('WF', 'Wallis and Futuna'), ('WS', 'Samoa'), ('YE', 'Yemen'), ('ZM', 'Zambia'), ('XX', 'Disputed Territory'), ('XE', 'Iraq-Saudi Arabia Neutral Zone'), ('XD', 'United Nations Neutral Zone'), ('XS', 'Spratly Islands'), ('XS', 'Spratly Islands')])),
('city', models.CharField(max_length=128)),
('state', models.CharField(
max_length=128, null=True, blank=True)),
('zip_code', models.CharField(
max_length=32, null=True, blank=True)),
('extra', models.TextField(
help_text=b'Extra information to display on the invoice (markdown formatted).', null=True, blank=True)),
('flow', models.CharField(default=b'proforma', help_text=b'One of the available workflows for generating proformas and invoices (see the documentation for more details).',
max_length=10, choices=[(
b'proforma', b'Proforma'), (b'invoice', b'Invoice')])),
('invoice_series', models.CharField(
help_text=b'The series that will be used on every invoice generated by this provider.', max_length=20)),
('invoice_starting_number', models.PositiveIntegerField()),
('proforma_series', models.CharField(
help_text=b'The series that will be used on every proforma generated by this provider.', max_length=20, null=True, blank=True)),
('proforma_starting_number',
models.PositiveIntegerField(null=True, blank=True)),
('default_document_state', models.CharField(default=b'draft', help_text=b'The default state of the auto-generated documents.',
max_length=10, choices=[(
b'draft', b'Draft'), (b'issued', b'Issued')])),
],
options={
'abstract': False,
},
),
migrations.CreateModel(
name='Subscription',
fields=[
('id', models.AutoField(verbose_name='ID',
serialize=False, auto_created=True, primary_key=True)),
('description', models.CharField(
max_length=1024, null=True, blank=True)),
('trial_end', models.DateField(
help_text=b'The date at which the trial ends. If set, overrides the computed trial end date from the plan.', null=True, blank=True)),
('start_date', models.DateField(
help_text=b'The starting date for the subscription.', null=True, blank=True)),
('ended_at', models.DateField(
help_text=b'The date when the subscription ended.', null=True, blank=True)),
('reference', models.CharField(
help_text=b"The subscription's reference in an external system.", max_length=128, null=True, blank=True)),
('state', django_fsm.FSMField(default=b'inactive', help_text=b'The state the subscription is in.', protected=True,
max_length=12, choices=[(
b'active', b'Active'), (b'inactive', b'Inactive'), (b'canceled', b'Canceled'), (b'ended', b'Ended')])),
('customer', models.ForeignKey(related_name='subscriptions',
to='silver.Customer', help_text=b'The customer who is subscribed to the plan.', on_delete=django.db.models.deletion.CASCADE)),
('plan', models.ForeignKey(
help_text=b'The plan the customer is subscribed to.', to='silver.Plan', on_delete=django.db.models.deletion.CASCADE)),
],
),
migrations.AddField(
model_name='proforma',
name='provider',
field=models.ForeignKey(to='silver.Provider', on_delete=django.db.models.deletion.CASCADE),
),
migrations.AddField(
model_name='plan',
name='product_code',
field=models.OneToOneField(
to='silver.ProductCode',
help_text=b'The product code for this plan.',
on_delete=django.db.models.deletion.CASCADE),
),
migrations.AddField(
model_name='plan',
name='provider',
field=models.ForeignKey(
related_name='plans',
to='silver.Provider',
help_text=b'The provider which provides the plan.', on_delete=django.db.models.deletion.CASCADE),
),
migrations.AddField(
model_name='meteredfeatureunitslog',
name='subscription',
field=models.ForeignKey(
related_name='mf_log_entries',
to='silver.Subscription', on_delete=django.db.models.deletion.CASCADE),
),
migrations.AddField(
model_name='meteredfeature',
name='product_code',
field=silver.utils.models.UnsavedForeignKey(
help_text=b'The product code for this plan.',
to='silver.ProductCode', on_delete=django.db.models.deletion.CASCADE),
),
migrations.AddField(
model_name='invoice',
name='proforma',
field=models.ForeignKey(
related_name='related_proforma',
blank=True,
to='silver.Proforma',
null=True, on_delete=django.db.models.deletion.CASCADE),
),
migrations.AddField(
model_name='invoice',
name='provider',
field=models.ForeignKey(to='silver.Provider', on_delete=django.db.models.deletion.CASCADE),
),
migrations.AddField(
model_name='documententry',
name='invoice',
field=models.ForeignKey(
related_name='invoice_entries',
blank=True,
to='silver.Invoice',
null=True, on_delete=django.db.models.deletion.CASCADE),
),
migrations.AddField(
model_name='documententry',
name='product_code',
field=models.ForeignKey(
related_name='invoices',
blank=True,
to='silver.ProductCode',
null=True, on_delete=django.db.models.deletion.CASCADE),
),
migrations.AddField(
model_name='documententry',
name='proforma',
field=models.ForeignKey(
related_name='proforma_entries',
blank=True,
to='silver.Proforma',
null=True, on_delete=django.db.models.deletion.CASCADE),
),
migrations.AddField(
model_name='billinglog',
name='invoice',
field=models.ForeignKey(
related_name='billing_log_entries',
blank=True,
to='silver.Invoice',
null=True, on_delete=django.db.models.deletion.CASCADE),
),
migrations.AddField(
model_name='billinglog',
name='proforma',
field=models.ForeignKey(
related_name='billing_log_entries',
blank=True,
to='silver.Proforma',
null=True, on_delete=django.db.models.deletion.CASCADE),
),
migrations.AddField(
model_name='billinglog',
name='subscription',
field=models.ForeignKey(
related_name='billing_log_entries',
to='silver.Subscription', on_delete=django.db.models.deletion.CASCADE),
),
migrations.AlterUniqueTogether(
name='proforma',
unique_together=set([('provider', 'number')]),
),
migrations.AlterUniqueTogether(
name='meteredfeatureunitslog',
unique_together=set(
[('metered_feature',
'subscription',
'start_date',
'end_date')]),
),
migrations.AlterUniqueTogether(
name='invoice',
unique_together=set([('provider', 'number')]),
),
]
| 119.501176
| 2,971
| 0.561629
| 5,736
| 50,788
| 4.922071
| 0.201534
| 0.014451
| 0.013389
| 0.022279
| 0.863033
| 0.846704
| 0.83243
| 0.81132
| 0.804449
| 0.794602
| 0
| 0.00459
| 0.214933
| 50,788
| 424
| 2,972
| 119.783019
| 0.703501
| 0.011322
| 0
| 0.665012
| 0
| 0.007444
| 0.46217
| 0.004064
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0.002481
| 0.01737
| 0
| 0.024814
| 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
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 8
|
d4d953bb32a7c4d5546c57d12ff4d1855758f964
| 64
|
py
|
Python
|
niced_url_request/__init__.py
|
jerabaul29/niced_url_request
|
a725456b09ef434deaaa089062d07ee5a7ef47ed
|
[
"MIT"
] | null | null | null |
niced_url_request/__init__.py
|
jerabaul29/niced_url_request
|
a725456b09ef434deaaa089062d07ee5a7ef47ed
|
[
"MIT"
] | null | null | null |
niced_url_request/__init__.py
|
jerabaul29/niced_url_request
|
a725456b09ef434deaaa089062d07ee5a7ef47ed
|
[
"MIT"
] | null | null | null |
from niced_url_request.niced_url_request import NicedUrlRequest
| 32
| 63
| 0.921875
| 9
| 64
| 6.111111
| 0.666667
| 0.290909
| 0.545455
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.0625
| 64
| 1
| 64
| 64
| 0.916667
| 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
|
d4d98febd85a760e464823d95c4fea0919b64fbe
| 174
|
py
|
Python
|
guildmaster/models/__init__.py
|
mrogaski/umami
|
22879e9f8fcba510c7945c808512b9cf1dbeaa2c
|
[
"MIT"
] | 2
|
2018-03-08T02:54:12.000Z
|
2018-03-10T04:57:32.000Z
|
guildmaster/models/__init__.py
|
AIE-Guild/umami
|
22879e9f8fcba510c7945c808512b9cf1dbeaa2c
|
[
"MIT"
] | 50
|
2015-01-08T21:22:11.000Z
|
2019-12-21T08:00:11.000Z
|
guildmaster/models/__init__.py
|
mrogaski/umami
|
22879e9f8fcba510c7945c808512b9cf1dbeaa2c
|
[
"MIT"
] | 2
|
2015-04-20T18:14:03.000Z
|
2018-03-10T05:07:23.000Z
|
from guildmaster.models.accounts import DiscordAccount
from guildmaster.models.oauth2 import Client, Token
from guildmaster.models.providers import DiscordProvider, Provider
| 43.5
| 66
| 0.873563
| 20
| 174
| 7.6
| 0.6
| 0.296053
| 0.414474
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.00625
| 0.08046
| 174
| 3
| 67
| 58
| 0.94375
| 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
|
077070386cb2dd964b14725aeca208d63360dd23
| 19
|
py
|
Python
|
Chapter04/namedtuple_indexed.py
|
PacktPublishing/Secret-Recipes-of-the-Python-Ninja
|
805d00c7a54927ba94c9077e9a580508ee3c5e56
|
[
"MIT"
] | 13
|
2018-06-21T01:44:49.000Z
|
2021-12-01T10:49:53.000Z
|
Chapter04/namedtuple_indexed.py
|
PacktPublishing/Secret-Recipes-of-the-Python-Ninja
|
805d00c7a54927ba94c9077e9a580508ee3c5e56
|
[
"MIT"
] | null | null | null |
Chapter04/namedtuple_indexed.py
|
PacktPublishing/Secret-Recipes-of-the-Python-Ninja
|
805d00c7a54927ba94c9077e9a580508ee3c5e56
|
[
"MIT"
] | 6
|
2018-10-05T08:29:24.000Z
|
2022-01-11T14:49:50.000Z
|
>>> p[0] + p[1]
33
| 6.333333
| 15
| 0.315789
| 5
| 19
| 1.2
| 0.8
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.285714
| 0.263158
| 19
| 2
| 16
| 9.5
| 0.142857
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0
| null | null | 0
| 1
| 1
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
077c536408dab58e14aa5e62d0a3bf6747e0a116
| 1,624
|
py
|
Python
|
python/phonenumbers/shortdata/region_TH.py
|
KomarovAlea/python-phonenumbers
|
168a1f1e80502544089bc0739670a324730c09bb
|
[
"Apache-2.0"
] | null | null | null |
python/phonenumbers/shortdata/region_TH.py
|
KomarovAlea/python-phonenumbers
|
168a1f1e80502544089bc0739670a324730c09bb
|
[
"Apache-2.0"
] | null | null | null |
python/phonenumbers/shortdata/region_TH.py
|
KomarovAlea/python-phonenumbers
|
168a1f1e80502544089bc0739670a324730c09bb
|
[
"Apache-2.0"
] | null | null | null |
"""Auto-generated file, do not edit by hand. TH metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_TH = PhoneMetadata(id='TH', country_code=None, international_prefix=None,
general_desc=PhoneNumberDesc(national_number_pattern='1\\d{2,3}', possible_length=(3, 4)),
toll_free=PhoneNumberDesc(national_number_pattern='1(?:1(?:00|2[03]|3[3479]|55|7[67]|9[0246])|5(?:55|78)|6(?:44|6[79]|88|9[16])|88\\d|9[19])', example_number='191', possible_length=(3, 4)),
premium_rate=PhoneNumberDesc(national_number_pattern='1(?:113|2[23]\\d|5(?:09|56))', example_number='1113', possible_length=(4,)),
emergency=PhoneNumberDesc(national_number_pattern='1(?:669|9[19])', example_number='191', possible_length=(3, 4)),
short_code=PhoneNumberDesc(national_number_pattern='1(?:0[0-2]|1(?:0[03]|1[1-35]|2[0358]|3[03-79]|4[02-489]|5[04-9]|6[04-79]|7[03-9]|8[027-9]|9[02-79])|2(?:22|3[89])|3(?:18|2[23]|3[013]|5[56]|6[45]|73)|477|5(?:0\\d|4[0-37-9]|5[1-8]|6[01679]|7[12568]|8[0-24589]|9[013589])|6(?:0[0-29]|2[03]|4[3-6]|6[1-9]|7[0257-9]|8[0158]|9[014-9])|7(?:[14]9|7[27]|90)|888|9[19])', example_number='100', possible_length=(3, 4)),
standard_rate=PhoneNumberDesc(national_number_pattern='1(?:1(?:03|1[15]|2[58]|3[056]|4[02-49]|5[046-9]|[68]\\d|7[03-589]|9[579])|(?:3[1-35]|7[17])\\d|5(?:0[0-8]|4[0-378]|5[1-478]|[689]\\d|7[156])|6(?:0\\d|20|4[356]|6[1-68]|7[057-9]|8[015]|9[0457-9]))', example_number='1103', possible_length=(4,)),
carrier_specific=PhoneNumberDesc(national_number_pattern='114[89]', example_number='1148', possible_length=(4,)),
short_data=True)
| 124.923077
| 415
| 0.670567
| 315
| 1,624
| 3.336508
| 0.377778
| 0.153187
| 0.193149
| 0.239772
| 0.287345
| 0.181732
| 0.066603
| 0.066603
| 0.066603
| 0
| 0
| 0.227684
| 0.04803
| 1,624
| 12
| 416
| 135.333333
| 0.452135
| 0.032635
| 0
| 0
| 1
| 0.3
| 0.43131
| 0.397444
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.1
| 0
| 0.1
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
6af27ebee8b914ad617904bf435fa952d3012291
| 114
|
py
|
Python
|
test_template_engine.py
|
MarcSchaetz/CMakician
|
3dd52ca08018bf9f4a2aa2c44fd15c62f55f199b
|
[
"MIT"
] | null | null | null |
test_template_engine.py
|
MarcSchaetz/CMakician
|
3dd52ca08018bf9f4a2aa2c44fd15c62f55f199b
|
[
"MIT"
] | null | null | null |
test_template_engine.py
|
MarcSchaetz/CMakician
|
3dd52ca08018bf9f4a2aa2c44fd15c62f55f199b
|
[
"MIT"
] | null | null | null |
import pytest
import template_engine
def test_template_start():
template_engine.start_templating("monolith")
| 19
| 48
| 0.824561
| 14
| 114
| 6.357143
| 0.642857
| 0.314607
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.105263
| 114
| 5
| 49
| 22.8
| 0.872549
| 0
| 0
| 0
| 0
| 0
| 0.070175
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| true
| 0
| 0.5
| 0
| 0.75
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 7
|
ed00a7cdfa57955091783160bb953a0be9984023
| 145
|
py
|
Python
|
ntz.py
|
xt0fer/ntz-py
|
d2753dd395688c84f1a287bf196f60718facc2bf
|
[
"MIT"
] | null | null | null |
ntz.py
|
xt0fer/ntz-py
|
d2753dd395688c84f1a287bf196f60718facc2bf
|
[
"MIT"
] | null | null | null |
ntz.py
|
xt0fer/ntz-py
|
d2753dd395688c84f1a287bf196f60718facc2bf
|
[
"MIT"
] | null | null | null |
# add your code in this file
import os
# main function
def cli():
pass
def get_args():
return sys.argv
# run the main function
cli()
| 10.357143
| 28
| 0.662069
| 24
| 145
| 3.958333
| 0.833333
| 0.252632
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.255172
| 145
| 13
| 29
| 11.153846
| 0.87963
| 0.427586
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| true
| 0.166667
| 0.166667
| 0.166667
| 0.666667
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 1
| 1
| 0
|
0
| 7
|
ed0569aa192cf10e5c63f6408c29a4ccf96c3bf3
| 60,344
|
py
|
Python
|
code/python/IRNNotes/v1/fds/sdk/IRNNotes/api/notes_api.py
|
factset/enterprise-sdk
|
3fd4d1360756c515c9737a0c9a992c7451d7de7e
|
[
"Apache-2.0"
] | 6
|
2022-02-07T16:34:18.000Z
|
2022-03-30T08:04:57.000Z
|
code/python/IRNNotes/v1/fds/sdk/IRNNotes/api/notes_api.py
|
factset/enterprise-sdk
|
3fd4d1360756c515c9737a0c9a992c7451d7de7e
|
[
"Apache-2.0"
] | 2
|
2022-02-07T05:25:57.000Z
|
2022-03-07T14:18:04.000Z
|
code/python/IRNNotes/v1/fds/sdk/IRNNotes/api/notes_api.py
|
factset/enterprise-sdk
|
3fd4d1360756c515c9737a0c9a992c7451d7de7e
|
[
"Apache-2.0"
] | null | null | null |
"""
IRN API v1
Allows users to extract, create, update and configure IRN data. # noqa: E501
The version of the OpenAPI document: 1
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from multiprocessing.pool import ApplyResult
import typing
from fds.sdk.IRNNotes.api_client import ApiClient, Endpoint as _Endpoint
from fds.sdk.IRNNotes.model_utils import ( # noqa: F401
check_allowed_values,
check_validations,
date,
datetime,
file_type,
none_type,
validate_and_convert_types
)
from fds.sdk.IRNNotes.exceptions import ApiException
from fds.sdk.IRNNotes.model.create_note_dto import CreateNoteDto
from fds.sdk.IRNNotes.model.new_item_dto import NewItemDto
from fds.sdk.IRNNotes.model.note_dto import NoteDto
from fds.sdk.IRNNotes.model.note_summary_dto import NoteSummaryDto
from fds.sdk.IRNNotes.model.problem_details import ProblemDetails
from fds.sdk.IRNNotes.model.update_note_dto import UpdateNoteDto
class NotesApi(object):
"""NOTE: This class is auto generated by OpenAPI Generator
Ref: https://openapi-generator.tech
Do not edit the class manually.
"""
def __init__(self, api_client=None):
if api_client is None:
api_client = ApiClient()
self.api_client = api_client
self.create_note_endpoint = _Endpoint(
settings={
'response_type': (
{ 201: (NewItemDto,), 400: (ProblemDetails,), },
None
),
'auth': [
'FactSetApiKey',
'FactSetOAuth2'
],
'endpoint_path': '/v1/notes',
'operation_id': 'create_note',
'http_method': 'POST',
'servers': None,
},
params_map={
'all': [
'create_note_dto',
'x_irn_contributor_username',
'x_irn_contributor_serial',
],
'required': [
'create_note_dto',
],
'nullable': [
],
'enum': [
],
'validation': [
'x_irn_contributor_username',
'x_irn_contributor_serial',
]
},
root_map={
'validations': {
('x_irn_contributor_username',): {
'max_length': 30,
'min_length': 0,
},
('x_irn_contributor_serial',): {
'max_length': 8,
'min_length': 0,
},
},
'allowed_values': {
},
'openapi_types': {
'create_note_dto':
(CreateNoteDto,),
'x_irn_contributor_username':
(str,),
'x_irn_contributor_serial':
(str,),
},
'attribute_map': {
'x_irn_contributor_username': 'X-IRN-Contributor-Username',
'x_irn_contributor_serial': 'X-IRN-Contributor-Serial',
},
'location_map': {
'create_note_dto': 'body',
'x_irn_contributor_username': 'header',
'x_irn_contributor_serial': 'header',
},
'collection_format_map': {
}
},
headers_map={
'accept': [
'application/json'
],
'content_type': [
'application/json-patch+json',
'application/json',
'text/json',
'application/*+json'
]
},
api_client=api_client
)
self.delete_note_endpoint = _Endpoint(
settings={
'response_type': None,
'auth': [
'FactSetApiKey',
'FactSetOAuth2'
],
'endpoint_path': '/v1/notes/{noteId}',
'operation_id': 'delete_note',
'http_method': 'DELETE',
'servers': None,
},
params_map={
'all': [
'note_id',
],
'required': [
'note_id',
],
'nullable': [
],
'enum': [
],
'validation': [
]
},
root_map={
'validations': {
},
'allowed_values': {
},
'openapi_types': {
'note_id':
(str,),
},
'attribute_map': {
'note_id': 'noteId',
},
'location_map': {
'note_id': 'path',
},
'collection_format_map': {
}
},
headers_map={
'accept': [
'application/json'
],
'content_type': [],
},
api_client=api_client
)
self.get_note_endpoint = _Endpoint(
settings={
'response_type': (
{ 200: (NoteDto,), 404: (ProblemDetails,), 0: (ProblemDetails,), },
None
),
'auth': [
'FactSetApiKey',
'FactSetOAuth2'
],
'endpoint_path': '/v1/notes/{noteId}',
'operation_id': 'get_note',
'http_method': 'GET',
'servers': None,
},
params_map={
'all': [
'note_id',
],
'required': [
'note_id',
],
'nullable': [
],
'enum': [
],
'validation': [
]
},
root_map={
'validations': {
},
'allowed_values': {
},
'openapi_types': {
'note_id':
(str,),
},
'attribute_map': {
'note_id': 'noteId',
},
'location_map': {
'note_id': 'path',
},
'collection_format_map': {
}
},
headers_map={
'accept': [
'application/json'
],
'content_type': [],
},
api_client=api_client
)
self.get_notes_endpoint = _Endpoint(
settings={
'response_type': (
{ 200: ([NoteSummaryDto],), 400: (ProblemDetails,), },
None
),
'auth': [
'FactSetApiKey',
'FactSetOAuth2'
],
'endpoint_path': '/v1/notes',
'operation_id': 'get_notes',
'http_method': 'GET',
'servers': None,
},
params_map={
'all': [
'start',
'end',
'identifiers',
'authors',
'subjects',
'recommendations',
'sentiments',
'limit',
'offset',
'modified_since',
'states',
'filter_on_related_symbols',
'x_irn_include_deleted',
],
'required': [],
'nullable': [
],
'enum': [
],
'validation': [
]
},
root_map={
'validations': {
},
'allowed_values': {
},
'openapi_types': {
'start':
(str,),
'end':
(str,),
'identifiers':
([str],),
'authors':
([str],),
'subjects':
([str],),
'recommendations':
([str],),
'sentiments':
([str],),
'limit':
(int,),
'offset':
(int,),
'modified_since':
(str,),
'states':
([str],),
'filter_on_related_symbols':
(bool,),
'x_irn_include_deleted':
(bool,),
},
'attribute_map': {
'start': 'start',
'end': 'end',
'identifiers': 'identifiers',
'authors': 'authors',
'subjects': 'subjects',
'recommendations': 'recommendations',
'sentiments': 'sentiments',
'limit': 'limit',
'offset': 'offset',
'modified_since': 'modifiedSince',
'states': 'states',
'filter_on_related_symbols': 'filterOnRelatedSymbols',
'x_irn_include_deleted': 'X-IRN-Include-Deleted',
},
'location_map': {
'start': 'query',
'end': 'query',
'identifiers': 'query',
'authors': 'query',
'subjects': 'query',
'recommendations': 'query',
'sentiments': 'query',
'limit': 'query',
'offset': 'query',
'modified_since': 'query',
'states': 'query',
'filter_on_related_symbols': 'query',
'x_irn_include_deleted': 'header',
},
'collection_format_map': {
'identifiers': 'multi',
'authors': 'multi',
'subjects': 'multi',
'recommendations': 'multi',
'sentiments': 'multi',
'states': 'multi',
}
},
headers_map={
'accept': [
'application/json'
],
'content_type': [],
},
api_client=api_client
)
self.update_note_endpoint = _Endpoint(
settings={
'response_type': None,
'auth': [
'FactSetApiKey',
'FactSetOAuth2'
],
'endpoint_path': '/v1/notes/{noteId}',
'operation_id': 'update_note',
'http_method': 'PUT',
'servers': None,
},
params_map={
'all': [
'note_id',
'update_note_dto',
],
'required': [
'note_id',
],
'nullable': [
],
'enum': [
],
'validation': [
]
},
root_map={
'validations': {
},
'allowed_values': {
},
'openapi_types': {
'note_id':
(str,),
'update_note_dto':
(UpdateNoteDto,),
},
'attribute_map': {
'note_id': 'noteId',
},
'location_map': {
'note_id': 'path',
'update_note_dto': 'body',
},
'collection_format_map': {
}
},
headers_map={
'accept': [
'application/json'
],
'content_type': [
'application/json-patch+json',
'application/json',
'text/json',
'application/*+json'
]
},
api_client=api_client
)
@staticmethod
def apply_kwargs_defaults(kwargs, return_http_data_only, async_req):
kwargs["async_req"] = async_req
kwargs["_return_http_data_only"] = return_http_data_only
kwargs["_preload_content"] = kwargs.get("_preload_content", True)
kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False)
kwargs["_content_type"] = kwargs.get("_content_type")
kwargs["_host_index"] = kwargs.get("_host_index")
def create_note(
self,
create_note_dto,
**kwargs
) -> NewItemDto:
"""Create a note # noqa: E501
This method makes a synchronous HTTP request. Returns the http data only
Args:
create_note_dto (CreateNoteDto):
Keyword Args:
x_irn_contributor_username (str): [optional]
x_irn_contributor_serial (str): [optional]
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (int/float/tuple): timeout setting for this request. If
one number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_content_type (str/None): force body content-type.
Default is None and content-type will be predicted by allowed
content-types and body.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
Returns:
NewItemDto
Response Object
"""
self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=False)
kwargs['create_note_dto'] = \
create_note_dto
return self.create_note_endpoint.call_with_http_info(**kwargs)
def create_note_with_http_info(
self,
create_note_dto,
**kwargs
) -> typing.Tuple[NewItemDto, int, typing.MutableMapping]:
"""Create a note # noqa: E501
This method makes a synchronous HTTP request. Returns http data, http status and headers
Args:
create_note_dto (CreateNoteDto):
Keyword Args:
x_irn_contributor_username (str): [optional]
x_irn_contributor_serial (str): [optional]
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (int/float/tuple): timeout setting for this request. If
one number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_content_type (str/None): force body content-type.
Default is None and content-type will be predicted by allowed
content-types and body.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
Returns:
NewItemDto
Response Object
int
Http Status Code
dict
Dictionary of the response headers
"""
self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=False)
kwargs['create_note_dto'] = \
create_note_dto
return self.create_note_endpoint.call_with_http_info(**kwargs)
def create_note_async(
self,
create_note_dto,
**kwargs
) -> "ApplyResult[NewItemDto]":
"""Create a note # noqa: E501
This method makes a asynchronous HTTP request. Returns the http data, wrapped in ApplyResult
Args:
create_note_dto (CreateNoteDto):
Keyword Args:
x_irn_contributor_username (str): [optional]
x_irn_contributor_serial (str): [optional]
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (int/float/tuple): timeout setting for this request. If
one number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_content_type (str/None): force body content-type.
Default is None and content-type will be predicted by allowed
content-types and body.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
Returns:
ApplyResult[NewItemDto]
"""
self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=True)
kwargs['create_note_dto'] = \
create_note_dto
return self.create_note_endpoint.call_with_http_info(**kwargs)
def create_note_with_http_info_async(
self,
create_note_dto,
**kwargs
) -> "ApplyResult[typing.Tuple[NewItemDto, int, typing.MutableMapping]]":
"""Create a note # noqa: E501
This method makes a asynchronous HTTP request. Returns http data, http status and headers, wrapped in ApplyResult
Args:
create_note_dto (CreateNoteDto):
Keyword Args:
x_irn_contributor_username (str): [optional]
x_irn_contributor_serial (str): [optional]
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (int/float/tuple): timeout setting for this request. If
one number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_content_type (str/None): force body content-type.
Default is None and content-type will be predicted by allowed
content-types and body.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
Returns:
ApplyResult[(NewItemDto, int, typing.Dict)]
"""
self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=True)
kwargs['create_note_dto'] = \
create_note_dto
return self.create_note_endpoint.call_with_http_info(**kwargs)
def delete_note(
self,
note_id,
**kwargs
) -> None:
"""Delete a Note # noqa: E501
This method makes a synchronous HTTP request. Returns the http data only
Args:
note_id (str):
Keyword Args:
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (int/float/tuple): timeout setting for this request. If
one number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_content_type (str/None): force body content-type.
Default is None and content-type will be predicted by allowed
content-types and body.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
Returns:
None
Response Object
"""
self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=False)
kwargs['note_id'] = \
note_id
return self.delete_note_endpoint.call_with_http_info(**kwargs)
def delete_note_with_http_info(
self,
note_id,
**kwargs
) -> typing.Tuple[None, int, typing.MutableMapping]:
"""Delete a Note # noqa: E501
This method makes a synchronous HTTP request. Returns http data, http status and headers
Args:
note_id (str):
Keyword Args:
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (int/float/tuple): timeout setting for this request. If
one number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_content_type (str/None): force body content-type.
Default is None and content-type will be predicted by allowed
content-types and body.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
Returns:
None
Response Object
int
Http Status Code
dict
Dictionary of the response headers
"""
self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=False)
kwargs['note_id'] = \
note_id
return self.delete_note_endpoint.call_with_http_info(**kwargs)
def delete_note_async(
self,
note_id,
**kwargs
) -> "ApplyResult[None]":
"""Delete a Note # noqa: E501
This method makes a asynchronous HTTP request. Returns the http data, wrapped in ApplyResult
Args:
note_id (str):
Keyword Args:
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (int/float/tuple): timeout setting for this request. If
one number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_content_type (str/None): force body content-type.
Default is None and content-type will be predicted by allowed
content-types and body.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
Returns:
ApplyResult[None]
"""
self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=True)
kwargs['note_id'] = \
note_id
return self.delete_note_endpoint.call_with_http_info(**kwargs)
def delete_note_with_http_info_async(
self,
note_id,
**kwargs
) -> "ApplyResult[typing.Tuple[None, int, typing.MutableMapping]]":
"""Delete a Note # noqa: E501
This method makes a asynchronous HTTP request. Returns http data, http status and headers, wrapped in ApplyResult
Args:
note_id (str):
Keyword Args:
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (int/float/tuple): timeout setting for this request. If
one number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_content_type (str/None): force body content-type.
Default is None and content-type will be predicted by allowed
content-types and body.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
Returns:
ApplyResult[(None, int, typing.Dict)]
"""
self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=True)
kwargs['note_id'] = \
note_id
return self.delete_note_endpoint.call_with_http_info(**kwargs)
def get_note(
self,
note_id,
**kwargs
) -> NoteDto:
"""Get details of a note # noqa: E501
This method makes a synchronous HTTP request. Returns the http data only
Args:
note_id (str): Note Id
Keyword Args:
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (int/float/tuple): timeout setting for this request. If
one number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_content_type (str/None): force body content-type.
Default is None and content-type will be predicted by allowed
content-types and body.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
Returns:
NoteDto
Response Object
"""
self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=False)
kwargs['note_id'] = \
note_id
return self.get_note_endpoint.call_with_http_info(**kwargs)
def get_note_with_http_info(
self,
note_id,
**kwargs
) -> typing.Tuple[NoteDto, int, typing.MutableMapping]:
"""Get details of a note # noqa: E501
This method makes a synchronous HTTP request. Returns http data, http status and headers
Args:
note_id (str): Note Id
Keyword Args:
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (int/float/tuple): timeout setting for this request. If
one number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_content_type (str/None): force body content-type.
Default is None and content-type will be predicted by allowed
content-types and body.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
Returns:
NoteDto
Response Object
int
Http Status Code
dict
Dictionary of the response headers
"""
self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=False)
kwargs['note_id'] = \
note_id
return self.get_note_endpoint.call_with_http_info(**kwargs)
def get_note_async(
self,
note_id,
**kwargs
) -> "ApplyResult[NoteDto]":
"""Get details of a note # noqa: E501
This method makes a asynchronous HTTP request. Returns the http data, wrapped in ApplyResult
Args:
note_id (str): Note Id
Keyword Args:
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (int/float/tuple): timeout setting for this request. If
one number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_content_type (str/None): force body content-type.
Default is None and content-type will be predicted by allowed
content-types and body.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
Returns:
ApplyResult[NoteDto]
"""
self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=True)
kwargs['note_id'] = \
note_id
return self.get_note_endpoint.call_with_http_info(**kwargs)
def get_note_with_http_info_async(
self,
note_id,
**kwargs
) -> "ApplyResult[typing.Tuple[NoteDto, int, typing.MutableMapping]]":
"""Get details of a note # noqa: E501
This method makes a asynchronous HTTP request. Returns http data, http status and headers, wrapped in ApplyResult
Args:
note_id (str): Note Id
Keyword Args:
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (int/float/tuple): timeout setting for this request. If
one number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_content_type (str/None): force body content-type.
Default is None and content-type will be predicted by allowed
content-types and body.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
Returns:
ApplyResult[(NoteDto, int, typing.Dict)]
"""
self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=True)
kwargs['note_id'] = \
note_id
return self.get_note_endpoint.call_with_http_info(**kwargs)
def get_notes(
self,
**kwargs
) -> [NoteSummaryDto]:
"""Get all the notes in the specified date range filtered on the given identifiers # noqa: E501
This method makes a synchronous HTTP request. Returns the http data only
Keyword Args:
start (str): StartDate. [optional]
end (str): EndDate. [optional]
identifiers ([str]): Set of identifiers to filter on. [optional]
authors ([str]): Set of authors to filter on. [optional]
subjects ([str]): Set of subjects to filter on. [optional]
recommendations ([str]): Set of recommendations to filter on. [optional]
sentiments ([str]): Set of sentiments to filter on. [optional]
limit (int): Limit on the number of notes retrieved. [optional]
offset (int): Fetch notes after the offset. [optional]
modified_since (str): Only return notes which have been modified or created since a particular time. [optional]
states ([str]): Set of states to filter on. [optional]
filter_on_related_symbols (bool): Include notes whose related symbols match the identifier filter. [optional] if omitted the server will use the default value of False
x_irn_include_deleted (bool): [optional] if omitted the server will use the default value of False
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (int/float/tuple): timeout setting for this request. If
one number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_content_type (str/None): force body content-type.
Default is None and content-type will be predicted by allowed
content-types and body.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
Returns:
[NoteSummaryDto]
Response Object
"""
self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=False)
return self.get_notes_endpoint.call_with_http_info(**kwargs)
def get_notes_with_http_info(
self,
**kwargs
) -> typing.Tuple[[NoteSummaryDto], int, typing.MutableMapping]:
"""Get all the notes in the specified date range filtered on the given identifiers # noqa: E501
This method makes a synchronous HTTP request. Returns http data, http status and headers
Keyword Args:
start (str): StartDate. [optional]
end (str): EndDate. [optional]
identifiers ([str]): Set of identifiers to filter on. [optional]
authors ([str]): Set of authors to filter on. [optional]
subjects ([str]): Set of subjects to filter on. [optional]
recommendations ([str]): Set of recommendations to filter on. [optional]
sentiments ([str]): Set of sentiments to filter on. [optional]
limit (int): Limit on the number of notes retrieved. [optional]
offset (int): Fetch notes after the offset. [optional]
modified_since (str): Only return notes which have been modified or created since a particular time. [optional]
states ([str]): Set of states to filter on. [optional]
filter_on_related_symbols (bool): Include notes whose related symbols match the identifier filter. [optional] if omitted the server will use the default value of False
x_irn_include_deleted (bool): [optional] if omitted the server will use the default value of False
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (int/float/tuple): timeout setting for this request. If
one number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_content_type (str/None): force body content-type.
Default is None and content-type will be predicted by allowed
content-types and body.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
Returns:
[NoteSummaryDto]
Response Object
int
Http Status Code
dict
Dictionary of the response headers
"""
self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=False)
return self.get_notes_endpoint.call_with_http_info(**kwargs)
def get_notes_async(
self,
**kwargs
) -> "ApplyResult[[NoteSummaryDto]]":
"""Get all the notes in the specified date range filtered on the given identifiers # noqa: E501
This method makes a asynchronous HTTP request. Returns the http data, wrapped in ApplyResult
Keyword Args:
start (str): StartDate. [optional]
end (str): EndDate. [optional]
identifiers ([str]): Set of identifiers to filter on. [optional]
authors ([str]): Set of authors to filter on. [optional]
subjects ([str]): Set of subjects to filter on. [optional]
recommendations ([str]): Set of recommendations to filter on. [optional]
sentiments ([str]): Set of sentiments to filter on. [optional]
limit (int): Limit on the number of notes retrieved. [optional]
offset (int): Fetch notes after the offset. [optional]
modified_since (str): Only return notes which have been modified or created since a particular time. [optional]
states ([str]): Set of states to filter on. [optional]
filter_on_related_symbols (bool): Include notes whose related symbols match the identifier filter. [optional] if omitted the server will use the default value of False
x_irn_include_deleted (bool): [optional] if omitted the server will use the default value of False
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (int/float/tuple): timeout setting for this request. If
one number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_content_type (str/None): force body content-type.
Default is None and content-type will be predicted by allowed
content-types and body.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
Returns:
ApplyResult[[NoteSummaryDto]]
"""
self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=True)
return self.get_notes_endpoint.call_with_http_info(**kwargs)
def get_notes_with_http_info_async(
self,
**kwargs
) -> "ApplyResult[typing.Tuple[[NoteSummaryDto], int, typing.MutableMapping]]":
"""Get all the notes in the specified date range filtered on the given identifiers # noqa: E501
This method makes a asynchronous HTTP request. Returns http data, http status and headers, wrapped in ApplyResult
Keyword Args:
start (str): StartDate. [optional]
end (str): EndDate. [optional]
identifiers ([str]): Set of identifiers to filter on. [optional]
authors ([str]): Set of authors to filter on. [optional]
subjects ([str]): Set of subjects to filter on. [optional]
recommendations ([str]): Set of recommendations to filter on. [optional]
sentiments ([str]): Set of sentiments to filter on. [optional]
limit (int): Limit on the number of notes retrieved. [optional]
offset (int): Fetch notes after the offset. [optional]
modified_since (str): Only return notes which have been modified or created since a particular time. [optional]
states ([str]): Set of states to filter on. [optional]
filter_on_related_symbols (bool): Include notes whose related symbols match the identifier filter. [optional] if omitted the server will use the default value of False
x_irn_include_deleted (bool): [optional] if omitted the server will use the default value of False
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (int/float/tuple): timeout setting for this request. If
one number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_content_type (str/None): force body content-type.
Default is None and content-type will be predicted by allowed
content-types and body.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
Returns:
ApplyResult[([NoteSummaryDto], int, typing.Dict)]
"""
self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=True)
return self.get_notes_endpoint.call_with_http_info(**kwargs)
def update_note(
self,
note_id,
**kwargs
) -> None:
"""Update a note # noqa: E501
This method makes a synchronous HTTP request. Returns the http data only
Args:
note_id (str): Note Id
Keyword Args:
update_note_dto (UpdateNoteDto): Note details to update. [optional]
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (int/float/tuple): timeout setting for this request. If
one number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_content_type (str/None): force body content-type.
Default is None and content-type will be predicted by allowed
content-types and body.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
Returns:
None
Response Object
"""
self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=False)
kwargs['note_id'] = \
note_id
return self.update_note_endpoint.call_with_http_info(**kwargs)
def update_note_with_http_info(
self,
note_id,
**kwargs
) -> typing.Tuple[None, int, typing.MutableMapping]:
"""Update a note # noqa: E501
This method makes a synchronous HTTP request. Returns http data, http status and headers
Args:
note_id (str): Note Id
Keyword Args:
update_note_dto (UpdateNoteDto): Note details to update. [optional]
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (int/float/tuple): timeout setting for this request. If
one number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_content_type (str/None): force body content-type.
Default is None and content-type will be predicted by allowed
content-types and body.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
Returns:
None
Response Object
int
Http Status Code
dict
Dictionary of the response headers
"""
self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=False)
kwargs['note_id'] = \
note_id
return self.update_note_endpoint.call_with_http_info(**kwargs)
def update_note_async(
self,
note_id,
**kwargs
) -> "ApplyResult[None]":
"""Update a note # noqa: E501
This method makes a asynchronous HTTP request. Returns the http data, wrapped in ApplyResult
Args:
note_id (str): Note Id
Keyword Args:
update_note_dto (UpdateNoteDto): Note details to update. [optional]
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (int/float/tuple): timeout setting for this request. If
one number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_content_type (str/None): force body content-type.
Default is None and content-type will be predicted by allowed
content-types and body.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
Returns:
ApplyResult[None]
"""
self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=True, async_req=True)
kwargs['note_id'] = \
note_id
return self.update_note_endpoint.call_with_http_info(**kwargs)
def update_note_with_http_info_async(
self,
note_id,
**kwargs
) -> "ApplyResult[typing.Tuple[None, int, typing.MutableMapping]]":
"""Update a note # noqa: E501
This method makes a asynchronous HTTP request. Returns http data, http status and headers, wrapped in ApplyResult
Args:
note_id (str): Note Id
Keyword Args:
update_note_dto (UpdateNoteDto): Note details to update. [optional]
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (int/float/tuple): timeout setting for this request. If
one number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_content_type (str/None): force body content-type.
Default is None and content-type will be predicted by allowed
content-types and body.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
Returns:
ApplyResult[(None, int, typing.Dict)]
"""
self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=True)
kwargs['note_id'] = \
note_id
return self.update_note_endpoint.call_with_http_info(**kwargs)
| 43.664255
| 179
| 0.555946
| 6,607
| 60,344
| 4.920842
| 0.040563
| 0.033219
| 0.023991
| 0.023376
| 0.920491
| 0.90705
| 0.900652
| 0.895669
| 0.888134
| 0.887242
| 0
| 0.003399
| 0.375911
| 60,344
| 1,381
| 180
| 43.695873
| 0.859904
| 0.571275
| 0
| 0.605954
| 1
| 0
| 0.18627
| 0.056286
| 0
| 0
| 0
| 0
| 0
| 1
| 0.038529
| false
| 0
| 0.022767
| 0
| 0.098074
| 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
|
ed4526e451d54556c75b6a6f5e72291aed99496a
| 28,355
|
py
|
Python
|
tests/unit/loader/test_hive_loader.py
|
rt-phb/Spooq
|
ef101dcb4239cee43f56497908fee63998eb5846
|
[
"MIT"
] | null | null | null |
tests/unit/loader/test_hive_loader.py
|
rt-phb/Spooq
|
ef101dcb4239cee43f56497908fee63998eb5846
|
[
"MIT"
] | null | null | null |
tests/unit/loader/test_hive_loader.py
|
rt-phb/Spooq
|
ef101dcb4239cee43f56497908fee63998eb5846
|
[
"MIT"
] | null | null | null |
from builtins import chr
from builtins import str
from builtins import object
import pytest
from copy import deepcopy
from doubles import expect
from pyspark.sql.functions import udf as spark_udf
from pyspark.sql.functions import lit
from pyspark.sql import types as sql_types
from py4j.protocol import Py4JJavaError
from spooq2.loader import HiveLoader
@pytest.fixture(scope="function")
def default_params():
return {
"db_name": "test_hive_loader",
"table_name": "test_partitioned",
"repartition_size": 2,
"clear_partition": True,
"auto_create_table": True,
"overwrite_partition_value": True,
"partition_definitions": [
{"column_name": "partition_key_int", "column_type": "IntegerType", "default_value": 7}
],
}
@pytest.fixture()
def full_table_name(default_params):
return "{db}.{tbl}".format(db=default_params["db_name"], tbl=default_params["table_name"])
@pytest.fixture()
def default_loader(default_params):
return HiveLoader(**default_params)
@spark_udf
def convert_int_to_ascii_char(input):
return chr(input)
def construct_partition_query(partition_definitions):
partition_queries = []
for dct in partition_definitions:
if issubclass(dct["column_type"], sql_types.NumericType):
partition_queries.append("{part} = {dt}".format(part=dct["column_name"], dt=dct["default_value"]))
else:
partition_queries.append("{part} = '{dt}'".format(part=dct["column_name"], dt=dct["default_value"]))
return ", ".join(partition_queries)
class TestBasicAttributes(object):
def test_logger_should_be_accessible(self, default_loader):
assert hasattr(default_loader, "logger")
def test_name_is_set(self, default_loader):
assert default_loader.name == "HiveLoader"
def test_str_representation_is_correct(self, default_loader):
assert str(default_loader) == "Loader Object of Class HiveLoader"
class TestSinglePartitionColumn(object):
@pytest.fixture()
def input_df(self, spark_session, default_params, full_table_name):
df = spark_session.read.parquet("data/schema_v1/parquetFiles")
df = df.withColumn("partition_key_int", df.meta.version % 10) # 0-9
spark_session.conf.set("hive.exec.dynamic.partition", "true")
spark_session.conf.set("hive.exec.dynamic.partition.mode", "nonstrict")
spark_session.sql("DROP DATABASE IF EXISTS {db} CASCADE".format(db=default_params["db_name"]))
spark_session.sql("CREATE DATABASE {db}".format(db=default_params["db_name"]))
df.write.partitionBy("partition_key_int").saveAsTable(full_table_name)
yield df
spark_session.sql("DROP DATABASE IF EXISTS {db} CASCADE".format(db=default_params["db_name"]))
class TestWarnings(object):
def test_more_columns_than_expected(self, input_df, default_loader):
df_to_load = input_df.withColumn("5th_wheel", lit(12345))
with pytest.raises(AssertionError) as excinfo:
default_loader.load(df_to_load)
assert "Input columns don't match the columns of the Hive table" in str(excinfo.value)
def test_less_columns_than_expected(self, input_df, default_loader):
df_to_load = input_df.drop("birthday")
with pytest.raises(AssertionError) as excinfo:
default_loader.load(df_to_load)
assert "Input columns don't match the columns of the Hive table" in str(excinfo.value)
def test_different_columns_order_than_expected(self, input_df, default_loader):
df_to_load = input_df.select(list(reversed(input_df.columns)))
with pytest.raises(AssertionError) as excinfo:
default_loader.load(df_to_load)
assert "Input columns don't match the columns of the Hive table" in str(excinfo.value)
class TestClearPartition(object):
"""Clearing the Hive Table Partition before inserting"""
@pytest.mark.parametrize("partition", [0, 2, 3, 6, 9])
def test_clear_partition(self, spark_session, input_df, partition, default_params, full_table_name):
"""Partition is dropped"""
default_params["partition_definitions"][0]["default_value"] = partition
loader = HiveLoader(**default_params)
partition_query = construct_partition_query(loader.partition_definitions)
inverted_partition_query = partition_query.replace("=", "!=").replace(", ", " and ")
expected_count = input_df.where("partition_key_int != " + str(partition)).count()
loader._clear_hive_partition()
actual_count = spark_session.table(full_table_name).count()
assert actual_count == expected_count
def test_clear_partition_is_called_exactly_once(self, default_loader, input_df):
"""Clear Partition is called exactly once (Default)"""
expect(default_loader)._clear_hive_partition.exactly(1).time
default_loader.load(input_df)
def test_clear_partition_is_not_called(self, default_loader, input_df):
"""Clear Partition is not called (Default Values was Overridden)"""
default_loader.clear_partition = False
expect(default_loader)._clear_hive_partition.exactly(0).time
default_loader.load(input_df)
class TestPartitionDefinitions(object):
@pytest.mark.parametrize(
"partition_definitions", ["Some string", 123, 75.0, b"abcd", ("Hello", "World"), {"Nice_to": "meet_you"}]
)
def test_input_is_not_a_list(self, partition_definitions, default_params):
default_params["partition_definitions"] = partition_definitions
with pytest.raises(AssertionError) as excinfo:
HiveLoader(**default_params)
assert "partition_definitions has to be a list containing dicts" in str(excinfo.value)
@pytest.mark.parametrize("partition_definitions", ["Some string", 123, 75.0, b"abcd", ("Hello", "World")])
def test_list_input_contains_non_dict_items(self, partition_definitions, default_params):
default_params["partition_definitions"] = [partition_definitions]
with pytest.raises(AssertionError) as excinfo:
HiveLoader(**default_params)
assert "Items of partition_definitions have to be dictionaries" in str(excinfo.value)
def test_column_name_is_missing(self, default_params):
default_params["partition_definitions"][0]["column_name"] = None
with pytest.raises(AssertionError) as excinfo:
HiveLoader(**default_params)
assert "No column name set!" in str(excinfo.value)
@pytest.mark.parametrize("data_type", [13, "no_spark_type", "arrray", "INT", ["IntegerType", "StringType"]])
def test_column_type_not_a_valid_spark_sql_type(self, data_type, default_params):
default_params["partition_definitions"][0]["column_type"] = data_type
with pytest.raises(AssertionError) as excinfo:
HiveLoader(**default_params)
assert "Not a valid (PySpark) datatype for the partition column" in str(excinfo.value)
@pytest.mark.parametrize("default_value", [None, "", [], {}])
def test_default_value_is_empty(self, default_value, default_params, input_df):
default_params["partition_definitions"][0]["default_value"] = default_value
with pytest.raises(AssertionError) as excinfo:
loader = HiveLoader(**default_params)
loader.load(input_df)
assert "No default partition value set for partition column" in str(excinfo.value)
def test_default_value_is_missing(self, default_params, input_df):
default_params["partition_definitions"][0].pop("default_value")
with pytest.raises(AssertionError) as excinfo:
loader = HiveLoader(**default_params)
loader.load(input_df)
assert "No default partition value set for partition column" in str(excinfo.value)
@pytest.mark.parametrize("partition", [0, 2, 3, 6, 9])
class TestLoadPartition(object):
def test_add_new_static_partition(self, input_df, default_params, partition, full_table_name, spark_session):
default_params["partition_definitions"][0]["default_value"] = partition
loader = HiveLoader(**default_params)
partition_query = construct_partition_query(default_params["partition_definitions"])
inverted_partition_query = partition_query.replace("=", "!=").replace(", ", " and ")
df_to_load = input_df.where(partition_query)
count_pre_total = input_df.where(inverted_partition_query).count()
count_to_load = df_to_load.count()
count_post_total = input_df.count()
assert (
count_post_total == count_pre_total + count_to_load
), "Something went wrong in the test setup of the input dataframe (input_df)"
spark_session.sql(
"alter table {tbl} drop partition ({part_def})".format(tbl=full_table_name, part_def=partition_query)
)
assert (
spark_session.table(full_table_name).count() == count_pre_total
), "test partition was not successfully dropped from output hive table"
assert df_to_load.count() > 0, "Dataframe to load is empty!"
loader.load(df_to_load)
spark_session.catalog.refreshTable(full_table_name)
assert (
spark_session.table(full_table_name).count() == count_post_total
), "test partition was not successfully loaded to output hive table"
def test_overwrite_static_partition(self, input_df, default_params, partition, full_table_name, spark_session):
default_params["partition_definitions"][0]["default_value"] = partition
loader = HiveLoader(**default_params)
partition_query = construct_partition_query(default_params["partition_definitions"])
df_to_load = input_df.where(partition_query)
count_pre_total = spark_session.table(full_table_name).count()
count_to_load = input_df.where(partition_query).count()
count_post_total = input_df.count()
assert (
count_post_total == count_pre_total
), "Something went wrong in the test setup of the input DataFrame (input_df)"
assert df_to_load.count() > 0, "DataFrame to load is empty!"
loader.load(df_to_load)
spark_session.catalog.refreshTable(full_table_name)
assert (
spark_session.table(full_table_name).count() == count_post_total
), "test partition was not successfully loaded to output hive table"
def test_append_to_static_partition(self, input_df, default_params, partition, full_table_name, spark_session):
default_params["partition_definitions"][0]["default_value"] = partition
default_params["clear_partition"] = False
loader = HiveLoader(**default_params)
partition_query = construct_partition_query(default_params["partition_definitions"])
df_to_load = input_df.where(partition_query)
count_pre_total = spark_session.table(full_table_name).count()
count_to_load = df_to_load.count()
count_post_total = count_pre_total + count_to_load
assert df_to_load.count() > 0, "DataFrame to load is empty!"
loader.load(df_to_load)
spark_session.catalog.refreshTable(full_table_name)
assert (
spark_session.table(full_table_name).count() == count_post_total
), "test partition was not successfully loaded to output hive table"
def test_create_partitioned_table(self, input_df, default_params, partition, full_table_name, spark_session):
default_params["partition_definitions"][0]["default_value"] = partition
default_params["auto_create_table"] = True
loader = HiveLoader(**default_params)
spark_session.sql("drop table if exists " + full_table_name)
spark_session.catalog.setCurrentDatabase(default_params["db_name"])
assert default_params["table_name"] not in [
tbl.name for tbl in spark_session.catalog.listTables()
], "Test setup of database is not clean. Table already exists!"
partition_query = construct_partition_query(default_params["partition_definitions"])
df_to_load = input_df.where(partition_query)
count_to_load = df_to_load.count()
assert df_to_load.count() > 0, "DataFrame to load is empty!"
loader.load(df_to_load)
spark_session.catalog.refreshTable(full_table_name)
assert default_params["table_name"] in [
tbl.name for tbl in spark_session.catalog.listTables()
], "Table was not created!"
assert (
spark_session.table(full_table_name).count() == count_to_load
), "test partition was not successfully loaded to automatically created output hive table"
try:
assert spark_session.sql("show partitions " + full_table_name).count() > 0
except Py4JJavaError as e:
raise AssertionError("Created table is not partitioned. " + str(e))
def test_add_new_static_partition_with_overwritten_partition_value(
self, input_df, default_params, partition, full_table_name, spark_session
):
default_params["partition_definitions"][0]["default_value"] = partition
default_params["clear_partition"] = False
loader = HiveLoader(**default_params)
partition_query = construct_partition_query(default_params["partition_definitions"])
inverted_partition_query = partition_query.replace("=", "!=").replace(", ", " and ")
output_table = spark_session.table(full_table_name)
count_pre_partition = output_table.where(partition_query).count()
count_post_partition = input_df.count()
count_post_total = input_df.count() * 2
assert input_df.count() > 0, "Dataframe to load is empty!"
loader.load(input_df)
assert (
output_table.count() == count_post_total
), "test partition was not successfully loaded to output hive table"
assert (
output_table.where(partition_query).count() == input_df.count() + count_pre_partition
), "test partition was not successfully loaded to output hive table"
class TestMultiplePartitionColumn(object):
@pytest.fixture()
def input_df(self, spark_session, default_params, full_table_name):
df = spark_session.read.parquet("data/schema_v1/parquetFiles")
df = df.withColumn("partition_key_int", df.meta.version % 10) # 0-9
df = df.withColumn("partition_key_str", convert_int_to_ascii_char(df.partition_key_int + 100)) # d-m
spark_session.conf.set("hive.exec.dynamic.partition", "true")
spark_session.conf.set("hive.exec.dynamic.partition.mode", "nonstrict")
spark_session.sql("DROP DATABASE IF EXISTS {db} CASCADE".format(db=default_params["db_name"]))
spark_session.sql("CREATE DATABASE {db}".format(db=default_params["db_name"]))
df.write.partitionBy("partition_key_int", "partition_key_str").saveAsTable(full_table_name)
yield df
spark_session.sql("DROP DATABASE IF EXISTS {db} CASCADE".format(db=default_params["db_name"]))
@pytest.fixture(scope="function")
def default_params(self):
return {
"db_name": "test_hive_loader",
"table_name": "test_partitioned",
"repartition_size": 2,
"clear_partition": True,
"auto_create_table": True,
"overwrite_partition_value": True,
"partition_definitions": [
{"column_name": "partition_key_int", "column_type": "IntegerType", "default_value": 7},
{"column_name": "partition_key_str", "column_type": "StringType", "default_value": "k"},
],
}
class TestClearPartition(object):
"""Clearing the Hive Table Partition before inserting"""
# input_df.groupBy("partition_key_int", "partition_key_str").count().orderBy("partition_key_int", "partition_key_str").show(200)
@pytest.mark.parametrize("partition", [[0, "d"], [2, "f"], [3, "g"], [6, "j"], [9, "m"]])
def test_clear_partition(self, spark_session, input_df, partition, default_params, full_table_name):
"""Partition is dropped"""
(
default_params["partition_definitions"][0]["default_value"],
default_params["partition_definitions"][1]["default_value"],
) = partition
loader = HiveLoader(**default_params)
partition_query = construct_partition_query(loader.partition_definitions).replace(", ", " and ")
inverted_partition_query = partition_query.replace("=", "!=")
expected_count = input_df.where(inverted_partition_query).count()
loader._clear_hive_partition()
actual_count = spark_session.table(full_table_name).count()
assert actual_count == expected_count
def test_clear_partition_is_called_exactly_once(self, default_loader, input_df):
"""Clear Partition is called exactly once (Default)"""
expect(default_loader)._clear_hive_partition.exactly(1).time
default_loader.load(input_df)
def test_clear_partition_is_not_called(self, default_loader, input_df):
"""Clear Partition is not called (Default Values was Overridden)"""
default_loader.clear_partition = False
expect(default_loader)._clear_hive_partition.exactly(0).time
default_loader.load(input_df)
class TestPartitionDefinitions(object):
@pytest.mark.parametrize(
"partition_definitions", ["Some string", 123, 75.0, b"abcd", ("Hello", "World"), {"Nice_to": "meet_you"}]
)
def test_input_is_not_a_list(self, partition_definitions, default_params):
default_params["partition_definitions"] = partition_definitions
with pytest.raises(AssertionError) as excinfo:
HiveLoader(**default_params)
assert "partition_definitions has to be a list containing dicts" in str(excinfo.value)
@pytest.mark.parametrize("partition_definitions", ["Some string", 123, 75.0, b"abcd", ("Hello", "World")])
def test_list_input_contains_non_dict_items(self, partition_definitions, default_params):
default_params["partition_definitions"] = [partition_definitions]
with pytest.raises(AssertionError) as excinfo:
HiveLoader(**default_params)
assert "Items of partition_definitions have to be dictionaries" in str(excinfo.value)
def test_column_name_is_missing(self, default_params):
default_params["partition_definitions"][0]["column_name"], default_params["partition_definitions"][1]["column_name"] = None, "f"
with pytest.raises(AssertionError) as excinfo:
HiveLoader(**default_params)
assert "No column name set!" in str(excinfo.value)
@pytest.mark.parametrize("data_type", [13, "no_spark_type", "arrray", "INT", ["IntegerType", "StringType"]])
def test_column_type_not_a_valid_spark_sql_type(self, data_type, default_params):
default_params["partition_definitions"][0]["column_type"], default_params["partition_definitions"][0]["column_type"] = "IntegerType", data_type
with pytest.raises(AssertionError) as excinfo:
HiveLoader(**default_params)
assert "Not a valid (PySpark) datatype for the partition column" in str(excinfo.value)
@pytest.mark.parametrize("default_value", [None, "", [], {}])
def test_default_value_is_empty(self, default_value, default_params, input_df):
default_params["partition_definitions"][0]["default_value"], default_params["partition_definitions"][0]["default_value"] = 3, default_value
with pytest.raises(AssertionError) as excinfo:
loader = HiveLoader(**default_params)
loader.load(input_df)
assert "No default partition value set for partition column" in str(excinfo.value)
def test_default_value_is_missing(self, default_params, input_df):
default_params["partition_definitions"][1].pop("default_value")
with pytest.raises(AssertionError) as excinfo:
loader = HiveLoader(**default_params)
loader.load(input_df)
assert "No default partition value set for partition column" in str(excinfo.value)
@pytest.mark.parametrize("partition", [[0, "d"], [2, "f"], [3, "g"], [6, "j"], [9, "m"]])
class TestLoadPartition(object):
def test_add_new_static_partition(self, input_df, default_params, partition, full_table_name, spark_session):
(
default_params["partition_definitions"][0]["default_value"],
default_params["partition_definitions"][1]["default_value"],
) = partition
loader = HiveLoader(**default_params)
partition_clause = construct_partition_query(loader.partition_definitions)
where_clause = partition_clause.replace(", ", " and ")
where_clause_inverted = where_clause.replace("=", "!=")
df_to_load = input_df.where(where_clause)
count_pre_total = input_df.where(where_clause_inverted).count()
count_to_load = df_to_load.count()
count_post_total = input_df.count()
assert (
count_post_total == count_pre_total + count_to_load
), "Something went wrong in the test setup of the input dataframe (input_df)"
spark_session.sql(
"alter table {tbl} drop partition ({part_def})".format(tbl=full_table_name, part_def=partition_clause)
)
assert (
spark_session.table(full_table_name).count() == count_pre_total
), "test partition was not successfully dropped from output hive table"
assert df_to_load.count() > 0, "Dataframe to load is empty!"
loader.load(df_to_load)
spark_session.catalog.refreshTable(full_table_name)
assert (
spark_session.table(full_table_name).count() == count_post_total
), "test partition was not successfully loaded to output hive table"
def test_overwrite_static_partition(self, input_df, default_params, partition, full_table_name, spark_session):
(
default_params["partition_definitions"][0]["default_value"],
default_params["partition_definitions"][1]["default_value"],
) = partition
loader = HiveLoader(**default_params)
where_clause = construct_partition_query(loader.partition_definitions).replace(", ", " and ")
df_to_load = input_df.where(where_clause)
count_pre_total = spark_session.table(full_table_name).count()
count_to_load = df_to_load.count()
count_post_total = input_df.count()
assert (
count_post_total == count_pre_total
), "Something went wrong in the test setup of the input DataFrame (input_df)"
assert df_to_load.count() > 0, "DataFrame to load is empty!"
loader.load(df_to_load)
spark_session.catalog.refreshTable(full_table_name)
assert (
spark_session.table(full_table_name).count() == count_post_total
), "test partition was not successfully loaded to output hive table"
def test_append_to_static_partition(self, input_df, default_params, partition, full_table_name, spark_session):
(
default_params["partition_definitions"][0]["default_value"],
default_params["partition_definitions"][1]["default_value"],
) = partition
default_params["clear_partition"] = False
loader = HiveLoader(**default_params)
where_clause = construct_partition_query(loader.partition_definitions).replace(", ", " and ")
#
df_to_load = input_df.where(where_clause)
count_pre_total = spark_session.table(full_table_name).count()
count_to_load = df_to_load.count()
count_post_total = count_pre_total + count_to_load
assert df_to_load.count() > 0, "DataFrame to load is empty!"
loader.load(df_to_load)
spark_session.catalog.refreshTable(full_table_name)
assert (
spark_session.table(full_table_name).count() == count_post_total
), "test partition was not successfully loaded to output hive table"
def test_create_partitioned_table(self, input_df, default_params, partition, full_table_name, spark_session):
(
default_params["partition_definitions"][0]["default_value"],
default_params["partition_definitions"][1]["default_value"],
) = partition
default_params["auto_create_table"] = True
loader = HiveLoader(**default_params)
spark_session.sql("drop table if exists " + full_table_name)
spark_session.catalog.setCurrentDatabase(default_params["db_name"])
assert default_params["table_name"] not in [
tbl.name for tbl in spark_session.catalog.listTables()
], "Test setup of database is not clean. Table already exists!"
where_clause = construct_partition_query(loader.partition_definitions).replace(", ", " and ")
df_to_load = input_df.where(where_clause)
count_to_load = df_to_load.count()
assert df_to_load.count() > 0, "DataFrame to load is empty!"
loader.load(df_to_load)
spark_session.catalog.refreshTable(full_table_name)
assert default_params["table_name"] in [
tbl.name for tbl in spark_session.catalog.listTables()
], "Table was not created!"
assert (
spark_session.table(full_table_name).count() == count_to_load
), "test partition was not successfully loaded to automatically created output hive table"
try:
assert spark_session.sql("show partitions " + full_table_name).count() > 0
except Py4JJavaError as e:
raise AssertionError("Created table is not partitioned. " + str(e))
def test_add_new_static_partition_with_overwritten_partition_value(
self, input_df, default_params, partition, full_table_name, spark_session
):
(
default_params["partition_definitions"][0]["default_value"],
default_params["partition_definitions"][1]["default_value"],
) = partition
default_params["clear_partition"] = False
loader = HiveLoader(**default_params)
where_clause = construct_partition_query(loader.partition_definitions).replace(", ", " and ")
output_table = spark_session.table(full_table_name)
count_pre_partition = output_table.where(where_clause).count()
count_post_partition = input_df.count()
count_post_total = input_df.count() * 2
assert input_df.count() > 0, "Dataframe to load is empty!"
loader.load(input_df)
assert (
output_table.count() == count_post_total
), "test partition was not successfully loaded to output hive table"
assert (
output_table.where(where_clause).count() == input_df.count() + count_pre_partition
), "test partition was not successfully loaded to output hive table"
| 50.724508
| 155
| 0.661259
| 3,308
| 28,355
| 5.351874
| 0.073458
| 0.082976
| 0.068346
| 0.070831
| 0.925328
| 0.913466
| 0.901774
| 0.886862
| 0.884828
| 0.882569
| 0
| 0.005881
| 0.238406
| 28,355
| 558
| 156
| 50.815412
| 0.813938
| 0.01781
| 0
| 0.802721
| 0
| 0
| 0.202417
| 0.044238
| 0
| 0
| 0
| 0
| 0.160998
| 1
| 0.095238
| false
| 0
| 0.024943
| 0.011338
| 0.156463
| 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
|
ed571f4a52b4dd17c6272746407cf758147c60f6
| 31,029
|
py
|
Python
|
osm_pla/test/test_mznModelGenerator.py
|
TCSOSM-20/PLA
|
de4f7820a050a7ed18aa93a298c5a59e379e752b
|
[
"Apache-2.0"
] | null | null | null |
osm_pla/test/test_mznModelGenerator.py
|
TCSOSM-20/PLA
|
de4f7820a050a7ed18aa93a298c5a59e379e752b
|
[
"Apache-2.0"
] | null | null | null |
osm_pla/test/test_mznModelGenerator.py
|
TCSOSM-20/PLA
|
de4f7820a050a7ed18aa93a298c5a59e379e752b
|
[
"Apache-2.0"
] | null | null | null |
# Copyright 2020 ArctosLabs Scandinavia AB
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import datetime
import logging
# import unittest
from unittest import TestCase
# import random
# from operator import itemgetter
import re
from jinja2 import Template
from osm_pla.placement.mznplacement import MznModelGenerator
test_ns_placement_data_str = {
'vim_accounts': ['vim' + vim_account.replace('-', '_') for vim_account in ['aaaaaaaa-38f5-438d-b8ee-3f93b3531f87',
'bbbbbbbb-38f5-438d-b8ee-3f93b3531f87',
'cccccccc-ed84-4e49-b5df-a9d117bd731f',
'dddddddd-ed84-4e49-b5df-a9d117bd731f',
'eeeeeeee-38f5-438d-b8ee-3f93b3531f87']],
'trp_link_latency': [[0, 50, 100, 150, 200], [0, 0, 100, 150, 200], [0, 0, 0, 150, 200], [0, 0, 0, 0, 200],
[0, 0, 0, 0, 0]],
'trp_link_jitter': [[0, 5, 10, 15, 20], [0, 0, 10, 15, 20], [0, 0, 0, 15, 20], [0, 0, 0, 0, 20],
[0, 0, 0, 0, 0]],
'trp_link_price_list': [[0, 5, 6, 6, 7], [0, 0, 6, 6, 7], [0, 0, 0, 6, 7], [0, 0, 0, 0, 7], [0, 0, 0, 0, 0]],
'ns_desc': [
{'vnf_id': 'one', 'vnf_price_per_vim': [50, 51, 52, 53, 54]},
{'vnf_id': 'two', 'vnf_price_per_vim': [20, 21, 22, 23, 24]},
{'vnf_id': 'three', 'vnf_price_per_vim': [70, 71, 72, 73, 74]},
{'vnf_id': 'four', 'vnf_price_per_vim': [40, 41, 42, 43, 44]}],
'vld_desc': [{'cp_refs': ['one', 'two'], 'latency': 150, 'jitter': 30},
{'cp_refs': ['two', 'three'], 'latency': 140, 'jitter': 30},
{'cp_refs': ['three', 'four'], 'latency': 130, 'jitter': 30}],
'generator_data': {'file': __file__, 'time': datetime.datetime.now()}
}
test_ns_placement_data_str_no_vld_constraints = {
'vim_accounts': ['vim' + vim_account.replace('-', '_') for vim_account in ['aaaaaaaa-38f5-438d-b8ee-3f93b3531f87',
'bbbbbbbb-38f5-438d-b8ee-3f93b3531f87',
'cccccccc-ed84-4e49-b5df-a9d117bd731f',
'dddddddd-ed84-4e49-b5df-a9d117bd731f',
'eeeeeeee-38f5-438d-b8ee-3f93b3531f87']],
'trp_link_latency': [[0, 50, 100, 150, 200], [0, 0, 100, 150, 200], [0, 0, 0, 150, 200], [0, 0, 0, 0, 200],
[0, 0, 0, 0, 0]],
'trp_link_jitter': [[0, 5, 10, 15, 20], [0, 0, 10, 15, 20], [0, 0, 0, 15, 20], [0, 0, 0, 0, 20],
[0, 0, 0, 0, 0]],
'trp_link_price_list': [[0, 5, 6, 6, 7], [0, 0, 6, 6, 7], [0, 0, 0, 6, 7], [0, 0, 0, 0, 7], [0, 0, 0, 0, 0]],
'ns_desc': [
{'vnf_id': 'one', 'vnf_price_per_vim': [50, 51, 52, 53, 54]},
{'vnf_id': 'two', 'vnf_price_per_vim': [20, 21, 22, 23, 24]},
{'vnf_id': 'three', 'vnf_price_per_vim': [70, 71, 72, 73, 74]},
{'vnf_id': 'four', 'vnf_price_per_vim': [40, 41, 42, 43, 44]}],
'vld_desc': [{'cp_refs': ['one', 'two']},
{'cp_refs': ['two', 'three']},
{'cp_refs': ['three', 'four']}],
'generator_data': {'file': __file__, 'time': datetime.datetime.now()}
}
test_ns_placement_data = {
'vim_accounts': ['vim' + vim_account.replace('-', '_') for vim_account in ['aaaaaaaa-38f5-438d-b8ee-3f93b3531f87',
'bbbbbbbb-38f5-438d-b8ee-3f93b3531f87',
'cccccccc-ed84-4e49-b5df-a9d117bd731f',
'dddddddd-ed84-4e49-b5df-a9d117bd731f',
'eeeeeeee-38f5-438d-b8ee-3f93b3531f87']],
'trp_link_latency': [[0, 50, 100, 150, 200], [0, 0, 100, 150, 200], [0, 0, 0, 150, 200], [0, 0, 0, 0, 200],
[0, 0, 0, 0, 0]],
'trp_link_jitter': [[0, 5, 10, 15, 20], [0, 0, 10, 15, 20], [0, 0, 0, 15, 20], [0, 0, 0, 0, 20],
[0, 0, 0, 0, 0]],
'trp_link_price_list': [[0, 5, 6, 6, 7], [0, 0, 6, 6, 7], [0, 0, 0, 6, 7], [0, 0, 0, 0, 7], [0, 0, 0, 0, 0]],
'ns_desc': [
{'vnf_id': '1', 'vnf_price_per_vim': [50, 51, 52, 53, 54]},
{'vnf_id': '2', 'vnf_price_per_vim': [20, 21, 22, 23, 24]},
{'vnf_id': '3', 'vnf_price_per_vim': [70, 71, 72, 73, 74]},
{'vnf_id': '4', 'vnf_price_per_vim': [40, 41, 42, 43, 44]}],
'vld_desc': [{'cp_refs': ['1', '2'], 'latency': 150, 'jitter': 30},
{'cp_refs': ['2', '3'], 'latency': 140, 'jitter': 30},
{'cp_refs': ['3', '4'], 'latency': 130, 'jitter': 30}],
'generator_data': {'file': __file__, 'time': datetime.datetime.now()}
}
test_ns_placement_data_w_pinning = {
'vim_accounts': ['vim' + vim_account.replace('-', '_') for vim_account in ['aaaaaaaa-38f5-438d-b8ee-3f93b3531f87',
'bbbbbbbb-38f5-438d-b8ee-3f93b3531f87',
'cccccccc-ed84-4e49-b5df-a9d117bd731f',
'dddddddd-ed84-4e49-b5df-a9d117bd731f',
'eeeeeeee-38f5-438d-b8ee-3f93b3531f87']],
'trp_link_latency': [[0, 50, 100, 150, 200], [0, 0, 100, 150, 200], [0, 0, 0, 150, 200], [0, 0, 0, 0, 200],
[0, 0, 0, 0, 0]],
'trp_link_jitter': [[0, 5, 10, 15, 20], [0, 0, 10, 15, 20], [0, 0, 0, 15, 20], [0, 0, 0, 0, 20],
[0, 0, 0, 0, 0]],
'trp_link_price_list': [[0, 5, 6, 6, 7], [0, 0, 6, 6, 7], [0, 0, 0, 6, 7], [0, 0, 0, 0, 7], [0, 0, 0, 0, 0]],
'ns_desc': [
{'vnf_id': '1', 'vnf_price_per_vim': [50, 51, 52, 53, 54]},
{'vnf_id': '2', 'vnf_price_per_vim': [20, 21, 22, 23, 24],
'vim_account': 'vimeeeeeeee_38f5_438d_b8ee_3f93b3531f87'},
{'vnf_id': '3', 'vnf_price_per_vim': [70, 71, 72, 73, 74]},
{'vnf_id': '4', 'vnf_price_per_vim': [40, 41, 42, 43, 44],
'vim_account': 'vimcccccccc_ed84_4e49_b5df_a9d117bd731f'}],
'vld_desc': [{'cp_refs': ['1', '2'], 'latency': 150, 'jitter': 30},
{'cp_refs': ['2', '3'], 'latency': 140, 'jitter': 30},
{'cp_refs': ['3', '4'], 'latency': 130, 'jitter': 30}],
'generator_data': {'file': __file__, 'time': datetime.datetime.now()}
}
test_ns_placement_data_w_pinning_str = {
'vim_accounts': ['vim' + vim_account.replace('-', '_') for vim_account in ['aaaaaaaa-38f5-438d-b8ee-3f93b3531f87',
'bbbbbbbb-38f5-438d-b8ee-3f93b3531f87',
'cccccccc-ed84-4e49-b5df-a9d117bd731f',
'dddddddd-ed84-4e49-b5df-a9d117bd731f',
'eeeeeeee-38f5-438d-b8ee-3f93b3531f87']],
'trp_link_latency': [[0, 50, 100, 150, 200], [0, 0, 100, 150, 200], [0, 0, 0, 150, 200], [0, 0, 0, 0, 200],
[0, 0, 0, 0, 0]],
'trp_link_jitter': [[0, 5, 10, 15, 20], [0, 0, 10, 15, 20], [0, 0, 0, 15, 20], [0, 0, 0, 0, 20],
[0, 0, 0, 0, 0]],
'trp_link_price_list': [[0, 5, 6, 6, 7], [0, 0, 6, 6, 7], [0, 0, 0, 6, 7], [0, 0, 0, 0, 7], [0, 0, 0, 0, 0]],
'ns_desc': [
{'vnf_id': 'one', 'vnf_price_per_vim': [50, 51, 52, 53, 54]},
{'vnf_id': 'two', 'vnf_price_per_vim': [20, 21, 22, 23, 24],
'vim_account': 'vimeeeeeeee_38f5_438d_b8ee_3f93b3531f87'},
{'vnf_id': 'three', 'vnf_price_per_vim': [70, 71, 72, 73, 74]},
{'vnf_id': 'four', 'vnf_price_per_vim': [40, 41, 42, 43, 44],
'vim_account': 'vimcccccccc_ed84_4e49_b5df_a9d117bd731f'}],
'vld_desc': [{'cp_refs': ['one', 'two'], 'latency': 150, 'jitter': 30},
{'cp_refs': ['two', 'three'], 'latency': 140, 'jitter': 30},
{'cp_refs': ['three', 'four'], 'latency': 130, 'jitter': 30}],
'generator_data': {'file': __file__, 'time': datetime.datetime.now()}
}
test_ns_placement_data_str_no_vld = {
'vim_accounts': ['vim' + vim_account.replace('-', '_') for vim_account in ['aaaaaaaa-38f5-438d-b8ee-3f93b3531f87',
'bbbbbbbb-38f5-438d-b8ee-3f93b3531f87',
'cccccccc-ed84-4e49-b5df-a9d117bd731f',
'dddddddd-ed84-4e49-b5df-a9d117bd731f',
'eeeeeeee-38f5-438d-b8ee-3f93b3531f87']],
'trp_link_latency': [[0, 50, 100, 150, 200], [0, 0, 100, 150, 200], [0, 0, 0, 150, 200], [0, 0, 0, 0, 200],
[0, 0, 0, 0, 0]],
'trp_link_jitter': [[0, 5, 10, 15, 20], [0, 0, 10, 15, 20], [0, 0, 0, 15, 20], [0, 0, 0, 0, 20],
[0, 0, 0, 0, 0]],
'trp_link_price_list': [[0, 5, 6, 6, 7], [0, 0, 6, 6, 7], [0, 0, 0, 6, 7], [0, 0, 0, 0, 7], [0, 0, 0, 0, 0]],
'ns_desc': [
{'vnf_id': 'one', 'vnf_price_per_vim': [50, 51, 52, 53, 54]}],
'vld_desc': [],
'generator_data': {'file': __file__, 'time': datetime.datetime.now()}
}
expected_model_fragment = """
%This is the NETWORK RESOURCE MODEL
enum Vims = {
vimaaaaaaaa_38f5_438d_b8ee_3f93b3531f87,
vimbbbbbbbb_38f5_438d_b8ee_3f93b3531f87,
vimcccccccc_ed84_4e49_b5df_a9d117bd731f,
vimdddddddd_ed84_4e49_b5df_a9d117bd731f,
vimeeeeeeee_38f5_438d_b8ee_3f93b3531f87}; % The vim-accounts
array[Vims, Vims] of int: trp_link_latency = [|0,50,100,150,200,
|0,0,100,150,200,
|0,0,0,150,200,
|0,0,0,0,200,
|0,0,0,0,0,
|]; % Transport link latency between data centers
array[Vims, Vims] of int: trp_link_jitter = [|0,5,10,15,20,
|0,0,10,15,20,
|0,0,0,15,20,
|0,0,0,0,20,
|0,0,0,0,0,
|]; % Transport link jitter between data centers
array[Vims, Vims] of int: trp_link_price_list = [|0,5,6,6,7,
|0,0,6,6,7,
|0,0,0,6,7,
|0,0,0,0,7,
|0,0,0,0,0,
|]; % Transport link price list
array[Vims] of int: vim_price_list_1 = [50,51,52,53,54];
array[Vims] of int: vim_price_list_2 = [20,21,22,23,24];
array[Vims] of int: vim_price_list_3 = [70,71,72,73,74];
array[Vims] of int: vim_price_list_4 = [40,41,42,43,44];
% This is the NETWORK BASIC LOAD MODEL (CONSUMED)
% NOTE. This is not applicable in OSM Release 7
% This is the SERVICE CONSUMPTION MODEL
% These are the variables, i.e. which DC to select for each VNF
var Vims: VNF1;
var Vims: VNF2;
var Vims: VNF3;
var Vims: VNF4;
% These are the set of rules for selecting DCs to VNFs
constraint trp_link_latency[VNF1, VNF2] <= 150;
constraint trp_link_latency[VNF2, VNF3] <= 140;
constraint trp_link_latency[VNF3, VNF4] <= 130;
constraint trp_link_jitter[VNF1, VNF2] <= 30;
constraint trp_link_jitter[VNF2, VNF3] <= 30;
constraint trp_link_jitter[VNF3, VNF4] <= 30;
% Calculate the cost for VNFs and cost for transport link and total cost
var int: used_transport_cost =trp_link_price_list[VNF1, VNF2]+
trp_link_price_list[VNF2, VNF3]+
trp_link_price_list[VNF3, VNF4];
var int: used_vim_cost =vim_price_list_1[VNF1]+
vim_price_list_2[VNF2]+
vim_price_list_3[VNF3]+
vim_price_list_4[VNF4];
var int: total_cost = used_transport_cost + used_vim_cost;
solve minimize total_cost;
"""
expected_model_fragment_str = """
%This is the NETWORK RESOURCE MODEL
enum Vims = {
vimaaaaaaaa_38f5_438d_b8ee_3f93b3531f87,
vimbbbbbbbb_38f5_438d_b8ee_3f93b3531f87,
vimcccccccc_ed84_4e49_b5df_a9d117bd731f,
vimdddddddd_ed84_4e49_b5df_a9d117bd731f,
vimeeeeeeee_38f5_438d_b8ee_3f93b3531f87}; % The vim-accounts
array[Vims, Vims] of int: trp_link_latency = [|0,50,100,150,200,
|0,0,100,150,200,
|0,0,0,150,200,
|0,0,0,0,200,
|0,0,0,0,0,
|]; % Transport link latency between data centers
array[Vims, Vims] of int: trp_link_jitter = [|0,5,10,15,20,
|0,0,10,15,20,
|0,0,0,15,20,
|0,0,0,0,20,
|0,0,0,0,0,
|]; % Transport link jitter between data centers
array[Vims, Vims] of int: trp_link_price_list = [|0,5,6,6,7,
|0,0,6,6,7,
|0,0,0,6,7,
|0,0,0,0,7,
|0,0,0,0,0,
|]; % Transport link price list
array[Vims] of int: vim_price_list_one = [50,51,52,53,54];
array[Vims] of int: vim_price_list_two = [20,21,22,23,24];
array[Vims] of int: vim_price_list_three = [70,71,72,73,74];
array[Vims] of int: vim_price_list_four = [40,41,42,43,44];
% This is the NETWORK BASIC LOAD MODEL (CONSUMED)
% NOTE. This is not applicable in OSM Release 7
% This is the SERVICE CONSUMPTION MODEL
% These are the variables, i.e. which DC to select for each VNF
var Vims: VNFone;
var Vims: VNFtwo;
var Vims: VNFthree;
var Vims: VNFfour;
% These are the set of rules for selecting DCs to VNFs
constraint trp_link_latency[VNFone, VNFtwo] <= 150;
constraint trp_link_latency[VNFtwo, VNFthree] <= 140;
constraint trp_link_latency[VNFthree, VNFfour] <= 130;
constraint trp_link_jitter[VNFone, VNFtwo] <= 30;
constraint trp_link_jitter[VNFtwo, VNFthree] <= 30;
constraint trp_link_jitter[VNFthree, VNFfour] <= 30;
% Calculate the cost for VNFs and cost for transport link and total cost
var int: used_transport_cost =trp_link_price_list[VNFone, VNFtwo]+
trp_link_price_list[VNFtwo, VNFthree]+
trp_link_price_list[VNFthree, VNFfour];
var int: used_vim_cost =vim_price_list_one[VNFone]+
vim_price_list_two[VNFtwo]+
vim_price_list_three[VNFthree]+
vim_price_list_four[VNFfour];
var int: total_cost = used_transport_cost + used_vim_cost;
solve minimize total_cost;
"""
expected_model_fragment_str_no_vld_constraints = """
%This is the NETWORK RESOURCE MODEL
enum Vims = {
vimaaaaaaaa_38f5_438d_b8ee_3f93b3531f87,
vimbbbbbbbb_38f5_438d_b8ee_3f93b3531f87,
vimcccccccc_ed84_4e49_b5df_a9d117bd731f,
vimdddddddd_ed84_4e49_b5df_a9d117bd731f,
vimeeeeeeee_38f5_438d_b8ee_3f93b3531f87}; % The vim-accounts
array[Vims, Vims] of int: trp_link_latency = [|0,50,100,150,200,
|0,0,100,150,200,
|0,0,0,150,200,
|0,0,0,0,200,
|0,0,0,0,0,
|]; % Transport link latency between data centers
array[Vims, Vims] of int: trp_link_jitter = [|0,5,10,15,20,
|0,0,10,15,20,
|0,0,0,15,20,
|0,0,0,0,20,
|0,0,0,0,0,
|]; % Transport link jitter between data centers
array[Vims, Vims] of int: trp_link_price_list = [|0,5,6,6,7,
|0,0,6,6,7,
|0,0,0,6,7,
|0,0,0,0,7,
|0,0,0,0,0,
|]; % Transport link price list
array[Vims] of int: vim_price_list_one = [50,51,52,53,54];
array[Vims] of int: vim_price_list_two = [20,21,22,23,24];
array[Vims] of int: vim_price_list_three = [70,71,72,73,74];
array[Vims] of int: vim_price_list_four = [40,41,42,43,44];
% This is the NETWORK BASIC LOAD MODEL (CONSUMED)
% NOTE. This is not applicable in OSM Release 7
% This is the SERVICE CONSUMPTION MODEL
% These are the variables, i.e. which DC to select for each VNF
var Vims: VNFone;
var Vims: VNFtwo;
var Vims: VNFthree;
var Vims: VNFfour;
% These are the set of rules for selecting DCs to VNFs
% Calculate the cost for VNFs and cost for transport link and total cost
var int: used_transport_cost =trp_link_price_list[VNFone, VNFtwo]+
trp_link_price_list[VNFtwo, VNFthree]+
trp_link_price_list[VNFthree, VNFfour];
var int: used_vim_cost =vim_price_list_one[VNFone]+
vim_price_list_two[VNFtwo]+
vim_price_list_three[VNFthree]+
vim_price_list_four[VNFfour];
var int: total_cost = used_transport_cost + used_vim_cost;
solve minimize total_cost;
"""
expected_model_fragment_w_pinning = """
%This is the NETWORK RESOURCE MODEL
enum Vims = {
vimaaaaaaaa_38f5_438d_b8ee_3f93b3531f87,
vimbbbbbbbb_38f5_438d_b8ee_3f93b3531f87,
vimcccccccc_ed84_4e49_b5df_a9d117bd731f,
vimdddddddd_ed84_4e49_b5df_a9d117bd731f,
vimeeeeeeee_38f5_438d_b8ee_3f93b3531f87}; % The vim-accounts
array[Vims, Vims] of int: trp_link_latency = [|0,50,100,150,200,
|0,0,100,150,200,
|0,0,0,150,200,
|0,0,0,0,200,
|0,0,0,0,0,
|]; % Transport link latency between data centers
array[Vims, Vims] of int: trp_link_jitter = [|0,5,10,15,20,
|0,0,10,15,20,
|0,0,0,15,20,
|0,0,0,0,20,
|0,0,0,0,0,
|]; % Transport link jitter between data centers
array[Vims, Vims] of int: trp_link_price_list = [|0,5,6,6,7,
|0,0,6,6,7,
|0,0,0,6,7,
|0,0,0,0,7,
|0,0,0,0,0,
|]; % Transport link price list
array[Vims] of int: vim_price_list_1 = [50,51,52,53,54];
array[Vims] of int: vim_price_list_2 = [20,21,22,23,24];
array[Vims] of int: vim_price_list_3 = [70,71,72,73,74];
array[Vims] of int: vim_price_list_4 = [40,41,42,43,44];
% This is the NETWORK BASIC LOAD MODEL (CONSUMED)
% NOTE. This is not applicable in OSM Release 7
% This is the SERVICE CONSUMPTION MODEL
% These are the variables, i.e. which DC to select for each VNF
var Vims: VNF1;
Vims: VNF2 = vimeeeeeeee_38f5_438d_b8ee_3f93b3531f87;
var Vims: VNF3;
Vims: VNF4 = vimcccccccc_ed84_4e49_b5df_a9d117bd731f;
% These are the set of rules for selecting DCs to VNFs
constraint trp_link_latency[VNF1, VNF2] <= 150;
constraint trp_link_latency[VNF2, VNF3] <= 140;
constraint trp_link_latency[VNF3, VNF4] <= 130;
constraint trp_link_jitter[VNF1, VNF2] <= 30;
constraint trp_link_jitter[VNF2, VNF3] <= 30;
constraint trp_link_jitter[VNF3, VNF4] <= 30;
% Calculate the cost for VNFs and cost for transport link and total cost
var int: used_transport_cost =trp_link_price_list[VNF1, VNF2]+
trp_link_price_list[VNF2, VNF3]+
trp_link_price_list[VNF3, VNF4];
var int: used_vim_cost =vim_price_list_1[VNF1]+
vim_price_list_2[VNF2]+
vim_price_list_3[VNF3]+
vim_price_list_4[VNF4];
var int: total_cost = used_transport_cost + used_vim_cost;
solve minimize total_cost;
"""
expected_model_fragment_w_pinning_str = """
%This is the NETWORK RESOURCE MODEL
enum Vims = {
vimaaaaaaaa_38f5_438d_b8ee_3f93b3531f87,
vimbbbbbbbb_38f5_438d_b8ee_3f93b3531f87,
vimcccccccc_ed84_4e49_b5df_a9d117bd731f,
vimdddddddd_ed84_4e49_b5df_a9d117bd731f,
vimeeeeeeee_38f5_438d_b8ee_3f93b3531f87}; % The vim-accounts
array[Vims, Vims] of int: trp_link_latency = [|0,50,100,150,200,
|0,0,100,150,200,
|0,0,0,150,200,
|0,0,0,0,200,
|0,0,0,0,0,
|]; % Transport link latency between data centers
array[Vims, Vims] of int: trp_link_jitter = [|0,5,10,15,20,
|0,0,10,15,20,
|0,0,0,15,20,
|0,0,0,0,20,
|0,0,0,0,0,
|]; % Transport link jitter between data centers
array[Vims, Vims] of int: trp_link_price_list = [|0,5,6,6,7,
|0,0,6,6,7,
|0,0,0,6,7,
|0,0,0,0,7,
|0,0,0,0,0,
|]; % Transport link price list
array[Vims] of int: vim_price_list_one = [50,51,52,53,54];
array[Vims] of int: vim_price_list_two = [20,21,22,23,24];
array[Vims] of int: vim_price_list_three = [70,71,72,73,74];
array[Vims] of int: vim_price_list_four = [40,41,42,43,44];
% This is the NETWORK BASIC LOAD MODEL (CONSUMED)
% NOTE. This is not applicable in OSM Release 7
% This is the SERVICE CONSUMPTION MODEL
% These are the variables, i.e. which DC to select for each VNF
var Vims: VNFone;
Vims: VNFtwo = vimeeeeeeee_38f5_438d_b8ee_3f93b3531f87;
var Vims: VNFthree;
Vims: VNFfour = vimcccccccc_ed84_4e49_b5df_a9d117bd731f;
% These are the set of rules for selecting DCs to VNFs
constraint trp_link_latency[VNFone, VNFtwo] <= 150;
constraint trp_link_latency[VNFtwo, VNFthree] <= 140;
constraint trp_link_latency[VNFthree, VNFfour] <= 130;
constraint trp_link_jitter[VNFone, VNFtwo] <= 30;
constraint trp_link_jitter[VNFtwo, VNFthree] <= 30;
constraint trp_link_jitter[VNFthree, VNFfour] <= 30;
% Calculate the cost for VNFs and cost for transport link and total cost
var int: used_transport_cost =trp_link_price_list[VNFone, VNFtwo]+
trp_link_price_list[VNFtwo, VNFthree]+
trp_link_price_list[VNFthree, VNFfour];
var int: used_vim_cost =vim_price_list_one[VNFone]+
vim_price_list_two[VNFtwo]+
vim_price_list_three[VNFthree]+
vim_price_list_four[VNFfour];
var int: total_cost = used_transport_cost + used_vim_cost;
solve minimize total_cost;
"""
expected_model_fragment_str_no_vld = """
%This is the NETWORK RESOURCE MODEL
enum Vims = {
vimaaaaaaaa_38f5_438d_b8ee_3f93b3531f87,
vimbbbbbbbb_38f5_438d_b8ee_3f93b3531f87,
vimcccccccc_ed84_4e49_b5df_a9d117bd731f,
vimdddddddd_ed84_4e49_b5df_a9d117bd731f,
vimeeeeeeee_38f5_438d_b8ee_3f93b3531f87}; % The vim-accounts
array[Vims, Vims] of int: trp_link_latency = [|0,50,100,150,200,
|0,0,100,150,200,
|0,0,0,150,200,
|0,0,0,0,200,
|0,0,0,0,0,
|]; % Transport link latency between data centers
array[Vims, Vims] of int: trp_link_jitter = [|0,5,10,15,20,
|0,0,10,15,20,
|0,0,0,15,20,
|0,0,0,0,20,
|0,0,0,0,0,
|]; % Transport link jitter between data centers
array[Vims, Vims] of int: trp_link_price_list = [|0,5,6,6,7,
|0,0,6,6,7,
|0,0,0,6,7,
|0,0,0,0,7,
|0,0,0,0,0,
|]; % Transport link price list
array[Vims] of int: vim_price_list_one = [50,51,52,53,54];
% This is the NETWORK BASIC LOAD MODEL (CONSUMED)
% NOTE. This is not applicable in OSM Release 7
% This is the SERVICE CONSUMPTION MODEL
% These are the variables, i.e. which DC to select for each VNF
var Vims: VNFone;
% These are the set of rules for selecting DCs to VNFs
% Calculate the cost for VNFs and cost for transport link and total cost
var int: used_transport_cost =0;
var int: used_vim_cost =vim_price_list_one[VNFone];
var int: total_cost = used_transport_cost + used_vim_cost;
solve minimize total_cost;
"""
class TestMznModelGenerator(TestCase):
def test_create_model(self):
mg = MznModelGenerator(logging.getLogger(__name__))
mzn_model = mg.create_model(test_ns_placement_data_str)
# so asserting exact content is difficult due to the datetime.now(), therefore we ignore the first lines
self.assertTrue(expected_model_fragment_str.replace('\n', '') in
mzn_model.replace('\n', ''), "faulty model generated")
def test_create_model_no_vld_constraints(self):
"""
instantiate w/o constraints in nsd or order params has a valid model
:return:
"""
mg = MznModelGenerator(logging.getLogger(__name__))
mzn_model = mg.create_model(test_ns_placement_data_str_no_vld_constraints)
# so asserting exact content is difficult due to the datetime.now(), therefore we ignore the first lines
self.assertTrue(expected_model_fragment_str_no_vld_constraints.replace('\n', '') in
mzn_model.replace('\n', ''), "faulty model generated")
def test_create_model_w_pinning(self):
mg = MznModelGenerator(logging.getLogger(__name__))
mzn_model = mg.create_model(test_ns_placement_data_w_pinning_str)
# so asserting exact content is difficult due to the datetime.now(), therefore we ignore the first lines
self.assertTrue(expected_model_fragment_w_pinning_str.replace('\n', '') in
mzn_model.replace('\n', ''), "faulty model generated")
def test_create_model_no_vld(self):
mg = MznModelGenerator(logging.getLogger(__name__))
mzn_model = mg.create_model(test_ns_placement_data_str_no_vld)
# so asserting exact content is difficult due to the datetime.now(), therefore we ignore the first lines
self.assertTrue(expected_model_fragment_str_no_vld.replace('\n', '') in
mzn_model.replace('\n', ''), "faulty model generated")
def test__load_jinja_template(self):
"""
add other test to check exception if template not loaded (e.g. invalid template name,
perhaps also valid name but invalid content (in case jinja2 detects such things))
"""
mg = MznModelGenerator(logging.getLogger(__name__))
template = mg._load_jinja_template() # Note we use the default template
self.assertTrue(isinstance(template, Template), "failed to load jinja2 template")
def test_vim_account_replace(self):
mg = MznModelGenerator(logging.getLogger(__name__))
nspd = test_ns_placement_data_str
mzn_model = mg.create_model(nspd)
expected = '%This is the NETWORK RESOURCE MODEL' + '\n' + 'enum Vims = {' + '\n'
for val in test_ns_placement_data_str['vim_accounts']:
expected = expected + val.replace('-', '_') + ',\n'
expected = expected[:-2] + '}; % The vim-accounts'
res = re.findall(expected, mzn_model)
self.assertEqual(1, len(res), "vim accounts didnt replace from - to _")
def test_trp_link_price_list(self):
mg = MznModelGenerator(logging.getLogger(__name__))
mzn_model = mg.create_model(test_ns_placement_data_str)
expected = 'array\\[Vims, Vims\\] of int: trp_link_price_list = \\['
for price_list in test_ns_placement_data_str['trp_link_price_list']:
expected = expected + '\\|' + (str(price_list)[1:-1]).replace(" ", "") + ',\n'
expected = expected + '\\|\\]; % Transport link price list'
res = re.findall(expected, mzn_model)
self.assertEqual(1, len(res), "price list is not correct")
def test_link_latency(self):
mg = MznModelGenerator(logging.getLogger(__name__))
mzn_model = mg.create_model(test_ns_placement_data_str)
expected = 'array\\[Vims, Vims\\] of int: trp_link_latency = \\['
for link_latency in test_ns_placement_data_str['trp_link_latency']:
expected = expected + '\\|' + (str(link_latency)[1:-1]).replace(" ", "") + ',\n'
expected = expected + '\\|\\]; % Transport link latency between data centers'
res = re.findall(expected, mzn_model)
self.assertEqual(1, len(res), "trp_link_latency values is not correct")
def test_link_jitter(self):
mg = MznModelGenerator(logging.getLogger(__name__))
mzn_model = mg.create_model(test_ns_placement_data_str)
expected = 'array\\[Vims, Vims\\] of int: trp_link_jitter = \\['
for link_jitter in test_ns_placement_data_str['trp_link_jitter']:
expected = expected + '\\|' + (str(link_jitter)[1:-1]).replace(" ", "") + ',\n'
expected = expected + '\\|\\]; % Transport link jitter between data centers'
res = re.findall(expected, mzn_model)
self.assertEqual(1, len(res), "trp_link_jitter values is not correct")
def test_price_per_vim(self):
mg = MznModelGenerator(logging.getLogger(__name__))
mzn_model = mg.create_model(test_ns_placement_data_w_pinning_str)
expected = ""
for price_list in test_ns_placement_data_w_pinning_str['ns_desc']:
expected += 'array\\[Vims\\] of int: vim_price_list_' + price_list.get('vnf_id') + " = "
temp = str(price_list.get('vnf_price_per_vim'))[1:-1].replace(" ", "")
expected += "\\[" + temp + "\\];\n"
res = re.findall(expected, mzn_model)
self.assertEqual(1, len(res), "mzn_model contains pinning")
def test_pinning(self):
mg = MznModelGenerator(logging.getLogger(__name__))
mzn_model = mg.create_model(test_ns_placement_data_str)
expected = ""
for pin_list in test_ns_placement_data_str['ns_desc']:
if pin_list.get('vim_account'):
expected += 'Vims: VNF' + pin_list.get('vnf_id') + ' = ' + pin_list.get('vim_account') + ';\n'
else:
expected += 'var Vims: VNF' + pin_list.get('vnf_id') + ';\n'
res = re.findall(expected, mzn_model)
self.assertEqual(1, len(res), "mzn_model has no pinning")
def test__without_pinning(self):
mg = MznModelGenerator(logging.getLogger(__name__))
mzn_model = mg.create_model(test_ns_placement_data_w_pinning_str)
expected = ""
for pin_list in test_ns_placement_data_w_pinning_str['ns_desc']:
if pin_list.get('vim_account'):
expected += 'Vims: VNF' + pin_list.get('vnf_id') + ' = ' + pin_list.get('vim_account') + ';\n'
else:
expected += 'var Vims: VNF' + pin_list.get('vnf_id') + ';\n'
res = re.findall(expected, mzn_model)
self.assertEqual(1, len(res), "mzn_model contains pinning")
def test__without_constraints_for_jitter_and_latency(self):
mg = MznModelGenerator(logging.getLogger(__name__))
mzn_model = mg.create_model(test_ns_placement_data_str_no_vld_constraints)
expected_latency = "constraint trp_link_latency"
expected_jitter = "constraint trp_link_jitter"
latency_or_jitter_was_found = 0
for l_o_j in test_ns_placement_data_str_no_vld_constraints['vld_desc']:
if l_o_j.get('latency') or l_o_j.get('jitter'):
latency_or_jitter_was_found = 1
res_latency = re.findall(expected_latency, mzn_model)
res_jitter = re.findall(expected_jitter, mzn_model)
self.assertEqual(0, latency_or_jitter_was_found, "Jitter or latency was found in the test input")
self.assertEqual(0, len(res_latency), "constraint trp_link_latency was found in mzn_model")
self.assertEqual(0, len(res_jitter), "constraint trp_link_latency was found in mzn_model")
def test__constraints_for_jitter_and_latency(self):
mg = MznModelGenerator(logging.getLogger(__name__))
mzn_model = mg.create_model(test_ns_placement_data_str)
expected_latency = ""
expected_jitter = ""
latency_or_jitter_was_found = 0
for l_o_j in test_ns_placement_data_str['vld_desc']:
if not (l_o_j.get('latency') or l_o_j.get('jitter')):
latency_or_jitter_was_found = 1
expected_latency += "constraint trp_link_latency" + "\\[VNF" + l_o_j.get('cp_refs')[0] + ", VNF" + \
l_o_j.get('cp_refs')[1] + "\\] \\<= " + str(l_o_j.get('latency')) + ";\n\n"
expected_jitter += "constraint trp_link_jitter" + "\\[VNF" + l_o_j.get('cp_refs')[0] + ", VNF" + \
l_o_j.get('cp_refs')[1] + "\\] \\<= " + str(l_o_j.get('jitter')) + ";\n\n"
res = re.findall(expected_latency + expected_jitter, mzn_model)
self.assertEqual(0, latency_or_jitter_was_found, "Jitter or latency was not found in the test input")
self.assertEqual(1, len(res), "faulty model generated")
| 44.200855
| 120
| 0.623965
| 4,650
| 31,029
| 3.913978
| 0.061075
| 0.03956
| 0.035604
| 0.023736
| 0.901429
| 0.892692
| 0.87522
| 0.861374
| 0.844286
| 0.839176
| 0
| 0.122084
| 0.230494
| 31,029
| 701
| 121
| 44.263909
| 0.640156
| 0.04238
| 0
| 0.799296
| 0
| 0.03169
| 0.531844
| 0.138817
| 0.005282
| 0
| 0
| 0
| 0.02993
| 1
| 0.024648
| false
| 0
| 0.010563
| 0
| 0.036972
| 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
|
ed6d9dae2ba6ac28cdc302f7a326f1fae7edb951
| 254
|
py
|
Python
|
ipinfo.py
|
pydanny/geoip2nation3
|
8f516fe11bf150f9e47baa484a83cea76e601266
|
[
"MIT"
] | null | null | null |
ipinfo.py
|
pydanny/geoip2nation3
|
8f516fe11bf150f9e47baa484a83cea76e601266
|
[
"MIT"
] | null | null | null |
ipinfo.py
|
pydanny/geoip2nation3
|
8f516fe11bf150f9e47baa484a83cea76e601266
|
[
"MIT"
] | null | null | null |
class IpInfo(object):
def __init__(self, country_code, country, host_name):
self.country_code = country_code
self.country = country
self.host_name = host_name
def __str__(self):
return "{0}".format(self.__dict__)
| 28.222222
| 57
| 0.65748
| 32
| 254
| 4.65625
| 0.46875
| 0.221477
| 0.201342
| 0.295302
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.005181
| 0.240157
| 254
| 8
| 58
| 31.75
| 0.766839
| 0
| 0
| 0
| 0
| 0
| 0.011811
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.285714
| false
| 0
| 0
| 0.142857
| 0.571429
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 7
|
ed756fe280598d4ecb7481c68243a59bfc92183e
| 3,080
|
py
|
Python
|
study_roadmaps/python_sample_examples/gluon/1_quick_mode/train.py
|
Shreyashwaghe/monk_v1
|
4ee4d9483e8ffac9b73a41f3c378e5abf5fc799b
|
[
"Apache-2.0"
] | 7
|
2020-07-26T08:37:29.000Z
|
2020-10-30T10:23:11.000Z
|
study_roadmaps/python_sample_examples/gluon/1_quick_mode/train.py
|
mursalfk/monk_v1
|
62f34a52f242772186ffff7e56764e958fbcd920
|
[
"Apache-2.0"
] | 9
|
2020-01-28T21:40:39.000Z
|
2022-02-10T01:24:06.000Z
|
study_roadmaps/python_sample_examples/gluon/1_quick_mode/train.py
|
mursalfk/monk_v1
|
62f34a52f242772186ffff7e56764e958fbcd920
|
[
"Apache-2.0"
] | 1
|
2020-10-07T12:57:44.000Z
|
2020-10-07T12:57:44.000Z
|
import os
import sys
sys.path.append("../../../monk/");
import psutil
from gluon_prototype import prototype
################################################## Foldered - Train Dataset #########################################################
gtf = prototype(verbose=1);
gtf.Prototype("sample-project-1", "sample-experiment-1");
gtf.Default(dataset_path="../../../monk/system_check_tests/datasets/dataset_cats_dogs_train",
model_name="resnet18_v1", freeze_base_network=True, num_epochs=2);
gtf.Train();
######################################################################################################################################
############################################ Auxiliary Functions - List all available models #########################################
gtf = prototype(verbose=1);
gtf.Prototype("sample-project-1", "sample-experiment-1");
gtf.List_Models();
######################################################################################################################################
################################################## Foldered - Train and Val Dataset ###################################################
gtf = prototype(verbose=1);
gtf.Prototype("sample-project-1", "sample-experiment-1");
gtf.Default(dataset_path=["../../../monk/system_check_tests/datasets/dataset_cats_dogs_train",
"../../../monk/system_check_tests/datasets/dataset_cats_dogs_eval"],
model_name="resnet18_v1", freeze_base_network=True, num_epochs=2);
gtf.Train();
######################################################################################################################################
################################################## CSV - Train Dataset ##############################################################
gtf = prototype(verbose=1);
gtf.Prototype("sample-project-1", "sample-experiment-1");
gtf.Default(dataset_path="../../../monk/system_check_tests/datasets/dataset_csv_id/train",
path_to_csv="../../../monk/system_check_tests/datasets/dataset_csv_id/train.csv",
model_name="resnet18_v1", freeze_base_network=True, num_epochs=2);
gtf.Train();
######################################################################################################################################
################################################## CSV - Train and Val Dataset ##############################################################
gtf = prototype(verbose=1);
gtf.Prototype("sample-project-1", "sample-experiment-1");
gtf.Default(dataset_path=["../../../monk/system_check_tests/datasets/dataset_csv_id/train",
"../../../monk/system_check_tests/datasets/dataset_csv_id/val"],
path_to_csv=["../../../monk/system_check_tests/datasets/dataset_csv_id/train.csv",
"../../../monk/system_check_tests/datasets/dataset_csv_id/val.csv"],
model_name="resnet18_v1", freeze_base_network=True, num_epochs=2);
gtf.Train();
######################################################################################################################################
| 32.765957
| 141
| 0.438312
| 258
| 3,080
| 4.965116
| 0.189922
| 0.093677
| 0.105386
| 0.140515
| 0.883685
| 0.883685
| 0.883685
| 0.883685
| 0.850117
| 0.782982
| 0
| 0.010805
| 0.068506
| 3,080
| 93
| 142
| 33.11828
| 0.435692
| 0.050974
| 0
| 0.545455
| 0
| 0
| 0.465398
| 0.331027
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.121212
| 0
| 0.121212
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
92dcb5b4d89401398b744802405c3b6cd0c72ad6
| 50,220
|
py
|
Python
|
bnf/rulen.py
|
naver/tamgu
|
9532edc82aa90f7610dbd98dc379e0631de4b252
|
[
"BSD-3-Clause-Clear",
"BSD-3-Clause"
] | 192
|
2019-07-10T15:47:11.000Z
|
2022-03-10T09:26:31.000Z
|
bnf/rulen.py
|
naver/tamgu
|
9532edc82aa90f7610dbd98dc379e0631de4b252
|
[
"BSD-3-Clause-Clear",
"BSD-3-Clause"
] | 5
|
2019-10-01T13:17:28.000Z
|
2021-01-05T15:31:39.000Z
|
bnf/rulen.py
|
naver/tamgu
|
9532edc82aa90f7610dbd98dc379e0631de4b252
|
[
"BSD-3-Clause-Clear",
"BSD-3-Clause"
] | 14
|
2019-09-23T03:39:59.000Z
|
2021-09-02T12:20:14.000Z
|
# -*- coding: utf-8 -*-
import sys
#La grammaire d'analyse du generateur a base de regle
sys.setrecursionlimit(100000)
debugmode=False
stopexecution=False
thelastpos=-1
def m_mot_0_1(fx,lreturn,tree,nb):
if stopexecution:
return False
if debugmode:
print 'mot_0_1',fx.lastchar
label="mot"
lret=[]
exitonfail=False
pos=fx.tell()
if '%NODES' not in tree:
tree['%NODES']=[]
# Or
subtree={}
if x_test_one(fx,lret,'.') or x_test_ord(fx,lret,'A','Z') or x_test_ord(fx,lret,'a','z') or x_test_sup(fx,lret) or x_test_one(fx,lret,'_'):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
lreturn.extend(lret)
return True
def m_mot_0_2_3(fx,lreturn,tree,nb):
if stopexecution:
return False
if debugmode:
print 'mot_0_2_3',fx.lastchar
label="mot"
lret=[]
exitonfail=False
pos=fx.tell()
if '%NODES' not in tree:
tree['%NODES']=[]
# Or
subtree={}
if x_test_one(fx,lret,'.') or x_test_ord(fx,lret,'A','Z') or x_test_ord(fx,lret,'a','z') or x_test_ord(fx,lret,'0','9') or x_test_sup(fx,lret) or x_test_one(fx,lret,'_'):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
lreturn.extend(lret)
return True
def m_mot_0_2(fx,lreturn,tree,nb):
if stopexecution:
return False
if debugmode:
print 'mot_0_2',fx.lastchar
label="mot"
lret=[]
exitonfail=False
pos=fx.tell()
if '%NODES' not in tree:
tree['%NODES']=[]
while not fx.eof():
subtree={}
if m_mot_0_2_3(fx,lret,subtree,nb):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
break
lreturn.extend(lret)
return True
def m_mot_0(fx,lreturn,tree,nb):
if stopexecution:
return False
if debugmode:
print 'mot_0',fx.lastchar
label="mot"
lret=[]
exitonfail=False
pos=fx.tell()
if '%NODES' not in tree:
tree['%NODES']=[]
# Sequence
subtree={}
if m_mot_0_1(fx,lret,subtree,nb):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
# Sequence
subtree={}
if m_mot_0_2(fx,lret,subtree,nb):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
lreturn.extend(lret)
return True
def m_mot(fx,lreturn,tree,nb):
if stopexecution:
return False
if debugmode:
print 'mot',fx.lastchar
label="mot"
lret=[]
exitonfail=False
pos=fx.tell()
tree['%NAME']='mot'
tree['%NODES']=[]
subtree={}
nb+=1
if m_mot_0(fx,lret,subtree,nb):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
tree.pop('%NAME')
fx.seek(pos)
return False
tree['%VALUE']="".join(lret)
tree['%OFFSETS']=[pos,fx.tell()]
lreturn.extend(lret)
return True
def m_string_4(fx,lreturn,tree,nb):
if stopexecution:
return False
if debugmode:
print 'string_4',fx.lastchar
label="string"
lret=[]
exitonfail=False
pos=fx.tell()
if '%NODES' not in tree:
tree['%NODES']=[]
# Sequence
subtree={}
if x_test_one(fx,lret,'$'):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
# Sequence
subtree={}
if m_mot_0_1(fx,lret,subtree,nb):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
# Sequence
subtree={}
if m_mot_0_2(fx,lret,subtree,nb):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
lreturn.extend(lret)
return True
def m_string(fx,lreturn,tree,nb):
if stopexecution:
return False
if debugmode:
print 'string',fx.lastchar
label="string"
lret=[]
exitonfail=False
pos=fx.tell()
tree['%NAME']='string'
tree['%NODES']=[]
subtree={}
nb+=1
if m_string_4(fx,lret,subtree,nb):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
tree.pop('%NAME')
fx.seek(pos)
return False
tree['%VALUE']="".join(lret)
tree['%OFFSETS']=[pos,fx.tell()]
lreturn.extend(lret)
return True
def m_vstring_4(fx,lreturn,tree,nb):
if stopexecution:
return False
if debugmode:
print 'vstring_4',fx.lastchar
label="vstring"
lret=[]
exitonfail=False
pos=fx.tell()
if '%NODES' not in tree:
tree['%NODES']=[]
# Sequence
subtree={}
if x_test_one(fx,lret,':'):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
# Sequence
subtree={}
if m_mot_0_1(fx,lret,subtree,nb):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
# Sequence
subtree={}
if m_mot_0_2(fx,lret,subtree,nb):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
lreturn.extend(lret)
return True
def m_vstring(fx,lreturn,tree,nb):
if stopexecution:
return False
if debugmode:
print 'vstring',fx.lastchar
label="vstring"
lret=[]
exitonfail=False
pos=fx.tell()
tree['%NAME']='vstring'
tree['%NODES']=[]
subtree={}
nb+=1
if m_vstring_4(fx,lret,subtree,nb):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
tree.pop('%NAME')
fx.seek(pos)
return False
tree['%VALUE']="".join(lret)
tree['%OFFSETS']=[pos,fx.tell()]
lreturn.extend(lret)
return True
def m_digits_8(fx,lreturn,tree,nb):
if stopexecution:
return False
if debugmode:
print 'digits_8',fx.lastchar
label="digits"
lret=[]
exitonfail=False
pos=fx.tell()
if '%NODES' not in tree:
tree['%NODES']=[]
# Loop
subtree={}
if x_test_ord(fx,lret,'0','9'):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
while not fx.eof():
subtree={}
if x_test_ord(fx,lret,'0','9'):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
break
lreturn.extend(lret)
return True
def m_digits(fx,lreturn,tree,nb):
if stopexecution:
return False
if debugmode:
print 'digits',fx.lastchar
label="digits"
lret=[]
exitonfail=False
pos=fx.tell()
tree['%NAME']='digits'
tree['%NODES']=[]
subtree={}
nb+=1
if m_digits_8(fx,lret,subtree,nb):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
tree.pop('%NAME')
fx.seek(pos)
return False
tree['%VALUE']="".join(lret)
tree['%OFFSETS']=[pos,fx.tell()]
lreturn.extend(lret)
return True
def m_chiffre_9(fx,lreturn,tree,nb):
if stopexecution:
return False
if debugmode:
print 'chiffre_9',fx.lastchar
label="chiffre"
lret=[]
exitonfail=False
pos=fx.tell()
if '%NODES' not in tree:
tree['%NODES']=[]
# Sequence
subtree={}
if x_test_one(fx,lret,'\\'):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
# Sequence
subtree={}
if m_digits(fx,lret,subtree,nb+1):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
lreturn.extend(lret)
return True
def m_chiffre(fx,lreturn,tree,nb):
if stopexecution:
return False
if debugmode:
print 'chiffre',fx.lastchar
label="chiffre"
lret=[]
exitonfail=False
pos=fx.tell()
tree['%NAME']='chiffre'
tree['%NODES']=[]
subtree={}
nb+=1
if m_chiffre_9(fx,lret,subtree,nb):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
tree.pop('%NAME')
fx.seek(pos)
return False
tree['%VALUE']="".join(lret)
tree['%OFFSETS']=[pos,fx.tell()]
lreturn.extend(lret)
return True
def m_unevariable_10(fx,lreturn,tree,nb):
if stopexecution:
return False
if debugmode:
print 'm_unevariable_10',fx.lastchar
label="unevariable"
lret=[]
exitonfail=False
pos=fx.tell()
if '%NODES' not in tree:
tree['%NODES']=[]
# Sequence
subtree={}
if x_test_one(fx,lret,'@'):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
# Sequence
subtree={}
if x_test_any(fx,lret):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
lreturn.extend(lret)
return True
def m_unevariable(fx,lreturn,tree,nb):
if stopexecution:
return False
if debugmode:
print 'm_unevariable',fx.lastchar
label="unevariable"
lret=[]
exitonfail=False
pos=fx.tell()
tree['%NAME']='unevariable'
tree['%NODES']=[]
subtree={}
nb+=1
if m_unevariable_10(fx,lret,subtree,nb):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
tree.pop('%NAME')
fx.seek(pos)
return False
tree['%VALUE']="".join(lret)
tree['%OFFSETS']=[pos,fx.tell()]
lreturn.extend(lret)
return True
def m_symbole_10(fx,lreturn,tree,nb):
if stopexecution:
return False
if debugmode:
print 'symbole_10',fx.lastchar
label="symbole"
lret=[]
exitonfail=False
pos=fx.tell()
if '%NODES' not in tree:
tree['%NODES']=[]
# Sequence
subtree={}
if x_test_one(fx,lret,'%'):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
# Sequence
subtree={}
if x_test_any(fx,lret):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
lreturn.extend(lret)
return True
def m_symbole(fx,lreturn,tree,nb):
if stopexecution:
return False
if debugmode:
print 'symbole',fx.lastchar
label="symbole"
lret=[]
exitonfail=False
pos=fx.tell()
tree['%NAME']='symbole'
tree['%NODES']=[]
subtree={}
nb+=1
if m_symbole_10(fx,lret,subtree,nb):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
tree.pop('%NAME')
fx.seek(pos)
return False
tree['%VALUE']="".join(lret)
tree['%OFFSETS']=[pos,fx.tell()]
lreturn.extend(lret)
return True
def m_point(fx,lreturn,tree,nb):
if stopexecution:
return False
if debugmode:
print 'point',fx.lastchar
label="point"
lret=[]
exitonfail=False
pos=fx.tell()
tree['%NAME']='point'
tree['%NODES']=[]
subtree={}
nb+=1
if x_test_one(fx,lret,'.'):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
tree.pop('%NAME')
fx.seek(pos)
return False
tree['%VALUE']="".join(lret)
tree['%OFFSETS']=[pos,fx.tell()]
lreturn.extend(lret)
return True
def m_interval_11(fx,lreturn,tree,nb):
if stopexecution:
return False
if debugmode:
print 'interval_11',fx.lastchar
label="interval"
lret=[]
exitonfail=False
pos=fx.tell()
if '%NODES' not in tree:
tree['%NODES']=[]
# Sequence
subtree={}
if m_mot_0_2_3(fx,lret,subtree,nb):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
# Sequence
subtree={}
if x_test_one(fx,lret,'-'):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
# Sequence
subtree={}
if m_mot_0_2_3(fx,lret,subtree,nb):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
lreturn.extend(lret)
return True
def m_interval(fx,lreturn,tree,nb):
if stopexecution:
return False
if debugmode:
print 'interval',fx.lastchar
label="interval"
lret=[]
exitonfail=False
pos=fx.tell()
tree['%NAME']='interval'
tree['%NODES']=[]
subtree={}
nb+=1
if m_interval_11(fx,lret,subtree,nb):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
tree.pop('%NAME')
fx.seek(pos)
return False
tree['%VALUE']="".join(lret)
tree['%OFFSETS']=[pos,fx.tell()]
lreturn.extend(lret)
return True
def m_token_14(fx,lreturn,tree,nb):
if stopexecution:
return False
if debugmode:
print 'token_14',fx.lastchar
label="token"
lret=[]
exitonfail=False
pos=fx.tell()
if '%NODES' not in tree:
tree['%NODES']=[]
# Or
subtree={}
if m_negation(fx,lret,subtree,nb+1) or m_string(fx,lret,subtree,nb+1) or m_vstring(fx,lret,subtree,nb+1) or m_point(fx,lret,subtree,nb+1) or m_interval(fx,lret,subtree,nb+1) or m_mot(fx,lret,subtree,nb+1) or m_chiffre(fx,lret,subtree,nb+1) or m_symbole(fx,lret,subtree,nb+1) or m_unevariable(fx,lret,subtree,nb+1):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
lreturn.extend(lret)
return True
def m_token(fx,lreturn,tree,nb):
if stopexecution:
return False
if debugmode:
print 'token',fx.lastchar
label="token"
lret=[]
exitonfail=False
pos=fx.tell()
tree['%NAME']='token'
tree['%NODES']=[]
subtree={}
nb+=1
if m_token_14(fx,lret,subtree,nb):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
tree.pop('%NAME')
fx.seek(pos)
return False
tree['%VALUE']="".join(lret)
tree['%OFFSETS']=[pos,fx.tell()]
lreturn.extend(lret)
return True
def m_negation_15_16(fx,lreturn,tree,nb):
if stopexecution:
return False
if debugmode:
print 'negation_15_16',fx.lastchar
label="negation"
lret=[]
exitonfail=False
pos=fx.tell()
if '%NODES' not in tree:
tree['%NODES']=[]
# Optional
subtree={}
if m_blanc(fx,lret,subtree,nb+1):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
lret=[]
lreturn.extend(lret)
return True
def m_negation_15_17(fx,lreturn,tree,nb):
if stopexecution:
return False
if debugmode:
print 'negation_15_17',fx.lastchar
label="negation"
lret=[]
exitonfail=False
pos=fx.tell()
if '%NODES' not in tree:
tree['%NODES']=[]
# Or
subtree={}
if m_crochet(fx,lret,subtree,nb+1) or m_optionel(fx,lret,subtree,nb+1) or m_contexte(fx,lret,subtree,nb+1) or m_token(fx,lret,subtree,nb+1):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
lreturn.extend(lret)
return True
def m_negation_15(fx,lreturn,tree,nb):
if stopexecution:
return False
if debugmode:
print 'negation_15',fx.lastchar
label="negation"
lret=[]
exitonfail=False
pos=fx.tell()
if '%NODES' not in tree:
tree['%NODES']=[]
# Sequence
subtree={}
if x_test_one(fx,lret,'~'):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
# Sequence
subtree={}
if m_negation_15_16(fx,lret,subtree,nb):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
# Sequence
subtree={}
if m_negation_15_17(fx,lret,subtree,nb):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
lreturn.extend(lret)
return True
def m_negation(fx,lreturn,tree,nb):
if stopexecution:
return False
if debugmode:
print 'negation',fx.lastchar
label="negation"
lret=[]
exitonfail=False
pos=fx.tell()
tree['%NAME']='negation'
tree['%NODES']=[]
subtree={}
nb+=1
if m_negation_15(fx,lret,subtree,nb):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
tree.pop('%NAME')
fx.seek(pos)
return False
tree['%VALUE']="".join(lret)
tree['%OFFSETS']=[pos,fx.tell()]
lreturn.extend(lret)
return True
def m_kleene_18_19(fx,lreturn,tree,nb):
if stopexecution:
return False
if debugmode:
print 'kleene_18_19',fx.lastchar
label="kleene"
lret=[]
exitonfail=False
pos=fx.tell()
if '%NODES' not in tree:
tree['%NODES']=[]
# Or
subtree={}
if x_test_in(fx,lret,['*','+']):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
lreturn.extend(lret)
return True
def m_kleene_18_20_21(fx,lreturn,tree,nb):
if stopexecution:
return False
if debugmode:
print 'kleene_18_20_21',fx.lastchar
label="kleene"
lret=[]
exitonfail=False
pos=fx.tell()
if '%NODES' not in tree:
tree['%NODES']=[]
# Sequence
subtree={}
if m_blanc(fx,lret,subtree,nb+1):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
# Sequence
subtree={}
if m_elementobligatoire(fx,lret,subtree,nb+1):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
lreturn.extend(lret)
return True
def m_kleene_18_20(fx,lreturn,tree,nb):
if stopexecution:
return False
if debugmode:
print 'kleene_18_20',fx.lastchar
label="kleene"
lret=[]
exitonfail=False
pos=fx.tell()
if '%NODES' not in tree:
tree['%NODES']=[]
# Optional
subtree={}
if m_kleene_18_20_21(fx,lret,subtree,nb):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
lret=[]
lreturn.extend(lret)
return True
def m_kleene_18(fx,lreturn,tree,nb):
if stopexecution:
return False
if debugmode:
print 'kleene_18',fx.lastchar
label="kleene"
lret=[]
exitonfail=False
pos=fx.tell()
if '%NODES' not in tree:
tree['%NODES']=[]
# Sequence
subtree={}
if m_kleene_18_19(fx,lret,subtree,nb):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
# Sequence
subtree={}
if m_kleene_18_20(fx,lret,subtree,nb):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
lreturn.extend(lret)
return True
def m_kleene(fx,lreturn,tree,nb):
if stopexecution:
return False
if debugmode:
print 'kleene',fx.lastchar
label="kleene"
lret=[]
exitonfail=False
pos=fx.tell()
tree['%NAME']='kleene'
tree['%NODES']=[]
subtree={}
nb+=1
if m_kleene_18(fx,lret,subtree,nb):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
tree.pop('%NAME')
fx.seek(pos)
return False
tree['%VALUE']="".join(lret)
tree['%OFFSETS']=[pos,fx.tell()]
lreturn.extend(lret)
return True
def m_unblanc_22(fx,lreturn,tree,nb):
if stopexecution:
return False
if debugmode:
print 'unblanc_22',fx.lastchar
label="unblanc"
lret=[]
exitonfail=False
pos=fx.tell()
if '%NODES' not in tree:
tree['%NODES']=[]
# Loop
subtree={}
if x_test_one(fx,lret,' '):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
while not fx.eof():
subtree={}
if x_test_one(fx,lret,' '):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
break
lreturn.extend(lret)
return True
def m_unblanc(fx,lreturn,tree,nb):
if stopexecution:
return False
if debugmode:
print 'unblanc',fx.lastchar
label="unblanc"
lret=[]
exitonfail=False
pos=fx.tell()
tree['%NAME']='unblanc'
tree['%NODES']=[]
subtree={}
nb+=1
if m_unblanc_22(fx,lret,subtree,nb):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
tree.pop('%NAME')
fx.seek(pos)
return False
tree['%VALUE']="".join(lret)
tree['%OFFSETS']=[pos,fx.tell()]
lreturn.extend(lret)
return True
def m_optionel_23(fx,lreturn,tree,nb):
if stopexecution:
return False
if debugmode:
print 'optionel_23',fx.lastchar
label="optionel"
lret=[]
exitonfail=False
pos=fx.tell()
if '%NODES' not in tree:
tree['%NODES']=[]
# Sequence
subtree={}
if x_test_one(fx,lret,'('):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
# Sequence
subtree={}
if m_liste(fx,lret,subtree,nb+1):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
# Sequence
subtree={}
if x_test_one(fx,lret,')'):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
lreturn.extend(lret)
return True
def m_optionel(fx,lreturn,tree,nb):
if stopexecution:
return False
if debugmode:
print 'optionel',fx.lastchar
label="optionel"
lret=[]
exitonfail=False
pos=fx.tell()
tree['%NAME']='optionel'
tree['%NODES']=[]
subtree={}
nb+=1
if m_optionel_23(fx,lret,subtree,nb):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
tree.pop('%NAME')
fx.seek(pos)
return False
tree['%VALUE']="".join(lret)
tree['%OFFSETS']=[pos,fx.tell()]
lreturn.extend(lret)
return True
def m_crochet_24(fx,lreturn,tree,nb):
if stopexecution:
return False
if debugmode:
print 'crochet_24',fx.lastchar
label="crochet"
lret=[]
exitonfail=False
pos=fx.tell()
if '%NODES' not in tree:
tree['%NODES']=[]
# Sequence
subtree={}
if x_test_one(fx,lret,'['):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
# Sequence
subtree={}
if m_liste(fx,lret,subtree,nb+1):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
# Sequence
subtree={}
if x_test_one(fx,lret,']'):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
lreturn.extend(lret)
return True
def m_crochet(fx,lreturn,tree,nb):
if stopexecution:
return False
if debugmode:
print 'crochet',fx.lastchar
label="crochet"
lret=[]
exitonfail=False
pos=fx.tell()
tree['%NAME']='crochet'
tree['%NODES']=[]
subtree={}
nb+=1
if m_crochet_24(fx,lret,subtree,nb):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
tree.pop('%NAME')
fx.seek(pos)
return False
tree['%VALUE']="".join(lret)
tree['%OFFSETS']=[pos,fx.tell()]
lreturn.extend(lret)
return True
def m_contexte_25(fx,lreturn,tree,nb):
if stopexecution:
return False
if debugmode:
print 'contexte_25',fx.lastchar
label="contexte"
lret=[]
exitonfail=False
pos=fx.tell()
if '%NODES' not in tree:
tree['%NODES']=[]
# Sequence
subtree={}
if x_test_one(fx,lret,'{'):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
# Sequence
subtree={}
if m_liste(fx,lret,subtree,nb+1):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
# Sequence
subtree={}
if x_test_one(fx,lret,'}'):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
lreturn.extend(lret)
return True
def m_contexte(fx,lreturn,tree,nb):
if stopexecution:
return False
if debugmode:
print 'contexte',fx.lastchar
label="contexte"
lret=[]
exitonfail=False
pos=fx.tell()
tree['%NAME']='contexte'
tree['%NODES']=[]
subtree={}
nb+=1
if m_contexte_25(fx,lret,subtree,nb):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
tree.pop('%NAME')
fx.seek(pos)
return False
tree['%VALUE']="".join(lret)
tree['%OFFSETS']=[pos,fx.tell()]
lreturn.extend(lret)
return True
def m_elementobligatoire_26(fx,lreturn,tree,nb):
if stopexecution:
return False
if debugmode:
print 'elementobligatoire_26',fx.lastchar
label="elementobligatoire"
lret=[]
exitonfail=False
pos=fx.tell()
if '%NODES' not in tree:
tree['%NODES']=[]
# Or
subtree={}
if m_crochet(fx,lret,subtree,nb+1) or m_token(fx,lret,subtree,nb+1):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
lreturn.extend(lret)
return True
def m_elementobligatoire(fx,lreturn,tree,nb):
if stopexecution:
return False
if debugmode:
print 'elementobligatoire',fx.lastchar
label="elementobligatoire"
lret=[]
exitonfail=False
pos=fx.tell()
tree['%NAME']='elementobligatoire'
tree['%NODES']=[]
subtree={}
nb+=1
if m_elementobligatoire_26(fx,lret,subtree,nb):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
tree.pop('%NAME')
fx.seek(pos)
return False
tree['%VALUE']="".join(lret)
tree['%OFFSETS']=[pos,fx.tell()]
lreturn.extend(lret)
return True
def m_elementbase(fx,lreturn,tree,nb):
if stopexecution:
return False
if debugmode:
print 'elementbase',fx.lastchar
label="elementbase"
lret=[]
exitonfail=False
pos=fx.tell()
tree['%NAME']='elementbase'
tree['%NODES']=[]
subtree={}
nb+=1
if m_negation_15_17(fx,lret,subtree,nb):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
tree.pop('%NAME')
fx.seek(pos)
return False
tree['%VALUE']="".join(lret)
tree['%OFFSETS']=[pos,fx.tell()]
lreturn.extend(lret)
return True
def m_element_28_29(fx,lreturn,tree,nb):
if stopexecution:
return False
if debugmode:
print 'element_28_29',fx.lastchar
label="element"
lret=[]
exitonfail=False
pos=fx.tell()
if '%NODES' not in tree:
tree['%NODES']=[]
# Optional
subtree={}
if m_kleene(fx,lret,subtree,nb+1):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
lret=[]
lreturn.extend(lret)
return True
def m_element_28(fx,lreturn,tree,nb):
if stopexecution:
return False
if debugmode:
print 'element_28',fx.lastchar
label="element"
lret=[]
exitonfail=False
pos=fx.tell()
if '%NODES' not in tree:
tree['%NODES']=[]
# Sequence
subtree={}
if m_elementbase(fx,lret,subtree,nb+1):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
# Sequence
subtree={}
if m_element_28_29(fx,lret,subtree,nb):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
lreturn.extend(lret)
return True
def m_element(fx,lreturn,tree,nb):
if stopexecution:
return False
if debugmode:
print 'element',fx.lastchar
label="element"
lret=[]
exitonfail=False
pos=fx.tell()
tree['%NAME']='element'
tree['%NODES']=[]
subtree={}
nb+=1
if m_element_28(fx,lret,subtree,nb):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
tree.pop('%NAME')
fx.seek(pos)
return False
tree['%VALUE']="".join(lret)
tree['%OFFSETS']=[pos,fx.tell()]
lreturn.extend(lret)
return True
def m_coupe_30(fx,lreturn,tree,nb):
if stopexecution:
return False
if debugmode:
print 'coupe_30',fx.lastchar
label="coupe"
lret=[]
exitonfail=False
pos=fx.tell()
if '%NODES' not in tree:
tree['%NODES']=[]
# Sequence
subtree={}
if x_test_one(fx,lret,';'):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
# Sequence
subtree={}
if m_digits(fx,lret,subtree,nb+1):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
lreturn.extend(lret)
return True
def m_coupe(fx,lreturn,tree,nb):
if stopexecution:
return False
if debugmode:
print 'coupe',fx.lastchar
label="coupe"
lret=[]
exitonfail=False
pos=fx.tell()
tree['%NAME']='coupe'
tree['%NODES']=[]
subtree={}
nb+=1
if m_coupe_30(fx,lret,subtree,nb):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
tree.pop('%NAME')
fx.seek(pos)
return False
tree['%VALUE']="".join(lret)
tree['%OFFSETS']=[pos,fx.tell()]
lreturn.extend(lret)
return True
def m_blanc_31_32(fx,lreturn,tree,nb):
if stopexecution:
return False
if debugmode:
print 'blanc_31_32',fx.lastchar
label="blanc"
lret=[]
exitonfail=False
pos=fx.tell()
if '%NODES' not in tree:
tree['%NODES']=[]
# Or
subtree={}
if x_test_one(fx,lret,' ') or m_coupe(fx,lret,subtree,nb+1):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
lreturn.extend(lret)
return True
def m_blanc_31(fx,lreturn,tree,nb):
if stopexecution:
return False
if debugmode:
print 'blanc_31',fx.lastchar
label="blanc"
lret=[]
exitonfail=False
pos=fx.tell()
if '%NODES' not in tree:
tree['%NODES']=[]
# Loop
subtree={}
if m_blanc_31_32(fx,lret,subtree,nb):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
while not fx.eof():
subtree={}
if m_blanc_31_32(fx,lret,subtree,nb):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
break
lreturn.extend(lret)
return True
def m_blanc(fx,lreturn,tree,nb):
if stopexecution:
return False
if debugmode:
print 'blanc',fx.lastchar
label="blanc"
lret=[]
exitonfail=False
pos=fx.tell()
tree['%NAME']='blanc'
tree['%NODES']=[]
subtree={}
nb+=1
if m_blanc_31(fx,lret,subtree,nb):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
tree.pop('%NAME')
fx.seek(pos)
return False
tree['%VALUE']="".join(lret)
tree['%OFFSETS']=[pos,fx.tell()]
lreturn.extend(lret)
return True
def m_exclusif_33(fx,lreturn,tree,nb):
if stopexecution:
return False
if debugmode:
print 'exclusif_33',fx.lastchar
label="exclusif"
lret=[]
exitonfail=False
pos=fx.tell()
if '%NODES' not in tree:
tree['%NODES']=[]
# Sequence
subtree={}
if x_test_one(fx,lret,'^'):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
# Sequence
subtree={}
if m_negation_15_16(fx,lret,subtree,nb):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
# Sequence
subtree={}
if m_liste(fx,lret,subtree,nb+1):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
lreturn.extend(lret)
return True
def m_exclusif(fx,lreturn,tree,nb):
if stopexecution:
return False
if debugmode:
print 'exclusif',fx.lastchar
label="exclusif"
lret=[]
exitonfail=False
pos=fx.tell()
tree['%NAME']='exclusif'
tree['%NODES']=[]
subtree={}
nb+=1
if m_exclusif_33(fx,lret,subtree,nb):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
tree.pop('%NAME')
fx.seek(pos)
return False
tree['%VALUE']="".join(lret)
tree['%OFFSETS']=[pos,fx.tell()]
lreturn.extend(lret)
return True
def m_union_35(fx,lreturn,tree,nb):
if stopexecution:
return False
if debugmode:
print 'union_35',fx.lastchar
label="union"
lret=[]
exitonfail=False
pos=fx.tell()
if '%NODES' not in tree:
tree['%NODES']=[]
# Sequence
subtree={}
if x_test_one(fx,lret,'|'):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
# Sequence
subtree={}
if m_negation_15_16(fx,lret,subtree,nb):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
# Sequence
subtree={}
if m_liste(fx,lret,subtree,nb+1):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
lreturn.extend(lret)
return True
def m_union(fx,lreturn,tree,nb):
if stopexecution:
return False
if debugmode:
print 'union',fx.lastchar
label="union"
lret=[]
exitonfail=False
pos=fx.tell()
tree['%NAME']='union'
tree['%NODES']=[]
subtree={}
nb+=1
if m_union_35(fx,lret,subtree,nb):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
tree.pop('%NAME')
fx.seek(pos)
return False
tree['%VALUE']="".join(lret)
tree['%OFFSETS']=[pos,fx.tell()]
lreturn.extend(lret)
return True
def m_coupechoix_37(fx,lreturn,tree,nb):
if stopexecution:
return False
if debugmode:
print 'coupechoix_37',fx.lastchar
label="coupechoix"
lret=[]
exitonfail=False
pos=fx.tell()
if '%NODES' not in tree:
tree['%NODES']=[]
# Sequence
subtree={}
if m_coupe(fx,lret,subtree,nb+1):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
# Sequence
subtree={}
if m_negation_15_16(fx,lret,subtree,nb):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
# Sequence
subtree={}
if m_liste(fx,lret,subtree,nb+1):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
lreturn.extend(lret)
return True
def m_coupechoix(fx,lreturn,tree,nb):
if stopexecution:
return False
if debugmode:
print 'coupechoix',fx.lastchar
label="coupechoix"
lret=[]
exitonfail=False
pos=fx.tell()
tree['%NAME']='coupechoix'
tree['%NODES']=[]
subtree={}
nb+=1
if m_coupechoix_37(fx,lret,subtree,nb):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
tree.pop('%NAME')
fx.seek(pos)
return False
tree['%VALUE']="".join(lret)
tree['%OFFSETS']=[pos,fx.tell()]
lreturn.extend(lret)
return True
def m_sequence_39(fx,lreturn,tree,nb):
if stopexecution:
return False
if debugmode:
print 'sequence_39',fx.lastchar
label="sequence"
lret=[]
exitonfail=False
pos=fx.tell()
if '%NODES' not in tree:
tree['%NODES']=[]
# Sequence
subtree={}
if m_blanc(fx,lret,subtree,nb+1):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
# Sequence
subtree={}
if m_liste(fx,lret,subtree,nb+1):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
lreturn.extend(lret)
return True
def m_sequence(fx,lreturn,tree,nb):
if stopexecution:
return False
if debugmode:
print 'sequence',fx.lastchar
label="sequence"
lret=[]
exitonfail=False
pos=fx.tell()
tree['%NAME']='sequence'
tree['%NODES']=[]
subtree={}
nb+=1
if m_sequence_39(fx,lret,subtree,nb):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
tree.pop('%NAME')
fx.seek(pos)
return False
tree['%VALUE']="".join(lret)
tree['%OFFSETS']=[pos,fx.tell()]
lreturn.extend(lret)
return True
def m_suivant_40(fx,lreturn,tree,nb):
if stopexecution:
return False
if debugmode:
print 'suivant_40',fx.lastchar
label="suivant"
lret=[]
exitonfail=False
pos=fx.tell()
if '%NODES' not in tree:
tree['%NODES']=[]
# Or
subtree={}
if m_exclusif(fx,lret,subtree,nb+1) or m_union(fx,lret,subtree,nb+1) or m_sequence(fx,lret,subtree,nb+1):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
lreturn.extend(lret)
return True
def m_suivant(fx,lreturn,tree,nb):
if stopexecution:
return False
if debugmode:
print 'suivant',fx.lastchar
label="suivant"
lret=[]
exitonfail=False
pos=fx.tell()
tree['%NAME']='suivant'
tree['%NODES']=[]
subtree={}
nb+=1
if m_suivant_40(fx,lret,subtree,nb):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
tree.pop('%NAME')
fx.seek(pos)
return False
tree['%VALUE']="".join(lret)
tree['%OFFSETS']=[pos,fx.tell()]
lreturn.extend(lret)
return True
def m_liste_41_42(fx,lreturn,tree,nb):
if stopexecution:
return False
if debugmode:
print 'liste_41_42',fx.lastchar
label="liste"
lret=[]
exitonfail=False
pos=fx.tell()
if '%NODES' not in tree:
tree['%NODES']=[]
# Optional
subtree={}
if m_suivant(fx,lret,subtree,nb+1):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
lret=[]
lreturn.extend(lret)
return True
def m_liste_41(fx,lreturn,tree,nb):
if stopexecution:
return False
if debugmode:
print 'liste_41',fx.lastchar
label="liste"
lret=[]
exitonfail=False
pos=fx.tell()
if '%NODES' not in tree:
tree['%NODES']=[]
# Sequence
subtree={}
if m_element(fx,lret,subtree,nb+1):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
# Sequence
subtree={}
if m_liste_41_42(fx,lret,subtree,nb):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
lreturn.extend(lret)
return True
def m_liste(fx,lreturn,tree,nb):
if stopexecution:
return False
if debugmode:
print 'liste',fx.lastchar
label="liste"
lret=[]
exitonfail=False
pos=fx.tell()
tree['%NAME']='liste'
tree['%NODES']=[]
subtree={}
nb+=1
if m_liste_41(fx,lret,subtree,nb):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
tree.pop('%NAME')
fx.seek(pos)
return False
tree['%VALUE']="".join(lret)
tree['%OFFSETS']=[pos,fx.tell()]
lreturn.extend(lret)
return True
def m_regle_43(fx,lreturn,tree,nb):
if stopexecution:
return False
if debugmode:
print 'regle_43',fx.lastchar
label="regle"
lret=[]
exitonfail=False
pos=fx.tell()
if '%NODES' not in tree:
tree['%NODES']=[]
# Sequence
subtree={}
if m_mot(fx,lret,subtree,nb+1):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
# Sequence
subtree={}
if m_negation_15_16(fx,lret,subtree,nb):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
# Sequence
subtree={}
if x_test_one(fx,lret,':'):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
# Sequence
subtree={}
if x_test_one(fx,lret,'='):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
# Sequence
subtree={}
if m_negation_15_16(fx,lret,subtree,nb):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
# Sequence
subtree={}
if m_liste(fx,lret,subtree,nb+1):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
fx.seek(pos)
x_setfail(fx,label,pos,exitonfail)
return False
lreturn.extend(lret)
return True
def m_regle(fx,lreturn,tree,nb):
if stopexecution:
return False
if debugmode:
print 'regle',fx.lastchar
label="regle"
lret=[]
exitonfail=False
pos=fx.tell()
tree['%NAME']='regle'
tree['%NODES']=[]
subtree={}
nb+=1
if m_regle_43(fx,lret,subtree,nb):
if x_test_tree(subtree):
tree['%NODES'].append(subtree)
else:
tree.pop('%NODES')
tree.pop('%NAME')
fx.seek(pos)
return False
tree['%VALUE']="".join(lret)
tree['%OFFSETS']=[pos,fx.tell()]
lreturn.extend(lret)
return True
def x_comparelen(xl,yl):
x=xl[0]
y=yl[0]
if x>y:
return -1
if x==y:
return 0
return 1
def x_test_string(fx,lret,sz,sub):
pos=fx.tell()
[lst,lstu]=fx.read(sz)
if len(lst)<sz:
fx.seek(pos)
return False
if lst==sub or lstu==sub:
lret.append(lst)
return True
fx.seek(pos)
return False
def x_test_in(fx,lret,sub):
pos=fx.tell()
[lst,lstu]=fx.read(1)
if lst=="":
fx.seek(pos)
return False
if lst in sub or lstu in sub:
lret.append(lst)
return True
fx.seek(pos)
return False
def x_test_one(fx,lret,onechar):
pos=fx.tell()
[lst,lstu]=fx.read(1)
if lst=="":
fx.seek(pos)
return False
if lst==onechar or lstu==onechar:
lret.append(lst)
return True
fx.seek(pos)
return False
def x_setfail(fx,label,pos,test):
if test:
stopexecution=True
fx.lastposerror=pos
fx.lastlabel=label
def x_test_ord(fx,lret,b,g):
pos=fx.tell()
[lst,lstu]=fx.read(1)
if lst=="":
fx.seek(pos)
return False
if ord(lst[0])>=ord(b) and ord(lst[0])<=ord(g):
lret.append(lst)
return True
fx.seek(pos)
return False
def x_test_sup(fx,lret):
pos=fx.tell()
[lst,lstu]=fx.read(1)
if lst=="":
fx.seek(pos)
return False
#print "x_test_ord",lst[0]
if ord(lst[0])>=128:
lret.append(lst)
return True
fx.seek(pos)
return False
def x_test_any(fx,lret):
pos=fx.tell()
[lst,lstu]=fx.read(1)
if lst=="":
fx.seek(pos)
return False
lret.append(lst)
return True
def x_test_tree(sub):
if sub=={}:
return False
if "%NODES" in sub and sub["%NODES"]==[]:
if "%NAME" not in sub:
return False
else:
sub.pop("%NODES")
return True
def x_displayanalysis(tree,nb):
space="".zfill(nb).replace("0"," ")
if "%NAME" in tree:
name=tree["%NAME"]
value=""
off=[]
if "%VALUE" in tree:
value=tree["%VALUE"]
off=tree["%OFFSETS"]
print space,name,off,'"'+value+'"'
if "%NODES" in tree:
lst=tree["%NODES"]
for l in lst:
x_displayanalysis(l,nb+1)
def x_maxoffset(tree,nb):
if "%NAME" in tree:
if "%OFFSETS" in tree:
off=tree["%OFFSETS"]
if off[1]>nb[0]:
nb[0]=off[1]
if "%NODES" in tree:
lst=tree["%NODES"]
for l in lst:
x_maxoffset(l,nb)
class readstring:
def __init__(self,s):
self.parcours=s
self.pos=0
self.length=len(s)
self.lastchar=""
self.lastposerror=0
self.lastlabel=""
def seek(self,p):
self.pos=p
def tell(self):
return self.pos
def peek(self):
return s[self.pos]
def eof(self):
if self.pos>=self.length:
return True
return False
def read(self,sz):
borne=self.pos+sz
if borne>=self.length:
borne=self.length
if self.eof():
return ["",""]
s=self.parcours[self.pos:borne]
self.lastchar=s
self.pos=borne
try:
sutf8=unicode(s).encode("utf8")
return [s,sutf8]
except:
return [s,s]
class readfile:
def __init__(self,s):
self.name=s
self.fichier=open(s,"rb")
#Jump to the end of the file
self.fichier.seek(0,2)
self.size=self.fichier.tell()
#Return to the beginning of the file
self.fichier.seek(0,0)
self.pos=0
self.lastchar=""
self.lastposerror=0
self.lastlabel=""
def seek(self,p):
self.pos=p
self.fichier.seek(p)
def tell(self):
return self.pos
def peek(self):
p=self.tell()
c=self.fichier.read(1)
self.seek(p)
return c
def eof(self):
if self.pos>=self.size:
return True
return False
def read(self,sz):
borne=self.pos+sz
if self.eof():
return ["",""]
s=self.fichier.read(sz)
self.lastchar=s
self.pos=borne
try:
sutf8=unicode(s).encode("utf8")
return [s,sutf8]
except:
return [s,s]
def close(self):
self.fichier.close()
def x_parse_string(x,f,full=True):
stopexecution=False
fx=readstring(x)
fx.lastposerror=0
lret=[]
tree={}
res=f(fx,lret,tree,0)
if not fx.eof() and full:
if fx.lastposerror==0:
maxoff=[0]
x_maxoffset(tree,maxoff)
fx.seek(maxoff[0])
print "Error:"
print fx.read(300)[0]
else:
print x[:fx.lastposerror],"Error on:",fx.lastlabel
return False
if res==True:
x_displayanalysis(tree,0)
return True
return False
def x_parse_file(x,f,full=True):
stopexecution=False
fx=readfile(x)
fx.lastposerror=0
lret=[]
tree={}
res=f(fx,lret,tree,0)
fx.close()
if not fx.eof() and full:
if fx.lastposerror==0:
maxoff=[0]
x_maxoffset(tree,maxoff)
fx.seek(maxoff[0])
print "Error:"
print fx.read(300)[0]
else:
fx.seek(fx.lastposerror)
fx.read(100)[0],"Error on:",fx.lastlabel
return False
if res==True:
x_displayanalysis(tree,0)
return True
return False
def applyrule(r):
tree={}
lreturn=[]
s=readstring(r)
r=m_regle(s,lreturn,tree,0)
print tree
return r
| 21.6
| 317
| 0.609299
| 7,040
| 50,220
| 4.243608
| 0.027131
| 0.065908
| 0.030929
| 0.037925
| 0.935163
| 0.929941
| 0.92713
| 0.895063
| 0.873941
| 0.869289
| 0
| 0.011676
| 0.232577
| 50,220
| 2,324
| 318
| 21.609294
| 0.763492
| 0.014715
| 0
| 0.850869
| 1
| 0
| 0.082885
| 0.000446
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0.000483
| null | null | 0.034749
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 9
|
131f3a48755a5cfff40f29b1e0704d23509ac58f
| 2,609
|
py
|
Python
|
pipeliner/steps/send_email.py
|
lubosmato/web-hooker
|
e95751185ab0292cd6a345baa14f2ff6055c9fa8
|
[
"MIT"
] | 4
|
2019-12-25T19:32:30.000Z
|
2020-10-16T14:56:57.000Z
|
pipeliner/steps/send_email.py
|
lubosmato/web-hooker
|
e95751185ab0292cd6a345baa14f2ff6055c9fa8
|
[
"MIT"
] | 6
|
2020-01-13T21:28:03.000Z
|
2020-02-17T18:48:37.000Z
|
pipeliner/steps/send_email.py
|
lubosmato/web-hooker
|
e95751185ab0292cd6a345baa14f2ff6055c9fa8
|
[
"MIT"
] | 1
|
2019-12-24T15:36:01.000Z
|
2019-12-24T15:36:01.000Z
|
import logging
import smtplib
import ssl
from email.header import Header
from email.mime.text import MIMEText
from typing import List
from pipeliner.steps.step import Step
logger = logging.getLogger(__name__)
class SendEmailTls(Step):
def __init__(self,
smtp_host: str,
smtp_port: int,
login: str,
password: str,
from_email: str,
to_emails: List[str],
subject: str):
super().__init__()
self._smtp_host = smtp_host
self._smtp_port = smtp_port
self._login = login
self._password = password
self._from_email = from_email
self._to_emails = to_emails
self._subject = subject
def perform(self, data: str) -> str:
context = ssl.SSLContext(ssl.PROTOCOL_TLS)
with smtplib.SMTP(self._smtp_host, self._smtp_port) as server:
server.ehlo()
server.starttls(context=context)
server.ehlo()
server.login(self._login, self._password)
message = MIMEText(data, "html", "utf-8")
message["Subject"] = Header(self._subject, "utf-8")
message["From"] = self._from_email
message["To"] = ",".join(self._to_emails)
server.sendmail(self._from_email, self._to_emails, message.as_string().encode("ascii"))
logger.info("Email was sent successfully")
return data
class SendEmailSsl(Step):
def __init__(self,
smtp_host: str,
smtp_port: int,
login: str,
password: str,
from_email: str,
to_emails: List[str],
subject: str):
super().__init__()
self._smtp_host = smtp_host
self._smtp_port = smtp_port
self._login = login
self._password = password
self._from_email = from_email
self._to_emails = to_emails
self._subject = subject
def perform(self, data: str) -> str:
with smtplib.SMTP_SSL(self._smtp_host, self._smtp_port) as server:
server.ehlo()
server.login(self._login, self._password)
message = MIMEText(data, "html", "utf-8")
message["Subject"] = Header(self._subject, "utf-8")
message["From"] = self._from_email
message["To"] = ",".join(self._to_emails)
server.sendmail(self._from_email, self._to_emails, message.as_string().encode("ascii"))
logger.info("Email was sent successfully")
return data
| 31.817073
| 99
| 0.578766
| 296
| 2,609
| 4.790541
| 0.202703
| 0.076164
| 0.050776
| 0.045134
| 0.792666
| 0.792666
| 0.792666
| 0.792666
| 0.792666
| 0.792666
| 0
| 0.002248
| 0.31813
| 2,609
| 81
| 100
| 32.209877
| 0.794829
| 0
| 0
| 0.791045
| 0
| 0
| 0.045995
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.059701
| false
| 0.089552
| 0.104478
| 0
| 0.223881
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 7
|
13206f64222d91514da90a2f94554ba28e5cfcb4
| 355,545
|
py
|
Python
|
nfselib/paulistana/v02/RetornoInformacoesLote.py
|
erpbrasil/nfselib.paulistana
|
520f2f7a1431589bf7faa4ee6e929ffa73ef6ad7
|
[
"MIT"
] | 1
|
2021-02-04T18:16:26.000Z
|
2021-02-04T18:16:26.000Z
|
nfselib/paulistana/v02/RetornoInformacoesLote.py
|
erpbrasil/nfselib.paulistana
|
520f2f7a1431589bf7faa4ee6e929ffa73ef6ad7
|
[
"MIT"
] | 2
|
2020-11-19T23:00:49.000Z
|
2022-01-19T13:41:26.000Z
|
nfselib/paulistana/v02/RetornoInformacoesLote.py
|
erpbrasil/nfselib.paulistana
|
520f2f7a1431589bf7faa4ee6e929ffa73ef6ad7
|
[
"MIT"
] | null | null | null |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated by generateDS.py version 2.36.6.
# Python 3.6.9 (default, Apr 18 2020, 01:56:04) [GCC 8.4.0]
#
# Command line options:
# ('--no-namespace-defs', '')
# ('--no-dates', '')
# ('--member-specs', 'list')
# ('--use-getter-setter', 'none')
# ('-f', '')
# ('-o', '/home/luisotavio/Documentos/Projects/produto_12/src/nfselib.paulistana/paulistanalib/v02/RetornoInformacoesLote.py')
#
# Command line arguments:
# /tmp/generated/schemas/paulistana/v02/RetornoInformacoesLote_v01.xsd
#
# Command line:
# /home/luisotavio/Documentos/erpbrasil/bin/generateDS.py --no-namespace-defs --no-dates --member-specs="list" --use-getter-setter="none" -f -o "/home/luisotavio/Documentos/Projects/produto_12/src/nfselib.paulistana/paulistanalib/v02/RetornoInformacoesLote.py" /tmp/generated/schemas/paulistana/v02/RetornoInformacoesLote_v01.xsd
#
# Current working directory (os.getcwd()):
# v02
#
from six.moves import zip_longest
import os
import sys
import re as re_
import base64
import datetime as datetime_
import decimal as decimal_
try:
from lxml import etree as etree_
except ImportError:
from xml.etree import ElementTree as etree_
Validate_simpletypes_ = True
SaveElementTreeNode = True
if sys.version_info.major == 2:
BaseStrType_ = basestring
else:
BaseStrType_ = str
def parsexml_(infile, parser=None, **kwargs):
if parser is None:
# Use the lxml ElementTree compatible parser so that, e.g.,
# we ignore comments.
try:
parser = etree_.ETCompatXMLParser()
except AttributeError:
# fallback to xml.etree
parser = etree_.XMLParser()
try:
if isinstance(infile, os.PathLike):
infile = os.path.join(infile)
except AttributeError:
pass
doc = etree_.parse(infile, parser=parser, **kwargs)
return doc
def parsexmlstring_(instring, parser=None, **kwargs):
if parser is None:
# Use the lxml ElementTree compatible parser so that, e.g.,
# we ignore comments.
try:
parser = etree_.ETCompatXMLParser()
except AttributeError:
# fallback to xml.etree
parser = etree_.XMLParser()
element = etree_.fromstring(instring, parser=parser, **kwargs)
return element
#
# Namespace prefix definition table (and other attributes, too)
#
# The module generatedsnamespaces, if it is importable, must contain
# a dictionary named GeneratedsNamespaceDefs. This Python dictionary
# should map element type names (strings) to XML schema namespace prefix
# definitions. The export method for any class for which there is
# a namespace prefix definition, will export that definition in the
# XML representation of that element. See the export method of
# any generated element type class for an example of the use of this
# table.
# A sample table is:
#
# # File: generatedsnamespaces.py
#
# GenerateDSNamespaceDefs = {
# "ElementtypeA": "http://www.xxx.com/namespaceA",
# "ElementtypeB": "http://www.xxx.com/namespaceB",
# }
#
# Additionally, the generatedsnamespaces module can contain a python
# dictionary named GenerateDSNamespaceTypePrefixes that associates element
# types with the namespace prefixes that are to be added to the
# "xsi:type" attribute value. See the exportAttributes method of
# any generated element type and the generation of "xsi:type" for an
# example of the use of this table.
# An example table:
#
# # File: generatedsnamespaces.py
#
# GenerateDSNamespaceTypePrefixes = {
# "ElementtypeC": "aaa:",
# "ElementtypeD": "bbb:",
# }
#
try:
from .generatedsnamespaces import GenerateDSNamespaceDefs as GenerateDSNamespaceDefs_
except ImportError:
GenerateDSNamespaceDefs_ = {}
try:
from .generatedsnamespaces import GenerateDSNamespaceTypePrefixes as GenerateDSNamespaceTypePrefixes_
except ImportError:
GenerateDSNamespaceTypePrefixes_ = {}
#
# You can replace the following class definition by defining an
# importable module named "generatedscollector" containing a class
# named "GdsCollector". See the default class definition below for
# clues about the possible content of that class.
#
try:
from generatedscollector import GdsCollector as GdsCollector_
except ImportError:
class GdsCollector_(object):
def __init__(self, messages=None):
if messages is None:
self.messages = []
else:
self.messages = messages
def add_message(self, msg):
self.messages.append(msg)
def get_messages(self):
return self.messages
def clear_messages(self):
self.messages = []
def print_messages(self):
for msg in self.messages:
print("Warning: {}".format(msg))
def write_messages(self, outstream):
for msg in self.messages:
outstream.write("Warning: {}\n".format(msg))
#
# The super-class for enum types
#
try:
from enum import Enum
except ImportError:
Enum = object
#
# The root super-class for element type classes
#
# Calls to the methods in these classes are generated by generateDS.py.
# You can replace these methods by re-implementing the following class
# in a module named generatedssuper.py.
try:
from generatedssuper import GeneratedsSuper
except ImportError as exp:
class GeneratedsSuper(object):
__hash__ = object.__hash__
tzoff_pattern = re_.compile(r'(\+|-)((0\d|1[0-3]):[0-5]\d|14:00)$')
class _FixedOffsetTZ(datetime_.tzinfo):
def __init__(self, offset, name):
self.__offset = datetime_.timedelta(minutes=offset)
self.__name = name
def utcoffset(self, dt):
return self.__offset
def tzname(self, dt):
return self.__name
def dst(self, dt):
return None
def gds_format_string(self, input_data, input_name=''):
return input_data
def gds_parse_string(self, input_data, node=None, input_name=''):
return input_data
def gds_validate_string(self, input_data, node=None, input_name=''):
if not input_data:
return ''
else:
return input_data
def gds_format_base64(self, input_data, input_name=''):
return base64.b64encode(input_data)
def gds_validate_base64(self, input_data, node=None, input_name=''):
return input_data
def gds_format_integer(self, input_data, input_name=''):
return '%d' % input_data
def gds_parse_integer(self, input_data, node=None, input_name=''):
try:
ival = int(input_data)
except (TypeError, ValueError) as exp:
raise_parse_error(node, 'Requires integer value: %s' % exp)
return ival
def gds_validate_integer(self, input_data, node=None, input_name=''):
try:
value = int(input_data)
except (TypeError, ValueError):
raise_parse_error(node, 'Requires integer value')
return value
def gds_format_integer_list(self, input_data, input_name=''):
return '%s' % ' '.join(input_data)
def gds_validate_integer_list(
self, input_data, node=None, input_name=''):
values = input_data.split()
for value in values:
try:
int(value)
except (TypeError, ValueError):
raise_parse_error(node, 'Requires sequence of integer valuess')
return values
def gds_format_float(self, input_data, input_name=''):
return ('%.15f' % input_data).rstrip('0')
def gds_parse_float(self, input_data, node=None, input_name=''):
try:
fval_ = float(input_data)
except (TypeError, ValueError) as exp:
raise_parse_error(node, 'Requires float or double value: %s' % exp)
return fval_
def gds_validate_float(self, input_data, node=None, input_name=''):
try:
value = float(input_data)
except (TypeError, ValueError):
raise_parse_error(node, 'Requires float value')
return value
def gds_format_float_list(self, input_data, input_name=''):
return '%s' % ' '.join(input_data)
def gds_validate_float_list(
self, input_data, node=None, input_name=''):
values = input_data.split()
for value in values:
try:
float(value)
except (TypeError, ValueError):
raise_parse_error(node, 'Requires sequence of float values')
return values
def gds_format_decimal(self, input_data, input_name=''):
return_value = '%s' % input_data
if '.' in return_value:
return_value = return_value.rstrip('0')
if return_value.endswith('.'):
return_value = return_value.rstrip('.')
return return_value
def gds_parse_decimal(self, input_data, node=None, input_name=''):
try:
decimal_value = decimal_.Decimal(input_data)
except (TypeError, ValueError):
raise_parse_error(node, 'Requires decimal value')
return decimal_value
def gds_validate_decimal(self, input_data, node=None, input_name=''):
try:
value = decimal_.Decimal(input_data)
except (TypeError, ValueError):
raise_parse_error(node, 'Requires decimal value')
return value
def gds_format_decimal_list(self, input_data, input_name=''):
return ' '.join([self.gds_format_decimal(item) for item in input_data])
def gds_validate_decimal_list(
self, input_data, node=None, input_name=''):
values = input_data.split()
for value in values:
try:
decimal_.Decimal(value)
except (TypeError, ValueError):
raise_parse_error(node, 'Requires sequence of decimal values')
return values
def gds_format_double(self, input_data, input_name=''):
return '%e' % input_data
def gds_parse_double(self, input_data, node=None, input_name=''):
try:
fval_ = float(input_data)
except (TypeError, ValueError) as exp:
raise_parse_error(node, 'Requires double or float value: %s' % exp)
return fval_
def gds_validate_double(self, input_data, node=None, input_name=''):
try:
value = float(input_data)
except (TypeError, ValueError):
raise_parse_error(node, 'Requires double or float value')
return value
def gds_format_double_list(self, input_data, input_name=''):
return '%s' % ' '.join(input_data)
def gds_validate_double_list(
self, input_data, node=None, input_name=''):
values = input_data.split()
for value in values:
try:
float(value)
except (TypeError, ValueError):
raise_parse_error(
node, 'Requires sequence of double or float values')
return values
def gds_format_boolean(self, input_data, input_name=''):
return ('%s' % input_data).lower()
def gds_parse_boolean(self, input_data, node=None, input_name=''):
if input_data in ('true', '1'):
bval = True
elif input_data in ('false', '0'):
bval = False
else:
raise_parse_error(node, 'Requires boolean value')
return bval
def gds_validate_boolean(self, input_data, node=None, input_name=''):
if input_data not in (True, 1, False, 0, ):
raise_parse_error(
node,
'Requires boolean value '
'(one of True, 1, False, 0)')
return input_data
def gds_format_boolean_list(self, input_data, input_name=''):
return '%s' % ' '.join(input_data)
def gds_validate_boolean_list(
self, input_data, node=None, input_name=''):
values = input_data.split()
for value in values:
if value not in (True, 1, False, 0, ):
raise_parse_error(
node,
'Requires sequence of boolean values '
'(one of True, 1, False, 0)')
return values
def gds_validate_datetime(self, input_data, node=None, input_name=''):
return input_data
def gds_format_datetime(self, input_data, input_name=''):
if input_data.microsecond == 0:
_svalue = '%04d-%02d-%02dT%02d:%02d:%02d' % (
input_data.year,
input_data.month,
input_data.day,
input_data.hour,
input_data.minute,
input_data.second,
)
else:
_svalue = '%04d-%02d-%02dT%02d:%02d:%02d.%s' % (
input_data.year,
input_data.month,
input_data.day,
input_data.hour,
input_data.minute,
input_data.second,
('%f' % (float(input_data.microsecond) / 1000000))[2:],
)
if input_data.tzinfo is not None:
tzoff = input_data.tzinfo.utcoffset(input_data)
if tzoff is not None:
total_seconds = tzoff.seconds + (86400 * tzoff.days)
if total_seconds == 0:
_svalue += 'Z'
else:
if total_seconds < 0:
_svalue += '-'
total_seconds *= -1
else:
_svalue += '+'
hours = total_seconds // 3600
minutes = (total_seconds - (hours * 3600)) // 60
_svalue += '{0:02d}:{1:02d}'.format(hours, minutes)
return _svalue
@classmethod
def gds_parse_datetime(cls, input_data):
tz = None
if input_data[-1] == 'Z':
tz = GeneratedsSuper._FixedOffsetTZ(0, 'UTC')
input_data = input_data[:-1]
else:
results = GeneratedsSuper.tzoff_pattern.search(input_data)
if results is not None:
tzoff_parts = results.group(2).split(':')
tzoff = int(tzoff_parts[0]) * 60 + int(tzoff_parts[1])
if results.group(1) == '-':
tzoff *= -1
tz = GeneratedsSuper._FixedOffsetTZ(
tzoff, results.group(0))
input_data = input_data[:-6]
time_parts = input_data.split('.')
if len(time_parts) > 1:
micro_seconds = int(float('0.' + time_parts[1]) * 1000000)
input_data = '%s.%s' % (
time_parts[0], "{}".format(micro_seconds).rjust(6, "0"), )
dt = datetime_.datetime.strptime(
input_data, '%Y-%m-%dT%H:%M:%S.%f')
else:
dt = datetime_.datetime.strptime(
input_data, '%Y-%m-%dT%H:%M:%S')
dt = dt.replace(tzinfo=tz)
return dt
def gds_validate_date(self, input_data, node=None, input_name=''):
return input_data
def gds_format_date(self, input_data, input_name=''):
_svalue = '%04d-%02d-%02d' % (
input_data.year,
input_data.month,
input_data.day,
)
try:
if input_data.tzinfo is not None:
tzoff = input_data.tzinfo.utcoffset(input_data)
if tzoff is not None:
total_seconds = tzoff.seconds + (86400 * tzoff.days)
if total_seconds == 0:
_svalue += 'Z'
else:
if total_seconds < 0:
_svalue += '-'
total_seconds *= -1
else:
_svalue += '+'
hours = total_seconds // 3600
minutes = (total_seconds - (hours * 3600)) // 60
_svalue += '{0:02d}:{1:02d}'.format(
hours, minutes)
except AttributeError:
pass
return _svalue
@classmethod
def gds_parse_date(cls, input_data):
tz = None
if input_data[-1] == 'Z':
tz = GeneratedsSuper._FixedOffsetTZ(0, 'UTC')
input_data = input_data[:-1]
else:
results = GeneratedsSuper.tzoff_pattern.search(input_data)
if results is not None:
tzoff_parts = results.group(2).split(':')
tzoff = int(tzoff_parts[0]) * 60 + int(tzoff_parts[1])
if results.group(1) == '-':
tzoff *= -1
tz = GeneratedsSuper._FixedOffsetTZ(
tzoff, results.group(0))
input_data = input_data[:-6]
dt = datetime_.datetime.strptime(input_data, '%Y-%m-%d')
dt = dt.replace(tzinfo=tz)
return dt.date()
def gds_validate_time(self, input_data, node=None, input_name=''):
return input_data
def gds_format_time(self, input_data, input_name=''):
if input_data.microsecond == 0:
_svalue = '%02d:%02d:%02d' % (
input_data.hour,
input_data.minute,
input_data.second,
)
else:
_svalue = '%02d:%02d:%02d.%s' % (
input_data.hour,
input_data.minute,
input_data.second,
('%f' % (float(input_data.microsecond) / 1000000))[2:],
)
if input_data.tzinfo is not None:
tzoff = input_data.tzinfo.utcoffset(input_data)
if tzoff is not None:
total_seconds = tzoff.seconds + (86400 * tzoff.days)
if total_seconds == 0:
_svalue += 'Z'
else:
if total_seconds < 0:
_svalue += '-'
total_seconds *= -1
else:
_svalue += '+'
hours = total_seconds // 3600
minutes = (total_seconds - (hours * 3600)) // 60
_svalue += '{0:02d}:{1:02d}'.format(hours, minutes)
return _svalue
def gds_validate_simple_patterns(self, patterns, target):
# pat is a list of lists of strings/patterns.
# The target value must match at least one of the patterns
# in order for the test to succeed.
found1 = True
for patterns1 in patterns:
found2 = False
for patterns2 in patterns1:
mo = re_.search(patterns2, target)
if mo is not None and len(mo.group(0)) == len(target):
found2 = True
break
if not found2:
found1 = False
break
return found1
@classmethod
def gds_parse_time(cls, input_data):
tz = None
if input_data[-1] == 'Z':
tz = GeneratedsSuper._FixedOffsetTZ(0, 'UTC')
input_data = input_data[:-1]
else:
results = GeneratedsSuper.tzoff_pattern.search(input_data)
if results is not None:
tzoff_parts = results.group(2).split(':')
tzoff = int(tzoff_parts[0]) * 60 + int(tzoff_parts[1])
if results.group(1) == '-':
tzoff *= -1
tz = GeneratedsSuper._FixedOffsetTZ(
tzoff, results.group(0))
input_data = input_data[:-6]
if len(input_data.split('.')) > 1:
dt = datetime_.datetime.strptime(input_data, '%H:%M:%S.%f')
else:
dt = datetime_.datetime.strptime(input_data, '%H:%M:%S')
dt = dt.replace(tzinfo=tz)
return dt.time()
def gds_check_cardinality_(
self, value, input_name,
min_occurs=0, max_occurs=1, required=None):
if value is None:
length = 0
elif isinstance(value, list):
length = len(value)
else:
length = 1
if required is not None :
if required and length < 1:
self.gds_collector_.add_message(
"Required value {}{} is missing".format(
input_name, self.gds_get_node_lineno_()))
if length < min_occurs:
self.gds_collector_.add_message(
"Number of values for {}{} is below "
"the minimum allowed, "
"expected at least {}, found {}".format(
input_name, self.gds_get_node_lineno_(),
min_occurs, length))
elif length > max_occurs:
self.gds_collector_.add_message(
"Number of values for {}{} is above "
"the maximum allowed, "
"expected at most {}, found {}".format(
input_name, self.gds_get_node_lineno_(),
max_occurs, length))
def gds_validate_builtin_ST_(
self, validator, value, input_name,
min_occurs=None, max_occurs=None, required=None):
if value is not None:
try:
validator(value, input_name=input_name)
except GDSParseError as parse_error:
self.gds_collector_.add_message(str(parse_error))
def gds_validate_defined_ST_(
self, validator, value, input_name,
min_occurs=None, max_occurs=None, required=None):
if value is not None:
try:
validator(value)
except GDSParseError as parse_error:
self.gds_collector_.add_message(str(parse_error))
def gds_str_lower(self, instring):
return instring.lower()
def get_path_(self, node):
path_list = []
self.get_path_list_(node, path_list)
path_list.reverse()
path = '/'.join(path_list)
return path
Tag_strip_pattern_ = re_.compile(r'\{.*\}')
def get_path_list_(self, node, path_list):
if node is None:
return
tag = GeneratedsSuper.Tag_strip_pattern_.sub('', node.tag)
if tag:
path_list.append(tag)
self.get_path_list_(node.getparent(), path_list)
def get_class_obj_(self, node, default_class=None):
class_obj1 = default_class
if 'xsi' in node.nsmap:
classname = node.get('{%s}type' % node.nsmap['xsi'])
if classname is not None:
names = classname.split(':')
if len(names) == 2:
classname = names[1]
class_obj2 = globals().get(classname)
if class_obj2 is not None:
class_obj1 = class_obj2
return class_obj1
def gds_build_any(self, node, type_name=None):
# provide default value in case option --disable-xml is used.
content = ""
content = etree_.tostring(node, encoding="unicode")
return content
@classmethod
def gds_reverse_node_mapping(cls, mapping):
return dict(((v, k) for k, v in mapping.items()))
@staticmethod
def gds_encode(instring):
if sys.version_info.major == 2:
if ExternalEncoding:
encoding = ExternalEncoding
else:
encoding = 'utf-8'
return instring.encode(encoding)
else:
return instring
@staticmethod
def convert_unicode(instring):
if isinstance(instring, str):
result = quote_xml(instring)
elif sys.version_info.major == 2 and isinstance(instring, unicode):
result = quote_xml(instring).encode('utf8')
else:
result = GeneratedsSuper.gds_encode(str(instring))
return result
def __eq__(self, other):
def excl_select_objs_(obj):
return (obj[0] != 'parent_object_' and
obj[0] != 'gds_collector_')
if type(self) != type(other):
return False
return all(x == y for x, y in zip_longest(
filter(excl_select_objs_, self.__dict__.items()),
filter(excl_select_objs_, other.__dict__.items())))
def __ne__(self, other):
return not self.__eq__(other)
# Django ETL transform hooks.
def gds_djo_etl_transform(self):
pass
def gds_djo_etl_transform_db_obj(self, dbobj):
pass
# SQLAlchemy ETL transform hooks.
def gds_sqa_etl_transform(self):
return 0, None
def gds_sqa_etl_transform_db_obj(self, dbobj):
pass
def gds_get_node_lineno_(self):
if (hasattr(self, "gds_elementtree_node_") and
self.gds_elementtree_node_ is not None):
return ' near line {}'.format(
self.gds_elementtree_node_.sourceline)
else:
return ""
def getSubclassFromModule_(module, class_):
'''Get the subclass of a class from a specific module.'''
name = class_.__name__ + 'Sub'
if hasattr(module, name):
return getattr(module, name)
else:
return None
#
# If you have installed IPython you can uncomment and use the following.
# IPython is available from http://ipython.scipy.org/.
#
## from IPython.Shell import IPShellEmbed
## args = ''
## ipshell = IPShellEmbed(args,
## banner = 'Dropping into IPython',
## exit_msg = 'Leaving Interpreter, back to program.')
# Then use the following line where and when you want to drop into the
# IPython shell:
# ipshell('<some message> -- Entering ipshell.\nHit Ctrl-D to exit')
#
# Globals
#
ExternalEncoding = ''
# Set this to false in order to deactivate during export, the use of
# name space prefixes captured from the input document.
UseCapturedNS_ = True
CapturedNsmap_ = {}
Tag_pattern_ = re_.compile(r'({.*})?(.*)')
String_cleanup_pat_ = re_.compile(r"[\n\r\s]+")
Namespace_extract_pat_ = re_.compile(r'{(.*)}(.*)')
CDATA_pattern_ = re_.compile(r"<!\[CDATA\[.*?\]\]>", re_.DOTALL)
# Change this to redirect the generated superclass module to use a
# specific subclass module.
CurrentSubclassModule_ = None
#
# Support/utility functions.
#
def showIndent(outfile, level, pretty_print=True):
if pretty_print:
for idx in range(level):
outfile.write(' ')
def quote_xml(inStr):
"Escape markup chars, but do not modify CDATA sections."
if not inStr:
return ''
s1 = (isinstance(inStr, BaseStrType_) and inStr or '%s' % inStr)
s2 = ''
pos = 0
matchobjects = CDATA_pattern_.finditer(s1)
for mo in matchobjects:
s3 = s1[pos:mo.start()]
s2 += quote_xml_aux(s3)
s2 += s1[mo.start():mo.end()]
pos = mo.end()
s3 = s1[pos:]
s2 += quote_xml_aux(s3)
return s2
def quote_xml_aux(inStr):
s1 = inStr.replace('&', '&')
s1 = s1.replace('<', '<')
s1 = s1.replace('>', '>')
return s1
def quote_attrib(inStr):
s1 = (isinstance(inStr, BaseStrType_) and inStr or '%s' % inStr)
s1 = s1.replace('&', '&')
s1 = s1.replace('<', '<')
s1 = s1.replace('>', '>')
if '"' in s1:
if "'" in s1:
s1 = '"%s"' % s1.replace('"', """)
else:
s1 = "'%s'" % s1
else:
s1 = '"%s"' % s1
return s1
def quote_python(inStr):
s1 = inStr
if s1.find("'") == -1:
if s1.find('\n') == -1:
return "'%s'" % s1
else:
return "'''%s'''" % s1
else:
if s1.find('"') != -1:
s1 = s1.replace('"', '\\"')
if s1.find('\n') == -1:
return '"%s"' % s1
else:
return '"""%s"""' % s1
def get_all_text_(node):
if node.text is not None:
text = node.text
else:
text = ''
for child in node:
if child.tail is not None:
text += child.tail
return text
def find_attr_value_(attr_name, node):
attrs = node.attrib
attr_parts = attr_name.split(':')
value = None
if len(attr_parts) == 1:
value = attrs.get(attr_name)
elif len(attr_parts) == 2:
prefix, name = attr_parts
namespace = node.nsmap.get(prefix)
if namespace is not None:
value = attrs.get('{%s}%s' % (namespace, name, ))
return value
def encode_str_2_3(instr):
return instr
class GDSParseError(Exception):
pass
def raise_parse_error(node, msg):
if node is not None:
msg = '%s (element %s/line %d)' % (msg, node.tag, node.sourceline, )
raise GDSParseError(msg)
class MixedContainer:
# Constants for category:
CategoryNone = 0
CategoryText = 1
CategorySimple = 2
CategoryComplex = 3
# Constants for content_type:
TypeNone = 0
TypeText = 1
TypeString = 2
TypeInteger = 3
TypeFloat = 4
TypeDecimal = 5
TypeDouble = 6
TypeBoolean = 7
TypeBase64 = 8
def __init__(self, category, content_type, name, value):
self.category = category
self.content_type = content_type
self.name = name
self.value = value
def getCategory(self):
return self.category
def getContenttype(self, content_type):
return self.content_type
def getValue(self):
return self.value
def getName(self):
return self.name
def export(self, outfile, level, name, namespace,
pretty_print=True):
if self.category == MixedContainer.CategoryText:
# Prevent exporting empty content as empty lines.
if self.value.strip():
outfile.write(self.value)
elif self.category == MixedContainer.CategorySimple:
self.exportSimple(outfile, level, name)
else: # category == MixedContainer.CategoryComplex
self.value.export(
outfile, level, namespace, name_=name,
pretty_print=pretty_print)
def exportSimple(self, outfile, level, name):
if self.content_type == MixedContainer.TypeString:
outfile.write('<%s>%s</%s>' % (
self.name, self.value, self.name))
elif self.content_type == MixedContainer.TypeInteger or \
self.content_type == MixedContainer.TypeBoolean:
outfile.write('<%s>%d</%s>' % (
self.name, self.value, self.name))
elif self.content_type == MixedContainer.TypeFloat or \
self.content_type == MixedContainer.TypeDecimal:
outfile.write('<%s>%f</%s>' % (
self.name, self.value, self.name))
elif self.content_type == MixedContainer.TypeDouble:
outfile.write('<%s>%g</%s>' % (
self.name, self.value, self.name))
elif self.content_type == MixedContainer.TypeBase64:
outfile.write('<%s>%s</%s>' % (
self.name,
base64.b64encode(self.value),
self.name))
def to_etree(self, element, mapping_=None, nsmap_=None):
if self.category == MixedContainer.CategoryText:
# Prevent exporting empty content as empty lines.
if self.value.strip():
if len(element) > 0:
if element[-1].tail is None:
element[-1].tail = self.value
else:
element[-1].tail += self.value
else:
if element.text is None:
element.text = self.value
else:
element.text += self.value
elif self.category == MixedContainer.CategorySimple:
subelement = etree_.SubElement(
element, '%s' % self.name)
subelement.text = self.to_etree_simple()
else: # category == MixedContainer.CategoryComplex
self.value.to_etree(element)
def to_etree_simple(self, mapping_=None, nsmap_=None):
if self.content_type == MixedContainer.TypeString:
text = self.value
elif (self.content_type == MixedContainer.TypeInteger or
self.content_type == MixedContainer.TypeBoolean):
text = '%d' % self.value
elif (self.content_type == MixedContainer.TypeFloat or
self.content_type == MixedContainer.TypeDecimal):
text = '%f' % self.value
elif self.content_type == MixedContainer.TypeDouble:
text = '%g' % self.value
elif self.content_type == MixedContainer.TypeBase64:
text = '%s' % base64.b64encode(self.value)
return text
def exportLiteral(self, outfile, level, name):
if self.category == MixedContainer.CategoryText:
showIndent(outfile, level)
outfile.write(
'model_.MixedContainer(%d, %d, "%s", "%s"),\n' % (
self.category, self.content_type,
self.name, self.value))
elif self.category == MixedContainer.CategorySimple:
showIndent(outfile, level)
outfile.write(
'model_.MixedContainer(%d, %d, "%s", "%s"),\n' % (
self.category, self.content_type,
self.name, self.value))
else: # category == MixedContainer.CategoryComplex
showIndent(outfile, level)
outfile.write(
'model_.MixedContainer(%d, %d, "%s",\n' % (
self.category, self.content_type, self.name,))
self.value.exportLiteral(outfile, level + 1)
showIndent(outfile, level)
outfile.write(')\n')
class MemberSpec_(object):
def __init__(self, name='', data_type='', container=0,
optional=0, child_attrs=None, choice=None):
self.name = name
self.data_type = data_type
self.container = container
self.child_attrs = child_attrs
self.choice = choice
self.optional = optional
def set_name(self, name): self.name = name
def get_name(self): return self.name
def set_data_type(self, data_type): self.data_type = data_type
def get_data_type_chain(self): return self.data_type
def get_data_type(self):
if isinstance(self.data_type, list):
if len(self.data_type) > 0:
return self.data_type[-1]
else:
return 'xs:string'
else:
return self.data_type
def set_container(self, container): self.container = container
def get_container(self): return self.container
def set_child_attrs(self, child_attrs): self.child_attrs = child_attrs
def get_child_attrs(self): return self.child_attrs
def set_choice(self, choice): self.choice = choice
def get_choice(self): return self.choice
def set_optional(self, optional): self.optional = optional
def get_optional(self): return self.optional
def _cast(typ, value):
if typ is None or value is None:
return value
return typ(value)
#
# Data representation classes.
#
class tpOpcaoSimples(str, Enum):
"""Tipo referente às possíveis opções de escolha pelo Simples."""
_0='0' # Não-optante pelo Simples Federal nem Municipal.
_1='1' # Optante pelo Simples Federal (Alíquota de 1,0%).
_2='2' # Optante pelo Simples Federal (Alíquota de 0,5%).
_3='3' # Optante pelo Simples Municipal.
class tpStatusNFe(str, Enum):
"""Tipo referente aos possíveis status de NFS-e."""
N='N' # Normal.
C='C' # Cancelada.
E='E' # Extraviada.
class tpTipoRPS(str, Enum):
"""Tipo referente aos possíveis tipos de RPS."""
RPS='RPS' # Recibo Provisório de Serviços.
RPSM='RPS-M' # Recibo Provisório de Serviços proveniente de Nota Fiscal Conjugada (Mista).
RPSC='RPS-C' # Cupom.
class RetornoInformacoesLote(GeneratedsSuper):
"""Schema utilizado para RETORNO de Pedidos de Informações de Lote.Este
Schema XML é utilizado pelo Web Service para informar aos prestadores
de serviços o resultado do pedido de informações de lote."""
__hash__ = GeneratedsSuper.__hash__
member_data_items_ = [
MemberSpec_('Cabecalho', 'CabecalhoType', 0, 0, {'maxOccurs': '1', 'minOccurs': '1', 'name': 'Cabecalho', 'type': 'CabecalhoType'}, None),
MemberSpec_('Alerta', 'tpEvento', 1, 1, {'maxOccurs': 'unbounded', 'minOccurs': '0', 'name': 'Alerta', 'type': 'tpEvento'}, None),
MemberSpec_('Erro', 'tpEvento', 1, 1, {'maxOccurs': 'unbounded', 'minOccurs': '0', 'name': 'Erro', 'type': 'tpEvento'}, None),
]
subclass = None
superclass = None
def __init__(self, Cabecalho=None, Alerta=None, Erro=None, gds_collector_=None, **kwargs_):
self.gds_collector_ = gds_collector_
self.gds_elementtree_node_ = None
self.original_tagname_ = None
self.parent_object_ = kwargs_.get('parent_object_')
self.ns_prefix_ = None
self.Cabecalho = Cabecalho
self.Cabecalho_nsprefix_ = None
if Alerta is None:
self.Alerta = []
else:
self.Alerta = Alerta
self.Alerta_nsprefix_ = None
if Erro is None:
self.Erro = []
else:
self.Erro = Erro
self.Erro_nsprefix_ = None
def factory(*args_, **kwargs_):
if CurrentSubclassModule_ is not None:
subclass = getSubclassFromModule_(
CurrentSubclassModule_, RetornoInformacoesLote)
if subclass is not None:
return subclass(*args_, **kwargs_)
if RetornoInformacoesLote.subclass:
return RetornoInformacoesLote.subclass(*args_, **kwargs_)
else:
return RetornoInformacoesLote(*args_, **kwargs_)
factory = staticmethod(factory)
def hasContent_(self):
if (
self.Cabecalho is not None or
self.Alerta or
self.Erro
):
return True
else:
return False
def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='RetornoInformacoesLote', pretty_print=True):
imported_ns_def_ = GenerateDSNamespaceDefs_.get('RetornoInformacoesLote')
if imported_ns_def_ is not None:
namespacedef_ = imported_ns_def_
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None and name_ == 'RetornoInformacoesLote':
name_ = self.original_tagname_
if UseCapturedNS_ and self.ns_prefix_:
namespaceprefix_ = self.ns_prefix_ + ':'
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='RetornoInformacoesLote')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='RetornoInformacoesLote', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='RetornoInformacoesLote'):
pass
def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='RetornoInformacoesLote', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.Cabecalho is not None:
namespaceprefix_ = self.Cabecalho_nsprefix_ + ':' if (UseCapturedNS_ and self.Cabecalho_nsprefix_) else ''
self.Cabecalho.export(outfile, level, namespaceprefix_, namespacedef_='', name_='Cabecalho', pretty_print=pretty_print)
for Alerta_ in self.Alerta:
namespaceprefix_ = self.Alerta_nsprefix_ + ':' if (UseCapturedNS_ and self.Alerta_nsprefix_) else ''
Alerta_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='Alerta', pretty_print=pretty_print)
for Erro_ in self.Erro:
namespaceprefix_ = self.Erro_nsprefix_ + ':' if (UseCapturedNS_ and self.Erro_nsprefix_) else ''
Erro_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='Erro', pretty_print=pretty_print)
def build(self, node, gds_collector_=None):
self.gds_collector_ = gds_collector_
if SaveElementTreeNode:
self.gds_elementtree_node_ = node
already_processed = set()
self.ns_prefix_ = node.prefix
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
return self
def buildAttributes(self, node, attrs, already_processed):
pass
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
if nodeName_ == 'Cabecalho':
obj_ = CabecalhoType.factory(parent_object_=self)
obj_.build(child_, gds_collector_=gds_collector_)
self.Cabecalho = obj_
obj_.original_tagname_ = 'Cabecalho'
elif nodeName_ == 'Alerta':
obj_ = tpEvento.factory(parent_object_=self)
obj_.build(child_, gds_collector_=gds_collector_)
self.Alerta.append(obj_)
obj_.original_tagname_ = 'Alerta'
elif nodeName_ == 'Erro':
obj_ = tpEvento.factory(parent_object_=self)
obj_.build(child_, gds_collector_=gds_collector_)
self.Erro.append(obj_)
obj_.original_tagname_ = 'Erro'
# end class RetornoInformacoesLote
class tpEvento(GeneratedsSuper):
"""Chave para identificação da origem do evento."""
__hash__ = GeneratedsSuper.__hash__
member_data_items_ = [
MemberSpec_('Codigo', ['tpCodigoEvento', 'xs:short'], 0, 0, {'maxOccurs': '1', 'minOccurs': '1', 'name': 'Codigo', 'type': 'xs:short'}, None),
MemberSpec_('Descricao', ['tpDescricaoEvento', 'xs:string'], 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'Descricao', 'type': 'xs:string'}, None),
MemberSpec_('ChaveRPS', 'tpChaveRPS', 0, 0, {'maxOccurs': '1', 'minOccurs': '1', 'name': 'ChaveRPS', 'type': 'tpChaveRPS'}, 1),
MemberSpec_('ChaveNFe', 'tpChaveNFe', 0, 0, {'maxOccurs': '1', 'minOccurs': '1', 'name': 'ChaveNFe', 'type': 'tpChaveNFe'}, 1),
]
subclass = None
superclass = None
def __init__(self, Codigo=None, Descricao=None, ChaveRPS=None, ChaveNFe=None, gds_collector_=None, **kwargs_):
self.gds_collector_ = gds_collector_
self.gds_elementtree_node_ = None
self.original_tagname_ = None
self.parent_object_ = kwargs_.get('parent_object_')
self.ns_prefix_ = None
self.Codigo = Codigo
self.validate_tpCodigoEvento(self.Codigo)
self.Codigo_nsprefix_ = None
self.Descricao = Descricao
self.validate_tpDescricaoEvento(self.Descricao)
self.Descricao_nsprefix_ = None
self.ChaveRPS = ChaveRPS
self.ChaveRPS_nsprefix_ = None
self.ChaveNFe = ChaveNFe
self.ChaveNFe_nsprefix_ = None
def factory(*args_, **kwargs_):
if CurrentSubclassModule_ is not None:
subclass = getSubclassFromModule_(
CurrentSubclassModule_, tpEvento)
if subclass is not None:
return subclass(*args_, **kwargs_)
if tpEvento.subclass:
return tpEvento.subclass(*args_, **kwargs_)
else:
return tpEvento(*args_, **kwargs_)
factory = staticmethod(factory)
def validate_tpCodigoEvento(self, value):
result = True
# Validate type tpCodigoEvento, a restriction on xs:short.
if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
if not isinstance(value, int):
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (int)' % {"value": value, "lineno": lineno, })
return False
if not self.gds_validate_simple_patterns(
self.validate_tpCodigoEvento_patterns_, value):
self.gds_collector_.add_message('Value "%s" does not match xsd pattern restrictions: %s' % (encode_str_2_3(value), self.validate_tpCodigoEvento_patterns_, ))
result = False
return result
validate_tpCodigoEvento_patterns_ = [['^([0-9]{3,4})$']]
def validate_tpDescricaoEvento(self, value):
result = True
# Validate type tpDescricaoEvento, a restriction on xs:string.
if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
if not isinstance(value, str):
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' % {"value": value, "lineno": lineno, })
return False
if len(value) > 300:
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd maxLength restriction on tpDescricaoEvento' % {"value" : encode_str_2_3(value), "lineno": lineno} )
result = False
if len(value) < 0:
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd minLength restriction on tpDescricaoEvento' % {"value" : encode_str_2_3(value), "lineno": lineno} )
result = False
return result
def hasContent_(self):
if (
self.Codigo is not None or
self.Descricao is not None or
self.ChaveRPS is not None or
self.ChaveNFe is not None
):
return True
else:
return False
def export(self, outfile, level, namespaceprefix_='tipos:', namespacedef_='', name_='tpEvento', pretty_print=True):
imported_ns_def_ = GenerateDSNamespaceDefs_.get('tpEvento')
if imported_ns_def_ is not None:
namespacedef_ = imported_ns_def_
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None and name_ == 'tpEvento':
name_ = self.original_tagname_
if UseCapturedNS_ and self.ns_prefix_:
namespaceprefix_ = self.ns_prefix_ + ':'
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='tpEvento')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='tpEvento', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='tipos:', name_='tpEvento'):
pass
def exportChildren(self, outfile, level, namespaceprefix_='tipos:', namespacedef_='', name_='tpEvento', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.Codigo is not None:
namespaceprefix_ = self.Codigo_nsprefix_ + ':' if (UseCapturedNS_ and self.Codigo_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sCodigo>%s</%sCodigo>%s' % (namespaceprefix_ , self.gds_format_integer(self.Codigo, input_name='Codigo'), namespaceprefix_ , eol_))
if self.Descricao is not None:
namespaceprefix_ = self.Descricao_nsprefix_ + ':' if (UseCapturedNS_ and self.Descricao_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sDescricao>%s</%sDescricao>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.Descricao), input_name='Descricao')), namespaceprefix_ , eol_))
if self.ChaveRPS is not None:
namespaceprefix_ = self.ChaveRPS_nsprefix_ + ':' if (UseCapturedNS_ and self.ChaveRPS_nsprefix_) else ''
self.ChaveRPS.export(outfile, level, namespaceprefix_, namespacedef_='', name_='ChaveRPS', pretty_print=pretty_print)
if self.ChaveNFe is not None:
namespaceprefix_ = self.ChaveNFe_nsprefix_ + ':' if (UseCapturedNS_ and self.ChaveNFe_nsprefix_) else ''
self.ChaveNFe.export(outfile, level, namespaceprefix_, namespacedef_='', name_='ChaveNFe', pretty_print=pretty_print)
def build(self, node, gds_collector_=None):
self.gds_collector_ = gds_collector_
if SaveElementTreeNode:
self.gds_elementtree_node_ = node
already_processed = set()
self.ns_prefix_ = node.prefix
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
return self
def buildAttributes(self, node, attrs, already_processed):
pass
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
if nodeName_ == 'Codigo' and child_.text:
sval_ = child_.text
ival_ = self.gds_parse_integer(sval_, node, 'Codigo')
ival_ = self.gds_validate_integer(ival_, node, 'Codigo')
self.Codigo = ival_
self.Codigo_nsprefix_ = child_.prefix
# validate type tpCodigoEvento
self.validate_tpCodigoEvento(self.Codigo)
elif nodeName_ == 'Descricao':
value_ = child_.text
value_ = self.gds_parse_string(value_, node, 'Descricao')
value_ = self.gds_validate_string(value_, node, 'Descricao')
self.Descricao = value_
self.Descricao_nsprefix_ = child_.prefix
# validate type tpDescricaoEvento
self.validate_tpDescricaoEvento(self.Descricao)
elif nodeName_ == 'ChaveRPS':
obj_ = tpChaveRPS.factory(parent_object_=self)
obj_.build(child_, gds_collector_=gds_collector_)
self.ChaveRPS = obj_
obj_.original_tagname_ = 'ChaveRPS'
elif nodeName_ == 'ChaveNFe':
obj_ = tpChaveNFe.factory(parent_object_=self)
obj_.build(child_, gds_collector_=gds_collector_)
self.ChaveNFe = obj_
obj_.original_tagname_ = 'ChaveNFe'
# end class tpEvento
class tpCPFCNPJ(GeneratedsSuper):
"""Tipo que representa um CPF/CNPJ."""
__hash__ = GeneratedsSuper.__hash__
member_data_items_ = [
MemberSpec_('CPF', ['tpCPF', 'xs:string'], 0, 0, {'maxOccurs': '1', 'minOccurs': '1', 'name': 'CPF', 'type': 'xs:string'}, 2),
MemberSpec_('CNPJ', ['tpCNPJ', 'xs:string'], 0, 0, {'maxOccurs': '1', 'minOccurs': '1', 'name': 'CNPJ', 'type': 'xs:string'}, 2),
]
subclass = None
superclass = None
def __init__(self, CPF=None, CNPJ=None, gds_collector_=None, **kwargs_):
self.gds_collector_ = gds_collector_
self.gds_elementtree_node_ = None
self.original_tagname_ = None
self.parent_object_ = kwargs_.get('parent_object_')
self.ns_prefix_ = None
self.CPF = CPF
self.validate_tpCPF(self.CPF)
self.CPF_nsprefix_ = None
self.CNPJ = CNPJ
self.validate_tpCNPJ(self.CNPJ)
self.CNPJ_nsprefix_ = None
def factory(*args_, **kwargs_):
if CurrentSubclassModule_ is not None:
subclass = getSubclassFromModule_(
CurrentSubclassModule_, tpCPFCNPJ)
if subclass is not None:
return subclass(*args_, **kwargs_)
if tpCPFCNPJ.subclass:
return tpCPFCNPJ.subclass(*args_, **kwargs_)
else:
return tpCPFCNPJ(*args_, **kwargs_)
factory = staticmethod(factory)
def validate_tpCPF(self, value):
result = True
# Validate type tpCPF, a restriction on xs:string.
if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
if not isinstance(value, str):
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' % {"value": value, "lineno": lineno, })
return False
if not self.gds_validate_simple_patterns(
self.validate_tpCPF_patterns_, value):
self.gds_collector_.add_message('Value "%s" does not match xsd pattern restrictions: %s' % (encode_str_2_3(value), self.validate_tpCPF_patterns_, ))
result = False
return result
validate_tpCPF_patterns_ = [['^([0-9]{0}|[0-9]{11})$']]
def validate_tpCNPJ(self, value):
result = True
# Validate type tpCNPJ, a restriction on xs:string.
if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
if not isinstance(value, str):
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' % {"value": value, "lineno": lineno, })
return False
if not self.gds_validate_simple_patterns(
self.validate_tpCNPJ_patterns_, value):
self.gds_collector_.add_message('Value "%s" does not match xsd pattern restrictions: %s' % (encode_str_2_3(value), self.validate_tpCNPJ_patterns_, ))
result = False
return result
validate_tpCNPJ_patterns_ = [['^([0-9]{14})$']]
def hasContent_(self):
if (
self.CPF is not None or
self.CNPJ is not None
):
return True
else:
return False
def export(self, outfile, level, namespaceprefix_='tipos:', namespacedef_='', name_='tpCPFCNPJ', pretty_print=True):
imported_ns_def_ = GenerateDSNamespaceDefs_.get('tpCPFCNPJ')
if imported_ns_def_ is not None:
namespacedef_ = imported_ns_def_
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None and name_ == 'tpCPFCNPJ':
name_ = self.original_tagname_
if UseCapturedNS_ and self.ns_prefix_:
namespaceprefix_ = self.ns_prefix_ + ':'
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='tpCPFCNPJ')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='tpCPFCNPJ', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='tipos:', name_='tpCPFCNPJ'):
pass
def exportChildren(self, outfile, level, namespaceprefix_='tipos:', namespacedef_='', name_='tpCPFCNPJ', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.CPF is not None:
namespaceprefix_ = self.CPF_nsprefix_ + ':' if (UseCapturedNS_ and self.CPF_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sCPF>%s</%sCPF>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.CPF), input_name='CPF')), namespaceprefix_ , eol_))
if self.CNPJ is not None:
namespaceprefix_ = self.CNPJ_nsprefix_ + ':' if (UseCapturedNS_ and self.CNPJ_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sCNPJ>%s</%sCNPJ>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.CNPJ), input_name='CNPJ')), namespaceprefix_ , eol_))
def build(self, node, gds_collector_=None):
self.gds_collector_ = gds_collector_
if SaveElementTreeNode:
self.gds_elementtree_node_ = node
already_processed = set()
self.ns_prefix_ = node.prefix
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
return self
def buildAttributes(self, node, attrs, already_processed):
pass
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
if nodeName_ == 'CPF':
value_ = child_.text
value_ = self.gds_parse_string(value_, node, 'CPF')
value_ = self.gds_validate_string(value_, node, 'CPF')
self.CPF = value_
self.CPF_nsprefix_ = child_.prefix
# validate type tpCPF
self.validate_tpCPF(self.CPF)
elif nodeName_ == 'CNPJ':
value_ = child_.text
value_ = self.gds_parse_string(value_, node, 'CNPJ')
value_ = self.gds_validate_string(value_, node, 'CNPJ')
self.CNPJ = value_
self.CNPJ_nsprefix_ = child_.prefix
# validate type tpCNPJ
self.validate_tpCNPJ(self.CNPJ)
# end class tpCPFCNPJ
class tpChaveNFeRPS(GeneratedsSuper):
"""Tipo que representa a chave de uma NFS-e e a Chave do RPS que a mesma
substitui."""
__hash__ = GeneratedsSuper.__hash__
member_data_items_ = [
MemberSpec_('ChaveNFe', 'tpChaveNFe', 0, 0, {'maxOccurs': '1', 'minOccurs': '1', 'name': 'ChaveNFe', 'type': 'tpChaveNFe'}, None),
MemberSpec_('ChaveRPS', 'tpChaveRPS', 0, 0, {'maxOccurs': '1', 'minOccurs': '1', 'name': 'ChaveRPS', 'type': 'tpChaveRPS'}, None),
]
subclass = None
superclass = None
def __init__(self, ChaveNFe=None, ChaveRPS=None, gds_collector_=None, **kwargs_):
self.gds_collector_ = gds_collector_
self.gds_elementtree_node_ = None
self.original_tagname_ = None
self.parent_object_ = kwargs_.get('parent_object_')
self.ns_prefix_ = None
self.ChaveNFe = ChaveNFe
self.ChaveNFe_nsprefix_ = None
self.ChaveRPS = ChaveRPS
self.ChaveRPS_nsprefix_ = None
def factory(*args_, **kwargs_):
if CurrentSubclassModule_ is not None:
subclass = getSubclassFromModule_(
CurrentSubclassModule_, tpChaveNFeRPS)
if subclass is not None:
return subclass(*args_, **kwargs_)
if tpChaveNFeRPS.subclass:
return tpChaveNFeRPS.subclass(*args_, **kwargs_)
else:
return tpChaveNFeRPS(*args_, **kwargs_)
factory = staticmethod(factory)
def hasContent_(self):
if (
self.ChaveNFe is not None or
self.ChaveRPS is not None
):
return True
else:
return False
def export(self, outfile, level, namespaceprefix_='tipos:', namespacedef_='', name_='tpChaveNFeRPS', pretty_print=True):
imported_ns_def_ = GenerateDSNamespaceDefs_.get('tpChaveNFeRPS')
if imported_ns_def_ is not None:
namespacedef_ = imported_ns_def_
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None and name_ == 'tpChaveNFeRPS':
name_ = self.original_tagname_
if UseCapturedNS_ and self.ns_prefix_:
namespaceprefix_ = self.ns_prefix_ + ':'
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='tpChaveNFeRPS')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='tpChaveNFeRPS', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='tipos:', name_='tpChaveNFeRPS'):
pass
def exportChildren(self, outfile, level, namespaceprefix_='tipos:', namespacedef_='', name_='tpChaveNFeRPS', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.ChaveNFe is not None:
namespaceprefix_ = self.ChaveNFe_nsprefix_ + ':' if (UseCapturedNS_ and self.ChaveNFe_nsprefix_) else ''
self.ChaveNFe.export(outfile, level, namespaceprefix_, namespacedef_='', name_='ChaveNFe', pretty_print=pretty_print)
if self.ChaveRPS is not None:
namespaceprefix_ = self.ChaveRPS_nsprefix_ + ':' if (UseCapturedNS_ and self.ChaveRPS_nsprefix_) else ''
self.ChaveRPS.export(outfile, level, namespaceprefix_, namespacedef_='', name_='ChaveRPS', pretty_print=pretty_print)
def build(self, node, gds_collector_=None):
self.gds_collector_ = gds_collector_
if SaveElementTreeNode:
self.gds_elementtree_node_ = node
already_processed = set()
self.ns_prefix_ = node.prefix
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
return self
def buildAttributes(self, node, attrs, already_processed):
pass
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
if nodeName_ == 'ChaveNFe':
obj_ = tpChaveNFe.factory(parent_object_=self)
obj_.build(child_, gds_collector_=gds_collector_)
self.ChaveNFe = obj_
obj_.original_tagname_ = 'ChaveNFe'
elif nodeName_ == 'ChaveRPS':
obj_ = tpChaveRPS.factory(parent_object_=self)
obj_.build(child_, gds_collector_=gds_collector_)
self.ChaveRPS = obj_
obj_.original_tagname_ = 'ChaveRPS'
# end class tpChaveNFeRPS
class tpChaveNFe(GeneratedsSuper):
"""Chave de identificação da NFS-e."""
__hash__ = GeneratedsSuper.__hash__
member_data_items_ = [
MemberSpec_('InscricaoPrestador', ['tpInscricaoMunicipal', 'xs:long'], 0, 0, {'maxOccurs': '1', 'minOccurs': '1', 'name': 'InscricaoPrestador', 'type': 'xs:long'}, None),
MemberSpec_('NumeroNFe', ['tpNumero', 'xs:long'], 0, 0, {'maxOccurs': '1', 'minOccurs': '1', 'name': 'NumeroNFe', 'type': 'xs:long'}, None),
MemberSpec_('CodigoVerificacao', ['tpCodigoVerificacao', 'xs:string'], 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'CodigoVerificacao', 'type': 'xs:string'}, None),
]
subclass = None
superclass = None
def __init__(self, InscricaoPrestador=None, NumeroNFe=None, CodigoVerificacao=None, gds_collector_=None, **kwargs_):
self.gds_collector_ = gds_collector_
self.gds_elementtree_node_ = None
self.original_tagname_ = None
self.parent_object_ = kwargs_.get('parent_object_')
self.ns_prefix_ = None
self.InscricaoPrestador = InscricaoPrestador
self.validate_tpInscricaoMunicipal(self.InscricaoPrestador)
self.InscricaoPrestador_nsprefix_ = None
self.NumeroNFe = NumeroNFe
self.validate_tpNumero(self.NumeroNFe)
self.NumeroNFe_nsprefix_ = None
self.CodigoVerificacao = CodigoVerificacao
self.validate_tpCodigoVerificacao(self.CodigoVerificacao)
self.CodigoVerificacao_nsprefix_ = None
def factory(*args_, **kwargs_):
if CurrentSubclassModule_ is not None:
subclass = getSubclassFromModule_(
CurrentSubclassModule_, tpChaveNFe)
if subclass is not None:
return subclass(*args_, **kwargs_)
if tpChaveNFe.subclass:
return tpChaveNFe.subclass(*args_, **kwargs_)
else:
return tpChaveNFe(*args_, **kwargs_)
factory = staticmethod(factory)
def validate_tpInscricaoMunicipal(self, value):
result = True
# Validate type tpInscricaoMunicipal, a restriction on xs:long.
if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
if not isinstance(value, int):
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (int)' % {"value": value, "lineno": lineno, })
return False
if not self.gds_validate_simple_patterns(
self.validate_tpInscricaoMunicipal_patterns_, value):
self.gds_collector_.add_message('Value "%s" does not match xsd pattern restrictions: %s' % (encode_str_2_3(value), self.validate_tpInscricaoMunicipal_patterns_, ))
result = False
return result
validate_tpInscricaoMunicipal_patterns_ = [['^([0-9]{8,8})$']]
def validate_tpNumero(self, value):
result = True
# Validate type tpNumero, a restriction on xs:long.
if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
if not isinstance(value, int):
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (int)' % {"value": value, "lineno": lineno, })
return False
if not self.gds_validate_simple_patterns(
self.validate_tpNumero_patterns_, value):
self.gds_collector_.add_message('Value "%s" does not match xsd pattern restrictions: %s' % (encode_str_2_3(value), self.validate_tpNumero_patterns_, ))
result = False
return result
validate_tpNumero_patterns_ = [['^([0-9]{1,12})$']]
def validate_tpCodigoVerificacao(self, value):
result = True
# Validate type tpCodigoVerificacao, a restriction on xs:string.
if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
if not isinstance(value, str):
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' % {"value": value, "lineno": lineno, })
return False
if len(value) > 8:
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd maxLength restriction on tpCodigoVerificacao' % {"value" : encode_str_2_3(value), "lineno": lineno} )
result = False
if len(value) < 8:
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd minLength restriction on tpCodigoVerificacao' % {"value" : encode_str_2_3(value), "lineno": lineno} )
result = False
return result
def hasContent_(self):
if (
self.InscricaoPrestador is not None or
self.NumeroNFe is not None or
self.CodigoVerificacao is not None
):
return True
else:
return False
def export(self, outfile, level, namespaceprefix_='tipos:', namespacedef_='', name_='tpChaveNFe', pretty_print=True):
imported_ns_def_ = GenerateDSNamespaceDefs_.get('tpChaveNFe')
if imported_ns_def_ is not None:
namespacedef_ = imported_ns_def_
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None and name_ == 'tpChaveNFe':
name_ = self.original_tagname_
if UseCapturedNS_ and self.ns_prefix_:
namespaceprefix_ = self.ns_prefix_ + ':'
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='tpChaveNFe')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='tpChaveNFe', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='tipos:', name_='tpChaveNFe'):
pass
def exportChildren(self, outfile, level, namespaceprefix_='tipos:', namespacedef_='', name_='tpChaveNFe', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.InscricaoPrestador is not None:
namespaceprefix_ = self.InscricaoPrestador_nsprefix_ + ':' if (UseCapturedNS_ and self.InscricaoPrestador_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sInscricaoPrestador>%s</%sInscricaoPrestador>%s' % (namespaceprefix_ , self.gds_format_integer(self.InscricaoPrestador, input_name='InscricaoPrestador'), namespaceprefix_ , eol_))
if self.NumeroNFe is not None:
namespaceprefix_ = self.NumeroNFe_nsprefix_ + ':' if (UseCapturedNS_ and self.NumeroNFe_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sNumeroNFe>%s</%sNumeroNFe>%s' % (namespaceprefix_ , self.gds_format_integer(self.NumeroNFe, input_name='NumeroNFe'), namespaceprefix_ , eol_))
if self.CodigoVerificacao is not None:
namespaceprefix_ = self.CodigoVerificacao_nsprefix_ + ':' if (UseCapturedNS_ and self.CodigoVerificacao_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sCodigoVerificacao>%s</%sCodigoVerificacao>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.CodigoVerificacao), input_name='CodigoVerificacao')), namespaceprefix_ , eol_))
def build(self, node, gds_collector_=None):
self.gds_collector_ = gds_collector_
if SaveElementTreeNode:
self.gds_elementtree_node_ = node
already_processed = set()
self.ns_prefix_ = node.prefix
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
return self
def buildAttributes(self, node, attrs, already_processed):
pass
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
if nodeName_ == 'InscricaoPrestador' and child_.text:
sval_ = child_.text
ival_ = self.gds_parse_integer(sval_, node, 'InscricaoPrestador')
ival_ = self.gds_validate_integer(ival_, node, 'InscricaoPrestador')
self.InscricaoPrestador = ival_
self.InscricaoPrestador_nsprefix_ = child_.prefix
# validate type tpInscricaoMunicipal
self.validate_tpInscricaoMunicipal(self.InscricaoPrestador)
elif nodeName_ == 'NumeroNFe' and child_.text:
sval_ = child_.text
ival_ = self.gds_parse_integer(sval_, node, 'NumeroNFe')
ival_ = self.gds_validate_integer(ival_, node, 'NumeroNFe')
self.NumeroNFe = ival_
self.NumeroNFe_nsprefix_ = child_.prefix
# validate type tpNumero
self.validate_tpNumero(self.NumeroNFe)
elif nodeName_ == 'CodigoVerificacao':
value_ = child_.text
value_ = self.gds_parse_string(value_, node, 'CodigoVerificacao')
value_ = self.gds_validate_string(value_, node, 'CodigoVerificacao')
self.CodigoVerificacao = value_
self.CodigoVerificacao_nsprefix_ = child_.prefix
# validate type tpCodigoVerificacao
self.validate_tpCodigoVerificacao(self.CodigoVerificacao)
# end class tpChaveNFe
class tpChaveRPS(GeneratedsSuper):
"""Tipo que define a chave identificadora de um RPS."""
__hash__ = GeneratedsSuper.__hash__
member_data_items_ = [
MemberSpec_('InscricaoPrestador', ['tpInscricaoMunicipal', 'xs:long'], 0, 0, {'maxOccurs': '1', 'minOccurs': '1', 'name': 'InscricaoPrestador', 'type': 'xs:long'}, None),
MemberSpec_('SerieRPS', ['tpSerieRPS', 'xs:string'], 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'SerieRPS', 'type': 'xs:string'}, None),
MemberSpec_('NumeroRPS', ['tpNumero', 'xs:long'], 0, 0, {'maxOccurs': '1', 'minOccurs': '1', 'name': 'NumeroRPS', 'type': 'xs:long'}, None),
]
subclass = None
superclass = None
def __init__(self, InscricaoPrestador=None, SerieRPS=None, NumeroRPS=None, gds_collector_=None, **kwargs_):
self.gds_collector_ = gds_collector_
self.gds_elementtree_node_ = None
self.original_tagname_ = None
self.parent_object_ = kwargs_.get('parent_object_')
self.ns_prefix_ = None
self.InscricaoPrestador = InscricaoPrestador
self.validate_tpInscricaoMunicipal(self.InscricaoPrestador)
self.InscricaoPrestador_nsprefix_ = None
self.SerieRPS = SerieRPS
self.validate_tpSerieRPS(self.SerieRPS)
self.SerieRPS_nsprefix_ = None
self.NumeroRPS = NumeroRPS
self.validate_tpNumero(self.NumeroRPS)
self.NumeroRPS_nsprefix_ = None
def factory(*args_, **kwargs_):
if CurrentSubclassModule_ is not None:
subclass = getSubclassFromModule_(
CurrentSubclassModule_, tpChaveRPS)
if subclass is not None:
return subclass(*args_, **kwargs_)
if tpChaveRPS.subclass:
return tpChaveRPS.subclass(*args_, **kwargs_)
else:
return tpChaveRPS(*args_, **kwargs_)
factory = staticmethod(factory)
def validate_tpInscricaoMunicipal(self, value):
result = True
# Validate type tpInscricaoMunicipal, a restriction on xs:long.
if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
if not isinstance(value, int):
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (int)' % {"value": value, "lineno": lineno, })
return False
if not self.gds_validate_simple_patterns(
self.validate_tpInscricaoMunicipal_patterns_, value):
self.gds_collector_.add_message('Value "%s" does not match xsd pattern restrictions: %s' % (encode_str_2_3(value), self.validate_tpInscricaoMunicipal_patterns_, ))
result = False
return result
validate_tpInscricaoMunicipal_patterns_ = [['^([0-9]{8,8})$']]
def validate_tpSerieRPS(self, value):
result = True
# Validate type tpSerieRPS, a restriction on xs:string.
if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
if not isinstance(value, str):
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' % {"value": value, "lineno": lineno, })
return False
if len(value) > 5:
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd maxLength restriction on tpSerieRPS' % {"value" : encode_str_2_3(value), "lineno": lineno} )
result = False
if len(value) < 1:
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd minLength restriction on tpSerieRPS' % {"value" : encode_str_2_3(value), "lineno": lineno} )
result = False
return result
def validate_tpNumero(self, value):
result = True
# Validate type tpNumero, a restriction on xs:long.
if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
if not isinstance(value, int):
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (int)' % {"value": value, "lineno": lineno, })
return False
if not self.gds_validate_simple_patterns(
self.validate_tpNumero_patterns_, value):
self.gds_collector_.add_message('Value "%s" does not match xsd pattern restrictions: %s' % (encode_str_2_3(value), self.validate_tpNumero_patterns_, ))
result = False
return result
validate_tpNumero_patterns_ = [['^([0-9]{1,12})$']]
def hasContent_(self):
if (
self.InscricaoPrestador is not None or
self.SerieRPS is not None or
self.NumeroRPS is not None
):
return True
else:
return False
def export(self, outfile, level, namespaceprefix_='tipos:', namespacedef_='', name_='tpChaveRPS', pretty_print=True):
imported_ns_def_ = GenerateDSNamespaceDefs_.get('tpChaveRPS')
if imported_ns_def_ is not None:
namespacedef_ = imported_ns_def_
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None and name_ == 'tpChaveRPS':
name_ = self.original_tagname_
if UseCapturedNS_ and self.ns_prefix_:
namespaceprefix_ = self.ns_prefix_ + ':'
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='tpChaveRPS')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='tpChaveRPS', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='tipos:', name_='tpChaveRPS'):
pass
def exportChildren(self, outfile, level, namespaceprefix_='tipos:', namespacedef_='', name_='tpChaveRPS', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.InscricaoPrestador is not None:
namespaceprefix_ = self.InscricaoPrestador_nsprefix_ + ':' if (UseCapturedNS_ and self.InscricaoPrestador_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sInscricaoPrestador>%s</%sInscricaoPrestador>%s' % (namespaceprefix_ , self.gds_format_integer(self.InscricaoPrestador, input_name='InscricaoPrestador'), namespaceprefix_ , eol_))
if self.SerieRPS is not None:
namespaceprefix_ = self.SerieRPS_nsprefix_ + ':' if (UseCapturedNS_ and self.SerieRPS_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sSerieRPS>%s</%sSerieRPS>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.SerieRPS), input_name='SerieRPS')), namespaceprefix_ , eol_))
if self.NumeroRPS is not None:
namespaceprefix_ = self.NumeroRPS_nsprefix_ + ':' if (UseCapturedNS_ and self.NumeroRPS_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sNumeroRPS>%s</%sNumeroRPS>%s' % (namespaceprefix_ , self.gds_format_integer(self.NumeroRPS, input_name='NumeroRPS'), namespaceprefix_ , eol_))
def build(self, node, gds_collector_=None):
self.gds_collector_ = gds_collector_
if SaveElementTreeNode:
self.gds_elementtree_node_ = node
already_processed = set()
self.ns_prefix_ = node.prefix
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
return self
def buildAttributes(self, node, attrs, already_processed):
pass
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
if nodeName_ == 'InscricaoPrestador' and child_.text:
sval_ = child_.text
ival_ = self.gds_parse_integer(sval_, node, 'InscricaoPrestador')
ival_ = self.gds_validate_integer(ival_, node, 'InscricaoPrestador')
self.InscricaoPrestador = ival_
self.InscricaoPrestador_nsprefix_ = child_.prefix
# validate type tpInscricaoMunicipal
self.validate_tpInscricaoMunicipal(self.InscricaoPrestador)
elif nodeName_ == 'SerieRPS':
value_ = child_.text
value_ = self.gds_parse_string(value_, node, 'SerieRPS')
value_ = self.gds_validate_string(value_, node, 'SerieRPS')
self.SerieRPS = value_
self.SerieRPS_nsprefix_ = child_.prefix
# validate type tpSerieRPS
self.validate_tpSerieRPS(self.SerieRPS)
elif nodeName_ == 'NumeroRPS' and child_.text:
sval_ = child_.text
ival_ = self.gds_parse_integer(sval_, node, 'NumeroRPS')
ival_ = self.gds_validate_integer(ival_, node, 'NumeroRPS')
self.NumeroRPS = ival_
self.NumeroRPS_nsprefix_ = child_.prefix
# validate type tpNumero
self.validate_tpNumero(self.NumeroRPS)
# end class tpChaveRPS
class tpEndereco(GeneratedsSuper):
"""Tipo Endereço."""
__hash__ = GeneratedsSuper.__hash__
member_data_items_ = [
MemberSpec_('TipoLogradouro', ['tpTipoLogradouro', 'xs:string'], 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'TipoLogradouro', 'type': 'xs:string'}, None),
MemberSpec_('Logradouro', ['tpLogradouro', 'xs:string'], 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'Logradouro', 'type': 'xs:string'}, None),
MemberSpec_('NumeroEndereco', ['tpNumeroEndereco', 'xs:string'], 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'NumeroEndereco', 'type': 'xs:string'}, None),
MemberSpec_('ComplementoEndereco', ['tpComplementoEndereco', 'xs:string'], 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'ComplementoEndereco', 'type': 'xs:string'}, None),
MemberSpec_('Bairro', ['tpBairro', 'xs:string'], 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'Bairro', 'type': 'xs:string'}, None),
MemberSpec_('Cidade', ['tpCidade', 'xs:int'], 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'Cidade', 'type': 'xs:int'}, None),
MemberSpec_('UF', ['tpUF', 'xs:string'], 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'UF', 'type': 'xs:string'}, None),
MemberSpec_('CEP', ['tpCEP', 'xs:int'], 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'CEP', 'type': 'xs:int'}, None),
]
subclass = None
superclass = None
def __init__(self, TipoLogradouro=None, Logradouro=None, NumeroEndereco=None, ComplementoEndereco=None, Bairro=None, Cidade=None, UF=None, CEP=None, gds_collector_=None, **kwargs_):
self.gds_collector_ = gds_collector_
self.gds_elementtree_node_ = None
self.original_tagname_ = None
self.parent_object_ = kwargs_.get('parent_object_')
self.ns_prefix_ = None
self.TipoLogradouro = TipoLogradouro
self.validate_tpTipoLogradouro(self.TipoLogradouro)
self.TipoLogradouro_nsprefix_ = None
self.Logradouro = Logradouro
self.validate_tpLogradouro(self.Logradouro)
self.Logradouro_nsprefix_ = None
self.NumeroEndereco = NumeroEndereco
self.validate_tpNumeroEndereco(self.NumeroEndereco)
self.NumeroEndereco_nsprefix_ = None
self.ComplementoEndereco = ComplementoEndereco
self.validate_tpComplementoEndereco(self.ComplementoEndereco)
self.ComplementoEndereco_nsprefix_ = None
self.Bairro = Bairro
self.validate_tpBairro(self.Bairro)
self.Bairro_nsprefix_ = None
self.Cidade = Cidade
self.validate_tpCidade(self.Cidade)
self.Cidade_nsprefix_ = None
self.UF = UF
self.validate_tpUF(self.UF)
self.UF_nsprefix_ = None
self.CEP = CEP
self.validate_tpCEP(self.CEP)
self.CEP_nsprefix_ = None
def factory(*args_, **kwargs_):
if CurrentSubclassModule_ is not None:
subclass = getSubclassFromModule_(
CurrentSubclassModule_, tpEndereco)
if subclass is not None:
return subclass(*args_, **kwargs_)
if tpEndereco.subclass:
return tpEndereco.subclass(*args_, **kwargs_)
else:
return tpEndereco(*args_, **kwargs_)
factory = staticmethod(factory)
def validate_tpTipoLogradouro(self, value):
result = True
# Validate type tpTipoLogradouro, a restriction on xs:string.
if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
if not isinstance(value, str):
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' % {"value": value, "lineno": lineno, })
return False
if len(value) > 3:
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd maxLength restriction on tpTipoLogradouro' % {"value" : encode_str_2_3(value), "lineno": lineno} )
result = False
if len(value) < 0:
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd minLength restriction on tpTipoLogradouro' % {"value" : encode_str_2_3(value), "lineno": lineno} )
result = False
return result
def validate_tpLogradouro(self, value):
result = True
# Validate type tpLogradouro, a restriction on xs:string.
if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
if not isinstance(value, str):
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' % {"value": value, "lineno": lineno, })
return False
if len(value) > 50:
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd maxLength restriction on tpLogradouro' % {"value" : encode_str_2_3(value), "lineno": lineno} )
result = False
if len(value) < 0:
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd minLength restriction on tpLogradouro' % {"value" : encode_str_2_3(value), "lineno": lineno} )
result = False
return result
def validate_tpNumeroEndereco(self, value):
result = True
# Validate type tpNumeroEndereco, a restriction on xs:string.
if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
if not isinstance(value, str):
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' % {"value": value, "lineno": lineno, })
return False
if len(value) > 10:
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd maxLength restriction on tpNumeroEndereco' % {"value" : encode_str_2_3(value), "lineno": lineno} )
result = False
if len(value) < 0:
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd minLength restriction on tpNumeroEndereco' % {"value" : encode_str_2_3(value), "lineno": lineno} )
result = False
return result
def validate_tpComplementoEndereco(self, value):
result = True
# Validate type tpComplementoEndereco, a restriction on xs:string.
if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
if not isinstance(value, str):
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' % {"value": value, "lineno": lineno, })
return False
if len(value) > 30:
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd maxLength restriction on tpComplementoEndereco' % {"value" : encode_str_2_3(value), "lineno": lineno} )
result = False
if len(value) < 0:
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd minLength restriction on tpComplementoEndereco' % {"value" : encode_str_2_3(value), "lineno": lineno} )
result = False
return result
def validate_tpBairro(self, value):
result = True
# Validate type tpBairro, a restriction on xs:string.
if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
if not isinstance(value, str):
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' % {"value": value, "lineno": lineno, })
return False
if len(value) > 30:
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd maxLength restriction on tpBairro' % {"value" : encode_str_2_3(value), "lineno": lineno} )
result = False
if len(value) < 0:
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd minLength restriction on tpBairro' % {"value" : encode_str_2_3(value), "lineno": lineno} )
result = False
return result
def validate_tpCidade(self, value):
result = True
# Validate type tpCidade, a restriction on xs:int.
if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
if not isinstance(value, int):
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (int)' % {"value": value, "lineno": lineno, })
return False
if not self.gds_validate_simple_patterns(
self.validate_tpCidade_patterns_, value):
self.gds_collector_.add_message('Value "%s" does not match xsd pattern restrictions: %s' % (encode_str_2_3(value), self.validate_tpCidade_patterns_, ))
result = False
return result
validate_tpCidade_patterns_ = [['^([0-9]{7})$']]
def validate_tpUF(self, value):
result = True
# Validate type tpUF, a restriction on xs:string.
if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
if not isinstance(value, str):
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' % {"value": value, "lineno": lineno, })
return False
if len(value) > 2:
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd maxLength restriction on tpUF' % {"value" : encode_str_2_3(value), "lineno": lineno} )
result = False
if len(value) < 2:
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd minLength restriction on tpUF' % {"value" : encode_str_2_3(value), "lineno": lineno} )
result = False
return result
def validate_tpCEP(self, value):
result = True
# Validate type tpCEP, a restriction on xs:int.
if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
if not isinstance(value, int):
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (int)' % {"value": value, "lineno": lineno, })
return False
if not self.gds_validate_simple_patterns(
self.validate_tpCEP_patterns_, value):
self.gds_collector_.add_message('Value "%s" does not match xsd pattern restrictions: %s' % (encode_str_2_3(value), self.validate_tpCEP_patterns_, ))
result = False
return result
validate_tpCEP_patterns_ = [['^([0-9]{7,8})$']]
def hasContent_(self):
if (
self.TipoLogradouro is not None or
self.Logradouro is not None or
self.NumeroEndereco is not None or
self.ComplementoEndereco is not None or
self.Bairro is not None or
self.Cidade is not None or
self.UF is not None or
self.CEP is not None
):
return True
else:
return False
def export(self, outfile, level, namespaceprefix_='tipos:', namespacedef_='', name_='tpEndereco', pretty_print=True):
imported_ns_def_ = GenerateDSNamespaceDefs_.get('tpEndereco')
if imported_ns_def_ is not None:
namespacedef_ = imported_ns_def_
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None and name_ == 'tpEndereco':
name_ = self.original_tagname_
if UseCapturedNS_ and self.ns_prefix_:
namespaceprefix_ = self.ns_prefix_ + ':'
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='tpEndereco')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='tpEndereco', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='tipos:', name_='tpEndereco'):
pass
def exportChildren(self, outfile, level, namespaceprefix_='tipos:', namespacedef_='', name_='tpEndereco', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.TipoLogradouro is not None:
namespaceprefix_ = self.TipoLogradouro_nsprefix_ + ':' if (UseCapturedNS_ and self.TipoLogradouro_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sTipoLogradouro>%s</%sTipoLogradouro>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.TipoLogradouro), input_name='TipoLogradouro')), namespaceprefix_ , eol_))
if self.Logradouro is not None:
namespaceprefix_ = self.Logradouro_nsprefix_ + ':' if (UseCapturedNS_ and self.Logradouro_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sLogradouro>%s</%sLogradouro>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.Logradouro), input_name='Logradouro')), namespaceprefix_ , eol_))
if self.NumeroEndereco is not None:
namespaceprefix_ = self.NumeroEndereco_nsprefix_ + ':' if (UseCapturedNS_ and self.NumeroEndereco_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sNumeroEndereco>%s</%sNumeroEndereco>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.NumeroEndereco), input_name='NumeroEndereco')), namespaceprefix_ , eol_))
if self.ComplementoEndereco is not None:
namespaceprefix_ = self.ComplementoEndereco_nsprefix_ + ':' if (UseCapturedNS_ and self.ComplementoEndereco_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sComplementoEndereco>%s</%sComplementoEndereco>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.ComplementoEndereco), input_name='ComplementoEndereco')), namespaceprefix_ , eol_))
if self.Bairro is not None:
namespaceprefix_ = self.Bairro_nsprefix_ + ':' if (UseCapturedNS_ and self.Bairro_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sBairro>%s</%sBairro>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.Bairro), input_name='Bairro')), namespaceprefix_ , eol_))
if self.Cidade is not None:
namespaceprefix_ = self.Cidade_nsprefix_ + ':' if (UseCapturedNS_ and self.Cidade_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sCidade>%s</%sCidade>%s' % (namespaceprefix_ , self.gds_format_integer(self.Cidade, input_name='Cidade'), namespaceprefix_ , eol_))
if self.UF is not None:
namespaceprefix_ = self.UF_nsprefix_ + ':' if (UseCapturedNS_ and self.UF_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sUF>%s</%sUF>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.UF), input_name='UF')), namespaceprefix_ , eol_))
if self.CEP is not None:
namespaceprefix_ = self.CEP_nsprefix_ + ':' if (UseCapturedNS_ and self.CEP_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sCEP>%s</%sCEP>%s' % (namespaceprefix_ , self.gds_format_integer(self.CEP, input_name='CEP'), namespaceprefix_ , eol_))
def build(self, node, gds_collector_=None):
self.gds_collector_ = gds_collector_
if SaveElementTreeNode:
self.gds_elementtree_node_ = node
already_processed = set()
self.ns_prefix_ = node.prefix
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
return self
def buildAttributes(self, node, attrs, already_processed):
pass
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
if nodeName_ == 'TipoLogradouro':
value_ = child_.text
value_ = self.gds_parse_string(value_, node, 'TipoLogradouro')
value_ = self.gds_validate_string(value_, node, 'TipoLogradouro')
self.TipoLogradouro = value_
self.TipoLogradouro_nsprefix_ = child_.prefix
# validate type tpTipoLogradouro
self.validate_tpTipoLogradouro(self.TipoLogradouro)
elif nodeName_ == 'Logradouro':
value_ = child_.text
value_ = self.gds_parse_string(value_, node, 'Logradouro')
value_ = self.gds_validate_string(value_, node, 'Logradouro')
self.Logradouro = value_
self.Logradouro_nsprefix_ = child_.prefix
# validate type tpLogradouro
self.validate_tpLogradouro(self.Logradouro)
elif nodeName_ == 'NumeroEndereco':
value_ = child_.text
value_ = self.gds_parse_string(value_, node, 'NumeroEndereco')
value_ = self.gds_validate_string(value_, node, 'NumeroEndereco')
self.NumeroEndereco = value_
self.NumeroEndereco_nsprefix_ = child_.prefix
# validate type tpNumeroEndereco
self.validate_tpNumeroEndereco(self.NumeroEndereco)
elif nodeName_ == 'ComplementoEndereco':
value_ = child_.text
value_ = self.gds_parse_string(value_, node, 'ComplementoEndereco')
value_ = self.gds_validate_string(value_, node, 'ComplementoEndereco')
self.ComplementoEndereco = value_
self.ComplementoEndereco_nsprefix_ = child_.prefix
# validate type tpComplementoEndereco
self.validate_tpComplementoEndereco(self.ComplementoEndereco)
elif nodeName_ == 'Bairro':
value_ = child_.text
value_ = self.gds_parse_string(value_, node, 'Bairro')
value_ = self.gds_validate_string(value_, node, 'Bairro')
self.Bairro = value_
self.Bairro_nsprefix_ = child_.prefix
# validate type tpBairro
self.validate_tpBairro(self.Bairro)
elif nodeName_ == 'Cidade' and child_.text:
sval_ = child_.text
ival_ = self.gds_parse_integer(sval_, node, 'Cidade')
ival_ = self.gds_validate_integer(ival_, node, 'Cidade')
self.Cidade = ival_
self.Cidade_nsprefix_ = child_.prefix
# validate type tpCidade
self.validate_tpCidade(self.Cidade)
elif nodeName_ == 'UF':
value_ = child_.text
value_ = self.gds_parse_string(value_, node, 'UF')
value_ = self.gds_validate_string(value_, node, 'UF')
self.UF = value_
self.UF_nsprefix_ = child_.prefix
# validate type tpUF
self.validate_tpUF(self.UF)
elif nodeName_ == 'CEP' and child_.text:
sval_ = child_.text
ival_ = self.gds_parse_integer(sval_, node, 'CEP')
ival_ = self.gds_validate_integer(ival_, node, 'CEP')
self.CEP = ival_
self.CEP_nsprefix_ = child_.prefix
# validate type tpCEP
self.validate_tpCEP(self.CEP)
# end class tpEndereco
class tpInformacoesLote(GeneratedsSuper):
"""Informações do lote processado."""
__hash__ = GeneratedsSuper.__hash__
member_data_items_ = [
MemberSpec_('NumeroLote', ['tpNumero', 'xs:long'], 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'NumeroLote', 'type': 'xs:long'}, None),
MemberSpec_('InscricaoPrestador', ['tpInscricaoMunicipal', 'xs:long'], 0, 0, {'maxOccurs': '1', 'minOccurs': '1', 'name': 'InscricaoPrestador', 'type': 'xs:long'}, None),
MemberSpec_('CPFCNPJRemetente', 'tpCPFCNPJ', 0, 0, {'maxOccurs': '1', 'minOccurs': '1', 'name': 'CPFCNPJRemetente', 'type': 'tpCPFCNPJ'}, None),
MemberSpec_('DataEnvioLote', 'xs:dateTime', 0, 0, {'maxOccurs': '1', 'minOccurs': '1', 'name': 'DataEnvioLote', 'type': 'xs:dateTime'}, None),
MemberSpec_('QtdNotasProcessadas', ['tpQuantidade', 'xs:long'], 0, 0, {'maxOccurs': '1', 'minOccurs': '1', 'name': 'QtdNotasProcessadas', 'type': 'xs:long'}, None),
MemberSpec_('TempoProcessamento', ['tpTempoProcessamento', 'xs:long'], 0, 0, {'maxOccurs': '1', 'minOccurs': '1', 'name': 'TempoProcessamento', 'type': 'xs:long'}, None),
MemberSpec_('ValorTotalServicos', ['tpValor', 'xs:decimal'], 0, 0, {'maxOccurs': '1', 'minOccurs': '1', 'name': 'ValorTotalServicos', 'type': 'xs:decimal'}, None),
MemberSpec_('ValorTotalDeducoes', ['tpValor', 'xs:decimal'], 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'ValorTotalDeducoes', 'type': 'xs:decimal'}, None),
]
subclass = None
superclass = None
def __init__(self, NumeroLote=None, InscricaoPrestador=None, CPFCNPJRemetente=None, DataEnvioLote=None, QtdNotasProcessadas=None, TempoProcessamento=None, ValorTotalServicos=None, ValorTotalDeducoes=None, gds_collector_=None, **kwargs_):
self.gds_collector_ = gds_collector_
self.gds_elementtree_node_ = None
self.original_tagname_ = None
self.parent_object_ = kwargs_.get('parent_object_')
self.ns_prefix_ = None
self.NumeroLote = NumeroLote
self.validate_tpNumero(self.NumeroLote)
self.NumeroLote_nsprefix_ = None
self.InscricaoPrestador = InscricaoPrestador
self.validate_tpInscricaoMunicipal(self.InscricaoPrestador)
self.InscricaoPrestador_nsprefix_ = None
self.CPFCNPJRemetente = CPFCNPJRemetente
self.CPFCNPJRemetente_nsprefix_ = None
if isinstance(DataEnvioLote, BaseStrType_):
initvalue_ = datetime_.datetime.strptime(DataEnvioLote, '%Y-%m-%dT%H:%M:%S')
else:
initvalue_ = DataEnvioLote
self.DataEnvioLote = initvalue_
self.DataEnvioLote_nsprefix_ = None
self.QtdNotasProcessadas = QtdNotasProcessadas
self.validate_tpQuantidade(self.QtdNotasProcessadas)
self.QtdNotasProcessadas_nsprefix_ = None
self.TempoProcessamento = TempoProcessamento
self.validate_tpTempoProcessamento(self.TempoProcessamento)
self.TempoProcessamento_nsprefix_ = None
self.ValorTotalServicos = ValorTotalServicos
self.validate_tpValor(self.ValorTotalServicos)
self.ValorTotalServicos_nsprefix_ = None
self.ValorTotalDeducoes = ValorTotalDeducoes
self.validate_tpValor(self.ValorTotalDeducoes)
self.ValorTotalDeducoes_nsprefix_ = None
def factory(*args_, **kwargs_):
if CurrentSubclassModule_ is not None:
subclass = getSubclassFromModule_(
CurrentSubclassModule_, tpInformacoesLote)
if subclass is not None:
return subclass(*args_, **kwargs_)
if tpInformacoesLote.subclass:
return tpInformacoesLote.subclass(*args_, **kwargs_)
else:
return tpInformacoesLote(*args_, **kwargs_)
factory = staticmethod(factory)
def validate_tpNumero(self, value):
result = True
# Validate type tpNumero, a restriction on xs:long.
if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
if not isinstance(value, int):
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (int)' % {"value": value, "lineno": lineno, })
return False
if not self.gds_validate_simple_patterns(
self.validate_tpNumero_patterns_, value):
self.gds_collector_.add_message('Value "%s" does not match xsd pattern restrictions: %s' % (encode_str_2_3(value), self.validate_tpNumero_patterns_, ))
result = False
return result
validate_tpNumero_patterns_ = [['^([0-9]{1,12})$']]
def validate_tpInscricaoMunicipal(self, value):
result = True
# Validate type tpInscricaoMunicipal, a restriction on xs:long.
if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
if not isinstance(value, int):
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (int)' % {"value": value, "lineno": lineno, })
return False
if not self.gds_validate_simple_patterns(
self.validate_tpInscricaoMunicipal_patterns_, value):
self.gds_collector_.add_message('Value "%s" does not match xsd pattern restrictions: %s' % (encode_str_2_3(value), self.validate_tpInscricaoMunicipal_patterns_, ))
result = False
return result
validate_tpInscricaoMunicipal_patterns_ = [['^([0-9]{8,8})$']]
def validate_tpQuantidade(self, value):
result = True
# Validate type tpQuantidade, a restriction on xs:long.
if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
if not isinstance(value, int):
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (int)' % {"value": value, "lineno": lineno, })
return False
if not self.gds_validate_simple_patterns(
self.validate_tpQuantidade_patterns_, value):
self.gds_collector_.add_message('Value "%s" does not match xsd pattern restrictions: %s' % (encode_str_2_3(value), self.validate_tpQuantidade_patterns_, ))
result = False
return result
validate_tpQuantidade_patterns_ = [['^([0-9]{1,15})$']]
def validate_tpTempoProcessamento(self, value):
result = True
# Validate type tpTempoProcessamento, a restriction on xs:long.
if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
if not isinstance(value, int):
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (int)' % {"value": value, "lineno": lineno, })
return False
if not self.gds_validate_simple_patterns(
self.validate_tpTempoProcessamento_patterns_, value):
self.gds_collector_.add_message('Value "%s" does not match xsd pattern restrictions: %s' % (encode_str_2_3(value), self.validate_tpTempoProcessamento_patterns_, ))
result = False
return result
validate_tpTempoProcessamento_patterns_ = [['^([0-9]{1,15})$']]
def validate_tpValor(self, value):
result = True
# Validate type tpValor, a restriction on xs:decimal.
if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
if not isinstance(value, decimal_.Decimal):
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (decimal_.Decimal)' % {"value": value, "lineno": lineno, })
return False
if value < 0:
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd minInclusive restriction on tpValor' % {"value": value, "lineno": lineno} )
result = False
if len(str(value)) >= 15:
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd totalDigits restriction on tpValor' % {"value": value, "lineno": lineno} )
result = False
if not self.gds_validate_simple_patterns(
self.validate_tpValor_patterns_, value):
self.gds_collector_.add_message('Value "%s" does not match xsd pattern restrictions: %s' % (encode_str_2_3(value), self.validate_tpValor_patterns_, ))
result = False
return result
validate_tpValor_patterns_ = [['^(0|0\\.[0-9]{2}|[1-9]{1}[0-9]{0,12}(\\.[0-9]{0,2})?)$']]
def hasContent_(self):
if (
self.NumeroLote is not None or
self.InscricaoPrestador is not None or
self.CPFCNPJRemetente is not None or
self.DataEnvioLote is not None or
self.QtdNotasProcessadas is not None or
self.TempoProcessamento is not None or
self.ValorTotalServicos is not None or
self.ValorTotalDeducoes is not None
):
return True
else:
return False
def export(self, outfile, level, namespaceprefix_='tipos:', namespacedef_='', name_='tpInformacoesLote', pretty_print=True):
imported_ns_def_ = GenerateDSNamespaceDefs_.get('tpInformacoesLote')
if imported_ns_def_ is not None:
namespacedef_ = imported_ns_def_
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None and name_ == 'tpInformacoesLote':
name_ = self.original_tagname_
if UseCapturedNS_ and self.ns_prefix_:
namespaceprefix_ = self.ns_prefix_ + ':'
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='tpInformacoesLote')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='tpInformacoesLote', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='tipos:', name_='tpInformacoesLote'):
pass
def exportChildren(self, outfile, level, namespaceprefix_='tipos:', namespacedef_='', name_='tpInformacoesLote', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.NumeroLote is not None:
namespaceprefix_ = self.NumeroLote_nsprefix_ + ':' if (UseCapturedNS_ and self.NumeroLote_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sNumeroLote>%s</%sNumeroLote>%s' % (namespaceprefix_ , self.gds_format_integer(self.NumeroLote, input_name='NumeroLote'), namespaceprefix_ , eol_))
if self.InscricaoPrestador is not None:
namespaceprefix_ = self.InscricaoPrestador_nsprefix_ + ':' if (UseCapturedNS_ and self.InscricaoPrestador_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sInscricaoPrestador>%s</%sInscricaoPrestador>%s' % (namespaceprefix_ , self.gds_format_integer(self.InscricaoPrestador, input_name='InscricaoPrestador'), namespaceprefix_ , eol_))
if self.CPFCNPJRemetente is not None:
namespaceprefix_ = self.CPFCNPJRemetente_nsprefix_ + ':' if (UseCapturedNS_ and self.CPFCNPJRemetente_nsprefix_) else ''
self.CPFCNPJRemetente.export(outfile, level, namespaceprefix_, namespacedef_='', name_='CPFCNPJRemetente', pretty_print=pretty_print)
if self.DataEnvioLote is not None:
namespaceprefix_ = self.DataEnvioLote_nsprefix_ + ':' if (UseCapturedNS_ and self.DataEnvioLote_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sDataEnvioLote>%s</%sDataEnvioLote>%s' % (namespaceprefix_ , self.gds_format_datetime(self.DataEnvioLote, input_name='DataEnvioLote'), namespaceprefix_ , eol_))
if self.QtdNotasProcessadas is not None:
namespaceprefix_ = self.QtdNotasProcessadas_nsprefix_ + ':' if (UseCapturedNS_ and self.QtdNotasProcessadas_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sQtdNotasProcessadas>%s</%sQtdNotasProcessadas>%s' % (namespaceprefix_ , self.gds_format_integer(self.QtdNotasProcessadas, input_name='QtdNotasProcessadas'), namespaceprefix_ , eol_))
if self.TempoProcessamento is not None:
namespaceprefix_ = self.TempoProcessamento_nsprefix_ + ':' if (UseCapturedNS_ and self.TempoProcessamento_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sTempoProcessamento>%s</%sTempoProcessamento>%s' % (namespaceprefix_ , self.gds_format_integer(self.TempoProcessamento, input_name='TempoProcessamento'), namespaceprefix_ , eol_))
if self.ValorTotalServicos is not None:
namespaceprefix_ = self.ValorTotalServicos_nsprefix_ + ':' if (UseCapturedNS_ and self.ValorTotalServicos_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sValorTotalServicos>%s</%sValorTotalServicos>%s' % (namespaceprefix_ , self.gds_format_decimal(self.ValorTotalServicos, input_name='ValorTotalServicos'), namespaceprefix_ , eol_))
if self.ValorTotalDeducoes is not None:
namespaceprefix_ = self.ValorTotalDeducoes_nsprefix_ + ':' if (UseCapturedNS_ and self.ValorTotalDeducoes_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sValorTotalDeducoes>%s</%sValorTotalDeducoes>%s' % (namespaceprefix_ , self.gds_format_decimal(self.ValorTotalDeducoes, input_name='ValorTotalDeducoes'), namespaceprefix_ , eol_))
def build(self, node, gds_collector_=None):
self.gds_collector_ = gds_collector_
if SaveElementTreeNode:
self.gds_elementtree_node_ = node
already_processed = set()
self.ns_prefix_ = node.prefix
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
return self
def buildAttributes(self, node, attrs, already_processed):
pass
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
if nodeName_ == 'NumeroLote' and child_.text:
sval_ = child_.text
ival_ = self.gds_parse_integer(sval_, node, 'NumeroLote')
ival_ = self.gds_validate_integer(ival_, node, 'NumeroLote')
self.NumeroLote = ival_
self.NumeroLote_nsprefix_ = child_.prefix
# validate type tpNumero
self.validate_tpNumero(self.NumeroLote)
elif nodeName_ == 'InscricaoPrestador' and child_.text:
sval_ = child_.text
ival_ = self.gds_parse_integer(sval_, node, 'InscricaoPrestador')
ival_ = self.gds_validate_integer(ival_, node, 'InscricaoPrestador')
self.InscricaoPrestador = ival_
self.InscricaoPrestador_nsprefix_ = child_.prefix
# validate type tpInscricaoMunicipal
self.validate_tpInscricaoMunicipal(self.InscricaoPrestador)
elif nodeName_ == 'CPFCNPJRemetente':
obj_ = tpCPFCNPJ.factory(parent_object_=self)
obj_.build(child_, gds_collector_=gds_collector_)
self.CPFCNPJRemetente = obj_
obj_.original_tagname_ = 'CPFCNPJRemetente'
elif nodeName_ == 'DataEnvioLote':
sval_ = child_.text
dval_ = self.gds_parse_datetime(sval_)
self.DataEnvioLote = dval_
self.DataEnvioLote_nsprefix_ = child_.prefix
elif nodeName_ == 'QtdNotasProcessadas' and child_.text:
sval_ = child_.text
ival_ = self.gds_parse_integer(sval_, node, 'QtdNotasProcessadas')
ival_ = self.gds_validate_integer(ival_, node, 'QtdNotasProcessadas')
self.QtdNotasProcessadas = ival_
self.QtdNotasProcessadas_nsprefix_ = child_.prefix
# validate type tpQuantidade
self.validate_tpQuantidade(self.QtdNotasProcessadas)
elif nodeName_ == 'TempoProcessamento' and child_.text:
sval_ = child_.text
ival_ = self.gds_parse_integer(sval_, node, 'TempoProcessamento')
ival_ = self.gds_validate_integer(ival_, node, 'TempoProcessamento')
self.TempoProcessamento = ival_
self.TempoProcessamento_nsprefix_ = child_.prefix
# validate type tpTempoProcessamento
self.validate_tpTempoProcessamento(self.TempoProcessamento)
elif nodeName_ == 'ValorTotalServicos' and child_.text:
sval_ = child_.text
fval_ = self.gds_parse_decimal(sval_, node, 'ValorTotalServicos')
fval_ = self.gds_validate_decimal(fval_, node, 'ValorTotalServicos')
self.ValorTotalServicos = fval_
self.ValorTotalServicos_nsprefix_ = child_.prefix
# validate type tpValor
self.validate_tpValor(self.ValorTotalServicos)
elif nodeName_ == 'ValorTotalDeducoes' and child_.text:
sval_ = child_.text
fval_ = self.gds_parse_decimal(sval_, node, 'ValorTotalDeducoes')
fval_ = self.gds_validate_decimal(fval_, node, 'ValorTotalDeducoes')
self.ValorTotalDeducoes = fval_
self.ValorTotalDeducoes_nsprefix_ = child_.prefix
# validate type tpValor
self.validate_tpValor(self.ValorTotalDeducoes)
# end class tpInformacoesLote
class tpNFe(GeneratedsSuper):
"""Tipo que representa uma NFS-e"""
__hash__ = GeneratedsSuper.__hash__
member_data_items_ = [
MemberSpec_('Assinatura', ['tpAssinatura', 'xs:base64Binary'], 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'Assinatura', 'type': 'xs:base64Binary'}, None),
MemberSpec_('ChaveNFe', 'tpChaveNFe', 0, 0, {'maxOccurs': '1', 'minOccurs': '1', 'name': 'ChaveNFe', 'type': 'tpChaveNFe'}, None),
MemberSpec_('DataEmissaoNFe', 'xs:dateTime', 0, 0, {'maxOccurs': '1', 'minOccurs': '1', 'name': 'DataEmissaoNFe', 'type': 'xs:dateTime'}, None),
MemberSpec_('NumeroLote', ['tpNumero', 'xs:long'], 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'NumeroLote', 'type': 'xs:long'}, None),
MemberSpec_('ChaveRPS', 'tpChaveRPS', 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'ChaveRPS', 'type': 'tpChaveRPS'}, None),
MemberSpec_('TipoRPS', ['tpTipoRPS', 'xs:string'], 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'TipoRPS', 'type': 'xs:string'}, None),
MemberSpec_('DataEmissaoRPS', 'xs:date', 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'DataEmissaoRPS', 'type': 'xs:date'}, None),
MemberSpec_('CPFCNPJPrestador', 'tpCPFCNPJ', 0, 0, {'maxOccurs': '1', 'minOccurs': '1', 'name': 'CPFCNPJPrestador', 'type': 'tpCPFCNPJ'}, None),
MemberSpec_('RazaoSocialPrestador', ['tpRazaoSocial', 'xs:string'], 0, 0, {'maxOccurs': '1', 'minOccurs': '1', 'name': 'RazaoSocialPrestador', 'type': 'xs:string'}, None),
MemberSpec_('EnderecoPrestador', 'tpEndereco', 0, 0, {'maxOccurs': '1', 'minOccurs': '1', 'name': 'EnderecoPrestador', 'type': 'tpEndereco'}, None),
MemberSpec_('EmailPrestador', ['tpEmail', 'xs:string'], 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'EmailPrestador', 'type': 'xs:string'}, None),
MemberSpec_('StatusNFe', ['tpStatusNFe', 'xs:string'], 0, 0, {'maxOccurs': '1', 'minOccurs': '1', 'name': 'StatusNFe', 'type': 'xs:string'}, None),
MemberSpec_('DataCancelamento', 'xs:dateTime', 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'DataCancelamento', 'type': 'xs:dateTime'}, None),
MemberSpec_('TributacaoNFe', ['tpTributacaoNFe', 'xs:string'], 0, 0, {'maxOccurs': '1', 'minOccurs': '1', 'name': 'TributacaoNFe', 'type': 'xs:string'}, None),
MemberSpec_('OpcaoSimples', ['tpOpcaoSimples', 'xs:string'], 0, 0, {'maxOccurs': '1', 'minOccurs': '1', 'name': 'OpcaoSimples', 'type': 'xs:string'}, None),
MemberSpec_('NumeroGuia', ['tpNumero', 'xs:long'], 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'NumeroGuia', 'type': 'xs:long'}, None),
MemberSpec_('DataQuitacaoGuia', 'xs:date', 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'DataQuitacaoGuia', 'type': 'xs:date'}, None),
MemberSpec_('ValorServicos', ['tpValor', 'xs:decimal'], 0, 0, {'maxOccurs': '1', 'minOccurs': '1', 'name': 'ValorServicos', 'type': 'xs:decimal'}, None),
MemberSpec_('ValorDeducoes', ['tpValor', 'xs:decimal'], 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'ValorDeducoes', 'type': 'xs:decimal'}, None),
MemberSpec_('ValorPIS', ['tpValor', 'xs:decimal'], 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'ValorPIS', 'type': 'xs:decimal'}, None),
MemberSpec_('ValorCOFINS', ['tpValor', 'xs:decimal'], 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'ValorCOFINS', 'type': 'xs:decimal'}, None),
MemberSpec_('ValorINSS', ['tpValor', 'xs:decimal'], 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'ValorINSS', 'type': 'xs:decimal'}, None),
MemberSpec_('ValorIR', ['tpValor', 'xs:decimal'], 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'ValorIR', 'type': 'xs:decimal'}, None),
MemberSpec_('ValorCSLL', ['tpValor', 'xs:decimal'], 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'ValorCSLL', 'type': 'xs:decimal'}, None),
MemberSpec_('CodigoServico', ['tpCodigoServico', 'xs:int'], 0, 0, {'maxOccurs': '1', 'minOccurs': '1', 'name': 'CodigoServico', 'type': 'xs:int'}, None),
MemberSpec_('AliquotaServicos', ['tpAliquota', 'xs:decimal'], 0, 0, {'maxOccurs': '1', 'minOccurs': '1', 'name': 'AliquotaServicos', 'type': 'xs:decimal'}, None),
MemberSpec_('ValorISS', ['tpValor', 'xs:decimal'], 0, 0, {'maxOccurs': '1', 'minOccurs': '1', 'name': 'ValorISS', 'type': 'xs:decimal'}, None),
MemberSpec_('ValorCredito', ['tpValor', 'xs:decimal'], 0, 0, {'maxOccurs': '1', 'minOccurs': '1', 'name': 'ValorCredito', 'type': 'xs:decimal'}, None),
MemberSpec_('ISSRetido', 'xs:boolean', 0, 0, {'maxOccurs': '1', 'minOccurs': '1', 'name': 'ISSRetido', 'type': 'xs:boolean'}, None),
MemberSpec_('CPFCNPJTomador', 'tpCPFCNPJ', 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'CPFCNPJTomador', 'type': 'tpCPFCNPJ'}, None),
MemberSpec_('InscricaoMunicipalTomador', ['tpInscricaoMunicipal', 'xs:long'], 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'InscricaoMunicipalTomador', 'type': 'xs:long'}, None),
MemberSpec_('InscricaoEstadualTomador', ['tpInscricaoEstadual', 'xs:long'], 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'InscricaoEstadualTomador', 'type': 'xs:long'}, None),
MemberSpec_('RazaoSocialTomador', ['tpRazaoSocial', 'xs:string'], 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'RazaoSocialTomador', 'type': 'xs:string'}, None),
MemberSpec_('EnderecoTomador', 'tpEndereco', 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'EnderecoTomador', 'type': 'tpEndereco'}, None),
MemberSpec_('EmailTomador', ['tpEmail', 'xs:string'], 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'EmailTomador', 'type': 'xs:string'}, None),
MemberSpec_('CPFCNPJIntermediario', 'tpCPFCNPJ', 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'CPFCNPJIntermediario', 'type': 'tpCPFCNPJ'}, None),
MemberSpec_('InscricaoMunicipalIntermediario', ['tpInscricaoMunicipal', 'xs:long'], 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'InscricaoMunicipalIntermediario', 'type': 'xs:long'}, None),
MemberSpec_('ISSRetidoIntermediario', 'xs:string', 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'ISSRetidoIntermediario', 'type': 'xs:string'}, None),
MemberSpec_('EmailIntermediario', ['tpEmail', 'xs:string'], 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'EmailIntermediario', 'type': 'xs:string'}, None),
MemberSpec_('Discriminacao', ['tpDiscriminacao', 'xs:string'], 0, 0, {'maxOccurs': '1', 'minOccurs': '1', 'name': 'Discriminacao', 'type': 'xs:string'}, None),
MemberSpec_('ValorCargaTributaria', ['tpValor', 'xs:decimal'], 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'ValorCargaTributaria', 'type': 'xs:decimal'}, None),
MemberSpec_('PercentualCargaTributaria', ['tpPercentualCargaTributaria', 'xs:decimal'], 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'PercentualCargaTributaria', 'type': 'xs:decimal'}, None),
MemberSpec_('FonteCargaTributaria', ['tpFonteCargaTributaria', 'xs:string'], 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'FonteCargaTributaria', 'type': 'xs:string'}, None),
MemberSpec_('CodigoCEI', ['tpNumero', 'xs:long'], 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'CodigoCEI', 'type': 'xs:long'}, None),
MemberSpec_('MatriculaObra', ['tpNumero', 'xs:long'], 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'MatriculaObra', 'type': 'xs:long'}, None),
MemberSpec_('MunicipioPrestacao', ['tpCidade', 'xs:int'], 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'MunicipioPrestacao', 'type': 'xs:int'}, None),
MemberSpec_('NumeroEncapsulamento', ['tpNumero', 'xs:long'], 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'NumeroEncapsulamento', 'type': 'xs:long'}, None),
MemberSpec_('ValorTotalRecebido', ['tpValor', 'xs:decimal'], 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'ValorTotalRecebido', 'type': 'xs:decimal'}, None),
]
subclass = None
superclass = None
def __init__(self, Assinatura=None, ChaveNFe=None, DataEmissaoNFe=None, NumeroLote=None, ChaveRPS=None, TipoRPS=None, DataEmissaoRPS=None, CPFCNPJPrestador=None, RazaoSocialPrestador=None, EnderecoPrestador=None, EmailPrestador=None, StatusNFe=None, DataCancelamento=None, TributacaoNFe=None, OpcaoSimples=None, NumeroGuia=None, DataQuitacaoGuia=None, ValorServicos=None, ValorDeducoes=None, ValorPIS=None, ValorCOFINS=None, ValorINSS=None, ValorIR=None, ValorCSLL=None, CodigoServico=None, AliquotaServicos=None, ValorISS=None, ValorCredito=None, ISSRetido=None, CPFCNPJTomador=None, InscricaoMunicipalTomador=None, InscricaoEstadualTomador=None, RazaoSocialTomador=None, EnderecoTomador=None, EmailTomador=None, CPFCNPJIntermediario=None, InscricaoMunicipalIntermediario=None, ISSRetidoIntermediario=None, EmailIntermediario=None, Discriminacao=None, ValorCargaTributaria=None, PercentualCargaTributaria=None, FonteCargaTributaria=None, CodigoCEI=None, MatriculaObra=None, MunicipioPrestacao=None, NumeroEncapsulamento=None, ValorTotalRecebido=None, gds_collector_=None, **kwargs_):
self.gds_collector_ = gds_collector_
self.gds_elementtree_node_ = None
self.original_tagname_ = None
self.parent_object_ = kwargs_.get('parent_object_')
self.ns_prefix_ = None
self.Assinatura = Assinatura
self.validate_tpAssinatura(self.Assinatura)
self.Assinatura_nsprefix_ = None
self.ChaveNFe = ChaveNFe
self.ChaveNFe_nsprefix_ = None
if isinstance(DataEmissaoNFe, BaseStrType_):
initvalue_ = datetime_.datetime.strptime(DataEmissaoNFe, '%Y-%m-%dT%H:%M:%S')
else:
initvalue_ = DataEmissaoNFe
self.DataEmissaoNFe = initvalue_
self.DataEmissaoNFe_nsprefix_ = None
self.NumeroLote = NumeroLote
self.validate_tpNumero(self.NumeroLote)
self.NumeroLote_nsprefix_ = None
self.ChaveRPS = ChaveRPS
self.ChaveRPS_nsprefix_ = None
self.TipoRPS = TipoRPS
self.validate_tpTipoRPS(self.TipoRPS)
self.TipoRPS_nsprefix_ = None
if isinstance(DataEmissaoRPS, BaseStrType_):
initvalue_ = datetime_.datetime.strptime(DataEmissaoRPS, '%Y-%m-%d').date()
else:
initvalue_ = DataEmissaoRPS
self.DataEmissaoRPS = initvalue_
self.DataEmissaoRPS_nsprefix_ = None
self.CPFCNPJPrestador = CPFCNPJPrestador
self.CPFCNPJPrestador_nsprefix_ = None
self.RazaoSocialPrestador = RazaoSocialPrestador
self.validate_tpRazaoSocial(self.RazaoSocialPrestador)
self.RazaoSocialPrestador_nsprefix_ = None
self.EnderecoPrestador = EnderecoPrestador
self.EnderecoPrestador_nsprefix_ = None
self.EmailPrestador = EmailPrestador
self.validate_tpEmail(self.EmailPrestador)
self.EmailPrestador_nsprefix_ = None
self.StatusNFe = StatusNFe
self.validate_tpStatusNFe(self.StatusNFe)
self.StatusNFe_nsprefix_ = None
if isinstance(DataCancelamento, BaseStrType_):
initvalue_ = datetime_.datetime.strptime(DataCancelamento, '%Y-%m-%dT%H:%M:%S')
else:
initvalue_ = DataCancelamento
self.DataCancelamento = initvalue_
self.DataCancelamento_nsprefix_ = None
self.TributacaoNFe = TributacaoNFe
self.validate_tpTributacaoNFe(self.TributacaoNFe)
self.TributacaoNFe_nsprefix_ = None
self.OpcaoSimples = OpcaoSimples
self.validate_tpOpcaoSimples(self.OpcaoSimples)
self.OpcaoSimples_nsprefix_ = None
self.NumeroGuia = NumeroGuia
self.validate_tpNumero(self.NumeroGuia)
self.NumeroGuia_nsprefix_ = None
if isinstance(DataQuitacaoGuia, BaseStrType_):
initvalue_ = datetime_.datetime.strptime(DataQuitacaoGuia, '%Y-%m-%d').date()
else:
initvalue_ = DataQuitacaoGuia
self.DataQuitacaoGuia = initvalue_
self.DataQuitacaoGuia_nsprefix_ = None
self.ValorServicos = ValorServicos
self.validate_tpValor(self.ValorServicos)
self.ValorServicos_nsprefix_ = None
self.ValorDeducoes = ValorDeducoes
self.validate_tpValor(self.ValorDeducoes)
self.ValorDeducoes_nsprefix_ = None
self.ValorPIS = ValorPIS
self.validate_tpValor(self.ValorPIS)
self.ValorPIS_nsprefix_ = None
self.ValorCOFINS = ValorCOFINS
self.validate_tpValor(self.ValorCOFINS)
self.ValorCOFINS_nsprefix_ = None
self.ValorINSS = ValorINSS
self.validate_tpValor(self.ValorINSS)
self.ValorINSS_nsprefix_ = None
self.ValorIR = ValorIR
self.validate_tpValor(self.ValorIR)
self.ValorIR_nsprefix_ = None
self.ValorCSLL = ValorCSLL
self.validate_tpValor(self.ValorCSLL)
self.ValorCSLL_nsprefix_ = None
self.CodigoServico = CodigoServico
self.validate_tpCodigoServico(self.CodigoServico)
self.CodigoServico_nsprefix_ = None
self.AliquotaServicos = AliquotaServicos
self.validate_tpAliquota(self.AliquotaServicos)
self.AliquotaServicos_nsprefix_ = None
self.ValorISS = ValorISS
self.validate_tpValor(self.ValorISS)
self.ValorISS_nsprefix_ = None
self.ValorCredito = ValorCredito
self.validate_tpValor(self.ValorCredito)
self.ValorCredito_nsprefix_ = None
self.ISSRetido = ISSRetido
self.ISSRetido_nsprefix_ = None
self.CPFCNPJTomador = CPFCNPJTomador
self.CPFCNPJTomador_nsprefix_ = None
self.InscricaoMunicipalTomador = InscricaoMunicipalTomador
self.validate_tpInscricaoMunicipal(self.InscricaoMunicipalTomador)
self.InscricaoMunicipalTomador_nsprefix_ = None
self.InscricaoEstadualTomador = InscricaoEstadualTomador
self.validate_tpInscricaoEstadual(self.InscricaoEstadualTomador)
self.InscricaoEstadualTomador_nsprefix_ = None
self.RazaoSocialTomador = RazaoSocialTomador
self.validate_tpRazaoSocial(self.RazaoSocialTomador)
self.RazaoSocialTomador_nsprefix_ = None
self.EnderecoTomador = EnderecoTomador
self.EnderecoTomador_nsprefix_ = None
self.EmailTomador = EmailTomador
self.validate_tpEmail(self.EmailTomador)
self.EmailTomador_nsprefix_ = None
self.CPFCNPJIntermediario = CPFCNPJIntermediario
self.CPFCNPJIntermediario_nsprefix_ = None
self.InscricaoMunicipalIntermediario = InscricaoMunicipalIntermediario
self.validate_tpInscricaoMunicipal(self.InscricaoMunicipalIntermediario)
self.InscricaoMunicipalIntermediario_nsprefix_ = None
self.ISSRetidoIntermediario = ISSRetidoIntermediario
self.ISSRetidoIntermediario_nsprefix_ = None
self.EmailIntermediario = EmailIntermediario
self.validate_tpEmail(self.EmailIntermediario)
self.EmailIntermediario_nsprefix_ = None
self.Discriminacao = Discriminacao
self.validate_tpDiscriminacao(self.Discriminacao)
self.Discriminacao_nsprefix_ = None
self.ValorCargaTributaria = ValorCargaTributaria
self.validate_tpValor(self.ValorCargaTributaria)
self.ValorCargaTributaria_nsprefix_ = None
self.PercentualCargaTributaria = PercentualCargaTributaria
self.validate_tpPercentualCargaTributaria(self.PercentualCargaTributaria)
self.PercentualCargaTributaria_nsprefix_ = None
self.FonteCargaTributaria = FonteCargaTributaria
self.validate_tpFonteCargaTributaria(self.FonteCargaTributaria)
self.FonteCargaTributaria_nsprefix_ = None
self.CodigoCEI = CodigoCEI
self.validate_tpNumero(self.CodigoCEI)
self.CodigoCEI_nsprefix_ = None
self.MatriculaObra = MatriculaObra
self.validate_tpNumero(self.MatriculaObra)
self.MatriculaObra_nsprefix_ = None
self.MunicipioPrestacao = MunicipioPrestacao
self.validate_tpCidade(self.MunicipioPrestacao)
self.MunicipioPrestacao_nsprefix_ = None
self.NumeroEncapsulamento = NumeroEncapsulamento
self.validate_tpNumero(self.NumeroEncapsulamento)
self.NumeroEncapsulamento_nsprefix_ = None
self.ValorTotalRecebido = ValorTotalRecebido
self.validate_tpValor(self.ValorTotalRecebido)
self.ValorTotalRecebido_nsprefix_ = None
def factory(*args_, **kwargs_):
if CurrentSubclassModule_ is not None:
subclass = getSubclassFromModule_(
CurrentSubclassModule_, tpNFe)
if subclass is not None:
return subclass(*args_, **kwargs_)
if tpNFe.subclass:
return tpNFe.subclass(*args_, **kwargs_)
else:
return tpNFe(*args_, **kwargs_)
factory = staticmethod(factory)
def validate_tpAssinatura(self, value):
result = True
# Validate type tpAssinatura, a restriction on xs:base64Binary.
if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
pass
return result
def validate_tpNumero(self, value):
result = True
# Validate type tpNumero, a restriction on xs:long.
if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
if not isinstance(value, int):
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (int)' % {"value": value, "lineno": lineno, })
return False
if not self.gds_validate_simple_patterns(
self.validate_tpNumero_patterns_, value):
self.gds_collector_.add_message('Value "%s" does not match xsd pattern restrictions: %s' % (encode_str_2_3(value), self.validate_tpNumero_patterns_, ))
result = False
return result
validate_tpNumero_patterns_ = [['^([0-9]{1,12})$']]
def validate_tpTipoRPS(self, value):
result = True
# Validate type tpTipoRPS, a restriction on xs:string.
if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
if not isinstance(value, str):
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' % {"value": value, "lineno": lineno, })
return False
value = value
enumerations = ['RPS', 'RPS-M', 'RPS-C']
if value not in enumerations:
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd enumeration restriction on tpTipoRPS' % {"value" : encode_str_2_3(value), "lineno": lineno} )
result = False
return result
def validate_tpRazaoSocial(self, value):
result = True
# Validate type tpRazaoSocial, a restriction on xs:string.
if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
if not isinstance(value, str):
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' % {"value": value, "lineno": lineno, })
return False
if len(value) > 75:
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd maxLength restriction on tpRazaoSocial' % {"value" : encode_str_2_3(value), "lineno": lineno} )
result = False
if len(value) < 0:
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd minLength restriction on tpRazaoSocial' % {"value" : encode_str_2_3(value), "lineno": lineno} )
result = False
return result
def validate_tpEmail(self, value):
result = True
# Validate type tpEmail, a restriction on xs:string.
if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
if not isinstance(value, str):
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' % {"value": value, "lineno": lineno, })
return False
if len(value) > 75:
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd maxLength restriction on tpEmail' % {"value" : encode_str_2_3(value), "lineno": lineno} )
result = False
if len(value) < 0:
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd minLength restriction on tpEmail' % {"value" : encode_str_2_3(value), "lineno": lineno} )
result = False
return result
def validate_tpStatusNFe(self, value):
result = True
# Validate type tpStatusNFe, a restriction on xs:string.
if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
if not isinstance(value, str):
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' % {"value": value, "lineno": lineno, })
return False
value = value
enumerations = ['N', 'C', 'E']
if value not in enumerations:
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd enumeration restriction on tpStatusNFe' % {"value" : encode_str_2_3(value), "lineno": lineno} )
result = False
return result
def validate_tpTributacaoNFe(self, value):
result = True
# Validate type tpTributacaoNFe, a restriction on xs:string.
if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
if not isinstance(value, str):
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' % {"value": value, "lineno": lineno, })
return False
if len(value) > 1:
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd maxLength restriction on tpTributacaoNFe' % {"value" : encode_str_2_3(value), "lineno": lineno} )
result = False
if len(value) < 1:
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd minLength restriction on tpTributacaoNFe' % {"value" : encode_str_2_3(value), "lineno": lineno} )
result = False
return result
def validate_tpOpcaoSimples(self, value):
result = True
# Validate type tpOpcaoSimples, a restriction on xs:string.
if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
if not isinstance(value, str):
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' % {"value": value, "lineno": lineno, })
return False
value = value
enumerations = ['0', '1', '2', '3']
if value not in enumerations:
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd enumeration restriction on tpOpcaoSimples' % {"value" : encode_str_2_3(value), "lineno": lineno} )
result = False
return result
def validate_tpValor(self, value):
result = True
# Validate type tpValor, a restriction on xs:decimal.
if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
if not isinstance(value, decimal_.Decimal):
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (decimal_.Decimal)' % {"value": value, "lineno": lineno, })
return False
if value < 0:
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd minInclusive restriction on tpValor' % {"value": value, "lineno": lineno} )
result = False
if len(str(value)) >= 15:
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd totalDigits restriction on tpValor' % {"value": value, "lineno": lineno} )
result = False
if not self.gds_validate_simple_patterns(
self.validate_tpValor_patterns_, value):
self.gds_collector_.add_message('Value "%s" does not match xsd pattern restrictions: %s' % (encode_str_2_3(value), self.validate_tpValor_patterns_, ))
result = False
return result
validate_tpValor_patterns_ = [['^(0|0\\.[0-9]{2}|[1-9]{1}[0-9]{0,12}(\\.[0-9]{0,2})?)$']]
def validate_tpCodigoServico(self, value):
result = True
# Validate type tpCodigoServico, a restriction on xs:int.
if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
if not isinstance(value, int):
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (int)' % {"value": value, "lineno": lineno, })
return False
if not self.gds_validate_simple_patterns(
self.validate_tpCodigoServico_patterns_, value):
self.gds_collector_.add_message('Value "%s" does not match xsd pattern restrictions: %s' % (encode_str_2_3(value), self.validate_tpCodigoServico_patterns_, ))
result = False
return result
validate_tpCodigoServico_patterns_ = [['^([0-9]{4,5})$']]
def validate_tpAliquota(self, value):
result = True
# Validate type tpAliquota, a restriction on xs:decimal.
if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
if not isinstance(value, decimal_.Decimal):
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (decimal_.Decimal)' % {"value": value, "lineno": lineno, })
return False
if value < 0:
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd minInclusive restriction on tpAliquota' % {"value": value, "lineno": lineno} )
result = False
if len(str(value)) >= 5:
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd totalDigits restriction on tpAliquota' % {"value": value, "lineno": lineno} )
result = False
return result
def validate_tpInscricaoMunicipal(self, value):
result = True
# Validate type tpInscricaoMunicipal, a restriction on xs:long.
if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
if not isinstance(value, int):
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (int)' % {"value": value, "lineno": lineno, })
return False
if not self.gds_validate_simple_patterns(
self.validate_tpInscricaoMunicipal_patterns_, value):
self.gds_collector_.add_message('Value "%s" does not match xsd pattern restrictions: %s' % (encode_str_2_3(value), self.validate_tpInscricaoMunicipal_patterns_, ))
result = False
return result
validate_tpInscricaoMunicipal_patterns_ = [['^([0-9]{8,8})$']]
def validate_tpInscricaoEstadual(self, value):
result = True
# Validate type tpInscricaoEstadual, a restriction on xs:long.
if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
if not isinstance(value, int):
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (int)' % {"value": value, "lineno": lineno, })
return False
if not self.gds_validate_simple_patterns(
self.validate_tpInscricaoEstadual_patterns_, value):
self.gds_collector_.add_message('Value "%s" does not match xsd pattern restrictions: %s' % (encode_str_2_3(value), self.validate_tpInscricaoEstadual_patterns_, ))
result = False
return result
validate_tpInscricaoEstadual_patterns_ = [['^([0-9]{1,19})$']]
def validate_tpDiscriminacao(self, value):
result = True
# Validate type tpDiscriminacao, a restriction on xs:string.
if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
if not isinstance(value, str):
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' % {"value": value, "lineno": lineno, })
return False
if len(value) > 2000:
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd maxLength restriction on tpDiscriminacao' % {"value" : encode_str_2_3(value), "lineno": lineno} )
result = False
if len(value) < 1:
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd minLength restriction on tpDiscriminacao' % {"value" : encode_str_2_3(value), "lineno": lineno} )
result = False
return result
def validate_tpPercentualCargaTributaria(self, value):
result = True
# Validate type tpPercentualCargaTributaria, a restriction on xs:decimal.
if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
if not isinstance(value, decimal_.Decimal):
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (decimal_.Decimal)' % {"value": value, "lineno": lineno, })
return False
if value < 0:
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd minInclusive restriction on tpPercentualCargaTributaria' % {"value": value, "lineno": lineno} )
result = False
if len(str(value)) >= 7:
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd totalDigits restriction on tpPercentualCargaTributaria' % {"value": value, "lineno": lineno} )
result = False
return result
def validate_tpFonteCargaTributaria(self, value):
result = True
# Validate type tpFonteCargaTributaria, a restriction on xs:string.
if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
if not isinstance(value, str):
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' % {"value": value, "lineno": lineno, })
return False
if len(value) > 10:
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd maxLength restriction on tpFonteCargaTributaria' % {"value" : encode_str_2_3(value), "lineno": lineno} )
result = False
if len(value) < 0:
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd minLength restriction on tpFonteCargaTributaria' % {"value" : encode_str_2_3(value), "lineno": lineno} )
result = False
return result
def validate_tpCidade(self, value):
result = True
# Validate type tpCidade, a restriction on xs:int.
if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
if not isinstance(value, int):
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (int)' % {"value": value, "lineno": lineno, })
return False
if not self.gds_validate_simple_patterns(
self.validate_tpCidade_patterns_, value):
self.gds_collector_.add_message('Value "%s" does not match xsd pattern restrictions: %s' % (encode_str_2_3(value), self.validate_tpCidade_patterns_, ))
result = False
return result
validate_tpCidade_patterns_ = [['^([0-9]{7})$']]
def hasContent_(self):
if (
self.Assinatura is not None or
self.ChaveNFe is not None or
self.DataEmissaoNFe is not None or
self.NumeroLote is not None or
self.ChaveRPS is not None or
self.TipoRPS is not None or
self.DataEmissaoRPS is not None or
self.CPFCNPJPrestador is not None or
self.RazaoSocialPrestador is not None or
self.EnderecoPrestador is not None or
self.EmailPrestador is not None or
self.StatusNFe is not None or
self.DataCancelamento is not None or
self.TributacaoNFe is not None or
self.OpcaoSimples is not None or
self.NumeroGuia is not None or
self.DataQuitacaoGuia is not None or
self.ValorServicos is not None or
self.ValorDeducoes is not None or
self.ValorPIS is not None or
self.ValorCOFINS is not None or
self.ValorINSS is not None or
self.ValorIR is not None or
self.ValorCSLL is not None or
self.CodigoServico is not None or
self.AliquotaServicos is not None or
self.ValorISS is not None or
self.ValorCredito is not None or
self.ISSRetido is not None or
self.CPFCNPJTomador is not None or
self.InscricaoMunicipalTomador is not None or
self.InscricaoEstadualTomador is not None or
self.RazaoSocialTomador is not None or
self.EnderecoTomador is not None or
self.EmailTomador is not None or
self.CPFCNPJIntermediario is not None or
self.InscricaoMunicipalIntermediario is not None or
self.ISSRetidoIntermediario is not None or
self.EmailIntermediario is not None or
self.Discriminacao is not None or
self.ValorCargaTributaria is not None or
self.PercentualCargaTributaria is not None or
self.FonteCargaTributaria is not None or
self.CodigoCEI is not None or
self.MatriculaObra is not None or
self.MunicipioPrestacao is not None or
self.NumeroEncapsulamento is not None or
self.ValorTotalRecebido is not None
):
return True
else:
return False
def export(self, outfile, level, namespaceprefix_='tipos:', namespacedef_='', name_='tpNFe', pretty_print=True):
imported_ns_def_ = GenerateDSNamespaceDefs_.get('tpNFe')
if imported_ns_def_ is not None:
namespacedef_ = imported_ns_def_
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None and name_ == 'tpNFe':
name_ = self.original_tagname_
if UseCapturedNS_ and self.ns_prefix_:
namespaceprefix_ = self.ns_prefix_ + ':'
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='tpNFe')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='tpNFe', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='tipos:', name_='tpNFe'):
pass
def exportChildren(self, outfile, level, namespaceprefix_='tipos:', namespacedef_='', name_='tpNFe', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.Assinatura is not None:
namespaceprefix_ = self.Assinatura_nsprefix_ + ':' if (UseCapturedNS_ and self.Assinatura_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sAssinatura>%s</%sAssinatura>%s' % (namespaceprefix_ , self.gds_format_base64(self.Assinatura, input_name='Assinatura'), namespaceprefix_ , eol_))
if self.ChaveNFe is not None:
namespaceprefix_ = self.ChaveNFe_nsprefix_ + ':' if (UseCapturedNS_ and self.ChaveNFe_nsprefix_) else ''
self.ChaveNFe.export(outfile, level, namespaceprefix_, namespacedef_='', name_='ChaveNFe', pretty_print=pretty_print)
if self.DataEmissaoNFe is not None:
namespaceprefix_ = self.DataEmissaoNFe_nsprefix_ + ':' if (UseCapturedNS_ and self.DataEmissaoNFe_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sDataEmissaoNFe>%s</%sDataEmissaoNFe>%s' % (namespaceprefix_ , self.gds_format_datetime(self.DataEmissaoNFe, input_name='DataEmissaoNFe'), namespaceprefix_ , eol_))
if self.NumeroLote is not None:
namespaceprefix_ = self.NumeroLote_nsprefix_ + ':' if (UseCapturedNS_ and self.NumeroLote_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sNumeroLote>%s</%sNumeroLote>%s' % (namespaceprefix_ , self.gds_format_integer(self.NumeroLote, input_name='NumeroLote'), namespaceprefix_ , eol_))
if self.ChaveRPS is not None:
namespaceprefix_ = self.ChaveRPS_nsprefix_ + ':' if (UseCapturedNS_ and self.ChaveRPS_nsprefix_) else ''
self.ChaveRPS.export(outfile, level, namespaceprefix_, namespacedef_='', name_='ChaveRPS', pretty_print=pretty_print)
if self.TipoRPS is not None:
namespaceprefix_ = self.TipoRPS_nsprefix_ + ':' if (UseCapturedNS_ and self.TipoRPS_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sTipoRPS>%s</%sTipoRPS>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.TipoRPS), input_name='TipoRPS')), namespaceprefix_ , eol_))
if self.DataEmissaoRPS is not None:
namespaceprefix_ = self.DataEmissaoRPS_nsprefix_ + ':' if (UseCapturedNS_ and self.DataEmissaoRPS_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sDataEmissaoRPS>%s</%sDataEmissaoRPS>%s' % (namespaceprefix_ , self.gds_format_date(self.DataEmissaoRPS, input_name='DataEmissaoRPS'), namespaceprefix_ , eol_))
if self.CPFCNPJPrestador is not None:
namespaceprefix_ = self.CPFCNPJPrestador_nsprefix_ + ':' if (UseCapturedNS_ and self.CPFCNPJPrestador_nsprefix_) else ''
self.CPFCNPJPrestador.export(outfile, level, namespaceprefix_, namespacedef_='', name_='CPFCNPJPrestador', pretty_print=pretty_print)
if self.RazaoSocialPrestador is not None:
namespaceprefix_ = self.RazaoSocialPrestador_nsprefix_ + ':' if (UseCapturedNS_ and self.RazaoSocialPrestador_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sRazaoSocialPrestador>%s</%sRazaoSocialPrestador>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.RazaoSocialPrestador), input_name='RazaoSocialPrestador')), namespaceprefix_ , eol_))
if self.EnderecoPrestador is not None:
namespaceprefix_ = self.EnderecoPrestador_nsprefix_ + ':' if (UseCapturedNS_ and self.EnderecoPrestador_nsprefix_) else ''
self.EnderecoPrestador.export(outfile, level, namespaceprefix_, namespacedef_='', name_='EnderecoPrestador', pretty_print=pretty_print)
if self.EmailPrestador is not None:
namespaceprefix_ = self.EmailPrestador_nsprefix_ + ':' if (UseCapturedNS_ and self.EmailPrestador_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sEmailPrestador>%s</%sEmailPrestador>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.EmailPrestador), input_name='EmailPrestador')), namespaceprefix_ , eol_))
if self.StatusNFe is not None:
namespaceprefix_ = self.StatusNFe_nsprefix_ + ':' if (UseCapturedNS_ and self.StatusNFe_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sStatusNFe>%s</%sStatusNFe>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.StatusNFe), input_name='StatusNFe')), namespaceprefix_ , eol_))
if self.DataCancelamento is not None:
namespaceprefix_ = self.DataCancelamento_nsprefix_ + ':' if (UseCapturedNS_ and self.DataCancelamento_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sDataCancelamento>%s</%sDataCancelamento>%s' % (namespaceprefix_ , self.gds_format_datetime(self.DataCancelamento, input_name='DataCancelamento'), namespaceprefix_ , eol_))
if self.TributacaoNFe is not None:
namespaceprefix_ = self.TributacaoNFe_nsprefix_ + ':' if (UseCapturedNS_ and self.TributacaoNFe_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sTributacaoNFe>%s</%sTributacaoNFe>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.TributacaoNFe), input_name='TributacaoNFe')), namespaceprefix_ , eol_))
if self.OpcaoSimples is not None:
namespaceprefix_ = self.OpcaoSimples_nsprefix_ + ':' if (UseCapturedNS_ and self.OpcaoSimples_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sOpcaoSimples>%s</%sOpcaoSimples>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.OpcaoSimples), input_name='OpcaoSimples')), namespaceprefix_ , eol_))
if self.NumeroGuia is not None:
namespaceprefix_ = self.NumeroGuia_nsprefix_ + ':' if (UseCapturedNS_ and self.NumeroGuia_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sNumeroGuia>%s</%sNumeroGuia>%s' % (namespaceprefix_ , self.gds_format_integer(self.NumeroGuia, input_name='NumeroGuia'), namespaceprefix_ , eol_))
if self.DataQuitacaoGuia is not None:
namespaceprefix_ = self.DataQuitacaoGuia_nsprefix_ + ':' if (UseCapturedNS_ and self.DataQuitacaoGuia_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sDataQuitacaoGuia>%s</%sDataQuitacaoGuia>%s' % (namespaceprefix_ , self.gds_format_date(self.DataQuitacaoGuia, input_name='DataQuitacaoGuia'), namespaceprefix_ , eol_))
if self.ValorServicos is not None:
namespaceprefix_ = self.ValorServicos_nsprefix_ + ':' if (UseCapturedNS_ and self.ValorServicos_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sValorServicos>%s</%sValorServicos>%s' % (namespaceprefix_ , self.gds_format_decimal(self.ValorServicos, input_name='ValorServicos'), namespaceprefix_ , eol_))
if self.ValorDeducoes is not None:
namespaceprefix_ = self.ValorDeducoes_nsprefix_ + ':' if (UseCapturedNS_ and self.ValorDeducoes_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sValorDeducoes>%s</%sValorDeducoes>%s' % (namespaceprefix_ , self.gds_format_decimal(self.ValorDeducoes, input_name='ValorDeducoes'), namespaceprefix_ , eol_))
if self.ValorPIS is not None:
namespaceprefix_ = self.ValorPIS_nsprefix_ + ':' if (UseCapturedNS_ and self.ValorPIS_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sValorPIS>%s</%sValorPIS>%s' % (namespaceprefix_ , self.gds_format_decimal(self.ValorPIS, input_name='ValorPIS'), namespaceprefix_ , eol_))
if self.ValorCOFINS is not None:
namespaceprefix_ = self.ValorCOFINS_nsprefix_ + ':' if (UseCapturedNS_ and self.ValorCOFINS_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sValorCOFINS>%s</%sValorCOFINS>%s' % (namespaceprefix_ , self.gds_format_decimal(self.ValorCOFINS, input_name='ValorCOFINS'), namespaceprefix_ , eol_))
if self.ValorINSS is not None:
namespaceprefix_ = self.ValorINSS_nsprefix_ + ':' if (UseCapturedNS_ and self.ValorINSS_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sValorINSS>%s</%sValorINSS>%s' % (namespaceprefix_ , self.gds_format_decimal(self.ValorINSS, input_name='ValorINSS'), namespaceprefix_ , eol_))
if self.ValorIR is not None:
namespaceprefix_ = self.ValorIR_nsprefix_ + ':' if (UseCapturedNS_ and self.ValorIR_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sValorIR>%s</%sValorIR>%s' % (namespaceprefix_ , self.gds_format_decimal(self.ValorIR, input_name='ValorIR'), namespaceprefix_ , eol_))
if self.ValorCSLL is not None:
namespaceprefix_ = self.ValorCSLL_nsprefix_ + ':' if (UseCapturedNS_ and self.ValorCSLL_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sValorCSLL>%s</%sValorCSLL>%s' % (namespaceprefix_ , self.gds_format_decimal(self.ValorCSLL, input_name='ValorCSLL'), namespaceprefix_ , eol_))
if self.CodigoServico is not None:
namespaceprefix_ = self.CodigoServico_nsprefix_ + ':' if (UseCapturedNS_ and self.CodigoServico_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sCodigoServico>%s</%sCodigoServico>%s' % (namespaceprefix_ , self.gds_format_integer(self.CodigoServico, input_name='CodigoServico'), namespaceprefix_ , eol_))
if self.AliquotaServicos is not None:
namespaceprefix_ = self.AliquotaServicos_nsprefix_ + ':' if (UseCapturedNS_ and self.AliquotaServicos_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sAliquotaServicos>%s</%sAliquotaServicos>%s' % (namespaceprefix_ , self.gds_format_decimal(self.AliquotaServicos, input_name='AliquotaServicos'), namespaceprefix_ , eol_))
if self.ValorISS is not None:
namespaceprefix_ = self.ValorISS_nsprefix_ + ':' if (UseCapturedNS_ and self.ValorISS_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sValorISS>%s</%sValorISS>%s' % (namespaceprefix_ , self.gds_format_decimal(self.ValorISS, input_name='ValorISS'), namespaceprefix_ , eol_))
if self.ValorCredito is not None:
namespaceprefix_ = self.ValorCredito_nsprefix_ + ':' if (UseCapturedNS_ and self.ValorCredito_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sValorCredito>%s</%sValorCredito>%s' % (namespaceprefix_ , self.gds_format_decimal(self.ValorCredito, input_name='ValorCredito'), namespaceprefix_ , eol_))
if self.ISSRetido is not None:
namespaceprefix_ = self.ISSRetido_nsprefix_ + ':' if (UseCapturedNS_ and self.ISSRetido_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sISSRetido>%s</%sISSRetido>%s' % (namespaceprefix_ , self.gds_format_boolean(self.ISSRetido, input_name='ISSRetido'), namespaceprefix_ , eol_))
if self.CPFCNPJTomador is not None:
namespaceprefix_ = self.CPFCNPJTomador_nsprefix_ + ':' if (UseCapturedNS_ and self.CPFCNPJTomador_nsprefix_) else ''
self.CPFCNPJTomador.export(outfile, level, namespaceprefix_, namespacedef_='', name_='CPFCNPJTomador', pretty_print=pretty_print)
if self.InscricaoMunicipalTomador is not None:
namespaceprefix_ = self.InscricaoMunicipalTomador_nsprefix_ + ':' if (UseCapturedNS_ and self.InscricaoMunicipalTomador_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sInscricaoMunicipalTomador>%s</%sInscricaoMunicipalTomador>%s' % (namespaceprefix_ , self.gds_format_integer(self.InscricaoMunicipalTomador, input_name='InscricaoMunicipalTomador'), namespaceprefix_ , eol_))
if self.InscricaoEstadualTomador is not None:
namespaceprefix_ = self.InscricaoEstadualTomador_nsprefix_ + ':' if (UseCapturedNS_ and self.InscricaoEstadualTomador_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sInscricaoEstadualTomador>%s</%sInscricaoEstadualTomador>%s' % (namespaceprefix_ , self.gds_format_integer(self.InscricaoEstadualTomador, input_name='InscricaoEstadualTomador'), namespaceprefix_ , eol_))
if self.RazaoSocialTomador is not None:
namespaceprefix_ = self.RazaoSocialTomador_nsprefix_ + ':' if (UseCapturedNS_ and self.RazaoSocialTomador_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sRazaoSocialTomador>%s</%sRazaoSocialTomador>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.RazaoSocialTomador), input_name='RazaoSocialTomador')), namespaceprefix_ , eol_))
if self.EnderecoTomador is not None:
namespaceprefix_ = self.EnderecoTomador_nsprefix_ + ':' if (UseCapturedNS_ and self.EnderecoTomador_nsprefix_) else ''
self.EnderecoTomador.export(outfile, level, namespaceprefix_, namespacedef_='', name_='EnderecoTomador', pretty_print=pretty_print)
if self.EmailTomador is not None:
namespaceprefix_ = self.EmailTomador_nsprefix_ + ':' if (UseCapturedNS_ and self.EmailTomador_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sEmailTomador>%s</%sEmailTomador>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.EmailTomador), input_name='EmailTomador')), namespaceprefix_ , eol_))
if self.CPFCNPJIntermediario is not None:
namespaceprefix_ = self.CPFCNPJIntermediario_nsprefix_ + ':' if (UseCapturedNS_ and self.CPFCNPJIntermediario_nsprefix_) else ''
self.CPFCNPJIntermediario.export(outfile, level, namespaceprefix_, namespacedef_='', name_='CPFCNPJIntermediario', pretty_print=pretty_print)
if self.InscricaoMunicipalIntermediario is not None:
namespaceprefix_ = self.InscricaoMunicipalIntermediario_nsprefix_ + ':' if (UseCapturedNS_ and self.InscricaoMunicipalIntermediario_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sInscricaoMunicipalIntermediario>%s</%sInscricaoMunicipalIntermediario>%s' % (namespaceprefix_ , self.gds_format_integer(self.InscricaoMunicipalIntermediario, input_name='InscricaoMunicipalIntermediario'), namespaceprefix_ , eol_))
if self.ISSRetidoIntermediario is not None:
namespaceprefix_ = self.ISSRetidoIntermediario_nsprefix_ + ':' if (UseCapturedNS_ and self.ISSRetidoIntermediario_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sISSRetidoIntermediario>%s</%sISSRetidoIntermediario>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.ISSRetidoIntermediario), input_name='ISSRetidoIntermediario')), namespaceprefix_ , eol_))
if self.EmailIntermediario is not None:
namespaceprefix_ = self.EmailIntermediario_nsprefix_ + ':' if (UseCapturedNS_ and self.EmailIntermediario_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sEmailIntermediario>%s</%sEmailIntermediario>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.EmailIntermediario), input_name='EmailIntermediario')), namespaceprefix_ , eol_))
if self.Discriminacao is not None:
namespaceprefix_ = self.Discriminacao_nsprefix_ + ':' if (UseCapturedNS_ and self.Discriminacao_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sDiscriminacao>%s</%sDiscriminacao>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.Discriminacao), input_name='Discriminacao')), namespaceprefix_ , eol_))
if self.ValorCargaTributaria is not None:
namespaceprefix_ = self.ValorCargaTributaria_nsprefix_ + ':' if (UseCapturedNS_ and self.ValorCargaTributaria_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sValorCargaTributaria>%s</%sValorCargaTributaria>%s' % (namespaceprefix_ , self.gds_format_decimal(self.ValorCargaTributaria, input_name='ValorCargaTributaria'), namespaceprefix_ , eol_))
if self.PercentualCargaTributaria is not None:
namespaceprefix_ = self.PercentualCargaTributaria_nsprefix_ + ':' if (UseCapturedNS_ and self.PercentualCargaTributaria_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sPercentualCargaTributaria>%s</%sPercentualCargaTributaria>%s' % (namespaceprefix_ , self.gds_format_decimal(self.PercentualCargaTributaria, input_name='PercentualCargaTributaria'), namespaceprefix_ , eol_))
if self.FonteCargaTributaria is not None:
namespaceprefix_ = self.FonteCargaTributaria_nsprefix_ + ':' if (UseCapturedNS_ and self.FonteCargaTributaria_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sFonteCargaTributaria>%s</%sFonteCargaTributaria>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.FonteCargaTributaria), input_name='FonteCargaTributaria')), namespaceprefix_ , eol_))
if self.CodigoCEI is not None:
namespaceprefix_ = self.CodigoCEI_nsprefix_ + ':' if (UseCapturedNS_ and self.CodigoCEI_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sCodigoCEI>%s</%sCodigoCEI>%s' % (namespaceprefix_ , self.gds_format_integer(self.CodigoCEI, input_name='CodigoCEI'), namespaceprefix_ , eol_))
if self.MatriculaObra is not None:
namespaceprefix_ = self.MatriculaObra_nsprefix_ + ':' if (UseCapturedNS_ and self.MatriculaObra_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sMatriculaObra>%s</%sMatriculaObra>%s' % (namespaceprefix_ , self.gds_format_integer(self.MatriculaObra, input_name='MatriculaObra'), namespaceprefix_ , eol_))
if self.MunicipioPrestacao is not None:
namespaceprefix_ = self.MunicipioPrestacao_nsprefix_ + ':' if (UseCapturedNS_ and self.MunicipioPrestacao_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sMunicipioPrestacao>%s</%sMunicipioPrestacao>%s' % (namespaceprefix_ , self.gds_format_integer(self.MunicipioPrestacao, input_name='MunicipioPrestacao'), namespaceprefix_ , eol_))
if self.NumeroEncapsulamento is not None:
namespaceprefix_ = self.NumeroEncapsulamento_nsprefix_ + ':' if (UseCapturedNS_ and self.NumeroEncapsulamento_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sNumeroEncapsulamento>%s</%sNumeroEncapsulamento>%s' % (namespaceprefix_ , self.gds_format_integer(self.NumeroEncapsulamento, input_name='NumeroEncapsulamento'), namespaceprefix_ , eol_))
if self.ValorTotalRecebido is not None:
namespaceprefix_ = self.ValorTotalRecebido_nsprefix_ + ':' if (UseCapturedNS_ and self.ValorTotalRecebido_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sValorTotalRecebido>%s</%sValorTotalRecebido>%s' % (namespaceprefix_ , self.gds_format_decimal(self.ValorTotalRecebido, input_name='ValorTotalRecebido'), namespaceprefix_ , eol_))
def build(self, node, gds_collector_=None):
self.gds_collector_ = gds_collector_
if SaveElementTreeNode:
self.gds_elementtree_node_ = node
already_processed = set()
self.ns_prefix_ = node.prefix
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
return self
def buildAttributes(self, node, attrs, already_processed):
pass
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
if nodeName_ == 'Assinatura':
sval_ = child_.text
if sval_ is not None:
try:
bval_ = base64.b64decode(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires base64 encoded string: %s' % exp)
bval_ = self.gds_validate_base64(bval_, node, 'Assinatura')
else:
bval_ = None
self.Assinatura = bval_
self.Assinatura_nsprefix_ = child_.prefix
# validate type tpAssinatura
self.validate_tpAssinatura(self.Assinatura)
elif nodeName_ == 'ChaveNFe':
obj_ = tpChaveNFe.factory(parent_object_=self)
obj_.build(child_, gds_collector_=gds_collector_)
self.ChaveNFe = obj_
obj_.original_tagname_ = 'ChaveNFe'
elif nodeName_ == 'DataEmissaoNFe':
sval_ = child_.text
dval_ = self.gds_parse_datetime(sval_)
self.DataEmissaoNFe = dval_
self.DataEmissaoNFe_nsprefix_ = child_.prefix
elif nodeName_ == 'NumeroLote' and child_.text:
sval_ = child_.text
ival_ = self.gds_parse_integer(sval_, node, 'NumeroLote')
ival_ = self.gds_validate_integer(ival_, node, 'NumeroLote')
self.NumeroLote = ival_
self.NumeroLote_nsprefix_ = child_.prefix
# validate type tpNumero
self.validate_tpNumero(self.NumeroLote)
elif nodeName_ == 'ChaveRPS':
obj_ = tpChaveRPS.factory(parent_object_=self)
obj_.build(child_, gds_collector_=gds_collector_)
self.ChaveRPS = obj_
obj_.original_tagname_ = 'ChaveRPS'
elif nodeName_ == 'TipoRPS':
value_ = child_.text
value_ = self.gds_parse_string(value_, node, 'TipoRPS')
value_ = self.gds_validate_string(value_, node, 'TipoRPS')
self.TipoRPS = value_
self.TipoRPS_nsprefix_ = child_.prefix
# validate type tpTipoRPS
self.validate_tpTipoRPS(self.TipoRPS)
elif nodeName_ == 'DataEmissaoRPS':
sval_ = child_.text
dval_ = self.gds_parse_date(sval_)
self.DataEmissaoRPS = dval_
self.DataEmissaoRPS_nsprefix_ = child_.prefix
elif nodeName_ == 'CPFCNPJPrestador':
obj_ = tpCPFCNPJ.factory(parent_object_=self)
obj_.build(child_, gds_collector_=gds_collector_)
self.CPFCNPJPrestador = obj_
obj_.original_tagname_ = 'CPFCNPJPrestador'
elif nodeName_ == 'RazaoSocialPrestador':
value_ = child_.text
value_ = self.gds_parse_string(value_, node, 'RazaoSocialPrestador')
value_ = self.gds_validate_string(value_, node, 'RazaoSocialPrestador')
self.RazaoSocialPrestador = value_
self.RazaoSocialPrestador_nsprefix_ = child_.prefix
# validate type tpRazaoSocial
self.validate_tpRazaoSocial(self.RazaoSocialPrestador)
elif nodeName_ == 'EnderecoPrestador':
obj_ = tpEndereco.factory(parent_object_=self)
obj_.build(child_, gds_collector_=gds_collector_)
self.EnderecoPrestador = obj_
obj_.original_tagname_ = 'EnderecoPrestador'
elif nodeName_ == 'EmailPrestador':
value_ = child_.text
value_ = self.gds_parse_string(value_, node, 'EmailPrestador')
value_ = self.gds_validate_string(value_, node, 'EmailPrestador')
self.EmailPrestador = value_
self.EmailPrestador_nsprefix_ = child_.prefix
# validate type tpEmail
self.validate_tpEmail(self.EmailPrestador)
elif nodeName_ == 'StatusNFe':
value_ = child_.text
value_ = self.gds_parse_string(value_, node, 'StatusNFe')
value_ = self.gds_validate_string(value_, node, 'StatusNFe')
self.StatusNFe = value_
self.StatusNFe_nsprefix_ = child_.prefix
# validate type tpStatusNFe
self.validate_tpStatusNFe(self.StatusNFe)
elif nodeName_ == 'DataCancelamento':
sval_ = child_.text
dval_ = self.gds_parse_datetime(sval_)
self.DataCancelamento = dval_
self.DataCancelamento_nsprefix_ = child_.prefix
elif nodeName_ == 'TributacaoNFe':
value_ = child_.text
value_ = self.gds_parse_string(value_, node, 'TributacaoNFe')
value_ = self.gds_validate_string(value_, node, 'TributacaoNFe')
self.TributacaoNFe = value_
self.TributacaoNFe_nsprefix_ = child_.prefix
# validate type tpTributacaoNFe
self.validate_tpTributacaoNFe(self.TributacaoNFe)
elif nodeName_ == 'OpcaoSimples':
value_ = child_.text
value_ = self.gds_parse_string(value_, node, 'OpcaoSimples')
value_ = self.gds_validate_string(value_, node, 'OpcaoSimples')
self.OpcaoSimples = value_
self.OpcaoSimples_nsprefix_ = child_.prefix
# validate type tpOpcaoSimples
self.validate_tpOpcaoSimples(self.OpcaoSimples)
elif nodeName_ == 'NumeroGuia' and child_.text:
sval_ = child_.text
ival_ = self.gds_parse_integer(sval_, node, 'NumeroGuia')
ival_ = self.gds_validate_integer(ival_, node, 'NumeroGuia')
self.NumeroGuia = ival_
self.NumeroGuia_nsprefix_ = child_.prefix
# validate type tpNumero
self.validate_tpNumero(self.NumeroGuia)
elif nodeName_ == 'DataQuitacaoGuia':
sval_ = child_.text
dval_ = self.gds_parse_date(sval_)
self.DataQuitacaoGuia = dval_
self.DataQuitacaoGuia_nsprefix_ = child_.prefix
elif nodeName_ == 'ValorServicos' and child_.text:
sval_ = child_.text
fval_ = self.gds_parse_decimal(sval_, node, 'ValorServicos')
fval_ = self.gds_validate_decimal(fval_, node, 'ValorServicos')
self.ValorServicos = fval_
self.ValorServicos_nsprefix_ = child_.prefix
# validate type tpValor
self.validate_tpValor(self.ValorServicos)
elif nodeName_ == 'ValorDeducoes' and child_.text:
sval_ = child_.text
fval_ = self.gds_parse_decimal(sval_, node, 'ValorDeducoes')
fval_ = self.gds_validate_decimal(fval_, node, 'ValorDeducoes')
self.ValorDeducoes = fval_
self.ValorDeducoes_nsprefix_ = child_.prefix
# validate type tpValor
self.validate_tpValor(self.ValorDeducoes)
elif nodeName_ == 'ValorPIS' and child_.text:
sval_ = child_.text
fval_ = self.gds_parse_decimal(sval_, node, 'ValorPIS')
fval_ = self.gds_validate_decimal(fval_, node, 'ValorPIS')
self.ValorPIS = fval_
self.ValorPIS_nsprefix_ = child_.prefix
# validate type tpValor
self.validate_tpValor(self.ValorPIS)
elif nodeName_ == 'ValorCOFINS' and child_.text:
sval_ = child_.text
fval_ = self.gds_parse_decimal(sval_, node, 'ValorCOFINS')
fval_ = self.gds_validate_decimal(fval_, node, 'ValorCOFINS')
self.ValorCOFINS = fval_
self.ValorCOFINS_nsprefix_ = child_.prefix
# validate type tpValor
self.validate_tpValor(self.ValorCOFINS)
elif nodeName_ == 'ValorINSS' and child_.text:
sval_ = child_.text
fval_ = self.gds_parse_decimal(sval_, node, 'ValorINSS')
fval_ = self.gds_validate_decimal(fval_, node, 'ValorINSS')
self.ValorINSS = fval_
self.ValorINSS_nsprefix_ = child_.prefix
# validate type tpValor
self.validate_tpValor(self.ValorINSS)
elif nodeName_ == 'ValorIR' and child_.text:
sval_ = child_.text
fval_ = self.gds_parse_decimal(sval_, node, 'ValorIR')
fval_ = self.gds_validate_decimal(fval_, node, 'ValorIR')
self.ValorIR = fval_
self.ValorIR_nsprefix_ = child_.prefix
# validate type tpValor
self.validate_tpValor(self.ValorIR)
elif nodeName_ == 'ValorCSLL' and child_.text:
sval_ = child_.text
fval_ = self.gds_parse_decimal(sval_, node, 'ValorCSLL')
fval_ = self.gds_validate_decimal(fval_, node, 'ValorCSLL')
self.ValorCSLL = fval_
self.ValorCSLL_nsprefix_ = child_.prefix
# validate type tpValor
self.validate_tpValor(self.ValorCSLL)
elif nodeName_ == 'CodigoServico' and child_.text:
sval_ = child_.text
ival_ = self.gds_parse_integer(sval_, node, 'CodigoServico')
ival_ = self.gds_validate_integer(ival_, node, 'CodigoServico')
self.CodigoServico = ival_
self.CodigoServico_nsprefix_ = child_.prefix
# validate type tpCodigoServico
self.validate_tpCodigoServico(self.CodigoServico)
elif nodeName_ == 'AliquotaServicos' and child_.text:
sval_ = child_.text
fval_ = self.gds_parse_decimal(sval_, node, 'AliquotaServicos')
fval_ = self.gds_validate_decimal(fval_, node, 'AliquotaServicos')
self.AliquotaServicos = fval_
self.AliquotaServicos_nsprefix_ = child_.prefix
# validate type tpAliquota
self.validate_tpAliquota(self.AliquotaServicos)
elif nodeName_ == 'ValorISS' and child_.text:
sval_ = child_.text
fval_ = self.gds_parse_decimal(sval_, node, 'ValorISS')
fval_ = self.gds_validate_decimal(fval_, node, 'ValorISS')
self.ValorISS = fval_
self.ValorISS_nsprefix_ = child_.prefix
# validate type tpValor
self.validate_tpValor(self.ValorISS)
elif nodeName_ == 'ValorCredito' and child_.text:
sval_ = child_.text
fval_ = self.gds_parse_decimal(sval_, node, 'ValorCredito')
fval_ = self.gds_validate_decimal(fval_, node, 'ValorCredito')
self.ValorCredito = fval_
self.ValorCredito_nsprefix_ = child_.prefix
# validate type tpValor
self.validate_tpValor(self.ValorCredito)
elif nodeName_ == 'ISSRetido':
sval_ = child_.text
ival_ = self.gds_parse_boolean(sval_, node, 'ISSRetido')
ival_ = self.gds_validate_boolean(ival_, node, 'ISSRetido')
self.ISSRetido = ival_
self.ISSRetido_nsprefix_ = child_.prefix
elif nodeName_ == 'CPFCNPJTomador':
obj_ = tpCPFCNPJ.factory(parent_object_=self)
obj_.build(child_, gds_collector_=gds_collector_)
self.CPFCNPJTomador = obj_
obj_.original_tagname_ = 'CPFCNPJTomador'
elif nodeName_ == 'InscricaoMunicipalTomador' and child_.text:
sval_ = child_.text
ival_ = self.gds_parse_integer(sval_, node, 'InscricaoMunicipalTomador')
ival_ = self.gds_validate_integer(ival_, node, 'InscricaoMunicipalTomador')
self.InscricaoMunicipalTomador = ival_
self.InscricaoMunicipalTomador_nsprefix_ = child_.prefix
# validate type tpInscricaoMunicipal
self.validate_tpInscricaoMunicipal(self.InscricaoMunicipalTomador)
elif nodeName_ == 'InscricaoEstadualTomador' and child_.text:
sval_ = child_.text
ival_ = self.gds_parse_integer(sval_, node, 'InscricaoEstadualTomador')
ival_ = self.gds_validate_integer(ival_, node, 'InscricaoEstadualTomador')
self.InscricaoEstadualTomador = ival_
self.InscricaoEstadualTomador_nsprefix_ = child_.prefix
# validate type tpInscricaoEstadual
self.validate_tpInscricaoEstadual(self.InscricaoEstadualTomador)
elif nodeName_ == 'RazaoSocialTomador':
value_ = child_.text
value_ = self.gds_parse_string(value_, node, 'RazaoSocialTomador')
value_ = self.gds_validate_string(value_, node, 'RazaoSocialTomador')
self.RazaoSocialTomador = value_
self.RazaoSocialTomador_nsprefix_ = child_.prefix
# validate type tpRazaoSocial
self.validate_tpRazaoSocial(self.RazaoSocialTomador)
elif nodeName_ == 'EnderecoTomador':
obj_ = tpEndereco.factory(parent_object_=self)
obj_.build(child_, gds_collector_=gds_collector_)
self.EnderecoTomador = obj_
obj_.original_tagname_ = 'EnderecoTomador'
elif nodeName_ == 'EmailTomador':
value_ = child_.text
value_ = self.gds_parse_string(value_, node, 'EmailTomador')
value_ = self.gds_validate_string(value_, node, 'EmailTomador')
self.EmailTomador = value_
self.EmailTomador_nsprefix_ = child_.prefix
# validate type tpEmail
self.validate_tpEmail(self.EmailTomador)
elif nodeName_ == 'CPFCNPJIntermediario':
obj_ = tpCPFCNPJ.factory(parent_object_=self)
obj_.build(child_, gds_collector_=gds_collector_)
self.CPFCNPJIntermediario = obj_
obj_.original_tagname_ = 'CPFCNPJIntermediario'
elif nodeName_ == 'InscricaoMunicipalIntermediario' and child_.text:
sval_ = child_.text
ival_ = self.gds_parse_integer(sval_, node, 'InscricaoMunicipalIntermediario')
ival_ = self.gds_validate_integer(ival_, node, 'InscricaoMunicipalIntermediario')
self.InscricaoMunicipalIntermediario = ival_
self.InscricaoMunicipalIntermediario_nsprefix_ = child_.prefix
# validate type tpInscricaoMunicipal
self.validate_tpInscricaoMunicipal(self.InscricaoMunicipalIntermediario)
elif nodeName_ == 'ISSRetidoIntermediario':
value_ = child_.text
value_ = self.gds_parse_string(value_, node, 'ISSRetidoIntermediario')
value_ = self.gds_validate_string(value_, node, 'ISSRetidoIntermediario')
self.ISSRetidoIntermediario = value_
self.ISSRetidoIntermediario_nsprefix_ = child_.prefix
elif nodeName_ == 'EmailIntermediario':
value_ = child_.text
value_ = self.gds_parse_string(value_, node, 'EmailIntermediario')
value_ = self.gds_validate_string(value_, node, 'EmailIntermediario')
self.EmailIntermediario = value_
self.EmailIntermediario_nsprefix_ = child_.prefix
# validate type tpEmail
self.validate_tpEmail(self.EmailIntermediario)
elif nodeName_ == 'Discriminacao':
value_ = child_.text
value_ = self.gds_parse_string(value_, node, 'Discriminacao')
value_ = self.gds_validate_string(value_, node, 'Discriminacao')
self.Discriminacao = value_
self.Discriminacao_nsprefix_ = child_.prefix
# validate type tpDiscriminacao
self.validate_tpDiscriminacao(self.Discriminacao)
elif nodeName_ == 'ValorCargaTributaria' and child_.text:
sval_ = child_.text
fval_ = self.gds_parse_decimal(sval_, node, 'ValorCargaTributaria')
fval_ = self.gds_validate_decimal(fval_, node, 'ValorCargaTributaria')
self.ValorCargaTributaria = fval_
self.ValorCargaTributaria_nsprefix_ = child_.prefix
# validate type tpValor
self.validate_tpValor(self.ValorCargaTributaria)
elif nodeName_ == 'PercentualCargaTributaria' and child_.text:
sval_ = child_.text
fval_ = self.gds_parse_decimal(sval_, node, 'PercentualCargaTributaria')
fval_ = self.gds_validate_decimal(fval_, node, 'PercentualCargaTributaria')
self.PercentualCargaTributaria = fval_
self.PercentualCargaTributaria_nsprefix_ = child_.prefix
# validate type tpPercentualCargaTributaria
self.validate_tpPercentualCargaTributaria(self.PercentualCargaTributaria)
elif nodeName_ == 'FonteCargaTributaria':
value_ = child_.text
value_ = self.gds_parse_string(value_, node, 'FonteCargaTributaria')
value_ = self.gds_validate_string(value_, node, 'FonteCargaTributaria')
self.FonteCargaTributaria = value_
self.FonteCargaTributaria_nsprefix_ = child_.prefix
# validate type tpFonteCargaTributaria
self.validate_tpFonteCargaTributaria(self.FonteCargaTributaria)
elif nodeName_ == 'CodigoCEI' and child_.text:
sval_ = child_.text
ival_ = self.gds_parse_integer(sval_, node, 'CodigoCEI')
ival_ = self.gds_validate_integer(ival_, node, 'CodigoCEI')
self.CodigoCEI = ival_
self.CodigoCEI_nsprefix_ = child_.prefix
# validate type tpNumero
self.validate_tpNumero(self.CodigoCEI)
elif nodeName_ == 'MatriculaObra' and child_.text:
sval_ = child_.text
ival_ = self.gds_parse_integer(sval_, node, 'MatriculaObra')
ival_ = self.gds_validate_integer(ival_, node, 'MatriculaObra')
self.MatriculaObra = ival_
self.MatriculaObra_nsprefix_ = child_.prefix
# validate type tpNumero
self.validate_tpNumero(self.MatriculaObra)
elif nodeName_ == 'MunicipioPrestacao' and child_.text:
sval_ = child_.text
ival_ = self.gds_parse_integer(sval_, node, 'MunicipioPrestacao')
ival_ = self.gds_validate_integer(ival_, node, 'MunicipioPrestacao')
self.MunicipioPrestacao = ival_
self.MunicipioPrestacao_nsprefix_ = child_.prefix
# validate type tpCidade
self.validate_tpCidade(self.MunicipioPrestacao)
elif nodeName_ == 'NumeroEncapsulamento' and child_.text:
sval_ = child_.text
ival_ = self.gds_parse_integer(sval_, node, 'NumeroEncapsulamento')
ival_ = self.gds_validate_integer(ival_, node, 'NumeroEncapsulamento')
self.NumeroEncapsulamento = ival_
self.NumeroEncapsulamento_nsprefix_ = child_.prefix
# validate type tpNumero
self.validate_tpNumero(self.NumeroEncapsulamento)
elif nodeName_ == 'ValorTotalRecebido' and child_.text:
sval_ = child_.text
fval_ = self.gds_parse_decimal(sval_, node, 'ValorTotalRecebido')
fval_ = self.gds_validate_decimal(fval_, node, 'ValorTotalRecebido')
self.ValorTotalRecebido = fval_
self.ValorTotalRecebido_nsprefix_ = child_.prefix
# validate type tpValor
self.validate_tpValor(self.ValorTotalRecebido)
# end class tpNFe
class tpRPS(GeneratedsSuper):
"""Tipo que representa um RPS."""
__hash__ = GeneratedsSuper.__hash__
member_data_items_ = [
MemberSpec_('Assinatura', ['tpAssinatura', 'xs:base64Binary'], 0, 0, {'maxOccurs': '1', 'minOccurs': '1', 'name': 'Assinatura', 'type': 'xs:base64Binary'}, None),
MemberSpec_('ChaveRPS', 'tpChaveRPS', 0, 0, {'maxOccurs': '1', 'minOccurs': '1', 'name': 'ChaveRPS', 'type': 'tpChaveRPS'}, None),
MemberSpec_('TipoRPS', ['tpTipoRPS', 'xs:string'], 0, 0, {'maxOccurs': '1', 'minOccurs': '1', 'name': 'TipoRPS', 'type': 'xs:string'}, None),
MemberSpec_('DataEmissao', 'xs:date', 0, 0, {'maxOccurs': '1', 'minOccurs': '1', 'name': 'DataEmissao', 'type': 'xs:date'}, None),
MemberSpec_('StatusRPS', ['tpStatusNFe', 'xs:string'], 0, 0, {'maxOccurs': '1', 'minOccurs': '1', 'name': 'StatusRPS', 'type': 'xs:string'}, None),
MemberSpec_('TributacaoRPS', ['tpTributacaoNFe', 'xs:string'], 0, 0, {'maxOccurs': '1', 'minOccurs': '1', 'name': 'TributacaoRPS', 'type': 'xs:string'}, None),
MemberSpec_('ValorServicos', ['tpValor', 'xs:decimal'], 0, 0, {'maxOccurs': '1', 'minOccurs': '1', 'name': 'ValorServicos', 'type': 'xs:decimal'}, None),
MemberSpec_('ValorDeducoes', ['tpValor', 'xs:decimal'], 0, 0, {'maxOccurs': '1', 'minOccurs': '1', 'name': 'ValorDeducoes', 'type': 'xs:decimal'}, None),
MemberSpec_('ValorPIS', ['tpValor', 'xs:decimal'], 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'ValorPIS', 'type': 'xs:decimal'}, None),
MemberSpec_('ValorCOFINS', ['tpValor', 'xs:decimal'], 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'ValorCOFINS', 'type': 'xs:decimal'}, None),
MemberSpec_('ValorINSS', ['tpValor', 'xs:decimal'], 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'ValorINSS', 'type': 'xs:decimal'}, None),
MemberSpec_('ValorIR', ['tpValor', 'xs:decimal'], 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'ValorIR', 'type': 'xs:decimal'}, None),
MemberSpec_('ValorCSLL', ['tpValor', 'xs:decimal'], 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'ValorCSLL', 'type': 'xs:decimal'}, None),
MemberSpec_('CodigoServico', ['tpCodigoServico', 'xs:int'], 0, 0, {'maxOccurs': '1', 'minOccurs': '1', 'name': 'CodigoServico', 'type': 'xs:int'}, None),
MemberSpec_('AliquotaServicos', ['tpAliquota', 'xs:decimal'], 0, 0, {'maxOccurs': '1', 'minOccurs': '1', 'name': 'AliquotaServicos', 'type': 'xs:decimal'}, None),
MemberSpec_('ISSRetido', 'xs:boolean', 0, 0, {'maxOccurs': '1', 'minOccurs': '1', 'name': 'ISSRetido', 'type': 'xs:boolean'}, None),
MemberSpec_('CPFCNPJTomador', 'tpCPFCNPJ', 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'CPFCNPJTomador', 'type': 'tpCPFCNPJ'}, None),
MemberSpec_('InscricaoMunicipalTomador', ['tpInscricaoMunicipal', 'xs:long'], 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'InscricaoMunicipalTomador', 'type': 'xs:long'}, None),
MemberSpec_('InscricaoEstadualTomador', ['tpInscricaoEstadual', 'xs:long'], 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'InscricaoEstadualTomador', 'type': 'xs:long'}, None),
MemberSpec_('RazaoSocialTomador', ['tpRazaoSocial', 'xs:string'], 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'RazaoSocialTomador', 'type': 'xs:string'}, None),
MemberSpec_('EnderecoTomador', 'tpEndereco', 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'EnderecoTomador', 'type': 'tpEndereco'}, None),
MemberSpec_('EmailTomador', ['tpEmail', 'xs:string'], 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'EmailTomador', 'type': 'xs:string'}, None),
MemberSpec_('CPFCNPJIntermediario', 'tpCPFCNPJ', 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'CPFCNPJIntermediario', 'type': 'tpCPFCNPJ'}, None),
MemberSpec_('InscricaoMunicipalIntermediario', ['tpInscricaoMunicipal', 'xs:long'], 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'InscricaoMunicipalIntermediario', 'type': 'xs:long'}, None),
MemberSpec_('ISSRetidoIntermediario', 'xs:string', 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'ISSRetidoIntermediario', 'type': 'xs:string'}, None),
MemberSpec_('EmailIntermediario', ['tpEmail', 'xs:string'], 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'EmailIntermediario', 'type': 'xs:string'}, None),
MemberSpec_('Discriminacao', ['tpDiscriminacao', 'xs:string'], 0, 0, {'maxOccurs': '1', 'minOccurs': '1', 'name': 'Discriminacao', 'type': 'xs:string'}, None),
MemberSpec_('ValorCargaTributaria', ['tpValor', 'xs:decimal'], 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'ValorCargaTributaria', 'type': 'xs:decimal'}, None),
MemberSpec_('PercentualCargaTributaria', ['tpPercentualCargaTributaria', 'xs:decimal'], 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'PercentualCargaTributaria', 'type': 'xs:decimal'}, None),
MemberSpec_('FonteCargaTributaria', ['tpFonteCargaTributaria', 'xs:string'], 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'FonteCargaTributaria', 'type': 'xs:string'}, None),
MemberSpec_('CodigoCEI', ['tpNumero', 'xs:long'], 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'CodigoCEI', 'type': 'xs:long'}, None),
MemberSpec_('MatriculaObra', ['tpNumero', 'xs:long'], 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'MatriculaObra', 'type': 'xs:long'}, None),
MemberSpec_('MunicipioPrestacao', ['tpCidade', 'xs:int'], 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'MunicipioPrestacao', 'type': 'xs:int'}, None),
MemberSpec_('NumeroEncapsulamento', ['tpNumero', 'xs:long'], 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'NumeroEncapsulamento', 'type': 'xs:long'}, None),
MemberSpec_('ValorTotalRecebido', ['tpValor', 'xs:decimal'], 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'ValorTotalRecebido', 'type': 'xs:decimal'}, None),
]
subclass = None
superclass = None
def __init__(self, Assinatura=None, ChaveRPS=None, TipoRPS=None, DataEmissao=None, StatusRPS=None, TributacaoRPS=None, ValorServicos=None, ValorDeducoes=None, ValorPIS=None, ValorCOFINS=None, ValorINSS=None, ValorIR=None, ValorCSLL=None, CodigoServico=None, AliquotaServicos=None, ISSRetido=None, CPFCNPJTomador=None, InscricaoMunicipalTomador=None, InscricaoEstadualTomador=None, RazaoSocialTomador=None, EnderecoTomador=None, EmailTomador=None, CPFCNPJIntermediario=None, InscricaoMunicipalIntermediario=None, ISSRetidoIntermediario=None, EmailIntermediario=None, Discriminacao=None, ValorCargaTributaria=None, PercentualCargaTributaria=None, FonteCargaTributaria=None, CodigoCEI=None, MatriculaObra=None, MunicipioPrestacao=None, NumeroEncapsulamento=None, ValorTotalRecebido=None, gds_collector_=None, **kwargs_):
self.gds_collector_ = gds_collector_
self.gds_elementtree_node_ = None
self.original_tagname_ = None
self.parent_object_ = kwargs_.get('parent_object_')
self.ns_prefix_ = None
self.Assinatura = Assinatura
self.validate_tpAssinatura(self.Assinatura)
self.Assinatura_nsprefix_ = None
self.ChaveRPS = ChaveRPS
self.ChaveRPS_nsprefix_ = None
self.TipoRPS = TipoRPS
self.validate_tpTipoRPS(self.TipoRPS)
self.TipoRPS_nsprefix_ = None
if isinstance(DataEmissao, BaseStrType_):
initvalue_ = datetime_.datetime.strptime(DataEmissao, '%Y-%m-%d').date()
else:
initvalue_ = DataEmissao
self.DataEmissao = initvalue_
self.DataEmissao_nsprefix_ = None
self.StatusRPS = StatusRPS
self.validate_tpStatusNFe(self.StatusRPS)
self.StatusRPS_nsprefix_ = None
self.TributacaoRPS = TributacaoRPS
self.validate_tpTributacaoNFe(self.TributacaoRPS)
self.TributacaoRPS_nsprefix_ = None
self.ValorServicos = ValorServicos
self.validate_tpValor(self.ValorServicos)
self.ValorServicos_nsprefix_ = None
self.ValorDeducoes = ValorDeducoes
self.validate_tpValor(self.ValorDeducoes)
self.ValorDeducoes_nsprefix_ = None
self.ValorPIS = ValorPIS
self.validate_tpValor(self.ValorPIS)
self.ValorPIS_nsprefix_ = None
self.ValorCOFINS = ValorCOFINS
self.validate_tpValor(self.ValorCOFINS)
self.ValorCOFINS_nsprefix_ = None
self.ValorINSS = ValorINSS
self.validate_tpValor(self.ValorINSS)
self.ValorINSS_nsprefix_ = None
self.ValorIR = ValorIR
self.validate_tpValor(self.ValorIR)
self.ValorIR_nsprefix_ = None
self.ValorCSLL = ValorCSLL
self.validate_tpValor(self.ValorCSLL)
self.ValorCSLL_nsprefix_ = None
self.CodigoServico = CodigoServico
self.validate_tpCodigoServico(self.CodigoServico)
self.CodigoServico_nsprefix_ = None
self.AliquotaServicos = AliquotaServicos
self.validate_tpAliquota(self.AliquotaServicos)
self.AliquotaServicos_nsprefix_ = None
self.ISSRetido = ISSRetido
self.ISSRetido_nsprefix_ = None
self.CPFCNPJTomador = CPFCNPJTomador
self.CPFCNPJTomador_nsprefix_ = None
self.InscricaoMunicipalTomador = InscricaoMunicipalTomador
self.validate_tpInscricaoMunicipal(self.InscricaoMunicipalTomador)
self.InscricaoMunicipalTomador_nsprefix_ = None
self.InscricaoEstadualTomador = InscricaoEstadualTomador
self.validate_tpInscricaoEstadual(self.InscricaoEstadualTomador)
self.InscricaoEstadualTomador_nsprefix_ = None
self.RazaoSocialTomador = RazaoSocialTomador
self.validate_tpRazaoSocial(self.RazaoSocialTomador)
self.RazaoSocialTomador_nsprefix_ = None
self.EnderecoTomador = EnderecoTomador
self.EnderecoTomador_nsprefix_ = None
self.EmailTomador = EmailTomador
self.validate_tpEmail(self.EmailTomador)
self.EmailTomador_nsprefix_ = None
self.CPFCNPJIntermediario = CPFCNPJIntermediario
self.CPFCNPJIntermediario_nsprefix_ = None
self.InscricaoMunicipalIntermediario = InscricaoMunicipalIntermediario
self.validate_tpInscricaoMunicipal(self.InscricaoMunicipalIntermediario)
self.InscricaoMunicipalIntermediario_nsprefix_ = None
self.ISSRetidoIntermediario = ISSRetidoIntermediario
self.ISSRetidoIntermediario_nsprefix_ = None
self.EmailIntermediario = EmailIntermediario
self.validate_tpEmail(self.EmailIntermediario)
self.EmailIntermediario_nsprefix_ = None
self.Discriminacao = Discriminacao
self.validate_tpDiscriminacao(self.Discriminacao)
self.Discriminacao_nsprefix_ = None
self.ValorCargaTributaria = ValorCargaTributaria
self.validate_tpValor(self.ValorCargaTributaria)
self.ValorCargaTributaria_nsprefix_ = None
self.PercentualCargaTributaria = PercentualCargaTributaria
self.validate_tpPercentualCargaTributaria(self.PercentualCargaTributaria)
self.PercentualCargaTributaria_nsprefix_ = None
self.FonteCargaTributaria = FonteCargaTributaria
self.validate_tpFonteCargaTributaria(self.FonteCargaTributaria)
self.FonteCargaTributaria_nsprefix_ = None
self.CodigoCEI = CodigoCEI
self.validate_tpNumero(self.CodigoCEI)
self.CodigoCEI_nsprefix_ = None
self.MatriculaObra = MatriculaObra
self.validate_tpNumero(self.MatriculaObra)
self.MatriculaObra_nsprefix_ = None
self.MunicipioPrestacao = MunicipioPrestacao
self.validate_tpCidade(self.MunicipioPrestacao)
self.MunicipioPrestacao_nsprefix_ = None
self.NumeroEncapsulamento = NumeroEncapsulamento
self.validate_tpNumero(self.NumeroEncapsulamento)
self.NumeroEncapsulamento_nsprefix_ = None
self.ValorTotalRecebido = ValorTotalRecebido
self.validate_tpValor(self.ValorTotalRecebido)
self.ValorTotalRecebido_nsprefix_ = None
def factory(*args_, **kwargs_):
if CurrentSubclassModule_ is not None:
subclass = getSubclassFromModule_(
CurrentSubclassModule_, tpRPS)
if subclass is not None:
return subclass(*args_, **kwargs_)
if tpRPS.subclass:
return tpRPS.subclass(*args_, **kwargs_)
else:
return tpRPS(*args_, **kwargs_)
factory = staticmethod(factory)
def validate_tpAssinatura(self, value):
result = True
# Validate type tpAssinatura, a restriction on xs:base64Binary.
if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
pass
return result
def validate_tpTipoRPS(self, value):
result = True
# Validate type tpTipoRPS, a restriction on xs:string.
if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
if not isinstance(value, str):
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' % {"value": value, "lineno": lineno, })
return False
value = value
enumerations = ['RPS', 'RPS-M', 'RPS-C']
if value not in enumerations:
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd enumeration restriction on tpTipoRPS' % {"value" : encode_str_2_3(value), "lineno": lineno} )
result = False
return result
def validate_tpStatusNFe(self, value):
result = True
# Validate type tpStatusNFe, a restriction on xs:string.
if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
if not isinstance(value, str):
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' % {"value": value, "lineno": lineno, })
return False
value = value
enumerations = ['N', 'C', 'E']
if value not in enumerations:
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd enumeration restriction on tpStatusNFe' % {"value" : encode_str_2_3(value), "lineno": lineno} )
result = False
return result
def validate_tpTributacaoNFe(self, value):
result = True
# Validate type tpTributacaoNFe, a restriction on xs:string.
if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
if not isinstance(value, str):
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' % {"value": value, "lineno": lineno, })
return False
if len(value) > 1:
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd maxLength restriction on tpTributacaoNFe' % {"value" : encode_str_2_3(value), "lineno": lineno} )
result = False
if len(value) < 1:
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd minLength restriction on tpTributacaoNFe' % {"value" : encode_str_2_3(value), "lineno": lineno} )
result = False
return result
def validate_tpValor(self, value):
result = True
# Validate type tpValor, a restriction on xs:decimal.
if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
if not isinstance(value, decimal_.Decimal):
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (decimal_.Decimal)' % {"value": value, "lineno": lineno, })
return False
if value < 0:
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd minInclusive restriction on tpValor' % {"value": value, "lineno": lineno} )
result = False
if len(str(value)) >= 15:
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd totalDigits restriction on tpValor' % {"value": value, "lineno": lineno} )
result = False
if not self.gds_validate_simple_patterns(
self.validate_tpValor_patterns_, value):
self.gds_collector_.add_message('Value "%s" does not match xsd pattern restrictions: %s' % (encode_str_2_3(value), self.validate_tpValor_patterns_, ))
result = False
return result
validate_tpValor_patterns_ = [['^(0|0\\.[0-9]{2}|[1-9]{1}[0-9]{0,12}(\\.[0-9]{0,2})?)$']]
def validate_tpCodigoServico(self, value):
result = True
# Validate type tpCodigoServico, a restriction on xs:int.
if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
if not isinstance(value, int):
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (int)' % {"value": value, "lineno": lineno, })
return False
if not self.gds_validate_simple_patterns(
self.validate_tpCodigoServico_patterns_, value):
self.gds_collector_.add_message('Value "%s" does not match xsd pattern restrictions: %s' % (encode_str_2_3(value), self.validate_tpCodigoServico_patterns_, ))
result = False
return result
validate_tpCodigoServico_patterns_ = [['^([0-9]{4,5})$']]
def validate_tpAliquota(self, value):
result = True
# Validate type tpAliquota, a restriction on xs:decimal.
if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
if not isinstance(value, decimal_.Decimal):
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (decimal_.Decimal)' % {"value": value, "lineno": lineno, })
return False
if value < 0:
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd minInclusive restriction on tpAliquota' % {"value": value, "lineno": lineno} )
result = False
if len(str(value)) >= 5:
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd totalDigits restriction on tpAliquota' % {"value": value, "lineno": lineno} )
result = False
return result
def validate_tpInscricaoMunicipal(self, value):
result = True
# Validate type tpInscricaoMunicipal, a restriction on xs:long.
if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
if not isinstance(value, int):
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (int)' % {"value": value, "lineno": lineno, })
return False
if not self.gds_validate_simple_patterns(
self.validate_tpInscricaoMunicipal_patterns_, value):
self.gds_collector_.add_message('Value "%s" does not match xsd pattern restrictions: %s' % (encode_str_2_3(value), self.validate_tpInscricaoMunicipal_patterns_, ))
result = False
return result
validate_tpInscricaoMunicipal_patterns_ = [['^([0-9]{8,8})$']]
def validate_tpInscricaoEstadual(self, value):
result = True
# Validate type tpInscricaoEstadual, a restriction on xs:long.
if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
if not isinstance(value, int):
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (int)' % {"value": value, "lineno": lineno, })
return False
if not self.gds_validate_simple_patterns(
self.validate_tpInscricaoEstadual_patterns_, value):
self.gds_collector_.add_message('Value "%s" does not match xsd pattern restrictions: %s' % (encode_str_2_3(value), self.validate_tpInscricaoEstadual_patterns_, ))
result = False
return result
validate_tpInscricaoEstadual_patterns_ = [['^([0-9]{1,19})$']]
def validate_tpRazaoSocial(self, value):
result = True
# Validate type tpRazaoSocial, a restriction on xs:string.
if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
if not isinstance(value, str):
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' % {"value": value, "lineno": lineno, })
return False
if len(value) > 75:
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd maxLength restriction on tpRazaoSocial' % {"value" : encode_str_2_3(value), "lineno": lineno} )
result = False
if len(value) < 0:
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd minLength restriction on tpRazaoSocial' % {"value" : encode_str_2_3(value), "lineno": lineno} )
result = False
return result
def validate_tpEmail(self, value):
result = True
# Validate type tpEmail, a restriction on xs:string.
if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
if not isinstance(value, str):
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' % {"value": value, "lineno": lineno, })
return False
if len(value) > 75:
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd maxLength restriction on tpEmail' % {"value" : encode_str_2_3(value), "lineno": lineno} )
result = False
if len(value) < 0:
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd minLength restriction on tpEmail' % {"value" : encode_str_2_3(value), "lineno": lineno} )
result = False
return result
def validate_tpDiscriminacao(self, value):
result = True
# Validate type tpDiscriminacao, a restriction on xs:string.
if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
if not isinstance(value, str):
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' % {"value": value, "lineno": lineno, })
return False
if len(value) > 2000:
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd maxLength restriction on tpDiscriminacao' % {"value" : encode_str_2_3(value), "lineno": lineno} )
result = False
if len(value) < 1:
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd minLength restriction on tpDiscriminacao' % {"value" : encode_str_2_3(value), "lineno": lineno} )
result = False
return result
def validate_tpPercentualCargaTributaria(self, value):
result = True
# Validate type tpPercentualCargaTributaria, a restriction on xs:decimal.
if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
if not isinstance(value, decimal_.Decimal):
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (decimal_.Decimal)' % {"value": value, "lineno": lineno, })
return False
if value < 0:
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd minInclusive restriction on tpPercentualCargaTributaria' % {"value": value, "lineno": lineno} )
result = False
if len(str(value)) >= 7:
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd totalDigits restriction on tpPercentualCargaTributaria' % {"value": value, "lineno": lineno} )
result = False
return result
def validate_tpFonteCargaTributaria(self, value):
result = True
# Validate type tpFonteCargaTributaria, a restriction on xs:string.
if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
if not isinstance(value, str):
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' % {"value": value, "lineno": lineno, })
return False
if len(value) > 10:
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd maxLength restriction on tpFonteCargaTributaria' % {"value" : encode_str_2_3(value), "lineno": lineno} )
result = False
if len(value) < 0:
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd minLength restriction on tpFonteCargaTributaria' % {"value" : encode_str_2_3(value), "lineno": lineno} )
result = False
return result
def validate_tpNumero(self, value):
result = True
# Validate type tpNumero, a restriction on xs:long.
if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
if not isinstance(value, int):
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (int)' % {"value": value, "lineno": lineno, })
return False
if not self.gds_validate_simple_patterns(
self.validate_tpNumero_patterns_, value):
self.gds_collector_.add_message('Value "%s" does not match xsd pattern restrictions: %s' % (encode_str_2_3(value), self.validate_tpNumero_patterns_, ))
result = False
return result
validate_tpNumero_patterns_ = [['^([0-9]{1,12})$']]
def validate_tpCidade(self, value):
result = True
# Validate type tpCidade, a restriction on xs:int.
if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
if not isinstance(value, int):
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (int)' % {"value": value, "lineno": lineno, })
return False
if not self.gds_validate_simple_patterns(
self.validate_tpCidade_patterns_, value):
self.gds_collector_.add_message('Value "%s" does not match xsd pattern restrictions: %s' % (encode_str_2_3(value), self.validate_tpCidade_patterns_, ))
result = False
return result
validate_tpCidade_patterns_ = [['^([0-9]{7})$']]
def hasContent_(self):
if (
self.Assinatura is not None or
self.ChaveRPS is not None or
self.TipoRPS is not None or
self.DataEmissao is not None or
self.StatusRPS is not None or
self.TributacaoRPS is not None or
self.ValorServicos is not None or
self.ValorDeducoes is not None or
self.ValorPIS is not None or
self.ValorCOFINS is not None or
self.ValorINSS is not None or
self.ValorIR is not None or
self.ValorCSLL is not None or
self.CodigoServico is not None or
self.AliquotaServicos is not None or
self.ISSRetido is not None or
self.CPFCNPJTomador is not None or
self.InscricaoMunicipalTomador is not None or
self.InscricaoEstadualTomador is not None or
self.RazaoSocialTomador is not None or
self.EnderecoTomador is not None or
self.EmailTomador is not None or
self.CPFCNPJIntermediario is not None or
self.InscricaoMunicipalIntermediario is not None or
self.ISSRetidoIntermediario is not None or
self.EmailIntermediario is not None or
self.Discriminacao is not None or
self.ValorCargaTributaria is not None or
self.PercentualCargaTributaria is not None or
self.FonteCargaTributaria is not None or
self.CodigoCEI is not None or
self.MatriculaObra is not None or
self.MunicipioPrestacao is not None or
self.NumeroEncapsulamento is not None or
self.ValorTotalRecebido is not None
):
return True
else:
return False
def export(self, outfile, level, namespaceprefix_='tipos:', namespacedef_='', name_='tpRPS', pretty_print=True):
imported_ns_def_ = GenerateDSNamespaceDefs_.get('tpRPS')
if imported_ns_def_ is not None:
namespacedef_ = imported_ns_def_
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None and name_ == 'tpRPS':
name_ = self.original_tagname_
if UseCapturedNS_ and self.ns_prefix_:
namespaceprefix_ = self.ns_prefix_ + ':'
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='tpRPS')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='tpRPS', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='tipos:', name_='tpRPS'):
pass
def exportChildren(self, outfile, level, namespaceprefix_='tipos:', namespacedef_='', name_='tpRPS', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.Assinatura is not None:
namespaceprefix_ = self.Assinatura_nsprefix_ + ':' if (UseCapturedNS_ and self.Assinatura_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sAssinatura>%s</%sAssinatura>%s' % (namespaceprefix_ , self.gds_format_base64(self.Assinatura, input_name='Assinatura'), namespaceprefix_ , eol_))
if self.ChaveRPS is not None:
namespaceprefix_ = self.ChaveRPS_nsprefix_ + ':' if (UseCapturedNS_ and self.ChaveRPS_nsprefix_) else ''
self.ChaveRPS.export(outfile, level, namespaceprefix_, namespacedef_='', name_='ChaveRPS', pretty_print=pretty_print)
if self.TipoRPS is not None:
namespaceprefix_ = self.TipoRPS_nsprefix_ + ':' if (UseCapturedNS_ and self.TipoRPS_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sTipoRPS>%s</%sTipoRPS>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.TipoRPS), input_name='TipoRPS')), namespaceprefix_ , eol_))
if self.DataEmissao is not None:
namespaceprefix_ = self.DataEmissao_nsprefix_ + ':' if (UseCapturedNS_ and self.DataEmissao_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sDataEmissao>%s</%sDataEmissao>%s' % (namespaceprefix_ , self.gds_format_date(self.DataEmissao, input_name='DataEmissao'), namespaceprefix_ , eol_))
if self.StatusRPS is not None:
namespaceprefix_ = self.StatusRPS_nsprefix_ + ':' if (UseCapturedNS_ and self.StatusRPS_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sStatusRPS>%s</%sStatusRPS>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.StatusRPS), input_name='StatusRPS')), namespaceprefix_ , eol_))
if self.TributacaoRPS is not None:
namespaceprefix_ = self.TributacaoRPS_nsprefix_ + ':' if (UseCapturedNS_ and self.TributacaoRPS_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sTributacaoRPS>%s</%sTributacaoRPS>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.TributacaoRPS), input_name='TributacaoRPS')), namespaceprefix_ , eol_))
if self.ValorServicos is not None:
namespaceprefix_ = self.ValorServicos_nsprefix_ + ':' if (UseCapturedNS_ and self.ValorServicos_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sValorServicos>%s</%sValorServicos>%s' % (namespaceprefix_ , self.gds_format_decimal(self.ValorServicos, input_name='ValorServicos'), namespaceprefix_ , eol_))
if self.ValorDeducoes is not None:
namespaceprefix_ = self.ValorDeducoes_nsprefix_ + ':' if (UseCapturedNS_ and self.ValorDeducoes_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sValorDeducoes>%s</%sValorDeducoes>%s' % (namespaceprefix_ , self.gds_format_decimal(self.ValorDeducoes, input_name='ValorDeducoes'), namespaceprefix_ , eol_))
if self.ValorPIS is not None:
namespaceprefix_ = self.ValorPIS_nsprefix_ + ':' if (UseCapturedNS_ and self.ValorPIS_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sValorPIS>%s</%sValorPIS>%s' % (namespaceprefix_ , self.gds_format_decimal(self.ValorPIS, input_name='ValorPIS'), namespaceprefix_ , eol_))
if self.ValorCOFINS is not None:
namespaceprefix_ = self.ValorCOFINS_nsprefix_ + ':' if (UseCapturedNS_ and self.ValorCOFINS_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sValorCOFINS>%s</%sValorCOFINS>%s' % (namespaceprefix_ , self.gds_format_decimal(self.ValorCOFINS, input_name='ValorCOFINS'), namespaceprefix_ , eol_))
if self.ValorINSS is not None:
namespaceprefix_ = self.ValorINSS_nsprefix_ + ':' if (UseCapturedNS_ and self.ValorINSS_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sValorINSS>%s</%sValorINSS>%s' % (namespaceprefix_ , self.gds_format_decimal(self.ValorINSS, input_name='ValorINSS'), namespaceprefix_ , eol_))
if self.ValorIR is not None:
namespaceprefix_ = self.ValorIR_nsprefix_ + ':' if (UseCapturedNS_ and self.ValorIR_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sValorIR>%s</%sValorIR>%s' % (namespaceprefix_ , self.gds_format_decimal(self.ValorIR, input_name='ValorIR'), namespaceprefix_ , eol_))
if self.ValorCSLL is not None:
namespaceprefix_ = self.ValorCSLL_nsprefix_ + ':' if (UseCapturedNS_ and self.ValorCSLL_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sValorCSLL>%s</%sValorCSLL>%s' % (namespaceprefix_ , self.gds_format_decimal(self.ValorCSLL, input_name='ValorCSLL'), namespaceprefix_ , eol_))
if self.CodigoServico is not None:
namespaceprefix_ = self.CodigoServico_nsprefix_ + ':' if (UseCapturedNS_ and self.CodigoServico_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sCodigoServico>%s</%sCodigoServico>%s' % (namespaceprefix_ , self.gds_format_integer(self.CodigoServico, input_name='CodigoServico'), namespaceprefix_ , eol_))
if self.AliquotaServicos is not None:
namespaceprefix_ = self.AliquotaServicos_nsprefix_ + ':' if (UseCapturedNS_ and self.AliquotaServicos_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sAliquotaServicos>%s</%sAliquotaServicos>%s' % (namespaceprefix_ , self.gds_format_decimal(self.AliquotaServicos, input_name='AliquotaServicos'), namespaceprefix_ , eol_))
if self.ISSRetido is not None:
namespaceprefix_ = self.ISSRetido_nsprefix_ + ':' if (UseCapturedNS_ and self.ISSRetido_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sISSRetido>%s</%sISSRetido>%s' % (namespaceprefix_ , self.gds_format_boolean(self.ISSRetido, input_name='ISSRetido'), namespaceprefix_ , eol_))
if self.CPFCNPJTomador is not None:
namespaceprefix_ = self.CPFCNPJTomador_nsprefix_ + ':' if (UseCapturedNS_ and self.CPFCNPJTomador_nsprefix_) else ''
self.CPFCNPJTomador.export(outfile, level, namespaceprefix_, namespacedef_='', name_='CPFCNPJTomador', pretty_print=pretty_print)
if self.InscricaoMunicipalTomador is not None:
namespaceprefix_ = self.InscricaoMunicipalTomador_nsprefix_ + ':' if (UseCapturedNS_ and self.InscricaoMunicipalTomador_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sInscricaoMunicipalTomador>%s</%sInscricaoMunicipalTomador>%s' % (namespaceprefix_ , self.gds_format_integer(self.InscricaoMunicipalTomador, input_name='InscricaoMunicipalTomador'), namespaceprefix_ , eol_))
if self.InscricaoEstadualTomador is not None:
namespaceprefix_ = self.InscricaoEstadualTomador_nsprefix_ + ':' if (UseCapturedNS_ and self.InscricaoEstadualTomador_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sInscricaoEstadualTomador>%s</%sInscricaoEstadualTomador>%s' % (namespaceprefix_ , self.gds_format_integer(self.InscricaoEstadualTomador, input_name='InscricaoEstadualTomador'), namespaceprefix_ , eol_))
if self.RazaoSocialTomador is not None:
namespaceprefix_ = self.RazaoSocialTomador_nsprefix_ + ':' if (UseCapturedNS_ and self.RazaoSocialTomador_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sRazaoSocialTomador>%s</%sRazaoSocialTomador>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.RazaoSocialTomador), input_name='RazaoSocialTomador')), namespaceprefix_ , eol_))
if self.EnderecoTomador is not None:
namespaceprefix_ = self.EnderecoTomador_nsprefix_ + ':' if (UseCapturedNS_ and self.EnderecoTomador_nsprefix_) else ''
self.EnderecoTomador.export(outfile, level, namespaceprefix_, namespacedef_='', name_='EnderecoTomador', pretty_print=pretty_print)
if self.EmailTomador is not None:
namespaceprefix_ = self.EmailTomador_nsprefix_ + ':' if (UseCapturedNS_ and self.EmailTomador_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sEmailTomador>%s</%sEmailTomador>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.EmailTomador), input_name='EmailTomador')), namespaceprefix_ , eol_))
if self.CPFCNPJIntermediario is not None:
namespaceprefix_ = self.CPFCNPJIntermediario_nsprefix_ + ':' if (UseCapturedNS_ and self.CPFCNPJIntermediario_nsprefix_) else ''
self.CPFCNPJIntermediario.export(outfile, level, namespaceprefix_, namespacedef_='', name_='CPFCNPJIntermediario', pretty_print=pretty_print)
if self.InscricaoMunicipalIntermediario is not None:
namespaceprefix_ = self.InscricaoMunicipalIntermediario_nsprefix_ + ':' if (UseCapturedNS_ and self.InscricaoMunicipalIntermediario_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sInscricaoMunicipalIntermediario>%s</%sInscricaoMunicipalIntermediario>%s' % (namespaceprefix_ , self.gds_format_integer(self.InscricaoMunicipalIntermediario, input_name='InscricaoMunicipalIntermediario'), namespaceprefix_ , eol_))
if self.ISSRetidoIntermediario is not None:
namespaceprefix_ = self.ISSRetidoIntermediario_nsprefix_ + ':' if (UseCapturedNS_ and self.ISSRetidoIntermediario_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sISSRetidoIntermediario>%s</%sISSRetidoIntermediario>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.ISSRetidoIntermediario), input_name='ISSRetidoIntermediario')), namespaceprefix_ , eol_))
if self.EmailIntermediario is not None:
namespaceprefix_ = self.EmailIntermediario_nsprefix_ + ':' if (UseCapturedNS_ and self.EmailIntermediario_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sEmailIntermediario>%s</%sEmailIntermediario>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.EmailIntermediario), input_name='EmailIntermediario')), namespaceprefix_ , eol_))
if self.Discriminacao is not None:
namespaceprefix_ = self.Discriminacao_nsprefix_ + ':' if (UseCapturedNS_ and self.Discriminacao_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sDiscriminacao>%s</%sDiscriminacao>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.Discriminacao), input_name='Discriminacao')), namespaceprefix_ , eol_))
if self.ValorCargaTributaria is not None:
namespaceprefix_ = self.ValorCargaTributaria_nsprefix_ + ':' if (UseCapturedNS_ and self.ValorCargaTributaria_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sValorCargaTributaria>%s</%sValorCargaTributaria>%s' % (namespaceprefix_ , self.gds_format_decimal(self.ValorCargaTributaria, input_name='ValorCargaTributaria'), namespaceprefix_ , eol_))
if self.PercentualCargaTributaria is not None:
namespaceprefix_ = self.PercentualCargaTributaria_nsprefix_ + ':' if (UseCapturedNS_ and self.PercentualCargaTributaria_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sPercentualCargaTributaria>%s</%sPercentualCargaTributaria>%s' % (namespaceprefix_ , self.gds_format_decimal(self.PercentualCargaTributaria, input_name='PercentualCargaTributaria'), namespaceprefix_ , eol_))
if self.FonteCargaTributaria is not None:
namespaceprefix_ = self.FonteCargaTributaria_nsprefix_ + ':' if (UseCapturedNS_ and self.FonteCargaTributaria_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sFonteCargaTributaria>%s</%sFonteCargaTributaria>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.FonteCargaTributaria), input_name='FonteCargaTributaria')), namespaceprefix_ , eol_))
if self.CodigoCEI is not None:
namespaceprefix_ = self.CodigoCEI_nsprefix_ + ':' if (UseCapturedNS_ and self.CodigoCEI_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sCodigoCEI>%s</%sCodigoCEI>%s' % (namespaceprefix_ , self.gds_format_integer(self.CodigoCEI, input_name='CodigoCEI'), namespaceprefix_ , eol_))
if self.MatriculaObra is not None:
namespaceprefix_ = self.MatriculaObra_nsprefix_ + ':' if (UseCapturedNS_ and self.MatriculaObra_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sMatriculaObra>%s</%sMatriculaObra>%s' % (namespaceprefix_ , self.gds_format_integer(self.MatriculaObra, input_name='MatriculaObra'), namespaceprefix_ , eol_))
if self.MunicipioPrestacao is not None:
namespaceprefix_ = self.MunicipioPrestacao_nsprefix_ + ':' if (UseCapturedNS_ and self.MunicipioPrestacao_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sMunicipioPrestacao>%s</%sMunicipioPrestacao>%s' % (namespaceprefix_ , self.gds_format_integer(self.MunicipioPrestacao, input_name='MunicipioPrestacao'), namespaceprefix_ , eol_))
if self.NumeroEncapsulamento is not None:
namespaceprefix_ = self.NumeroEncapsulamento_nsprefix_ + ':' if (UseCapturedNS_ and self.NumeroEncapsulamento_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sNumeroEncapsulamento>%s</%sNumeroEncapsulamento>%s' % (namespaceprefix_ , self.gds_format_integer(self.NumeroEncapsulamento, input_name='NumeroEncapsulamento'), namespaceprefix_ , eol_))
if self.ValorTotalRecebido is not None:
namespaceprefix_ = self.ValorTotalRecebido_nsprefix_ + ':' if (UseCapturedNS_ and self.ValorTotalRecebido_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sValorTotalRecebido>%s</%sValorTotalRecebido>%s' % (namespaceprefix_ , self.gds_format_decimal(self.ValorTotalRecebido, input_name='ValorTotalRecebido'), namespaceprefix_ , eol_))
def build(self, node, gds_collector_=None):
self.gds_collector_ = gds_collector_
if SaveElementTreeNode:
self.gds_elementtree_node_ = node
already_processed = set()
self.ns_prefix_ = node.prefix
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
return self
def buildAttributes(self, node, attrs, already_processed):
pass
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
if nodeName_ == 'Assinatura':
sval_ = child_.text
if sval_ is not None:
try:
bval_ = base64.b64decode(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires base64 encoded string: %s' % exp)
bval_ = self.gds_validate_base64(bval_, node, 'Assinatura')
else:
bval_ = None
self.Assinatura = bval_
self.Assinatura_nsprefix_ = child_.prefix
# validate type tpAssinatura
self.validate_tpAssinatura(self.Assinatura)
elif nodeName_ == 'ChaveRPS':
obj_ = tpChaveRPS.factory(parent_object_=self)
obj_.build(child_, gds_collector_=gds_collector_)
self.ChaveRPS = obj_
obj_.original_tagname_ = 'ChaveRPS'
elif nodeName_ == 'TipoRPS':
value_ = child_.text
value_ = self.gds_parse_string(value_, node, 'TipoRPS')
value_ = self.gds_validate_string(value_, node, 'TipoRPS')
self.TipoRPS = value_
self.TipoRPS_nsprefix_ = child_.prefix
# validate type tpTipoRPS
self.validate_tpTipoRPS(self.TipoRPS)
elif nodeName_ == 'DataEmissao':
sval_ = child_.text
dval_ = self.gds_parse_date(sval_)
self.DataEmissao = dval_
self.DataEmissao_nsprefix_ = child_.prefix
elif nodeName_ == 'StatusRPS':
value_ = child_.text
value_ = self.gds_parse_string(value_, node, 'StatusRPS')
value_ = self.gds_validate_string(value_, node, 'StatusRPS')
self.StatusRPS = value_
self.StatusRPS_nsprefix_ = child_.prefix
# validate type tpStatusNFe
self.validate_tpStatusNFe(self.StatusRPS)
elif nodeName_ == 'TributacaoRPS':
value_ = child_.text
value_ = self.gds_parse_string(value_, node, 'TributacaoRPS')
value_ = self.gds_validate_string(value_, node, 'TributacaoRPS')
self.TributacaoRPS = value_
self.TributacaoRPS_nsprefix_ = child_.prefix
# validate type tpTributacaoNFe
self.validate_tpTributacaoNFe(self.TributacaoRPS)
elif nodeName_ == 'ValorServicos' and child_.text:
sval_ = child_.text
fval_ = self.gds_parse_decimal(sval_, node, 'ValorServicos')
fval_ = self.gds_validate_decimal(fval_, node, 'ValorServicos')
self.ValorServicos = fval_
self.ValorServicos_nsprefix_ = child_.prefix
# validate type tpValor
self.validate_tpValor(self.ValorServicos)
elif nodeName_ == 'ValorDeducoes' and child_.text:
sval_ = child_.text
fval_ = self.gds_parse_decimal(sval_, node, 'ValorDeducoes')
fval_ = self.gds_validate_decimal(fval_, node, 'ValorDeducoes')
self.ValorDeducoes = fval_
self.ValorDeducoes_nsprefix_ = child_.prefix
# validate type tpValor
self.validate_tpValor(self.ValorDeducoes)
elif nodeName_ == 'ValorPIS' and child_.text:
sval_ = child_.text
fval_ = self.gds_parse_decimal(sval_, node, 'ValorPIS')
fval_ = self.gds_validate_decimal(fval_, node, 'ValorPIS')
self.ValorPIS = fval_
self.ValorPIS_nsprefix_ = child_.prefix
# validate type tpValor
self.validate_tpValor(self.ValorPIS)
elif nodeName_ == 'ValorCOFINS' and child_.text:
sval_ = child_.text
fval_ = self.gds_parse_decimal(sval_, node, 'ValorCOFINS')
fval_ = self.gds_validate_decimal(fval_, node, 'ValorCOFINS')
self.ValorCOFINS = fval_
self.ValorCOFINS_nsprefix_ = child_.prefix
# validate type tpValor
self.validate_tpValor(self.ValorCOFINS)
elif nodeName_ == 'ValorINSS' and child_.text:
sval_ = child_.text
fval_ = self.gds_parse_decimal(sval_, node, 'ValorINSS')
fval_ = self.gds_validate_decimal(fval_, node, 'ValorINSS')
self.ValorINSS = fval_
self.ValorINSS_nsprefix_ = child_.prefix
# validate type tpValor
self.validate_tpValor(self.ValorINSS)
elif nodeName_ == 'ValorIR' and child_.text:
sval_ = child_.text
fval_ = self.gds_parse_decimal(sval_, node, 'ValorIR')
fval_ = self.gds_validate_decimal(fval_, node, 'ValorIR')
self.ValorIR = fval_
self.ValorIR_nsprefix_ = child_.prefix
# validate type tpValor
self.validate_tpValor(self.ValorIR)
elif nodeName_ == 'ValorCSLL' and child_.text:
sval_ = child_.text
fval_ = self.gds_parse_decimal(sval_, node, 'ValorCSLL')
fval_ = self.gds_validate_decimal(fval_, node, 'ValorCSLL')
self.ValorCSLL = fval_
self.ValorCSLL_nsprefix_ = child_.prefix
# validate type tpValor
self.validate_tpValor(self.ValorCSLL)
elif nodeName_ == 'CodigoServico' and child_.text:
sval_ = child_.text
ival_ = self.gds_parse_integer(sval_, node, 'CodigoServico')
ival_ = self.gds_validate_integer(ival_, node, 'CodigoServico')
self.CodigoServico = ival_
self.CodigoServico_nsprefix_ = child_.prefix
# validate type tpCodigoServico
self.validate_tpCodigoServico(self.CodigoServico)
elif nodeName_ == 'AliquotaServicos' and child_.text:
sval_ = child_.text
fval_ = self.gds_parse_decimal(sval_, node, 'AliquotaServicos')
fval_ = self.gds_validate_decimal(fval_, node, 'AliquotaServicos')
self.AliquotaServicos = fval_
self.AliquotaServicos_nsprefix_ = child_.prefix
# validate type tpAliquota
self.validate_tpAliquota(self.AliquotaServicos)
elif nodeName_ == 'ISSRetido':
sval_ = child_.text
ival_ = self.gds_parse_boolean(sval_, node, 'ISSRetido')
ival_ = self.gds_validate_boolean(ival_, node, 'ISSRetido')
self.ISSRetido = ival_
self.ISSRetido_nsprefix_ = child_.prefix
elif nodeName_ == 'CPFCNPJTomador':
obj_ = tpCPFCNPJ.factory(parent_object_=self)
obj_.build(child_, gds_collector_=gds_collector_)
self.CPFCNPJTomador = obj_
obj_.original_tagname_ = 'CPFCNPJTomador'
elif nodeName_ == 'InscricaoMunicipalTomador' and child_.text:
sval_ = child_.text
ival_ = self.gds_parse_integer(sval_, node, 'InscricaoMunicipalTomador')
ival_ = self.gds_validate_integer(ival_, node, 'InscricaoMunicipalTomador')
self.InscricaoMunicipalTomador = ival_
self.InscricaoMunicipalTomador_nsprefix_ = child_.prefix
# validate type tpInscricaoMunicipal
self.validate_tpInscricaoMunicipal(self.InscricaoMunicipalTomador)
elif nodeName_ == 'InscricaoEstadualTomador' and child_.text:
sval_ = child_.text
ival_ = self.gds_parse_integer(sval_, node, 'InscricaoEstadualTomador')
ival_ = self.gds_validate_integer(ival_, node, 'InscricaoEstadualTomador')
self.InscricaoEstadualTomador = ival_
self.InscricaoEstadualTomador_nsprefix_ = child_.prefix
# validate type tpInscricaoEstadual
self.validate_tpInscricaoEstadual(self.InscricaoEstadualTomador)
elif nodeName_ == 'RazaoSocialTomador':
value_ = child_.text
value_ = self.gds_parse_string(value_, node, 'RazaoSocialTomador')
value_ = self.gds_validate_string(value_, node, 'RazaoSocialTomador')
self.RazaoSocialTomador = value_
self.RazaoSocialTomador_nsprefix_ = child_.prefix
# validate type tpRazaoSocial
self.validate_tpRazaoSocial(self.RazaoSocialTomador)
elif nodeName_ == 'EnderecoTomador':
obj_ = tpEndereco.factory(parent_object_=self)
obj_.build(child_, gds_collector_=gds_collector_)
self.EnderecoTomador = obj_
obj_.original_tagname_ = 'EnderecoTomador'
elif nodeName_ == 'EmailTomador':
value_ = child_.text
value_ = self.gds_parse_string(value_, node, 'EmailTomador')
value_ = self.gds_validate_string(value_, node, 'EmailTomador')
self.EmailTomador = value_
self.EmailTomador_nsprefix_ = child_.prefix
# validate type tpEmail
self.validate_tpEmail(self.EmailTomador)
elif nodeName_ == 'CPFCNPJIntermediario':
obj_ = tpCPFCNPJ.factory(parent_object_=self)
obj_.build(child_, gds_collector_=gds_collector_)
self.CPFCNPJIntermediario = obj_
obj_.original_tagname_ = 'CPFCNPJIntermediario'
elif nodeName_ == 'InscricaoMunicipalIntermediario' and child_.text:
sval_ = child_.text
ival_ = self.gds_parse_integer(sval_, node, 'InscricaoMunicipalIntermediario')
ival_ = self.gds_validate_integer(ival_, node, 'InscricaoMunicipalIntermediario')
self.InscricaoMunicipalIntermediario = ival_
self.InscricaoMunicipalIntermediario_nsprefix_ = child_.prefix
# validate type tpInscricaoMunicipal
self.validate_tpInscricaoMunicipal(self.InscricaoMunicipalIntermediario)
elif nodeName_ == 'ISSRetidoIntermediario':
value_ = child_.text
value_ = self.gds_parse_string(value_, node, 'ISSRetidoIntermediario')
value_ = self.gds_validate_string(value_, node, 'ISSRetidoIntermediario')
self.ISSRetidoIntermediario = value_
self.ISSRetidoIntermediario_nsprefix_ = child_.prefix
elif nodeName_ == 'EmailIntermediario':
value_ = child_.text
value_ = self.gds_parse_string(value_, node, 'EmailIntermediario')
value_ = self.gds_validate_string(value_, node, 'EmailIntermediario')
self.EmailIntermediario = value_
self.EmailIntermediario_nsprefix_ = child_.prefix
# validate type tpEmail
self.validate_tpEmail(self.EmailIntermediario)
elif nodeName_ == 'Discriminacao':
value_ = child_.text
value_ = self.gds_parse_string(value_, node, 'Discriminacao')
value_ = self.gds_validate_string(value_, node, 'Discriminacao')
self.Discriminacao = value_
self.Discriminacao_nsprefix_ = child_.prefix
# validate type tpDiscriminacao
self.validate_tpDiscriminacao(self.Discriminacao)
elif nodeName_ == 'ValorCargaTributaria' and child_.text:
sval_ = child_.text
fval_ = self.gds_parse_decimal(sval_, node, 'ValorCargaTributaria')
fval_ = self.gds_validate_decimal(fval_, node, 'ValorCargaTributaria')
self.ValorCargaTributaria = fval_
self.ValorCargaTributaria_nsprefix_ = child_.prefix
# validate type tpValor
self.validate_tpValor(self.ValorCargaTributaria)
elif nodeName_ == 'PercentualCargaTributaria' and child_.text:
sval_ = child_.text
fval_ = self.gds_parse_decimal(sval_, node, 'PercentualCargaTributaria')
fval_ = self.gds_validate_decimal(fval_, node, 'PercentualCargaTributaria')
self.PercentualCargaTributaria = fval_
self.PercentualCargaTributaria_nsprefix_ = child_.prefix
# validate type tpPercentualCargaTributaria
self.validate_tpPercentualCargaTributaria(self.PercentualCargaTributaria)
elif nodeName_ == 'FonteCargaTributaria':
value_ = child_.text
value_ = self.gds_parse_string(value_, node, 'FonteCargaTributaria')
value_ = self.gds_validate_string(value_, node, 'FonteCargaTributaria')
self.FonteCargaTributaria = value_
self.FonteCargaTributaria_nsprefix_ = child_.prefix
# validate type tpFonteCargaTributaria
self.validate_tpFonteCargaTributaria(self.FonteCargaTributaria)
elif nodeName_ == 'CodigoCEI' and child_.text:
sval_ = child_.text
ival_ = self.gds_parse_integer(sval_, node, 'CodigoCEI')
ival_ = self.gds_validate_integer(ival_, node, 'CodigoCEI')
self.CodigoCEI = ival_
self.CodigoCEI_nsprefix_ = child_.prefix
# validate type tpNumero
self.validate_tpNumero(self.CodigoCEI)
elif nodeName_ == 'MatriculaObra' and child_.text:
sval_ = child_.text
ival_ = self.gds_parse_integer(sval_, node, 'MatriculaObra')
ival_ = self.gds_validate_integer(ival_, node, 'MatriculaObra')
self.MatriculaObra = ival_
self.MatriculaObra_nsprefix_ = child_.prefix
# validate type tpNumero
self.validate_tpNumero(self.MatriculaObra)
elif nodeName_ == 'MunicipioPrestacao' and child_.text:
sval_ = child_.text
ival_ = self.gds_parse_integer(sval_, node, 'MunicipioPrestacao')
ival_ = self.gds_validate_integer(ival_, node, 'MunicipioPrestacao')
self.MunicipioPrestacao = ival_
self.MunicipioPrestacao_nsprefix_ = child_.prefix
# validate type tpCidade
self.validate_tpCidade(self.MunicipioPrestacao)
elif nodeName_ == 'NumeroEncapsulamento' and child_.text:
sval_ = child_.text
ival_ = self.gds_parse_integer(sval_, node, 'NumeroEncapsulamento')
ival_ = self.gds_validate_integer(ival_, node, 'NumeroEncapsulamento')
self.NumeroEncapsulamento = ival_
self.NumeroEncapsulamento_nsprefix_ = child_.prefix
# validate type tpNumero
self.validate_tpNumero(self.NumeroEncapsulamento)
elif nodeName_ == 'ValorTotalRecebido' and child_.text:
sval_ = child_.text
fval_ = self.gds_parse_decimal(sval_, node, 'ValorTotalRecebido')
fval_ = self.gds_validate_decimal(fval_, node, 'ValorTotalRecebido')
self.ValorTotalRecebido = fval_
self.ValorTotalRecebido_nsprefix_ = child_.prefix
# validate type tpValor
self.validate_tpValor(self.ValorTotalRecebido)
# end class tpRPS
class SignatureType(GeneratedsSuper):
__hash__ = GeneratedsSuper.__hash__
member_data_items_ = [
MemberSpec_('Id', 'xs:string', 0, 1, {'use': 'optional'}),
MemberSpec_('SignedInfo', 'SignedInfoType', 0, 0, {'name': 'SignedInfo', 'type': 'SignedInfoType'}, None),
MemberSpec_('SignatureValue', 'SignatureValueType', 0, 0, {'name': 'SignatureValue', 'type': 'SignatureValueType'}, None),
MemberSpec_('KeyInfo', 'KeyInfoType', 0, 0, {'name': 'KeyInfo', 'type': 'KeyInfoType'}, None),
]
subclass = None
superclass = None
def __init__(self, Id=None, SignedInfo=None, SignatureValue=None, KeyInfo=None, gds_collector_=None, **kwargs_):
self.gds_collector_ = gds_collector_
self.gds_elementtree_node_ = None
self.original_tagname_ = None
self.parent_object_ = kwargs_.get('parent_object_')
self.ns_prefix_ = None
self.Id = _cast(None, Id)
self.Id_nsprefix_ = None
self.SignedInfo = SignedInfo
self.SignedInfo_nsprefix_ = None
self.SignatureValue = SignatureValue
self.SignatureValue_nsprefix_ = None
self.KeyInfo = KeyInfo
self.KeyInfo_nsprefix_ = None
def factory(*args_, **kwargs_):
if CurrentSubclassModule_ is not None:
subclass = getSubclassFromModule_(
CurrentSubclassModule_, SignatureType)
if subclass is not None:
return subclass(*args_, **kwargs_)
if SignatureType.subclass:
return SignatureType.subclass(*args_, **kwargs_)
else:
return SignatureType(*args_, **kwargs_)
factory = staticmethod(factory)
def hasContent_(self):
if (
self.SignedInfo is not None or
self.SignatureValue is not None or
self.KeyInfo is not None
):
return True
else:
return False
def export(self, outfile, level, namespaceprefix_='ds:', namespacedef_='', name_='SignatureType', pretty_print=True):
imported_ns_def_ = GenerateDSNamespaceDefs_.get('SignatureType')
if imported_ns_def_ is not None:
namespacedef_ = imported_ns_def_
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None and name_ == 'SignatureType':
name_ = self.original_tagname_
if UseCapturedNS_ and self.ns_prefix_:
namespaceprefix_ = self.ns_prefix_ + ':'
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='SignatureType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='SignatureType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='ds:', name_='SignatureType'):
if self.Id is not None and 'Id' not in already_processed:
already_processed.add('Id')
outfile.write(' Id=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.Id), input_name='Id')), ))
def exportChildren(self, outfile, level, namespaceprefix_='ds:', namespacedef_='', name_='SignatureType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.SignedInfo is not None:
namespaceprefix_ = self.SignedInfo_nsprefix_ + ':' if (UseCapturedNS_ and self.SignedInfo_nsprefix_) else ''
self.SignedInfo.export(outfile, level, namespaceprefix_, namespacedef_='', name_='SignedInfo', pretty_print=pretty_print)
if self.SignatureValue is not None:
namespaceprefix_ = self.SignatureValue_nsprefix_ + ':' if (UseCapturedNS_ and self.SignatureValue_nsprefix_) else ''
self.SignatureValue.export(outfile, level, namespaceprefix_, namespacedef_='', name_='SignatureValue', pretty_print=pretty_print)
if self.KeyInfo is not None:
namespaceprefix_ = self.KeyInfo_nsprefix_ + ':' if (UseCapturedNS_ and self.KeyInfo_nsprefix_) else ''
self.KeyInfo.export(outfile, level, namespaceprefix_, namespacedef_='', name_='KeyInfo', pretty_print=pretty_print)
def build(self, node, gds_collector_=None):
self.gds_collector_ = gds_collector_
if SaveElementTreeNode:
self.gds_elementtree_node_ = node
already_processed = set()
self.ns_prefix_ = node.prefix
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
return self
def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('Id', node)
if value is not None and 'Id' not in already_processed:
already_processed.add('Id')
self.Id = value
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
if nodeName_ == 'SignedInfo':
obj_ = SignedInfoType.factory(parent_object_=self)
obj_.build(child_, gds_collector_=gds_collector_)
self.SignedInfo = obj_
obj_.original_tagname_ = 'SignedInfo'
elif nodeName_ == 'SignatureValue':
obj_ = SignatureValueType.factory(parent_object_=self)
obj_.build(child_, gds_collector_=gds_collector_)
self.SignatureValue = obj_
obj_.original_tagname_ = 'SignatureValue'
elif nodeName_ == 'KeyInfo':
obj_ = KeyInfoType.factory(parent_object_=self)
obj_.build(child_, gds_collector_=gds_collector_)
self.KeyInfo = obj_
obj_.original_tagname_ = 'KeyInfo'
# end class SignatureType
class SignatureValueType(GeneratedsSuper):
__hash__ = GeneratedsSuper.__hash__
member_data_items_ = [
MemberSpec_('Id', 'xs:string', 0, 1, {'use': 'optional'}),
MemberSpec_('valueOf_', 'xs:base64Binary', 0),
]
subclass = None
superclass = None
def __init__(self, Id=None, valueOf_=None, gds_collector_=None, **kwargs_):
self.gds_collector_ = gds_collector_
self.gds_elementtree_node_ = None
self.original_tagname_ = None
self.parent_object_ = kwargs_.get('parent_object_')
self.ns_prefix_ = None
self.Id = _cast(None, Id)
self.Id_nsprefix_ = None
self.valueOf_ = valueOf_
def factory(*args_, **kwargs_):
if CurrentSubclassModule_ is not None:
subclass = getSubclassFromModule_(
CurrentSubclassModule_, SignatureValueType)
if subclass is not None:
return subclass(*args_, **kwargs_)
if SignatureValueType.subclass:
return SignatureValueType.subclass(*args_, **kwargs_)
else:
return SignatureValueType(*args_, **kwargs_)
factory = staticmethod(factory)
def hasContent_(self):
if (
(1 if type(self.valueOf_) in [int,float] else self.valueOf_)
):
return True
else:
return False
def export(self, outfile, level, namespaceprefix_='ds:', namespacedef_='', name_='SignatureValueType', pretty_print=True):
imported_ns_def_ = GenerateDSNamespaceDefs_.get('SignatureValueType')
if imported_ns_def_ is not None:
namespacedef_ = imported_ns_def_
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None and name_ == 'SignatureValueType':
name_ = self.original_tagname_
if UseCapturedNS_ and self.ns_prefix_:
namespaceprefix_ = self.ns_prefix_ + ':'
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='SignatureValueType')
if self.hasContent_():
outfile.write('>')
outfile.write(self.convert_unicode(self.valueOf_))
self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='SignatureValueType', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='ds:', name_='SignatureValueType'):
if self.Id is not None and 'Id' not in already_processed:
already_processed.add('Id')
outfile.write(' Id=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.Id), input_name='Id')), ))
def exportChildren(self, outfile, level, namespaceprefix_='ds:', namespacedef_='', name_='SignatureValueType', fromsubclass_=False, pretty_print=True):
pass
def build(self, node, gds_collector_=None):
self.gds_collector_ = gds_collector_
if SaveElementTreeNode:
self.gds_elementtree_node_ = node
already_processed = set()
self.ns_prefix_ = node.prefix
self.buildAttributes(node, node.attrib, already_processed)
self.valueOf_ = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
return self
def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('Id', node)
if value is not None and 'Id' not in already_processed:
already_processed.add('Id')
self.Id = value
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
pass
# end class SignatureValueType
class SignedInfoType(GeneratedsSuper):
__hash__ = GeneratedsSuper.__hash__
member_data_items_ = [
MemberSpec_('Id', 'xs:string', 0, 1, {'use': 'optional'}),
MemberSpec_('CanonicalizationMethod', 'CanonicalizationMethodType', 0, 0, {'name': 'CanonicalizationMethod', 'type': 'CanonicalizationMethodType'}, None),
MemberSpec_('SignatureMethod', 'SignatureMethodType', 0, 0, {'name': 'SignatureMethod', 'type': 'SignatureMethodType'}, None),
MemberSpec_('Reference', 'ReferenceType', 1, 0, {'maxOccurs': 'unbounded', 'name': 'Reference', 'type': 'ReferenceType'}, None),
]
subclass = None
superclass = None
def __init__(self, Id=None, CanonicalizationMethod=None, SignatureMethod=None, Reference=None, gds_collector_=None, **kwargs_):
self.gds_collector_ = gds_collector_
self.gds_elementtree_node_ = None
self.original_tagname_ = None
self.parent_object_ = kwargs_.get('parent_object_')
self.ns_prefix_ = None
self.Id = _cast(None, Id)
self.Id_nsprefix_ = None
self.CanonicalizationMethod = CanonicalizationMethod
self.CanonicalizationMethod_nsprefix_ = None
self.SignatureMethod = SignatureMethod
self.SignatureMethod_nsprefix_ = None
if Reference is None:
self.Reference = []
else:
self.Reference = Reference
self.Reference_nsprefix_ = None
def factory(*args_, **kwargs_):
if CurrentSubclassModule_ is not None:
subclass = getSubclassFromModule_(
CurrentSubclassModule_, SignedInfoType)
if subclass is not None:
return subclass(*args_, **kwargs_)
if SignedInfoType.subclass:
return SignedInfoType.subclass(*args_, **kwargs_)
else:
return SignedInfoType(*args_, **kwargs_)
factory = staticmethod(factory)
def hasContent_(self):
if (
self.CanonicalizationMethod is not None or
self.SignatureMethod is not None or
self.Reference
):
return True
else:
return False
def export(self, outfile, level, namespaceprefix_='ds:', namespacedef_='', name_='SignedInfoType', pretty_print=True):
imported_ns_def_ = GenerateDSNamespaceDefs_.get('SignedInfoType')
if imported_ns_def_ is not None:
namespacedef_ = imported_ns_def_
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None and name_ == 'SignedInfoType':
name_ = self.original_tagname_
if UseCapturedNS_ and self.ns_prefix_:
namespaceprefix_ = self.ns_prefix_ + ':'
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='SignedInfoType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='SignedInfoType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='ds:', name_='SignedInfoType'):
if self.Id is not None and 'Id' not in already_processed:
already_processed.add('Id')
outfile.write(' Id=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.Id), input_name='Id')), ))
def exportChildren(self, outfile, level, namespaceprefix_='ds:', namespacedef_='', name_='SignedInfoType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.CanonicalizationMethod is not None:
namespaceprefix_ = self.CanonicalizationMethod_nsprefix_ + ':' if (UseCapturedNS_ and self.CanonicalizationMethod_nsprefix_) else ''
self.CanonicalizationMethod.export(outfile, level, namespaceprefix_, namespacedef_='', name_='CanonicalizationMethod', pretty_print=pretty_print)
if self.SignatureMethod is not None:
namespaceprefix_ = self.SignatureMethod_nsprefix_ + ':' if (UseCapturedNS_ and self.SignatureMethod_nsprefix_) else ''
self.SignatureMethod.export(outfile, level, namespaceprefix_, namespacedef_='', name_='SignatureMethod', pretty_print=pretty_print)
for Reference_ in self.Reference:
namespaceprefix_ = self.Reference_nsprefix_ + ':' if (UseCapturedNS_ and self.Reference_nsprefix_) else ''
Reference_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='Reference', pretty_print=pretty_print)
def build(self, node, gds_collector_=None):
self.gds_collector_ = gds_collector_
if SaveElementTreeNode:
self.gds_elementtree_node_ = node
already_processed = set()
self.ns_prefix_ = node.prefix
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
return self
def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('Id', node)
if value is not None and 'Id' not in already_processed:
already_processed.add('Id')
self.Id = value
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
if nodeName_ == 'CanonicalizationMethod':
obj_ = CanonicalizationMethodType.factory(parent_object_=self)
obj_.build(child_, gds_collector_=gds_collector_)
self.CanonicalizationMethod = obj_
obj_.original_tagname_ = 'CanonicalizationMethod'
elif nodeName_ == 'SignatureMethod':
obj_ = SignatureMethodType.factory(parent_object_=self)
obj_.build(child_, gds_collector_=gds_collector_)
self.SignatureMethod = obj_
obj_.original_tagname_ = 'SignatureMethod'
elif nodeName_ == 'Reference':
obj_ = ReferenceType.factory(parent_object_=self)
obj_.build(child_, gds_collector_=gds_collector_)
self.Reference.append(obj_)
obj_.original_tagname_ = 'Reference'
# end class SignedInfoType
class ReferenceType(GeneratedsSuper):
__hash__ = GeneratedsSuper.__hash__
member_data_items_ = [
MemberSpec_('Id', 'xs:string', 0, 1, {'use': 'optional'}),
MemberSpec_('URI', 'xs:anyURI', 0, 1, {'use': 'optional'}),
MemberSpec_('Type', 'xs:anyURI', 0, 1, {'use': 'optional'}),
MemberSpec_('Transforms', 'TransformsType', 0, 0, {'name': 'Transforms', 'type': 'TransformsType'}, None),
MemberSpec_('DigestMethod', 'DigestMethodType', 0, 0, {'name': 'DigestMethod', 'type': 'DigestMethodType'}, None),
MemberSpec_('DigestValue', ['DigestValueType', 'xs:base64Binary'], 0, 0, {'name': 'DigestValue', 'type': 'xs:base64Binary'}, None),
]
subclass = None
superclass = None
def __init__(self, Id=None, URI=None, Type=None, Transforms=None, DigestMethod=None, DigestValue=None, gds_collector_=None, **kwargs_):
self.gds_collector_ = gds_collector_
self.gds_elementtree_node_ = None
self.original_tagname_ = None
self.parent_object_ = kwargs_.get('parent_object_')
self.ns_prefix_ = None
self.Id = _cast(None, Id)
self.Id_nsprefix_ = None
self.URI = _cast(None, URI)
self.URI_nsprefix_ = None
self.Type = _cast(None, Type)
self.Type_nsprefix_ = None
self.Transforms = Transforms
self.Transforms_nsprefix_ = None
self.DigestMethod = DigestMethod
self.DigestMethod_nsprefix_ = None
self.DigestValue = DigestValue
self.validate_DigestValueType(self.DigestValue)
self.DigestValue_nsprefix_ = None
def factory(*args_, **kwargs_):
if CurrentSubclassModule_ is not None:
subclass = getSubclassFromModule_(
CurrentSubclassModule_, ReferenceType)
if subclass is not None:
return subclass(*args_, **kwargs_)
if ReferenceType.subclass:
return ReferenceType.subclass(*args_, **kwargs_)
else:
return ReferenceType(*args_, **kwargs_)
factory = staticmethod(factory)
def validate_DigestValueType(self, value):
result = True
# Validate type DigestValueType, a restriction on xs:base64Binary.
if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
pass
return result
def hasContent_(self):
if (
self.Transforms is not None or
self.DigestMethod is not None or
self.DigestValue is not None
):
return True
else:
return False
def export(self, outfile, level, namespaceprefix_='ds:', namespacedef_='', name_='ReferenceType', pretty_print=True):
imported_ns_def_ = GenerateDSNamespaceDefs_.get('ReferenceType')
if imported_ns_def_ is not None:
namespacedef_ = imported_ns_def_
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None and name_ == 'ReferenceType':
name_ = self.original_tagname_
if UseCapturedNS_ and self.ns_prefix_:
namespaceprefix_ = self.ns_prefix_ + ':'
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='ReferenceType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='ReferenceType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='ds:', name_='ReferenceType'):
if self.Id is not None and 'Id' not in already_processed:
already_processed.add('Id')
outfile.write(' Id=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.Id), input_name='Id')), ))
if self.URI is not None and 'URI' not in already_processed:
already_processed.add('URI')
outfile.write(' URI=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.URI), input_name='URI')), ))
if self.Type is not None and 'Type' not in already_processed:
already_processed.add('Type')
outfile.write(' Type=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.Type), input_name='Type')), ))
def exportChildren(self, outfile, level, namespaceprefix_='ds:', namespacedef_='', name_='ReferenceType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.Transforms is not None:
namespaceprefix_ = self.Transforms_nsprefix_ + ':' if (UseCapturedNS_ and self.Transforms_nsprefix_) else ''
self.Transforms.export(outfile, level, namespaceprefix_, namespacedef_='', name_='Transforms', pretty_print=pretty_print)
if self.DigestMethod is not None:
namespaceprefix_ = self.DigestMethod_nsprefix_ + ':' if (UseCapturedNS_ and self.DigestMethod_nsprefix_) else ''
self.DigestMethod.export(outfile, level, namespaceprefix_, namespacedef_='', name_='DigestMethod', pretty_print=pretty_print)
if self.DigestValue is not None:
namespaceprefix_ = self.DigestValue_nsprefix_ + ':' if (UseCapturedNS_ and self.DigestValue_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sDigestValue>%s</%sDigestValue>%s' % (namespaceprefix_ , self.gds_format_base64(self.DigestValue, input_name='DigestValue'), namespaceprefix_ , eol_))
def build(self, node, gds_collector_=None):
self.gds_collector_ = gds_collector_
if SaveElementTreeNode:
self.gds_elementtree_node_ = node
already_processed = set()
self.ns_prefix_ = node.prefix
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
return self
def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('Id', node)
if value is not None and 'Id' not in already_processed:
already_processed.add('Id')
self.Id = value
value = find_attr_value_('URI', node)
if value is not None and 'URI' not in already_processed:
already_processed.add('URI')
self.URI = value
value = find_attr_value_('Type', node)
if value is not None and 'Type' not in already_processed:
already_processed.add('Type')
self.Type = value
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
if nodeName_ == 'Transforms':
obj_ = TransformsType.factory(parent_object_=self)
obj_.build(child_, gds_collector_=gds_collector_)
self.Transforms = obj_
obj_.original_tagname_ = 'Transforms'
elif nodeName_ == 'DigestMethod':
obj_ = DigestMethodType.factory(parent_object_=self)
obj_.build(child_, gds_collector_=gds_collector_)
self.DigestMethod = obj_
obj_.original_tagname_ = 'DigestMethod'
elif nodeName_ == 'DigestValue':
sval_ = child_.text
if sval_ is not None:
try:
bval_ = base64.b64decode(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires base64 encoded string: %s' % exp)
bval_ = self.gds_validate_base64(bval_, node, 'DigestValue')
else:
bval_ = None
self.DigestValue = bval_
self.DigestValue_nsprefix_ = child_.prefix
# validate type DigestValueType
self.validate_DigestValueType(self.DigestValue)
# end class ReferenceType
class TransformsType(GeneratedsSuper):
__hash__ = GeneratedsSuper.__hash__
member_data_items_ = [
MemberSpec_('Transform', 'TransformType', 1, 0, {'maxOccurs': 'unbounded', 'name': 'Transform', 'type': 'TransformType'}, None),
]
subclass = None
superclass = None
def __init__(self, Transform=None, gds_collector_=None, **kwargs_):
self.gds_collector_ = gds_collector_
self.gds_elementtree_node_ = None
self.original_tagname_ = None
self.parent_object_ = kwargs_.get('parent_object_')
self.ns_prefix_ = None
if Transform is None:
self.Transform = []
else:
self.Transform = Transform
self.Transform_nsprefix_ = None
def factory(*args_, **kwargs_):
if CurrentSubclassModule_ is not None:
subclass = getSubclassFromModule_(
CurrentSubclassModule_, TransformsType)
if subclass is not None:
return subclass(*args_, **kwargs_)
if TransformsType.subclass:
return TransformsType.subclass(*args_, **kwargs_)
else:
return TransformsType(*args_, **kwargs_)
factory = staticmethod(factory)
def hasContent_(self):
if (
self.Transform
):
return True
else:
return False
def export(self, outfile, level, namespaceprefix_='ds:', namespacedef_='', name_='TransformsType', pretty_print=True):
imported_ns_def_ = GenerateDSNamespaceDefs_.get('TransformsType')
if imported_ns_def_ is not None:
namespacedef_ = imported_ns_def_
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None and name_ == 'TransformsType':
name_ = self.original_tagname_
if UseCapturedNS_ and self.ns_prefix_:
namespaceprefix_ = self.ns_prefix_ + ':'
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='TransformsType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='TransformsType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='ds:', name_='TransformsType'):
pass
def exportChildren(self, outfile, level, namespaceprefix_='ds:', namespacedef_='', name_='TransformsType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
for Transform_ in self.Transform:
namespaceprefix_ = self.Transform_nsprefix_ + ':' if (UseCapturedNS_ and self.Transform_nsprefix_) else ''
Transform_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='Transform', pretty_print=pretty_print)
def build(self, node, gds_collector_=None):
self.gds_collector_ = gds_collector_
if SaveElementTreeNode:
self.gds_elementtree_node_ = node
already_processed = set()
self.ns_prefix_ = node.prefix
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
return self
def buildAttributes(self, node, attrs, already_processed):
pass
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
if nodeName_ == 'Transform':
obj_ = TransformType.factory(parent_object_=self)
obj_.build(child_, gds_collector_=gds_collector_)
self.Transform.append(obj_)
obj_.original_tagname_ = 'Transform'
# end class TransformsType
class TransformType(GeneratedsSuper):
__hash__ = GeneratedsSuper.__hash__
member_data_items_ = [
MemberSpec_('Algorithm', 'xs:anyURI', 0, 0, {'use': 'required'}),
MemberSpec_('XPath', 'xs:string', 1, 1, {'maxOccurs': 'unbounded', 'minOccurs': '0', 'name': 'XPath', 'type': 'xs:string'}, None),
]
subclass = None
superclass = None
def __init__(self, Algorithm=None, XPath=None, gds_collector_=None, **kwargs_):
self.gds_collector_ = gds_collector_
self.gds_elementtree_node_ = None
self.original_tagname_ = None
self.parent_object_ = kwargs_.get('parent_object_')
self.ns_prefix_ = None
self.Algorithm = _cast(None, Algorithm)
self.Algorithm_nsprefix_ = None
if XPath is None:
self.XPath = []
else:
self.XPath = XPath
self.XPath_nsprefix_ = None
def factory(*args_, **kwargs_):
if CurrentSubclassModule_ is not None:
subclass = getSubclassFromModule_(
CurrentSubclassModule_, TransformType)
if subclass is not None:
return subclass(*args_, **kwargs_)
if TransformType.subclass:
return TransformType.subclass(*args_, **kwargs_)
else:
return TransformType(*args_, **kwargs_)
factory = staticmethod(factory)
def hasContent_(self):
if (
self.XPath
):
return True
else:
return False
def export(self, outfile, level, namespaceprefix_='ds:', namespacedef_='', name_='TransformType', pretty_print=True):
imported_ns_def_ = GenerateDSNamespaceDefs_.get('TransformType')
if imported_ns_def_ is not None:
namespacedef_ = imported_ns_def_
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None and name_ == 'TransformType':
name_ = self.original_tagname_
if UseCapturedNS_ and self.ns_prefix_:
namespaceprefix_ = self.ns_prefix_ + ':'
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='TransformType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='TransformType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='ds:', name_='TransformType'):
if self.Algorithm is not None and 'Algorithm' not in already_processed:
already_processed.add('Algorithm')
outfile.write(' Algorithm=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.Algorithm), input_name='Algorithm')), ))
def exportChildren(self, outfile, level, namespaceprefix_='ds:', namespacedef_='', name_='TransformType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
for XPath_ in self.XPath:
namespaceprefix_ = self.XPath_nsprefix_ + ':' if (UseCapturedNS_ and self.XPath_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sXPath>%s</%sXPath>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(XPath_), input_name='XPath')), namespaceprefix_ , eol_))
def build(self, node, gds_collector_=None):
self.gds_collector_ = gds_collector_
if SaveElementTreeNode:
self.gds_elementtree_node_ = node
already_processed = set()
self.ns_prefix_ = node.prefix
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
return self
def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('Algorithm', node)
if value is not None and 'Algorithm' not in already_processed:
already_processed.add('Algorithm')
self.Algorithm = value
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
if nodeName_ == 'XPath':
value_ = child_.text
value_ = self.gds_parse_string(value_, node, 'XPath')
value_ = self.gds_validate_string(value_, node, 'XPath')
self.XPath.append(value_)
self.XPath_nsprefix_ = child_.prefix
# end class TransformType
class KeyInfoType(GeneratedsSuper):
__hash__ = GeneratedsSuper.__hash__
member_data_items_ = [
MemberSpec_('Id', 'xs:string', 0, 1, {'use': 'optional'}),
MemberSpec_('X509Data', 'X509DataType', 0, 0, {'name': 'X509Data', 'type': 'X509DataType'}, None),
]
subclass = None
superclass = None
def __init__(self, Id=None, X509Data=None, gds_collector_=None, **kwargs_):
self.gds_collector_ = gds_collector_
self.gds_elementtree_node_ = None
self.original_tagname_ = None
self.parent_object_ = kwargs_.get('parent_object_')
self.ns_prefix_ = None
self.Id = _cast(None, Id)
self.Id_nsprefix_ = None
self.X509Data = X509Data
self.X509Data_nsprefix_ = None
def factory(*args_, **kwargs_):
if CurrentSubclassModule_ is not None:
subclass = getSubclassFromModule_(
CurrentSubclassModule_, KeyInfoType)
if subclass is not None:
return subclass(*args_, **kwargs_)
if KeyInfoType.subclass:
return KeyInfoType.subclass(*args_, **kwargs_)
else:
return KeyInfoType(*args_, **kwargs_)
factory = staticmethod(factory)
def hasContent_(self):
if (
self.X509Data is not None
):
return True
else:
return False
def export(self, outfile, level, namespaceprefix_='ds:', namespacedef_='', name_='KeyInfoType', pretty_print=True):
imported_ns_def_ = GenerateDSNamespaceDefs_.get('KeyInfoType')
if imported_ns_def_ is not None:
namespacedef_ = imported_ns_def_
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None and name_ == 'KeyInfoType':
name_ = self.original_tagname_
if UseCapturedNS_ and self.ns_prefix_:
namespaceprefix_ = self.ns_prefix_ + ':'
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='KeyInfoType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='KeyInfoType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='ds:', name_='KeyInfoType'):
if self.Id is not None and 'Id' not in already_processed:
already_processed.add('Id')
outfile.write(' Id=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.Id), input_name='Id')), ))
def exportChildren(self, outfile, level, namespaceprefix_='ds:', namespacedef_='', name_='KeyInfoType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.X509Data is not None:
namespaceprefix_ = self.X509Data_nsprefix_ + ':' if (UseCapturedNS_ and self.X509Data_nsprefix_) else ''
self.X509Data.export(outfile, level, namespaceprefix_, namespacedef_='', name_='X509Data', pretty_print=pretty_print)
def build(self, node, gds_collector_=None):
self.gds_collector_ = gds_collector_
if SaveElementTreeNode:
self.gds_elementtree_node_ = node
already_processed = set()
self.ns_prefix_ = node.prefix
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
return self
def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('Id', node)
if value is not None and 'Id' not in already_processed:
already_processed.add('Id')
self.Id = value
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
if nodeName_ == 'X509Data':
obj_ = X509DataType.factory(parent_object_=self)
obj_.build(child_, gds_collector_=gds_collector_)
self.X509Data = obj_
obj_.original_tagname_ = 'X509Data'
# end class KeyInfoType
class KeyValueType(GeneratedsSuper):
__hash__ = GeneratedsSuper.__hash__
member_data_items_ = [
MemberSpec_('RSAKeyValue', 'RSAKeyValueType', 0, 0, {'name': 'RSAKeyValue', 'type': 'RSAKeyValueType'}, None),
]
subclass = None
superclass = None
def __init__(self, RSAKeyValue=None, gds_collector_=None, **kwargs_):
self.gds_collector_ = gds_collector_
self.gds_elementtree_node_ = None
self.original_tagname_ = None
self.parent_object_ = kwargs_.get('parent_object_')
self.ns_prefix_ = None
self.RSAKeyValue = RSAKeyValue
self.RSAKeyValue_nsprefix_ = None
def factory(*args_, **kwargs_):
if CurrentSubclassModule_ is not None:
subclass = getSubclassFromModule_(
CurrentSubclassModule_, KeyValueType)
if subclass is not None:
return subclass(*args_, **kwargs_)
if KeyValueType.subclass:
return KeyValueType.subclass(*args_, **kwargs_)
else:
return KeyValueType(*args_, **kwargs_)
factory = staticmethod(factory)
def hasContent_(self):
if (
self.RSAKeyValue is not None
):
return True
else:
return False
def export(self, outfile, level, namespaceprefix_='ds:', namespacedef_='', name_='KeyValueType', pretty_print=True):
imported_ns_def_ = GenerateDSNamespaceDefs_.get('KeyValueType')
if imported_ns_def_ is not None:
namespacedef_ = imported_ns_def_
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None and name_ == 'KeyValueType':
name_ = self.original_tagname_
if UseCapturedNS_ and self.ns_prefix_:
namespaceprefix_ = self.ns_prefix_ + ':'
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='KeyValueType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='KeyValueType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='ds:', name_='KeyValueType'):
pass
def exportChildren(self, outfile, level, namespaceprefix_='ds:', namespacedef_='', name_='KeyValueType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.RSAKeyValue is not None:
namespaceprefix_ = self.RSAKeyValue_nsprefix_ + ':' if (UseCapturedNS_ and self.RSAKeyValue_nsprefix_) else ''
self.RSAKeyValue.export(outfile, level, namespaceprefix_, namespacedef_='', name_='RSAKeyValue', pretty_print=pretty_print)
def build(self, node, gds_collector_=None):
self.gds_collector_ = gds_collector_
if SaveElementTreeNode:
self.gds_elementtree_node_ = node
already_processed = set()
self.ns_prefix_ = node.prefix
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
return self
def buildAttributes(self, node, attrs, already_processed):
pass
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
if nodeName_ == 'RSAKeyValue':
obj_ = RSAKeyValueType.factory(parent_object_=self)
obj_.build(child_, gds_collector_=gds_collector_)
self.RSAKeyValue = obj_
obj_.original_tagname_ = 'RSAKeyValue'
# end class KeyValueType
class X509DataType(GeneratedsSuper):
__hash__ = GeneratedsSuper.__hash__
member_data_items_ = [
MemberSpec_('X509Certificate', 'xs:base64Binary', 0, 0, {'name': 'X509Certificate', 'type': 'xs:base64Binary'}, None),
]
subclass = None
superclass = None
def __init__(self, X509Certificate=None, gds_collector_=None, **kwargs_):
self.gds_collector_ = gds_collector_
self.gds_elementtree_node_ = None
self.original_tagname_ = None
self.parent_object_ = kwargs_.get('parent_object_')
self.ns_prefix_ = None
self.X509Certificate = X509Certificate
self.X509Certificate_nsprefix_ = None
def factory(*args_, **kwargs_):
if CurrentSubclassModule_ is not None:
subclass = getSubclassFromModule_(
CurrentSubclassModule_, X509DataType)
if subclass is not None:
return subclass(*args_, **kwargs_)
if X509DataType.subclass:
return X509DataType.subclass(*args_, **kwargs_)
else:
return X509DataType(*args_, **kwargs_)
factory = staticmethod(factory)
def hasContent_(self):
if (
self.X509Certificate is not None
):
return True
else:
return False
def export(self, outfile, level, namespaceprefix_='ds:', namespacedef_='', name_='X509DataType', pretty_print=True):
imported_ns_def_ = GenerateDSNamespaceDefs_.get('X509DataType')
if imported_ns_def_ is not None:
namespacedef_ = imported_ns_def_
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None and name_ == 'X509DataType':
name_ = self.original_tagname_
if UseCapturedNS_ and self.ns_prefix_:
namespaceprefix_ = self.ns_prefix_ + ':'
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='X509DataType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='X509DataType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='ds:', name_='X509DataType'):
pass
def exportChildren(self, outfile, level, namespaceprefix_='ds:', namespacedef_='', name_='X509DataType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.X509Certificate is not None:
namespaceprefix_ = self.X509Certificate_nsprefix_ + ':' if (UseCapturedNS_ and self.X509Certificate_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sX509Certificate>%s</%sX509Certificate>%s' % (namespaceprefix_ , self.gds_format_base64(self.X509Certificate, input_name='X509Certificate'), namespaceprefix_ , eol_))
def build(self, node, gds_collector_=None):
self.gds_collector_ = gds_collector_
if SaveElementTreeNode:
self.gds_elementtree_node_ = node
already_processed = set()
self.ns_prefix_ = node.prefix
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
return self
def buildAttributes(self, node, attrs, already_processed):
pass
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
if nodeName_ == 'X509Certificate':
sval_ = child_.text
if sval_ is not None:
try:
bval_ = base64.b64decode(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires base64 encoded string: %s' % exp)
bval_ = self.gds_validate_base64(bval_, node, 'X509Certificate')
else:
bval_ = None
self.X509Certificate = bval_
self.X509Certificate_nsprefix_ = child_.prefix
# end class X509DataType
class CabecalhoType(GeneratedsSuper):
"""Cabeçalho do retorno.Versão do Schema XML utilizado."""
__hash__ = GeneratedsSuper.__hash__
member_data_items_ = [
MemberSpec_('Versao', 'tipos:tpVersao', 0, 0, {'use': 'required'}),
MemberSpec_('Sucesso', ['tpSucesso', 'xs:boolean'], 0, 0, {'maxOccurs': '1', 'minOccurs': '1', 'name': 'Sucesso', 'type': 'xs:boolean'}, None),
MemberSpec_('InformacoesLote', 'tpInformacoesLote', 0, 1, {'maxOccurs': '1', 'minOccurs': '0', 'name': 'InformacoesLote', 'type': 'tpInformacoesLote'}, None),
]
subclass = None
superclass = None
def __init__(self, Versao='1', Sucesso=None, InformacoesLote=None, gds_collector_=None, **kwargs_):
self.gds_collector_ = gds_collector_
self.gds_elementtree_node_ = None
self.original_tagname_ = None
self.parent_object_ = kwargs_.get('parent_object_')
self.ns_prefix_ = None
self.Versao = _cast(None, Versao)
self.Versao_nsprefix_ = None
self.Sucesso = Sucesso
self.validate_tpSucesso(self.Sucesso)
self.Sucesso_nsprefix_ = None
self.InformacoesLote = InformacoesLote
self.InformacoesLote_nsprefix_ = None
def factory(*args_, **kwargs_):
if CurrentSubclassModule_ is not None:
subclass = getSubclassFromModule_(
CurrentSubclassModule_, CabecalhoType)
if subclass is not None:
return subclass(*args_, **kwargs_)
if CabecalhoType.subclass:
return CabecalhoType.subclass(*args_, **kwargs_)
else:
return CabecalhoType(*args_, **kwargs_)
factory = staticmethod(factory)
def validate_tpSucesso(self, value):
result = True
# Validate type tpSucesso, a restriction on xs:boolean.
if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
pass
return result
def validate_tpVersao(self, value):
# Validate type tipos:tpVersao, a restriction on xs:long.
if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
if not isinstance(value, int):
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (int)' % {"value": value, "lineno": lineno, })
return False
if not self.gds_validate_simple_patterns(
self.validate_tpVersao_patterns_, value):
self.gds_collector_.add_message('Value "%s" does not match xsd pattern restrictions: %s' % (encode_str_2_3(value), self.validate_tpVersao_patterns_, ))
validate_tpVersao_patterns_ = [['^([0-9]{1,3})$']]
def hasContent_(self):
if (
self.Sucesso is not None or
self.InformacoesLote is not None
):
return True
else:
return False
def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='CabecalhoType', pretty_print=True):
imported_ns_def_ = GenerateDSNamespaceDefs_.get('CabecalhoType')
if imported_ns_def_ is not None:
namespacedef_ = imported_ns_def_
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None and name_ == 'CabecalhoType':
name_ = self.original_tagname_
if UseCapturedNS_ and self.ns_prefix_:
namespaceprefix_ = self.ns_prefix_ + ':'
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='CabecalhoType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='CabecalhoType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='CabecalhoType'):
if self.Versao is not None and 'Versao' not in already_processed:
already_processed.add('Versao')
outfile.write(' Versao="%s"' % self.gds_format_integer(self.Versao, input_name='Versao'))
def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='CabecalhoType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.Sucesso is not None:
namespaceprefix_ = self.Sucesso_nsprefix_ + ':' if (UseCapturedNS_ and self.Sucesso_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sSucesso>%s</%sSucesso>%s' % (namespaceprefix_ , self.gds_format_boolean(self.Sucesso, input_name='Sucesso'), namespaceprefix_ , eol_))
if self.InformacoesLote is not None:
namespaceprefix_ = self.InformacoesLote_nsprefix_ + ':' if (UseCapturedNS_ and self.InformacoesLote_nsprefix_) else ''
self.InformacoesLote.export(outfile, level, namespaceprefix_, namespacedef_='', name_='InformacoesLote', pretty_print=pretty_print)
def build(self, node, gds_collector_=None):
self.gds_collector_ = gds_collector_
if SaveElementTreeNode:
self.gds_elementtree_node_ = node
already_processed = set()
self.ns_prefix_ = node.prefix
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
return self
def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('Versao', node)
if value is not None and 'Versao' not in already_processed:
already_processed.add('Versao')
self.Versao = self.gds_parse_integer(value, node, 'Versao')
self.validate_tpVersao(self.Versao) # validate type tpVersao
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
if nodeName_ == 'Sucesso':
sval_ = child_.text
ival_ = self.gds_parse_boolean(sval_, node, 'Sucesso')
ival_ = self.gds_validate_boolean(ival_, node, 'Sucesso')
self.Sucesso = ival_
self.Sucesso_nsprefix_ = child_.prefix
# validate type tpSucesso
self.validate_tpSucesso(self.Sucesso)
elif nodeName_ == 'InformacoesLote':
obj_ = tpInformacoesLote.factory(parent_object_=self)
obj_.build(child_, gds_collector_=gds_collector_)
self.InformacoesLote = obj_
obj_.original_tagname_ = 'InformacoesLote'
# end class CabecalhoType
class CanonicalizationMethodType(GeneratedsSuper):
__hash__ = GeneratedsSuper.__hash__
member_data_items_ = [
MemberSpec_('Algorithm', 'xs:anyURI', 0, 0, {'use': 'required'}),
]
subclass = None
superclass = None
def __init__(self, Algorithm=None, gds_collector_=None, **kwargs_):
self.gds_collector_ = gds_collector_
self.gds_elementtree_node_ = None
self.original_tagname_ = None
self.parent_object_ = kwargs_.get('parent_object_')
self.ns_prefix_ = None
self.Algorithm = _cast(None, Algorithm)
self.Algorithm_nsprefix_ = None
def factory(*args_, **kwargs_):
if CurrentSubclassModule_ is not None:
subclass = getSubclassFromModule_(
CurrentSubclassModule_, CanonicalizationMethodType)
if subclass is not None:
return subclass(*args_, **kwargs_)
if CanonicalizationMethodType.subclass:
return CanonicalizationMethodType.subclass(*args_, **kwargs_)
else:
return CanonicalizationMethodType(*args_, **kwargs_)
factory = staticmethod(factory)
def hasContent_(self):
if (
):
return True
else:
return False
def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='CanonicalizationMethodType', pretty_print=True):
imported_ns_def_ = GenerateDSNamespaceDefs_.get('CanonicalizationMethodType')
if imported_ns_def_ is not None:
namespacedef_ = imported_ns_def_
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None and name_ == 'CanonicalizationMethodType':
name_ = self.original_tagname_
if UseCapturedNS_ and self.ns_prefix_:
namespaceprefix_ = self.ns_prefix_ + ':'
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='CanonicalizationMethodType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='CanonicalizationMethodType', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='CanonicalizationMethodType'):
if self.Algorithm is not None and 'Algorithm' not in already_processed:
already_processed.add('Algorithm')
outfile.write(' Algorithm=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.Algorithm), input_name='Algorithm')), ))
def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='CanonicalizationMethodType', fromsubclass_=False, pretty_print=True):
pass
def build(self, node, gds_collector_=None):
self.gds_collector_ = gds_collector_
if SaveElementTreeNode:
self.gds_elementtree_node_ = node
already_processed = set()
self.ns_prefix_ = node.prefix
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
return self
def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('Algorithm', node)
if value is not None and 'Algorithm' not in already_processed:
already_processed.add('Algorithm')
self.Algorithm = value
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
pass
# end class CanonicalizationMethodType
class SignatureMethodType(GeneratedsSuper):
__hash__ = GeneratedsSuper.__hash__
member_data_items_ = [
MemberSpec_('Algorithm', 'xs:anyURI', 0, 0, {'use': 'required'}),
]
subclass = None
superclass = None
def __init__(self, Algorithm=None, gds_collector_=None, **kwargs_):
self.gds_collector_ = gds_collector_
self.gds_elementtree_node_ = None
self.original_tagname_ = None
self.parent_object_ = kwargs_.get('parent_object_')
self.ns_prefix_ = None
self.Algorithm = _cast(None, Algorithm)
self.Algorithm_nsprefix_ = None
def factory(*args_, **kwargs_):
if CurrentSubclassModule_ is not None:
subclass = getSubclassFromModule_(
CurrentSubclassModule_, SignatureMethodType)
if subclass is not None:
return subclass(*args_, **kwargs_)
if SignatureMethodType.subclass:
return SignatureMethodType.subclass(*args_, **kwargs_)
else:
return SignatureMethodType(*args_, **kwargs_)
factory = staticmethod(factory)
def hasContent_(self):
if (
):
return True
else:
return False
def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='SignatureMethodType', pretty_print=True):
imported_ns_def_ = GenerateDSNamespaceDefs_.get('SignatureMethodType')
if imported_ns_def_ is not None:
namespacedef_ = imported_ns_def_
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None and name_ == 'SignatureMethodType':
name_ = self.original_tagname_
if UseCapturedNS_ and self.ns_prefix_:
namespaceprefix_ = self.ns_prefix_ + ':'
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='SignatureMethodType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='SignatureMethodType', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='SignatureMethodType'):
if self.Algorithm is not None and 'Algorithm' not in already_processed:
already_processed.add('Algorithm')
outfile.write(' Algorithm=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.Algorithm), input_name='Algorithm')), ))
def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='SignatureMethodType', fromsubclass_=False, pretty_print=True):
pass
def build(self, node, gds_collector_=None):
self.gds_collector_ = gds_collector_
if SaveElementTreeNode:
self.gds_elementtree_node_ = node
already_processed = set()
self.ns_prefix_ = node.prefix
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
return self
def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('Algorithm', node)
if value is not None and 'Algorithm' not in already_processed:
already_processed.add('Algorithm')
self.Algorithm = value
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
pass
# end class SignatureMethodType
class DigestMethodType(GeneratedsSuper):
__hash__ = GeneratedsSuper.__hash__
member_data_items_ = [
MemberSpec_('Algorithm', 'xs:anyURI', 0, 0, {'use': 'required'}),
]
subclass = None
superclass = None
def __init__(self, Algorithm=None, gds_collector_=None, **kwargs_):
self.gds_collector_ = gds_collector_
self.gds_elementtree_node_ = None
self.original_tagname_ = None
self.parent_object_ = kwargs_.get('parent_object_')
self.ns_prefix_ = None
self.Algorithm = _cast(None, Algorithm)
self.Algorithm_nsprefix_ = None
def factory(*args_, **kwargs_):
if CurrentSubclassModule_ is not None:
subclass = getSubclassFromModule_(
CurrentSubclassModule_, DigestMethodType)
if subclass is not None:
return subclass(*args_, **kwargs_)
if DigestMethodType.subclass:
return DigestMethodType.subclass(*args_, **kwargs_)
else:
return DigestMethodType(*args_, **kwargs_)
factory = staticmethod(factory)
def hasContent_(self):
if (
):
return True
else:
return False
def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='DigestMethodType', pretty_print=True):
imported_ns_def_ = GenerateDSNamespaceDefs_.get('DigestMethodType')
if imported_ns_def_ is not None:
namespacedef_ = imported_ns_def_
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None and name_ == 'DigestMethodType':
name_ = self.original_tagname_
if UseCapturedNS_ and self.ns_prefix_:
namespaceprefix_ = self.ns_prefix_ + ':'
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='DigestMethodType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='DigestMethodType', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='DigestMethodType'):
if self.Algorithm is not None and 'Algorithm' not in already_processed:
already_processed.add('Algorithm')
outfile.write(' Algorithm=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.Algorithm), input_name='Algorithm')), ))
def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='DigestMethodType', fromsubclass_=False, pretty_print=True):
pass
def build(self, node, gds_collector_=None):
self.gds_collector_ = gds_collector_
if SaveElementTreeNode:
self.gds_elementtree_node_ = node
already_processed = set()
self.ns_prefix_ = node.prefix
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
return self
def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('Algorithm', node)
if value is not None and 'Algorithm' not in already_processed:
already_processed.add('Algorithm')
self.Algorithm = value
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
pass
# end class DigestMethodType
class RSAKeyValueType(GeneratedsSuper):
__hash__ = GeneratedsSuper.__hash__
member_data_items_ = [
MemberSpec_('Modulus', ['CryptoBinary', 'xs:base64Binary'], 0, 0, {'name': 'Modulus', 'type': 'xs:base64Binary'}, None),
MemberSpec_('Exponent', ['CryptoBinary', 'xs:base64Binary'], 0, 0, {'name': 'Exponent', 'type': 'xs:base64Binary'}, None),
]
subclass = None
superclass = None
def __init__(self, Modulus=None, Exponent=None, gds_collector_=None, **kwargs_):
self.gds_collector_ = gds_collector_
self.gds_elementtree_node_ = None
self.original_tagname_ = None
self.parent_object_ = kwargs_.get('parent_object_')
self.ns_prefix_ = None
self.Modulus = Modulus
self.validate_CryptoBinary(self.Modulus)
self.Modulus_nsprefix_ = None
self.Exponent = Exponent
self.validate_CryptoBinary(self.Exponent)
self.Exponent_nsprefix_ = None
def factory(*args_, **kwargs_):
if CurrentSubclassModule_ is not None:
subclass = getSubclassFromModule_(
CurrentSubclassModule_, RSAKeyValueType)
if subclass is not None:
return subclass(*args_, **kwargs_)
if RSAKeyValueType.subclass:
return RSAKeyValueType.subclass(*args_, **kwargs_)
else:
return RSAKeyValueType(*args_, **kwargs_)
factory = staticmethod(factory)
def validate_CryptoBinary(self, value):
result = True
# Validate type CryptoBinary, a restriction on xs:base64Binary.
if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
pass
return result
def hasContent_(self):
if (
self.Modulus is not None or
self.Exponent is not None
):
return True
else:
return False
def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='RSAKeyValueType', pretty_print=True):
imported_ns_def_ = GenerateDSNamespaceDefs_.get('RSAKeyValueType')
if imported_ns_def_ is not None:
namespacedef_ = imported_ns_def_
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None and name_ == 'RSAKeyValueType':
name_ = self.original_tagname_
if UseCapturedNS_ and self.ns_prefix_:
namespaceprefix_ = self.ns_prefix_ + ':'
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='RSAKeyValueType')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='RSAKeyValueType', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='RSAKeyValueType'):
pass
def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='RSAKeyValueType', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.Modulus is not None:
namespaceprefix_ = self.Modulus_nsprefix_ + ':' if (UseCapturedNS_ and self.Modulus_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sModulus>%s</%sModulus>%s' % (namespaceprefix_ , self.gds_format_base64(self.Modulus, input_name='Modulus'), namespaceprefix_ , eol_))
if self.Exponent is not None:
namespaceprefix_ = self.Exponent_nsprefix_ + ':' if (UseCapturedNS_ and self.Exponent_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sExponent>%s</%sExponent>%s' % (namespaceprefix_ , self.gds_format_base64(self.Exponent, input_name='Exponent'), namespaceprefix_ , eol_))
def build(self, node, gds_collector_=None):
self.gds_collector_ = gds_collector_
if SaveElementTreeNode:
self.gds_elementtree_node_ = node
already_processed = set()
self.ns_prefix_ = node.prefix
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
return self
def buildAttributes(self, node, attrs, already_processed):
pass
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
if nodeName_ == 'Modulus':
sval_ = child_.text
if sval_ is not None:
try:
bval_ = base64.b64decode(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires base64 encoded string: %s' % exp)
bval_ = self.gds_validate_base64(bval_, node, 'Modulus')
else:
bval_ = None
self.Modulus = bval_
self.Modulus_nsprefix_ = child_.prefix
# validate type CryptoBinary
self.validate_CryptoBinary(self.Modulus)
elif nodeName_ == 'Exponent':
sval_ = child_.text
if sval_ is not None:
try:
bval_ = base64.b64decode(sval_)
except (TypeError, ValueError) as exp:
raise_parse_error(child_, 'requires base64 encoded string: %s' % exp)
bval_ = self.gds_validate_base64(bval_, node, 'Exponent')
else:
bval_ = None
self.Exponent = bval_
self.Exponent_nsprefix_ = child_.prefix
# validate type CryptoBinary
self.validate_CryptoBinary(self.Exponent)
# end class RSAKeyValueType
GDSClassesMapping = {
'Signature': SignatureType,
}
USAGE_TEXT = """
Usage: python <Parser>.py [ -s ] <in_xml_file>
"""
def usage():
print(USAGE_TEXT)
sys.exit(1)
def get_root_tag(node):
tag = Tag_pattern_.match(node.tag).groups()[-1]
rootClass = GDSClassesMapping.get(tag)
if rootClass is None:
rootClass = globals().get(tag)
return tag, rootClass
def get_required_ns_prefix_defs(rootNode):
'''Get all name space prefix definitions required in this XML doc.
Return a dictionary of definitions and a char string of definitions.
'''
nsmap = {
prefix: uri
for node in rootNode.iter()
for (prefix, uri) in node.nsmap.items()
if prefix is not None
}
namespacedefs = ' '.join([
'xmlns:{}="{}"'.format(prefix, uri)
for prefix, uri in nsmap.items()
])
return nsmap, namespacedefs
def parse(inFileName, silence=False, print_warnings=True):
global CapturedNsmap_
gds_collector = GdsCollector_()
parser = None
doc = parsexml_(inFileName, parser)
rootNode = doc.getroot()
rootTag, rootClass = get_root_tag(rootNode)
if rootClass is None:
rootTag = 'RetornoInformacoesLote'
rootClass = RetornoInformacoesLote
rootObj = rootClass.factory()
rootObj.build(rootNode, gds_collector_=gds_collector)
CapturedNsmap_, namespacedefs = get_required_ns_prefix_defs(rootNode)
if not SaveElementTreeNode:
doc = None
rootNode = None
if not silence:
sys.stdout.write('<?xml version="1.0" ?>\n')
rootObj.export(
sys.stdout, 0, name_=rootTag,
namespacedef_=namespacedefs,
pretty_print=True)
if print_warnings and len(gds_collector.get_messages()) > 0:
separator = ('-' * 50) + '\n'
sys.stderr.write(separator)
sys.stderr.write('----- Warnings -- count: {} -----\n'.format(
len(gds_collector.get_messages()), ))
gds_collector.write_messages(sys.stderr)
sys.stderr.write(separator)
return rootObj
def parseEtree(inFileName, silence=False, print_warnings=True,
mapping=None, nsmap=None):
parser = None
doc = parsexml_(inFileName, parser)
gds_collector = GdsCollector_()
rootNode = doc.getroot()
rootTag, rootClass = get_root_tag(rootNode)
if rootClass is None:
rootTag = 'RetornoInformacoesLote'
rootClass = RetornoInformacoesLote
rootObj = rootClass.factory()
rootObj.build(rootNode, gds_collector_=gds_collector)
# Enable Python to collect the space used by the DOM.
if mapping is None:
mapping = {}
rootElement = rootObj.to_etree(
None, name_=rootTag, mapping_=mapping, nsmap_=nsmap)
reverse_mapping = rootObj.gds_reverse_node_mapping(mapping)
if not SaveElementTreeNode:
doc = None
rootNode = None
if not silence:
content = etree_.tostring(
rootElement, pretty_print=True,
xml_declaration=True, encoding="utf-8")
sys.stdout.write(str(content))
sys.stdout.write('\n')
if print_warnings and len(gds_collector.get_messages()) > 0:
separator = ('-' * 50) + '\n'
sys.stderr.write(separator)
sys.stderr.write('----- Warnings -- count: {} -----\n'.format(
len(gds_collector.get_messages()), ))
gds_collector.write_messages(sys.stderr)
sys.stderr.write(separator)
return rootObj, rootElement, mapping, reverse_mapping
def parseString(inString, silence=False, print_warnings=True):
'''Parse a string, create the object tree, and export it.
Arguments:
- inString -- A string. This XML fragment should not start
with an XML declaration containing an encoding.
- silence -- A boolean. If False, export the object.
Returns -- The root object in the tree.
'''
parser = None
rootNode= parsexmlstring_(inString, parser)
gds_collector = GdsCollector_()
rootTag, rootClass = get_root_tag(rootNode)
if rootClass is None:
rootTag = 'RetornoInformacoesLote'
rootClass = RetornoInformacoesLote
rootObj = rootClass.factory()
rootObj.build(rootNode, gds_collector_=gds_collector)
if not SaveElementTreeNode:
rootNode = None
if not silence:
sys.stdout.write('<?xml version="1.0" ?>\n')
rootObj.export(
sys.stdout, 0, name_=rootTag,
namespacedef_='')
if print_warnings and len(gds_collector.get_messages()) > 0:
separator = ('-' * 50) + '\n'
sys.stderr.write(separator)
sys.stderr.write('----- Warnings -- count: {} -----\n'.format(
len(gds_collector.get_messages()), ))
gds_collector.write_messages(sys.stderr)
sys.stderr.write(separator)
return rootObj
def parseLiteral(inFileName, silence=False, print_warnings=True):
parser = None
doc = parsexml_(inFileName, parser)
gds_collector = GdsCollector_()
rootNode = doc.getroot()
rootTag, rootClass = get_root_tag(rootNode)
if rootClass is None:
rootTag = 'RetornoInformacoesLote'
rootClass = RetornoInformacoesLote
rootObj = rootClass.factory()
rootObj.build(rootNode, gds_collector_=gds_collector)
# Enable Python to collect the space used by the DOM.
if not SaveElementTreeNode:
doc = None
rootNode = None
if not silence:
sys.stdout.write('#from RetornoInformacoesLote import *\n\n')
sys.stdout.write('import RetornoInformacoesLote as model_\n\n')
sys.stdout.write('rootObj = model_.rootClass(\n')
rootObj.exportLiteral(sys.stdout, 0, name_=rootTag)
sys.stdout.write(')\n')
if print_warnings and len(gds_collector.get_messages()) > 0:
separator = ('-' * 50) + '\n'
sys.stderr.write(separator)
sys.stderr.write('----- Warnings -- count: {} -----\n'.format(
len(gds_collector.get_messages()), ))
gds_collector.write_messages(sys.stderr)
sys.stderr.write(separator)
return rootObj
def main():
args = sys.argv[1:]
if len(args) == 1:
parse(args[0])
else:
usage()
if __name__ == '__main__':
#import pdb; pdb.set_trace()
main()
RenameMappings_ = {
}
#
# Mapping of namespaces to types defined in them
# and the file in which each is defined.
# simpleTypes are marked "ST" and complexTypes "CT".
NamespaceToDefMappings_ = {'http://www.prefeitura.sp.gov.br/nfe': [],
'http://www.prefeitura.sp.gov.br/nfe/tipos': [('tpAliquota',
'TiposNFe_v01.xsd',
'ST'),
('tpAssinatura',
'TiposNFe_v01.xsd',
'ST'),
('tpAssinaturaCancelamento',
'TiposNFe_v01.xsd',
'ST'),
('tpBairro',
'TiposNFe_v01.xsd',
'ST'),
('tpCEP',
'TiposNFe_v01.xsd',
'ST'),
('tpCidade',
'TiposNFe_v01.xsd',
'ST'),
('tpCNPJ',
'TiposNFe_v01.xsd',
'ST'),
('tpCodigoServico',
'TiposNFe_v01.xsd',
'ST'),
('tpCodigoEvento',
'TiposNFe_v01.xsd',
'ST'),
('tpCodigoVerificacao',
'TiposNFe_v01.xsd',
'ST'),
('tpComplementoEndereco',
'TiposNFe_v01.xsd',
'ST'),
('tpCPF',
'TiposNFe_v01.xsd',
'ST'),
('tpDescricaoEvento',
'TiposNFe_v01.xsd',
'ST'),
('tpDiscriminacao',
'TiposNFe_v01.xsd',
'ST'),
('tpEmail',
'TiposNFe_v01.xsd',
'ST'),
('tpInscricaoEstadual',
'TiposNFe_v01.xsd',
'ST'),
('tpInscricaoMunicipal',
'TiposNFe_v01.xsd',
'ST'),
('tpLogradouro',
'TiposNFe_v01.xsd',
'ST'),
('tpNumero',
'TiposNFe_v01.xsd',
'ST'),
('tpNumeroEndereco',
'TiposNFe_v01.xsd',
'ST'),
('tpOpcaoSimples',
'TiposNFe_v01.xsd',
'ST'),
('tpQuantidade',
'TiposNFe_v01.xsd',
'ST'),
('tpRazaoSocial',
'TiposNFe_v01.xsd',
'ST'),
('tpSerieRPS',
'TiposNFe_v01.xsd',
'ST'),
('tpStatusNFe',
'TiposNFe_v01.xsd',
'ST'),
('tpSucesso',
'TiposNFe_v01.xsd',
'ST'),
('tpTempoProcessamento',
'TiposNFe_v01.xsd',
'ST'),
('tpTipoLogradouro',
'TiposNFe_v01.xsd',
'ST'),
('tpTipoRPS',
'TiposNFe_v01.xsd',
'ST'),
('tpTributacaoNFe',
'TiposNFe_v01.xsd',
'ST'),
('tpUF',
'TiposNFe_v01.xsd',
'ST'),
('tpValor',
'TiposNFe_v01.xsd',
'ST'),
('tpVersao',
'TiposNFe_v01.xsd',
'ST'),
('tpPercentualCargaTributaria',
'TiposNFe_v01.xsd',
'ST'),
('tpFonteCargaTributaria',
'TiposNFe_v01.xsd',
'ST'),
('tpEvento',
'TiposNFe_v01.xsd',
'CT'),
('tpCPFCNPJ',
'TiposNFe_v01.xsd',
'CT'),
('tpChaveNFeRPS',
'TiposNFe_v01.xsd',
'CT'),
('tpChaveNFe',
'TiposNFe_v01.xsd',
'CT'),
('tpChaveRPS',
'TiposNFe_v01.xsd',
'CT'),
('tpEndereco',
'TiposNFe_v01.xsd',
'CT'),
('tpInformacoesLote',
'TiposNFe_v01.xsd',
'CT'),
('tpNFe',
'TiposNFe_v01.xsd',
'CT'),
('tpRPS',
'TiposNFe_v01.xsd',
'CT')],
'http://www.w3.org/2000/09/xmldsig#': [('CryptoBinary',
'xmldsig-core-schema_v01.xsd',
'ST'),
('DigestValueType',
'xmldsig-core-schema_v01.xsd',
'ST'),
('SignatureType',
'xmldsig-core-schema_v01.xsd',
'CT'),
('SignatureValueType',
'xmldsig-core-schema_v01.xsd',
'CT'),
('SignedInfoType',
'xmldsig-core-schema_v01.xsd',
'CT'),
('ReferenceType',
'xmldsig-core-schema_v01.xsd',
'CT'),
('TransformsType',
'xmldsig-core-schema_v01.xsd',
'CT'),
('TransformType',
'xmldsig-core-schema_v01.xsd',
'CT'),
('KeyInfoType',
'xmldsig-core-schema_v01.xsd',
'CT'),
('KeyValueType',
'xmldsig-core-schema_v01.xsd',
'CT'),
('X509DataType',
'xmldsig-core-schema_v01.xsd',
'CT')]}
__all__ = [
"CabecalhoType",
"CanonicalizationMethodType",
"DigestMethodType",
"KeyInfoType",
"KeyValueType",
"RSAKeyValueType",
"ReferenceType",
"RetornoInformacoesLote",
"SignatureMethodType",
"SignatureType",
"SignatureValueType",
"SignedInfoType",
"TransformType",
"TransformsType",
"X509DataType",
"tpCPFCNPJ",
"tpChaveNFe",
"tpChaveNFeRPS",
"tpChaveRPS",
"tpEndereco",
"tpEvento",
"tpInformacoesLote",
"tpNFe",
"tpRPS"
]
| 55.973709
| 1,088
| 0.629858
| 36,079
| 355,545
| 5.916544
| 0.026165
| 0.026234
| 0.022135
| 0.016284
| 0.835559
| 0.782435
| 0.763102
| 0.742307
| 0.728866
| 0.708708
| 0
| 0.006659
| 0.266354
| 355,545
| 6,351
| 1,089
| 55.982522
| 0.811696
| 0.034876
| 0
| 0.702583
| 1
| 0.001869
| 0.12416
| 0.02851
| 0
| 0
| 0
| 0
| 0
| 1
| 0.066281
| false
| 0.009687
| 0.015976
| 0.006118
| 0.176751
| 0.052855
| 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
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 9
|
1345d6c49cd9e43e9ebe74f5d9075e8925d76b37
| 246
|
py
|
Python
|
__init__.py
|
csalyk/slabspec
|
5893f90566b5db4cb4eb18130fc96302c4aaaac0
|
[
"MIT-0"
] | 2
|
2021-02-20T11:48:00.000Z
|
2021-06-18T13:56:30.000Z
|
__init__.py
|
csalyk/slabspec
|
5893f90566b5db4cb4eb18130fc96302c4aaaac0
|
[
"MIT-0"
] | null | null | null |
__init__.py
|
csalyk/slabspec
|
5893f90566b5db4cb4eb18130fc96302c4aaaac0
|
[
"MIT-0"
] | 1
|
2021-06-18T12:02:04.000Z
|
2021-06-18T12:02:04.000Z
|
from .helpers import extract_hitran_data, compute_thermal_velocity
from .slabspec import make_spec
from .slabspec import compute_partition_function
from .slabspec import spec_convol, spec_convol_klaus
from .slabspec import make_rotation_diagram
| 35.142857
| 66
| 0.878049
| 34
| 246
| 6
| 0.529412
| 0.235294
| 0.352941
| 0.215686
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.093496
| 246
| 6
| 67
| 41
| 0.914798
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 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
|
135b4f842911f6140efdc381ef1e7d4fb8068614
| 63,170
|
py
|
Python
|
utils/watchResults.py
|
bottero/IMCMCrun
|
18d9badbb58e3a23f99d9d1ed0cd9f97b6ec12e6
|
[
"MIT"
] | 13
|
2015-04-26T09:24:48.000Z
|
2022-01-03T04:34:19.000Z
|
utils/watchResults.py
|
bottero/IMCMCrun
|
18d9badbb58e3a23f99d9d1ed0cd9f97b6ec12e6
|
[
"MIT"
] | null | null | null |
utils/watchResults.py
|
bottero/IMCMCrun
|
18d9badbb58e3a23f99d9d1ed0cd9f97b6ec12e6
|
[
"MIT"
] | 4
|
2016-08-31T05:43:55.000Z
|
2020-12-08T19:53:30.000Z
|
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Created on Wed Dec 17 15:08:14 2014
@author: bottero
Script to watch the results of a run.
TODO : _load prior profiles as well
_
"""
### --- MODULES AND PACKAGES --- ###
import os, sys
import argparse # To deal with arguments :
# https://docs.python.org/2/library/argparse.html
import numpy as np # NumPy (multidimensional arrays, linear algebra, ...)
import glob # Unix style pathname pattern expansion
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt # Matplotlib's pyplot: MATLAB-like syntax
def pdense(x, y, sigma, M=1000):
""" Plot probability density of y with known stddev sigma
"""
assert len(x) == len(y) and len(x) == len(sigma)
N = len(x)
# TODO: better y ranging
ymin, ymax = min(y - 2 * sigma), max(y + 2 * sigma)
yy = np.linspace(ymin, ymax, M)
a = [np.exp(-((Y - yy) / s) ** 2) / s for Y, s in zip(y, sigma)]
A = np.array(a)
A = A.reshape(N, M)
plt.imshow(-A, cmap='gray', aspect='auto',
origin='upper', extent=(ymin,ymax,max(x),min(x)))
# plt.title('Density plot')
def representsInt(s):
try:
int(s)
return True
except ValueError:
return False
def representsFloat(s):
try:
float(s)
return True
except ValueError:
return False
### --- Parser arguments --- ###
parser = argparse.ArgumentParser(description='Watch the results of a run')
parser.add_argument("pathToDir",
help="Path to result directory (ex : OUTPUT_FILES/XXX)")
parser.add_argument("-v","--verbose", help="Increase output verbosity",
action="store_true")
parser.add_argument("-a","--all", help="Plot everything",
action="store_true", default=False)
parser.add_argument("-d","--data", help="Plot the first guess curve (and real curves for analytical runs))",
action="store_true")
parser.add_argument("-g","--geometry", help="Plot the geometry used (sources and receivers)",
action="store_true")
parser.add_argument("-e","--energies", help="Plot the energies of the chains",
action="store_true")
parser.add_argument("-b","--best", help="Plot the some good models found and the residuals of the best",
action="store_true")
parser.add_argument("--dont_show_guess", help="Don't show first guess model on plots",
action="store_true", default=False)
parser.add_argument("--show_ranges", help="Show exploration ranges on plots",
action="store_true", default=False)
parser.add_argument("--show_averages", help="Show average models on plots",
action="store_true", default=False)
parser.add_argument("--no_density_plots", help="Represent uncertainties by a range",
action="store_true", default=False)
parser.add_argument("-r","--results", help="Plot the results from the inversion",
action="store_true", default=False)
parser.add_argument("--resultsChain",type=int,
help="Plot the results from the inversion for given \
chain number",default=-1)
parser.add_argument("-t","--treshold",type=int,
help="Iteration after which we show the model calculated",
default=0)
parser.add_argument("--recalculate_t0", help="Force recalculate t0 (even if it had not been chosen during the run)",
action="store_true")
parser.add_argument("-s","--swaps", help="Plot the swaps",
action="store_true")
parser.add_argument("--vpvs", help="Plot mean Vp/Vs ratio plus uncertainties",
action="store_true")
parser.add_argument("--filtering", help="Show optimum filtering",
action="store_true")
parser.add_argument("--paper", help="Plot the figures for the paper",
action="store_true")
args = parser.parse_args()
### --- Test arguments --- ###
if not os.path.isdir(args.pathToDir): # If the path does not exist
print "Directory ",args.pathToDir," not found."
parser.print_help()
sys.exit(0)
if args.pathToDir[-1:] != '/': # add a / at the end of the path if necessary
args.pathToDir+='/'
code = glob.glob1(args.pathToDir,"stats0.*")[0].split('.')[1]
#args.pathToDir.split("/")[-2] # just keep the name of the directory
if not representsInt(code):
print "Directory ",args.pathToDir," does not seem to be a correct IMCMC \
directory... (no stats0 found)"
sys.exit(0)
if not (args.all or args.data or args.geometry or args.energies or args.results or args.best or (args.resultsChain != -1) or args.filtering or args.swaps or args.vpvs or args.paper):
print "Nothing has to be done!"
sys.exit(0)
### --- Load files --- ###
# Extract informations from config.XXX.dat :
# TODO : read the cfg file
T = np.zeros(0)
with open(args.pathToDir+'config.cfg') as configFile:
for line in configFile:
if line.split('#')[0].strip(): # If the line is not a comment
if 'SWAVES' in line:
if line.split(" = ")[1].split("#")[0].strip() == "1":
swaves=True
else:
swaves=False
if 'ANALYTICAL_RUN' in line:
if line.split(" = ")[1].split("#")[0].strip() == "1":
analytical=True
else:
analytical=False
if 'RECALCULATE_T0' in line:
if line.split(" = ")[1].split("#")[0].strip() == "1":
recalculate_t0=True
else:
recalculate_t0=False
if 'QP =' in line:
qp = line.split(" = ")[1].split("#")[0].strip()
if 'NAME_OF_FIRST_GUESS_P_FILE' in line:
nameOfFirstGuessP = line.split(" = ")[1].split("#")[0].strip()
if 'NAME_OF_FIRST_GUESS_S_FILE' in line:
nameOfFirstGuessS = line.split(" = ")[1].split("#")[0].strip()
if 'NAME_OF_REAL_PROFILE_FILE_P' in line:
nameOfrealP = line.split(" = ")[1].split("#")[0].strip()
if 'NAME_OF_REAL_PROFILE_FILE_S' in line:
nameOfrealS = line.split(" = ")[1].split("#")[0].strip()
if 'N_PRIOR_PROFILES' in line:
nPriorProfiles = line.split(" = ")[1].split("#")[0].strip()
if representsInt(nPriorProfiles): # Verify that the string extracted is a int
nPriorProfiles = int(nPriorProfiles)
if 'NAME_OF_STATIONS_FILE' in line:
nameOfStationsFile = line.split(" = ")[1].split("#")[0].strip()
if 'NAME_OF_SHOTS_FILE' in line:
nameOfShotsFile = line.split(" = ")[1].split("#")[0].strip()
if 'NAME_OF_TIMES_FILE =' in line:
nameOfTimesFile = line.split(" = ")[1].split("#")[0].strip()
if 'SIGMAP =' in line:
sigmaP = line.split(" = ")[1].split("#")[0].strip()
if representsFloat(sigmaP): # Verify that the string extracted is a int
sigmaP = float(sigmaP)
if 'SIGMAS =' in line:
sigmaS = line.split(" = ")[1].split("#")[0].strip()
if representsFloat(sigmaS): # Verify that the string extracted is a int
sigmaS = float(sigmaS)
if 'COORD_TOL =' in line:
coord_tol = line.split(" = ")[1].split("#")[0].strip()
if representsFloat(coord_tol): # Verify that the string extracted is a int
coord_tol = float(coord_tol)
with open(args.pathToDir+'config.'+code+'.dat') as outConfigFile:
for line in outConfigFile:
if 'Energy of the prior : ' in line:
ep=line.split(":")[1].strip("\n").strip()
if representsFloat(ep): # Verify that the string extracted is a int
ep = float(ep)
if 'temperatures : ' in line:
# Extract the number of temperatures from the line :
nbt=(line.split(":")[-1]).split("\n")[0].strip()
if representsInt(nbt): # Verify that the string extracted is a int
nbt = int(nbt)
T=np.resize(T,nbt)
if 'Temperature max : ' in line:
# Extract temperature max from the line :
tmax=(line.split(":")[-1]).split("\n")[0].strip()
if representsInt(tmax): # Verify that the string extracted is a int
tmax = int(tmax)
if 'Temperature ladder : ' in line: # Extract temperature ladder from line
T[nbt-1]=line.split("T["+str(nbt-1)+"] = ")[1].strip("\n").strip()
for i in np.arange(nbt-1):
T[i]=line.split("T["+str(i)+"] = ")[1].split("T["+str(i+1)+"] = ")[0].strip()
if args.verbose:
print "Watching the results of run : ",code,"..."
if analytical:
print "This is an analytical run"
if swaves:
print "S waves arrival times were calculated"
print "There are ",nbt," temperatures (tmax =",tmax,") :",
for i in np.arange(nbt):
print " T[",i,"] = ",T[i],
print
print "Loading files ..."
### --- Load files --- ###
# declare empty list to store files :
M=1000 # For density plot
averagesP=[0]*nbt # declare empty list to store files :
averagesS=[0]*nbt
chains=[0]*nbt
varPs=[0]*nbt
varSs=[0]*nbt
qInfPs=[0]*nbt
qSupPs=[0]*nbt
qInfSs=[0]*nbt
qSupSs=[0]*nbt
minP=[0]*nbt
minS=[0]*nbt
maxP=[0]*nbt
maxS=[0]*nbt
priorP=[0]*nPriorProfiles
priorS=[0]*nPriorProfiles
timesData=[0]
nFiltered=len(glob.glob1(args.pathToDir,"filteredFirstGuessP.*"))
filteredPcurve=[0]*nFiltered
waveletFiltered=[""]*nFiltered
filteredScurve=[0]*nFiltered
# Loop on temperature chains
for i in np.arange(nbt):
averagesP[i]=np.loadtxt(args.pathToDir+"averageP"+str(i)+"."+code+".dat")
chains[i]=np.loadtxt(args.pathToDir+"chain"+str(i)+"."+code+".dat")
varPs[i]=np.loadtxt(args.pathToDir+"varP"+str(i)+"."+code+".dat")
qSupPs[i]=np.loadtxt(args.pathToDir+"qSupP"+str(i)+"."+code+".dat")
qInfPs[i]=np.loadtxt(args.pathToDir+"qInfP"+str(i)+"."+code+".dat")
minP[i]=np.loadtxt(args.pathToDir+"minP."+str(i)+"."+code+".dat")
maxP[i]=np.loadtxt(args.pathToDir+"maxP."+str(i)+"."+code+".dat")
if swaves:
averagesS[i]=np.loadtxt(args.pathToDir+"averageS"+str(i)+"."+code+".dat")
varSs[i]=np.loadtxt(args.pathToDir+"varS"+str(i)+"."+code+".dat")
qSupSs[i]=np.loadtxt(args.pathToDir+"qSupS"+str(i)+"."+code+".dat")
qInfSs[i]=np.loadtxt(args.pathToDir+"qInfS"+str(i)+"."+code+".dat")
minS[i]=np.loadtxt(args.pathToDir+"minS."+str(i)+"."+code+".dat")
maxS[i]=np.loadtxt(args.pathToDir+"maxS."+str(i)+"."+code+".dat")
for i,filteredGuessPCurve in enumerate(glob.glob1(args.pathToDir,"filteredFirstGuessP.*")):
waveletFiltered[i]=filteredGuessPCurve.split('.')[1]
filteredPcurve[i] = np.loadtxt(args.pathToDir+filteredGuessPCurve)
for i,filteredGuessSCurve in enumerate(glob.glob1(args.pathToDir,"filteredFirstGuessS.*")):
filteredScurve[i] = np.loadtxt(args.pathToDir+filteredGuessSCurve)
globalAverageP=np.loadtxt(args.pathToDir+"globalAverageP."+code+".dat")
globalVarP=np.loadtxt(args.pathToDir+"globalVarP."+code+".dat")
globalMaxP=np.loadtxt(args.pathToDir+"maxP."+code+".dat") #TODO don't forget them
globalMinP=np.loadtxt(args.pathToDir+"minP."+code+".dat")
if swaves:
globalMaxS=np.loadtxt(args.pathToDir+"maxS."+code+".dat")
globalMinS=np.loadtxt(args.pathToDir+"minS."+code+".dat")
globalAverageS=np.loadtxt(args.pathToDir+"globalAverageS."+code+".dat")
globalVarS=np.loadtxt(args.pathToDir+"globalVarS."+code+".dat")
globalVarVpVs=np.loadtxt(args.pathToDir+"globalVarVpVs."+code+".dat")
coordShots=np.loadtxt(args.pathToDir+nameOfShotsFile)
coordStats=np.loadtxt(args.pathToDir+nameOfStationsFile)
firstGuessP=np.loadtxt(args.pathToDir+nameOfFirstGuessP)
firstGuessS=np.loadtxt(args.pathToDir+nameOfFirstGuessS)
if analytical:
realP=np.loadtxt(args.pathToDir+nameOfrealP)
realS=np.loadtxt(args.pathToDir+nameOfrealS)
timesData=np.loadtxt(args.pathToDir+"calculatedTimes."+code+".dat")
else:
timesData=np.loadtxt(args.pathToDir+nameOfTimesFile)
if os.path.isfile(args.pathToDir+"bestModelTimes."+code+".dat"):
bestModelCalculated=True
bestModelTimes=np.loadtxt(args.pathToDir+"bestModelTimes."+code+".dat")
else:
bestModelCalculated=False
ll=np.loadtxt(args.pathToDir+"ll."+code+".dat")
if nPriorProfiles > 0:
for i in np.arange(nPriorProfiles):
priorP[i]=np.loadtxt(args.pathToDir+"priorProfiles"+code+"/priorProfileP."+code+"."+str(i)+".dat")
priorS[i]=np.loadtxt(args.pathToDir+"priorProfiles"+code+"/priorProfileS."+code+"."+str(i)+".dat")
nit=len(chains[0])
if args.verbose:
print "Loading done !"
print
print "During this simulation the",nbt,"chains have run during",nit,"steps"
if nit < 50:
print "Take care!! Below 50 iterations min and max profiles don't make sense!"
### --- Analyses --- ###
xmin=-1e99
ymin=-1e99
zmin=-1e99
xmax=1e99
ymax=1e99
zmax=1e99
### --- Analyses --- ###
if np.size(coordShots) > 3:
xmin = coordShots[:,0].min()
ymin = coordShots[:,1].min()
zmin = coordShots[:,2].min()
xmax = coordShots[:,0].max()
ymax = coordShots[:,1].max()
zmax = coordShots[:,2].max()
else:
xmin = coordShots[0]
ymin = coordShots[1]
zmin = coordShots[2]
xmax = coordShots[0]
ymax = coordShots[1]
zmax = coordShots[2]
if np.size(coordStats) > 3:
xmin = min(xmin,coordStats[:,0].min())
ymin = min(ymin,coordStats[:,1].min())
zmin = min(zmin,coordStats[:,2].min())
xmax = max(xmax,coordStats[:,0].max())
ymax = max(ymax,coordStats[:,1].max())
zmax = max(zmax,coordStats[:,2].max())
else:
xmin = min(xmin,coordStats[0])
ymin = min(ymin,coordStats[1])
zmin = min(zmin,coordStats[2])
xmax = max(xmax,coordStats[0])
ymax = max(ymax,coordStats[1])
zmax = max(zmax,coordStats[2])
xmin2 = xmin - (xmax-xmin)*coord_tol;
ymin2 = ymin - (ymax-ymin)*coord_tol;
xmax2 = xmax + (xmax-xmin)*coord_tol;
ymax2 = ymax + (ymax-ymin)*coord_tol;
xmin = xmin2
ymin = ymin2
xmax = xmax2
ymax = ymax2
z=firstGuessP[:,0]
zFilt=varPs[0][:,0]
nStats=coordStats.size/3
nShots=coordShots.size/3
plt.close('all')
if args.all:
args.geometry=True
args.energies=True
args.best=True
args.data=True
if swaves:
args.vpvs=True
# args.swaps=True
if args.energies:
plt.hold(True)
ii=0
nBest=len(glob.glob1(args.pathToDir,"bestPprofile*"))
E=[0]*nBest
iterationBest=[0]*nBest
chain=[0]*nBest
for bestModel in glob.glob1(args.pathToDir,"bestSprofile*"):
ii=ii+1
iterationBest[ii-1]=int(bestModel.split("idx")[1].split(".")[0])
chain[ii-1]=int(bestModel.split("chain")[1].split(".")[0])
E[ii-1]=float(bestModel.split("E")[1].split(code)[0].strip("."))
# TODO : this does not work if the energy value contains the code of the run : ex code=745 energy=745.23
if args.verbose:
print "Models kept after iteration : "+str(args.treshold)+" will be shown"
from operator import itemgetter
idxBest=0
itBestE=0
chainBest=0
if E:
idxBest=min(enumerate(E), key=itemgetter(1))[0] # index of best model
itBestE=iterationBest[idxBest]
chainBest=chain[idxBest]
chain=[chain[i] for i in np.arange(nBest) if iterationBest[i] > args.treshold]
iterationBest=[i for i in iterationBest if i>args.treshold]
iteration=np.arange(nit)
for i in np.arange(nbt):
if len(iteration) == len(chains[i][:,-1]):
plt.semilogy(iteration,chains[i][:,-1]*T[i])
else:
miniIteration = min(len(iteration),len(chains[i][:,-1]))
plt.semilogy(iteration[:miniIteration],chains[i][:miniIteration,-1]*T[i])
plt.rc('text', usetex=True)
plt.rc('font', family='serif')
flagForLabel=True
for j in np.arange(len(iterationBest)):
if flagForLabel:
plt.semilogy(iteration[iterationBest[j]], T[chain[j]]*chains[chain[j]][:,-1][iterationBest[j]], 'bD', label="Best models saved")
flagForLabel=False
else:
plt.semilogy(iteration[iterationBest[j]], T[chain[j]]*chains[chain[j]][:,-1][iterationBest[j]], 'bD')
plt.semilogy(itBestE, T[chainBest]*chains[chainBest][:,-1][itBestE], 'rD', label="Best model")
if recalculate_t0 is True:
if swaves:
plt.semilogy(iteration,np.zeros(nit)+nStats*nShots+ep,'b--',linewidth=2,label=r'Behind that line every model can be acceptable ($1\sigma$ misfit for each measurement)')
else:
plt.semilogy(iteration,np.zeros(nit)+nStats*nShots/2.0+ep,'b--',linewidth=2)
plt.legend(numpoints=1)
plt.semilogy(iteration,np.zeros(nit)+ep)
plt.xlim(xmax=iteration.max())
plt.rc('font', family='serif')
plt.xlabel('Iteration number',fontsize='14')
plt.ylabel('Energy',fontsize='14')
if args.geometry:
fig = plt.figure()
ax = fig.gca(projection='3d') #Axes3D(fig)
ax.hold(True)
ax.scatter(coordStats[:,0],coordStats[:,1],coordStats[:,2],zdir='z',s=20,c='b')
if (coordShots.size>3):
ax.scatter(coordShots[:,0],coordShots[:,1],coordShots[:,2],zdir='z',s=20,c='r',marker='^')
else:
ax.scatter(coordShots[0],coordShots[1],coordShots[2],zdir='z',s=200,c='r',marker='^')
ax.set_xlim3d(xmin,xmax)
ax.set_ylim3d(ymin,ymax)
ax.set_zlim3d(zmin,zmax)
plt.rc('text', usetex=True)
plt.rc('font', family='serif')
ax.set_xlabel('X (m)')
ax.set_ylabel('Y (m)')
ax.set_zlabel('Z (m)')
ax.set_title('Geometry')
ax.invert_zaxis()
if args.data:
fig2 = plt.figure()
plt.hold(True)
plt.plot(firstGuessP[:,1],z,color=(0.5,0.5,0.95))
if (swaves):
plt.plot(firstGuessS[:,1],z,color=(0.5,0.95,0.5))
if analytical:
plt.plot(realP[:,1],z,color=(0,0,0.5),linewidth=4)
if swaves:
plt.plot(realS[:,1],z,color=(0,0.5,0),linewidth=4)
plt.rc('text', usetex=True)
plt.rc('font', family='serif')
plt.xlabel(r'Wave speed ($m.s^{-1}$)',fontsize='14')
plt.ylabel(r'Depth ($m$)',fontsize='14')
if swaves:
plt.title(r'First guess velocity profiles',fontsize='14')
else:
plt.title(r'First guess velocity profile',fontsize='14')
plt.ylim(ymax=z.max())
plt.gca().invert_yaxis()
if nPriorProfiles > 0:
plt.figure()
plt.hold(True)
plt.plot(firstGuessP[:,1],z,color=(0.5,0.5,0.95))
if analytical:
plt.plot(realP[:,1],z,color=(0,0,0.5),linewidth=4)
for i in np.arange(nPriorProfiles):
plt.plot(priorP[i][:,1],z)
plt.rc('text', usetex=True)
plt.rc('font', family='serif')
plt.xlabel(r'P wave velocity profiles from prior ($m.s^{-1}$)',fontsize='14')
plt.ylabel(r'Depth ($m$)',fontsize='14')
plt.ylim(ymin=z.max())
plt.ylim(ymax=z.min())
if swaves:
plt.figure()
plt.hold(True)
plt.plot(firstGuessS[:,1],z,color=(0.5,0.95,0.5))
if analytical:
plt.plot(realS[:,1],z,color=(0,0.5,0),linewidth=4)
for i in np.arange(nPriorProfiles):
plt.plot(priorS[i][:,1],z)
plt.rc('text', usetex=True)
plt.rc('font', family='serif')
plt.xlabel(r'S wave velocity profiles from prior ($m.s^{-1}$)',fontsize='14')
plt.ylabel(r'Depth ($m$)',fontsize='14')
plt.ylim(ymin=z.max())
plt.ylim(ymax=z.min())
if args.all:
chainsToPlot=np.arange(nbt)
elif args.resultsChain >= 0:
if args.resultsChain > nbt-1:
print "There were just ",nbt," chains running!"
print "-> maximum index : ",nbt-1
sys.exit(0)
chainsToPlot=np.array([args.resultsChain])
if (args.resultsChain >= 0) or args.all:
lb=qp+"\% confidence interval"
maxiP=globalMaxP[:,1].max()
miniP=globalMinP[:,1].min()
maxiS=globalMaxS[:,1].max()
miniS=globalMinS[:,1].min()
dp=(maxiP-miniP)/10
ds=(maxiS-miniS)/10
for i in chainsToPlot:
plt.figure()
plt.hold(True)
if args.show_ranges:
plt.plot(maxP[i][:,1],zFilt,color=(0.4,0.8,0.8),label="Range investigated by chain "+str(i))
plt.plot(minP[i][:,1],zFilt,color=(0.4,0.8,0.8))
if not args.dont_show_guess:
plt.plot(firstGuessP[:,1],z,color=(0.5,0.5,0.95),linewidth=4,label="First guess velocity profile")
if analytical:
plt.plot(realP[:,1],z,color=(0,0,0.5),linewidth=4,label="Real velocity profile")
plt.plot(averagesP[i][:,1],zFilt,color=(0.5,0.5,0),linewidth=4,label="Average profile")
if not args.no_density_plots:
#pdense(zFilt,averagesP[i][:,1],np.sqrt(varPs[i][:,1]),M)
pdense(zFilt,(qSupPs[i][:,1]+qInfPs[i][:,1])/2,(qSupPs[i][:,1]-qInfPs[i][:,1])/2,M)
else:
#plt.plot(averagesP[i][:,1]+np.sqrt(varPs[i][:,1]),zFilt,color=(0.5,0.5,0),label="Standard deviation")
#plt.plot(averagesP[i][:,1]-np.sqrt(varPs[i][:,1]),zFilt,color=(0.5,0.5,0))
plt.plot(qSupPs[i][:,1],zFilt,linestyle='--',color=(0.3,0.3,0.7),label=lb)
plt.plot(qInfPs[i][:,1],zFilt,linestyle='--',color=(0.3,0.3,0.7))
if args.show_averages:
plt.plot(averagesP[i][:,1],zFilt,label="Average model")
if args.show_ranges:
plt.plot(globalMaxP[:,1],zFilt,color=(1,0,0),label="Range investigated by all chains")
plt.plot(globalMinP[:,1],zFilt,color=(1,0,0))
plt.rc('text', usetex=True)
plt.rc('font', family='serif')
plt.title(r'Chain '+str(i),fontsize='14')
plt.xlabel(r'P waves velocity ($m.s^{-1}$)',fontsize='14')
plt.ylabel(r'Depth ($m$)',fontsize='14')
plt.xlim(miniP-dp, maxiP+dp)
plt.legend()
plt.ylim(ymin=zFilt.max())
plt.ylim(ymax=zFilt.min())
if swaves:
plt.figure()
if args.show_ranges:
plt.plot(maxS[i][:,1],zFilt,color=(0.4,0.8,0.8),label="Range investigated by chain "+str(i))
plt.plot(minS[i][:,1],zFilt,color=(0.4,0.8,0.8))
if not args.dont_show_guess:
plt.plot(firstGuessS[:,1],z,color=(0.5,0.95,0.5),linewidth=4,label="First guess velocity profile")
if analytical:
plt.plot(realS[:,1],z,color=(0,0.5,0),linewidth=4,label="Real velocity profile")
plt.plot(averagesS[i][:,1],zFilt,color=(0.5,0.5,0),linewidth=4,label="Average profile")
if not args.no_density_plots:
#pdense(zFilt,averagesS[i][:,1],np.sqrt(varSs[i][:,1]),M)
pdense(zFilt,(qSupSs[i][:,1]+qInfSs[i][:,1])/2,(qSupSs[i][:,1]-qInfSs[i][:,1])/2,M)
else:
#plt.plot(averagesS[i][:,1]+np.sqrt(varSs[i][:,1]),zFilt,color=(0.5,0.5,0),label="Standard deviation")
#plt.plot(averagesS[i][:,1]-np.sqrt(varSs[i][:,1]),zFilt,color=(0.5,0.5,0))
plt.plot(qSupSs[i][:,1],zFilt,linestyle='--',color=(0.3,0.3,0.7),label=lb)
plt.plot(qInfSs[i][:,1],zFilt,linestyle='--',color=(0.3,0.3,0.7))
if args.show_averages:
plt.plot(averagesS[i][:,1],zFilt,label="Average model")
if args.show_ranges:
plt.plot(globalMaxS[:,1],zFilt,color=(1,0,0),label="Range investigated by all chains")
plt.plot(globalMinS[:,1],zFilt,color=(1,0,0))
plt.rc('text', usetex=True)
plt.rc('font', family='serif')
plt.title(r'Chain '+str(i),fontsize='14')
plt.xlabel(r'S waves velocity ($m.s^{-1}$)',fontsize='14')
plt.ylabel(r'Depth ($m$)',fontsize='14')
plt.xlim(miniS-ds, maxiS+ds)
plt.legend()
plt.ylim(ymin=zFilt.max())
plt.ylim(ymax=zFilt.min())
if args.results:
maxiP=globalMaxP[:,1].max()
miniP=globalMinP[:,1].min()
maxiS=globalMaxS[:,1].max()
miniS=globalMinS[:,1].min()
dp=(maxiP-miniP)/10
ds=(maxiS-miniS)/10
plt.figure()
plt.hold(True)
if not args.dont_show_guess:
plt.plot(firstGuessP[:,1],z,color=(0.5,0.5,0.95),linewidth=4,label="First guess velocity profile")
plt.plot(globalAverageP[:,1],zFilt,color=(0.5,0.5,0),linewidth=4,label="Global average")
if analytical:
plt.plot(realP[:,1],z,color=(0,0,0.5),linewidth=4,label="Real velocity profile")
if not args.no_density_plots:
pdense(zFilt,globalAverageP[:,1],np.sqrt(globalVarP[:,1]),M)
else:
plt.plot(globalAverageP[:,1]+np.sqrt(globalVarP[:,1]),zFilt,linestyle='--',color=(0.3,0.3,0.7),label="Standard deviation")
plt.plot(globalAverageP[:,1]-np.sqrt(globalVarP[:,1]),zFilt,linestyle='--',color=(0.3,0.3,0.7))
if args.show_ranges:
plt.plot(globalMaxP[:,1],zFilt,color=(1,0,0),label="Range investigated by all chains")
plt.plot(globalMinP[:,1],zFilt,color=(1,0,0))
plt.rc('text', usetex=True)
plt.rc('font', family='serif')
plt.title('Global results',fontsize=18)
plt.xlabel('P waves velocity (m.s$^{-1}$)',fontsize=18)
plt.ylabel('Depth (m)',fontsize=18)
plt.xlim(miniP-dp, maxiP+dp)
plt.legend()
plt.ylim(ymin=zFilt.max())
plt.ylim(ymax=zFilt.min())
if swaves:
plt.figure()
if not args.dont_show_guess:
plt.plot(firstGuessS[:,1],z,color=(0.5,0.95,0.5),linewidth=4,label="First guess velocity profile")
plt.plot(globalAverageS[:,1],zFilt,color=(0.5,0.5,0),linewidth=4,label="Global average")
if analytical:
plt.plot(realS[:,1],z,color=(0,0.5,0),linewidth=4,label="Real velocity profile")
if not args.no_density_plots:
pdense(zFilt,globalAverageS[:,1],np.sqrt(globalVarS[:,1]),M)
else:
plt.plot(globalAverageS[:,1]+np.sqrt(globalVarS[:,1]),zFilt,linestyle='--',color=(0.3,0.3,0.7),label="Standard deviation")
plt.plot(globalAverageS[:,1]-np.sqrt(globalVarS[:,1]),zFilt,linestyle='--',color=(0.3,0.3,0.7))
if args.show_ranges:
plt.plot(globalMaxS[:,1],zFilt,color=(1,0,0),label="Range investigated by all chains")
plt.plot(globalMinS[:,1],zFilt,color=(1,0,0))
plt.rc('text', usetex=True)
plt.rc('font', family='serif')
plt.title('Global results',fontsize=18)
plt.xlabel('S waves velocity (m.s$^{-1}$)',fontsize=18)
plt.ylabel('Depth (m)',fontsize=18)
plt.xlim(miniS-ds, maxiS+ds)
plt.legend()
plt.ylim(ymin=zFilt.max())
plt.ylim(ymax=zFilt.min())
if args.best:
if bestModelCalculated:
diffDataBestModel=bestModelTimes-timesData
if recalculate_t0 or args.recalculate_t0:
for i in np.arange(nShots):
diffPshoti=diffDataBestModel[i*nStats:(i+1)*nStats,0][timesData[i*nStats:(i+1)*nStats,0]>0]
t0ShotsPi=diffPshoti.mean()
if args.verbose:
print "t0P[",i,"] = ",t0ShotsPi
diffDataBestModel[i*nStats:(i+1)*nStats,0]=diffDataBestModel[i*nStats:(i+1)*nStats,0]-t0ShotsPi
if swaves:
diffSshoti=diffDataBestModel[i*nStats:(i+1)*nStats,1][timesData[i*nStats:(i+1)*nStats,1]>0]
t0ShotsSi=diffSshoti.mean()
if args.verbose:
print "t0S[",i,"] = ",t0ShotsSi
diffDataBestModel[i*nStats:(i+1)*nStats,1]=diffDataBestModel[i*nStats:(i+1)*nStats,1]-t0ShotsSi
diffP=diffDataBestModel[:,0][timesData[:,0]>0]
diffS=diffDataBestModel[:,1][timesData[:,1]>0]
fig = plt.figure()
plt.hold(True)
plt.plot(np.arange(len(diffP)),np.zeros(len(diffP))+sigmaP,'b--',linewidth=2)
plt.plot(np.arange(len(diffP)),np.zeros(len(diffP))-sigmaP,'b--',linewidth=2)
plt.plot(np.arange(len(diffP)),np.zeros(len(diffP))+2*sigmaP,'--',color=(0.3,0.3,1),linewidth=1.5)
plt.plot(np.arange(len(diffP)),np.zeros(len(diffP))-2*sigmaP,'--',color=(0.3,0.3,1),linewidth=1.5)
plt.plot(np.arange(len(diffP)),np.zeros(len(diffP))+3*sigmaP,'--',color=(0.5,0.5,1))
plt.plot(np.arange(len(diffP)),np.zeros(len(diffP))-3*sigmaP,'--',color=(0.5,0.5,1))
plt.plot(np.arange(len(diffP)),diffP,'g+')
plt.ylim([-20*sigmaP,20*sigmaP])
plt.xlim([0,len(diffP)-1])
plt.rc('text', usetex=True)
plt.rc('font', family='serif')
plt.text(0.6666*len(diffP), 1.1*sigmaP, r'$1\sigma$',fontsize='30',color='b')
plt.text(0.7708*len(diffP), 2.1*sigmaP, r'$2\sigma$',fontsize='30',color=(0.3,0.3,1))
plt.text(0.875*len(diffP), 3.1*sigmaP, r'$3\sigma$',fontsize='30',color=(0.5,0.5,1))
plt.xlabel(r'Receiver number',fontsize='14')
plt.ylabel(r'P waves arrival times residuals ($s$)',fontsize='14')
plt.title(r'Best model residuals',fontsize='14')
if swaves:
fig2 = plt.figure()
plt.hold(True)
plt.plot(np.arange(len(diffS)),np.zeros(len(diffS))+sigmaS,'b--',linewidth=2)
plt.plot(np.arange(len(diffS)),np.zeros(len(diffS))-sigmaS,'b--',linewidth=2)
plt.plot(np.arange(len(diffS)),np.zeros(len(diffS))+2*sigmaS,'--',color=(0.3,0.3,1),linewidth=1.5)
plt.plot(np.arange(len(diffS)),np.zeros(len(diffS))-2*sigmaS,'--',color=(0.3,0.3,1),linewidth=1.5)
plt.plot(np.arange(len(diffS)),np.zeros(len(diffS))+3*sigmaS,'--',color=(0.5,0.5,1))
plt.plot(np.arange(len(diffS)),np.zeros(len(diffS))-3*sigmaS,'--',color=(0.5,0.5,1))
#plt.plot(np.arange(len(diffS)),diffDataBestModel[:,1],'g+')
plt.plot(np.arange(len(diffS)),diffS,'g+')
plt.ylim([-20*sigmaP,20*sigmaP])
plt.xlim([0,len(diffS)-1])
plt.rc('text', usetex=True)
plt.rc('font', family='serif')
plt.text(0.6666*len(diffS), 1.1*sigmaS, r'$1\sigma$',fontsize='30',color='b')
plt.text(0.7708*len(diffS), 2.1*sigmaS, r'$2\sigma$',fontsize='30',color=(0.3,0.3,1))
plt.text(0.875*len(diffS), 3.1*sigmaS, r'$3\sigma$',fontsize='30',color=(0.5,0.5,1))
plt.xlabel(r'Receiver number',fontsize='14')
plt.ylabel(r'S waves arrival times residuals ($s$)',fontsize='14')
plt.title(r'Best model residuals',fontsize='14')
E=sum((diffP/sigmaP)**2/2)+sum((diffS/sigmaS)**2/2)+ep
else:
E=sum((diffP/sigmaP)**2/2)+ep
if args.verbose:
print "Energy of best model :",E
else:
print "The best model has not been calculated"
nBest=len(glob.glob1(args.pathToDir,"bestPprofile*"))
if args.verbose:
print "Number of good model kept : ",nBest
bestP=[0]*nBest
bestS=[0]*nBest
ii=0
iterationBest=[0]*nBest
EP=[0]*nBest
ES=[0]*nBest
for bestModel in glob.glob1(args.pathToDir,"bestPprofile*"):
ii=ii+1
chain=bestModel.split("chain")[1].split(".")[0]
idx=bestModel.split("idx")[1].split(".")[0]
iterationBest[ii-1]=int(idx)
EP[ii-1]=float(bestModel.split("E")[1].split(code)[0].strip("."))
bestP[ii-1]=np.loadtxt(args.pathToDir+bestModel)
if args.verbose:
print "Model number : ",ii, " -> ",bestModel," generated by chain ",chain," at iteration ",idx," (energy "+str(EP[ii-1])+")"
ii=0
for bestModel in glob.glob1(args.pathToDir,"bestSprofile*"):
ii=ii+1
chain=bestModel.split("chain")[1].split(".")[0]
idx=bestModel.split("idx")[1].split(".")[0]
ES[ii-1]=float(bestModel.split("E")[1].split(code)[0].strip("."))
bestS[ii-1]=np.loadtxt(args.pathToDir+bestModel)
if args.verbose:
print "Model number : ",ii, " -> ",bestModel," generated by chain ",chain," at iteration ",idx," (energy "+str(ES[ii-1])+")"
maxiP=globalMaxP[:,1].max()
miniP=globalMinP[:,1].min()
maxiS=globalMaxS[:,1].max()
miniS=globalMinS[:,1].min()
dp=(maxiP-miniP)/10
ds=(maxiS-miniS)/10
from operator import itemgetter
idxBestP=min(enumerate(EP), key=itemgetter(1))[0] # index of best model
idxBestS=min(enumerate(ES), key=itemgetter(1))[0] # index of best S model (it is the same one!)
plt.figure()
if analytical:
plt.plot(realP[:,1],z,color=(0,0,0.5),linewidth=4,label="Real velocity profile")
if args.verbose:
print "Models kept after iteration : "+str(args.treshold)+" will be shown"
for i in np.arange(nBest):
if iterationBest[i] > args.treshold:
plt.hold(True)
if i == idxBestP:
plt.plot(bestP[i][:,1],zFilt,linewidth=4,label="Best model")
else:
plt.plot(bestP[i][:,1],zFilt)
plt.rc('text', usetex=True)
plt.rc('font', family='serif')
plt.xlabel(r'Best P wave velocity models in ($m.s^{-1}$)',fontsize='14')
plt.ylabel(r'Depth ($m$)',fontsize='14')
plt.xlim(miniP-dp, maxiP+dp)
plt.ylim(ymax=z.max())
plt.gca().invert_yaxis()
plt.legend()
if swaves:
plt.figure()
if analytical:
plt.plot(realS[:,1],z,color=(0,0,0.5),linewidth=4,label="Real velocity profile")
for i in np.arange(nBest):
if iterationBest[i] > args.treshold:
plt.hold(True)
if i == idxBestS:
plt.plot(bestS[i][:,1],zFilt,linewidth=4,label="Best model")
else:
plt.plot(bestS[i][:,1],zFilt)
plt.rc('text', usetex=True)
plt.rc('font', family='serif')
plt.xlabel(r'Best S wave velocity models in ($m.s^{-1}$)',fontsize='14')
plt.ylabel(r'Depth ($m$)',fontsize='14')
plt.xlim(miniS-ds, maxiS+ds)
plt.ylim(ymax=z.max())
plt.gca().invert_yaxis()
plt.legend()
################################ VP/VS ################################
if args.vpvs:
if not swaves:
print "Impossible to print Vp/Vs ratio as Swaves had not been calculated during the algorithm"
else:
for i in np.arange(nbt):
plt.figure()
plt.hold(True)
vpFractionalUncertainty = 100*np.sqrt(varPs[i][:,1])/averagesP[i][:,1] # Ex: is vp=2500+/-100m/s -> fractional uncertainty 4% vp = 2500+/-4%
vsFractionalUncertainty = 100*np.sqrt(varSs[i][:,1])/averagesS[i][:,1] # Ex: is vs=2500+/-100m/s -> fractional uncertainty 4% vs = 2500+/-4%
ratioFractionalUncertainty = vpFractionalUncertainty + vsFractionalUncertainty
meanRatio = averagesP[i][:,1]/averagesS[i][:,1]
numericalUncertainty = meanRatio*(vpFractionalUncertainty + vsFractionalUncertainty)/100
plt.plot(meanRatio + numericalUncertainty,zFilt,linestyle='--',color=(0.3,0.3,0.7),label="Standard deviation")
plt.plot(meanRatio - numericalUncertainty,zFilt,linestyle='--',color=(0.3,0.3,0.7))
plt.plot(meanRatio,zFilt,label="Average Vp/Vs for chain "+str(i))
# Load best profiles :
nBest=len(glob.glob1(args.pathToDir,"bestPprofile*"))
bestP=[0]*nBest
bestS=[0]*nBest
EP=[0]*nBest
ES=[0]*nBest
ii=0
for bestModel in glob.glob1(args.pathToDir,"bestPprofile*"):
ii=ii+1
EP[ii-1]=float(bestModel.split("E")[1].split(code)[0].strip("."))
bestP[ii-1]=np.loadtxt(args.pathToDir+bestModel)
ii=0
for bestModel in glob.glob1(args.pathToDir,"bestSprofile*"):
ii=ii+1
ES[ii-1]=float(bestModel.split("E")[1].split(code)[0].strip("."))
bestS[ii-1]=np.loadtxt(args.pathToDir+bestModel)
from operator import itemgetter
idxBestP=[]
idxBestS=[]
if EP:
idxBestP=min(enumerate(EP), key=itemgetter(1))[0] # index of best model
if ES:
idxBestS=min(enumerate(ES), key=itemgetter(1))[0] # index of best S model (it is the same one!)
# End of loading best profiles
if EP:
plt.plot(bestP[idxBestP][:,1]/bestS[idxBestS][:,1],zFilt,linewidth=4,label="Vp/Vs of the best model")
plt.rc('text', usetex=True)
plt.rc('font', family='serif')
plt.xlabel(r'Ratio Vp/Vs',fontsize='14')
plt.ylabel(r'Depth ($m$)',fontsize='14')
#plt.ylim(ymax=zFilt.max())
plt.ylim(ymin=zFilt.max())
plt.ylim(ymax=zFilt.min())
plt.legend()
plt.figure()
plt.hold(True)
vpFractionalUncertainty = 100*np.sqrt(globalVarP[:,1])/globalAverageP[:,1] # Ex: is vp=2500+/-100m/s -> fractional uncertainty 4% vp = 2500+/-4%
vsFractionalUncertainty = 100*np.sqrt(globalVarS[:,1])/globalAverageS[:,1] # Ex: is vs=2500+/-100m/s -> fractional uncertainty 4% vs = 2500+/-4%
ratioFractionalUncertainty = vpFractionalUncertainty + vsFractionalUncertainty
meanRatio = globalAverageP[:,1]/globalAverageS[:,1]
numericalUncertainty = meanRatio*(vpFractionalUncertainty + vsFractionalUncertainty)/100
plt.plot(meanRatio + np.sqrt(globalVarVpVs[:,1])/3,zFilt,linestyle='--',color=(0.3,0.5,0.7),label="Real standard deviation")
plt.plot(meanRatio - np.sqrt(globalVarVpVs[:,1])/3,zFilt,linestyle='--',color=(0.3,0.5,0.7))
plt.plot(meanRatio + numericalUncertainty,zFilt,linestyle='--',color=(0.3,0.3,0.7),label="Approx standard deviation")
plt.plot(meanRatio - numericalUncertainty,zFilt,linestyle='--',color=(0.3,0.3,0.7))
plt.plot(meanRatio,zFilt,label="Global average Vp/Vs")
# Load best profiles :
nBest=len(glob.glob1(args.pathToDir,"bestPprofile*"))
bestP=[0]*nBest
bestS=[0]*nBest
EP=[0]*nBest
ES=[0]*nBest
ii=0
for bestModel in glob.glob1(args.pathToDir,"bestPprofile*"):
ii=ii+1
EP[ii-1]=float(bestModel.split("E")[1].split(code)[0].strip("."))
bestP[ii-1]=np.loadtxt(args.pathToDir+bestModel)
ii=0
for bestModel in glob.glob1(args.pathToDir,"bestSprofile*"):
ii=ii+1
ES[ii-1]=float(bestModel.split("E")[1].split(code)[0].strip("."))
bestS[ii-1]=np.loadtxt(args.pathToDir+bestModel)
from operator import itemgetter
idxBestP=[]
idxBestS=[]
if EP:
idxBestP=min(enumerate(EP), key=itemgetter(1))[0] # index of best model
if ES:
idxBestS=min(enumerate(ES), key=itemgetter(1))[0] # index of best S model (it is the same one!)
# End of loading best profiles
if EP:
plt.plot(bestP[idxBestP][:,1]/bestS[idxBestS][:,1],zFilt,linewidth=4,label="Vp/Vs of the best model")
if analytical:
plt.plot(realP[:,1]/realS[:,1],z,color=(0,0,0.5),linewidth=4,label="Real Vp/Vs")
plt.rc('text', usetex=True)
plt.rc('font', family='serif')
plt.xlabel(r'Ratio Vp/Vs',fontsize='14')
plt.ylabel(r'Depth ($m$)',fontsize='14')
#plt.ylim(ymax=zFilt.max())
plt.ylim(ymin=zFilt.max())
plt.ylim(ymax=zFilt.min())
plt.legend()
if args.filtering:
for i,filteredCurve in enumerate(filteredPcurve):
fig = plt.figure(figsize=(4,6))
plt.hold(True)
plt.plot(firstGuessP[:,1],z,color=(0.5,0.5,0.95))
#if analytical:
# plt.plot(realP[:,1],z,color=(0,0,0.5),linewidth=4)
plt.plot(filteredCurve[:,1],z,color=(0.5,0,0),linewidth=4,label=waveletFiltered[i])
plt.rc('text', usetex=True)
plt.rc('font', family='serif')
plt.xlabel(r'Wave speed (m.s$^{-1}$)',fontsize=16)
plt.ylabel(r'Depth (m)',fontsize=16)
plt.ylim(ymax=z.max())
plt.gca().invert_yaxis()
plt.tick_params(axis='x', labelsize=16)
plt.tick_params(axis='y', labelsize=16)
plt.locator_params(nbins=5)
plt.legend()
################################ SWAPS ################################
if args.swaps:
print "Not implemented for now"
plt.figure()
plt.plot(ll[ll[:,2]==3,1],ll[ll[:,1]==4,2])
#plot(exch(exch(:,2)==3,1),exch(exch(:,2)==3,3),'k')
# plot(exch(exch(:,2)==3,1),exch(exch(:,2)==3,3),'y')
# plot(exch(exch(:,2)==2,1),exch(exch(:,2)==2,3),'c')
#plot(exch(exch(:,2)==1,1),exch(exch(:,2)==1,3),'r')
#plot(exch(exch(:,2)==0,1),exch(exch(:,2)==0,3),'b')
################################ PAPER ################################
if args.paper:
### GEOMETRY ###
fig = plt.figure()
ax = fig.gca(projection='3d') #Axes3D(fig)
ax.hold(True)
ax.scatter(coordStats[:,0],coordStats[:,1],coordStats[:,2],zdir='z',s=20,c='b')
if (coordShots.size>3):
ax.scatter(coordShots[:,0],coordShots[:,1],coordShots[:,2],zdir='z',s=20,c='r',marker='^')
else:
ax.scatter(coordShots[0],coordShots[1],coordShots[2],zdir='z',s=200,c='r',marker='^')
ax.set_xlim3d(xmin,xmax)
ax.set_ylim3d(ymin,ymax)
ax.set_zlim3d(zmin,zmax)
plt.rc('text', usetex=True)
plt.rc('font', family='serif')
ax.set_xlabel('X (m)')
ax.set_ylabel('Y (m)')
ax.set_zlabel('Z (m)')
ax.invert_zaxis()
### LOGS AND PRIOR ###
fontsize=18
fig2 = plt.figure(figsize=(6,8))
plt.gcf().subplots_adjust(left=0.15)
plt.hold(True)
plt.plot(firstGuessP[:,1],z,color=(0.5,0.5,0.95))
if (swaves):
plt.plot(firstGuessS[:,1],z,color=(0.5,0.95,0.5))
if analytical:
plt.plot(realP[:,1],z,color=(0,0,0.5),linewidth=4)
if swaves:
plt.plot(realS[:,1],z,color=(0,0.5,0),linewidth=4)
plt.rc('text', usetex=True)
plt.rc('font', family='serif')
plt.xlabel('Wave speed (m.s$^{-1}$)',fontsize=fontsize)
plt.ylabel('Depth (m)',fontsize=fontsize)
plt.tick_params(axis='x', labelsize=fontsize-2)
plt.tick_params(axis='y', labelsize=fontsize-2)
plt.ylim(ymax=z.max())
plt.gca().invert_yaxis()
if nPriorProfiles > 0:
plt.figure(figsize=(6,8))
plt.gcf().subplots_adjust(left=0.15)
plt.hold(True)
plt.plot(firstGuessP[:,1],z,color=(0.5,0.5,0.95),alpha=0.5,label="P wave sonic log")
for i in np.arange(nPriorProfiles):
if i%3 == 1:
if i == 1:
plt.plot(priorP[i][:,1],z,'m',label="P wave velocity profiles from prior")
else:
plt.plot(priorP[i][:,1],z,'m')
plt.rc('text', usetex=True)
plt.rc('font', family='serif')
plt.xlabel('Velocity (m.s$^{-1}$)',fontsize=fontsize)
plt.ylabel('Depth (m)',fontsize=fontsize)
plt.tick_params(axis='x', labelsize=fontsize-2)
plt.tick_params(axis='y', labelsize=fontsize-2)
plt.ylim(ymin=z.max())
plt.ylim(ymax=z.min())
plt.legend(loc=0,fontsize=16)
if swaves:
plt.figure(figsize=(6,8))
plt.gcf().subplots_adjust(left=0.15)
plt.hold(True)
plt.plot(firstGuessS[:,1],z,color=(0.5,0.95,0.5),alpha=0.5,label="S wave sonic log")
for i in np.arange(nPriorProfiles):
if i%3 == 1:
if i == 1:
plt.plot(priorS[i][:,1],z,'y',label="S wave velocity profiles from prior")
else:
plt.plot(priorS[i][:,1],z,'y')
plt.rc('text', usetex=True)
plt.rc('font', family='serif')
plt.xlabel('Velocity (m.s$^{-1}$)',fontsize=fontsize)
plt.ylabel('Depth (m)',fontsize=fontsize)
plt.ylim(ymin=z.max())
plt.ylim(ymax=z.min())
plt.tick_params(axis='x', labelsize=fontsize-2)
plt.tick_params(axis='y', labelsize=fontsize-2)
plt.legend(loc=0,fontsize=16)
### ENERGY ###
plt.figure(figsize=(8,6))
plt.hold(True)
ii=0
nBest=len(glob.glob1(args.pathToDir,"bestPprofile*"))
E=[0]*nBest
iterationBest=[0]*nBest
chain=[0]*nBest
for bestModel in glob.glob1(args.pathToDir,"bestSprofile*"):
ii=ii+1
iterationBest[ii-1]=int(bestModel.split("idx")[1].split(".")[0])
chain[ii-1]=int(bestModel.split("chain")[1].split(".")[0])
E[ii-1]=float(bestModel.split("E")[1].split(code)[0].strip("."))
# TODO : this does not work if the energy value contains the code of the run : ex code=745 energy=745.23
if args.verbose:
print "Models kept after iteration : "+str(args.treshold)+" will be shown"
from operator import itemgetter
idxBest=min(enumerate(E), key=itemgetter(1))[0] # index of best model
itBestE=iterationBest[idxBest]
chainBest=chain[idxBest]
chain=[chain[i] for i in np.arange(nBest) if iterationBest[i] > args.treshold]
iterationBest=[i for i in iterationBest if i>args.treshold]
iteration=np.arange(nit)
for i in np.arange(nbt):
if i<20:
if len(iteration) == len(chains[i][:,-1]):
plt.semilogy(iteration,chains[i][:,-1]*T[i])
else:
miniIteration = min(len(iteration),len(chains[i][:,-1]))
plt.semilogy(iteration[:miniIteration],chains[i][:miniIteration,-1]*T[i])
plt.rc('text', usetex=True)
plt.rc('font', family='serif')
flagForLabel=True
plt.semilogy(itBestE, T[chainBest]*chains[chainBest][:,-1][itBestE], 'rD', label="Best model")
if recalculate_t0 is True:
if swaves:
plt.semilogy(iteration,np.zeros(nit)+nStats*nShots+ep,'b--',linewidth=2) #,label=r'Behind that line every model can be acceptable ($1\sigma$ misfit for each measurement)')
else:
plt.semilogy(iteration,np.zeros(nit)+nStats*nShots/2.0+ep,'b--',linewidth=2)
plt.semilogy(iteration,np.zeros(nit)+ep,label="Prior's energy")
plt.xlim(xmax=iteration.max())
plt.rc('font', family='serif')
plt.xlabel('Iteration',fontsize=18)
#plt.ylim(ymin=1500,ymax=2300)
plt.ylabel('Energy',fontsize=18)
plt.tick_params(axis='x', labelsize=16)
plt.tick_params(axis='y', labelsize=16)
plt.legend(loc=0,numpoints=1,fontsize=16)
### VP/VS ###
plt.figure(figsize=(8,10))
plt.hold(True)
plt.plot(firstGuessP[:,1]/firstGuessS[:,1],z,color=(0.95,0.9,0.9),linewidth=1,label="Sonic logs Vp/Vs", zorder=1)
vpFractionalUncertainty = 100*np.sqrt(globalVarP[:,1])/globalAverageP[:,1] # Ex: is vp=2500+/-100m/s -> fractional uncertainty 4% vp = 2500+/-4%
vsFractionalUncertainty = 100*np.sqrt(globalVarS[:,1])/globalAverageS[:,1] # Ex: is vs=2500+/-100m/s -> fractional uncertainty 4% vs = 2500+/-4%
ratioFractionalUncertainty = vpFractionalUncertainty + vsFractionalUncertainty
meanRatio = globalAverageP[:,1]/globalAverageS[:,1]
numericalUncertainty = meanRatio*(vpFractionalUncertainty + vsFractionalUncertainty)/100
#pdense(zFilt,meanRatio,numericalUncertainty,M)
pdense(zFilt,meanRatio,np.sqrt(globalVarVpVs[:,1])/3,M)
plt.plot(meanRatio + np.sqrt(globalVarVpVs[:,1])/3,zFilt,linestyle='--',color=(0.3,0.3,0.7),label="Standard deviation")
plt.plot(meanRatio - np.sqrt(globalVarVpVs[:,1])/3,zFilt,linestyle='--',color=(0.3,0.3,0.7))
#plt.plot(meanRatio + numericalUncertainty,zFilt,linestyle='--',color=(0.3,0.3,0.7),label="Standard deviation")
#plt.plot(meanRatio - numericalUncertainty,zFilt,linestyle='--',color=(0.3,0.3,0.7))
plt.plot(meanRatio,zFilt,label="Average Vp/Vs")
# Load best profiles :
nBest=len(glob.glob1(args.pathToDir,"bestPprofile*"))
bestP=[0]*nBest
bestS=[0]*nBest
EP=[0]*nBest
ES=[0]*nBest
ii=0
for bestModel in glob.glob1(args.pathToDir,"bestPprofile*"):
ii=ii+1
EP[ii-1]=float(bestModel.split("E")[1].split(code)[0].strip("."))
bestP[ii-1]=np.loadtxt(args.pathToDir+bestModel)
ii=0
for bestModel in glob.glob1(args.pathToDir,"bestSprofile*"):
ii=ii+1
ES[ii-1]=float(bestModel.split("E")[1].split(code)[0].strip("."))
bestS[ii-1]=np.loadtxt(args.pathToDir+bestModel)
from operator import itemgetter
idxBestP=min(enumerate(EP), key=itemgetter(1))[0] # index of best model
idxBestS=min(enumerate(ES), key=itemgetter(1))[0] # index of best S model (it is the same one!)
# End of loading best profiles
plt.plot(bestP[idxBestP][:,1]/bestS[idxBestS][:,1],zFilt,'g',linewidth=2,label="Vp/Vs of the best model")
plt.rc('text', usetex=True)
plt.rc('font', family='serif')
plt.xlabel(r'Ratio Vp/Vs',fontsize=18)
plt.ylabel(r'Depth (m)',fontsize=18)
#plt.ylim(ymax=zFilt.max())
plt.ylim(ymin=zFilt.max())
plt.ylim(ymax=zFilt.min())
plt.xlim([0.5,3.5])
plt.tick_params(axis='x', labelsize=16)
plt.tick_params(axis='y', labelsize=16)
plt.legend(loc=4,fontsize=16)
### RESIDUALS ###
if bestModelCalculated:
diffDataBestModel=bestModelTimes-timesData
if recalculate_t0 or args.recalculate_t0:
for i in np.arange(nShots):
diffPshoti=diffDataBestModel[i*nStats:(i+1)*nStats,0][timesData[i*nStats:(i+1)*nStats,0]>0]
t0ShotsPi=diffPshoti.mean()
diffDataBestModel[i*nStats:(i+1)*nStats,0]=diffDataBestModel[i*nStats:(i+1)*nStats,0]-t0ShotsPi
if swaves:
diffSshoti=diffDataBestModel[i*nStats:(i+1)*nStats,1][timesData[i*nStats:(i+1)*nStats,1]>0]
t0ShotsSi=diffSshoti.mean()
diffDataBestModel[i*nStats:(i+1)*nStats,1]=diffDataBestModel[i*nStats:(i+1)*nStats,1]-t0ShotsSi
diffP=diffDataBestModel[:,0][timesData[:,0]>0]
diffS=diffDataBestModel[:,1][timesData[:,1]>0]
fig = plt.figure()
plt.hold(True)
plt.plot(np.arange(len(diffP)),np.zeros(len(diffP))+sigmaP,'b--',linewidth=2)
plt.plot(np.arange(len(diffP)),np.zeros(len(diffP))-sigmaP,'b--',linewidth=2)
plt.plot(np.arange(len(diffP)),np.zeros(len(diffP))+2*sigmaP,'--',color=(0.3,0.3,1),linewidth=1.5)
plt.plot(np.arange(len(diffP)),np.zeros(len(diffP))-2*sigmaP,'--',color=(0.3,0.3,1),linewidth=1.5)
plt.plot(np.arange(len(diffP)),np.zeros(len(diffP))+3*sigmaP,'--',color=(0.5,0.5,1))
plt.plot(np.arange(len(diffP)),np.zeros(len(diffP))-3*sigmaP,'--',color=(0.5,0.5,1))
plt.plot(np.arange(len(diffP)),diffP,'g+')
plt.ylim([-10*sigmaP,10*sigmaP])
plt.xlim([0,len(diffP)-1])
plt.rc('text', usetex=True)
plt.rc('font', family='serif')
plt.text(0.6666*len(diffP), 1.1*sigmaP, r'$1\sigma$',fontsize=30,color='b')
plt.text(0.7708*len(diffP), 2.1*sigmaP, r'$2\sigma$',fontsize=30,color=(0.3,0.3,1))
plt.text(0.875*len(diffP), 3.1*sigmaP, r'$3\sigma$',fontsize=30,color=(0.5,0.5,1))
plt.tick_params(axis='x', labelsize=16)
plt.tick_params(axis='y', labelsize=16)
plt.xlabel('Receiver number',fontsize=18)
plt.ylabel('P waves arrival times residuals (s)',fontsize=18)
if swaves:
fig2 = plt.figure()
plt.hold(True)
plt.plot(np.arange(len(diffS)),np.zeros(len(diffS))+sigmaS,'b--',linewidth=2)
plt.plot(np.arange(len(diffS)),np.zeros(len(diffS))-sigmaS,'b--',linewidth=2)
plt.plot(np.arange(len(diffS)),np.zeros(len(diffS))+2*sigmaS,'--',color=(0.3,0.3,1),linewidth=1.5)
plt.plot(np.arange(len(diffS)),np.zeros(len(diffS))-2*sigmaS,'--',color=(0.3,0.3,1),linewidth=1.5)
plt.plot(np.arange(len(diffS)),np.zeros(len(diffS))+3*sigmaS,'--',color=(0.5,0.5,1))
plt.plot(np.arange(len(diffS)),np.zeros(len(diffS))-3*sigmaS,'--',color=(0.5,0.5,1))
#plt.plot(np.arange(len(diffS)),diffDataBestModel[:,1],'g+')
plt.plot(np.arange(len(diffS)),diffS,'g+')
plt.ylim([-10*sigmaP,10*sigmaP])
plt.xlim([0,len(diffS)-1])
plt.rc('text', usetex=True)
plt.rc('font', family='serif')
plt.text(0.6666*len(diffS), 1.1*sigmaS, r'$1\sigma$',fontsize=30,color='b')
plt.text(0.7708*len(diffS), 2.1*sigmaS, r'$2\sigma$',fontsize=30,color=(0.3,0.3,1))
plt.text(0.875*len(diffS), 3.1*sigmaS, r'$3\sigma$',fontsize=30,color=(0.5,0.5,1))
plt.xlabel('Receiver number',fontsize=18)
plt.ylabel('S waves arrival times residuals (s)',fontsize=18)
plt.tick_params(axis='x', labelsize=16)
plt.tick_params(axis='y', labelsize=16)
E=sum((diffP/sigmaP)**2/2)+sum((diffS/sigmaS)**2/2)+ep
else:
E=sum((diffP/sigmaP)**2/2)+ep
else:
print "The best model has not been calculated"
### RESULTS ###
# lb=qp+"\% confidence interval"
# maxiP=globalMaxP[:,1].max()
# miniP=globalMinP[:,1].min()
# maxiS=globalMaxS[:,1].max()
# miniS=globalMinS[:,1].min()
# plt.figure(figsize=(8,10))
# plt.hold(True)
# plt.plot(firstGuessP[:,1],z,color=(0.5,0.5,0.95),linewidth=1,label="Sonic log", alpha=0.4, zorder=1)
# if analytical:
# plt.plot(realP[:,1],z,color=(0,0,0.5),linewidth=4,label="Real velocity profile")
# plt.plot(globalAverageP[:,1],zFilt,linewidth=4,label="Global average")
# pdense(zFilt,globalAverageP[:,1],np.sqrt(globalVarP[:,1]),M)
# plt.plot(globalAverageP[:,1]+np.sqrt(globalVarP[:,1]),zFilt,linestyle='--',color=(0.3,0.3,0.7),label="Standard deviation")
# plt.plot(globalAverageP[:,1]-np.sqrt(globalVarP[:,1]),zFilt,linestyle='--',color=(0.3,0.3,0.7))
# plt.plot(bestP[idxBestP][:,1],zFilt,linewidth=4,label="Best model")
# if args.show_ranges:
# plt.plot(globalMaxP[:,1],zFilt,color=(1,0,0),label="Range investigated by all chains")
# plt.plot(globalMinP[:,1],zFilt,color=(1,0,0))
# plt.rc('text', usetex=True)
# plt.rc('font', family='serif')
# plt.xlabel('P wave velocity (m.s$^{-1}$)',fontsize=18)
# plt.ylabel('Depth (m)',fontsize=18)
# plt.xlim(2500, 6500)
# plt.legend(fontsize=16)
# plt.ylim(ymin=zFilt.max())
# plt.ylim(ymax=zFilt.min())
# plt.tick_params(axis='x', labelsize=16)
# plt.tick_params(axis='y', labelsize=16)
# if swaves:
# plt.figure(figsize=(8,10))
# if args.show_ranges:
# plt.plot(globalMaxP[:,1],zFilt,color=(1,0,0),label="Range investigated by all chains")
# plt.plot(globalMinP[:,1],zFilt,color=(1,0,0))
# plt.plot(firstGuessS[:,1],z,color=(0.5,0.95,0.5),linewidth=1,label="Sonic log", alpha=0.4, zorder=1)
# if analytical:
# plt.plot(realS[:,1],z,color=(0,0.5,0),linewidth=4,label="Real velocity profile")
# plt.plot(globalAverageS[:,1],zFilt,linewidth=4,label="Global average")
# pdense(zFilt,globalAverageS[:,1],np.sqrt(globalVarS[:,1]),M)
# plt.plot(globalAverageS[:,1]+np.sqrt(globalVarS[:,1]),zFilt,linestyle='--',color=(0.3,0.3,0.7),label="Standard deviation")
# plt.plot(globalAverageS[:,1]-np.sqrt(globalVarP[:,1]),zFilt,linestyle='--',color=(0.3,0.3,0.7))
# plt.plot(bestS[idxBestS][:,1],zFilt,linewidth=4,label="Best model")
# plt.rc('text', usetex=True)
# plt.rc('font', family='serif')
# plt.xlabel('S wave velocity (m.s$^{-1}$)',fontsize=18)
# plt.ylabel('Depth (m)',fontsize=18)
# plt.xlim(1000,5000)
# plt.legend(fontsize=16)
# plt.ylim(ymin=zFilt.max())
# plt.ylim(ymax=zFilt.min())
# plt.tick_params(axis='x', labelsize=16)
# plt.tick_params(axis='y', labelsize=16)
### RESULTS ###
lb=qp+"\% confidence interval"
maxiP=globalMaxP[:,1].max()
miniP=globalMinP[:,1].min()
maxiS=globalMaxS[:,1].max()
miniS=globalMinS[:,1].min()
plt.figure(figsize=(8,10))
plt.hold(True)
plt.plot(firstGuessP[:,1],z,color=(0.9,0.9,0.99),linewidth=1,label="Sonic log", zorder=1)
#plt.plot(firstGuessP[:,1],z,color=(0.5,0.5,0.95),linewidth=1,label="Sonic log", alpha=0.2, zorder=1)
if analytical:
plt.plot(realP[:,1],z,color=(0,0,0.5),linewidth=4,label="Real velocity profile")
pdense(zFilt,globalAverageP[:,1],np.sqrt(globalVarP[:,1]),M)
#pdense(zFilt,(qSupPs[i][:,1]+qInfPs[i][:,1])/2,(qSupPs[i][:,1]-qInfPs[i][:,1])/2,M)
#plt.plot(qSupPs[i][:,1],zFilt,linestyle='--',color=(0.3,0.3,0.7),label=lb)
#plt.plot(qInfPs[i][:,1],zFilt,linestyle='--',color=(0.3,0.3,0.7))
plt.plot(globalAverageP[:,1],zFilt,linewidth=2,label="Average model")
plt.plot(bestP[idxBestP][:,1],zFilt,linewidth=2,label="Best model")
plt.plot(globalAverageP[:,1]+np.sqrt(globalVarP[:,1]),zFilt,linestyle='--',color=(0.3,0.3,0.7),label="Standard deviation")
plt.plot(globalAverageP[:,1]-np.sqrt(globalVarP[:,1]),zFilt,linestyle='--',color=(0.3,0.3,0.7))
if args.show_ranges:
plt.plot(globalMaxP[:,1],zFilt,color=(1,0,0),label="Range investigated by all chains")
plt.plot(globalMinP[:,1],zFilt,color=(1,0,0))
plt.rc('text', usetex=True)
plt.rc('font', family='serif')
plt.xlabel('P wave velocity (m.s$^{-1}$)',fontsize=18)
plt.ylabel('Depth (m)',fontsize=18)
plt.xlim(2000, 7500)
plt.legend(loc=0,fontsize=16)
plt.ylim(ymin=zFilt.max())
plt.ylim(ymax=zFilt.min())
plt.tick_params(axis='x', labelsize=16)
plt.tick_params(axis='y', labelsize=16)
if swaves:
plt.figure(figsize=(8,10))
if args.show_ranges:
plt.plot(maxS[i][:,1],zFilt,color=(0.4,0.8,0.8),label="Range investigated by chain "+str(i))
plt.plot(minS[i][:,1],zFilt,color=(0.4,0.8,0.8))
plt.plot(firstGuessS[:,1],z,color=(0.89,0.98,0.89),linewidth=1,label="Sonic log",zorder=1)
if analytical:
plt.plot(realS[:,1],z,color=(0,0.5,0),linewidth=4,label="Real velocity profile")
#pdense(zFilt,(qSupSs[i][:,1]+qInfSs[i][:,1])/2,(qSupSs[i][:,1]-qInfSs[i][:,1])/2,M)
pdense(zFilt,globalAverageS[:,1],np.sqrt(globalVarS[:,1]),M)
#plt.plot(qSupSs[i][:,1],zFilt,linestyle='--',color=(0.3,0.3,0.7),label=lb)
#plt.plot(qInfSs[i][:,1],zFilt,linestyle='--',color=(0.3,0.3,0.7))
plt.plot(globalAverageS[:,1],zFilt,linewidth=2,label="Average model")
plt.plot(bestS[idxBestS][:,1],zFilt,linewidth=2,label="Best model")
plt.plot(globalAverageS[:,1]+np.sqrt(globalVarS[:,1]),zFilt,linestyle='--',color=(0.3,0.3,0.7),label="Standard deviation")
plt.plot(globalAverageS[:,1]-np.sqrt(globalVarS[:,1]),zFilt,linestyle='--',color=(0.3,0.3,0.7))
plt.rc('text', usetex=True)
plt.rc('font', family='serif')
plt.xlabel('S wave velocity (m.s$^{-1}$)',fontsize=18)
plt.ylabel('Depth (m)',fontsize=18)
plt.xlim(500,4500)
plt.legend(fontsize=16,loc=0)
plt.ylim(ymin=zFilt.max())
plt.ylim(ymax=zFilt.min())
plt.tick_params(axis='x', labelsize=16)
plt.tick_params(axis='y', labelsize=16)
### Filtered Curves ###
for i,filteredCurve in enumerate(filteredPcurve):
fig = plt.figure(figsize=(4,6))
plt.gcf().subplots_adjust(left=0.22)
plt.hold(True)
plt.plot(firstGuessP[:,1],z,color=(0.5,0.5,0.95))
#if analytical:
# plt.plot(realP[:,1],z,color=(0,0,0.5),linewidth=4)
plt.plot(filteredCurve[:,1],z,color=(0.5,0,0),linewidth=4,label=waveletFiltered[i])
plt.rc('text', usetex=True)
plt.rc('font', family='serif')
plt.xlabel(r'Wave speed (m.s$^{-1}$)',fontsize=18)
plt.ylabel(r'Depth (m)',fontsize=18)
plt.ylim(ymax=z.max())
plt.gca().invert_yaxis()
plt.legend(fontsize=16)
plt.tick_params(axis='x', labelsize=16)
plt.tick_params(axis='y', labelsize=16)
plt.locator_params(nbins=5)
plt.show()
# ### RESULTS ###
# lb=qp+"\% confidence interval"
# maxiP=globalMaxP[:,1].max()
# miniP=globalMinP[:,1].min()
# maxiS=globalMaxS[:,1].max()
# miniS=globalMinS[:,1].min()
# for i in [2]:
# plt.figure(figsize=(8,10))
# plt.hold(True)
# plt.plot(firstGuessP[:,1],z,color=(0.5,0.5,0.95),linewidth=1,label="Sonic log", alpha=0.4, zorder=1)
# if analytical:
# plt.plot(realP[:,1],z,color=(0,0,0.5),linewidth=4,label="Real velocity profile")
# pdense(zFilt,(qSupPs[i][:,1]+qInfPs[i][:,1])/2,(qSupPs[i][:,1]-qInfPs[i][:,1])/2,M)
# plt.plot(qSupPs[i][:,1],zFilt,linestyle='--',color=(0.3,0.3,0.7),label=lb)
# plt.plot(qInfPs[i][:,1],zFilt,linestyle='--',color=(0.3,0.3,0.7))
# plt.plot(averagesP[i][:,1],zFilt,linewidth=4,label="Average model")
# plt.plot(bestP[idxBestP][:,1],zFilt,linewidth=4,label="Best model")
# # plt.plot(averagesP[i][:,1]+np.sqrt(varPs[i][:,1]),zFilt,color=(0.5,0.5,0),label="Standard deviation")
# # plt.plot(averagesP[i][:,1]-np.sqrt(varPs[i][:,1]),zFilt,color=(0.5,0.5,0))
# if args.show_ranges:
# plt.plot(globalMaxP[:,1],zFilt,color=(1,0,0),label="Range investigated by all chains")
# plt.plot(globalMinP[:,1],zFilt,color=(1,0,0))
# plt.rc('text', usetex=True)
# plt.rc('font', family='serif')
# plt.xlabel('P wave velocity (m.s$^{-1}$)',fontsize=18)
# plt.ylabel('Depth (m)',fontsize=18)
# plt.xlim(2500, 6500)
# plt.legend(fontsize=16)
# plt.ylim(ymin=zFilt.max())
# plt.ylim(ymax=zFilt.min())
# plt.tick_params(axis='x', labelsize=16)
# plt.tick_params(axis='y', labelsize=16)
# if swaves:
# plt.figure(figsize=(8,10))
# if args.show_ranges:
# plt.plot(maxS[i][:,1],zFilt,color=(0.4,0.8,0.8),label="Range investigated by chain "+str(i))
# plt.plot(minS[i][:,1],zFilt,color=(0.4,0.8,0.8))
# plt.plot(firstGuessS[:,1],z,color=(0.5,0.95,0.5),linewidth=1,label="Sonic log", alpha=0.4, zorder=1)
# if analytical:
# plt.plot(realS[:,1],z,color=(0,0.5,0),linewidth=4,label="Real velocity profile")
# pdense(zFilt,(qSupSs[i][:,1]+qInfSs[i][:,1])/2,(qSupSs[i][:,1]-qInfSs[i][:,1])/2,M)
# plt.plot(qSupSs[i][:,1],zFilt,linestyle='--',color=(0.3,0.3,0.7),label=lb)
# plt.plot(qInfSs[i][:,1],zFilt,linestyle='--',color=(0.3,0.3,0.7))
# plt.plot(averagesS[i][:,1],zFilt,linewidth=4,label="Average model")
# plt.plot(bestS[idxBestS][:,1],zFilt,linewidth=4,label="Best model")
# # plt.plot(averagesS[i][:,1]+np.sqrt(varSs[i][:,1]),zFilt,color=(0.5,0.5,0),label="Standard deviation")
# # plt.plot(averagesS[i][:,1]-np.sqrt(varSs[i][:,1]),zFilt,color=(0.5,0.5,0))
# plt.rc('text', usetex=True)
# plt.rc('font', family='serif')
# plt.xlabel('S wave velocity (m.s$^{-1}$)',fontsize=18)
# plt.ylabel('Depth (m)',fontsize=18)
# plt.xlim(1000,5000)
# plt.legend(fontsize=16)
# plt.ylim(ymin=zFilt.max())
# plt.ylim(ymax=zFilt.min())
# plt.tick_params(axis='x', labelsize=16)
# plt.tick_params(axis='y', labelsize=16)
| 47.318352
| 183
| 0.592037
| 9,104
| 63,170
| 4.087654
| 0.06239
| 0.033106
| 0.006288
| 0.009889
| 0.801741
| 0.770651
| 0.743564
| 0.726528
| 0.707637
| 0.688934
| 0
| 0.044546
| 0.206111
| 63,170
| 1,334
| 184
| 47.353823
| 0.697507
| 0.16264
| 0
| 0.640884
| 0
| 0
| 0.120744
| 0.00364
| 0
| 0
| 0
| 0.001499
| 0.000921
| 0
| null | null | 0
| 0.01105
| null | null | 0.027624
| 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
|
1393384e4df83686317766243717ebae8e5368cb
| 71
|
py
|
Python
|
Tests/Bugs/chapman/r_mitch_chapman_2_t.py
|
jwilk/Pyrex
|
83dfbae1261788933472e3f9c501ad74c61a37c5
|
[
"Apache-2.0"
] | 5
|
2019-05-26T20:48:36.000Z
|
2021-07-09T01:38:38.000Z
|
Tests/Bugs/chapman/r_mitch_chapman_2_t.py
|
jwilk/Pyrex
|
83dfbae1261788933472e3f9c501ad74c61a37c5
|
[
"Apache-2.0"
] | null | null | null |
Tests/Bugs/chapman/r_mitch_chapman_2_t.py
|
jwilk/Pyrex
|
83dfbae1261788933472e3f9c501ad74c61a37c5
|
[
"Apache-2.0"
] | 1
|
2022-02-10T07:14:58.000Z
|
2022-02-10T07:14:58.000Z
|
import r_mitch_chapman_2
print r_mitch_chapman_2.boolExpressionsFail()
| 23.666667
| 45
| 0.901408
| 11
| 71
| 5.272727
| 0.636364
| 0.206897
| 0.448276
| 0.482759
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.029851
| 0.056338
| 71
| 2
| 46
| 35.5
| 0.835821
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0.5
| null | null | 0.5
| 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
| 1
| 0
| 0
| 1
|
0
| 8
|
139a895d571437e30e487aba7f22592bc19f184f
| 52
|
py
|
Python
|
picbasket/app.py
|
tomocafe/picbasket
|
c1ebe641b31867971bf4a07f364fe8de7b9e99b4
|
[
"MIT"
] | null | null | null |
picbasket/app.py
|
tomocafe/picbasket
|
c1ebe641b31867971bf4a07f364fe8de7b9e99b4
|
[
"MIT"
] | 4
|
2019-11-14T04:32:19.000Z
|
2022-01-28T16:15:10.000Z
|
picbasket/app.py
|
tomocafe/picbasket
|
c1ebe641b31867971bf4a07f364fe8de7b9e99b4
|
[
"MIT"
] | null | null | null |
import picbasket
def main():
# TODO
return
| 8.666667
| 16
| 0.615385
| 6
| 52
| 5.333333
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.307692
| 52
| 5
| 17
| 10.4
| 0.888889
| 0.076923
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.2
| 0
| 1
| 0.333333
| true
| 0
| 0.333333
| 0.333333
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 1
| 1
| 0
| 1
| 1
| 1
| 0
|
0
| 8
|
13a26a58d391bfdcb966482939437e7645f3a503
| 125
|
py
|
Python
|
lib/solutions/HLO/hello_solution.py
|
DPNT-Sourcecode/CHK-nrni01
|
6898b610a7af8c606f75657fd7d92567e9959bb9
|
[
"Apache-2.0"
] | null | null | null |
lib/solutions/HLO/hello_solution.py
|
DPNT-Sourcecode/CHK-nrni01
|
6898b610a7af8c606f75657fd7d92567e9959bb9
|
[
"Apache-2.0"
] | null | null | null |
lib/solutions/HLO/hello_solution.py
|
DPNT-Sourcecode/CHK-nrni01
|
6898b610a7af8c606f75657fd7d92567e9959bb9
|
[
"Apache-2.0"
] | null | null | null |
# noinspection PyUnusedLocal
# friend_name = unicode string
def hello(friend_name):
return "Hello, " + friend_name + "!"
| 25
| 40
| 0.72
| 14
| 125
| 6.214286
| 0.642857
| 0.344828
| 0.344828
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.168
| 125
| 4
| 41
| 31.25
| 0.836538
| 0.44
| 0
| 0
| 0
| 0
| 0.119403
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.5
| false
| 0
| 0
| 0.5
| 1
| 0
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 7
|
13d023405285ec948f2296c18d0acdc91c75979d
| 4,325
|
py
|
Python
|
mvmm/multi_view/block_diag/graph/tests/test_Lsym_gevp.py
|
idc9/mvmm
|
64fce755a7cd53be9b08278484c7a4c77daf38d1
|
[
"MIT"
] | 1
|
2021-08-17T13:22:54.000Z
|
2021-08-17T13:22:54.000Z
|
mvmm/multi_view/block_diag/graph/tests/test_Lsym_gevp.py
|
idc9/mvmm
|
64fce755a7cd53be9b08278484c7a4c77daf38d1
|
[
"MIT"
] | null | null | null |
mvmm/multi_view/block_diag/graph/tests/test_Lsym_gevp.py
|
idc9/mvmm
|
64fce755a7cd53be9b08278484c7a4c77daf38d1
|
[
"MIT"
] | null | null | null |
import numpy as np
from copy import deepcopy
from mvmm.linalg_utils import eigh_wrapper
from mvmm.multi_view.block_diag.graph.linalg import get_sym_laplacian_bp, \
geigh_Lsym_bp, smallest_geigh_Lsym_bp_from_Tsym
from mvmm.multi_view.block_diag.graph.tests.utils_test_Lsym_gevp import \
check_vs_truth_smallest_eigh_Lsym_bp_from_Tsym_no_zeros, \
check_vs_internal_smallest_eigh_Lsym_bp_from_Tsym_no_zeros, \
check_geigh_Lsym_internal_no_zeros, \
true_gevals_Lsym
def test_smallest_eigh_Lsym_bp_from_Tsym_no_zeros():
Xs = [np.random.uniform(size=(4, 5)),
np.random.uniform(size=(5, 5)),
np.random.uniform(size=(5, 1))]
for X in Xs:
for rank in range(1, sum(X.shape) + 1):
check_vs_truth_smallest_eigh_Lsym_bp_from_Tsym_no_zeros(X, rank)
check_vs_internal_smallest_eigh_Lsym_bp_from_Tsym_no_zeros(X, rank)
check_vs_truth_smallest_eigh_Lsym_bp_from_Tsym_no_zeros(X, rank=None)
check_vs_internal_smallest_eigh_Lsym_bp_from_Tsym_no_zeros(X, rank=None)
def test_geigh_Lsym_bp():
Xs = [np.random.uniform(size=(4, 5)),
np.random.uniform(size=(5, 5)),
np.random.uniform(size=(5, 1))]
for X in Xs:
Lsym = get_sym_laplacian_bp(X)
true_evals, true_evecs = eigh_wrapper(Lsym, rank=None)
for rank in range(1, sum(X.shape) + 1):
gevals, gevecs = geigh_Lsym_bp(X, rank=rank, zero_tol=1e-10,
end='largest')
check_geigh_Lsym_internal_no_zeros(X, gevals, gevecs, rank)
assert np.allclose(gevals[:rank], true_evals[:rank])
gevals, gevecs = geigh_Lsym_bp(X, rank=rank, zero_tol=1e-10,
end='smallest')
check_geigh_Lsym_internal_no_zeros(X, gevals, gevecs, rank)
assert np.allclose(gevals[:rank], true_evals[-rank:])
rank = None
gevals, gevecs = geigh_Lsym_bp(X, rank=rank, zero_tol=1e-10,
end='largest')
check_geigh_Lsym_internal_no_zeros(X, gevals, gevecs, rank)
gevals, gevecs = geigh_Lsym_bp(X, rank=rank, zero_tol=1e-10,
end='smallest')
check_geigh_Lsym_internal_no_zeros(X, gevals, gevecs, rank)
# test with zero rows/cols
X = deepcopy(Xs)[0]
X[0, :] = 0
X[:, 0] = 0
true_gevals, true_zero_mask = true_gevals_Lsym(X)
for rank in range(1, 7 + 1):
# make sure gen evals are correct
gevals, gevecs = geigh_Lsym_bp(X, rank=rank, zero_tol=1e-10, end='largest')
# check_geigh_Lsym_internal(X, gevals, gevecs, rank=rank)
assert np.allclose(gevals, true_gevals[:rank])
# check gen evecs have correct zero rows
assert np.allclose(abs(gevecs[true_zero_mask]).sum(), 0)
def test_smallest_geigh_Lsym_bp_from_Tsym():
Xs = [np.random.uniform(size=(4, 5)),
np.random.uniform(size=(5, 5)),
np.random.uniform(size=(5, 1))]
for X in Xs:
Lsym = get_sym_laplacian_bp(X)
true_evals, true_evecs = eigh_wrapper(Lsym, rank=None)
for rank in range(1, sum(X.shape) + 1):
gevals, gevecs = smallest_geigh_Lsym_bp_from_Tsym(X, rank=rank,
zero_tol=1e-10)
check_geigh_Lsym_internal_no_zeros(X, gevals, gevecs, rank)
assert np.allclose(gevals[:rank], true_evals[-rank:])
rank = None
gevals, gevecs = smallest_geigh_Lsym_bp_from_Tsym(X, rank=rank,
zero_tol=1e-10)
check_geigh_Lsym_internal_no_zeros(X, gevals, gevecs, rank)
# test with zeros
X = deepcopy(Xs)[0]
X[0, :] = 0
X[:, 0] = 0
true_gevals, true_zero_mask = true_gevals_Lsym(X)
for rank in range(1, 7 + 1):
# make sure gen evals are correct
gevals, gevecs = smallest_geigh_Lsym_bp_from_Tsym(X, rank=rank,
zero_tol=1e-10)
# check_geigh_Lsym_internal(X, gevals, gevecs, rank=rank)
assert np.allclose(gevals, true_gevals[-rank:])
# check gen evecs have correct zero rows
assert np.allclose(abs(gevecs[true_zero_mask]).sum(), 0)
| 36.041667
| 83
| 0.619884
| 625
| 4,325
| 3.9648
| 0.1216
| 0.076271
| 0.053269
| 0.067797
| 0.917676
| 0.917676
| 0.886199
| 0.861178
| 0.847861
| 0.835755
| 0
| 0.021167
| 0.279075
| 4,325
| 119
| 84
| 36.344538
| 0.773573
| 0.067977
| 0
| 0.723684
| 0
| 0
| 0.009199
| 0
| 0
| 0
| 0
| 0
| 0.092105
| 1
| 0.039474
| false
| 0
| 0.065789
| 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
|
b92d1e06567b28605aa3255178022a49a8a0c778
| 9,814
|
py
|
Python
|
melodic/lib/python2.7/dist-packages/mavros_msgs/srv/_SetMode.py
|
Dieptranivsr/Ros_Diep
|
d790e75e6f5da916701b11a2fdf3e03b6a47086b
|
[
"MIT"
] | 10
|
2021-03-15T03:58:06.000Z
|
2021-12-30T15:33:38.000Z
|
melodic/lib/python2.7/dist-packages/mavros_msgs/srv/_SetMode.py
|
Dieptranivsr/Ros_Diep
|
d790e75e6f5da916701b11a2fdf3e03b6a47086b
|
[
"MIT"
] | 1
|
2021-07-08T10:26:06.000Z
|
2021-07-08T10:31:11.000Z
|
melodic/lib/python2.7/dist-packages/mavros_msgs/srv/_SetMode.py
|
Dieptranivsr/Ros_Diep
|
d790e75e6f5da916701b11a2fdf3e03b6a47086b
|
[
"MIT"
] | 4
|
2021-03-06T09:35:58.000Z
|
2021-05-24T14:34:11.000Z
|
# This Python file uses the following encoding: utf-8
"""autogenerated by genpy from mavros_msgs/SetModeRequest.msg. Do not edit."""
import codecs
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
class SetModeRequest(genpy.Message):
_md5sum = "d770431847cad3a8f50a81ec70ddf0e2"
_type = "mavros_msgs/SetModeRequest"
_has_header = False # flag to mark the presence of a Header object
_full_text = """# set FCU mode
#
# Known custom modes listed here:
# http://wiki.ros.org/mavros/CustomModes
# basic modes from MAV_MODE
uint8 MAV_MODE_PREFLIGHT = 0
uint8 MAV_MODE_STABILIZE_DISARMED = 80
uint8 MAV_MODE_STABILIZE_ARMED = 208
uint8 MAV_MODE_MANUAL_DISARMED = 64
uint8 MAV_MODE_MANUAL_ARMED = 192
uint8 MAV_MODE_GUIDED_DISARMED = 88
uint8 MAV_MODE_GUIDED_ARMED = 216
uint8 MAV_MODE_AUTO_DISARMED = 92
uint8 MAV_MODE_AUTO_ARMED = 220
uint8 MAV_MODE_TEST_DISARMED = 66
uint8 MAV_MODE_TEST_ARMED = 194
uint8 base_mode # filled by MAV_MODE enum value or 0 if custom_mode != ''
string custom_mode # string mode representation or integer
"""
# Pseudo-constants
MAV_MODE_PREFLIGHT = 0
MAV_MODE_STABILIZE_DISARMED = 80
MAV_MODE_STABILIZE_ARMED = 208
MAV_MODE_MANUAL_DISARMED = 64
MAV_MODE_MANUAL_ARMED = 192
MAV_MODE_GUIDED_DISARMED = 88
MAV_MODE_GUIDED_ARMED = 216
MAV_MODE_AUTO_DISARMED = 92
MAV_MODE_AUTO_ARMED = 220
MAV_MODE_TEST_DISARMED = 66
MAV_MODE_TEST_ARMED = 194
__slots__ = ['base_mode','custom_mode']
_slot_types = ['uint8','string']
def __init__(self, *args, **kwds):
"""
Constructor. Any message fields that are implicitly/explicitly
set to None will be assigned a default value. The recommend
use is keyword arguments as this is more robust to future message
changes. You cannot mix in-order arguments and keyword arguments.
The available fields are:
base_mode,custom_mode
:param args: complete set of field values, in .msg order
:param kwds: use keyword arguments corresponding to message field names
to set specific fields.
"""
if args or kwds:
super(SetModeRequest, self).__init__(*args, **kwds)
# message fields cannot be None, assign default values for those that are
if self.base_mode is None:
self.base_mode = 0
if self.custom_mode is None:
self.custom_mode = ''
else:
self.base_mode = 0
self.custom_mode = ''
def _get_types(self):
"""
internal API method
"""
return self._slot_types
def serialize(self, buff):
"""
serialize message into buffer
:param buff: buffer, ``StringIO``
"""
try:
_x = self.base_mode
buff.write(_get_struct_B().pack(_x))
_x = self.custom_mode
length = len(_x)
if python3 or type(_x) == unicode:
_x = _x.encode('utf-8')
length = len(_x)
buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
def deserialize(self, str):
"""
unpack serialized message in str into this message instance
:param str: byte array of serialized message, ``str``
"""
codecs.lookup_error("rosmsg").msg_type = self._type
try:
end = 0
start = end
end += 1
(self.base_mode,) = _get_struct_B().unpack(str[start:end])
start = end
end += 4
(length,) = _struct_I.unpack(str[start:end])
start = end
end += length
if python3:
self.custom_mode = str[start:end].decode('utf-8', 'rosmsg')
else:
self.custom_mode = str[start:end]
return self
except struct.error as e:
raise genpy.DeserializationError(e) # most likely buffer underfill
def serialize_numpy(self, buff, numpy):
"""
serialize message with numpy array types into buffer
:param buff: buffer, ``StringIO``
:param numpy: numpy python module
"""
try:
_x = self.base_mode
buff.write(_get_struct_B().pack(_x))
_x = self.custom_mode
length = len(_x)
if python3 or type(_x) == unicode:
_x = _x.encode('utf-8')
length = len(_x)
buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
def deserialize_numpy(self, str, numpy):
"""
unpack serialized message in str into this message instance using numpy for array types
:param str: byte array of serialized message, ``str``
:param numpy: numpy python module
"""
codecs.lookup_error("rosmsg").msg_type = self._type
try:
end = 0
start = end
end += 1
(self.base_mode,) = _get_struct_B().unpack(str[start:end])
start = end
end += 4
(length,) = _struct_I.unpack(str[start:end])
start = end
end += length
if python3:
self.custom_mode = str[start:end].decode('utf-8', 'rosmsg')
else:
self.custom_mode = str[start:end]
return self
except struct.error as e:
raise genpy.DeserializationError(e) # most likely buffer underfill
_struct_I = genpy.struct_I
def _get_struct_I():
global _struct_I
return _struct_I
_struct_B = None
def _get_struct_B():
global _struct_B
if _struct_B is None:
_struct_B = struct.Struct("<B")
return _struct_B
# This Python file uses the following encoding: utf-8
"""autogenerated by genpy from mavros_msgs/SetModeResponse.msg. Do not edit."""
import codecs
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
class SetModeResponse(genpy.Message):
_md5sum = "a70bfe6329ecf8f8d858daa6f3db7655"
_type = "mavros_msgs/SetModeResponse"
_has_header = False # flag to mark the presence of a Header object
_full_text = """bool mode_sent # Mode known/parsed correctly and SET_MODE are sent
"""
__slots__ = ['mode_sent']
_slot_types = ['bool']
def __init__(self, *args, **kwds):
"""
Constructor. Any message fields that are implicitly/explicitly
set to None will be assigned a default value. The recommend
use is keyword arguments as this is more robust to future message
changes. You cannot mix in-order arguments and keyword arguments.
The available fields are:
mode_sent
:param args: complete set of field values, in .msg order
:param kwds: use keyword arguments corresponding to message field names
to set specific fields.
"""
if args or kwds:
super(SetModeResponse, self).__init__(*args, **kwds)
# message fields cannot be None, assign default values for those that are
if self.mode_sent is None:
self.mode_sent = False
else:
self.mode_sent = False
def _get_types(self):
"""
internal API method
"""
return self._slot_types
def serialize(self, buff):
"""
serialize message into buffer
:param buff: buffer, ``StringIO``
"""
try:
_x = self.mode_sent
buff.write(_get_struct_B().pack(_x))
except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
def deserialize(self, str):
"""
unpack serialized message in str into this message instance
:param str: byte array of serialized message, ``str``
"""
codecs.lookup_error("rosmsg").msg_type = self._type
try:
end = 0
start = end
end += 1
(self.mode_sent,) = _get_struct_B().unpack(str[start:end])
self.mode_sent = bool(self.mode_sent)
return self
except struct.error as e:
raise genpy.DeserializationError(e) # most likely buffer underfill
def serialize_numpy(self, buff, numpy):
"""
serialize message with numpy array types into buffer
:param buff: buffer, ``StringIO``
:param numpy: numpy python module
"""
try:
_x = self.mode_sent
buff.write(_get_struct_B().pack(_x))
except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
def deserialize_numpy(self, str, numpy):
"""
unpack serialized message in str into this message instance using numpy for array types
:param str: byte array of serialized message, ``str``
:param numpy: numpy python module
"""
codecs.lookup_error("rosmsg").msg_type = self._type
try:
end = 0
start = end
end += 1
(self.mode_sent,) = _get_struct_B().unpack(str[start:end])
self.mode_sent = bool(self.mode_sent)
return self
except struct.error as e:
raise genpy.DeserializationError(e) # most likely buffer underfill
_struct_I = genpy.struct_I
def _get_struct_I():
global _struct_I
return _struct_I
_struct_B = None
def _get_struct_B():
global _struct_B
if _struct_B is None:
_struct_B = struct.Struct("<B")
return _struct_B
class SetMode(object):
_type = 'mavros_msgs/SetMode'
_md5sum = 'e4f18fa93379f9ff1780d270ce110203'
_request_class = SetModeRequest
_response_class = SetModeResponse
| 33.155405
| 145
| 0.671592
| 1,376
| 9,814
| 4.572674
| 0.150436
| 0.026701
| 0.020979
| 0.024158
| 0.847107
| 0.777813
| 0.777813
| 0.777813
| 0.777813
| 0.777813
| 0
| 0.022037
| 0.218565
| 9,814
| 295
| 146
| 33.267797
| 0.798409
| 0.249236
| 0
| 0.744898
| 1
| 0
| 0.174474
| 0.047844
| 0
| 0
| 0.002865
| 0
| 0
| 1
| 0.081633
| false
| 0
| 0.040816
| 0
| 0.326531
| 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
|
b94459d554ae93da87835fbe45c60e954f04620a
| 186,010
|
py
|
Python
|
code/analyze.py
|
azshue/boosting_robust
|
cff781d53ed5fa7df6ba567d3b51df202b6ec14e
|
[
"MIT"
] | 213
|
2019-06-13T01:40:22.000Z
|
2022-03-23T22:03:06.000Z
|
smoothing-adversarial/code/analyze.py
|
eth-sri/transformation-smoothing
|
12a653e881a6d61c5c63a3e16d58292435486cbd
|
[
"Apache-2.0"
] | 9
|
2019-07-03T07:52:05.000Z
|
2021-04-05T04:45:45.000Z
|
smoothing-adversarial/code/analyze.py
|
eth-sri/transformation-smoothing
|
12a653e881a6d61c5c63a3e16d58292435486cbd
|
[
"Apache-2.0"
] | 41
|
2019-06-13T01:41:35.000Z
|
2022-03-28T17:26:46.000Z
|
import math
import os
import matplotlib
matplotlib.use("TkAgg")
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from typing import *
from IPython import embed
sns.set()
class Accuracy(object):
def at_radii(self, radii: np.ndarray):
raise NotImplementedError()
class ApproximateAccuracy(Accuracy):
def __init__(self, data_file_path: str):
self.data_file_path = data_file_path
def at_radii(self, radii: np.ndarray) -> np.ndarray:
df = pd.read_csv(self.data_file_path, delimiter="\t")
return np.array([self.at_radius(df, radius) for radius in radii])
def at_radius(self, df: pd.DataFrame, radius: float):
return (df["correct"] & (df["radius"] >= radius)).mean()
def get_abstention_rate(self) -> np.ndarray:
df = pd.read_csv(self.data_file_path, delimiter="\t")
return 1.*(df["predict"]==-1).sum()/len(df["predict"])*100
class HighProbAccuracy(Accuracy):
def __init__(self, data_file_path: str, alpha: float, rho: float):
self.data_file_path = data_file_path
self.alpha = alpha
self.rho = rho
def at_radii(self, radii: np.ndarray) -> np.ndarray:
df = pd.read_csv(self.data_file_path, delimiter="\t")
return np.array([self.at_radius(df, radius) for radius in radii])
def at_radius(self, df: pd.DataFrame, radius: float):
mean = (df["correct"] & (df["radius"] >= radius)).mean()
num_examples = len(df)
return (mean - self.alpha - math.sqrt(self.alpha * (1 - self.alpha) * math.log(1 / self.rho) / num_examples)
- math.log(1 / self.rho) / (3 * num_examples))
class EmpiricalAccuracy(Accuracy):
def __init__(self, data_dir: str):
self.data_dir = data_dir
def at_radii(self, radii: np.ndarray, attack: str, method: str) -> np.ndarray:
accuracies = []
for radius in radii:
file_path = os.path.join(self.data_dir, '{}_{:.3f}/{}/predictions'.format(attack, radius, method))
df = pd.read_csv(file_path, delimiter="\t")
accuracies.append(self.at_radius(df, radius))
return np.array(accuracies)
def at_radius(self, df: pd.DataFrame, radius: float):
return df["correct"].mean()
class Line(object):
def __init__(self, quantity: Accuracy, legend: str = None, plot_fmt: str = "", scale_x: float = 1, alpha: float = 1):
self.quantity = quantity
self.legend = legend
self.plot_fmt = plot_fmt
self.scale_x = scale_x
self.alpha = alpha
def plot_certified_accuracy(outfile: str, title: str, max_radius: float,
lines: List[Line], radius_step: float = 0.01, upper_bounds=False) -> None:
radii = np.arange(0, max_radius + radius_step, radius_step)
plt.figure()
for line in lines:
plt.plot(radii * line.scale_x, line.quantity.at_radii(radii), line.plot_fmt, alpha=line.alpha,)
if upper_bounds:
epsilons = [i for i in range(64,680,64)]
for line in lines:
accuracies = []
for eps in epsilons:
model = line.quantity.data_file_path.split('data/certify/')[1].split('/test')[0]
data_file_path = 'philly_exp/predict/predict_all_20steps_PGD_DDN/my_models/{}/PGD_{}'.format(model, eps)
df = pd.read_csv(data_file_path, delimiter="\t")
accuracies.append(df['correct'].mean())
plt.plot([0]+[eps/255.0 for eps in epsilons], [line.quantity.at_radii([0])] + accuracies, line.plot_fmt, dashes=[6, 2], alpha=0.2*line.alpha)
plt.ylim((0, 1))
plt.xlim((0, max_radius))
plt.tick_params(labelsize=14)
plt.xlabel("radius", fontsize=16)
plt.ylabel("certified accuracy", fontsize=16)
plt.legend([method.legend for method in lines if method.legend is not None], loc='upper right', fontsize=16)
plt.tight_layout()
plt.savefig(outfile + ".pdf")
plt.title(title, fontsize=20)
plt.tight_layout()
plt.savefig(outfile + ".png", dpi=300)
plt.close()
def plot_certified_accuracy_per_sigma_against_original_one_sample(outfile: str, title: str, max_radius: float,
methods: List[Line], methods_original: List[Line], radius_step: float = 0.01, upper_bounds=False) -> None:
radii = np.arange(0, max_radius + radius_step, radius_step)
plt.figure()
color = ['b', 'orange', 'g', 'r']
for it, line in enumerate(methods):
plt.plot(radii * line.scale_x, line.quantity.at_radii(radii), color[it], alpha=line.alpha, label='Ours|'+line.legend)
for it, line in enumerate(methods_original):
plt.plot(radii * line.scale_x, line.quantity.at_radii(radii), color[it], dashes=[2, 2], alpha=line.alpha, label='Cohen et al.|'+line.legend)
plt.ylim((0, 1))
plt.xlim((0, max_radius))
plt.tick_params(labelsize=14)
plt.xlabel("$\ell_2$ radius", fontsize=16)
plt.ylabel("Certified Accuracy", fontsize=16)
plt.legend(loc='upper right', fontsize=16)
plt.tight_layout()
plt.savefig(outfile + ".pdf")
plt.title(title, fontsize=20)
plt.tight_layout()
plt.savefig(outfile + ".png", dpi=300)
plt.close()
def plot_certified_accuracy_per_sigma_against_original(outfile: str, title: str, max_radius: float,
methods: List[Line], methods_original: List[Line], radius_step: float = 0.01, upper_bounds=False) -> None:
color = ['b', 'orange', 'g', 'r']
if 'imagenet' in outfile:
sigmas = [0.25, 0.5, 1.00]
elif 'cifar' in outfile:
sigmas = [0.12, 0.25, 0.5, 1.00]
for it, sigma in enumerate(sigmas):
methods_eps = [method for method in methods if '{:.2f}'.format(sigma) in method.quantity.data_file_path]
accuracies_cert_ours, radii = _get_accuracies_at_radii(methods_eps, 0, max_radius, radius_step)
plt.plot(radii, accuracies_cert_ours.max(0), color[it], label='Ours|$\sigma = {:.2f}$'.format(sigma))
for it, line in enumerate(methods_original):
plt.plot(radii * line.scale_x, line.quantity.at_radii(radii), color[it], dashes=[2, 2], alpha=line.alpha, label='Cohen et al.|'+line.legend)
plt.ylim((0, 1))
plt.xlim((0, max_radius))
plt.tick_params(labelsize=14)
plt.xlabel("$\ell_2$ radius", fontsize=16)
plt.ylabel("Certified Accuracy", fontsize=16)
plt.legend(loc='upper right', fontsize=16)
plt.tight_layout()
plt.savefig(outfile + ".pdf")
plt.title(title, fontsize=20)
plt.tight_layout()
plt.savefig(outfile + ".png", dpi=300)
plt.close()
def smallplot_certified_accuracy(outfile: str, title: str, max_radius: float,
methods: List[Line], radius_step: float = 0.01, xticks=0.5) -> None:
radii = np.arange(0, max_radius + radius_step, radius_step)
plt.figure()
for method in methods:
plt.plot(radii, method.quantity.at_radii(radii), method.plot_fmt)
plt.ylim((0, 1))
plt.xlim((0, max_radius))
plt.xlabel("radius", fontsize=22)
plt.ylabel("certified accuracy", fontsize=22)
plt.tick_params(labelsize=20)
plt.gca().xaxis.set_major_locator(plt.MultipleLocator(xticks))
plt.legend([method.legend for method in methods], loc='upper right', fontsize=20)
plt.tight_layout()
plt.savefig(outfile + ".pdf")
plt.close()
def plot_certified_accuracy_upper_envelopes(
outfile: str,
title: str,
max_radius: float,
methods_certified_ours: List[Line] = None,
methods_certified_cohen: List[Line]= None,
methods_empirical_ours: str = None,
methods_empirical_cohen: str = None,
radius_step: float = 0.01) -> None:
plt.figure()
if methods_certified_ours is not None:
accuracies_cert_ours, radii = _get_accuracies_at_radii(methods_certified_ours, 0, max_radius, radius_step)
plt.plot(radii, accuracies_cert_ours.max(0), 'b', label='Ours certified')
if methods_certified_cohen is not None:
accuracies_cert_cohen, radii = _get_accuracies_at_radii(methods_certified_cohen, 0, max_radius, radius_step)
plt.plot(radii, accuracies_cert_cohen.max(0), 'r', label='Cohen et al. certified')
if 'imagenet' in outfile:
m = 'num_16'
elif 'cifar' in outfile:
m = 'num_128'
empirical_radii = np.arange(0, max_radius + 0.125, 0.125)
if methods_empirical_ours is not None:
emp_acc = EmpiricalAccuracy(methods_empirical_ours)
accuracies_empirical_ours = emp_acc.at_radii(empirical_radii, attack='PGD', method=m)
accuracies_empirical_ours[0] = accuracies_cert_ours.max(0)[0]
plt.plot(empirical_radii, accuracies_empirical_ours, 'b', dashes=[6, 2], label='Ours empirical')
if methods_empirical_cohen is not None:
emp_acc = EmpiricalAccuracy(methods_empirical_cohen)
accuracies_empirical_cohen = emp_acc.at_radii(empirical_radii, attack='PGD', method=m)
accuracies_empirical_cohen[0] = accuracies_cert_cohen.max(0)[0]
plt.plot(empirical_radii, accuracies_empirical_cohen, 'r',dashes=[6, 2], label='Cohen et. al empirical')
plt.ylim((0, 1))
plt.xlim((0, max_radius))
plt.tick_params(labelsize=14)
plt.xlabel("$\ell_2$ radius", fontsize=16)
plt.ylabel("Accuracy", fontsize=16)
plt.legend(loc='upper right', fontsize=16)
plt.tight_layout()
plt.savefig(outfile + ".pdf")
plt.title(title, fontsize=20)
plt.tight_layout()
plt.savefig(outfile + ".png", dpi=300)
plt.close()
def plot_certified_accuracy_upper_envelopes_all_methods(
outfile: str,
title: str,
max_radius: float,
methods_certified_ours: List[Line] = None,
methods_certified_ours_pretrain: List[Line] = None,
methods_certified_ours_semisuper: List[Line] = None,
methods_certified_ours_pretrain_semisuper: List[Line] = None,
methods_certified_cohen: List[Line]= None,
radius_step: float = 0.01) -> None:
plt.figure()
if methods_certified_ours is not None:
accuracies_cert_ours, radii = _get_accuracies_at_radii(methods_certified_ours, 0, max_radius, radius_step)
plt.plot(radii, accuracies_cert_ours.max(0), 'b', label='Ours ')
if methods_certified_ours_pretrain is not None:
accuracies_cert_ours, radii = _get_accuracies_at_radii(methods_certified_ours_pretrain, 0, max_radius, radius_step)
plt.plot(radii, accuracies_cert_ours.max(0), 'k', label=' + pretraining ')
if methods_certified_ours_semisuper is not None:
accuracies_cert_ours, radii = _get_accuracies_at_radii(methods_certified_ours_semisuper, 0, max_radius, radius_step)
plt.plot(radii, accuracies_cert_ours.max(0), 'g', label=' + semisupervision ')
if methods_certified_ours_pretrain_semisuper is not None:
accuracies_cert_ours, radii = _get_accuracies_at_radii(methods_certified_ours_pretrain_semisuper, 0, max_radius, radius_step)
plt.plot(radii, accuracies_cert_ours.max(0), 'orange', label=' + Both')
if methods_certified_cohen is not None:
accuracies_cert_cohen, radii = _get_accuracies_at_radii(methods_certified_cohen, 0, max_radius, radius_step)
plt.plot(radii, accuracies_cert_cohen.max(0), 'r', label='Cohen et al. ')
if 'imagenet' in outfile:
m = 'num_16'
elif 'cifar' in outfile:
m = 'num_128'
plt.ylim((0, 1))
plt.xlim((0, max_radius))
plt.tick_params(labelsize=14)
plt.xlabel("$\ell_2$ radius", fontsize=16)
plt.ylabel("Certified Accuracy", fontsize=16)
plt.legend(loc='upper right', fontsize=16)
plt.tight_layout()
plt.savefig(outfile + ".pdf")
plt.title(title, fontsize=20)
plt.tight_layout()
plt.savefig(outfile + ".png", dpi=300)
plt.close()
def plot_certified_accuracy_upper_envelopes_vary_eps(
outfile: str,
title: str,
max_radius: float,
methods_certified_ours: List[Line] = None,
methods_certified_cohen: List[Line]= None,
methods_empirical_ours: str = None,
methods_empirical_cohen: str = None,
radius_step: float = 0.01) -> None:
plt.figure()
epsilons = [64, 127, 255, 512]
for eps in epsilons:
methods_eps = [method for method in methods_certified_ours if '{}'.format(eps) in method.quantity.data_file_path
and 'PGD' in method.quantity.data_file_path]
accuracies_cert_ours, radii = _get_accuracies_at_radii(methods_eps, 0, max_radius, radius_step)
plt.plot(radii, accuracies_cert_ours.max(0), label='$\epsilon = {}$'.format(round(eps/256,2)))
if methods_certified_cohen is not None:
accuracies_cert_cohen, radii = _get_accuracies_at_radii(methods_certified_cohen, 0, max_radius, radius_step)
plt.plot(radii, accuracies_cert_cohen.max(0), dashes=[6, 2], label='Cohen et al.')
plt.ylim((0, 1))
plt.xlim((0, max_radius))
plt.tick_params(labelsize=14)
plt.xlabel("$\ell_2$ radius", fontsize=16)
plt.ylabel("Certified Accuracy", fontsize=16)
plt.legend(loc='upper right', fontsize=16)
plt.tight_layout()
plt.savefig(outfile + ".pdf")
plt.title(title, fontsize=20)
plt.tight_layout()
plt.savefig(outfile + ".png", dpi=300)
plt.close()
def plot_certified_accuracy_upper_envelopes_vary_m(
outfile: str,
title: str,
max_radius: float,
methods_certified_cohen: List[Line],
methods_certified_N1: List[Line],
methods_certified_N2: List[Line],
methods_certified_N4: List[Line],
methods_certified_N8: List[Line],
radius_step: float = 0.01) -> None:
plt.figure()
accuracies_cert_ours_cohen, radii = _get_accuracies_at_radii(methods_certified_cohen, 0, max_radius, radius_step)
plt.plot(radii, accuracies_cert_ours_cohen.max(0), dashes=[6, 2], label='Cohen et al.')
accuracies_cert_ours_N1, radii = _get_accuracies_at_radii(methods_certified_N1, 0, max_radius, radius_step)
plt.plot(radii, accuracies_cert_ours_N1.max(0), label='$m_{train} = 1$')
accuracies_cert_ours_N2, radii = _get_accuracies_at_radii(methods_certified_N2, 0, max_radius, radius_step)
plt.plot(radii, accuracies_cert_ours_N2.max(0), label='$m_{train} = 2$')
accuracies_cert_ours_N4, radii = _get_accuracies_at_radii(methods_certified_N4, 0, max_radius, radius_step)
plt.plot(radii, accuracies_cert_ours_N4.max(0), label='$m_{train} = 4$')
accuracies_cert_ours_N8, radii = _get_accuracies_at_radii(methods_certified_N8, 0, max_radius, radius_step)
plt.plot(radii, accuracies_cert_ours_N8.max(0), label='$m_{train} = 8$')
plt.ylim((0, 1))
plt.xlim((0, max_radius))
plt.tick_params(labelsize=14)
plt.xlabel("$\ell_2$ radius", fontsize=16)
plt.ylabel("Certified Accuracy", fontsize=16)
plt.legend(loc='upper right', fontsize=16)
plt.tight_layout()
plt.savefig(outfile + ".pdf")
plt.title(title, fontsize=20)
plt.tight_layout()
plt.savefig(outfile + ".png", dpi=300)
plt.close()
def plot_certified_accuracy_upper_envelopes_base_vs_ours_vs_cohen(
outfile: str,
title: str,
max_radius: float,
methods_certified_cohen: List[Line],
methods_certified_ours: List[Line],
methods_certified_base: List[Line],
methods_certified_base_with_noise: List[Line],
radius_step: float = 0.01) -> None:
plt.figure()
accuracies_cert_cohen, radii = _get_accuracies_at_radii(methods_certified_cohen, 0, max_radius, radius_step)
plt.plot(radii, accuracies_cert_cohen.max(0), 'g', dashes=[6, 2], label='Cohen et al.')
accuracies_cert_ours, radii = _get_accuracies_at_radii(methods_certified_ours, 0, max_radius, radius_step)
plt.plot(radii, accuracies_cert_ours.max(0), 'b', label='Ours')
accuracies_cert_base, radii = _get_accuracies_at_radii(methods_certified_base, 0, max_radius, radius_step)
plt.plot(radii, accuracies_cert_base.max(0), 'r', dashes=[2, 2], label='Vanilla PGD')
accuracies_cert_base, radii = _get_accuracies_at_radii(methods_certified_base_with_noise, 0, max_radius, radius_step)
plt.plot(radii, accuracies_cert_base.max(0), 'k', dashes=[1, 1], label='Vanilla PGD+noise')
plt.ylim((0, 1))
plt.xlim((0, max_radius))
plt.tick_params(labelsize=14)
plt.xlabel("$\ell_2$ radius", fontsize=16)
plt.ylabel("Certified Accuracy", fontsize=16)
plt.legend(loc='upper right', fontsize=16)
plt.tight_layout()
plt.savefig(outfile + ".pdf")
plt.title(title, fontsize=20)
plt.tight_layout()
plt.savefig(outfile + ".png", dpi=300)
plt.close()
def plot_empirical_accuracy_upper_envelopes_vary_num_samples_during_attack(
outfile: str,
title: str,
max_radius: float,
methods_certified: List[Line]= None,
methods_empirical: str = None,
radius_step: float = 0.01) -> None:
fig = plt.figure()
ax = fig.add_subplot(111)
if methods_certified is not None:
accuracies_cert, radii = _get_accuracies_at_radii(methods_certified, 0, max_radius, radius_step)
plt.plot(radii, accuracies_cert.max(0), label='Cohen et al. certified')
empirical_radii = np.arange(0, max_radius + 0.125, 0.125)
if methods_empirical is not None:
emp_acc = EmpiricalAccuracy(methods_empirical)
accuracies_empirical_cohen = emp_acc.at_radii(empirical_radii, attack='PGD', method='base')
plt.plot(empirical_radii, accuracies_empirical_cohen,'xk', linestyle='dashed',
linewidth=1, markersize=3, label='Empirical vanilla PGD ')
accuracies_empirical_cohen = emp_acc.at_radii(empirical_radii, attack='PGD', method='num_1')
plt.plot(empirical_radii, accuracies_empirical_cohen, dashes=[4, 2], linewidth=1, label='$Empirical, m_{test} = 1$')
accuracies_empirical_cohen = emp_acc.at_radii(empirical_radii, attack='PGD', method='num_4')
plt.plot(empirical_radii, accuracies_empirical_cohen, dashes=[4, 2], linewidth=1, label='$Empirical, m_{test} = 4$')
accuracies_empirical_cohen = emp_acc.at_radii(empirical_radii, attack='PGD', method='num_8')
plt.plot(empirical_radii, accuracies_empirical_cohen, dashes=[4, 2], linewidth=1, label='$Empirical, m_{test} = 8$')
accuracies_empirical_cohen = emp_acc.at_radii(empirical_radii, attack='PGD', method='num_16')
plt.plot(empirical_radii, accuracies_empirical_cohen, dashes=[4, 2], linewidth=1, label='$Empirical, m_{test} = 16$')
accuracies_empirical_cohen = emp_acc.at_radii(empirical_radii, attack='PGD', method='num_64')
plt.plot(empirical_radii, accuracies_empirical_cohen, dashes=[4, 2], linewidth=1, label='$Empirical, m_{test} = 64$')
accuracies_empirical_cohen = emp_acc.at_radii(empirical_radii, attack='PGD', method='num_128')
plt.plot(empirical_radii, accuracies_empirical_cohen, dashes=[4, 2], linewidth=1, label='$Empirical, m_{test} = 128$')
ax.set_ylim((0, 1))
ax.set_xlim((0, max_radius))
ax.tick_params(labelsize=12)
ax.set_xlabel("$\ell_2$ radius", fontsize=12)
ax.set_ylabel("Accuracy", fontsize=12)
box = ax.get_position()
ax.set_position([box.x0, box.y0, box.width * 0.70, box.height])
ax.legend(loc='center right', fontsize=8, bbox_to_anchor=(1.5, 0.5))
# ax.tight_layout()
ax.set_aspect(aspect=1)
plt.savefig(outfile + ".pdf")
ax.set_title(title, fontsize=20)
# plt.tight_layout()
plt.savefig(outfile + ".png", dpi=300)
plt.close()
def plot_empirical_accuracy_vary_N(
outfile: str,
title: str,
max_radius: float,
methods_certified: list,
methods_empirical: list,
radius_step: float = 0.125) -> None:
plt.figure()
# if methods_certified is not None:
# accuracies_cert_cohen, radii = _get_accuracies_at_radii(methods_certified, 0, max_radius, 0.01)
# plt.plot(radii, accuracies_cert_cohen.max(0), label='Cohen et al. certified')
empirical_radii = np.arange(0, max_radius + radius_step, radius_step)
for method in methods_empirical:
N = method.split('N')[-1]
emp_acc = EmpiricalAccuracy(method)
accuracies_empirical = emp_acc.at_radii(empirical_radii, attack='PGD', method='num_128')
plt.plot(empirical_radii, accuracies_empirical, dashes=[6, 2], label='n = {}'.format(N))
plt.ylim((0, 1))
plt.xlim((0, max_radius))
plt.tick_params(labelsize=14)
plt.xlabel("$\ell_2$ radius", fontsize=16)
plt.ylabel("Accuracy", fontsize=16)
plt.legend(loc='upper right', fontsize=16)
plt.tight_layout()
plt.savefig(outfile + ".pdf")
plt.title(title, fontsize=20)
plt.tight_layout()
plt.savefig(outfile + ".png", dpi=300)
plt.close()
def plot_empirical_accuracy_nograd_trick(
outfile: str,
title: str,
max_radius: float,
methods_certified: list,
methods_empirical: str,
methods_empirical_nograd_trick: str,
radius_step: float = 0.125) -> None:
fig = plt.figure()
ax = fig.add_subplot(111)
if methods_certified is not None:
accuracies_cert_cohen, radii = _get_accuracies_at_radii(methods_certified, 0, max_radius, 0.01)
plt.plot(radii, accuracies_cert_cohen.max(0), label='Cohen et al. certified')
empirical_radii = np.arange(0, max_radius + radius_step, radius_step)
if methods_empirical is not None:
emp_acc = EmpiricalAccuracy(methods_empirical)
accuracies_empirical = emp_acc.at_radii(empirical_radii, attack='PGD', method='num_64')
plt.plot(empirical_radii, accuracies_empirical, dashes=[2, 3], label='Eq.(6), $m_{test} = 128$')
if methods_empirical_nograd_trick is not None:
emp_acc = EmpiricalAccuracy(methods_empirical_nograd_trick)
accuracies_empirical = emp_acc.at_radii(empirical_radii, attack='PGD', method='num_4')
plt.plot(empirical_radii, accuracies_empirical, dashes=[6, 2], label='Eq.(7), $m_{test} = 4$')
accuracies_empirical = emp_acc.at_radii(empirical_radii, attack='PGD', method='num_8')
plt.plot(empirical_radii, accuracies_empirical, dashes=[6, 2], label='Eq.(7), $m_{test} = 8$')
accuracies_empirical = emp_acc.at_radii(empirical_radii, attack='PGD', method='num_16')
plt.plot(empirical_radii, accuracies_empirical, dashes=[6, 2], label='Eq.(7), $m_{test} = 16$')
accuracies_empirical = emp_acc.at_radii(empirical_radii, attack='PGD', method='num_64')
plt.plot(empirical_radii, accuracies_empirical, dashes=[6, 2], label='Eq.(7), $m_{test} = 64$')
accuracies_empirical = emp_acc.at_radii(empirical_radii, attack='PGD', method='num_128')
plt.plot(empirical_radii, accuracies_empirical, dashes=[6, 2], label='Eq.(7), $m_{test} = 128$')
accuracies_empirical = emp_acc.at_radii(empirical_radii, attack='PGD', method='num_256')
plt.plot(empirical_radii, accuracies_empirical, dashes=[6, 2], label='Eq.(7), $m_{test} = 256$')
accuracies_empirical = emp_acc.at_radii(empirical_radii, attack='PGD', method='num_512')
plt.plot(empirical_radii, accuracies_empirical, dashes=[6, 2], label='Eq.(7), $m_{test} = 512$')
ax.set_ylim((0, 1))
ax.set_xlim((0, max_radius))
ax.tick_params(labelsize=12)
ax.set_xlabel("$\ell_2$ radius", fontsize=12)
ax.set_ylabel("Accuracy", fontsize=12)
box = ax.get_position()
ax.set_position([box.x0, box.y0, box.width * 0.70, box.height])
ax.legend(loc='center right', fontsize=8, bbox_to_anchor=(1.5, 0.5))
# ax.tight_layout()
ax.set_aspect(aspect=1)
plt.savefig(outfile + ".pdf")
ax.set_title(title, fontsize=20)
# plt.tight_layout()
plt.savefig(outfile + ".png", dpi=300)
plt.close()
def latex_table_certified_accuracy(outfile: str, radius_start: float, radius_stop: float, radius_step: float,
methods: List[Line]):
accuracies, radii = _get_accuracies_at_radii(methods, radius_start, radius_stop, radius_step)
f = open(outfile, 'w')
f.write("$\ell_2$ Radius")
for radius in radii:
f.write("& ${:.3}$".format(radius))
f.write("\\\\\n")
f.write("\midrule\n")
for i, method in enumerate(methods):
f.write(method.legend)
for j, radius in enumerate(radii):
if i == accuracies[:, j].argmax():
txt = r" & \textbf{" + "{:.2f}".format(accuracies[i, j]) + "}"
else:
txt = " & {:.2f}".format(accuracies[i, j])
f.write(txt)
f.write("\\\\\n")
f.close()
def latex_table_certified_accuracy_upper_envelope(outfile: str, radius_start: float, radius_stop: float, radius_step: float,
methods: List[Line], clean_accuracy=True):
accuracies, radii = _get_accuracies_at_radii(methods, radius_start, radius_stop, radius_step)
clean_accuracies, _ = _get_accuracies_at_radii(methods, 0, 0, 0.25)
assert clean_accuracies.shape[1] == 1
f = open(outfile, 'w')
f.write("$\ell_2$ Radius")
for radius in radii:
f.write("& ${:.3}$".format(radius))
f.write("\\\\\n")
f.write("\midrule\n")
for j, radius in enumerate(radii):
argmaxs = np.argwhere(accuracies[:,j] == accuracies[:, j].max())
argmaxs = argmaxs.flatten()
i = argmaxs[clean_accuracies[argmaxs, 0].argmax()]
# i = i.flatten()[0]
if clean_accuracy:
txt = " & $^{("+"{:.2f})".format(clean_accuracies[i, 0]) + "}" + "${:.2f}".format(accuracies[i, j])
else:
txt = " & {:.2f}".format(accuracies[i, j])
f.write(txt)
f.write("\\\\\n")
f.close()
def latex_table_abstention_rate(outfile: str, radius_start: float, radius_stop: float, radius_step: float,
methods: List[Line], clean_accuracy=True):
accuracies, radii = _get_accuracies_at_radii(methods, radius_start, radius_stop, radius_step)
clean_accuracies, _ = _get_accuracies_at_radii(methods, 0, 0, 0.25)
assert clean_accuracies.shape[1] == 1
abstention_rates = 0*accuracies
for i, method in enumerate(methods):
abstention_rates[i,:] = method.quantity.get_abstention_rate()
f = open(outfile, 'w')
f.write("$\ell_2$ Radius")
for radius in radii:
f.write("& ${:.3}$".format(radius))
f.write("\\\\\n")
f.write("\midrule\n")
for j, radius in enumerate(radii):
argmaxs = np.argwhere(accuracies[:,j] == accuracies[:, j].max())
argmaxs = argmaxs.flatten()
i = argmaxs[clean_accuracies[argmaxs, 0].argmax()]
# i = i.flatten()[0]
if clean_accuracy:
txt = " & $^{("+"{:.2f})".format(clean_accuracies[i, 0]) + "}" + "${:.2f}".format(accuracies[i, j])
else:
txt = " & {:.2f}".format(accuracies[i, j])
f.write(txt)
f.write("\midrule\n")
for j, radius in enumerate(radii):
argmaxs = np.argwhere(accuracies[:,j] == accuracies[:, j].max())
argmaxs = argmaxs.flatten()
i = argmaxs[clean_accuracies[argmaxs, 0].argmax()]
# i = i.flatten()[0]
txt = " & {:.1f}".format(abstention_rates[i, j])
f.write(txt)
f.write("\\\\\n")
f.close()
def markdown_table_certified_accuracy(outfile: str, radius_start: float, radius_stop: float, radius_step: float,
methods: List[Line]):
accuracies, radii = _get_accuracies_at_radii(methods, radius_start, radius_stop, radius_step)
f = open(outfile, 'w')
f.write("| | ")
for radius in radii:
f.write("r = {:.3} |".format(radius))
f.write("\n")
f.write("| --- | ")
for i in range(len(radii)):
f.write(" --- |")
f.write("\n")
for i, method in enumerate(methods):
f.write("<b> {} </b>| ".format(method.legend))
for j, radius in enumerate(radii):
if i == accuracies[:, j].argmax():
txt = "{:.2f}<b>*</b> |".format(accuracies[i, j])
else:
txt = "{:.2f} |".format(accuracies[i, j])
f.write(txt)
f.write("\n")
f.close()
def radii_to_best_models(outfile: str, methods: List[Line], max_radius: float, radius_step: float = 0.01):
accuracies, radii = _get_accuracies_at_radii(methods, 0, max_radius, radius_step)
f = open(outfile, 'w')
f.write('radius\tbest_cert_accuracy\tbest_model\n')
for j, radius in enumerate(radii):
i = accuracies[:, j].argmax()
model = methods[i].quantity.data_file_path.split('certify/')[1].split('/test')[0]
f.write('{:.3f}\t{}\t{}'.format(radius, accuracies[i, j], model))
f.write('\n')
f.close()
def _get_accuracies_at_radii(methods: List[Line], radius_start: float, radius_stop: float, radius_step: float):
radii = np.arange(radius_start, radius_stop + radius_step, radius_step)
accuracies = np.zeros((len(methods), len(radii)))
for i, method in enumerate(methods):
accuracies[i, :] = method.quantity.at_radii(radii)
return accuracies, radii
def print_certified_accuracy(radii: float, lines: List[Line]) -> None:
for line in lines:
print(line.quantity.data_file_path)
print()
accuracies = line.quantity.at_radii(radii)
for radius, accuracy in zip(radii, accuracies):
print("certified accuracy at radius {} is {}%\n".format(radius, accuracy))
#####################################################################################################
## PGD and DDN no noise no noise during attack, just noise data augmentation
PGD_with_noise_during_attack = [
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_baseAttackExp/with_noise/eps_64/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_baseAttackExp/with_noise/eps_127/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_baseAttackExp/with_noise/eps_255/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_baseAttackExp/with_noise/eps_512/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_baseAttackExp/with_noise/eps_64/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_baseAttackExp/with_noise/eps_127/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_baseAttackExp/with_noise/eps_255/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_baseAttackExp/with_noise/eps_512/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_baseAttackExp/with_noise/eps_64/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_baseAttackExp/with_noise/eps_127/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_baseAttackExp/with_noise/eps_255/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_baseAttackExp/with_noise/eps_512/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_baseAttackExp/with_noise/eps_64/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_baseAttackExp/with_noise/eps_127/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_baseAttackExp/with_noise/eps_255/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_baseAttackExp/with_noise/eps_512/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 2.00$"),
]
PGD_no_noise_during_attack = [
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_baseAttackExp/without_noise/eps_64/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_baseAttackExp/without_noise/eps_127/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_baseAttackExp/without_noise/eps_255/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_baseAttackExp/without_noise/eps_512/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_baseAttackExp/without_noise/eps_64/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_baseAttackExp/without_noise/eps_127/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_baseAttackExp/without_noise/eps_255/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_baseAttackExp/without_noise/eps_512/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_baseAttackExp/without_noise/eps_64/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_baseAttackExp/without_noise/eps_127/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_baseAttackExp/without_noise/eps_255/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_baseAttackExp/without_noise/eps_512/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_baseAttackExp/without_noise/eps_64/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_baseAttackExp/without_noise/eps_127/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_baseAttackExp/without_noise/eps_255/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_baseAttackExp/without_noise/eps_512/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 2.00$"),
]
PGD_no_noise_during_attack_and_training = [
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_baseAttackExp/without_noise/eps_64/cifar10/resnet110/noise_0.00/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_baseAttackExp/without_noise/eps_127/cifar10/resnet110/noise_0.00/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_baseAttackExp/without_noise/eps_255/cifar10/resnet110/noise_0.00/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_baseAttackExp/without_noise/eps_512/cifar10/resnet110/noise_0.00/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_baseAttackExp/without_noise/eps_64/cifar10/resnet110/noise_0.00/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_baseAttackExp/without_noise/eps_127/cifar10/resnet110/noise_0.00/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_baseAttackExp/without_noise/eps_255/cifar10/resnet110/noise_0.00/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_baseAttackExp/without_noise/eps_512/cifar10/resnet110/noise_0.00/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_baseAttackExp/without_noise/eps_64/cifar10/resnet110/noise_0.00/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_baseAttackExp/without_noise/eps_127/cifar10/resnet110/noise_0.00/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_baseAttackExp/without_noise/eps_255/cifar10/resnet110/noise_0.00/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_baseAttackExp/without_noise/eps_512/cifar10/resnet110/noise_0.00/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_baseAttackExp/without_noise/eps_64/cifar10/resnet110/noise_0.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_baseAttackExp/without_noise/eps_127/cifar10/resnet110/noise_0.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_baseAttackExp/without_noise/eps_255/cifar10/resnet110/noise_0.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_baseAttackExp/without_noise/eps_512/cifar10/resnet110/noise_0.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 2.00$"),
]
#####################################################################################################
## DDN/PGD varying number of attack steps experiments
DDN_2steps = [
Line(ApproximateAccuracy("data/certify/cifar10/DDN_2steps/eps_64/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_2steps/eps_127/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_2steps/eps_255/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_2steps/eps_512/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_2steps/eps_64/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_2steps/eps_127/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_2steps/eps_255/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_2steps/eps_512/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_2steps/eps_64/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_2steps/eps_127/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_2steps/eps_255/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_2steps/eps_512/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_2steps/eps_64/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_2steps/eps_127/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_2steps/eps_255/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_2steps/eps_512/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 2.00$"),
]
PGD_2steps = [
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps/eps_64/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps/eps_127/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps/eps_255/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps/eps_512/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps/eps_64/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps/eps_127/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps/eps_255/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps/eps_512/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps/eps_64/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps/eps_127/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps/eps_255/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps/eps_512/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps/eps_64/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps/eps_127/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps/eps_255/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps/eps_512/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 2.00$"),
]
DDN_4steps = [
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps/eps_64/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps/eps_127/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps/eps_255/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps/eps_512/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps/eps_64/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps/eps_127/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps/eps_255/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps/eps_512/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps/eps_64/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps/eps_127/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps/eps_255/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps/eps_512/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps/eps_64/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps/eps_127/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps/eps_255/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps/eps_512/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 2.00$"),
]
PGD_4steps = [
Line(ApproximateAccuracy("data/certify/cifar10/PGD_4steps/eps_64/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_4steps/eps_127/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_4steps/eps_255/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_4steps/eps_512/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_4steps/eps_64/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_4steps/eps_127/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_4steps/eps_255/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_4steps/eps_512/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_4steps/eps_64/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_4steps/eps_127/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_4steps/eps_255/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_4steps/eps_512/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_4steps/eps_64/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_4steps/eps_127/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_4steps/eps_255/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_4steps/eps_512/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 2.00$"),
]
DDN_6steps = [
Line(ApproximateAccuracy("data/certify/cifar10/DDN_6steps/eps_64/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_6steps/eps_127/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_6steps/eps_255/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_6steps/eps_512/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_6steps/eps_64/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_6steps/eps_127/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_6steps/eps_255/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_6steps/eps_512/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_6steps/eps_64/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_6steps/eps_127/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_6steps/eps_255/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_6steps/eps_512/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_6steps/eps_64/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_6steps/eps_127/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_6steps/eps_255/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_6steps/eps_512/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 2.00$"),
]
PGD_6steps = [
Line(ApproximateAccuracy("data/certify/cifar10/PGD_6steps/eps_64/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_6steps/eps_127/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_6steps/eps_255/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_6steps/eps_512/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_6steps/eps_64/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_6steps/eps_127/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_6steps/eps_255/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_6steps/eps_512/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_6steps/eps_64/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_6steps/eps_127/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_6steps/eps_255/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_6steps/eps_512/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_6steps/eps_64/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_6steps/eps_127/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_6steps/eps_255/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_6steps/eps_512/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 2.00$"),
]
DDN_8steps = [
Line(ApproximateAccuracy("data/certify/cifar10/DDN_8steps/eps_64/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_8steps/eps_127/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_8steps/eps_255/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_8steps/eps_512/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_8steps/eps_64/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_8steps/eps_127/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_8steps/eps_255/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_8steps/eps_512/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_8steps/eps_64/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_8steps/eps_127/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_8steps/eps_255/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_8steps/eps_512/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_8steps/eps_64/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_8steps/eps_127/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_8steps/eps_255/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_8steps/eps_512/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 2.00$"),
]
PGD_8steps = [
Line(ApproximateAccuracy("data/certify/cifar10/PGD_8steps/eps_64/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_8steps/eps_127/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_8steps/eps_255/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_8steps/eps_512/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_8steps/eps_64/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_8steps/eps_127/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_8steps/eps_255/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_8steps/eps_512/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_8steps/eps_64/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_8steps/eps_127/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_8steps/eps_255/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_8steps/eps_512/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_8steps/eps_64/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_8steps/eps_127/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_8steps/eps_255/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_8steps/eps_512/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 2.00$"),
]
DDN_10steps = [
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps/eps_64/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps/eps_127/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps/eps_255/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps/eps_512/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps/eps_64/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps/eps_127/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps/eps_255/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps/eps_512/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps/eps_64/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps/eps_127/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps/eps_255/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps/eps_512/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps/eps_64/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps/eps_127/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps/eps_255/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps/eps_512/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 2.00$"),
]
PGD_10steps = [
Line(ApproximateAccuracy("data/certify/cifar10/PGD_10steps/eps_64/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_10steps/eps_127/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_10steps/eps_255/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_10steps/eps_512/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_10steps/eps_64/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_10steps/eps_127/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_10steps/eps_255/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_10steps/eps_512/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_10steps/eps_64/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_10steps/eps_127/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_10steps/eps_255/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_10steps/eps_512/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_10steps/eps_64/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_10steps/eps_127/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_10steps/eps_255/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_10steps/eps_512/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 2.00$"),
]
#####################################################################################################
## DDN varying number of noise samples experiments
DDN_4_steps_2_samples = [
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps_multiNoiseSamples/2-multitrain/eps_64/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps_multiNoiseSamples/2-multitrain/eps_127/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps_multiNoiseSamples/2-multitrain/eps_255/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps_multiNoiseSamples/2-multitrain/eps_512/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps_multiNoiseSamples/2-multitrain/eps_64/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps_multiNoiseSamples/2-multitrain/eps_127/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps_multiNoiseSamples/2-multitrain/eps_255/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps_multiNoiseSamples/2-multitrain/eps_512/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps_multiNoiseSamples/2-multitrain/eps_64/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps_multiNoiseSamples/2-multitrain/eps_127/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps_multiNoiseSamples/2-multitrain/eps_255/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps_multiNoiseSamples/2-multitrain/eps_512/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps_multiNoiseSamples/2-multitrain/eps_64/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps_multiNoiseSamples/2-multitrain/eps_127/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps_multiNoiseSamples/2-multitrain/eps_255/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps_multiNoiseSamples/2-multitrain/eps_512/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 2.00$"),
]
DDN_4_steps_4_samples = [
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps_multiNoiseSamples/4-multitrain/eps_64/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps_multiNoiseSamples/4-multitrain/eps_127/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps_multiNoiseSamples/4-multitrain/eps_255/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps_multiNoiseSamples/4-multitrain/eps_512/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps_multiNoiseSamples/4-multitrain/eps_64/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps_multiNoiseSamples/4-multitrain/eps_127/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps_multiNoiseSamples/4-multitrain/eps_255/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps_multiNoiseSamples/4-multitrain/eps_512/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps_multiNoiseSamples/4-multitrain/eps_64/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps_multiNoiseSamples/4-multitrain/eps_127/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps_multiNoiseSamples/4-multitrain/eps_255/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps_multiNoiseSamples/4-multitrain/eps_512/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps_multiNoiseSamples/4-multitrain/eps_64/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps_multiNoiseSamples/4-multitrain/eps_127/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps_multiNoiseSamples/4-multitrain/eps_255/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps_multiNoiseSamples/4-multitrain/eps_512/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 2.00$"),
]
DDN_4_steps_8_samples = [
# Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps_multiNoiseSamples/8-multitrain/eps_64/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps_multiNoiseSamples/8-multitrain/eps_127/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps_multiNoiseSamples/8-multitrain/eps_255/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps_multiNoiseSamples/8-multitrain/eps_512/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps_multiNoiseSamples/8-multitrain/eps_64/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps_multiNoiseSamples/8-multitrain/eps_127/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps_multiNoiseSamples/8-multitrain/eps_255/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps_multiNoiseSamples/8-multitrain/eps_512/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps_multiNoiseSamples/8-multitrain/eps_64/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps_multiNoiseSamples/8-multitrain/eps_127/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps_multiNoiseSamples/8-multitrain/eps_255/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps_multiNoiseSamples/8-multitrain/eps_512/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps_multiNoiseSamples/8-multitrain/eps_64/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps_multiNoiseSamples/8-multitrain/eps_127/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps_multiNoiseSamples/8-multitrain/eps_255/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps_multiNoiseSamples/8-multitrain/eps_512/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 2.00$"),
]
DDN_4_steps_16_samples = [
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps_multiNoiseSamples/16-multitrain/eps_64/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps_multiNoiseSamples/16-multitrain/eps_127/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps_multiNoiseSamples/16-multitrain/eps_255/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps_multiNoiseSamples/16-multitrain/eps_512/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps_multiNoiseSamples/16-multitrain/eps_64/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps_multiNoiseSamples/16-multitrain/eps_127/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps_multiNoiseSamples/16-multitrain/eps_255/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps_multiNoiseSamples/16-multitrain/eps_512/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps_multiNoiseSamples/16-multitrain/eps_64/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps_multiNoiseSamples/16-multitrain/eps_127/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps_multiNoiseSamples/16-multitrain/eps_255/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps_multiNoiseSamples/16-multitrain/eps_512/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps_multiNoiseSamples/16-multitrain/eps_64/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps_multiNoiseSamples/16-multitrain/eps_127/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps_multiNoiseSamples/16-multitrain/eps_255/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_4steps_multiNoiseSamples/16-multitrain/eps_512/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 2.00$"),
]
DDN_10_steps_2_samples = [
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps_multiNoiseSamples/2-multitrain/eps_64/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps_multiNoiseSamples/2-multitrain/eps_127/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps_multiNoiseSamples/2-multitrain/eps_255/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps_multiNoiseSamples/2-multitrain/eps_512/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps_multiNoiseSamples/2-multitrain/eps_64/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps_multiNoiseSamples/2-multitrain/eps_127/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps_multiNoiseSamples/2-multitrain/eps_255/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps_multiNoiseSamples/2-multitrain/eps_512/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps_multiNoiseSamples/2-multitrain/eps_64/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps_multiNoiseSamples/2-multitrain/eps_127/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps_multiNoiseSamples/2-multitrain/eps_255/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps_multiNoiseSamples/2-multitrain/eps_512/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps_multiNoiseSamples/2-multitrain/eps_64/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps_multiNoiseSamples/2-multitrain/eps_127/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps_multiNoiseSamples/2-multitrain/eps_255/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps_multiNoiseSamples/2-multitrain/eps_512/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 2.00$"),
]
DDN_10_steps_4_samples = [
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps_multiNoiseSamples/4-multitrain/eps_64/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps_multiNoiseSamples/4-multitrain/eps_127/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps_multiNoiseSamples/4-multitrain/eps_255/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps_multiNoiseSamples/4-multitrain/eps_512/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps_multiNoiseSamples/4-multitrain/eps_64/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps_multiNoiseSamples/4-multitrain/eps_127/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps_multiNoiseSamples/4-multitrain/eps_255/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps_multiNoiseSamples/4-multitrain/eps_512/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps_multiNoiseSamples/4-multitrain/eps_64/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps_multiNoiseSamples/4-multitrain/eps_127/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps_multiNoiseSamples/4-multitrain/eps_255/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps_multiNoiseSamples/4-multitrain/eps_512/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps_multiNoiseSamples/4-multitrain/eps_64/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps_multiNoiseSamples/4-multitrain/eps_127/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps_multiNoiseSamples/4-multitrain/eps_255/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps_multiNoiseSamples/4-multitrain/eps_512/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 2.00$"),
]
DDN_10_steps_8_samples = [
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps_multiNoiseSamples/8-multitrain/eps_64/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps_multiNoiseSamples/8-multitrain/eps_127/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps_multiNoiseSamples/8-multitrain/eps_255/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps_multiNoiseSamples/8-multitrain/eps_512/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps_multiNoiseSamples/8-multitrain/eps_64/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps_multiNoiseSamples/8-multitrain/eps_127/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps_multiNoiseSamples/8-multitrain/eps_255/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps_multiNoiseSamples/8-multitrain/eps_512/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps_multiNoiseSamples/8-multitrain/eps_64/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps_multiNoiseSamples/8-multitrain/eps_127/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps_multiNoiseSamples/8-multitrain/eps_255/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps_multiNoiseSamples/8-multitrain/eps_512/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps_multiNoiseSamples/8-multitrain/eps_64/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps_multiNoiseSamples/8-multitrain/eps_127/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps_multiNoiseSamples/8-multitrain/eps_255/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps_multiNoiseSamples/8-multitrain/eps_512/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 2.00$"),
]
DDN_10_steps_16_samples = [
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps_multiNoiseSamples/16-multitrain/eps_64/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps_multiNoiseSamples/16-multitrain/eps_127/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps_multiNoiseSamples/16-multitrain/eps_255/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps_multiNoiseSamples/16-multitrain/eps_512/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps_multiNoiseSamples/16-multitrain/eps_64/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps_multiNoiseSamples/16-multitrain/eps_127/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps_multiNoiseSamples/16-multitrain/eps_255/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps_multiNoiseSamples/16-multitrain/eps_512/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps_multiNoiseSamples/16-multitrain/eps_64/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps_multiNoiseSamples/16-multitrain/eps_127/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps_multiNoiseSamples/16-multitrain/eps_255/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps_multiNoiseSamples/16-multitrain/eps_512/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps_multiNoiseSamples/16-multitrain/eps_64/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps_multiNoiseSamples/16-multitrain/eps_127/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps_multiNoiseSamples/16-multitrain/eps_255/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/DDN_10steps_multiNoiseSamples/16-multitrain/eps_512/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 2.00$"),
]
#####################################################################################################
## PGD varying number of noise samples experiments
PGD_2_steps_2_samples = [
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_multiNoiseSamples/2-multitrain/eps_64/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_multiNoiseSamples/2-multitrain/eps_127/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_multiNoiseSamples/2-multitrain/eps_255/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_multiNoiseSamples/2-multitrain/eps_512/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_multiNoiseSamples/2-multitrain/eps_64/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_multiNoiseSamples/2-multitrain/eps_127/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_multiNoiseSamples/2-multitrain/eps_255/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_multiNoiseSamples/2-multitrain/eps_512/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_multiNoiseSamples/2-multitrain/eps_64/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_multiNoiseSamples/2-multitrain/eps_127/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_multiNoiseSamples/2-multitrain/eps_255/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_multiNoiseSamples/2-multitrain/eps_512/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_multiNoiseSamples/2-multitrain/eps_64/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_multiNoiseSamples/2-multitrain/eps_127/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_multiNoiseSamples/2-multitrain/eps_255/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_multiNoiseSamples/2-multitrain/eps_512/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 2.00$"),
]
PGD_2_steps_4_samples = [
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_multiNoiseSamples/4-multitrain/eps_64/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_multiNoiseSamples/4-multitrain/eps_127/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_multiNoiseSamples/4-multitrain/eps_255/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_multiNoiseSamples/4-multitrain/eps_512/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_multiNoiseSamples/4-multitrain/eps_64/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_multiNoiseSamples/4-multitrain/eps_127/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_multiNoiseSamples/4-multitrain/eps_255/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_multiNoiseSamples/4-multitrain/eps_512/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_multiNoiseSamples/4-multitrain/eps_64/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_multiNoiseSamples/4-multitrain/eps_127/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_multiNoiseSamples/4-multitrain/eps_255/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_multiNoiseSamples/4-multitrain/eps_512/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_multiNoiseSamples/4-multitrain/eps_64/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_multiNoiseSamples/4-multitrain/eps_127/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_multiNoiseSamples/4-multitrain/eps_255/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_multiNoiseSamples/4-multitrain/eps_512/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 2.00$"),
]
PGD_2_steps_8_samples = [
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_multiNoiseSamples/8-multitrain/eps_64/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_multiNoiseSamples/8-multitrain/eps_127/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_multiNoiseSamples/8-multitrain/eps_255/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_multiNoiseSamples/8-multitrain/eps_512/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_multiNoiseSamples/8-multitrain/eps_64/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_multiNoiseSamples/8-multitrain/eps_127/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_multiNoiseSamples/8-multitrain/eps_255/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_multiNoiseSamples/8-multitrain/eps_512/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_multiNoiseSamples/8-multitrain/eps_64/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_multiNoiseSamples/8-multitrain/eps_127/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_multiNoiseSamples/8-multitrain/eps_255/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_multiNoiseSamples/8-multitrain/eps_512/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_multiNoiseSamples/8-multitrain/eps_64/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_multiNoiseSamples/8-multitrain/eps_127/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_multiNoiseSamples/8-multitrain/eps_255/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_multiNoiseSamples/8-multitrain/eps_512/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 2.00$"),
]
PGD_4_steps_2_samples = [
Line(ApproximateAccuracy("data/certify/cifar10/PGD_4steps_multiNoiseSamples/2-multitrain/eps_64/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_4steps_multiNoiseSamples/2-multitrain/eps_127/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_4steps_multiNoiseSamples/2-multitrain/eps_255/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_4steps_multiNoiseSamples/2-multitrain/eps_512/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_4steps_multiNoiseSamples/2-multitrain/eps_64/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_4steps_multiNoiseSamples/2-multitrain/eps_127/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_4steps_multiNoiseSamples/2-multitrain/eps_255/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_4steps_multiNoiseSamples/2-multitrain/eps_512/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_4steps_multiNoiseSamples/2-multitrain/eps_64/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_4steps_multiNoiseSamples/2-multitrain/eps_127/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_4steps_multiNoiseSamples/2-multitrain/eps_255/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_4steps_multiNoiseSamples/2-multitrain/eps_512/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_4steps_multiNoiseSamples/2-multitrain/eps_64/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_4steps_multiNoiseSamples/2-multitrain/eps_127/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_4steps_multiNoiseSamples/2-multitrain/eps_255/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_4steps_multiNoiseSamples/2-multitrain/eps_512/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 2.00$"),
]
PGD_4_steps_4_samples = [
Line(ApproximateAccuracy("data/certify/cifar10/PGD_4steps_multiNoiseSamples/4-multitrain/eps_64/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_4steps_multiNoiseSamples/4-multitrain/eps_127/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_4steps_multiNoiseSamples/4-multitrain/eps_255/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_4steps_multiNoiseSamples/4-multitrain/eps_512/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_4steps_multiNoiseSamples/4-multitrain/eps_64/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_4steps_multiNoiseSamples/4-multitrain/eps_127/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_4steps_multiNoiseSamples/4-multitrain/eps_255/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_4steps_multiNoiseSamples/4-multitrain/eps_512/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_4steps_multiNoiseSamples/4-multitrain/eps_64/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_4steps_multiNoiseSamples/4-multitrain/eps_127/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_4steps_multiNoiseSamples/4-multitrain/eps_255/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_4steps_multiNoiseSamples/4-multitrain/eps_512/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_4steps_multiNoiseSamples/4-multitrain/eps_64/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_4steps_multiNoiseSamples/4-multitrain/eps_127/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_4steps_multiNoiseSamples/4-multitrain/eps_255/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_4steps_multiNoiseSamples/4-multitrain/eps_512/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 2.00$"),
]
PGD_4_steps_8_samples = [
Line(ApproximateAccuracy("data/certify/cifar10/PGD_4steps_multiNoiseSamples/8-multitrain/eps_64/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_4steps_multiNoiseSamples/8-multitrain/eps_127/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_4steps_multiNoiseSamples/8-multitrain/eps_255/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_4steps_multiNoiseSamples/8-multitrain/eps_512/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_4steps_multiNoiseSamples/8-multitrain/eps_64/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_4steps_multiNoiseSamples/8-multitrain/eps_127/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_4steps_multiNoiseSamples/8-multitrain/eps_255/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_4steps_multiNoiseSamples/8-multitrain/eps_512/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_4steps_multiNoiseSamples/8-multitrain/eps_64/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_4steps_multiNoiseSamples/8-multitrain/eps_127/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_4steps_multiNoiseSamples/8-multitrain/eps_255/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_4steps_multiNoiseSamples/8-multitrain/eps_512/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_4steps_multiNoiseSamples/8-multitrain/eps_64/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_4steps_multiNoiseSamples/8-multitrain/eps_127/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_4steps_multiNoiseSamples/8-multitrain/eps_255/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_4steps_multiNoiseSamples/8-multitrain/eps_512/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 2.00$"),
]
PGD_10_steps_2_samples = [
Line(ApproximateAccuracy("data/certify/cifar10/PGD_10steps_multiNoiseSamples/2-multitrain/eps_64/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_10steps_multiNoiseSamples/2-multitrain/eps_127/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_10steps_multiNoiseSamples/2-multitrain/eps_255/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_10steps_multiNoiseSamples/2-multitrain/eps_512/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_10steps_multiNoiseSamples/2-multitrain/eps_64/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_10steps_multiNoiseSamples/2-multitrain/eps_127/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_10steps_multiNoiseSamples/2-multitrain/eps_255/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_10steps_multiNoiseSamples/2-multitrain/eps_512/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_10steps_multiNoiseSamples/2-multitrain/eps_64/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_10steps_multiNoiseSamples/2-multitrain/eps_127/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_10steps_multiNoiseSamples/2-multitrain/eps_255/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_10steps_multiNoiseSamples/2-multitrain/eps_512/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_10steps_multiNoiseSamples/2-multitrain/eps_64/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_10steps_multiNoiseSamples/2-multitrain/eps_127/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_10steps_multiNoiseSamples/2-multitrain/eps_255/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_10steps_multiNoiseSamples/2-multitrain/eps_512/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 2.00$"),
]
PGD_10_steps_4_samples = [
Line(ApproximateAccuracy("data/certify/cifar10/PGD_10steps_multiNoiseSamples/4-multitrain/eps_64/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_10steps_multiNoiseSamples/4-multitrain/eps_127/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_10steps_multiNoiseSamples/4-multitrain/eps_255/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_10steps_multiNoiseSamples/4-multitrain/eps_512/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_10steps_multiNoiseSamples/4-multitrain/eps_64/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_10steps_multiNoiseSamples/4-multitrain/eps_127/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_10steps_multiNoiseSamples/4-multitrain/eps_255/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_10steps_multiNoiseSamples/4-multitrain/eps_512/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_10steps_multiNoiseSamples/4-multitrain/eps_64/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_10steps_multiNoiseSamples/4-multitrain/eps_127/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_10steps_multiNoiseSamples/4-multitrain/eps_255/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_10steps_multiNoiseSamples/4-multitrain/eps_512/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_10steps_multiNoiseSamples/4-multitrain/eps_64/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_10steps_multiNoiseSamples/4-multitrain/eps_127/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_10steps_multiNoiseSamples/4-multitrain/eps_255/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_10steps_multiNoiseSamples/4-multitrain/eps_512/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 2.00$"),
]
PGD_10_steps_8_samples = [
Line(ApproximateAccuracy("data/certify/cifar10/PGD_10steps_multiNoiseSamples/8-multitrain/eps_64/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_10steps_multiNoiseSamples/8-multitrain/eps_127/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_10steps_multiNoiseSamples/8-multitrain/eps_255/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_10steps_multiNoiseSamples/8-multitrain/eps_512/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_10steps_multiNoiseSamples/8-multitrain/eps_64/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_10steps_multiNoiseSamples/8-multitrain/eps_127/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_10steps_multiNoiseSamples/8-multitrain/eps_255/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_10steps_multiNoiseSamples/8-multitrain/eps_512/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_10steps_multiNoiseSamples/8-multitrain/eps_64/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_10steps_multiNoiseSamples/8-multitrain/eps_127/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_10steps_multiNoiseSamples/8-multitrain/eps_255/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_10steps_multiNoiseSamples/8-multitrain/eps_512/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 2.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_10steps_multiNoiseSamples/8-multitrain/eps_64/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_10steps_multiNoiseSamples/8-multitrain/eps_127/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_10steps_multiNoiseSamples/8-multitrain/eps_255/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 1.00$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_10steps_multiNoiseSamples/8-multitrain/eps_512/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 2.00$"),
]
all_imagenet_experiments = [
Line(ApproximateAccuracy("data/certify/imagenet/PGD_1step/imagenet/eps_127/resnet50/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 0.5$"),
Line(ApproximateAccuracy("data/certify/imagenet/PGD_1step/imagenet/eps_255/resnet50/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 1.0$"),
Line(ApproximateAccuracy("data/certify/imagenet/PGD_1step/imagenet/eps_512/resnet50/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 2.0$"),
Line(ApproximateAccuracy("data/certify/imagenet/PGD_1step/imagenet/eps_1024/resnet50/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 4.0$"),
Line(ApproximateAccuracy("data/certify/imagenet/PGD_1step/imagenet/eps_2048/resnet50/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 8.0$"),
Line(ApproximateAccuracy("data/certify/imagenet/PGD_1step/imagenet/eps_127/resnet50/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 0.5$"),
Line(ApproximateAccuracy("data/certify/imagenet/PGD_1step/imagenet/eps_255/resnet50/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 1.0$"),
Line(ApproximateAccuracy("data/certify/imagenet/PGD_1step/imagenet/eps_512/resnet50/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 2.0$"),
Line(ApproximateAccuracy("data/certify/imagenet/PGD_1step/imagenet/eps_1024/resnet50/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 4.0$"),
Line(ApproximateAccuracy("data/certify/imagenet/PGD_1step/imagenet/eps_2048/resnet50/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 8.0$"),
Line(ApproximateAccuracy("data/certify/imagenet/PGD_1step/imagenet/eps_127/resnet50/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 0.5$"),
Line(ApproximateAccuracy("data/certify/imagenet/PGD_1step/imagenet/eps_255/resnet50/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 1.0$"),
Line(ApproximateAccuracy("data/certify/imagenet/PGD_1step/imagenet/eps_512/resnet50/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 2.0$"),
Line(ApproximateAccuracy("data/certify/imagenet/PGD_1step/imagenet/eps_1024/resnet50/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 4.0$"),
Line(ApproximateAccuracy("data/certify/imagenet/PGD_1step/imagenet/eps_2048/resnet50/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 8.0$"),
Line(ApproximateAccuracy("data/certify/imagenet/DDN_2steps/eps_127/resnet50/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 0.5$"),
Line(ApproximateAccuracy("data/certify/imagenet/DDN_2steps/eps_255/resnet50/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 1.0$"),
Line(ApproximateAccuracy("data/certify/imagenet/DDN_2steps/eps_512/resnet50/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 2.0$"),
Line(ApproximateAccuracy("data/certify/imagenet/DDN_2steps/eps_1024/resnet50/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 4.0$"),
Line(ApproximateAccuracy("data/certify/imagenet/DDN_2steps/eps_127/resnet50/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 0.5$"),
Line(ApproximateAccuracy("data/certify/imagenet/DDN_2steps/eps_255/resnet50/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 1.0$"),
Line(ApproximateAccuracy("data/certify/imagenet/DDN_2steps/eps_512/resnet50/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 2.0$"),
Line(ApproximateAccuracy("data/certify/imagenet/DDN_2steps/eps_1024/resnet50/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 4.0$"),
Line(ApproximateAccuracy("data/certify/imagenet/DDN_2steps/eps_127/resnet50/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 0.5$"),
Line(ApproximateAccuracy("data/certify/imagenet/DDN_2steps/eps_255/resnet50/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 1.0$"),
Line(ApproximateAccuracy("data/certify/imagenet/DDN_2steps/eps_512/resnet50/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 2.0$"),
Line(ApproximateAccuracy("data/certify/imagenet/DDN_2steps/eps_1024/resnet50/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 4.0$"),
]
PGD_self_training = np.hstack([
[
Line(ApproximateAccuracy("data/certify/cifar10/self_training/PGD_{}steps/weight_{:.1f}/eps_{}/cifar10/resnet110/noise_0.12/test/sigma_0.12".format(num_pgd, weight, eps)), "$\sigma = 0.12$", plot_fmt='b'),
Line(ApproximateAccuracy("data/certify/cifar10/self_training/PGD_{}steps/weight_{:.1f}/eps_{}/cifar10/resnet110/noise_0.25/test/sigma_0.25".format(num_pgd, weight, eps)), "$\sigma = 0.25$", plot_fmt='orange'),
Line(ApproximateAccuracy("data/certify/cifar10/self_training/PGD_{}steps/weight_{:.1f}/eps_{}/cifar10/resnet110/noise_0.50/test/sigma_0.50".format(num_pgd, weight, eps)), "$\sigma = 0.50$", plot_fmt='g'),
Line(ApproximateAccuracy("data/certify/cifar10/self_training/PGD_{}steps/weight_{:.1f}/eps_{}/cifar10/resnet110/noise_1.00/test/sigma_1.00".format(num_pgd, weight, eps)), "$\sigma = 1.00$", plot_fmt='r'),
Line(ApproximateAccuracy("data/certify/cifar10/self_training/PGD_{}steps/weight_{:.1f}/eps_{}/cifar10/resnet110/noise_0.12/test/sigma_0.12".format(num_pgd, weight, eps)), "$\sigma = 0.12$", plot_fmt='b'),
Line(ApproximateAccuracy("data/certify/cifar10/self_training/PGD_{}steps/weight_{:.1f}/eps_{}/cifar10/resnet110/noise_0.25/test/sigma_0.25".format(num_pgd, weight, eps)), "$\sigma = 0.25$", plot_fmt='orange'),
Line(ApproximateAccuracy("data/certify/cifar10/self_training/PGD_{}steps/weight_{:.1f}/eps_{}/cifar10/resnet110/noise_0.50/test/sigma_0.50".format(num_pgd, weight, eps)), "$\sigma = 0.50$", plot_fmt='g'),
Line(ApproximateAccuracy("data/certify/cifar10/self_training/PGD_{}steps/weight_{:.1f}/eps_{}/cifar10/resnet110/noise_1.00/test/sigma_1.00".format(num_pgd, weight, eps)), "$\sigma = 1.00$", plot_fmt='r'),
Line(ApproximateAccuracy("data/certify/cifar10/self_training/PGD_{}steps/weight_{:.1f}/eps_{}/cifar10/resnet110/noise_0.12/test/sigma_0.12".format(num_pgd, weight, eps)), "$\sigma = 0.12$", plot_fmt='b'),
Line(ApproximateAccuracy("data/certify/cifar10/self_training/PGD_{}steps/weight_{:.1f}/eps_{}/cifar10/resnet110/noise_0.25/test/sigma_0.25".format(num_pgd, weight, eps)), "$\sigma = 0.25$", plot_fmt='orange'),
Line(ApproximateAccuracy("data/certify/cifar10/self_training/PGD_{}steps/weight_{:.1f}/eps_{}/cifar10/resnet110/noise_0.50/test/sigma_0.50".format(num_pgd, weight, eps)), "$\sigma = 0.50$", plot_fmt='g'),
Line(ApproximateAccuracy("data/certify/cifar10/self_training/PGD_{}steps/weight_{:.1f}/eps_{}/cifar10/resnet110/noise_1.00/test/sigma_1.00".format(num_pgd, weight, eps)), "$\sigma = 1.00$", plot_fmt='r'),
Line(ApproximateAccuracy("data/certify/cifar10/self_training/PGD_{}steps/weight_{:.1f}/eps_{}/cifar10/resnet110/noise_0.12/test/sigma_0.12".format(num_pgd, weight, eps)), "$\sigma = 0.12$", plot_fmt='b'),
Line(ApproximateAccuracy("data/certify/cifar10/self_training/PGD_{}steps/weight_{:.1f}/eps_{}/cifar10/resnet110/noise_0.25/test/sigma_0.25".format(num_pgd, weight, eps)), "$\sigma = 0.25$", plot_fmt='orange'),
Line(ApproximateAccuracy("data/certify/cifar10/self_training/PGD_{}steps/weight_{:.1f}/eps_{}/cifar10/resnet110/noise_0.50/test/sigma_0.50".format(num_pgd, weight, eps)), "$\sigma = 0.50$", plot_fmt='g'),
Line(ApproximateAccuracy("data/certify/cifar10/self_training/PGD_{}steps/weight_{:.1f}/eps_{}/cifar10/resnet110/noise_1.00/test/sigma_1.00".format(num_pgd, weight, eps)), "$\sigma = 1.00$", plot_fmt='r'),
]for num_pgd in [2, 4, 6, 8, 10] for weight in [0.1, 0.5, 1.0]for eps in [64, 127, 255, 512]
]).tolist()
PGD_imagenetPretraining_cifar10Fineuning_self_training = np.hstack([
[
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/self_training_PGD_{}steps/weight_{:.1f}/eps_{}/cifar10/resnet110/noise_0.12/test/sigma_0.12".format(num_pgd, weight, eps)), "$\sigma = 0.12$", plot_fmt='b'),
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/self_training_PGD_{}steps/weight_{:.1f}/eps_{}/cifar10/resnet110/noise_0.25/test/sigma_0.25".format(num_pgd, weight, eps)), "$\sigma = 0.25$", plot_fmt='orange'),
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/self_training_PGD_{}steps/weight_{:.1f}/eps_{}/cifar10/resnet110/noise_0.50/test/sigma_0.50".format(num_pgd, weight, eps)), "$\sigma = 0.50$", plot_fmt='g'),
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/self_training_PGD_{}steps/weight_{:.1f}/eps_{}/cifar10/resnet110/noise_1.00/test/sigma_1.00".format(num_pgd, weight, eps)), "$\sigma = 1.00$", plot_fmt='r'),
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/self_training_PGD_{}steps/weight_{:.1f}/eps_{}/cifar10/resnet110/noise_0.12/test/sigma_0.12".format(num_pgd, weight, eps)), "$\sigma = 0.12$", plot_fmt='b'),
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/self_training_PGD_{}steps/weight_{:.1f}/eps_{}/cifar10/resnet110/noise_0.25/test/sigma_0.25".format(num_pgd, weight, eps)), "$\sigma = 0.25$", plot_fmt='orange'),
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/self_training_PGD_{}steps/weight_{:.1f}/eps_{}/cifar10/resnet110/noise_0.50/test/sigma_0.50".format(num_pgd, weight, eps)), "$\sigma = 0.50$", plot_fmt='g'),
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/self_training_PGD_{}steps/weight_{:.1f}/eps_{}/cifar10/resnet110/noise_1.00/test/sigma_1.00".format(num_pgd, weight, eps)), "$\sigma = 1.00$", plot_fmt='r'),
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/self_training_PGD_{}steps/weight_{:.1f}/eps_{}/cifar10/resnet110/noise_0.12/test/sigma_0.12".format(num_pgd, weight, eps)), "$\sigma = 0.12$", plot_fmt='b'),
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/self_training_PGD_{}steps/weight_{:.1f}/eps_{}/cifar10/resnet110/noise_0.25/test/sigma_0.25".format(num_pgd, weight, eps)), "$\sigma = 0.25$", plot_fmt='orange'),
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/self_training_PGD_{}steps/weight_{:.1f}/eps_{}/cifar10/resnet110/noise_0.50/test/sigma_0.50".format(num_pgd, weight, eps)), "$\sigma = 0.50$", plot_fmt='g'),
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/self_training_PGD_{}steps/weight_{:.1f}/eps_{}/cifar10/resnet110/noise_1.00/test/sigma_1.00".format(num_pgd, weight, eps)), "$\sigma = 1.00$", plot_fmt='r'),
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/self_training_PGD_{}steps/weight_{:.1f}/eps_{}/cifar10/resnet110/noise_0.12/test/sigma_0.12".format(num_pgd, weight, eps)), "$\sigma = 0.12$", plot_fmt='b'),
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/self_training_PGD_{}steps/weight_{:.1f}/eps_{}/cifar10/resnet110/noise_0.25/test/sigma_0.25".format(num_pgd, weight, eps)), "$\sigma = 0.25$", plot_fmt='orange'),
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/self_training_PGD_{}steps/weight_{:.1f}/eps_{}/cifar10/resnet110/noise_0.50/test/sigma_0.50".format(num_pgd, weight, eps)), "$\sigma = 0.50$", plot_fmt='g'),
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/self_training_PGD_{}steps/weight_{:.1f}/eps_{}/cifar10/resnet110/noise_1.00/test/sigma_1.00".format(num_pgd, weight, eps)), "$\sigma = 1.00$", plot_fmt='r'),
# ]for num_pgd in [4] for weight in [0.1, 0.5, 1.0]for eps in [64, 127, 255, 512]
]for num_pgd in [2, 4, 6, 8, 10] for weight in [0.1, 0.5, 1.0] for eps in [64, 127, 255, 512]
]).tolist()
PGD_imagenetPretraining_cifar10Fineuning_1sample = np.hstack([
[
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/PGD_{}steps_30epochs/eps_{}/cifar10/resnet110/noise_0.12/test/sigma_0.12".format(num_pgd, eps)), "$\sigma = 0.12$", plot_fmt='b'),
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/PGD_{}steps_30epochs/eps_{}/cifar10/resnet110/noise_0.25/test/sigma_0.25".format(num_pgd, eps)), "$\sigma = 0.25$", plot_fmt='orange'),
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/PGD_{}steps_30epochs/eps_{}/cifar10/resnet110/noise_0.50/test/sigma_0.50".format(num_pgd, eps)), "$\sigma = 0.50$", plot_fmt='g'),
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/PGD_{}steps_30epochs/eps_{}/cifar10/resnet110/noise_1.00/test/sigma_1.00".format(num_pgd, eps)), "$\sigma = 1.00$", plot_fmt='r'),
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/PGD_{}steps_30epochs/eps_{}/cifar10/resnet110/noise_0.12/test/sigma_0.12".format(num_pgd, eps)), "$\sigma = 0.12$", plot_fmt='b'),
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/PGD_{}steps_30epochs/eps_{}/cifar10/resnet110/noise_0.25/test/sigma_0.25".format(num_pgd, eps)), "$\sigma = 0.25$", plot_fmt='orange'),
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/PGD_{}steps_30epochs/eps_{}/cifar10/resnet110/noise_0.50/test/sigma_0.50".format(num_pgd, eps)), "$\sigma = 0.50$", plot_fmt='g'),
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/PGD_{}steps_30epochs/eps_{}/cifar10/resnet110/noise_1.00/test/sigma_1.00".format(num_pgd, eps)), "$\sigma = 1.00$", plot_fmt='r'),
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/PGD_{}steps_30epochs/eps_{}/cifar10/resnet110/noise_0.12/test/sigma_0.12".format(num_pgd, eps)), "$\sigma = 0.12$", plot_fmt='b'),
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/PGD_{}steps_30epochs/eps_{}/cifar10/resnet110/noise_0.25/test/sigma_0.25".format(num_pgd, eps)), "$\sigma = 0.25$", plot_fmt='orange'),
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/PGD_{}steps_30epochs/eps_{}/cifar10/resnet110/noise_0.50/test/sigma_0.50".format(num_pgd, eps)), "$\sigma = 0.50$", plot_fmt='g'),
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/PGD_{}steps_30epochs/eps_{}/cifar10/resnet110/noise_1.00/test/sigma_1.00".format(num_pgd, eps)), "$\sigma = 1.00$", plot_fmt='r'),
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/PGD_{}steps_30epochs/eps_{}/cifar10/resnet110/noise_0.12/test/sigma_0.12".format(num_pgd, eps)), "$\sigma = 0.12$", plot_fmt='b'),
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/PGD_{}steps_30epochs/eps_{}/cifar10/resnet110/noise_0.25/test/sigma_0.25".format(num_pgd, eps)), "$\sigma = 0.25$", plot_fmt='orange'),
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/PGD_{}steps_30epochs/eps_{}/cifar10/resnet110/noise_0.50/test/sigma_0.50".format(num_pgd, eps)), "$\sigma = 0.50$", plot_fmt='g'),
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/PGD_{}steps_30epochs/eps_{}/cifar10/resnet110/noise_1.00/test/sigma_1.00".format(num_pgd, eps)), "$\sigma = 1.00$", plot_fmt='r'),
]for num_pgd in [2, 4, 6, 8, 10] for eps in [64, 127, 255, 512]
]).tolist()
DDN_imagenetPretraining_cifar10Fineuning_1sample = np.hstack([
[
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/DDN_{}steps_30epochs/eps_{}/cifar10/resnet110/noise_0.12/test/sigma_0.12".format(num_ddn, eps)), "$\sigma = 0.12$", plot_fmt='b'),
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/DDN_{}steps_30epochs/eps_{}/cifar10/resnet110/noise_0.25/test/sigma_0.25".format(num_ddn, eps)), "$\sigma = 0.25$", plot_fmt='orange'),
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/DDN_{}steps_30epochs/eps_{}/cifar10/resnet110/noise_0.50/test/sigma_0.50".format(num_ddn, eps)), "$\sigma = 0.50$", plot_fmt='g'),
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/DDN_{}steps_30epochs/eps_{}/cifar10/resnet110/noise_1.00/test/sigma_1.00".format(num_ddn, eps)), "$\sigma = 1.00$", plot_fmt='r'),
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/DDN_{}steps_30epochs/eps_{}/cifar10/resnet110/noise_0.12/test/sigma_0.12".format(num_ddn, eps)), "$\sigma = 0.12$", plot_fmt='b'),
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/DDN_{}steps_30epochs/eps_{}/cifar10/resnet110/noise_0.25/test/sigma_0.25".format(num_ddn, eps)), "$\sigma = 0.25$", plot_fmt='orange'),
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/DDN_{}steps_30epochs/eps_{}/cifar10/resnet110/noise_0.50/test/sigma_0.50".format(num_ddn, eps)), "$\sigma = 0.50$", plot_fmt='g'),
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/DDN_{}steps_30epochs/eps_{}/cifar10/resnet110/noise_1.00/test/sigma_1.00".format(num_ddn, eps)), "$\sigma = 1.00$", plot_fmt='r'),
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/DDN_{}steps_30epochs/eps_{}/cifar10/resnet110/noise_0.12/test/sigma_0.12".format(num_ddn, eps)), "$\sigma = 0.12$", plot_fmt='b'),
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/DDN_{}steps_30epochs/eps_{}/cifar10/resnet110/noise_0.25/test/sigma_0.25".format(num_ddn, eps)), "$\sigma = 0.25$", plot_fmt='orange'),
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/DDN_{}steps_30epochs/eps_{}/cifar10/resnet110/noise_0.50/test/sigma_0.50".format(num_ddn, eps)), "$\sigma = 0.50$", plot_fmt='g'),
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/DDN_{}steps_30epochs/eps_{}/cifar10/resnet110/noise_1.00/test/sigma_1.00".format(num_ddn, eps)), "$\sigma = 1.00$", plot_fmt='r'),
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/DDN_{}steps_30epochs/eps_{}/cifar10/resnet110/noise_0.12/test/sigma_0.12".format(num_ddn, eps)), "$\sigma = 0.12$", plot_fmt='b'),
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/DDN_{}steps_30epochs/eps_{}/cifar10/resnet110/noise_0.25/test/sigma_0.25".format(num_ddn, eps)), "$\sigma = 0.25$", plot_fmt='orange'),
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/DDN_{}steps_30epochs/eps_{}/cifar10/resnet110/noise_0.50/test/sigma_0.50".format(num_ddn, eps)), "$\sigma = 0.50$", plot_fmt='g'),
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/DDN_{}steps_30epochs/eps_{}/cifar10/resnet110/noise_1.00/test/sigma_1.00".format(num_ddn, eps)), "$\sigma = 1.00$", plot_fmt='r'),
]for num_ddn in [2, 4, 6, 8, 10] for eps in [64, 127, 255, 512]
]).tolist()
PGD_imagenetPretraining_cifar10Fineuning_multinoise = np.hstack([
[
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/PGD_{}steps_30epochs_multinoise/{}-multitrain/eps_{}/cifar10/resnet110/noise_0.12/test/sigma_0.12".format(num_pgd, num_noise, eps)), "$\sigma = 0.12$", plot_fmt='b'),
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/PGD_{}steps_30epochs_multinoise/{}-multitrain/eps_{}/cifar10/resnet110/noise_0.25/test/sigma_0.25".format(num_pgd, num_noise, eps)), "$\sigma = 0.25$", plot_fmt='orange'),
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/PGD_{}steps_30epochs_multinoise/{}-multitrain/eps_{}/cifar10/resnet110/noise_0.50/test/sigma_0.50".format(num_pgd, num_noise, eps)), "$\sigma = 0.50$", plot_fmt='g'),
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/PGD_{}steps_30epochs_multinoise/{}-multitrain/eps_{}/cifar10/resnet110/noise_1.00/test/sigma_1.00".format(num_pgd, num_noise, eps)), "$\sigma = 1.00$", plot_fmt='r'),
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/PGD_{}steps_30epochs_multinoise/{}-multitrain/eps_{}/cifar10/resnet110/noise_0.12/test/sigma_0.12".format(num_pgd, num_noise, eps)), "$\sigma = 0.12$", plot_fmt='b'),
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/PGD_{}steps_30epochs_multinoise/{}-multitrain/eps_{}/cifar10/resnet110/noise_0.25/test/sigma_0.25".format(num_pgd, num_noise, eps)), "$\sigma = 0.25$", plot_fmt='orange'),
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/PGD_{}steps_30epochs_multinoise/{}-multitrain/eps_{}/cifar10/resnet110/noise_0.50/test/sigma_0.50".format(num_pgd, num_noise, eps)), "$\sigma = 0.50$", plot_fmt='g'),
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/PGD_{}steps_30epochs_multinoise/{}-multitrain/eps_{}/cifar10/resnet110/noise_1.00/test/sigma_1.00".format(num_pgd, num_noise, eps)), "$\sigma = 1.00$", plot_fmt='r'),
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/PGD_{}steps_30epochs_multinoise/{}-multitrain/eps_{}/cifar10/resnet110/noise_0.12/test/sigma_0.12".format(num_pgd, num_noise, eps)), "$\sigma = 0.12$", plot_fmt='b'),
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/PGD_{}steps_30epochs_multinoise/{}-multitrain/eps_{}/cifar10/resnet110/noise_0.25/test/sigma_0.25".format(num_pgd, num_noise, eps)), "$\sigma = 0.25$", plot_fmt='orange'),
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/PGD_{}steps_30epochs_multinoise/{}-multitrain/eps_{}/cifar10/resnet110/noise_0.50/test/sigma_0.50".format(num_pgd, num_noise, eps)), "$\sigma = 0.50$", plot_fmt='g'),
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/PGD_{}steps_30epochs_multinoise/{}-multitrain/eps_{}/cifar10/resnet110/noise_1.00/test/sigma_1.00".format(num_pgd, num_noise, eps)), "$\sigma = 1.00$", plot_fmt='r'),
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/PGD_{}steps_30epochs_multinoise/{}-multitrain/eps_{}/cifar10/resnet110/noise_0.12/test/sigma_0.12".format(num_pgd, num_noise, eps)), "$\sigma = 0.12$", plot_fmt='b'),
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/PGD_{}steps_30epochs_multinoise/{}-multitrain/eps_{}/cifar10/resnet110/noise_0.25/test/sigma_0.25".format(num_pgd, num_noise, eps)), "$\sigma = 0.25$", plot_fmt='orange'),
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/PGD_{}steps_30epochs_multinoise/{}-multitrain/eps_{}/cifar10/resnet110/noise_0.50/test/sigma_0.50".format(num_pgd, num_noise, eps)), "$\sigma = 0.50$", plot_fmt='g'),
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/PGD_{}steps_30epochs_multinoise/{}-multitrain/eps_{}/cifar10/resnet110/noise_1.00/test/sigma_1.00".format(num_pgd, num_noise, eps)), "$\sigma = 1.00$", plot_fmt='r'),
] for num_pgd in [2, 4, 6, 8, 10] for num_noise in [2, 4, 8] for eps in [64, 127, 255, 512]
]).tolist()
PGD_imagenetPretraining_cifar10Fineuning = PGD_imagenetPretraining_cifar10Fineuning_1sample + \
PGD_imagenetPretraining_cifar10Fineuning_multinoise + \
DDN_imagenetPretraining_cifar10Fineuning_1sample
################################################
# All experiments
all_cifar_experiments = PGD_2_steps_8_samples + \
PGD_2_steps_4_samples + \
PGD_2_steps_2_samples + \
PGD_10_steps_8_samples + \
PGD_10_steps_4_samples + \
PGD_10_steps_2_samples + \
DDN_4_steps_16_samples + \
DDN_4_steps_8_samples + \
DDN_4_steps_4_samples + \
DDN_4_steps_2_samples + \
DDN_10_steps_16_samples + \
DDN_10_steps_8_samples + \
DDN_10_steps_4_samples + \
DDN_10_steps_2_samples + \
PGD_10steps + \
PGD_8steps + \
PGD_6steps + \
PGD_4steps + \
PGD_2steps + \
DDN_10steps + \
DDN_8steps + \
DDN_6steps + \
DDN_4steps + \
DDN_2steps
all_cifar_cohen=[
Line(ApproximateAccuracy("data_cohen/certify/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$"),
Line(ApproximateAccuracy("data_cohen/certify/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$"),
Line(ApproximateAccuracy("data_cohen/certify/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$"),
Line(ApproximateAccuracy("data_cohen/certify/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$"),
]
all_cifar_cohen_fulldataset=[
Line(ApproximateAccuracy("data/certify/best_models/cifar10/cohen/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$"),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/cohen/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$"),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/cohen/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$"),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/cohen/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$"),
]
all_imagenet_cohen=[
Line(ApproximateAccuracy("data_cohen/certify/imagenet/resnet50/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$"),
Line(ApproximateAccuracy("data_cohen/certify/imagenet/resnet50/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$"),
Line(ApproximateAccuracy("data_cohen/certify/imagenet/resnet50/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$"),
]
all_imagenet_cohen_replicate=[
Line(ApproximateAccuracy("data/certify/imagenet/replication/resnet50/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$", plot_fmt='b'),
Line(ApproximateAccuracy("data/certify/imagenet/replication/resnet50/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$", plot_fmt='orange'),
Line(ApproximateAccuracy("data/certify/imagenet/replication/resnet50/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$", plot_fmt='g'),
]
all_imagenet_cohen_500samples=[
Line(ApproximateAccuracy("data/certify/best_models/imagenet/replication/resnet50/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$", plot_fmt='b'),
Line(ApproximateAccuracy("data/certify/best_models/imagenet/replication/resnet50/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$", plot_fmt='orange'),
Line(ApproximateAccuracy("data/certify/best_models/imagenet/replication/resnet50/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$", plot_fmt='g'),
]
## Our best models
best_cifar10 = [
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours/cifar10/DDN_10steps_multiNoiseSamples/8-multitrain/eps_64/cifar10/resnet110/noise_0.12/test/sigma_0.12")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours/cifar10/DDN_10steps_multiNoiseSamples/4-multitrain/eps_64/cifar10/resnet110/noise_0.12/test/sigma_0.12")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours/cifar10/PGD_10steps_multiNoiseSamples/4-multitrain/eps_64/cifar10/resnet110/noise_0.12/test/sigma_0.12")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours/cifar10/DDN_4steps_multiNoiseSamples/4-multitrain/eps_255/cifar10/resnet110/noise_0.12/test/sigma_0.12")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours/cifar10/PGD_10steps_multiNoiseSamples/8-multitrain/eps_255/cifar10/resnet110/noise_0.25/test/sigma_0.25")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours/cifar10/PGD_2steps_multiNoiseSamples/8-multitrain/eps_255/cifar10/resnet110/noise_0.25/test/sigma_0.25")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours/cifar10/PGD_10steps_multiNoiseSamples/4-multitrain/eps_255/cifar10/resnet110/noise_0.25/test/sigma_0.25")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours/cifar10/PGD_2steps_multiNoiseSamples/8-multitrain/eps_512/cifar10/resnet110/noise_0.25/test/sigma_0.25")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours/cifar10/PGD_2steps_multiNoiseSamples/8-multitrain/eps_512/cifar10/resnet110/noise_0.50/test/sigma_0.50")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours/cifar10/PGD_2steps_multiNoiseSamples/8-multitrain/eps_512/cifar10/resnet110/noise_0.50/test/sigma_0.50")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours/cifar10/PGD_2steps_multiNoiseSamples/2-multitrain/eps_512/cifar10/resnet110/noise_0.50/test/sigma_0.50")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours/cifar10/PGD_2steps_multiNoiseSamples/2-multitrain/eps_512/cifar10/resnet110/noise_0.50/test/sigma_0.50")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours/cifar10/PGD_10steps_multiNoiseSamples/2-multitrain/eps_512/cifar10/resnet110/noise_0.50/test/sigma_0.50")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours/cifar10/PGD_4steps/eps_512/cifar10/resnet110/noise_0.50/test/sigma_0.50")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours/cifar10/PGD_4steps/eps_512/cifar10/resnet110/noise_0.50/test/sigma_0.50")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours/cifar10/PGD_10steps_multiNoiseSamples/2-multitrain/eps_512/cifar10/resnet110/noise_1.00/test/sigma_1.00")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours/cifar10/PGD_10steps_multiNoiseSamples/2-multitrain/eps_512/cifar10/resnet110/noise_1.00/test/sigma_1.00")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours/cifar10/PGD_2steps_multiNoiseSamples/4-multitrain/eps_512/cifar10/resnet110/noise_1.00/test/sigma_1.00")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours/cifar10/PGD_10steps_multiNoiseSamples/2-multitrain/eps_512/cifar10/resnet110/noise_1.00/test/sigma_1.00")),
]
best_cifar10_pretraining = [
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours_pretraining/cifar10/finetune_cifar_from_imagenetPGD2steps/DDN_2steps_30epochs/eps_64/cifar10/resnet110/noise_0.12/test/sigma_0.12")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours_pretraining/cifar10/finetune_cifar_from_imagenetPGD2steps/DDN_4steps_30epochs/eps_64/cifar10/resnet110/noise_0.12/test/sigma_0.12")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours_pretraining/cifar10/finetune_cifar_from_imagenetPGD2steps/PGD_6steps_30epochs/eps_64/cifar10/resnet110/noise_0.12/test/sigma_0.12")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours_pretraining/cifar10/finetune_cifar_from_imagenetPGD2steps/PGD_10steps_30epochs/eps_127/cifar10/resnet110/noise_0.12/test/sigma_0.12")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours_pretraining/cifar10/finetune_cifar_from_imagenetPGD2steps/PGD_4steps_30epochs/eps_127/cifar10/resnet110/noise_0.25/test/sigma_0.25")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours_pretraining/cifar10/finetune_cifar_from_imagenetPGD2steps/PGD_4steps_30epochs_multinoise/2-multitrain/eps_127/cifar10/resnet110/noise_0.25/test/sigma_0.25")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours_pretraining/cifar10/finetune_cifar_from_imagenetPGD2steps/PGD_6steps_30epochs_multinoise/4-multitrain/eps_255/cifar10/resnet110/noise_0.25/test/sigma_0.25")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours_pretraining/cifar10/finetune_cifar_from_imagenetPGD2steps/PGD_2steps_30epochs_multinoise/2-multitrain/eps_255/cifar10/resnet110/noise_0.25/test/sigma_0.25")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours_pretraining/cifar10/finetune_cifar_from_imagenetPGD2steps/PGD_8steps_30epochs_multinoise/4-multitrain/eps_512/cifar10/resnet110/noise_0.50/test/sigma_0.50")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours_pretraining/cifar10/finetune_cifar_from_imagenetPGD2steps/PGD_2steps_30epochs_multinoise/4-multitrain/eps_512/cifar10/resnet110/noise_0.50/test/sigma_0.50")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours_pretraining/cifar10/finetune_cifar_from_imagenetPGD2steps/PGD_2steps_30epochs_multinoise/4-multitrain/eps_512/cifar10/resnet110/noise_0.50/test/sigma_0.50")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours_pretraining/cifar10/finetune_cifar_from_imagenetPGD2steps/PGD_2steps_30epochs_multinoise/4-multitrain/eps_512/cifar10/resnet110/noise_0.50/test/sigma_0.50")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours_pretraining/cifar10/finetune_cifar_from_imagenetPGD2steps/PGD_4steps_30epochs_multinoise/4-multitrain/eps_512/cifar10/resnet110/noise_0.50/test/sigma_0.50")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours_pretraining/cifar10/finetune_cifar_from_imagenetPGD2steps/PGD_6steps_30epochs/eps_512/cifar10/resnet110/noise_0.50/test/sigma_0.50")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours_pretraining/cifar10/finetune_cifar_from_imagenetPGD2steps/PGD_6steps_30epochs_multinoise/2-multitrain/eps_512/cifar10/resnet110/noise_0.50/test/sigma_0.50")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours_pretraining/cifar10/finetune_cifar_from_imagenetPGD2steps/PGD_6steps_30epochs/eps_512/cifar10/resnet110/noise_1.00/test/sigma_1.00")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours_pretraining/cifar10/finetune_cifar_from_imagenetPGD2steps/PGD_6steps_30epochs/eps_512/cifar10/resnet110/noise_1.00/test/sigma_1.00")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours_pretraining/cifar10/finetune_cifar_from_imagenetPGD2steps/PGD_6steps_30epochs/eps_512/cifar10/resnet110/noise_1.00/test/sigma_1.00")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours_pretraining/cifar10/finetune_cifar_from_imagenetPGD2steps/PGD_6steps_30epochs/eps_512/cifar10/resnet110/noise_1.00/test/sigma_1.00")),
]
best_cifar10_selftraining = [
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours_selftraining/cifar10/self_training/PGD_4steps/weight_0.5/eps_64/cifar10/resnet110/noise_0.12/test/sigma_0.12")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours_selftraining/cifar10/self_training/PGD_2steps/weight_1.0/eps_64/cifar10/resnet110/noise_0.12/test/sigma_0.12")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours_selftraining/cifar10/self_training/PGD_4steps/weight_1.0/eps_64/cifar10/resnet110/noise_0.12/test/sigma_0.12")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours_selftraining/cifar10/self_training/PGD_8steps/weight_1.0/eps_64/cifar10/resnet110/noise_0.12/test/sigma_0.12")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours_selftraining/cifar10/self_training/PGD_4steps/weight_1.0/eps_127/cifar10/resnet110/noise_0.25/test/sigma_0.25")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours_selftraining/cifar10/self_training/PGD_4steps/weight_1.0/eps_127/cifar10/resnet110/noise_0.25/test/sigma_0.25")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours_selftraining/cifar10/self_training/PGD_2steps/weight_1.0/eps_255/cifar10/resnet110/noise_0.25/test/sigma_0.25")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours_selftraining/cifar10/self_training/PGD_2steps/weight_1.0/eps_255/cifar10/resnet110/noise_0.25/test/sigma_0.25")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours_selftraining/cifar10/self_training/PGD_2steps/weight_0.5/eps_255/cifar10/resnet110/noise_0.50/test/sigma_0.50")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours_selftraining/cifar10/self_training/PGD_8steps/weight_1.0/eps_512/cifar10/resnet110/noise_0.50/test/sigma_0.50")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours_selftraining/cifar10/self_training/PGD_4steps/weight_1.0/eps_512/cifar10/resnet110/noise_0.50/test/sigma_0.50")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours_selftraining/cifar10/self_training/PGD_4steps/weight_1.0/eps_512/cifar10/resnet110/noise_0.50/test/sigma_0.50")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours_selftraining/cifar10/self_training/PGD_4steps/weight_1.0/eps_512/cifar10/resnet110/noise_0.50/test/sigma_0.50")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours_selftraining/cifar10/self_training/PGD_4steps/weight_1.0/eps_512/cifar10/resnet110/noise_0.50/test/sigma_0.50")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours_selftraining/cifar10/self_training/PGD_4steps/weight_1.0/eps_512/cifar10/resnet110/noise_0.50/test/sigma_0.50")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours_selftraining/cifar10/self_training/PGD_8steps/weight_0.5/eps_512/cifar10/resnet110/noise_1.00/test/sigma_1.00")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours_selftraining/cifar10/self_training/PGD_8steps/weight_0.5/eps_512/cifar10/resnet110/noise_1.00/test/sigma_1.00")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours_selftraining/cifar10/self_training/PGD_10steps/weight_1.0/eps_512/cifar10/resnet110/noise_1.00/test/sigma_1.00")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours_selftraining/cifar10/self_training/PGD_8steps/weight_0.5/eps_512/cifar10/resnet110/noise_1.00/test/sigma_1.00")),
]
best_cifar10_pretraining_selftraining = [
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours_pretraining_selftraining/cifar10/finetune_cifar_from_imagenetPGD2steps/self_training_PGD_2steps/weight_1.0/eps_64/cifar10/resnet110/noise_0.12/test/sigma_0.12")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours_pretraining_selftraining/cifar10/finetune_cifar_from_imagenetPGD2steps/self_training_PGD_10steps/weight_1.0/eps_64/cifar10/resnet110/noise_0.12/test/sigma_0.12")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours_pretraining_selftraining/cifar10/finetune_cifar_from_imagenetPGD2steps/self_training_PGD_2steps/weight_1.0/eps_64/cifar10/resnet110/noise_0.12/test/sigma_0.12")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours_pretraining_selftraining/cifar10/finetune_cifar_from_imagenetPGD2steps/self_training_PGD_4steps/weight_1.0/eps_127/cifar10/resnet110/noise_0.12/test/sigma_0.12")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours_pretraining_selftraining/cifar10/finetune_cifar_from_imagenetPGD2steps/self_training_PGD_2steps/weight_0.5/eps_64/cifar10/resnet110/noise_0.25/test/sigma_0.25")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours_pretraining_selftraining/cifar10/finetune_cifar_from_imagenetPGD2steps/self_training_PGD_4steps/weight_1.0/eps_127/cifar10/resnet110/noise_0.25/test/sigma_0.25")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours_pretraining_selftraining/cifar10/finetune_cifar_from_imagenetPGD2steps/self_training_PGD_6steps/weight_1.0/eps_255/cifar10/resnet110/noise_0.25/test/sigma_0.25")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours_pretraining_selftraining/cifar10/finetune_cifar_from_imagenetPGD2steps/self_training_PGD_6steps/weight_1.0/eps_255/cifar10/resnet110/noise_0.25/test/sigma_0.25")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours_pretraining_selftraining/cifar10/finetune_cifar_from_imagenetPGD2steps/self_training_PGD_6steps/weight_0.5/eps_512/cifar10/resnet110/noise_0.50/test/sigma_0.50")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours_pretraining_selftraining/cifar10/finetune_cifar_from_imagenetPGD2steps/self_training_PGD_2steps/weight_0.5/eps_512/cifar10/resnet110/noise_0.50/test/sigma_0.50")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours_pretraining_selftraining/cifar10/finetune_cifar_from_imagenetPGD2steps/self_training_PGD_2steps/weight_0.5/eps_512/cifar10/resnet110/noise_0.50/test/sigma_0.50")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours_pretraining_selftraining/cifar10/finetune_cifar_from_imagenetPGD2steps/self_training_PGD_2steps/weight_0.5/eps_512/cifar10/resnet110/noise_0.50/test/sigma_0.50")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours_pretraining_selftraining/cifar10/finetune_cifar_from_imagenetPGD2steps/self_training_PGD_2steps/weight_0.5/eps_512/cifar10/resnet110/noise_0.50/test/sigma_0.50")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours_pretraining_selftraining/cifar10/finetune_cifar_from_imagenetPGD2steps/self_training_PGD_8steps/weight_0.5/eps_512/cifar10/resnet110/noise_0.50/test/sigma_0.50")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours_pretraining_selftraining/cifar10/finetune_cifar_from_imagenetPGD2steps/self_training_PGD_8steps/weight_0.5/eps_512/cifar10/resnet110/noise_0.50/test/sigma_0.50")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours_pretraining_selftraining/cifar10/finetune_cifar_from_imagenetPGD2steps/self_training_PGD_8steps/weight_0.1/eps_512/cifar10/resnet110/noise_0.50/test/sigma_0.50")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours_pretraining_selftraining/cifar10/finetune_cifar_from_imagenetPGD2steps/self_training_PGD_6steps/weight_0.5/eps_512/cifar10/resnet110/noise_1.00/test/sigma_1.00")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours_pretraining_selftraining/cifar10/finetune_cifar_from_imagenetPGD2steps/self_training_PGD_8steps/weight_1.0/eps_512/cifar10/resnet110/noise_1.00/test/sigma_1.00")),
Line(ApproximateAccuracy("data/certify/best_models/cifar10/ours_pretraining_selftraining/cifar10/finetune_cifar_from_imagenetPGD2steps/self_training_PGD_4steps/weight_0.5/eps_512/cifar10/resnet110/noise_1.00/test/sigma_1.00")),
]
all_imagenet_experiments_500samples = [
Line(ApproximateAccuracy("data/certify/best_models/imagenet/PGD_1step/eps_127/resnet50/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 0.5$"),
Line(ApproximateAccuracy("data/certify/best_models/imagenet/PGD_1step/eps_255/resnet50/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 1.0$"),
Line(ApproximateAccuracy("data/certify/best_models/imagenet/PGD_1step/eps_512/resnet50/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 2.0$"),
Line(ApproximateAccuracy("data/certify/best_models/imagenet/PGD_1step/eps_1024/resnet50/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 4.0$"),
Line(ApproximateAccuracy("data/certify/best_models/imagenet/PGD_1step/eps_127/resnet50/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 0.5$"),
Line(ApproximateAccuracy("data/certify/best_models/imagenet/PGD_1step/eps_255/resnet50/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 1.0$"),
Line(ApproximateAccuracy("data/certify/best_models/imagenet/PGD_1step/eps_512/resnet50/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 2.0$"),
Line(ApproximateAccuracy("data/certify/best_models/imagenet/PGD_1step/eps_1024/resnet50/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 4.0$"),
Line(ApproximateAccuracy("data/certify/best_models/imagenet/PGD_1step/eps_127/resnet50/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 0.5$"),
Line(ApproximateAccuracy("data/certify/best_models/imagenet/PGD_1step/eps_255/resnet50/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 1.0$"),
Line(ApproximateAccuracy("data/certify/best_models/imagenet/PGD_1step/eps_512/resnet50/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 2.0$"),
Line(ApproximateAccuracy("data/certify/best_models/imagenet/PGD_1step/eps_1024/resnet50/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 4.0$"),
Line(ApproximateAccuracy("data/certify/best_models/imagenet/DDN_2steps/eps_127/resnet50/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 0.5$"),
Line(ApproximateAccuracy("data/certify/best_models/imagenet/DDN_2steps/eps_255/resnet50/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 1.0$"),
Line(ApproximateAccuracy("data/certify/best_models/imagenet/DDN_2steps/eps_512/resnet50/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 2.0$"),
Line(ApproximateAccuracy("data/certify/best_models/imagenet/DDN_2steps/eps_1024/resnet50/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$ | $\epsilon = 4.0$"),
Line(ApproximateAccuracy("data/certify/best_models/imagenet/DDN_2steps/eps_127/resnet50/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 0.5$"),
Line(ApproximateAccuracy("data/certify/best_models/imagenet/DDN_2steps/eps_255/resnet50/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 1.0$"),
Line(ApproximateAccuracy("data/certify/best_models/imagenet/DDN_2steps/eps_512/resnet50/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 2.0$"),
Line(ApproximateAccuracy("data/certify/best_models/imagenet/DDN_2steps/eps_1024/resnet50/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$ | $\epsilon = 4.0$"),
Line(ApproximateAccuracy("data/certify/best_models/imagenet/DDN_2steps/eps_127/resnet50/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 0.5$"),
Line(ApproximateAccuracy("data/certify/best_models/imagenet/DDN_2steps/eps_255/resnet50/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 1.0$"),
Line(ApproximateAccuracy("data/certify/best_models/imagenet/DDN_2steps/eps_512/resnet50/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 2.0$"),
Line(ApproximateAccuracy("data/certify/best_models/imagenet/DDN_2steps/eps_1024/resnet50/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$ | $\epsilon = 4.0$"),
]
if __name__ == "__main__":
latex_table_abstention_rate(
"analysis/latex_new/cohen_cifar10_abstention_rates", 0.25, 2.25, 0.25, all_cifar_cohen_fulldataset)
latex_table_abstention_rate(
"analysis/latex_new/our_cifar10_abstention_rates", 0.25, 2.25, 0.25, best_cifar10)
latex_table_abstention_rate(
"analysis/latex_new/our_cifar10_abstention_rates_self_training", 0.25, 2.25, 0.25, best_cifar10_selftraining)
latex_table_abstention_rate(
"analysis/latex_new/our_cifar10_abstention_rates_pretraining", 0.25, 2.25, 0.25, best_cifar10_pretraining)
latex_table_abstention_rate(
"analysis/latex_new/our_cifar10_abstention_rates_pretraining_self_training", 0.25, 2.25, 0.25, best_cifar10_pretraining_selftraining)
# Latex New (updated main latex tables: CIFAR10 full dataset / ImageeNet 500 samples)
latex_table_certified_accuracy_upper_envelope(
"analysis/latex_new/cohen_cifar10_certified_outer_envelop", 0.25, 2.25, 0.25, all_cifar_cohen_fulldataset)
latex_table_certified_accuracy_upper_envelope(
"analysis/latex_new/cohen_imagenet_certified_outer_envelop", 0.5, 3.5, 0.5, all_imagenet_cohen_500samples)
latex_table_certified_accuracy_upper_envelope(
"analysis/latex_new/our_cifar10_certified_outer_envelop", 0.25, 2.25, 0.25, best_cifar10)
latex_table_certified_accuracy_upper_envelope(
"analysis/latex_new/our_imagenet_certified_outer_envelop", 0.5, 3.5, 0.5, all_imagenet_experiments_500samples)
latex_table_certified_accuracy_upper_envelope(
"analysis/latex_new/our_cifar10_certified_outer_envelop_self_training", 0.25, 2.25, 0.25, best_cifar10_selftraining)
latex_table_certified_accuracy_upper_envelope(
"analysis/latex_new/our_cifar10_certified_outer_envelop_pretraining", 0.25, 2.25, 0.25, best_cifar10_pretraining)
latex_table_certified_accuracy_upper_envelope(
"analysis/latex_new/our_cifar10_certified_outer_envelop_pretraining_Custom", 0.4347, 0.5, 0.25, best_cifar10_pretraining)
latex_table_certified_accuracy_upper_envelope(
"analysis/latex_new/our_cifar10_certified_outer_envelop_pretraining_self_training", 0.25, 2.25, 0.25, best_cifar10_pretraining_selftraining)
radii_to_best_models(
"analysis/radii_to_best_models/cifar10_original",
all_cifar_cohen_fulldataset, max_radius=2.25, radius_step=0.125)
radii_to_best_models(
"analysis/radii_to_best_models/cifar10_ours",
best_cifar10, max_radius=2.25, radius_step=0.125)
radii_to_best_models(
"analysis/radii_to_best_models/cifar10_ours_pretraining",
best_cifar10_pretraining, max_radius=2.25, radius_step=0.125)
radii_to_best_models(
"analysis/radii_to_best_models/cifar10_ours_pretraining_selftraining",
best_cifar10_pretraining_selftraining, max_radius=2.25, radius_step=0.125)
radii_to_best_models(
"analysis/radii_to_best_models/cifar10_ours_selftraining",
best_cifar10_selftraining, max_radius=2.25, radius_step=0.125)
radii_to_best_models(
"analysis/radii_to_best_models/imagenet_original",
all_imagenet_cohen_500samples, max_radius=3.5, radius_step=0.125)
radii_to_best_models(
"analysis/radii_to_best_models/imagenet_ours",
all_imagenet_experiments_500samples, max_radius=3.5, radius_step=0.125)
exit()
# Latex
latex_table_certified_accuracy(
"analysis/latex/vary_noise_cifar10_cohen", 0.25, 1.5, 0.25, all_cifar_cohen)
latex_table_certified_accuracy(
"analysis/latex/vary_noise_imagenet_cohen", 0.5, 3.5, 0.5, all_imagenet_cohen)
latex_table_certified_accuracy_upper_envelope(
"analysis/latex/cohen_cifar10_certified_outer_envelop", 0.25, 2.25, 0.25, all_cifar_cohen)
latex_table_certified_accuracy_upper_envelope(
"analysis/latex/cohen_imagenet_certified_outer_envelop", 0.5, 3.5, 0.5, all_imagenet_cohen)
latex_table_certified_accuracy_upper_envelope(
"analysis/latex/our_cifar10_certified_outer_envelop", 0.25, 2.25, 0.25, all_cifar_experiments)
latex_table_certified_accuracy_upper_envelope(
"analysis/latex/our_imagenet_certified_outer_envelop", 0.5, 3.5, 0.5, all_imagenet_experiments)
latex_table_certified_accuracy_upper_envelope(
"analysis/latex/our_cifar10_certified_outer_envelop_self_training", 0.25, 2.25, 0.25, PGD_self_training)
latex_table_certified_accuracy_upper_envelope(
"analysis/latex/our_cifar10_certified_outer_envelop_pretraining", 0.25, 2.25, 0.25, PGD_imagenetPretraining_cifar10Fineuning)
latex_table_certified_accuracy_upper_envelope(
"analysis/latex/our_cifar10_certified_outer_envelop_pretraining_Custom", 0.4347, 0.5, 0.25, PGD_imagenetPretraining_cifar10Fineuning)
latex_table_certified_accuracy_upper_envelope(
"analysis/latex/our_cifar10_certified_outer_envelop_pretraining_self_training", 0.25, 2.25, 0.25, PGD_imagenetPretraining_cifar10Fineuning_self_training)
latex_table_certified_accuracy(
"analysis/latex/vary_noise_imagenet_PGD_and_DDN", 0.0, 3.5, 0.5, all_imagenet_cohen + all_imagenet_experiments)
#### PGD and DDN varying steps results
## PGD/DDN 2 step 1 sample vs Cohen's
latex_table_certified_accuracy(
"analysis/latex/vary_noise_cifar10_PGD_DDN_2steps", 0.0, 2.25, 0.25, all_cifar_cohen + PGD_2steps + DDN_2steps)
## PGD/DDN 4 step 1 sample vs Cohen's
latex_table_certified_accuracy(
"analysis/latex/vary_noise_cifar10_PGD_DDN_4steps", 0.0, 2.25, 0.25, all_cifar_cohen + PGD_4steps + DDN_4steps)
## PGD/DDN 6 step 1 sample vs Cohen's
latex_table_certified_accuracy(
"analysis/latex/vary_noise_cifar10_PGD_DDN_6steps", 0.0, 2.25, 0.25, all_cifar_cohen + PGD_6steps + DDN_6steps)
## PGD/DDN 8 step 1 sample vs Cohen's
latex_table_certified_accuracy(
"analysis/latex/vary_noise_cifar10_PGD_DDN_8steps", 0.0, 2.25, 0.25, all_cifar_cohen + PGD_8steps + DDN_8steps)
## PGD/DDN 10 step 1 sample vs Cohen's
latex_table_certified_accuracy(
"analysis/latex/vary_noise_cifar10_PGD_DDN_10steps", 0.0, 2.25, 0.25, all_cifar_cohen + PGD_10steps + DDN_10steps)
#### DDN varying number of samples
## DDN 4 step 2/4/8/16 sample vs Cohen's
latex_table_certified_accuracy(
"analysis/latex/vary_noise_cifar10_DDN_4steps_multinoise", 0.0, 2.25, 0.25, all_cifar_cohen + DDN_4steps + DDN_4_steps_2_samples + DDN_4_steps_4_samples + DDN_4_steps_8_samples)
## DDN 10 step 2/4/8 sample vs Cohen's
latex_table_certified_accuracy(
"analysis/latex/vary_noise_cifar10_DDN_10steps_multinoise", 0.0, 2.25, 0.25, all_cifar_cohen + DDN_10steps + DDN_10_steps_2_samples + DDN_10_steps_4_samples + DDN_10_steps_8_samples)
#### PGD varying number of samples
## PGD 2 step 2/4/8 sample vs Cohen's
latex_table_certified_accuracy(
"analysis/latex/vary_noise_cifar10_PGD_2steps_multinoise", 0.0, 2.25, 0.25, all_cifar_cohen + PGD_2steps + PGD_2_steps_2_samples + PGD_2_steps_4_samples + PGD_2_steps_8_samples)
## PGD 4 step 2/4/8 sample vs Cohen's
latex_table_certified_accuracy(
"analysis/latex/vary_noise_cifar10_PGD_4steps_multinoise", 0.0, 2.25, 0.25, all_cifar_cohen + PGD_4steps + PGD_4_steps_2_samples + PGD_4_steps_4_samples + PGD_4_steps_8_samples)
## PGD 10 step 2/4/8 sample vs Cohen's
latex_table_certified_accuracy(
"analysis/latex/vary_noise_cifar10_PGD_10steps_multinoise", 0.0, 2.25, 0.25, all_cifar_cohen + PGD_10steps + PGD_10_steps_2_samples + PGD_10_steps_4_samples + PGD_10_steps_8_samples)
################### PLOTS
# Paper plots
plot_empirical_accuracy_vary_N(
"analysis/plots/paper_figures/cohen_empirical_vary_N",
None, 2.25,
methods_certified=all_cifar_cohen,
methods_empirical=[
'data/predict/predict_cifar_cohen/N100',
'data/predict/predict_cifar_cohen/N1000',
'data/predict/predict_cifar_cohen/N10000',
'data/predict/predict_cifar_cohen/N100000',
])
plot_empirical_accuracy_nograd_trick(
"analysis/plots/paper_figures/cohen_empirical_nograd_trick",
None, 2.25,
methods_certified=all_cifar_cohen,
methods_empirical= 'data/predict/predict_cifar_cohen/N10000',
methods_empirical_nograd_trick='data/predict/predict_cifar_cohen/N10000_nogradtrick')
plot_empirical_accuracy_vary_N(
"analysis/plots/paper_figures/ours_empirical_vary_N",
None, 2.25,
methods_certified=all_cifar_experiments,
methods_empirical=[
'data/predict/predict_cifar_ours/N100',
'data/predict/predict_cifar_ours/N1000',
'data/predict/predict_cifar_ours/N10000',
'data/predict/predict_cifar_ours/N100000',
])
plot_empirical_accuracy_upper_envelopes_vary_num_samples_during_attack(
"analysis/plots/paper_figures/cohen_vary_samples_during_attack",
None, 2.25,
methods_certified=all_cifar_cohen,
methods_empirical='data/predict/predict_cifar_cohen/N10000',
)
plot_empirical_accuracy_upper_envelopes_vary_num_samples_during_attack(
"analysis/plots/paper_figures/ours_vary_samples_during_attack",
None, 2.25,
methods_certified=all_cifar_experiments,
methods_empirical='data/predict/predict_cifar_ours/N100000',
)
plot_certified_accuracy_upper_envelopes(
"analysis/plots/paper_figures/our_vs_cohen_certified_and_empirical_cifar",
None, 2.25,
methods_certified_ours=all_cifar_experiments,
methods_empirical_ours= 'data/predict/predict_cifar_ours/N100000',
methods_certified_cohen=all_cifar_cohen,
methods_empirical_cohen='data/predict/predict_cifar_cohen/N10000',
)
plot_certified_accuracy_upper_envelopes_all_methods(
"analysis/plots/paper_figures/our_vs_cohen_certified_and_empirical_cifar_all_methods",
None, 2.25,
methods_certified_ours=all_cifar_experiments,
methods_certified_ours_pretrain = PGD_imagenetPretraining_cifar10Fineuning,
methods_certified_ours_semisuper = PGD_self_training,
methods_certified_ours_pretrain_semisuper = PGD_imagenetPretraining_cifar10Fineuning_self_training,
methods_certified_cohen=all_cifar_cohen,
)
plot_certified_accuracy_upper_envelopes_vary_eps(
"analysis/plots/paper_figures/our_vs_cohen_certified_vary_epsilon",
None, 2.25,
methods_certified_ours=all_cifar_experiments,
methods_empirical_ours= 'data/predict/predict_cifar_ours/N100000',
methods_certified_cohen=all_cifar_cohen,
methods_empirical_cohen='data/predict/predict_cifar_cohen/N10000',
)
plot_certified_accuracy_upper_envelopes(
"analysis/plots/paper_figures/our_vs_cohen_certified_imagenet",
None, 3.5,
methods_certified_ours=all_imagenet_experiments,
methods_certified_cohen=all_imagenet_cohen_replicate,
)
plot_certified_accuracy_upper_envelopes_vary_m(
"analysis/plots/paper_figures/PGD_DDN_bestSteps_vary_samples",
None, 2.25,
methods_certified_cohen=all_cifar_cohen,
methods_certified_N1=DDN_10steps + DDN_4steps + PGD_2steps + PGD_10steps,
methods_certified_N2=DDN_10_steps_2_samples + DDN_4_steps_2_samples + PGD_2_steps_2_samples + PGD_10_steps_2_samples,
methods_certified_N4=DDN_10_steps_4_samples + DDN_4_steps_4_samples + PGD_2_steps_4_samples + PGD_10_steps_4_samples,
methods_certified_N8=DDN_10_steps_8_samples + DDN_4_steps_8_samples + PGD_2_steps_8_samples + PGD_10_steps_8_samples,
)
plot_certified_accuracy_upper_envelopes_base_vs_ours_vs_cohen(
"analysis/plots/paper_figures/ours_vs_cohen_vs_base",
None, 2.25,
methods_certified_cohen=all_cifar_cohen,
methods_certified_ours=PGD_with_noise_during_attack,
methods_certified_base=PGD_no_noise_during_attack_and_training,
methods_certified_base_with_noise=PGD_no_noise_during_attack,)
plot_certified_accuracy_per_sigma_against_original(
"analysis/plots/paper_figures/vary_noise_cifar_ours_vs_cohen", None, 4,
methods=all_cifar_experiments,
methods_original=all_cifar_cohen)
plot_certified_accuracy_per_sigma_against_original(
"analysis/plots/paper_figures/vary_noise_imagenet_ours_vs_cohen", None, 4,
methods=all_imagenet_experiments,
methods_original=all_imagenet_cohen_replicate)
plot_certified_accuracy_per_sigma_against_original_one_sample(
"analysis/plots/paper_figures/vary_noise_cifar_ours_vs_cohen_one_sample", None, 4,
methods=[
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_multiNoiseSamples/8-multitrain/eps_255/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_multiNoiseSamples/8-multitrain/eps_255/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_multiNoiseSamples/8-multitrain/eps_255/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/PGD_2steps_multiNoiseSamples/8-multitrain/eps_255/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$"),
],
methods_original=all_cifar_cohen)
plot_certified_accuracy_per_sigma_against_original_one_sample(
"analysis/plots/paper_figures/vary_noise_imagenet_ours_vs_cohen_one_sample", None, 4,
methods=[
Line(ApproximateAccuracy("data/certify/imagenet/PGD_1step/imagenet/eps_255/resnet50/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$", plot_fmt='b'),
Line(ApproximateAccuracy("data/certify/imagenet/PGD_1step/imagenet/eps_255/resnet50/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$", plot_fmt='orange'),
Line(ApproximateAccuracy("data/certify/imagenet/PGD_1step/imagenet/eps_255/resnet50/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$", plot_fmt='g'),
],
methods_original=all_imagenet_cohen_replicate)
plot_certified_accuracy(
"analysis/plots/paper_figures/github_readme_certified", "CIFAR-10, vary $\sigma$", 1.5, [
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/PGD_10steps_30epochs_multinoise/2-multitrain/eps_64/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$"),
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/PGD_10steps_30epochs_multinoise/2-multitrain/eps_64/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$"),
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/PGD_10steps_30epochs_multinoise/2-multitrain/eps_64/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$"),
Line(ApproximateAccuracy("data/certify/cifar10/finetune_cifar_from_imagenetPGD2steps/PGD_10steps_30epochs_multinoise/2-multitrain/eps_64/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$"),
])
#################### Generate Cohen et al. results
latex_table_certified_accuracy(
"analysis/latex/vary_noise_cifar10", 0.25, 1.5, 0.25, [
Line(ApproximateAccuracy("data_cohen/certify/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$"),
Line(ApproximateAccuracy("data_cohen/certify/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$"),
Line(ApproximateAccuracy("data_cohen/certify/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$"),
Line(ApproximateAccuracy("data_cohen/certify/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$"),
])
markdown_table_certified_accuracy(
"analysis/markdown/vary_noise_cifar10", 0.25, 1.5, 0.25, [
Line(ApproximateAccuracy("data_cohen/certify/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "σ = 0.12"),
Line(ApproximateAccuracy("data_cohen/certify/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "σ = 0.25"),
Line(ApproximateAccuracy("data_cohen/certify/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "σ = 0.50"),
Line(ApproximateAccuracy("data_cohen/certify/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "σ = 1.00"),
])
latex_table_certified_accuracy(
"analysis/latex/vary_noise_imagenet", 0.5, 3.0, 0.5, [
Line(ApproximateAccuracy("data_cohen/certify/imagenet/resnet50/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$"),
Line(ApproximateAccuracy("data_cohen/certify/imagenet/resnet50/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$"),
Line(ApproximateAccuracy("data_cohen/certify/imagenet/resnet50/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$"),
])
markdown_table_certified_accuracy(
"analysis/markdown/vary_noise_imagenet", 0.5, 3.0, 0.5, [
Line(ApproximateAccuracy("data_cohen/certify/imagenet/resnet50/noise_0.25/test/sigma_0.25"), "σ = 0.25"),
Line(ApproximateAccuracy("data_cohen/certify/imagenet/resnet50/noise_0.50/test/sigma_0.50"), "σ = 0.50"),
Line(ApproximateAccuracy("data_cohen/certify/imagenet/resnet50/noise_1.00/test/sigma_1.00"), "σ = 1.00"),
])
plot_certified_accuracy(
"analysis/plots/cohen_figures/vary_noise_cifar10", "CIFAR-10, vary $\sigma$", 1.5, [
Line(ApproximateAccuracy("data_cohen/certify/cifar10/resnet110/noise_0.12/test/sigma_0.12"), "$\sigma = 0.12$"),
Line(ApproximateAccuracy("data_cohen/certify/cifar10/resnet110/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$"),
Line(ApproximateAccuracy("data_cohen/certify/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$"),
Line(ApproximateAccuracy("data_cohen/certify/cifar10/resnet110/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$"),
])
plot_certified_accuracy(
"analysis/plots/cohen_figures/vary_train_noise_cifar_050", "CIFAR-10, vary train noise, $\sigma=0.5$", 1.5, [
Line(ApproximateAccuracy("data_cohen/certify/cifar10/resnet110/noise_0.25/test/sigma_0.50"), "train $\sigma = 0.25$"),
Line(ApproximateAccuracy("data_cohen/certify/cifar10/resnet110/noise_0.50/test/sigma_0.50"), "train $\sigma = 0.50$"),
Line(ApproximateAccuracy("data_cohen/certify/cifar10/resnet110/noise_1.00/test/sigma_0.50"), "train $\sigma = 1.00$"),
])
plot_certified_accuracy(
"analysis/plots/cohen_figures/vary_train_noise_imagenet_050", "ImageNet, vary train noise, $\sigma=0.5$", 1.5, [
Line(ApproximateAccuracy("data_cohen/certify/imagenet/resnet50/noise_0.25/test/sigma_0.50"), "train $\sigma = 0.25$"),
Line(ApproximateAccuracy("data_cohen/certify/imagenet/resnet50/noise_0.50/test/sigma_0.50"), "train $\sigma = 0.50$"),
Line(ApproximateAccuracy("data_cohen/certify/imagenet/resnet50/noise_1.00/test/sigma_0.50"), "train $\sigma = 1.00$"),
])
plot_certified_accuracy(
"analysis/plots/cohen_figures/vary_noise_imagenet", "ImageNet, vary $\sigma$", 4, [
Line(ApproximateAccuracy("data_cohen/certify/imagenet/resnet50/noise_0.25/test/sigma_0.25"), "$\sigma = 0.25$"),
Line(ApproximateAccuracy("data_cohen/certify/imagenet/resnet50/noise_0.50/test/sigma_0.50"), "$\sigma = 0.50$"),
Line(ApproximateAccuracy("data_cohen/certify/imagenet/resnet50/noise_1.00/test/sigma_1.00"), "$\sigma = 1.00$"),
])
plot_certified_accuracy(
"analysis/plots/cohen_figures/high_prob", "Approximate vs. High-Probability", 2.0, [
Line(ApproximateAccuracy("data_cohen/certify/imagenet/resnet50/noise_0.50/test/sigma_0.50"), "Approximate"),
Line(HighProbAccuracy("data_cohen/certify/imagenet/resnet50/noise_0.50/test/sigma_0.50", 0.001, 0.001), "High-Prob"),
])
| 88.240038
| 257
| 0.727762
| 26,221
| 186,010
| 4.91606
| 0.013348
| 0.049013
| 0.155627
| 0.186744
| 0.964291
| 0.954935
| 0.947379
| 0.939234
| 0.935526
| 0.923804
| 0
| 0.107302
| 0.109483
| 186,010
| 2,108
| 258
| 88.240038
| 0.670893
| 0.007806
| 0
| 0.36715
| 0
| 0.425121
| 0.601769
| 0.475228
| 0.001208
| 0
| 0
| 0
| 0.001208
| 1
| 0.01872
| false
| 0
| 0.005435
| 0.001208
| 0.032005
| 0.002415
| 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
| 1
| 1
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 10
|
b94eff1d279762ee44b40b0faf157d4917690078
| 2,323
|
py
|
Python
|
project/nodes.py
|
SagarSikchi/Math-Interpreter-using-Python
|
84d014cd72dde69aa82040933783a7f6629b820b
|
[
"MIT"
] | 2
|
2021-01-19T10:11:29.000Z
|
2021-07-14T17:38:27.000Z
|
project/nodes.py
|
SagarSikchi/Math-Interpreter-using-Python
|
84d014cd72dde69aa82040933783a7f6629b820b
|
[
"MIT"
] | null | null | null |
project/nodes.py
|
SagarSikchi/Math-Interpreter-using-Python
|
84d014cd72dde69aa82040933783a7f6629b820b
|
[
"MIT"
] | null | null | null |
from dataclasses import dataclass
@dataclass
class NumberNode:
value: float
def __repr__(self):
try:
return f"{self.value}"
except:
# raise Exception("Error in Calculation")
return "Error in TreeNode"
@dataclass
class AddNode:
node_a: any
node_b: any
def __repr__(self):
try:
return f"({self.node_a}+{self.node_b})"
except:
# raise Exception("Error in Calculation")
return "Error in TreeNode"
@dataclass
class SubtractNode:
node_a: any
node_b: any
def __repr__(self):
try:
return f"({self.node_a}-{self.node_b})"
except:
# raise Exception("Error in Calculation")
return "Error in TreeNode"
@dataclass
class MultiplyNode:
node_a: any
node_b: any
def __repr__(self):
try:
return f"({self.node_a}*{self.node_b})"
except:
# raise Exception("Error in Calculation")
return "Error in TreeNode"
@dataclass
class DivideNode:
node_a: any
node_b: any
def __repr__(self):
try:
return f"({self.node_a}/{self.node_b})"
except:
# raise Exception("Error in Calculation")
return "Error in TreeNode"
@dataclass
class ModuloNode:
node_a: any
node_b: any
def __repr__(self):
try:
return f"({self.node_a}%{self.node_b})"
except:
# raise Exception("Error in Calculation")
return "Error in TreeNode"
@dataclass
class ExponentNode:
node_a: any
node_b: any
def __repr__(self):
try:
return f"({self.node_a}^{self.node_b})"
except:
# raise Exception("Error in Calculation")
return "Error in TreeNode"
@dataclass
class PlusNode:
node_t: any
def __repr__(self):
try:
return f"(+{self.node})"
except:
# raise Exception("Error in Calculation")
return "Error in TreeNode"
@dataclass
class MinusNode:
node_t: any
def __repr__(self):
try:
return f"(-{self.node})"
except:
# raise Exception("Error in Calculation")
return "Error in TreeNode"
| 21.509259
| 53
| 0.552303
| 261
| 2,323
| 4.678161
| 0.130268
| 0.103194
| 0.081081
| 0.103194
| 0.877969
| 0.877969
| 0.877969
| 0.857494
| 0.857494
| 0.857494
| 0
| 0
| 0.349548
| 2,323
| 107
| 54
| 21.71028
| 0.808074
| 0.154542
| 0
| 0.746835
| 0
| 0
| 0.187916
| 0.089094
| 0
| 0
| 0
| 0
| 0
| 1
| 0.113924
| false
| 0
| 0.012658
| 0
| 0.658228
| 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
| 1
| 0
|
0
| 8
|
b9d4a52b57219b13d38dc9dcb0ed8be1142e288c
| 156,290
|
py
|
Python
|
sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/operations/_runs_operations.py
|
dubiety/azure-sdk-for-python
|
62ffa839f5d753594cf0fe63668f454a9d87a346
|
[
"MIT"
] | 1
|
2022-02-01T18:50:12.000Z
|
2022-02-01T18:50:12.000Z
|
sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/operations/_runs_operations.py
|
ellhe-blaster/azure-sdk-for-python
|
82193ba5e81cc5e5e5a5239bba58abe62e86f469
|
[
"MIT"
] | null | null | null |
sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/runhistory/operations/_runs_operations.py
|
ellhe-blaster/azure-sdk-for-python
|
82193ba5e81cc5e5e5a5239bba58abe62e86f469
|
[
"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.
# --------------------------------------------------------------------------
import functools
from typing import TYPE_CHECKING
import warnings
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import HttpResponse
from azure.core.rest import HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.mgmt.core.exceptions import ARMErrorFormat
from msrest import Serializer
from .. import models as _models
from .._vendor import _convert_request, _format_url_section
if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from typing import Any, Callable, Dict, Generic, Iterable, List, Optional, TypeVar, Union
T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
_SERIALIZER = Serializer()
_SERIALIZER.client_side_validation = False
# fmt: off
def build_get_child_by_experiment_name_request(
subscription_id, # type: str
resource_group_name, # type: str
workspace_name, # type: str
run_id, # type: str
experiment_name, # type: str
**kwargs # type: Any
):
# type: (...) -> HttpRequest
filter = kwargs.pop('filter', None) # type: Optional[str]
continuationtoken = kwargs.pop('continuationtoken', None) # type: Optional[str]
orderby = kwargs.pop('orderby', None) # type: Optional[List[str]]
sortorder = kwargs.pop('sortorder', None) # type: Optional[Union[str, "_models.SortOrderDirection"]]
top = kwargs.pop('top', None) # type: Optional[int]
count = kwargs.pop('count', None) # type: Optional[bool]
accept = "application/json"
# Construct URL
url = kwargs.pop("template_url", '/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/children')
path_format_arguments = {
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'),
"runId": _SERIALIZER.url("run_id", run_id, 'str'),
"experimentName": _SERIALIZER.url("experiment_name", experiment_name, 'str'),
}
url = _format_url_section(url, **path_format_arguments)
# Construct parameters
query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
if filter is not None:
query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str')
if continuationtoken is not None:
query_parameters['$continuationtoken'] = _SERIALIZER.query("continuationtoken", continuationtoken, 'str')
if orderby is not None:
query_parameters['$orderby'] = _SERIALIZER.query("orderby", orderby, '[str]')
if sortorder is not None:
query_parameters['$sortorder'] = _SERIALIZER.query("sortorder", sortorder, 'str')
if top is not None:
query_parameters['$top'] = _SERIALIZER.query("top", top, 'int')
if count is not None:
query_parameters['$count'] = _SERIALIZER.query("count", count, 'bool')
# Construct headers
header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=url,
params=query_parameters,
headers=header_parameters,
**kwargs
)
def build_get_child_by_experiment_id_request(
subscription_id, # type: str
resource_group_name, # type: str
workspace_name, # type: str
run_id, # type: str
experiment_id, # type: str
**kwargs # type: Any
):
# type: (...) -> HttpRequest
filter = kwargs.pop('filter', None) # type: Optional[str]
continuationtoken = kwargs.pop('continuationtoken', None) # type: Optional[str]
orderby = kwargs.pop('orderby', None) # type: Optional[List[str]]
sortorder = kwargs.pop('sortorder', None) # type: Optional[Union[str, "_models.SortOrderDirection"]]
top = kwargs.pop('top', None) # type: Optional[int]
count = kwargs.pop('count', None) # type: Optional[bool]
accept = "application/json"
# Construct URL
url = kwargs.pop("template_url", '/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/children')
path_format_arguments = {
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'),
"runId": _SERIALIZER.url("run_id", run_id, 'str'),
"experimentId": _SERIALIZER.url("experiment_id", experiment_id, 'str'),
}
url = _format_url_section(url, **path_format_arguments)
# Construct parameters
query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
if filter is not None:
query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str')
if continuationtoken is not None:
query_parameters['$continuationtoken'] = _SERIALIZER.query("continuationtoken", continuationtoken, 'str')
if orderby is not None:
query_parameters['$orderby'] = _SERIALIZER.query("orderby", orderby, '[str]')
if sortorder is not None:
query_parameters['$sortorder'] = _SERIALIZER.query("sortorder", sortorder, 'str')
if top is not None:
query_parameters['$top'] = _SERIALIZER.query("top", top, 'int')
if count is not None:
query_parameters['$count'] = _SERIALIZER.query("count", count, 'bool')
# Construct headers
header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=url,
params=query_parameters,
headers=header_parameters,
**kwargs
)
def build_get_child_request(
subscription_id, # type: str
resource_group_name, # type: str
workspace_name, # type: str
run_id, # type: str
**kwargs # type: Any
):
# type: (...) -> HttpRequest
filter = kwargs.pop('filter', None) # type: Optional[str]
continuationtoken = kwargs.pop('continuationtoken', None) # type: Optional[str]
orderby = kwargs.pop('orderby', None) # type: Optional[List[str]]
sortorder = kwargs.pop('sortorder', None) # type: Optional[Union[str, "_models.SortOrderDirection"]]
top = kwargs.pop('top', None) # type: Optional[int]
count = kwargs.pop('count', None) # type: Optional[bool]
accept = "application/json"
# Construct URL
url = kwargs.pop("template_url", '/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/children')
path_format_arguments = {
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'),
"runId": _SERIALIZER.url("run_id", run_id, 'str'),
}
url = _format_url_section(url, **path_format_arguments)
# Construct parameters
query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
if filter is not None:
query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str')
if continuationtoken is not None:
query_parameters['$continuationtoken'] = _SERIALIZER.query("continuationtoken", continuationtoken, 'str')
if orderby is not None:
query_parameters['$orderby'] = _SERIALIZER.query("orderby", orderby, '[str]')
if sortorder is not None:
query_parameters['$sortorder'] = _SERIALIZER.query("sortorder", sortorder, 'str')
if top is not None:
query_parameters['$top'] = _SERIALIZER.query("top", top, 'int')
if count is not None:
query_parameters['$count'] = _SERIALIZER.query("count", count, 'bool')
# Construct headers
header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=url,
params=query_parameters,
headers=header_parameters,
**kwargs
)
def build_get_details_by_experiment_id_request(
subscription_id, # type: str
resource_group_name, # type: str
workspace_name, # type: str
run_id, # type: str
experiment_id, # type: str
**kwargs # type: Any
):
# type: (...) -> HttpRequest
accept = "application/json"
# Construct URL
url = kwargs.pop("template_url", '/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/details')
path_format_arguments = {
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'),
"runId": _SERIALIZER.url("run_id", run_id, 'str'),
"experimentId": _SERIALIZER.url("experiment_id", experiment_id, 'str'),
}
url = _format_url_section(url, **path_format_arguments)
# Construct headers
header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=url,
headers=header_parameters,
**kwargs
)
def build_get_details_by_experiment_name_request(
subscription_id, # type: str
resource_group_name, # type: str
workspace_name, # type: str
run_id, # type: str
experiment_name, # type: str
**kwargs # type: Any
):
# type: (...) -> HttpRequest
accept = "application/json"
# Construct URL
url = kwargs.pop("template_url", '/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/details')
path_format_arguments = {
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'),
"runId": _SERIALIZER.url("run_id", run_id, 'str'),
"experimentName": _SERIALIZER.url("experiment_name", experiment_name, 'str'),
}
url = _format_url_section(url, **path_format_arguments)
# Construct headers
header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=url,
headers=header_parameters,
**kwargs
)
def build_get_details_request(
subscription_id, # type: str
resource_group_name, # type: str
workspace_name, # type: str
run_id, # type: str
**kwargs # type: Any
):
# type: (...) -> HttpRequest
accept = "application/json"
# Construct URL
url = kwargs.pop("template_url", '/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/details')
path_format_arguments = {
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'),
"runId": _SERIALIZER.url("run_id", run_id, 'str'),
}
url = _format_url_section(url, **path_format_arguments)
# Construct headers
header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=url,
headers=header_parameters,
**kwargs
)
def build_get_run_data_request(
subscription_id, # type: str
resource_group_name, # type: str
workspace_name, # type: str
**kwargs # type: Any
):
# type: (...) -> HttpRequest
content_type = kwargs.pop('content_type', None) # type: Optional[str]
accept = "application/json"
# Construct URL
url = kwargs.pop("template_url", '/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/rundata')
path_format_arguments = {
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'),
}
url = _format_url_section(url, **path_format_arguments)
# Construct headers
header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="POST",
url=url,
headers=header_parameters,
**kwargs
)
def build_batch_get_run_data_request(
subscription_id, # type: str
resource_group_name, # type: str
workspace_name, # type: str
**kwargs # type: Any
):
# type: (...) -> HttpRequest
content_type = kwargs.pop('content_type', None) # type: Optional[str]
accept = "application/json"
# Construct URL
url = kwargs.pop("template_url", '/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchrundata')
path_format_arguments = {
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'),
}
url = _format_url_section(url, **path_format_arguments)
# Construct headers
header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="POST",
url=url,
headers=header_parameters,
**kwargs
)
def build_batch_add_or_modify_by_experiment_id_request(
subscription_id, # type: str
resource_group_name, # type: str
workspace_name, # type: str
experiment_id, # type: str
**kwargs # type: Any
):
# type: (...) -> HttpRequest
content_type = kwargs.pop('content_type', None) # type: Optional[str]
accept = "application/json"
# Construct URL
url = kwargs.pop("template_url", '/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/batch/runs')
path_format_arguments = {
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'),
"experimentId": _SERIALIZER.url("experiment_id", experiment_id, 'str'),
}
url = _format_url_section(url, **path_format_arguments)
# Construct headers
header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="PATCH",
url=url,
headers=header_parameters,
**kwargs
)
def build_batch_add_or_modify_by_experiment_name_request(
subscription_id, # type: str
resource_group_name, # type: str
workspace_name, # type: str
experiment_name, # type: str
**kwargs # type: Any
):
# type: (...) -> HttpRequest
content_type = kwargs.pop('content_type', None) # type: Optional[str]
accept = "application/json"
# Construct URL
url = kwargs.pop("template_url", '/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/batch/runs')
path_format_arguments = {
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'),
"experimentName": _SERIALIZER.url("experiment_name", experiment_name, 'str'),
}
url = _format_url_section(url, **path_format_arguments)
# Construct headers
header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="PATCH",
url=url,
headers=header_parameters,
**kwargs
)
def build_add_or_modify_by_experiment_name_request(
subscription_id, # type: str
resource_group_name, # type: str
workspace_name, # type: str
run_id, # type: str
experiment_name, # type: str
**kwargs # type: Any
):
# type: (...) -> HttpRequest
content_type = kwargs.pop('content_type', None) # type: Optional[str]
accept = "application/json"
# Construct URL
url = kwargs.pop("template_url", '/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}')
path_format_arguments = {
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'),
"runId": _SERIALIZER.url("run_id", run_id, 'str', pattern=r'^[a-zA-Z0-9][\w-]{0,255}$'),
"experimentName": _SERIALIZER.url("experiment_name", experiment_name, 'str'),
}
url = _format_url_section(url, **path_format_arguments)
# Construct headers
header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="PATCH",
url=url,
headers=header_parameters,
**kwargs
)
def build_get_by_experiment_name_request(
subscription_id, # type: str
resource_group_name, # type: str
workspace_name, # type: str
run_id, # type: str
experiment_name, # type: str
**kwargs # type: Any
):
# type: (...) -> HttpRequest
accept = "application/json"
# Construct URL
url = kwargs.pop("template_url", '/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}')
path_format_arguments = {
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'),
"runId": _SERIALIZER.url("run_id", run_id, 'str'),
"experimentName": _SERIALIZER.url("experiment_name", experiment_name, 'str'),
}
url = _format_url_section(url, **path_format_arguments)
# Construct headers
header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=url,
headers=header_parameters,
**kwargs
)
def build_add_or_modify_by_experiment_id_request(
subscription_id, # type: str
resource_group_name, # type: str
workspace_name, # type: str
run_id, # type: str
experiment_id, # type: str
**kwargs # type: Any
):
# type: (...) -> HttpRequest
content_type = kwargs.pop('content_type', None) # type: Optional[str]
accept = "application/json"
# Construct URL
url = kwargs.pop("template_url", '/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}')
path_format_arguments = {
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'),
"runId": _SERIALIZER.url("run_id", run_id, 'str', pattern=r'^[a-zA-Z0-9][\w-]{0,255}$'),
"experimentId": _SERIALIZER.url("experiment_id", experiment_id, 'str'),
}
url = _format_url_section(url, **path_format_arguments)
# Construct headers
header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="PATCH",
url=url,
headers=header_parameters,
**kwargs
)
def build_get_by_experiment_id_request(
subscription_id, # type: str
resource_group_name, # type: str
workspace_name, # type: str
run_id, # type: str
experiment_id, # type: str
**kwargs # type: Any
):
# type: (...) -> HttpRequest
accept = "application/json"
# Construct URL
url = kwargs.pop("template_url", '/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}')
path_format_arguments = {
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'),
"runId": _SERIALIZER.url("run_id", run_id, 'str'),
"experimentId": _SERIALIZER.url("experiment_id", experiment_id, 'str'),
}
url = _format_url_section(url, **path_format_arguments)
# Construct headers
header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=url,
headers=header_parameters,
**kwargs
)
def build_add_or_modify_experiment_request(
subscription_id, # type: str
resource_group_name, # type: str
workspace_name, # type: str
run_id, # type: str
**kwargs # type: Any
):
# type: (...) -> HttpRequest
content_type = kwargs.pop('content_type', None) # type: Optional[str]
accept = "application/json"
# Construct URL
url = kwargs.pop("template_url", '/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}')
path_format_arguments = {
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'),
"runId": _SERIALIZER.url("run_id", run_id, 'str', pattern=r'^[a-zA-Z0-9][\w-]{0,255}$'),
}
url = _format_url_section(url, **path_format_arguments)
# Construct headers
header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="PATCH",
url=url,
headers=header_parameters,
**kwargs
)
def build_add_request(
subscription_id, # type: str
resource_group_name, # type: str
workspace_name, # type: str
run_id, # type: str
**kwargs # type: Any
):
# type: (...) -> HttpRequest
content_type = kwargs.pop('content_type', None) # type: Optional[str]
accept = "application/json"
# Construct URL
url = kwargs.pop("template_url", '/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}')
path_format_arguments = {
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'),
"runId": _SERIALIZER.url("run_id", run_id, 'str', pattern=r'^[a-zA-Z0-9][\w-]{0,255}$'),
}
url = _format_url_section(url, **path_format_arguments)
# Construct headers
header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="POST",
url=url,
headers=header_parameters,
**kwargs
)
def build_get_request(
subscription_id, # type: str
resource_group_name, # type: str
workspace_name, # type: str
run_id, # type: str
**kwargs # type: Any
):
# type: (...) -> HttpRequest
accept = "application/json"
# Construct URL
url = kwargs.pop("template_url", '/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}')
path_format_arguments = {
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'),
"runId": _SERIALIZER.url("run_id", run_id, 'str'),
}
url = _format_url_section(url, **path_format_arguments)
# Construct headers
header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="GET",
url=url,
headers=header_parameters,
**kwargs
)
def build_delete_tags_by_experiment_id_request(
subscription_id, # type: str
resource_group_name, # type: str
workspace_name, # type: str
run_id, # type: str
experiment_id, # type: str
**kwargs # type: Any
):
# type: (...) -> HttpRequest
content_type = kwargs.pop('content_type', None) # type: Optional[str]
accept = "application/json"
# Construct URL
url = kwargs.pop("template_url", '/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/tags')
path_format_arguments = {
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'),
"runId": _SERIALIZER.url("run_id", run_id, 'str'),
"experimentId": _SERIALIZER.url("experiment_id", experiment_id, 'str'),
}
url = _format_url_section(url, **path_format_arguments)
# Construct headers
header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="DELETE",
url=url,
headers=header_parameters,
**kwargs
)
def build_modify_or_delete_tags_by_experiment_id_request(
subscription_id, # type: str
resource_group_name, # type: str
workspace_name, # type: str
run_id, # type: str
experiment_id, # type: str
**kwargs # type: Any
):
# type: (...) -> HttpRequest
content_type = kwargs.pop('content_type', None) # type: Optional[str]
accept = "application/json"
# Construct URL
url = kwargs.pop("template_url", '/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/tags')
path_format_arguments = {
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'),
"runId": _SERIALIZER.url("run_id", run_id, 'str'),
"experimentId": _SERIALIZER.url("experiment_id", experiment_id, 'str'),
}
url = _format_url_section(url, **path_format_arguments)
# Construct headers
header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="PATCH",
url=url,
headers=header_parameters,
**kwargs
)
def build_delete_tags_by_experiment_name_request(
subscription_id, # type: str
resource_group_name, # type: str
workspace_name, # type: str
run_id, # type: str
experiment_name, # type: str
**kwargs # type: Any
):
# type: (...) -> HttpRequest
content_type = kwargs.pop('content_type', None) # type: Optional[str]
accept = "application/json"
# Construct URL
url = kwargs.pop("template_url", '/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/tags')
path_format_arguments = {
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'),
"runId": _SERIALIZER.url("run_id", run_id, 'str'),
"experimentName": _SERIALIZER.url("experiment_name", experiment_name, 'str'),
}
url = _format_url_section(url, **path_format_arguments)
# Construct headers
header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="DELETE",
url=url,
headers=header_parameters,
**kwargs
)
def build_modify_or_delete_tags_by_experiment_name_request(
subscription_id, # type: str
resource_group_name, # type: str
workspace_name, # type: str
run_id, # type: str
experiment_name, # type: str
**kwargs # type: Any
):
# type: (...) -> HttpRequest
content_type = kwargs.pop('content_type', None) # type: Optional[str]
accept = "application/json"
# Construct URL
url = kwargs.pop("template_url", '/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/tags')
path_format_arguments = {
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'),
"runId": _SERIALIZER.url("run_id", run_id, 'str'),
"experimentName": _SERIALIZER.url("experiment_name", experiment_name, 'str'),
}
url = _format_url_section(url, **path_format_arguments)
# Construct headers
header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="PATCH",
url=url,
headers=header_parameters,
**kwargs
)
def build_delete_tags_request(
subscription_id, # type: str
resource_group_name, # type: str
workspace_name, # type: str
run_id, # type: str
**kwargs # type: Any
):
# type: (...) -> HttpRequest
content_type = kwargs.pop('content_type', None) # type: Optional[str]
accept = "application/json"
# Construct URL
url = kwargs.pop("template_url", '/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/tags')
path_format_arguments = {
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'),
"runId": _SERIALIZER.url("run_id", run_id, 'str'),
}
url = _format_url_section(url, **path_format_arguments)
# Construct headers
header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="DELETE",
url=url,
headers=header_parameters,
**kwargs
)
def build_delete_run_services_by_experiment_id_request(
subscription_id, # type: str
resource_group_name, # type: str
workspace_name, # type: str
run_id, # type: str
experiment_id, # type: str
**kwargs # type: Any
):
# type: (...) -> HttpRequest
content_type = kwargs.pop('content_type', None) # type: Optional[str]
accept = "application/json"
# Construct URL
url = kwargs.pop("template_url", '/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/services')
path_format_arguments = {
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'),
"runId": _SERIALIZER.url("run_id", run_id, 'str'),
"experimentId": _SERIALIZER.url("experiment_id", experiment_id, 'str'),
}
url = _format_url_section(url, **path_format_arguments)
# Construct headers
header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="DELETE",
url=url,
headers=header_parameters,
**kwargs
)
def build_delete_run_services_by_experiment_name_request(
subscription_id, # type: str
resource_group_name, # type: str
workspace_name, # type: str
run_id, # type: str
experiment_name, # type: str
**kwargs # type: Any
):
# type: (...) -> HttpRequest
content_type = kwargs.pop('content_type', None) # type: Optional[str]
accept = "application/json"
# Construct URL
url = kwargs.pop("template_url", '/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/services')
path_format_arguments = {
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'),
"runId": _SERIALIZER.url("run_id", run_id, 'str'),
"experimentName": _SERIALIZER.url("experiment_name", experiment_name, 'str'),
}
url = _format_url_section(url, **path_format_arguments)
# Construct headers
header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="DELETE",
url=url,
headers=header_parameters,
**kwargs
)
def build_delete_run_services_request(
subscription_id, # type: str
resource_group_name, # type: str
workspace_name, # type: str
run_id, # type: str
**kwargs # type: Any
):
# type: (...) -> HttpRequest
content_type = kwargs.pop('content_type', None) # type: Optional[str]
accept = "application/json"
# Construct URL
url = kwargs.pop("template_url", '/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/services')
path_format_arguments = {
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'),
"runId": _SERIALIZER.url("run_id", run_id, 'str'),
}
url = _format_url_section(url, **path_format_arguments)
# Construct headers
header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="DELETE",
url=url,
headers=header_parameters,
**kwargs
)
def build_get_by_query_by_experiment_name_request(
subscription_id, # type: str
resource_group_name, # type: str
workspace_name, # type: str
experiment_name, # type: str
**kwargs # type: Any
):
# type: (...) -> HttpRequest
content_type = kwargs.pop('content_type', None) # type: Optional[str]
accept = "application/json"
# Construct URL
url = kwargs.pop("template_url", '/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs:query')
path_format_arguments = {
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'),
"experimentName": _SERIALIZER.url("experiment_name", experiment_name, 'str'),
}
url = _format_url_section(url, **path_format_arguments)
# Construct headers
header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="POST",
url=url,
headers=header_parameters,
**kwargs
)
def build_get_by_query_by_experiment_id_request(
subscription_id, # type: str
resource_group_name, # type: str
workspace_name, # type: str
experiment_id, # type: str
**kwargs # type: Any
):
# type: (...) -> HttpRequest
content_type = kwargs.pop('content_type', None) # type: Optional[str]
accept = "application/json"
# Construct URL
url = kwargs.pop("template_url", '/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs:query')
path_format_arguments = {
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'),
"experimentId": _SERIALIZER.url("experiment_id", experiment_id, 'str'),
}
url = _format_url_section(url, **path_format_arguments)
# Construct headers
header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="POST",
url=url,
headers=header_parameters,
**kwargs
)
def build_get_by_ids_by_experiment_id_request(
subscription_id, # type: str
resource_group_name, # type: str
workspace_name, # type: str
experiment_id, # type: str
**kwargs # type: Any
):
# type: (...) -> HttpRequest
content_type = kwargs.pop('content_type', None) # type: Optional[str]
accept = "application/json"
# Construct URL
url = kwargs.pop("template_url", '/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/runIds')
path_format_arguments = {
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'),
"experimentId": _SERIALIZER.url("experiment_id", experiment_id, 'str'),
}
url = _format_url_section(url, **path_format_arguments)
# Construct headers
header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="POST",
url=url,
headers=header_parameters,
**kwargs
)
def build_get_by_ids_by_experiment_name_request(
subscription_id, # type: str
resource_group_name, # type: str
workspace_name, # type: str
experiment_name, # type: str
**kwargs # type: Any
):
# type: (...) -> HttpRequest
content_type = kwargs.pop('content_type', None) # type: Optional[str]
accept = "application/json"
# Construct URL
url = kwargs.pop("template_url", '/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/runIds')
path_format_arguments = {
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'),
"experimentName": _SERIALIZER.url("experiment_name", experiment_name, 'str'),
}
url = _format_url_section(url, **path_format_arguments)
# Construct headers
header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
if content_type is not None:
header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="POST",
url=url,
headers=header_parameters,
**kwargs
)
def build_cancel_run_with_uri_by_experiment_id_request(
subscription_id, # type: str
resource_group_name, # type: str
workspace_name, # type: str
run_id, # type: str
experiment_id, # type: str
**kwargs # type: Any
):
# type: (...) -> HttpRequest
cancelation_reason = kwargs.pop('cancelation_reason', None) # type: Optional[str]
accept = "application/json"
# Construct URL
url = kwargs.pop("template_url", '/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/cancel')
path_format_arguments = {
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'),
"runId": _SERIALIZER.url("run_id", run_id, 'str'),
"experimentId": _SERIALIZER.url("experiment_id", experiment_id, 'str'),
}
url = _format_url_section(url, **path_format_arguments)
# Construct parameters
query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
if cancelation_reason is not None:
query_parameters['CancelationReason'] = _SERIALIZER.query("cancelation_reason", cancelation_reason, 'str')
# Construct headers
header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="POST",
url=url,
params=query_parameters,
headers=header_parameters,
**kwargs
)
def build_cancel_run_with_uri_by_experiment_name_request(
subscription_id, # type: str
resource_group_name, # type: str
workspace_name, # type: str
run_id, # type: str
experiment_name, # type: str
**kwargs # type: Any
):
# type: (...) -> HttpRequest
cancelation_reason = kwargs.pop('cancelation_reason', None) # type: Optional[str]
accept = "application/json"
# Construct URL
url = kwargs.pop("template_url", '/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/cancel')
path_format_arguments = {
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
"workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'),
"runId": _SERIALIZER.url("run_id", run_id, 'str'),
"experimentName": _SERIALIZER.url("experiment_name", experiment_name, 'str'),
}
url = _format_url_section(url, **path_format_arguments)
# Construct parameters
query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any]
if cancelation_reason is not None:
query_parameters['CancelationReason'] = _SERIALIZER.query("cancelation_reason", cancelation_reason, 'str')
# Construct headers
header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any]
header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
return HttpRequest(
method="POST",
url=url,
params=query_parameters,
headers=header_parameters,
**kwargs
)
# fmt: on
class RunsOperations(object):
"""RunsOperations operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.machinelearningservices.models
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
"""
models = _models
def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self._config = config
@distributed_trace
def get_child_by_experiment_name(
self,
subscription_id, # type: str
resource_group_name, # type: str
workspace_name, # type: str
run_id, # type: str
experiment_name, # type: str
filter=None, # type: Optional[str]
continuationtoken=None, # type: Optional[str]
orderby=None, # type: Optional[List[str]]
sortorder=None, # type: Optional[Union[str, "_models.SortOrderDirection"]]
top=None, # type: Optional[int]
count=None, # type: Optional[bool]
**kwargs # type: Any
):
# type: (...) -> Iterable["_models.PaginatedRunList"]
"""get_child_by_experiment_name.
:param subscription_id: The Azure Subscription ID.
:type subscription_id: str
:param resource_group_name: The Name of the resource group in which the workspace is located.
:type resource_group_name: str
:param workspace_name: The name of the workspace.
:type workspace_name: str
:param run_id:
:type run_id: str
:param experiment_name:
:type experiment_name: str
:param filter: Allows for filtering the collection of resources.
The expression specified is evaluated for each resource in the collection, and only items
where the expression evaluates to true are included in the response.
:type filter: str
:param continuationtoken: The continuation token to use for getting the next set of resources.
:type continuationtoken: str
:param orderby: The list of resource properties to use for sorting the requested resources.
:type orderby: list[str]
:param sortorder: The sort order of the returned resources. Not used, specify asc or desc after
each property name in the OrderBy parameter.
:type sortorder: str or ~azure.mgmt.machinelearningservices.models.SortOrderDirection
:param top: The maximum number of items in the resource collection to be included in the
result.
If not specified, all items are returned.
:type top: int
:param count: Whether to include a count of the matching resources along with the resources
returned in the response.
:type count: bool
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either PaginatedRunList or the result of cls(response)
:rtype:
~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedRunList]
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedRunList"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if not next_link:
request = build_get_child_by_experiment_name_request(
subscription_id=subscription_id,
resource_group_name=resource_group_name,
workspace_name=workspace_name,
run_id=run_id,
experiment_name=experiment_name,
filter=filter,
continuationtoken=continuationtoken,
orderby=orderby,
sortorder=sortorder,
top=top,
count=count,
template_url=self.get_child_by_experiment_name.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_get_child_by_experiment_name_request(
subscription_id=subscription_id,
resource_group_name=resource_group_name,
workspace_name=workspace_name,
run_id=run_id,
experiment_name=experiment_name,
filter=filter,
continuationtoken=continuationtoken,
orderby=orderby,
sortorder=sortorder,
top=top,
count=count,
template_url=next_link,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = "GET"
return request
def extract_data(pipeline_response):
deserialized = self._deserialize("PaginatedRunList", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
return pipeline_response
return ItemPaged(
get_next, extract_data
)
get_child_by_experiment_name.metadata = {'url': '/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/children'} # type: ignore
@distributed_trace
def get_child_by_experiment_id(
self,
subscription_id, # type: str
resource_group_name, # type: str
workspace_name, # type: str
run_id, # type: str
experiment_id, # type: str
filter=None, # type: Optional[str]
continuationtoken=None, # type: Optional[str]
orderby=None, # type: Optional[List[str]]
sortorder=None, # type: Optional[Union[str, "_models.SortOrderDirection"]]
top=None, # type: Optional[int]
count=None, # type: Optional[bool]
**kwargs # type: Any
):
# type: (...) -> Iterable["_models.PaginatedRunList"]
"""get_child_by_experiment_id.
:param subscription_id: The Azure Subscription ID.
:type subscription_id: str
:param resource_group_name: The Name of the resource group in which the workspace is located.
:type resource_group_name: str
:param workspace_name: The name of the workspace.
:type workspace_name: str
:param run_id:
:type run_id: str
:param experiment_id:
:type experiment_id: str
:param filter: Allows for filtering the collection of resources.
The expression specified is evaluated for each resource in the collection, and only items
where the expression evaluates to true are included in the response.
:type filter: str
:param continuationtoken: The continuation token to use for getting the next set of resources.
:type continuationtoken: str
:param orderby: The list of resource properties to use for sorting the requested resources.
:type orderby: list[str]
:param sortorder: The sort order of the returned resources. Not used, specify asc or desc after
each property name in the OrderBy parameter.
:type sortorder: str or ~azure.mgmt.machinelearningservices.models.SortOrderDirection
:param top: The maximum number of items in the resource collection to be included in the
result.
If not specified, all items are returned.
:type top: int
:param count: Whether to include a count of the matching resources along with the resources
returned in the response.
:type count: bool
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either PaginatedRunList or the result of cls(response)
:rtype:
~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedRunList]
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedRunList"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if not next_link:
request = build_get_child_by_experiment_id_request(
subscription_id=subscription_id,
resource_group_name=resource_group_name,
workspace_name=workspace_name,
run_id=run_id,
experiment_id=experiment_id,
filter=filter,
continuationtoken=continuationtoken,
orderby=orderby,
sortorder=sortorder,
top=top,
count=count,
template_url=self.get_child_by_experiment_id.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_get_child_by_experiment_id_request(
subscription_id=subscription_id,
resource_group_name=resource_group_name,
workspace_name=workspace_name,
run_id=run_id,
experiment_id=experiment_id,
filter=filter,
continuationtoken=continuationtoken,
orderby=orderby,
sortorder=sortorder,
top=top,
count=count,
template_url=next_link,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = "GET"
return request
def extract_data(pipeline_response):
deserialized = self._deserialize("PaginatedRunList", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
return pipeline_response
return ItemPaged(
get_next, extract_data
)
get_child_by_experiment_id.metadata = {'url': '/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/children'} # type: ignore
@distributed_trace
def get_child(
self,
subscription_id, # type: str
resource_group_name, # type: str
workspace_name, # type: str
run_id, # type: str
filter=None, # type: Optional[str]
continuationtoken=None, # type: Optional[str]
orderby=None, # type: Optional[List[str]]
sortorder=None, # type: Optional[Union[str, "_models.SortOrderDirection"]]
top=None, # type: Optional[int]
count=None, # type: Optional[bool]
**kwargs # type: Any
):
# type: (...) -> Iterable["_models.PaginatedRunList"]
"""get_child.
:param subscription_id: The Azure Subscription ID.
:type subscription_id: str
:param resource_group_name: The Name of the resource group in which the workspace is located.
:type resource_group_name: str
:param workspace_name: The name of the workspace.
:type workspace_name: str
:param run_id:
:type run_id: str
:param filter: Allows for filtering the collection of resources.
The expression specified is evaluated for each resource in the collection, and only items
where the expression evaluates to true are included in the response.
:type filter: str
:param continuationtoken: The continuation token to use for getting the next set of resources.
:type continuationtoken: str
:param orderby: The list of resource properties to use for sorting the requested resources.
:type orderby: list[str]
:param sortorder: The sort order of the returned resources. Not used, specify asc or desc after
each property name in the OrderBy parameter.
:type sortorder: str or ~azure.mgmt.machinelearningservices.models.SortOrderDirection
:param top: The maximum number of items in the resource collection to be included in the
result.
If not specified, all items are returned.
:type top: int
:param count: Whether to include a count of the matching resources along with the resources
returned in the response.
:type count: bool
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either PaginatedRunList or the result of cls(response)
:rtype:
~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedRunList]
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedRunList"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if not next_link:
request = build_get_child_request(
subscription_id=subscription_id,
resource_group_name=resource_group_name,
workspace_name=workspace_name,
run_id=run_id,
filter=filter,
continuationtoken=continuationtoken,
orderby=orderby,
sortorder=sortorder,
top=top,
count=count,
template_url=self.get_child.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
request = build_get_child_request(
subscription_id=subscription_id,
resource_group_name=resource_group_name,
workspace_name=workspace_name,
run_id=run_id,
filter=filter,
continuationtoken=continuationtoken,
orderby=orderby,
sortorder=sortorder,
top=top,
count=count,
template_url=next_link,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = "GET"
return request
def extract_data(pipeline_response):
deserialized = self._deserialize("PaginatedRunList", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
return pipeline_response
return ItemPaged(
get_next, extract_data
)
get_child.metadata = {'url': '/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/children'} # type: ignore
@distributed_trace
def get_details_by_experiment_id(
self,
subscription_id, # type: str
resource_group_name, # type: str
workspace_name, # type: str
run_id, # type: str
experiment_id, # type: str
**kwargs # type: Any
):
# type: (...) -> "_models.RunDetails"
"""get_details_by_experiment_id.
:param subscription_id: The Azure Subscription ID.
:type subscription_id: str
:param resource_group_name: The Name of the resource group in which the workspace is located.
:type resource_group_name: str
:param workspace_name: The name of the workspace.
:type workspace_name: str
:param run_id:
:type run_id: str
:param experiment_id:
:type experiment_id: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: RunDetails, or the result of cls(response)
:rtype: ~azure.mgmt.machinelearningservices.models.RunDetails
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.RunDetails"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
request = build_get_details_by_experiment_id_request(
subscription_id=subscription_id,
resource_group_name=resource_group_name,
workspace_name=workspace_name,
run_id=run_id,
experiment_id=experiment_id,
template_url=self.get_details_by_experiment_id.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
deserialized = self._deserialize('RunDetails', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
get_details_by_experiment_id.metadata = {'url': '/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/details'} # type: ignore
@distributed_trace
def get_details_by_experiment_name(
self,
subscription_id, # type: str
resource_group_name, # type: str
workspace_name, # type: str
run_id, # type: str
experiment_name, # type: str
**kwargs # type: Any
):
# type: (...) -> "_models.RunDetails"
"""get_details_by_experiment_name.
:param subscription_id: The Azure Subscription ID.
:type subscription_id: str
:param resource_group_name: The Name of the resource group in which the workspace is located.
:type resource_group_name: str
:param workspace_name: The name of the workspace.
:type workspace_name: str
:param run_id:
:type run_id: str
:param experiment_name:
:type experiment_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: RunDetails, or the result of cls(response)
:rtype: ~azure.mgmt.machinelearningservices.models.RunDetails
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.RunDetails"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
request = build_get_details_by_experiment_name_request(
subscription_id=subscription_id,
resource_group_name=resource_group_name,
workspace_name=workspace_name,
run_id=run_id,
experiment_name=experiment_name,
template_url=self.get_details_by_experiment_name.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
deserialized = self._deserialize('RunDetails', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
get_details_by_experiment_name.metadata = {'url': '/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/details'} # type: ignore
@distributed_trace
def get_details(
self,
subscription_id, # type: str
resource_group_name, # type: str
workspace_name, # type: str
run_id, # type: str
**kwargs # type: Any
):
# type: (...) -> "_models.RunDetails"
"""get_details.
:param subscription_id: The Azure Subscription ID.
:type subscription_id: str
:param resource_group_name: The Name of the resource group in which the workspace is located.
:type resource_group_name: str
:param workspace_name: The name of the workspace.
:type workspace_name: str
:param run_id:
:type run_id: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: RunDetails, or the result of cls(response)
:rtype: ~azure.mgmt.machinelearningservices.models.RunDetails
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.RunDetails"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
request = build_get_details_request(
subscription_id=subscription_id,
resource_group_name=resource_group_name,
workspace_name=workspace_name,
run_id=run_id,
template_url=self.get_details.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
deserialized = self._deserialize('RunDetails', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
get_details.metadata = {'url': '/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/details'} # type: ignore
@distributed_trace
def get_run_data(
self,
subscription_id, # type: str
resource_group_name, # type: str
workspace_name, # type: str
body=None, # type: Optional["_models.GetRunDataRequest"]
**kwargs # type: Any
):
# type: (...) -> "_models.GetRunDataResult"
"""get_run_data.
:param subscription_id: The Azure Subscription ID.
:type subscription_id: str
:param resource_group_name: The Name of the resource group in which the workspace is located.
:type resource_group_name: str
:param workspace_name: The name of the workspace.
:type workspace_name: str
:param body:
:type body: ~azure.mgmt.machinelearningservices.models.GetRunDataRequest
:keyword callable cls: A custom type or function that will be passed the direct response
:return: GetRunDataResult, or the result of cls(response)
:rtype: ~azure.mgmt.machinelearningservices.models.GetRunDataResult
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.GetRunDataResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
if body is not None:
_json = self._serialize.body(body, 'GetRunDataRequest')
else:
_json = None
request = build_get_run_data_request(
subscription_id=subscription_id,
resource_group_name=resource_group_name,
workspace_name=workspace_name,
content_type=content_type,
json=_json,
template_url=self.get_run_data.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
deserialized = self._deserialize('GetRunDataResult', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
get_run_data.metadata = {'url': '/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/rundata'} # type: ignore
@distributed_trace
def batch_get_run_data(
self,
subscription_id, # type: str
resource_group_name, # type: str
workspace_name, # type: str
body=None, # type: Optional["_models.BatchRequest1"]
**kwargs # type: Any
):
# type: (...) -> "_models.BatchResult1"
"""batch_get_run_data.
:param subscription_id: The Azure Subscription ID.
:type subscription_id: str
:param resource_group_name: The Name of the resource group in which the workspace is located.
:type resource_group_name: str
:param workspace_name: The name of the workspace.
:type workspace_name: str
:param body:
:type body: ~azure.mgmt.machinelearningservices.models.BatchRequest1
:keyword callable cls: A custom type or function that will be passed the direct response
:return: BatchResult1, or the result of cls(response)
:rtype: ~azure.mgmt.machinelearningservices.models.BatchResult1
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchResult1"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
if body is not None:
_json = self._serialize.body(body, 'BatchRequest1')
else:
_json = None
request = build_batch_get_run_data_request(
subscription_id=subscription_id,
resource_group_name=resource_group_name,
workspace_name=workspace_name,
content_type=content_type,
json=_json,
template_url=self.batch_get_run_data.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200, 207]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = self._deserialize('BatchResult1', pipeline_response)
if response.status_code == 207:
deserialized = self._deserialize('BatchResult1', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
batch_get_run_data.metadata = {'url': '/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchrundata'} # type: ignore
@distributed_trace
def batch_add_or_modify_by_experiment_id(
self,
subscription_id, # type: str
resource_group_name, # type: str
workspace_name, # type: str
experiment_id, # type: str
body=None, # type: Optional["_models.BatchAddOrModifyRunRequest"]
**kwargs # type: Any
):
# type: (...) -> "_models.BatchRunResult"
"""batch_add_or_modify_by_experiment_id.
:param subscription_id: The Azure Subscription ID.
:type subscription_id: str
:param resource_group_name: The Name of the resource group in which the workspace is located.
:type resource_group_name: str
:param workspace_name: The name of the workspace.
:type workspace_name: str
:param experiment_id:
:type experiment_id: str
:param body:
:type body: ~azure.mgmt.machinelearningservices.models.BatchAddOrModifyRunRequest
:keyword callable cls: A custom type or function that will be passed the direct response
:return: BatchRunResult, or the result of cls(response)
:rtype: ~azure.mgmt.machinelearningservices.models.BatchRunResult
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchRunResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
if body is not None:
_json = self._serialize.body(body, 'BatchAddOrModifyRunRequest')
else:
_json = None
request = build_batch_add_or_modify_by_experiment_id_request(
subscription_id=subscription_id,
resource_group_name=resource_group_name,
workspace_name=workspace_name,
experiment_id=experiment_id,
content_type=content_type,
json=_json,
template_url=self.batch_add_or_modify_by_experiment_id.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
deserialized = self._deserialize('BatchRunResult', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
batch_add_or_modify_by_experiment_id.metadata = {'url': '/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/batch/runs'} # type: ignore
@distributed_trace
def batch_add_or_modify_by_experiment_name(
self,
subscription_id, # type: str
resource_group_name, # type: str
workspace_name, # type: str
experiment_name, # type: str
body=None, # type: Optional["_models.BatchAddOrModifyRunRequest"]
**kwargs # type: Any
):
# type: (...) -> "_models.BatchRunResult"
"""batch_add_or_modify_by_experiment_name.
:param subscription_id: The Azure Subscription ID.
:type subscription_id: str
:param resource_group_name: The Name of the resource group in which the workspace is located.
:type resource_group_name: str
:param workspace_name: The name of the workspace.
:type workspace_name: str
:param experiment_name:
:type experiment_name: str
:param body:
:type body: ~azure.mgmt.machinelearningservices.models.BatchAddOrModifyRunRequest
:keyword callable cls: A custom type or function that will be passed the direct response
:return: BatchRunResult, or the result of cls(response)
:rtype: ~azure.mgmt.machinelearningservices.models.BatchRunResult
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchRunResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
if body is not None:
_json = self._serialize.body(body, 'BatchAddOrModifyRunRequest')
else:
_json = None
request = build_batch_add_or_modify_by_experiment_name_request(
subscription_id=subscription_id,
resource_group_name=resource_group_name,
workspace_name=workspace_name,
experiment_name=experiment_name,
content_type=content_type,
json=_json,
template_url=self.batch_add_or_modify_by_experiment_name.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
deserialized = self._deserialize('BatchRunResult', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
batch_add_or_modify_by_experiment_name.metadata = {'url': '/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/batch/runs'} # type: ignore
@distributed_trace
def add_or_modify_by_experiment_name(
self,
subscription_id, # type: str
resource_group_name, # type: str
workspace_name, # type: str
run_id, # type: str
experiment_name, # type: str
body=None, # type: Optional["_models.CreateRun"]
**kwargs # type: Any
):
# type: (...) -> "_models.Run"
"""add_or_modify_by_experiment_name.
:param subscription_id: The Azure Subscription ID.
:type subscription_id: str
:param resource_group_name: The Name of the resource group in which the workspace is located.
:type resource_group_name: str
:param workspace_name: The name of the workspace.
:type workspace_name: str
:param run_id:
:type run_id: str
:param experiment_name:
:type experiment_name: str
:param body:
:type body: ~azure.mgmt.machinelearningservices.models.CreateRun
:keyword callable cls: A custom type or function that will be passed the direct response
:return: Run, or the result of cls(response)
:rtype: ~azure.mgmt.machinelearningservices.models.Run
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.Run"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
if body is not None:
_json = self._serialize.body(body, 'CreateRun')
else:
_json = None
request = build_add_or_modify_by_experiment_name_request(
subscription_id=subscription_id,
resource_group_name=resource_group_name,
workspace_name=workspace_name,
run_id=run_id,
experiment_name=experiment_name,
content_type=content_type,
json=_json,
template_url=self.add_or_modify_by_experiment_name.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
deserialized = self._deserialize('Run', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
add_or_modify_by_experiment_name.metadata = {'url': '/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}'} # type: ignore
@distributed_trace
def get_by_experiment_name(
self,
subscription_id, # type: str
resource_group_name, # type: str
workspace_name, # type: str
run_id, # type: str
experiment_name, # type: str
**kwargs # type: Any
):
# type: (...) -> "_models.Run"
"""get_by_experiment_name.
:param subscription_id: The Azure Subscription ID.
:type subscription_id: str
:param resource_group_name: The Name of the resource group in which the workspace is located.
:type resource_group_name: str
:param workspace_name: The name of the workspace.
:type workspace_name: str
:param run_id:
:type run_id: str
:param experiment_name:
:type experiment_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: Run, or the result of cls(response)
:rtype: ~azure.mgmt.machinelearningservices.models.Run
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.Run"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
request = build_get_by_experiment_name_request(
subscription_id=subscription_id,
resource_group_name=resource_group_name,
workspace_name=workspace_name,
run_id=run_id,
experiment_name=experiment_name,
template_url=self.get_by_experiment_name.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
deserialized = self._deserialize('Run', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
get_by_experiment_name.metadata = {'url': '/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}'} # type: ignore
@distributed_trace
def add_or_modify_by_experiment_id(
self,
subscription_id, # type: str
resource_group_name, # type: str
workspace_name, # type: str
run_id, # type: str
experiment_id, # type: str
body=None, # type: Optional["_models.CreateRun"]
**kwargs # type: Any
):
# type: (...) -> "_models.Run"
"""add_or_modify_by_experiment_id.
:param subscription_id: The Azure Subscription ID.
:type subscription_id: str
:param resource_group_name: The Name of the resource group in which the workspace is located.
:type resource_group_name: str
:param workspace_name: The name of the workspace.
:type workspace_name: str
:param run_id:
:type run_id: str
:param experiment_id:
:type experiment_id: str
:param body:
:type body: ~azure.mgmt.machinelearningservices.models.CreateRun
:keyword callable cls: A custom type or function that will be passed the direct response
:return: Run, or the result of cls(response)
:rtype: ~azure.mgmt.machinelearningservices.models.Run
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.Run"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
if body is not None:
_json = self._serialize.body(body, 'CreateRun')
else:
_json = None
request = build_add_or_modify_by_experiment_id_request(
subscription_id=subscription_id,
resource_group_name=resource_group_name,
workspace_name=workspace_name,
run_id=run_id,
experiment_id=experiment_id,
content_type=content_type,
json=_json,
template_url=self.add_or_modify_by_experiment_id.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
deserialized = self._deserialize('Run', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
add_or_modify_by_experiment_id.metadata = {'url': '/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}'} # type: ignore
@distributed_trace
def get_by_experiment_id(
self,
subscription_id, # type: str
resource_group_name, # type: str
workspace_name, # type: str
run_id, # type: str
experiment_id, # type: str
**kwargs # type: Any
):
# type: (...) -> "_models.Run"
"""get_by_experiment_id.
:param subscription_id: The Azure Subscription ID.
:type subscription_id: str
:param resource_group_name: The Name of the resource group in which the workspace is located.
:type resource_group_name: str
:param workspace_name: The name of the workspace.
:type workspace_name: str
:param run_id:
:type run_id: str
:param experiment_id:
:type experiment_id: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: Run, or the result of cls(response)
:rtype: ~azure.mgmt.machinelearningservices.models.Run
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.Run"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
request = build_get_by_experiment_id_request(
subscription_id=subscription_id,
resource_group_name=resource_group_name,
workspace_name=workspace_name,
run_id=run_id,
experiment_id=experiment_id,
template_url=self.get_by_experiment_id.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
deserialized = self._deserialize('Run', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
get_by_experiment_id.metadata = {'url': '/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}'} # type: ignore
@distributed_trace
def add_or_modify_experiment(
self,
subscription_id, # type: str
resource_group_name, # type: str
workspace_name, # type: str
run_id, # type: str
body=None, # type: Optional["_models.CreateRun"]
**kwargs # type: Any
):
# type: (...) -> "_models.Run"
"""add_or_modify_experiment.
:param subscription_id: The Azure Subscription ID.
:type subscription_id: str
:param resource_group_name: The Name of the resource group in which the workspace is located.
:type resource_group_name: str
:param workspace_name: The name of the workspace.
:type workspace_name: str
:param run_id:
:type run_id: str
:param body:
:type body: ~azure.mgmt.machinelearningservices.models.CreateRun
:keyword callable cls: A custom type or function that will be passed the direct response
:return: Run, or the result of cls(response)
:rtype: ~azure.mgmt.machinelearningservices.models.Run
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.Run"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
if body is not None:
_json = self._serialize.body(body, 'CreateRun')
else:
_json = None
request = build_add_or_modify_experiment_request(
subscription_id=subscription_id,
resource_group_name=resource_group_name,
workspace_name=workspace_name,
run_id=run_id,
content_type=content_type,
json=_json,
template_url=self.add_or_modify_experiment.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
deserialized = self._deserialize('Run', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
add_or_modify_experiment.metadata = {'url': '/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}'} # type: ignore
@distributed_trace
def add(
self,
subscription_id, # type: str
resource_group_name, # type: str
workspace_name, # type: str
run_id, # type: str
body=None, # type: Optional["_models.CreateRun"]
**kwargs # type: Any
):
# type: (...) -> "_models.Run"
"""add.
:param subscription_id: The Azure Subscription ID.
:type subscription_id: str
:param resource_group_name: The Name of the resource group in which the workspace is located.
:type resource_group_name: str
:param workspace_name: The name of the workspace.
:type workspace_name: str
:param run_id:
:type run_id: str
:param body:
:type body: ~azure.mgmt.machinelearningservices.models.CreateRun
:keyword callable cls: A custom type or function that will be passed the direct response
:return: Run, or the result of cls(response)
:rtype: ~azure.mgmt.machinelearningservices.models.Run
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.Run"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
if body is not None:
_json = self._serialize.body(body, 'CreateRun')
else:
_json = None
request = build_add_request(
subscription_id=subscription_id,
resource_group_name=resource_group_name,
workspace_name=workspace_name,
run_id=run_id,
content_type=content_type,
json=_json,
template_url=self.add.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
deserialized = self._deserialize('Run', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
add.metadata = {'url': '/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}'} # type: ignore
@distributed_trace
def get(
self,
subscription_id, # type: str
resource_group_name, # type: str
workspace_name, # type: str
run_id, # type: str
**kwargs # type: Any
):
# type: (...) -> "_models.Run"
"""get.
:param subscription_id: The Azure Subscription ID.
:type subscription_id: str
:param resource_group_name: The Name of the resource group in which the workspace is located.
:type resource_group_name: str
:param workspace_name: The name of the workspace.
:type workspace_name: str
:param run_id:
:type run_id: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: Run, or the result of cls(response)
:rtype: ~azure.mgmt.machinelearningservices.models.Run
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.Run"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
request = build_get_request(
subscription_id=subscription_id,
resource_group_name=resource_group_name,
workspace_name=workspace_name,
run_id=run_id,
template_url=self.get.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
deserialized = self._deserialize('Run', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
get.metadata = {'url': '/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}'} # type: ignore
@distributed_trace
def delete_tags_by_experiment_id(
self,
subscription_id, # type: str
resource_group_name, # type: str
workspace_name, # type: str
run_id, # type: str
experiment_id, # type: str
body=None, # type: Optional[List[str]]
**kwargs # type: Any
):
# type: (...) -> "_models.Run"
"""delete_tags_by_experiment_id.
:param subscription_id: The Azure Subscription ID.
:type subscription_id: str
:param resource_group_name: The Name of the resource group in which the workspace is located.
:type resource_group_name: str
:param workspace_name: The name of the workspace.
:type workspace_name: str
:param run_id:
:type run_id: str
:param experiment_id:
:type experiment_id: str
:param body:
:type body: list[str]
:keyword callable cls: A custom type or function that will be passed the direct response
:return: Run, or the result of cls(response)
:rtype: ~azure.mgmt.machinelearningservices.models.Run
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.Run"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
if body is not None:
_json = self._serialize.body(body, '[str]')
else:
_json = None
request = build_delete_tags_by_experiment_id_request(
subscription_id=subscription_id,
resource_group_name=resource_group_name,
workspace_name=workspace_name,
run_id=run_id,
experiment_id=experiment_id,
content_type=content_type,
json=_json,
template_url=self.delete_tags_by_experiment_id.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
deserialized = self._deserialize('Run', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
delete_tags_by_experiment_id.metadata = {'url': '/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/tags'} # type: ignore
@distributed_trace
def modify_or_delete_tags_by_experiment_id(
self,
subscription_id, # type: str
resource_group_name, # type: str
workspace_name, # type: str
run_id, # type: str
experiment_id, # type: str
body=None, # type: Optional["_models.DeleteOrModifyTags"]
**kwargs # type: Any
):
# type: (...) -> "_models.Run"
"""modify_or_delete_tags_by_experiment_id.
:param subscription_id: The Azure Subscription ID.
:type subscription_id: str
:param resource_group_name: The Name of the resource group in which the workspace is located.
:type resource_group_name: str
:param workspace_name: The name of the workspace.
:type workspace_name: str
:param run_id:
:type run_id: str
:param experiment_id:
:type experiment_id: str
:param body:
:type body: ~azure.mgmt.machinelearningservices.models.DeleteOrModifyTags
:keyword callable cls: A custom type or function that will be passed the direct response
:return: Run, or the result of cls(response)
:rtype: ~azure.mgmt.machinelearningservices.models.Run
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.Run"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
if body is not None:
_json = self._serialize.body(body, 'DeleteOrModifyTags')
else:
_json = None
request = build_modify_or_delete_tags_by_experiment_id_request(
subscription_id=subscription_id,
resource_group_name=resource_group_name,
workspace_name=workspace_name,
run_id=run_id,
experiment_id=experiment_id,
content_type=content_type,
json=_json,
template_url=self.modify_or_delete_tags_by_experiment_id.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
deserialized = self._deserialize('Run', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
modify_or_delete_tags_by_experiment_id.metadata = {'url': '/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/tags'} # type: ignore
@distributed_trace
def delete_tags_by_experiment_name(
self,
subscription_id, # type: str
resource_group_name, # type: str
workspace_name, # type: str
run_id, # type: str
experiment_name, # type: str
body=None, # type: Optional[List[str]]
**kwargs # type: Any
):
# type: (...) -> "_models.Run"
"""delete_tags_by_experiment_name.
:param subscription_id: The Azure Subscription ID.
:type subscription_id: str
:param resource_group_name: The Name of the resource group in which the workspace is located.
:type resource_group_name: str
:param workspace_name: The name of the workspace.
:type workspace_name: str
:param run_id:
:type run_id: str
:param experiment_name:
:type experiment_name: str
:param body:
:type body: list[str]
:keyword callable cls: A custom type or function that will be passed the direct response
:return: Run, or the result of cls(response)
:rtype: ~azure.mgmt.machinelearningservices.models.Run
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.Run"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
if body is not None:
_json = self._serialize.body(body, '[str]')
else:
_json = None
request = build_delete_tags_by_experiment_name_request(
subscription_id=subscription_id,
resource_group_name=resource_group_name,
workspace_name=workspace_name,
run_id=run_id,
experiment_name=experiment_name,
content_type=content_type,
json=_json,
template_url=self.delete_tags_by_experiment_name.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
deserialized = self._deserialize('Run', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
delete_tags_by_experiment_name.metadata = {'url': '/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/tags'} # type: ignore
@distributed_trace
def modify_or_delete_tags_by_experiment_name(
self,
subscription_id, # type: str
resource_group_name, # type: str
workspace_name, # type: str
run_id, # type: str
experiment_name, # type: str
body=None, # type: Optional["_models.DeleteOrModifyTags"]
**kwargs # type: Any
):
# type: (...) -> "_models.Run"
"""modify_or_delete_tags_by_experiment_name.
:param subscription_id: The Azure Subscription ID.
:type subscription_id: str
:param resource_group_name: The Name of the resource group in which the workspace is located.
:type resource_group_name: str
:param workspace_name: The name of the workspace.
:type workspace_name: str
:param run_id:
:type run_id: str
:param experiment_name:
:type experiment_name: str
:param body:
:type body: ~azure.mgmt.machinelearningservices.models.DeleteOrModifyTags
:keyword callable cls: A custom type or function that will be passed the direct response
:return: Run, or the result of cls(response)
:rtype: ~azure.mgmt.machinelearningservices.models.Run
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.Run"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
if body is not None:
_json = self._serialize.body(body, 'DeleteOrModifyTags')
else:
_json = None
request = build_modify_or_delete_tags_by_experiment_name_request(
subscription_id=subscription_id,
resource_group_name=resource_group_name,
workspace_name=workspace_name,
run_id=run_id,
experiment_name=experiment_name,
content_type=content_type,
json=_json,
template_url=self.modify_or_delete_tags_by_experiment_name.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
deserialized = self._deserialize('Run', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
modify_or_delete_tags_by_experiment_name.metadata = {'url': '/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/tags'} # type: ignore
@distributed_trace
def delete_tags(
self,
subscription_id, # type: str
resource_group_name, # type: str
workspace_name, # type: str
run_id, # type: str
body=None, # type: Optional[List[str]]
**kwargs # type: Any
):
# type: (...) -> "_models.Run"
"""delete_tags.
:param subscription_id: The Azure Subscription ID.
:type subscription_id: str
:param resource_group_name: The Name of the resource group in which the workspace is located.
:type resource_group_name: str
:param workspace_name: The name of the workspace.
:type workspace_name: str
:param run_id:
:type run_id: str
:param body:
:type body: list[str]
:keyword callable cls: A custom type or function that will be passed the direct response
:return: Run, or the result of cls(response)
:rtype: ~azure.mgmt.machinelearningservices.models.Run
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.Run"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
if body is not None:
_json = self._serialize.body(body, '[str]')
else:
_json = None
request = build_delete_tags_request(
subscription_id=subscription_id,
resource_group_name=resource_group_name,
workspace_name=workspace_name,
run_id=run_id,
content_type=content_type,
json=_json,
template_url=self.delete_tags.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
deserialized = self._deserialize('Run', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
delete_tags.metadata = {'url': '/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/tags'} # type: ignore
@distributed_trace
def delete_run_services_by_experiment_id(
self,
subscription_id, # type: str
resource_group_name, # type: str
workspace_name, # type: str
run_id, # type: str
experiment_id, # type: str
body=None, # type: Optional["_models.DeleteRunServices"]
**kwargs # type: Any
):
# type: (...) -> "_models.Run"
"""delete_run_services_by_experiment_id.
:param subscription_id: The Azure Subscription ID.
:type subscription_id: str
:param resource_group_name: The Name of the resource group in which the workspace is located.
:type resource_group_name: str
:param workspace_name: The name of the workspace.
:type workspace_name: str
:param run_id:
:type run_id: str
:param experiment_id:
:type experiment_id: str
:param body:
:type body: ~azure.mgmt.machinelearningservices.models.DeleteRunServices
:keyword callable cls: A custom type or function that will be passed the direct response
:return: Run, or the result of cls(response)
:rtype: ~azure.mgmt.machinelearningservices.models.Run
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.Run"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
if body is not None:
_json = self._serialize.body(body, 'DeleteRunServices')
else:
_json = None
request = build_delete_run_services_by_experiment_id_request(
subscription_id=subscription_id,
resource_group_name=resource_group_name,
workspace_name=workspace_name,
run_id=run_id,
experiment_id=experiment_id,
content_type=content_type,
json=_json,
template_url=self.delete_run_services_by_experiment_id.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
deserialized = self._deserialize('Run', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
delete_run_services_by_experiment_id.metadata = {'url': '/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/services'} # type: ignore
@distributed_trace
def delete_run_services_by_experiment_name(
self,
subscription_id, # type: str
resource_group_name, # type: str
workspace_name, # type: str
run_id, # type: str
experiment_name, # type: str
body=None, # type: Optional["_models.DeleteRunServices"]
**kwargs # type: Any
):
# type: (...) -> "_models.Run"
"""delete_run_services_by_experiment_name.
:param subscription_id: The Azure Subscription ID.
:type subscription_id: str
:param resource_group_name: The Name of the resource group in which the workspace is located.
:type resource_group_name: str
:param workspace_name: The name of the workspace.
:type workspace_name: str
:param run_id:
:type run_id: str
:param experiment_name:
:type experiment_name: str
:param body:
:type body: ~azure.mgmt.machinelearningservices.models.DeleteRunServices
:keyword callable cls: A custom type or function that will be passed the direct response
:return: Run, or the result of cls(response)
:rtype: ~azure.mgmt.machinelearningservices.models.Run
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.Run"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
if body is not None:
_json = self._serialize.body(body, 'DeleteRunServices')
else:
_json = None
request = build_delete_run_services_by_experiment_name_request(
subscription_id=subscription_id,
resource_group_name=resource_group_name,
workspace_name=workspace_name,
run_id=run_id,
experiment_name=experiment_name,
content_type=content_type,
json=_json,
template_url=self.delete_run_services_by_experiment_name.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
deserialized = self._deserialize('Run', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
delete_run_services_by_experiment_name.metadata = {'url': '/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/services'} # type: ignore
@distributed_trace
def delete_run_services(
self,
subscription_id, # type: str
resource_group_name, # type: str
workspace_name, # type: str
run_id, # type: str
body=None, # type: Optional["_models.DeleteRunServices"]
**kwargs # type: Any
):
# type: (...) -> "_models.Run"
"""delete_run_services.
:param subscription_id: The Azure Subscription ID.
:type subscription_id: str
:param resource_group_name: The Name of the resource group in which the workspace is located.
:type resource_group_name: str
:param workspace_name: The name of the workspace.
:type workspace_name: str
:param run_id:
:type run_id: str
:param body:
:type body: ~azure.mgmt.machinelearningservices.models.DeleteRunServices
:keyword callable cls: A custom type or function that will be passed the direct response
:return: Run, or the result of cls(response)
:rtype: ~azure.mgmt.machinelearningservices.models.Run
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.Run"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
if body is not None:
_json = self._serialize.body(body, 'DeleteRunServices')
else:
_json = None
request = build_delete_run_services_request(
subscription_id=subscription_id,
resource_group_name=resource_group_name,
workspace_name=workspace_name,
run_id=run_id,
content_type=content_type,
json=_json,
template_url=self.delete_run_services.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
deserialized = self._deserialize('Run', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
delete_run_services.metadata = {'url': '/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/runs/{runId}/services'} # type: ignore
@distributed_trace
def get_by_query_by_experiment_name(
self,
subscription_id, # type: str
resource_group_name, # type: str
workspace_name, # type: str
experiment_name, # type: str
body=None, # type: Optional["_models.QueryParams"]
**kwargs # type: Any
):
# type: (...) -> Iterable["_models.PaginatedRunList"]
"""get_by_query_by_experiment_name.
:param subscription_id: The Azure Subscription ID.
:type subscription_id: str
:param resource_group_name: The Name of the resource group in which the workspace is located.
:type resource_group_name: str
:param workspace_name: The name of the workspace.
:type workspace_name: str
:param experiment_name:
:type experiment_name: str
:param body:
:type body: ~azure.mgmt.machinelearningservices.models.QueryParams
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either PaginatedRunList or the result of cls(response)
:rtype:
~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedRunList]
:raises: ~azure.core.exceptions.HttpResponseError
"""
content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedRunList"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if not next_link:
if body is not None:
_json = self._serialize.body(body, 'QueryParams')
else:
_json = None
request = build_get_by_query_by_experiment_name_request(
subscription_id=subscription_id,
resource_group_name=resource_group_name,
workspace_name=workspace_name,
experiment_name=experiment_name,
content_type=content_type,
json=_json,
template_url=self.get_by_query_by_experiment_name.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
if body is not None:
_json = self._serialize.body(body, 'QueryParams')
else:
_json = None
request = build_get_by_query_by_experiment_name_request(
subscription_id=subscription_id,
resource_group_name=resource_group_name,
workspace_name=workspace_name,
experiment_name=experiment_name,
content_type=content_type,
json=_json,
template_url=next_link,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = "GET"
return request
def extract_data(pipeline_response):
deserialized = self._deserialize("PaginatedRunList", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
return pipeline_response
return ItemPaged(
get_next, extract_data
)
get_by_query_by_experiment_name.metadata = {'url': '/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs:query'} # type: ignore
@distributed_trace
def get_by_query_by_experiment_id(
self,
subscription_id, # type: str
resource_group_name, # type: str
workspace_name, # type: str
experiment_id, # type: str
body=None, # type: Optional["_models.QueryParams"]
**kwargs # type: Any
):
# type: (...) -> Iterable["_models.PaginatedRunList"]
"""get_by_query_by_experiment_id.
:param subscription_id: The Azure Subscription ID.
:type subscription_id: str
:param resource_group_name: The Name of the resource group in which the workspace is located.
:type resource_group_name: str
:param workspace_name: The name of the workspace.
:type workspace_name: str
:param experiment_id:
:type experiment_id: str
:param body:
:type body: ~azure.mgmt.machinelearningservices.models.QueryParams
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either PaginatedRunList or the result of cls(response)
:rtype:
~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PaginatedRunList]
:raises: ~azure.core.exceptions.HttpResponseError
"""
content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
cls = kwargs.pop('cls', None) # type: ClsType["_models.PaginatedRunList"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
def prepare_request(next_link=None):
if not next_link:
if body is not None:
_json = self._serialize.body(body, 'QueryParams')
else:
_json = None
request = build_get_by_query_by_experiment_id_request(
subscription_id=subscription_id,
resource_group_name=resource_group_name,
workspace_name=workspace_name,
experiment_id=experiment_id,
content_type=content_type,
json=_json,
template_url=self.get_by_query_by_experiment_id.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
else:
if body is not None:
_json = self._serialize.body(body, 'QueryParams')
else:
_json = None
request = build_get_by_query_by_experiment_id_request(
subscription_id=subscription_id,
resource_group_name=resource_group_name,
workspace_name=workspace_name,
experiment_id=experiment_id,
content_type=content_type,
json=_json,
template_url=next_link,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = "GET"
return request
def extract_data(pipeline_response):
deserialized = self._deserialize("PaginatedRunList", pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
return pipeline_response
return ItemPaged(
get_next, extract_data
)
get_by_query_by_experiment_id.metadata = {'url': '/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs:query'} # type: ignore
@distributed_trace
def get_by_ids_by_experiment_id(
self,
subscription_id, # type: str
resource_group_name, # type: str
workspace_name, # type: str
experiment_id, # type: str
body=None, # type: Optional["_models.GetRunsByIds"]
**kwargs # type: Any
):
# type: (...) -> "_models.BatchRunResult"
"""get_by_ids_by_experiment_id.
:param subscription_id: The Azure Subscription ID.
:type subscription_id: str
:param resource_group_name: The Name of the resource group in which the workspace is located.
:type resource_group_name: str
:param workspace_name: The name of the workspace.
:type workspace_name: str
:param experiment_id:
:type experiment_id: str
:param body:
:type body: ~azure.mgmt.machinelearningservices.models.GetRunsByIds
:keyword callable cls: A custom type or function that will be passed the direct response
:return: BatchRunResult, or the result of cls(response)
:rtype: ~azure.mgmt.machinelearningservices.models.BatchRunResult
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchRunResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
if body is not None:
_json = self._serialize.body(body, 'GetRunsByIds')
else:
_json = None
request = build_get_by_ids_by_experiment_id_request(
subscription_id=subscription_id,
resource_group_name=resource_group_name,
workspace_name=workspace_name,
experiment_id=experiment_id,
content_type=content_type,
json=_json,
template_url=self.get_by_ids_by_experiment_id.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
deserialized = self._deserialize('BatchRunResult', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
get_by_ids_by_experiment_id.metadata = {'url': '/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/runIds'} # type: ignore
@distributed_trace
def get_by_ids_by_experiment_name(
self,
subscription_id, # type: str
resource_group_name, # type: str
workspace_name, # type: str
experiment_name, # type: str
body=None, # type: Optional["_models.GetRunsByIds"]
**kwargs # type: Any
):
# type: (...) -> "_models.BatchRunResult"
"""get_by_ids_by_experiment_name.
:param subscription_id: The Azure Subscription ID.
:type subscription_id: str
:param resource_group_name: The Name of the resource group in which the workspace is located.
:type resource_group_name: str
:param workspace_name: The name of the workspace.
:type workspace_name: str
:param experiment_name:
:type experiment_name: str
:param body:
:type body: ~azure.mgmt.machinelearningservices.models.GetRunsByIds
:keyword callable cls: A custom type or function that will be passed the direct response
:return: BatchRunResult, or the result of cls(response)
:rtype: ~azure.mgmt.machinelearningservices.models.BatchRunResult
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchRunResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
if body is not None:
_json = self._serialize.body(body, 'GetRunsByIds')
else:
_json = None
request = build_get_by_ids_by_experiment_name_request(
subscription_id=subscription_id,
resource_group_name=resource_group_name,
workspace_name=workspace_name,
experiment_name=experiment_name,
content_type=content_type,
json=_json,
template_url=self.get_by_ids_by_experiment_name.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
deserialized = self._deserialize('BatchRunResult', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
get_by_ids_by_experiment_name.metadata = {'url': '/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/runIds'} # type: ignore
@distributed_trace
def cancel_run_with_uri_by_experiment_id(
self,
subscription_id, # type: str
resource_group_name, # type: str
workspace_name, # type: str
run_id, # type: str
experiment_id, # type: str
cancelation_reason=None, # type: Optional[str]
**kwargs # type: Any
):
# type: (...) -> "_models.Run"
"""cancel_run_with_uri_by_experiment_id.
:param subscription_id: The Azure Subscription ID.
:type subscription_id: str
:param resource_group_name: The Name of the resource group in which the workspace is located.
:type resource_group_name: str
:param workspace_name: The name of the workspace.
:type workspace_name: str
:param run_id:
:type run_id: str
:param experiment_id:
:type experiment_id: str
:param cancelation_reason:
:type cancelation_reason: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: Run, or the result of cls(response)
:rtype: ~azure.mgmt.machinelearningservices.models.Run
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.Run"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
request = build_cancel_run_with_uri_by_experiment_id_request(
subscription_id=subscription_id,
resource_group_name=resource_group_name,
workspace_name=workspace_name,
run_id=run_id,
experiment_id=experiment_id,
cancelation_reason=cancelation_reason,
template_url=self.cancel_run_with_uri_by_experiment_id.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
deserialized = self._deserialize('Run', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
cancel_run_with_uri_by_experiment_id.metadata = {'url': '/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experimentids/{experimentId}/runs/{runId}/cancel'} # type: ignore
@distributed_trace
def cancel_run_with_uri_by_experiment_name(
self,
subscription_id, # type: str
resource_group_name, # type: str
workspace_name, # type: str
run_id, # type: str
experiment_name, # type: str
cancelation_reason=None, # type: Optional[str]
**kwargs # type: Any
):
# type: (...) -> "_models.Run"
"""cancel_run_with_uri_by_experiment_name.
:param subscription_id: The Azure Subscription ID.
:type subscription_id: str
:param resource_group_name: The Name of the resource group in which the workspace is located.
:type resource_group_name: str
:param workspace_name: The name of the workspace.
:type workspace_name: str
:param run_id:
:type run_id: str
:param experiment_name:
:type experiment_name: str
:param cancelation_reason:
:type cancelation_reason: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: Run, or the result of cls(response)
:rtype: ~azure.mgmt.machinelearningservices.models.Run
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.Run"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
request = build_cancel_run_with_uri_by_experiment_name_request(
subscription_id=subscription_id,
resource_group_name=resource_group_name,
workspace_name=workspace_name,
run_id=run_id,
experiment_name=experiment_name,
cancelation_reason=cancelation_reason,
template_url=self.cancel_run_with_uri_by_experiment_name.metadata['url'],
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
deserialized = self._deserialize('Run', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
cancel_run_with_uri_by_experiment_name.metadata = {'url': '/history/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/experiments/{experimentName}/runs/{runId}/cancel'} # type: ignore
| 43.055096
| 282
| 0.665129
| 16,804
| 156,290
| 5.931742
| 0.018805
| 0.020787
| 0.044002
| 0.018821
| 0.981009
| 0.980266
| 0.979243
| 0.977818
| 0.977457
| 0.976645
| 0
| 0.004498
| 0.233265
| 156,290
| 3,629
| 283
| 43.066961
| 0.827301
| 0.232747
| 0
| 0.857325
| 0
| 0.026327
| 0.179435
| 0.102303
| 0
| 0
| 0
| 0
| 0
| 1
| 0.033121
| false
| 0
| 0.005945
| 0
| 0.083652
| 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
|
b9dde9f5710d820710f0071c7d6756f6b6bd1ee9
| 56,381
|
py
|
Python
|
AutoClicker.py
|
uyvu2808/autoclick
|
6355c9037fc882d6fe48a2ec8278a1358202ebc3
|
[
"MIT"
] | 8
|
2018-12-16T21:15:02.000Z
|
2022-01-18T22:20:33.000Z
|
AutoClicker.py
|
uyvu2808/autoclick
|
6355c9037fc882d6fe48a2ec8278a1358202ebc3
|
[
"MIT"
] | 1
|
2018-12-20T18:56:59.000Z
|
2018-12-20T18:56:59.000Z
|
AutoClicker.py
|
uyvu2808/autoclick
|
6355c9037fc882d6fe48a2ec8278a1358202ebc3
|
[
"MIT"
] | 7
|
2018-12-19T08:41:45.000Z
|
2021-11-08T08:49:57.000Z
|
import pyautogui
import time
import tkinter as tk
import webbrowser
from tkinter import *
from tkinter import messagebox
import keyboard
from tkinter import ttk
from tkinter import filedialog
import os
import sys
import datetime
import threading
import time
try:
import gspread
from oauth2client.service_account import ServiceAccountCredentials
from pprint import pprint
except:
pass
try:
import win10toast #This module only works on windows
except:
pass
try:
from PIL import ImageGrab
from colormap import rgb2hex
from win32api import GetSystemMetrics
except:
pass
################################################################################
# /\ | | | |__ __/ __ \ / ____| | |_ _/ ____| |/ / ____| __ \ #
# / \ | | | | | | | | | | | | | | | || | | ' /| |__ | |__) |#
# / /\ \| | | | | | | | | | | | | | | || | | < | __| | _ / #
# / ____ \ |__| | | | | |__| | | |____| |____ _| || |____| . \| |____| | \ \ #
# /_/ \_\____/ |_| \____/ \_____|______|_____\_____|_|\_\______|_| \_\#
################################################################################
def Colour_Clicker():
master = Tk()
master.title("Colour Clicker")
master.geometry("+300+300")
master.attributes("-topmost", True)
master.resizable(False, False)
try:
window.iconbitmap('favicon.ico')
except:
pass
color = 1
xStart = 0
xEnd = 111
yStart = 0
yEnd = 111
def return_entry():
color = entry.get()
xStart1 = entry2.get()
xStart = int(xStart1,10)
xEnd1 = entry3.get()
xEnd = int(xEnd1,10)
yStart1 = entry4.get()
yStart = int(yStart1,10)
yEnd1 = entry5.get()
yEnd = int(yEnd1,10)
mainscript()
# Create this method before you create the entry
ttk.Label(master, text="Enter color in hexadecimals:").grid(row=0, sticky=W)
ttk.Label(master, text="Enter start cordinate in x axis:").grid(row=1, sticky=W)
ttk.Label(master, text="Enter stop cordinate in x axis:").grid(row=2, sticky=W)
ttk.Label(master, text="Enter start cordinate in y axis:").grid(row=3, sticky=W)
ttk.Label(master, text="Enter end cordinate in y axis:").grid(row=4, sticky=W)
ttk.Button(master, text="start", command= return_entry).grid(row=5, sticky=W)
entry = ttk.Entry(master)
entry.grid(row=0, column=1)
entry2 = ttk.Entry(master)
entry2.grid(row=1, column=1)
entry3 = ttk.Entry(master)
entry3.grid(row=2, column=1)
entry4 = ttk.Entry(master)
entry4.grid(row=3, column=1)
entry5 = ttk.Entry(master)
entry5.grid(row=4, column=1)
# Connect the entry with the return button
entry.bind('<Return>', return_entry)
entry2.bind('<Return>', return_entry)
entry3.bind('<Return>', return_entry)
entry4.bind('<Return>', return_entry)
def mainscript():
# returns the color of given pixel
def get_pixel_colour(i_x, i_y):
import win32gui
i_desktop_window_id = win32gui.GetDesktopWindow()
i_desktop_window_dc = win32gui.GetWindowDC(i_desktop_window_id)
long_colour = win32gui.GetPixel(i_desktop_window_dc, i_x, i_y)
i_colour = int(long_colour)
print(long_colour)
return rgb2hex((i_colour & 0xff), ((i_colour >> 8) & 0xff), ((i_colour >> 16) & 0xff))
# get the size of screen
width = GetSystemMetrics(0)
height = GetSystemMetrics(1)
stepSize = 10
# scanning the screen for given color
selectedCordinates = []
for w in range(xStart, xEnd, 10):
for h in range(yStart, yEnd, 10):
print("Now scanning pixel at", (w, h))
if(get_pixel_colour(w, h)==(color)):
selectedCordinates.append([w, h])
pyautogui.FAILSAFE = False
# start click events
for cordinate in selectedCordinates:
print("i got here")
pyautogui.click(x=cordinate[2], y=cordinate[1])
def Locate_Click():
window = Tk()
label1 = tk.Label(window, text='Locate and click', font=('helvetica', 14)).pack()
def click_image():
locate = pyautogui.locateCenterOnScreen(window.filename)
pyautogui.click(locate)
def select_image():
window.filename = filedialog.askopenfilename(initialdir = "/",title = "Select file",filetypes = (("jpeg files","*.jpg"),("all files","*.*")))
button_select = ttk.Button(window, text="Select Image",command=select_image)
button_Find = ttk.Button(window, text="Find and click on image",command=click_image)
button_select.pack()
button_Find.pack()
try:
window.iconbitmap('favicon.ico')
except:
pass
window.attributes("-topmost", True)
window.resizable(False, False)
window.title("Locate and Click")
window.geometry("+300+300")
window.geometry("200x100")
window.mainloop()
def feedback():
root= tk.Tk()
root.geometry("+300+300")
root.attributes("-topmost", True)
root.title('Send Feedback') # Set title
scope = ["https://spreadsheets.google.com/feeds", 'https://www.googleapis.com/auth/spreadsheets',
"https://www.googleapis.com/auth/drive.file", "https://www.googleapis.com/auth/drive"]
creds = creds = ServiceAccountCredentials.from_json_keyfile_name("creds.json", scope)
client = gspread.authorize(creds)
sheet = client.open("feedback").sheet1
label1 = tk.Label(root, text='Send Feedback', font=('helvetica', 14)).grid(row=1, column=3)
try:
root.iconbitmap('favicon.ico')
except:
pass
root.resizable(False, False)
entry1 = ttk.Entry(root)
entry1.grid(row=3, column=3)
def sendfeedbackbutton():
try:
x1 = entry1.get()
sheet.update('A1', x1)
messagebox.showinfo('Sent', 'Feedback was sent!!')
except:
messagebox.showerror('Fail', 'Feedback failed to send')
pass
label2 = tk.Label(root, text='Type your Feedback:',font=('helvetica', 10)).grid(row=2, column=3)
button1 = ttk.Button(root, text='Send', command=sendfeedbackbutton).grid(row=4, column=3)
root.mainloop()
def NOTIFICATION():
try:
toaster = win10toast.ToastNotifier()
toaster.show_toast("AutoClicker", "V6.0", duration=5, threaded=True, icon_path ="favicon.ico")
messagebox.showinfo('AutoClicker', 'V6.0')
except:
messagebox.showinfo('AutoClicker', 'V6.0')
pass
def tutorial():
try:
os.startfile("AutoClickerHelpPage.exe")
except:
window = Tk()
window.title("Tutorial")
window.geometry('770x50')
tab_control = ttk.Notebook(window)
tab1 = ttk.Frame(tab_control)
tab2 = ttk.Frame(tab_control)
tab_control.add(tab1, text='First Step')
tab_control.add(tab2, text='Second Step')
lbl1 = Label(tab1, anchor=W,
text='First get the coordinates, click on Find Coordinates the first number is the x coordinate and the second is the y coordinate.')
lbl1.grid(column=0, row=0)
lbl2 = Label(tab2,
text='Input the X and Y coordinates into the X and Y entry boxes set a key as the stop key and press start you can use the stop key to stop the clicking.')
lbl2.grid(column=0, row=0)
tab_control.pack(expand=1, fill='both')
try:
window.iconbitmap('favicon.ico')
except:
pass
window.attributes("-topmost", True)
window.resizable(False, False)
window.geometry("+300+300")
window.mainloop()
def OldStyleGUI():
class YourGUI(tk.Tk):
def __init__(self):
# inherit tkinter's window methods
tk.Tk.__init__(self)
tk.Label(self, text="ENTER Y:", background="#e7dff2").grid(row=0, column=2)
self.inputX = tk.Entry(self)
self.inputX.grid(row=0, column=1)
tk.Label(self, text="ENTER X:", background="#e7dff2").grid(row=0, column=0)
self.inputY = tk.Entry(self)
self.inputY.grid(row=0, column=3)
self.cmb = ttk.Combobox(self, width="10", values=("Left Click","Right Click","Middle Click","Double Right Click","Double Left Click","Double Middle Click"))
ttk.Label(self, text="Delay Between clicks", background="#e7dff2", anchor=E).grid(row=5, column=0)
self.inputdelayentry = tk.StringVar()
self.inputdelayentry.set("0")
self.inputdelay = tk.Entry(self, textvariable= self.inputdelayentry).grid(row=5, column=1)
class TableDropDown(ttk.Combobox):
def __init__(self, parent):
self.current_table = tk.StringVar() # create variable for table
ttk.Combobox.__init__(self, parent)# init widget
self.config(textvariable = self.current_table, state = "readonly", values = ["Customers", "Pets", "Invoices", "Prices"])
self.current(0) # index of values for current table
self.place(x = 50, y = 50, anchor = "w") # place drop down box
ttk.Label(self, text="""Choose the left or
right mouse button""", background="#e7dff2", anchor=E).grid(row=1, column=0)
self.cmb.grid(row=1, column=1, sticky="ew")
self.cmb.current(0)
# Start Button ⬇
tk.Button(self, text="start", fg='green', command=self.startclick).grid(row=6, column=0)
# close button ⬇
tk.Button(self, text="exit!", fg='red', command=self.EXITME).grid(row=7, column=0)
self.inputhotkey = tk.Entry(self)
self.inputhotkey.grid(row=1, column=3, columnspan=1)
def callback():
webbrowser.open_new(r"https://kai9987kai.github.io/AutoClicker.html")
def callback2():
webbrowser.open_new(r"https://github.com/kai9987kai/AutoClicker")
tk.Button(self, text="ABOUT", command=callback).grid(row=5, column=3, sticky="ew")
def clicked3():
your_gui.destroy()
pyautogui.PAUSE = 0.50
pyautogui.FAILSAFE = True
things = []
root = Tk()
root.geometry("550x425")
list_box = Listbox(root, font=(12))
list_box.config(width=30, height=18)
list_box.place(x=0, y=0)
run_btn = Button(root, text="Run List", command=lambda: run_list(), font=(12))
run_btn.place(x=350, y=15)
run_btn.config(width=15)
del_btn = Button(root, text="Delete", command=lambda: delete(list_box), font=(12))
del_btn.place(x=350, y=105)
del_btn.config(width=15)
add_btn = Button(root, text="Add", command=lambda: add(), font=(12))
add_btn.place(x=350, y=60)
add_btn.config(width=15)
x_txt = StringVar()
y_txt = StringVar()
x_label = Label(root, text="x", font=(12))
x_label.place(x=350, y=150)
x = Entry(root, textvariable=x_txt)
x.place(x=375, y=150)
x_txt.set('')
y_label = Label(root, text="y", font=(12))
y_label.place(x=350, y=180)
y = Entry(root, textvariable=y_txt)
y.place(x=375, y=180)
y_txt.set('')
cmb = ttk.Combobox(root, width="15", values=("Left Click","Right Click","Middle Click","Double Right Click","Double Left Click","Double Middle Click"))
ttk.Label(root, text="""Select whether to right or
left click the list""", anchor=E).place(x=350, y=220)
cmb.place(x=350, y=265)
cmb.current(0)
def add():
content_x = x_txt.get()
content_y = y_txt.get()
closed_str = [content_x, content_y]
things.append(closed_str)
list_box.delete(0, 'end')
for i in range(len(things)):
list_box.insert(END, things[i])
def run_list():
x_cords = [item[0] for item in things]
y_cords = [item[1] for item in things]
for i in range(len(things)):
if cmb.get() == "Left Click":
screenWidth, screenHeight = pyautogui.size()
currentMouseX, currentMouseY = pyautogui.position()
pyautogui.moveTo(int(x_cords[i]), int(y_cords[i]))
# print("Gonna Click",x_cords[i],y_cords[i])
pyautogui.click()
elif cmb.get() == "Right Click":
screenWidth, screenHeight = pyautogui.size()
currentMouseX, currentMouseY = pyautogui.position()
pyautogui.moveTo(int(x_cords[i]), int(y_cords[i]))
# print("Gonna Click",x_cords[i],y_cords[i])
pyautogui.click(button='right')
pyautogui.click()
elif cmb.get() == "Middle Click":
screenWidth, screenHeight = pyautogui.size()
currentMouseX, currentMouseY = pyautogui.position()
pyautogui.moveTo(int(x_cords[i]), int(y_cords[i]))
# print("Gonna Click",x_cords[i],y_cords[i])
pyautogui.click(button='middle')
pyautogui.click()
elif cmb.get() == "Double Right Click":
screenWidth, screenHeight = pyautogui.size()
currentMouseX, currentMouseY = pyautogui.position()
pyautogui.moveTo(int(x_cords[i]), int(y_cords[i]))
# print("Gonna Click",x_cords[i],y_cords[i])
pyautogui.click(clicks=2)
pyautogui.click(button='right')
pyautogui.click()
elif cmb.get() == "Double Left Click":
screenWidth, screenHeight = pyautogui.size()
currentMouseX, currentMouseY = pyautogui.position()
pyautogui.moveTo(int(x_cords[i]), int(y_cords[i]))
# print("Gonna Click",x_cords[i],y_cords[i])
pyautogui.click(clicks=2)
pyautogui.click(button='left')
pyautogui.click()
elif cmb.get() == "Double Middle Click":
screenWidth, screenHeight = pyautogui.size()
currentMouseX, currentMouseY = pyautogui.position()
pyautogui.moveTo(int(x_cords[i]), int(y_cords[i]))
# print("Gonna Click",x_cords[i],y_cords[i])
pyautogui.click(clicks=2)
pyautogui.click(button='middle')
pyautogui.click()
def delete(listbox):
global things
# Delete from Listbox
selection = list_box.curselection()
list_box.delete(selection[0])
# Delete from list that provided it
value = eval(list_box.get(selection[0]))
ind = things.index(value)
del (things[ind])
popup = Menu(root, tearoff=0)
popup.add_command(label='Run list', command=run_list)
popup.add_command(label='Exit', command=self.EXITME)
def do_popup(event):
# display the popup menu
try:
popup.tk_popup(event.x_root, event.y_root, 0)
finally:
# make sure to release the grab (Tk 8.0a1 only)
popup.grab_release()
root.bind("<Button-3>", do_popup)
root.title("AutoClicker - list of coordinates")
try:
root.iconbitmap('favicon.ico')
except:
pass
root.resizable(False, False)
root.attributes("-topmost", True)
root.mainloop()
def Finder():
try:
os.startfile("AutoClickerMouseCoordinatesPage.exe")
except:
messagebox.showerror("ERROR", "AutoClickerMouseCoordinatesPage.exe is missing")
pass
tk.Button(self, text="List Coordinates", command=clicked3).grid(row=7, column=3,sticky="ew")
tk.Button(self, text="Find Coordinates", command=Finder).grid(row=6, column=3, sticky="ew")
def clicked():
os.startfile("AutoClickerContactPage.exe")
def settings():
window = Tk()
window.title("Settings")
window.geometry('335x130')
try:
window.iconbitmap('favicon.ico')
except:
pass
window.resizable(False, False)
window.geometry("+0+0")
window.attributes("-topmost", True)
def callBackFunc():
your_gui.overrideredirect(True)
window.destroy()
def ExitWindow():
window.destroy()
def Full_screen():
your_gui.attributes('-fullscreen', True)
your_gui.bind('<Escape>', lambda e: root.destroy())
window.destroy()
def Exit_Full_Screen():
python = sys.executable
os.execl(python, python, * sys.argv)
def Show_Title_bar():
python = sys.executable
os.execl(python, python, * sys.argv)
ttk.Label(window, text="Settings").grid(column=0, row=1, sticky="ew")
Button(window, text=" Exit Settings ", command=ExitWindow).grid(column=0, row= 6)
Button(window, text="FullScreen", command=Full_screen).grid(column=0, row=3, sticky="ew")
Button(window, text="Exit FullScreen", command=Exit_Full_Screen).grid(column=1, row=3, sticky="ew")
Button(window, text="Hide Title Bar ", command=callBackFunc).grid(column=0, row=5, sticky="ew")
Button(window, text="Show Title Bar", command=Show_Title_bar).grid(column=1, row=5, sticky="ew")
Button(window, text="Restart program", command=Show_Title_bar).grid(column=1, row=6, sticky="ew")
popup = Menu(your_gui, tearoff=0)
popup.add_command(label="FullScreen", command=Full_screen)
popup.add_command(label="Exit FullScreen", command=Exit_Full_Screen)
popup.add_command(label="Hide Title Bar", command=callBackFunc)
popup.add_command(label="Show Title Bar", command=Show_Title_bar)
popup.add_command(label="Restart program", command=Show_Title_bar)
popup.add_command(label="Exit Settings", command=ExitWindow)
def do_popup(event):
try:
popup.tk_popup(event.x_root, event.y_root, 0)
finally:
popup.grab_release()
window.bind("<Button-3>", do_popup)
window.mainloop()
def OpenModernWindow():
your_gui.destroy()
MAINWINDOW_NEWSTYLE()
def clicked2():
try:
os.startfile("AutoClickerMegaSpam.exe")
except:
messagebox.showerror("Error", "AutoClickerMegaSpam.exe is missing")
pass
# Menu Bar!! ⬇
menu = Menu(self)
new_item = Menu(menu)
new_item.add_command(label='About', command=callback)
new_item.add_command(label='Github Page', command=callback2)
new_item.add_command(label='List Coordinates', command=clicked3)
new_item.add_command(label='Version Number', command=NOTIFICATION)
new_item.add_command(label='Modern Style', command=OpenModernWindow)
new_item.add_command(label='Auto Clicker Mega Spam', command=clicked2)
new_item.add_command(label='Coordinates Finder', command=Finder)
new_item.add_command(label='Send Feedback', command=feedback)
new_item.add_command(label='Locate and Click', command=Locate_Click)
new_item.add_command(label='Colour/Color Clicker', command=Colour_Clicker)
new_item.add_command(label='Settings', command=settings)
new_item.add_separator()
new_item.add_command(label='Start', command=self.do_conversion)
new_item.add_command(label='Exit', command=self.EXITME)
menu.add_cascade(label='Menu', menu=new_item)
new_item2 = Menu(menu)
new_item2.add_command(label='Tutorial', command=tutorial)
new_item2.add_command(label='Contact', command=clicked)
menu.add_cascade(label='Help', menu=new_item2)
popup = Menu(self, tearoff=0)
popup.add_command(label="About", command=callback)
popup.add_command(label="Send Feedback", command=feedback)
popup.add_command(label='GitHub Page', command=callback2)
popup.add_command(label='Auto Clicker Mega Spam', command=clicked2)
popup.add_command(label='Version Number', command=NOTIFICATION)
popup.add_command(label='Modern Style', command=OpenModernWindow)
popup.add_command(label='Settings', command=settings)
popup.add_command(label='List of coordinates', command=clicked3)
popup.add_command(label='Locate and Click', command=Locate_Click)
popup.add_command(label='Colour/Color Clicker', command=Colour_Clicker)
popup.add_command(label='Find Coordinates', command=Finder)
popup.add_separator()
popup.add_command(label='Start', command=self.do_conversion)
popup.add_command(label='Exit', command=self.EXITME)
def do_popup(event):
# display the popup menu
try:
popup.tk_popup(event.x_root, event.y_root, 0)
finally:
# make sure to release the grab (Tk 8.0a1 only)
popup.grab_release()
self.bind("<Button-3>", do_popup)
self.config(menu=menu)
tk.Label(self, text="Keyboard key to stop clicking:", background="#e7dff2").grid(row=1, column=2)
def EXITME(self):
YourGUI.destroy(self)
def startclick(self):
x1 = threading.Thread(target=self.do_conversion, daemon=True)
x1.start()
def do_conversion(self):
if self.cmb.get() == "Left Click":
y = self.inputY.get()
x = self.inputX.get()
running = True
try:
x = int(x)
y = int(y)
except:
messagebox.showerror('Invalid point', 'Invalid point')
YourGUI.destroy(self)
# strtoint("crashmE!")
while running:
pyautogui.FAILSAFE = False # disables the fail-safe
pyautogui.click(x, y)
num= int(self.inputdelayentry.get())
start_time = datetime.datetime.now()
while (datetime.datetime.now() - start_time).total_seconds() < num:
if keyboard.is_pressed(self.inputhotkey.get()):
exit(0)
else:
pass
if keyboard.is_pressed(self.inputhotkey.get()):
break
elif self.cmb.get() == "Right Click":
y = self.inputY.get()
x = self.inputX.get()
running = True
try:
x = int(x)
y = int(y)
except:
messagebox.showerror('Invalid point', 'Invalid point')
YourGUI.destroy(self)
# strtoint("crashmE!")
while running:
pyautogui.FAILSAFE = False # disables the fail-safe
pyautogui.click(button='right')
pyautogui.click(x, y)
if keyboard.is_pressed(self.inputhotkey.get()):
break
num= int(self.inputdelayentry.get())
start_time = datetime.datetime.now()
while (datetime.datetime.now() - start_time).total_seconds() < num:
if keyboard.is_pressed(self.inputhotkey.get()):
exit(0)
else:
pass
elif self.cmb.get() == "Middle Click":
y = self.inputY.get()
x = self.inputX.get()
running = True
try:
x = int(x)
y = int(y)
except:
messagebox.showerror('Invalid point', 'Invalid point')
YourGUI.destroy(self)
while running:
pyautogui.FAILSAFE = False
pyautogui.click(button='middle')
pyautogui.click(x, y)
time.sleep(int(self.inputdelayentry.get()))
num= int(self.inputdelayentry.get())
start_time = datetime.datetime.now()
while (datetime.datetime.now() - start_time).total_seconds() < num:
if keyboard.is_pressed(self.inputhotkey.get()):
exit(0)
else:
pass
if keyboard.is_pressed(self.inputhotkey.get()):
break
elif self.cmb.get() == "Double Right Click":
y = self.inputY.get()
x = self.inputX.get()
running = True
try:
x = int(x)
y = int(y)
except:
messagebox.showerror('Invalid point', 'Invalid point')
YourGUI.destroy(self)
while running:
pyautogui.FAILSAFE = False
pyautogui.click(clicks=2)
pyautogui.click(button='right')
pyautogui.click(x, y)
time.sleep(int(self.inputdelayentry.get()))
num= int(self.inputdelayentry.get())
start_time = datetime.datetime.now()
while (datetime.datetime.now() - start_time).total_seconds() < num:
if keyboard.is_pressed(self.inputhotkey.get()):
exit(0)
else:
pass
if keyboard.is_pressed(self.inputhotkey.get()):
break
elif self.cmb.get() == "Double Left Click":
y = self.inputY.get()
x = self.inputX.get()
running = True
try:
x = int(x)
y = int(y)
except:
messagebox.showerror('Invalid point', 'Invalid point')
YourGUI.destroy(self)
while running:
pyautogui.FAILSAFE = False
pyautogui.click(clicks=2)
pyautogui.click(button='left')
pyautogui.click(x, y)
time.sleep(int(self.inputdelayentry.get()))
num= int(self.inputdelayentry.get())
start_time = datetime.datetime.now()
while (datetime.datetime.now() - start_time).total_seconds() < num:
if keyboard.is_pressed(self.inputhotkey.get()):
exit(0)
else:
pass
if keyboard.is_pressed(self.inputhotkey.get()):
break
elif self.cmb.get() == "Double Middle Click":
y = self.inputY.get()
x = self.inputX.get()
running = True
try:
x = int(x)
y = int(y)
except:
messagebox.showerror('Invalid point', 'Invalid point')
YourGUI.destroy(self)
while running:
pyautogui.FAILSAFE = False
pyautogui.click(clicks=2)
pyautogui.click(button='middle')
pyautogui.click(x, y)
time.sleep(int(self.inputdelayentry.get()))
num= int(self.inputdelayentry.get())
start_time = datetime.datetime.now()
while (datetime.datetime.now() - start_time).total_seconds() < num:
if keyboard.is_pressed(self.inputhotkey.get()):
exit(0)
else:
pass
if keyboard.is_pressed(self.inputhotkey.get()):
break
def do_hotkey(self):
hotkey = self.inputhotkey.get()
if __name__ == '__main__':
your_gui = YourGUI()
your_gui.geometry("+300+300")
your_gui.attributes("-topmost", True)
your_gui.title('AutoClicker') # Set title
try:
your_gui.iconbitmap('favicon.ico')
except:
pass
your_gui.resizable(False, False)
your_gui.configure(background="#e7dff2")
your_gui.mainloop()
class Coordinates():
replayBtn = (100, 350)
def MAINWINDOW_NEWSTYLE():
class YourGUI(tk.Tk):
def __init__(self):
tk.Tk.__init__(self)
ttk.Label(self, text="ENTER Y:", background="#e7dff2", anchor=E).grid(row=0, column=2)
ttk.Label(self, text="Delay Between clicks", background="#e7dff2", anchor=E).grid(row=5, column=0)
self.inputdelayentry = tk.StringVar()
self.inputdelayentry.set("0")
self.inputdelay = ttk.Entry(self, textvariable= self.inputdelayentry).grid(row=5, column=1)
self.inputX = ttk.Entry(self)
self.inputX.grid(row=0, column=1)
self.cmb = ttk.Combobox(self, width="15", values=("Left Click","Right Click","Middle Click","Double Right Click","Double Left Click","Double Middle Click"))
class TableDropDown(ttk.Combobox):
def __init__(self, parent):
self.current_table = tk.StringVar() # create variable for table
ttk.Combobox.__init__(self, parent)# init widget
self.config(textvariable = self.current_table, state = "readonly", values = ["Customers", "Pets", "Invoices", "Prices"])
self.current(0) # index of values for current table
self.place(x = 50, y = 50, anchor = "w") # place drop down box
ttk.Label(self, text="""Choose the left or
right mouse button""", background="#e7dff2", anchor=E).grid(row=1, column=0)
self.cmb.grid(row=1, column=1, sticky="ew")
self.cmb.current(0)
ttk.Label(self, text="ENTER X:", background="#e7dff2").grid(row=0, column=0)
self.inputY = ttk.Entry(self)
self.inputY.grid(row=0, column=3)
# Start Button ⬇
ttk.Button(self, text="start", command=self.startclick).grid(row=6, column=0)
# close button ⬇
ttk.Button(self, text="exit!", command=self.EXITME).grid(row=7, column=0)
self.inputhotkey = ttk.Entry(self)
self.inputhotkey.grid(row=1, column=3, columnspan=1)
def callback():
webbrowser.open_new(r"https://kai9987kai.github.io/AutoClicker.html")
def callback2():
webbrowser.open_new(r"https://github.com/kai9987kai/AutoClicker")
ttk.Button(self, text="ABOUT", command=callback).grid(row=5, column=3, sticky="ew")
def clicked3():
your_gui.destroy()
pyautogui.PAUSE = 0.50
pyautogui.FAILSAFE = True
things = []
root = Tk()
root.geometry("600x400")
list_box = Listbox(root, font=(12))
list_box.config(width=30, height=18)
list_box.place(x=0, y=0)
run_btn = ttk.Button(root, text="Run List", command=lambda: run_list())
run_btn.place(x=350, y=20)
run_btn.config(width=15)
del_btn = ttk.Button(root, text="Delete", command=lambda: delete(list_box))
del_btn.place(x=350, y=80)
del_btn.config(width=15)
add_btn = ttk.Button(root, text="Add", command=lambda: add())
add_btn.place(x=350, y=50)
add_btn.config(width=15)
x_txt = StringVar()
y_txt = StringVar()
x_label = Label(root, text="x", font=(12))
x_label.place(x=350, y=150)
x = ttk.Entry(root, textvariable=x_txt)
x.place(x=375, y=150)
x_txt.set('')
y_label = Label(root, text="y", font=(12))
y_label.place(x=350, y=170)
y = ttk.Entry(root, textvariable=y_txt)
y.place(x=375, y=180)
y_txt.set('')
cmb = ttk.Combobox(root, width="15", values=("Left Click","Right Click","Middle Click","Double Right Click","Double Left Click","Double Middle Click"))
ttk.Label(root, text="""Select whether to right or
left click the list""", anchor=E).place(x=350, y=250)
cmb.place(x=350, y=300)
cmb.current(0)
root.title("AutoClicker - list of coordinates")
try:
root.iconbitmap('favicon.ico')
except:
pass
root.resizable(False, False)
root.attributes("-topmost", True)
def add():
content_x = x_txt.get()
content_y = y_txt.get()
closed_str = [content_x, content_y]
things.append(closed_str)
list_box.delete(0, 'end')
for i in range(len(things)):
list_box.insert(END, things[i])
def run_list():
x_cords = [item[0] for item in things]
y_cords = [item[1] for item in things]
for i in range(len(things)):
if cmb.get() == "Left Click":
screenWidth, screenHeight = pyautogui.size()
currentMouseX, currentMouseY = pyautogui.position()
pyautogui.moveTo(int(x_cords[i]), int(y_cords[i]))
# print("Gonna Click",x_cords[i],y_cords[i])
pyautogui.click()
elif cmb.get() == "Right Click":
screenWidth, screenHeight = pyautogui.size()
currentMouseX, currentMouseY = pyautogui.position()
pyautogui.moveTo(int(x_cords[i]), int(y_cords[i]))
# print("Gonna Click",x_cords[i],y_cords[i])
pyautogui.click(button='right')
pyautogui.click()
elif cmb.get() == "Middle Click":
screenWidth, screenHeight = pyautogui.size()
currentMouseX, currentMouseY = pyautogui.position()
pyautogui.moveTo(int(x_cords[i]), int(y_cords[i]))
# print("Gonna Click",x_cords[i],y_cords[i])
pyautogui.click(button='middle')
pyautogui.click()
elif cmb.get() == "Double Right Click":
screenWidth, screenHeight = pyautogui.size()
currentMouseX, currentMouseY = pyautogui.position()
pyautogui.moveTo(int(x_cords[i]), int(y_cords[i]))
# print("Gonna Click",x_cords[i],y_cords[i])
pyautogui.click(clicks=2)
pyautogui.click(button='right')
pyautogui.click()
elif cmb.get() == "Double Left Click":
screenWidth, screenHeight = pyautogui.size()
currentMouseX, currentMouseY = pyautogui.position()
pyautogui.moveTo(int(x_cords[i]), int(y_cords[i]))
# print("Gonna Click",x_cords[i],y_cords[i])
pyautogui.click(clicks=2)
pyautogui.click(button='left')
pyautogui.click()
elif cmb.get() == "Double Middle Click":
screenWidth, screenHeight = pyautogui.size()
currentMouseX, currentMouseY = pyautogui.position()
pyautogui.moveTo(int(x_cords[i]), int(y_cords[i]))
# print("Gonna Click",x_cords[i],y_cords[i])
pyautogui.click(clicks=2)
pyautogui.click(button='middle')
pyautogui.click()
def delete(listbox):
global things
# Delete from Listbox
selection = list_box.curselection()
list_box.delete(selection[0])
# Delete from list that provided it
value = eval(list_box.get(selection[0]))
ind = things.index(value)
del (things[ind])
popup = Menu(root, tearoff=0)
popup.add_command(label='Run list', command=run_list)
popup.add_command(label='Exit', command=self.EXITME)
def do_popup(event):
# display the popup menu
try:
popup.tk_popup(event.x_root, event.y_root, 0)
finally:
# make sure to release the grab (Tk 8.0a1 only)
popup.grab_release()
root.bind("<Button-3>", do_popup)
root.mainloop()
def clicked():
try:
os.startfile("AutoClickerContactPage.exe")
except:
messagebox.showerror("ERROR", "AutoClickerContactPage.exe is missing")
pass
def clicked2():
try:
os.startfile("AutoClickerMegaSpam.exe")
except:
messagebox.showerror("Error", "AutoClickerMegaSpam.exe is missing")
pass
def Finder():
try:
os.startfile("AutoClickerMouseCoordinatesPage.exe")
except:
messagebox.showerror("ERROR", "AutoClickerMouseCoordinatesPage.exe is missing")
pass
ttk.Button(self, text="List Coordinates", command=clicked3).grid(row=7, column=3, sticky="ew")
ttk.Button(self, text="Find Coordinates", command=Finder).grid(row=6, column=3, sticky="ew")
def settings():
window = Tk()
window.title("Settings")
window.geometry('330x115')
try:
window.iconbitmap('favicon.ico')
except:
pass
window.resizable(False, False)
window.geometry("+0+0")
window.attributes("-topmost", True)
def callBackFunc():
your_gui.overrideredirect(True)
window.destroy()
def ExitWindow():
window.destroy()
def Full_screen():
your_gui.attributes('-fullscreen', True)
your_gui.bind('<Escape>', lambda e: root.destroy())
window.destroy()
def Exit_Full_Screen():
python = sys.executable
os.execl(python, python, * sys.argv)
def Show_Title_bar():
python = sys.executable
os.execl(python, python, * sys.argv)
ttk.Label(window, text="Settings").grid(column=0, row=1, sticky="ew")
ttk.Button(window, text=" Exit Settings ", command=ExitWindow).grid(column=0, row= 6)
ttk.Button(window, text="FullScreen", command=Full_screen).grid(column=0, row=3, sticky="ew")
ttk.Button(window, text="Exit FullScreen", command=Exit_Full_Screen).grid(column=1, row=3, sticky="ew")
ttk.Button(window, text="Hide Title Bar ", command=callBackFunc).grid(column=0, row=5, sticky="ew")
ttk.Button(window, text="Show Title Bar", command=Show_Title_bar).grid(column=1, row=5, sticky="ew")
ttk.Button(window, text="Restart program", command=Show_Title_bar).grid(column=1, row=6, sticky="ew")
popup = Menu(your_gui, tearoff=0)
popup.add_command(label="FullScreen", command=Full_screen)
popup.add_command(label="Exit FullScreen", command=Exit_Full_Screen)
popup.add_command(label="Hide Title Bar", command=callBackFunc)
popup.add_command(label="Show Title Bar", command=Show_Title_bar)
popup.add_command(label="Restart program", command=Show_Title_bar)
popup.add_command(label="Exit Settings", command=ExitWindow)
def do_popup(event):
try:
popup.tk_popup(event.x_root, event.y_root, 0)
finally:
popup.grab_release()
window.bind("<Button-3>", do_popup)
window.mainloop()
def OpenOldWindow():
your_gui.destroy()
OldStyleGUI()
# Menu Bar!! ⬇
menu = Menu(self)
new_item = Menu(menu)
new_item.add_command(label='About', command=callback)
new_item.add_command(label='Github Page', command=callback2)
new_item.add_command(label='Auto Clicker Mega Spam', command=clicked2)
new_item.add_command(label='Version Number', command=NOTIFICATION)
new_item.add_command(label='Old Style GUI', command=OpenOldWindow)
new_item.add_command(label='Settings', command=settings)
new_item.add_command(label='List of Coordinates', command=clicked3)
new_item.add_command(label='Coordinates Finder', command=Finder)
new_item.add_command(label='Send Feedback', command=feedback)
new_item.add_command(label='Colour/Color Clicker', command=Colour_Clicker)
new_item.add_command(label='Locate and Click', command=Locate_Click)
new_item.add_separator()
new_item.add_command(label='Start', command=self.do_conversion)
new_item.add_command(label='Exit', command=self.EXITME)
menu.add_cascade(label='Menu', menu=new_item)
new_item2 = Menu(menu)
new_item2.add_command(label='Tutorial', command=tutorial)
menu.add_cascade(label='Help', menu=new_item2)
new_item2.add_command(label='Contact', command=clicked)
self.config(menu=menu)
tk.Label(self, text="Keyboard key to stop clicking:", background="#e7dff2").grid(row=1, column=2)
popup = Menu(self, tearoff=0)
popup.add_command(label="About", command=callback) # , command=next) etc...
popup.add_command(label='GitHub Page', command=callback2)
popup.add_command(label='Send Feedback', command=feedback)
popup.add_command(label='Locate and Click', command=Locate_Click)
popup.add_command(label='Auto Clicker Mega Spam', command=clicked2)
popup.add_command(label='Version Number', command=NOTIFICATION)
popup.add_command(label='Old Style Gui', command=OpenOldWindow)
popup.add_command(label='Settings', command=settings)
popup.add_command(label='List of coordinates', command=clicked3)
popup.add_command(label='Colour/Color Clicker', command=Colour_Clicker)
popup.add_command(label='Find Coordinates', command=Finder)
popup.add_separator()
popup.add_command(label='Start', command=self.do_conversion)
popup.add_command(label='Exit', command=self.EXITME)
def do_popup(event):
# display the popup menu
try:
popup.tk_popup(event.x_root, event.y_root, 0)
finally:
# make sure to release the grab (Tk 8.0a1 only)
popup.grab_release()
self.bind("<Button-3>", do_popup)
def EXITME(self):
YourGUI.destroy(self)
def startclick(self):
x1 = threading.Thread(target=self.do_conversion, daemon=True)
x1.start()
def do_conversion(self):
if self.cmb.get() == "Left Click":
y = self.inputY.get()
x = self.inputX.get()
running = True
try:
x = int(x)
y = int(y)
except:
messagebox.showerror('Invalid point', 'Invalid point')
YourGUI.destroy(self)
while running:
pyautogui.FAILSAFE = False
pyautogui.click(x, y)
if keyboard.is_pressed(self.inputhotkey.get()):
running = False
num= int(self.inputdelayentry.get())
start_time = datetime.datetime.now()
while (datetime.datetime.now() - start_time).total_seconds() < num:
if keyboard.is_pressed(self.inputhotkey.get()):
exit(0)
else:
pass
elif self.cmb.get() == "Right Click":
y = self.inputY.get()
x = self.inputX.get()
running = True
try:
x = int(x)
y = int(y)
except:
messagebox.showerror('Invalid point', 'Invalid point')
YourGUI.destroy(self)
while running:
pyautogui.FAILSAFE = False # disables the fail-safe
pyautogui.click(button='right')
pyautogui.click(x, y)
time.sleep(int(self.inputdelayentry.get()))
num= int(self.inputdelayentry.get())
start_time = datetime.datetime.now()
while (datetime.datetime.now() - start_time).total_seconds() < num:
if keyboard.is_pressed(self.inputhotkey.get()):
exit(0)
else:
pass
if keyboard.is_pressed(self.inputhotkey.get()):
break
elif self.cmb.get() == "Middle Click":
y = self.inputY.get()
x = self.inputX.get()
running = True
try:
x = int(x)
y = int(y)
except:
messagebox.showerror('Invalid point', 'Invalid point')
YourGUI.destroy(self)
while running:
pyautogui.FAILSAFE = False
pyautogui.click(button='middle')
pyautogui.click(x, y)
time.sleep(int(self.inputdelayentry.get()))
num= int(self.inputdelayentry.get())
start_time = datetime.datetime.now()
while (datetime.datetime.now() - start_time).total_seconds() < num:
if keyboard.is_pressed(self.inputhotkey.get()):
exit(0)
else:
pass
if keyboard.is_pressed(self.inputhotkey.get()):
break
elif self.cmb.get() == "Double Right Click":
y = self.inputY.get()
x = self.inputX.get()
running = True
try:
x = int(x)
y = int(y)
except:
messagebox.showerror('Invalid point', 'Invalid point')
YourGUI.destroy(self)
while running:
pyautogui.FAILSAFE = False
pyautogui.click(clicks=2)
pyautogui.click(button='right')
pyautogui.click(x, y)
time.sleep(int(self.inputdelayentry.get()))
num= int(self.inputdelayentry.get())
start_time = datetime.datetime.now()
while (datetime.datetime.now() - start_time).total_seconds() < num:
if keyboard.is_pressed(self.inputhotkey.get()):
exit(0)
else:
pass
if keyboard.is_pressed(self.inputhotkey.get()):
break
elif self.cmb.get() == "Double Left Click":
y = self.inputY.get()
x = self.inputX.get()
running = True
try:
x = int(x)
y = int(y)
except:
messagebox.showerror('Invalid point', 'Invalid point')
YourGUI.destroy(self)
while running:
pyautogui.FAILSAFE = False
pyautogui.click(clicks=2)
pyautogui.click(button='left')
pyautogui.click(x, y)
time.sleep(int(self.inputdelayentry.get()))
num= int(self.inputdelayentry.get())
start_time = datetime.datetime.now()
while (datetime.datetime.now() - start_time).total_seconds() < num:
if keyboard.is_pressed(self.inputhotkey.get()):
exit(0)
else:
pass
if keyboard.is_pressed(self.inputhotkey.get()):
break
elif self.cmb.get() == "Double Middle Click":
y = self.inputY.get()
x = self.inputX.get()
running = True
try:
x = int(x)
y = int(y)
except:
messagebox.showerror('Invalid point', 'Invalid point')
YourGUI.destroy(self)
while running:
pyautogui.FAILSAFE = False
pyautogui.click(clicks=2)
pyautogui.click(button='middle')
pyautogui.click(x, y)
time.sleep(int(self.inputdelayentry.get()))
num= int(self.inputdelayentry.get())
start_time = datetime.datetime.now()
while (datetime.datetime.now() - start_time).total_seconds() < num:
if keyboard.is_pressed(self.inputhotkey.get()):
exit(0)
else:
pass
if keyboard.is_pressed(self.inputhotkey.get()):
break
def action():
YourGUI.destroy()
def getdelay(self):
tx = self.getinputdelayentry.get()
def do_hotkey(self):
hotkey = self.inputhotkey.get()
if __name__ == '__main__':
your_gui = YourGUI()
your_gui.geometry("+300+300")
your_gui.attributes("-topmost", True)
your_gui.title('AutoClicker') # Set title
try:
your_gui.iconbitmap('favicon.ico')
except:
pass
your_gui.resizable(False, False)
your_gui.configure(background="#e7dff2")
your_gui.mainloop()
time.sleep(0)
MAINWINDOW_NEWSTYLE()
| 40.358626
| 172
| 0.487416
| 5,509
| 56,381
| 4.874024
| 0.083681
| 0.027559
| 0.040222
| 0.031284
| 0.83982
| 0.826263
| 0.811553
| 0.794421
| 0.782988
| 0.767681
| 0
| 0.018364
| 0.402157
| 56,381
| 1,396
| 173
| 40.387536
| 0.777939
| 0.035367
| 0
| 0.790338
| 0
| 0.001932
| 0.092302
| 0.006149
| 0
| 0
| 0.000222
| 0
| 0
| 1
| 0.062802
| false
| 0.030918
| 0.021256
| 0
| 0.090821
| 0.003865
| 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
|
b9de759ae0fa0e20d4d4d6934eeddea78ccf4b31
| 148
|
py
|
Python
|
test/test_del_group.py
|
TienaViena/task_1
|
df8bb6d94e383e889c199a45ac7addef7a6bbcbc
|
[
"Apache-2.0"
] | 1
|
2021-02-15T21:07:48.000Z
|
2021-02-15T21:07:48.000Z
|
test/test_del_group.py
|
TienaViena/task_1
|
df8bb6d94e383e889c199a45ac7addef7a6bbcbc
|
[
"Apache-2.0"
] | null | null | null |
test/test_del_group.py
|
TienaViena/task_1
|
df8bb6d94e383e889c199a45ac7addef7a6bbcbc
|
[
"Apache-2.0"
] | null | null | null |
def test_delete_first_group(app):
app.session.login(name="admin", password="secret")
app.group.delete_first_group()
app.session.logout()
| 37
| 54
| 0.736486
| 21
| 148
| 4.952381
| 0.619048
| 0.211538
| 0.307692
| 0.365385
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.114865
| 148
| 4
| 55
| 37
| 0.793893
| 0
| 0
| 0
| 0
| 0
| 0.073826
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0.25
| 0
| 0
| 0.25
| 0
| 1
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 7
|
b9f066170f222c9c123ff8d05efeea66e2584919
| 22,818
|
py
|
Python
|
tests/dhcpv6/multiple_IA/test_v6_multiple_ia.py
|
shawnmullaney/forge
|
aaaef0a0645f73d24666aab6a400f3604e753aac
|
[
"0BSD"
] | null | null | null |
tests/dhcpv6/multiple_IA/test_v6_multiple_ia.py
|
shawnmullaney/forge
|
aaaef0a0645f73d24666aab6a400f3604e753aac
|
[
"0BSD"
] | null | null | null |
tests/dhcpv6/multiple_IA/test_v6_multiple_ia.py
|
shawnmullaney/forge
|
aaaef0a0645f73d24666aab6a400f3604e753aac
|
[
"0BSD"
] | null | null | null |
"""Multiple Identity Association Option in single DHCPv6 message"""
# pylint: disable=invalid-name,line-too-long
import pytest
import srv_msg
import srv_control
import misc
@pytest.mark.v6
@pytest.mark.dhcp6
@pytest.mark.multipleIA
def test_v6_multipleIA_addresses():
# Testing server ability to parse and allocate addresses
# when multiple IA option are included in one message.
# Client Server
# SOLICIT -->
# save IA_NA <-- ADVERTISE
# SOLICIT -->
# save IA_NA <-- ADVERTISE
# SOLICIT -->
# save IA_NA <-- ADVERTISE
# include all IA's REQUEST -->
# <-- REPLY
# Pass Criteria:
# REPLY MUST include option:
# IA-NA
# IA-Address with 3000::1 address
# IA-Address with 3000::2 address
# IA-Address with 3000::3 address
misc.test_setup()
srv_control.config_srv_subnet('3000::/64', '3000::1-3000::3')
srv_control.build_and_send_config_files('SSH', 'config-file')
srv_control.start_srv('DHCP', 'started')
misc.test_procedure()
srv_msg.client_does_include('Client', None, 'client-id')
srv_msg.client_does_include('Client', None, 'IA-NA')
srv_msg.client_send_msg('SOLICIT')
misc.pass_criteria()
srv_msg.send_wait_for_message('MUST', None, 'ADVERTISE')
srv_msg.response_check_include_option('Response', None, '3')
srv_msg.response_check_option_content('Response', '3', None, 'sub-option', '5')
misc.test_procedure()
srv_msg.client_save_option('IA_NA')
srv_msg.generate_new('IA')
srv_msg.client_requests_option('7')
srv_msg.client_does_include('Client', None, 'client-id')
srv_msg.client_does_include('Client', None, 'IA-NA')
srv_msg.client_send_msg('SOLICIT')
misc.pass_criteria()
srv_msg.send_wait_for_message('MUST', None, 'ADVERTISE')
srv_msg.response_check_include_option('Response', None, '3')
srv_msg.response_check_option_content('Response', '3', None, 'sub-option', '5')
misc.test_procedure()
srv_msg.client_save_option('IA_NA')
srv_msg.generate_new('IA')
srv_msg.client_requests_option('7')
srv_msg.client_does_include('Client', None, 'client-id')
srv_msg.client_does_include('Client', None, 'IA-NA')
srv_msg.client_send_msg('SOLICIT')
misc.pass_criteria()
srv_msg.send_wait_for_message('MUST', None, 'ADVERTISE')
srv_msg.response_check_include_option('Response', None, '3')
srv_msg.response_check_option_content('Response', '3', None, 'sub-option', '5')
misc.test_procedure()
srv_msg.client_save_option('IA_NA')
srv_msg.client_copy_option('server-id')
srv_msg.client_add_saved_option(None)
srv_msg.client_does_include('Client', None, 'client-id')
srv_msg.client_send_msg('REQUEST')
misc.pass_criteria()
srv_msg.send_wait_for_message('MUST', None, 'REPLY')
srv_msg.response_check_include_option('Response', None, '3')
srv_msg.response_check_option_content('Response', '3', None, 'sub-option', '5')
srv_msg.response_check_suboption_content('Response', '5', '3', None, 'addr', '3000::1')
srv_msg.response_check_suboption_content('Response', '5', '3', None, 'addr', '3000::2')
srv_msg.response_check_suboption_content('Response', '5', '3', None, 'addr', '3000::3')
@pytest.mark.v6
@pytest.mark.dhcp6
@pytest.mark.multipleIA
def test_v6_multipleIA_addresses_multiple_pools():
# Testing server ability to parse and allocate addresses
# when multiple IA option are included in one message.
# Server is configured with multiple pools within single subnet
# Client Server
# SOLICIT -->
# save IA_NA <-- ADVERTISE
# SOLICIT -->
# save IA_NA <-- ADVERTISE
# SOLICIT -->
# save IA_NA <-- ADVERTISE
# include all IA's REQUEST -->
# <-- REPLY
# Pass Criteria:
# REPLY MUST include option:
# IA-NA
# IA-Address with 3000::1 address
# IA-Address with 3000::2 address
# IA-Address with 3000::3 address
misc.test_setup()
srv_control.config_srv_subnet('3000::/64', '3000::1-3000::1')
srv_control.new_pool('3000::2-3000::2', '0')
srv_control.new_pool('3000::3-3000::3', '0')
srv_control.build_and_send_config_files('SSH', 'config-file')
srv_control.start_srv('DHCP', 'started')
misc.test_procedure()
srv_msg.client_does_include('Client', None, 'client-id')
srv_msg.client_does_include('Client', None, 'IA-NA')
srv_msg.client_send_msg('SOLICIT')
misc.pass_criteria()
srv_msg.send_wait_for_message('MUST', None, 'ADVERTISE')
srv_msg.response_check_include_option('Response', None, '3')
srv_msg.response_check_option_content('Response', '3', None, 'sub-option', '5')
misc.test_procedure()
srv_msg.client_save_option('IA_NA')
srv_msg.generate_new('IA')
srv_msg.client_requests_option('7')
srv_msg.client_does_include('Client', None, 'client-id')
srv_msg.client_does_include('Client', None, 'IA-NA')
srv_msg.client_send_msg('SOLICIT')
misc.pass_criteria()
srv_msg.send_wait_for_message('MUST', None, 'ADVERTISE')
srv_msg.response_check_include_option('Response', None, '3')
srv_msg.response_check_option_content('Response', '3', None, 'sub-option', '5')
misc.test_procedure()
srv_msg.client_save_option('IA_NA')
srv_msg.generate_new('IA')
srv_msg.client_requests_option('7')
srv_msg.client_does_include('Client', None, 'client-id')
srv_msg.client_does_include('Client', None, 'IA-NA')
srv_msg.client_send_msg('SOLICIT')
misc.pass_criteria()
srv_msg.send_wait_for_message('MUST', None, 'ADVERTISE')
srv_msg.response_check_include_option('Response', None, '3')
srv_msg.response_check_option_content('Response', '3', None, 'sub-option', '5')
misc.test_procedure()
srv_msg.client_save_option('IA_NA')
srv_msg.client_copy_option('server-id')
srv_msg.client_add_saved_option(None)
srv_msg.client_does_include('Client', None, 'client-id')
srv_msg.client_send_msg('REQUEST')
misc.pass_criteria()
srv_msg.send_wait_for_message('MUST', None, 'REPLY')
srv_msg.response_check_include_option('Response', None, '3')
srv_msg.response_check_option_content('Response', '3', None, 'sub-option', '5')
srv_msg.response_check_suboption_content('Response', '5', '3', None, 'addr', '3000::1')
srv_msg.response_check_suboption_content('Response', '5', '3', None, 'addr', '3000::2')
srv_msg.response_check_suboption_content('Response', '5', '3', None, 'addr', '3000::3')
@pytest.mark.v6
@pytest.mark.dhcp6
@pytest.mark.multipleIA
def test_v6_multipleIA_addresses_release_success():
# Testing server ability to parse multiple IA's included into message
# and release included addresses.
# Client Server
# SOLICIT -->
# <-- ADVERTISE
# REQUEST -->
# save IA_NA <-- REPLY
# new IA SOLICIT -->
# <-- ADVERTISE
# REQUEST -->
# save IA_NA <-- REPLY
# new IA SOLICIT -->
# <-- ADVERTISE
# REQUEST -->
# save IA_NA <-- REPLY
# include all IA'a RELEASE -->
# <-- REPLY
# Pass Criteria:
# REPLY MUST include option:
# Status code 'success'
misc.test_setup()
srv_control.config_srv_subnet('3000::/64', '3000::1-3000::3')
srv_control.build_and_send_config_files('SSH', 'config-file')
srv_control.start_srv('DHCP', 'started')
misc.test_procedure()
srv_msg.client_does_include('Client', None, 'client-id')
srv_msg.client_does_include('Client', None, 'IA-NA')
srv_msg.client_send_msg('SOLICIT')
misc.pass_criteria()
srv_msg.send_wait_for_message('MUST', None, 'ADVERTISE')
srv_msg.response_check_include_option('Response', None, '3')
srv_msg.response_check_option_content('Response', '3', None, 'sub-option', '5')
misc.test_procedure()
srv_msg.client_copy_option('IA_NA')
srv_msg.client_copy_option('server-id')
srv_msg.client_does_include('Client', None, 'client-id')
srv_msg.client_send_msg('REQUEST')
misc.pass_criteria()
srv_msg.send_wait_for_message('MUST', None, 'REPLY')
misc.test_procedure()
srv_msg.client_save_option('IA_NA')
srv_msg.generate_new('IA')
srv_msg.client_does_include('Client', None, 'client-id')
srv_msg.client_does_include('Client', None, 'IA-NA')
srv_msg.client_send_msg('SOLICIT')
misc.pass_criteria()
srv_msg.send_wait_for_message('MUST', None, 'ADVERTISE')
srv_msg.response_check_include_option('Response', None, '3')
srv_msg.response_check_option_content('Response', '3', None, 'sub-option', '5')
misc.test_procedure()
srv_msg.client_copy_option('IA_NA')
srv_msg.client_copy_option('server-id')
srv_msg.client_does_include('Client', None, 'client-id')
srv_msg.client_send_msg('REQUEST')
misc.pass_criteria()
srv_msg.send_wait_for_message('MUST', None, 'REPLY')
misc.test_procedure()
srv_msg.client_save_option('IA_NA')
srv_msg.generate_new('IA')
srv_msg.client_does_include('Client', None, 'client-id')
srv_msg.client_does_include('Client', None, 'IA-NA')
srv_msg.client_send_msg('SOLICIT')
misc.pass_criteria()
srv_msg.send_wait_for_message('MUST', None, 'ADVERTISE')
srv_msg.response_check_include_option('Response', None, '3')
srv_msg.response_check_option_content('Response', '3', None, 'sub-option', '5')
misc.test_procedure()
srv_msg.client_copy_option('IA_NA')
srv_msg.client_copy_option('server-id')
srv_msg.client_does_include('Client', None, 'client-id')
srv_msg.client_send_msg('REQUEST')
misc.pass_criteria()
srv_msg.send_wait_for_message('MUST', None, 'REPLY')
misc.test_procedure()
srv_msg.client_save_option('IA_NA')
srv_msg.client_copy_option('server-id')
srv_msg.client_add_saved_option('DONT ')
srv_msg.client_does_include('Client', None, 'client-id')
srv_msg.client_send_msg('RELEASE')
misc.pass_criteria()
srv_msg.send_wait_for_message('MUST', None, 'REPLY')
srv_msg.response_check_include_option('Response', None, '13')
srv_msg.response_check_option_content('Response', '13', None, 'status-code', '0')
@pytest.mark.v6
@pytest.mark.dhcp6
@pytest.mark.multipleIA
def test_v6_multipleIA_addresses_release_partial_success():
# Testing server ability to parse multiple IA's included into message
# and release included addresses. One of the IA's are released twice.
# first time: success, next: NoBinding
# Client Server
# SOLICIT -->
# <-- ADVERTISE
# REQUEST -->
# save IA_NA <-- REPLY
# new IA SOLICIT -->
# <-- ADVERTISE
# REQUEST -->
# save IA_NA <-- REPLY
# new IA SOLICIT -->
# <-- ADVERTISE
# REQUEST -->
# save IA_NA <-- REPLY
# include last IA_NA RELEASE -->
# <-- REPLY
# Pass Criteria:
# REPLY MUST include option:
# Status code 'success'
#
# include all IA_NA's RELEASE -->
# <-- REPLY
# Pass Criteria:
# REPLY MUST include option:
# IA_NA option
# IA_Address with status code: NoBinding
misc.test_setup()
srv_control.config_srv_subnet('3000::/64', '3000::1-3000::3')
srv_control.build_and_send_config_files('SSH', 'config-file')
srv_control.start_srv('DHCP', 'started')
misc.test_procedure()
srv_msg.client_does_include('Client', None, 'client-id')
srv_msg.client_does_include('Client', None, 'IA-NA')
srv_msg.client_send_msg('SOLICIT')
misc.pass_criteria()
srv_msg.send_wait_for_message('MUST', None, 'ADVERTISE')
srv_msg.response_check_include_option('Response', None, '3')
srv_msg.response_check_option_content('Response', '3', None, 'sub-option', '5')
misc.test_procedure()
srv_msg.client_copy_option('IA_NA')
srv_msg.client_copy_option('server-id')
srv_msg.client_does_include('Client', None, 'client-id')
srv_msg.client_send_msg('REQUEST')
misc.pass_criteria()
srv_msg.send_wait_for_message('MUST', None, 'REPLY')
misc.test_procedure()
srv_msg.client_save_option('IA_NA')
srv_msg.generate_new('IA')
srv_msg.client_does_include('Client', None, 'client-id')
srv_msg.client_does_include('Client', None, 'IA-NA')
srv_msg.client_send_msg('SOLICIT')
misc.pass_criteria()
srv_msg.send_wait_for_message('MUST', None, 'ADVERTISE')
srv_msg.response_check_include_option('Response', None, '3')
srv_msg.response_check_option_content('Response', '3', None, 'sub-option', '5')
misc.test_procedure()
srv_msg.client_copy_option('IA_NA')
srv_msg.client_copy_option('server-id')
srv_msg.client_does_include('Client', None, 'client-id')
srv_msg.client_send_msg('REQUEST')
misc.pass_criteria()
srv_msg.send_wait_for_message('MUST', None, 'REPLY')
misc.test_procedure()
srv_msg.client_save_option('IA_NA')
srv_msg.generate_new('IA')
srv_msg.client_does_include('Client', None, 'client-id')
srv_msg.client_does_include('Client', None, 'IA-NA')
srv_msg.client_send_msg('SOLICIT')
misc.pass_criteria()
srv_msg.send_wait_for_message('MUST', None, 'ADVERTISE')
srv_msg.response_check_include_option('Response', None, '3')
srv_msg.response_check_option_content('Response', '3', None, 'sub-option', '5')
misc.test_procedure()
srv_msg.client_copy_option('IA_NA')
srv_msg.client_copy_option('server-id')
srv_msg.client_does_include('Client', None, 'client-id')
srv_msg.client_send_msg('REQUEST')
misc.pass_criteria()
srv_msg.send_wait_for_message('MUST', None, 'REPLY')
misc.test_procedure()
srv_msg.client_save_option('IA_NA')
srv_msg.client_copy_option('IA_NA')
srv_msg.client_copy_option('server-id')
srv_msg.client_does_include('Client', None, 'client-id')
srv_msg.client_send_msg('RELEASE')
misc.pass_criteria()
srv_msg.send_wait_for_message('MUST', None, 'REPLY')
srv_msg.response_check_include_option('Response', None, '13')
srv_msg.response_check_option_content('Response', '13', None, 'status-code', '0')
misc.test_procedure()
srv_msg.client_copy_option('server-id')
srv_msg.client_add_saved_option('DONT ')
srv_msg.client_does_include('Client', None, 'client-id')
srv_msg.client_send_msg('RELEASE')
misc.pass_criteria()
srv_msg.send_wait_for_message('MUST', None, 'REPLY')
srv_msg.response_check_include_option('Response', None, '13')
# Response option 13 MUST contain status-code 0. IS IT TRURE? RFC 3315 is not clear about that.
srv_msg.response_check_include_option('Response', None, '3')
srv_msg.response_check_option_content('Response', '3', None, 'sub-option', '13')
srv_msg.response_check_suboption_content('Response', '13', '3', None, 'statuscode', '3')
@pytest.mark.v6
@pytest.mark.dhcp6
@pytest.mark.multipleIA
def test_v6_multipleIA_addresses_rebind_partial_success():
# Testing servers ability to rebind two IA form three received
# One IA_NA released before.
# Client Server
# SOLICIT -->
# <-- ADVERTISE
# REQUEST -->
# save IA_NA <-- REPLY
# new IA SOLICIT -->
# <-- ADVERTISE
# REQUEST -->
# save IA_NA <-- REPLY
# new IA SOLICIT -->
# <-- ADVERTISE
# REQUEST -->
# save IA_NA <-- REPLY
# include last IA_NA RELEASE -->
# <-- REPLY
# include all IA_NA's REBIND -->
# <-- REPLY
# Pass Criteria:
# REPLY MUST include option:
# IA_NA option (for T1/T2)
# IA_Address (for lifetimes)
# IA_Address (for lifetimes)
# One status code/error? RFC is not clear
# abut what should happen in such case.
misc.test_setup()
srv_control.config_srv_subnet('3000::/64', '3000::1-3000::3')
srv_control.build_and_send_config_files('SSH', 'config-file')
srv_control.start_srv('DHCP', 'started')
misc.test_procedure()
srv_msg.client_does_include('Client', None, 'client-id')
srv_msg.client_does_include('Client', None, 'IA-NA')
srv_msg.client_send_msg('SOLICIT')
misc.pass_criteria()
srv_msg.send_wait_for_message('MUST', None, 'ADVERTISE')
srv_msg.response_check_include_option('Response', None, '3')
srv_msg.response_check_option_content('Response', '3', None, 'sub-option', '5')
misc.test_procedure()
srv_msg.client_copy_option('IA_NA')
srv_msg.client_copy_option('server-id')
srv_msg.client_does_include('Client', None, 'client-id')
srv_msg.client_send_msg('REQUEST')
misc.pass_criteria()
srv_msg.send_wait_for_message('MUST', None, 'REPLY')
misc.test_procedure()
srv_msg.client_save_option('IA_NA')
srv_msg.generate_new('IA')
srv_msg.client_does_include('Client', None, 'client-id')
srv_msg.client_does_include('Client', None, 'IA-NA')
srv_msg.client_send_msg('SOLICIT')
misc.pass_criteria()
srv_msg.send_wait_for_message('MUST', None, 'ADVERTISE')
srv_msg.response_check_include_option('Response', None, '3')
srv_msg.response_check_option_content('Response', '3', None, 'sub-option', '5')
misc.test_procedure()
srv_msg.client_copy_option('IA_NA')
srv_msg.client_copy_option('server-id')
srv_msg.client_does_include('Client', None, 'client-id')
srv_msg.client_send_msg('REQUEST')
misc.pass_criteria()
srv_msg.send_wait_for_message('MUST', None, 'REPLY')
misc.test_procedure()
srv_msg.client_save_option('IA_NA')
srv_msg.generate_new('IA')
srv_msg.client_does_include('Client', None, 'client-id')
srv_msg.client_does_include('Client', None, 'IA-NA')
srv_msg.client_send_msg('SOLICIT')
misc.pass_criteria()
srv_msg.send_wait_for_message('MUST', None, 'ADVERTISE')
srv_msg.response_check_include_option('Response', None, '3')
srv_msg.response_check_option_content('Response', '3', None, 'sub-option', '5')
misc.test_procedure()
srv_msg.client_copy_option('IA_NA')
srv_msg.client_copy_option('server-id')
srv_msg.client_does_include('Client', None, 'client-id')
srv_msg.client_send_msg('REQUEST')
misc.pass_criteria()
srv_msg.send_wait_for_message('MUST', None, 'REPLY')
misc.test_procedure()
srv_msg.client_save_option('IA_NA')
srv_msg.client_copy_option('IA_NA')
srv_msg.client_copy_option('server-id')
srv_msg.client_does_include('Client', None, 'client-id')
srv_msg.client_send_msg('RELEASE')
misc.pass_criteria()
srv_msg.send_wait_for_message('MUST', None, 'REPLY')
srv_msg.response_check_include_option('Response', None, '13')
srv_msg.response_check_option_content('Response', '13', None, 'status-code', '0')
misc.test_procedure()
srv_msg.client_add_saved_option(None)
srv_msg.client_does_include('Client', None, 'client-id')
srv_msg.client_send_msg('REBIND')
misc.pass_criteria()
srv_msg.send_wait_for_message('MUST', None, 'REPLY')
srv_msg.response_check_include_option('Response', None, '3')
srv_msg.response_check_option_content('Response', '3', None, 'sub-option', '5')
# Response option 3 MUST contain sub-option 13. changed due to RFC 7550
# Response sub-option 13 from option 3 MUST contain statuscode 3.
@pytest.mark.v6
@pytest.mark.dhcp6
@pytest.mark.multipleIA
def test_v6_multipleIA_addresses_noaddravail():
# Testing server ability to assign two addresses and
# send one status code: NoAddrAvail in one message.
# Client Server
# SOLICIT -->
# save IA_NA <-- ADVERTISE
# new IA SOLICIT -->
# save IA_NA <-- ADVERTISE
# new IA SOLICIT -->
# save IA_NA <-- ADVERTISE
# with all IA_NA's REQUEST -->
# <-- REPLY
# Pass Criteria:
# REPLY MUST include option:
# IA_NA option
# IA_Address with address 3000::1
# IA_Address with address 3000::2
# IA_NA with status code: NoAddrAvail
misc.test_setup()
srv_control.config_srv_subnet('3000::/64', '3000::1-3000::2')
srv_control.build_and_send_config_files('SSH', 'config-file')
srv_control.start_srv('DHCP', 'started')
misc.test_procedure()
srv_msg.client_does_include('Client', None, 'client-id')
srv_msg.client_does_include('Client', None, 'IA-NA')
srv_msg.client_send_msg('SOLICIT')
misc.pass_criteria()
srv_msg.send_wait_for_message('MUST', None, 'ADVERTISE')
srv_msg.response_check_include_option('Response', None, '3')
srv_msg.response_check_option_content('Response', '3', None, 'sub-option', '5')
misc.test_procedure()
srv_msg.client_save_option('IA_NA')
srv_msg.generate_new('IA')
srv_msg.client_requests_option('7')
srv_msg.client_does_include('Client', None, 'client-id')
srv_msg.client_does_include('Client', None, 'IA-NA')
srv_msg.client_send_msg('SOLICIT')
misc.pass_criteria()
srv_msg.send_wait_for_message('MUST', None, 'ADVERTISE')
srv_msg.response_check_include_option('Response', None, '3')
srv_msg.response_check_option_content('Response', '3', None, 'sub-option', '5')
misc.test_procedure()
srv_msg.client_save_option('IA_NA')
srv_msg.generate_new('IA')
srv_msg.client_requests_option('7')
srv_msg.client_does_include('Client', None, 'client-id')
srv_msg.client_does_include('Client', None, 'IA-NA')
srv_msg.client_send_msg('SOLICIT')
misc.pass_criteria()
srv_msg.send_wait_for_message('MUST', None, 'ADVERTISE')
srv_msg.response_check_include_option('Response', None, '3')
srv_msg.response_check_option_content('Response', '3', None, 'sub-option', '5')
misc.test_procedure()
srv_msg.client_save_option('IA_NA')
srv_msg.client_copy_option('server-id')
srv_msg.client_add_saved_option('DONT ')
srv_msg.client_does_include('Client', None, 'client-id')
srv_msg.client_send_msg('REQUEST')
misc.pass_criteria()
srv_msg.send_wait_for_message('MUST', None, 'REPLY')
srv_msg.response_check_include_option('Response', None, '3')
srv_msg.response_check_option_content('Response', '3', None, 'sub-option', '5')
srv_msg.response_check_suboption_content('Response', '5', '3', None, 'addr', '3000::1')
srv_msg.response_check_suboption_content('Response', '5', '3', None, 'addr', '3000::2')
srv_msg.response_check_option_content('Response', '3', None, 'sub-option', '13')
srv_msg.response_check_suboption_content('Response', '13', '3', None, 'statuscode', '2')
| 38.157191
| 99
| 0.68183
| 3,171
| 22,818
| 4.561337
| 0.046673
| 0.10661
| 0.120299
| 0.084071
| 0.943446
| 0.936048
| 0.936048
| 0.936048
| 0.935564
| 0.935564
| 0
| 0.019028
| 0.177754
| 22,818
| 597
| 100
| 38.221106
| 0.751892
| 0.169471
| 0
| 0.955263
| 0
| 0
| 0.160555
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.015789
| true
| 0.092105
| 0.010526
| 0
| 0.026316
| 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
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 9
|
6a34b610b58771df06e80cbb598b8a8c703cab41
| 19,824
|
py
|
Python
|
tests/test__routines.py
|
noviksv/aws-data-wrangler
|
344c75f0195c6a27b70181c7101caf45e8cd2e78
|
[
"Apache-2.0"
] | 2,695
|
2019-03-01T00:38:08.000Z
|
2022-03-31T16:09:38.000Z
|
tests/test__routines.py
|
noviksv/aws-data-wrangler
|
344c75f0195c6a27b70181c7101caf45e8cd2e78
|
[
"Apache-2.0"
] | 977
|
2019-08-15T22:13:37.000Z
|
2022-03-31T15:19:58.000Z
|
tests/test__routines.py
|
noviksv/aws-data-wrangler
|
344c75f0195c6a27b70181c7101caf45e8cd2e78
|
[
"Apache-2.0"
] | 475
|
2019-05-01T04:24:50.000Z
|
2022-03-31T22:08:09.000Z
|
import logging
import pandas as pd
import pytest
import awswrangler as wr
logging.getLogger("awswrangler").setLevel(logging.DEBUG)
@pytest.mark.parametrize("use_threads", [True, False])
@pytest.mark.parametrize("concurrent_partitioning", [True, False])
@pytest.mark.parametrize("table_type", ["EXTERNAL_TABLE", "GOVERNED"])
def test_routine_0(glue_database, glue_table, table_type, path, use_threads, concurrent_partitioning):
# Round 1 - Warm up
df = pd.DataFrame({"c0": [0, None]}, dtype="Int64")
wr.s3.to_parquet(
df=df,
path=path,
dataset=True,
mode="overwrite",
database=glue_database,
table=glue_table,
table_type=table_type,
description="c0",
parameters={"num_cols": str(len(df.columns)), "num_rows": str(len(df.index))},
columns_comments={"c0": "0"},
use_threads=use_threads,
concurrent_partitioning=concurrent_partitioning,
)
if table_type == "GOVERNED":
df2 = wr.lakeformation.read_sql_table(glue_table, glue_database, use_threads=use_threads)
else:
df2 = wr.athena.read_sql_table(glue_table, glue_database, use_threads=use_threads)
assert df.shape == df2.shape
assert df.c0.sum() == df2.c0.sum()
parameters = wr.catalog.get_table_parameters(glue_database, glue_table)
assert len(parameters) >= 5
assert parameters["num_cols"] == str(len(df2.columns))
assert parameters["num_rows"] == str(len(df2.index))
assert wr.catalog.get_table_description(glue_database, glue_table) == "c0"
comments = wr.catalog.get_columns_comments(glue_database, glue_table)
assert len(comments) == len(df.columns)
assert comments["c0"] == "0"
# Round 2 - Overwrite
df = pd.DataFrame({"c1": [None, 1, None]}, dtype="Int16")
wr.s3.to_parquet(
df=df,
dataset=True,
mode="overwrite",
database=glue_database,
table=glue_table,
description="c1",
parameters={"num_cols": str(len(df.columns)), "num_rows": str(len(df.index))},
columns_comments={"c1": "1"},
use_threads=use_threads,
concurrent_partitioning=concurrent_partitioning,
)
if table_type == "GOVERNED":
df2 = wr.lakeformation.read_sql_table(glue_table, glue_database, use_threads=use_threads)
else:
df2 = wr.athena.read_sql_table(glue_table, glue_database, use_threads=use_threads)
assert df.shape == df2.shape
assert df.c1.sum() == df2.c1.sum()
parameters = wr.catalog.get_table_parameters(glue_database, glue_table)
assert len(parameters) >= 5
assert parameters["num_cols"] == str(len(df2.columns))
assert parameters["num_rows"] == str(len(df2.index))
assert wr.catalog.get_table_description(glue_database, glue_table) == "c1"
comments = wr.catalog.get_columns_comments(glue_database, glue_table)
assert len(comments) == len(df.columns)
assert comments["c1"] == "1"
# Round 3 - Append
df = pd.DataFrame({"c1": [None, 2, None]}, dtype="Int8")
wr.s3.to_parquet(
df=df,
path=path,
dataset=True,
mode="append",
database=glue_database,
table=glue_table,
description="c1",
parameters={"num_cols": str(len(df.columns)), "num_rows": str(len(df.index) * 2)},
columns_comments={"c1": "1"},
use_threads=use_threads,
concurrent_partitioning=concurrent_partitioning,
)
if table_type == "GOVERNED":
df2 = wr.lakeformation.read_sql_table(glue_table, glue_database, use_threads=use_threads)
else:
df2 = wr.athena.read_sql_table(glue_table, glue_database, use_threads=use_threads)
assert len(df.columns) == len(df2.columns)
assert len(df.index) * 2 == len(df2.index)
assert df.c1.sum() + 1 == df2.c1.sum()
parameters = wr.catalog.get_table_parameters(glue_database, glue_table)
assert len(parameters) >= 5
assert parameters["num_cols"] == str(len(df2.columns))
assert parameters["num_rows"] == str(len(df2.index))
assert wr.catalog.get_table_description(glue_database, glue_table) == "c1"
comments = wr.catalog.get_columns_comments(glue_database, glue_table)
assert len(comments) == len(df.columns)
assert comments["c1"] == "1"
# Round 4 - Append + New Column
df = pd.DataFrame({"c2": ["a", None, "b"], "c1": [None, None, None]})
wr.s3.to_parquet(
df=df,
dataset=True,
mode="append",
database=glue_database,
table=glue_table,
description="c1+c2",
parameters={"num_cols": "2", "num_rows": "9"},
columns_comments={"c1": "1", "c2": "2"},
use_threads=use_threads,
concurrent_partitioning=concurrent_partitioning,
)
if table_type == "GOVERNED":
df2 = wr.lakeformation.read_sql_table(glue_table, glue_database, use_threads=use_threads)
else:
df2 = wr.athena.read_sql_table(glue_table, glue_database, use_threads=use_threads)
assert len(df2.columns) == 2
assert len(df2.index) == 9
assert df2.c1.sum() == 3
parameters = wr.catalog.get_table_parameters(glue_database, glue_table)
assert len(parameters) >= 5
assert parameters["num_cols"] == "2"
assert parameters["num_rows"] == "9"
assert wr.catalog.get_table_description(glue_database, glue_table) == "c1+c2"
comments = wr.catalog.get_columns_comments(glue_database, glue_table)
assert len(comments) == len(df.columns)
assert comments["c1"] == "1"
assert comments["c2"] == "2"
# Round 5 - Append + New Column + Wrong Types
df = pd.DataFrame({"c2": [1], "c3": [True], "c1": ["1"]})
wr.s3.to_parquet(
df=df,
path=path,
dataset=True,
mode="append",
database=glue_database,
table=glue_table,
description="c1+c2+c3",
parameters={"num_cols": "3", "num_rows": "10"},
columns_comments={"c1": "1!", "c2": "2!", "c3": "3"},
use_threads=use_threads,
concurrent_partitioning=concurrent_partitioning,
)
if table_type == "GOVERNED":
df2 = wr.lakeformation.read_sql_table(glue_table, glue_database, use_threads=use_threads)
else:
df2 = wr.athena.read_sql_table(glue_table, glue_database, use_threads=use_threads)
assert len(df2.columns) == 3
assert len(df2.index) == 10
assert df2.c1.sum() == 4
parameters = wr.catalog.get_table_parameters(glue_database, glue_table)
assert len(parameters) >= 5
assert parameters["num_cols"] == "3"
assert parameters["num_rows"] == "10"
assert wr.catalog.get_table_description(glue_database, glue_table) == "c1+c2+c3"
comments = wr.catalog.get_columns_comments(glue_database, glue_table)
assert len(comments) == len(df.columns)
assert comments["c1"] == "1!"
assert comments["c2"] == "2!"
assert comments["c3"] == "3"
@pytest.mark.parametrize("use_threads", [True, False])
@pytest.mark.parametrize("concurrent_partitioning", [True, False])
@pytest.mark.parametrize("table_type", ["EXTERNAL_TABLE", "GOVERNED"])
def test_routine_1(glue_database, glue_table, table_type, path, use_threads, concurrent_partitioning):
# Round 1 - Overwrite Partitioned
df = pd.DataFrame({"c0": ["foo", None], "c1": [0, 1]})
wr.s3.to_parquet(
df=df,
dataset=True,
path=path,
mode="overwrite",
database=glue_database,
table=glue_table,
table_type=table_type,
partition_cols=["c1"],
description="c0+c1",
parameters={"num_cols": "2", "num_rows": "2"},
columns_comments={"c0": "zero", "c1": "one"},
use_threads=use_threads,
concurrent_partitioning=concurrent_partitioning,
)
if table_type == "GOVERNED":
df2 = wr.lakeformation.read_sql_table(glue_table, glue_database, use_threads=use_threads)
else:
df2 = wr.athena.read_sql_table(glue_table, glue_database, use_threads=use_threads)
assert df.shape == df2.shape
assert df.c1.sum() == df2.c1.sum()
parameters = wr.catalog.get_table_parameters(glue_database, glue_table)
assert len(parameters) >= 5
assert parameters["num_cols"] == "2"
assert parameters["num_rows"] == "2"
assert wr.catalog.get_table_description(glue_database, glue_table) == "c0+c1"
comments = wr.catalog.get_columns_comments(glue_database, glue_table)
assert len(comments) == len(df.columns)
assert comments["c0"] == "zero"
assert comments["c1"] == "one"
# Round 2 - Overwrite Partitions
df = pd.DataFrame({"c0": [None, None], "c1": [0, 2]})
wr.s3.to_parquet(
df=df,
dataset=True,
mode="overwrite_partitions",
database=glue_database,
table=glue_table,
partition_cols=["c1"],
description="c0+c1",
parameters={"num_cols": "2", "num_rows": "3"},
columns_comments={"c0": "zero", "c1": "one"},
concurrent_partitioning=concurrent_partitioning,
use_threads=use_threads,
)
if table_type == "GOVERNED":
df2 = wr.lakeformation.read_sql_table(glue_table, glue_database, use_threads=use_threads)
else:
df2 = wr.athena.read_sql_table(glue_table, glue_database, use_threads=use_threads)
assert len(df2.columns) == 2
assert len(df2.index) == 3
assert df2.c1.sum() == 3
parameters = wr.catalog.get_table_parameters(glue_database, glue_table)
assert len(parameters) >= 5
assert parameters["num_cols"] == "2"
assert parameters["num_rows"] == "3"
assert wr.catalog.get_table_description(glue_database, glue_table) == "c0+c1"
comments = wr.catalog.get_columns_comments(glue_database, glue_table)
assert len(comments) == len(df.columns)
assert comments["c0"] == "zero"
assert comments["c1"] == "one"
# Round 3 - Overwrite Partitions + New Column + Wrong Type
df = pd.DataFrame({"c0": [1, 2], "c1": ["1", "3"], "c2": [True, False]})
wr.s3.to_parquet(
df=df,
dataset=True,
mode="overwrite_partitions",
database=glue_database,
table=glue_table,
partition_cols=["c1"],
description="c0+c1+c2",
parameters={"num_cols": "3", "num_rows": "4"},
columns_comments={"c0": "zero", "c1": "one", "c2": "two"},
use_threads=use_threads,
concurrent_partitioning=concurrent_partitioning,
)
if table_type == "GOVERNED":
df2 = wr.lakeformation.read_sql_table(glue_table, glue_database, use_threads=use_threads)
else:
df2 = wr.athena.read_sql_table(glue_table, glue_database, use_threads=use_threads)
assert len(df2.columns) == 3
assert len(df2.index) == 4
assert df2.c1.sum() == 6
parameters = wr.catalog.get_table_parameters(glue_database, glue_table)
assert len(parameters) >= 5
assert parameters["num_cols"] == "3"
assert parameters["num_rows"] == "4"
assert wr.catalog.get_table_description(glue_database, glue_table) == "c0+c1+c2"
comments = wr.catalog.get_columns_comments(glue_database, glue_table)
assert len(comments) == len(df.columns)
assert comments["c0"] == "zero"
assert comments["c1"] == "one"
assert comments["c2"] == "two"
def test_routine_2(glue_database, glue_table, path):
# Round 1 - Warm up
df = pd.DataFrame({"c0": [0, None]}, dtype="Int64")
wr.s3.to_parquet(df=df, path=path, dataset=True, mode="overwrite")
wr.s3.store_parquet_metadata(
path=path,
dataset=True,
mode="overwrite",
database=glue_database,
table=glue_table,
description="c0",
parameters={"num_cols": str(len(df.columns)), "num_rows": str(len(df.index))},
columns_comments={"c0": "0"},
)
assert wr.catalog.get_table_number_of_versions(table=glue_table, database=glue_database) == 1
df2 = wr.athena.read_sql_table(glue_table, glue_database)
assert df.shape == df2.shape
assert df.c0.sum() == df2.c0.sum()
parameters = wr.catalog.get_table_parameters(glue_database, glue_table)
assert len(parameters) >= 5
assert parameters["num_cols"] == str(len(df2.columns))
assert parameters["num_rows"] == str(len(df2.index))
assert wr.catalog.get_table_description(glue_database, glue_table) == "c0"
comments = wr.catalog.get_columns_comments(glue_database, glue_table)
assert len(comments) == len(df.columns)
assert comments["c0"] == "0"
# Round 2 - Overwrite
df = pd.DataFrame({"c1": [None, 1, None]}, dtype="Int16")
wr.s3.to_parquet(df=df, path=path, dataset=True, mode="overwrite")
wr.s3.store_parquet_metadata(
path=path,
dataset=True,
mode="overwrite",
database=glue_database,
table=glue_table,
description="c1",
parameters={"num_cols": str(len(df.columns)), "num_rows": str(len(df.index))},
columns_comments={"c1": "1"},
)
assert wr.catalog.get_table_number_of_versions(table=glue_table, database=glue_database) == 1
df2 = wr.athena.read_sql_table(glue_table, glue_database)
assert df.shape == df2.shape
assert df.c1.sum() == df2.c1.sum()
parameters = wr.catalog.get_table_parameters(glue_database, glue_table)
assert len(parameters) >= 5
assert parameters["num_cols"] == str(len(df2.columns))
assert parameters["num_rows"] == str(len(df2.index))
assert wr.catalog.get_table_description(glue_database, glue_table) == "c1"
comments = wr.catalog.get_columns_comments(glue_database, glue_table)
assert len(comments) == len(df.columns)
assert comments["c1"] == "1"
# Round 3 - Append
df = pd.DataFrame({"c1": [None, 2, None]}, dtype="Int16")
wr.s3.to_parquet(df=df, path=path, dataset=True, mode="append")
wr.s3.store_parquet_metadata(
path=path,
dataset=True,
mode="append",
database=glue_database,
table=glue_table,
description="c1",
parameters={"num_cols": str(len(df.columns)), "num_rows": str(len(df.index) * 2)},
columns_comments={"c1": "1"},
)
assert wr.catalog.get_table_number_of_versions(table=glue_table, database=glue_database) == 1
df2 = wr.athena.read_sql_table(glue_table, glue_database)
assert len(df.columns) == len(df2.columns)
assert len(df.index) * 2 == len(df2.index)
assert df.c1.sum() + 1 == df2.c1.sum()
parameters = wr.catalog.get_table_parameters(glue_database, glue_table)
assert len(parameters) >= 5
assert parameters["num_cols"] == str(len(df2.columns))
assert parameters["num_rows"] == str(len(df2.index))
assert wr.catalog.get_table_description(glue_database, glue_table) == "c1"
comments = wr.catalog.get_columns_comments(glue_database, glue_table)
assert len(comments) == len(df.columns)
assert comments["c1"] == "1"
# Round 4 - Append + New Column
df = pd.DataFrame({"c2": ["a", None, "b"], "c1": [None, 1, None]})
df["c1"] = df["c1"].astype("Int16")
wr.s3.to_parquet(df=df, path=path, dataset=True, mode="append")
wr.s3.store_parquet_metadata(
path=path,
dataset=True,
mode="append",
database=glue_database,
table=glue_table,
description="c1+c2",
parameters={"num_cols": "2", "num_rows": "9"},
columns_comments={"c1": "1", "c2": "2"},
)
assert wr.catalog.get_table_number_of_versions(table=glue_table, database=glue_database) == 1
df2 = wr.athena.read_sql_table(glue_table, glue_database)
assert len(df2.columns) == 2
assert len(df2.index) == 9
assert df2.c1.sum() == 4
parameters = wr.catalog.get_table_parameters(glue_database, glue_table)
assert len(parameters) >= 5
assert parameters["num_cols"] == "2"
assert parameters["num_rows"] == "9"
assert wr.catalog.get_table_description(glue_database, glue_table) == "c1+c2"
comments = wr.catalog.get_columns_comments(glue_database, glue_table)
assert len(comments) == len(df.columns)
assert comments["c1"] == "1"
assert comments["c2"] == "2"
# Round 5 - Overwrite Partitioned
df = pd.DataFrame({"c0": ["foo", None], "c1": [0, 1]})
wr.s3.to_parquet(df=df, path=path, dataset=True, mode="overwrite", partition_cols=["c1"])
wr.s3.store_parquet_metadata(
path=path,
dataset=True,
mode="overwrite",
database=glue_database,
table=glue_table,
description="c0+c1",
parameters={"num_cols": "2", "num_rows": "2"},
columns_comments={"c0": "zero", "c1": "one"},
)
assert wr.catalog.get_table_number_of_versions(table=glue_table, database=glue_database) == 1
df2 = wr.athena.read_sql_table(glue_table, glue_database)
assert df.shape == df2.shape
assert df.c1.sum() == df2.c1.astype(int).sum()
parameters = wr.catalog.get_table_parameters(glue_database, glue_table)
assert len(parameters) >= 5
assert parameters["num_cols"] == "2"
assert parameters["num_rows"] == "2"
assert wr.catalog.get_table_description(glue_database, glue_table) == "c0+c1"
comments = wr.catalog.get_columns_comments(glue_database, glue_table)
assert len(comments) == len(df.columns)
assert comments["c0"] == "zero"
assert comments["c1"] == "one"
# Round 6 - Overwrite Partitions
df = pd.DataFrame({"c0": [None, "boo"], "c1": [0, 2]})
wr.s3.to_parquet(df=df, path=path, dataset=True, mode="overwrite_partitions", partition_cols=["c1"])
wr.s3.store_parquet_metadata(
path=path,
dataset=True,
mode="append",
database=glue_database,
table=glue_table,
description="c0+c1",
parameters={"num_cols": "2", "num_rows": "3"},
columns_comments={"c0": "zero", "c1": "one"},
)
assert wr.catalog.get_table_number_of_versions(table=glue_table, database=glue_database) == 1
df2 = wr.athena.read_sql_table(glue_table, glue_database)
assert len(df2.columns) == 2
assert len(df2.index) == 3
assert df2.c1.astype(int).sum() == 3
parameters = wr.catalog.get_table_parameters(glue_database, glue_table)
assert len(parameters) >= 5
assert parameters["num_cols"] == "2"
assert parameters["num_rows"] == "3"
assert wr.catalog.get_table_description(glue_database, glue_table) == "c0+c1"
comments = wr.catalog.get_columns_comments(glue_database, glue_table)
assert len(comments) == len(df.columns)
assert comments["c0"] == "zero"
assert comments["c1"] == "one"
# Round 7 - Overwrite Partitions + New Column
df = pd.DataFrame({"c0": ["bar", None], "c1": [1, 3], "c2": [True, False]})
wr.s3.to_parquet(df=df, path=path, dataset=True, mode="overwrite_partitions", partition_cols=["c1"])
wr.s3.store_parquet_metadata(
path=path,
dataset=True,
mode="append",
database=glue_database,
table=glue_table,
description="c0+c1+c2",
parameters={"num_cols": "3", "num_rows": "4"},
columns_comments={"c0": "zero", "c1": "one", "c2": "two"},
)
assert wr.catalog.get_table_number_of_versions(table=glue_table, database=glue_database) == 1
df2 = wr.athena.read_sql_table(glue_table, glue_database)
assert len(df2.columns) == 3
assert len(df2.index) == 4
assert df2.c1.astype(int).sum() == 6
parameters = wr.catalog.get_table_parameters(glue_database, glue_table)
assert len(parameters) >= 5
assert parameters["num_cols"] == "3"
assert parameters["num_rows"] == "4"
assert wr.catalog.get_table_description(glue_database, glue_table) == "c0+c1+c2"
comments = wr.catalog.get_columns_comments(glue_database, glue_table)
assert len(comments) == len(df.columns)
assert comments["c0"] == "zero"
assert comments["c1"] == "one"
assert comments["c2"] == "two"
wr.catalog.delete_table_if_exists(database=glue_database, table=glue_table)
| 42.089172
| 104
| 0.656124
| 2,620
| 19,824
| 4.748855
| 0.040458
| 0.090661
| 0.050153
| 0.081016
| 0.963511
| 0.961019
| 0.953143
| 0.947034
| 0.94615
| 0.944141
| 0
| 0.026931
| 0.194562
| 19,824
| 470
| 105
| 42.178723
| 0.752302
| 0.022195
| 0
| 0.888372
| 0
| 0
| 0.073782
| 0.002375
| 0
| 0
| 0
| 0
| 0.344186
| 1
| 0.006977
| false
| 0
| 0.009302
| 0
| 0.016279
| 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
|
dbdeb9603c1b1c4e12d0af4440aeadd4fa9a4b83
| 9,561
|
py
|
Python
|
tests/integration/preview/marketplace/test_installed_add_on.py
|
neetaramaswamy/twilio-python
|
28472ffab1a170824ba17f12a6c1692a5e849439
|
[
"MIT"
] | null | null | null |
tests/integration/preview/marketplace/test_installed_add_on.py
|
neetaramaswamy/twilio-python
|
28472ffab1a170824ba17f12a6c1692a5e849439
|
[
"MIT"
] | null | null | null |
tests/integration/preview/marketplace/test_installed_add_on.py
|
neetaramaswamy/twilio-python
|
28472ffab1a170824ba17f12a6c1692a5e849439
|
[
"MIT"
] | null | null | null |
# coding=utf-8
"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from tests import IntegrationTestCase
from tests.holodeck import Request
from twilio.base.exceptions import TwilioException
from twilio.http.response import Response
class InstalledAddOnTestCase(IntegrationTestCase):
def test_create_request(self):
self.holodeck.mock(Response(500, ''))
with self.assertRaises(TwilioException):
self.client.preview.marketplace.installed_add_ons.create(available_add_on_sid="XBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", accept_terms_of_service=True)
values = {'AvailableAddOnSid': "XBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", 'AcceptTermsOfService': True, }
self.holodeck.assert_has_request(Request(
'post',
'https://preview.twilio.com/marketplace/InstalledAddOns',
data=values,
))
def test_create_response(self):
self.holodeck.mock(Response(
201,
'''
{
"sid": "XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"friendly_name": "VoiceBase High Accuracy Transcription",
"description": "Automatic Transcription and Keyword Extract...",
"configuration": {
"bad_words": true
},
"unique_name": "voicebase_high_accuracy_transcription_1",
"date_created": "2016-04-07T23:52:28Z",
"date_updated": "2016-04-07T23:52:28Z",
"url": "https://preview.twilio.com/marketplace/InstalledAddOns/XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"links": {
"extensions": "https://preview.twilio.com/marketplace/InstalledAddOns/XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Extensions",
"available_add_on": "https://preview.twilio.com/marketplace/AvailableAddOns/XBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}
}
'''
))
actual = self.client.preview.marketplace.installed_add_ons.create(available_add_on_sid="XBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", accept_terms_of_service=True)
self.assertIsNotNone(actual)
def test_delete_request(self):
self.holodeck.mock(Response(500, ''))
with self.assertRaises(TwilioException):
self.client.preview.marketplace.installed_add_ons(sid="XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").delete()
self.holodeck.assert_has_request(Request(
'delete',
'https://preview.twilio.com/marketplace/InstalledAddOns/XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
))
def test_delete_response(self):
self.holodeck.mock(Response(
204,
None,
))
actual = self.client.preview.marketplace.installed_add_ons(sid="XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").delete()
self.assertTrue(actual)
def test_fetch_request(self):
self.holodeck.mock(Response(500, ''))
with self.assertRaises(TwilioException):
self.client.preview.marketplace.installed_add_ons(sid="XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").fetch()
self.holodeck.assert_has_request(Request(
'get',
'https://preview.twilio.com/marketplace/InstalledAddOns/XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
))
def test_fetch_response(self):
self.holodeck.mock(Response(
200,
'''
{
"sid": "XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"friendly_name": "VoiceBase High Accuracy Transcription",
"description": "Automatic Transcription and Keyword Extract...",
"configuration": {
"bad_words": true
},
"unique_name": "voicebase_high_accuracy_transcription",
"date_created": "2016-04-07T23:52:28Z",
"date_updated": "2016-04-07T23:52:28Z",
"url": "https://preview.twilio.com/marketplace/InstalledAddOns/XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"links": {
"extensions": "https://preview.twilio.com/marketplace/InstalledAddOns/XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Extensions",
"available_add_on": "https://preview.twilio.com/marketplace/AvailableAddOns/XBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}
}
'''
))
actual = self.client.preview.marketplace.installed_add_ons(sid="XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").fetch()
self.assertIsNotNone(actual)
def test_update_request(self):
self.holodeck.mock(Response(500, ''))
with self.assertRaises(TwilioException):
self.client.preview.marketplace.installed_add_ons(sid="XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").update()
self.holodeck.assert_has_request(Request(
'post',
'https://preview.twilio.com/marketplace/InstalledAddOns/XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
))
def test_update_response(self):
self.holodeck.mock(Response(
200,
'''
{
"sid": "XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"friendly_name": "VoiceBase High Accuracy Transcription",
"description": "Automatic Transcription and Keyword Extract...",
"configuration": {
"bad_words": true
},
"unique_name": "voicebase_high_accuracy_transcription_2",
"date_created": "2016-04-07T23:52:28Z",
"date_updated": "2016-04-07T23:52:28Z",
"url": "https://preview.twilio.com/marketplace/InstalledAddOns/XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"links": {
"extensions": "https://preview.twilio.com/marketplace/InstalledAddOns/XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Extensions",
"available_add_on": "https://preview.twilio.com/marketplace/AvailableAddOns/XBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}
}
'''
))
actual = self.client.preview.marketplace.installed_add_ons(sid="XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").update()
self.assertIsNotNone(actual)
def test_list_request(self):
self.holodeck.mock(Response(500, ''))
with self.assertRaises(TwilioException):
self.client.preview.marketplace.installed_add_ons.list()
self.holodeck.assert_has_request(Request(
'get',
'https://preview.twilio.com/marketplace/InstalledAddOns',
))
def test_read_full_response(self):
self.holodeck.mock(Response(
200,
'''
{
"installed_add_ons": [
{
"sid": "XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"friendly_name": "VoiceBase High Accuracy Transcription",
"description": "Automatic Transcription and Keyword Extract...",
"configuration": {
"bad_words": true
},
"unique_name": "voicebase_high_accuracy_transcription",
"date_created": "2016-04-07T23:52:28Z",
"date_updated": "2016-04-07T23:52:28Z",
"url": "https://preview.twilio.com/marketplace/InstalledAddOns/XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"links": {
"extensions": "https://preview.twilio.com/marketplace/InstalledAddOns/XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Extensions",
"available_add_on": "https://preview.twilio.com/marketplace/AvailableAddOns/XBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}
}
],
"meta": {
"page": 0,
"page_size": 50,
"first_page_url": "https://preview.twilio.com/marketplace/InstalledAddOns?PageSize=50&Page=0",
"previous_page_url": null,
"url": "https://preview.twilio.com/marketplace/InstalledAddOns?PageSize=50&Page=0",
"next_page_url": null,
"key": "installed_add_ons"
}
}
'''
))
actual = self.client.preview.marketplace.installed_add_ons.list()
self.assertIsNotNone(actual)
def test_read_empty_response(self):
self.holodeck.mock(Response(
200,
'''
{
"installed_add_ons": [],
"meta": {
"page": 0,
"page_size": 50,
"first_page_url": "https://preview.twilio.com/marketplace/InstalledAddOns?PageSize=50&Page=0",
"previous_page_url": null,
"url": "https://preview.twilio.com/marketplace/InstalledAddOns?PageSize=50&Page=0",
"next_page_url": null,
"key": "installed_add_ons"
}
}
'''
))
actual = self.client.preview.marketplace.installed_add_ons.list()
self.assertIsNotNone(actual)
| 41.211207
| 162
| 0.587595
| 755
| 9,561
| 7.249007
| 0.150993
| 0.046044
| 0.069066
| 0.080577
| 0.918326
| 0.900968
| 0.882149
| 0.882149
| 0.882149
| 0.850356
| 0
| 0.025368
| 0.303211
| 9,561
| 231
| 163
| 41.38961
| 0.796157
| 0.0114
| 0
| 0.619048
| 1
| 0
| 0.182764
| 0.07578
| 0
| 0
| 0
| 0
| 0.190476
| 1
| 0.130952
| false
| 0
| 0.047619
| 0
| 0.190476
| 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
|
dbec25f99341bf261e351eb0a9e6a0883cad87c1
| 112
|
py
|
Python
|
date/date/__init__.py
|
GennadiiTurutin/NYU_AdvancedPython_tasks
|
1c32501cb1c3bb67fd4c2d8a046dc80a505bc13a
|
[
"MIT"
] | null | null | null |
date/date/__init__.py
|
GennadiiTurutin/NYU_AdvancedPython_tasks
|
1c32501cb1c3bb67fd4c2d8a046dc80a505bc13a
|
[
"MIT"
] | null | null | null |
date/date/__init__.py
|
GennadiiTurutin/NYU_AdvancedPython_tasks
|
1c32501cb1c3bb67fd4c2d8a046dc80a505bc13a
|
[
"MIT"
] | null | null | null |
# coding: utf-8
# In[17]:
from .date_simple import get_date_object
from .date_simple import get_date_string
| 12.444444
| 40
| 0.767857
| 19
| 112
| 4.210526
| 0.631579
| 0.2
| 0.35
| 0.5
| 0.675
| 0.675
| 0
| 0
| 0
| 0
| 0
| 0.031579
| 0.151786
| 112
| 8
| 41
| 14
| 0.810526
| 0.1875
| 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
|
dbef1d25cb8cf9e1a036457c332af06a2665074a
| 7,500
|
py
|
Python
|
l1l2/test_l2_coding.py
|
OH2NXX/amtetra2
|
9f9738af30a2b9252da87bf6a08ef3f995be05c4
|
[
"MIT"
] | 2
|
2021-02-15T21:38:13.000Z
|
2021-02-19T21:35:19.000Z
|
l1l2/test_l2_coding.py
|
OH2NXX/hamtetra2
|
9f9738af30a2b9252da87bf6a08ef3f995be05c4
|
[
"MIT"
] | null | null | null |
l1l2/test_l2_coding.py
|
OH2NXX/hamtetra2
|
9f9738af30a2b9252da87bf6a08ef3f995be05c4
|
[
"MIT"
] | 1
|
2020-12-21T14:32:00.000Z
|
2020-12-21T14:32:00.000Z
|
#!/usr/bin/env python3
"""Some "manual" tests for L2 coding functions"""
import time
import cProfile
import numpy as np
import debug
import l2_coding as coding
import pdu_class as pdu
def bytes_to_np(b):
"""Convert from old representation of bits (bytes object) into the new representation (numpy array).
This is mainly used for testing before all of the code is converted to use numpy arrays."""
return np.frombuffer(b, dtype=np.uint8)
# Bits demodulated from DMO synchronization bursts
burst_strs = [
"00 01 01 00 01 11 10 11 11 11 11 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 11 11 11 00 11 11 11 11 00 01 10 11 11 10 11 01 01 10 10 01 01 00 00 00 01 11 11 10 10 11 11 10 10 11 11 11 10 10 11 10 11 11 10 11 11 01 10 00 10 11 11 00 00 11 11 01 00 10 10 00 11 10 10 11 00 00 01 10 01 11 00 11 10 10 01 11 00 00 01 10 01 11 10 01 11 11 01 11 00 00 11 11 01 10 11 10 00 00 11 11 01 01 10 10 01 01 11 00 10 10 00 10 11 11 10 01 10 01 00 10 11 10 10 01 01 00 00 00 11 01 10 00 01 10 11 00 10 00 10 01 11 00 00 00 01 11 10 01 01 00 10 01 10 10 00 10 01 01 11 11 11 00 01 11 11 01 00 10 00 10 00 01 01 00 11 10 01 00 10 10 01 10 10 10 00 10 11 01 11 10 00",
"00 01 01 00 01 11 10 11 11 11 11 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 11 11 11 00 01 11 11 11 00 01 10 11 11 10 11 01 01 10 11 01 01 00 00 00 10 11 01 10 10 10 01 11 10 11 10 11 10 10 11 10 11 11 10 11 11 00 00 00 10 11 11 11 00 11 11 01 01 00 11 00 11 10 01 11 00 00 01 10 01 11 00 11 10 10 01 11 00 00 01 10 01 11 10 01 11 11 01 11 00 00 11 11 01 10 11 10 00 00 11 11 01 01 10 10 01 01 11 00 10 10 00 10 11 11 10 01 10 01 00 10 11 10 10 01 01 00 00 00 11 01 10 00 01 10 11 00 10 00 10 01 11 00 00 00 01 11 10 01 01 00 10 01 10 10 00 10 01 01 11 11 11 00 01 11 11 01 00 10 00 10 00 01 01 00 11 10 01 00 10 10 01 10 10 10 00 10 11 01 11 10 00",
"00 01 01 00 01 11 01 11 11 11 11 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 11 11 11 00 11 11 11 11 10 00 10 11 11 00 11 01 01 10 11 11 00 00 00 01 10 11 01 10 10 01 11 10 10 11 11 01 10 10 11 10 00 11 10 11 11 00 00 01 10 11 11 11 00 01 11 01 00 00 11 00 11 10 10 11 00 00 01 10 01 11 00 11 10 10 01 11 00 00 01 10 01 11 10 01 11 11 01 11 00 00 11 11 01 10 11 10 00 00 11 11 01 01 10 10 01 01 11 00 10 10 00 10 11 11 10 01 10 01 00 10 11 10 10 01 01 00 00 00 11 01 10 00 01 10 11 00 10 00 10 01 11 00 00 00 01 11 10 01 01 00 10 01 10 10 00 10 01 01 11 11 11 00 01 11 11 01 00 10 00 10 00 01 01 00 11 10 01 00 10 10 01 10 10 10 00 10 11 01 11 10 00",
"00 01 01 00 01 11 10 11 11 11 11 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 11 11 11 00 01 11 11 11 10 00 10 11 11 00 11 01 01 10 10 11 00 00 00 01 01 11 11 10 10 00 01 11 10 11 10 01 10 10 11 10 00 11 10 11 11 01 10 01 10 11 11 00 00 01 11 01 01 10 10 00 11 10 01 11 00 00 01 10 01 11 00 11 10 10 01 11 00 00 01 10 01 11 10 01 11 11 01 11 00 00 11 11 01 10 11 10 00 00 11 11 01 01 10 10 01 01 11 00 10 10 00 10 11 11 10 01 10 01 00 10 11 10 10 01 01 00 00 00 11 01 10 00 01 10 11 00 10 00 10 01 11 00 00 00 01 11 10 01 01 00 10 01 10 10 00 10 01 01 11 11 11 00 01 11 11 01 00 10 00 10 00 01 01 00 11 10 01 00 10 10 01 10 10 10 00 10 11 01 11 10 00",
"00 01 01 00 01 11 01 11 11 11 11 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 11 11 11 10 10 11 11 11 10 01 00 11 11 01 11 00 01 10 11 11 01 00 00 01 10 11 11 10 10 00 01 11 10 11 10 00 10 10 11 10 10 11 11 11 11 00 10 00 00 11 11 01 00 11 11 01 00 11 10 00 11 10 11 11 00 00 01 10 01 11 00 11 10 10 01 11 00 00 01 10 01 11 00 01 11 11 01 10 00 10 11 11 01 10 10 10 10 00 11 01 01 00 10 00 01 01 11 00 11 10 10 10 11 01 10 00 10 11 00 10 11 10 10 01 11 00 00 00 11 01 10 00 01 10 11 00 10 00 00 01 11 00 00 00 01 11 11 01 01 01 10 01 10 10 00 10 01 01 11 11 11 00 01 11 11 01 10 10 00 10 01 01 01 10 10 10 01 00 10 10 01 10 10 10 00 10 11 01 10 10 00",
"00 01 01 00 01 11 10 11 11 11 11 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 11 11 11 10 00 11 11 11 10 01 00 11 11 01 11 00 01 10 10 11 01 00 00 01 01 11 01 10 10 01 11 10 10 11 11 00 10 10 11 10 10 11 11 11 11 01 00 00 00 11 11 10 00 11 11 01 01 01 11 00 11 10 00 11 00 00 01 10 01 11 00 11 10 10 01 11 00 00 01 10 01 11 00 01 11 11 01 10 00 10 11 11 01 10 10 10 10 00 11 01 01 00 10 00 01 01 11 00 11 10 10 10 11 01 10 00 10 11 00 10 11 10 10 01 11 00 00 00 11 01 10 00 01 10 11 00 10 00 00 01 11 00 00 00 01 11 11 01 01 01 10 01 10 10 00 10 01 01 11 11 11 00 01 11 11 01 10 10 00 10 01 01 01 10 10 10 01 00 10 10 01 10 10 10 00 10 11 01 10 10 00",
"00 01 01 00 01 11 10 11 11 11 11 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 11 11 11 10 10 11 11 11 00 00 00 11 11 11 11 00 01 10 10 01 00 00 00 00 01 11 01 10 10 10 01 11 10 11 10 10 10 10 11 10 01 11 11 11 11 01 00 01 00 11 11 10 00 01 11 01 00 01 11 00 11 10 11 11 00 00 01 10 01 11 00 11 10 10 01 11 00 00 01 10 01 11 00 01 11 11 01 10 00 10 11 11 01 10 10 10 10 00 11 01 01 00 10 00 01 01 11 00 11 10 10 10 11 01 10 00 10 11 00 10 11 10 10 01 11 00 00 00 11 01 10 00 01 10 11 00 10 00 00 01 11 00 00 00 01 11 11 01 01 01 10 01 10 10 00 10 01 01 11 11 11 00 01 11 11 01 10 10 00 10 01 01 01 10 10 10 01 00 10 10 01 10 10 10 00 10 11 01 10 10 00"
]
punct_2_3 = coding.generate_puncturing_pattern(120, (2,3))
deint_11 = coding.generate_deinterleaving_pattern(K = 120, a = 11)
for burst_str in burst_strs:
# Handle the burst as a byte array, each byte representing one bit
burst = bytes(1 if c=="1" else 0 for c in burst_str.replace(" ", ""))
burst = bytes_to_np(burst)
# Split into fields
sb_bits5 = burst[94:214] # Scrambled synchronization block 1 type 5 bits
bkn2_bits5 = burst[252:468] # Scrambled block 2 bits
debug.print_bits("Type 5:", sb_bits5)
# Convert to type 4 bits
sb_bits4 = coding.descramble(sb_bits5, coding.sb_scrambling)
debug.print_bits("Type 4:", sb_bits4)
# Convert to type 3 bits
sb_bits3 = coding.deinterleave(sb_bits4, deint_11)
debug.print_bits("Type 3:", sb_bits3)
sb_depunct = coding.depuncture(coding.hard_to_soft(sb_bits3), punct_2_3)
debug.print_softbits("Depunctured:", sb_depunct)
sb_bits2 = coding.decode_1_4(sb_depunct)
debug.print_bits("Type 2:", sb_bits2)
sb_bits1 = sb_bits2[0:-16]
debug.print_bits("Type 1 (not CRC checked):", sb_bits1)
debug.print_bits("Received CRC:", sb_bits2[-16:])
debug.print_bits("Calculated CRC:", coding.crc16(sb_bits1))
# Show some DMAC-SYNC PDU contents in SCH/S
debug.print_pdu(pdu.DMAC_SYNC_SCH_S(sb_bits1))
# Speedtest
N = 10000
def test_things():
sb_bits5 = burst[94:214]
sb_bits4 = coding.descramble(sb_bits5, coding.sb_scrambling)
sb_bits3 = coding.deinterleave(sb_bits4, deint_11)
sb_depunct = coding.depuncture(coding.hard_to_soft(sb_bits3), punct_2_3)
sb_bits2 = coding.decode_1_4(sb_depunct)
crc = coding.crc16(sb_bits2[0:-16])
sb_bits1 = sb_bits2[0:-16]
return pdu.DMAC_SYNC_SCH_S(sb_bits1)
t1 = time.perf_counter()
#for i in range(N):
# test_things()
cProfile.run("for i in range(N): test_things()")
t2 = time.perf_counter()
print("Descrambled, deinterleaved, decoded and unpacked %f blocks per second" % (N / (t2-t1)))
| 86.206897
| 711
| 0.6796
| 2,049
| 7,500
| 2.445095
| 0.07223
| 0.239521
| 0.279042
| 0.325749
| 0.754491
| 0.722954
| 0.684232
| 0.663872
| 0.631138
| 0.608383
| 0
| 0.631003
| 0.280933
| 7,500
| 86
| 712
| 87.209302
| 0.297979
| 0.078133
| 0
| 0.230769
| 0
| 0.134615
| 0.744193
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0.038462
| false
| 0
| 0.115385
| 0
| 0.192308
| 0.192308
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 9
|
e0453c44c99b52467f2c89c6b0dd912094bcc2d9
| 4,832
|
py
|
Python
|
cyclopeps/tests/peps/test_canonical_peps.py
|
philliphelms/cyclopeps
|
f024d827a7412f4d9df10d6b9453c2692b1a74c3
|
[
"MIT"
] | null | null | null |
cyclopeps/tests/peps/test_canonical_peps.py
|
philliphelms/cyclopeps
|
f024d827a7412f4d9df10d6b9453c2692b1a74c3
|
[
"MIT"
] | null | null | null |
cyclopeps/tests/peps/test_canonical_peps.py
|
philliphelms/cyclopeps
|
f024d827a7412f4d9df10d6b9453c2692b1a74c3
|
[
"MIT"
] | null | null | null |
import unittest
from cyclopeps.tools.utils import *
import copy
class test_canonical_peps(unittest.TestCase):
def test_canonical_normalization_z2(self):
from cyclopeps.tools.peps_tools import PEPS
mpiprint(0,'\n'+'='*50+'\nCanonical Peps Normalization test (Z2 Symmetry) \n'+'-'*50)
Nx = 3
Ny = 5
d = 2
D = 3
chi = 10
Zn = 2
backend = 'numpy'
peps = PEPS(Nx=Nx,
Ny=Ny,
d=d,
D=D,
chi=chi,
Zn=Zn,
backend=backend,
normalize=False,
canonical=True)
norm = peps.calc_norm(chi=chi)
norm = peps.normalize()
mpiprint(0,'Norm = {}'.format(norm))
self.assertTrue(abs(1.0-norm) < 1e-3)
mpiprint(0,'Passed\n'+'='*50)
def test_canonical_normalization(self):
from cyclopeps.tools.peps_tools import PEPS
mpiprint(0,'\n'+'='*50+'\nCanonical Peps Normalization test\n'+'-'*50)
Nx = 3
Ny = 5
d = 2
D = 3
chi = 10
peps = PEPS(Nx=Nx,
Ny=Ny,
d=d,
D=D,
chi=chi,
normalize=False,
canonical=True)
norm = peps.calc_norm(chi=chi)
norm = peps.normalize()
mpiprint(0,'Norm = {}'.format(norm))
self.assertTrue(abs(1.0-norm) < 1e-3)
mpiprint(0,'Passed\n'+'='*50)
def test_canonical_rotate(self):
mpiprint(0,'\n'+'='*50+'\nCanonical Peps Rotation test\n'+'-'*50)
from cyclopeps.tools.peps_tools import PEPS
Nx = 6
Ny = 4
d = 2
D = 3
chi = 10
peps = PEPS(Nx=Nx,Ny=Ny,d=d,D=D,chi=chi,normalize=False,canonical=True)
norm0 = peps.calc_norm()
peps.rotate()
norm1 = peps.calc_norm()
peps.rotate(clockwise=False)
norm2 = peps.calc_norm()
mpiprint(0,'Norms = {},{},{}'.format(norm0,norm1,norm2))
self.assertTrue(abs((norm0-norm1)/norm0) < 1e-3)
self.assertTrue(abs((norm0-norm2)/norm0) < 1e-10)
mpiprint(0,'Passed\n'+'='*50)
def test_canonical_flip(self):
mpiprint(0,'\n'+'='*50+'\nCanonical Peps Flipping test\n'+'-'*50)
from cyclopeps.tools.peps_tools import PEPS
Nx = 5
Ny = 5
d = 2
D = 3
chi = 10
peps = PEPS(Nx=Nx,Ny=Ny,d=d,D=D,chi=chi,normalize=False,canonical=True)
norm0 = peps.calc_norm()
peps.flip()
norm1 = peps.calc_norm()
peps.flip()
norm2 = peps.calc_norm()
mpiprint(0,'Norms = {},{},{}'.format(norm0,norm1,norm2))
self.assertTrue(abs((norm0-norm1)/norm0) < 1e-3)
self.assertTrue(abs((norm0-norm2)/norm0) < 1e-10)
mpiprint(0,'Passed\n'+'='*50)
def test_canonical_flip_z2(self):
mpiprint(0,'\n'+'='*50+'\nCanonical Peps Flipping test (Z2 Symmetry)\n'+'-'*50)
from cyclopeps.tools.peps_tools import PEPS
Nx = 5
Ny = 5
d = 2
D = 3
chi = 10
Zn = 2
backend = 'numpy'
peps = PEPS(Nx=Nx,
Ny=Ny,
d=d,
D=D,
chi=chi,
Zn=Zn,
backend=backend,
normalize=False,
canonical=True)
norm0 = peps.calc_norm()
peps.flip()
norm1 = peps.calc_norm()
peps.flip()
norm2 = peps.calc_norm()
mpiprint(0,'Norms = {},{},{}'.format(norm0,norm1,norm2))
self.assertTrue(abs((norm0-norm1)/norm0) < 1e-3)
self.assertTrue(abs((norm0-norm2)/norm0) < 1e-10)
mpiprint(0,'Passed\n'+'='*50)
def test_canonical_rotate_z2(self):
mpiprint(0,'\n'+'='*50+'\nCanonical Peps Rotation test (Z2 Symmetry)\n'+'-'*50)
from cyclopeps.tools.peps_tools import PEPS
Nx = 3
Ny = 3
d = 2
D = 3
chi = 10
Zn = 2
backend = 'numpy'
peps = PEPS(Nx=Nx,
Ny=Ny,
d=d,
D=D,
chi=chi,
Zn=Zn,
backend=backend,
normalize=False,
canonical=True)
norm0 = peps.calc_norm()
peps.rotate()
norm1 = peps.calc_norm()
peps.rotate(clockwise=False)
norm2 = peps.calc_norm()
mpiprint(0,'Norms = {},{},{}'.format(norm0,norm1,norm2))
self.assertTrue(abs((norm0-norm1)/norm0) < 1e-3)
self.assertTrue(abs((norm0-norm2)/norm0) < 1e-10)
mpiprint(0,'Passed\n'+'='*50)
if __name__ == "__main__":
unittest.main()
| 32
| 93
| 0.48779
| 575
| 4,832
| 4.02087
| 0.10087
| 0.070069
| 0.072664
| 0.055363
| 0.928633
| 0.924308
| 0.924308
| 0.924308
| 0.922578
| 0.851644
| 0
| 0.057452
| 0.369619
| 4,832
| 150
| 94
| 32.213333
| 0.701576
| 0
| 0
| 0.852113
| 0
| 0
| 0.088576
| 0
| 0.042254
| 0
| 0
| 0
| 0.070423
| 1
| 0.042254
| false
| 0.042254
| 0.06338
| 0
| 0.112676
| 0.126761
| 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
|
e07264a13e787833fba75e7e533ad3083eaf9b36
| 2,007
|
py
|
Python
|
src/brouwers/shop/migrations/0009_auto_20180930_2016.py
|
modelbrouwers/modelbrouwers
|
e0ba4819bf726d6144c0a648fdd4731cdc098a52
|
[
"MIT"
] | 6
|
2015-03-03T13:23:07.000Z
|
2021-12-19T18:12:41.000Z
|
src/brouwers/shop/migrations/0009_auto_20180930_2016.py
|
modelbrouwers/modelbrouwers
|
e0ba4819bf726d6144c0a648fdd4731cdc098a52
|
[
"MIT"
] | 95
|
2015-02-07T00:55:39.000Z
|
2022-02-08T20:22:05.000Z
|
src/brouwers/shop/migrations/0009_auto_20180930_2016.py
|
modelbrouwers/modelbrouwers
|
e0ba4819bf726d6144c0a648fdd4731cdc098a52
|
[
"MIT"
] | 2
|
2016-03-22T16:53:26.000Z
|
2019-02-09T22:46:04.000Z
|
# -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-09-30 18:16
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("shop", "0008_auto_20180930_1947"),
]
operations = [
migrations.AlterField(
model_name="product",
name="name",
field=models.CharField(max_length=200, verbose_name="name"),
),
migrations.AlterField(
model_name="product",
name="name_de",
field=models.CharField(max_length=200, null=True, verbose_name="name"),
),
migrations.AlterField(
model_name="product",
name="name_en",
field=models.CharField(max_length=200, null=True, verbose_name="name"),
),
migrations.AlterField(
model_name="product",
name="name_nl",
field=models.CharField(max_length=200, null=True, verbose_name="name"),
),
migrations.AlterField(
model_name="product",
name="seo_keyword",
field=models.CharField(
blank=True, max_length=200, null=True, verbose_name="seo keyword"
),
),
migrations.AlterField(
model_name="product",
name="seo_keyword_de",
field=models.CharField(
blank=True, max_length=200, null=True, verbose_name="seo keyword"
),
),
migrations.AlterField(
model_name="product",
name="seo_keyword_en",
field=models.CharField(
blank=True, max_length=200, null=True, verbose_name="seo keyword"
),
),
migrations.AlterField(
model_name="product",
name="seo_keyword_nl",
field=models.CharField(
blank=True, max_length=200, null=True, verbose_name="seo keyword"
),
),
]
| 31.359375
| 83
| 0.554061
| 201
| 2,007
| 5.323383
| 0.248756
| 0.149533
| 0.186916
| 0.216822
| 0.811215
| 0.811215
| 0.781308
| 0.740187
| 0.730841
| 0.730841
| 0
| 0.043123
| 0.329846
| 2,007
| 63
| 84
| 31.857143
| 0.752416
| 0.03438
| 0
| 0.696429
| 1
| 0
| 0.114212
| 0.011886
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.035714
| 0
| 0.089286
| 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
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 9
|
0ebde779619393472aca3e0f7708925e0b0b218a
| 64,028
|
py
|
Python
|
infoblox_netmri/api/broker/v2_9_0/script_broker.py
|
infobloxopen/infoblox_netmri
|
aa1c744df7e439dbe163bb9edd165e4e85a9771b
|
[
"Apache-2.0"
] | 12
|
2016-02-19T12:37:54.000Z
|
2022-03-04T20:11:08.000Z
|
infoblox_netmri/api/broker/v2_9_0/script_broker.py
|
azinfoblox/infoblox-netmri
|
02372c5231e2677ab6299cb659a73c9a41b4b0f4
|
[
"Apache-2.0"
] | 18
|
2015-11-12T18:37:00.000Z
|
2021-05-19T07:59:55.000Z
|
infoblox_netmri/api/broker/v2_9_0/script_broker.py
|
azinfoblox/infoblox-netmri
|
02372c5231e2677ab6299cb659a73c9a41b4b0f4
|
[
"Apache-2.0"
] | 18
|
2016-01-07T12:04:34.000Z
|
2022-03-31T11:05:41.000Z
|
from ..broker import Broker
class ScriptBroker(Broker):
controller = "scripts"
def index(self, **kwargs):
"""Lists the available scripts. Any of the inputs listed may be be used to narrow the list; other inputs will be ignored. Of the various ways to query lists, using this method is most efficient.
**Inputs**
| ``api version min:`` 2
| ``api version max:`` 2.4
| ``required:`` False
| ``default:`` None
:param id: The internal NetMRI identifier for the script.
:type id: Integer
| ``api version min:`` 2.5
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param id: The internal NetMRI identifier for the script.
:type id: Array of Integer
| ``api version min:`` 2
| ``api version max:`` 2.4
| ``required:`` False
| ``default:`` None
:param name: The name of this script.
:type name: String
| ``api version min:`` 2.5
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param name: The name of this script.
:type name: Array of String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` 0
:param start: The record number to return in the selected page of data. It will always appear, although it may not be the first record. See the :limit for more information.
:type start: Integer
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` 1000
:param limit: The size of the page of data, that is, the maximum number of records returned. The limit size will be used to break the data up into pages and the first page with the start record will be returned. So if you have 100 records and use a :limit of 10 and a :start of 10, you will get records 10-19. The maximum limit is 10000.
:type limit: Integer
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` id
:param sort: The data field(s) to use for sorting the output. Default is id. Valid values are id, name, module, visible, description, created_by, updated_by, language, risk_level, created_at, updated_at, category, read_only, taskflow_create, taskflow_edit, taskflow_revert, target_mapping, transactional_ind.
:type sort: Array of String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` asc
:param dir: The direction(s) in which to sort the data. Default is 'asc'. Valid values are 'asc' and 'desc'.
:type dir: Array of String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param select: The list of attributes to return for each Script. Valid values are id, name, module, visible, description, created_by, updated_by, language, risk_level, created_at, updated_at, category, read_only, taskflow_create, taskflow_edit, taskflow_revert, target_mapping, transactional_ind. If empty or omitted, all attributes will be returned.
:type select: Array
| ``api version min:`` 2.8
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param goto_field: The field name for NIOS GOTO that is used for locating a row position of records.
:type goto_field: String
| ``api version min:`` 2.8
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param goto_value: The value of goto_field for NIOS GOTO that is used for locating a row position of records.
:type goto_value: String
**Outputs**
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:return scripts: An array of the Script objects that match the specified input criteria.
:rtype scripts: Array of Script
"""
return self.api_list_request(self._get_method_fullname("index"), kwargs)
def show(self, **kwargs):
"""Shows the details for the specified script.
**Inputs**
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` True
| ``default:`` None
:param id: The internal NetMRI identifier for the script.
:type id: Integer
**Outputs**
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:return script: The script identified by the specified id.
:rtype script: Script
"""
return self.api_request(self._get_method_fullname("show"), kwargs)
def search(self, **kwargs):
"""Lists the available scripts matching the input criteria. This method provides a more flexible search interface than the index method, but searching using this method is more demanding on the system and will not perform to the same level as the index method. The input fields listed below will be used as in the index method, to filter the result, along with the optional query string and XML filter described below.
**Inputs**
| ``api version min:`` 2.3
| ``api version max:`` 2.4
| ``required:`` False
| ``default:`` None
:param category: Currently unused.
:type category: String
| ``api version min:`` 2.5
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param category: Currently unused.
:type category: Array of String
| ``api version min:`` 2.3
| ``api version max:`` 2.4
| ``required:`` False
| ``default:`` None
:param created_at: The date and time the script was initially imported into NetMRI.
:type created_at: DateTime
| ``api version min:`` 2.5
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param created_at: The date and time the script was initially imported into NetMRI.
:type created_at: Array of DateTime
| ``api version min:`` 2.3
| ``api version max:`` 2.4
| ``required:`` False
| ``default:`` None
:param created_by: The user that initially imported the script into NetMRI.
:type created_by: String
| ``api version min:`` 2.5
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param created_by: The user that initially imported the script into NetMRI.
:type created_by: Array of String
| ``api version min:`` 2.3
| ``api version max:`` 2.4
| ``required:`` False
| ``default:`` None
:param description: Describes the purpose, function and usage of this script.
:type description: String
| ``api version min:`` 2.5
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param description: Describes the purpose, function and usage of this script.
:type description: Array of String
| ``api version min:`` 2.3
| ``api version max:`` 2.4
| ``required:`` False
| ``default:`` None
:param id: The internal NetMRI identifier for the script.
:type id: Integer
| ``api version min:`` 2.5
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param id: The internal NetMRI identifier for the script.
:type id: Array of Integer
| ``api version min:`` 2.3
| ``api version max:`` 2.4
| ``required:`` False
| ``default:`` None
:param language: The scripting language used; currently the only supported language is CCS.
:type language: String
| ``api version min:`` 2.5
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param language: The scripting language used; currently the only supported language is CCS.
:type language: Array of String
| ``api version min:`` 2.3
| ``api version max:`` 2.4
| ``required:`` False
| ``default:`` None
:param module: Currently unused.
:type module: String
| ``api version min:`` 2.5
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param module: Currently unused.
:type module: Array of String
| ``api version min:`` 2.3
| ``api version max:`` 2.4
| ``required:`` False
| ``default:`` None
:param name: The name of this script.
:type name: String
| ``api version min:`` 2.5
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param name: The name of this script.
:type name: Array of String
| ``api version min:`` 2.3
| ``api version max:`` 2.4
| ``required:`` False
| ``default:`` None
:param read_only: Read-only scripts are not user modifiable.
:type read_only: Boolean
| ``api version min:`` 2.5
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param read_only: Read-only scripts are not user modifiable.
:type read_only: Array of Boolean
| ``api version min:`` 2.3
| ``api version max:`` 2.4
| ``required:`` False
| ``default:`` None
:param risk_level: The user-specified risk level for the script. Possible levels are 1 (low), 2 (medium), and 3 (high). To run higher risk scripts, higher privileges are required.
:type risk_level: Integer
| ``api version min:`` 2.5
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param risk_level: The user-specified risk level for the script. Possible levels are 1 (low), 2 (medium), and 3 (high). To run higher risk scripts, higher privileges are required.
:type risk_level: Array of Integer
| ``api version min:`` 2.3
| ``api version max:`` 2.4
| ``required:`` False
| ``default:`` None
:param target_mapping: Kind of mapping used for this script : 'device' ...
:type target_mapping: String
| ``api version min:`` 2.5
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param target_mapping: Kind of mapping used for this script : 'device' ...
:type target_mapping: Array of String
| ``api version min:`` 2.3
| ``api version max:`` 2.4
| ``required:`` False
| ``default:`` None
:param taskflow_create: Internal workflow name for job creation using this script.
:type taskflow_create: String
| ``api version min:`` 2.5
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param taskflow_create: Internal workflow name for job creation using this script.
:type taskflow_create: Array of String
| ``api version min:`` 2.3
| ``api version max:`` 2.4
| ``required:`` False
| ``default:`` None
:param taskflow_edit: Internal workflow name for job edition using this script.
:type taskflow_edit: String
| ``api version min:`` 2.5
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param taskflow_edit: Internal workflow name for job edition using this script.
:type taskflow_edit: Array of String
| ``api version min:`` 2.3
| ``api version max:`` 2.4
| ``required:`` False
| ``default:`` None
:param taskflow_revert: Internal workflow name for job reversion using this script.
:type taskflow_revert: String
| ``api version min:`` 2.5
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param taskflow_revert: Internal workflow name for job reversion using this script.
:type taskflow_revert: Array of String
| ``api version min:`` 2.3
| ``api version max:`` 2.4
| ``required:`` False
| ``default:`` None
:param transactional_ind: Flag indicating if devices should be reserved during execution of this script.
:type transactional_ind: Boolean
| ``api version min:`` 2.5
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param transactional_ind: Flag indicating if devices should be reserved during execution of this script.
:type transactional_ind: Array of Boolean
| ``api version min:`` 2.3
| ``api version max:`` 2.4
| ``required:`` False
| ``default:`` None
:param updated_at: The date and time the script was last modified.
:type updated_at: DateTime
| ``api version min:`` 2.5
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param updated_at: The date and time the script was last modified.
:type updated_at: Array of DateTime
| ``api version min:`` 2.3
| ``api version max:`` 2.4
| ``required:`` False
| ``default:`` None
:param updated_by: The user that last modified this script.
:type updated_by: String
| ``api version min:`` 2.5
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param updated_by: The user that last modified this script.
:type updated_by: Array of String
| ``api version min:`` 2.3
| ``api version max:`` 2.4
| ``required:`` False
| ``default:`` None
:param visible: Indicates whether this script is visible on the user interface.
:type visible: Boolean
| ``api version min:`` 2.5
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param visible: Indicates whether this script is visible on the user interface.
:type visible: Array of Boolean
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` 0
:param start: The record number to return in the selected page of data. It will always appear, although it may not be the first record. See the :limit for more information.
:type start: Integer
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` 1000
:param limit: The size of the page of data, that is, the maximum number of records returned. The limit size will be used to break the data up into pages and the first page with the start record will be returned. So if you have 100 records and use a :limit of 10 and a :start of 10, you will get records 10-19. The maximum limit is 10000.
:type limit: Integer
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` id
:param sort: The data field(s) to use for sorting the output. Default is id. Valid values are id, name, module, visible, description, created_by, updated_by, language, risk_level, created_at, updated_at, category, read_only, taskflow_create, taskflow_edit, taskflow_revert, target_mapping, transactional_ind.
:type sort: Array of String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` asc
:param dir: The direction(s) in which to sort the data. Default is 'asc'. Valid values are 'asc' and 'desc'.
:type dir: Array of String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param select: The list of attributes to return for each Script. Valid values are id, name, module, visible, description, created_by, updated_by, language, risk_level, created_at, updated_at, category, read_only, taskflow_create, taskflow_edit, taskflow_revert, target_mapping, transactional_ind. If empty or omitted, all attributes will be returned.
:type select: Array
| ``api version min:`` 2.8
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param goto_field: The field name for NIOS GOTO that is used for locating a row position of records.
:type goto_field: String
| ``api version min:`` 2.8
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param goto_value: The value of goto_field for NIOS GOTO that is used for locating a row position of records.
:type goto_value: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param query: This value will be matched against scripts, looking to see if one or more of the listed attributes contain the passed value. You may also surround the value with '/' and '/' to perform a regular expression search rather than a containment operation. Any record that matches will be returned. The attributes searched are: category, created_at, created_by, description, id, language, module, name, read_only, risk_level, target_mapping, taskflow_create, taskflow_edit, taskflow_revert, transactional_ind, updated_at, updated_by, visible.
:type query: String
| ``api version min:`` 2.3
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param xml_filter: A SetFilter XML structure to further refine the search. The SetFilter will be applied AFTER any search query or field values, but before any limit options. The limit and pagination will be enforced after the filter. Remind that this kind of filter may be costly and inefficient if not associated with a database filtering.
:type xml_filter: String
**Outputs**
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:return scripts: An array of the Script objects that match the specified input criteria.
:rtype scripts: Array of Script
"""
return self.api_list_request(self._get_method_fullname("search"), kwargs)
def find(self, **kwargs):
"""Lists the available scripts matching the input specification. This provides the most flexible search specification of all the query mechanisms, enabling searching using comparison operations other than equality. However, it is more complex to use and will not perform as efficiently as the index or search methods. In the input descriptions below, 'field names' refers to the following fields: category, created_at, created_by, description, id, language, module, name, read_only, risk_level, target_mapping, taskflow_create, taskflow_edit, taskflow_revert, transactional_ind, updated_at, updated_by, visible.
**Inputs**
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param op_category: The operator to apply to the field category. Valid values are: =, <>, rlike, not rlike, >, >=, <, <=, like, not like, is null, is not null, between. category: Currently unused. For the between operator the value will be treated as an Array if comma delimited string is passed, and it must contain an even number of values.
:type op_category: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_f_category: If op_category is specified, the field named in this input will be compared to the value in category using the specified operator. That is, the value in this input will be treated as another field name, rather than a constant value. Either this field or val_c_category must be specified if op_category is specified.
:type val_f_category: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_c_category: If op_category is specified, this value will be compared to the value in category using the specified operator. The value in this input will be treated as an explicit constant value. Either this field or val_f_category must be specified if op_category is specified.
:type val_c_category: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param op_created_at: The operator to apply to the field created_at. Valid values are: =, <>, rlike, not rlike, >, >=, <, <=, like, not like, is null, is not null, between. created_at: The date and time the script was initially imported into NetMRI. For the between operator the value will be treated as an Array if comma delimited string is passed, and it must contain an even number of values.
:type op_created_at: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_f_created_at: If op_created_at is specified, the field named in this input will be compared to the value in created_at using the specified operator. That is, the value in this input will be treated as another field name, rather than a constant value. Either this field or val_c_created_at must be specified if op_created_at is specified.
:type val_f_created_at: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_c_created_at: If op_created_at is specified, this value will be compared to the value in created_at using the specified operator. The value in this input will be treated as an explicit constant value. Either this field or val_f_created_at must be specified if op_created_at is specified.
:type val_c_created_at: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param op_created_by: The operator to apply to the field created_by. Valid values are: =, <>, rlike, not rlike, >, >=, <, <=, like, not like, is null, is not null, between. created_by: The user that initially imported the script into NetMRI. For the between operator the value will be treated as an Array if comma delimited string is passed, and it must contain an even number of values.
:type op_created_by: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_f_created_by: If op_created_by is specified, the field named in this input will be compared to the value in created_by using the specified operator. That is, the value in this input will be treated as another field name, rather than a constant value. Either this field or val_c_created_by must be specified if op_created_by is specified.
:type val_f_created_by: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_c_created_by: If op_created_by is specified, this value will be compared to the value in created_by using the specified operator. The value in this input will be treated as an explicit constant value. Either this field or val_f_created_by must be specified if op_created_by is specified.
:type val_c_created_by: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param op_description: The operator to apply to the field description. Valid values are: =, <>, rlike, not rlike, >, >=, <, <=, like, not like, is null, is not null, between. description: Describes the purpose, function and usage of this script. For the between operator the value will be treated as an Array if comma delimited string is passed, and it must contain an even number of values.
:type op_description: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_f_description: If op_description is specified, the field named in this input will be compared to the value in description using the specified operator. That is, the value in this input will be treated as another field name, rather than a constant value. Either this field or val_c_description must be specified if op_description is specified.
:type val_f_description: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_c_description: If op_description is specified, this value will be compared to the value in description using the specified operator. The value in this input will be treated as an explicit constant value. Either this field or val_f_description must be specified if op_description is specified.
:type val_c_description: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param op_id: The operator to apply to the field id. Valid values are: =, <>, rlike, not rlike, >, >=, <, <=, like, not like, is null, is not null, between. id: The internal NetMRI identifier for the script. For the between operator the value will be treated as an Array if comma delimited string is passed, and it must contain an even number of values.
:type op_id: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_f_id: If op_id is specified, the field named in this input will be compared to the value in id using the specified operator. That is, the value in this input will be treated as another field name, rather than a constant value. Either this field or val_c_id must be specified if op_id is specified.
:type val_f_id: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_c_id: If op_id is specified, this value will be compared to the value in id using the specified operator. The value in this input will be treated as an explicit constant value. Either this field or val_f_id must be specified if op_id is specified.
:type val_c_id: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param op_language: The operator to apply to the field language. Valid values are: =, <>, rlike, not rlike, >, >=, <, <=, like, not like, is null, is not null, between. language: The scripting language used; currently the only supported language is CCS. For the between operator the value will be treated as an Array if comma delimited string is passed, and it must contain an even number of values.
:type op_language: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_f_language: If op_language is specified, the field named in this input will be compared to the value in language using the specified operator. That is, the value in this input will be treated as another field name, rather than a constant value. Either this field or val_c_language must be specified if op_language is specified.
:type val_f_language: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_c_language: If op_language is specified, this value will be compared to the value in language using the specified operator. The value in this input will be treated as an explicit constant value. Either this field or val_f_language must be specified if op_language is specified.
:type val_c_language: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param op_module: The operator to apply to the field module. Valid values are: =, <>, rlike, not rlike, >, >=, <, <=, like, not like, is null, is not null, between. module: Currently unused. For the between operator the value will be treated as an Array if comma delimited string is passed, and it must contain an even number of values.
:type op_module: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_f_module: If op_module is specified, the field named in this input will be compared to the value in module using the specified operator. That is, the value in this input will be treated as another field name, rather than a constant value. Either this field or val_c_module must be specified if op_module is specified.
:type val_f_module: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_c_module: If op_module is specified, this value will be compared to the value in module using the specified operator. The value in this input will be treated as an explicit constant value. Either this field or val_f_module must be specified if op_module is specified.
:type val_c_module: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param op_name: The operator to apply to the field name. Valid values are: =, <>, rlike, not rlike, >, >=, <, <=, like, not like, is null, is not null, between. name: The name of this script. For the between operator the value will be treated as an Array if comma delimited string is passed, and it must contain an even number of values.
:type op_name: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_f_name: If op_name is specified, the field named in this input will be compared to the value in name using the specified operator. That is, the value in this input will be treated as another field name, rather than a constant value. Either this field or val_c_name must be specified if op_name is specified.
:type val_f_name: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_c_name: If op_name is specified, this value will be compared to the value in name using the specified operator. The value in this input will be treated as an explicit constant value. Either this field or val_f_name must be specified if op_name is specified.
:type val_c_name: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param op_read_only: The operator to apply to the field read_only. Valid values are: =, <>, rlike, not rlike, >, >=, <, <=, like, not like, is null, is not null, between. read_only: Read-only scripts are not user modifiable. For the between operator the value will be treated as an Array if comma delimited string is passed, and it must contain an even number of values.
:type op_read_only: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_f_read_only: If op_read_only is specified, the field named in this input will be compared to the value in read_only using the specified operator. That is, the value in this input will be treated as another field name, rather than a constant value. Either this field or val_c_read_only must be specified if op_read_only is specified.
:type val_f_read_only: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_c_read_only: If op_read_only is specified, this value will be compared to the value in read_only using the specified operator. The value in this input will be treated as an explicit constant value. Either this field or val_f_read_only must be specified if op_read_only is specified.
:type val_c_read_only: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param op_risk_level: The operator to apply to the field risk_level. Valid values are: =, <>, rlike, not rlike, >, >=, <, <=, like, not like, is null, is not null, between. risk_level: The user-specified risk level for the script. Possible levels are 1 (low), 2 (medium), and 3 (high). To run higher risk scripts, higher privileges are required. For the between operator the value will be treated as an Array if comma delimited string is passed, and it must contain an even number of values.
:type op_risk_level: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_f_risk_level: If op_risk_level is specified, the field named in this input will be compared to the value in risk_level using the specified operator. That is, the value in this input will be treated as another field name, rather than a constant value. Either this field or val_c_risk_level must be specified if op_risk_level is specified.
:type val_f_risk_level: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_c_risk_level: If op_risk_level is specified, this value will be compared to the value in risk_level using the specified operator. The value in this input will be treated as an explicit constant value. Either this field or val_f_risk_level must be specified if op_risk_level is specified.
:type val_c_risk_level: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param op_target_mapping: The operator to apply to the field target_mapping. Valid values are: =, <>, rlike, not rlike, >, >=, <, <=, like, not like, is null, is not null, between. target_mapping: Kind of mapping used for this script : 'device' ... For the between operator the value will be treated as an Array if comma delimited string is passed, and it must contain an even number of values.
:type op_target_mapping: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_f_target_mapping: If op_target_mapping is specified, the field named in this input will be compared to the value in target_mapping using the specified operator. That is, the value in this input will be treated as another field name, rather than a constant value. Either this field or val_c_target_mapping must be specified if op_target_mapping is specified.
:type val_f_target_mapping: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_c_target_mapping: If op_target_mapping is specified, this value will be compared to the value in target_mapping using the specified operator. The value in this input will be treated as an explicit constant value. Either this field or val_f_target_mapping must be specified if op_target_mapping is specified.
:type val_c_target_mapping: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param op_taskflow_create: The operator to apply to the field taskflow_create. Valid values are: =, <>, rlike, not rlike, >, >=, <, <=, like, not like, is null, is not null, between. taskflow_create: Internal workflow name for job creation using this script. For the between operator the value will be treated as an Array if comma delimited string is passed, and it must contain an even number of values.
:type op_taskflow_create: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_f_taskflow_create: If op_taskflow_create is specified, the field named in this input will be compared to the value in taskflow_create using the specified operator. That is, the value in this input will be treated as another field name, rather than a constant value. Either this field or val_c_taskflow_create must be specified if op_taskflow_create is specified.
:type val_f_taskflow_create: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_c_taskflow_create: If op_taskflow_create is specified, this value will be compared to the value in taskflow_create using the specified operator. The value in this input will be treated as an explicit constant value. Either this field or val_f_taskflow_create must be specified if op_taskflow_create is specified.
:type val_c_taskflow_create: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param op_taskflow_edit: The operator to apply to the field taskflow_edit. Valid values are: =, <>, rlike, not rlike, >, >=, <, <=, like, not like, is null, is not null, between. taskflow_edit: Internal workflow name for job edition using this script. For the between operator the value will be treated as an Array if comma delimited string is passed, and it must contain an even number of values.
:type op_taskflow_edit: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_f_taskflow_edit: If op_taskflow_edit is specified, the field named in this input will be compared to the value in taskflow_edit using the specified operator. That is, the value in this input will be treated as another field name, rather than a constant value. Either this field or val_c_taskflow_edit must be specified if op_taskflow_edit is specified.
:type val_f_taskflow_edit: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_c_taskflow_edit: If op_taskflow_edit is specified, this value will be compared to the value in taskflow_edit using the specified operator. The value in this input will be treated as an explicit constant value. Either this field or val_f_taskflow_edit must be specified if op_taskflow_edit is specified.
:type val_c_taskflow_edit: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param op_taskflow_revert: The operator to apply to the field taskflow_revert. Valid values are: =, <>, rlike, not rlike, >, >=, <, <=, like, not like, is null, is not null, between. taskflow_revert: Internal workflow name for job reversion using this script. For the between operator the value will be treated as an Array if comma delimited string is passed, and it must contain an even number of values.
:type op_taskflow_revert: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_f_taskflow_revert: If op_taskflow_revert is specified, the field named in this input will be compared to the value in taskflow_revert using the specified operator. That is, the value in this input will be treated as another field name, rather than a constant value. Either this field or val_c_taskflow_revert must be specified if op_taskflow_revert is specified.
:type val_f_taskflow_revert: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_c_taskflow_revert: If op_taskflow_revert is specified, this value will be compared to the value in taskflow_revert using the specified operator. The value in this input will be treated as an explicit constant value. Either this field or val_f_taskflow_revert must be specified if op_taskflow_revert is specified.
:type val_c_taskflow_revert: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param op_transactional_ind: The operator to apply to the field transactional_ind. Valid values are: =, <>, rlike, not rlike, >, >=, <, <=, like, not like, is null, is not null, between. transactional_ind: Flag indicating if devices should be reserved during execution of this script. For the between operator the value will be treated as an Array if comma delimited string is passed, and it must contain an even number of values.
:type op_transactional_ind: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_f_transactional_ind: If op_transactional_ind is specified, the field named in this input will be compared to the value in transactional_ind using the specified operator. That is, the value in this input will be treated as another field name, rather than a constant value. Either this field or val_c_transactional_ind must be specified if op_transactional_ind is specified.
:type val_f_transactional_ind: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_c_transactional_ind: If op_transactional_ind is specified, this value will be compared to the value in transactional_ind using the specified operator. The value in this input will be treated as an explicit constant value. Either this field or val_f_transactional_ind must be specified if op_transactional_ind is specified.
:type val_c_transactional_ind: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param op_updated_at: The operator to apply to the field updated_at. Valid values are: =, <>, rlike, not rlike, >, >=, <, <=, like, not like, is null, is not null, between. updated_at: The date and time the script was last modified. For the between operator the value will be treated as an Array if comma delimited string is passed, and it must contain an even number of values.
:type op_updated_at: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_f_updated_at: If op_updated_at is specified, the field named in this input will be compared to the value in updated_at using the specified operator. That is, the value in this input will be treated as another field name, rather than a constant value. Either this field or val_c_updated_at must be specified if op_updated_at is specified.
:type val_f_updated_at: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_c_updated_at: If op_updated_at is specified, this value will be compared to the value in updated_at using the specified operator. The value in this input will be treated as an explicit constant value. Either this field or val_f_updated_at must be specified if op_updated_at is specified.
:type val_c_updated_at: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param op_updated_by: The operator to apply to the field updated_by. Valid values are: =, <>, rlike, not rlike, >, >=, <, <=, like, not like, is null, is not null, between. updated_by: The user that last modified this script. For the between operator the value will be treated as an Array if comma delimited string is passed, and it must contain an even number of values.
:type op_updated_by: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_f_updated_by: If op_updated_by is specified, the field named in this input will be compared to the value in updated_by using the specified operator. That is, the value in this input will be treated as another field name, rather than a constant value. Either this field or val_c_updated_by must be specified if op_updated_by is specified.
:type val_f_updated_by: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_c_updated_by: If op_updated_by is specified, this value will be compared to the value in updated_by using the specified operator. The value in this input will be treated as an explicit constant value. Either this field or val_f_updated_by must be specified if op_updated_by is specified.
:type val_c_updated_by: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param op_visible: The operator to apply to the field visible. Valid values are: =, <>, rlike, not rlike, >, >=, <, <=, like, not like, is null, is not null, between. visible: Indicates whether this script is visible on the user interface. For the between operator the value will be treated as an Array if comma delimited string is passed, and it must contain an even number of values.
:type op_visible: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_f_visible: If op_visible is specified, the field named in this input will be compared to the value in visible using the specified operator. That is, the value in this input will be treated as another field name, rather than a constant value. Either this field or val_c_visible must be specified if op_visible is specified.
:type val_f_visible: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param val_c_visible: If op_visible is specified, this value will be compared to the value in visible using the specified operator. The value in this input will be treated as an explicit constant value. Either this field or val_f_visible must be specified if op_visible is specified.
:type val_c_visible: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` 0
:param start: The record number to return in the selected page of data. It will always appear, although it may not be the first record. See the :limit for more information.
:type start: Integer
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` 1000
:param limit: The size of the page of data, that is, the maximum number of records returned. The limit size will be used to break the data up into pages and the first page with the start record will be returned. So if you have 100 records and use a :limit of 10 and a :start of 10, you will get records 10-19. The maximum limit is 10000.
:type limit: Integer
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` id
:param sort: The data field(s) to use for sorting the output. Default is id. Valid values are id, name, module, visible, description, created_by, updated_by, language, risk_level, created_at, updated_at, category, read_only, taskflow_create, taskflow_edit, taskflow_revert, target_mapping, transactional_ind.
:type sort: Array of String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` asc
:param dir: The direction(s) in which to sort the data. Default is 'asc'. Valid values are 'asc' and 'desc'.
:type dir: Array of String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param select: The list of attributes to return for each Script. Valid values are id, name, module, visible, description, created_by, updated_by, language, risk_level, created_at, updated_at, category, read_only, taskflow_create, taskflow_edit, taskflow_revert, target_mapping, transactional_ind. If empty or omitted, all attributes will be returned.
:type select: Array
| ``api version min:`` 2.8
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param goto_field: The field name for NIOS GOTO that is used for locating a row position of records.
:type goto_field: String
| ``api version min:`` 2.8
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param goto_value: The value of goto_field for NIOS GOTO that is used for locating a row position of records.
:type goto_value: String
| ``api version min:`` 2.3
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param xml_filter: A SetFilter XML structure to further refine the search. The SetFilter will be applied AFTER any search query or field values, but before any limit options. The limit and pagination will be enforced after the filter. Remind that this kind of filter may be costly and inefficient if not associated with a database filtering.
:type xml_filter: String
**Outputs**
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:return scripts: An array of the Script objects that match the specified input criteria.
:rtype scripts: Array of Script
"""
return self.api_list_request(self._get_method_fullname("find"), kwargs)
def export_file(self, **kwargs):
"""Export a CCS/Perl/Python script from the server.
**Inputs**
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` True
| ``default:`` None
:param id: The ID of the script to export.
:type id: Integer
**Outputs**
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:return content: The content of the script.
:rtype content: String
"""
return self.api_request(self._get_method_fullname("export_file"), kwargs)
def import_file(self, **kwargs):
"""Import a CCS/Perl/Python script into the server.
**Inputs**
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` True
| ``default:`` None
:param id: The ID of the script to update.
:type id: Integer
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` True
| ``default:`` None
:param content: The content of the script.
:type content: String
**Outputs**
"""
return self.api_request(self._get_method_fullname("import_file"), kwargs)
def create(self, **kwargs):
"""Create a CCS/Perl/Python script on NetMRI.
**Inputs**
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` True
| ``default:`` None
:param script_file: The contents of the script file to be created.
:type script_file: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` True
:param overwrite: Overwrite any existing version of the script with the same name.
:type overwrite: Boolean
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` CCS
:param language: The language the script is written in (CCS, Perl, Python).
:type language: String
**Outputs**
"""
return self.api_request(self._get_method_fullname("create"), kwargs)
def update(self, **kwargs):
"""Update a CCS/Perl/Python script on NetMRI.
**Inputs**
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` True
| ``default:`` None
:param id: The ID of the script to update.
:type id: Integer
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` True
| ``default:`` None
:param script_file: The contents of the script file to be updated.
:type script_file: String
| ``api version min:`` 2.1
| ``api version max:`` None
| ``required:`` False
| ``default:`` CCS
:param language: The language the script is written in (CCS, Perl, Python).
:type language: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` 1
:param overwrite: Overwrite any existing version of the script with the same name.
:type overwrite: Integer
**Outputs**
"""
return self.api_request(self._get_method_fullname("update"), kwargs)
def destroy(self, **kwargs):
"""Delete a CCS script on NetMRI.
**Inputs**
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` True
| ``default:`` None
:param id: The ID of the script to delete.
:type id: Integer
**Outputs**
"""
return self.api_request(self._get_method_fullname("destroy"), kwargs)
def run(self, **kwargs):
"""Run a script immediately with specified input. In addition to the listed parameters, optional parameters can be passed. Any parameter name starting with \\$ will be passed as Script-Variable to the script.
**Inputs**
| ``api version min:`` 2.1
| ``api version max:`` 2.1
| ``required:`` True
| ``default:`` None
:param id: The ID of the script to run.
:type id: Integer
| ``api version min:`` 2.1.1
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param id: The ID of the script to run. Required unless name is specified.
:type id: Integer
| ``api version min:`` 2.1.1
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param name: The name of the script to run. Required unless ID is specified.
:type name: String
| ``api version min:`` 2.4
| ``api version max:`` None
| ``required:`` False
| ``default:`` 0
:param wait: Maximum number of seconds to wait for script completion before returning the job result. Using a value of 0 will cause the call to schedule the job and return immediately. Requires that the target is one single device.
:type wait: Integer
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param device_group_ids: An array of device group ids. Can be blank if not using device groups.
:type device_group_ids: Array of Integer
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param device_ids: An array of device ids. Can be blank if ONLY using device groups.
:type device_ids: Array of Integer
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` requestor
:param credential_mode: If user credentials are required, they may be set from additional inputs (credential_mode = 'manual'). The credentials may be looked up using requestor stored credentials (credential_mode = 'requestor').
:type credential_mode: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param username: Username to be used if the job requires user credentials.
:type username: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param password: Password to be used if the job requires user credentials.
:type password: String
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param enable_password: Enable password to be used if the job requires user credentials.
:type enable_password: String
| ``api version min:`` 2.4
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param job_name: Optional name for this run of a job.
:type job_name: String
**Outputs**
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:return JobID: The JobID of the running script.
:rtype JobID: Integer
| ``api version min:`` 2.4
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:return status: The status of the job, if the call input wait parameter had a non zero value. Status Pending or Running indicates the call timed out and the job is still in processing.
:rtype status: String
| ``api version min:`` 2.4
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:return payload: The JSON payload of the script output, if any. Only set if Status is set and its value is OK.
:rtype payload: String
"""
return self.api_request(self._get_method_fullname("run"), kwargs)
| 48.95107
| 619
| 0.590007
| 8,143
| 64,028
| 4.551271
| 0.044333
| 0.080408
| 0.052265
| 0.058714
| 0.926014
| 0.919673
| 0.909905
| 0.899328
| 0.876906
| 0.869539
| 0
| 0.005267
| 0.320906
| 64,028
| 1,307
| 620
| 48.988523
| 0.847083
| 0.805304
| 0
| 0
| 0
| 0
| 0.053599
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.434783
| false
| 0
| 0.130435
| 0
| 1.086957
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 8
|
0ee45cd0e69f67127706014cc9a717b6727e7ac6
| 173
|
py
|
Python
|
hTools2.roboFontExt/lib/Scripts/selected glyphs/transform/mirror.py
|
frankrolf/hTools2_extension
|
9d73b8640c85209853a72f8d4b167768de5e0d60
|
[
"BSD-3-Clause"
] | 2
|
2019-12-18T16:12:07.000Z
|
2019-12-21T01:19:23.000Z
|
hTools2.roboFontExt/lib/Scripts/selected glyphs/transform/mirror.py
|
frankrolf/hTools2_extension
|
9d73b8640c85209853a72f8d4b167768de5e0d60
|
[
"BSD-3-Clause"
] | null | null | null |
hTools2.roboFontExt/lib/Scripts/selected glyphs/transform/mirror.py
|
frankrolf/hTools2_extension
|
9d73b8640c85209853a72f8d4b167768de5e0d60
|
[
"BSD-3-Clause"
] | null | null | null |
# [h] move dialog
import hTools2.dialogs.glyphs.mirror
import importlib
importlib.reload(hTools2.dialogs.glyphs.mirror)
hTools2.dialogs.glyphs.mirror.mirrorGlyphsDialog()
| 21.625
| 50
| 0.82659
| 21
| 173
| 6.809524
| 0.52381
| 0.293706
| 0.41958
| 0.545455
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.018634
| 0.069364
| 173
| 7
| 51
| 24.714286
| 0.869565
| 0.086705
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.75
| 0
| 0.75
| 0
| 1
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 8
|
0eeeaae9d741ead25dc02c45b0426a7dda51c85a
| 588
|
bzl
|
Python
|
dotnet/defs.nuget.bzl
|
GravitySketch/rules_msbuild
|
d4afc08bb3c84f691bd32b5cd250c49bb9cc80f9
|
[
"Apache-2.0"
] | 2
|
2021-11-07T13:02:33.000Z
|
2022-01-17T20:12:20.000Z
|
dotnet/defs.nuget.bzl
|
GravitySketch/rules_msbuild
|
d4afc08bb3c84f691bd32b5cd250c49bb9cc80f9
|
[
"Apache-2.0"
] | 107
|
2021-02-28T17:09:16.000Z
|
2021-06-10T18:50:20.000Z
|
dotnet/defs.nuget.bzl
|
GravitySketch/rules_msbuild
|
d4afc08bb3c84f691bd32b5cd250c49bb9cc80f9
|
[
"Apache-2.0"
] | null | null | null |
load(
"//dotnet/private/rules:nuget_download.bzl",
_framework_info = "framework_info",
_nuget_package_framework_version = "nuget_package_framework_version",
_nuget_package_version = "nuget_package_version",
_tfm_mapping = "tfm_mapping",
)
load(
"//dotnet/private:nuget_macros.bzl",
_nuget_package_download = "nuget_package_download",
)
nuget_package_download = _nuget_package_download
framework_info = _framework_info
nuget_package_framework_version = _nuget_package_framework_version
nuget_package_version = _nuget_package_version
tfm_mapping = _tfm_mapping
| 32.666667
| 73
| 0.811224
| 69
| 588
| 6.217391
| 0.202899
| 0.335664
| 0.265734
| 0.261072
| 0.839161
| 0.839161
| 0.839161
| 0.839161
| 0.839161
| 0.652681
| 0
| 0
| 0.110544
| 588
| 17
| 74
| 34.588235
| 0.820268
| 0
| 0
| 0.125
| 0
| 0
| 0.294218
| 0.251701
| 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
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 9
|
160fa8e1ba26dc2f1436d6f4097ed5b40ef49404
| 6,561
|
py
|
Python
|
image/edit_3.py
|
NidushaAmarasinghe/Nidusha-Image-Editor-Bot
|
883ca4f5ad6ad0524c54eb8e69cf46f0d29240c5
|
[
"MIT"
] | null | null | null |
image/edit_3.py
|
NidushaAmarasinghe/Nidusha-Image-Editor-Bot
|
883ca4f5ad6ad0524c54eb8e69cf46f0d29240c5
|
[
"MIT"
] | null | null | null |
image/edit_3.py
|
NidushaAmarasinghe/Nidusha-Image-Editor-Bot
|
883ca4f5ad6ad0524c54eb8e69cf46f0d29240c5
|
[
"MIT"
] | null | null | null |
# By @Nidusha_Bots
from PIL import Image, ImageOps
import shutil
import os
async def black_border(client, message):
try:
userid = str(message.chat.id)
if not os.path.isdir(f"./DOWNLOADS/{userid}"):
os.makedirs(f"./DOWNLOADS/{userid}")
download_location = "./DOWNLOADS" + "/" + userid + "/" + userid + ".jpg"
edit_img_loc = "./DOWNLOADS" + "/" + userid + "/" + "imaged-black-border.png"
if not message.reply_to_message.empty:
msg = await message.reply_to_message.reply_text(
"Downloading image", quote=True
)
a = await client.download_media(
message=message.reply_to_message, file_name=download_location
)
await msg.edit("Processing Image...")
img = Image.open(a)
img_with_border = ImageOps.expand(img, border=100, fill="black")
img_with_border.save(edit_img_loc)
await message.reply_chat_action("upload_photo")
await message.reply_to_message.reply_photo(edit_img_loc, quote=True)
await msg.delete()
else:
await message.reply_text("Why did you delete that??")
try:
shutil.rmtree(f"./DOWNLOADS/{userid}")
except Exception:
pass
except Exception as e:
print("black_border-error - " + str(e))
if "USER_IS_BLOCKED" in str(e):
return
else:
try:
await message.reply_to_message.reply_text(
"Something went wrong!", quote=True
)
except Exception:
return
async def green_border(client, message):
try:
userid = str(message.chat.id)
if not os.path.isdir(f"./DOWNLOADS/{userid}"):
os.makedirs(f"./DOWNLOADS/{userid}")
download_location = "./DOWNLOADS" + "/" + userid + "/" + userid + ".jpg"
edit_img_loc = "./DOWNLOADS" + "/" + userid + "/" + "imaged-green-border.png"
if not message.reply_to_message.empty:
msg = await message.reply_to_message.reply_text(
"Downloading image", quote=True
)
a = await client.download_media(
message=message.reply_to_message, file_name=download_location
)
await msg.edit("Processing Image...")
img = Image.open(a)
img_with_border = ImageOps.expand(img, border=100, fill="green")
img_with_border.save(edit_img_loc)
await message.reply_chat_action("upload_photo")
await message.reply_to_message.reply_photo(edit_img_loc, quote=True)
await msg.delete()
else:
await message.reply_text("Why did you delete that??")
try:
shutil.rmtree(f"./DOWNLOADS/{userid}")
except Exception:
pass
except Exception as e:
print("green_border-error - " + str(e))
if "USER_IS_BLOCKED" in str(e):
return
else:
try:
await message.reply_to_message.reply_text(
"Something went wrong!", quote=True
)
except Exception:
return
async def blue_border(client, message):
try:
userid = str(message.chat.id)
if not os.path.isdir(f"./DOWNLOADS/{userid}"):
os.makedirs(f"./DOWNLOADS/{userid}")
download_location = "./DOWNLOADS" + "/" + userid + "/" + userid + ".jpg"
edit_img_loc = "./DOWNLOADS" + "/" + userid + "/" + "imaged-blue-border.png"
if not message.reply_to_message.empty:
msg = await message.reply_to_message.reply_text(
"Downloading image", quote=True
)
a = await client.download_media(
message=message.reply_to_message, file_name=download_location
)
await msg.edit("Processing Image...")
img = Image.open(a)
img_with_border = ImageOps.expand(img, border=100, fill="blue")
img_with_border.save(edit_img_loc)
await message.reply_chat_action("upload_photo")
await message.reply_to_message.reply_photo(edit_img_loc, quote=True)
await msg.delete()
else:
await message.reply_text("Why did you delete that??")
try:
shutil.rmtree(f"./DOWNLOADS/{userid}")
except Exception:
pass
except Exception as e:
print("blue_border-error - " + str(e))
if "USER_IS_BLOCKED" in str(e):
return
else:
try:
await message.reply_to_message.reply_text(
"Something went wrong!", quote=True
)
except Exception:
return
async def red_border(client, message):
try:
userid = str(message.chat.id)
if not os.path.isdir(f"./DOWNLOADS/{userid}"):
os.makedirs(f"./DOWNLOADS/{userid}")
download_location = "./DOWNLOADS" + "/" + userid + "/" + userid + ".jpg"
edit_img_loc = "./DOWNLOADS" + "/" + userid + "/" + "imaged-red-border.png"
if not message.reply_to_message.empty:
msg = await message.reply_to_message.reply_text(
"Downloading image", quote=True
)
a = await client.download_media(
message=message.reply_to_message, file_name=download_location
)
await msg.edit("Processing Image...")
img = Image.open(a)
img_with_border = ImageOps.expand(img, border=100, fill="red")
img_with_border.save(edit_img_loc)
await message.reply_chat_action("upload_photo")
await message.reply_to_message.reply_photo(edit_img_loc, quote=True)
await msg.delete()
else:
await message.reply_text("Why did you delete that??")
try:
shutil.rmtree(f"./DOWNLOADS/{userid}")
except Exception:
pass
except Exception as e:
print("red_border-error - " + str(e))
if "USER_IS_BLOCKED" in str(e):
return
else:
try:
await message.reply_to_message.reply_text(
"Something went wrong!", quote=True
)
except Exception:
return
| 40.006098
| 86
| 0.545039
| 712
| 6,561
| 4.824438
| 0.117978
| 0.139738
| 0.081514
| 0.122271
| 0.960699
| 0.960699
| 0.960699
| 0.960699
| 0.960699
| 0.960699
| 0
| 0.002799
| 0.346594
| 6,561
| 164
| 87
| 40.006098
| 0.79846
| 0.002439
| 0
| 0.8
| 0
| 0
| 0.154051
| 0.013948
| 0.051613
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0.025806
| 0.019355
| 0
| 0.070968
| 0.025806
| 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
|
16307648c4c058f771edf95bba9937e0940f6b47
| 153
|
py
|
Python
|
python/maya/core/__init__.py
|
CountZer0/PipelineConstructionSet
|
0aa73a8a63c72989b2d1c677efd78dad4388d335
|
[
"BSD-3-Clause"
] | 21
|
2015-04-27T05:01:36.000Z
|
2021-11-22T13:45:14.000Z
|
python/maya/core/__init__.py
|
0xb1dd1e/PipelineConstructionSet
|
621349da1b6d1437e95d0c9e48ee9f36d59f19fd
|
[
"BSD-3-Clause"
] | null | null | null |
python/maya/core/__init__.py
|
0xb1dd1e/PipelineConstructionSet
|
621349da1b6d1437e95d0c9e48ee9f36d59f19fd
|
[
"BSD-3-Clause"
] | 7
|
2015-04-11T11:37:19.000Z
|
2020-05-22T09:49:04.000Z
|
"""
Author: jason
Created: Jul 7, 2012
Module: maya.core.__init__
Purpose: to import maya.core
"""
print "maya.core.__init__ imported"
| 17
| 36
| 0.653595
| 20
| 153
| 4.6
| 0.75
| 0.26087
| 0.26087
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.042373
| 0.228758
| 153
| 9
| 36
| 17
| 0.737288
| 0
| 0
| 0
| 0
| 0
| 0.5625
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 1
| null | null | 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
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 1
|
0
| 7
|
165f31c501b9d2c165e439bcbfabdb5b6b2d3fb1
| 22,725
|
py
|
Python
|
sdk/python/pulumi_aws/ssoadmin/permission_set.py
|
chivandikwa/pulumi-aws
|
19c08bf9dcb90544450ffa4eec7bf6751058fde2
|
[
"ECL-2.0",
"Apache-2.0"
] | 1
|
2021-11-10T16:33:40.000Z
|
2021-11-10T16:33:40.000Z
|
sdk/python/pulumi_aws/ssoadmin/permission_set.py
|
chivandikwa/pulumi-aws
|
19c08bf9dcb90544450ffa4eec7bf6751058fde2
|
[
"ECL-2.0",
"Apache-2.0"
] | null | null | null |
sdk/python/pulumi_aws/ssoadmin/permission_set.py
|
chivandikwa/pulumi-aws
|
19c08bf9dcb90544450ffa4eec7bf6751058fde2
|
[
"ECL-2.0",
"Apache-2.0"
] | null | null | null |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
__all__ = ['PermissionSetArgs', 'PermissionSet']
@pulumi.input_type
class PermissionSetArgs:
def __init__(__self__, *,
instance_arn: pulumi.Input[str],
description: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
relay_state: Optional[pulumi.Input[str]] = None,
session_duration: Optional[pulumi.Input[str]] = None,
tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None):
"""
The set of arguments for constructing a PermissionSet resource.
:param pulumi.Input[str] instance_arn: The Amazon Resource Name (ARN) of the SSO Instance under which the operation will be executed.
:param pulumi.Input[str] description: The description of the Permission Set.
:param pulumi.Input[str] name: The name of the Permission Set.
:param pulumi.Input[str] relay_state: The relay state URL used to redirect users within the application during the federation authentication process.
:param pulumi.Input[str] session_duration: The length of time that the application user sessions are valid in the ISO-8601 standard. Default: `PT1H`.
:param pulumi.Input[Mapping[str, pulumi.Input[str]]] tags: Key-value map of resource tags. .If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
"""
pulumi.set(__self__, "instance_arn", instance_arn)
if description is not None:
pulumi.set(__self__, "description", description)
if name is not None:
pulumi.set(__self__, "name", name)
if relay_state is not None:
pulumi.set(__self__, "relay_state", relay_state)
if session_duration is not None:
pulumi.set(__self__, "session_duration", session_duration)
if tags is not None:
pulumi.set(__self__, "tags", tags)
@property
@pulumi.getter(name="instanceArn")
def instance_arn(self) -> pulumi.Input[str]:
"""
The Amazon Resource Name (ARN) of the SSO Instance under which the operation will be executed.
"""
return pulumi.get(self, "instance_arn")
@instance_arn.setter
def instance_arn(self, value: pulumi.Input[str]):
pulumi.set(self, "instance_arn", value)
@property
@pulumi.getter
def description(self) -> Optional[pulumi.Input[str]]:
"""
The description of the Permission Set.
"""
return pulumi.get(self, "description")
@description.setter
def description(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "description", value)
@property
@pulumi.getter
def name(self) -> Optional[pulumi.Input[str]]:
"""
The name of the Permission Set.
"""
return pulumi.get(self, "name")
@name.setter
def name(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "name", value)
@property
@pulumi.getter(name="relayState")
def relay_state(self) -> Optional[pulumi.Input[str]]:
"""
The relay state URL used to redirect users within the application during the federation authentication process.
"""
return pulumi.get(self, "relay_state")
@relay_state.setter
def relay_state(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "relay_state", value)
@property
@pulumi.getter(name="sessionDuration")
def session_duration(self) -> Optional[pulumi.Input[str]]:
"""
The length of time that the application user sessions are valid in the ISO-8601 standard. Default: `PT1H`.
"""
return pulumi.get(self, "session_duration")
@session_duration.setter
def session_duration(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "session_duration", value)
@property
@pulumi.getter
def tags(self) -> Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]:
"""
Key-value map of resource tags. .If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
"""
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 _PermissionSetState:
def __init__(__self__, *,
arn: Optional[pulumi.Input[str]] = None,
created_date: Optional[pulumi.Input[str]] = None,
description: Optional[pulumi.Input[str]] = None,
instance_arn: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
relay_state: Optional[pulumi.Input[str]] = None,
session_duration: Optional[pulumi.Input[str]] = None,
tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
tags_all: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None):
"""
Input properties used for looking up and filtering PermissionSet resources.
:param pulumi.Input[str] arn: The Amazon Resource Name (ARN) of the Permission Set.
:param pulumi.Input[str] created_date: The date the Permission Set was created in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8).
:param pulumi.Input[str] description: The description of the Permission Set.
:param pulumi.Input[str] instance_arn: The Amazon Resource Name (ARN) of the SSO Instance under which the operation will be executed.
:param pulumi.Input[str] name: The name of the Permission Set.
:param pulumi.Input[str] relay_state: The relay state URL used to redirect users within the application during the federation authentication process.
:param pulumi.Input[str] session_duration: The length of time that the application user sessions are valid in the ISO-8601 standard. Default: `PT1H`.
:param pulumi.Input[Mapping[str, pulumi.Input[str]]] tags: Key-value map of resource tags. .If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
:param pulumi.Input[Mapping[str, pulumi.Input[str]]] tags_all: A map of tags assigned to the resource, including those inherited from the provider .
"""
if arn is not None:
pulumi.set(__self__, "arn", arn)
if created_date is not None:
pulumi.set(__self__, "created_date", created_date)
if description is not None:
pulumi.set(__self__, "description", description)
if instance_arn is not None:
pulumi.set(__self__, "instance_arn", instance_arn)
if name is not None:
pulumi.set(__self__, "name", name)
if relay_state is not None:
pulumi.set(__self__, "relay_state", relay_state)
if session_duration is not None:
pulumi.set(__self__, "session_duration", session_duration)
if tags is not None:
pulumi.set(__self__, "tags", tags)
if tags_all is not None:
pulumi.set(__self__, "tags_all", tags_all)
@property
@pulumi.getter
def arn(self) -> Optional[pulumi.Input[str]]:
"""
The Amazon Resource Name (ARN) of the Permission Set.
"""
return pulumi.get(self, "arn")
@arn.setter
def arn(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "arn", value)
@property
@pulumi.getter(name="createdDate")
def created_date(self) -> Optional[pulumi.Input[str]]:
"""
The date the Permission Set was created in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8).
"""
return pulumi.get(self, "created_date")
@created_date.setter
def created_date(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "created_date", value)
@property
@pulumi.getter
def description(self) -> Optional[pulumi.Input[str]]:
"""
The description of the Permission Set.
"""
return pulumi.get(self, "description")
@description.setter
def description(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "description", value)
@property
@pulumi.getter(name="instanceArn")
def instance_arn(self) -> Optional[pulumi.Input[str]]:
"""
The Amazon Resource Name (ARN) of the SSO Instance under which the operation will be executed.
"""
return pulumi.get(self, "instance_arn")
@instance_arn.setter
def instance_arn(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "instance_arn", value)
@property
@pulumi.getter
def name(self) -> Optional[pulumi.Input[str]]:
"""
The name of the Permission Set.
"""
return pulumi.get(self, "name")
@name.setter
def name(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "name", value)
@property
@pulumi.getter(name="relayState")
def relay_state(self) -> Optional[pulumi.Input[str]]:
"""
The relay state URL used to redirect users within the application during the federation authentication process.
"""
return pulumi.get(self, "relay_state")
@relay_state.setter
def relay_state(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "relay_state", value)
@property
@pulumi.getter(name="sessionDuration")
def session_duration(self) -> Optional[pulumi.Input[str]]:
"""
The length of time that the application user sessions are valid in the ISO-8601 standard. Default: `PT1H`.
"""
return pulumi.get(self, "session_duration")
@session_duration.setter
def session_duration(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "session_duration", value)
@property
@pulumi.getter
def tags(self) -> Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]:
"""
Key-value map of resource tags. .If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
"""
return pulumi.get(self, "tags")
@tags.setter
def tags(self, value: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]):
pulumi.set(self, "tags", value)
@property
@pulumi.getter(name="tagsAll")
def tags_all(self) -> Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]:
"""
A map of tags assigned to the resource, including those inherited from the provider .
"""
return pulumi.get(self, "tags_all")
@tags_all.setter
def tags_all(self, value: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]):
pulumi.set(self, "tags_all", value)
class PermissionSet(pulumi.CustomResource):
@overload
def __init__(__self__,
resource_name: str,
opts: Optional[pulumi.ResourceOptions] = None,
description: Optional[pulumi.Input[str]] = None,
instance_arn: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
relay_state: Optional[pulumi.Input[str]] = None,
session_duration: Optional[pulumi.Input[str]] = None,
tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
__props__=None):
"""
Provides a Single Sign-On (SSO) Permission Set resource
> **NOTE:** Updating this resource will automatically [Provision the Permission Set](https://docs.aws.amazon.com/singlesignon/latest/APIReference/API_ProvisionPermissionSet.html) to apply the corresponding updates to all assigned accounts.
## Import
SSO Permission Sets can be imported using the `arn` and `instance_arn` separated by a comma (`,`) e.g.,
```sh
$ pulumi import aws:ssoadmin/permissionSet:PermissionSet example arn:aws:sso:::permissionSet/ssoins-2938j0x8920sbj72/ps-80383020jr9302rk,arn:aws:sso:::instance/ssoins-2938j0x8920sbj72
```
: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 Permission Set.
:param pulumi.Input[str] instance_arn: The Amazon Resource Name (ARN) of the SSO Instance under which the operation will be executed.
:param pulumi.Input[str] name: The name of the Permission Set.
:param pulumi.Input[str] relay_state: The relay state URL used to redirect users within the application during the federation authentication process.
:param pulumi.Input[str] session_duration: The length of time that the application user sessions are valid in the ISO-8601 standard. Default: `PT1H`.
:param pulumi.Input[Mapping[str, pulumi.Input[str]]] tags: Key-value map of resource tags. .If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
"""
...
@overload
def __init__(__self__,
resource_name: str,
args: PermissionSetArgs,
opts: Optional[pulumi.ResourceOptions] = None):
"""
Provides a Single Sign-On (SSO) Permission Set resource
> **NOTE:** Updating this resource will automatically [Provision the Permission Set](https://docs.aws.amazon.com/singlesignon/latest/APIReference/API_ProvisionPermissionSet.html) to apply the corresponding updates to all assigned accounts.
## Import
SSO Permission Sets can be imported using the `arn` and `instance_arn` separated by a comma (`,`) e.g.,
```sh
$ pulumi import aws:ssoadmin/permissionSet:PermissionSet example arn:aws:sso:::permissionSet/ssoins-2938j0x8920sbj72/ps-80383020jr9302rk,arn:aws:sso:::instance/ssoins-2938j0x8920sbj72
```
:param str resource_name: The name of the resource.
:param PermissionSetArgs 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(PermissionSetArgs, 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,
instance_arn: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
relay_state: Optional[pulumi.Input[str]] = None,
session_duration: 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__ = PermissionSetArgs.__new__(PermissionSetArgs)
__props__.__dict__["description"] = description
if instance_arn is None and not opts.urn:
raise TypeError("Missing required property 'instance_arn'")
__props__.__dict__["instance_arn"] = instance_arn
__props__.__dict__["name"] = name
__props__.__dict__["relay_state"] = relay_state
__props__.__dict__["session_duration"] = session_duration
__props__.__dict__["tags"] = tags
__props__.__dict__["arn"] = None
__props__.__dict__["created_date"] = None
__props__.__dict__["tags_all"] = None
super(PermissionSet, __self__).__init__(
'aws:ssoadmin/permissionSet:PermissionSet',
resource_name,
__props__,
opts)
@staticmethod
def get(resource_name: str,
id: pulumi.Input[str],
opts: Optional[pulumi.ResourceOptions] = None,
arn: Optional[pulumi.Input[str]] = None,
created_date: Optional[pulumi.Input[str]] = None,
description: Optional[pulumi.Input[str]] = None,
instance_arn: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
relay_state: Optional[pulumi.Input[str]] = None,
session_duration: Optional[pulumi.Input[str]] = None,
tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
tags_all: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None) -> 'PermissionSet':
"""
Get an existing PermissionSet 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] arn: The Amazon Resource Name (ARN) of the Permission Set.
:param pulumi.Input[str] created_date: The date the Permission Set was created in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8).
:param pulumi.Input[str] description: The description of the Permission Set.
:param pulumi.Input[str] instance_arn: The Amazon Resource Name (ARN) of the SSO Instance under which the operation will be executed.
:param pulumi.Input[str] name: The name of the Permission Set.
:param pulumi.Input[str] relay_state: The relay state URL used to redirect users within the application during the federation authentication process.
:param pulumi.Input[str] session_duration: The length of time that the application user sessions are valid in the ISO-8601 standard. Default: `PT1H`.
:param pulumi.Input[Mapping[str, pulumi.Input[str]]] tags: Key-value map of resource tags. .If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
:param pulumi.Input[Mapping[str, pulumi.Input[str]]] tags_all: A map of tags assigned to the resource, including those inherited from the provider .
"""
opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))
__props__ = _PermissionSetState.__new__(_PermissionSetState)
__props__.__dict__["arn"] = arn
__props__.__dict__["created_date"] = created_date
__props__.__dict__["description"] = description
__props__.__dict__["instance_arn"] = instance_arn
__props__.__dict__["name"] = name
__props__.__dict__["relay_state"] = relay_state
__props__.__dict__["session_duration"] = session_duration
__props__.__dict__["tags"] = tags
__props__.__dict__["tags_all"] = tags_all
return PermissionSet(resource_name, opts=opts, __props__=__props__)
@property
@pulumi.getter
def arn(self) -> pulumi.Output[str]:
"""
The Amazon Resource Name (ARN) of the Permission Set.
"""
return pulumi.get(self, "arn")
@property
@pulumi.getter(name="createdDate")
def created_date(self) -> pulumi.Output[str]:
"""
The date the Permission Set was created in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8).
"""
return pulumi.get(self, "created_date")
@property
@pulumi.getter
def description(self) -> pulumi.Output[Optional[str]]:
"""
The description of the Permission Set.
"""
return pulumi.get(self, "description")
@property
@pulumi.getter(name="instanceArn")
def instance_arn(self) -> pulumi.Output[str]:
"""
The Amazon Resource Name (ARN) of the SSO Instance under which the operation will be executed.
"""
return pulumi.get(self, "instance_arn")
@property
@pulumi.getter
def name(self) -> pulumi.Output[str]:
"""
The name of the Permission Set.
"""
return pulumi.get(self, "name")
@property
@pulumi.getter(name="relayState")
def relay_state(self) -> pulumi.Output[Optional[str]]:
"""
The relay state URL used to redirect users within the application during the federation authentication process.
"""
return pulumi.get(self, "relay_state")
@property
@pulumi.getter(name="sessionDuration")
def session_duration(self) -> pulumi.Output[Optional[str]]:
"""
The length of time that the application user sessions are valid in the ISO-8601 standard. Default: `PT1H`.
"""
return pulumi.get(self, "session_duration")
@property
@pulumi.getter
def tags(self) -> pulumi.Output[Optional[Mapping[str, str]]]:
"""
Key-value map of resource tags. .If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
"""
return pulumi.get(self, "tags")
@property
@pulumi.getter(name="tagsAll")
def tags_all(self) -> pulumi.Output[Mapping[str, str]]:
"""
A map of tags assigned to the resource, including those inherited from the provider .
"""
return pulumi.get(self, "tags_all")
| 46.567623
| 249
| 0.65681
| 2,759
| 22,725
| 5.233055
| 0.080464
| 0.090664
| 0.095027
| 0.076188
| 0.86307
| 0.846239
| 0.822482
| 0.812647
| 0.804267
| 0.775315
| 0
| 0.008322
| 0.238548
| 22,725
| 487
| 250
| 46.663244
| 0.826052
| 0.371001
| 0
| 0.706714
| 1
| 0
| 0.082028
| 0.003027
| 0
| 0
| 0
| 0
| 0
| 1
| 0.162544
| false
| 0.003534
| 0.017668
| 0
| 0.279152
| 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
|
16a4b31e69247b35d85ac3e517eeeed990929384
| 37,995
|
py
|
Python
|
sdk/python/pulumi_gcp/compute/firewall_policy_rule.py
|
sisisin/pulumi-gcp
|
af6681d70ea457843409110c1324817fe55f68ad
|
[
"ECL-2.0",
"Apache-2.0"
] | null | null | null |
sdk/python/pulumi_gcp/compute/firewall_policy_rule.py
|
sisisin/pulumi-gcp
|
af6681d70ea457843409110c1324817fe55f68ad
|
[
"ECL-2.0",
"Apache-2.0"
] | null | null | null |
sdk/python/pulumi_gcp/compute/firewall_policy_rule.py
|
sisisin/pulumi-gcp
|
af6681d70ea457843409110c1324817fe55f68ad
|
[
"ECL-2.0",
"Apache-2.0"
] | null | null | null |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from . import outputs
from ._inputs import *
__all__ = ['FirewallPolicyRuleArgs', 'FirewallPolicyRule']
@pulumi.input_type
class FirewallPolicyRuleArgs:
def __init__(__self__, *,
action: pulumi.Input[str],
direction: pulumi.Input[str],
firewall_policy: pulumi.Input[str],
match: pulumi.Input['FirewallPolicyRuleMatchArgs'],
priority: pulumi.Input[int],
description: Optional[pulumi.Input[str]] = None,
disabled: Optional[pulumi.Input[bool]] = None,
enable_logging: Optional[pulumi.Input[bool]] = None,
target_resources: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
target_service_accounts: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None):
"""
The set of arguments for constructing a FirewallPolicyRule resource.
:param pulumi.Input[str] action: The Action to perform when the client connection triggers the rule. Can currently be either "allow" or "deny()" where valid values for status are 403, 404, and 502.
:param pulumi.Input[str] direction: The direction in which this rule applies. Possible values: INGRESS, EGRESS
:param pulumi.Input[str] firewall_policy: The firewall policy of the resource.
:param pulumi.Input['FirewallPolicyRuleMatchArgs'] match: A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced.
:param pulumi.Input[int] priority: An integer indicating the priority of a rule in the list. The priority must be a positive value between 0 and 2147483647. Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest prority.
:param pulumi.Input[str] description: An optional description for this resource.
:param pulumi.Input[bool] disabled: Denotes whether the firewall policy rule is disabled. When set to true, the firewall policy rule is not enforced and traffic behaves as if it did not exist. If this is unspecified, the firewall policy rule will be enabled.
:param pulumi.Input[bool] enable_logging: Denotes whether to enable logging for a particular rule. If logging is enabled, logs will be exported to the configured export destination in Stackdriver. Logs may be exported to BigQuery or Pub/Sub. Note: you cannot enable logging on "goto_next" rules.
:param pulumi.Input[Sequence[pulumi.Input[str]]] target_resources: A list of network resource URLs to which this rule applies. This field allows you to control which network's VMs get this rule. If this field is left blank, all VMs within the organization will receive the rule.
:param pulumi.Input[Sequence[pulumi.Input[str]]] target_service_accounts: A list of service accounts indicating the sets of instances that are applied with this rule.
"""
pulumi.set(__self__, "action", action)
pulumi.set(__self__, "direction", direction)
pulumi.set(__self__, "firewall_policy", firewall_policy)
pulumi.set(__self__, "match", match)
pulumi.set(__self__, "priority", priority)
if description is not None:
pulumi.set(__self__, "description", description)
if disabled is not None:
pulumi.set(__self__, "disabled", disabled)
if enable_logging is not None:
pulumi.set(__self__, "enable_logging", enable_logging)
if target_resources is not None:
pulumi.set(__self__, "target_resources", target_resources)
if target_service_accounts is not None:
pulumi.set(__self__, "target_service_accounts", target_service_accounts)
@property
@pulumi.getter
def action(self) -> pulumi.Input[str]:
"""
The Action to perform when the client connection triggers the rule. Can currently be either "allow" or "deny()" where valid values for status are 403, 404, and 502.
"""
return pulumi.get(self, "action")
@action.setter
def action(self, value: pulumi.Input[str]):
pulumi.set(self, "action", value)
@property
@pulumi.getter
def direction(self) -> pulumi.Input[str]:
"""
The direction in which this rule applies. Possible values: INGRESS, EGRESS
"""
return pulumi.get(self, "direction")
@direction.setter
def direction(self, value: pulumi.Input[str]):
pulumi.set(self, "direction", value)
@property
@pulumi.getter(name="firewallPolicy")
def firewall_policy(self) -> pulumi.Input[str]:
"""
The firewall policy of the resource.
"""
return pulumi.get(self, "firewall_policy")
@firewall_policy.setter
def firewall_policy(self, value: pulumi.Input[str]):
pulumi.set(self, "firewall_policy", value)
@property
@pulumi.getter
def match(self) -> pulumi.Input['FirewallPolicyRuleMatchArgs']:
"""
A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced.
"""
return pulumi.get(self, "match")
@match.setter
def match(self, value: pulumi.Input['FirewallPolicyRuleMatchArgs']):
pulumi.set(self, "match", value)
@property
@pulumi.getter
def priority(self) -> pulumi.Input[int]:
"""
An integer indicating the priority of a rule in the list. The priority must be a positive value between 0 and 2147483647. Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest prority.
"""
return pulumi.get(self, "priority")
@priority.setter
def priority(self, value: pulumi.Input[int]):
pulumi.set(self, "priority", value)
@property
@pulumi.getter
def description(self) -> Optional[pulumi.Input[str]]:
"""
An optional description for this resource.
"""
return pulumi.get(self, "description")
@description.setter
def description(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "description", value)
@property
@pulumi.getter
def disabled(self) -> Optional[pulumi.Input[bool]]:
"""
Denotes whether the firewall policy rule is disabled. When set to true, the firewall policy rule is not enforced and traffic behaves as if it did not exist. If this is unspecified, the firewall policy rule will be enabled.
"""
return pulumi.get(self, "disabled")
@disabled.setter
def disabled(self, value: Optional[pulumi.Input[bool]]):
pulumi.set(self, "disabled", value)
@property
@pulumi.getter(name="enableLogging")
def enable_logging(self) -> Optional[pulumi.Input[bool]]:
"""
Denotes whether to enable logging for a particular rule. If logging is enabled, logs will be exported to the configured export destination in Stackdriver. Logs may be exported to BigQuery or Pub/Sub. Note: you cannot enable logging on "goto_next" rules.
"""
return pulumi.get(self, "enable_logging")
@enable_logging.setter
def enable_logging(self, value: Optional[pulumi.Input[bool]]):
pulumi.set(self, "enable_logging", value)
@property
@pulumi.getter(name="targetResources")
def target_resources(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
"""
A list of network resource URLs to which this rule applies. This field allows you to control which network's VMs get this rule. If this field is left blank, all VMs within the organization will receive the rule.
"""
return pulumi.get(self, "target_resources")
@target_resources.setter
def target_resources(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]):
pulumi.set(self, "target_resources", value)
@property
@pulumi.getter(name="targetServiceAccounts")
def target_service_accounts(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
"""
A list of service accounts indicating the sets of instances that are applied with this rule.
"""
return pulumi.get(self, "target_service_accounts")
@target_service_accounts.setter
def target_service_accounts(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]):
pulumi.set(self, "target_service_accounts", value)
@pulumi.input_type
class _FirewallPolicyRuleState:
def __init__(__self__, *,
action: Optional[pulumi.Input[str]] = None,
description: Optional[pulumi.Input[str]] = None,
direction: Optional[pulumi.Input[str]] = None,
disabled: Optional[pulumi.Input[bool]] = None,
enable_logging: Optional[pulumi.Input[bool]] = None,
firewall_policy: Optional[pulumi.Input[str]] = None,
kind: Optional[pulumi.Input[str]] = None,
match: Optional[pulumi.Input['FirewallPolicyRuleMatchArgs']] = None,
priority: Optional[pulumi.Input[int]] = None,
rule_tuple_count: Optional[pulumi.Input[int]] = None,
target_resources: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
target_service_accounts: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None):
"""
Input properties used for looking up and filtering FirewallPolicyRule resources.
:param pulumi.Input[str] action: The Action to perform when the client connection triggers the rule. Can currently be either "allow" or "deny()" where valid values for status are 403, 404, and 502.
:param pulumi.Input[str] description: An optional description for this resource.
:param pulumi.Input[str] direction: The direction in which this rule applies. Possible values: INGRESS, EGRESS
:param pulumi.Input[bool] disabled: Denotes whether the firewall policy rule is disabled. When set to true, the firewall policy rule is not enforced and traffic behaves as if it did not exist. If this is unspecified, the firewall policy rule will be enabled.
:param pulumi.Input[bool] enable_logging: Denotes whether to enable logging for a particular rule. If logging is enabled, logs will be exported to the configured export destination in Stackdriver. Logs may be exported to BigQuery or Pub/Sub. Note: you cannot enable logging on "goto_next" rules.
:param pulumi.Input[str] firewall_policy: The firewall policy of the resource.
:param pulumi.Input[str] kind: Type of the resource. Always `compute#firewallPolicyRule` for firewall policy rules
:param pulumi.Input['FirewallPolicyRuleMatchArgs'] match: A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced.
:param pulumi.Input[int] priority: An integer indicating the priority of a rule in the list. The priority must be a positive value between 0 and 2147483647. Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest prority.
:param pulumi.Input[int] rule_tuple_count: Calculation of the complexity of a single firewall policy rule.
:param pulumi.Input[Sequence[pulumi.Input[str]]] target_resources: A list of network resource URLs to which this rule applies. This field allows you to control which network's VMs get this rule. If this field is left blank, all VMs within the organization will receive the rule.
:param pulumi.Input[Sequence[pulumi.Input[str]]] target_service_accounts: A list of service accounts indicating the sets of instances that are applied with this rule.
"""
if action is not None:
pulumi.set(__self__, "action", action)
if description is not None:
pulumi.set(__self__, "description", description)
if direction is not None:
pulumi.set(__self__, "direction", direction)
if disabled is not None:
pulumi.set(__self__, "disabled", disabled)
if enable_logging is not None:
pulumi.set(__self__, "enable_logging", enable_logging)
if firewall_policy is not None:
pulumi.set(__self__, "firewall_policy", firewall_policy)
if kind is not None:
pulumi.set(__self__, "kind", kind)
if match is not None:
pulumi.set(__self__, "match", match)
if priority is not None:
pulumi.set(__self__, "priority", priority)
if rule_tuple_count is not None:
pulumi.set(__self__, "rule_tuple_count", rule_tuple_count)
if target_resources is not None:
pulumi.set(__self__, "target_resources", target_resources)
if target_service_accounts is not None:
pulumi.set(__self__, "target_service_accounts", target_service_accounts)
@property
@pulumi.getter
def action(self) -> Optional[pulumi.Input[str]]:
"""
The Action to perform when the client connection triggers the rule. Can currently be either "allow" or "deny()" where valid values for status are 403, 404, and 502.
"""
return pulumi.get(self, "action")
@action.setter
def action(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "action", value)
@property
@pulumi.getter
def description(self) -> Optional[pulumi.Input[str]]:
"""
An optional description for this resource.
"""
return pulumi.get(self, "description")
@description.setter
def description(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "description", value)
@property
@pulumi.getter
def direction(self) -> Optional[pulumi.Input[str]]:
"""
The direction in which this rule applies. Possible values: INGRESS, EGRESS
"""
return pulumi.get(self, "direction")
@direction.setter
def direction(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "direction", value)
@property
@pulumi.getter
def disabled(self) -> Optional[pulumi.Input[bool]]:
"""
Denotes whether the firewall policy rule is disabled. When set to true, the firewall policy rule is not enforced and traffic behaves as if it did not exist. If this is unspecified, the firewall policy rule will be enabled.
"""
return pulumi.get(self, "disabled")
@disabled.setter
def disabled(self, value: Optional[pulumi.Input[bool]]):
pulumi.set(self, "disabled", value)
@property
@pulumi.getter(name="enableLogging")
def enable_logging(self) -> Optional[pulumi.Input[bool]]:
"""
Denotes whether to enable logging for a particular rule. If logging is enabled, logs will be exported to the configured export destination in Stackdriver. Logs may be exported to BigQuery or Pub/Sub. Note: you cannot enable logging on "goto_next" rules.
"""
return pulumi.get(self, "enable_logging")
@enable_logging.setter
def enable_logging(self, value: Optional[pulumi.Input[bool]]):
pulumi.set(self, "enable_logging", value)
@property
@pulumi.getter(name="firewallPolicy")
def firewall_policy(self) -> Optional[pulumi.Input[str]]:
"""
The firewall policy of the resource.
"""
return pulumi.get(self, "firewall_policy")
@firewall_policy.setter
def firewall_policy(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "firewall_policy", value)
@property
@pulumi.getter
def kind(self) -> Optional[pulumi.Input[str]]:
"""
Type of the resource. Always `compute#firewallPolicyRule` for firewall policy rules
"""
return pulumi.get(self, "kind")
@kind.setter
def kind(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "kind", value)
@property
@pulumi.getter
def match(self) -> Optional[pulumi.Input['FirewallPolicyRuleMatchArgs']]:
"""
A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced.
"""
return pulumi.get(self, "match")
@match.setter
def match(self, value: Optional[pulumi.Input['FirewallPolicyRuleMatchArgs']]):
pulumi.set(self, "match", value)
@property
@pulumi.getter
def priority(self) -> Optional[pulumi.Input[int]]:
"""
An integer indicating the priority of a rule in the list. The priority must be a positive value between 0 and 2147483647. Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest prority.
"""
return pulumi.get(self, "priority")
@priority.setter
def priority(self, value: Optional[pulumi.Input[int]]):
pulumi.set(self, "priority", value)
@property
@pulumi.getter(name="ruleTupleCount")
def rule_tuple_count(self) -> Optional[pulumi.Input[int]]:
"""
Calculation of the complexity of a single firewall policy rule.
"""
return pulumi.get(self, "rule_tuple_count")
@rule_tuple_count.setter
def rule_tuple_count(self, value: Optional[pulumi.Input[int]]):
pulumi.set(self, "rule_tuple_count", value)
@property
@pulumi.getter(name="targetResources")
def target_resources(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
"""
A list of network resource URLs to which this rule applies. This field allows you to control which network's VMs get this rule. If this field is left blank, all VMs within the organization will receive the rule.
"""
return pulumi.get(self, "target_resources")
@target_resources.setter
def target_resources(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]):
pulumi.set(self, "target_resources", value)
@property
@pulumi.getter(name="targetServiceAccounts")
def target_service_accounts(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
"""
A list of service accounts indicating the sets of instances that are applied with this rule.
"""
return pulumi.get(self, "target_service_accounts")
@target_service_accounts.setter
def target_service_accounts(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]):
pulumi.set(self, "target_service_accounts", value)
class FirewallPolicyRule(pulumi.CustomResource):
@overload
def __init__(__self__,
resource_name: str,
opts: Optional[pulumi.ResourceOptions] = None,
action: Optional[pulumi.Input[str]] = None,
description: Optional[pulumi.Input[str]] = None,
direction: Optional[pulumi.Input[str]] = None,
disabled: Optional[pulumi.Input[bool]] = None,
enable_logging: Optional[pulumi.Input[bool]] = None,
firewall_policy: Optional[pulumi.Input[str]] = None,
match: Optional[pulumi.Input[pulumi.InputType['FirewallPolicyRuleMatchArgs']]] = None,
priority: Optional[pulumi.Input[int]] = None,
target_resources: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
target_service_accounts: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
__props__=None):
"""
Hierarchical firewall policy rules let you create and enforce a consistent firewall policy across your organization. Rules can explicitly allow or deny connections or delegate evaluation to lower level policies.
For more information see the [official documentation](https://cloud.google.com/vpc/docs/using-firewall-policies#create-rules)
## Example Usage
```python
import pulumi
import pulumi_gcp as gcp
default_firewall_policy = gcp.compute.FirewallPolicy("defaultFirewallPolicy",
parent="organizations/12345",
short_name="my-policy",
description="Example Resource")
default_firewall_policy_rule = gcp.compute.FirewallPolicyRule("defaultFirewallPolicyRule",
firewall_policy=default_firewall_policy.id,
description="Example Resource",
priority=9000,
enable_logging=True,
action="allow",
direction="EGRESS",
disabled=False,
match=gcp.compute.FirewallPolicyRuleMatchArgs(
layer4_configs=[gcp.compute.FirewallPolicyRuleMatchLayer4ConfigArgs(
ip_protocol="tcp",
ports=[
"80",
"8080",
],
)],
dest_ip_ranges=["11.100.0.1/32"],
))
```
## Import
FirewallPolicyRule can be imported using any of these accepted formats
```sh
$ pulumi import gcp:compute/firewallPolicyRule:FirewallPolicyRule default locations/global/firewallPolicies/{{firewall_policy}}/rules/{{priority}}
```
```sh
$ pulumi import gcp:compute/firewallPolicyRule:FirewallPolicyRule default {{firewall_policy}}/{{priority}}
```
:param str resource_name: The name of the resource.
:param pulumi.ResourceOptions opts: Options for the resource.
:param pulumi.Input[str] action: The Action to perform when the client connection triggers the rule. Can currently be either "allow" or "deny()" where valid values for status are 403, 404, and 502.
:param pulumi.Input[str] description: An optional description for this resource.
:param pulumi.Input[str] direction: The direction in which this rule applies. Possible values: INGRESS, EGRESS
:param pulumi.Input[bool] disabled: Denotes whether the firewall policy rule is disabled. When set to true, the firewall policy rule is not enforced and traffic behaves as if it did not exist. If this is unspecified, the firewall policy rule will be enabled.
:param pulumi.Input[bool] enable_logging: Denotes whether to enable logging for a particular rule. If logging is enabled, logs will be exported to the configured export destination in Stackdriver. Logs may be exported to BigQuery or Pub/Sub. Note: you cannot enable logging on "goto_next" rules.
:param pulumi.Input[str] firewall_policy: The firewall policy of the resource.
:param pulumi.Input[pulumi.InputType['FirewallPolicyRuleMatchArgs']] match: A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced.
:param pulumi.Input[int] priority: An integer indicating the priority of a rule in the list. The priority must be a positive value between 0 and 2147483647. Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest prority.
:param pulumi.Input[Sequence[pulumi.Input[str]]] target_resources: A list of network resource URLs to which this rule applies. This field allows you to control which network's VMs get this rule. If this field is left blank, all VMs within the organization will receive the rule.
:param pulumi.Input[Sequence[pulumi.Input[str]]] target_service_accounts: A list of service accounts indicating the sets of instances that are applied with this rule.
"""
...
@overload
def __init__(__self__,
resource_name: str,
args: FirewallPolicyRuleArgs,
opts: Optional[pulumi.ResourceOptions] = None):
"""
Hierarchical firewall policy rules let you create and enforce a consistent firewall policy across your organization. Rules can explicitly allow or deny connections or delegate evaluation to lower level policies.
For more information see the [official documentation](https://cloud.google.com/vpc/docs/using-firewall-policies#create-rules)
## Example Usage
```python
import pulumi
import pulumi_gcp as gcp
default_firewall_policy = gcp.compute.FirewallPolicy("defaultFirewallPolicy",
parent="organizations/12345",
short_name="my-policy",
description="Example Resource")
default_firewall_policy_rule = gcp.compute.FirewallPolicyRule("defaultFirewallPolicyRule",
firewall_policy=default_firewall_policy.id,
description="Example Resource",
priority=9000,
enable_logging=True,
action="allow",
direction="EGRESS",
disabled=False,
match=gcp.compute.FirewallPolicyRuleMatchArgs(
layer4_configs=[gcp.compute.FirewallPolicyRuleMatchLayer4ConfigArgs(
ip_protocol="tcp",
ports=[
"80",
"8080",
],
)],
dest_ip_ranges=["11.100.0.1/32"],
))
```
## Import
FirewallPolicyRule can be imported using any of these accepted formats
```sh
$ pulumi import gcp:compute/firewallPolicyRule:FirewallPolicyRule default locations/global/firewallPolicies/{{firewall_policy}}/rules/{{priority}}
```
```sh
$ pulumi import gcp:compute/firewallPolicyRule:FirewallPolicyRule default {{firewall_policy}}/{{priority}}
```
:param str resource_name: The name of the resource.
:param FirewallPolicyRuleArgs 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(FirewallPolicyRuleArgs, 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,
action: Optional[pulumi.Input[str]] = None,
description: Optional[pulumi.Input[str]] = None,
direction: Optional[pulumi.Input[str]] = None,
disabled: Optional[pulumi.Input[bool]] = None,
enable_logging: Optional[pulumi.Input[bool]] = None,
firewall_policy: Optional[pulumi.Input[str]] = None,
match: Optional[pulumi.Input[pulumi.InputType['FirewallPolicyRuleMatchArgs']]] = None,
priority: Optional[pulumi.Input[int]] = None,
target_resources: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
target_service_accounts: 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__ = FirewallPolicyRuleArgs.__new__(FirewallPolicyRuleArgs)
if action is None and not opts.urn:
raise TypeError("Missing required property 'action'")
__props__.__dict__["action"] = action
__props__.__dict__["description"] = description
if direction is None and not opts.urn:
raise TypeError("Missing required property 'direction'")
__props__.__dict__["direction"] = direction
__props__.__dict__["disabled"] = disabled
__props__.__dict__["enable_logging"] = enable_logging
if firewall_policy is None and not opts.urn:
raise TypeError("Missing required property 'firewall_policy'")
__props__.__dict__["firewall_policy"] = firewall_policy
if match is None and not opts.urn:
raise TypeError("Missing required property 'match'")
__props__.__dict__["match"] = match
if priority is None and not opts.urn:
raise TypeError("Missing required property 'priority'")
__props__.__dict__["priority"] = priority
__props__.__dict__["target_resources"] = target_resources
__props__.__dict__["target_service_accounts"] = target_service_accounts
__props__.__dict__["kind"] = None
__props__.__dict__["rule_tuple_count"] = None
super(FirewallPolicyRule, __self__).__init__(
'gcp:compute/firewallPolicyRule:FirewallPolicyRule',
resource_name,
__props__,
opts)
@staticmethod
def get(resource_name: str,
id: pulumi.Input[str],
opts: Optional[pulumi.ResourceOptions] = None,
action: Optional[pulumi.Input[str]] = None,
description: Optional[pulumi.Input[str]] = None,
direction: Optional[pulumi.Input[str]] = None,
disabled: Optional[pulumi.Input[bool]] = None,
enable_logging: Optional[pulumi.Input[bool]] = None,
firewall_policy: Optional[pulumi.Input[str]] = None,
kind: Optional[pulumi.Input[str]] = None,
match: Optional[pulumi.Input[pulumi.InputType['FirewallPolicyRuleMatchArgs']]] = None,
priority: Optional[pulumi.Input[int]] = None,
rule_tuple_count: Optional[pulumi.Input[int]] = None,
target_resources: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
target_service_accounts: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None) -> 'FirewallPolicyRule':
"""
Get an existing FirewallPolicyRule 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] action: The Action to perform when the client connection triggers the rule. Can currently be either "allow" or "deny()" where valid values for status are 403, 404, and 502.
:param pulumi.Input[str] description: An optional description for this resource.
:param pulumi.Input[str] direction: The direction in which this rule applies. Possible values: INGRESS, EGRESS
:param pulumi.Input[bool] disabled: Denotes whether the firewall policy rule is disabled. When set to true, the firewall policy rule is not enforced and traffic behaves as if it did not exist. If this is unspecified, the firewall policy rule will be enabled.
:param pulumi.Input[bool] enable_logging: Denotes whether to enable logging for a particular rule. If logging is enabled, logs will be exported to the configured export destination in Stackdriver. Logs may be exported to BigQuery or Pub/Sub. Note: you cannot enable logging on "goto_next" rules.
:param pulumi.Input[str] firewall_policy: The firewall policy of the resource.
:param pulumi.Input[str] kind: Type of the resource. Always `compute#firewallPolicyRule` for firewall policy rules
:param pulumi.Input[pulumi.InputType['FirewallPolicyRuleMatchArgs']] match: A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced.
:param pulumi.Input[int] priority: An integer indicating the priority of a rule in the list. The priority must be a positive value between 0 and 2147483647. Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest prority.
:param pulumi.Input[int] rule_tuple_count: Calculation of the complexity of a single firewall policy rule.
:param pulumi.Input[Sequence[pulumi.Input[str]]] target_resources: A list of network resource URLs to which this rule applies. This field allows you to control which network's VMs get this rule. If this field is left blank, all VMs within the organization will receive the rule.
:param pulumi.Input[Sequence[pulumi.Input[str]]] target_service_accounts: A list of service accounts indicating the sets of instances that are applied with this rule.
"""
opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))
__props__ = _FirewallPolicyRuleState.__new__(_FirewallPolicyRuleState)
__props__.__dict__["action"] = action
__props__.__dict__["description"] = description
__props__.__dict__["direction"] = direction
__props__.__dict__["disabled"] = disabled
__props__.__dict__["enable_logging"] = enable_logging
__props__.__dict__["firewall_policy"] = firewall_policy
__props__.__dict__["kind"] = kind
__props__.__dict__["match"] = match
__props__.__dict__["priority"] = priority
__props__.__dict__["rule_tuple_count"] = rule_tuple_count
__props__.__dict__["target_resources"] = target_resources
__props__.__dict__["target_service_accounts"] = target_service_accounts
return FirewallPolicyRule(resource_name, opts=opts, __props__=__props__)
@property
@pulumi.getter
def action(self) -> pulumi.Output[str]:
"""
The Action to perform when the client connection triggers the rule. Can currently be either "allow" or "deny()" where valid values for status are 403, 404, and 502.
"""
return pulumi.get(self, "action")
@property
@pulumi.getter
def description(self) -> pulumi.Output[Optional[str]]:
"""
An optional description for this resource.
"""
return pulumi.get(self, "description")
@property
@pulumi.getter
def direction(self) -> pulumi.Output[str]:
"""
The direction in which this rule applies. Possible values: INGRESS, EGRESS
"""
return pulumi.get(self, "direction")
@property
@pulumi.getter
def disabled(self) -> pulumi.Output[Optional[bool]]:
"""
Denotes whether the firewall policy rule is disabled. When set to true, the firewall policy rule is not enforced and traffic behaves as if it did not exist. If this is unspecified, the firewall policy rule will be enabled.
"""
return pulumi.get(self, "disabled")
@property
@pulumi.getter(name="enableLogging")
def enable_logging(self) -> pulumi.Output[Optional[bool]]:
"""
Denotes whether to enable logging for a particular rule. If logging is enabled, logs will be exported to the configured export destination in Stackdriver. Logs may be exported to BigQuery or Pub/Sub. Note: you cannot enable logging on "goto_next" rules.
"""
return pulumi.get(self, "enable_logging")
@property
@pulumi.getter(name="firewallPolicy")
def firewall_policy(self) -> pulumi.Output[str]:
"""
The firewall policy of the resource.
"""
return pulumi.get(self, "firewall_policy")
@property
@pulumi.getter
def kind(self) -> pulumi.Output[str]:
"""
Type of the resource. Always `compute#firewallPolicyRule` for firewall policy rules
"""
return pulumi.get(self, "kind")
@property
@pulumi.getter
def match(self) -> pulumi.Output['outputs.FirewallPolicyRuleMatch']:
"""
A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced.
"""
return pulumi.get(self, "match")
@property
@pulumi.getter
def priority(self) -> pulumi.Output[int]:
"""
An integer indicating the priority of a rule in the list. The priority must be a positive value between 0 and 2147483647. Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest prority.
"""
return pulumi.get(self, "priority")
@property
@pulumi.getter(name="ruleTupleCount")
def rule_tuple_count(self) -> pulumi.Output[int]:
"""
Calculation of the complexity of a single firewall policy rule.
"""
return pulumi.get(self, "rule_tuple_count")
@property
@pulumi.getter(name="targetResources")
def target_resources(self) -> pulumi.Output[Optional[Sequence[str]]]:
"""
A list of network resource URLs to which this rule applies. This field allows you to control which network's VMs get this rule. If this field is left blank, all VMs within the organization will receive the rule.
"""
return pulumi.get(self, "target_resources")
@property
@pulumi.getter(name="targetServiceAccounts")
def target_service_accounts(self) -> pulumi.Output[Optional[Sequence[str]]]:
"""
A list of service accounts indicating the sets of instances that are applied with this rule.
"""
return pulumi.get(self, "target_service_accounts")
| 52.624654
| 303
| 0.674826
| 4,573
| 37,995
| 5.463153
| 0.06604
| 0.075732
| 0.048193
| 0.025858
| 0.914982
| 0.89689
| 0.876876
| 0.857543
| 0.850058
| 0.83829
| 0
| 0.009294
| 0.235373
| 37,995
| 721
| 304
| 52.697642
| 0.850647
| 0.447375
| 0
| 0.713918
| 1
| 0
| 0.109604
| 0.032206
| 0
| 0
| 0
| 0
| 0
| 1
| 0.162371
| false
| 0.002577
| 0.018041
| 0
| 0.278351
| 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
|
16e93be47ad6f9f4a9a65c74f67a92e8366c6a3c
| 231
|
py
|
Python
|
domain.py
|
sbacheld/sudoku-solver
|
ae2d8122c468dc31402e54d1ef39cf01e83bef8a
|
[
"MIT"
] | null | null | null |
domain.py
|
sbacheld/sudoku-solver
|
ae2d8122c468dc31402e54d1ef39cf01e83bef8a
|
[
"MIT"
] | null | null | null |
domain.py
|
sbacheld/sudoku-solver
|
ae2d8122c468dc31402e54d1ef39cf01e83bef8a
|
[
"MIT"
] | null | null | null |
class Domain:
_values = []
def __init__(self, values):
self._values = values
@property
def values(self):
return self._values
def update_values(self, values):
self._values = values
| 17.769231
| 36
| 0.593074
| 25
| 231
| 5.12
| 0.36
| 0.390625
| 0.375
| 0.3125
| 0.40625
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.316017
| 231
| 12
| 37
| 19.25
| 0.810127
| 0
| 0
| 0.222222
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0
| 0.111111
| 0.666667
| 0
| 1
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 7
|
16e9c7dacadb126e13e3efee05c0bb78f8988b91
| 45,480
|
py
|
Python
|
src/model/main.py
|
bentherien/measevalcompetition
|
1d285991eb26403682a633a728629a9900923d80
|
[
"MIT"
] | null | null | null |
src/model/main.py
|
bentherien/measevalcompetition
|
1d285991eb26403682a633a728629a9900923d80
|
[
"MIT"
] | null | null | null |
src/model/main.py
|
bentherien/measevalcompetition
|
1d285991eb26403682a633a728629a9900923d80
|
[
"MIT"
] | null | null | null |
import argparse
import json
import latex
import os
import pickle
import pprint
import numpy as np
from helpers import *
from latex import *
from load_util import load_samples
from data import PathData, BertPathData
from tqdm import tqdm
from math import floor
from sklearn_crfsuite.metrics import flat_classification_report
from sklearn.metrics import classification_report
import torch
import torch.nn as nn
import torch.nn.functional as F
from pytorch_util import *
from torch import optim
CUDA = True
def run_train(args):
if args.type == "roberta_token":
run_train_roberta_token(args)
elif args.type == "bert_token":
run_train_bert_token(args)
elif args.type == "bert_mod":
run_train_bert_modifiers(args)
elif args.type == "modifier":
run_train_modifier(args)
elif args.type == "bert":
train_bert_matcher(args)
elif args.type == "paths":
run_train_paths(args)
elif args.type == "paths2":
run_train_paths2(args)
elif args.type == "paths-bert":
run_train_paths_bert(args)
elif args.type == "paths-word":
run_train_paths_word(args)
else:
run_train_token(args)
def run_train_roberta_token(args):
"""
Description: Method used to train roberta on a token level task
"""
global CUDA
def check_test(test):
global CUDA
nonlocal tag_to_ix
nonlocal model
inv_dic=get_inv(tag_to_ix)
all_predictions = []
all_gold = []
for sample in test:
pred = model.predict([sample.tokens],CUDA)[0]
assert(len(pred) == len(sample.targets))
all_predictions.append(pred)
all_gold.append(sample.targets)
return flat_classification_report(all_gold,all_predictions)
model_name = 'roberta-base'
model_name = 'facebook/bart-base'
# model_name = 'xlm-roberta-base'
model_name = 'dmis-lab/biobert-base-cased-v1.1'
model_name = 'allenai/biomed_roberta_base'
train = load_samples(os.path.join(args.sys_path,"data-fold{}".format(args.fold),"train_allS.tsv"))
# test = load_samples(os.path.join(args.sys_path,"data-fold{}".format(args.fold),"test_allS.tsv"))
test=[]
tag_to_ix = {}
for sample in train+test:
for tag in sample.targets:
if tag not in tag_to_ix:
tag_to_ix[tag] = len(tag_to_ix)
if CUDA:
model = RobertaTokenClassifier(model_name,tag_to_ix).cuda()
else:
model = RobertaTokenClassifier(model_name,tag_to_ix)
optimizer = optim.Adam(model.parameters(), lr=args.learning_rate)
maxF1 = 0
for epoch in range(args.epoch_num):
all_loss = list()
print('Epoch: ' + str(epoch + 1))
train_predictions = []
train_gold = []
for i in tqdm(range(len(train))):
sample=train[i]
model.zero_grad()
input = train[i].tokens
target = train[i].targets
target = expand_annotations(input,target,model.tokenizer)
target.insert(0,'o')
target.append('o')
target=convert_2_tensor(target,tag_to_ix,torch.long,CUDA)
input=model.tokenizer(input,return_tensors="pt",is_split_into_words=True,add_special_tokens=True)
loss,logits=model(input,target)
loss.backward()
optimizer.step()
all_loss.append(loss.cpu().detach().numpy())
train_predictions.append(model.sm(logits,sample.tokens,CUDA))
train_gold.append(train[i].targets)
trainReport = flat_classification_report(train_gold,train_predictions)
print("Train:")
print(trainReport)
print(getLatexReport(trainReport))
# report = check_test(test)
# print("Test:")
# print(report)
# print(getLatexReport(report))
# f1 = getLabel(tag_to_ix,report,label="macro",row=4)
# if f1 > maxF1:
# print("New Max macro F1: {} > {}".format(f1,maxF1))
# # model.save(os.path.join(args.sys_path,"{}-fold{}.pt".format(args.model_name,args.fold)))
# maxF1 = f1
print('\n')
print('Average loss: ' + str(np.mean(all_loss)))
model.save(os.path.join(args.sys_path,"{}-fold{}.pt".format(args.model_name,args.fold)))
exit(0)
def run_train_bert_token(args):
global CUDA
def check_test(test):
global CUDA
nonlocal tag_to_ix
nonlocal model
inv_dic=get_inv(tag_to_ix)
all_predictions = []
all_gold = []
for sample in test:
pred = model.predict([sample.tokens],CUDA)[0]
assert(len(pred) == len(sample.targets))
all_predictions.append(pred)
all_gold.append(sample.targets)
return flat_classification_report(all_gold,all_predictions)
# model_name='allenai/scibert_scivocab_cased'
model_name = 'dmis-lab/biobert-base-cased-v1.1'
# model_name = 'bert-base-cased'
tokenizer = AutoTokenizer.from_pretrained(model_name)
train = load_samples(os.path.join(args.sys_path,"data-fold{}".format(args.fold),"train_allS.tsv"))
test = load_samples(os.path.join(args.sys_path,"data-fold{}".format(args.fold),"test_allS.tsv"))
# test=[]
word_to_ix = {}
tag_to_ix = {}
pos_to_ix={}
for sample in train+test:
for token in sample.tokens:
if token not in word_to_ix:
word_to_ix[token] = len(word_to_ix)
for tag in sample.targets:
if tag not in tag_to_ix:
tag_to_ix[tag] = len(tag_to_ix)
for pos in sample.pos:
if pos not in pos_to_ix:
pos_to_ix[pos] = len(pos_to_ix)
if CUDA:
model = BERT_SequenceTagger( model_name, len(tag_to_ix),tag_to_ix).cuda()
else:
model = BERT_SequenceTagger( model_name, len(tag_to_ix),tag_to_ix)
optimizer = optim.Adam(model.parameters(), lr=args.learning_rate)
maxF1 = 0
for epoch in range(args.epoch_num):
all_loss = list()
print('Epoch: ' + str(epoch + 1))
train_predictions = []
train_gold = []
for i in tqdm(range(len(train))):
sample=train[i]
model.zero_grad()
input = train[i].tokens
target = train[i].targets
target = expand_annotations(input,target,tokenizer)
target.insert(0,'o')
target.append('o')
target=convert_2_tensor(target,tag_to_ix,torch.long,CUDA)
input=tokenizer(input,return_tensors="pt",is_split_into_words=True,add_special_tokens=True)
loss,logits=model(input,target)
loss.backward()
optimizer.step()
all_loss.append(loss.cpu().detach().numpy())
train_predictions.append(model.sm(logits,sample.tokens,CUDA))
train_gold.append(train[i].targets)
trainReport = flat_classification_report(train_gold,train_predictions)
print("Train:")
print(trainReport)
print(getLatexReport(trainReport))
# report = check_test(test)
# print("Test:")
# print(report)
# print(getLatexReport(report))
# f1 = getLabel(tag_to_ix,report,label="macro",row=4)
# if f1 > maxF1:
# print("New Max macro F1: {} > {}".format(f1,maxF1))
# # model.save(os.path.join(args.sys_path,"{}-fold{}.pt".format(args.model_name,args.fold)))
# maxF1 = f1
print('\n')
print('Average loss: ' + str(np.mean(all_loss)))
model.save(os.path.join(args.sys_path,"{}-fold{}.pt".format(args.model_name,args.fold)))
exit(0)
def run_train_bert_modifiers(args):
global CUDA
# test = json.load(open(os.path.join(args.sys_path,"data-fold{}".format(args.fold),"test-{}.json".format(args.data)),"r",encoding="utf-8"))
# test = [(x["span"],x["type"][0],) for x in test]
test = []
train = json.load(open(os.path.join(args.sys_path,"data-fold{}".format(args.fold),"train-{}.json".format(args.data)),"r",encoding="utf-8"))
train = [(x["span"],x["type"][0],) for x in train]
print("Train size:",len(train))
print("Test size:",len(test))
all_data = test + train
tag_to_ix = {}
for sample in all_data:
try:
tag_to_ix[sample[1]]
except KeyError:
tag_to_ix[sample[1]] = len(tag_to_ix)
model_name = 'allenai/scibert_scivocab_cased'
#model_name='bert-large-cased-whole-word-masking-finetuned-squad'
if CUDA:
model = BERT_Matcher( model_name, len(tag_to_ix),tag_to_ix).cuda()
else:
model = BERT_Matcher( model_name, len(tag_to_ix),tag_to_ix)
tokenizer = AutoTokenizer.from_pretrained(model_name)
optimizer = optim.Adam(model.parameters(), lr=args.learning_rate)
def check_test(test,epoch,avgLoss,fold,silent=True):
global CUDA
nonlocal model
nonlocal args
nonlocal tokenizer
model.eval()
with torch.no_grad():
all_predictions = []
all_gold = []
inv_dict = get_inv(model.tag_to_ix)
maxIndices = None
for span, target in tqdm(test):
input = tokenizer([span],return_tensors="pt",is_split_into_words=True,add_special_tokens=True,padding=True)
all_gold.append(target)
_, logits = model(input,None)
pred = F.log_softmax(logits, dim=1)
if maxIndices == None:
_, maxIndices = torch.max(pred,1)
else:
_, tempMaxIndices = torch.max(pred,1)
maxIndices = torch.cat((maxIndices,tempMaxIndices),0)
all_predictions = [inv_dict[x] for x in maxIndices.cpu().detach().numpy()]
return classification_report(all_gold,all_predictions)
maxF1 = 0
for epoch in range(args.epoch_num):
model.train()
all_loss = list()
print('Epoch: ' + str(epoch + 1))
for span, target in tqdm(train):
model.zero_grad()
target=convert_2_tensor([target],tag_to_ix,torch.long,CUDA)
input = tokenizer([span],return_tensors="pt",is_split_into_words=True,add_special_tokens=True,padding=True)
loss,_ = model(input,target)
loss.backward()
optimizer.step()
all_loss.append(loss.cpu().detach().numpy())
print('\n')
print('Average loss: ' + str(np.mean(all_loss)))
# report = check_test(test,epoch,np.mean(all_loss),1)
# print(report)
# lab = "weighted"
# f1 = getLabel(model.tag_to_ix,report,label=lab)
# if f1 > maxF1:
# print("New {} Max F1: {}".format(lab,f1))
# savePath = os.path.join(args.sys_path,f"{args.model_name}fold{args.fold}.pt")
# model.save(savePath)
# maxF1 = f1
savePath = os.path.join(args.sys_path,f"{args.model_name}fold{args.fold}.pt")
model.save(savePath)
exit(0)
def train_bert_matcher(args):
global CUDA
test = json.load(open(os.path.join(args.sys_path,"data-json","test-{}.json".format(args.data)),"r",encoding="utf-8"))
train = json.load(open(os.path.join(args.sys_path,"data-json","train-{}.json".format(args.data)),"r",encoding="utf-8"))
tag_to_ix = {}
for sample in train+test:
tag = sample[2]
try:
tag_to_ix[tag]
except KeyError:
tag_to_ix[tag] = len(tag_to_ix)
model_name = 'allenai/scibert_scivocab_cased'
if CUDA:
model = BERT_Matcher( model_name, len(tag_to_ix),tag_to_ix).cuda()
else:
model = BERT_Matcher( model_name, len(tag_to_ix),tag_to_ix)
tokenizer = AutoTokenizer.from_pretrained(model_name)
optimizer = optim.Adam(model.parameters(), lr=args.learning_rate)
def check_test(test,epoch,avgLoss,fold,silent=True):
global CUDA
nonlocal model
nonlocal args
nonlocal tokenizer
#model.eval()
with torch.no_grad():
all_predictions = []
all_gold = []
inv_dict = get_inv(model.tag_to_ix)
maxIndices = None
for span1, span2, target in tqdm(test):
input = tokenizer([span1,span2],return_tensors="pt",is_split_into_words=True,add_special_tokens=True,padding=True)
all_gold.append(target)
_, logits = model(input,None)
pred = F.log_softmax(logits, dim=1)
if maxIndices == None:
_, maxIndices = torch.max(pred,1)
else:
_, tempMaxIndices = torch.max(pred,1)
maxIndices = torch.cat((maxIndices,tempMaxIndices),0)
all_predictions = [inv_dict[x] for x in maxIndices.cpu().detach().numpy()]
return classification_report(all_gold,all_predictions)
maxF1 = 0
for epoch in range(args.epoch_num):
model.train()
all_loss = list()
print('Epoch: ' + str(epoch + 1))
for span1, span2, target in tqdm(train):
model.zero_grad()
target=convert_2_tensor([target],tag_to_ix,torch.long,CUDA)
input = tokenizer([span1,span2],return_tensors="pt",is_split_into_words=True,add_special_tokens=True,padding=True)
loss,_ = model(input,target)
loss.backward()
optimizer.step()
all_loss.append(loss.cpu().detach().numpy())
print('\n')
print('Average loss: ' + str(np.mean(all_loss)))
report = check_test(test,epoch,np.mean(all_loss),1)
print(report)
f1 = getLabel(model.tag_to_ix,report,label="macro")
if f1 > maxF1:
print("New Max F1: {}".format(f1))
savePath = os.path.join(args.sys_path,f"{args.model_name}.pt")
model.save(savePath)
maxF1 = f1
exit(0)
def run_train_paths_word(args):
global CUDA
test = json.load(open(os.path.join(args.sys_path,"path-data-2","test-path-data-NOUN.json"),"r",encoding="utf-8"))
test = PathData(test)
train = json.load(open(os.path.join(args.sys_path,"path-data-2","train-path-data-NOUN.json"),"r",encoding="utf-8"))
train = PathData(train)
all_tags = test.getTags() + train.getTags()
tag_to_ix = {}
dep_to_ix = {}
deps = ['pad','subtok','self','ROOT', 'acl', 'acomp', 'advcl', 'advmod', 'agent', 'amod', 'appos', 'attr', 'aux', 'auxpass', 'case', 'cc', 'ccomp', 'compound', 'conj', 'csubj', 'csubjpass', 'dative', 'dep', 'det', 'dobj', 'expl', 'intj', 'mark', 'meta', 'neg', 'nmod', 'npadvmod', 'nsubj', 'nsubjpass', 'nummod', 'oprd', "parataxis", "pcomp", "pobj", "poss", "preconj", "predet", "prep", "prt", "punct", "quantmod", "relcl", "xcomp"]
rdeps = ["r"+x for x in deps]
all_deps = deps + rdeps + test.getDeps2() + train.getDeps2()
for dep in all_deps:
try:
dep_to_ix[dep]
except KeyError:
dep_to_ix[dep] = len(dep_to_ix)
for tag in all_tags:
try:
tag_to_ix[tag]
except KeyError:
tag_to_ix[tag] = len(tag_to_ix)
pretrained_emb=None
if CUDA:
model = WordPath(dep_to_ix,tag_to_ix,args.embeddings,args.sys_path,emb_dim=64,d_model=64).cuda()
else:
model = WordPath(dep_to_ix,tag_to_ix,args.embeddings,args.sys_path,emb_dim=64,d_model=64)
loss_function = nn.CrossEntropyLoss()
optimizer = optim.Adam(model.parameters(),lr=args.learning_rate)
accum = []
def check_test(test,epoch,avgLoss,fold,silent=True):
global CUDA
nonlocal model
nonlocal accum
nonlocal args
with torch.no_grad():
all_predictions = []
all_gold = []
for sent in test.sents:
if sent.targets == []:
continue
def pad(l,pad="pad"):
m=0
for pathListList in l:
for pathList in pathListList:
m = max(m, len(pathList))
pathLens = []
for i,pathListList in enumerate(l):
for ii,pathList in enumerate(pathListList):
pathLens.append(len(pathList))
if len(pathList) < m:
l[i][ii] = pathList + [pad for x in range(m-len(pathList))]
return l,pathLens
inputWords = [[[z[1] for z in y] for y in x] for x in sent.samples]
inputPaths = [[[z[0] for z in y] for y in x] for x in sent.samples]
inputWords,pathLens = pad(inputWords,"<UNK>")
inputPaths,pathLens = pad(inputPaths,"pad")
accum = []
for x in inputPaths:
accum += x
accumWords = []
for word in inputWords:
accumWords += word
tg = []
for target in sent.targets:
tg += target
# print(len(accum),len(tg))
pred = model.predict(accum,accumWords,pathLens,CUDA)
assert(len(accum) == len(pred))
all_predictions = all_predictions + pred
all_gold = all_gold + tg
# print(all_predictions)
# print(all_gold)
# print(len(all_predictions),len(all_gold))
print(classification_report(all_gold,all_predictions))
for epoch in range(args.epoch_num):
all_loss = list()
print('Epoch: ' + str(epoch + 1))
for sent in tqdm(train.sents):
if sent.targets == []:
continue
model.zero_grad()
tg = []
for target in sent.targets:
tg += target
target = convert_2_tensor(tg, tag_to_ix, torch.long, CUDA)
# print(target)
# print(sent.targets)
#target = torch.stack(target,0)
def pad(l,pad="pad"):
m=0
for pathListList in l:
for pathList in pathListList:
m = max(m, len(pathList))
pathLens = []
for i,pathListList in enumerate(l):
for ii,pathList in enumerate(pathListList):
pathLens.append(len(pathList))
if len(pathList) < m:
l[i][ii] = pathList + [pad for x in range(m-len(pathList))]
return l, pathLens
inputWords = [[[z[1] for z in y] for y in x] for x in sent.samples]
inputPaths = [[[z[0] for z in y] for y in x] for x in sent.samples]
inputWords,pathLens = pad(inputWords,"<UNK>")
inputPaths,pathLens = pad(inputPaths,"pad")
accumWords = []
for word in inputWords:
accumWords += word
accum = []
for x in inputPaths:
accum += x
out, _ = model(accum,accumWords,pathLens,CUDA)
loss = loss_function(out, target)
loss.backward(retain_graph = True)
optimizer.step()
all_loss.append(loss.cpu().detach().numpy())
if epoch % 1 != 0:
optimizer.lr = optimizer.lr/2
print('\n')
print('Average loss: ' + str(np.mean(all_loss)))
check_test(test,epoch=(epoch+1),avgLoss=np.mean(all_loss),fold=args.fold,silent=False)
savePath = os.path.join(args.sys_path,f"{args.model_name}.pt")
model.save(savePath)
exit(0)
def run_train_paths2(args):
global CUDA
# test = json.load(open(os.path.join(args.sys_path,"data-fold{}".format(args.fold),"test-path-data-Small.json"),"r",encoding="utf-8"))
# test = PathData(test)
test = []
train = json.load(open(os.path.join(args.sys_path,"data-fold{}".format(args.fold),"train-path-data-Small.json"),"r",encoding="utf-8"))
train = PathData(train)
all_tags = train.getTags()
# all_tags = test.getTags() + train.getTags()
tag_to_ix = {}
dep_to_ix = {}
deps = ['pad','subtok','self','ROOT', 'acl', 'acomp', 'advcl', 'advmod', 'agent', 'amod', 'appos', 'attr', 'aux', 'auxpass', 'case', 'cc', 'ccomp', 'compound', 'conj', 'csubj', 'csubjpass', 'dative', 'dep', 'det', 'dobj', 'expl', 'intj', 'mark', 'meta', 'neg', 'nmod', 'npadvmod', 'nsubj', 'nsubjpass', 'nummod', 'oprd', "parataxis", "pcomp", "pobj", "poss", "preconj", "predet", "prep", "prt", "punct", "quantmod", "relcl", "xcomp"]
rdeps = ["r"+x for x in deps]
# all_deps = deps + rdeps + test.getDeps2() + train.getDeps2()
all_deps = deps + rdeps + train.getDeps2()
for dep in all_deps:
try:
dep_to_ix[dep]
except KeyError:
dep_to_ix[dep] = len(dep_to_ix)
for tag in all_tags:
try:
tag_to_ix[tag]
except KeyError:
tag_to_ix[tag] = len(tag_to_ix)
pretrained_emb=None
if CUDA:
model = PathRepresentation(dep_to_ix,tag_to_ix,emb_dim=16,d_model=16).cuda()
else:
model = PathRepresentation(dep_to_ix,tag_to_ix,emb_dim=16,d_model=16)
loss_function = nn.CrossEntropyLoss()
optimizer = optim.Adam(model.parameters(),lr=args.learning_rate)
accum = []
# model.load(os.path.join(args.sys_path,f"{args.model_name}fold{args.fold}.pt"))
# pred = model.predictSys(["rnummod","rpobj"],CUDA)
# print(pred)
# exit(0)
def padInput(batch):
pathList = [[dep[0] for dep in e.path] for e in batch]
m=0
for depList in pathList:
m = max(m, len(depList))
pathLens = []
for i,depList in enumerate(pathList):
pathLens.append(len(depList))
if len(depList) < m:
pathList[i] = depList + ["pad" for x in range(m-len(depList))]
return pathList,pathLens
def check_test(test,epoch,avgLoss,fold,silent=True):
global CUDA
nonlocal model
nonlocal accum
nonlocal args
all_gold = [e.target for e in test.sents]
with torch.no_grad():
model.eval()
pathList,pathLens = padInput(test.sents)
all_predictions = model.predict(pathList,pathLens,CUDA)
return classification_report(all_gold,all_predictions)
maxF1 = 0
lastSaveEpoch = 0
lastSaveReport = None
lastSaveLoss = 0
for epoch in range(args.epoch_num):
all_loss = []
print('Epoch: ' + str(epoch + 1))
model.train()
for batch in tqdm(getBatches(train.sents)):
#get targets
model.zero_grad()
targetList = [e.target for e in batch]
target = convert_2_tensor(targetList, tag_to_ix, torch.long, CUDA)
#get input
pathList,pathLens = padInput(batch)
out, _ = model(input=pathList,pathLens=pathLens,CUDA=CUDA)
loss = loss_function(out, target)
loss.backward(retain_graph = True)
optimizer.step()
all_loss.append(loss.cpu().detach().numpy())
print('\n')
print('Average loss: ' + str(np.mean(all_loss)))
# report = check_test(test,epoch=(epoch+1),avgLoss=np.mean(all_loss),fold=args.fold,silent=False)
# print(report)
# f1 = getLabel(model.tag_to_ix,report,label="macro",row=4)
# if f1 > maxF1:
# print("New Max additive F1: {} > {}".format(f1,maxF1))
# print("savingModelTo {}".format(os.path.join(args.sys_path,f"{args.model_name}fold{args.fold}.pt")))
# savePath = os.path.join(args.sys_path,f"{args.model_name}fold{args.fold}.pt")
# model.save(savePath)
# maxF1 = f1
# lastSaveEpoch = epoch
# lastSaveReport = report
# lastSaveLoss = np.mean(all_loss)
savePath = os.path.join(args.sys_path,f"{args.model_name}fold{args.fold}.pt")
model.save(savePath)
# print("Last saved epoch:{}".format(lastSaveEpoch))
# print("Last saved loss:{}".format(lastSaveLoss))
# print("Learning Rate:{}".format(args.learning_rate))
# print("Classification Report:")
# print(lastSaveReport)
exit(0)
def run_train_paths_bert(args):
def padInput(batch):
pathList = [[dep for dep in node.path] for node in batch]
m=0
for depList in pathList:
m = max(m, len(depList))
pathLens = []
for i,depList in enumerate(pathList):
pathLens.append(len(depList))
if len(depList) < m:
pathList[i] = depList + ["pad" for x in range(m-len(depList))]
return pathList,pathLens
def check_test(test):
global CUDA
nonlocal model
nonlocal args
all_gold = [node.target for node in test.data]
all_predictions = []
with torch.no_grad():
model.eval()
for batch in tqdm(getBatches(test.data)):
quantBatch = model.tokenizer([node.qSpan for node in batch],return_tensors="pt",is_split_into_words=True,add_special_tokens=True,padding=True)
nounBatch = model.tokenizer([node.nSpan for node in batch],return_tensors="pt",is_split_into_words=True,add_special_tokens=True,padding=True)
pathList,pathLens = padInput(batch)
all_predictions += model.predict(
nounBatch=nounBatch,
quantBatch=quantBatch,
pathList=pathList,
pathLens=pathLens,
CUDA=CUDA)
return classification_report(all_gold,all_predictions)
global CUDA
test = json.load(open(os.path.join(args.sys_path,"data-fold{}".format(args.fold),"test-path-data-Small.json"),"r",encoding="utf-8"))
test = BertPathData(test)
train = json.load(open(os.path.join(args.sys_path,"data-fold{}".format(args.fold),"train-path-data-Small.json"),"r",encoding="utf-8"))
train = BertPathData(train)
temp = torch.load(os.path.join(args.sys_path,"path-rep-fold{}.pt".format(args.fold)))
tag_to_ix = temp["tag_to_ix"]
dep_to_ix = temp["dep_to_ix"]
if CUDA:
pathModel = PathRepresentation(dep_to_ix,tag_to_ix,emb_dim=16,d_model=16).cuda()
else:
pathModel = PathRepresentation(dep_to_ix,tag_to_ix,emb_dim=16,d_model=16)
model_name='allenai/scibert_scivocab_cased'
all_tags = [x.target for x in train.data] + [x.target for x in test.data]
tag_to_ix = {}
for tag in all_tags:
try:
tag_to_ix[tag]
except KeyError:
tag_to_ix[tag] = len(tag_to_ix)
if CUDA:
model = BERT_Matcher_plus_path(model_name,tag_to_ix,pathModel).cuda()
else:
model = BERT_Matcher_plus_path(model_name,tag_to_ix,pathModel)
loss_function = nn.CrossEntropyLoss()
optimizer = optim.Adam(model.parameters(),lr=args.learning_rate)
maxF1 = 0
lastSaveEpoch = 0
lastSaveReport = None
lastSaveLoss = 0
for epoch in range(args.epoch_num):
all_loss = []
print('Epoch: ' + str(epoch + 1))
model.train()
for batch in tqdm(getBatches(train.data)):
#get targets
model.zero_grad()
targetList = [node.target for node in batch]
target = convert_2_tensor(targetList, model.tag_to_ix, torch.long, CUDA)
#get quant batch
quantBatch = model.tokenizer([node.qSpan for node in batch],return_tensors="pt",is_split_into_words=True,add_special_tokens=True,padding=True)
#get noun batcg
nounBatch = model.tokenizer([node.nSpan for node in batch],return_tensors="pt",is_split_into_words=True,add_special_tokens=True,padding=True)
#get input paths
pathList,pathLens = padInput(batch)
loss,_ = model(
nounBatch=nounBatch,
quantBatch=quantBatch,
pathList=pathList,
pathLens=pathLens,
labels=target,
CUDA=CUDA)
loss.backward()
optimizer.step()
all_loss.append(loss.cpu().detach().numpy())
print('\n')
print('Average loss: ' + str(np.mean(all_loss)))
savePath = os.path.join(args.sys_path,f"{args.model_name}fold{args.fold}.pt")
model.save(savePath)
# report = check_test(test)
# print(report)
# f1 = getLabel(model.tag_to_ix,report,label="MP",row=3) + getLabel(model.tag_to_ix,report,label="ME",row=3)
# if f1 > maxF1:
# print("New Max additive F1: {} > {}".format(f1,maxF1))
# print("savingModelTo {}".format(os.path.join(args.sys_path,f"{args.model_name}fold{args.fold}.pt")))
# savePath = os.path.join(args.sys_path,f"{args.model_name}fold{args.fold}.pt")
# model.save(savePath)
# maxF1 = f1
# lastSaveEpoch = epoch
# lastSaveReport = report
# lastSaveLoss = np.mean(all_loss)
# print("Last saved epoch:{}".format(lastSaveEpoch))
# print("Last saved loss:{}".format(lastSaveLoss))
# print("Learning Rate:{}".format(args.learning_rate))
# print("Classification Report:")
# print(lastSaveReport)
exit(0)
def run_train_paths(args):
global CUDA
test = json.load(open(os.path.join(args.sys_path,"path-data","test-path-data.json"),"r",encoding="utf-8"))
test = PathData(test)
train = json.load(open(os.path.join(args.sys_path,"path-data","train-path-data.json"),"r",encoding="utf-8"))
train = PathData(train)
all_tags = test.getTags() + train.getTags()
tag_to_ix = {}
dep_to_ix = {}
deps = ['subtok','self','ROOT', 'acl', 'acomp', 'advcl', 'advmod', 'agent', 'amod', 'appos', 'attr', 'aux', 'auxpass', 'case', 'cc', 'ccomp', 'compound', 'conj', 'csubj', 'csubjpass', 'dative', 'dep', 'det', 'dobj', 'expl', 'intj', 'mark', 'meta', 'neg', 'nmod', 'npadvmod', 'nsubj', 'nsubjpass', 'nummod', 'oprd', "parataxis", "pcomp", "pobj", "poss", "preconj", "predet", "prep", "prt", "punct", "quantmod", "relcl", "xcomp"]
rdeps = ["r"+x for x in deps]
all_deps = deps + rdeps + test.getDeps() + train.getDeps()
for dep in all_deps:
try:
dep_to_ix[dep]
except KeyError:
dep_to_ix[dep] = len(dep_to_ix)
for tag in all_tags:
try:
tag_to_ix[tag]
except KeyError:
tag_to_ix[tag] = len(tag_to_ix)
pretrained_emb=None
if CUDA:
model = Elmo_paths(dep_to_ix,tag_to_ix,1024,1024,args.embeddings,args.sys_path).cuda()
else:
model = Elmo_paths(dep_to_ix,tag_to_ix,1024,1024,args.embeddings,args.sys_path)
loss_function = nn.CrossEntropyLoss()
optimizer = optim.Adam(model.parameters(),lr=args.learning_rate)
accum = []
def check_test(test,epoch,avgLoss,fold,silent=True):
global CUDA
nonlocal model
nonlocal accum
nonlocal args
with torch.no_grad():
all_predictions = []
all_gold = []
for sent in test.sents:
if sent.targets == []:
continue
all_predictions = all_predictions + model.predict(sent.sentence,sent.samples,CUDA)
all_gold = all_gold + sent.targets
#print(all_predictions)
#print(all_gold)
print(flat_classification_report(all_gold,all_predictions))
for epoch in range(args.epoch_num):
all_loss = list()
print('Epoch: ' + str(epoch + 1))
for sent in tqdm(train.sents):
if sent.targets == []:
continue
model.zero_grad()
target = [convert_2_tensor(x, tag_to_ix, torch.long, CUDA) for x in sent.targets]
# print(target)
# print(sent.targets)
target = torch.stack(target,0)
pred, out = model(input=sent.sentence,paths=sent.samples,CUDA=CUDA)
out = torch.reshape(out,(out.shape[0],out.shape[2],out.shape[1]))
# print(out.shape)
# print(target.shape)
loss = loss_function(out, target)
loss.backward(retain_graph = True)
optimizer.step()
all_loss.append(loss.cpu().detach().numpy())
print('\n')
print('Average loss: ' + str(np.mean(all_loss)))
check_test(test,epoch=(epoch+1),avgLoss=np.mean(all_loss),fold=args.fold,silent=False)
savePath = os.path.join(args.sys_path,f"{args.model_name}.pt")
model.save(savePath)
exit(0)
def run_train_modifier(args):
global CUDA
test = json.load(open(os.path.join(args.sys_path,"data-fold{}".format(args.fold),"test-{}.json".format(args.data)),"r",encoding="utf-8"))
test = [(x["span"],x["type"][0],) for x in test]
train = json.load(open(os.path.join(args.sys_path,"data-fold{}".format(args.fold),"train-{}.json".format(args.data)),"r",encoding="utf-8"))
train = [(x["span"],x["type"][0],) for x in train]
print("Train size:",len(train))
print("Test size:",len(test))
all_data = test + train
tag_to_ix = {}
for sample in all_data:
try:
tag_to_ix[sample[1]]
except KeyError:
tag_to_ix[sample[1]] = len(tag_to_ix)
def getBatches(data,size):
tempBatch = {"spans":[],"lengths":[],"targets":[]}
count = 0
batches = []
for x in train:
if type(x[0]) != list:
print(x[0])
count+=1
tempBatch["spans"].append(x[0])
tempBatch["lengths"].append(len(x[0]))
tempBatch["targets"].append(x[1])
if count % size == 0:
m = np.max(tempBatch["lengths"])
tempBatch["spans"] = [span + ["<UNK>" for y in range(m-len(x))] for span in tempBatch["spans"]]
batches.append(tempBatch)
count = 0
tempBatch = {"spans":[],"lengths":[],"targets":[]}
m = np.max(tempBatch["lengths"])
tempBatch["spans"] = [span+["<UNK>" for y in range(m-len(x))] for span in tempBatch["spans"]]
batches.append(tempBatch)
return batches
batches = getBatches(train,128)
#print(batches)
pretrained_emb=None
if CUDA:
model = Modifier_Tagger(tag_to_ix,1024,1024,args.embeddings,args.sys_path).cuda()
else:
model = Modifier_Tagger(tag_to_ix,1024,1024,args.embeddings,args.sys_path)
loss_function = nn.CrossEntropyLoss()
optimizer = optim.Adam(model.parameters(), lr=args.learning_rate)
accum = []
maxf1 = 0
def check_test(test,epoch,avgLoss,fold,silent=True):
global CUDA
nonlocal model
nonlocal accum
nonlocal args
nonlocal tag_to_ix
nonlocal maxf1
model.eval()
with torch.no_grad():
all_predictions = []
all_gold = []
for sample in test:
pred = model.predict([sample[0]],CUDA)
if pred == []:
continue
all_predictions.append(pred[0][0])
all_gold.append(sample[1])
report = classification_report(all_gold,all_predictions)
print(report)
return getLabel(tag_to_ix,report)
# model.load(os.path.join(args.sys_path,"modifier-pred.pt"))
# check_test(test,epoch=1,avgLoss=1,fold=args.fold,silent=False)
# exit(0)
for epoch in range(args.epoch_num):
model.train()
all_loss = list()
print('Epoch: ' + str(epoch + 1))
for i in tqdm(range(len(train))):
model.zero_grad()
target = train[i][1]
target = convert_2_tensor([target], tag_to_ix, torch.long, CUDA)
input = train[i][0]
if input == []:
continue
out, pred = model(input, CUDA)
loss = loss_function(out, target)
loss.backward(retain_graph = True)
optimizer.step()
all_loss.append(loss.cpu().detach().numpy())
# if epoch % 1 != 0:
# optimizer.lr = optimizer.lr/2
print('\n')
print('Average loss: ' + str(np.mean(all_loss)))
print("Check Train:")
#check_test(train,epoch=(epoch+1),avgLoss=np.mean(all_loss),fold=args.fold,silent=False)
print("Check Dev:")
f1 = check_test(test,epoch=(epoch+1),avgLoss=np.mean(all_loss),fold=args.fold,silent=False)
print(f1)
if f1 > maxf1:
print("Saving model for new max weighted F1:{}".format(f1))
maxf1 = f1
savePath = os.path.join(args.sys_path,f"{args.model_name}fold{args.fold}.pt")
model.save(savePath)
exit(0)
def run_train_token(args):
global CUDA
print(args)
test = load_samples(os.path.join(args.sys_path,"data","test_"+args.data+".tsv"))
train = load_samples(os.path.join(args.sys_path,"data","train_"+args.data+".tsv"))
all_data = test + train
word_to_ix = {}
tag_to_ix = {}
pos_to_ix={}
for sample in all_data:
for token in sample.tokens:
if token not in word_to_ix:
word_to_ix[token] = len(word_to_ix)
for tag in sample.target:
if tag not in tag_to_ix:
tag_to_ix[tag] = len(tag_to_ix)
for pos in sample.pos:
if pos not in pos_to_ix:
pos_to_ix[pos] = len(pos_to_ix)
pretrained_emb=None
if CUDA:
model = Sequence_Tagger_GCNN(word_to_ix,tag_to_ix,pos_to_ix,pretrained_emb,1024,1024,args.embeddings,args.sys_path).cuda()
else:
model = Sequence_Tagger_GCNN(word_to_ix,tag_to_ix,pos_to_ix,pretrained_emb,1024,1024,args.embeddings,args.sys_path)
loss_function = nn.CrossEntropyLoss()
optimizer = optim.Adam(model.parameters(), lr=args.learning_rate)
accum = []
def check_test(test,epoch,avgLoss,fold,silent=True):
global CUDA
nonlocal tag_to_ix
nonlocal model
nonlocal accum
nonlocal args
inv_dic = get_inv(tag_to_ix)
with torch.no_grad():
all_predictions = list()
all_gold = list()
for sample in test:
input = (sample.tokens,sample.deps)
output_task = model(input, CUDA)
pred = predict_class(output_task, CUDA)
pred = id_to_tag(pred,inv_dic)
all_predictions.append(pred)
all_gold.append(sample.target)
temp = latex.getSummary(
epoch=epoch,
fold=args.fold,
embeddingType=model.emb,
learningRate=args.learning_rate,
report = flat_classification_report(all_gold,all_predictions),
title = args.run_title)
if not silent:
pp = pprint.PrettyPrinter(indent = 4)
pp.pprint(temp)
accum += temp
for epoch in range(args.epoch_num):
all_loss = list()
print('Epoch: ' + str(epoch + 1))
for i in tqdm(range(len(train))):
model.zero_grad()
pos = train[i].pos
pos = convert_2_tensor(pos,pos_to_ix,torch.long,CUDA)
target = train[i].target
target = convert_2_tensor(target, tag_to_ix, torch.long, CUDA)
input = (train[i].tokens,train[i].deps)
output_task = model(input, CUDA)
loss = loss_function(output_task, target)
loss.backward(retain_graph = True)
optimizer.step()
all_loss.append(loss.cpu().detach().numpy())
if epoch % 1 != 0:
optimizer.lr = optimizer.lr/2
print('\n')
print('Average loss: ' + str(np.mean(all_loss)))
check_test(test,epoch=(epoch+1),avgLoss=np.mean(all_loss),fold=args.fold,silent=False)
savePath = os.path.join(args.sys_path,f"{args.model_name}.pt")
torch.save(model.state_dict(),savePath)
if not os.path.isfile("run_logs.json"):
json.dump([accum],open("run_logs.json","w",encoding="utf-8"),indent=3)
else:
try:
read = json.load(open("run_logs.json","r",encoding="utf-8"))
read.append(accum)
json.dump(read,open("run_logs.json","w",encoding="utf-8"),indent=3)
except json.decoder.JSONDecodeError:
json.dump(accum,open("run_logs.json","w",encoding="utf-8"),indent=3)
latex.toLatex(accum)
exit(0)
def run_test(args):
global CUDA
print(args)
#start
test = load_sample(os.path.join(args.sys_path,"data","test_"+args.data+".tsv"))
train = load_sample(os.path.join(args.sys_path,"data","train_"+args.data+".tsv"))
all_data = test + train
word_to_ix = {}
tag_to_ix = {}
pos_to_ix = {}
for sample in all_data:
for token in sample.tokens:
if token not in word_to_ix:
word_to_ix[token] = len(word_to_ix)
for tag in sample.target:
if tag not in tag_to_ix:
tag_to_ix[tag] = len(tag_to_ix)
for pos in sample.pos:
if pos not in pos_to_ix:
pos_to_ix[pos] = len(pos_to_ix)
pretrained_emb=None
if CUDA:
model = Sequence_Tagger(word_to_ix,tag_to_ix,pos_to_ix,pretrained_emb,1024,1024,args.embeddings,args.sys_path).cuda()
else:
model = Sequence_Tagger(word_to_ix,tag_to_ix,pos_to_ix,pretrained_emb,1024,1024,args.embeddings,args.sys_path)
model.load(args.saved_model)
testSize, trainSize = getSizeData(test), getSizeData(train)
accum = []
def check_test(test,epoch,avgLoss,fold,silent=True):
global CUDA
nonlocal tag_to_ix
nonlocal model
nonlocal accum
nonlocal args
inv_dic = get_inv(tag_to_ix)
with torch.no_grad():
all_predictions = list()
all_gold = list()
for sample in test:
input = (sample.tokens,sample.deps)
output_task = model(input, CUDA)
pred = predict_class(output_task, CUDA)
pred = id_to_tag(pred,inv_dic)
all_predictions.append(pred)
all_gold.append(sample.target)
temp = latex.getSummary(
epoch=epoch,
fold=args.fold,
embeddingType=model.emb,
learningRate=args.learning_rate,
report = flat_classification_report(all_gold,all_predictions),
title = args.run_title)
if not silent:
pp = pprint.PrettyPrinter(indent = 4)
pp.pprint(temp)
accum += temp
check_test(test,epoch=(epoch+1),avgLoss=np.mean(all_loss),fold=args.fold,silent=False)
exit(0)
def main():
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers()
subparser = subparsers.add_parser("train")
subparser.set_defaults(callback=run_train)
subparser.add_argument("--output-path", "-o", default="output.tex")
subparser.add_argument("--sys-path", "-sp", default="generatedData/")
subparser.add_argument("--data", "-d", default="allS")
subparser.add_argument("--model-name", "-n", default="DefaultModelName")
subparser.add_argument("--epoch-num", "-e",type=int, default=2)
subparser.add_argument("--fold", "-f", type=int, default=1)
subparser.add_argument("--learning-rate", "-l", type=float, default= 0.00042)
subparser.add_argument("--embeddings", "-emb", type=str, default="original")
subparser.add_argument("--run-title", "-rt", type=str, default="original")
subparser.add_argument("--type", "-t", default="modifier")
subparser = subparsers.add_parser("test")
subparser.set_defaults(callback=run_test)
subparser.add_argument("--output-path", "-o", default="output.tex")
subparser.add_argument("--sys-path", "-sp", default="generatedData/")
subparser.add_argument("--model-name", "-n", default="DefaultModelName")
subparser.add_argument("--saved-model", "-s", default="path to saved model")
subparser.add_argument("--data", "-d", default="allS")
subparser.add_argument("--epoch-num", "-e",type=int, default=2)
subparser.add_argument("--fold", "-f", type=int, default=1)
subparser.add_argument("--learning-rate", "-l", type=float, default= 0.00042)
subparser.add_argument("--embeddings", "-emb", type=str, default="original")
args = parser.parse_args()
args.callback(args)
if __name__ == "__main__":
main()
| 30.259481
| 437
| 0.57865
| 5,742
| 45,480
| 4.413967
| 0.06705
| 0.025252
| 0.029
| 0.0232
| 0.880923
| 0.854054
| 0.833222
| 0.808838
| 0.7884
| 0.782797
| 0
| 0.010322
| 0.2885
| 45,480
| 1,502
| 438
| 30.279627
| 0.772923
| 0.091337
| 0
| 0.773128
| 0
| 0
| 0.069397
| 0.01085
| 0
| 0
| 0
| 0
| 0.003304
| 1
| 0.031938
| false
| 0.003304
| 0.022026
| 0
| 0.067181
| 0.062775
| 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
|
bc45eef148c50b8983f3083f3b05ebbd02c90d60
| 10,487
|
py
|
Python
|
test/unit_tests/test_neuron_fi.py
|
fossabot/pytorchfi
|
d4b077226250c72bb2b6867fef0a9a9562290b9c
|
[
"NCSA"
] | null | null | null |
test/unit_tests/test_neuron_fi.py
|
fossabot/pytorchfi
|
d4b077226250c72bb2b6867fef0a9a9562290b9c
|
[
"NCSA"
] | null | null | null |
test/unit_tests/test_neuron_fi.py
|
fossabot/pytorchfi
|
d4b077226250c72bb2b6867fef0a9a9562290b9c
|
[
"NCSA"
] | null | null | null |
import pytest
import torch
from pytorchfi.core import fault_injection as pfi_core
from .util_test import helper_setUp_CIFAR10_same
class TestNeuronFIgpu:
"""Testing focuses on neuron perturbations on GPU with batch = 1."""
def setup_class(self):
torch.manual_seed(0)
self.BATCH_SIZE = 1
self.WORKERS = 1
self.channels = 3
self.img_size = 32
self.USE_GPU = True
self.model, self.dataset = helper_setUp_CIFAR10_same(
self.BATCH_SIZE, self.WORKERS
)
self.dataiter = iter(self.dataset)
self.model.cuda()
self.images, self.labels = self.dataiter.next()
self.images = self.images.cuda()
self.model.eval()
with torch.no_grad():
self.output = self.model(self.images)
self.p = pfi_core(
self.model,
self.BATCH_SIZE,
input_shape=[self.channels, self.img_size, self.img_size],
use_cuda=self.USE_GPU,
)
@pytest.mark.skipif(
not torch.cuda.is_available(), reason="GPU not supported on this machine"
)
def test_neuronFI_singleElement(self):
batch_i = [0]
layer_i = [4]
c_i = [0]
h_i = [1]
w_i = [1]
inj_value_i = [10000.0]
self.inj_model = self.p.declare_neuron_fi(
batch=batch_i,
layer_num=layer_i,
dim1=c_i,
dim2=h_i,
dim3=w_i,
value=inj_value_i,
)
self.inj_model.eval()
with torch.no_grad():
corrupted_output_1 = self.inj_model(self.images)
if torch.all(corrupted_output_1.eq(self.output)):
raise AssertionError
self.inj_model = self.p.declare_neuron_fi(
batch=batch_i,
layer_num=layer_i,
dim1=c_i,
dim2=h_i,
dim3=w_i,
value=[0],
)
self.inj_model.eval()
with torch.no_grad():
uncorrupted_output = self.inj_model(self.images)
if not torch.all(uncorrupted_output.eq(self.output)):
raise AssertionError
self.inj_model = self.p.declare_neuron_fi(
batch=batch_i,
layer_num=layer_i,
dim1=c_i,
dim2=h_i,
dim3=w_i,
value=inj_value_i * 2,
)
self.inj_model.eval()
with torch.no_grad():
corrupted_output_2 = self.inj_model(self.images)
if torch.all(corrupted_output_2.eq(self.output)):
raise AssertionError
if not torch.all(corrupted_output_2.eq(corrupted_output_2)):
raise AssertionError
class TestNeuronFIcpu:
"""Testing focuses on neuron perturbations on CPU with batch = 1."""
def setup_class(self):
torch.manual_seed(0)
batch_size = 1
workers = 1
channels = 3
img_size = 32
model, dataset = helper_setUp_CIFAR10_same(batch_size, workers)
dataiter = iter(dataset)
self.images, _ = dataiter.next()
self.p = pfi_core(
model,
batch_size,
input_shape=[channels, img_size, img_size],
use_cuda=False,
)
model.eval()
with torch.no_grad():
self.golden_output = model(self.images)
def test_neuronFI_singleElement(self):
batch_i = [0]
layer_i = [4]
c_i = [0]
h_i = [1]
w_i = [1]
inj_value_i = [10000.0]
uncorrupted_model = self.p.declare_neuron_fi(
batch=batch_i,
layer_num=layer_i,
dim1=c_i,
dim2=h_i,
dim3=w_i,
value=[0],
)
uncorrupted_model.eval()
with torch.no_grad():
uncorrupted_output = uncorrupted_model(self.images)
if not torch.all(uncorrupted_output.eq(self.golden_output)):
raise AssertionError
corrupt_model_1 = self.p.declare_neuron_fi(
batch=batch_i,
layer_num=layer_i,
dim1=c_i,
dim2=h_i,
dim3=w_i,
value=inj_value_i,
)
corrupt_model_1.eval()
with torch.no_grad():
corrupt_output_1 = corrupt_model_1(self.images)
if torch.all(corrupt_output_1.eq(self.golden_output)):
raise AssertionError
corrupt_model_2 = self.p.declare_neuron_fi(
batch=batch_i,
layer_num=layer_i,
dim1=c_i,
dim2=h_i,
dim3=w_i,
value=inj_value_i * 2,
)
corrupt_model_2.eval()
with torch.no_grad():
corrupt_output_2 = corrupt_model_2(self.images)
if torch.all(corrupt_output_2.eq(self.golden_output)):
raise AssertionError
class TestNeuronFIgpuBatch:
"""Testing focuses on neuron perturbations on GPU with batch = N."""
def setup_class(self):
torch.manual_seed(0)
self.BATCH_SIZE = 4
self.WORKERS = 1
self.channels = 3
self.img_size = 32
self.USE_GPU = True
self.model, self.dataset = helper_setUp_CIFAR10_same(
self.BATCH_SIZE, self.WORKERS
)
self.dataiter = iter(self.dataset)
self.model.cuda()
self.images, self.labels = self.dataiter.next()
self.images = self.images.cuda()
self.model.eval()
with torch.no_grad():
self.output = self.model(self.images)
self.p = pfi_core(
self.model,
self.BATCH_SIZE,
input_shape=[self.channels, self.img_size, self.img_size],
use_cuda=self.USE_GPU,
)
@pytest.mark.skipif(
not torch.cuda.is_available(), reason="GPU not supported on this machine"
)
def test_neuronFI_batch_1(self):
batch_i = [2]
layer_i = [4]
c_i = [0]
h_i = [1]
w_i = [1]
inj_value_i = [10000.0]
self.inj_model = self.p.declare_neuron_fi(
batch=batch_i,
layer_num=layer_i,
dim1=c_i,
dim2=h_i,
dim3=w_i,
value=inj_value_i,
)
self.inj_model.eval()
with torch.no_grad():
corrupted_output_1 = self.inj_model(self.images)
if not torch.all(corrupted_output_1[0].eq(self.output[0])):
raise AssertionError
if not torch.all(corrupted_output_1[1].eq(self.output[1])):
raise AssertionError
if torch.all(corrupted_output_1[2].eq(self.output[2])):
raise AssertionError
if not torch.all(corrupted_output_1[3].eq(self.output[3])):
raise AssertionError
@pytest.mark.skipif(
not torch.cuda.is_available(), reason="GPU not supported on this machine"
)
def test_neuronFI_batch_2(self):
batch_i = [0, 2, 3]
layer_i = [1, 2, 4]
c_i = [3, 1, 1]
h_i = [1, 0, 1]
w_i = [0, 1, 0]
inj_value_i = [10000.0, 10000.0, 10000.0]
self.inj_model = self.p.declare_neuron_fi(
batch=batch_i,
layer_num=layer_i,
dim1=c_i,
dim2=h_i,
dim3=w_i,
value=inj_value_i,
)
self.inj_model.eval()
with torch.no_grad():
corrupted_output_1 = self.inj_model(self.images)
if torch.all(corrupted_output_1[0].eq(self.output[0])):
raise AssertionError
if not torch.all(corrupted_output_1[1].eq(self.output[1])):
raise AssertionError
if torch.all(corrupted_output_1[2].eq(self.output[2])):
raise AssertionError
if torch.all(corrupted_output_1[3].eq(self.output[3])):
raise AssertionError
class TestNeuronFIcpuBatch:
"""Testing focuses on neuron perturbations on cpu with batch = N."""
def setup_class(self):
torch.manual_seed(0)
self.BATCH_SIZE = 4
self.WORKERS = 1
self.channels = 3
self.img_size = 32
self.USE_GPU = False
self.model, self.dataset = helper_setUp_CIFAR10_same(
self.BATCH_SIZE, self.WORKERS
)
self.dataiter = iter(self.dataset)
self.images, self.labels = self.dataiter.next()
self.model.eval()
with torch.no_grad():
self.output = self.model(self.images)
self.p = pfi_core(
self.model,
self.BATCH_SIZE,
input_shape=[self.channels, self.img_size, self.img_size],
use_cuda=self.USE_GPU,
)
def test_neuronFI_batch_1(self):
batch_i = [2]
layer_i = [4]
c_i = [0]
h_i = [1]
w_i = [1]
inj_value_i = [10000.0]
self.inj_model = self.p.declare_neuron_fi(
batch=batch_i,
layer_num=layer_i,
dim1=c_i,
dim2=h_i,
dim3=w_i,
value=inj_value_i,
)
self.inj_model.eval()
with torch.no_grad():
corrupted_output_1 = self.inj_model(self.images)
if not torch.all(corrupted_output_1[0].eq(self.output[0])):
raise AssertionError
if not torch.all(corrupted_output_1[1].eq(self.output[1])):
raise AssertionError
if torch.all(corrupted_output_1[2].eq(self.output[2])):
raise AssertionError
if not torch.all(corrupted_output_1[3].eq(self.output[3])):
raise AssertionError
def test_neuronFI_batch_2(self):
batch_i = [0, 2, 3]
layer_i = [1, 2, 4]
c_i = [3, 1, 1]
h_i = [1, 0, 1]
w_i = [0, 1, 0]
inj_value_i = [10000.0, 10000.0, 10000.0]
self.inj_model = self.p.declare_neuron_fi(
batch=batch_i,
layer_num=layer_i,
dim1=c_i,
dim2=h_i,
dim3=w_i,
value=inj_value_i,
)
self.inj_model.eval()
with torch.no_grad():
corrupted_output_1 = self.inj_model(self.images)
if torch.all(corrupted_output_1[0].eq(self.output[0])):
raise AssertionError
if not torch.all(corrupted_output_1[1].eq(self.output[1])):
raise AssertionError
if torch.all(corrupted_output_1[2].eq(self.output[2])):
raise AssertionError
if torch.all(corrupted_output_1[3].eq(self.output[3])):
raise AssertionError
| 27.381201
| 81
| 0.560503
| 1,370
| 10,487
| 4.039416
| 0.070803
| 0.035417
| 0.063607
| 0.078966
| 0.904771
| 0.897723
| 0.889953
| 0.861402
| 0.81442
| 0.784243
| 0
| 0.036233
| 0.336798
| 10,487
| 382
| 82
| 27.45288
| 0.759454
| 0.023934
| 0
| 0.796667
| 0
| 0
| 0.009692
| 0
| 0
| 0
| 0
| 0
| 0.076667
| 1
| 0.033333
| false
| 0
| 0.013333
| 0
| 0.06
| 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
|
bc4f56b0261e6268a76fc27e3c49bbb4b0e2d6ff
| 276
|
py
|
Python
|
src/cms/forms/users/__init__.py
|
digitalfabrik/coldaid-backend
|
b769510570d5921e30876565263813c0362994e2
|
[
"Apache-2.0"
] | 4
|
2019-12-05T16:45:17.000Z
|
2020-05-09T07:26:34.000Z
|
src/cms/forms/users/__init__.py
|
digitalfabrik/coldaid-backend
|
b769510570d5921e30876565263813c0362994e2
|
[
"Apache-2.0"
] | 56
|
2019-12-05T12:31:37.000Z
|
2021-01-07T15:47:45.000Z
|
src/cms/forms/users/__init__.py
|
digitalfabrik/coldaid-backend
|
b769510570d5921e30876565263813c0362994e2
|
[
"Apache-2.0"
] | 2
|
2019-12-11T09:52:26.000Z
|
2020-05-09T07:26:38.000Z
|
from .user_form import UserForm
from .user_profile_form import UserProfileForm
from .region_user_form import RegionUserForm
from .region_user_profile_form import RegionUserProfileForm
from .user_email_form import UserEmailForm
from .user_password_form import UserPasswordForm
| 39.428571
| 59
| 0.891304
| 36
| 276
| 6.5
| 0.388889
| 0.25641
| 0.119658
| 0.179487
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.086957
| 276
| 6
| 60
| 46
| 0.928571
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.166667
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 1
| 0
|
0
| 7
|
bc584879a6e8d4f006a588e8f698cb9f9d52b12f
| 533
|
py
|
Python
|
tests/test_client.py
|
0mco/shadowsocksR
|
e5395a8d52e2c346caf81d26890f7a18dc51bbc2
|
[
"Apache-2.0"
] | 4
|
2018-10-16T04:50:10.000Z
|
2020-03-03T08:01:58.000Z
|
tests/test_client.py
|
wickedbinary/shadowsocksR
|
e5395a8d52e2c346caf81d26890f7a18dc51bbc2
|
[
"Apache-2.0"
] | null | null | null |
tests/test_client.py
|
wickedbinary/shadowsocksR
|
e5395a8d52e2c346caf81d26890f7a18dc51bbc2
|
[
"Apache-2.0"
] | 1
|
2021-11-28T18:38:04.000Z
|
2021-11-28T18:38:04.000Z
|
import os
def test_client():
print('testing:', 'python3 ~/Projects/shadowsocksr-dev/shadowsocks/local.py -L "ssr://NjIuMTEzLjE542MTo0MDAxMDpvcmlnaW46YWVzLTI1Ni1jZmI6cGxhaW46ZG5CdWJtVnpkQ0ZBSXpFeU0yUS8_b2Jmc3BhcmFtPSZyZW1hcmtzPTViNjM1WnU5Jmdyb3VwPVUxTlNVMGhCVWtVdVEwOU4mdW90PTE"')
os.system('python3 ~/Projects/shadowsocksr-dev/shadowsocks/local.py -L "ssr://NjIuMTEzLjE542MTo0MDAxMDpvcmlnaW46YWVzLTI1Ni1jZmI6cGxhaW46ZG5CdWJtVnpkQ0ZBSXpFeU0yUS8_b2Jmc3BhcmFtPSZyZW1hcmtzPTViNjM1WnU5Jmdyb3VwPVUxTlNVMGhCVWtVdVEwOU4mdW90PTE"')
| 76.142857
| 254
| 0.878049
| 31
| 533
| 15
| 0.612903
| 0.064516
| 0.116129
| 0.129032
| 0.911828
| 0.911828
| 0.911828
| 0.911828
| 0.911828
| 0.911828
| 0
| 0.098039
| 0.043152
| 533
| 6
| 255
| 88.833333
| 0.813725
| 0
| 0
| 0
| 0
| 0
| 0.874296
| 0.814259
| 0
| 1
| 0
| 0
| 0
| 1
| 0.25
| true
| 0
| 0.25
| 0
| 0.5
| 0.25
| 0
| 0
| 1
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| null | 1
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 13
|
bc73050d2e19fc884ff96f8d876332ba027b31e8
| 2,596
|
py
|
Python
|
tests/addons/test_ui_schema.py
|
zewelor/supervisor
|
a21353909d5d9c58eb82ea81d94dcab6f2bee224
|
[
"Apache-2.0"
] | null | null | null |
tests/addons/test_ui_schema.py
|
zewelor/supervisor
|
a21353909d5d9c58eb82ea81d94dcab6f2bee224
|
[
"Apache-2.0"
] | null | null | null |
tests/addons/test_ui_schema.py
|
zewelor/supervisor
|
a21353909d5d9c58eb82ea81d94dcab6f2bee224
|
[
"Apache-2.0"
] | null | null | null |
"""Test add-ons schema to UI schema convertion."""
from hassio.addons.validate import schema_ui_options
def test_simple_schema():
"""Test with simple schema."""
assert schema_ui_options(
{"name": "str", "password": "password", "fires": "bool", "alias": "str?"}
) == [
{"name": "name", "required": True, "type": "string"},
{"format": "password", "name": "password", "required": True, "type": "string"},
{"name": "fires", "required": True, "type": "boolean"},
{"name": "alias", "optional": True, "type": "string"},
]
def test_group_schema():
"""Test with group schema."""
assert schema_ui_options(
{
"name": "str",
"password": "password",
"fires": "bool",
"alias": "str?",
"extended": {"name": "str", "data": ["str"], "path": "str?"},
}
) == [
{"name": "name", "required": True, "type": "string"},
{"format": "password", "name": "password", "required": True, "type": "string"},
{"name": "fires", "required": True, "type": "boolean"},
{"name": "alias", "optional": True, "type": "string"},
{
"multiple": False,
"name": "extended",
"optional": True,
"schema": [
{"name": "name", "required": True, "type": "string"},
{"multiple": True, "name": "data", "required": True, "type": "string"},
{"name": "path", "optional": True, "type": "string"},
],
"type": "schema",
},
]
def test_group_list():
"""Test with group schema."""
assert schema_ui_options(
{
"name": "str",
"password": "password",
"fires": "bool",
"alias": "str?",
"extended": [{"name": "str", "data": ["str?"], "path": "str?"}],
}
) == [
{"name": "name", "required": True, "type": "string"},
{"format": "password", "name": "password", "required": True, "type": "string"},
{"name": "fires", "required": True, "type": "boolean"},
{"name": "alias", "optional": True, "type": "string"},
{
"multiple": True,
"name": "extended",
"optional": True,
"schema": [
{"name": "name", "required": True, "type": "string"},
{"multiple": True, "name": "data", "optional": True, "type": "string"},
{"name": "path", "optional": True, "type": "string"},
],
"type": "schema",
},
]
| 35.081081
| 87
| 0.45416
| 226
| 2,596
| 5.154867
| 0.163717
| 0.123605
| 0.180258
| 0.169957
| 0.861803
| 0.854936
| 0.851502
| 0.851502
| 0.851502
| 0.851502
| 0
| 0
| 0.31433
| 2,596
| 73
| 88
| 35.561644
| 0.654494
| 0.045069
| 0
| 0.645161
| 0
| 0
| 0.333198
| 0
| 0
| 0
| 0
| 0
| 0.048387
| 1
| 0.048387
| true
| 0.096774
| 0.016129
| 0
| 0.064516
| 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
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 10
|
bc980d73f7163645936925768871e77f5f908d76
| 69
|
py
|
Python
|
examples/mnist/get_mnist_train.py
|
fukatani/ChainerWing
|
37a1435635cbc610dc86d15c8baca67622355757
|
[
"MIT",
"BSD-3-Clause"
] | 26
|
2017-07-03T13:50:28.000Z
|
2021-02-06T08:43:42.000Z
|
examples/mnist/get_mnist_train.py
|
fukatani/CW_gui
|
37a1435635cbc610dc86d15c8baca67622355757
|
[
"MIT",
"BSD-3-Clause"
] | 10
|
2017-07-03T14:30:00.000Z
|
2017-12-21T13:26:43.000Z
|
examples/mnist/get_mnist_train.py
|
fukatani/CW_gui
|
37a1435635cbc610dc86d15c8baca67622355757
|
[
"MIT",
"BSD-3-Clause"
] | 6
|
2017-03-15T13:48:09.000Z
|
2019-04-15T19:28:02.000Z
|
import chainer
def main():
return chainer.datasets.get_mnist()
| 11.5
| 39
| 0.724638
| 9
| 69
| 5.444444
| 0.888889
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.173913
| 69
| 5
| 40
| 13.8
| 0.859649
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| true
| 0
| 0.333333
| 0.333333
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 1
| 1
| 1
| 0
|
0
| 7
|
bcad3afea4c086ab8415b8a1158b5b7c0c22fb24
| 2,323
|
py
|
Python
|
tests/unit/test_boto3.py
|
anton-chekanov/lpipe
|
acc2c18150584e2e330eb0fbce889ea0ec77cd62
|
[
"Apache-2.0"
] | null | null | null |
tests/unit/test_boto3.py
|
anton-chekanov/lpipe
|
acc2c18150584e2e330eb0fbce889ea0ec77cd62
|
[
"Apache-2.0"
] | null | null | null |
tests/unit/test_boto3.py
|
anton-chekanov/lpipe
|
acc2c18150584e2e330eb0fbce889ea0ec77cd62
|
[
"Apache-2.0"
] | null | null | null |
import pytest
from lpipe import _boto3, utils
region_name = "us-east-1"
fixtures = [
("no_url", {"region_name": region_name}),
("none_url", {"region_name": region_name, "endpoint_url": None}),
("url", {"region_name": region_name, "endpoint_url": "http://localstack:1234"}),
]
client_services = ["sqs", "kinesis", "dynamodb", "s3", "lambda"]
resource_services = ["sqs"]
@pytest.mark.parametrize("service_name", client_services)
@pytest.mark.parametrize("fixture_name,fixture", fixtures)
def test_client(fixture_name, fixture, service_name, environment):
endpoint_url = fixture.get("endpoint_url", None)
env = {}
if endpoint_url:
env["AWS_ENDPOINTS"] = service_name + "=" + endpoint_url
with utils.set_env(env):
client = _boto3.client(service_name, **fixture)
if endpoint_url:
assert client.meta.endpoint_url == endpoint_url
@pytest.mark.parametrize("service_name", client_services)
@pytest.mark.parametrize("fixture_name,fixture", fixtures)
def test_client_no_env(fixture_name, fixture, service_name):
endpoint_url = fixture.get("endpoint_url", None)
client = _boto3.client(service_name, **fixture)
if endpoint_url:
assert client.meta.endpoint_url == endpoint_url
@pytest.mark.parametrize("service_name", resource_services)
@pytest.mark.parametrize("fixture_name,fixture", fixtures)
def test_resource(fixture_name, fixture, service_name, environment):
endpoint_url = fixture.get("endpoint_url", None)
env = {}
if endpoint_url:
env["AWS_ENDPOINTS"] = service_name + "=" + endpoint_url
with utils.set_env(env):
resource = _boto3.resource(service_name, **fixture)
assert resource.meta.service_name == service_name
client = resource.meta.client
if endpoint_url:
assert client.meta.endpoint_url == endpoint_url
@pytest.mark.parametrize("service_name", resource_services)
@pytest.mark.parametrize("fixture_name,fixture", fixtures)
def test_resource_no_env(fixture_name, fixture, service_name):
endpoint_url = fixture.get("endpoint_url", None)
resource = _boto3.resource(service_name, **fixture)
assert resource.meta.service_name == service_name
client = resource.meta.client
if endpoint_url:
assert client.meta.endpoint_url == endpoint_url
| 38.081967
| 84
| 0.718898
| 288
| 2,323
| 5.506944
| 0.149306
| 0.180328
| 0.105927
| 0.070618
| 0.911097
| 0.896595
| 0.896595
| 0.896595
| 0.848676
| 0.848676
| 0
| 0.005601
| 0.154542
| 2,323
| 60
| 85
| 38.716667
| 0.801935
| 0
| 0
| 0.72
| 0
| 0
| 0.145502
| 0
| 0
| 0
| 0
| 0
| 0.12
| 1
| 0.08
| false
| 0
| 0.04
| 0
| 0.12
| 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
|
4c3e7efda94c20ae66f3ae3c23e9eda1d810e86f
| 24,556
|
py
|
Python
|
pandapower/test/opf/test_basic.py
|
xiaolu1990/pandapower
|
53af7f2d455dc4ff6a4fcaccc870b0076fa97bf9
|
[
"BSD-3-Clause"
] | 1
|
2017-05-17T10:40:53.000Z
|
2017-05-17T10:40:53.000Z
|
pandapower/test/opf/test_basic.py
|
xiaolu1990/pandapower
|
53af7f2d455dc4ff6a4fcaccc870b0076fa97bf9
|
[
"BSD-3-Clause"
] | null | null | null |
pandapower/test/opf/test_basic.py
|
xiaolu1990/pandapower
|
53af7f2d455dc4ff6a4fcaccc870b0076fa97bf9
|
[
"BSD-3-Clause"
] | 1
|
2020-03-05T10:07:32.000Z
|
2020-03-05T10:07:32.000Z
|
# -*- coding: utf-8 -*-
# Copyright (c) 2016-2017 by University of Kassel and Fraunhofer Institute for Wind Energy and
# Energy System Technology (IWES), Kassel. All rights reserved. Use of this source code is governed
# by a BSD-style license that can be found in the LICENSE file.
import pytest
from numpy import array
import pandapower as pp
from pandapower.test.toolbox import add_grid_connection
from pandapower.toolbox import convert_format
try:
import pplog as logging
except ImportError:
import logging
logger = logging.getLogger(__name__)
@pytest.fixture
def simple_opf_test_net():
net = pp.create_empty_network()
pp.create_bus(net, vn_kv=10.)
pp.create_bus(net, vn_kv=.4)
pp.create_gen(net, 1, p_kw=-100, controllable=True, max_p_kw=-5, min_p_kw=-150, max_q_kvar=50,
min_q_kvar=-50)
pp.create_ext_grid(net, 0)
pp.create_load(net, 1, p_kw=20, controllable=False)
pp.create_line_from_parameters(net, 0, 1, 50, name="line2", r_ohm_per_km=0.876,
c_nf_per_km=260.0, max_i_ka=0.123, x_ohm_per_km=0.1159876,
max_loading_percent=100)
return net
def test_convert_format():
""" Testing a very simple network without transformer for voltage
constraints with OPF """
# boundaries:
vm_max = 1.05
vm_min = 0.95
# create net
net = pp.create_empty_network()
pp.create_bus(net, max_vm_pu=vm_max, min_vm_pu=vm_min, vn_kv=10.)
pp.create_bus(net, max_vm_pu=vm_max, min_vm_pu=vm_min, vn_kv=.4)
pp.create_gen(net, 1, p_kw=-100, controllable=True, max_p_kw=-5, min_p_kw=-150, max_q_kvar=50,
min_q_kvar=-50)
net.gen["cost_per_kw"] = 100
pp.create_ext_grid(net, 0)
pp.create_load(net, 1, p_kw=20, controllable=False)
pp.create_line_from_parameters(net, 0, 1, 50, name="line2", r_ohm_per_km=0.876,
c_nf_per_km=260.0, max_i_ka=0.123, x_ohm_per_km=0.1159876,
max_loading_percent=100 * 690)
# run OPF
convert_format(net)
for init in ["pf", "flat"]:
pp.runopp(net, verbose=False, init=init)
assert net["OPF_converged"]
# check and assert result
logger.debug("test_simplest_voltage")
logger.debug("res_gen:\n%s" % net.res_gen)
logger.debug("res_ext_grid:\n%s" % net.res_ext_grid)
logger.debug("res_bus.vm_pu: \n%s" % net.res_bus.vm_pu)
assert max(net.res_bus.vm_pu) < vm_max
assert min(net.res_bus.vm_pu) > vm_min
def test_simplest_voltage():
""" Testing a very simple network without transformer for voltage
constraints with OPF """
# boundaries:
vm_max = 1.05
vm_min = 0.95
# create net
net = pp.create_empty_network()
pp.create_bus(net, max_vm_pu=vm_max, min_vm_pu=vm_min, vn_kv=10.)
pp.create_bus(net, max_vm_pu=vm_max, min_vm_pu=vm_min, vn_kv=.4)
pp.create_gen(net, 1, p_kw=-100, controllable=True, max_p_kw=-5, min_p_kw=-150, max_q_kvar=50,
min_q_kvar=-50)
pp.create_ext_grid(net, 0)
pp.create_load(net, 1, p_kw=20, controllable=False)
pp.create_line_from_parameters(net, 0, 1, 50, name="line2", r_ohm_per_km=0.876,
c_nf_per_km=260.0, max_i_ka=0.123, x_ohm_per_km=0.1159876,
max_loading_percent=100)
pp.create_polynomial_cost(net, 0, "gen", array([-100, 0]))
# run OPF
for init in ["pf", "flat"]:
pp.runopp(net, verbose=False, init=init)
assert net["OPF_converged"]
# check and assert result
logger.debug("test_simplest_voltage")
logger.debug("res_gen:\n%s" % net.res_gen)
logger.debug("res_ext_grid:\n%s" % net.res_ext_grid)
logger.debug("res_bus.vm_pu: \n%s" % net.res_bus.vm_pu)
assert max(net.res_bus.vm_pu) < vm_max
assert min(net.res_bus.vm_pu) > vm_min
pp.runopp(net, verbose=False, check_connectivity=True)
assert net["OPF_converged"]
# check and assert result
logger.debug("test_simplest_voltage")
logger.debug("res_gen:\n%s" % net.res_gen)
logger.debug("res_ext_grid:\n%s" % net.res_ext_grid)
logger.debug("res_bus.vm_pu: \n%s" % net.res_bus.vm_pu)
assert max(net.res_bus.vm_pu) < vm_max
assert min(net.res_bus.vm_pu) > vm_min
def test_eg_voltage():
""" Testing a very simple network without transformer for voltage
constraints with OPF """
# boundaries:
vm_max = 1.05
vm_min = 0.95
# create net
net = pp.create_empty_network()
pp.create_bus(net, max_vm_pu=vm_max, min_vm_pu=vm_min, vn_kv=10.)
pp.create_bus(net, max_vm_pu=vm_max, min_vm_pu=vm_min, vn_kv=.4)
pp.create_gen(net, 1, p_kw=-100, controllable=True, max_p_kw=-5, min_p_kw=-150, max_q_kvar=50,
min_q_kvar=-50)
pp.create_ext_grid(net, 0, vm_pu=1.01)
pp.create_load(net, 1, p_kw=20, controllable=False)
pp.create_line_from_parameters(net, 0, 1, 50, name="line2", r_ohm_per_km=0.876,
c_nf_per_km=260.0, max_i_ka=0.123, x_ohm_per_km=0.1159876,
max_loading_percent=100)
# run OPF
for init in ["pf", "flat"]:
pp.runopp(net, verbose=False, init=init)
assert net["OPF_converged"]
# check and assert result
logger.debug("test_simplest_voltage")
logger.debug("res_gen:\n%s" % net.res_gen)
logger.debug("res_ext_grid:\n%s" % net.res_ext_grid)
logger.debug("res_bus.vm_pu: \n%s" % net.res_bus.vm_pu)
assert net.res_bus.vm_pu.at[0] == net.ext_grid.vm_pu.values
def test_simplest_dispatch():
""" Testing a very simple network without transformer for voltage
constraints with OPF """
# boundaries:
vm_max = 1.05
vm_min = 0.95
# create net
net = pp.create_empty_network()
pp.create_bus(net, max_vm_pu=vm_max, min_vm_pu=vm_min, vn_kv=10.)
pp.create_bus(net, max_vm_pu=vm_max, min_vm_pu=vm_min, vn_kv=.4)
pp.create_gen(net, 1, p_kw=-100, controllable=True, max_p_kw=-5, min_p_kw=-150, max_q_kvar=50,
min_q_kvar=-50)
pp.create_polynomial_cost(net, 0, "gen", array([-100, 0]))
pp.create_ext_grid(net, 0)
pp.create_polynomial_cost(net, 0, "ext_grid", array([-101, 0]))
pp.create_load(net, 1, p_kw=20, controllable=False)
pp.create_line_from_parameters(net, 0, 1, 50, name="line2", r_ohm_per_km=0.876,
c_nf_per_km=260.0, max_i_ka=0.123, x_ohm_per_km=0.1159876,
max_loading_percent=100 * 690)
# run OPF
for init in ["pf", "flat"]:
pp.runopp(net, cost_function="linear", verbose=False, init=init)
assert net["OPF_converged"]
# check and assert result
logger.debug("test_simplest_voltage")
logger.debug("res_gen:\n%s" % net.res_gen)
logger.debug("res_est_grid:\n%s" % net.res_ext_grid)
logger.debug("res_bus.vm_pu: \n%s" % net.res_bus.vm_pu)
assert max(net.res_bus.vm_pu) < vm_max
assert min(net.res_bus.vm_pu) > vm_min
def test_opf_gen_voltage():
""" Testing a simple network with transformer for voltage
constraints with OPF using a generator """
# boundaries:
vm_max = 1.05
vm_min = 0.95
# ceate net
net = pp.create_empty_network()
pp.create_bus(net, max_vm_pu=vm_max, min_vm_pu=vm_min, vn_kv=10.)
pp.create_bus(net, max_vm_pu=vm_max, min_vm_pu=vm_min, vn_kv=.4)
pp.create_bus(net, max_vm_pu=vm_max, min_vm_pu=vm_min, vn_kv=.4)
pp.create_bus(net, max_vm_pu=vm_max, min_vm_pu=vm_min, vn_kv=.4)
pp.create_transformer_from_parameters(net, 0, 1, vsc_percent=3.75,
tp_max=2, vn_lv_kv=0.4,
shift_degree=150, tp_mid=0,
vn_hv_kv=10.0, vscr_percent=2.8125,
tp_pos=0, tp_side="hv", tp_min=-2,
tp_st_percent=2.5, i0_percent=0.68751,
sn_kva=16.0, pfe_kw=0.11, name=None,
in_service=True, index=None, max_loading_percent=200)
pp.create_gen(net, 3, p_kw=-10, controllable=True, max_p_kw=0, min_p_kw=-25, max_q_kvar=500,
min_q_kvar=-500)
pp.create_polynomial_cost(net, 0, "gen", array([-10, 0]))
pp.create_ext_grid(net, 0)
pp.create_line_from_parameters(net, 1, 2, 1, name="line2", r_ohm_per_km=0.876,
c_nf_per_km=260.0, max_i_ka=0.123, x_ohm_per_km=0.1159876,
max_loading_percent=100000)
pp.create_line_from_parameters(net, 2, 3, 1, name="line2", r_ohm_per_km=0.876,
c_nf_per_km=260.0, max_i_ka=0.123, x_ohm_per_km=0.1159876,
max_loading_percent=100000)
# run OPF
for init in ["pf", "flat"]:
pp.runopp(net, verbose=False, init=init)
assert net["OPF_converged"]
# check and assert result
logger.debug("test_opf_gen_voltage")
logger.debug("res_gen:\n%s" % net.res_gen)
logger.debug("res_bus.vm_pu: \n%s" % net.res_bus.vm_pu)
assert max(net.res_bus.vm_pu) < vm_max
assert min(net.res_bus.vm_pu) > vm_min
def test_opf_sgen_voltage():
""" Testing a simple network with transformer for voltage
constraints with OPF using a static generator """
# boundaries
vm_max = 1.04
vm_min = 0.96
# create net
net = pp.create_empty_network()
pp.create_bus(net, max_vm_pu=vm_max, min_vm_pu=vm_min, vn_kv=10.)
pp.create_bus(net, max_vm_pu=vm_max, min_vm_pu=vm_min, vn_kv=.4)
pp.create_bus(net, max_vm_pu=vm_max, min_vm_pu=vm_min, vn_kv=.4)
pp.create_bus(net, max_vm_pu=vm_max, min_vm_pu=vm_min, vn_kv=.4)
pp.create_transformer_from_parameters(net, 0, 1, vsc_percent=3.75,
tp_max=2, vn_lv_kv=0.4,
shift_degree=150, tp_mid=0,
vn_hv_kv=10.0, vscr_percent=2.8125,
tp_pos=0, tp_side="hv", tp_min=-2,
tp_st_percent=2.5, i0_percent=0.68751,
sn_kva=16.0, pfe_kw=0.11, name=None,
in_service=True, index=None, max_loading_percent=1000000)
pp.create_sgen(net, 3, p_kw=-10, controllable=True, max_p_kw=-5, min_p_kw=-15, max_q_kvar=25,
min_q_kvar=-25)
pp.create_polynomial_cost(net, 0, "sgen", array([-100, 0]))
pp.create_ext_grid(net, 0)
pp.create_line_from_parameters(net, 1, 2, 1, name="line2", r_ohm_per_km=0.876,
c_nf_per_km=260.0, max_i_ka=0.123, x_ohm_per_km=0.1159876,
max_loading_percent=1000000)
pp.create_line_from_parameters(net, 2, 3, 1, name="line2", r_ohm_per_km=0.876,
c_nf_per_km=260.0, max_i_ka=0.123, x_ohm_per_km=0.1159876,
max_loading_percent=1000000)
# run OPF
for init in ["pf", "flat"]:
pp.runopp(net, verbose=False, init=init)
assert net["OPF_converged"]
# assert and check result
logger.debug("test_opf_sgen_voltage")
logger.debug("res_sgen:\n%s" % net.res_sgen)
logger.debug("res_bus.vm_pu: \n%s" % net.res_bus.vm_pu)
assert max(net.res_bus.vm_pu) < vm_max
assert min(net.res_bus.vm_pu) > vm_min
def test_opf_gen_loading():
""" Testing a simple network with transformer for loading
constraints with OPF using a generator """
# wide open voltage boundaries to make sure they don't interfere with loading constraints
vm_max = 1.5
vm_min = 0.5
max_line_loading = 11
# create net
net = pp.create_empty_network()
pp.create_bus(net, max_vm_pu=vm_max, min_vm_pu=vm_min, vn_kv=10.)
pp.create_bus(net, max_vm_pu=vm_max, min_vm_pu=vm_min, vn_kv=.4)
pp.create_bus(net, max_vm_pu=vm_max, min_vm_pu=vm_min, vn_kv=.4)
pp.create_bus(net, max_vm_pu=vm_max, min_vm_pu=vm_min, vn_kv=.4)
pp.create_transformer_from_parameters(net, 0, 1, vsc_percent=3.75,
tp_max=2, vn_lv_kv=0.4,
shift_degree=150, tp_mid=0,
vn_hv_kv=10.0, vscr_percent=2.8125,
tp_pos=0, tp_side="hv", tp_min=-2,
tp_st_percent=2.5, i0_percent=0.68751,
sn_kva=16.0, pfe_kw=0.11, name=None,
in_service=True, index=None, max_loading_percent=145)
pp.create_gen(net, 3, p_kw=-10, controllable=True, max_p_kw=-5, min_p_kw=-15, max_q_kvar=50,
min_q_kvar=-50)
pp.create_polynomial_cost(net, 0, "gen", array([10, 0]))
pp.create_ext_grid(net, 0)
pp.create_polynomial_cost(net, 0, "ext_grid", array([-.1, 0]))
pp.create_line_from_parameters(net, 1, 2, 1, name="line2", r_ohm_per_km=0.876,
c_nf_per_km=260.0, max_i_ka=0.123, x_ohm_per_km=0.1159876,
max_loading_percent=max_line_loading)
pp.create_line_from_parameters(net, 2, 3, 1, name="line2", r_ohm_per_km=0.876,
c_nf_per_km=260.0, max_i_ka=0.123, x_ohm_per_km=0.1159876,
max_loading_percent=max_line_loading)
# run OPF
pp.runopp(net, verbose=False, OPF_VIOLATION=1e-1, OUT_LIM_LINE=2,
PDIPM_GRADTOL=1e-10, PDIPM_COMPTOL=1e-10, PDIPM_COSTTOL=1e-10)
assert net["OPF_converged"]
# assert and check result
logger.debug("test_opf_gen_loading")
logger.debug("res_gen:\n%s" % net.res_gen)
logger.debug("res_line.loading_percent:\n%s" % net.res_line.loading_percent)
assert max(net.res_line.loading_percent) < max_line_loading
logger.debug("res_trafo.loading_percent:\n%s" % net.res_trafo.loading_percent)
assert max(net.res_trafo.loading_percent) < 145
assert max(net.res_bus.vm_pu) < vm_max
assert min(net.res_bus.vm_pu) > vm_min
def test_opf_sgen_loading():
""" Testing a simple network with transformer for loading
constraints with OPF using a generator """
# boundaries
vm_max = 1.5
vm_min = 0.5
max_trafo_loading = 800
max_line_loading = 13
# create net
net = pp.create_empty_network()
pp.create_bus(net, max_vm_pu=vm_max, min_vm_pu=vm_min, vn_kv=10.)
pp.create_bus(net, max_vm_pu=vm_max, min_vm_pu=vm_min, vn_kv=.4)
pp.create_bus(net, max_vm_pu=vm_max, min_vm_pu=vm_min, vn_kv=.4)
pp.create_bus(net, max_vm_pu=vm_max, min_vm_pu=vm_min, vn_kv=.4)
pp.create_transformer_from_parameters(net, 0, 1, vsc_percent=3.75, tp_max=2, vn_lv_kv=0.4,
shift_degree=150, tp_mid=0, vn_hv_kv=10.0,
vscr_percent=2.8125, tp_pos=0, tp_side="hv", tp_min=-2,
tp_st_percent=2.5, i0_percent=0.68751, sn_kva=16.0,
pfe_kw=0.11, name=None, in_service=True, index=None,
max_loading_percent=max_trafo_loading)
pp.create_sgen(net, 3, p_kw=-10, controllable=True, max_p_kw=-5, min_p_kw=-15, max_q_kvar=25,
min_q_kvar=-25)
pp.create_polynomial_cost(net, 0, "sgen", array([10, 0]))
pp.create_ext_grid(net, 0)
pp.create_polynomial_cost(net, 0, "ext_grid", array([-.1, 0]))
pp.create_line_from_parameters(net, 1, 2, 1, name="line2", r_ohm_per_km=0.876,
c_nf_per_km=260.0, max_i_ka=0.123, x_ohm_per_km=0.1159876,
max_loading_percent=max_line_loading)
pp.create_line_from_parameters(net, 2, 3, 1, name="line2", r_ohm_per_km=0.876,
c_nf_per_km=260.0, max_i_ka=0.123, x_ohm_per_km=0.1159876,
max_loading_percent=max_line_loading)
# run OPF
for init in ["pf", "flat"]:
pp.runopp(net, verbose=False, init=init)
assert net["OPF_converged"]
# assert and check result
logger.debug("test_opf_sgen_loading")
logger.debug("res_sgen:\n%s" % net.res_sgen)
logger.debug("res_line.loading_percent:\n%s" % net.res_line.loading_percent)
assert max(net.res_line.loading_percent) - max_line_loading < 1e-2
logger.debug("res_trafo.loading_percent:\n%s" % net.res_trafo.loading_percent)
assert max(net.res_trafo.loading_percent) < max_trafo_loading
assert max(net.res_bus.vm_pu) < vm_max
assert min(net.res_bus.vm_pu) > vm_min
# check connectivity check
pp.runopp(net, verbose=False, check_connectivity=True)
def test_unconstrained_line():
""" Testing a very simple network without transformer for voltage
constraints with OPF """
# boundaries:
vm_max = 1.05
vm_min = 0.95
# create net
net = pp.create_empty_network()
pp.create_bus(net, max_vm_pu=vm_max, min_vm_pu=vm_min, vn_kv=10.)
pp.create_bus(net, max_vm_pu=vm_max, min_vm_pu=vm_min, vn_kv=.4)
pp.create_gen(net, 1, p_kw=-100, controllable=True, max_p_kw=-5, min_p_kw=-150, max_q_kvar=50,
min_q_kvar=-50)
pp.create_ext_grid(net, 0)
pp.create_load(net, 1, p_kw=20, controllable=False)
pp.create_line_from_parameters(net, 0, 1, 50, name="line2", r_ohm_per_km=0.876,
c_nf_per_km=260.0, max_i_ka=0.123, x_ohm_per_km=0.1159876)
pp.create_polynomial_cost(net, 0, "gen", array([-1, 0]))
# run OPF
for init in ["pf", "flat"]:
pp.runopp(net, verbose=False, init=init)
assert net["OPF_converged"]
# check and assert result
logger.debug("test_simplest_voltage")
logger.debug("res_gen:\n%s" % net.res_gen)
logger.debug("res_ext_grid:\n%s" % net.res_ext_grid)
logger.debug("res_bus.vm_pu: \n%s" % net.res_bus.vm_pu)
assert max(net.res_bus.vm_pu) < vm_max
assert min(net.res_bus.vm_pu) > vm_min
def test_trafo3w_loading():
net = pp.create_empty_network()
b1, b2, l1 = add_grid_connection(net, vn_kv=110.)
b3 = pp.create_bus(net, vn_kv=20.)
b4 = pp.create_bus(net, vn_kv=10.)
tidx = pp.create_transformer3w(
net, b2, b3, b4, std_type='63/25/38 MVA 110/20/10 kV', max_loading_percent=120)
pp.create_load(net, b3, 5e3, controllable=False)
id = pp.create_load(net, b4, 5e3, controllable=True, max_p_kw=5e4, min_p_kw=0, min_q_kvar=-1e9, max_q_kvar= 1e9)
pp.create_polynomial_cost(net, id, "load", array([-1, 0]))
#pp.create_xward(net, b4, 1000, 1000, 1000, 1000, 0.1, 0.1, 1.0)
net.trafo3w.shift_lv_degree.at[tidx] = 120
net.trafo3w.shift_mv_degree.at[tidx] = 80
# pp.runopp(net, calculate_voltage_angles = True) >> Doesn't converge
for init in ["pf", "flat"]:
pp.runopp(net, calculate_voltage_angles=False, verbose=False, init=init)
assert net["OPF_converged"]
assert abs(net.res_trafo3w.loading_percent.values - 120) < 1e-3
def test_dcopf_poly(simple_opf_test_net):
net = simple_opf_test_net
pp.create_polynomial_cost(net, 0, "gen", array([-100, 0]))
# run OPF
pp.rundcopp(net, verbose=False)
# check and assert result
logger.debug("test_simplest_voltage")
logger.debug("res_gen:\n%s" % net.res_gen)
logger.debug("res_ext_grid:\n%s" % net.res_ext_grid)
logger.debug("res_bus.vm_pu: \n%s" % net.res_bus.vm_pu)
assert abs(100 * net.res_gen.p_kw.values - net.res_cost) < 1e-3
def test_opf_poly(simple_opf_test_net):
net = simple_opf_test_net
pp.create_polynomial_cost(net, 0, "gen", array([-100, 0]))
# run OPF
for init in ["pf", "flat"]:
pp.runopp(net, verbose=False, init=init)
assert net["OPF_converged"]
# check and assert result
logger.debug("test_simplest_voltage")
logger.debug("res_gen:\n%s" % net.res_gen)
logger.debug("res_ext_grid:\n%s" % net.res_ext_grid)
logger.debug("res_bus.vm_pu: \n%s" % net.res_bus.vm_pu)
assert abs(100 * net.res_gen.p_kw.values - net.res_cost) < 1e-3
def test_opf_pwl(simple_opf_test_net):
# create net
net = simple_opf_test_net
# pp.create_polynomial_cost(net, 0, "gen", array([-100, 0]))
pp.create_piecewise_linear_cost(net, 0, "gen", array([[-200, 20000], [-100, 10000], [0, 0]]))
# run OPF
for init in ["pf", "flat"]:
pp.runopp(net, verbose=False, init=init)
assert net["OPF_converged"]
# check and assert result
logger.debug("test_simplest_voltage")
logger.debug("res_gen:\n%s" % net.res_gen)
logger.debug("res_ext_grid:\n%s" % net.res_ext_grid)
logger.debug("res_bus.vm_pu: \n%s" % net.res_bus.vm_pu)
assert abs(100 * net.res_gen.p_kw.values - net.res_cost) < 1e-3
def test_dcopf_pwl(simple_opf_test_net):
# create net
net = simple_opf_test_net
# pp.create_polynomial_cost(net, 0, "gen", array([-100, 0]))
pp.create_piecewise_linear_cost(net, 0, "gen", array([[-200, 20000], [-100, 10000], [0, 0]]))
# run OPF
pp.rundcopp(net, verbose=False)
assert net["OPF_converged"]
# check and assert result
logger.debug("test_simplest_voltage")
logger.debug("res_gen:\n%s" % net.res_gen)
logger.debug("res_ext_grid:\n%s" % net.res_ext_grid)
logger.debug("res_bus.vm_pu: \n%s" % net.res_bus.vm_pu)
assert abs(100 * net.res_gen.p_kw.values - net.res_cost) < 1e-3
def test_opf_varying_max_line_loading():
""" Testing a simple network with transformer for loading
constraints with OPF using a generator """
# boundaries
vm_max = 1.5
vm_min = 0.5
max_trafo_loading = 800
max_line_loading = 13
# create net
net = pp.create_empty_network()
pp.create_bus(net, max_vm_pu=vm_max, min_vm_pu=vm_min, vn_kv=10.)
pp.create_bus(net, max_vm_pu=vm_max, min_vm_pu=vm_min, vn_kv=.4)
pp.create_bus(net, max_vm_pu=vm_max, min_vm_pu=vm_min, vn_kv=.4)
pp.create_bus(net, max_vm_pu=vm_max, min_vm_pu=vm_min, vn_kv=.4)
pp.create_transformer_from_parameters(net, 0, 1, vsc_percent=3.75, tp_max=2, vn_lv_kv=0.4,
shift_degree=150, tp_mid=0, vn_hv_kv=10.0,
vscr_percent=2.8125, tp_pos=0, tp_side="hv", tp_min=-2,
tp_st_percent=2.5, i0_percent=0.68751, sn_kva=16.0,
pfe_kw=0.11, name=None, in_service=True, index=None,
max_loading_percent=max_trafo_loading)
pp.create_sgen(net, 3, p_kw=-100, controllable=True, max_p_kw=-5, min_p_kw=-150, max_q_kvar=25,
min_q_kvar=-25)
pp.create_sgen(net, 2, p_kw=-100, controllable=True, max_p_kw=-5, min_p_kw=-150, max_q_kvar=25,
min_q_kvar=-25)
pp.create_polynomial_cost(net, 0, "sgen", array([-10, 0]))
pp.create_polynomial_cost(net, 1, "sgen", array([-10, 0]))
pp.create_ext_grid(net, 0)
pp.create_polynomial_cost(net, 0, "ext_grid", array([-.1, 0]))
pp.create_line_from_parameters(net, 1, 2, 1, name="line1", r_ohm_per_km=0.876,
c_nf_per_km=260.0, max_i_ka=0.200, x_ohm_per_km=0.1159876,
max_loading_percent=20)
pp.create_line_from_parameters(net, 1, 3, 1, name="line2", r_ohm_per_km=0.876,
c_nf_per_km=260.0, max_i_ka=0.100, x_ohm_per_km=0.1159876,
max_loading_percent=10)
# run OPF
pp.runopp(net, verbose=False, init="flat")
assert net["OPF_converged"]
assert sum(net["_ppc"]["branch"][:, 5] - array([ 0.02771281+0.j, 0.00692820+0.j, 0.12800000+0.j])) < 1e-8
# assert and check result
logger.debug("test_opf_sgen_loading")
logger.debug("res_sgen:\n%s" % net.res_sgen)
logger.debug("res_line.loading_percent:\n%s" % net.res_line.loading_percent)
assert net.res_line.loading_percent.at[0] - 20 < 1e-2
logger.debug("res_line.loading_percent:\n%s" % net.res_line.loading_percent)
assert net.res_line.loading_percent.at[1] - 10 < 1e-2
if __name__ == "__main__":
# pytest.main(["-s"])
test_opf_varying_max_line_loading()
# pytest.main(["test_basic.py", "-s"])
# test_simplest_dispatch()
# test_trafo3w_loading()
# test_trafo3w_loading()
# test_dcopf_pwl()
| 43.85
| 116
| 0.6284
| 4,085
| 24,556
| 3.459731
| 0.063892
| 0.067926
| 0.033114
| 0.02434
| 0.895917
| 0.881483
| 0.870728
| 0.862096
| 0.848086
| 0.838039
| 0
| 0.065197
| 0.246091
| 24,556
| 560
| 117
| 43.85
| 0.698212
| 0.097573
| 0
| 0.771208
| 0
| 0
| 0.071107
| 0.020414
| 0
| 0
| 0
| 0
| 0.118252
| 1
| 0.041131
| false
| 0
| 0.020566
| 0
| 0.064267
| 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
|
4c673dd71d396ba5c03ec61d593adf0f7ba84d8c
| 8,347
|
py
|
Python
|
tests/test_cli.py
|
AndreaGiardini/cogeo-mosaic
|
53409dbf1f6858393f017c5a1db205e58cb44ee6
|
[
"MIT"
] | 56
|
2019-05-23T21:02:17.000Z
|
2022-02-17T16:09:06.000Z
|
tests/test_cli.py
|
AndreaGiardini/cogeo-mosaic
|
53409dbf1f6858393f017c5a1db205e58cb44ee6
|
[
"MIT"
] | 119
|
2019-05-24T14:28:40.000Z
|
2022-03-22T15:18:52.000Z
|
tests/test_cli.py
|
AndreaGiardini/cogeo-mosaic
|
53409dbf1f6858393f017c5a1db205e58cb44ee6
|
[
"MIT"
] | 18
|
2019-08-14T03:30:38.000Z
|
2021-06-30T09:03:08.000Z
|
"""tests cogeo_mosaic.scripts.cli."""
import json
import os
from click.testing import CliRunner
from cogeo_mosaic.mosaic import MosaicJSON
from cogeo_mosaic.scripts.cli import cogeo_cli
asset1 = os.path.join(os.path.dirname(__file__), "fixtures", "cog1.tif")
asset2 = os.path.join(os.path.dirname(__file__), "fixtures", "cog2.tif")
assets = [asset1, asset2]
mosaic_content = MosaicJSON.from_urls(assets)
def test_create_valid():
"""Should work as expected."""
runner = CliRunner()
with runner.isolated_filesystem():
with open("./list.txt", "w") as f:
f.write("\n")
f.write("\n".join(assets))
f.write("\n")
result = runner.invoke(cogeo_cli, ["create", "list.txt", "--quiet"])
assert not result.exception
assert result.exit_code == 0
assert mosaic_content == MosaicJSON(**json.loads(result.output))
result = runner.invoke(cogeo_cli, ["create", "list.txt", "-o", "mosaic.json"])
assert not result.exception
assert result.exit_code == 0
assert mosaic_content == MosaicJSON.parse_file("mosaic.json")
result = runner.invoke(
cogeo_cli,
[
"create",
"list.txt",
"-o",
"mosaic.json",
"--name",
"my_mosaic",
"--description",
"A mosaic",
"--attribution",
"someone",
],
)
assert not result.exception
assert result.exit_code == 0
mosaic = MosaicJSON.parse_file("mosaic.json")
assert mosaic.name == "my_mosaic"
assert mosaic.description == "A mosaic"
assert mosaic.attribution == "someone"
def test_update_valid():
"""Should work as expected."""
runner = CliRunner()
with runner.isolated_filesystem():
with open("mosaic_1.json", "w") as f:
f.write(json.dumps(MosaicJSON.from_urls([asset1]).dict(exclude_none=True)))
with open("./list.txt", "w") as f:
f.write("\n".join([asset2]))
result = runner.invoke(
cogeo_cli, ["update", "list.txt", "mosaic_1.json", "--quiet"]
)
assert not result.exception
assert result.exit_code == 0
with open("mosaic_1.json", "r") as f:
updated_mosaic = json.load(f)
updated_mosaic["version"] == "1.0.1"
assert not mosaic_content.tiles == updated_mosaic["tiles"]
with open("mosaic_2.json", "w") as f:
f.write(json.dumps(MosaicJSON.from_urls([asset1]).dict(exclude_none=True)))
result = runner.invoke(
cogeo_cli, ["update", "list.txt", "mosaic_2.json", "--add-last", "--quiet"]
)
assert not result.exception
assert result.exit_code == 0
with open("mosaic_2.json", "r") as f:
updated_mosaic = json.load(f)
updated_mosaic["version"] == "1.0.1"
assert mosaic_content.tiles == updated_mosaic["tiles"]
def test_footprint_valid():
"""Should work as expected."""
runner = CliRunner()
with runner.isolated_filesystem():
with open("./list.txt", "w") as f:
f.write("\n".join([asset1, asset2]))
result = runner.invoke(cogeo_cli, ["footprint", "list.txt", "--quiet"])
assert not result.exception
assert result.exit_code == 0
footprint = json.loads(result.output)
assert len(footprint["features"]) == 2
result = runner.invoke(
cogeo_cli, ["footprint", "list.txt", "-o", "mosaic.geojson"]
)
assert not result.exception
assert result.exit_code == 0
with open("mosaic.geojson", "r") as f:
footprint = json.load(f)
assert len(footprint["features"]) == 2
def test_from_features():
"""Should work as expected."""
runner = CliRunner()
with runner.isolated_filesystem():
with open("./list.txt", "w") as f:
f.write("\n".join([asset1, asset2]))
result = runner.invoke(
cogeo_cli, ["footprint", "list.txt", "-o", "mosaic.geojson"]
)
with open("mosaic.geojson", "r") as f:
features = f.read()
result = runner.invoke(
cogeo_cli,
[
"create-from-features",
"--minzoom",
"7",
"--maxzoom",
"9",
"--property",
"path",
"--quiet",
],
input=features,
)
assert not result.exception
assert result.exit_code == 0
assert mosaic_content == MosaicJSON(**json.loads(result.output))
result = runner.invoke(
cogeo_cli,
[
"create-from-features",
"--minzoom",
"7",
"--maxzoom",
"9",
"--property",
"path",
"-o",
"mosaic.json",
"--quiet",
],
input=features,
)
assert not result.exception
assert result.exit_code == 0
assert mosaic_content == MosaicJSON.parse_file("mosaic.json")
result = runner.invoke(
cogeo_cli,
[
"create-from-features",
"--minzoom",
"7",
"--maxzoom",
"9",
"--property",
"path",
"--name",
"my_mosaic",
"--description",
"A mosaic",
"--attribution",
"someone",
"--quiet",
],
input=features,
)
assert not result.exception
assert result.exit_code == 0
mosaic = MosaicJSON(**json.loads(result.output))
assert mosaic.name == "my_mosaic"
assert mosaic.description == "A mosaic"
assert mosaic.attribution == "someone"
def test_info_valid():
"""Should work as expected."""
runner = CliRunner()
with runner.isolated_filesystem():
mosaic = os.path.join(os.path.dirname(__file__), "fixtures", "mosaic.json")
result = runner.invoke(cogeo_cli, ["info", mosaic, "--json"])
assert not result.exception
assert result.exit_code == 0
info = json.loads(result.output)
assert info["Backend"] == "File"
assert not info["Compressed"]
mosaic = os.path.join(os.path.dirname(__file__), "fixtures", "mosaic.json.gz")
result = runner.invoke(cogeo_cli, ["info", mosaic, "--json"])
assert not result.exception
assert result.exit_code == 0
info = json.loads(result.output)
assert info["Backend"] == "File"
assert info["Compressed"]
mosaic = os.path.join(os.path.dirname(__file__), "fixtures", "mosaic.json.gz")
result = runner.invoke(cogeo_cli, ["info", mosaic])
assert not result.exception
assert result.exit_code == 0
assert "Compressed: True" in result.output
def test_to_geojson():
"""Should work as expected."""
runner = CliRunner()
with runner.isolated_filesystem():
mosaic = os.path.join(os.path.dirname(__file__), "fixtures", "mosaic.json")
result = runner.invoke(cogeo_cli, ["to-geojson", mosaic])
assert not result.exception
assert result.exit_code == 0
info = result.output.split("\n")
assert len(info) == 10
assert json.loads(info[0])["properties"]["nb_assets"] == 1
mosaic = os.path.join(os.path.dirname(__file__), "fixtures", "mosaic.json")
result = runner.invoke(cogeo_cli, ["to-geojson", mosaic, "--features"])
assert not result.exception
assert result.exit_code == 0
info = result.output.split("\n")
assert len(info) == 10
assert json.loads(info[0])["properties"]["nb_assets"] == 1
mosaic = os.path.join(os.path.dirname(__file__), "fixtures", "mosaic.json")
result = runner.invoke(cogeo_cli, ["to-geojson", mosaic, "--collect"])
assert not result.exception
assert result.exit_code == 0
info = json.loads(result.output)
assert len(info["features"]) == 9
| 33.657258
| 87
| 0.540673
| 896
| 8,347
| 4.902902
| 0.112723
| 0.032779
| 0.069656
| 0.089005
| 0.909401
| 0.872297
| 0.847029
| 0.838835
| 0.793763
| 0.773276
| 0
| 0.010149
| 0.315323
| 8,347
| 247
| 88
| 33.793522
| 0.75853
| 0.021684
| 0
| 0.7343
| 0
| 0
| 0.142312
| 0
| 0
| 0
| 0
| 0
| 0.270531
| 1
| 0.028986
| false
| 0
| 0.024155
| 0
| 0.05314
| 0.038647
| 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
|
d5eec3870fbfbe477372db75fb7c4f8295adca02
| 3,690
|
py
|
Python
|
Crypto-hardRSA/hardRSA_solve.py
|
JSW2020/hsctf-2019-freshmen
|
5282d6d51153aadd62f42673aa3d487f8d7ef45b
|
[
"MIT"
] | 16
|
2019-12-09T15:53:08.000Z
|
2021-12-07T00:34:30.000Z
|
Crypto-hardRSA/hardRSA_solve.py
|
JSW2020/hsctf-2019-freshmen
|
5282d6d51153aadd62f42673aa3d487f8d7ef45b
|
[
"MIT"
] | null | null | null |
Crypto-hardRSA/hardRSA_solve.py
|
JSW2020/hsctf-2019-freshmen
|
5282d6d51153aadd62f42673aa3d487f8d7ef45b
|
[
"MIT"
] | 7
|
2019-12-09T11:53:52.000Z
|
2021-11-14T04:09:04.000Z
|
#! /usr/bin/python2
# -*- coding: utf-8 -*-
import gmpy2
n1 = 17963064878219297499926539755529525701375912229028373100173473134607394789664287607368340798794683194437682952690508928886652995386383146889003406172408614571972729531812623495934448286040540097840662578369651592616783708165933036306017892497833364373485432426417809013633924450913331047907013191887482793788688736422653892662900369700701081539738763728230752094073294005560908179016172875213907812943500460207818071050071895019325622709305548027158608131204996083137774696224909740835744016252811508782404134677682054379270633099277445509293373814980267901088167711756798567438727515561927878122737404945310578048219
c1 = 2519784075571363990355801446319896012899269885206109823774950526790963683990153738128746190638393784786596405506731840240589533349004496866914346264165223649729391271273556253486062775839454219993404367212857109756953767455690796208791355456292865648813147954137342631589248190059107210837405220320124078796283385382994717993598412926549647978190991179177838292156516142496656655553613583148209957002024913648233539568864514049304210818483385640653620994626277688420873819215255064048179977060710057344959786809400706849894340484144098989681668420576351191631435372353088813222856086210998354107613629733847782962190
n2 = 18724308600993680772040132476147443059937062865510694686877532603079614680086774925762072671394784787691065784432778464228230479469525602116950506124178922966302228834351364607333986401435253287986565305219407269279319145851605536263946222693062150972421981977212241191765587924831341467136660852112059970632881164690431105960074159318822853545203221878413076459098980779367764115932851271974512575031047448816911420663521305894273613218483567916755598148798190932027939210902403155767487515702073721374684377875350047635848757189883075996002319631998930528597791545501045272097478778892159675588840857142652895265911
c2 = [3227115480108687251143827858010802848948769835037303555920483802259214819344453925631294417806432714176524195861938002549436386343852098195596387592472144546437874859798830812267011643855867112448231876484774166379425286268881326798711769931848606930434512049291154720821129654830620829493843059059835800242333615312846190103494997079811557982251508839708002883778910917631553992619052626191828854730582898255670700858011426887487070944722267353577011178466697504947762804170585435684678698950363434075952461947607646966414518037049739527149945887998812316417005423702083018805606242882095334884780205891592816168103L, 17139275485259110169718125211934888629708949924849742315041043571562307752055065297519271353044041441264892639110696891866965260187916302606640599942290472419225004160983308212078726494659784938191829066322525193057563553826485587827351089778042018829577434276292639964092632076137550347805354953807458891741631731341557365791973551073866525939105337652370251223107187937345980460911362790708353134912495192276504731259631723322913019046682545871283275754931576128656069033856416078373511440449107627433371949378696710812496517227289219196266427370667273925986284754478473526404645897976394395240810054198847661134728L]
c3 = [281487861809153, 49947026556362417]
#低加密指数攻击 得到e1,e2
e1 = gmpy2.iroot(c3[0],3)[0]
e2 = gmpy2.iroot(c3[1],3)[0]
#共模攻击 得到 p
s = gmpy2.gcdext(e1, e2)
s1,s2 = s[1],s[2]
enc1,enc2 = c2[0],c2[1]
if s1 < 0:
s1 = -s1
enc1 = gmpy2.invert(enc1, n2)
elif s2 < 0:
s2 = -s2
enc2 = gmpy2.invert(enc2, n2)
p = gmpy2.powmod(enc1, s1, n2) * gmpy2.powmod(enc2, s2, n2) % n2
#分解n1 得到 p,q解密
q = n1/p
d = gmpy2.invert(e1,(p-1)*(q-1))
m = gmpy2.powmod(c1,d,n1)
flag = hex(m)[2:].strip('L').decode('hex')
print(flag)
| 111.818182
| 1,244
| 0.931707
| 120
| 3,690
| 28.65
| 0.441667
| 0.009599
| 0.006981
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.891158
| 0.031436
| 3,690
| 33
| 1,245
| 111.818182
| 0.070789
| 0.020867
| 0
| 0
| 0
| 0
| 0.001108
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | null | 0
| 0.043478
| null | null | 0.043478
| 0
| 0
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
d5fa6064d729a251b2919a3f2253a9fb79e9a8f3
| 138,989
|
py
|
Python
|
bfrs/reports.py
|
dbca-wa/bfrs
|
48aa760be0e9038287faa1cadbc5276f0e1a46ce
|
[
"Apache-2.0"
] | null | null | null |
bfrs/reports.py
|
dbca-wa/bfrs
|
48aa760be0e9038287faa1cadbc5276f0e1a46ce
|
[
"Apache-2.0"
] | 3
|
2020-02-12T00:03:12.000Z
|
2021-12-13T19:45:47.000Z
|
bfrs/reports.py
|
dbca-wa/bfrs
|
48aa760be0e9038287faa1cadbc5276f0e1a46ce
|
[
"Apache-2.0"
] | 5
|
2018-02-16T02:05:40.000Z
|
2022-01-18T03:35:41.000Z
|
from django.db import connection
from bfrs.models import Bushfire, Region, District, Tenure, Cause, current_finyear,Agency
from bfrs.utils import get_pbs_bushfires
from django.db.models import Count, Sum
from django.db.models.query import QuerySet
from django.contrib.auth.models import User, Group
from django.contrib import messages
from datetime import datetime
from xlwt import Workbook, Font, XFStyle, Alignment, Pattern, Style
from itertools import count
import unicodecsv
import shutil
from django.http import HttpResponse, HttpResponseRedirect
from django.template.response import TemplateResponse
from django.core.mail import send_mail
from django.db import connection
from cStringIO import StringIO
from django.core.mail import EmailMessage
from django.conf import settings
from django.utils import timezone
import os
import subprocess
import csv
import traceback
from django.template.loader import render_to_string
from .utils import generate_pdf
import logging
logger = logging.getLogger(__name__)
DISCLAIMER = 'Any discrepancies between the total and the sum of the individual values is due to rounding.'
MISSING_MAP = []
region_order = {
'Goldfields':-97,
'Kimberley':-100,
'Midwest':-98,
'Pilbara':-99,
'South Coast':-95,
'South West':-199,
'Swan':-200,
'Warren':-198,
'Wheatbelt':-96
}
sorted_regions = {}
def get_sorted_regions(forest_region=None):
key = "all" if forest_region is None else ("forest" if forest_region else "nonforest")
if key not in sorted_regions:
if forest_region is None:
#sorted_regions[key] = sorted(Region.objects.all(),cmp=lambda r1,r2: cmp(region_order.get(r1.name,r1.id),region_order.get(r2.name,r2.id)))
sorted_regions[key] = sorted(Region.objects.filter(dbca=True) ,cmp=lambda r1,r2: cmp(region_order.get(r1.name,r1.id),region_order.get(r2.name,r2.id)))
else:
#sorted_regions[key] = sorted(Region.objects.filter(forest_region=forest_region),cmp=lambda r1,r2: cmp(region_order.get(r1.name,r1.id),region_order.get(r2.name,r2.id)))
sorted_regions[key] = sorted(Region.objects.filter(dbca=True).filter(forest_region=forest_region),cmp=lambda r1,r2: cmp(region_order.get(r1.name,r1.id),region_order.get(r2.name,r2.id)))
return sorted_regions[key]
def style(bold=False, num_fmt='#,##0', horz_align=Alignment.HORZ_GENERAL, colour=None):
style = XFStyle()
font = Font()
font.bold = bold
style.font = font
style.num_format_str = num_fmt
style.alignment.horz = horz_align
# add cell colour
if colour:
pattern = Pattern()
pattern.pattern = Pattern.SOLID_PATTERN
pattern.pattern_fore_colour = Style.colour_map[colour]
style.pattern = pattern
return style
style_normal_int = style()
style_normal = style(num_fmt='#,##0')
style_normal_float = style(num_fmt='#,##0.00')
style_normal_area = style(num_fmt='#,##0.00')
style_normal_percentage = style(num_fmt='#,##0.00\\%')
style_bold_int = style(bold=True)
style_bold = style(bold=True, num_fmt='#,##0', horz_align=Alignment.HORZ_CENTER)
style_bold_float = style(bold=True, num_fmt='#,##0.00')
style_bold_area = style(bold=True, num_fmt='#,##0.00')
style_bold_percentage = style(bold=True, num_fmt='#,##0.00\\%')
style_bold_gen = style(bold=True, num_fmt='#,##0')
style_bold_red = style(bold=True, num_fmt='#,##0', colour='red')
style_bold_yellow = style(bold=True, num_fmt='#,##0', colour='yellow')
def read_col(fin_year, col_type):
"""
Reads historical data from file - provided by FMS from legacy BFRS application
fin_year: 2006 --> first part of '2006/2007'
col_type: 'count' --> annotated values or
'total_count' --> aggregated values
"""
try:
reader = csv.reader(open(settings.HISTORICAL_CAUSE_CSV_FILE), delimiter=',', quotechar='"')
hdr = reader.next()
hdr = [hdr[0]] + [int(i.split('/')[0]) for i in hdr if '/' in i] # converts '2006/2007' --> int('2006')
idx = hdr.index(fin_year)
if hdr[idx+10] != fin_year:
# check idx + 10 is also equal to fin_year
logger.error("Cannot find 2nd fin_year (percentage column) in CSV header: {}, {}".format(fin_year, hdr))
return [], []
count_list = []
perc_list = []
for i in list(reader):
if len(i) == 0 or i[0].startswith('#'):
# ignore comments or blanks lines in csv file
continue
if i[0] != 'Total' and col_type=='count':
cause = Cause.objects.filter(name=i[0])
if cause:
cause_id = cause[0].id
else:
if not [j for j in MISSING_MAP if not j.has_key(i[0])]:
MISSING_MAP.append( dict(name=i[0], error='Cause {0}, Missing from BFRS Enum list. Please Request OIM to add Cause={0}'.format(i[0])))
continue
count_list.append( dict(cause_id=cause_id, count=int(i[idx])) )
perc_list.append( dict(cause_id=cause_id, count=int(i[idx+10])) )
if i[0] == 'Total' and col_type=='total_count':
return dict(count_total=int(i[idx])), dict(count_total=int(i[idx+10]))
return count_list, perc_list
except ValueError, e:
logger.error("Cannot find fin_year in CSV header: {}, {}, {}".format(fin_year, hdr, e))
except IndexError, e:
logger.error("Cannot find 2nd fin_year (percentage column) in CSV header: {}, {}, {}".format(fin_year, hdr, e))
except IOError, e:
logger.error("Cannot Open CSV file: {}, {}".format(settings.HISTORICAL_CAUSE_CSV_FILE, e))
except Exception, e:
logger.error("Error reading column from CSV file: {}, {}, {}".format(fin_year, settings.HISTORICAL_CAUSE_CSV_FILE, e))
return [], []
class BushfireReport():
def __init__(self, reporting_year=None):
self.reporting_year = current_finyear() if (reporting_year is None or reporting_year >= current_finyear()) else reporting_year
self.ministerial_auth = MinisterialReportAuth(self.reporting_year)
self.ministerial_268 = MinisterialReport268(self.reporting_year)
self.ministerial = MinisterialReport(self.ministerial_auth, self.ministerial_268,self.reporting_year)
self.quarterly = QuarterlyReport(self.reporting_year)
self.by_tenure = BushfireByTenureReport(self.reporting_year)
self.by_cause = BushfireByCauseReport(self.reporting_year)
self.region_by_tenure = BushfireByRegionByTenureReport(self.reporting_year)
self.indicator = BushfireIndicator(self.reporting_year)
self.by_cause_10YrAverage = Bushfire10YrAverageReport(self.reporting_year)
def write_excel(self):
rpt_date = datetime.now()
book = Workbook()
self.ministerial.get_excel_sheet(rpt_date, book)
self.ministerial_auth.get_excel_sheet(rpt_date, book)
self.ministerial_268.get_excel_sheet(rpt_date, book)
self.quarterly.get_excel_sheet(rpt_date, book)
self.by_tenure.get_excel_sheet(rpt_date, book)
self.by_cause.get_excel_sheet(rpt_date, book)
self.region_by_tenure.get_excel_sheet(rpt_date, book)
self.indicator.get_excel_sheet(rpt_date, book)
self.by_cause_10YrAverage.get_excel_sheet(rpt_date, book)
filename = '/tmp/bushfire_report_{}.xls'.format(rpt_date.strftime('%d-%b-%Y'))
book.save(filename)
def export(self):
""" Executed from the Overview page in BFRS, returns an Excel WB as a HTTP Response object """
rpt_date = datetime.now()
filename = 'bushfire_report_{}.xls'.format(rpt_date.strftime('%d%b%Y'))
response = HttpResponse(content_type='application/vnd.ms-excel')
response['Content-Disposition'] = 'attachment; filename=' + filename
book = Workbook()
self.ministerial.get_excel_sheet(rpt_date, book)
self.ministerial_auth.get_excel_sheet(rpt_date, book)
self.ministerial_268.get_excel_sheet(rpt_date, book)
self.quarterly.get_excel_sheet(rpt_date, book)
self.by_tenure.get_excel_sheet(rpt_date, book)
self.by_cause.get_excel_sheet(rpt_date, book)
self.region_by_tenure.get_excel_sheet(rpt_date, book)
self.indicator.get_excel_sheet(rpt_date, book)
self.by_cause_10YrAverage.get_excel_sheet(rpt_date, book)
book.add_sheet('Sheet 1')
book.save(response)
return response
class MinisterialReport():
"""
Report for Combined (Authorised and active 268b) fires. This is the sum of MinisterialAuth and Ministerial268b.
"""
def __init__(self, ministerial_auth=None, ministerial_268=None, reporting_year=None):
self.reporting_year = current_finyear() if (reporting_year is None or reporting_year >= current_finyear()) else reporting_year
self.ministerial_auth = ministerial_auth if ministerial_auth else MinisterialReportAuth(self.reporting_year)
self.ministerial_268 = ministerial_268 if ministerial_268 else MinisterialReport268(self.reporting_year)
self.rpt_map, self.item_map = self.create()
def create(self):
rpt_map_auth = self.ministerial_auth.rpt_map
rpt_map_268 = self.ministerial_268.rpt_map
item_map_auth = self.ministerial_auth.item_map
item_map_268 = self.ministerial_268.item_map
rpt_map = []
item_map = {}
for region in get_sorted_regions(True):
map_auth = [i for i in rpt_map_auth if i.has_key(region.name)][0]
map_268 = [i for i in rpt_map_268 if i.has_key(region.name)][0]
rpt_map.append({
region.name: dict(
pw_tenure=map_auth[region.name]['pw_tenure'] + map_268[region.name]['pw_tenure'],
area_pw_tenure=map_auth[region.name]['area_pw_tenure'] + map_268[region.name]['area_pw_tenure'],
total_all_tenure=map_auth[region.name]['total_all_tenure'] + map_268[region.name]['total_all_tenure'],
total_area=map_auth[region.name]['total_area'] + map_268[region.name]['total_area']
)
})
key = 'Sub Total (Forest)'
map_auth = [i for i in rpt_map_auth if i.has_key(key)][0]
map_268 = [i for i in rpt_map_268 if i.has_key(key)][0]
rpt_map.append({
key: dict(
pw_tenure=map_auth[key]['pw_tenure'] + map_268[key]['pw_tenure'],
area_pw_tenure=map_auth[key]['area_pw_tenure'] + map_268[key]['area_pw_tenure'],
total_all_tenure=map_auth[key]['total_all_tenure'] + map_268[key]['total_all_tenure'],
total_area=map_auth[key]['total_area'] + map_268[key]['total_area']
)
})
item_map['forest_pw_tenure'] = item_map_auth['forest_pw_tenure'] + item_map_268['forest_pw_tenure']
item_map['forest_area_pw_tenure'] = item_map_auth['forest_area_pw_tenure'] + item_map_268['forest_area_pw_tenure']
item_map['forest_total_all_tenure'] = item_map_auth['forest_total_all_tenure'] + item_map_268['forest_total_all_tenure']
item_map['forest_total_area'] = item_map_auth['forest_total_area'] + item_map_268['forest_total_area']
rpt_map.append(
{'': ''}
)
for region in get_sorted_regions(False):
map_auth = [i for i in rpt_map_auth if i.has_key(region.name)][0]
map_268 = [i for i in rpt_map_268 if i.has_key(region.name)][0]
rpt_map.append({
region.name: dict(
pw_tenure=map_auth[region.name]['pw_tenure'] + map_268[region.name]['pw_tenure'],
area_pw_tenure=map_auth[region.name]['area_pw_tenure'] + map_268[region.name]['area_pw_tenure'],
total_all_tenure=map_auth[region.name]['total_all_tenure'] + map_268[region.name]['total_all_tenure'],
total_area=map_auth[region.name]['total_area'] + map_268[region.name]['total_area']
)
})
key = 'Sub Total (Non Forest)'
map_auth = [i for i in rpt_map_auth if i.has_key(key)][0]
map_268 = [i for i in rpt_map_268 if i.has_key(key)][0]
rpt_map.append({
key: dict(
pw_tenure=map_auth[key]['pw_tenure'] + map_268[key]['pw_tenure'],
area_pw_tenure=map_auth[key]['area_pw_tenure'] + map_268[key]['area_pw_tenure'],
total_all_tenure=map_auth[key]['total_all_tenure'] + map_268[key]['total_all_tenure'],
total_area=map_auth[key]['total_area'] + map_268[key]['total_area']
)
})
item_map['nonforest_total_all_tenure'] = item_map_auth['nonforest_total_all_tenure'] + item_map_268['nonforest_total_all_tenure']
item_map['nonforest_total_area'] = item_map_auth['nonforest_total_area'] + item_map_268['nonforest_total_area']
key = 'GRAND TOTAL'
map_auth = [i for i in rpt_map_auth if i.has_key(key)][0]
map_268 = [i for i in rpt_map_268 if i.has_key(key)][0]
rpt_map.append({
key: dict(
pw_tenure=map_auth[key]['pw_tenure'] + map_268[key]['pw_tenure'],
area_pw_tenure=map_auth[key]['area_pw_tenure'] + map_268[key]['area_pw_tenure'],
total_all_tenure=map_auth[key]['total_all_tenure'] + map_268[key]['total_all_tenure'],
total_area=map_auth[key]['total_area'] + map_268[key]['total_area']
)
})
return rpt_map, item_map
def export_final_csv(self, request, queryset):
writer = unicodecsv.writer(response, quoting=unicodecsv.QUOTE_ALL)
writer.writerow([
"Region",
"DBCA Interest",
"Area DBCA Interest",
"Total All Area",
"Total Area",
])
for row in self.rpt_map:
for region, data in row.iteritems():
writer.writerow([
region,
data['pw_tenure'],
data['area_pw_tenure'],
data['total_all_tenure'],
data['total_area'],
])
return response
def get_excel_sheet(self, rpt_date, book=Workbook()):
# book = Workbook()
sheet1 = book.add_sheet('Ministerial Report')
sheet1 = book.get_sheet('Ministerial Report')
col_no = lambda c=count(): next(c)
row_no = lambda c=count(): next(c)
hdr = sheet1.row(row_no())
hdr.write(0, 'Report Date', style=style_bold_gen)
hdr.write(1, rpt_date.strftime('%d-%b-%Y'))
hdr = sheet1.row(row_no())
hdr.write(0, 'Report', style=style_bold_gen)
hdr.write(1, 'Ministerial Report')
hdr = sheet1.row(row_no())
hdr.write(0, 'Fin Year', style=style_bold_gen)
hdr.write(1, self.reporting_year)
hdr = sheet1.row(row_no())
hdr.write(0, 'Missing Final', style=style_bold_gen)
hdr.write(1, Bushfire.objects.filter(report_status=Bushfire.STATUS_INITIAL_AUTHORISED, reporting_year=self.reporting_year).count() )
hdr = sheet1.row(row_no())
hdr = sheet1.row(row_no())
hdr.write(col_no(), "Region", style=style_bold_gen)
hdr.write(col_no(), "DBCA Interest", style=style_bold_gen)
hdr.write(col_no(), "Area DBCA Interest", style=style_bold_gen)
hdr.write(col_no(), "Total All Tenure", style=style_bold_gen)
hdr.write(col_no(), "Total Area", style=style_bold_gen)
for row in self.rpt_map:
for region, data in row.iteritems():
row = sheet1.row(row_no())
col_no = lambda c=count(): next(c)
if region == '':
#row = sheet1.row(row_no())
continue
elif 'total' in region.lower():
#row = sheet1.row(row_no())
row.write(col_no(), region, style=style_bold_gen)
row.write(col_no(), data['pw_tenure'], style=style_bold_gen)
row.write(col_no(), data['area_pw_tenure'], style=style_bold_area)
row.write(col_no(), data['total_all_tenure'], style=style_bold_gen)
row.write(col_no(), data['total_area'], style=style_bold_area)
else:
row.write(col_no(), region )
row.write(col_no(), data['pw_tenure'], style=style_normal_int)
row.write(col_no(), data['area_pw_tenure'], style=style_normal_area)
row.write(col_no(), data['total_all_tenure'], style=style_normal_int)
row.write(col_no(), data['total_area'], style=style_normal_area)
# DISCLAIMER
col_no = lambda c=count(): next(c)
hdr = sheet1.row(row_no())
hdr = sheet1.row(row_no())
hdr.write(col_no(), DISCLAIMER, style=style_normal)
col_no = lambda c=count(): next(c)
hdr = sheet1.row(row_no())
hdr = sheet1.row(row_no())
hdr.write(col_no(), "See the Ministerial Report (Auth) tab for information re bushfires excluded from the area figures (not from the count figures) above.", style=style_normal)
#book.save("/tmp/foobar.xls")
#return sheet1
def write_excel(self):
rpt_date = datetime.now()
book = Workbook()
self.get_excel_sheet(rpt_date, book)
filename = '/tmp/ministerial_report_{}.xls'.format(rpt_date.strftime('%d-%b-%Y'))
book.save(filename)
def export(self):
""" Executed from the Overview page in BFRS, returns an Excel WB as a HTTP Response object """
rpt_date = datetime.now()
filename = 'ministerial_report_{}.xls'.format(rpt_date.strftime('%d%b%Y'))
response = HttpResponse(content_type='application/vnd.ms-excel')
response['Content-Disposition'] = 'attachment; filename=' + filename
book = Workbook()
self.get_excel_sheet(rpt_date, book)
book.add_sheet('Sheet 2')
book.save(response)
return response
def display(self):
print '{}\t{}\t{}\t{}\t{}'.format('Region', 'DBCA Interest', 'Area DBCA Interest', 'Total All Area', 'Total Area').expandtabs(20)
for row in self.rpt_map:
for region, data in row.iteritems():
print '{}\t{}\t{}\t{}\t{}'.format(region, data['pw_tenure'], data['area_pw_tenure'], data['total_all_tenure'], data['total_area']).expandtabs(20)
def pdflatex(self, request, form_data):
now = timezone.localtime(timezone.now())
#report_date = now.strptime(request.GET.get('date'), '%Y-%m-%d').date()
report_date = now
#template = request.GET.get("template", "pfp")
template = "ministerial_report"
response = HttpResponse(content_type='application/pdf')
filename = template + ".pdf"
timestamp = now.isoformat().rsplit(
".")[0].replace(":", "")
if template == "ministerial_report":
downloadname = "ministerial_report_" + report_date.strftime('%Y-%m-%d') + ".pdf"
else:
downloadname = "ministerial_report_" + template + "_" + report_date.strftime('%Y-%m-%d') + ".pdf"
error_response = HttpResponse(content_type='text/html')
errortxt = downloadname.replace(".pdf", ".errors.txt.html")
error_response['Content-Disposition'] = (
'{0}; filename="{1}"'.format(
"inline", errortxt))
subtitles = {
"ministerial_report": "Ministerial Report",
#"form268a": "268a - Planned Burns",
}
embed = False if request.GET.get("embed") == "false" else True
context = {
'user': request.user.get_full_name(),
'report_date': report_date.strftime('%e %B %Y').strip(),
'time': report_date.strftime('%H:%M'),
'current_finyear': self.reporting_year,
'rpt_map': self.rpt_map,
'item_map': self.item_map,
'form': form_data,
'embed': embed,
'headers': request.GET.get("headers", True),
'title': request.GET.get("title", "Bushfire Reporting System"),
'subtitle': subtitles.get(template, ""),
'timestamp': now,
'downloadname': downloadname,
'settings': settings,
'baseurl': request.build_absolute_uri("/")[:-1]
}
disposition = "attachment"
#disposition = "inline"
response['Content-Disposition'] = (
'{0}; filename="{1}"'.format(
disposition, downloadname))
folder = None
try:
folder,pdf_file = generate_pdf("latex/{}.tex".format(template),context=context,request=request,check_output=False)
with open(pdf_file) as f:
response.write(f.read())
logger.debug("Finally: returning PDF response.")
return response
finally:
if folder:
shutil.rmtree(folder)
class MinisterialReport268():
"""
Report for active 268b bushfires only
"""
def __init__(self,reporting_year=None):
self.reporting_year = current_finyear() if (reporting_year is None or reporting_year >= current_finyear()) else reporting_year
self.rpt_map, self.item_map = self.create()
def get_268_data(self, dbca_initial_control=None):
""" Retrieves the 268b fires from PBS and Aggregates the Area and Number count by region """
qs_regions = get_sorted_regions()
if dbca_initial_control:
# get the fires managed by DBCA
outstanding_fires = list(Bushfire.objects.filter(report_status__in=[Bushfire.STATUS_INITIAL_AUTHORISED], initial_control=Agency.DBCA,reporting_year__lte=self.reporting_year).values_list('fire_number', flat=True))
else:
outstanding_fires = list(Bushfire.objects.filter(report_status__in=[Bushfire.STATUS_INITIAL_AUTHORISED],reporting_year__lte=self.reporting_year).values_list('fire_number', flat=True))
pbs_fires_dict = get_pbs_bushfires(outstanding_fires) or []
if not dbca_initial_control:
self.pbs_fires_dict = pbs_fires_dict
#logger.info("self.pbs_fires_dict: " + str(self.pbs_fires_dict))
self.found_fires = [i['fire_id'] for i in self.pbs_fires_dict]
self.missing_fires = list(set(outstanding_fires).difference(self.found_fires)) # fire_numbers not returned from PB
rpt_map = {}
for i in pbs_fires_dict:
region_id = i['region']
exists = [i for r in qs_regions if r.id==region_id]
if exists:
if rpt_map.has_key(region_id):
rpt_map[region_id]['area'] = rpt_map[region_id]['area'] + float(i['area'])
rpt_map[region_id]['number'] = rpt_map[region_id]['number'] + 1
else:
rpt_map[region_id] = {
'area' : float(i['area']),
'number' : 1
}
else:
raise Exception("PBS Region id({}) Not Found in BFRS".format(region_id))
return rpt_map
def create(self):
# Group By Region
data_268 = self.get_268_data()
data_268_pw = self.get_268_data('DBCA')
rpt_map = []
item_map = {}
net_forest_pw_tenure = 0
net_forest_area_pw_tenure = 0
net_forest_total_all_tenure = 0
net_forest_total_area = 0
for region in get_sorted_regions(True):
if data_268_pw.has_key(region.id):
pw_tenure = data_268_pw[region.id]['number']
area_pw_tenure = data_268_pw[region.id]['area']
else:
pw_tenure = 0
area_pw_tenure = 0.0
if data_268.has_key(region.id):
total_all_tenure = data_268[region.id]['number']
total_area = data_268[region.id]['area']
else:
total_all_tenure = 0
total_area = 0.0
rpt_map.append(
{region.name: dict(pw_tenure=pw_tenure, area_pw_tenure=area_pw_tenure, total_all_tenure=total_all_tenure, total_area=total_area)}
)
net_forest_pw_tenure += pw_tenure
net_forest_area_pw_tenure += area_pw_tenure
net_forest_total_all_tenure += total_all_tenure
net_forest_total_area += total_area
rpt_map.append(
{'Sub Total (Forest)': dict(pw_tenure=net_forest_pw_tenure, area_pw_tenure=net_forest_area_pw_tenure, total_all_tenure=net_forest_total_all_tenure, total_area=net_forest_total_area)}
)
item_map['forest_pw_tenure'] = net_forest_pw_tenure
item_map['forest_area_pw_tenure'] = net_forest_area_pw_tenure
item_map['forest_total_all_tenure'] = net_forest_total_all_tenure
item_map['forest_total_area'] = net_forest_total_area
# add a white space/line between forest and non-forest region tabulated info
rpt_map.append(
{'': ''}
)
net_nonforest_pw_tenure = 0
net_nonforest_area_pw_tenure = 0
net_nonforest_total_all_tenure = 0
net_nonforest_total_area = 0
for region in get_sorted_regions(False):
if data_268_pw.has_key(region.id):
pw_tenure = data_268_pw[region.id]['number']
area_pw_tenure = data_268_pw[region.id]['area']
else:
pw_tenure = 0
area_pw_tenure = 0.0
if data_268.has_key(region.id):
total_all_tenure = data_268[region.id]['number']
total_area = data_268[region.id]['area']
else:
total_all_tenure = 0
total_area = 0.0
rpt_map.append(
{region.name: dict(pw_tenure=pw_tenure, area_pw_tenure=area_pw_tenure, total_all_tenure=total_all_tenure, total_area=total_area)}
)
net_nonforest_pw_tenure += pw_tenure
net_nonforest_area_pw_tenure += area_pw_tenure
net_nonforest_total_all_tenure += total_all_tenure
net_nonforest_total_area += total_area
rpt_map.append(
{'Sub Total (Non Forest)': dict(pw_tenure=net_nonforest_pw_tenure, area_pw_tenure=net_nonforest_area_pw_tenure, total_all_tenure=net_nonforest_total_all_tenure, total_area=net_nonforest_total_area)}
)
item_map['nonforest_total_all_tenure'] = net_nonforest_total_all_tenure
item_map['nonforest_total_area'] = net_nonforest_total_area
rpt_map.append(
{'GRAND TOTAL': dict(
pw_tenure=net_forest_pw_tenure + net_nonforest_pw_tenure,
area_pw_tenure=net_forest_area_pw_tenure + net_nonforest_area_pw_tenure,
total_all_tenure=net_forest_total_all_tenure + net_nonforest_total_all_tenure,
total_area=net_forest_total_area + net_nonforest_total_area
)}
)
return rpt_map, item_map
def get_excel_sheet(self, rpt_date, book=Workbook()):
# book = Workbook()
sheet1 = book.add_sheet('Ministerial Report (268)')
sheet1 = book.get_sheet('Ministerial Report (268)')
col_no = lambda c=count(): next(c)
row_no = lambda c=count(): next(c)
hdr = sheet1.row(row_no())
hdr.write(0, 'Report Date', style=style_bold_gen)
hdr.write(1, rpt_date.strftime('%d-%b-%Y'))
hdr = sheet1.row(row_no())
hdr.write(0, 'Report', style=style_bold_gen)
hdr.write(1, 'Ministerial Report 268')
hdr = sheet1.row(row_no())
hdr.write(0, 'Fin Year', style=style_bold_gen)
hdr.write(1, self.reporting_year)
hdr = sheet1.row(row_no())
hdr.write(0, 'Missing Final', style=style_bold_gen)
hdr.write(1, Bushfire.objects.filter(report_status=Bushfire.STATUS_INITIAL_AUTHORISED, reporting_year=self.reporting_year).count() )
hdr = sheet1.row(row_no())
hdr = sheet1.row(row_no())
hdr.write(col_no(), "Region", style=style_bold_gen)
hdr.write(col_no(), "DBCA Interest", style=style_bold_gen)
hdr.write(col_no(), "Area DBCA Interest", style=style_bold_gen)
hdr.write(col_no(), "Total All Tenure", style=style_bold_gen)
hdr.write(col_no(), "Total Area", style=style_bold_gen)
for row in self.rpt_map:
for region, data in row.iteritems():
row = sheet1.row(row_no())
col_no = lambda c=count(): next(c)
if region == '':
#row = sheet1.row(row_no())
continue
elif 'total' in region.lower():
#row = sheet1.row(row_no())
row.write(col_no(), region, style=style_bold_gen)
row.write(col_no(), data['pw_tenure'], style=style_bold_gen)
row.write(col_no(), data['area_pw_tenure'], style=style_bold_area)
row.write(col_no(), data['total_all_tenure'], style=style_bold_gen)
row.write(col_no(), data['total_area'], style=style_bold_area)
else:
row.write(col_no(), region )
row.write(col_no(), data['pw_tenure'], style=style_normal_int)
row.write(col_no(), data['area_pw_tenure'], style=style_normal_area)
row.write(col_no(), data['total_all_tenure'], style=style_normal_int)
row.write(col_no(), data['total_area'], style=style_normal_area)
# DISCLAIMER
col_no = lambda c=count(): next(c)
hdr = sheet1.row(row_no())
hdr = sheet1.row(row_no())
hdr.write(col_no(), DISCLAIMER, style=style_normal)
col_no = lambda c=count(): next(c)
hdr = sheet1.row(row_no())
hdr = sheet1.row(row_no())
hdr.write(col_no(), "Outstanding Fires (Contributing)", style=style_bold_gen)
hdr.write(col_no(), "Area (ha)", style=style_bold_area)
for data in self.pbs_fires_dict:
row = sheet1.row(row_no())
col_no = lambda c=count(): next(c)
row.write(col_no(), data['fire_id'], style=style_normal)
row.write(col_no(), float(data['area']), style=style_normal_area)
col_no = lambda c=count(): next(c)
hdr = sheet1.row(row_no())
hdr = sheet1.row(row_no())
hdr.write(col_no(), "Outstanding Fires (Non-contributing)", style=style_bold_gen)
for fire_id in self.missing_fires:
row = sheet1.row(row_no())
col_no = lambda c=count(): next(c)
row.write(col_no(), fire_id, style=style_normal)
#book.save("/tmp/foobar.xls")
#return sheet1
def write_excel(self):
rpt_date = datetime.now()
book = Workbook()
self.get_excel_sheet(rpt_date, book)
filename = '/tmp/ministerial_268_report_{}.xls'.format(rpt_date.strftime('%d-%b-%Y'))
book.save(filename)
def export(self):
""" Executed from the Overview page in BFRS, returns an Excel WB as a HTTP Response object """
rpt_date = datetime.now()
filename = 'ministerial_268_report_{}.xls'.format(rpt_date.strftime('%d%b%Y'))
response = HttpResponse(content_type='application/vnd.ms-excel')
response['Content-Disposition'] = 'attachment; filename=' + filename
book = Workbook()
self.get_excel_sheet(rpt_date, book)
book.add_sheet('Sheet 2')
book.save(response)
return response
class MinisterialReportAuth():
"""
Report for Authorised fires Only
"""
def __init__(self, reporting_year=None, overlap_ids=[]):
self.reporting_year = current_finyear() if (reporting_year is None or reporting_year >= current_finyear()) else reporting_year
self.overlap_ids = overlap_ids
self.rpt_map, self.item_map, self.excluded_bf_info = self.create()
def create(self):
rpt_map = []
item_map = {}
net_forest_pw_tenure = 0
net_forest_area_pw_tenure = 0
net_forest_total_all_area = 0
net_forest_total_area = 0
excluded_bfs_general_info = {}
excluded_bfs_region_info = {}
excluded_bfs_tenure_info = {}
count_sql = """
SELECT r.region_id,count(*)
FROM
((SELECT a.region_id,a.id
FROM reporting_bushfire a JOIN bfrs_tenure t ON a.tenure_id = t.id
WHERE a.report_status IN {report_statuses} AND a.reporting_year={reporting_year} AND a.fire_not_found=false {{agency_condition}}
)
UNION
(SELECT b.region_id,b.id
FROM reporting_bushfire b JOIN reporting_bushfire c ON b.valid_bushfire_id = c.id AND c.report_status IN {report_statuses} AND c.reporting_year={reporting_year} AND c.fire_not_found=false JOIN bfrs_tenure t ON b.tenure_id = t.id
WHERE b.report_status = {status_merged} {{agency_condition}}
)) as r
group by r.region_id
""".format(
report_statuses="({})".format(",".join([str(i) for i in [Bushfire.STATUS_FINAL_AUTHORISED,Bushfire.STATUS_REVIEWED]])),
reporting_year = self.reporting_year,
status_merged = Bushfire.STATUS_MERGED
)
area_sql = """
SELECT bf.region_id, SUM(ab.area) AS total_all_regions_area, SUM(bf.area) AS total_area
FROM reporting_bushfire bf JOIN reporting_areaburnt ab ON bf.id = ab.bushfire_id JOIN bfrs_tenure t ON ab.tenure_id = t.id
WHERE bf.report_status IN {report_statuses} AND bf.reporting_year={reporting_year} AND bf.fire_not_found=false AND t.report_group='ALL REGIONS' {{agency_condition}}
GROUP BY bf.region_id
""".format(
report_statuses="({})".format(",".join([str(i) for i in [Bushfire.STATUS_FINAL_AUTHORISED, Bushfire.STATUS_REVIEWED]])),
reporting_year = self.reporting_year
)
dbca_count_data = {}
total_count_data = {}
dbca_area_data = {}
total_area_data = {}
with connection.cursor() as cursor:
sql = count_sql.format(agency_condition = "AND t.dbca_interest IS TRUE")
cursor.execute(sql)
for result in cursor.fetchall():
dbca_count_data[result[0]] = result[1] or 0
sql = count_sql.format(agency_condition = "")
cursor.execute(sql)
for result in cursor.fetchall():
total_count_data[result[0]] = result[1] or 0
sql = area_sql.format(agency_condition = "AND t.dbca_interest IS TRUE")
cursor.execute(sql)
for result in cursor.fetchall():
dbca_area_data[result[0]] = result[1] or 0
sql = area_sql.format(agency_condition = "")
logger.info("sql: " + sql)
cursor.execute(sql)
for result in cursor.fetchall():
total_area_data[result[0]] = result[1] or 0
logger.info("total_area_data: " + str(total_area_data))
for region in get_sorted_regions(True):
pw_tenure = dbca_count_data.get(region.id, 0)
area_pw_tenure = round(dbca_area_data.get(region.id, 0), 2)
total_all_area = total_count_data.get(region.id, 0)
total_area = round(total_area_data.get(region.id, 0), 2)
rpt_map.append(
{region.name: dict(pw_tenure=pw_tenure, area_pw_tenure=area_pw_tenure, total_all_tenure=total_all_area, total_area=total_area)}
)
net_forest_pw_tenure += pw_tenure
net_forest_area_pw_tenure += area_pw_tenure
net_forest_total_all_area += total_all_area
net_forest_total_area += total_area
rpt_map.append(
{'Sub Total (Forest)': dict(pw_tenure=net_forest_pw_tenure, area_pw_tenure=net_forest_area_pw_tenure, total_all_tenure=net_forest_total_all_area, total_area=net_forest_total_area)}
)
item_map['forest_pw_tenure'] = net_forest_pw_tenure
item_map['forest_area_pw_tenure'] = net_forest_area_pw_tenure
item_map['forest_total_all_tenure'] = net_forest_total_all_area
item_map['forest_total_area'] = net_forest_total_area
# add a white space/line between forest and non-forest region tabulated info
rpt_map.append(
{'': ''}
)
net_nonforest_pw_tenure = 0
net_nonforest_area_pw_tenure = 0
net_nonforest_total_all_area = 0
net_nonforest_total_area = 0
for region in get_sorted_regions(False):
pw_tenure = dbca_count_data.get(region.id,0)
area_pw_tenure = round(dbca_area_data.get(region.id,0), 2)
total_all_area = total_count_data.get(region.id,0)
total_area = round(total_area_data.get(region.id,0), 2)
rpt_map.append(
{region.name: dict(pw_tenure=pw_tenure, area_pw_tenure=area_pw_tenure, total_all_tenure=total_all_area, total_area=total_area)}
)
net_nonforest_pw_tenure += pw_tenure
net_nonforest_area_pw_tenure += area_pw_tenure
net_nonforest_total_all_area += total_all_area
net_nonforest_total_area += total_area
rpt_map.append(
{'Sub Total (Non Forest)': dict(pw_tenure=net_nonforest_pw_tenure, area_pw_tenure=net_nonforest_area_pw_tenure, total_all_tenure=net_nonforest_total_all_area, total_area=net_nonforest_total_area)}
)
item_map['nonforest_total_all_tenure'] = net_nonforest_total_all_area
item_map['nonforest_total_area'] = net_nonforest_total_area
rpt_map.append(
{'GRAND TOTAL': dict(
pw_tenure=net_forest_pw_tenure + net_nonforest_pw_tenure,
area_pw_tenure=net_forest_area_pw_tenure + net_nonforest_area_pw_tenure,
total_all_tenure=net_forest_total_all_area + net_nonforest_total_all_area,
total_area=net_forest_total_area + net_nonforest_total_area
)}
)
# Excluded bushfires
excluded_bf_info = {
"general": excluded_bfs_general_info,
"region_info": excluded_bfs_region_info,
"tenure_info": excluded_bfs_tenure_info
}
return rpt_map, item_map, excluded_bf_info
def export_final_csv(self, request, queryset):
writer = unicodecsv.writer(response, quoting=unicodecsv.QUOTE_ALL)
writer.writerow([
"Region",
"DBCA Interest",
"Area DBCA Interest",
"Total All Area",
"Total Area",
])
for row in self.rpt_map:
for region, data in row.iteritems():
writer.writerow([
region,
data['pw_tenure'],
data['area_pw_tenure'],
data['total_all_tenure'],
data['total_area'],
])
return response
def get_excel_sheet(self, rpt_date, book=Workbook()):
# book = Workbook()
sheet1 = book.add_sheet('Ministerial Report (Auth)')
sheet1 = book.get_sheet('Ministerial Report (Auth)')
col_no = lambda c=count(): next(c)
row_no = lambda c=count(): next(c)
hdr = sheet1.row(row_no())
hdr.write(0, 'Report Date', style=style_bold_gen)
hdr.write(1, rpt_date.strftime('%d-%b-%Y'))
hdr = sheet1.row(row_no())
hdr.write(0, 'Report', style=style_bold_gen)
hdr.write(1, 'Ministerial Report (Authorised)')
hdr = sheet1.row(row_no())
hdr.write(0, 'Fin Year', style=style_bold_gen)
hdr.write(1, self.reporting_year)
hdr = sheet1.row(row_no())
hdr.write(0, 'Missing Final', style=style_bold_gen)
hdr.write(1, Bushfire.objects.filter(report_status=Bushfire.STATUS_INITIAL_AUTHORISED, reporting_year=self.reporting_year).count() )
hdr = sheet1.row(row_no())
hdr = sheet1.row(row_no())
hdr.write(col_no(), "Region", style=style_bold_gen)
hdr.write(col_no(), "DBCA Interest", style=style_bold_gen)
hdr.write(col_no(), "Area DBCA Interest", style=style_bold_gen)
hdr.write(col_no(), "Total All Tenure", style=style_bold_gen)
hdr.write(col_no(), "Total Area", style=style_bold_gen)
for row in self.rpt_map:
for region, data in row.iteritems():
row = sheet1.row(row_no())
col_no = lambda c=count(): next(c)
if region == '':
#row = sheet1.row(row_no())
continue
elif 'total' in region.lower():
#row = sheet1.row(row_no())
row.write(col_no(), region, style=style_bold_gen)
row.write(col_no(), data['pw_tenure'], style=style_bold_gen)
row.write(col_no(), data['area_pw_tenure'], style=style_bold_area)
row.write(col_no(), data['total_all_tenure'], style=style_bold_gen)
row.write(col_no(), data['total_area'], style=style_bold_area)
else:
row.write(col_no(), region )
row.write(col_no(), data['pw_tenure'], style=style_normal_int)
row.write(col_no(), data['area_pw_tenure'], style=style_normal_area)
row.write(col_no(), data['total_all_tenure'], style=style_normal_int)
row.write(col_no(), data['total_area'], style=style_normal_area)
# DISCLAIMER
col_no = lambda c=count(): next(c)
hdr = sheet1.row(row_no())
hdr = sheet1.row(row_no())
hdr.write(col_no(), DISCLAIMER, style=style_normal)
def write_excel(self):
rpt_date = datetime.now()
book = Workbook()
self.get_excel_sheet(rpt_date, book)
filename = '/tmp/ministerial_auth_report_{}.xls'.format(rpt_date.strftime('%d-%b-%Y'))
book.save(filename)
def export(self):
""" Executed from the Overview page in BFRS, returns an Excel WB as a HTTP Response object """
rpt_date = datetime.now()
filename = 'ministerial_auth_report_{}.xls'.format(rpt_date.strftime('%d%b%Y'))
response = HttpResponse(content_type='application/vnd.ms-excel')
response['Content-Disposition'] = 'attachment; filename=' + filename
book = Workbook()
self.get_excel_sheet(rpt_date, book)
book.add_sheet('Sheet 2')
book.save(response)
return response
def display(self):
print '{}\t{}\t{}\t{}\t{}'.format('Region', 'DBCA Interest', 'Area DBCA Interest', 'Total All Area', 'Total Area').expandtabs(20)
for row in self.rpt_map:
for region, data in row.iteritems():
print '{}\t{}\t{}\t{}\t{}'.format(region, data['pw_tenure'], data['area_pw_tenure'], data['total_all_tenure'], data['total_area']).expandtabs(20)
def pdflatex(self, request, form_data):
now = timezone.localtime(timezone.now())
report_date = now
template = "ministerial_auth_report"
response = HttpResponse(content_type='application/pdf')
filename = template + ".pdf"
timestamp = now.isoformat().rsplit(
".")[0].replace(":", "")
if template == "ministerial_auth_report":
downloadname = "ministerial_auth_report_" + report_date.strftime('%Y-%m-%d') + ".pdf"
else:
downloadname = "ministerial_auth_report_" + template + "_" + report_date.strftime('%Y-%m-%d') + ".pdf"
error_response = HttpResponse(content_type='text/html')
errortxt = downloadname.replace(".pdf", ".errors.txt.html")
error_response['Content-Disposition'] = (
'{0}; filename="{1}"'.format(
"inline", errortxt))
subtitles = {
"ministerial_report": "Ministerial Report",
#"form268a": "268a - Planned Burns",
}
embed = False if request.GET.get("embed") == "false" else True
context = {
'user': request.user.get_full_name(),
'report_date': report_date.strftime('%e %B %Y').strip(),
'time': report_date.strftime('%H:%M'),
'current_finyear': self.reporting_year,
'rpt_map': self.rpt_map,
'item_map': self.item_map,
'form': form_data,
'embed': embed,
'headers': request.GET.get("headers", True),
'title': request.GET.get("title", "Bushfire Reporting System"),
'subtitle': subtitles.get(template, ""),
'timestamp': now,
'downloadname': downloadname,
'settings': settings,
'baseurl': request.build_absolute_uri("/")[:-1]
}
disposition = "attachment"
#disposition = "inline"
response['Content-Disposition'] = (
'{0}; filename="{1}"'.format(
disposition, downloadname))
folder = None
try:
folder,pdf_file = generate_pdf("latex/{}.tex".format(template),context=context,request=request,check_output=False)
with open(pdf_file) as f:
response.write(f.read())
logger.debug("Finally: returning PDF response.")
return response
finally:
if folder:
shutil.rmtree(folder)
class QuarterlyReport():
def __init__(self, reporting_year=None, overlap_ids=[]):
self.reporting_year = current_finyear() if (reporting_year is None or reporting_year >= current_finyear()) else reporting_year
self.overlap_ids = overlap_ids
self.rpt_map, self.item_map = self.create()
#logger.info("overlap_ids: " + str(overlap_ids))
def create(self):
"""
To Test:
from bfrs.reports import QuarterlyReport
q=QuarterlyReport()
q.display()
"""
rpt_map = []
item_map = {}
count_sql = """
SELECT COUNT(*)
FROM
((SELECT bf1.region_id, bf1.id
FROM reporting_bushfire bf1 JOIN bfrs_region r ON bf1.region_id = r.id AND r.forest_region = {{forest_region}} JOIN bfrs_tenure t ON bf1.tenure_id = t.id
WHERE bf1.report_status IN {report_statuses} AND bf1.reporting_year = {reporting_year} AND bf1.fire_not_found=False {{agency_condition}}
)
UNION
(SELECT bf2.region_id, bf2.id
FROM reporting_bushfire bf2
JOIN bfrs_region r2 ON bf2.region_id = r2.id AND r2.forest_region = {{forest_region}}
JOIN reporting_bushfire bf3 ON bf2.valid_bushfire_id = bf3.id AND bf3.report_status IN {report_statuses} AND bf3.reporting_year = {reporting_year} AND bf3.fire_not_found=false
JOIN bfrs_tenure t ON bf2.tenure_id = t.id
WHERE bf2.report_status = {status_merged} {{agency_condition}}
)) AS x
""".format(
report_statuses="({})".format(",".join([str(i) for i in [Bushfire.STATUS_FINAL_AUTHORISED,Bushfire.STATUS_REVIEWED]])),
reporting_year = self.reporting_year,
status_merged = Bushfire.STATUS_MERGED
)
area_sql = """
SELECT SUM(ab.area) AS total_all_regions_area, SUM(bf.area) AS total_area
FROM reporting_bushfire bf JOIN bfrs_region r ON bf.region_id = r.id JOIN reporting_areaburnt ab ON bf.id = ab.bushfire_id JOIN bfrs_tenure t ON ab.tenure_id = t.id
WHERE bf.report_status IN {report_statuses} AND bf.reporting_year = {reporting_year} AND bf.fire_not_found=False AND r.forest_region = {{forest_region}} {{agency_condition}} AND t.report_group = 'ALL REGIONS'
""".format(
report_statuses="({})".format(",".join([str(i) for i in [Bushfire.STATUS_FINAL_AUTHORISED,Bushfire.STATUS_REVIEWED]])),
reporting_year = self.reporting_year
)
with connection.cursor() as cursor:
cursor.execute(count_sql.format(
forest_region = 'true',
agency_condition = "AND t.dbca_interest IS TRUE"
))
result = cursor.fetchone()
forest_pw_tenure = result[0] or 0
logger.info("Quarterly: forest region + DBCA interest count complete")
cursor.execute(area_sql.format(
forest_region = 'true',
agency_condition = "AND t.dbca_interest IS TRUE"
))
result = cursor.fetchone()
forest_area_pw_tenure = result[0] or 0
logger.info("Quarterly: forest region + DBCA interest area complete")
cursor.execute(count_sql.format(
forest_region = 'true',
agency_condition = "AND t.dbca_interest IS NOT TRUE"
))
result = cursor.fetchone()
forest_non_pw_tenure = result[0] or 0
logger.info("Quarterly: forest region + Non DBCA interest count complete")
cursor.execute(area_sql.format(
forest_region = 'true',
agency_condition = "AND t.dbca_interest IS NOT TRUE"
))
result = cursor.fetchone()
forest_area_non_pw_tenure = result[0] or 0
logger.info("Quarterly: forest region + Non DBCA interest area complete")
forest_tenure_total = forest_pw_tenure + forest_non_pw_tenure
forest_area_total = forest_area_pw_tenure + forest_area_non_pw_tenure
rpt_map.append(
{'Forest Regions': dict(
pw_tenure=forest_pw_tenure, area_pw_tenure=forest_area_pw_tenure,
non_pw_tenure=forest_non_pw_tenure, area_non_pw_tenure=forest_area_non_pw_tenure,
total_all_tenure=forest_tenure_total, total_area=forest_area_total
)}
)
cursor.execute(count_sql.format(
forest_region = 'false',
agency_condition = "AND t.dbca_interest IS TRUE"
))
result = cursor.fetchone()
nonforest_pw_tenure = result[0] or 0
logger.info("Quarterly: Non forest region + DBCA interest count complete")
cursor.execute(area_sql.format(
forest_region = 'false',
agency_condition = "AND t.dbca_interest IS TRUE"
))
result = cursor.fetchone()
nonforest_area_pw_tenure = result[0] or 0
logger.info("Quarterly: Non forest region + DBCA interest area complete")
cursor.execute(count_sql.format(
forest_region = 'false',
agency_condition = "AND t.dbca_interest IS NOT TRUE"
))
result = cursor.fetchone()
nonforest_non_pw_tenure = result[0] or 0
logger.info("Quarterly: Non forest region + non DBCA interest count complete")
cursor.execute(area_sql.format(
forest_region = 'false',
agency_condition = "AND t.dbca_interest IS NOT TRUE"
))
result = cursor.fetchone()
nonforest_area_non_pw_tenure = result[0] or 0
logger.info("Quarterly: Non forest region + Non DBCA interest area complete")
nonforest_tenure_total = nonforest_pw_tenure + nonforest_non_pw_tenure
nonforest_area_total = nonforest_area_pw_tenure + nonforest_area_non_pw_tenure
rpt_map.append(
{'Non Forest Regions': dict(
pw_tenure=nonforest_pw_tenure, area_pw_tenure=nonforest_area_pw_tenure,
non_pw_tenure=nonforest_non_pw_tenure, area_non_pw_tenure=nonforest_area_non_pw_tenure,
total_all_tenure=nonforest_tenure_total, total_area=nonforest_area_total
)}
)
rpt_map.append(
{'TOTAL': dict(
pw_tenure=forest_pw_tenure + nonforest_pw_tenure, area_pw_tenure=forest_area_pw_tenure + nonforest_area_pw_tenure,
non_pw_tenure=forest_non_pw_tenure + nonforest_non_pw_tenure, area_non_pw_tenure=forest_area_non_pw_tenure + nonforest_area_non_pw_tenure,
total_all_tenure=forest_tenure_total + nonforest_tenure_total, total_area=forest_area_total + nonforest_area_total
)}
)
logger.info("Quarterly: create complete")
return rpt_map, item_map
def escape_burns(self):
#return Bushfire.objects.filter(report_status__gte=Bushfire.STATUS_FINAL_AUTHORISED, reporting_year=self.reporting_year, cause__name__icontains='escape')
#return Bushfire.objects.filter(authorised_by__isnull=False, reporting_year=self.reporting_year, cause__name__icontains='escape').exclude(report_status=Bushfire.STATUS_INVALIDATED)
return Bushfire.objects.filter(report_status__in=[Bushfire.STATUS_FINAL_AUTHORISED,Bushfire.STATUS_REVIEWED], reporting_year=self.reporting_year,fire_not_found=False, cause__name__icontains='escape')
def get_excel_sheet(self, rpt_date, book=Workbook()):
# book = Workbook()
sheet1 = book.add_sheet('Quarterly Report')
sheet1 = book.get_sheet('Quarterly Report')
col_no = lambda c=count(): next(c)
row_no = lambda c=count(): next(c)
hdr = sheet1.row(row_no())
hdr.write(0, 'Report Date', style=style_bold_gen)
hdr.write(1, rpt_date.strftime('%d-%b-%Y'))
hdr = sheet1.row(row_no())
hdr.write(0, 'Report', style=style_bold_gen)
hdr.write(1, 'Quarterly Report')
hdr = sheet1.row(row_no())
hdr.write(0, 'Fin Year', style=style_bold_gen)
hdr.write(1, self.reporting_year)
hdr = sheet1.row(row_no())
hdr.write(0, 'Missing Final', style=style_bold_gen)
hdr.write(1, Bushfire.objects.filter(report_status=Bushfire.STATUS_INITIAL_AUTHORISED, reporting_year=self.reporting_year).count() )
hdr = sheet1.row(row_no())
hdr = sheet1.row(row_no())
hdr.write(col_no(), "Region", style=style_bold_gen)
hdr.write(col_no(), "DBCA Interest", style=style_bold_gen)
hdr.write(col_no(), "Area DBCA Interest", style=style_bold_gen)
hdr.write(col_no(), "Non DBCA Interest", style=style_bold_gen)
hdr.write(col_no(), "Area Non DBCA Interest", style=style_bold_gen)
hdr.write(col_no(), "Total All Tenure", style=style_bold_gen)
hdr.write(col_no(), "Total Area", style=style_bold_gen)
for row in self.rpt_map:
for region, data in row.iteritems():
row = sheet1.row(row_no())
col_no = lambda c=count(): next(c)
if region == '':
#row = sheet1.row(row_no())
continue
elif 'total' in region.lower():
#row = sheet1.row(row_no())
row.write(col_no(), region, style=style_bold_gen)
row.write(col_no(), data['pw_tenure'], style=style_bold_gen)
row.write(col_no(), data['area_pw_tenure'], style=style_bold_area)
row.write(col_no(), data['non_pw_tenure'], style=style_bold_gen)
row.write(col_no(), data['area_non_pw_tenure'], style=style_bold_area)
row.write(col_no(), data['total_all_tenure'], style=style_bold_gen)
row.write(col_no(), data['total_area'], style=style_bold_area)
else:
row.write(col_no(), region )
row.write(col_no(), data['pw_tenure'], style=style_normal)
row.write(col_no(), data['area_pw_tenure'], style=style_normal_area)
row.write(col_no(), data['non_pw_tenure'], style=style_normal)
row.write(col_no(), data['area_non_pw_tenure'], style=style_normal_area)
row.write(col_no(), data['total_all_tenure'], style=style_normal)
row.write(col_no(), data['total_area'], style=style_normal_area)
# DISCLAIMER
col_no = lambda c=count(): next(c)
hdr = sheet1.row(row_no())
hdr = sheet1.row(row_no())
hdr.write(col_no(), DISCLAIMER, style=style_normal)
escape_burns = self.escape_burns()
hdr = sheet1.row(row_no())
hdr = sheet1.row(row_no())
hdr.write(0, 'Escape Fires', style=style_bold_gen)
hdr.write(1, escape_burns.count() )
col_no = lambda c=count(): next(c)
hdr = sheet1.row(row_no())
hdr.write(col_no(), "Bushfire Number", style=style_bold_gen)
hdr.write(col_no(), "Name", style=style_bold_gen)
hdr.write(col_no(), "Cause", style=style_bold_gen)
hdr.write(col_no(), "Prescribed Burn ID", style=style_bold_gen)
for bushfire in escape_burns:
row = sheet1.row(row_no())
col_no = lambda c=count(): next(c)
row.write(col_no(), bushfire.fire_number)
row.write(col_no(), bushfire.name)
row.write(col_no(), bushfire.cause.report_name)
row.write(col_no(), bushfire.prescribed_burn_id)
def write_excel(self):
rpt_date = datetime.now()
book = Workbook()
self.get_excel_sheet(rpt_date, book)
filename = '/tmp/quarterly_report_{}.xls'.format(rpt_date.strftime('%d-%b-%Y'))
book.save(filename)
def export(self):
""" Executed from the Overview page in BFRS, returns an Excel WB as a HTTP Response object """
rpt_date = datetime.now()
filename = 'quarterly_report_{}.xls'.format(rpt_date.strftime('%d%b%Y'))
response = HttpResponse(content_type='application/vnd.ms-excel')
response['Content-Disposition'] = 'attachment; filename=' + filename
book = Workbook()
self.get_excel_sheet(rpt_date, book)
book.add_sheet('Sheet 2')
book.save(response)
return response
def display(self):
print '{}\t{}\t{}\t{}\t{}\t{}\t{}'.format('Region', 'DBCA Interest', 'Area DBCA Interest', 'Non DBCA Interest', 'Area Non DBCA Interest', 'Total All Area', 'Total Area').expandtabs(20)
for row in self.rpt_map:
for region, data in row.iteritems():
if region and data:
print '{}\t{}\t{}\t{}\t{}\t{}\t{}'.format(region, data['pw_tenure'], data['area_pw_tenure'], data['non_pw_tenure'], data['area_non_pw_tenure'], data['total_all_tenure'], data['total_area']).expandtabs(20)
else:
print
class BushfireByTenureReport():
def __init__(self,reporting_year=None):
self.reporting_year = current_finyear() if (reporting_year is None or reporting_year >= current_finyear()) else reporting_year
self.rpt_map, self.item_map, self.other_report_group_fires_info = self.create()
logger.info("Starting BushfireByTenureReport")
def create(self):
# Group By Region
#qs = Bushfire.objects.filter(report_status__gte=Bushfire.STATUS_FINAL_AUTHORISED)
report_group_sql = """
SELECT DISTINCT report_group, report_group_order FROM bfrs_tenure WHERE report_group_order > 0 ORDER BY report_group_order
"""
report_name_sql = """
SELECT DISTINCT report_name, report_order FROM bfrs_tenure WHERE report_group = '{report_group}' ORDER BY report_order
"""
count_sql = """
SELECT b.report_name, count(*)
FROM (
(SELECT
a1.tenure_id,
a1.fire_number
FROM reporting_bushfire a1
WHERE a1.report_status IN {report_statuses} AND a1.reporting_year = {{year}} AND a1.fire_not_found = false
)
UNION
(SELECT
b1.tenure_id,
b1.fire_number
FROM reporting_bushfire b1
JOIN reporting_bushfire b2 ON b1.valid_bushfire_id = b2.id AND b2.report_status IN {report_statuses} AND b2.reporting_year = {{year}} AND b2.fire_not_found = false
WHERE b1.report_status = {status_merged}
)
) a JOIN bfrs_tenure b ON a.tenure_id = b.id
WHERE b.report_group='{{report_group}}'
GROUP BY b.report_name,b.report_order
ORDER BY b.report_order
""".format(
report_statuses="({})".format(",".join([str(i) for i in [Bushfire.STATUS_FINAL_AUTHORISED, Bushfire.STATUS_REVIEWED]])),
status_merged = Bushfire.STATUS_MERGED
)
area_sql = """
SELECT t.report_name, SUM(ab.area) AS area
FROM reporting_bushfire bf JOIN reporting_areaburnt ab ON bf.id = ab.bushfire_id JOIN bfrs_tenure t ON ab.tenure_id = t.id
WHERE bf.report_status IN {report_statuses} AND bf.reporting_year = {{year}} AND bf.fire_not_found = false AND t.report_group = '{{report_group}}'
GROUP BY t.report_name, t.report_order
""".format(
report_statuses="({})".format(",".join([str(i) for i in [Bushfire.STATUS_FINAL_AUTHORISED,Bushfire.STATUS_REVIEWED]]))
)
other_report_group_sql = """
SELECT bf.id, bf.name, bf.fire_number, r.name
FROM reporting_bushfire bf JOIN reporting_areaburnt ab ON bf.id = ab.bushfire_id JOIN bfrs_region r ON bf.region_id = r.id
WHERE ab.tenure_id = 20 AND bf.report_status in {report_statuses} AND bf.reporting_year = {year} AND bf.fire_not_found = false AND ab.area >= 1;
""".format(
report_statuses="({})".format(",".join([str(i) for i in [Bushfire.STATUS_FINAL_AUTHORISED,Bushfire.STATUS_REVIEWED]])),
year = self.reporting_year
)
rpt_map = []
report_groups = []
with connection.cursor() as cursor:
cursor.execute(report_group_sql)
for result in cursor.fetchall():
report_groups.append(result[0])
for report_group in report_groups:
counts = []
areas = []
rpt_group_map = []
rpt_map.append((report_group, rpt_group_map))
for y in (self.reporting_year - 2, self.reporting_year - 1, self.reporting_year):
year_counts = {"total":0}
counts.append(year_counts)
cursor.execute(count_sql.format(year=y, report_group=report_group))
for result in cursor.fetchall():
year_counts[result[0]] = result[1] or 0
year_counts["total"] += result[1] or 0
year_areas = {"total":0}
areas.append(year_areas)
cursor.execute(area_sql.format(year=y, report_group=report_group))
for result in cursor.fetchall():
year_areas[result[0]] = result[1] or 0
year_areas["total"] += result[1] or 0
cursor.execute(report_name_sql.format(report_group=report_group))
for result in cursor.fetchall():
report_name = result[0]
rpt_group_map.append(
{report_name: dict(
count2=counts[0].get(report_name,0),
count1=counts[1].get(report_name,0),
count0=counts[2].get(report_name,0),
area2=areas[0].get(report_name,0),
area1=areas[1].get(report_name,0),
area0=areas[2].get(report_name,0)
)}
)
rpt_group_map.append(
{'Total': dict(
count2=counts[0].get("total",0),
count1=counts[1].get("total",0),
count0=counts[2].get("total",0),
area2=areas[0].get("total",0),
area1=areas[1].get("total",0),
area0=areas[2].get("total",0)
)}
)
# 'Other' report group polys >= 1 ha
other_report_group_fires_info = {}
cursor.execute(other_report_group_sql)
for result in cursor.fetchall():
other_report_group_fires_info[result[0]] = (result[1], result[2], result[3])
logger.info("BushfireByTenureReport create complete")
return rpt_map, None, other_report_group_fires_info
def get_excel_sheet(self, rpt_date, book=Workbook()):
year0 = str(self.reporting_year) + '/' + str(self.reporting_year+1)
year1 = str(self.reporting_year-1) + '/' + str(self.reporting_year)
year2 = str(self.reporting_year-2) + '/' + str(self.reporting_year-1)
# book = Workbook()
sheet1 = book.add_sheet('Bushfire By Tenure Report')
sheet1 = book.get_sheet('Bushfire By Tenure Report')
# # font BOLD
# style = XFStyle()
# font = Font()
# font.bold = True
# style.font = font
#
# # font BOLD and Center Aligned
# style_center = XFStyle()
# font = Font()
# font.bold = True
# style_center.font = font
# style_center.alignment.horz = Alignment.HORZ_CENTER
row_no = lambda c=count(): next(c)
hdr = sheet1.row(row_no())
hdr.write(0, 'Report Date', style=style_bold_gen)
hdr.write(1, rpt_date.strftime('%d-%b-%Y'))
hdr = sheet1.row(row_no())
hdr.write(0, 'Report', style=style_bold_gen)
hdr.write(1, 'Bushfire By Tenure Report')
hdr = sheet1.row(row_no())
hdr.write(0, 'Fin Year', style=style_bold_gen)
hdr.write(1, self.reporting_year)
hdr = sheet1.row(row_no())
hdr.write(0, 'Missing Final', style=style_bold_gen)
hdr.write(1, Bushfire.objects.filter(report_status=Bushfire.STATUS_INITIAL_AUTHORISED, reporting_year=self.reporting_year).count() )
for report_group, rpt_group_map in self.rpt_map:
hdr = sheet1.row(row_no())
hdr = sheet1.row(row_no())
row = row_no()
sheet1.write_merge(row, row, 1, 3, "Number", style_bold)
sheet1.write_merge(row, row, 4, 6, "Area (ha)", style_bold)
hdr = sheet1.row(row_no())
col_no = lambda c=count(): next(c)
hdr.write(col_no(), report_group, style=style_bold_gen)
hdr.write(col_no(), year2, style=style_bold_gen)
hdr.write(col_no(), year1, style=style_bold_gen)
hdr.write(col_no(), year0, style=style_bold_gen)
hdr.write(col_no(), year2, style=style_bold_gen)
hdr.write(col_no(), year1, style=style_bold_gen)
hdr.write(col_no(), year0, style=style_bold_gen)
for row in rpt_group_map:
for tenure, data in row.iteritems():
row = sheet1.row(row_no())
col_no = lambda c=count(): next(c)
if tenure == '':
#row = sheet1.row(row_no())
continue
elif 'total' in tenure.lower():
#row = sheet1.row(row_no())
row.write(col_no(), tenure, style=style_bold_gen)
row.write(col_no(), data['count2'] if data['count2'] > 0 else '', style=style_bold_gen)
row.write(col_no(), data['count1'] if data['count1'] > 0 else '', style=style_bold_gen)
row.write(col_no(), data['count0'], style=style_bold_gen)
row.write(col_no(), data['area2'] if data['area2'] > 0 else '', style=style_bold_area)
row.write(col_no(), data['area1'] if data['area1'] > 0 else '', style=style_bold_area)
row.write(col_no(), data['area0'], style=style_bold_area)
else:
row.write(col_no(), tenure, style=style_normal )
row.write(col_no(), data['count2'] if data['count2'] > 0 else '', style=style_normal_int)
row.write(col_no(), data['count1'] if data['count1'] > 0 else '', style=style_normal_int)
row.write(col_no(), data['count0'], style=style_normal_int)
row.write(col_no(), data['area2'] if data['area2'] > 0 else '', style=style_normal_area)
row.write(col_no(), data['area1'] if data['area1'] > 0 else '', style=style_normal_area)
row.write(col_no(), data['area0'], style=style_normal_area)
# DISCLAIMER
col_no = lambda c=count(): next(c)
hdr = sheet1.row(row_no())
hdr = sheet1.row(row_no())
hdr.write(col_no(), DISCLAIMER, style=style_normal)
# 'OTHER' REPORT GROUP FIRES
if len(self.other_report_group_fires_info) > 0:
col_no = lambda c=count(): next(c)
hdr = sheet1.row(row_no())
hdr = sheet1.row(row_no())
note = "The following fires have a tenure component which comes under the 'OTHER' category and have an area >= 1 ha. It is likely they extend into SA or the NT and may need a manual check."
hdr.write(col_no(), note, style=style_normal)
col_no = lambda c=count(): next(c)
hdr = sheet1.row(row_no())
hdr.write(col_no(), "ID", style=style_bold_int)
hdr.write(col_no(), "Name", style=style_bold_int)
hdr.write(col_no(), "Fire Number", style=style_bold_int)
hdr.write(col_no(), "Designated region", style=style_bold_int)
for fire in self.other_report_group_fires_info:
row = sheet1.row(row_no())
col_no = lambda c=count(): next(c)
row.write(col_no(), str(fire), style = style_normal )
row.write(col_no(), self.other_report_group_fires_info[fire][0], style = style_normal )
row.write(col_no(), self.other_report_group_fires_info[fire][1], style = style_normal )
row.write(col_no(), self.other_report_group_fires_info[fire][2], style = style_normal )
def write_excel(self):
rpt_date = datetime.now()
book = Workbook()
self.get_excel_sheet(rpt_date, book)
filename = '/tmp/bushfire_by_tenure_report_{}.xls'.format(rpt_date.strftime('%d-%b-%Y'))
book.save(filename)
def export(self):
""" Executed from the Overview page in BFRS, returns an Excel WB as a HTTP Response object """
rpt_date = datetime.now()
filename = 'bushfire_by_tenure_report_{}.xls'.format(rpt_date.strftime('%d%b%Y'))
response = HttpResponse(content_type='application/vnd.ms-excel')
response['Content-Disposition'] = 'attachment; filename=' + filename
book = Workbook()
self.get_excel_sheet(rpt_date, book)
book.add_sheet('Sheet 2')
book.save(response)
return response
def display(self):
year0 = str(self.reporting_year-1) + '/' + str(self.reporting_year)
year1 = str(self.reporting_year-2) + '/' + str(self.reporting_year-1)
year2 = str(self.reporting_year-3) + '/' + str(self.reporting_year-2)
print '{}\t{}\t{}\t{}\t{}\t{}\t{}'.format('Tenure', year2, year1, year0, year2, year1, year0).expandtabs(20)
for row in self.rpt_map:
for tenure, data in row.iteritems():
if tenure and data:
print '{}\t{}\t{}\t{}\t{}\t{}\t{}'.format(tenure, data['count2'], data['count1'], data['count0'], data['area2'], data['area1'], data['area0']).expandtabs(20)
else:
print
class BushfireByCauseReport():
def __init__(self,reporting_year=None):
self.reporting_year = current_finyear() if (reporting_year is None or reporting_year >= current_finyear()) else reporting_year
self.rpt_map, self.item_map = self.create()
logger.info("Starting BushfireByCauseReport")
def create(self):
rpt_map = []
item_map = {}
count_sql = """
SELECT a.cause_id, COUNT(*)
FROM (
(SELECT COALESCE(a1.cause_id, 9) AS cause_id, a1.id
FROM reporting_bushfire a1
WHERE a1.report_status IN {report_statuses} AND a1.reporting_year = {{reporting_year}} AND a1.fire_not_found = false
)
UNION
(SELECT COALESCE(b1.cause_id, 9) AS cause_id, b1.id
FROM reporting_bushfire b1
JOIN reporting_bushfire b2 ON b1.valid_bushfire_id = b2.id AND b2.report_status IN {report_statuses} AND b2.reporting_year = {{reporting_year}} AND b2.fire_not_found = false
WHERE b1.report_status = {status_merged}
)
) AS a
GROUP BY cause_id
""".format(
report_statuses="({})".format(",".join([str(i) for i in [Bushfire.STATUS_FINAL_AUTHORISED,Bushfire.STATUS_REVIEWED]])),
status_merged = Bushfire.STATUS_MERGED
)
area_sql = """
SELECT COALESCE(a.cause_id, 9) AS cause_id, SUM(b.area) AS total_all_regions_area, SUM(a.area) AS total_area
FROM reporting_bushfire a JOIN reporting_areaburnt b ON a.id = b.bushfire_id JOIN bfrs_tenure c ON b.tenure_id = c.id
WHERE a.report_status IN {report_statuses} AND a.reporting_year = {{reporting_year}} AND a.fire_not_found = false AND c.report_group = 'ALL REGIONS'
GROUP BY cause_id
""".format(
report_statuses="({})".format(",".join([str(i) for i in [Bushfire.STATUS_FINAL_AUTHORISED,Bushfire.STATUS_REVIEWED]]))
)
year_count_list = []
year_total_count_list = []
all_causes = Cause.objects.all().order_by('report_order')
with connection.cursor() as cursor:
for year in range(self.reporting_year,self.reporting_year - 3,-1):
year_count_data = {}
year_count_list.append(year_count_data)
year_total_count = 0
if year >= 2017:
cursor.execute(count_sql.format(reporting_year=year))
for result in cursor.fetchall():
year_count_data[result[0]] = result[1] or 0
year_total_count += result[1] or 0
else:
data = read_col(year,'count')[0]
for cause in all_causes:
row = [d for d in data if d.get('cause_id')==cause.id]
if len(row) > 0:
year_count_data[cause.id] = row[0].get('count') or 0
year_total_count += (row[0].get('count') or 0)
else:
year_count_data[cause.id] = 0
year_total_count_list.append(year_total_count)
for cause in all_causes:
if rpt_map and cause.report_name in rpt_map[-1]:
for i in range(0,len(year_count_list),1):
rpt_map[-1][cause.report_name]["count{}".format(i)] = rpt_map[-1][cause.report_name]["count{}".format(i)] + year_count_list[i].get(cause.id,0)
if year_total_count_list[i] == 0:
rpt_map[-1][cause.report_name]["perc{}".format(i)] = 0
else:
rpt_map[-1][cause.report_name]["perc{}".format(i)] = rpt_map[-1][cause.report_name]["count{}".format(i)] * 100 / (year_total_count_list[i] * 1.0)
else:
report_data = {}
for i in range(0,len(year_count_list),1):
report_data["count{}".format(i)] = year_count_list[i].get(cause.id,0)
if year_total_count_list[i] == 0:
report_data["perc{}".format(i)] = 0
else:
report_data["perc{}".format(i)] = year_count_list[i].get(cause.id,0) * 100 / (year_total_count_list[i] * 1.0)
rpt_map.append(
{cause.report_name: report_data}
)
report_total_data = {}
for i in range(0,len(year_total_count_list),1):
report_total_data["count{}".format(i)] = year_total_count_list[i]
if year_total_count_list[i] == 0:
report_total_data["perc{}".format(i)] = 0
else:
report_total_data["perc{}".format(i)] = year_total_count_list[i] * 100 / (year_total_count_list[i] * 1.0)
rpt_map.append(
{'Total': report_total_data}
)
logger.info("BushfireByCauseReport create complete" )
return rpt_map, item_map
def get_excel_sheet(self, rpt_date, book=Workbook()):
year0 = str(self.reporting_year) + '/' + str(self.reporting_year+1)
year1 = str(self.reporting_year-1) + '/' + str(self.reporting_year)
year2 = str(self.reporting_year-2) + '/' + str(self.reporting_year-1)
# book = Workbook()
sheet1 = book.add_sheet('Bushfire By Cause Report')
sheet1 = book.get_sheet('Bushfire By Cause Report')
# font BOLD
style = XFStyle()
font = Font()
font.bold = True
style.font = font
# font BOLD and Center Aligned
style_center = XFStyle()
font = Font()
font.bold = True
style_center.font = font
style_center.alignment.horz = Alignment.HORZ_CENTER
col_no = lambda c=count(): next(c)
row_no = lambda c=count(): next(c)
hdr = sheet1.row(row_no())
hdr.write(0, 'Report Date', style=style)
hdr.write(1, rpt_date.strftime('%d-%b-%Y'))
hdr = sheet1.row(row_no())
hdr.write(0, 'Report', style=style)
hdr.write(1, 'Bushfire By Cause Report')
hdr = sheet1.row(row_no())
hdr.write(0, 'Fin Year', style=style)
hdr.write(1, self.reporting_year)
hdr = sheet1.row(row_no())
hdr.write(0, 'Missing Final', style=style)
hdr.write(1, Bushfire.objects.filter(report_status=Bushfire.STATUS_INITIAL_AUTHORISED, reporting_year=self.reporting_year).count() )
hdr = sheet1.row(row_no())
hdr = sheet1.row(row_no())
row = row_no()
sheet1.write_merge(row, row, 1, 3, "Number", style_center)
sheet1.write_merge(row, row, 4, 6, "Percent %", style_center)
hdr = sheet1.row(row_no())
hdr.write(col_no(), "ALL REGIONS", style=style)
hdr.write(col_no(), year2, style=style)
hdr.write(col_no(), year1, style=style)
hdr.write(col_no(), year0, style=style)
hdr.write(col_no(), year2, style=style)
hdr.write(col_no(), year1, style=style)
hdr.write(col_no(), year0, style=style)
for row in self.rpt_map:
for tenure, data in row.iteritems():
row = sheet1.row(row_no())
col_no = lambda c=count(): next(c)
if tenure == '':
#row = sheet1.row(row_no())
continue
elif 'total' in tenure.lower():
#row = sheet1.row(row_no())
row.write(col_no(), tenure, style=style_bold_gen)
row.write(col_no(), data['count2'], style=style_bold_gen)
row.write(col_no(), data['count1'], style=style_bold_gen)
row.write(col_no(), data['count0'], style=style_bold_gen)
row.write(col_no(), data['perc2'], style=style_bold_percentage)
row.write(col_no(), data['perc1'], style=style_bold_percentage)
row.write(col_no(), data['perc0'], style=style_bold_percentage)
else:
row.write(col_no(), tenure, style=style_bold_gen )
row.write(col_no(), data['count2'], style=style_normal)
row.write(col_no(), data['count1'], style=style_normal)
row.write(col_no(), data['count0'], style=style_normal)
row.write(col_no(), data['perc2'], style=style_normal_percentage)
row.write(col_no(), data['perc1'], style=style_normal_percentage)
row.write(col_no(), data['perc0'], style=style_normal_percentage)
# DISCLAIMER
col_no = lambda c=count(): next(c)
hdr = sheet1.row(row_no())
hdr = sheet1.row(row_no())
hdr.write(col_no(), DISCLAIMER, style=style_normal)
if MISSING_MAP:
col_no = lambda c=count(): next(c)
hdr = sheet1.row(row_no())
hdr = sheet1.row(row_no())
row = row_no()
sheet1.write_merge(row, row, 0, 2, "NOTE: Errors in report", style_bold_red)
for item in MISSING_MAP:
hdr = sheet1.row(row_no())
hdr.write(col_no(), item.get('name'), style=style_bold_yellow)
hdr.write(col_no(), item.get('error'), style=style_bold_yellow)
def write_excel(self):
rpt_date = datetime.now()
book = Workbook()
self.get_excel_sheet(rpt_date, book)
filename = '/tmp/bushfire_by_cause_report_{}.xls'.format(rpt_date.strftime('%d-%b-%Y'))
book.save(filename)
def export(self):
""" Executed from the Overview page in BFRS, returns an Excel WB as a HTTP Response object """
rpt_date = datetime.now()
filename = 'bushfire_by_cause_report_{}.xls'.format(rpt_date.strftime('%d%b%Y'))
response = HttpResponse(content_type='application/vnd.ms-excel')
response['Content-Disposition'] = 'attachment; filename=' + filename
book = Workbook()
self.get_excel_sheet(rpt_date, book)
book.add_sheet('Sheet 2')
book.save(response)
return response
def display(self):
year0 = str(self.reporting_year-1) + '/' + str(self.reporting_year)
year1 = str(self.reporting_year-2) + '/' + str(self.reporting_year-1)
year2 = str(self.reporting_year-3) + '/' + str(self.reporting_year-2)
print '{}\t{}\t{}\t{}\t{}\t{}\t{}'.format('Cause', year2, year1, year0, year2, year1, year0).expandtabs(20)
for row in self.rpt_map:
for cause, data in row.iteritems():
if cause and data:
print '{}\t{}\t{}\t{}\t{}\t{}\t{}'.format(cause, data['count2'], data['count1'], data['count0'], data['perc2'], data['perc1'], data['perc0']).expandtabs(25)
else:
print
class BushfireByRegionByTenureReport():
def __init__(self, reporting_year=None, overlap_ids=[]):
self.reporting_year = current_finyear() if (reporting_year is None or reporting_year >= current_finyear()) else reporting_year
self.overlap_ids = overlap_ids
logger.info("Startiing RegionByTenureReport; overlap ids: " + str(self.overlap_ids))
self.rpt_map, self.tenure_names = self.create()
def create(self):
tenure_name_sql = """
SELECT distinct report_name, report_order FROM bfrs_tenure WHERE report_group = 'ALL REGIONS' ORDER BY report_order
"""
count_sql = """
SELECT a.region_id, b.report_name, count(*)
FROM (
(SELECT a1.region_id, a1.tenure_id, a1.id
FROM reporting_bushfire a1
WHERE a1.report_status in {report_statuses} AND a1.reporting_year={{year}} AND a1.fire_not_found = false
)
UNION
(SELECT b1.region_id, b1.tenure_id, b1.id
FROM reporting_bushfire b1
JOIN reporting_bushfire b2 ON b1.valid_bushfire_id = b2.id AND b2.report_status IN {report_statuses} AND b2.reporting_year = {{year}} AND b2.fire_not_found = false
WHERE b1.report_status = {status_merged}
)
) AS a
JOIN bfrs_tenure b ON a.tenure_id = b.id JOIN bfrs_region r ON a.region_id = r.id
WHERE r.dbca AND b.report_group='ALL REGIONS'
GROUP BY a.region_id,b.report_name, b.report_order
ORDER BY a.region_id, b.report_name
""".format(
report_statuses="({})".format(",".join([str(i) for i in [Bushfire.STATUS_FINAL_AUTHORISED, Bushfire.STATUS_REVIEWED]])),
status_merged = Bushfire.STATUS_MERGED
)
area_sql = """
SELECT ab.region_id, t.report_name, SUM(ab.area) AS area
FROM reporting_bushfire bf JOIN reporting_areaburnt ab ON bf.id = ab.bushfire_id JOIN bfrs_tenure t on ab.tenure_id = t.id JOIN bfrs_region r ON ab.region_id = r.id
WHERE bf.report_status in {report_statuses} AND bf.reporting_year = {{year}} AND bf.fire_not_found = False AND t.report_group = 'ALL REGIONS' AND r.dbca
GROUP BY ab.region_id, t.report_name, t.report_order
ORDER BY ab.region_id, t.report_name
""".format(
report_statuses="({})".format(",".join([str(i) for i in [Bushfire.STATUS_FINAL_AUTHORISED,Bushfire.STATUS_REVIEWED]]))
)
rpt_map = []
count_data = {}
area_data = {}
tenure_names = []
with connection.cursor() as cursor:
cursor.execute(tenure_name_sql)
for result in cursor.fetchall():
tenure_names.append(result[0])
cursor.execute(count_sql.format(year=self.reporting_year))
for result in cursor.fetchall():
region_id = result[0]
tenure_name = result[1]
report_count = result[2] or 0
if region_id not in count_data:
count_data[region_id] = {}
count_data[region_id][tenure_name] = count_data[region_id].get(tenure_name,0) + report_count
logger.info("Region by Tenure: count complete")
#cursor.execute(area_sql.format(year=self.reporting_year, excluded_ids=str(excluded_ids)[1:-1]))
cursor.execute(area_sql.format(year=self.reporting_year))
for result in cursor.fetchall():
region_id = result[0]
tenure_name = result[1]
report_area = result[2] or 0
if region_id not in area_data:
area_data[region_id] = {}
area_data[region_id][tenure_name] = area_data[region_id].get(tenure_name, 0) + report_area
logger.info("Region by Tenure: area complete")
tenure_count_total_forest={}
tenure_area_total_forest = {}
for region in get_sorted_regions(True):
region_count_data = count_data.get(region.id,{})
region_area_data = area_data.get(region.id,{})
region_data = {}
rpt_map.append((region.name,region_data))
region_count_total = 0
region_area_total = 0
for tenure_name in tenure_names:
region_data[tenure_name]=dict(count = region_count_data.get(tenure_name,0),area=region_area_data.get(tenure_name,0))
region_count_total += region_count_data.get(tenure_name,0)
region_area_total += region_area_data.get(tenure_name,0)
tenure_count_total_forest[tenure_name] = tenure_count_total_forest.get(tenure_name,0) + region_count_data.get(tenure_name,0)
tenure_area_total_forest[tenure_name] = tenure_area_total_forest.get(tenure_name,0) + region_area_data.get(tenure_name,0)
tenure_count_total_forest["Total"] = tenure_count_total_forest.get("Total",0) + region_count_data.get(tenure_name,0)
tenure_area_total_forest["Total"] = tenure_area_total_forest.get("Total",0) + region_area_data.get(tenure_name,0)
region_data["Total"] = dict(count=region_count_total,area=region_area_total)
total_data = {}
rpt_map.append(("Sub Total (Forest)",total_data))
for tenure_name in tenure_names + ["Total"]:
total_data[tenure_name]=dict(count = tenure_count_total_forest.get(tenure_name,0),area=tenure_area_total_forest.get(tenure_name,0))
tenure_count_total_nonforest={}
tenure_area_total_nonforest = {}
for region in get_sorted_regions(False):
region_count_data = count_data.get(region.id,{})
region_area_data = area_data.get(region.id,{})
region_data = {}
rpt_map.append((region.name,region_data))
region_count_total = 0
region_area_total = 0
for tenure_name in tenure_names:
region_data[tenure_name]=dict(count = region_count_data.get(tenure_name,0),area=region_area_data.get(tenure_name,0))
region_count_total += region_count_data.get(tenure_name,0)
region_area_total += region_area_data.get(tenure_name,0)
tenure_count_total_nonforest[tenure_name] = tenure_count_total_nonforest.get(tenure_name,0) + region_count_data.get(tenure_name,0)
tenure_area_total_nonforest[tenure_name] = tenure_area_total_nonforest.get(tenure_name,0) + region_area_data.get(tenure_name,0)
tenure_count_total_nonforest["Total"] = tenure_count_total_nonforest.get("Total",0) + region_count_data.get(tenure_name,0)
tenure_area_total_nonforest["Total"] = tenure_area_total_nonforest.get("Total",0) + region_area_data.get(tenure_name,0)
region_data["Total"] = dict(count=region_count_total,area=region_area_total)
total_data = {}
rpt_map.append(("Sub Total (Non Forest)",total_data))
for tenure_name in tenure_names + ["Total"]:
total_data[tenure_name]=dict(count = tenure_count_total_nonforest.get(tenure_name,0),area=tenure_area_total_nonforest.get(tenure_name,0))
total_data = {}
rpt_map.append(("Grand Total (All Regions)",total_data))
for tenure_name in tenure_names + ["Total"]:
total_data[tenure_name]=dict(
count = tenure_count_total_nonforest.get(tenure_name,0) + tenure_count_total_forest.get(tenure_name,0),
area = tenure_area_total_nonforest.get(tenure_name,0) + tenure_area_total_forest.get(tenure_name,0)
)
return rpt_map, tenure_names
def get_excel_sheet(self, rpt_date, book=Workbook()):
# book = Workbook()
sheet1 = book.add_sheet('Bushfire Region By Tenure')
sheet1 = book.get_sheet('Bushfire Region By Tenure')
# font BOLD
style = XFStyle()
font = Font()
font.bold = True
style.font = font
# font BOLD and Center Aligned
style_center = XFStyle()
font = Font()
font.bold = True
style_center.font = font
style_center.alignment.horz = Alignment.HORZ_CENTER
col_no = lambda c=count(): next(c)
row_no = lambda c=count(): next(c)
hdr = sheet1.row(row_no())
hdr.write(0, 'Report Date', style=style)
hdr.write(1, rpt_date.strftime('%d-%b-%Y'))
hdr = sheet1.row(row_no())
hdr.write(0, 'Report', style=style)
hdr.write(1, 'Bushfire Region By Tenure Report')
hdr = sheet1.row(row_no())
hdr.write(0, 'Fin Year', style=style)
hdr.write(1, self.reporting_year)
hdr = sheet1.row(row_no())
hdr.write(0, 'Missing Final', style=style)
hdr.write(1, Bushfire.objects.filter(report_status=Bushfire.STATUS_INITIAL_AUTHORISED, reporting_year=self.reporting_year).count() )
hdr = sheet1.row(row_no())
hdr = sheet1.row(row_no())
row = row_no()
sheet1.write_merge(row, row, 0, 1, "Bushfire Region By Tenure", style_center)
hdr = sheet1.row(row_no())
row = sheet1.row(row_no())
col_no = lambda c=count(): next(c)
row.write(col_no(), '')
row.write(col_no(), '' )
for name in self.tenure_names:
row.write(col_no(), name, style=style)
row.write(col_no(), "Total", style=style)
for region, region_data in self.rpt_map:
row = sheet1.row(row_no())
col_no = lambda c=count(): next(c)
row.write(col_no(), region, style=style_bold_gen)
row.write(col_no(), 'Area', style=style_bold_gen)
for tenure_name in self.tenure_names: # loops through all tenures for given region
row.write(col_no(), round(region_data.get(tenure_name,{}).get('area',0),2), style=style_bold_area if "total" in region.lower() else style_normal_area )
row.write(col_no(), round(region_data.get("Total",{}).get('area',0),2), style=style_bold_area )
row = sheet1.row(row_no())
col_no = lambda c=count(): next(c)
row.write(col_no(), '' )
row.write(col_no(), 'Number', style=style_bold_gen)
for tenure_name in self.tenure_names: # loops through all tenures for given region
row.write(col_no(), region_data.get(tenure_name,{}).get('count',0), style=style_bold_int if "total" in region.lower() else style_normal_int )
row.write(col_no(), region_data.get("Total",{}).get('count',0), style=style_bold_int )
row = sheet1.row(row_no())
# DISCLAIMER
col_no = lambda c=count(): next(c)
hdr = sheet1.row(row_no())
hdr = sheet1.row(row_no())
hdr.write(col_no(), DISCLAIMER, style=style_normal)
def write_excel(self):
rpt_date = datetime.now()
book = Workbook()
self.get_excel_sheet(rpt_date, book)
filename = '/tmp/bushfire_regionbytenure_report_{}.xls'.format(rpt_date.strftime('%d-%b-%Y'))
book.save(filename)
def export(self):
""" Executed from the Overview page in BFRS, returns an Excel WB as a HTTP Response object """
rpt_date = datetime.now()
filename = 'bushfire_regionbytenure_report_{}.xls'.format(rpt_date.strftime('%d%b%Y'))
response = HttpResponse(content_type='application/vnd.ms-excel')
response['Content-Disposition'] = 'attachment; filename=' + filename
book = Workbook()
self.get_excel_sheet(rpt_date, book)
book.add_sheet('Sheet 2')
book.save(response)
return response
def display(self):
for data in self.rpt_map:
print ', '.join([str(i['count']) for i in data])
print ', '.join([str(i['area']) for i in data])
print
class Bushfire10YrAverageReport():
def __init__(self,reporting_year=None):
self.reporting_year = current_finyear() if (reporting_year is None or reporting_year >= current_finyear()) else reporting_year
self.rpt_map, self.item_map = self.create()
logger.info("Starting Bushfire10YrAverageReport")
def create(self):
rpt_map = []
item_map = {}
count_sql = """
SELECT a.cause_id, COUNT(*)
FROM (
(SELECT COALESCE(a1.cause_id, 9) AS cause_id, a1.id
FROM reporting_bushfire a1
WHERE a1.report_status IN {report_statuses} AND a1.reporting_year = {{reporting_year}} AND a1.fire_not_found = false
)
UNION
(SELECT COALESCE(b1.cause_id, 9) AS cause_id, b1.id
FROM reporting_bushfire b1
JOIN reporting_bushfire b2 ON b1.valid_bushfire_id = b2.id AND b2.report_status IN {report_statuses} AND b2.reporting_year = {{reporting_year}} AND b2.fire_not_found = false
WHERE b1.report_status = {status_merged}
)
) AS a
GROUP BY a.cause_id
""".format(
report_statuses="({})".format(",".join([str(i) for i in [Bushfire.STATUS_FINAL_AUTHORISED, Bushfire.STATUS_REVIEWED]])),
status_merged = Bushfire.STATUS_MERGED
)
area_sql = """
SELECT COALESCE(a.cause_id, 9) AS cause_id, SUM(b.area) AS total_all_regions_area, SUM(a.area) AS total_area
FROM reporting_bushfire a JOIN reporting_areaburnt b ON a.id = b.bushfire_id JOIN bfrs_tenure c ON b.tenure_id = c.id
WHERE a.report_status IN {report_statuses} AND a.reporting_year = {{reporting_year}} AND a.fire_not_found = false AND c.report_group = 'ALL REGIONS'
GROUP BY a.cause_id
""".format(
report_statuses="({})".format(",".join([str(i) for i in [Bushfire.STATUS_FINAL_AUTHORISED,Bushfire.STATUS_REVIEWED]]))
)
year_count_list = []
year_total_count_list = []
total_count = 0
total_count_avg = 0
all_causes = Cause.objects.all().order_by('report_order')
with connection.cursor() as cursor:
for year in range(self.reporting_year,self.reporting_year - 10,-1):
year_count_data = {}
year_count_list.append(year_count_data)
year_total_count = 0
if year >= 2017:
cursor.execute(count_sql.format(reporting_year=year))
for result in cursor.fetchall():
year_count_data[result[0]] = result[1] or 0
year_total_count += result[1] or 0
else:
data = read_col(year,'count')[0]
for cause in all_causes:
row = [d for d in data if d.get('cause_id')==cause.id]
if len(row) > 0:
year_count_data[cause.id] = row[0].get('count') or 0
year_total_count += (row[0].get('count') or 0)
else:
year_count_data[cause.id] = 0
year_total_count_list.append(year_total_count)
total_count += year_total_count
total_count_avg = round(total_count/(len(year_count_list) * 1.0))
for cause in all_causes:
if rpt_map and cause.report_name in rpt_map[-1]:
for i in range(0,len(year_count_list),1):
rpt_map[-1][cause.report_name]["count{}".format(i)] = rpt_map[-1][cause.report_name]["count{}".format(i)] + year_count_list[i].get(cause.id,0)
if year_total_count_list[i] == 0:
rpt_map[-1][cause.report_name]["perc{}".format(i)] = 0
else:
rpt_map[-1][cause.report_name]["perc{}".format(i)] = rpt_map[-1][cause.report_name]["count{}".format(i)] * 100 / (year_total_count_list[i] * 1.0)
rpt_map[-1][cause.report_name]["total_count"] += year_count_list[i].get(cause.id,0)
else:
report_data = {"total_count":0}
for i in range(0,len(year_count_list),1):
report_data["count{}".format(i)] = year_count_list[i].get(cause.id,0)
if year_total_count_list[i] == 0:
report_data["perc{}".format(i)] = 0
else:
report_data["perc{}".format(i)] = year_count_list[i].get(cause.id,0) * 100 / (year_total_count_list[i] * 1.0)
report_data["total_count"] += year_count_list[i].get(cause.id,0)
rpt_map.append(
{cause.report_name: report_data}
)
for m in rpt_map:
for data in m.values():
data["count_avg"] = round(data["total_count"] / (len(year_count_list) * 1.0))
if total_count_avg == 0:
data["perc_avg"] = 0
else:
data["perc_avg"] = data["count_avg"] * 100 / (total_count_avg * 1.0)
report_total_data = {"count_avg":total_count_avg,"perc_avg":total_count * 100 / (total_count * 1.0)}
for i in range(0,len(year_total_count_list),1):
report_total_data["count{}".format(i)] = year_total_count_list[i]
if year_total_count_list[i] == 0:
report_total_data["perc{}".format(i)] = 0
else:
report_total_data["perc{}".format(i)] = year_total_count_list[i] * 100 / (year_total_count_list[i] * 1.0)
rpt_map.append(
{'Total': report_total_data}
)
logger.info("Bushfire10YrAverageReport create complete")
return rpt_map, item_map
def get_excel_sheet(self, rpt_date, book=Workbook()):
year0 = str(self.reporting_year) + '/' + str(self.reporting_year+1)
year1 = str(self.reporting_year-1) + '/' + str(self.reporting_year)
year2 = str(self.reporting_year-2) + '/' + str(self.reporting_year-1)
year3 = str(self.reporting_year-3) + '/' + str(self.reporting_year-2)
year4 = str(self.reporting_year-4) + '/' + str(self.reporting_year-3)
year5 = str(self.reporting_year-5) + '/' + str(self.reporting_year-4)
year6 = str(self.reporting_year-6) + '/' + str(self.reporting_year-5)
year7 = str(self.reporting_year-7) + '/' + str(self.reporting_year-6)
year8 = str(self.reporting_year-8) + '/' + str(self.reporting_year-7)
year9 = str(self.reporting_year-9) + '/' + str(self.reporting_year-8)
# book = Workbook()
sheet1 = book.add_sheet('Bushfire Causes 10Yr Average')
sheet1 = book.get_sheet('Bushfire Causes 10Yr Average')
# font BOLD
style = XFStyle()
font = Font()
font.bold = True
style.font = font
# font BOLD and Center Aligned
style_center = XFStyle()
font = Font()
font.bold = True
style_center.font = font
style_center.alignment.horz = Alignment.HORZ_CENTER
col_no = lambda c=count(): next(c)
row_no = lambda c=count(): next(c)
hdr = sheet1.row(row_no())
hdr.write(0, 'Report Date', style=style)
hdr.write(1, rpt_date.strftime('%d-%b-%Y'))
hdr = sheet1.row(row_no())
hdr.write(0, 'Report', style=style)
hdr.write(1, 'Bushfire Causes 10Yr Average')
hdr = sheet1.row(row_no())
hdr.write(0, 'Fin Year', style=style)
hdr.write(1, self.reporting_year)
hdr = sheet1.row(row_no())
hdr.write(0, 'Missing Final', style=style)
hdr.write(1, Bushfire.objects.filter(report_status=Bushfire.STATUS_INITIAL_AUTHORISED, reporting_year=self.reporting_year).count() )
hdr = sheet1.row(row_no())
hdr = sheet1.row(row_no())
row = row_no()
sheet1.write_merge(row, row, 1, 10, "Number", style_center)
sheet1.write_merge(row, row, 11, 20, "Percent %", style_center)
hdr = sheet1.row(row_no())
hdr.write(col_no(), "ALL REGIONS", style=style)
hdr.write(col_no(), year9, style=style)
hdr.write(col_no(), year8, style=style)
hdr.write(col_no(), year7, style=style)
hdr.write(col_no(), year6, style=style)
hdr.write(col_no(), year5, style=style)
hdr.write(col_no(), year4, style=style)
hdr.write(col_no(), year3, style=style)
hdr.write(col_no(), year2, style=style)
hdr.write(col_no(), year1, style=style)
hdr.write(col_no(), year0, style=style)
hdr.write(col_no(), year9, style=style)
hdr.write(col_no(), year8, style=style)
hdr.write(col_no(), year7, style=style)
hdr.write(col_no(), year6, style=style)
hdr.write(col_no(), year5, style=style)
hdr.write(col_no(), year4, style=style)
hdr.write(col_no(), year3, style=style)
hdr.write(col_no(), year2, style=style)
hdr.write(col_no(), year1, style=style)
hdr.write(col_no(), year0, style=style)
for row in self.rpt_map:
for cause, data in row.iteritems():
row = sheet1.row(row_no())
col_no = lambda c=count(): next(c)
if cause == '':
#row = sheet1.row(row_no())
continue
elif 'total' in cause.lower():
#row = sheet1.row(row_no())
row.write(col_no(), cause, style=style)
row.write(col_no(), data['count9'], style=style_bold_gen)
row.write(col_no(), data['count8'], style=style_bold_gen)
row.write(col_no(), data['count7'], style=style_bold_gen)
row.write(col_no(), data['count6'], style=style_bold_gen)
row.write(col_no(), data['count5'], style=style_bold_gen)
row.write(col_no(), data['count4'], style=style_bold_gen)
row.write(col_no(), data['count3'], style=style_bold_gen)
row.write(col_no(), data['count2'], style=style_bold_gen)
row.write(col_no(), data['count1'], style=style_bold_gen)
row.write(col_no(), data['count0'], style=style_bold_gen)
row.write(col_no(), data['perc9'], style=style_bold_percentage)
row.write(col_no(), data['perc8'], style=style_bold_percentage)
row.write(col_no(), data['perc7'], style=style_bold_percentage)
row.write(col_no(), data['perc6'], style=style_bold_percentage)
row.write(col_no(), data['perc5'], style=style_bold_percentage)
row.write(col_no(), data['perc4'], style=style_bold_percentage)
row.write(col_no(), data['perc3'], style=style_bold_percentage)
row.write(col_no(), data['perc2'], style=style_bold_percentage)
row.write(col_no(), data['perc1'], style=style_bold_percentage)
row.write(col_no(), data['perc0'], style=style_bold_percentage)
else:
row.write(col_no(), cause )
row.write(col_no(), data['count9'], style=style_normal)
row.write(col_no(), data['count8'], style=style_normal)
row.write(col_no(), data['count7'], style=style_normal)
row.write(col_no(), data['count6'], style=style_normal)
row.write(col_no(), data['count5'], style=style_normal)
row.write(col_no(), data['count4'], style=style_normal)
row.write(col_no(), data['count3'], style=style_normal)
row.write(col_no(), data['count2'], style=style_normal)
row.write(col_no(), data['count1'], style=style_normal)
row.write(col_no(), data['count0'], style=style_normal)
row.write(col_no(), data['perc9'], style=style_normal_percentage)
row.write(col_no(), data['perc8'], style=style_normal_percentage)
row.write(col_no(), data['perc7'], style=style_normal_percentage)
row.write(col_no(), data['perc6'], style=style_normal_percentage)
row.write(col_no(), data['perc5'], style=style_normal_percentage)
row.write(col_no(), data['perc4'], style=style_normal_percentage)
row.write(col_no(), data['perc3'], style=style_normal_percentage)
row.write(col_no(), data['perc2'], style=style_normal_percentage)
row.write(col_no(), data['perc1'], style=style_normal_percentage)
row.write(col_no(), data['perc0'], style=style_normal_percentage)
if MISSING_MAP:
col_no = lambda c=count(): next(c)
hdr = sheet1.row(row_no())
hdr = sheet1.row(row_no())
row = row_no()
sheet1.write_merge(row, row, 0, 2, "NOTE: Errors in report", style_bold_red)
for item in MISSING_MAP:
hdr = sheet1.row(row_no())
hdr.write(col_no(), item.get('name'), style=style_bold_yellow)
hdr.write(col_no(), item.get('error'), style=style_bold_yellow)
col_no = lambda c=count(): next(c)
hdr = sheet1.row(row_no())
hdr = sheet1.row(row_no())
row = row_no()
sheet1.write_merge(row, row, 0, 2, "Ten Year Average", style_center)
hdr = sheet1.row(row_no())
hdr.write(col_no(), "ALL REGIONS", style=style)
hdr.write(col_no(), "Number", style=style)
hdr.write(col_no(), "Percent (%)", style=style)
for row in self.rpt_map:
for cause, data in row.iteritems():
row = sheet1.row(row_no())
col_no = lambda c=count(): next(c)
if cause == '':
#row = sheet1.row(row_no())
continue
elif 'total' in cause.lower():
#row = sheet1.row(row_no())
row.write(col_no(), cause, style=style_bold_gen)
row.write(col_no(), data['count_avg'], style=style_bold_gen)
row.write(col_no(), data['perc_avg'], style=style_bold_percentage)
else:
row.write(col_no(), cause, style=style_normal)
row.write(col_no(), data['count_avg'], style=style_normal)
row.write(col_no(), data['perc_avg'], style=style_normal_percentage)
# DISCLAIMER
col_no = lambda c=count(): next(c)
hdr = sheet1.row(row_no())
hdr = sheet1.row(row_no())
hdr.write(col_no(), DISCLAIMER, style=style_normal)
def write_excel(self):
rpt_date = datetime.now()
book = Workbook()
self.get_excel_sheet(rpt_date, book)
filename = '/tmp/bushfire_cause_10yr_average_report_{}.xls'.format(rpt_date.strftime('%d-%b-%Y'))
book.save(filename)
def export(self):
""" Executed from the Overview page in BFRS, returns an Excel WB as a HTTP Response object """
rpt_date = datetime.now()
filename = 'bushfire_by_cause_10yr_average_report_{}.xls'.format(rpt_date.strftime('%d%b%Y'))
response = HttpResponse(content_type='application/vnd.ms-excel')
response['Content-Disposition'] = 'attachment; filename=' + filename
book = Workbook()
self.get_excel_sheet(rpt_date, book)
book.add_sheet('Sheet 2')
book.save(response)
return response
def display(self):
year0 = str(self.reporting_year-1) + '/' + str(self.reporting_year)
year1 = str(self.reporting_year-2) + '/' + str(self.reporting_year-1)
year2 = str(self.reporting_year-3) + '/' + str(self.reporting_year-2)
print '{}\t{}\t{}\t{}\t{}\t{}\t{}'.format('Cause', year2, year1, year0, year2, year1, year0).expandtabs(20)
for row in self.rpt_map:
for cause, data in row.iteritems():
if cause and data:
print '{}\t{}\t{}\t{}\t{}\t{}\t{}'.format(cause, data['count2'], data['count1'], data['count0'], data['perc2'], data['perc1'], data['perc0']).expandtabs(25)
else:
print
class BushfireIndicator():
def __init__(self,reporting_year=None):
self.reporting_year = current_finyear() if (reporting_year is None or reporting_year >= current_finyear()) else reporting_year
self.rpt_map, self.item_map = self.create()
logger.info("Starting BushfireIndicator")
def create(self):
# Group By Region
#qs = Bushfire.objects.filter(report_status__gte=Bushfire.STATUS_FINAL_AUTHORISED, reporting_year=self.reporting_year, region__in=Region.objects.filter(forest_region=False), first_attack__name='DBCA P&W')
#qs = Bushfire.objects.filter(authorised_by__isnull=False, reporting_year=self.reporting_year, region__in=Region.objects.filter(forest_region=False), first_attack__name='DBCA P&W').exclude(report_status=Bushfire.STATUS_INVALIDATED)
"""
qs = Bushfire.objects.filter(report_status__in=[Bushfire.STATUS_FINAL_AUTHORISED,Bushfire.STATUS_REVIEWED], reporting_year=self.reporting_year,fire_not_found=False, region__in=get_sorted_regions(True), first_attack=Agency.DBCA)
qs1 = qs.aggregate(count=Count('id'), area=Sum('area') )
qs2 = qs.filter(area__lt=2.0).aggregate(count=Count('id'), area=Sum('area') )
count1 = qs1.get('count') if qs1.get('count') else 0
count2 = qs2.get('count') if qs2.get('count') else 0
"""
count_sql = """
select count(*)
from (
(select a1.id,a1.area
from reporting_bushfire a1
where a1.report_status in {report_statuses} and a1.reporting_year={reporting_year} and a1.fire_not_found=false and a1.region_id in ({regions}) and a1.first_attack_id = {first_attack_agency}
)
union
(select b1.id,b2.area
from reporting_bushfire b1
join reporting_bushfire b2 on b1.valid_bushfire_id = b2.id and b2.report_status in {report_statuses} and b2.reporting_year={reporting_year} and b2.region_id in ({regions}) and b2.fire_not_found=false and b2.first_attack_id = {first_attack_agency}
where b1.report_status = {status_merged}
)
) as a
{{filter}}
""".format(
report_statuses="({})".format(",".join([str(i) for i in [Bushfire.STATUS_FINAL_AUTHORISED,Bushfire.STATUS_REVIEWED]])),
status_merged = Bushfire.STATUS_MERGED,
regions = ",".join([str(r.id) for r in get_sorted_regions(True)]),
reporting_year = self.reporting_year,
first_attack_agency = Agency.DBCA.id
)
count1 = 0
count2 = 0
with connection.cursor() as cursor:
cursor.execute(count_sql.format(filter=""))
result = cursor.fetchone()
count1 = result[0] or 0
cursor.execute(count_sql.format(filter=" where a.area < 2.0"))
result = cursor.fetchone()
count2 = result[0] or 0
rpt_map = []
item_map = {}
rpt_map.append({'No of bushfires in the Forest Regions where DBCA was the initial attack agency': dict(count=count1)})
rpt_map.append({'No of bushfires in the Forest Regions <2ha, where DBCA was the initial attack agency': dict(count=count2)})
if count1 == 0:
rpt_map.append({'Percentage': dict(count=0)})
else:
rpt_map.append({'Percentage': dict(count=round(count2*100./count1, 2))})
logger.info("BushfireIndicator create complete")
return rpt_map, item_map
def get_excel_sheet(self, rpt_date, book=Workbook()):
# book = Workbook()
sheet1 = book.add_sheet('Bushfire Indicator')
sheet1 = book.get_sheet('Bushfire Indicator')
# font BOLD
style = XFStyle()
font = Font()
font.bold = True
style.font = font
# font BOLD and Center Aligned
style_center = XFStyle()
font = Font()
font.bold = True
style_center.font = font
style_center.alignment.horz = Alignment.HORZ_CENTER
col_no = lambda c=count(): next(c)
row_no = lambda c=count(): next(c)
hdr = sheet1.row(row_no())
hdr.write(0, 'Report Date', style=style)
hdr.write(1, rpt_date.strftime('%d-%b-%Y'))
hdr = sheet1.row(row_no())
hdr.write(0, 'Report', style=style)
hdr.write(1, 'Bushfire Indicator Report')
hdr = sheet1.row(row_no())
hdr.write(0, 'Fin Year', style=style)
hdr.write(1, self.reporting_year)
hdr = sheet1.row(row_no())
hdr.write(0, 'Missing Final', style=style)
hdr.write(1, Bushfire.objects.filter(report_status=Bushfire.STATUS_INITIAL_AUTHORISED, reporting_year=self.reporting_year).count() )
hdr = sheet1.row(row_no())
hdr = sheet1.row(row_no())
row = row_no()
sheet1.write_merge(row, row, 0, 1, "Bushfire Indicator", style_center)
hdr = sheet1.row(row_no())
for row in self.rpt_map:
for key, data in row.iteritems():
sheet_row = sheet1.row(row_no())
col_no = lambda c=count(): next(c)
if key == '':
#sheet_row = sheet1.row(row_no())
continue
elif 'total' in key.lower():
#sheet_row = sheet1.row(row_no())
sheet_row.write(col_no(), key, style=style_bold_gen)
sheet_row.write(col_no(), data['count'], style=style_bold_gen)
elif 'percentage' in key.lower():
#sheet_row = sheet1.row(row_no())
sheet_row.write(col_no(), key, style=style_bold_gen)
sheet_row.write(col_no(), data['count'], style=style_bold_percentage)
else:
sheet_row.write(col_no(), key, style=style_normal)
sheet_row.write(col_no(), data['count'], style=style_normal)
# DISCLAIMER
col_no = lambda c=count(): next(c)
hdr = sheet1.row(row_no())
hdr = sheet1.row(row_no())
hdr.write(col_no(), DISCLAIMER, style=style_normal)
def write_excel(self):
rpt_date = datetime.now()
book = Workbook()
self.get_excel_sheet(rpt_date, book)
filename = '/tmp/bushfire_indicator_report_{}.xls'.format(rpt_date.strftime('%d-%b-%Y'))
book.save(filename)
def export(self):
""" Executed from the Overview page in BFRS, returns an Excel WB as a HTTP Response object """
rpt_date = datetime.now()
filename = 'bushfire_indicator_report_{}.xls'.format(rpt_date.strftime('%d%b%Y'))
response = HttpResponse(content_type='application/vnd.ms-excel')
response['Content-Disposition'] = 'attachment; filename=' + filename
book = Workbook()
self.get_excel_sheet(rpt_date, book)
book.add_sheet('Sheet 2')
book.save(response)
return response
def display(self):
print '{}\t{}'.format('', 'Number').expandtabs(20)
for row in self.rpt_map:
for key, data in row.iteritems():
if key and data:
print '{}\t{}'.format(key, data['count']).expandtabs(25)
else:
print
def export_outstanding_fires(request, region_id, queryset):
""" Executed from the Overview page in BFRS, returns an Excel WB as a HTTP Response object """
#regions = Region.objects.filter(id=region_id) if region_id else Region.objects.all()
regions = Region.objects.filter(id=region_id) if region_id else Region.objects.filter(dbca=True)
region_name = regions[0].name if region_id else 'All-Regions'
rpt_date = datetime.now()
filename = 'outstanding_fires_{}_{}.xls'.format(region_name, rpt_date.strftime('%d%b%Y'))
response = HttpResponse(content_type='application/vnd.ms-excel')
response['Content-Disposition'] = 'attachment; filename=' + filename
book = Workbook()
for region in regions:
outstanding_fires(book, region, queryset, rpt_date)
book.add_sheet('Sheet 2')
book.save(response)
return response
def email_outstanding_fires(region_id=None):
""" Executed from the command line, returns an Excel WB attachment via email """
qs = Bushfire.objects.filter(report_status__in=[Bushfire.STATUS_INITIAL_AUTHORISED])
rpt_date = datetime.now()
for row in settings.OUTSTANDING_FIRES_EMAIL:
for region_name,email_to in row.iteritems():
try:
region = Region.objects.get(name=region_name)
except:
region = None
traceback.print_exc()
if region:
f = StringIO()
book = Workbook()
total_reports = outstanding_fires(book, region, qs, rpt_date)
book.add_sheet('Sheet 2')
book.save(f)
if total_reports == 0:
subject = 'Outstanding Fires Report - {} - {} - No Outstanding Fire'.format(region_name, rpt_date.strftime('%d-%b-%Y'))
body = 'Outstanding Fires Report - {} - {} - No Outstanding Fire'.format(region_name, rpt_date.strftime('%d-%b-%Y'))
elif total_reports == 1:
subject = 'Outstanding Fires Report - {} - {} - 1 Outstanding Fire'.format(region_name, rpt_date.strftime('%d-%b-%Y'))
body = 'Outstanding Fires Report - {} - {} - 1 Outstanding Fire'.format(region_name, rpt_date.strftime('%d-%b-%Y'))
else:
subject = 'Outstanding Fires Report - {} - {} - {} Outstanding Fires'.format(region_name, rpt_date.strftime('%d-%b-%Y'),total_reports)
body = 'Outstanding Fires Report - {} - {} - {} Outstanding Fires'.format(region_name, rpt_date.strftime('%d-%b-%Y'),total_reports)
message = EmailMessage(subject=subject, body=body, from_email=settings.FROM_EMAIL, to=email_to, cc=settings.CC_EMAIL, bcc=settings.BCC_EMAIL)
if total_reports > 0:
filename = 'outstanding_fires_{}_{}.xls'.format(region_name.replace(' ', '').lower(), rpt_date.strftime('%d-%b-%Y'))
message.attach(filename, f.getvalue(), "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet") #get the stream and set the correct mimetype
message.send()
def outstanding_fires(book, region, queryset, rpt_date):
qs = queryset.filter(region_id=region.id)
sheet1 = book.add_sheet(region.name)
col_no = lambda c=count(): next(c)
row_no = lambda c=count(): next(c)
sheet1 = book.get_sheet(region.name)
hdr = sheet1.row(row_no())
hdr.write(0, 'Report Date')
hdr.write(1, rpt_date.strftime('%d-%b-%Y'))
hdr = sheet1.row(row_no())
hdr.write(0, 'Region')
hdr.write(1, region.name)
hdr = sheet1.row(row_no())
hdr = sheet1.row(row_no())
hdr.write(col_no(), "Fire Number")
hdr.write(col_no(), "Name")
hdr.write(col_no(), "Date Detected")
hdr.write(col_no(), "Duty Officer")
hdr.write(col_no(), "Date Contained")
hdr.write(col_no(), "Date Controlled")
hdr.write(col_no(), "Date Inactive")
#row_no = lambda c=count(5): next(c)
total_reports = 0
for obj in qs:
total_reports += 1
row = sheet1.row(row_no())
col_no = lambda c=count(): next(c)
row.write(col_no(), obj.fire_number )
row.write(col_no(), obj.name)
row.write(col_no(), obj.fire_detected_date.strftime('%Y-%m-%d %H:%M:%S') if obj.fire_detected_date else '' )
row.write(col_no(), obj.duty_officer.get_full_name() if obj.duty_officer else '' )
row.write(col_no(), obj.fire_contained_date.strftime('%Y-%m-%d %H:%M:%S') if obj.fire_contained_date else '' )
row.write(col_no(), obj.fire_controlled_date.strftime('%Y-%m-%d %H:%M:%S') if obj.fire_controlled_date else '' )
row.write(col_no(), obj.fire_safe_date.strftime('%Y-%m-%d %H:%M:%S') if obj.fire_safe_date else '' )
return total_reports
export_outstanding_fires.short_description = u"Outstanding Fires"
def calculate_report_tables(request):
url = request.META.get('HTTP_REFERER')
with connection.cursor() as csr:
csr.execute("""
--------------------------------------------------------------------
--reporting_bushfire and reporting_areaburnt CREATION AND INDEXES
---------------------------------------------------------------------
DROP TABLE IF EXISTS reporting_bushfire;
CREATE TABLE reporting_bushfire AS SELECT * FROM bfrs_bushfire;
--CREATE INDEX idx_reporting_bushfire_origin ON reporting_bushfire USING GIST(origin_point);
DROP INDEX IF EXISTS idx_reporting_bushfire_tenure;
CREATE INDEX idx_reporting_bushfire_tenure ON reporting_bushfire (tenure_id);
DROP INDEX IF EXISTS idx_reporting_bushfire_region;
CREATE INDEX idx_reporting_bushfire_region ON reporting_bushfire (region_id);
DROP INDEX IF EXISTS idx_reporting_bushfire_rpt_status;
CREATE INDEX idx_reporting_bushfire_rpt_status ON reporting_bushfire (report_status);
DROP INDEX IF EXISTS idx_reporting_bushfire_rpt_year;
CREATE INDEX idx_reporting_bushfire_rpt_year ON reporting_bushfire (reporting_year);
DROP TABLE IF EXISTS reporting_areaburnt;
CREATE TABLE reporting_areaburnt AS SELECT * FROM bfrs_areaburnt;
ALTER TABLE reporting_areaburnt DROP CONSTRAINT IF EXISTS reporting_areaburnt_bushfire_id_tenure_id_key;
ALTER TABLE reporting_areaburnt ADD COLUMN region_id Integer;
ALTER TABLE reporting_areaburnt ADD COLUMN has_fire_boundary Boolean;
CREATE INDEX idx_reporting_areaburnt_tenure ON reporting_areaburnt(tenure_id);
CREATE INDEX idx_reporting_areaburnt_bushfire ON reporting_areaburnt(bushfire_id);
CREATE INDEX idx_reporting_areaburnt_region ON reporting_areaburnt(region_id);
DELETE FROM reporting_areaburnt WHERE bushfire_id IN
(SELECT id FROM reporting_bushfire WHERE fire_boundary IS NOT NULL);
UPDATE reporting_areaburnt ab SET region_id = (SELECT bf.region_id FROM reporting_bushfire bf WHERE ab.bushfire_id = bf.id);
UPDATE reporting_areaburnt SET has_fire_boundary = False;
--make valid geometries (NB checked cadastre_for_bfrs and no invalid geometries
UPDATE reporting_bushfire SET fire_boundary = ST_MakeValid(fire_boundary) WHERE NOT ST_IsValid(fire_boundary);
UPDATE reporting_state_forest SET shape = ST_MakeValid(shape) WHERE NOT ST_IsValid(shape);
UPDATE reporting_cadastre SET shape = ST_MakeValid(shape) WHERE NOT ST_IsValid(shape);
UPDATE reporting_dept_managed SET geometry = ST_MakeValid(geometry) WHERE NOT ST_IsValid(geometry);
UPDATE reporting_dept_interest SET geometry = ST_MakeValid(geometry) WHERE NOT ST_IsValid(geometry);
----------------------------------------
--GET REGION-CROSSING FIRES
----------------------------------------
DROP TABLE IF EXISTS reporting_crossregion_fires;
CREATE TABLE reporting_crossregion_fires AS SELECT DISTINCT bf.id FROM reporting_bushfire bf JOIN bfrs_region r ON ST_Overlaps(bf.fire_boundary, r.geometry);
DROP INDEX IF EXISTS idx_reporting_crossregion_fires;
CREATE INDEX idx_reporting_crossregion_fires ON reporting_crossregion_fires(id);
---------------------------------------
--UCL/Other Crown/Private Property 13 min
---------------------------------------
--insert recalculated 'other crown' / UCL / Freehold
--Other Crown 5min
INSERT INTO reporting_areaburnt (area, bushfire_id, tenure_id, region_id, has_fire_boundary)
SELECT ROUND((ST_Area(ST_Transform(ST_Intersection(bf.fire_boundary, cad.shape), 900914))/10000)::numeric,2), bf.id, 19, bf.region_id, True
FROM reporting_bushfire bf JOIN reporting_cadastre cad ON ST_Intersects(bf.fire_boundary, cad.shape)
WHERE brc_fms_legend = 'Other Crown Land' AND bf.report_status IN (3, 4) AND NOT bf.fire_not_found AND bf.id NOT IN (SELECT id FROM reporting_crossregion_fires);
--UCL 5min
INSERT INTO reporting_areaburnt (area, bushfire_id, tenure_id, region_id, has_fire_boundary)
SELECT ROUND((ST_Area(ST_Transform(ST_Intersection(bf.fire_boundary, cad.shape), 900914))/10000)::numeric,2), bf.id, 25, bf.region_id, True
FROM reporting_bushfire bf JOIN reporting_cadastre cad ON ST_Intersects(bf.fire_boundary, cad.shape)
WHERE brc_fms_legend = 'UCL' AND bf.report_status IN (3, 4) AND NOT bf.fire_not_found AND bf.id NOT IN (SELECT id FROM reporting_crossregion_fires);
--Freehold 15s
INSERT INTO reporting_areaburnt (area, bushfire_id, tenure_id, region_id, has_fire_boundary)
SELECT ROUND((ST_Area(ST_Transform(ST_Intersection(bf.fire_boundary, cad.shape), 900914))/10000)::numeric,2), bf.id, 18, bf.region_id, True
FROM reporting_bushfire bf JOIN reporting_cadastre cad ON ST_Intersects(bf.fire_boundary, cad.shape)
WHERE brc_fms_legend = 'Freehold' AND bf.report_status IN (3, 4) AND NOT bf.fire_not_found AND bf.id NOT IN (SELECT id FROM reporting_crossregion_fires);
--UPDATE tenure_id FOR IGNITION POINTS IN UCL, FREEHOLD AND OTHER CROWN
UPDATE reporting_bushfire bf SET tenure_id = 19 WHERE bf.id IN
(SELECT id FROM reporting_bushfire bf, reporting_cadastre cad WHERE ST_Within(bf.origin_point, cad.shape) AND cad.brc_fms_legend = 'Other Crown Land');
UPDATE reporting_bushfire bf SET tenure_id = 18 WHERE bf.id IN
(SELECT id FROM reporting_bushfire bf, reporting_cadastre cad WHERE ST_Within(bf.origin_point, cad.shape) AND cad.brc_fms_legend = 'Freehold');
UPDATE reporting_bushfire bf SET tenure_id = 25 WHERE bf.id IN
(SELECT id FROM reporting_bushfire bf, reporting_cadastre cad WHERE ST_Within(bf.origin_point, cad.shape) AND cad.brc_fms_legend = 'UCL');
-------------------------------------------
--DEPT LAND
---------------------------------------------
--INTEREST 20s
INSERT INTO reporting_areaburnt (area, bushfire_id, tenure_id, region_id, has_fire_boundary)
SELECT ROUND((ST_Area(ST_Transform(ST_Intersection(bf.fire_boundary, di.geometry), 900914))/10000)::numeric,2),
bf.id, t.id, bf.region_id, True
FROM reporting_bushfire bf JOIN reporting_dept_interest di ON ST_Intersects(bf.fire_boundary, di.geometry) JOIN bfrs_tenure t ON di.category = t.name
WHERE bf.report_status IN (3, 4) AND NOT bf.fire_not_found AND bf.id NOT IN (SELECT id FROM reporting_crossregion_fires);
--MANAGED 3min
INSERT INTO reporting_areaburnt (area, bushfire_id, tenure_id, region_id, has_fire_boundary)
SELECT ROUND((ST_Area(ST_Transform(ST_Intersection(bf.fire_boundary, dm.geometry), 900914))/10000)::numeric,2),
bf.id, t.id, bf.region_id, True
FROM reporting_bushfire bf JOIN reporting_dept_managed dm ON ST_Intersects(bf.fire_boundary, dm.geometry) JOIN bfrs_tenure t ON dm.category = t.name
WHERE dm.category <> 'State Forest' AND bf.report_status IN (3, 4) AND NOT bf.fire_not_found AND bf.id NOT IN (SELECT id FROM reporting_crossregion_fires);
--UPDATE tenure_id FOR OLD 'Other' TENURE IN DEPT-MANAGED LAND
UPDATE reporting_bushfire
SET tenure_id = t_id
FROM (SELECT bf.id AS bf_id, t.id AS t_id FROM reporting_bushfire bf, reporting_dept_managed dm
JOIN bfrs_tenure t ON dm.category = t.name
WHERE tenure_id = 20
AND st_within(bf.origin_point, dm.geometry)) AS sqry
WHERE id = bf_id;
--------------------------------------------------
--STATE FOREST 20s
--------------------------------------------------
--Hardwood 4s
INSERT INTO reporting_areaburnt (area, bushfire_id, tenure_id, region_id, has_fire_boundary)
SELECT ROUND((ST_Area(ST_Transform(ST_Intersection(bf.fire_boundary, sf.shape), 900914))/10000)::numeric,2), bf.id, 26, bf.region_id, True
FROM reporting_bushfire bf JOIN reporting_state_forest sf ON ST_Intersects(bf.fire_boundary, sf.shape)
WHERE fbr_fire_report_classification = 'Native Hardwood' AND bf.report_status IN (3, 4) AND NOT bf.fire_not_found AND bf.id NOT IN (SELECT id FROM reporting_crossregion_fires);
--Softwood 1s
INSERT INTO reporting_areaburnt (area, bushfire_id, tenure_id, region_id, has_fire_boundary)
SELECT ROUND((ST_Area(ST_Transform(ST_Intersection(bf.fire_boundary, sf.shape), 900914))/10000)::numeric,2), bf.id, 27, bf.region_id, True
FROM reporting_bushfire bf JOIN reporting_state_forest sf ON ST_Intersects(bf.fire_boundary, sf.shape)
WHERE fbr_fire_report_classification = 'State - Coniferous' AND bf.report_status IN (3, 4) AND NOT bf.fire_not_found AND bf.id NOT IN (SELECT id FROM reporting_crossregion_fires);
--where NOT has_fire_boundary
UPDATE reporting_areaburnt
SET tenure_id = 27 WHERE id IN
(SELECT ab.id
FROM reporting_areaburnt ab JOIN reporting_bushfire bf ON ab.bushfire_id = bf.id
JOIN reporting_state_forest sf ON ST_Within(bf.origin_point, sf.shape)
WHERE ab.tenure_id = 3 AND NOT has_fire_boundary AND sf.fbr_fire_report_classification = 'State - Coniferous');
--remaining '3's should be 26
UPDATE reporting_areaburnt
SET tenure_id = 26 WHERE id IN
(SELECT ab.id
FROM reporting_areaburnt ab JOIN reporting_bushfire bf ON ab.bushfire_id = bf.id
JOIN reporting_state_forest sf ON ST_Within(bf.origin_point, sf.shape)
WHERE ab.tenure_id = 3 AND NOT has_fire_boundary AND sf.fbr_fire_report_classification = 'Native Hardwood');
DELETE FROM reporting_areaburnt WHERE tenure_id = 3;
--UPDATE STATE FOREST IGNITION POINTS
UPDATE reporting_bushfire bf SET tenure_id = 26 WHERE bf.tenure_id = 3 AND bf.id IN
(SELECT id FROM reporting_bushfire bf, reporting_state_forest sf WHERE ST_Within(bf.origin_point, sf.shape) AND sf.fbr_fire_report_classification = 'Native Hardwood');
UPDATE reporting_bushfire bf SET tenure_id = 27 WHERE bf.tenure_id = 3 AND bf.id IN
(SELECT id FROM reporting_bushfire bf, reporting_state_forest sf WHERE ST_Within(bf.origin_point, sf.shape) AND sf.fbr_fire_report_classification = 'State - Coniferous');
---------------------------------------
--ADD IN INFO FOR REGION-CROSSING FIRES 20min in total
---------------------------------------
--SA/NT: insert into reporting_areaburnt the SA/NT components of trans-state fires (this is done USING r.name = t.name) 1 min
INSERT INTO reporting_areaburnt (area, bushfire_id, tenure_id, region_id, has_fire_boundary)
SELECT ROUND((ST_Area(ST_Transform(ST_Intersection(bf.fire_boundary, r.geometry), 900914))/10000)::numeric,2),
bf.id, t.id, r.id, True
FROM reporting_bushfire bf JOIN bfrs_region r ON ST_Intersects(bf.fire_boundary, r.geometry) JOIN bfrs_tenure t ON r.name = t.name;
--insert into reporting_areaburnt the Prvt Prpty / UCL / Other Crown Land components of trans-region fires (13 min)
--Other Crown Land
INSERT INTO reporting_areaburnt (area, bushfire_id, tenure_id, region_id, has_fire_boundary)
SELECT area, bushfire_id, 19, region_id, True
FROM (
SELECT SUM(ROUND((ST_Area(ST_Transform(ST_Intersection(ST_Intersection(bf.fire_boundary, cad.shape), r.geometry), 900914))/10000)::numeric, 2)) AS area,
bf.id as bushfire_id, r.id as region_id
FROM reporting_bushfire bf JOIN reporting_cadastre cad ON ST_Intersects(bf.fire_boundary, cad.shape) JOIN bfrs_region r ON ST_Intersects(bf.fire_boundary, r.geometry)
WHERE brc_fms_legend = 'Other Crown Land' AND bf.id IN (SELECT id FROM reporting_crossregion_fires) AND r.dbca
GROUP BY bf.id, r.id) AS sqry;
--UCL 3 min
INSERT INTO reporting_areaburnt (area, bushfire_id, tenure_id, region_id, has_fire_boundary)
SELECT area, bushfire_id, 25, region_id, True
FROM (
SELECT SUM(ROUND((ST_Area(ST_Transform(ST_Intersection(ST_Intersection(bf.fire_boundary, cad.shape), r.geometry), 900914))/10000)::numeric, 2)) AS area,
bf.id as bushfire_id, r.id as region_id
FROM reporting_bushfire bf JOIN reporting_cadastre cad ON ST_Intersects(bf.fire_boundary, cad.shape) JOIN bfrs_region r ON ST_Intersects(bf.fire_boundary, r.geometry)
WHERE brc_fms_legend = 'UCL' AND bf.id IN (SELECT id FROM reporting_crossregion_fires) AND r.dbca
GROUP BY bf.id, r.id) AS sqry;
--Private Property (Freehold) 30s OK
INSERT INTO reporting_areaburnt (area, bushfire_id, tenure_id, region_id, has_fire_boundary)
SELECT area, bushfire_id, 18, region_id, True
FROM (
SELECT SUM(ROUND((ST_Area(ST_Transform(ST_Intersection(ST_Intersection(bf.fire_boundary, cad.shape), r.geometry), 900914))/10000)::numeric, 2)) AS area,
bf.id as bushfire_id, r.id as region_id
FROM reporting_bushfire bf JOIN reporting_cadastre cad ON ST_Intersects(bf.fire_boundary, cad.shape) JOIN bfrs_region r ON ST_Intersects(bf.fire_boundary, r.geometry)
WHERE brc_fms_legend = 'Freehold' AND bf.id IN (SELECT id FROM reporting_crossregion_fires) and r.dbca
GROUP BY bf.id, r.id) AS sqry;
--State Forest (Hardwood) (4s)
INSERT INTO reporting_areaburnt (area, bushfire_id, tenure_id, region_id, has_fire_boundary)
SELECT area, bushfire_id, 26, region_id, True
FROM (
SELECT SUM(ROUND((ST_Area(ST_Transform(ST_Intersection(ST_Intersection(bf.fire_boundary, sf.shape), r.geometry), 900914))/10000)::numeric, 2)) AS area,
bf.id as bushfire_id, r.id as region_id
FROM reporting_bushfire bf JOIN reporting_state_forest sf ON ST_Intersects(bf.fire_boundary, sf.shape) JOIN bfrs_region r ON ST_Intersects(bf.fire_boundary, r.geometry)
WHERE fbr_fire_report_classification = 'Native Hardwood' AND bf.id IN (SELECT id FROM reporting_crossregion_fires) and r.dbca
GROUP BY bf.id, r.id) AS sqry;
--State Forest (Softwood) (4s)
INSERT INTO reporting_areaburnt (area, bushfire_id, tenure_id, region_id, has_fire_boundary)
SELECT area, bushfire_id, 27, region_id, True
FROM (
SELECT SUM(ROUND((ST_Area(ST_Transform(ST_Intersection(ST_Intersection(bf.fire_boundary, sf.shape), r.geometry), 900914))/10000)::numeric, 2)) AS area,
bf.id as bushfire_id, r.id as region_id
FROM reporting_bushfire bf JOIN reporting_state_forest sf ON ST_Intersects(bf.fire_boundary, sf.shape) JOIN bfrs_region r ON ST_Intersects(bf.fire_boundary, r.geometry)
WHERE fbr_fire_report_classification = 'State - Coniferous' AND bf.id IN (SELECT id FROM reporting_crossregion_fires) and r.dbca
GROUP BY bf.id, r.id) AS sqry;
--insert into reporting_areaburnt the Interest Tenure components of trans-region fires (8s)
INSERT INTO reporting_areaburnt (area, bushfire_id, tenure_id, region_id)
SELECT ROUND((ST_Area(ST_Transform(ST_Intersection(ST_Intersection(bf.fire_boundary, di.geometry), r.geometry), 900914))/10000)::numeric,2),
bf.id, t.id, r.id
FROM reporting_bushfire bf JOIN reporting_dept_interest di ON ST_Intersects(bf.fire_boundary, di.geometry) JOIN bfrs_region r ON ST_Intersects(bf.fire_boundary, r.geometry) JOIN bfrs_tenure t ON di.category = t.name
WHERE bf.id IN (SELECT id FROM reporting_crossregion_fires);
--insert into reporting_areaburnt the Managed Tenure components of trans-region fires (1:19)
INSERT INTO reporting_areaburnt (area, bushfire_id, tenure_id, region_id)
SELECT ROUND((ST_Area(ST_Transform(ST_Intersection(ST_Intersection(bf.fire_boundary, dm.geometry), r.geometry), 900914))/10000)::numeric,2),
bf.id, t.id, r.id
FROM reporting_bushfire bf JOIN reporting_dept_managed dm ON ST_Intersects(bf.fire_boundary, dm.geometry) JOIN bfrs_region r ON ST_Intersects(bf.fire_boundary, r.geometry) JOIN bfrs_tenure t ON dm.category = t.name
WHERE dm.category <> 'State Forest' AND bf.id IN (SELECT id FROM reporting_crossregion_fires);
""")
return HttpResponseRedirect(url)
| 48.026607
| 261
| 0.618833
| 18,341
| 138,989
| 4.427512
| 0.035222
| 0.018102
| 0.030663
| 0.024974
| 0.866375
| 0.823201
| 0.793079
| 0.765113
| 0.742799
| 0.7137
| 0
| 0.016378
| 0.260208
| 138,989
| 2,893
| 262
| 48.043208
| 0.773378
| 0.026204
| 0
| 0.623326
| 0
| 0.034989
| 0.268839
| 0.054879
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0.011663
| null | null | 0.009935
| 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
|
91128dc8a4e8ca5efe21e1ff4ca6e40c630080d3
| 284
|
py
|
Python
|
python/if.py
|
dambergn/programing-examples
|
d1086047caa52c7cc6d2e7877cbbbebd2a1cbee0
|
[
"MIT"
] | null | null | null |
python/if.py
|
dambergn/programing-examples
|
d1086047caa52c7cc6d2e7877cbbbebd2a1cbee0
|
[
"MIT"
] | null | null | null |
python/if.py
|
dambergn/programing-examples
|
d1086047caa52c7cc6d2e7877cbbbebd2a1cbee0
|
[
"MIT"
] | null | null | null |
#!/usr/bin/env python3
a = 33
b = 200
if b > a:
print("b is greater than a")
if b > a:
print("b is greater than a")
elif a == b:
print("a and b are equal")
if b > a:
print("b is greater than a")
elif a == b:
print("a and b are equal")
else:
print("a is greater than b")
| 15.777778
| 30
| 0.588028
| 60
| 284
| 2.783333
| 0.3
| 0.215569
| 0.311377
| 0.161677
| 0.718563
| 0.718563
| 0.718563
| 0.718563
| 0.718563
| 0.57485
| 0
| 0.028436
| 0.257042
| 284
| 18
| 31
| 15.777778
| 0.763033
| 0.073944
| 0
| 0.714286
| 0
| 0
| 0.418251
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.428571
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 1
| 1
| 1
| 1
| 0
| 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
| 1
|
0
| 9
|
91273e6b2bf5a8248e761db96708485fe1742dca
| 7,120
|
py
|
Python
|
stage/test_cassandra_stages.py
|
Sentienz/datacollector-tests
|
ca27988351dc3366488098b5db6c85a8be2f7b85
|
[
"Apache-2.0"
] | null | null | null |
stage/test_cassandra_stages.py
|
Sentienz/datacollector-tests
|
ca27988351dc3366488098b5db6c85a8be2f7b85
|
[
"Apache-2.0"
] | null | null | null |
stage/test_cassandra_stages.py
|
Sentienz/datacollector-tests
|
ca27988351dc3366488098b5db6c85a8be2f7b85
|
[
"Apache-2.0"
] | 1
|
2019-10-29T08:46:11.000Z
|
2019-10-29T08:46:11.000Z
|
# Copyright 2017 StreamSets Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import json
import logging
import string
from streamsets.testframework.markers import cassandra
from streamsets.testframework.markers import sdc_min_version
from streamsets.testframework.utils import get_random_string
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
# pylint: disable=not-an-iterable, pointless-statement, redefined-outer-name, too-many-locals
@cassandra
def test_cassandra_destination(sdc_builder, sdc_executor, cassandra):
"""Test for Cassandra destination stage. Support to test Kerberos or plain text only. The pipeline looks like:
dev_raw_data_source >> cassandra_destination
"""
raw_dict = [dict(contact=dict(name='Jane Smith', phone=2124050000, zip_code=27023)),
dict(contact=dict(name='San', phone=2120998998, zip_code=14305))]
raw_data = json.dumps(raw_dict)
cassandra_keyspace = get_random_string(string.ascii_letters, 10)
cassandra_table = 'contact'
builder = sdc_builder.get_pipeline_builder()
dev_raw_data_source = builder.add_stage('Dev Raw Data Source')
dev_raw_data_source.set_attributes(data_format='JSON', json_content='ARRAY_OBJECTS', raw_data=raw_data)
cassandra_destination = builder.add_stage('Cassandra', type='destination')
cassandra_destination.set_attributes(field_to_column_mapping=[
{'field': '/contact/name', 'columnName': 'name'},
{'field': '/contact/zip_code', 'columnName': 'zip_code'},
{'field': '/contact/phone', 'columnName': 'phone'}],
fully_qualified_table_name=f'{cassandra_keyspace}.{cassandra_table}',
protocol_version='V4')
if cassandra.kerberos_enabled:
cassandra_destination.set_attributes(authentication_provider='KERBEROS')
else:
cassandra_destination.set_attributes(authentication_provider='PLAINTEXT', password=cassandra.password,
username=cassandra.username)
dev_raw_data_source >> cassandra_destination
pipeline = builder.build(title='Cassandra Destination pipeline').configure_for_environment(cassandra)
sdc_executor.add_pipeline(pipeline)
try:
client = cassandra.client
cluster = client.cluster
session = client.session
# create Cassandra required tables before pipeline can put data
session.execute(f"CREATE KEYSPACE {cassandra_keyspace} WITH replication = "
f"{{'class': 'SimpleStrategy', 'replication_factor': 1}}")
session.execute(f'CREATE TABLE {cassandra_keyspace}.{cassandra_table} '
f'(name text PRIMARY KEY, zip_code int, phone int)')
sdc_executor.start_pipeline(pipeline).wait_for_pipeline_batch_count(1)
sdc_executor.stop_pipeline(pipeline)
# read data from Cassandra and assert to what pipeline has ingested
rows = session.execute(f'SELECT * FROM {cassandra_keyspace}.{cassandra_table}').current_rows
assert len(rows) == len(raw_dict)
for index, row in enumerate(rows):
for key, value in raw_dict[index]['contact'].items():
assert getattr(row, key) == value
finally:
# drop table and keyspace from Cassandra
session.execute(f'DROP TABLE {cassandra_keyspace}.{cassandra_table}')
session.execute(f'DROP KEYSPACE {cassandra_keyspace}')
cluster.shutdown()
@cassandra
@sdc_min_version('3.11.0')
def test_cassandra_destination_no_batch(sdc_builder, sdc_executor, cassandra):
"""Test for Cassandra destination stage. Support to test Kerberos or plain text only. The pipeline looks like:
dev_raw_data_source >> cassandra_destination
"""
raw_dict = [dict(contact=dict(name='Jane Smith', phone=2124050000, zip_code=27023)),
dict(contact=dict(name='San', phone=2120998998, zip_code=14305))]
raw_data = json.dumps(raw_dict)
cassandra_keyspace = get_random_string(string.ascii_letters, 10)
cassandra_table = 'contact'
builder = sdc_builder.get_pipeline_builder()
dev_raw_data_source = builder.add_stage('Dev Raw Data Source')
dev_raw_data_source.set_attributes(data_format='JSON', json_content='ARRAY_OBJECTS', raw_data=raw_data)
cassandra_destination = builder.add_stage('Cassandra', type='destination')
cassandra_destination.set_attributes(field_to_column_mapping=[
{'field': '/contact/name', 'columnName': 'name'},
{'field': '/contact/zip_code', 'columnName': 'zip_code'},
{'field': '/contact/phone', 'columnName': 'phone'}],
fully_qualified_table_name=f'{cassandra_keyspace}.{cassandra_table}',
protocol_version='V4', disable_batch_insert=True)
if cassandra.kerberos_enabled:
cassandra_destination.set_attributes(authentication_provider='KERBEROS')
else:
cassandra_destination.set_attributes(authentication_provider='PLAINTEXT', password=cassandra.password,
username=cassandra.username)
dev_raw_data_source >> cassandra_destination
pipeline = builder.build(title='Cassandra Destination pipeline').configure_for_environment(cassandra)
sdc_executor.add_pipeline(pipeline)
try:
client = cassandra.client
cluster = client.cluster
session = client.session
# create Cassandra required tables before pipeline can put data
session.execute(f"CREATE KEYSPACE {cassandra_keyspace} WITH replication = "
f"{{'class': 'SimpleStrategy', 'replication_factor': 1}}")
session.execute(f'CREATE TABLE {cassandra_keyspace}.{cassandra_table} '
f'(name text PRIMARY KEY, zip_code int, phone int)')
sdc_executor.start_pipeline(pipeline).wait_for_pipeline_batch_count(1)
sdc_executor.stop_pipeline(pipeline)
# read data from Cassandra and assert to what pipeline has ingested
rows = session.execute(f'SELECT * FROM {cassandra_keyspace}.{cassandra_table}').current_rows
assert len(rows) == len(raw_dict)
for index, row in enumerate(rows):
for key, value in raw_dict[index]['contact'].items():
assert getattr(row, key) == value
finally:
# drop table and keyspace from Cassandra
session.execute(f'DROP TABLE {cassandra_keyspace}.{cassandra_table}')
session.execute(f'DROP KEYSPACE {cassandra_keyspace}')
cluster.shutdown()
| 48.767123
| 114
| 0.697331
| 837
| 7,120
| 5.712067
| 0.241338
| 0.075298
| 0.020916
| 0.033466
| 0.833298
| 0.816566
| 0.816566
| 0.816566
| 0.816566
| 0.816566
| 0
| 0.014495
| 0.205478
| 7,120
| 145
| 115
| 49.103448
| 0.830652
| 0.180758
| 0
| 0.865979
| 0
| 0
| 0.216029
| 0.059893
| 0
| 0
| 0
| 0
| 0.041237
| 1
| 0.020619
| false
| 0.020619
| 0.061856
| 0
| 0.082474
| 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
|
e6738b0a6c59388973734b1e9a17951a095341a0
| 3,077
|
py
|
Python
|
joeynmt/embeddings.py
|
DavidHector/joeynmt
|
dc6970fe93f960bb9cbbed81a05bd5ff7f83b7bb
|
[
"Apache-2.0"
] | null | null | null |
joeynmt/embeddings.py
|
DavidHector/joeynmt
|
dc6970fe93f960bb9cbbed81a05bd5ff7f83b7bb
|
[
"Apache-2.0"
] | null | null | null |
joeynmt/embeddings.py
|
DavidHector/joeynmt
|
dc6970fe93f960bb9cbbed81a05bd5ff7f83b7bb
|
[
"Apache-2.0"
] | null | null | null |
import math
from torch import nn, Tensor
from joeynmt.helpers import freeze_params
class Embeddings(nn.Module):
"""
Simple embeddings class
"""
# pylint: disable=unused-argument
def __init__(self,
embedding_dim: int = 64,
scale: bool = False,
vocab_size: int = 0,
padding_idx: int = 1,
freeze: bool = False,
**kwargs):
"""
Create new embeddings for the vocabulary.
Use scaling for the Transformer.
:param embedding_dim:
:param scale:
:param vocab_size:
:param padding_idx:
:param freeze: freeze the embeddings during training
"""
super(Embeddings, self).__init__()
self.embedding_dim = embedding_dim
self.scale = scale
self.vocab_size = vocab_size
self.lut = nn.Embedding(vocab_size, self.embedding_dim,
padding_idx=padding_idx)
if freeze:
freeze_params(self)
# pylint: disable=arguments-differ
def forward(self, x: Tensor) -> Tensor:
"""
Perform lookup for input `x` in the embedding table.
:param x: index in the vocabulary
:return: embedded representation for `x`
"""
if self.scale:
return self.lut(x) * math.sqrt(self.embedding_dim)
return self.lut(x)
def __repr__(self):
return "%s(embedding_dim=%d, vocab_size=%d)" % (
self.__class__.__name__, self.embedding_dim, self.vocab_size)
class Embeddings_Audio(nn.Module):
"""
Simple embeddings class
"""
# pylint: disable=unused-argument
def __init__(self,
embedding_dim: int = 64,
scale: bool = False,
vocab_size: int = 0,
padding_idx: int = 1,
freeze: bool = False,
**kwargs):
"""
Create new embeddings for the vocabulary.
Use scaling for the Transformer.
:param embedding_dim:
:param scale:
:param vocab_size:
:param padding_idx:
:param freeze: freeze the embeddings during training
"""
super(Embeddings_Audio, self).__init__()
self.embedding_dim = embedding_dim
self.scale = scale
self.vocab_size = vocab_size
# self.lut = nn.Embedding(vocab_size, self.embedding_dim,
# padding_idx=padding_idx)
if freeze:
freeze_params(self)
# pylint: disable=arguments-differ
def forward(self, x: Tensor) -> Tensor:
"""
Perform lookup for input `x` in the embedding table.
:param x: index in the vocabulary
:return: embedded representation for `x`
"""
if self.scale:
return x * math.sqrt(self.embedding_dim)
return x
def __repr__(self):
return "%s(embedding_dim=%d, vocab_size=%d)" % (
self.__class__.__name__, self.embedding_dim, self.vocab_size)
| 28.757009
| 73
| 0.566136
| 337
| 3,077
| 4.922849
| 0.20178
| 0.115732
| 0.096444
| 0.048222
| 0.925859
| 0.925859
| 0.925859
| 0.888487
| 0.888487
| 0.888487
| 0
| 0.003968
| 0.344816
| 3,077
| 106
| 74
| 29.028302
| 0.818948
| 0.307442
| 0
| 0.723404
| 0
| 0
| 0.037333
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.12766
| false
| 0
| 0.06383
| 0.042553
| 0.361702
| 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
|
e686bda7e7a49915c68832f065ef4cf70e9c7ee6
| 111
|
py
|
Python
|
utils/__init__.py
|
steliossid/twitter-sentiment-analysis
|
6ce9aa7ff1a6bd8dd1c0358cd25d8fb38e7713fb
|
[
"MIT"
] | 1
|
2020-06-12T14:57:10.000Z
|
2020-06-12T14:57:10.000Z
|
utils/__init__.py
|
steliossid/twitter-sentiment-analysis
|
6ce9aa7ff1a6bd8dd1c0358cd25d8fb38e7713fb
|
[
"MIT"
] | null | null | null |
utils/__init__.py
|
steliossid/twitter-sentiment-analysis
|
6ce9aa7ff1a6bd8dd1c0358cd25d8fb38e7713fb
|
[
"MIT"
] | null | null | null |
from utils import read_write
from utils import db_utils
from utils import frames
from utils import stream_util
| 22.2
| 29
| 0.855856
| 19
| 111
| 4.842105
| 0.473684
| 0.391304
| 0.652174
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.144144
| 111
| 4
| 30
| 27.75
| 0.968421
| 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
|
e69ed723449880568f64334b9eeca0f2ffdd88fb
| 24
|
py
|
Python
|
test/regression/features/bytestrings/hex_bytes_escaped_bytestring.py
|
bjpop/blip
|
3d9105a44d1afb7bd007da3742fb19dc69372e10
|
[
"BSD-3-Clause"
] | 137
|
2015-02-13T21:03:23.000Z
|
2021-11-24T03:53:55.000Z
|
test/regression/features/bytestrings/hex_bytes_escaped_bytestring.py
|
bjpop/blip
|
3d9105a44d1afb7bd007da3742fb19dc69372e10
|
[
"BSD-3-Clause"
] | 2
|
2015-03-07T14:08:33.000Z
|
2015-10-13T02:00:40.000Z
|
test/regression/features/bytestrings/hex_bytes_escaped_bytestring.py
|
bjpop/blip
|
3d9105a44d1afb7bd007da3742fb19dc69372e10
|
[
"BSD-3-Clause"
] | 4
|
2015-05-03T22:07:27.000Z
|
2018-09-10T08:55:03.000Z
|
print(b'\x80\x02\x88.')
| 12
| 23
| 0.625
| 5
| 24
| 3
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.26087
| 0.041667
| 24
| 1
| 24
| 24
| 0.391304
| 0
| 0
| 0
| 0
| 0
| 0.541667
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 7
|
e6b21aeed359d6cf4f2a672853c6f7184446c0eb
| 9,218
|
py
|
Python
|
tests/test_connection.py
|
khsing/SchemaObject
|
8318fd40309ade4158e4995528dead4ed149c5b9
|
[
"Apache-2.0"
] | 18
|
2015-04-11T18:28:07.000Z
|
2020-12-11T08:14:48.000Z
|
tests/test_connection.py
|
khsing/SchemaObject
|
8318fd40309ade4158e4995528dead4ed149c5b9
|
[
"Apache-2.0"
] | 8
|
2015-09-03T18:38:48.000Z
|
2020-01-25T21:40:47.000Z
|
tests/test_connection.py
|
khsing/SchemaObject
|
8318fd40309ade4158e4995528dead4ed149c5b9
|
[
"Apache-2.0"
] | 27
|
2015-02-20T22:01:39.000Z
|
2021-07-12T15:39:29.000Z
|
#!/usr/bin/python
"""
Tests for the Database Connection URL (RFC 1738)
http://www.ietf.org/rfc/rfc1738.txt
"""
import unittest
from schemaobject.connection import REGEX_RFC1738
from schemaobject.connection import build_database_url
class TestDatabaseURL(unittest.TestCase):
def test_user_pw_host_port_db(self):
test = "mysql://user:password@localhost:3306/database"
matches = REGEX_RFC1738.match(test)
self.assertTrue(matches)
self.assertEqual(matches.group('protocol'), 'mysql')
self.assertEqual(matches.group('username'), 'user')
self.assertEqual(matches.group('password'), 'password')
self.assertEqual(matches.group('host'), 'localhost')
self.assertEqual(matches.group('port'), '3306')
self.assertEqual(matches.group('database'), 'database')
def test_user_pw_host_db(self):
test = "mysql://user:password@localhost/database"
matches = REGEX_RFC1738.match(test)
self.assertTrue(matches)
self.assertEqual(matches.group('protocol'), 'mysql')
self.assertEqual(matches.group('username'), 'user')
self.assertEqual(matches.group('password'), 'password')
self.assertEqual(matches.group('host'), 'localhost')
self.assertEqual(matches.group('port'), None)
self.assertEqual(matches.group('database'), 'database')
def test_user_pw_db(self):
test = "mysql://user:password@/database"
matches = REGEX_RFC1738.match(test)
self.assertTrue(matches)
self.assertEqual(matches.group('protocol'), 'mysql')
self.assertEqual(matches.group('username'), 'user')
self.assertEqual(matches.group('password'), 'password')
self.assertEqual(matches.group('host'), '')
self.assertEqual(matches.group('port'), None)
self.assertEqual(matches.group('database'), 'database')
def test_host_port_db(self):
test = "mysql://localhost:3306/database"
matches = REGEX_RFC1738.match(test)
self.assertTrue(matches)
self.assertEqual(matches.group('protocol'), 'mysql')
self.assertEqual(matches.group('username'), None)
self.assertEqual(matches.group('password'), None)
self.assertEqual(matches.group('host'), 'localhost')
self.assertEqual(matches.group('port'), '3306')
self.assertEqual(matches.group('database'), 'database')
def test_host_db(self):
test = "mysql://localhost/database"
matches = REGEX_RFC1738.match(test)
self.assertTrue(matches)
self.assertEqual(matches.group('protocol'), 'mysql')
self.assertEqual(matches.group('username'), None)
self.assertEqual(matches.group('password'), None)
self.assertEqual(matches.group('host'), 'localhost')
self.assertEqual(matches.group('port'), None)
self.assertEqual(matches.group('database'), 'database')
def test_host(self):
test = "mysql://localhost"
matches = REGEX_RFC1738.match(test)
self.assertTrue(matches)
self.assertEqual(matches.group('protocol'), 'mysql')
self.assertEqual(matches.group('username'), None)
self.assertEqual(matches.group('password'), None)
self.assertEqual(matches.group('host'), 'localhost')
self.assertEqual(matches.group('port'), None)
self.assertEqual(matches.group('database'), None)
def test_host_port(self):
test = "mysql://localhost:3306"
matches = REGEX_RFC1738.match(test)
self.assertTrue(matches)
self.assertEqual(matches.group('protocol'), 'mysql')
self.assertEqual(matches.group('username'), None)
self.assertEqual(matches.group('password'), None)
self.assertEqual(matches.group('host'), 'localhost')
self.assertEqual(matches.group('port'), '3306')
self.assertEqual(matches.group('database'), None)
def test_db(self):
test = "mysql:///database"
matches = REGEX_RFC1738.match(test)
self.assertTrue(matches)
self.assertEqual(matches.group('protocol'), 'mysql')
self.assertEqual(matches.group('username'), None)
self.assertEqual(matches.group('password'), None)
self.assertEqual(matches.group('host'), '')
self.assertEqual(matches.group('port'), None)
def test_empty_user_host_port_db(self):
test = "mysql://@localhost:3306/database"
matches = REGEX_RFC1738.match(test)
self.assertTrue(matches)
self.assertEqual(matches.group('protocol'), 'mysql')
self.assertEqual(matches.group('username'), '')
self.assertEqual(matches.group('password'), None)
self.assertEqual(matches.group('host'), 'localhost')
self.assertEqual(matches.group('port'), '3306')
self.assertEqual(matches.group('database'), 'database')
def test_empty_user_host_port(self):
test = "mysql://@localhost:3306"
matches = REGEX_RFC1738.match(test)
self.assertTrue(matches)
self.assertEqual(matches.group('protocol'), 'mysql')
self.assertEqual(matches.group('username'), '')
self.assertEqual(matches.group('password'), None)
self.assertEqual(matches.group('host'), 'localhost')
self.assertEqual(matches.group('port'), '3306')
self.assertEqual(matches.group('database'), None)
def test_empty_user_host_db(self):
test = "mysql://@localhost/database"
matches = REGEX_RFC1738.match(test)
self.assertTrue(matches)
self.assertEqual(matches.group('protocol'), 'mysql')
self.assertEqual(matches.group('username'), '')
self.assertEqual(matches.group('password'), None)
self.assertEqual(matches.group('host'), 'localhost')
self.assertEqual(matches.group('port'), None)
self.assertEqual(matches.group('database'), 'database')
def test_empty_user_db(self):
test = "mysql://@/database"
matches = REGEX_RFC1738.match(test)
self.assertTrue(matches)
self.assertEqual(matches.group('protocol'), 'mysql')
self.assertEqual(matches.group('username'), '')
self.assertEqual(matches.group('password'), None)
self.assertEqual(matches.group('host'), '')
self.assertEqual(matches.group('port'), None)
self.assertEqual(matches.group('database'), 'database')
def test_user_host_port_db(self):
test = "mysql://user@localhost:3306/database"
matches = REGEX_RFC1738.match(test)
self.assertTrue(matches)
self.assertEqual(matches.group('protocol'), 'mysql')
self.assertEqual(matches.group('username'), 'user')
self.assertEqual(matches.group('password'), None)
self.assertEqual(matches.group('host'), 'localhost')
self.assertEqual(matches.group('port'), '3306')
self.assertEqual(matches.group('database'), 'database')
def test_user_host_db(self):
test = "mysql://user@localhost/database"
matches = REGEX_RFC1738.match(test)
self.assertTrue(matches)
self.assertEqual(matches.group('protocol'), 'mysql')
self.assertEqual(matches.group('username'), 'user')
self.assertEqual(matches.group('password'), None)
self.assertEqual(matches.group('host'), 'localhost')
self.assertEqual(matches.group('port'), None)
self.assertEqual(matches.group('database'), 'database')
def test_user_host_port(self):
test = "mysql://user@localhost:3306"
matches = REGEX_RFC1738.match(test)
self.assertTrue(matches)
self.assertEqual(matches.group('protocol'), 'mysql')
self.assertEqual(matches.group('username'), 'user')
self.assertEqual(matches.group('password'), None)
self.assertEqual(matches.group('host'), 'localhost')
self.assertEqual(matches.group('port'), '3306')
self.assertEqual(matches.group('database'), None)
def test_user_db(self):
test = "mysql://user@/database"
matches = REGEX_RFC1738.match(test)
self.assertTrue(matches)
self.assertEqual(matches.group('protocol'), 'mysql')
self.assertEqual(matches.group('username'), 'user')
self.assertEqual(matches.group('password'), None)
self.assertEqual(matches.group('host'), '')
self.assertEqual(matches.group('port'), None)
def test_user_pw(self):
test = "mysql://user:password@"
matches = REGEX_RFC1738.match(test)
self.assertTrue(matches)
self.assertEqual(matches.group('protocol'), 'mysql')
self.assertEqual(matches.group('username'), 'user')
self.assertEqual(matches.group('password'), 'password')
self.assertEqual(matches.group('host'), '')
self.assertEqual(matches.group('port'), None)
def test_build_url_host(self):
url = build_database_url('host')
self.assertEqual(url, 'mysql://root@host:3306/')
def test_build_url_database(self):
url = build_database_url(host='host', password='pwd', database='test')
self.assertEqual(url, 'mysql://root:pwd@host:3306/test')
def test_build_url_missed_host(self):
self.assertRaises(TypeError, build_database_url)
| 40.429825
| 78
| 0.655674
| 993
| 9,218
| 5.998993
| 0.052367
| 0.254323
| 0.36562
| 0.448716
| 0.932349
| 0.913043
| 0.890381
| 0.876112
| 0.874266
| 0.874266
| 0
| 0.019303
| 0.190714
| 9,218
| 228
| 79
| 40.429825
| 0.779223
| 0.010957
| 0
| 0.743017
| 0
| 0
| 0.170911
| 0.051482
| 0
| 0
| 0
| 0
| 0.664804
| 1
| 0.111732
| false
| 0.122905
| 0.01676
| 0
| 0.134078
| 0
| 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
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 12
|
fc07bfd6672c70bdc90c57049bd3c8610df0b6cf
| 11,134
|
py
|
Python
|
automate/others.py
|
architsakhadeo/Text-Summarizer
|
da48f2883219f3c8fef490f7cf6c39b2a3883212
|
[
"MIT"
] | null | null | null |
automate/others.py
|
architsakhadeo/Text-Summarizer
|
da48f2883219f3c8fef490f7cf6c39b2a3883212
|
[
"MIT"
] | null | null | null |
automate/others.py
|
architsakhadeo/Text-Summarizer
|
da48f2883219f3c8fef490f7cf6c39b2a3883212
|
[
"MIT"
] | null | null | null |
import os
docs = os.listdir('duc2001_docs/')
for doc in docs:
print '\n\n***********' + str(docs.index(doc)) + '***********\n\n'
print '\n\n***********' + doc + '***********\n\n'
'''
file_size = int(os.stat('duc2001_docs/'+doc).st_size)
size_10 = (int(os.stat('final_excess/excess_0.10/mycode/'+doc.replace('_Reference2','_System230')).st_size)+int(os.stat('final_excess/excess_0.10/nowinnowing/'+doc.replace('_Reference2','_System2320')).st_size)+int(os.stat('final_excess/excess_0.10/keywordsubject/'+doc.replace('_Reference2','_System270')).st_size))/3.0
size_15 = (int(os.stat('final_excess/excess_0.15/mycode/'+doc.replace('_Reference2','_System230')).st_size)+int(os.stat('final_excess/excess_0.15/nowinnowing/'+doc.replace('_Reference2','_System2320')).st_size)+int(os.stat('final_excess/excess_0.15/keywordsubject/'+doc.replace('_Reference2','_System270')).st_size))/3.0
size_20 = (int(os.stat('final_excess/excess_0.20/mycode/'+doc.replace('_Reference2','_System230')).st_size)+int(os.stat('final_excess/excess_0.20/nowinnowing/'+doc.replace('_Reference2','_System2320')).st_size)+int(os.stat('final_excess/excess_0.20/keywordsubject/'+doc.replace('_Reference2','_System270')).st_size))/3.0
size_25 =(int(os.stat('final_excess/excess_0.25/mycode/'+doc.replace('_Reference2','_System230')).st_size)+int(os.stat('final_excess/excess_0.25/nowinnowing/'+doc.replace('_Reference2','_System2320')).st_size)+int(os.stat('final_excess/excess_0.25/keywordsubject/'+doc.replace('_Reference2','_System270')).st_size))/3.0
size_33 = (int(os.stat('final_excess/excess_0.33/mycode/'+doc.replace('_Reference2','_System230')).st_size)+int(os.stat('final_excess/excess_0.33/nowinnowing/'+doc.replace('_Reference2','_System2320')).st_size)+int(os.stat('final_excess/excess_0.33/keywordsubject/'+doc.replace('_Reference2','_System270')).st_size))/3.0
size_39 = (int(os.stat('final_excess/excess_0.39/mycode/'+doc.replace('_Reference2','_System230')).st_size)+int(os.stat('final_excess/excess_0.39/nowinnowing/'+doc.replace('_Reference2','_System2320')).st_size)+int(os.stat('final_excess/excess_0.39/keywordsubject/'+doc.replace('_Reference2','_System270')).st_size))/3.0
size_45 = (int(os.stat('final_excess/excess_0.46/mycode/'+doc.replace('_Reference2','_System230')).st_size)+int(os.stat('final_excess/excess_0.46/nowinnowing/'+doc.replace('_Reference2','_System2320')).st_size)+int(os.stat('final_excess/excess_0.46/keywordsubject/'+doc.replace('_Reference2','_System270')).st_size))/3.0
percent_10 = int(round(100.0*size_10/file_size))
percent_15 = int(round(100.0*size_15/file_size))
percent_20 = int(round(100.0*size_20/file_size))
percent_25 = int(round(100.0*size_25/file_size))
percent_33 = int(round(100.0*size_33/file_size))
percent_39 = int(round(100.0*size_39/file_size))
percent_45 = int(round(100.0*size_45/file_size))
'''
file_size = len(open('duc2001_docs/'+doc,'r').readlines())
size_10 = (len(open('final_excess/excess_0.10/mycode/'+doc.replace('_Reference2','_System230'),'r').readlines())+len(open('final_excess/excess_0.10/nowinnowing/'+doc.replace('_Reference2','_System2320'),'r').readlines())+len(open('final_excess/excess_0.10/keywordsubject/'+doc.replace('_Reference2','_System270'),'r').readlines()))/3.0
size_15 = (len(open('final_excess/excess_0.15/mycode/'+doc.replace('_Reference2','_System230'),'r').readlines())+len(open('final_excess/excess_0.15/nowinnowing/'+doc.replace('_Reference2','_System2320'),'r').readlines())+len(open('final_excess/excess_0.15/keywordsubject/'+doc.replace('_Reference2','_System270'),'r').readlines()))/3.0
size_20 = (len(open('final_excess/excess_0.20/mycode/'+doc.replace('_Reference2','_System230'),'r').readlines())+len(open('final_excess/excess_0.20/nowinnowing/'+doc.replace('_Reference2','_System2320'),'r').readlines())+len(open('final_excess/excess_0.20/keywordsubject/'+doc.replace('_Reference2','_System270'),'r').readlines()))/3.0
size_25 = (len(open('final_excess/excess_0.25/mycode/'+doc.replace('_Reference2','_System230'),'r').readlines())+len(open('final_excess/excess_0.25/nowinnowing/'+doc.replace('_Reference2','_System2320'),'r').readlines())+len(open('final_excess/excess_0.25/keywordsubject/'+doc.replace('_Reference2','_System270'),'r').readlines()))/3.0
size_33 = (len(open('final_excess/excess_0.33/mycode/'+doc.replace('_Reference2','_System230'),'r').readlines())+len(open('final_excess/excess_0.33/nowinnowing/'+doc.replace('_Reference2','_System2320'),'r').readlines())+len(open('final_excess/excess_0.33/keywordsubject/'+doc.replace('_Reference2','_System270'),'r').readlines()))/3.0
size_39 = (len(open('final_excess/excess_0.39/mycode/'+doc.replace('_Reference2','_System230'),'r').readlines())+len(open('final_excess/excess_0.39/nowinnowing/'+doc.replace('_Reference2','_System2320'),'r').readlines())+len(open('final_excess/excess_0.39/keywordsubject/'+doc.replace('_Reference2','_System270'),'r').readlines()))/3.0
size_45 = (len(open('final_excess/excess_0.46/mycode/'+doc.replace('_Reference2','_System230'),'r').readlines())+len(open('final_excess/excess_0.46/nowinnowing/'+doc.replace('_Reference2','_System2320'),'r').readlines())+len(open('final_excess/excess_0.46/keywordsubject/'+doc.replace('_Reference2','_System270'),'r').readlines()))/3.0
percent_10 = int(round(100.0*size_10/file_size))
percent_15 = int(round(100.0*size_15/file_size))
percent_20 = int(round(100.0*size_20/file_size))
percent_25 = int(round(100.0*size_25/file_size))
percent_33 = int(round(100.0*size_33/file_size))
percent_39 = int(round(100.0*size_39/file_size))
percent_45 = int(round(100.0*size_45/file_size))
os.system('sumy luhn --length='+str(percent_10)+'% --file=duc2001_docs/'+doc + ' > 10/luhn/'+doc.replace('Reference2','System21'))
print '10_luhn'
os.system('sumy luhn --length='+str(percent_15)+'% --file=duc2001_docs/'+doc + ' > 15/luhn/'+doc.replace('Reference2','System21'))
print '15_luhn'
os.system('sumy luhn --length='+str(percent_20)+'% --file=duc2001_docs/'+doc + ' > 20/luhn/'+doc.replace('Reference2','System21'))
print '20_luhn'
os.system('sumy luhn --length='+str(percent_25)+'% --file=duc2001_docs/'+doc + ' > 25/luhn/'+doc.replace('Reference2','System21'))
print '25_luhn'
os.system('sumy luhn --length='+str(percent_33)+'% --file=duc2001_docs/'+doc + ' > 33/luhn/'+doc.replace('Reference2','System21'))
print '33_luhn'
os.system('sumy luhn --length='+str(percent_39)+'% --file=duc2001_docs/'+doc + ' > 39/luhn/'+doc.replace('Reference2','System21'))
print '39_luhn'
os.system('sumy luhn --length='+str(percent_45)+'% --file=duc2001_docs/'+doc + ' > 45/luhn/'+doc.replace('Reference2','System21'))
print '45_luhn'
os.system('sumy edmundson --length='+str(percent_10)+'% --file=duc2001_docs/'+doc + ' > 10/edmundson/'+doc.replace('Reference2','System22'))
print '10_edmundson'
os.system('sumy edmundson --length='+str(percent_15)+'% --file=duc2001_docs/'+doc + ' > 15/edmundson/'+doc.replace('Reference2','System22'))
print '15_edmundson'
os.system('sumy edmundson --length='+str(percent_20)+'% --file=duc2001_docs/'+doc + ' > 20/edmundson/'+doc.replace('Reference2','System22'))
print '20_edmundson'
os.system('sumy edmundson --length='+str(percent_25)+'% --file=duc2001_docs/'+doc + ' > 25/edmundson/'+doc.replace('Reference2','System22'))
print '25_edmundson'
os.system('sumy edmundson --length='+str(percent_33)+'% --file=duc2001_docs/'+doc + ' > 33/edmundson/'+doc.replace('Reference2','System22'))
print '33_edmundson'
os.system('sumy edmundson --length='+str(percent_39)+'% --file=duc2001_docs/'+doc + ' > 39/edmundson/'+doc.replace('Reference2','System22'))
print '39_edmundson'
os.system('sumy edmundson --length='+str(percent_45)+'% --file=duc2001_docs/'+doc + ' > 45/edmundson/'+doc.replace('Reference2','System22'))
print '45_edmundson'
os.system('sumy lsa --length='+str(percent_10)+'% --file=duc2001_docs/'+doc + ' > 10/lsa/'+doc.replace('Reference2','System23'))
print '10_lsa'
os.system('sumy lsa --length='+str(percent_15)+'% --file=duc2001_docs/'+doc + ' > 15/lsa/'+doc.replace('Reference2','System23'))
print '15_lsa'
os.system('sumy lsa --length='+str(percent_20)+'% --file=duc2001_docs/'+doc + ' > 20/lsa/'+doc.replace('Reference2','System23'))
print '20_lsa'
os.system('sumy lsa --length='+str(percent_25)+'% --file=duc2001_docs/'+doc + ' > 25/lsa/'+doc.replace('Reference2','System23'))
print '25_lsa'
os.system('sumy lsa --length='+str(percent_33)+'% --file=duc2001_docs/'+doc + ' > 33/lsa/'+doc.replace('Reference2','System23'))
print '33_lsa'
os.system('sumy lsa --length='+str(percent_39)+'% --file=duc2001_docs/'+doc + ' > 39/lsa/'+doc.replace('Reference2','System23'))
print '39_lsa'
os.system('sumy lsa --length='+str(percent_45)+'% --file=duc2001_docs/'+doc + ' > 45/lsa/'+doc.replace('Reference2','System23'))
print '45_lsa'
os.system('sumy text-rank --length='+str(percent_10)+'% --file=duc2001_docs/'+doc + ' > 10/text-rank/'+doc.replace('Reference2','System24'))
print '10_text-rank'
os.system('sumy text-rank --length='+str(percent_15)+'% --file=duc2001_docs/'+doc + ' > 15/text-rank/'+doc.replace('Reference2','System24'))
print '15_text-rank'
os.system('sumy text-rank --length='+str(percent_20)+'% --file=duc2001_docs/'+doc + ' > 20/text-rank/'+doc.replace('Reference2','System24'))
print '20_text-rank'
os.system('sumy text-rank --length='+str(percent_25)+'% --file=duc2001_docs/'+doc + ' > 25/text-rank/'+doc.replace('Reference2','System24'))
print '25_text-rank'
os.system('sumy text-rank --length='+str(percent_33)+'% --file=duc2001_docs/'+doc + ' > 33/text-rank/'+doc.replace('Reference2','System24'))
print '33_text-rank'
os.system('sumy text-rank --length='+str(percent_39)+'% --file=duc2001_docs/'+doc + ' > 39/text-rank/'+doc.replace('Reference2','System24'))
print '39_text-rank'
os.system('sumy text-rank --length='+str(percent_45)+'% --file=duc2001_docs/'+doc + ' > 45/text-rank/'+doc.replace('Reference2','System24'))
print '45_text-rank'
os.system('sumy lex-rank --length='+str(percent_10)+'% --file=duc2001_docs/'+doc + ' > 10/lex-rank/'+doc.replace('Reference2','System25'))
print '10_lex-rank'
os.system('sumy lex-rank --length='+str(percent_15)+'% --file=duc2001_docs/'+doc + ' > 15/lex-rank/'+doc.replace('Reference2','System25'))
print '15_lex-rank'
os.system('sumy lex-rank --length='+str(percent_20)+'% --file=duc2001_docs/'+doc + ' > 20/lex-rank/'+doc.replace('Reference2','System25'))
print '20_lex-rank'
os.system('sumy lex-rank --length='+str(percent_25)+'% --file=duc2001_docs/'+doc + ' > 25/lex-rank/'+doc.replace('Reference2','System25'))
print '25_lex-rank'
os.system('sumy lex-rank --length='+str(percent_33)+'% --file=duc2001_docs/'+doc + ' > 33/lex-rank/'+doc.replace('Reference2','System25'))
print '33_lex-rank'
os.system('sumy lex-rank --length='+str(percent_39)+'% --file=duc2001_docs/'+doc + ' > 39/lex-rank/'+doc.replace('Reference2','System25'))
print '39_lex-rank'
os.system('sumy lex-rank --length='+str(percent_45)+'% --file=duc2001_docs/'+doc + ' > 45/lex-rank/'+doc.replace('Reference2','System25'))
print '45_lex-rank'
| 92.016529
| 336
| 0.711155
| 1,627
| 11,134
| 4.647818
| 0.035648
| 0.101825
| 0.20365
| 0.099974
| 0.962312
| 0.961783
| 0.855329
| 0.766993
| 0.702592
| 0.592436
| 0
| 0.089469
| 0.05335
| 11,134
| 120
| 337
| 92.783333
| 0.627989
| 0
| 0
| 0
| 0
| 0
| 0.506378
| 0.090125
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0.011111
| null | null | 0.411111
| 0
| 0
| 0
| null | 0
| 1
| 0
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 8
|
fc132b960034fa0a84d4eab75375c1ea49eeca24
| 145
|
py
|
Python
|
lib/models/rut.py
|
Daia-Systems-SPA/sii-dte-py
|
a1030f4abf3d4004fdede88072cc8621214158bf
|
[
"MIT"
] | null | null | null |
lib/models/rut.py
|
Daia-Systems-SPA/sii-dte-py
|
a1030f4abf3d4004fdede88072cc8621214158bf
|
[
"MIT"
] | null | null | null |
lib/models/rut.py
|
Daia-Systems-SPA/sii-dte-py
|
a1030f4abf3d4004fdede88072cc8621214158bf
|
[
"MIT"
] | 1
|
2020-10-04T00:37:48.000Z
|
2020-10-04T00:37:48.000Z
|
class RUT():
_rut_string = ''
def __init__(self, rut_string):
_rut_string = rut_string
def get_sii_formated_rut(sef):
return _rut_string
| 18.125
| 32
| 0.744828
| 22
| 145
| 4.227273
| 0.5
| 0.483871
| 0.258065
| 0.387097
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.158621
| 145
| 7
| 33
| 20.714286
| 0.762295
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0
| 0.166667
| 0.833333
| 0
| 1
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 8
|
fc2d7dbdabcccaf3fce332e0971502abe865826f
| 1,128
|
py
|
Python
|
tests/test_security.py
|
LandRegistry/login-api
|
a9c7128498f9ec4dede07d0c915cc1a4c0e37a43
|
[
"MIT"
] | null | null | null |
tests/test_security.py
|
LandRegistry/login-api
|
a9c7128498f9ec4dede07d0c915cc1a4c0e37a43
|
[
"MIT"
] | 8
|
2015-05-29T14:25:32.000Z
|
2015-08-06T15:36:17.000Z
|
tests/test_security.py
|
LandRegistry/login-api
|
a9c7128498f9ec4dede07d0c915cc1a4c0e37a43
|
[
"MIT"
] | 2
|
2016-11-22T12:26:32.000Z
|
2021-04-11T06:05:42.000Z
|
import pytest
from service import security
class TestSecurity:
def test_get_user_password_hash_returns_same_hash_for_same_data(self):
hash1 = security.get_user_password_hash('user1', 'password1', 'salt1')
hash2 = security.get_user_password_hash('user1', 'password1', 'salt1')
assert hash1 == hash2
def test_get_userpass_hash_returns_different_hash_for_diff_salts(self):
hash1 = security.get_user_password_hash('user1', 'password1', 'salt1')
hash2 = security.get_user_password_hash('user1', 'password1', 'salt2')
assert hash1 != hash2
def test_get_userpass_hash_returns_different_hash_for_diff_users(self):
hash1 = security.get_user_password_hash('user1', 'password1', 'salt1')
hash2 = security.get_user_password_hash('user2', 'password1', 'salt1')
assert hash1 != hash2
def test_get_userpass_returns_different_hash_for_different_passwords(self):
hash1 = security.get_user_password_hash('user1', 'password1', 'salt1')
hash2 = security.get_user_password_hash('user1', 'password2', 'salt1')
assert hash1 != hash2
| 43.384615
| 79
| 0.727837
| 140
| 1,128
| 5.435714
| 0.235714
| 0.082786
| 0.177398
| 0.224704
| 0.74113
| 0.74113
| 0.74113
| 0.74113
| 0.74113
| 0.671485
| 0
| 0.042644
| 0.16844
| 1,128
| 25
| 80
| 45.12
| 0.768657
| 0
| 0
| 0.368421
| 0
| 0
| 0.134752
| 0
| 0
| 0
| 0
| 0
| 0.210526
| 1
| 0.210526
| false
| 0.631579
| 0.105263
| 0
| 0.368421
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 8
|
fc7b0c14fbce4761742069be480c3b59d9b86388
| 65,536
|
py
|
Python
|
dingtalk/python/alibabacloud_dingtalk/village_1_0/client.py
|
aliyun/dingtalk-sdk
|
ab4f856b8cfe94f6b69f10a0730a2e5a7d4901c5
|
[
"Apache-2.0"
] | 15
|
2020-08-27T04:10:26.000Z
|
2022-03-07T06:25:42.000Z
|
dingtalk/python/alibabacloud_dingtalk/village_1_0/client.py
|
aliyun/dingtalk-sdk
|
ab4f856b8cfe94f6b69f10a0730a2e5a7d4901c5
|
[
"Apache-2.0"
] | 1
|
2020-09-27T01:30:46.000Z
|
2021-12-29T09:15:34.000Z
|
dingtalk/python/alibabacloud_dingtalk/village_1_0/client.py
|
aliyun/dingtalk-sdk
|
ab4f856b8cfe94f6b69f10a0730a2e5a7d4901c5
|
[
"Apache-2.0"
] | 5
|
2020-08-27T04:07:44.000Z
|
2021-12-03T02:55:20.000Z
|
# -*- coding: utf-8 -*-
# This file is auto-generated, don't edit it. Thanks.
from Tea.core import TeaCore
from alibabacloud_tea_openapi.client import Client as OpenApiClient
from alibabacloud_tea_openapi import models as open_api_models
from alibabacloud_tea_util.client import Client as UtilClient
from alibabacloud_dingtalk.village_1_0 import models as dingtalkvillage__1__0_models
from alibabacloud_tea_util import models as util_models
from alibabacloud_openapi_util.client import Client as OpenApiUtilClient
class Client(OpenApiClient):
"""
*\
"""
def __init__(
self,
config: open_api_models.Config,
):
super().__init__(config)
self._endpoint_rule = ''
if UtilClient.empty(self._endpoint):
self._endpoint = 'api.dingtalk.com'
def list_sub_corps(
self,
request: dingtalkvillage__1__0_models.ListSubCorpsRequest,
) -> dingtalkvillage__1__0_models.ListSubCorpsResponse:
runtime = util_models.RuntimeOptions()
headers = dingtalkvillage__1__0_models.ListSubCorpsHeaders()
return self.list_sub_corps_with_options(request, headers, runtime)
async def list_sub_corps_async(
self,
request: dingtalkvillage__1__0_models.ListSubCorpsRequest,
) -> dingtalkvillage__1__0_models.ListSubCorpsResponse:
runtime = util_models.RuntimeOptions()
headers = dingtalkvillage__1__0_models.ListSubCorpsHeaders()
return await self.list_sub_corps_with_options_async(request, headers, runtime)
def list_sub_corps_with_options(
self,
request: dingtalkvillage__1__0_models.ListSubCorpsRequest,
headers: dingtalkvillage__1__0_models.ListSubCorpsHeaders,
runtime: util_models.RuntimeOptions,
) -> dingtalkvillage__1__0_models.ListSubCorpsResponse:
UtilClient.validate_model(request)
query = {}
if not UtilClient.is_unset(request.types):
query['types'] = request.types
if not UtilClient.is_unset(request.sub_corp_id):
query['subCorpId'] = request.sub_corp_id
if not UtilClient.is_unset(request.is_only_direct):
query['isOnlyDirect'] = request.is_only_direct
real_headers = {}
if not UtilClient.is_unset(headers.common_headers):
real_headers = headers.common_headers
if not UtilClient.is_unset(headers.x_acs_dingtalk_access_token):
real_headers['x-acs-dingtalk-access-token'] = headers.x_acs_dingtalk_access_token
req = open_api_models.OpenApiRequest(
headers=real_headers,
query=OpenApiUtilClient.query(query)
)
return TeaCore.from_map(
dingtalkvillage__1__0_models.ListSubCorpsResponse(),
self.do_roarequest('ListSubCorps', 'village_1.0', 'HTTP', 'POST', 'AK', f'/v1.0/village/corps/subCorps', 'json', req, runtime)
)
async def list_sub_corps_with_options_async(
self,
request: dingtalkvillage__1__0_models.ListSubCorpsRequest,
headers: dingtalkvillage__1__0_models.ListSubCorpsHeaders,
runtime: util_models.RuntimeOptions,
) -> dingtalkvillage__1__0_models.ListSubCorpsResponse:
UtilClient.validate_model(request)
query = {}
if not UtilClient.is_unset(request.types):
query['types'] = request.types
if not UtilClient.is_unset(request.sub_corp_id):
query['subCorpId'] = request.sub_corp_id
if not UtilClient.is_unset(request.is_only_direct):
query['isOnlyDirect'] = request.is_only_direct
real_headers = {}
if not UtilClient.is_unset(headers.common_headers):
real_headers = headers.common_headers
if not UtilClient.is_unset(headers.x_acs_dingtalk_access_token):
real_headers['x-acs-dingtalk-access-token'] = headers.x_acs_dingtalk_access_token
req = open_api_models.OpenApiRequest(
headers=real_headers,
query=OpenApiUtilClient.query(query)
)
return TeaCore.from_map(
dingtalkvillage__1__0_models.ListSubCorpsResponse(),
await self.do_roarequest_async('ListSubCorps', 'village_1.0', 'HTTP', 'POST', 'AK', f'/v1.0/village/corps/subCorps', 'json', req, runtime)
)
def get_village_org_info(
self,
sub_corp_id: str,
) -> dingtalkvillage__1__0_models.GetVillageOrgInfoResponse:
runtime = util_models.RuntimeOptions()
headers = dingtalkvillage__1__0_models.GetVillageOrgInfoHeaders()
return self.get_village_org_info_with_options(sub_corp_id, headers, runtime)
async def get_village_org_info_async(
self,
sub_corp_id: str,
) -> dingtalkvillage__1__0_models.GetVillageOrgInfoResponse:
runtime = util_models.RuntimeOptions()
headers = dingtalkvillage__1__0_models.GetVillageOrgInfoHeaders()
return await self.get_village_org_info_with_options_async(sub_corp_id, headers, runtime)
def get_village_org_info_with_options(
self,
sub_corp_id: str,
headers: dingtalkvillage__1__0_models.GetVillageOrgInfoHeaders,
runtime: util_models.RuntimeOptions,
) -> dingtalkvillage__1__0_models.GetVillageOrgInfoResponse:
real_headers = {}
if not UtilClient.is_unset(headers.common_headers):
real_headers = headers.common_headers
if not UtilClient.is_unset(headers.x_acs_dingtalk_access_token):
real_headers['x-acs-dingtalk-access-token'] = headers.x_acs_dingtalk_access_token
req = open_api_models.OpenApiRequest(
headers=real_headers
)
return TeaCore.from_map(
dingtalkvillage__1__0_models.GetVillageOrgInfoResponse(),
self.do_roarequest('GetVillageOrgInfo', 'village_1.0', 'HTTP', 'GET', 'AK', f'/v1.0/village/corps/{sub_corp_id}', 'json', req, runtime)
)
async def get_village_org_info_with_options_async(
self,
sub_corp_id: str,
headers: dingtalkvillage__1__0_models.GetVillageOrgInfoHeaders,
runtime: util_models.RuntimeOptions,
) -> dingtalkvillage__1__0_models.GetVillageOrgInfoResponse:
real_headers = {}
if not UtilClient.is_unset(headers.common_headers):
real_headers = headers.common_headers
if not UtilClient.is_unset(headers.x_acs_dingtalk_access_token):
real_headers['x-acs-dingtalk-access-token'] = headers.x_acs_dingtalk_access_token
req = open_api_models.OpenApiRequest(
headers=real_headers
)
return TeaCore.from_map(
dingtalkvillage__1__0_models.GetVillageOrgInfoResponse(),
await self.do_roarequest_async('GetVillageOrgInfo', 'village_1.0', 'HTTP', 'GET', 'AK', f'/v1.0/village/corps/{sub_corp_id}', 'json', req, runtime)
)
def list_resident_dept_users(
self,
department_id: str,
request: dingtalkvillage__1__0_models.ListResidentDeptUsersRequest,
) -> dingtalkvillage__1__0_models.ListResidentDeptUsersResponse:
runtime = util_models.RuntimeOptions()
headers = dingtalkvillage__1__0_models.ListResidentDeptUsersHeaders()
return self.list_resident_dept_users_with_options(department_id, request, headers, runtime)
async def list_resident_dept_users_async(
self,
department_id: str,
request: dingtalkvillage__1__0_models.ListResidentDeptUsersRequest,
) -> dingtalkvillage__1__0_models.ListResidentDeptUsersResponse:
runtime = util_models.RuntimeOptions()
headers = dingtalkvillage__1__0_models.ListResidentDeptUsersHeaders()
return await self.list_resident_dept_users_with_options_async(department_id, request, headers, runtime)
def list_resident_dept_users_with_options(
self,
department_id: str,
request: dingtalkvillage__1__0_models.ListResidentDeptUsersRequest,
headers: dingtalkvillage__1__0_models.ListResidentDeptUsersHeaders,
runtime: util_models.RuntimeOptions,
) -> dingtalkvillage__1__0_models.ListResidentDeptUsersResponse:
UtilClient.validate_model(request)
query = {}
if not UtilClient.is_unset(request.sub_corp_id):
query['subCorpId'] = request.sub_corp_id
if not UtilClient.is_unset(request.role):
query['role'] = request.role
if not UtilClient.is_unset(request.cursor):
query['cursor'] = request.cursor
if not UtilClient.is_unset(request.size):
query['size'] = request.size
real_headers = {}
if not UtilClient.is_unset(headers.common_headers):
real_headers = headers.common_headers
if not UtilClient.is_unset(headers.x_acs_dingtalk_access_token):
real_headers['x-acs-dingtalk-access-token'] = headers.x_acs_dingtalk_access_token
req = open_api_models.OpenApiRequest(
headers=real_headers,
query=OpenApiUtilClient.query(query)
)
return TeaCore.from_map(
dingtalkvillage__1__0_models.ListResidentDeptUsersResponse(),
self.do_roarequest('ListResidentDeptUsers', 'village_1.0', 'HTTP', 'GET', 'AK', f'/v1.0/village/residentDepartments/{department_id}/users', 'json', req, runtime)
)
async def list_resident_dept_users_with_options_async(
self,
department_id: str,
request: dingtalkvillage__1__0_models.ListResidentDeptUsersRequest,
headers: dingtalkvillage__1__0_models.ListResidentDeptUsersHeaders,
runtime: util_models.RuntimeOptions,
) -> dingtalkvillage__1__0_models.ListResidentDeptUsersResponse:
UtilClient.validate_model(request)
query = {}
if not UtilClient.is_unset(request.sub_corp_id):
query['subCorpId'] = request.sub_corp_id
if not UtilClient.is_unset(request.role):
query['role'] = request.role
if not UtilClient.is_unset(request.cursor):
query['cursor'] = request.cursor
if not UtilClient.is_unset(request.size):
query['size'] = request.size
real_headers = {}
if not UtilClient.is_unset(headers.common_headers):
real_headers = headers.common_headers
if not UtilClient.is_unset(headers.x_acs_dingtalk_access_token):
real_headers['x-acs-dingtalk-access-token'] = headers.x_acs_dingtalk_access_token
req = open_api_models.OpenApiRequest(
headers=real_headers,
query=OpenApiUtilClient.query(query)
)
return TeaCore.from_map(
dingtalkvillage__1__0_models.ListResidentDeptUsersResponse(),
await self.do_roarequest_async('ListResidentDeptUsers', 'village_1.0', 'HTTP', 'GET', 'AK', f'/v1.0/village/residentDepartments/{department_id}/users', 'json', req, runtime)
)
def list_dept_simple_users(
self,
department_id: str,
request: dingtalkvillage__1__0_models.ListDeptSimpleUsersRequest,
) -> dingtalkvillage__1__0_models.ListDeptSimpleUsersResponse:
runtime = util_models.RuntimeOptions()
headers = dingtalkvillage__1__0_models.ListDeptSimpleUsersHeaders()
return self.list_dept_simple_users_with_options(department_id, request, headers, runtime)
async def list_dept_simple_users_async(
self,
department_id: str,
request: dingtalkvillage__1__0_models.ListDeptSimpleUsersRequest,
) -> dingtalkvillage__1__0_models.ListDeptSimpleUsersResponse:
runtime = util_models.RuntimeOptions()
headers = dingtalkvillage__1__0_models.ListDeptSimpleUsersHeaders()
return await self.list_dept_simple_users_with_options_async(department_id, request, headers, runtime)
def list_dept_simple_users_with_options(
self,
department_id: str,
request: dingtalkvillage__1__0_models.ListDeptSimpleUsersRequest,
headers: dingtalkvillage__1__0_models.ListDeptSimpleUsersHeaders,
runtime: util_models.RuntimeOptions,
) -> dingtalkvillage__1__0_models.ListDeptSimpleUsersResponse:
UtilClient.validate_model(request)
query = {}
if not UtilClient.is_unset(request.cursor):
query['cursor'] = request.cursor
if not UtilClient.is_unset(request.size):
query['size'] = request.size
if not UtilClient.is_unset(request.contain_access_limit):
query['containAccessLimit'] = request.contain_access_limit
if not UtilClient.is_unset(request.sub_corp_id):
query['subCorpId'] = request.sub_corp_id
if not UtilClient.is_unset(request.language):
query['language'] = request.language
if not UtilClient.is_unset(request.order_field):
query['orderField'] = request.order_field
real_headers = {}
if not UtilClient.is_unset(headers.common_headers):
real_headers = headers.common_headers
if not UtilClient.is_unset(headers.x_acs_dingtalk_access_token):
real_headers['x-acs-dingtalk-access-token'] = headers.x_acs_dingtalk_access_token
req = open_api_models.OpenApiRequest(
headers=real_headers,
query=OpenApiUtilClient.query(query)
)
return TeaCore.from_map(
dingtalkvillage__1__0_models.ListDeptSimpleUsersResponse(),
self.do_roarequest('ListDeptSimpleUsers', 'village_1.0', 'HTTP', 'GET', 'AK', f'/v1.0/village/departments/{department_id}/simpleUsers', 'json', req, runtime)
)
async def list_dept_simple_users_with_options_async(
self,
department_id: str,
request: dingtalkvillage__1__0_models.ListDeptSimpleUsersRequest,
headers: dingtalkvillage__1__0_models.ListDeptSimpleUsersHeaders,
runtime: util_models.RuntimeOptions,
) -> dingtalkvillage__1__0_models.ListDeptSimpleUsersResponse:
UtilClient.validate_model(request)
query = {}
if not UtilClient.is_unset(request.cursor):
query['cursor'] = request.cursor
if not UtilClient.is_unset(request.size):
query['size'] = request.size
if not UtilClient.is_unset(request.contain_access_limit):
query['containAccessLimit'] = request.contain_access_limit
if not UtilClient.is_unset(request.sub_corp_id):
query['subCorpId'] = request.sub_corp_id
if not UtilClient.is_unset(request.language):
query['language'] = request.language
if not UtilClient.is_unset(request.order_field):
query['orderField'] = request.order_field
real_headers = {}
if not UtilClient.is_unset(headers.common_headers):
real_headers = headers.common_headers
if not UtilClient.is_unset(headers.x_acs_dingtalk_access_token):
real_headers['x-acs-dingtalk-access-token'] = headers.x_acs_dingtalk_access_token
req = open_api_models.OpenApiRequest(
headers=real_headers,
query=OpenApiUtilClient.query(query)
)
return TeaCore.from_map(
dingtalkvillage__1__0_models.ListDeptSimpleUsersResponse(),
await self.do_roarequest_async('ListDeptSimpleUsers', 'village_1.0', 'HTTP', 'GET', 'AK', f'/v1.0/village/departments/{department_id}/simpleUsers', 'json', req, runtime)
)
def get_user_by_union_id(
self,
request: dingtalkvillage__1__0_models.GetUserByUnionIdRequest,
) -> dingtalkvillage__1__0_models.GetUserByUnionIdResponse:
runtime = util_models.RuntimeOptions()
headers = dingtalkvillage__1__0_models.GetUserByUnionIdHeaders()
return self.get_user_by_union_id_with_options(request, headers, runtime)
async def get_user_by_union_id_async(
self,
request: dingtalkvillage__1__0_models.GetUserByUnionIdRequest,
) -> dingtalkvillage__1__0_models.GetUserByUnionIdResponse:
runtime = util_models.RuntimeOptions()
headers = dingtalkvillage__1__0_models.GetUserByUnionIdHeaders()
return await self.get_user_by_union_id_with_options_async(request, headers, runtime)
def get_user_by_union_id_with_options(
self,
request: dingtalkvillage__1__0_models.GetUserByUnionIdRequest,
headers: dingtalkvillage__1__0_models.GetUserByUnionIdHeaders,
runtime: util_models.RuntimeOptions,
) -> dingtalkvillage__1__0_models.GetUserByUnionIdResponse:
UtilClient.validate_model(request)
query = {}
if not UtilClient.is_unset(request.sub_corp_id):
query['subCorpId'] = request.sub_corp_id
if not UtilClient.is_unset(request.union_id):
query['unionId'] = request.union_id
if not UtilClient.is_unset(request.language):
query['language'] = request.language
real_headers = {}
if not UtilClient.is_unset(headers.common_headers):
real_headers = headers.common_headers
if not UtilClient.is_unset(headers.x_acs_dingtalk_access_token):
real_headers['x-acs-dingtalk-access-token'] = headers.x_acs_dingtalk_access_token
req = open_api_models.OpenApiRequest(
headers=real_headers,
query=OpenApiUtilClient.query(query)
)
return TeaCore.from_map(
dingtalkvillage__1__0_models.GetUserByUnionIdResponse(),
self.do_roarequest('GetUserByUnionId', 'village_1.0', 'HTTP', 'GET', 'AK', f'/v1.0/village/users/getByUnionId', 'json', req, runtime)
)
async def get_user_by_union_id_with_options_async(
self,
request: dingtalkvillage__1__0_models.GetUserByUnionIdRequest,
headers: dingtalkvillage__1__0_models.GetUserByUnionIdHeaders,
runtime: util_models.RuntimeOptions,
) -> dingtalkvillage__1__0_models.GetUserByUnionIdResponse:
UtilClient.validate_model(request)
query = {}
if not UtilClient.is_unset(request.sub_corp_id):
query['subCorpId'] = request.sub_corp_id
if not UtilClient.is_unset(request.union_id):
query['unionId'] = request.union_id
if not UtilClient.is_unset(request.language):
query['language'] = request.language
real_headers = {}
if not UtilClient.is_unset(headers.common_headers):
real_headers = headers.common_headers
if not UtilClient.is_unset(headers.x_acs_dingtalk_access_token):
real_headers['x-acs-dingtalk-access-token'] = headers.x_acs_dingtalk_access_token
req = open_api_models.OpenApiRequest(
headers=real_headers,
query=OpenApiUtilClient.query(query)
)
return TeaCore.from_map(
dingtalkvillage__1__0_models.GetUserByUnionIdResponse(),
await self.do_roarequest_async('GetUserByUnionId', 'village_1.0', 'HTTP', 'GET', 'AK', f'/v1.0/village/users/getByUnionId', 'json', req, runtime)
)
def get_resident_dept(
self,
department_id: str,
request: dingtalkvillage__1__0_models.GetResidentDeptRequest,
) -> dingtalkvillage__1__0_models.GetResidentDeptResponse:
runtime = util_models.RuntimeOptions()
headers = dingtalkvillage__1__0_models.GetResidentDeptHeaders()
return self.get_resident_dept_with_options(department_id, request, headers, runtime)
async def get_resident_dept_async(
self,
department_id: str,
request: dingtalkvillage__1__0_models.GetResidentDeptRequest,
) -> dingtalkvillage__1__0_models.GetResidentDeptResponse:
runtime = util_models.RuntimeOptions()
headers = dingtalkvillage__1__0_models.GetResidentDeptHeaders()
return await self.get_resident_dept_with_options_async(department_id, request, headers, runtime)
def get_resident_dept_with_options(
self,
department_id: str,
request: dingtalkvillage__1__0_models.GetResidentDeptRequest,
headers: dingtalkvillage__1__0_models.GetResidentDeptHeaders,
runtime: util_models.RuntimeOptions,
) -> dingtalkvillage__1__0_models.GetResidentDeptResponse:
UtilClient.validate_model(request)
query = {}
if not UtilClient.is_unset(request.sub_corp_id):
query['subCorpId'] = request.sub_corp_id
real_headers = {}
if not UtilClient.is_unset(headers.common_headers):
real_headers = headers.common_headers
if not UtilClient.is_unset(headers.x_acs_dingtalk_access_token):
real_headers['x-acs-dingtalk-access-token'] = headers.x_acs_dingtalk_access_token
req = open_api_models.OpenApiRequest(
headers=real_headers,
query=OpenApiUtilClient.query(query)
)
return TeaCore.from_map(
dingtalkvillage__1__0_models.GetResidentDeptResponse(),
self.do_roarequest('GetResidentDept', 'village_1.0', 'HTTP', 'GET', 'AK', f'/v1.0/village/residentDepartments/departments/{department_id}', 'json', req, runtime)
)
async def get_resident_dept_with_options_async(
self,
department_id: str,
request: dingtalkvillage__1__0_models.GetResidentDeptRequest,
headers: dingtalkvillage__1__0_models.GetResidentDeptHeaders,
runtime: util_models.RuntimeOptions,
) -> dingtalkvillage__1__0_models.GetResidentDeptResponse:
UtilClient.validate_model(request)
query = {}
if not UtilClient.is_unset(request.sub_corp_id):
query['subCorpId'] = request.sub_corp_id
real_headers = {}
if not UtilClient.is_unset(headers.common_headers):
real_headers = headers.common_headers
if not UtilClient.is_unset(headers.x_acs_dingtalk_access_token):
real_headers['x-acs-dingtalk-access-token'] = headers.x_acs_dingtalk_access_token
req = open_api_models.OpenApiRequest(
headers=real_headers,
query=OpenApiUtilClient.query(query)
)
return TeaCore.from_map(
dingtalkvillage__1__0_models.GetResidentDeptResponse(),
await self.do_roarequest_async('GetResidentDept', 'village_1.0', 'HTTP', 'GET', 'AK', f'/v1.0/village/residentDepartments/departments/{department_id}', 'json', req, runtime)
)
def get_resident_user_info(
self,
department_id: str,
user_id: str,
request: dingtalkvillage__1__0_models.GetResidentUserInfoRequest,
) -> dingtalkvillage__1__0_models.GetResidentUserInfoResponse:
runtime = util_models.RuntimeOptions()
headers = dingtalkvillage__1__0_models.GetResidentUserInfoHeaders()
return self.get_resident_user_info_with_options(department_id, user_id, request, headers, runtime)
async def get_resident_user_info_async(
self,
department_id: str,
user_id: str,
request: dingtalkvillage__1__0_models.GetResidentUserInfoRequest,
) -> dingtalkvillage__1__0_models.GetResidentUserInfoResponse:
runtime = util_models.RuntimeOptions()
headers = dingtalkvillage__1__0_models.GetResidentUserInfoHeaders()
return await self.get_resident_user_info_with_options_async(department_id, user_id, request, headers, runtime)
def get_resident_user_info_with_options(
self,
department_id: str,
user_id: str,
request: dingtalkvillage__1__0_models.GetResidentUserInfoRequest,
headers: dingtalkvillage__1__0_models.GetResidentUserInfoHeaders,
runtime: util_models.RuntimeOptions,
) -> dingtalkvillage__1__0_models.GetResidentUserInfoResponse:
UtilClient.validate_model(request)
query = {}
if not UtilClient.is_unset(request.sub_corp_id):
query['subCorpId'] = request.sub_corp_id
real_headers = {}
if not UtilClient.is_unset(headers.common_headers):
real_headers = headers.common_headers
if not UtilClient.is_unset(headers.x_acs_dingtalk_access_token):
real_headers['x-acs-dingtalk-access-token'] = headers.x_acs_dingtalk_access_token
req = open_api_models.OpenApiRequest(
headers=real_headers,
query=OpenApiUtilClient.query(query)
)
return TeaCore.from_map(
dingtalkvillage__1__0_models.GetResidentUserInfoResponse(),
self.do_roarequest('GetResidentUserInfo', 'village_1.0', 'HTTP', 'GET', 'AK', f'/v1.0/village/residentDepartments/{department_id}/users/{user_id}', 'json', req, runtime)
)
async def get_resident_user_info_with_options_async(
self,
department_id: str,
user_id: str,
request: dingtalkvillage__1__0_models.GetResidentUserInfoRequest,
headers: dingtalkvillage__1__0_models.GetResidentUserInfoHeaders,
runtime: util_models.RuntimeOptions,
) -> dingtalkvillage__1__0_models.GetResidentUserInfoResponse:
UtilClient.validate_model(request)
query = {}
if not UtilClient.is_unset(request.sub_corp_id):
query['subCorpId'] = request.sub_corp_id
real_headers = {}
if not UtilClient.is_unset(headers.common_headers):
real_headers = headers.common_headers
if not UtilClient.is_unset(headers.x_acs_dingtalk_access_token):
real_headers['x-acs-dingtalk-access-token'] = headers.x_acs_dingtalk_access_token
req = open_api_models.OpenApiRequest(
headers=real_headers,
query=OpenApiUtilClient.query(query)
)
return TeaCore.from_map(
dingtalkvillage__1__0_models.GetResidentUserInfoResponse(),
await self.do_roarequest_async('GetResidentUserInfo', 'village_1.0', 'HTTP', 'GET', 'AK', f'/v1.0/village/residentDepartments/{department_id}/users/{user_id}', 'json', req, runtime)
)
def get_dept(
self,
department_id: str,
request: dingtalkvillage__1__0_models.GetDeptRequest,
) -> dingtalkvillage__1__0_models.GetDeptResponse:
runtime = util_models.RuntimeOptions()
headers = dingtalkvillage__1__0_models.GetDeptHeaders()
return self.get_dept_with_options(department_id, request, headers, runtime)
async def get_dept_async(
self,
department_id: str,
request: dingtalkvillage__1__0_models.GetDeptRequest,
) -> dingtalkvillage__1__0_models.GetDeptResponse:
runtime = util_models.RuntimeOptions()
headers = dingtalkvillage__1__0_models.GetDeptHeaders()
return await self.get_dept_with_options_async(department_id, request, headers, runtime)
def get_dept_with_options(
self,
department_id: str,
request: dingtalkvillage__1__0_models.GetDeptRequest,
headers: dingtalkvillage__1__0_models.GetDeptHeaders,
runtime: util_models.RuntimeOptions,
) -> dingtalkvillage__1__0_models.GetDeptResponse:
UtilClient.validate_model(request)
query = {}
if not UtilClient.is_unset(request.sub_corp_id):
query['subCorpId'] = request.sub_corp_id
if not UtilClient.is_unset(request.language):
query['language'] = request.language
real_headers = {}
if not UtilClient.is_unset(headers.common_headers):
real_headers = headers.common_headers
if not UtilClient.is_unset(headers.x_acs_dingtalk_access_token):
real_headers['x-acs-dingtalk-access-token'] = headers.x_acs_dingtalk_access_token
req = open_api_models.OpenApiRequest(
headers=real_headers,
query=OpenApiUtilClient.query(query)
)
return TeaCore.from_map(
dingtalkvillage__1__0_models.GetDeptResponse(),
self.do_roarequest('GetDept', 'village_1.0', 'HTTP', 'GET', 'AK', f'/v1.0/village/deptartments/{department_id}', 'json', req, runtime)
)
async def get_dept_with_options_async(
self,
department_id: str,
request: dingtalkvillage__1__0_models.GetDeptRequest,
headers: dingtalkvillage__1__0_models.GetDeptHeaders,
runtime: util_models.RuntimeOptions,
) -> dingtalkvillage__1__0_models.GetDeptResponse:
UtilClient.validate_model(request)
query = {}
if not UtilClient.is_unset(request.sub_corp_id):
query['subCorpId'] = request.sub_corp_id
if not UtilClient.is_unset(request.language):
query['language'] = request.language
real_headers = {}
if not UtilClient.is_unset(headers.common_headers):
real_headers = headers.common_headers
if not UtilClient.is_unset(headers.x_acs_dingtalk_access_token):
real_headers['x-acs-dingtalk-access-token'] = headers.x_acs_dingtalk_access_token
req = open_api_models.OpenApiRequest(
headers=real_headers,
query=OpenApiUtilClient.query(query)
)
return TeaCore.from_map(
dingtalkvillage__1__0_models.GetDeptResponse(),
await self.do_roarequest_async('GetDept', 'village_1.0', 'HTTP', 'GET', 'AK', f'/v1.0/village/deptartments/{department_id}', 'json', req, runtime)
)
def list_parent_by_dept(
self,
request: dingtalkvillage__1__0_models.ListParentByDeptRequest,
) -> dingtalkvillage__1__0_models.ListParentByDeptResponse:
runtime = util_models.RuntimeOptions()
headers = dingtalkvillage__1__0_models.ListParentByDeptHeaders()
return self.list_parent_by_dept_with_options(request, headers, runtime)
async def list_parent_by_dept_async(
self,
request: dingtalkvillage__1__0_models.ListParentByDeptRequest,
) -> dingtalkvillage__1__0_models.ListParentByDeptResponse:
runtime = util_models.RuntimeOptions()
headers = dingtalkvillage__1__0_models.ListParentByDeptHeaders()
return await self.list_parent_by_dept_with_options_async(request, headers, runtime)
def list_parent_by_dept_with_options(
self,
request: dingtalkvillage__1__0_models.ListParentByDeptRequest,
headers: dingtalkvillage__1__0_models.ListParentByDeptHeaders,
runtime: util_models.RuntimeOptions,
) -> dingtalkvillage__1__0_models.ListParentByDeptResponse:
UtilClient.validate_model(request)
query = {}
if not UtilClient.is_unset(request.sub_corp_id):
query['subCorpId'] = request.sub_corp_id
if not UtilClient.is_unset(request.department_id):
query['departmentId'] = request.department_id
real_headers = {}
if not UtilClient.is_unset(headers.common_headers):
real_headers = headers.common_headers
if not UtilClient.is_unset(headers.x_acs_dingtalk_access_token):
real_headers['x-acs-dingtalk-access-token'] = headers.x_acs_dingtalk_access_token
req = open_api_models.OpenApiRequest(
headers=real_headers,
query=OpenApiUtilClient.query(query)
)
return TeaCore.from_map(
dingtalkvillage__1__0_models.ListParentByDeptResponse(),
self.do_roarequest('ListParentByDept', 'village_1.0', 'HTTP', 'GET', 'AK', f'/v1.0/village/departments/listParentByDepartment', 'json', req, runtime)
)
async def list_parent_by_dept_with_options_async(
self,
request: dingtalkvillage__1__0_models.ListParentByDeptRequest,
headers: dingtalkvillage__1__0_models.ListParentByDeptHeaders,
runtime: util_models.RuntimeOptions,
) -> dingtalkvillage__1__0_models.ListParentByDeptResponse:
UtilClient.validate_model(request)
query = {}
if not UtilClient.is_unset(request.sub_corp_id):
query['subCorpId'] = request.sub_corp_id
if not UtilClient.is_unset(request.department_id):
query['departmentId'] = request.department_id
real_headers = {}
if not UtilClient.is_unset(headers.common_headers):
real_headers = headers.common_headers
if not UtilClient.is_unset(headers.x_acs_dingtalk_access_token):
real_headers['x-acs-dingtalk-access-token'] = headers.x_acs_dingtalk_access_token
req = open_api_models.OpenApiRequest(
headers=real_headers,
query=OpenApiUtilClient.query(query)
)
return TeaCore.from_map(
dingtalkvillage__1__0_models.ListParentByDeptResponse(),
await self.do_roarequest_async('ListParentByDept', 'village_1.0', 'HTTP', 'GET', 'AK', f'/v1.0/village/departments/listParentByDepartment', 'json', req, runtime)
)
def list_dept_user_ids(
self,
department_id: str,
request: dingtalkvillage__1__0_models.ListDeptUserIdsRequest,
) -> dingtalkvillage__1__0_models.ListDeptUserIdsResponse:
runtime = util_models.RuntimeOptions()
headers = dingtalkvillage__1__0_models.ListDeptUserIdsHeaders()
return self.list_dept_user_ids_with_options(department_id, request, headers, runtime)
async def list_dept_user_ids_async(
self,
department_id: str,
request: dingtalkvillage__1__0_models.ListDeptUserIdsRequest,
) -> dingtalkvillage__1__0_models.ListDeptUserIdsResponse:
runtime = util_models.RuntimeOptions()
headers = dingtalkvillage__1__0_models.ListDeptUserIdsHeaders()
return await self.list_dept_user_ids_with_options_async(department_id, request, headers, runtime)
def list_dept_user_ids_with_options(
self,
department_id: str,
request: dingtalkvillage__1__0_models.ListDeptUserIdsRequest,
headers: dingtalkvillage__1__0_models.ListDeptUserIdsHeaders,
runtime: util_models.RuntimeOptions,
) -> dingtalkvillage__1__0_models.ListDeptUserIdsResponse:
UtilClient.validate_model(request)
query = {}
if not UtilClient.is_unset(request.sub_corp_id):
query['subCorpId'] = request.sub_corp_id
real_headers = {}
if not UtilClient.is_unset(headers.common_headers):
real_headers = headers.common_headers
if not UtilClient.is_unset(headers.x_acs_dingtalk_access_token):
real_headers['x-acs-dingtalk-access-token'] = headers.x_acs_dingtalk_access_token
req = open_api_models.OpenApiRequest(
headers=real_headers,
query=OpenApiUtilClient.query(query)
)
return TeaCore.from_map(
dingtalkvillage__1__0_models.ListDeptUserIdsResponse(),
self.do_roarequest('ListDeptUserIds', 'village_1.0', 'HTTP', 'GET', 'AK', f'/v1.0/village/departments/{department_id}/userIds', 'json', req, runtime)
)
async def list_dept_user_ids_with_options_async(
self,
department_id: str,
request: dingtalkvillage__1__0_models.ListDeptUserIdsRequest,
headers: dingtalkvillage__1__0_models.ListDeptUserIdsHeaders,
runtime: util_models.RuntimeOptions,
) -> dingtalkvillage__1__0_models.ListDeptUserIdsResponse:
UtilClient.validate_model(request)
query = {}
if not UtilClient.is_unset(request.sub_corp_id):
query['subCorpId'] = request.sub_corp_id
real_headers = {}
if not UtilClient.is_unset(headers.common_headers):
real_headers = headers.common_headers
if not UtilClient.is_unset(headers.x_acs_dingtalk_access_token):
real_headers['x-acs-dingtalk-access-token'] = headers.x_acs_dingtalk_access_token
req = open_api_models.OpenApiRequest(
headers=real_headers,
query=OpenApiUtilClient.query(query)
)
return TeaCore.from_map(
dingtalkvillage__1__0_models.ListDeptUserIdsResponse(),
await self.do_roarequest_async('ListDeptUserIds', 'village_1.0', 'HTTP', 'GET', 'AK', f'/v1.0/village/departments/{department_id}/userIds', 'json', req, runtime)
)
def list_simple_users_by_role(
self,
request: dingtalkvillage__1__0_models.ListSimpleUsersByRoleRequest,
) -> dingtalkvillage__1__0_models.ListSimpleUsersByRoleResponse:
runtime = util_models.RuntimeOptions()
headers = dingtalkvillage__1__0_models.ListSimpleUsersByRoleHeaders()
return self.list_simple_users_by_role_with_options(request, headers, runtime)
async def list_simple_users_by_role_async(
self,
request: dingtalkvillage__1__0_models.ListSimpleUsersByRoleRequest,
) -> dingtalkvillage__1__0_models.ListSimpleUsersByRoleResponse:
runtime = util_models.RuntimeOptions()
headers = dingtalkvillage__1__0_models.ListSimpleUsersByRoleHeaders()
return await self.list_simple_users_by_role_with_options_async(request, headers, runtime)
def list_simple_users_by_role_with_options(
self,
request: dingtalkvillage__1__0_models.ListSimpleUsersByRoleRequest,
headers: dingtalkvillage__1__0_models.ListSimpleUsersByRoleHeaders,
runtime: util_models.RuntimeOptions,
) -> dingtalkvillage__1__0_models.ListSimpleUsersByRoleResponse:
UtilClient.validate_model(request)
query = {}
if not UtilClient.is_unset(request.offset):
query['offset'] = request.offset
if not UtilClient.is_unset(request.size):
query['size'] = request.size
if not UtilClient.is_unset(request.role_id):
query['roleId'] = request.role_id
if not UtilClient.is_unset(request.sub_corp_id):
query['subCorpId'] = request.sub_corp_id
real_headers = {}
if not UtilClient.is_unset(headers.common_headers):
real_headers = headers.common_headers
if not UtilClient.is_unset(headers.x_acs_dingtalk_access_token):
real_headers['x-acs-dingtalk-access-token'] = headers.x_acs_dingtalk_access_token
req = open_api_models.OpenApiRequest(
headers=real_headers,
query=OpenApiUtilClient.query(query)
)
return TeaCore.from_map(
dingtalkvillage__1__0_models.ListSimpleUsersByRoleResponse(),
self.do_roarequest('ListSimpleUsersByRole', 'village_1.0', 'HTTP', 'GET', 'AK', f'/v1.0/village/users/listByRole', 'json', req, runtime)
)
async def list_simple_users_by_role_with_options_async(
self,
request: dingtalkvillage__1__0_models.ListSimpleUsersByRoleRequest,
headers: dingtalkvillage__1__0_models.ListSimpleUsersByRoleHeaders,
runtime: util_models.RuntimeOptions,
) -> dingtalkvillage__1__0_models.ListSimpleUsersByRoleResponse:
UtilClient.validate_model(request)
query = {}
if not UtilClient.is_unset(request.offset):
query['offset'] = request.offset
if not UtilClient.is_unset(request.size):
query['size'] = request.size
if not UtilClient.is_unset(request.role_id):
query['roleId'] = request.role_id
if not UtilClient.is_unset(request.sub_corp_id):
query['subCorpId'] = request.sub_corp_id
real_headers = {}
if not UtilClient.is_unset(headers.common_headers):
real_headers = headers.common_headers
if not UtilClient.is_unset(headers.x_acs_dingtalk_access_token):
real_headers['x-acs-dingtalk-access-token'] = headers.x_acs_dingtalk_access_token
req = open_api_models.OpenApiRequest(
headers=real_headers,
query=OpenApiUtilClient.query(query)
)
return TeaCore.from_map(
dingtalkvillage__1__0_models.ListSimpleUsersByRoleResponse(),
await self.do_roarequest_async('ListSimpleUsersByRole', 'village_1.0', 'HTTP', 'GET', 'AK', f'/v1.0/village/users/listByRole', 'json', req, runtime)
)
def list_resident_sub_depts(
self,
department_id: str,
request: dingtalkvillage__1__0_models.ListResidentSubDeptsRequest,
) -> dingtalkvillage__1__0_models.ListResidentSubDeptsResponse:
runtime = util_models.RuntimeOptions()
headers = dingtalkvillage__1__0_models.ListResidentSubDeptsHeaders()
return self.list_resident_sub_depts_with_options(department_id, request, headers, runtime)
async def list_resident_sub_depts_async(
self,
department_id: str,
request: dingtalkvillage__1__0_models.ListResidentSubDeptsRequest,
) -> dingtalkvillage__1__0_models.ListResidentSubDeptsResponse:
runtime = util_models.RuntimeOptions()
headers = dingtalkvillage__1__0_models.ListResidentSubDeptsHeaders()
return await self.list_resident_sub_depts_with_options_async(department_id, request, headers, runtime)
def list_resident_sub_depts_with_options(
self,
department_id: str,
request: dingtalkvillage__1__0_models.ListResidentSubDeptsRequest,
headers: dingtalkvillage__1__0_models.ListResidentSubDeptsHeaders,
runtime: util_models.RuntimeOptions,
) -> dingtalkvillage__1__0_models.ListResidentSubDeptsResponse:
UtilClient.validate_model(request)
query = {}
if not UtilClient.is_unset(request.sub_corp_id):
query['subCorpId'] = request.sub_corp_id
if not UtilClient.is_unset(request.cursor):
query['cursor'] = request.cursor
if not UtilClient.is_unset(request.size):
query['size'] = request.size
real_headers = {}
if not UtilClient.is_unset(headers.common_headers):
real_headers = headers.common_headers
if not UtilClient.is_unset(headers.x_acs_dingtalk_access_token):
real_headers['x-acs-dingtalk-access-token'] = headers.x_acs_dingtalk_access_token
req = open_api_models.OpenApiRequest(
headers=real_headers,
query=OpenApiUtilClient.query(query)
)
return TeaCore.from_map(
dingtalkvillage__1__0_models.ListResidentSubDeptsResponse(),
self.do_roarequest('ListResidentSubDepts', 'village_1.0', 'HTTP', 'GET', 'AK', f'/v1.0/village/residentDepartments/{department_id}/subDepartments', 'json', req, runtime)
)
async def list_resident_sub_depts_with_options_async(
self,
department_id: str,
request: dingtalkvillage__1__0_models.ListResidentSubDeptsRequest,
headers: dingtalkvillage__1__0_models.ListResidentSubDeptsHeaders,
runtime: util_models.RuntimeOptions,
) -> dingtalkvillage__1__0_models.ListResidentSubDeptsResponse:
UtilClient.validate_model(request)
query = {}
if not UtilClient.is_unset(request.sub_corp_id):
query['subCorpId'] = request.sub_corp_id
if not UtilClient.is_unset(request.cursor):
query['cursor'] = request.cursor
if not UtilClient.is_unset(request.size):
query['size'] = request.size
real_headers = {}
if not UtilClient.is_unset(headers.common_headers):
real_headers = headers.common_headers
if not UtilClient.is_unset(headers.x_acs_dingtalk_access_token):
real_headers['x-acs-dingtalk-access-token'] = headers.x_acs_dingtalk_access_token
req = open_api_models.OpenApiRequest(
headers=real_headers,
query=OpenApiUtilClient.query(query)
)
return TeaCore.from_map(
dingtalkvillage__1__0_models.ListResidentSubDeptsResponse(),
await self.do_roarequest_async('ListResidentSubDepts', 'village_1.0', 'HTTP', 'GET', 'AK', f'/v1.0/village/residentDepartments/{department_id}/subDepartments', 'json', req, runtime)
)
def list_parent_by_user(
self,
request: dingtalkvillage__1__0_models.ListParentByUserRequest,
) -> dingtalkvillage__1__0_models.ListParentByUserResponse:
runtime = util_models.RuntimeOptions()
headers = dingtalkvillage__1__0_models.ListParentByUserHeaders()
return self.list_parent_by_user_with_options(request, headers, runtime)
async def list_parent_by_user_async(
self,
request: dingtalkvillage__1__0_models.ListParentByUserRequest,
) -> dingtalkvillage__1__0_models.ListParentByUserResponse:
runtime = util_models.RuntimeOptions()
headers = dingtalkvillage__1__0_models.ListParentByUserHeaders()
return await self.list_parent_by_user_with_options_async(request, headers, runtime)
def list_parent_by_user_with_options(
self,
request: dingtalkvillage__1__0_models.ListParentByUserRequest,
headers: dingtalkvillage__1__0_models.ListParentByUserHeaders,
runtime: util_models.RuntimeOptions,
) -> dingtalkvillage__1__0_models.ListParentByUserResponse:
UtilClient.validate_model(request)
query = {}
if not UtilClient.is_unset(request.sub_corp_id):
query['subCorpId'] = request.sub_corp_id
if not UtilClient.is_unset(request.user_id):
query['userId'] = request.user_id
real_headers = {}
if not UtilClient.is_unset(headers.common_headers):
real_headers = headers.common_headers
if not UtilClient.is_unset(headers.x_acs_dingtalk_access_token):
real_headers['x-acs-dingtalk-access-token'] = headers.x_acs_dingtalk_access_token
req = open_api_models.OpenApiRequest(
headers=real_headers,
query=OpenApiUtilClient.query(query)
)
return TeaCore.from_map(
dingtalkvillage__1__0_models.ListParentByUserResponse(),
self.do_roarequest('ListParentByUser', 'village_1.0', 'HTTP', 'GET', 'AK', f'/v1.0/village/departments/listParentByUser', 'json', req, runtime)
)
async def list_parent_by_user_with_options_async(
self,
request: dingtalkvillage__1__0_models.ListParentByUserRequest,
headers: dingtalkvillage__1__0_models.ListParentByUserHeaders,
runtime: util_models.RuntimeOptions,
) -> dingtalkvillage__1__0_models.ListParentByUserResponse:
UtilClient.validate_model(request)
query = {}
if not UtilClient.is_unset(request.sub_corp_id):
query['subCorpId'] = request.sub_corp_id
if not UtilClient.is_unset(request.user_id):
query['userId'] = request.user_id
real_headers = {}
if not UtilClient.is_unset(headers.common_headers):
real_headers = headers.common_headers
if not UtilClient.is_unset(headers.x_acs_dingtalk_access_token):
real_headers['x-acs-dingtalk-access-token'] = headers.x_acs_dingtalk_access_token
req = open_api_models.OpenApiRequest(
headers=real_headers,
query=OpenApiUtilClient.query(query)
)
return TeaCore.from_map(
dingtalkvillage__1__0_models.ListParentByUserResponse(),
await self.do_roarequest_async('ListParentByUser', 'village_1.0', 'HTTP', 'GET', 'AK', f'/v1.0/village/departments/listParentByUser', 'json', req, runtime)
)
def list_sub_dept(
self,
department_id: str,
request: dingtalkvillage__1__0_models.ListSubDeptRequest,
) -> dingtalkvillage__1__0_models.ListSubDeptResponse:
runtime = util_models.RuntimeOptions()
headers = dingtalkvillage__1__0_models.ListSubDeptHeaders()
return self.list_sub_dept_with_options(department_id, request, headers, runtime)
async def list_sub_dept_async(
self,
department_id: str,
request: dingtalkvillage__1__0_models.ListSubDeptRequest,
) -> dingtalkvillage__1__0_models.ListSubDeptResponse:
runtime = util_models.RuntimeOptions()
headers = dingtalkvillage__1__0_models.ListSubDeptHeaders()
return await self.list_sub_dept_with_options_async(department_id, request, headers, runtime)
def list_sub_dept_with_options(
self,
department_id: str,
request: dingtalkvillage__1__0_models.ListSubDeptRequest,
headers: dingtalkvillage__1__0_models.ListSubDeptHeaders,
runtime: util_models.RuntimeOptions,
) -> dingtalkvillage__1__0_models.ListSubDeptResponse:
UtilClient.validate_model(request)
query = {}
if not UtilClient.is_unset(request.sub_corp_id):
query['subCorpId'] = request.sub_corp_id
if not UtilClient.is_unset(request.language):
query['language'] = request.language
real_headers = {}
if not UtilClient.is_unset(headers.common_headers):
real_headers = headers.common_headers
if not UtilClient.is_unset(headers.x_acs_dingtalk_access_token):
real_headers['x-acs-dingtalk-access-token'] = headers.x_acs_dingtalk_access_token
req = open_api_models.OpenApiRequest(
headers=real_headers,
query=OpenApiUtilClient.query(query)
)
return TeaCore.from_map(
dingtalkvillage__1__0_models.ListSubDeptResponse(),
self.do_roarequest('ListSubDept', 'village_1.0', 'HTTP', 'GET', 'AK', f'/v1.0/village/departments/{department_id}/subDepartments', 'json', req, runtime)
)
async def list_sub_dept_with_options_async(
self,
department_id: str,
request: dingtalkvillage__1__0_models.ListSubDeptRequest,
headers: dingtalkvillage__1__0_models.ListSubDeptHeaders,
runtime: util_models.RuntimeOptions,
) -> dingtalkvillage__1__0_models.ListSubDeptResponse:
UtilClient.validate_model(request)
query = {}
if not UtilClient.is_unset(request.sub_corp_id):
query['subCorpId'] = request.sub_corp_id
if not UtilClient.is_unset(request.language):
query['language'] = request.language
real_headers = {}
if not UtilClient.is_unset(headers.common_headers):
real_headers = headers.common_headers
if not UtilClient.is_unset(headers.x_acs_dingtalk_access_token):
real_headers['x-acs-dingtalk-access-token'] = headers.x_acs_dingtalk_access_token
req = open_api_models.OpenApiRequest(
headers=real_headers,
query=OpenApiUtilClient.query(query)
)
return TeaCore.from_map(
dingtalkvillage__1__0_models.ListSubDeptResponse(),
await self.do_roarequest_async('ListSubDept', 'village_1.0', 'HTTP', 'GET', 'AK', f'/v1.0/village/departments/{department_id}/subDepartments', 'json', req, runtime)
)
def get_user(
self,
user_id: str,
request: dingtalkvillage__1__0_models.GetUserRequest,
) -> dingtalkvillage__1__0_models.GetUserResponse:
runtime = util_models.RuntimeOptions()
headers = dingtalkvillage__1__0_models.GetUserHeaders()
return self.get_user_with_options(user_id, request, headers, runtime)
async def get_user_async(
self,
user_id: str,
request: dingtalkvillage__1__0_models.GetUserRequest,
) -> dingtalkvillage__1__0_models.GetUserResponse:
runtime = util_models.RuntimeOptions()
headers = dingtalkvillage__1__0_models.GetUserHeaders()
return await self.get_user_with_options_async(user_id, request, headers, runtime)
def get_user_with_options(
self,
user_id: str,
request: dingtalkvillage__1__0_models.GetUserRequest,
headers: dingtalkvillage__1__0_models.GetUserHeaders,
runtime: util_models.RuntimeOptions,
) -> dingtalkvillage__1__0_models.GetUserResponse:
UtilClient.validate_model(request)
query = {}
if not UtilClient.is_unset(request.sub_corp_id):
query['subCorpId'] = request.sub_corp_id
if not UtilClient.is_unset(request.language):
query['language'] = request.language
real_headers = {}
if not UtilClient.is_unset(headers.common_headers):
real_headers = headers.common_headers
if not UtilClient.is_unset(headers.x_acs_dingtalk_access_token):
real_headers['x-acs-dingtalk-access-token'] = headers.x_acs_dingtalk_access_token
req = open_api_models.OpenApiRequest(
headers=real_headers,
query=OpenApiUtilClient.query(query)
)
return TeaCore.from_map(
dingtalkvillage__1__0_models.GetUserResponse(),
self.do_roarequest('GetUser', 'village_1.0', 'HTTP', 'GET', 'AK', f'/v1.0/village/users/getByUserId', 'json', req, runtime)
)
async def get_user_with_options_async(
self,
user_id: str,
request: dingtalkvillage__1__0_models.GetUserRequest,
headers: dingtalkvillage__1__0_models.GetUserHeaders,
runtime: util_models.RuntimeOptions,
) -> dingtalkvillage__1__0_models.GetUserResponse:
UtilClient.validate_model(request)
query = {}
if not UtilClient.is_unset(request.sub_corp_id):
query['subCorpId'] = request.sub_corp_id
if not UtilClient.is_unset(request.language):
query['language'] = request.language
real_headers = {}
if not UtilClient.is_unset(headers.common_headers):
real_headers = headers.common_headers
if not UtilClient.is_unset(headers.x_acs_dingtalk_access_token):
real_headers['x-acs-dingtalk-access-token'] = headers.x_acs_dingtalk_access_token
req = open_api_models.OpenApiRequest(
headers=real_headers,
query=OpenApiUtilClient.query(query)
)
return TeaCore.from_map(
dingtalkvillage__1__0_models.GetUserResponse(),
await self.do_roarequest_async('GetUser', 'village_1.0', 'HTTP', 'GET', 'AK', f'/v1.0/village/users/getByUserId', 'json', req, runtime)
)
def list_dept_users(
self,
department_id: str,
request: dingtalkvillage__1__0_models.ListDeptUsersRequest,
) -> dingtalkvillage__1__0_models.ListDeptUsersResponse:
runtime = util_models.RuntimeOptions()
headers = dingtalkvillage__1__0_models.ListDeptUsersHeaders()
return self.list_dept_users_with_options(department_id, request, headers, runtime)
async def list_dept_users_async(
self,
department_id: str,
request: dingtalkvillage__1__0_models.ListDeptUsersRequest,
) -> dingtalkvillage__1__0_models.ListDeptUsersResponse:
runtime = util_models.RuntimeOptions()
headers = dingtalkvillage__1__0_models.ListDeptUsersHeaders()
return await self.list_dept_users_with_options_async(department_id, request, headers, runtime)
def list_dept_users_with_options(
self,
department_id: str,
request: dingtalkvillage__1__0_models.ListDeptUsersRequest,
headers: dingtalkvillage__1__0_models.ListDeptUsersHeaders,
runtime: util_models.RuntimeOptions,
) -> dingtalkvillage__1__0_models.ListDeptUsersResponse:
UtilClient.validate_model(request)
query = {}
if not UtilClient.is_unset(request.cursor):
query['cursor'] = request.cursor
if not UtilClient.is_unset(request.size):
query['size'] = request.size
if not UtilClient.is_unset(request.contain_access_limit):
query['containAccessLimit'] = request.contain_access_limit
if not UtilClient.is_unset(request.sub_corp_id):
query['subCorpId'] = request.sub_corp_id
if not UtilClient.is_unset(request.language):
query['language'] = request.language
if not UtilClient.is_unset(request.order_field):
query['orderField'] = request.order_field
real_headers = {}
if not UtilClient.is_unset(headers.common_headers):
real_headers = headers.common_headers
if not UtilClient.is_unset(headers.x_acs_dingtalk_access_token):
real_headers['x-acs-dingtalk-access-token'] = headers.x_acs_dingtalk_access_token
req = open_api_models.OpenApiRequest(
headers=real_headers,
query=OpenApiUtilClient.query(query)
)
return TeaCore.from_map(
dingtalkvillage__1__0_models.ListDeptUsersResponse(),
self.do_roarequest('ListDeptUsers', 'village_1.0', 'HTTP', 'GET', 'AK', f'/v1.0/village/departments/{department_id}/users', 'json', req, runtime)
)
async def list_dept_users_with_options_async(
self,
department_id: str,
request: dingtalkvillage__1__0_models.ListDeptUsersRequest,
headers: dingtalkvillage__1__0_models.ListDeptUsersHeaders,
runtime: util_models.RuntimeOptions,
) -> dingtalkvillage__1__0_models.ListDeptUsersResponse:
UtilClient.validate_model(request)
query = {}
if not UtilClient.is_unset(request.cursor):
query['cursor'] = request.cursor
if not UtilClient.is_unset(request.size):
query['size'] = request.size
if not UtilClient.is_unset(request.contain_access_limit):
query['containAccessLimit'] = request.contain_access_limit
if not UtilClient.is_unset(request.sub_corp_id):
query['subCorpId'] = request.sub_corp_id
if not UtilClient.is_unset(request.language):
query['language'] = request.language
if not UtilClient.is_unset(request.order_field):
query['orderField'] = request.order_field
real_headers = {}
if not UtilClient.is_unset(headers.common_headers):
real_headers = headers.common_headers
if not UtilClient.is_unset(headers.x_acs_dingtalk_access_token):
real_headers['x-acs-dingtalk-access-token'] = headers.x_acs_dingtalk_access_token
req = open_api_models.OpenApiRequest(
headers=real_headers,
query=OpenApiUtilClient.query(query)
)
return TeaCore.from_map(
dingtalkvillage__1__0_models.ListDeptUsersResponse(),
await self.do_roarequest_async('ListDeptUsers', 'village_1.0', 'HTTP', 'GET', 'AK', f'/v1.0/village/departments/{department_id}/users', 'json', req, runtime)
)
def list_resident_user_infos(
self,
request: dingtalkvillage__1__0_models.ListResidentUserInfosRequest,
) -> dingtalkvillage__1__0_models.ListResidentUserInfosResponse:
runtime = util_models.RuntimeOptions()
headers = dingtalkvillage__1__0_models.ListResidentUserInfosHeaders()
return self.list_resident_user_infos_with_options(request, headers, runtime)
async def list_resident_user_infos_async(
self,
request: dingtalkvillage__1__0_models.ListResidentUserInfosRequest,
) -> dingtalkvillage__1__0_models.ListResidentUserInfosResponse:
runtime = util_models.RuntimeOptions()
headers = dingtalkvillage__1__0_models.ListResidentUserInfosHeaders()
return await self.list_resident_user_infos_with_options_async(request, headers, runtime)
def list_resident_user_infos_with_options(
self,
tmp_req: dingtalkvillage__1__0_models.ListResidentUserInfosRequest,
headers: dingtalkvillage__1__0_models.ListResidentUserInfosHeaders,
runtime: util_models.RuntimeOptions,
) -> dingtalkvillage__1__0_models.ListResidentUserInfosResponse:
UtilClient.validate_model(tmp_req)
request = dingtalkvillage__1__0_models.ListResidentUserInfosShrinkRequest()
OpenApiUtilClient.convert(tmp_req, request)
if not UtilClient.is_unset(tmp_req.user_ids):
request.user_ids_shrink = OpenApiUtilClient.array_to_string_with_specified_style(tmp_req.user_ids, 'userIds', 'json')
query = {}
if not UtilClient.is_unset(request.sub_corp_id):
query['subCorpId'] = request.sub_corp_id
if not UtilClient.is_unset(request.user_ids_shrink):
query['userIds'] = request.user_ids_shrink
real_headers = {}
if not UtilClient.is_unset(headers.common_headers):
real_headers = headers.common_headers
if not UtilClient.is_unset(headers.x_acs_dingtalk_access_token):
real_headers['x-acs-dingtalk-access-token'] = headers.x_acs_dingtalk_access_token
req = open_api_models.OpenApiRequest(
headers=real_headers,
query=OpenApiUtilClient.query(query)
)
return TeaCore.from_map(
dingtalkvillage__1__0_models.ListResidentUserInfosResponse(),
self.do_roarequest('ListResidentUserInfos', 'village_1.0', 'HTTP', 'GET', 'AK', f'/v1.0/village/residentUsers/getByUserIds', 'json', req, runtime)
)
async def list_resident_user_infos_with_options_async(
self,
tmp_req: dingtalkvillage__1__0_models.ListResidentUserInfosRequest,
headers: dingtalkvillage__1__0_models.ListResidentUserInfosHeaders,
runtime: util_models.RuntimeOptions,
) -> dingtalkvillage__1__0_models.ListResidentUserInfosResponse:
UtilClient.validate_model(tmp_req)
request = dingtalkvillage__1__0_models.ListResidentUserInfosShrinkRequest()
OpenApiUtilClient.convert(tmp_req, request)
if not UtilClient.is_unset(tmp_req.user_ids):
request.user_ids_shrink = OpenApiUtilClient.array_to_string_with_specified_style(tmp_req.user_ids, 'userIds', 'json')
query = {}
if not UtilClient.is_unset(request.sub_corp_id):
query['subCorpId'] = request.sub_corp_id
if not UtilClient.is_unset(request.user_ids_shrink):
query['userIds'] = request.user_ids_shrink
real_headers = {}
if not UtilClient.is_unset(headers.common_headers):
real_headers = headers.common_headers
if not UtilClient.is_unset(headers.x_acs_dingtalk_access_token):
real_headers['x-acs-dingtalk-access-token'] = headers.x_acs_dingtalk_access_token
req = open_api_models.OpenApiRequest(
headers=real_headers,
query=OpenApiUtilClient.query(query)
)
return TeaCore.from_map(
dingtalkvillage__1__0_models.ListResidentUserInfosResponse(),
await self.do_roarequest_async('ListResidentUserInfos', 'village_1.0', 'HTTP', 'GET', 'AK', f'/v1.0/village/residentUsers/getByUserIds', 'json', req, runtime)
)
def list_sub_dept_ids(
self,
department_id: str,
request: dingtalkvillage__1__0_models.ListSubDeptIdsRequest,
) -> dingtalkvillage__1__0_models.ListSubDeptIdsResponse:
runtime = util_models.RuntimeOptions()
headers = dingtalkvillage__1__0_models.ListSubDeptIdsHeaders()
return self.list_sub_dept_ids_with_options(department_id, request, headers, runtime)
async def list_sub_dept_ids_async(
self,
department_id: str,
request: dingtalkvillage__1__0_models.ListSubDeptIdsRequest,
) -> dingtalkvillage__1__0_models.ListSubDeptIdsResponse:
runtime = util_models.RuntimeOptions()
headers = dingtalkvillage__1__0_models.ListSubDeptIdsHeaders()
return await self.list_sub_dept_ids_with_options_async(department_id, request, headers, runtime)
def list_sub_dept_ids_with_options(
self,
department_id: str,
request: dingtalkvillage__1__0_models.ListSubDeptIdsRequest,
headers: dingtalkvillage__1__0_models.ListSubDeptIdsHeaders,
runtime: util_models.RuntimeOptions,
) -> dingtalkvillage__1__0_models.ListSubDeptIdsResponse:
UtilClient.validate_model(request)
query = {}
if not UtilClient.is_unset(request.sub_corp_id):
query['subCorpId'] = request.sub_corp_id
real_headers = {}
if not UtilClient.is_unset(headers.common_headers):
real_headers = headers.common_headers
if not UtilClient.is_unset(headers.x_acs_dingtalk_access_token):
real_headers['x-acs-dingtalk-access-token'] = headers.x_acs_dingtalk_access_token
req = open_api_models.OpenApiRequest(
headers=real_headers,
query=OpenApiUtilClient.query(query)
)
return TeaCore.from_map(
dingtalkvillage__1__0_models.ListSubDeptIdsResponse(),
self.do_roarequest('ListSubDeptIds', 'village_1.0', 'HTTP', 'GET', 'AK', f'/v1.0/village/departments/{department_id}/subDepartmentIds', 'json', req, runtime)
)
async def list_sub_dept_ids_with_options_async(
self,
department_id: str,
request: dingtalkvillage__1__0_models.ListSubDeptIdsRequest,
headers: dingtalkvillage__1__0_models.ListSubDeptIdsHeaders,
runtime: util_models.RuntimeOptions,
) -> dingtalkvillage__1__0_models.ListSubDeptIdsResponse:
UtilClient.validate_model(request)
query = {}
if not UtilClient.is_unset(request.sub_corp_id):
query['subCorpId'] = request.sub_corp_id
real_headers = {}
if not UtilClient.is_unset(headers.common_headers):
real_headers = headers.common_headers
if not UtilClient.is_unset(headers.x_acs_dingtalk_access_token):
real_headers['x-acs-dingtalk-access-token'] = headers.x_acs_dingtalk_access_token
req = open_api_models.OpenApiRequest(
headers=real_headers,
query=OpenApiUtilClient.query(query)
)
return TeaCore.from_map(
dingtalkvillage__1__0_models.ListSubDeptIdsResponse(),
await self.do_roarequest_async('ListSubDeptIds', 'village_1.0', 'HTTP', 'GET', 'AK', f'/v1.0/village/departments/{department_id}/subDepartmentIds', 'json', req, runtime)
)
| 49.090637
| 193
| 0.702789
| 7,124
| 65,536
| 6.033829
| 0.029618
| 0.0134
| 0.099267
| 0.134303
| 0.981831
| 0.964569
| 0.957171
| 0.931604
| 0.912644
| 0.909666
| 0
| 0.012586
| 0.213165
| 65,536
| 1,334
| 194
| 49.127436
| 0.821006
| 0.001221
| 0
| 0.815789
| 1
| 0
| 0.073898
| 0.042266
| 0
| 0
| 0
| 0
| 0
| 1
| 0.029506
| false
| 0
| 0.005582
| 0
| 0.093301
| 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
|
fc81fd07a17d04b91295d3513e01da661ff21fb2
| 102
|
py
|
Python
|
antu/nn/dynet/classifiers/__init__.py
|
AntNLP/pyAnt
|
3256ada0784401b9677d9568e81f3a8792eebee7
|
[
"Apache-2.0"
] | 17
|
2018-12-28T09:39:12.000Z
|
2021-09-21T11:56:00.000Z
|
antu/nn/dynet/classifiers/__init__.py
|
AntNLP/pyAnt
|
3256ada0784401b9677d9568e81f3a8792eebee7
|
[
"Apache-2.0"
] | 3
|
2019-01-21T06:14:16.000Z
|
2020-05-25T13:18:09.000Z
|
antu/nn/dynet/classifiers/__init__.py
|
AntNLP/antu
|
3256ada0784401b9677d9568e81f3a8792eebee7
|
[
"Apache-2.0"
] | 11
|
2018-12-31T09:06:03.000Z
|
2021-06-18T07:00:53.000Z
|
from .nn_classifier import BiaffineLabelClassifier
from .nn_classifier import PointerLabelClassifier
| 25.5
| 50
| 0.892157
| 10
| 102
| 8.9
| 0.6
| 0.134831
| 0.359551
| 0.494382
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.088235
| 102
| 3
| 51
| 34
| 0.956989
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 7
|
5d779bb55193f069362bc8d32cabca95fc166f07
| 112
|
py
|
Python
|
feed/tests/conftest.py
|
cul-it/arxiv-rss
|
40c0e859528119cc8ba3700312cb8df095d95cdd
|
[
"MIT"
] | 4
|
2020-06-29T15:05:37.000Z
|
2022-02-02T10:28:28.000Z
|
feed/tests/conftest.py
|
arXiv/arxiv-feed
|
82923d062e2524df94c22490cf936a988559ce66
|
[
"MIT"
] | 12
|
2020-03-06T16:45:00.000Z
|
2022-03-02T15:36:14.000Z
|
feed/tests/conftest.py
|
cul-it/arxiv-rss
|
40c0e859528119cc8ba3700312cb8df095d95cdd
|
[
"MIT"
] | 2
|
2020-12-06T16:30:06.000Z
|
2021-11-05T12:29:08.000Z
|
import pytest
from feed.factory import create_web_app
@pytest.fixture
def app():
return create_web_app()
| 12.444444
| 39
| 0.767857
| 17
| 112
| 4.823529
| 0.647059
| 0.219512
| 0.292683
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.160714
| 112
| 8
| 40
| 14
| 0.87234
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.2
| true
| 0
| 0.4
| 0.2
| 0.8
| 0
| 1
| 0
| 0
| null | 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
| 1
| 1
| 0
|
0
| 8
|
5db71c15af65bb16026746f0880e76d0d7c62b55
| 349
|
py
|
Python
|
tests/internal/instance_type/test_instance_type_f1_auto.py
|
frolovv/aws.ec2.compare
|
582805823492f833d65c0441c4a14dce697c12aa
|
[
"Apache-2.0"
] | null | null | null |
tests/internal/instance_type/test_instance_type_f1_auto.py
|
frolovv/aws.ec2.compare
|
582805823492f833d65c0441c4a14dce697c12aa
|
[
"Apache-2.0"
] | null | null | null |
tests/internal/instance_type/test_instance_type_f1_auto.py
|
frolovv/aws.ec2.compare
|
582805823492f833d65c0441c4a14dce697c12aa
|
[
"Apache-2.0"
] | 1
|
2021-12-15T11:58:22.000Z
|
2021-12-15T11:58:22.000Z
|
# Testing module instance_type.f1
import pytest
import ec2_compare.internal.instance_type.f1
def test_get_internal_data_instance_type_f1_get_instances_list():
assert len(ec2_compare.internal.instance_type.f1.get_instances_list()) > 0
def test_get_internal_data_instance_type_f1_get():
assert len(ec2_compare.internal.instance_type.f1.get) > 0
| 34.9
| 76
| 0.848138
| 56
| 349
| 4.839286
| 0.339286
| 0.265683
| 0.309963
| 0.250923
| 0.826568
| 0.826568
| 0.612546
| 0.612546
| 0.612546
| 0
| 0
| 0.034056
| 0.074499
| 349
| 9
| 77
| 38.777778
| 0.804954
| 0.088825
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.333333
| 1
| 0.333333
| true
| 0
| 0.333333
| 0
| 0.666667
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 10
|
5dd6cb949151e6c48b0b4e75d0221f40d88395fd
| 2,672
|
py
|
Python
|
squad_game/games/migrations/0003_game_created_at_game_updated_at_and_more.py
|
ricardodani/squad-game
|
e75a22dee8acc6bf11bdf81363712344f42dc207
|
[
"Apache-2.0"
] | null | null | null |
squad_game/games/migrations/0003_game_created_at_game_updated_at_and_more.py
|
ricardodani/squad-game
|
e75a22dee8acc6bf11bdf81363712344f42dc207
|
[
"Apache-2.0"
] | null | null | null |
squad_game/games/migrations/0003_game_created_at_game_updated_at_and_more.py
|
ricardodani/squad-game
|
e75a22dee8acc6bf11bdf81363712344f42dc207
|
[
"Apache-2.0"
] | null | null | null |
# Generated by Django 4.0.3 on 2022-03-25 05:44
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('games', '0002_gameplayer_is_accepted'),
]
operations = [
migrations.AddField(
model_name='game',
name='created_at',
field=models.DateTimeField(auto_now_add=True, default=django.utils.timezone.now),
preserve_default=False,
),
migrations.AddField(
model_name='game',
name='updated_at',
field=models.DateTimeField(auto_now=True),
),
migrations.AddField(
model_name='gamecategory',
name='created_at',
field=models.DateTimeField(auto_now_add=True, default=django.utils.timezone.now),
preserve_default=False,
),
migrations.AddField(
model_name='gamecategory',
name='updated_at',
field=models.DateTimeField(auto_now=True),
),
migrations.AddField(
model_name='gameplayer',
name='created_at',
field=models.DateTimeField(auto_now_add=True, default=django.utils.timezone.now),
preserve_default=False,
),
migrations.AddField(
model_name='gameplayer',
name='updated_at',
field=models.DateTimeField(auto_now=True),
),
migrations.AddField(
model_name='gameround',
name='created_at',
field=models.DateTimeField(auto_now_add=True, default=django.utils.timezone.now),
preserve_default=False,
),
migrations.AddField(
model_name='gameround',
name='updated_at',
field=models.DateTimeField(auto_now=True),
),
migrations.AddField(
model_name='playerfact',
name='created_at',
field=models.DateTimeField(auto_now_add=True, default=django.utils.timezone.now),
preserve_default=False,
),
migrations.AddField(
model_name='playerfact',
name='updated_at',
field=models.DateTimeField(auto_now=True),
),
migrations.AddField(
model_name='playerroundscore',
name='created_at',
field=models.DateTimeField(auto_now_add=True, default=django.utils.timezone.now),
preserve_default=False,
),
migrations.AddField(
model_name='playerroundscore',
name='updated_at',
field=models.DateTimeField(auto_now=True),
),
]
| 32.987654
| 93
| 0.584581
| 255
| 2,672
| 5.92549
| 0.188235
| 0.142952
| 0.18266
| 0.214428
| 0.882859
| 0.882859
| 0.784249
| 0.784249
| 0.784249
| 0.752482
| 0
| 0.010281
| 0.308383
| 2,672
| 80
| 94
| 33.4
| 0.807359
| 0.016841
| 0
| 0.891892
| 1
| 0
| 0.104381
| 0.010286
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.027027
| 0
| 0.067568
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 1
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 10
|
5d00f06630e4ff333b84a63d477020159cf35d9d
| 28,058
|
py
|
Python
|
covigator/tests/unit_tests/test_ena_accessor.py
|
TRON-Bioinformatics/covigator
|
59cd5012217cb043d97c77ce5273d8930e74390d
|
[
"MIT"
] | 7
|
2021-07-23T14:09:51.000Z
|
2022-01-26T20:26:27.000Z
|
covigator/tests/unit_tests/test_ena_accessor.py
|
TRON-Bioinformatics/covigator
|
59cd5012217cb043d97c77ce5273d8930e74390d
|
[
"MIT"
] | 2
|
2021-07-27T08:30:22.000Z
|
2022-02-22T20:06:05.000Z
|
covigator/tests/unit_tests/test_ena_accessor.py
|
TRON-Bioinformatics/covigator
|
59cd5012217cb043d97c77ce5273d8930e74390d
|
[
"MIT"
] | null | null | null |
from datetime import date
from sqlalchemy import and_
from covigator.database.model import SampleEna, Sample, JobEna, Log, DataSource, CovigatorModule
from covigator.tests.unit_tests.abstract_test import AbstractTest
from covigator.tests.unit_tests.faked_objects import FakeEnaAccessor
class EnaAccessorTests(AbstractTest):
def test_filtering_by_library_strategies(self):
ena_accessor = FakeEnaAccessor([
{"run_accession": "ERR4080483",
"scientific_name": "Severe acute respiratory syndrome coronavirus 2",
"instrument_platform": "ILLUMINA",
"library_strategy": "AMPLICON",
"fastq_ftp": "ftp.sra.ebi.ac.uk/vol1/fastq/ERR408/003/ERR4080483/ERR4080483_1.fastq.gz",
"fastq_md5": "a91a9dfa2f7008e13a7ce9767aa9aaf3",
"host_tax_id": "9606"},
{"run_accession": "ERR4080484",
"scientific_name": "Severe acute respiratory syndrome coronavirus 2",
"instrument_platform": "ILLUMINA",
"library_strategy": "OTHER",
"fastq_ftp": "ftp.sra.ebi.ac.uk/vol1/fastq/ERR408/004/ERR4080484/ERR4080484_1.fastq.gz",
"fastq_md5": "c57fef34933cbbec2e9e08867f3c664c",
"host_tax_id": "9606"},
{"run_accession": "ERR4080485",
"scientific_name": "Severe acute respiratory syndrome coronavirus 2",
"instrument_platform": "ILLUMINA",
"library_strategy": "WGS",
"fastq_ftp": "ftp.sra.ebi.ac.uk/vol1/fastq/ERR408/005/ERR4080485/ERR4080485_1.fastq.gz",
"fastq_md5": "4de269d2b5831e1c5175586af694d21e",
"host_tax_id": "9606"}
])
ena_accessor.access()
self.assertEqual(ena_accessor.included, 1)
self.assertEqual(ena_accessor.excluded, 2)
self.assertEqual(ena_accessor.excluded_samples_by_library_strategy.get("AMPLICON"), 1)
self.assertEqual(ena_accessor.excluded_samples_by_library_strategy.get("OTHER"), 1)
def test_filtering_by_instrument_platform(self):
ena_accessor = FakeEnaAccessor([
{"run_accession": "ERR4080483",
"scientific_name": "Severe acute respiratory syndrome coronavirus 2",
"instrument_platform": "OXFORD_NANOPORE",
"library_strategy": "WGS",
"fastq_ftp": "ftp.sra.ebi.ac.uk/vol1/fastq/ERR408/003/ERR4080483/ERR4080483_1.fastq.gz",
"fastq_md5": "a91a9dfa2f7008e13a7ce9767aa9aaf3",
"host_tax_id": "9606"},
{"run_accession": "ERR4080484",
"scientific_name": "Severe acute respiratory syndrome coronavirus 2",
"instrument_platform": "SANGER",
"library_strategy": "WGS",
"fastq_ftp": "ftp.sra.ebi.ac.uk/vol1/fastq/ERR408/004/ERR4080484/ERR4080484_1.fastq.gz",
"fastq_md5": "c57fef34933cbbec2e9e08867f3c664c",
"host_tax_id": "9606"},
{"run_accession": "ERR4080485",
"scientific_name": "Severe acute respiratory syndrome coronavirus 2",
"instrument_platform": "ILLUMINA",
"library_strategy": "WGS",
"fastq_ftp": "ftp.sra.ebi.ac.uk/vol1/fastq/ERR408/005/ERR4080485/ERR4080485_1.fastq.gz",
"fastq_md5": "4de269d2b5831e1c5175586af694d21e",
"host_tax_id": "9606"}
])
ena_accessor.access()
self.assertEqual(ena_accessor.included, 1)
self.assertEqual(ena_accessor.excluded, 2)
self.assertEqual(ena_accessor.excluded_samples_by_instrument_platform.get("OXFORD_NANOPORE"), 1)
self.assertEqual(ena_accessor.excluded_samples_by_instrument_platform.get("SANGER"), 1)
def test_filtering_by_host_taxid(self):
ena_accessor = FakeEnaAccessor([
{"run_accession": "ERR4080483",
"scientific_name": "Severe acute respiratory syndrome coronavirus 2",
"instrument_platform": "ILLUMINA",
"library_strategy": "WGS",
"fastq_ftp": "ftp.sra.ebi.ac.uk/vol1/fastq/ERR408/003/ERR4080483/ERR4080483_1.fastq.gz",
"fastq_md5": "a91a9dfa2f7008e13a7ce9767aa9aaf3",
"host_tax_id": "9606"},
{"run_accession": "ERR4080484",
"scientific_name": "Severe acute respiratory syndrome coronavirus 2",
"instrument_platform": "ILLUMINA",
"library_strategy": "WGS",
"fastq_ftp": "ftp.sra.ebi.ac.uk/vol1/fastq/ERR408/004/ERR4080484/ERR4080484_1.fastq.gz",
"fastq_md5": "c57fef34933cbbec2e9e08867f3c664c",
"host_tax_id": "1111"},
{"run_accession": "ERR4080485",
"scientific_name": "Severe acute respiratory syndrome coronavirus 2",
"instrument_platform": "ILLUMINA",
"library_strategy": "WGS",
"fastq_ftp": "ftp.sra.ebi.ac.uk/vol1/fastq/ERR408/005/ERR4080485/ERR4080485_1.fastq.gz",
"fastq_md5": "4de269d2b5831e1c5175586af694d21e",
"host_tax_id": "2222"}
])
ena_accessor.access()
self.assertEqual(ena_accessor.included, 1)
self.assertEqual(ena_accessor.excluded, 2)
self.assertEqual(ena_accessor.excluded_samples_by_host_tax_id.get("1111"), 1)
self.assertEqual(ena_accessor.excluded_samples_by_host_tax_id.get("2222"), 1)
def test_filtering_by_missing_fastqs(self):
ena_accessor = FakeEnaAccessor([
{"run_accession": "ERR4080483",
"scientific_name": "Severe acute respiratory syndrome coronavirus 2",
"instrument_platform": "ILLUMINA",
"library_strategy": "WGS",
"fastq_ftp": "",
"fastq_md5": "a91a9dfa2f7008e13a7ce9767aa9aaf3",
"host_tax_id": "9606"},
{"run_accession": "ERR4080484",
"scientific_name": "Severe acute respiratory syndrome coronavirus 2",
"instrument_platform": "ILLUMINA",
"library_strategy": "WGS",
"fastq_ftp": None,
"fastq_md5": "c57fef34933cbbec2e9e08867f3c664c",
"host_tax_id": "9606"},
{"run_accession": "ERR4080485",
"scientific_name": "Severe acute respiratory syndrome coronavirus 2",
"instrument_platform": "ILLUMINA",
"library_strategy": "WGS",
"fastq_ftp": "ftp.sra.ebi.ac.uk/vol1/fastq/ERR408/005/ERR4080485/ERR4080485_1.fastq.gz",
"fastq_md5": "4de269d2b5831e1c5175586af694d21e",
"host_tax_id": "9606"}
])
ena_accessor.access()
self.assertEqual(ena_accessor.included, 1)
self.assertEqual(ena_accessor.excluded, 2)
self.assertEqual(ena_accessor.excluded_samples_by_fastq_ftp, 2)
def test_no_filtering(self):
ena_accessor = FakeEnaAccessor([
{"run_accession": "ERR4080483",
"scientific_name": "Severe acute respiratory syndrome coronavirus 2",
"instrument_platform": "ILLUMINA",
"library_strategy": "WGS",
"fastq_ftp": "ftp.sra.ebi.ac.uk/vol1/fastq/ERR408/003/ERR4080483/ERR4080483_1.fastq.gz",
"fastq_md5": "a91a9dfa2f7008e13a7ce9767aa9aaf3",
"host_tax_id": "9606"},
{"run_accession": "ERR4080484",
"scientific_name": "Severe acute respiratory syndrome coronavirus 2",
"instrument_platform": "ILLUMINA",
"library_strategy": "WGS",
"fastq_ftp": "ftp.sra.ebi.ac.uk/vol1/fastq/ERR408/003/ERR4080483/ERR4080483_1.fastq.gz",
"fastq_md5": "c57fef34933cbbec2e9e08867f3c664c",
"host_tax_id": "9606"},
{"run_accession": "ERR4080485",
"scientific_name": "Severe acute respiratory syndrome coronavirus 2",
"instrument_platform": "ILLUMINA",
"library_strategy": "WGS",
"fastq_ftp": "ftp.sra.ebi.ac.uk/vol1/fastq/ERR408/005/ERR4080485/ERR4080485_1.fastq.gz",
"fastq_md5": "4de269d2b5831e1c5175586af694d21e",
"host_tax_id": "9606"}
])
ena_accessor.access()
self.assertEqual(ena_accessor.included, 3)
self.assertEqual(ena_accessor.excluded, 0)
def test_filtering_data_already_in_db(self):
ena_accessor = FakeEnaAccessor(results=[
{"run_accession": "ERR4080483",
"scientific_name": "Severe acute respiratory syndrome coronavirus 2",
"instrument_platform": "ILLUMINA",
"library_strategy": "WGS",
"fastq_ftp": "ftp.sra.ebi.ac.uk/vol1/fastq/ERR408/003/ERR4080483/ERR4080483_1.fastq.gz",
"fastq_md5": "a91a9dfa2f7008e13a7ce9767aa9aaf3",
"host_tax_id": "9606"},
{"run_accession": "ERR4080484",
"scientific_name": "Severe acute respiratory syndrome coronavirus 2",
"instrument_platform": "ILLUMINA",
"library_strategy": "WGS",
"fastq_ftp": "ftp.sra.ebi.ac.uk/vol1/fastq/ERR408/003/ERR4080483/ERR4080483_1.fastq.gz",
"fastq_md5": "c57fef34933cbbec2e9e08867f3c664c",
"host_tax_id": "9606"},
{"run_accession": "ERR4080485",
"scientific_name": "Severe acute respiratory syndrome coronavirus 2",
"instrument_platform": "ILLUMINA",
"library_strategy": "WGS",
"fastq_ftp": "ftp.sra.ebi.ac.uk/vol1/fastq/ERR408/005/ERR4080485/ERR4080485_1.fastq.gz",
"fastq_md5": "4de269d2b5831e1c5175586af694d21e",
"host_tax_id": "9606"}
], database=self.database)
ena_accessor.access()
self.assertEqual(ena_accessor.included, 3)
self.assertEqual(ena_accessor.excluded, 0)
ena_accessor = FakeEnaAccessor(results=[
{"run_accession": "ERR4080483",
"scientific_name": "Severe acute respiratory syndrome coronavirus 2",
"instrument_platform": "ILLUMINA",
"library_strategy": "WGS",
"fastq_ftp": "ftp.sra.ebi.ac.uk/vol1/fastq/ERR408/003/ERR4080483/ERR4080483_1.fastq.gz",
"fastq_md5": "a91a9dfa2f7008e13a7ce9767aa9aaf3",
"host_tax_id": "9606"},
{"run_accession": "ERR4080484",
"scientific_name": "Severe acute respiratory syndrome coronavirus 2",
"instrument_platform": "ILLUMINA",
"library_strategy": "WGS",
"fastq_ftp": "ftp.sra.ebi.ac.uk/vol1/fastq/ERR408/003/ERR4080483/ERR4080483_1.fastq.gz",
"fastq_md5": "c57fef34933cbbec2e9e08867f3c664c",
"host_tax_id": "9606"},
{"run_accession": "THIS_IS_A_NEW_ONE",
"scientific_name": "Severe acute respiratory syndrome coronavirus 2",
"instrument_platform": "ILLUMINA",
"library_strategy": "WGS",
"fastq_ftp": "ftp.sra.ebi.ac.uk/vol1/fastq/ERR408/005/ERR4080485/ERR4080485_1.fastq.gz",
"fastq_md5": "4de269d2b5831e1c5175586af694d21e",
"host_tax_id": "9606"}
], database=self.database)
ena_accessor.access()
self.assertEqual(ena_accessor.included, 1)
self.assertEqual(ena_accessor.excluded_existing, 2)
def test_country_parsing(self):
ena_accessor = FakeEnaAccessor(results=[
{"run_accession": "ERR4080483",
"scientific_name": "Severe acute respiratory syndrome coronavirus 2",
"instrument_platform": "ILLUMINA",
"library_strategy": "WGS",
"fastq_ftp": "ftp.sra.ebi.ac.uk/vol1/fastq/ERR408/003/ERR4080483/ERR4080483_1.fastq.gz",
"fastq_md5": "a91a9dfa2f7008e13a7ce9767aa9aaf3",
"host_tax_id": "9606",
"country": "england"},
{"run_accession": "ERR4080484",
"scientific_name": "Severe acute respiratory syndrome coronavirus 2",
"instrument_platform": "ILLUMINA",
"library_strategy": "WGS",
"fastq_ftp": "ftp.sra.ebi.ac.uk/vol1/fastq/ERR408/003/ERR4080483/ERR4080483_1.fastq.gz",
"fastq_md5": "c57fef34933cbbec2e9e08867f3c664c",
"host_tax_id": "9606",
"country": "GermaN"},
{"run_accession": "ERR4080485",
"scientific_name": "Severe acute respiratory syndrome coronavirus 2",
"instrument_platform": "ILLUMINA",
"library_strategy": "WGS",
"fastq_ftp": "ftp.sra.ebi.ac.uk/vol1/fastq/ERR408/005/ERR4080485/ERR4080485_1.fastq.gz",
"fastq_md5": "4de269d2b5831e1c5175586af694d21e",
"host_tax_id": "9606",
"country": "Morocco:Meknez"},
{"run_accession": "ERR4080486",
"scientific_name": "Severe acute respiratory syndrome coronavirus 2",
"instrument_platform": "ILLUMINA",
"library_strategy": "WGS",
"fastq_ftp": "ftp.sra.ebi.ac.uk/vol1/fastq/ERR408/005/ERR4080485/ERR4080485_1.fastq.gz",
"fastq_md5": "4de269d2b5831e1c5175586af694d21e",
"host_tax_id": "9606"},
{"run_accession": "ERR4080487",
"scientific_name": "Severe acute respiratory syndrome coronavirus 2",
"instrument_platform": "ILLUMINA",
"library_strategy": "WGS",
"fastq_ftp": "ftp.sra.ebi.ac.uk/vol1/fastq/ERR408/005/ERR4080485/ERR4080485_1.fastq.gz",
"fastq_md5": "4de269d2b5831e1c5175586af694d21e",
"host_tax_id": "9606",
"country": ""},
{"run_accession": "ERR4080488",
"scientific_name": "Severe acute respiratory syndrome coronavirus 2",
"instrument_platform": "ILLUMINA",
"library_strategy": "WGS",
"fastq_ftp": "ftp.sra.ebi.ac.uk/vol1/fastq/ERR408/005/ERR4080485/ERR4080485_1.fastq.gz",
"fastq_md5": "4de269d2b5831e1c5175586af694d21e",
"host_tax_id": "9606",
"country": "Jupiter"}
], database=self.database)
ena_accessor.access()
self.assertEqual(ena_accessor.included, 6)
self.assertEqual(ena_accessor.excluded, 0)
session = self.database.get_database_session()
run = session.query(SampleEna).filter(SampleEna.run_accession == "ERR4080483").first()
self.assertEqual(run.country_raw, "england")
self.assertEqual(run.country, "United Kingdom")
self.assertEqual(run.country_alpha_2, "GB")
self.assertEqual(run.country_alpha_3, "GBR")
self.assertEqual(run.continent_alpha_2, "EU")
self.assertEqual(run.continent, "Europe")
run = session.query(SampleEna).filter(SampleEna.run_accession == "ERR4080484").first()
self.assertEqual(run.country_raw, "GermaN")
self.assertEqual(run.country, "Germany")
self.assertEqual(run.country_alpha_2, "DE")
self.assertEqual(run.country_alpha_3, "DEU")
self.assertEqual(run.continent_alpha_2, "EU")
self.assertEqual(run.continent, "Europe")
run = session.query(SampleEna).filter(SampleEna.run_accession == "ERR4080485").first()
self.assertEqual(run.country_raw, "Morocco:Meknez")
self.assertEqual(run.country, "Morocco")
self.assertEqual(run.country_alpha_2, "MA")
self.assertEqual(run.country_alpha_3, "MAR")
self.assertEqual(run.continent_alpha_2, "AF")
self.assertEqual(run.continent, "Africa")
run = session.query(SampleEna).filter(SampleEna.run_accession == "ERR4080486").first()
self.assertEqual(run.country_raw, None)
self.assertEqual(run.country, "Not available")
self.assertEqual(run.country_alpha_2, "None")
self.assertEqual(run.country_alpha_3, "None")
self.assertEqual(run.continent_alpha_2, "None")
self.assertEqual(run.continent, "None")
run = session.query(SampleEna).filter(SampleEna.run_accession == "ERR4080487").first()
self.assertEqual(run.country_raw, "")
self.assertEqual(run.country, "Not available")
self.assertEqual(run.country_alpha_2, "None")
self.assertEqual(run.country_alpha_3, "None")
self.assertEqual(run.continent_alpha_2, "None")
self.assertEqual(run.continent, "None")
run = session.query(SampleEna).filter(SampleEna.run_accession == "ERR4080488").first()
self.assertEqual(run.country_raw, "Jupiter")
self.assertEqual(run.country, "Not available")
self.assertEqual(run.country_alpha_2, "None")
self.assertEqual(run.country_alpha_3, "None")
self.assertEqual(run.continent_alpha_2, "None")
self.assertEqual(run.continent, "None")
def test_dates_parsing(self):
ena_accessor = FakeEnaAccessor(results=[
{"run_accession": "ERR4080483",
"scientific_name": "Severe acute respiratory syndrome coronavirus 2",
"instrument_platform": "ILLUMINA",
"library_strategy": "WGS",
"fastq_ftp": "ftp.sra.ebi.ac.uk/vol1/fastq/ERR408/003/ERR4080483/ERR4080483_1.fastq.gz",
"fastq_md5": "a91a9dfa2f7008e13a7ce9767aa9aaf3",
"host_tax_id": "9606",
"first_created": "2020-01-01",
"collection_date": "2019-12-31",
},
{"run_accession": "ERR4080484",
"scientific_name": "Severe acute respiratory syndrome coronavirus 2",
"instrument_platform": "ILLUMINA",
"library_strategy": "WGS",
"fastq_ftp": "ftp.sra.ebi.ac.uk/vol1/fastq/ERR408/003/ERR4080483/ERR4080483_1.fastq.gz",
"fastq_md5": "c57fef34933cbbec2e9e08867f3c664c",
"host_tax_id": "9606",
"first_created": "2020-01-01 14:50",
"collection_date": "2019-12-31 12:12:12"},
{"run_accession": "ERR4080485",
"scientific_name": "Severe acute respiratory syndrome coronavirus 2",
"instrument_platform": "ILLUMINA",
"library_strategy": "WGS",
"fastq_ftp": "ftp.sra.ebi.ac.uk/vol1/fastq/ERR408/005/ERR4080485/ERR4080485_1.fastq.gz",
"fastq_md5": "4de269d2b5831e1c5175586af694d21e",
"host_tax_id": "9606",
"first_created": "blah",
"collection_date": "blah"}
], database=self.database)
ena_accessor.access()
self.assertEqual(ena_accessor.included, 3)
self.assertEqual(ena_accessor.excluded, 0)
session = self.database.get_database_session()
run = session.query(SampleEna).filter(SampleEna.run_accession == "ERR4080483").first()
self.assertEqual(run.collection_date, date.fromisoformat("2019-12-31"))
self.assertEqual(run.first_created, date.fromisoformat("2020-01-01"))
run = session.query(SampleEna).filter(SampleEna.run_accession == "ERR4080484").first()
self.assertIsNone(run.collection_date)
self.assertIsNone(run.first_created)
run = session.query(SampleEna).filter(SampleEna.run_accession == "ERR4080485").first()
self.assertIsNone(run.collection_date)
self.assertIsNone(run.first_created)
def test_numeric_values(self):
ena_accessor = FakeEnaAccessor(results=[
{"run_accession": "ERR4080483",
"scientific_name": "Severe acute respiratory syndrome coronavirus 2",
"instrument_platform": "ILLUMINA",
"library_strategy": "WGS",
"fastq_ftp": "ftp.sra.ebi.ac.uk/vol1/fastq/ERR408/003/ERR4080483/ERR4080483_1.fastq.gz",
"fastq_md5": "a91a9dfa2f7008e13a7ce9767aa9aaf3",
"host_tax_id": "9606",
"lat": "",
"lon": "",
"read_count": "",
"base_count": "",
"nominal_length": "",
},
{"run_accession": "ERR4080484",
"scientific_name": "Severe acute respiratory syndrome coronavirus 2",
"instrument_platform": "ILLUMINA",
"library_strategy": "WGS",
"fastq_ftp": "ftp.sra.ebi.ac.uk/vol1/fastq/ERR408/003/ERR4080483/ERR4080483_1.fastq.gz",
"fastq_md5": "c57fef34933cbbec2e9e08867f3c664c",
"host_tax_id": "9606",
"lat": "hey",
"lon": "hey",
"read_count": "hey",
"base_count": "hey",
"nominal_length": "hey"},
{"run_accession": "ERR4080485",
"scientific_name": "Severe acute respiratory syndrome coronavirus 2",
"instrument_platform": "ILLUMINA",
"library_strategy": "WGS",
"fastq_ftp": "ftp.sra.ebi.ac.uk/vol1/fastq/ERR408/005/ERR4080485/ERR4080485_1.fastq.gz",
"fastq_md5": "4de269d2b5831e1c5175586af694d21e",
"host_tax_id": "9606",
"lat": "1.1",
"lon": "1.1",
"read_count": "1",
"base_count": "1",
"nominal_length": "1"
}
], database=self.database)
ena_accessor.access()
self.assertEqual(ena_accessor.included, 3)
self.assertEqual(ena_accessor.excluded, 0)
session = self.database.get_database_session()
run = session.query(SampleEna).filter(SampleEna.run_accession == "ERR4080483").first()
self.assertIsNone(run.lat)
self.assertIsNone(run.lon)
self.assertIsNone(run.nominal_length)
self.assertIsNone(run.read_count)
self.assertIsNone(run.base_count)
run = session.query(SampleEna).filter(SampleEna.run_accession == "ERR4080484").first()
self.assertIsNone(run.lat)
self.assertIsNone(run.lon)
self.assertIsNone(run.nominal_length)
self.assertIsNone(run.read_count)
self.assertIsNone(run.base_count)
run = session.query(SampleEna).filter(SampleEna.run_accession == "ERR4080485").first()
self.assertEqual(run.lat, 1.1)
self.assertEqual(run.lon, 1.1)
self.assertEqual(run.nominal_length, 1)
self.assertEqual(run.read_count, 1)
self.assertEqual(run.base_count, 1)
def test_sample_and_job_loading(self):
ena_accessor = FakeEnaAccessor(results=[
{"run_accession": "ERR4080483",
"scientific_name": "Severe acute respiratory syndrome coronavirus 2",
"instrument_platform": "ILLUMINA",
"library_strategy": "WGS",
"fastq_ftp": "ftp.sra.ebi.ac.uk/vol1/fastq/ERR408/003/ERR4080483/ERR4080483_1.fastq.gz",
"fastq_md5": "a91a9dfa2f7008e13a7ce9767aa9aaf3",
"host_tax_id": "9606"
},
{"run_accession": "ERR4080484",
"scientific_name": "Severe acute respiratory syndrome coronavirus 2",
"instrument_platform": "ILLUMINA",
"library_strategy": "WGS",
"fastq_ftp": "ftp.sra.ebi.ac.uk/vol1/fastq/ERR408/003/ERR4080483/ERR4080483_1.fastq.gz",
"fastq_md5": "c57fef34933cbbec2e9e08867f3c664c",
"host_tax_id": "9606"
},
{"run_accession": "ERR4080485",
"scientific_name": "Severe acute respiratory syndrome coronavirus 2",
"instrument_platform": "ILLUMINA",
"library_strategy": "WGS",
"fastq_ftp": "ftp.sra.ebi.ac.uk/vol1/fastq/ERR408/005/ERR4080485/ERR4080485_1.fastq.gz",
"fastq_md5": "4de269d2b5831e1c5175586af694d21e",
"host_tax_id": "9606"
}
], database=self.database)
ena_accessor.access()
self.assertEqual(ena_accessor.included, 3)
self.assertEqual(ena_accessor.excluded, 0)
session = self.database.get_database_session()
self._assert_entities_from_accessor(session, "ERR4080483")
self._assert_entities_from_accessor(session, "ERR4080484")
self._assert_entities_from_accessor(session, "ERR4080485")
def _assert_entities_from_accessor(self, session, identifier):
self.assertEqual(session.query(SampleEna).filter(SampleEna.run_accession == identifier).count(), 1)
self.assertEqual(session.query(Sample).filter(Sample.id == identifier).count(), 1)
self.assertEqual(session.query(Sample).filter(
and_(Sample.id == identifier, Sample.ena_id == identifier)).count(), 1)
self.assertEqual(session.query(JobEna).filter(JobEna.run_accession == identifier).count(), 1)
def test_writing_logs(self):
ena_accessor = FakeEnaAccessor(results=[
{"run_accession": "ERR4080483",
"scientific_name": "Severe acute respiratory syndrome coronavirus 2",
"instrument_platform": "ILLUMINA",
"library_strategy": "WGS",
"fastq_ftp": "ftp.sra.ebi.ac.uk/vol1/fastq/ERR408/003/ERR4080483/ERR4080483_1.fastq.gz",
"fastq_md5": "a91a9dfa2f7008e13a7ce9767aa9aaf3",
"host_tax_id": "9606"
},
{"run_accession": "ERR4080484",
"scientific_name": "Severe acute respiratory syndrome coronavirus 2",
"instrument_platform": "ILLUMINA",
"library_strategy": "WGS",
"fastq_ftp": "ftp.sra.ebi.ac.uk/vol1/fastq/ERR408/003/ERR4080483/ERR4080483_1.fastq.gz",
"fastq_md5": "c57fef34933cbbec2e9e08867f3c664c",
"host_tax_id": "9606"
},
{"run_accession": "ERR4080485",
"scientific_name": "Severe acute respiratory syndrome coronavirus 2",
"instrument_platform": "ILLUMINA",
"library_strategy": "WGS",
"fastq_ftp": "ftp.sra.ebi.ac.uk/vol1/fastq/ERR408/005/ERR4080485/ERR4080485_1.fastq.gz",
"fastq_md5": "4de269d2b5831e1c5175586af694d21e",
"host_tax_id": "9606"
}
], database=self.database)
ena_accessor.access()
session = self.database.get_database_session()
self.assertEqual(session.query(Log).count(), 1)
log = session.query(Log).first()
self.assertIsNotNone(log.start)
self.assertIsNotNone(log.end)
self.assertEqual(log.source, DataSource.ENA)
self.assertEqual(log.module, CovigatorModule.ACCESSOR)
self.assertEqual(log.processed, 3)
data = log.data
self.assertEqual(data.get("included"), 3)
self.assertEqual(data.get("excluded").get("existing"), 0)
self.assertEqual(data.get("excluded").get("excluded_by_criteria"), 0)
self.assertEqual(data.get("excluded").get("missing_fastq"), 0)
self.assertIsInstance(data.get("excluded").get("platform"), dict)
self.assertIsInstance(data.get("excluded").get("library_strategy"), dict)
self.assertIsInstance(data.get("excluded").get("host"), dict)
def test_excluding_rnaseq_samples(self):
ena_accessor = FakeEnaAccessor([
{"run_accession": "ERR4080483",
"scientific_name": "Severe acute respiratory syndrome coronavirus 2",
"instrument_platform": "ILLUMINA",
"library_strategy": "RNA-Seq",
"fastq_ftp": "",
"fastq_md5": "a91a9dfa2f7008e13a7ce9767aa9aaf3",
"host_tax_id": "9606"},
{"run_accession": "ERR4080484",
"scientific_name": "Severe acute respiratory syndrome coronavirus 2",
"instrument_platform": "RNA-Seq",
"library_strategy": "WGS",
"fastq_ftp": None,
"fastq_md5": "c57fef34933cbbec2e9e08867f3c664c",
"host_tax_id": "9606"},
{"run_accession": "ERR4080485",
"scientific_name": "Severe acute respiratory syndrome coronavirus 2",
"instrument_platform": "RNA-Seq",
"library_strategy": "WGS",
"fastq_ftp": "ftp.sra.ebi.ac.uk/vol1/fastq/ERR408/005/ERR4080485/ERR4080485_1.fastq.gz",
"fastq_md5": "4de269d2b5831e1c5175586af694d21e",
"host_tax_id": "9606"}
])
ena_accessor.access()
self.assertEqual(ena_accessor.included, 0)
self.assertEqual(ena_accessor.excluded, 3)
| 51.959259
| 107
| 0.623708
| 2,831
| 28,058
| 5.959378
| 0.063229
| 0.076463
| 0.023472
| 0.062237
| 0.899532
| 0.882698
| 0.849268
| 0.834746
| 0.828759
| 0.819868
| 0
| 0.114846
| 0.247131
| 28,058
| 539
| 108
| 52.055659
| 0.683819
| 0
| 0
| 0.75534
| 0
| 0.073786
| 0.423195
| 0.145413
| 0
| 0
| 0
| 0
| 0.21165
| 1
| 0.025243
| false
| 0
| 0.009709
| 0
| 0.036893
| 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
|
5d27770f1081eae0db348ccca80ced4b953fb40d
| 176
|
py
|
Python
|
playground/packages/pkg/__init__.py
|
HackBulgaria/Programming-101-Python-2020-Spring
|
443446028df7fe78fcdd6c37dada0b5cd8ed3c93
|
[
"MIT"
] | 30
|
2020-01-22T17:22:43.000Z
|
2022-01-26T08:28:57.000Z
|
playground/packages/pkg/__init__.py
|
HackBulgaria/Programming-101-Python-2020-Spring
|
443446028df7fe78fcdd6c37dada0b5cd8ed3c93
|
[
"MIT"
] | 1
|
2020-01-21T19:50:47.000Z
|
2020-03-18T16:18:31.000Z
|
playground/packages/pkg/__init__.py
|
HackBulgaria/Programming-101-Python-2020-Spring
|
443446028df7fe78fcdd6c37dada0b5cd8ed3c93
|
[
"MIT"
] | 7
|
2019-11-28T15:59:16.000Z
|
2020-12-05T08:39:02.000Z
|
print('In pkg init...')
import pkg.foo1
print('foo1: ', foo1)
from . import foo1
print('foo1: ', foo1)
from pkg import foo1
print('foo1: ', foo1)
# from pkg import foo3
| 11
| 23
| 0.647727
| 27
| 176
| 4.222222
| 0.296296
| 0.236842
| 0.342105
| 0.447368
| 0.763158
| 0.578947
| 0.578947
| 0.578947
| 0
| 0
| 0
| 0.070423
| 0.193182
| 176
| 15
| 24
| 11.733333
| 0.732394
| 0.113636
| 0
| 0.428571
| 0
| 0
| 0.207792
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.428571
| 0
| 0.428571
| 0.571429
| 1
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 1
|
0
| 7
|
5d416a6e3e406b8a73e60c64474bd5b2ecbddb28
| 55,599
|
py
|
Python
|
core/arxiv/submission/tests/examples/test_07_cross_list_requested.py
|
NeolithEra/arxiv-submission-core
|
d4f20be62a882d2d5f3d1584eda69e7d90ca2c12
|
[
"MIT"
] | 14
|
2019-05-26T22:52:17.000Z
|
2021-11-05T12:26:46.000Z
|
core/arxiv/submission/tests/examples/test_07_cross_list_requested.py
|
NeolithEra/arxiv-submission-core
|
d4f20be62a882d2d5f3d1584eda69e7d90ca2c12
|
[
"MIT"
] | 30
|
2018-01-31T19:16:08.000Z
|
2018-12-08T08:41:04.000Z
|
core/arxiv/submission/tests/examples/test_07_cross_list_requested.py
|
NeolithEra/arxiv-submission-core
|
d4f20be62a882d2d5f3d1584eda69e7d90ca2c12
|
[
"MIT"
] | 8
|
2019-01-10T22:01:39.000Z
|
2021-11-20T21:44:51.000Z
|
"""Example 7: cross-list request."""
from unittest import TestCase, mock
import tempfile
from datetime import datetime
from pytz import UTC
from flask import Flask
from ...services import classic
from ... import save, load, load_fast, domain, exceptions, core
CCO = 'http://creativecommons.org/publicdomain/zero/1.0/'
TEX = domain.submission.SubmissionContent.Format('tex')
class TestCrossListRequested(TestCase):
"""Submitter has requested that a cross-list classification be added."""
@classmethod
def setUpClass(cls):
"""Instantiate an app for use with a SQLite database."""
_, db = tempfile.mkstemp(suffix='.sqlite')
cls.app = Flask('foo')
cls.app.config['CLASSIC_DATABASE_URI'] = f'sqlite:///{db}'
cls.app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
with cls.app.app_context():
classic.init_app(cls.app)
@mock.patch(f'{core.__name__}.StreamPublisher', mock.MagicMock())
def setUp(self):
"""Create, complete, and publish the submission."""
self.submitter = domain.agent.User(1234, email='j.user@somewhere.edu',
forename='Jane', surname='User',
endorsements=['cs.DL', 'cs.IR'])
self.defaults = {'creator': self.submitter}
with self.app.app_context():
classic.create_all()
self.title = "the best title"
self.doi = "10.01234/56789"
self.category = "cs.DL"
self.submission, self.events = save(
domain.event.CreateSubmission(**self.defaults),
domain.event.ConfirmContactInformation(**self.defaults),
domain.event.ConfirmAuthorship(**self.defaults),
domain.event.ConfirmPolicy(**self.defaults),
domain.event.SetTitle(title=self.title, **self.defaults),
domain.event.SetLicense(license_uri=CCO,
license_name="CC0 1.0",
**self.defaults),
domain.event.SetPrimaryClassification(category=self.category,
**self.defaults),
domain.event.SetUploadPackage(checksum="a9s9k342900ks03330029",
source_format=TEX,
identifier=123,
uncompressed_size=593992,
compressed_size=593992,
**self.defaults),
domain.event.SetAbstract(abstract="Very abstract " * 20,
**self.defaults),
domain.event.SetComments(comments="Fine indeed " * 10,
**self.defaults),
domain.event.SetJournalReference(journal_ref="Foo 1992",
**self.defaults),
domain.event.SetDOI(doi=self.doi, **self.defaults),
domain.event.SetAuthors(authors_display='Robert Paulson (FC)',
**self.defaults),
domain.event.FinalizeSubmission(**self.defaults)
)
# Announce the submission.
self.paper_id = '1901.00123'
with self.app.app_context():
session = classic.current_session()
db_row = session.query(classic.models.Submission).first()
db_row.status = classic.models.Submission.ANNOUNCED
dated = (datetime.now() - datetime.utcfromtimestamp(0))
db_row.document = classic.models.Document(
document_id=1,
paper_id=self.paper_id,
title=self.submission.metadata.title,
authors=self.submission.metadata.authors_display,
dated=dated.total_seconds(),
primary_subject_class=self.category,
created=datetime.now(UTC),
submitter_email=self.submission.creator.email,
submitter_id=self.submission.creator.native_id
)
db_row.doc_paper_id = self.paper_id
session.add(db_row)
session.commit()
# Request cross-list classification
self.category = "cs.IR"
with self.app.app_context():
self.submission, self.events = save(
domain.event.RequestCrossList(categories=[self.category],
**self.defaults),
submission_id=self.submission.submission_id
)
def tearDown(self):
"""Clear the database after each test."""
with self.app.app_context():
classic.drop_all()
@mock.patch(f'{core.__name__}.StreamPublisher', mock.MagicMock())
def test_has_pending_requests(self):
"""The submission has an outstanding publication."""
with self.app.app_context():
submission, events = load(self.submission.submission_id)
self.assertEqual(submission.status,
domain.submission.Submission.ANNOUNCED,
"The submission is announced.")
self.assertTrue(submission.has_active_requests,
"The submission has an active request.")
self.assertEqual(len(submission.pending_user_requests), 1,
"There is one pending user request.")
self.assertIsInstance(
submission.pending_user_requests[0],
domain.submission.CrossListClassificationRequest
)
self.assertIn(self.category,
submission.pending_user_requests[0].categories,
"Requested category is set on request.")
self.assertEqual(len(submission.versions), 1,
"There is one announced versions")
with self.app.app_context():
submission = load_fast(self.submission.submission_id)
self.assertEqual(submission.status,
domain.submission.Submission.ANNOUNCED,
"The submission is announced.")
self.assertTrue(submission.has_active_requests,
"The submission has an active request.")
self.assertEqual(len(submission.pending_user_requests), 1,
"There is one pending user request.")
self.assertIsInstance(
submission.pending_user_requests[0],
domain.submission.CrossListClassificationRequest
)
self.assertIn(self.category,
submission.pending_user_requests[0].categories,
"Requested category is set on request.")
self.assertEqual(len(submission.versions), 1,
"There is one announced versions")
# Check the database state.
with self.app.app_context():
session = classic.current_session()
db_rows = session.query(classic.models.Submission) \
.order_by(classic.models.Submission.submission_id.asc()) \
.all()
self.assertEqual(len(db_rows), 2,
"There are two rows in the submission table")
self.assertEqual(db_rows[0].type,
classic.models.Submission.NEW_SUBMISSION,
"The first row has type 'new'")
self.assertEqual(db_rows[0].status,
classic.models.Submission.ANNOUNCED,
"The first row is announced")
self.assertEqual(db_rows[1].type,
classic.models.Submission.CROSS_LIST,
"The second row has type 'cross'")
self.assertEqual(db_rows[1].status,
classic.models.Submission.PROCESSING_SUBMISSION,
"The second row is in the processing submission"
" state.")
@mock.patch(f'{core.__name__}.StreamPublisher', mock.MagicMock())
def test_cannot_replace_submission(self):
"""The submission cannot be replaced."""
with self.app.app_context():
with self.assertRaises(exceptions.InvalidEvent):
save(domain.event.CreateSubmissionVersion(**self.defaults),
submission_id=self.submission.submission_id)
@mock.patch(f'{core.__name__}.StreamPublisher', mock.MagicMock())
def test_cannot_withdraw_submission(self):
"""The submitter cannot request withdrawal."""
withdrawal_reason = "the best reason"
with self.app.app_context():
with self.assertRaises(exceptions.InvalidEvent):
save(domain.event.RequestWithdrawal(reason=withdrawal_reason,
**self.defaults),
submission_id=self.submission.submission_id)
@mock.patch(f'{core.__name__}.StreamPublisher', mock.MagicMock())
def test_cannot_request_another_crosslist(self):
"""The submitter cannot request a second cross-list."""
# Cannot submit another cross-list request while one is pending.
with self.app.app_context():
with self.assertRaises(exceptions.InvalidEvent):
save(domain.event.RequestCrossList(categories=["q-fin.CP"],
**self.defaults),
submission_id=self.submission.submission_id)
@mock.patch(f'{core.__name__}.StreamPublisher', mock.MagicMock())
def test_request_is_rejected(self):
"""If the request is 'removed' in classic, NG request is rejected."""
with self.app.app_context():
session = classic.current_session()
db_rows = session.query(classic.models.Submission) \
.order_by(classic.models.Submission.submission_id.asc()) \
.all()
db_rows[1].status = classic.models.Submission.REMOVED
session.add(db_rows[1])
session.commit()
with self.app.app_context():
submission, events = load(self.submission.submission_id)
self.assertEqual(submission.status,
domain.submission.Submission.ANNOUNCED,
"The submission is announced.")
self.assertFalse(submission.has_active_requests,
"The submission has no active requests.")
self.assertEqual(len(submission.pending_user_requests), 0,
"There are no pending user request.")
self.assertEqual(len(submission.rejected_user_requests), 1,
"There is one rejected user request.")
self.assertIsInstance(
submission.rejected_user_requests[0],
domain.submission.CrossListClassificationRequest
)
self.assertIn(self.category,
submission.rejected_user_requests[0].categories,
"Requested category is set on request.")
self.assertNotIn(self.category, submission.secondary_categories,
"Requested category is not added to submission")
with self.app.app_context():
submission = load_fast(self.submission.submission_id)
self.assertEqual(submission.status,
domain.submission.Submission.ANNOUNCED,
"The submission is announced.")
self.assertFalse(submission.has_active_requests,
"The submission has no active requests.")
self.assertEqual(len(submission.pending_user_requests), 0,
"There are no pending user request.")
self.assertEqual(len(submission.rejected_user_requests), 1,
"There is one rejected user request.")
self.assertIsInstance(
submission.rejected_user_requests[0],
domain.submission.CrossListClassificationRequest
)
self.assertIn(self.category,
submission.rejected_user_requests[0].categories,
"Requested category is set on request.")
self.assertNotIn(self.category, submission.secondary_categories,
"Requested category is not added to submission")
@mock.patch(f'{core.__name__}.StreamPublisher', mock.MagicMock())
def test_request_is_applied(self):
"""If the request is announced in classic, NG request is 'applied'."""
with self.app.app_context():
session = classic.current_session()
db_rows = session.query(classic.models.Submission) \
.order_by(classic.models.Submission.submission_id.asc()) \
.all()
db_rows[1].status = classic.models.Submission.ANNOUNCED
session.add(db_rows[1])
session.commit()
with self.app.app_context():
submission, events = load(self.submission.submission_id)
self.assertEqual(submission.status,
domain.submission.Submission.ANNOUNCED,
"The submission is announced.")
self.assertFalse(submission.has_active_requests,
"The submission has no active requests.")
self.assertEqual(len(submission.pending_user_requests), 0,
"There are no pending user request.")
self.assertEqual(len(submission.applied_user_requests), 1,
"There is one applied user request.")
self.assertIsInstance(
submission.applied_user_requests[0],
domain.submission.CrossListClassificationRequest
)
self.assertIn(self.category,
submission.applied_user_requests[0].categories,
"Requested category is set on request.")
self.assertIn(self.category, submission.secondary_categories,
"Requested category is added to submission")
with self.app.app_context():
submission = load_fast(self.submission.submission_id)
self.assertEqual(submission.status,
domain.submission.Submission.ANNOUNCED,
"The submission is announced.")
self.assertFalse(submission.has_active_requests,
"The submission has no active requests.")
self.assertEqual(len(submission.pending_user_requests), 0,
"There are no pending user request.")
self.assertEqual(len(submission.applied_user_requests), 1,
"There is one applied user request.")
self.assertIsInstance(
submission.applied_user_requests[0],
domain.submission.CrossListClassificationRequest
)
self.assertIn(self.category,
submission.applied_user_requests[0].categories,
"Requested category is set on request.")
self.assertIn(self.category, submission.secondary_categories,
"Requested category is added to submission")
class TestCrossListApplied(TestCase):
"""Request for cross-list has been approved and applied."""
@classmethod
def setUpClass(cls):
"""Instantiate an app for use with a SQLite database."""
_, db = tempfile.mkstemp(suffix='.sqlite')
cls.app = Flask('foo')
cls.app.config['CLASSIC_DATABASE_URI'] = f'sqlite:///{db}'
cls.app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
with cls.app.app_context():
classic.init_app(cls.app)
@mock.patch(f'{core.__name__}.StreamPublisher', mock.MagicMock())
def setUp(self):
"""Create, complete, and publish the submission."""
self.submitter = domain.agent.User(1234, email='j.user@somewhere.edu',
forename='Jane', surname='User',
endorsements=['cs.DL', 'cs.IR'])
self.defaults = {'creator': self.submitter}
with self.app.app_context():
classic.create_all()
self.title = "the best title"
self.doi = "10.01234/56789"
self.category = "cs.DL"
self.submission, self.events = save(
domain.event.CreateSubmission(**self.defaults),
domain.event.ConfirmContactInformation(**self.defaults),
domain.event.ConfirmAuthorship(**self.defaults),
domain.event.ConfirmPolicy(**self.defaults),
domain.event.SetTitle(title=self.title, **self.defaults),
domain.event.SetLicense(license_uri=CCO,
license_name="CC0 1.0",
**self.defaults),
domain.event.SetPrimaryClassification(category=self.category,
**self.defaults),
domain.event.SetUploadPackage(checksum="a9s9k342900ks03330029",
source_format=TEX, identifier=123,
uncompressed_size=593992,
compressed_size=593992,
**self.defaults),
domain.event.SetAbstract(abstract="Very abstract " * 20,
**self.defaults),
domain.event.SetComments(comments="Fine indeed " * 10,
**self.defaults),
domain.event.SetJournalReference(journal_ref="Foo 1992",
**self.defaults),
domain.event.SetDOI(doi=self.doi, **self.defaults),
domain.event.SetAuthors(authors_display='Robert Paulson (FC)',
**self.defaults),
domain.event.FinalizeSubmission(**self.defaults)
)
# Announce the submission.
self.paper_id = '1901.00123'
with self.app.app_context():
session = classic.current_session()
db_row = session.query(classic.models.Submission).first()
db_row.status = classic.models.Submission.ANNOUNCED
dated = (datetime.now() - datetime.utcfromtimestamp(0))
db_row.document = classic.models.Document(
document_id=1,
paper_id=self.paper_id,
title=self.submission.metadata.title,
authors=self.submission.metadata.authors_display,
dated=dated.total_seconds(),
primary_subject_class=self.category,
created=datetime.now(UTC),
submitter_email=self.submission.creator.email,
submitter_id=self.submission.creator.native_id
)
db_row.doc_paper_id = self.paper_id
session.add(db_row)
session.commit()
# Request cross-list classification
self.category = "cs.IR"
with self.app.app_context():
self.submission, self.events = save(
domain.event.RequestCrossList(categories=[self.category],
**self.defaults),
submission_id=self.submission.submission_id
)
# Apply.
with self.app.app_context():
session = classic.current_session()
db_rows = session.query(classic.models.Submission) \
.order_by(classic.models.Submission.submission_id.asc()) \
.all()
db_rows[1].status = classic.models.Submission.ANNOUNCED
session.add(db_rows[1])
session.commit()
def tearDown(self):
"""Clear the database after each test."""
with self.app.app_context():
classic.drop_all()
@mock.patch(f'{core.__name__}.StreamPublisher', mock.MagicMock())
def test_has_applied_requests(self):
"""The submission has an applied request."""
with self.app.app_context():
submission, events = load(self.submission.submission_id)
self.assertEqual(submission.status,
domain.submission.Submission.ANNOUNCED,
"The submission is announced.")
self.assertFalse(submission.has_active_requests,
"The submission has no active requests.")
self.assertEqual(len(submission.applied_user_requests), 1,
"There is one pending user request.")
self.assertIsInstance(
submission.applied_user_requests[0],
domain.submission.CrossListClassificationRequest
)
self.assertIn(self.category,
submission.applied_user_requests[0].categories,
"Requested category is set on request.")
self.assertEqual(len(submission.versions), 1,
"There is one announced versions")
with self.app.app_context():
submission = load_fast(self.submission.submission_id)
self.assertEqual(submission.status,
domain.submission.Submission.ANNOUNCED,
"The submission is announced.")
self.assertFalse(submission.has_active_requests,
"The submission has no active requests.")
self.assertEqual(len(submission.applied_user_requests), 1,
"There is one pending user request.")
self.assertIsInstance(
submission.applied_user_requests[0],
domain.submission.CrossListClassificationRequest
)
self.assertIn(self.category,
submission.applied_user_requests[0].categories,
"Requested category is set on request.")
self.assertEqual(len(submission.versions), 1,
"There is one announced versions")
# Check the database state.
with self.app.app_context():
session = classic.current_session()
db_rows = session.query(classic.models.Submission) \
.order_by(classic.models.Submission.submission_id.asc()) \
.all()
self.assertEqual(len(db_rows), 2,
"There are two rows in the submission table")
self.assertEqual(db_rows[0].type,
classic.models.Submission.NEW_SUBMISSION,
"The first row has type 'new'")
self.assertEqual(db_rows[0].status,
classic.models.Submission.ANNOUNCED,
"The first row is announced")
self.assertEqual(db_rows[1].type,
classic.models.Submission.CROSS_LIST,
"The second row has type 'cross'")
self.assertEqual(db_rows[1].status,
classic.models.Submission.ANNOUNCED,
"The second row is in the processing submission"
" state.")
@mock.patch(f'{core.__name__}.StreamPublisher', mock.MagicMock())
def test_can_replace_submission(self):
"""The submission can be replaced, resulting in a new version."""
with self.app.app_context():
submission, events = save(
domain.event.CreateSubmissionVersion(**self.defaults),
submission_id=self.submission.submission_id
)
# Check the submission state.
with self.app.app_context():
submission, events = load(self.submission.submission_id)
self.assertEqual(submission.status,
domain.submission.Submission.WORKING,
"The submission is in the working state")
self.assertEqual(submission.version, 2,
"The version number is incremented by 1")
self.assertEqual(len(submission.versions), 1,
"There is one announced versions")
with self.app.app_context():
submission = load_fast(self.submission.submission_id)
self.assertEqual(submission.status,
domain.submission.Submission.WORKING,
"The submission is in the working state")
self.assertEqual(submission.version, 2,
"The version number is incremented by 1")
self.assertEqual(len(submission.versions), 1,
"There is one announced versions")
# Check the database state.
with self.app.app_context():
session = classic.current_session()
db_rows = session.query(classic.models.Submission) \
.order_by(classic.models.Submission.submission_id.asc()) \
.all()
self.assertEqual(len(db_rows), 3,
"There are three rows in the submission table")
self.assertEqual(db_rows[0].type,
classic.models.Submission.NEW_SUBMISSION,
"The first row has type 'new'")
self.assertEqual(db_rows[0].status,
classic.models.Submission.ANNOUNCED,
"The first row is announced")
self.assertEqual(db_rows[1].type,
classic.models.Submission.CROSS_LIST,
"The second row has type 'cross'")
self.assertEqual(db_rows[1].status,
classic.models.Submission.ANNOUNCED,
"The second row is in the announced state")
self.assertEqual(db_rows[2].type,
classic.models.Submission.REPLACEMENT,
"The third row has type 'replacement'")
self.assertEqual(db_rows[2].status,
classic.models.Submission.NOT_SUBMITTED,
"The third row is in not submitted state")
@mock.patch(f'{core.__name__}.StreamPublisher', mock.MagicMock())
def test_can_withdraw_submission(self):
"""The submitter can request withdrawal of the submission."""
withdrawal_reason = "the best reason"
with self.app.app_context():
submission, events = save(
domain.event.RequestWithdrawal(reason=withdrawal_reason,
**self.defaults),
submission_id=self.submission.submission_id
)
# Check the submission state.
with self.app.app_context():
submission, events = load(self.submission.submission_id)
self.assertEqual(submission.status,
domain.submission.Submission.ANNOUNCED,
"The submission is announced.")
self.assertTrue(submission.has_active_requests,
"The submission has an active request.")
self.assertEqual(len(submission.pending_user_requests), 1,
"There is one pending user request.")
self.assertIsInstance(submission.pending_user_requests[0],
domain.submission.WithdrawalRequest)
self.assertEqual(
submission.pending_user_requests[0].reason_for_withdrawal,
withdrawal_reason,
"Withdrawal reason is set on request."
)
self.assertEqual(len(submission.versions), 1,
"There is one announced versions")
with self.app.app_context():
submission = load_fast(self.submission.submission_id)
self.assertEqual(submission.status,
domain.submission.Submission.ANNOUNCED,
"The submission is announced.")
self.assertTrue(submission.has_active_requests,
"The submission has an active request.")
self.assertEqual(len(submission.pending_user_requests), 1,
"There is one pending user request.")
self.assertIsInstance(submission.pending_user_requests[0],
domain.submission.WithdrawalRequest)
self.assertEqual(
submission.pending_user_requests[0].reason_for_withdrawal,
withdrawal_reason,
"Withdrawal reason is set on request."
)
self.assertEqual(len(submission.versions), 1,
"There is one announced versions")
# Check the database state.
with self.app.app_context():
session = classic.current_session()
db_rows = session.query(classic.models.Submission) \
.order_by(classic.models.Submission.submission_id.asc()) \
.all()
self.assertEqual(len(db_rows), 3,
"There are three rows in the submission table")
self.assertEqual(db_rows[0].type,
classic.models.Submission.NEW_SUBMISSION,
"The first row has type 'new'")
self.assertEqual(db_rows[0].status,
classic.models.Submission.ANNOUNCED,
"The first row is announced")
self.assertEqual(db_rows[1].type,
classic.models.Submission.CROSS_LIST,
"The second row has type 'cross'")
self.assertEqual(db_rows[1].status,
classic.models.Submission.ANNOUNCED,
"The second row is in the announced state")
self.assertEqual(db_rows[2].type,
classic.models.Submission.WITHDRAWAL,
"The third row has type 'withdrawal'")
self.assertEqual(db_rows[2].status,
classic.models.Submission.PROCESSING_SUBMISSION,
"The third row is in the processing submission"
" state.")
# Cannot submit another withdrawal request while one is pending.
with self.app.app_context():
with self.assertRaises(exceptions.InvalidEvent):
save(domain.event.RequestWithdrawal(reason="more reason",
**self.defaults),
submission_id=self.submission.submission_id)
@mock.patch(f'{core.__name__}.StreamPublisher', mock.MagicMock())
def test_can_request_crosslist(self):
"""The submitter can request cross-list classification."""
category = "cs.LO"
with self.app.app_context():
submission, events = save(
domain.event.RequestCrossList(categories=[category],
**self.defaults),
submission_id=self.submission.submission_id
)
# Check the submission state.
with self.app.app_context():
submission, events = load(self.submission.submission_id)
self.assertEqual(submission.status,
domain.submission.Submission.ANNOUNCED,
"The submission is announced.")
self.assertTrue(submission.has_active_requests,
"The submission has an active request.")
self.assertEqual(len(submission.pending_user_requests), 1,
"There is one pending user request.")
self.assertIsInstance(
submission.pending_user_requests[0],
domain.submission.CrossListClassificationRequest
)
self.assertIn(category,
submission.pending_user_requests[0].categories,
"Requested category is set on request.")
self.assertEqual(len(submission.versions), 1,
"There is one announced versions")
with self.app.app_context():
submission = load_fast(self.submission.submission_id)
self.assertEqual(submission.status,
domain.submission.Submission.ANNOUNCED,
"The submission is announced.")
self.assertTrue(submission.has_active_requests,
"The submission has an active request.")
self.assertEqual(len(submission.pending_user_requests), 1,
"There is one pending user request.")
self.assertIsInstance(
submission.pending_user_requests[0],
domain.submission.CrossListClassificationRequest
)
self.assertIn(category,
submission.pending_user_requests[0].categories,
"Requested category is set on request.")
self.assertEqual(len(submission.versions), 1,
"There is one announced versions")
# Check the database state.
with self.app.app_context():
session = classic.current_session()
db_rows = session.query(classic.models.Submission) \
.order_by(classic.models.Submission.submission_id.asc()) \
.all()
self.assertEqual(len(db_rows), 3,
"There are three rows in the submission table")
self.assertEqual(db_rows[0].type,
classic.models.Submission.NEW_SUBMISSION,
"The first row has type 'new'")
self.assertEqual(db_rows[0].status,
classic.models.Submission.ANNOUNCED,
"The first row is announced")
self.assertEqual(db_rows[1].type,
classic.models.Submission.CROSS_LIST,
"The second row has type 'cross'")
self.assertEqual(db_rows[1].status,
classic.models.Submission.ANNOUNCED,
"The second row is in the announced state")
self.assertEqual(db_rows[2].type,
classic.models.Submission.CROSS_LIST,
"The third row has type 'cross'")
self.assertEqual(db_rows[2].status,
classic.models.Submission.PROCESSING_SUBMISSION,
"The third row is in the processing submission"
" state.")
class TestCrossListRejected(TestCase):
"""Request for cross-list has been rejected."""
@classmethod
def setUpClass(cls):
"""Instantiate an app for use with a SQLite database."""
_, db = tempfile.mkstemp(suffix='.sqlite')
cls.app = Flask('foo')
cls.app.config['CLASSIC_DATABASE_URI'] = f'sqlite:///{db}'
cls.app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
with cls.app.app_context():
classic.init_app(cls.app)
@mock.patch(f'{core.__name__}.StreamPublisher', mock.MagicMock())
def setUp(self):
"""Create, complete, and publish the submission."""
self.submitter = domain.agent.User(1234, email='j.user@somewhere.edu',
forename='Jane', surname='User',
endorsements=['cs.DL', 'cs.IR'])
self.defaults = {'creator': self.submitter}
with self.app.app_context():
classic.create_all()
self.title = "the best title"
self.doi = "10.01234/56789"
self.category = "cs.DL"
self.submission, self.events = save(
domain.event.CreateSubmission(**self.defaults),
domain.event.ConfirmContactInformation(**self.defaults),
domain.event.ConfirmAuthorship(**self.defaults),
domain.event.ConfirmPolicy(**self.defaults),
domain.event.SetTitle(title=self.title, **self.defaults),
domain.event.SetLicense(license_uri=CCO,
license_name="CC0 1.0",
**self.defaults),
domain.event.SetPrimaryClassification(category=self.category,
**self.defaults),
domain.event.SetUploadPackage(checksum="a9s9k342900ks03330029",
source_format=TEX,
identifier=123,
uncompressed_size=593992,
compressed_size=593992,
**self.defaults),
domain.event.SetAbstract(abstract="Very abstract " * 20,
**self.defaults),
domain.event.SetComments(comments="Fine indeed " * 10,
**self.defaults),
domain.event.SetJournalReference(journal_ref="Foo 1992",
**self.defaults),
domain.event.SetDOI(doi=self.doi, **self.defaults),
domain.event.SetAuthors(authors_display='Robert Paulson (FC)',
**self.defaults),
domain.event.FinalizeSubmission(**self.defaults)
)
# Announce the submission.
self.paper_id = '1901.00123'
with self.app.app_context():
session = classic.current_session()
db_row = session.query(classic.models.Submission).first()
db_row.status = classic.models.Submission.ANNOUNCED
dated = (datetime.now() - datetime.utcfromtimestamp(0))
db_row.document = classic.models.Document(
document_id=1,
paper_id=self.paper_id,
title=self.submission.metadata.title,
authors=self.submission.metadata.authors_display,
dated=dated.total_seconds(),
primary_subject_class=self.category,
created=datetime.now(UTC),
submitter_email=self.submission.creator.email,
submitter_id=self.submission.creator.native_id
)
db_row.doc_paper_id = self.paper_id
session.add(db_row)
session.commit()
# Request cross-list classification
self.category = "cs.IR"
with self.app.app_context():
self.submission, self.events = save(
domain.event.RequestCrossList(categories=[self.category],
**self.defaults),
submission_id=self.submission.submission_id
)
# Apply.
with self.app.app_context():
session = classic.current_session()
db_rows = session.query(classic.models.Submission) \
.order_by(classic.models.Submission.submission_id.asc()) \
.all()
db_rows[1].status = classic.models.Submission.REMOVED
session.add(db_rows[1])
session.commit()
def tearDown(self):
"""Clear the database after each test."""
with self.app.app_context():
classic.drop_all()
@mock.patch(f'{core.__name__}.StreamPublisher', mock.MagicMock())
def test_has_rejected_request(self):
"""The submission has a rejected request."""
with self.app.app_context():
submission, events = load(self.submission.submission_id)
self.assertEqual(submission.status,
domain.submission.Submission.ANNOUNCED,
"The submission is announced.")
self.assertFalse(submission.has_active_requests,
"The submission has no active requests.")
self.assertEqual(len(submission.pending_user_requests), 0,
"There is are no pending user requests.")
self.assertEqual(len(submission.rejected_user_requests), 1,
"There is one rejected user request.")
self.assertIsInstance(
submission.rejected_user_requests[0],
domain.submission.CrossListClassificationRequest
)
self.assertIn(self.category,
submission.rejected_user_requests[0].categories,
"Requested category is set on request.")
self.assertEqual(len(submission.versions), 1,
"There is one announced versions")
with self.app.app_context():
submission = load_fast(self.submission.submission_id)
self.assertEqual(submission.status,
domain.submission.Submission.ANNOUNCED,
"The submission is announced.")
self.assertFalse(submission.has_active_requests,
"The submission has no active requests.")
self.assertEqual(len(submission.pending_user_requests), 0,
"There is are no pending user requests.")
self.assertEqual(len(submission.rejected_user_requests), 1,
"There is one rejected user request.")
self.assertIsInstance(
submission.rejected_user_requests[0],
domain.submission.CrossListClassificationRequest
)
self.assertIn(self.category,
submission.rejected_user_requests[0].categories,
"Requested category is set on request.")
self.assertEqual(len(submission.versions), 1,
"There is one announced versions")
# Check the database state.
with self.app.app_context():
session = classic.current_session()
db_rows = session.query(classic.models.Submission) \
.order_by(classic.models.Submission.submission_id.asc()) \
.all()
self.assertEqual(len(db_rows), 2,
"There are two rows in the submission table")
self.assertEqual(db_rows[0].type,
classic.models.Submission.NEW_SUBMISSION,
"The first row has type 'new'")
self.assertEqual(db_rows[0].status,
classic.models.Submission.ANNOUNCED,
"The first row is announced")
self.assertEqual(db_rows[1].type,
classic.models.Submission.CROSS_LIST,
"The second row has type 'cross'")
self.assertEqual(db_rows[1].status,
classic.models.Submission.REMOVED,
"The second row is in the removed state.")
@mock.patch(f'{core.__name__}.StreamPublisher', mock.MagicMock())
def test_can_replace_submission(self):
"""The submission can be replaced, resulting in a new version."""
with self.app.app_context():
submission, events = save(
domain.event.CreateSubmissionVersion(**self.defaults),
submission_id=self.submission.submission_id
)
# Check the submission state.
with self.app.app_context():
submission, events = load(self.submission.submission_id)
self.assertEqual(submission.status,
domain.submission.Submission.WORKING,
"The submission is in the working state")
self.assertEqual(submission.version, 2,
"The version number is incremented by 1")
self.assertEqual(len(submission.versions), 1,
"There is one announced versions")
with self.app.app_context():
submission = load_fast(self.submission.submission_id)
self.assertEqual(submission.status,
domain.submission.Submission.WORKING,
"The submission is in the working state")
self.assertEqual(submission.version, 2,
"The version number is incremented by 1")
self.assertEqual(len(submission.versions), 1,
"There is one announced versions")
# Check the database state.
with self.app.app_context():
session = classic.current_session()
db_rows = session.query(classic.models.Submission) \
.order_by(classic.models.Submission.submission_id.asc()) \
.all()
self.assertEqual(len(db_rows), 3,
"There are three rows in the submission table")
self.assertEqual(db_rows[0].type,
classic.models.Submission.NEW_SUBMISSION,
"The first row has type 'new'")
self.assertEqual(db_rows[0].status,
classic.models.Submission.ANNOUNCED,
"The first row is announced")
self.assertEqual(db_rows[1].type,
classic.models.Submission.CROSS_LIST,
"The second row has type 'cross'")
self.assertEqual(db_rows[1].status,
classic.models.Submission.REMOVED,
"The second row is in the removed state")
self.assertEqual(db_rows[2].type,
classic.models.Submission.REPLACEMENT,
"The third row has type 'replacement'")
self.assertEqual(db_rows[2].status,
classic.models.Submission.NOT_SUBMITTED,
"The third row is in not submitted state")
@mock.patch(f'{core.__name__}.StreamPublisher', mock.MagicMock())
def test_can_withdraw_submission(self):
"""The submitter can request withdrawal of the submission."""
withdrawal_reason = "the best reason"
with self.app.app_context():
submission, events = save(
domain.event.RequestWithdrawal(reason=withdrawal_reason,
**self.defaults),
submission_id=self.submission.submission_id
)
# Check the submission state.
with self.app.app_context():
submission, events = load(self.submission.submission_id)
self.assertEqual(submission.status,
domain.submission.Submission.ANNOUNCED,
"The submission is announced.")
self.assertTrue(submission.has_active_requests,
"The submission has an active request.")
self.assertEqual(len(submission.pending_user_requests), 1,
"There is one pending user request.")
self.assertIsInstance(submission.pending_user_requests[0],
domain.submission.WithdrawalRequest)
self.assertEqual(
submission.pending_user_requests[0].reason_for_withdrawal,
withdrawal_reason,
"Withdrawal reason is set on request."
)
self.assertEqual(len(submission.versions), 1,
"There is one announced versions")
with self.app.app_context():
submission = load_fast(self.submission.submission_id)
self.assertEqual(submission.status,
domain.submission.Submission.ANNOUNCED,
"The submission is announced.")
self.assertTrue(submission.has_active_requests,
"The submission has an active request.")
self.assertEqual(len(submission.pending_user_requests), 1,
"There is one pending user request.")
self.assertIsInstance(submission.pending_user_requests[0],
domain.submission.WithdrawalRequest)
self.assertEqual(
submission.pending_user_requests[0].reason_for_withdrawal,
withdrawal_reason,
"Withdrawal reason is set on request."
)
self.assertEqual(len(submission.versions), 1,
"There is one announced versions")
# Check the database state.
with self.app.app_context():
session = classic.current_session()
db_rows = session.query(classic.models.Submission) \
.order_by(classic.models.Submission.submission_id.asc()) \
.all()
self.assertEqual(len(db_rows), 3,
"There are three rows in the submission table")
self.assertEqual(db_rows[0].type,
classic.models.Submission.NEW_SUBMISSION,
"The first row has type 'new'")
self.assertEqual(db_rows[0].status,
classic.models.Submission.ANNOUNCED,
"The first row is announced")
self.assertEqual(db_rows[1].type,
classic.models.Submission.CROSS_LIST,
"The second row has type 'cross'")
self.assertEqual(db_rows[1].status,
classic.models.Submission.REMOVED,
"The second row is in the removed state")
self.assertEqual(db_rows[2].type,
classic.models.Submission.WITHDRAWAL,
"The third row has type 'withdrawal'")
self.assertEqual(db_rows[2].status,
classic.models.Submission.PROCESSING_SUBMISSION,
"The third row is in the processing submission"
" state.")
# Cannot submit another withdrawal request while one is pending.
with self.app.app_context():
with self.assertRaises(exceptions.InvalidEvent):
save(domain.event.RequestWithdrawal(reason="more reason",
**self.defaults),
submission_id=self.submission.submission_id)
@mock.patch(f'{core.__name__}.StreamPublisher', mock.MagicMock())
def test_can_request_crosslist(self):
"""The submitter can request cross-list classification."""
category = "cs.LO"
with self.app.app_context():
submission, events = save(
domain.event.RequestCrossList(categories=[category],
**self.defaults),
submission_id=self.submission.submission_id
)
# Check the submission state.
with self.app.app_context():
submission, events = load(self.submission.submission_id)
self.assertEqual(submission.status,
domain.submission.Submission.ANNOUNCED,
"The submission is announced.")
self.assertTrue(submission.has_active_requests,
"The submission has an active request.")
self.assertEqual(len(submission.pending_user_requests), 1,
"There is one pending user request.")
self.assertIsInstance(
submission.pending_user_requests[0],
domain.submission.CrossListClassificationRequest
)
self.assertIn(category,
submission.pending_user_requests[0].categories,
"Requested category is set on request.")
self.assertEqual(len(submission.versions), 1,
"There is one announced versions")
with self.app.app_context():
submission = load_fast(self.submission.submission_id)
self.assertEqual(submission.status,
domain.submission.Submission.ANNOUNCED,
"The submission is announced.")
self.assertTrue(submission.has_active_requests,
"The submission has an active request.")
self.assertEqual(len(submission.pending_user_requests), 1,
"There is one pending user request.")
self.assertIsInstance(
submission.pending_user_requests[0],
domain.submission.CrossListClassificationRequest
)
self.assertIn(category,
submission.pending_user_requests[0].categories,
"Requested category is set on request.")
self.assertEqual(len(submission.versions), 1,
"There is one announced versions")
# Check the database state.
with self.app.app_context():
session = classic.current_session()
db_rows = session.query(classic.models.Submission) \
.order_by(classic.models.Submission.submission_id.asc()) \
.all()
self.assertEqual(len(db_rows), 3,
"There are three rows in the submission table")
self.assertEqual(db_rows[0].type,
classic.models.Submission.NEW_SUBMISSION,
"The first row has type 'new'")
self.assertEqual(db_rows[0].status,
classic.models.Submission.ANNOUNCED,
"The first row is announced")
self.assertEqual(db_rows[1].type,
classic.models.Submission.CROSS_LIST,
"The second row has type 'cross'")
self.assertEqual(db_rows[1].status,
classic.models.Submission.REMOVED,
"The second row is in the removed state")
self.assertEqual(db_rows[2].type,
classic.models.Submission.CROSS_LIST,
"The third row has type 'cross'")
self.assertEqual(db_rows[2].status,
classic.models.Submission.PROCESSING_SUBMISSION,
"The third row is in the processing submission"
" state.")
| 51.149034
| 80
| 0.546431
| 5,106
| 55,599
| 5.820603
| 0.051116
| 0.065108
| 0.065007
| 0.027322
| 0.976783
| 0.96965
| 0.967631
| 0.96467
| 0.96467
| 0.96467
| 0
| 0.010246
| 0.366284
| 55,599
| 1,086
| 81
| 51.196133
| 0.833258
| 0.037645
| 0
| 0.938947
| 0
| 0
| 0.133696
| 0.012747
| 0
| 0
| 0
| 0
| 0.197895
| 1
| 0.024211
| false
| 0
| 0.007368
| 0
| 0.034737
| 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
|
5370fccc70088b365d33e05658c15cb79534ec2e
| 214
|
py
|
Python
|
Week Two/Day 2/second.py
|
Splufic-Automation-Systems-Ltd/Python-Training-Online-Cohort-Two
|
7fb6b57d3686610dcef8d3a240887ad6ad36af44
|
[
"MIT"
] | null | null | null |
Week Two/Day 2/second.py
|
Splufic-Automation-Systems-Ltd/Python-Training-Online-Cohort-Two
|
7fb6b57d3686610dcef8d3a240887ad6ad36af44
|
[
"MIT"
] | null | null | null |
Week Two/Day 2/second.py
|
Splufic-Automation-Systems-Ltd/Python-Training-Online-Cohort-Two
|
7fb6b57d3686610dcef8d3a240887ad6ad36af44
|
[
"MIT"
] | null | null | null |
""" This is my python code
Another linbe to show some documentation.
"""
print('This is my code using sublime text.')
print('This is my code using sublime text.')
print('This is my code using sublime text.')
| 19.454545
| 44
| 0.71028
| 35
| 214
| 4.342857
| 0.428571
| 0.157895
| 0.210526
| 0.256579
| 0.651316
| 0.651316
| 0.651316
| 0.651316
| 0.651316
| 0.651316
| 0
| 0
| 0.186916
| 214
| 10
| 45
| 21.4
| 0.873563
| 0.303738
| 0
| 1
| 0
| 0
| 0.76087
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 7
|
53b144300e753d2eb18d1513c3d0c753c8b98d23
| 338
|
py
|
Python
|
test/test_format.py
|
belovachap/pyvsystems_rewards
|
70786b08ef8ce8f96a91ac0983fd1e61c3db86cc
|
[
"BSD-3-Clause"
] | 3
|
2020-02-11T10:56:04.000Z
|
2020-06-03T08:10:42.000Z
|
test/test_format.py
|
belovachap/pyvsystems_rewards
|
70786b08ef8ce8f96a91ac0983fd1e61c3db86cc
|
[
"BSD-3-Clause"
] | 1
|
2020-03-17T14:12:09.000Z
|
2020-03-17T14:26:17.000Z
|
test/test_format.py
|
virtualeconomy/pyvsystems_rewards
|
cd2fd3380195933c573f55700147e30b2c0f7789
|
[
"BSD-3-Clause"
] | 2
|
2020-02-04T02:39:02.000Z
|
2020-06-03T08:10:32.000Z
|
from pyvsystems_rewards.format import format_as_vsys
def test_format_as_vsys():
assert format_as_vsys(100000000) == '1.00000000'
assert format_as_vsys(703) == '0.00000703'
assert format_as_vsys(4747) == '0.00004747'
assert format_as_vsys(123456789) == '1.23456789'
assert format_as_vsys(-123456789) == '-1.23456789'
| 33.8
| 54
| 0.736686
| 48
| 338
| 4.854167
| 0.416667
| 0.240343
| 0.360515
| 0.386266
| 0.309013
| 0.309013
| 0.309013
| 0
| 0
| 0
| 0
| 0.272414
| 0.142012
| 338
| 9
| 55
| 37.555556
| 0.531034
| 0
| 0
| 0
| 0
| 0
| 0.150888
| 0
| 0
| 0
| 0
| 0
| 0.714286
| 1
| 0.142857
| true
| 0
| 0.142857
| 0
| 0.285714
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 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
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
53ea5fbfce5508c6cc662371d62404d85bd13ae3
| 2,642
|
py
|
Python
|
alpyro_msgs/control_msgs/grippercommandaction.py
|
rho2/alpyro_msgs
|
b5a680976c40c83df70d61bb2db1de32a1cde8d3
|
[
"MIT"
] | 1
|
2020-12-13T13:07:10.000Z
|
2020-12-13T13:07:10.000Z
|
alpyro_msgs/control_msgs/grippercommandaction.py
|
rho2/alpyro_msgs
|
b5a680976c40c83df70d61bb2db1de32a1cde8d3
|
[
"MIT"
] | null | null | null |
alpyro_msgs/control_msgs/grippercommandaction.py
|
rho2/alpyro_msgs
|
b5a680976c40c83df70d61bb2db1de32a1cde8d3
|
[
"MIT"
] | null | null | null |
from typing import Final
from alpyro_msgs import RosMessage
from alpyro_msgs.control_msgs.grippercommandactionfeedback import GripperCommandActionFeedback
from alpyro_msgs.control_msgs.grippercommandactiongoal import GripperCommandActionGoal
from alpyro_msgs.control_msgs.grippercommandactionresult import GripperCommandActionResult
class GripperCommandAction(RosMessage):
__msg_typ__ = "control_msgs/GripperCommandAction"
__msg_def__ = "Y29udHJvbF9tc2dzL0dyaXBwZXJDb21tYW5kQWN0aW9uR29hbCBhY3Rpb25fZ29hbAogIHN0ZF9tc2dzL0hlYWRlciBoZWFkZXIKICAgIHVpbnQzMiBzZXEKICAgIHRpbWUgc3RhbXAKICAgIHN0cmluZyBmcmFtZV9pZAogIGFjdGlvbmxpYl9tc2dzL0dvYWxJRCBnb2FsX2lkCiAgICB0aW1lIHN0YW1wCiAgICBzdHJpbmcgaWQKICBjb250cm9sX21zZ3MvR3JpcHBlckNvbW1hbmRHb2FsIGdvYWwKICAgIGNvbnRyb2xfbXNncy9HcmlwcGVyQ29tbWFuZCBjb21tYW5kCiAgICAgIGZsb2F0NjQgcG9zaXRpb24KICAgICAgZmxvYXQ2NCBtYXhfZWZmb3J0CmNvbnRyb2xfbXNncy9HcmlwcGVyQ29tbWFuZEFjdGlvblJlc3VsdCBhY3Rpb25fcmVzdWx0CiAgc3RkX21zZ3MvSGVhZGVyIGhlYWRlcgogICAgdWludDMyIHNlcQogICAgdGltZSBzdGFtcAogICAgc3RyaW5nIGZyYW1lX2lkCiAgYWN0aW9ubGliX21zZ3MvR29hbFN0YXR1cyBzdGF0dXMKICAgIHVpbnQ4IFBFTkRJTkc9MAogICAgdWludDggQUNUSVZFPTEKICAgIHVpbnQ4IFBSRUVNUFRFRD0yCiAgICB1aW50OCBTVUNDRUVERUQ9MwogICAgdWludDggQUJPUlRFRD00CiAgICB1aW50OCBSRUpFQ1RFRD01CiAgICB1aW50OCBQUkVFTVBUSU5HPTYKICAgIHVpbnQ4IFJFQ0FMTElORz03CiAgICB1aW50OCBSRUNBTExFRD04CiAgICB1aW50OCBMT1NUPTkKICAgIGFjdGlvbmxpYl9tc2dzL0dvYWxJRCBnb2FsX2lkCiAgICAgIHRpbWUgc3RhbXAKICAgICAgc3RyaW5nIGlkCiAgICB1aW50OCBzdGF0dXMKICAgIHN0cmluZyB0ZXh0CiAgY29udHJvbF9tc2dzL0dyaXBwZXJDb21tYW5kUmVzdWx0IHJlc3VsdAogICAgZmxvYXQ2NCBwb3NpdGlvbgogICAgZmxvYXQ2NCBlZmZvcnQKICAgIGJvb2wgc3RhbGxlZAogICAgYm9vbCByZWFjaGVkX2dvYWwKY29udHJvbF9tc2dzL0dyaXBwZXJDb21tYW5kQWN0aW9uRmVlZGJhY2sgYWN0aW9uX2ZlZWRiYWNrCiAgc3RkX21zZ3MvSGVhZGVyIGhlYWRlcgogICAgdWludDMyIHNlcQogICAgdGltZSBzdGFtcAogICAgc3RyaW5nIGZyYW1lX2lkCiAgYWN0aW9ubGliX21zZ3MvR29hbFN0YXR1cyBzdGF0dXMKICAgIHVpbnQ4IFBFTkRJTkc9MAogICAgdWludDggQUNUSVZFPTEKICAgIHVpbnQ4IFBSRUVNUFRFRD0yCiAgICB1aW50OCBTVUNDRUVERUQ9MwogICAgdWludDggQUJPUlRFRD00CiAgICB1aW50OCBSRUpFQ1RFRD01CiAgICB1aW50OCBQUkVFTVBUSU5HPTYKICAgIHVpbnQ4IFJFQ0FMTElORz03CiAgICB1aW50OCBSRUNBTExFRD04CiAgICB1aW50OCBMT1NUPTkKICAgIGFjdGlvbmxpYl9tc2dzL0dvYWxJRCBnb2FsX2lkCiAgICAgIHRpbWUgc3RhbXAKICAgICAgc3RyaW5nIGlkCiAgICB1aW50OCBzdGF0dXMKICAgIHN0cmluZyB0ZXh0CiAgY29udHJvbF9tc2dzL0dyaXBwZXJDb21tYW5kRmVlZGJhY2sgZmVlZGJhY2sKICAgIGZsb2F0NjQgcG9zaXRpb24KICAgIGZsb2F0NjQgZWZmb3J0CiAgICBib29sIHN0YWxsZWQKICAgIGJvb2wgcmVhY2hlZF9nb2FsCgo="
__md5_sum__ = "950b2a6ebe831f5d4f4ceaba3d8be01e"
action_goal: GripperCommandActionGoal
action_result: GripperCommandActionResult
action_feedback: GripperCommandActionFeedback
| 165.125
| 2,030
| 0.971612
| 56
| 2,642
| 45.375
| 0.428571
| 0.015742
| 0.022039
| 0.024793
| 0.029516
| 0
| 0
| 0
| 0
| 0
| 0
| 0.105019
| 0.019682
| 2,642
| 15
| 2,031
| 176.133333
| 0.876062
| 0
| 0
| 0
| 0
| 0
| 0.786147
| 0.786147
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.416667
| 0
| 1
| 0
| 0
| 0
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 8
|
53f55122ea998ecdfe14b33909ec42b30e9a4520
| 1,567
|
py
|
Python
|
cupyx/scipy/ndimage/__init__.py
|
yoshipon/cupy
|
50bac854269742c5eed277208e7310ea38167a80
|
[
"MIT"
] | null | null | null |
cupyx/scipy/ndimage/__init__.py
|
yoshipon/cupy
|
50bac854269742c5eed277208e7310ea38167a80
|
[
"MIT"
] | null | null | null |
cupyx/scipy/ndimage/__init__.py
|
yoshipon/cupy
|
50bac854269742c5eed277208e7310ea38167a80
|
[
"MIT"
] | null | null | null |
from cupyx.scipy.ndimage.filters import correlate # NOQA
from cupyx.scipy.ndimage.filters import convolve # NOQA
from cupyx.scipy.ndimage.filters import correlate1d # NOQA
from cupyx.scipy.ndimage.filters import convolve1d # NOQA
from cupyx.scipy.ndimage.filters import minimum_filter # NOQA
from cupyx.scipy.ndimage.filters import maximum_filter # NOQA
from cupyx.scipy.ndimage.filters import minimum_filter1d # NOQA
from cupyx.scipy.ndimage.filters import maximum_filter1d # NOQA
from cupyx.scipy.ndimage.filters import median_filter # NOQA
from cupyx.scipy.ndimage.filters import rank_filter # NOQA
from cupyx.scipy.ndimage.filters import percentile_filter # NOQA
from cupyx.scipy.ndimage.interpolation import affine_transform # NOQA
from cupyx.scipy.ndimage.interpolation import map_coordinates # NOQA
from cupyx.scipy.ndimage.interpolation import rotate # NOQA
from cupyx.scipy.ndimage.interpolation import shift # NOQA
from cupyx.scipy.ndimage.interpolation import zoom # NOQA
from cupyx.scipy.ndimage.measurements import label # NOQA
from cupyx.scipy.ndimage.measurements import sum # NOQA
from cupyx.scipy.ndimage.measurements import mean # NOQA
from cupyx.scipy.ndimage.measurements import variance # NOQA
from cupyx.scipy.ndimage.measurements import standard_deviation # NOQA
from cupyx.scipy.ndimage.morphology import grey_erosion # NOQA
from cupyx.scipy.ndimage.morphology import grey_dilation # NOQA
from cupyx.scipy.ndimage.morphology import grey_closing # NOQA
from cupyx.scipy.ndimage.morphology import grey_opening # NOQA
| 54.034483
| 71
| 0.822591
| 214
| 1,567
| 5.957944
| 0.182243
| 0.176471
| 0.27451
| 0.411765
| 0.865098
| 0.865098
| 0.833725
| 0.403137
| 0
| 0
| 0
| 0.00288
| 0.113593
| 1,567
| 28
| 72
| 55.964286
| 0.915047
| 0.079132
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 8
|
072c1e1a6d7c31196502a2e6b1f121b4e87fd407
| 958,925
|
py
|
Python
|
ns-allinone-3.35/ns-3.35/src/dsr/bindings/modulegen__gcc_LP64.py
|
usi-systems/cc
|
487aa9e322b2b01b6af3a92e38545c119e4980a3
|
[
"Apache-2.0"
] | null | null | null |
ns-allinone-3.35/ns-3.35/src/dsr/bindings/modulegen__gcc_LP64.py
|
usi-systems/cc
|
487aa9e322b2b01b6af3a92e38545c119e4980a3
|
[
"Apache-2.0"
] | null | null | null |
ns-allinone-3.35/ns-3.35/src/dsr/bindings/modulegen__gcc_LP64.py
|
usi-systems/cc
|
487aa9e322b2b01b6af3a92e38545c119e4980a3
|
[
"Apache-2.0"
] | null | null | null |
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
return True
pybindgen.settings.error_handler = ErrorHandler()
import sys
def module_init():
root_module = Module('ns.dsr', cpp_namespace='::ns3')
return root_module
def register_types(module):
root_module = module.get_root()
## wifi-mac.h (module 'wifi'): ns3::TypeOfStation [enumeration]
module.add_enum('TypeOfStation', ['STA', 'AP', 'ADHOC_STA', 'MESH', 'OCB'], import_from_module='ns.wifi')
## wifi-mac.h (module 'wifi'): ns3::WifiMacDropReason [enumeration]
module.add_enum('WifiMacDropReason', ['WIFI_MAC_DROP_FAILED_ENQUEUE', 'WIFI_MAC_DROP_EXPIRED_LIFETIME', 'WIFI_MAC_DROP_REACHED_RETRY_LIMIT', 'WIFI_MAC_DROP_QOS_OLD_PACKET'], import_from_module='ns.wifi')
## qos-utils.h (module 'wifi'): ns3::AcIndex [enumeration]
module.add_enum('AcIndex', ['AC_BE', 'AC_BK', 'AC_VI', 'AC_VO', 'AC_BE_NQOS', 'AC_BEACON', 'AC_UNDEF'], import_from_module='ns.wifi')
## wifi-phy-common.h (module 'wifi'): ns3::WifiPreamble [enumeration]
module.add_enum('WifiPreamble', ['WIFI_PREAMBLE_LONG', 'WIFI_PREAMBLE_SHORT', 'WIFI_PREAMBLE_HT_MF', 'WIFI_PREAMBLE_VHT_SU', 'WIFI_PREAMBLE_VHT_MU', 'WIFI_PREAMBLE_HE_SU', 'WIFI_PREAMBLE_HE_ER_SU', 'WIFI_PREAMBLE_HE_MU', 'WIFI_PREAMBLE_HE_TB'], import_from_module='ns.wifi')
## wifi-phy-common.h (module 'wifi'): ns3::WifiModulationClass [enumeration]
module.add_enum('WifiModulationClass', ['WIFI_MOD_CLASS_UNKNOWN', 'WIFI_MOD_CLASS_DSSS', 'WIFI_MOD_CLASS_HR_DSSS', 'WIFI_MOD_CLASS_ERP_OFDM', 'WIFI_MOD_CLASS_OFDM', 'WIFI_MOD_CLASS_HT', 'WIFI_MOD_CLASS_VHT', 'WIFI_MOD_CLASS_HE'], import_from_module='ns.wifi')
## wifi-phy-common.h (module 'wifi'): ns3::WifiPpduField [enumeration]
module.add_enum('WifiPpduField', ['WIFI_PPDU_FIELD_PREAMBLE', 'WIFI_PPDU_FIELD_NON_HT_HEADER', 'WIFI_PPDU_FIELD_HT_SIG', 'WIFI_PPDU_FIELD_TRAINING', 'WIFI_PPDU_FIELD_SIG_A', 'WIFI_PPDU_FIELD_SIG_B', 'WIFI_PPDU_FIELD_DATA'], import_from_module='ns.wifi')
## wifi-phy-common.h (module 'wifi'): ns3::WifiPpduType [enumeration]
module.add_enum('WifiPpduType', ['WIFI_PPDU_TYPE_SU', 'WIFI_PPDU_TYPE_DL_MU', 'WIFI_PPDU_TYPE_UL_MU'], import_from_module='ns.wifi')
## wifi-phy-common.h (module 'wifi'): ns3::WifiPhyRxfailureReason [enumeration]
module.add_enum('WifiPhyRxfailureReason', ['UNKNOWN', 'UNSUPPORTED_SETTINGS', 'CHANNEL_SWITCHING', 'RXING', 'TXING', 'SLEEPING', 'BUSY_DECODING_PREAMBLE', 'PREAMBLE_DETECT_FAILURE', 'RECEPTION_ABORTED_BY_TX', 'L_SIG_FAILURE', 'HT_SIG_FAILURE', 'SIG_A_FAILURE', 'SIG_B_FAILURE', 'PREAMBLE_DETECTION_PACKET_SWITCH', 'FRAME_CAPTURE_PACKET_SWITCH', 'OBSS_PD_CCA_RESET', 'HE_TB_PPDU_TOO_LATE', 'FILTERED'], import_from_module='ns.wifi')
## wifi-standards.h (module 'wifi'): ns3::WifiPhyStandard [enumeration]
module.add_enum('WifiPhyStandard', ['WIFI_PHY_STANDARD_80211a', 'WIFI_PHY_STANDARD_80211b', 'WIFI_PHY_STANDARD_80211g', 'WIFI_PHY_STANDARD_80211p', 'WIFI_PHY_STANDARD_80211n', 'WIFI_PHY_STANDARD_80211ac', 'WIFI_PHY_STANDARD_80211ax', 'WIFI_PHY_STANDARD_UNSPECIFIED'], import_from_module='ns.wifi')
## wifi-standards.h (module 'wifi'): ns3::WifiMacStandard [enumeration]
module.add_enum('WifiMacStandard', ['WIFI_MAC_STANDARD_80211', 'WIFI_MAC_STANDARD_80211n', 'WIFI_MAC_STANDARD_80211ac', 'WIFI_MAC_STANDARD_80211ax'], import_from_module='ns.wifi')
## wifi-standards.h (module 'wifi'): ns3::WifiStandard [enumeration]
module.add_enum('WifiStandard', ['WIFI_STANDARD_80211a', 'WIFI_STANDARD_80211b', 'WIFI_STANDARD_80211g', 'WIFI_STANDARD_80211p', 'WIFI_STANDARD_80211n_2_4GHZ', 'WIFI_STANDARD_80211n_5GHZ', 'WIFI_STANDARD_80211ac', 'WIFI_STANDARD_80211ax_2_4GHZ', 'WIFI_STANDARD_80211ax_5GHZ', 'WIFI_STANDARD_80211ax_6GHZ'], import_from_module='ns.wifi')
## wifi-standards.h (module 'wifi'): ns3::FrequencyChannelType [enumeration]
module.add_enum('FrequencyChannelType', ['WIFI_PHY_DSSS_CHANNEL', 'WIFI_PHY_OFDM_CHANNEL', 'WIFI_PHY_80211p_CHANNEL'], import_from_module='ns.wifi')
## wifi-phy-band.h (module 'wifi'): ns3::WifiPhyBand [enumeration]
module.add_enum('WifiPhyBand', ['WIFI_PHY_BAND_2_4GHZ', 'WIFI_PHY_BAND_5GHZ', 'WIFI_PHY_BAND_6GHZ', 'WIFI_PHY_BAND_UNSPECIFIED'], import_from_module='ns.wifi')
## log.h (module 'core'): ns3::LogLevel [enumeration]
module.add_enum('LogLevel', ['LOG_NONE', 'LOG_ERROR', 'LOG_LEVEL_ERROR', 'LOG_WARN', 'LOG_LEVEL_WARN', 'LOG_DEBUG', 'LOG_LEVEL_DEBUG', 'LOG_INFO', 'LOG_LEVEL_INFO', 'LOG_FUNCTION', 'LOG_LEVEL_FUNCTION', 'LOG_LOGIC', 'LOG_LEVEL_LOGIC', 'LOG_ALL', 'LOG_LEVEL_ALL', 'LOG_PREFIX_FUNC', 'LOG_PREFIX_TIME', 'LOG_PREFIX_NODE', 'LOG_PREFIX_LEVEL', 'LOG_PREFIX_ALL'], import_from_module='ns.core')
## address.h (module 'network'): ns3::Address [class]
module.add_class('Address', import_from_module='ns.network')
## address.h (module 'network'): ns3::Address::MaxSize_e [enumeration]
module.add_enum('MaxSize_e', ['MAX_SIZE'], outer_class=root_module['ns3::Address'], import_from_module='ns.network')
## attribute-construction-list.h (module 'core'): ns3::AttributeConstructionList [class]
module.add_class('AttributeConstructionList', import_from_module='ns.core')
## attribute-construction-list.h (module 'core'): ns3::AttributeConstructionList::Item [struct]
module.add_class('Item', import_from_module='ns.core', outer_class=root_module['ns3::AttributeConstructionList'])
typehandlers.add_type_alias('std::list< ns3::AttributeConstructionList::Item > const_iterator', 'ns3::AttributeConstructionList::CIterator')
typehandlers.add_type_alias('std::list< ns3::AttributeConstructionList::Item > const_iterator*', 'ns3::AttributeConstructionList::CIterator*')
typehandlers.add_type_alias('std::list< ns3::AttributeConstructionList::Item > const_iterator&', 'ns3::AttributeConstructionList::CIterator&')
## block-ack-type.h (module 'wifi'): ns3::BlockAckReqType [struct]
module.add_class('BlockAckReqType', import_from_module='ns.wifi')
## block-ack-type.h (module 'wifi'): ns3::BlockAckReqType::Variant [enumeration]
module.add_enum('Variant', ['BASIC', 'COMPRESSED', 'EXTENDED_COMPRESSED', 'MULTI_TID'], outer_class=root_module['ns3::BlockAckReqType'], import_from_module='ns.wifi')
## block-ack-type.h (module 'wifi'): ns3::BlockAckType [struct]
module.add_class('BlockAckType', import_from_module='ns.wifi')
## block-ack-type.h (module 'wifi'): ns3::BlockAckType::Variant [enumeration]
module.add_enum('Variant', ['BASIC', 'COMPRESSED', 'EXTENDED_COMPRESSED', 'MULTI_TID', 'MULTI_STA'], outer_class=root_module['ns3::BlockAckType'], import_from_module='ns.wifi')
## buffer.h (module 'network'): ns3::Buffer [class]
module.add_class('Buffer', import_from_module='ns.network')
## buffer.h (module 'network'): ns3::Buffer::Iterator [class]
module.add_class('Iterator', import_from_module='ns.network', outer_class=root_module['ns3::Buffer'])
## packet.h (module 'network'): ns3::ByteTagIterator [class]
module.add_class('ByteTagIterator', import_from_module='ns.network')
## packet.h (module 'network'): ns3::ByteTagIterator::Item [class]
module.add_class('Item', import_from_module='ns.network', outer_class=root_module['ns3::ByteTagIterator'])
## byte-tag-list.h (module 'network'): ns3::ByteTagList [class]
module.add_class('ByteTagList', import_from_module='ns.network')
## byte-tag-list.h (module 'network'): ns3::ByteTagList::Iterator [class]
module.add_class('Iterator', import_from_module='ns.network', outer_class=root_module['ns3::ByteTagList'])
## byte-tag-list.h (module 'network'): ns3::ByteTagList::Iterator::Item [struct]
module.add_class('Item', import_from_module='ns.network', outer_class=root_module['ns3::ByteTagList::Iterator'])
## callback.h (module 'core'): ns3::CallbackBase [class]
module.add_class('CallbackBase', import_from_module='ns.core')
## data-rate.h (module 'network'): ns3::DataRate [class]
module.add_class('DataRate', import_from_module='ns.network')
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::AttributeAccessor> [struct]
module.add_class('DefaultDeleter', import_from_module='ns.core', template_parameters=['ns3::AttributeAccessor'])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::AttributeChecker> [struct]
module.add_class('DefaultDeleter', import_from_module='ns.core', template_parameters=['ns3::AttributeChecker'])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::AttributeValue> [struct]
module.add_class('DefaultDeleter', import_from_module='ns.core', template_parameters=['ns3::AttributeValue'])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::CallbackImplBase> [struct]
module.add_class('DefaultDeleter', import_from_module='ns.core', template_parameters=['ns3::CallbackImplBase'])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::EventImpl> [struct]
module.add_class('DefaultDeleter', import_from_module='ns.core', template_parameters=['ns3::EventImpl'])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::Hash::Implementation> [struct]
module.add_class('DefaultDeleter', import_from_module='ns.core', template_parameters=['ns3::Hash::Implementation'])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::Ipv4Route> [struct]
module.add_class('DefaultDeleter', import_from_module='ns.core', template_parameters=['ns3::Ipv4Route'])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::NixVector> [struct]
module.add_class('DefaultDeleter', import_from_module='ns.core', template_parameters=['ns3::NixVector'])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::Packet> [struct]
module.add_class('DefaultDeleter', import_from_module='ns.core', template_parameters=['ns3::Packet'])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::TraceSourceAccessor> [struct]
module.add_class('DefaultDeleter', import_from_module='ns.core', template_parameters=['ns3::TraceSourceAccessor'])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::WifiInformationElement> [struct]
module.add_class('DefaultDeleter', import_from_module='ns.core', template_parameters=['ns3::WifiInformationElement'])
## dsr-helper.h (module 'dsr'): ns3::DsrHelper [class]
module.add_class('DsrHelper')
## dsr-main-helper.h (module 'dsr'): ns3::DsrMainHelper [class]
module.add_class('DsrMainHelper')
## event-garbage-collector.h (module 'core'): ns3::EventGarbageCollector [class]
module.add_class('EventGarbageCollector', import_from_module='ns.core')
## event-id.h (module 'core'): ns3::EventId [class]
module.add_class('EventId', import_from_module='ns.core')
## hash.h (module 'core'): ns3::Hasher [class]
module.add_class('Hasher', import_from_module='ns.core')
## inet6-socket-address.h (module 'network'): ns3::Inet6SocketAddress [class]
module.add_class('Inet6SocketAddress', import_from_module='ns.network')
## inet6-socket-address.h (module 'network'): ns3::Inet6SocketAddress [class]
root_module['ns3::Inet6SocketAddress'].implicitly_converts_to(root_module['ns3::Address'])
## inet-socket-address.h (module 'network'): ns3::InetSocketAddress [class]
module.add_class('InetSocketAddress', import_from_module='ns.network')
## inet-socket-address.h (module 'network'): ns3::InetSocketAddress [class]
root_module['ns3::InetSocketAddress'].implicitly_converts_to(root_module['ns3::Address'])
## int-to-type.h (module 'core'): ns3::IntToType<0> [struct]
module.add_class('IntToType', import_from_module='ns.core', template_parameters=['0'])
## int-to-type.h (module 'core'): ns3::IntToType<0>::v_e [enumeration]
module.add_enum('v_e', ['value'], outer_class=root_module['ns3::IntToType< 0 >'], import_from_module='ns.core')
## int-to-type.h (module 'core'): ns3::IntToType<1> [struct]
module.add_class('IntToType', import_from_module='ns.core', template_parameters=['1'])
## int-to-type.h (module 'core'): ns3::IntToType<1>::v_e [enumeration]
module.add_enum('v_e', ['value'], outer_class=root_module['ns3::IntToType< 1 >'], import_from_module='ns.core')
## int-to-type.h (module 'core'): ns3::IntToType<2> [struct]
module.add_class('IntToType', import_from_module='ns.core', template_parameters=['2'])
## int-to-type.h (module 'core'): ns3::IntToType<2>::v_e [enumeration]
module.add_enum('v_e', ['value'], outer_class=root_module['ns3::IntToType< 2 >'], import_from_module='ns.core')
## int-to-type.h (module 'core'): ns3::IntToType<3> [struct]
module.add_class('IntToType', import_from_module='ns.core', template_parameters=['3'])
## int-to-type.h (module 'core'): ns3::IntToType<3>::v_e [enumeration]
module.add_enum('v_e', ['value'], outer_class=root_module['ns3::IntToType< 3 >'], import_from_module='ns.core')
## int-to-type.h (module 'core'): ns3::IntToType<4> [struct]
module.add_class('IntToType', import_from_module='ns.core', template_parameters=['4'])
## int-to-type.h (module 'core'): ns3::IntToType<4>::v_e [enumeration]
module.add_enum('v_e', ['value'], outer_class=root_module['ns3::IntToType< 4 >'], import_from_module='ns.core')
## int-to-type.h (module 'core'): ns3::IntToType<5> [struct]
module.add_class('IntToType', import_from_module='ns.core', template_parameters=['5'])
## int-to-type.h (module 'core'): ns3::IntToType<5>::v_e [enumeration]
module.add_enum('v_e', ['value'], outer_class=root_module['ns3::IntToType< 5 >'], import_from_module='ns.core')
## int-to-type.h (module 'core'): ns3::IntToType<6> [struct]
module.add_class('IntToType', import_from_module='ns.core', template_parameters=['6'])
## int-to-type.h (module 'core'): ns3::IntToType<6>::v_e [enumeration]
module.add_enum('v_e', ['value'], outer_class=root_module['ns3::IntToType< 6 >'], import_from_module='ns.core')
## ipv4-address.h (module 'network'): ns3::Ipv4Address [class]
module.add_class('Ipv4Address', import_from_module='ns.network')
## ipv4-address.h (module 'network'): ns3::Ipv4Address [class]
root_module['ns3::Ipv4Address'].implicitly_converts_to(root_module['ns3::Address'])
## ipv4-address.h (module 'network'): ns3::Ipv4AddressHash [class]
module.add_class('Ipv4AddressHash', import_from_module='ns.network')
## ipv4-interface-address.h (module 'internet'): ns3::Ipv4InterfaceAddress [class]
module.add_class('Ipv4InterfaceAddress', import_from_module='ns.internet')
## ipv4-interface-address.h (module 'internet'): ns3::Ipv4InterfaceAddress::InterfaceAddressScope_e [enumeration]
module.add_enum('InterfaceAddressScope_e', ['HOST', 'LINK', 'GLOBAL'], outer_class=root_module['ns3::Ipv4InterfaceAddress'], import_from_module='ns.internet')
## ipv4-address.h (module 'network'): ns3::Ipv4Mask [class]
module.add_class('Ipv4Mask', import_from_module='ns.network')
## ipv6-address.h (module 'network'): ns3::Ipv6Address [class]
module.add_class('Ipv6Address', import_from_module='ns.network')
## ipv6-address.h (module 'network'): ns3::Ipv6Address [class]
root_module['ns3::Ipv6Address'].implicitly_converts_to(root_module['ns3::Address'])
## ipv6-address.h (module 'network'): ns3::Ipv6AddressHash [class]
module.add_class('Ipv6AddressHash', import_from_module='ns.network')
## ipv6-address.h (module 'network'): ns3::Ipv6Prefix [class]
module.add_class('Ipv6Prefix', import_from_module='ns.network')
## log.h (module 'core'): ns3::LogComponent [class]
module.add_class('LogComponent', import_from_module='ns.core')
typehandlers.add_type_alias('std::map< std::string, ns3::LogComponent * >', 'ns3::LogComponent::ComponentList')
typehandlers.add_type_alias('std::map< std::string, ns3::LogComponent * >*', 'ns3::LogComponent::ComponentList*')
typehandlers.add_type_alias('std::map< std::string, ns3::LogComponent * >&', 'ns3::LogComponent::ComponentList&')
## mac48-address.h (module 'network'): ns3::Mac48Address [class]
module.add_class('Mac48Address', import_from_module='ns.network')
typehandlers.add_type_alias('void ( * ) ( ns3::Mac48Address )', 'ns3::Mac48Address::TracedCallback')
typehandlers.add_type_alias('void ( * ) ( ns3::Mac48Address )*', 'ns3::Mac48Address::TracedCallback*')
typehandlers.add_type_alias('void ( * ) ( ns3::Mac48Address )&', 'ns3::Mac48Address::TracedCallback&')
## mac48-address.h (module 'network'): ns3::Mac48Address [class]
root_module['ns3::Mac48Address'].implicitly_converts_to(root_module['ns3::Address'])
## mac8-address.h (module 'network'): ns3::Mac8Address [class]
module.add_class('Mac8Address', import_from_module='ns.network')
## mac8-address.h (module 'network'): ns3::Mac8Address [class]
root_module['ns3::Mac8Address'].implicitly_converts_to(root_module['ns3::Address'])
## node-container.h (module 'network'): ns3::NodeContainer [class]
module.add_class('NodeContainer', import_from_module='ns.network')
typehandlers.add_type_alias('std::vector< ns3::Ptr< ns3::Node > > const_iterator', 'ns3::NodeContainer::Iterator')
typehandlers.add_type_alias('std::vector< ns3::Ptr< ns3::Node > > const_iterator*', 'ns3::NodeContainer::Iterator*')
typehandlers.add_type_alias('std::vector< ns3::Ptr< ns3::Node > > const_iterator&', 'ns3::NodeContainer::Iterator&')
## non-copyable.h (module 'core'): ns3::NonCopyable [class]
module.add_class('NonCopyable', destructor_visibility='protected', import_from_module='ns.core')
## object-base.h (module 'core'): ns3::ObjectBase [class]
module.add_class('ObjectBase', allow_subclassing=True, import_from_module='ns.core')
## object.h (module 'core'): ns3::ObjectDeleter [struct]
module.add_class('ObjectDeleter', import_from_module='ns.core')
## object-factory.h (module 'core'): ns3::ObjectFactory [class]
module.add_class('ObjectFactory', import_from_module='ns.core')
## packet-metadata.h (module 'network'): ns3::PacketMetadata [class]
module.add_class('PacketMetadata', import_from_module='ns.network')
## packet-metadata.h (module 'network'): ns3::PacketMetadata::Item [struct]
module.add_class('Item', import_from_module='ns.network', outer_class=root_module['ns3::PacketMetadata'])
## packet-metadata.h (module 'network'): ns3::PacketMetadata::Item::ItemType [enumeration]
module.add_enum('ItemType', ['PAYLOAD', 'HEADER', 'TRAILER'], outer_class=root_module['ns3::PacketMetadata::Item'], import_from_module='ns.network')
## packet-metadata.h (module 'network'): ns3::PacketMetadata::ItemIterator [class]
module.add_class('ItemIterator', import_from_module='ns.network', outer_class=root_module['ns3::PacketMetadata'])
## packet.h (module 'network'): ns3::PacketTagIterator [class]
module.add_class('PacketTagIterator', import_from_module='ns.network')
## packet.h (module 'network'): ns3::PacketTagIterator::Item [class]
module.add_class('Item', import_from_module='ns.network', outer_class=root_module['ns3::PacketTagIterator'])
## packet-tag-list.h (module 'network'): ns3::PacketTagList [class]
module.add_class('PacketTagList', import_from_module='ns.network')
## packet-tag-list.h (module 'network'): ns3::PacketTagList::TagData [struct]
module.add_class('TagData', import_from_module='ns.network', outer_class=root_module['ns3::PacketTagList'])
## log.h (module 'core'): ns3::ParameterLogger [class]
module.add_class('ParameterLogger', import_from_module='ns.core')
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Object, ns3::ObjectBase, ns3::ObjectDeleter> [class]
module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'), parent=root_module['ns3::ObjectBase'], template_parameters=['ns3::Object', 'ns3::ObjectBase', 'ns3::ObjectDeleter'])
## simulator.h (module 'core'): ns3::Simulator [class]
module.add_class('Simulator', destructor_visibility='private', import_from_module='ns.core')
## simulator.h (module 'core'): ns3::Simulator [enumeration]
module.add_enum('', ['NO_CONTEXT'], outer_class=root_module['ns3::Simulator'], import_from_module='ns.core')
## system-wall-clock-ms.h (module 'core'): ns3::SystemWallClockMs [class]
module.add_class('SystemWallClockMs', import_from_module='ns.core')
## tag.h (module 'network'): ns3::Tag [class]
module.add_class('Tag', import_from_module='ns.network', parent=root_module['ns3::ObjectBase'])
## tag-buffer.h (module 'network'): ns3::TagBuffer [class]
module.add_class('TagBuffer', import_from_module='ns.network')
## nstime.h (module 'core'): ns3::Time [class]
module.add_class('Time', import_from_module='ns.core')
## nstime.h (module 'core'): ns3::Time::Unit [enumeration]
module.add_enum('Unit', ['Y', 'D', 'H', 'MIN', 'S', 'MS', 'US', 'NS', 'PS', 'FS', 'LAST', 'AUTO'], outer_class=root_module['ns3::Time'], import_from_module='ns.core')
typehandlers.add_type_alias('void ( * ) ( ns3::Time )', 'ns3::Time::TracedCallback')
typehandlers.add_type_alias('void ( * ) ( ns3::Time )*', 'ns3::Time::TracedCallback*')
typehandlers.add_type_alias('void ( * ) ( ns3::Time )&', 'ns3::Time::TracedCallback&')
## nstime.h (module 'core'): ns3::TimeWithUnit [class]
module.add_class('TimeWithUnit', import_from_module='ns.core')
## timer.h (module 'core'): ns3::Timer [class]
module.add_class('Timer', import_from_module='ns.core')
## timer.h (module 'core'): ns3::Timer::DestroyPolicy [enumeration]
module.add_enum('DestroyPolicy', ['CANCEL_ON_DESTROY', 'REMOVE_ON_DESTROY', 'CHECK_ON_DESTROY'], outer_class=root_module['ns3::Timer'], import_from_module='ns.core')
## timer.h (module 'core'): ns3::Timer::State [enumeration]
module.add_enum('State', ['RUNNING', 'EXPIRED', 'SUSPENDED'], outer_class=root_module['ns3::Timer'], import_from_module='ns.core')
## timer-impl.h (module 'core'): ns3::TimerImpl [class]
module.add_class('TimerImpl', allow_subclassing=True, import_from_module='ns.core')
## type-id.h (module 'core'): ns3::TypeId [class]
module.add_class('TypeId', import_from_module='ns.core')
## type-id.h (module 'core'): ns3::TypeId::AttributeFlag [enumeration]
module.add_enum('AttributeFlag', ['ATTR_GET', 'ATTR_SET', 'ATTR_CONSTRUCT', 'ATTR_SGC'], outer_class=root_module['ns3::TypeId'], import_from_module='ns.core')
## type-id.h (module 'core'): ns3::TypeId::SupportLevel [enumeration]
module.add_enum('SupportLevel', ['SUPPORTED', 'DEPRECATED', 'OBSOLETE'], outer_class=root_module['ns3::TypeId'], import_from_module='ns.core')
## type-id.h (module 'core'): ns3::TypeId::AttributeInformation [struct]
module.add_class('AttributeInformation', import_from_module='ns.core', outer_class=root_module['ns3::TypeId'])
## type-id.h (module 'core'): ns3::TypeId::TraceSourceInformation [struct]
module.add_class('TraceSourceInformation', import_from_module='ns.core', outer_class=root_module['ns3::TypeId'])
typehandlers.add_type_alias('uint32_t', 'ns3::TypeId::hash_t')
typehandlers.add_type_alias('uint32_t*', 'ns3::TypeId::hash_t*')
typehandlers.add_type_alias('uint32_t&', 'ns3::TypeId::hash_t&')
## qos-utils.h (module 'wifi'): ns3::WifiAc [class]
module.add_class('WifiAc', import_from_module='ns.wifi')
## qos-utils.h (module 'wifi'): ns3::WifiAddressHash [struct]
module.add_class('WifiAddressHash', import_from_module='ns.wifi')
## qos-utils.h (module 'wifi'): ns3::WifiAddressTidHash [struct]
module.add_class('WifiAddressTidHash', import_from_module='ns.wifi')
## wifi-mode.h (module 'wifi'): ns3::WifiMode [class]
module.add_class('WifiMode', import_from_module='ns.wifi')
## wifi-mode.h (module 'wifi'): ns3::WifiModeFactory [class]
module.add_class('WifiModeFactory', import_from_module='ns.wifi')
typehandlers.add_type_alias('ns3::Callback< unsigned short, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ns3::WifiModeFactory::CodeRateCallback')
typehandlers.add_type_alias('ns3::Callback< unsigned short, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', 'ns3::WifiModeFactory::CodeRateCallback*')
typehandlers.add_type_alias('ns3::Callback< unsigned short, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', 'ns3::WifiModeFactory::CodeRateCallback&')
typehandlers.add_type_alias('ns3::Callback< unsigned short, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ns3::WifiModeFactory::ConstellationSizeCallback')
typehandlers.add_type_alias('ns3::Callback< unsigned short, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', 'ns3::WifiModeFactory::ConstellationSizeCallback*')
typehandlers.add_type_alias('ns3::Callback< unsigned short, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', 'ns3::WifiModeFactory::ConstellationSizeCallback&')
typehandlers.add_type_alias('ns3::Callback< unsigned long, unsigned short, unsigned short, unsigned char, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ns3::WifiModeFactory::PhyRateCallback')
typehandlers.add_type_alias('ns3::Callback< unsigned long, unsigned short, unsigned short, unsigned char, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', 'ns3::WifiModeFactory::PhyRateCallback*')
typehandlers.add_type_alias('ns3::Callback< unsigned long, unsigned short, unsigned short, unsigned char, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', 'ns3::WifiModeFactory::PhyRateCallback&')
typehandlers.add_type_alias('ns3::Callback< unsigned long, ns3::WifiTxVector const &, unsigned short, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ns3::WifiModeFactory::PhyRateFromTxVectorCallback')
typehandlers.add_type_alias('ns3::Callback< unsigned long, ns3::WifiTxVector const &, unsigned short, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', 'ns3::WifiModeFactory::PhyRateFromTxVectorCallback*')
typehandlers.add_type_alias('ns3::Callback< unsigned long, ns3::WifiTxVector const &, unsigned short, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', 'ns3::WifiModeFactory::PhyRateFromTxVectorCallback&')
typehandlers.add_type_alias('ns3::Callback< unsigned long, unsigned short, unsigned short, unsigned char, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ns3::WifiModeFactory::DataRateCallback')
typehandlers.add_type_alias('ns3::Callback< unsigned long, unsigned short, unsigned short, unsigned char, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', 'ns3::WifiModeFactory::DataRateCallback*')
typehandlers.add_type_alias('ns3::Callback< unsigned long, unsigned short, unsigned short, unsigned char, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', 'ns3::WifiModeFactory::DataRateCallback&')
typehandlers.add_type_alias('ns3::Callback< unsigned long, ns3::WifiTxVector const &, unsigned short, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ns3::WifiModeFactory::DataRateFromTxVectorCallback')
typehandlers.add_type_alias('ns3::Callback< unsigned long, ns3::WifiTxVector const &, unsigned short, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', 'ns3::WifiModeFactory::DataRateFromTxVectorCallback*')
typehandlers.add_type_alias('ns3::Callback< unsigned long, ns3::WifiTxVector const &, unsigned short, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', 'ns3::WifiModeFactory::DataRateFromTxVectorCallback&')
typehandlers.add_type_alias('ns3::Callback< unsigned long, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ns3::WifiModeFactory::NonHtReferenceRateCallback')
typehandlers.add_type_alias('ns3::Callback< unsigned long, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', 'ns3::WifiModeFactory::NonHtReferenceRateCallback*')
typehandlers.add_type_alias('ns3::Callback< unsigned long, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', 'ns3::WifiModeFactory::NonHtReferenceRateCallback&')
typehandlers.add_type_alias('ns3::Callback< bool, unsigned short, unsigned char, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ns3::WifiModeFactory::ModeAllowedCallback')
typehandlers.add_type_alias('ns3::Callback< bool, unsigned short, unsigned char, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', 'ns3::WifiModeFactory::ModeAllowedCallback*')
typehandlers.add_type_alias('ns3::Callback< bool, unsigned short, unsigned char, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', 'ns3::WifiModeFactory::ModeAllowedCallback&')
## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiRemoteStation [struct]
module.add_class('WifiRemoteStation', import_from_module='ns.wifi')
## wifi-remote-station-info.h (module 'wifi'): ns3::WifiRemoteStationInfo [class]
module.add_class('WifiRemoteStationInfo', import_from_module='ns.wifi')
## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiRemoteStationState [struct]
module.add_class('WifiRemoteStationState', import_from_module='ns.wifi')
## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiRemoteStationState [enumeration]
module.add_enum('', ['BRAND_NEW', 'DISASSOC', 'WAIT_ASSOC_TX_OK', 'GOT_ASSOC_TX_OK'], outer_class=root_module['ns3::WifiRemoteStationState'], import_from_module='ns.wifi')
## wifi-standards.h (module 'wifi'): ns3::WifiStandardInfo [struct]
module.add_class('WifiStandardInfo', import_from_module='ns.wifi')
## empty.h (module 'core'): ns3::empty [class]
module.add_class('empty', import_from_module='ns.core')
## int64x64-128.h (module 'core'): ns3::int64x64_t [class]
module.add_class('int64x64_t', import_from_module='ns.core')
## int64x64-128.h (module 'core'): ns3::int64x64_t::impl_type [enumeration]
module.add_enum('impl_type', ['int128_impl', 'cairo_impl', 'ld_impl'], outer_class=root_module['ns3::int64x64_t'], import_from_module='ns.core')
## chunk.h (module 'network'): ns3::Chunk [class]
module.add_class('Chunk', import_from_module='ns.network', parent=root_module['ns3::ObjectBase'])
## header.h (module 'network'): ns3::Header [class]
module.add_class('Header', import_from_module='ns.network', parent=root_module['ns3::Chunk'])
## icmpv4.h (module 'internet'): ns3::Icmpv4DestinationUnreachable [class]
module.add_class('Icmpv4DestinationUnreachable', import_from_module='ns.internet', parent=root_module['ns3::Header'])
## icmpv4.h (module 'internet'): ns3::Icmpv4DestinationUnreachable::ErrorDestinationUnreachable_e [enumeration]
module.add_enum('ErrorDestinationUnreachable_e', ['ICMPV4_NET_UNREACHABLE', 'ICMPV4_HOST_UNREACHABLE', 'ICMPV4_PROTOCOL_UNREACHABLE', 'ICMPV4_PORT_UNREACHABLE', 'ICMPV4_FRAG_NEEDED', 'ICMPV4_SOURCE_ROUTE_FAILED'], outer_class=root_module['ns3::Icmpv4DestinationUnreachable'], import_from_module='ns.internet')
## icmpv4.h (module 'internet'): ns3::Icmpv4Echo [class]
module.add_class('Icmpv4Echo', import_from_module='ns.internet', parent=root_module['ns3::Header'])
## icmpv4.h (module 'internet'): ns3::Icmpv4Header [class]
module.add_class('Icmpv4Header', import_from_module='ns.internet', parent=root_module['ns3::Header'])
## icmpv4.h (module 'internet'): ns3::Icmpv4Header::Type_e [enumeration]
module.add_enum('Type_e', ['ICMPV4_ECHO_REPLY', 'ICMPV4_DEST_UNREACH', 'ICMPV4_ECHO', 'ICMPV4_TIME_EXCEEDED'], outer_class=root_module['ns3::Icmpv4Header'], import_from_module='ns.internet')
## icmpv4.h (module 'internet'): ns3::Icmpv4TimeExceeded [class]
module.add_class('Icmpv4TimeExceeded', import_from_module='ns.internet', parent=root_module['ns3::Header'])
## icmpv4.h (module 'internet'): ns3::Icmpv4TimeExceeded::ErrorTimeExceeded_e [enumeration]
module.add_enum('ErrorTimeExceeded_e', ['ICMPV4_TIME_TO_LIVE', 'ICMPV4_FRAGMENT_REASSEMBLY'], outer_class=root_module['ns3::Icmpv4TimeExceeded'], import_from_module='ns.internet')
## ipv4-header.h (module 'internet'): ns3::Ipv4Header [class]
module.add_class('Ipv4Header', import_from_module='ns.internet', parent=root_module['ns3::Header'])
## ipv4-header.h (module 'internet'): ns3::Ipv4Header::DscpType [enumeration]
module.add_enum('DscpType', ['DscpDefault', 'DSCP_CS1', 'DSCP_AF11', 'DSCP_AF12', 'DSCP_AF13', 'DSCP_CS2', 'DSCP_AF21', 'DSCP_AF22', 'DSCP_AF23', 'DSCP_CS3', 'DSCP_AF31', 'DSCP_AF32', 'DSCP_AF33', 'DSCP_CS4', 'DSCP_AF41', 'DSCP_AF42', 'DSCP_AF43', 'DSCP_CS5', 'DSCP_EF', 'DSCP_CS6', 'DSCP_CS7'], outer_class=root_module['ns3::Ipv4Header'], import_from_module='ns.internet')
## ipv4-header.h (module 'internet'): ns3::Ipv4Header::EcnType [enumeration]
module.add_enum('EcnType', ['ECN_NotECT', 'ECN_ECT1', 'ECN_ECT0', 'ECN_CE'], outer_class=root_module['ns3::Ipv4Header'], import_from_module='ns.internet')
## ipv6-header.h (module 'internet'): ns3::Ipv6Header [class]
module.add_class('Ipv6Header', import_from_module='ns.internet', parent=root_module['ns3::Header'])
## ipv6-header.h (module 'internet'): ns3::Ipv6Header::DscpType [enumeration]
module.add_enum('DscpType', ['DscpDefault', 'DSCP_CS1', 'DSCP_AF11', 'DSCP_AF12', 'DSCP_AF13', 'DSCP_CS2', 'DSCP_AF21', 'DSCP_AF22', 'DSCP_AF23', 'DSCP_CS3', 'DSCP_AF31', 'DSCP_AF32', 'DSCP_AF33', 'DSCP_CS4', 'DSCP_AF41', 'DSCP_AF42', 'DSCP_AF43', 'DSCP_CS5', 'DSCP_EF', 'DSCP_CS6', 'DSCP_CS7'], outer_class=root_module['ns3::Ipv6Header'], import_from_module='ns.internet')
## ipv6-header.h (module 'internet'): ns3::Ipv6Header::NextHeader_e [enumeration]
module.add_enum('NextHeader_e', ['IPV6_EXT_HOP_BY_HOP', 'IPV6_IPV4', 'IPV6_TCP', 'IPV6_UDP', 'IPV6_IPV6', 'IPV6_EXT_ROUTING', 'IPV6_EXT_FRAGMENTATION', 'IPV6_EXT_CONFIDENTIALITY', 'IPV6_EXT_AUTHENTIFICATION', 'IPV6_ICMPV6', 'IPV6_EXT_END', 'IPV6_EXT_DESTINATION', 'IPV6_SCTP', 'IPV6_EXT_MOBILITY', 'IPV6_UDP_LITE'], outer_class=root_module['ns3::Ipv6Header'], import_from_module='ns.internet')
## ipv6-header.h (module 'internet'): ns3::Ipv6Header::EcnType [enumeration]
module.add_enum('EcnType', ['ECN_NotECT', 'ECN_ECT1', 'ECN_ECT0', 'ECN_CE'], outer_class=root_module['ns3::Ipv6Header'], import_from_module='ns.internet')
## object.h (module 'core'): ns3::Object [class]
module.add_class('Object', import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::Object, ns3::ObjectBase, ns3::ObjectDeleter >'])
## object.h (module 'core'): ns3::Object::AggregateIterator [class]
module.add_class('AggregateIterator', import_from_module='ns.core', outer_class=root_module['ns3::Object'])
## random-variable-stream.h (module 'core'): ns3::RandomVariableStream [class]
module.add_class('RandomVariableStream', import_from_module='ns.core', parent=root_module['ns3::Object'])
## random-variable-stream.h (module 'core'): ns3::SequentialRandomVariable [class]
module.add_class('SequentialRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream'])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter<ns3::AttributeAccessor> > [class]
module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'), parent=root_module['ns3::empty'], template_parameters=['ns3::AttributeAccessor', 'ns3::empty', 'ns3::DefaultDeleter<ns3::AttributeAccessor>'])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeChecker, ns3::empty, ns3::DefaultDeleter<ns3::AttributeChecker> > [class]
module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'), parent=root_module['ns3::empty'], template_parameters=['ns3::AttributeChecker', 'ns3::empty', 'ns3::DefaultDeleter<ns3::AttributeChecker>'])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeValue, ns3::empty, ns3::DefaultDeleter<ns3::AttributeValue> > [class]
module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'), parent=root_module['ns3::empty'], template_parameters=['ns3::AttributeValue', 'ns3::empty', 'ns3::DefaultDeleter<ns3::AttributeValue>'])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::CallbackImplBase, ns3::empty, ns3::DefaultDeleter<ns3::CallbackImplBase> > [class]
module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'), parent=root_module['ns3::empty'], template_parameters=['ns3::CallbackImplBase', 'ns3::empty', 'ns3::DefaultDeleter<ns3::CallbackImplBase>'])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::EventImpl, ns3::empty, ns3::DefaultDeleter<ns3::EventImpl> > [class]
module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'), parent=root_module['ns3::empty'], template_parameters=['ns3::EventImpl', 'ns3::empty', 'ns3::DefaultDeleter<ns3::EventImpl>'])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Hash::Implementation, ns3::empty, ns3::DefaultDeleter<ns3::Hash::Implementation> > [class]
module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'), parent=root_module['ns3::empty'], template_parameters=['ns3::Hash::Implementation', 'ns3::empty', 'ns3::DefaultDeleter<ns3::Hash::Implementation>'])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Ipv4MulticastRoute, ns3::empty, ns3::DefaultDeleter<ns3::Ipv4MulticastRoute> > [class]
module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'), parent=root_module['ns3::empty'], template_parameters=['ns3::Ipv4MulticastRoute', 'ns3::empty', 'ns3::DefaultDeleter<ns3::Ipv4MulticastRoute>'])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Ipv4Route, ns3::empty, ns3::DefaultDeleter<ns3::Ipv4Route> > [class]
module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'), parent=root_module['ns3::empty'], template_parameters=['ns3::Ipv4Route', 'ns3::empty', 'ns3::DefaultDeleter<ns3::Ipv4Route>'])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::NixVector, ns3::empty, ns3::DefaultDeleter<ns3::NixVector> > [class]
module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'), parent=root_module['ns3::empty'], template_parameters=['ns3::NixVector', 'ns3::empty', 'ns3::DefaultDeleter<ns3::NixVector>'])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::OutputStreamWrapper, ns3::empty, ns3::DefaultDeleter<ns3::OutputStreamWrapper> > [class]
module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'), parent=root_module['ns3::empty'], template_parameters=['ns3::OutputStreamWrapper', 'ns3::empty', 'ns3::DefaultDeleter<ns3::OutputStreamWrapper>'])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Packet, ns3::empty, ns3::DefaultDeleter<ns3::Packet> > [class]
module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'), parent=root_module['ns3::empty'], template_parameters=['ns3::Packet', 'ns3::empty', 'ns3::DefaultDeleter<ns3::Packet>'])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter<ns3::TraceSourceAccessor> > [class]
module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'), parent=root_module['ns3::empty'], template_parameters=['ns3::TraceSourceAccessor', 'ns3::empty', 'ns3::DefaultDeleter<ns3::TraceSourceAccessor>'])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::WifiInformationElement, ns3::empty, ns3::DefaultDeleter<ns3::WifiInformationElement> > [class]
module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'), parent=root_module['ns3::empty'], template_parameters=['ns3::WifiInformationElement', 'ns3::empty', 'ns3::DefaultDeleter<ns3::WifiInformationElement>'])
## socket.h (module 'network'): ns3::Socket [class]
module.add_class('Socket', import_from_module='ns.network', parent=root_module['ns3::Object'])
## socket.h (module 'network'): ns3::Socket::SocketErrno [enumeration]
module.add_enum('SocketErrno', ['ERROR_NOTERROR', 'ERROR_ISCONN', 'ERROR_NOTCONN', 'ERROR_MSGSIZE', 'ERROR_AGAIN', 'ERROR_SHUTDOWN', 'ERROR_OPNOTSUPP', 'ERROR_AFNOSUPPORT', 'ERROR_INVAL', 'ERROR_BADF', 'ERROR_NOROUTETOHOST', 'ERROR_NODEV', 'ERROR_ADDRNOTAVAIL', 'ERROR_ADDRINUSE', 'SOCKET_ERRNO_LAST'], outer_class=root_module['ns3::Socket'], import_from_module='ns.network')
## socket.h (module 'network'): ns3::Socket::SocketType [enumeration]
module.add_enum('SocketType', ['NS3_SOCK_STREAM', 'NS3_SOCK_SEQPACKET', 'NS3_SOCK_DGRAM', 'NS3_SOCK_RAW'], outer_class=root_module['ns3::Socket'], import_from_module='ns.network')
## socket.h (module 'network'): ns3::Socket::SocketPriority [enumeration]
module.add_enum('SocketPriority', ['NS3_PRIO_BESTEFFORT', 'NS3_PRIO_FILLER', 'NS3_PRIO_BULK', 'NS3_PRIO_INTERACTIVE_BULK', 'NS3_PRIO_INTERACTIVE', 'NS3_PRIO_CONTROL'], outer_class=root_module['ns3::Socket'], import_from_module='ns.network')
## socket.h (module 'network'): ns3::Socket::Ipv6MulticastFilterMode [enumeration]
module.add_enum('Ipv6MulticastFilterMode', ['INCLUDE', 'EXCLUDE'], outer_class=root_module['ns3::Socket'], import_from_module='ns.network')
## socket.h (module 'network'): ns3::SocketIpTosTag [class]
module.add_class('SocketIpTosTag', import_from_module='ns.network', parent=root_module['ns3::Tag'])
## socket.h (module 'network'): ns3::SocketIpTtlTag [class]
module.add_class('SocketIpTtlTag', import_from_module='ns.network', parent=root_module['ns3::Tag'])
## socket.h (module 'network'): ns3::SocketIpv6HopLimitTag [class]
module.add_class('SocketIpv6HopLimitTag', import_from_module='ns.network', parent=root_module['ns3::Tag'])
## socket.h (module 'network'): ns3::SocketIpv6TclassTag [class]
module.add_class('SocketIpv6TclassTag', import_from_module='ns.network', parent=root_module['ns3::Tag'])
## socket.h (module 'network'): ns3::SocketPriorityTag [class]
module.add_class('SocketPriorityTag', import_from_module='ns.network', parent=root_module['ns3::Tag'])
## socket.h (module 'network'): ns3::SocketSetDontFragmentTag [class]
module.add_class('SocketSetDontFragmentTag', import_from_module='ns.network', parent=root_module['ns3::Tag'])
## trace-source-accessor.h (module 'core'): ns3::TraceSourceAccessor [class]
module.add_class('TraceSourceAccessor', import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter<ns3::TraceSourceAccessor> >'])
## trailer.h (module 'network'): ns3::Trailer [class]
module.add_class('Trailer', import_from_module='ns.network', parent=root_module['ns3::Chunk'])
## random-variable-stream.h (module 'core'): ns3::TriangularRandomVariable [class]
module.add_class('TriangularRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream'])
## random-variable-stream.h (module 'core'): ns3::UniformRandomVariable [class]
module.add_class('UniformRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream'])
## random-variable-stream.h (module 'core'): ns3::WeibullRandomVariable [class]
module.add_class('WeibullRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream'])
## wifi-information-element.h (module 'wifi'): ns3::WifiInformationElement [class]
module.add_class('WifiInformationElement', import_from_module='ns.wifi', parent=root_module['ns3::SimpleRefCount< ns3::WifiInformationElement, ns3::empty, ns3::DefaultDeleter<ns3::WifiInformationElement> >'])
## wifi-mac.h (module 'wifi'): ns3::WifiMac [class]
module.add_class('WifiMac', import_from_module='ns.wifi', parent=root_module['ns3::Object'])
typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::Mac48Address, ns3::Mac48Address, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ns3::WifiMac::ForwardUpCallback')
typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::Mac48Address, ns3::Mac48Address, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', 'ns3::WifiMac::ForwardUpCallback*')
typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::Mac48Address, ns3::Mac48Address, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', 'ns3::WifiMac::ForwardUpCallback&')
## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiRemoteStationManager [class]
module.add_class('WifiRemoteStationManager', import_from_module='ns.wifi', parent=root_module['ns3::Object'])
## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiRemoteStationManager::ProtectionMode [enumeration]
module.add_enum('ProtectionMode', ['RTS_CTS', 'CTS_TO_SELF'], outer_class=root_module['ns3::WifiRemoteStationManager'], import_from_module='ns.wifi')
typehandlers.add_type_alias('std::unordered_map< ns3::Mac48Address, ns3::WifiRemoteStation *, ns3::WifiAddressHash, std::equal_to< ns3::Mac48Address >, std::allocator< std::pair< ns3::Mac48Address const, ns3::WifiRemoteStation * > > >', 'ns3::WifiRemoteStationManager::Stations')
typehandlers.add_type_alias('std::unordered_map< ns3::Mac48Address, ns3::WifiRemoteStation *, ns3::WifiAddressHash, std::equal_to< ns3::Mac48Address >, std::allocator< std::pair< ns3::Mac48Address const, ns3::WifiRemoteStation * > > >*', 'ns3::WifiRemoteStationManager::Stations*')
typehandlers.add_type_alias('std::unordered_map< ns3::Mac48Address, ns3::WifiRemoteStation *, ns3::WifiAddressHash, std::equal_to< ns3::Mac48Address >, std::allocator< std::pair< ns3::Mac48Address const, ns3::WifiRemoteStation * > > >&', 'ns3::WifiRemoteStationManager::Stations&')
typehandlers.add_type_alias('std::unordered_map< ns3::Mac48Address, ns3::WifiRemoteStationState *, ns3::WifiAddressHash, std::equal_to< ns3::Mac48Address >, std::allocator< std::pair< ns3::Mac48Address const, ns3::WifiRemoteStationState * > > >', 'ns3::WifiRemoteStationManager::StationStates')
typehandlers.add_type_alias('std::unordered_map< ns3::Mac48Address, ns3::WifiRemoteStationState *, ns3::WifiAddressHash, std::equal_to< ns3::Mac48Address >, std::allocator< std::pair< ns3::Mac48Address const, ns3::WifiRemoteStationState * > > >*', 'ns3::WifiRemoteStationManager::StationStates*')
typehandlers.add_type_alias('std::unordered_map< ns3::Mac48Address, ns3::WifiRemoteStationState *, ns3::WifiAddressHash, std::equal_to< ns3::Mac48Address >, std::allocator< std::pair< ns3::Mac48Address const, ns3::WifiRemoteStationState * > > >&', 'ns3::WifiRemoteStationManager::StationStates&')
typehandlers.add_type_alias('void ( * ) ( double, double, ns3::Mac48Address )', 'ns3::WifiRemoteStationManager::PowerChangeTracedCallback')
typehandlers.add_type_alias('void ( * ) ( double, double, ns3::Mac48Address )*', 'ns3::WifiRemoteStationManager::PowerChangeTracedCallback*')
typehandlers.add_type_alias('void ( * ) ( double, double, ns3::Mac48Address )&', 'ns3::WifiRemoteStationManager::PowerChangeTracedCallback&')
typehandlers.add_type_alias('void ( * ) ( ns3::DataRate, ns3::DataRate, ns3::Mac48Address )', 'ns3::WifiRemoteStationManager::RateChangeTracedCallback')
typehandlers.add_type_alias('void ( * ) ( ns3::DataRate, ns3::DataRate, ns3::Mac48Address )*', 'ns3::WifiRemoteStationManager::RateChangeTracedCallback*')
typehandlers.add_type_alias('void ( * ) ( ns3::DataRate, ns3::DataRate, ns3::Mac48Address )&', 'ns3::WifiRemoteStationManager::RateChangeTracedCallback&')
## random-variable-stream.h (module 'core'): ns3::ZetaRandomVariable [class]
module.add_class('ZetaRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream'])
## random-variable-stream.h (module 'core'): ns3::ZipfRandomVariable [class]
module.add_class('ZipfRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream'])
## arp-cache.h (module 'internet'): ns3::ArpCache [class]
module.add_class('ArpCache', import_from_module='ns.internet', parent=root_module['ns3::Object'])
## arp-cache.h (module 'internet'): ns3::ArpCache::Entry [class]
module.add_class('Entry', import_from_module='ns.internet', outer_class=root_module['ns3::ArpCache'])
typehandlers.add_type_alias('std::pair< ns3::Ptr< ns3::Packet >, ns3::Ipv4Header >', 'ns3::ArpCache::Ipv4PayloadHeaderPair')
typehandlers.add_type_alias('std::pair< ns3::Ptr< ns3::Packet >, ns3::Ipv4Header >*', 'ns3::ArpCache::Ipv4PayloadHeaderPair*')
typehandlers.add_type_alias('std::pair< ns3::Ptr< ns3::Packet >, ns3::Ipv4Header >&', 'ns3::ArpCache::Ipv4PayloadHeaderPair&')
## attribute.h (module 'core'): ns3::AttributeAccessor [class]
module.add_class('AttributeAccessor', import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter<ns3::AttributeAccessor> >'])
## attribute.h (module 'core'): ns3::AttributeChecker [class]
module.add_class('AttributeChecker', allow_subclassing=False, automatic_type_narrowing=True, import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::AttributeChecker, ns3::empty, ns3::DefaultDeleter<ns3::AttributeChecker> >'])
## attribute.h (module 'core'): ns3::AttributeValue [class]
module.add_class('AttributeValue', allow_subclassing=False, automatic_type_narrowing=True, import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::AttributeValue, ns3::empty, ns3::DefaultDeleter<ns3::AttributeValue> >'])
## callback.h (module 'core'): ns3::CallbackChecker [class]
module.add_class('CallbackChecker', import_from_module='ns.core', parent=root_module['ns3::AttributeChecker'])
## callback.h (module 'core'): ns3::CallbackImplBase [class]
module.add_class('CallbackImplBase', import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::CallbackImplBase, ns3::empty, ns3::DefaultDeleter<ns3::CallbackImplBase> >'])
## callback.h (module 'core'): ns3::CallbackValue [class]
module.add_class('CallbackValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue'])
## random-variable-stream.h (module 'core'): ns3::ConstantRandomVariable [class]
module.add_class('ConstantRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream'])
## data-rate.h (module 'network'): ns3::DataRateChecker [class]
module.add_class('DataRateChecker', import_from_module='ns.network', parent=root_module['ns3::AttributeChecker'])
## data-rate.h (module 'network'): ns3::DataRateValue [class]
module.add_class('DataRateValue', import_from_module='ns.network', parent=root_module['ns3::AttributeValue'])
## random-variable-stream.h (module 'core'): ns3::DeterministicRandomVariable [class]
module.add_class('DeterministicRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream'])
## random-variable-stream.h (module 'core'): ns3::EmpiricalRandomVariable [class]
module.add_class('EmpiricalRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream'])
## attribute.h (module 'core'): ns3::EmptyAttributeAccessor [class]
module.add_class('EmptyAttributeAccessor', import_from_module='ns.core', parent=root_module['ns3::AttributeAccessor'])
## attribute.h (module 'core'): ns3::EmptyAttributeChecker [class]
module.add_class('EmptyAttributeChecker', import_from_module='ns.core', parent=root_module['ns3::AttributeChecker'])
## attribute.h (module 'core'): ns3::EmptyAttributeValue [class]
module.add_class('EmptyAttributeValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue'])
## enum.h (module 'core'): ns3::EnumChecker [class]
module.add_class('EnumChecker', import_from_module='ns.core', parent=root_module['ns3::AttributeChecker'])
## enum.h (module 'core'): ns3::EnumValue [class]
module.add_class('EnumValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue'])
## random-variable-stream.h (module 'core'): ns3::ErlangRandomVariable [class]
module.add_class('ErlangRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream'])
## event-impl.h (module 'core'): ns3::EventImpl [class]
module.add_class('EventImpl', import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::EventImpl, ns3::empty, ns3::DefaultDeleter<ns3::EventImpl> >'])
## random-variable-stream.h (module 'core'): ns3::ExponentialRandomVariable [class]
module.add_class('ExponentialRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream'])
## random-variable-stream.h (module 'core'): ns3::GammaRandomVariable [class]
module.add_class('GammaRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream'])
## he-capabilities.h (module 'wifi'): ns3::HeCapabilities [class]
module.add_class('HeCapabilities', import_from_module='ns.wifi', parent=root_module['ns3::WifiInformationElement'])
## ht-capabilities.h (module 'wifi'): ns3::HtCapabilities [class]
module.add_class('HtCapabilities', import_from_module='ns.wifi', parent=root_module['ns3::WifiInformationElement'])
## ip-l4-protocol.h (module 'internet'): ns3::IpL4Protocol [class]
module.add_class('IpL4Protocol', import_from_module='ns.internet', parent=root_module['ns3::Object'])
## ip-l4-protocol.h (module 'internet'): ns3::IpL4Protocol::RxStatus [enumeration]
module.add_enum('RxStatus', ['RX_OK', 'RX_CSUM_FAILED', 'RX_ENDPOINT_CLOSED', 'RX_ENDPOINT_UNREACH'], outer_class=root_module['ns3::IpL4Protocol'], import_from_module='ns.internet')
typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::Ipv4Address, ns3::Ipv4Address, unsigned char, ns3::Ptr< ns3::Ipv4Route >, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ns3::IpL4Protocol::DownTargetCallback')
typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::Ipv4Address, ns3::Ipv4Address, unsigned char, ns3::Ptr< ns3::Ipv4Route >, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', 'ns3::IpL4Protocol::DownTargetCallback*')
typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::Ipv4Address, ns3::Ipv4Address, unsigned char, ns3::Ptr< ns3::Ipv4Route >, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', 'ns3::IpL4Protocol::DownTargetCallback&')
typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::Ipv6Address, ns3::Ipv6Address, unsigned char, ns3::Ptr< ns3::Ipv6Route >, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ns3::IpL4Protocol::DownTargetCallback6')
typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::Ipv6Address, ns3::Ipv6Address, unsigned char, ns3::Ptr< ns3::Ipv6Route >, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', 'ns3::IpL4Protocol::DownTargetCallback6*')
typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::Ipv6Address, ns3::Ipv6Address, unsigned char, ns3::Ptr< ns3::Ipv6Route >, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', 'ns3::IpL4Protocol::DownTargetCallback6&')
## ipv4.h (module 'internet'): ns3::Ipv4 [class]
module.add_class('Ipv4', import_from_module='ns.internet', parent=root_module['ns3::Object'])
## ipv4-address.h (module 'network'): ns3::Ipv4AddressChecker [class]
module.add_class('Ipv4AddressChecker', import_from_module='ns.network', parent=root_module['ns3::AttributeChecker'])
## ipv4-address.h (module 'network'): ns3::Ipv4AddressValue [class]
module.add_class('Ipv4AddressValue', import_from_module='ns.network', parent=root_module['ns3::AttributeValue'])
## ipv4-interface.h (module 'internet'): ns3::Ipv4Interface [class]
module.add_class('Ipv4Interface', import_from_module='ns.internet', parent=root_module['ns3::Object'])
## ipv4-l3-protocol.h (module 'internet'): ns3::Ipv4L3Protocol [class]
module.add_class('Ipv4L3Protocol', import_from_module='ns.internet', parent=root_module['ns3::Ipv4'])
## ipv4-l3-protocol.h (module 'internet'): ns3::Ipv4L3Protocol::DropReason [enumeration]
module.add_enum('DropReason', ['DROP_TTL_EXPIRED', 'DROP_NO_ROUTE', 'DROP_BAD_CHECKSUM', 'DROP_INTERFACE_DOWN', 'DROP_ROUTE_ERROR', 'DROP_FRAGMENT_TIMEOUT', 'DROP_DUPLICATE'], outer_class=root_module['ns3::Ipv4L3Protocol'], import_from_module='ns.internet')
typehandlers.add_type_alias('void ( * ) ( ns3::Ipv4Header const &, ns3::Ptr< ns3::Packet const >, uint32_t )', 'ns3::Ipv4L3Protocol::SentTracedCallback')
typehandlers.add_type_alias('void ( * ) ( ns3::Ipv4Header const &, ns3::Ptr< ns3::Packet const >, uint32_t )*', 'ns3::Ipv4L3Protocol::SentTracedCallback*')
typehandlers.add_type_alias('void ( * ) ( ns3::Ipv4Header const &, ns3::Ptr< ns3::Packet const >, uint32_t )&', 'ns3::Ipv4L3Protocol::SentTracedCallback&')
typehandlers.add_type_alias('void ( * ) ( ns3::Ptr< ns3::Packet const >, ns3::Ptr< ns3::Ipv4 >, uint32_t )', 'ns3::Ipv4L3Protocol::TxRxTracedCallback')
typehandlers.add_type_alias('void ( * ) ( ns3::Ptr< ns3::Packet const >, ns3::Ptr< ns3::Ipv4 >, uint32_t )*', 'ns3::Ipv4L3Protocol::TxRxTracedCallback*')
typehandlers.add_type_alias('void ( * ) ( ns3::Ptr< ns3::Packet const >, ns3::Ptr< ns3::Ipv4 >, uint32_t )&', 'ns3::Ipv4L3Protocol::TxRxTracedCallback&')
typehandlers.add_type_alias('void ( * ) ( ns3::Ipv4Header const &, ns3::Ptr< ns3::Packet const >, ns3::Ipv4L3Protocol::DropReason, ns3::Ptr< ns3::Ipv4 >, uint32_t )', 'ns3::Ipv4L3Protocol::DropTracedCallback')
typehandlers.add_type_alias('void ( * ) ( ns3::Ipv4Header const &, ns3::Ptr< ns3::Packet const >, ns3::Ipv4L3Protocol::DropReason, ns3::Ptr< ns3::Ipv4 >, uint32_t )*', 'ns3::Ipv4L3Protocol::DropTracedCallback*')
typehandlers.add_type_alias('void ( * ) ( ns3::Ipv4Header const &, ns3::Ptr< ns3::Packet const >, ns3::Ipv4L3Protocol::DropReason, ns3::Ptr< ns3::Ipv4 >, uint32_t )&', 'ns3::Ipv4L3Protocol::DropTracedCallback&')
## ipv4-address.h (module 'network'): ns3::Ipv4MaskChecker [class]
module.add_class('Ipv4MaskChecker', import_from_module='ns.network', parent=root_module['ns3::AttributeChecker'])
## ipv4-address.h (module 'network'): ns3::Ipv4MaskValue [class]
module.add_class('Ipv4MaskValue', import_from_module='ns.network', parent=root_module['ns3::AttributeValue'])
## ipv4-route.h (module 'internet'): ns3::Ipv4MulticastRoute [class]
module.add_class('Ipv4MulticastRoute', import_from_module='ns.internet', parent=root_module['ns3::SimpleRefCount< ns3::Ipv4MulticastRoute, ns3::empty, ns3::DefaultDeleter<ns3::Ipv4MulticastRoute> >'])
## ipv4-route.h (module 'internet'): ns3::Ipv4Route [class]
module.add_class('Ipv4Route', import_from_module='ns.internet', parent=root_module['ns3::SimpleRefCount< ns3::Ipv4Route, ns3::empty, ns3::DefaultDeleter<ns3::Ipv4Route> >'])
## ipv4-routing-protocol.h (module 'internet'): ns3::Ipv4RoutingProtocol [class]
module.add_class('Ipv4RoutingProtocol', import_from_module='ns.internet', parent=root_module['ns3::Object'])
typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::Ipv4Route >, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ns3::Ipv4RoutingProtocol::UnicastForwardCallback')
typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::Ipv4Route >, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', 'ns3::Ipv4RoutingProtocol::UnicastForwardCallback*')
typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::Ipv4Route >, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', 'ns3::Ipv4RoutingProtocol::UnicastForwardCallback&')
typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::Ipv4MulticastRoute >, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ns3::Ipv4RoutingProtocol::MulticastForwardCallback')
typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::Ipv4MulticastRoute >, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', 'ns3::Ipv4RoutingProtocol::MulticastForwardCallback*')
typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::Ipv4MulticastRoute >, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', 'ns3::Ipv4RoutingProtocol::MulticastForwardCallback&')
typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ns3::Ipv4RoutingProtocol::LocalDeliverCallback')
typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', 'ns3::Ipv4RoutingProtocol::LocalDeliverCallback*')
typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', 'ns3::Ipv4RoutingProtocol::LocalDeliverCallback&')
typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::Socket::SocketErrno, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ns3::Ipv4RoutingProtocol::ErrorCallback')
typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::Socket::SocketErrno, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', 'ns3::Ipv4RoutingProtocol::ErrorCallback*')
typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::Socket::SocketErrno, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', 'ns3::Ipv4RoutingProtocol::ErrorCallback&')
## ipv6-address.h (module 'network'): ns3::Ipv6AddressChecker [class]
module.add_class('Ipv6AddressChecker', import_from_module='ns.network', parent=root_module['ns3::AttributeChecker'])
## ipv6-address.h (module 'network'): ns3::Ipv6AddressValue [class]
module.add_class('Ipv6AddressValue', import_from_module='ns.network', parent=root_module['ns3::AttributeValue'])
## ipv6-address.h (module 'network'): ns3::Ipv6PrefixChecker [class]
module.add_class('Ipv6PrefixChecker', import_from_module='ns.network', parent=root_module['ns3::AttributeChecker'])
## ipv6-address.h (module 'network'): ns3::Ipv6PrefixValue [class]
module.add_class('Ipv6PrefixValue', import_from_module='ns.network', parent=root_module['ns3::AttributeValue'])
## random-variable-stream.h (module 'core'): ns3::LogNormalRandomVariable [class]
module.add_class('LogNormalRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream'])
## mac48-address.h (module 'network'): ns3::Mac48AddressChecker [class]
module.add_class('Mac48AddressChecker', import_from_module='ns.network', parent=root_module['ns3::AttributeChecker'])
## mac48-address.h (module 'network'): ns3::Mac48AddressValue [class]
module.add_class('Mac48AddressValue', import_from_module='ns.network', parent=root_module['ns3::AttributeValue'])
## net-device.h (module 'network'): ns3::NetDevice [class]
module.add_class('NetDevice', import_from_module='ns.network', parent=root_module['ns3::Object'])
## net-device.h (module 'network'): ns3::NetDevice::PacketType [enumeration]
module.add_enum('PacketType', ['PACKET_HOST', 'NS3_PACKET_HOST', 'PACKET_BROADCAST', 'NS3_PACKET_BROADCAST', 'PACKET_MULTICAST', 'NS3_PACKET_MULTICAST', 'PACKET_OTHERHOST', 'NS3_PACKET_OTHERHOST'], outer_class=root_module['ns3::NetDevice'], import_from_module='ns.network')
typehandlers.add_type_alias('void ( * ) ( )', 'ns3::NetDevice::LinkChangeTracedCallback')
typehandlers.add_type_alias('void ( * ) ( )*', 'ns3::NetDevice::LinkChangeTracedCallback*')
typehandlers.add_type_alias('void ( * ) ( )&', 'ns3::NetDevice::LinkChangeTracedCallback&')
typehandlers.add_type_alias('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ns3::NetDevice::ReceiveCallback')
typehandlers.add_type_alias('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', 'ns3::NetDevice::ReceiveCallback*')
typehandlers.add_type_alias('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', 'ns3::NetDevice::ReceiveCallback&')
typehandlers.add_type_alias('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::Address const &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty >', 'ns3::NetDevice::PromiscReceiveCallback')
typehandlers.add_type_alias('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::Address const &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty >*', 'ns3::NetDevice::PromiscReceiveCallback*')
typehandlers.add_type_alias('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::Address const &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty >&', 'ns3::NetDevice::PromiscReceiveCallback&')
## nix-vector.h (module 'network'): ns3::NixVector [class]
module.add_class('NixVector', import_from_module='ns.network', parent=root_module['ns3::SimpleRefCount< ns3::NixVector, ns3::empty, ns3::DefaultDeleter<ns3::NixVector> >'])
## node.h (module 'network'): ns3::Node [class]
module.add_class('Node', import_from_module='ns.network', parent=root_module['ns3::Object'])
typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::Address const &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty >', 'ns3::Node::ProtocolHandler')
typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::Address const &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty >*', 'ns3::Node::ProtocolHandler*')
typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::Address const &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty >&', 'ns3::Node::ProtocolHandler&')
typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::NetDevice >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ns3::Node::DeviceAdditionListener')
typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::NetDevice >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', 'ns3::Node::DeviceAdditionListener*')
typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::NetDevice >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', 'ns3::Node::DeviceAdditionListener&')
## random-variable-stream.h (module 'core'): ns3::NormalRandomVariable [class]
module.add_class('NormalRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream'])
## object-factory.h (module 'core'): ns3::ObjectFactoryChecker [class]
module.add_class('ObjectFactoryChecker', import_from_module='ns.core', parent=root_module['ns3::AttributeChecker'])
## object-factory.h (module 'core'): ns3::ObjectFactoryValue [class]
module.add_class('ObjectFactoryValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue'])
## output-stream-wrapper.h (module 'network'): ns3::OutputStreamWrapper [class]
module.add_class('OutputStreamWrapper', import_from_module='ns.network', parent=root_module['ns3::SimpleRefCount< ns3::OutputStreamWrapper, ns3::empty, ns3::DefaultDeleter<ns3::OutputStreamWrapper> >'])
## packet.h (module 'network'): ns3::Packet [class]
module.add_class('Packet', import_from_module='ns.network', parent=root_module['ns3::SimpleRefCount< ns3::Packet, ns3::empty, ns3::DefaultDeleter<ns3::Packet> >'])
typehandlers.add_type_alias('void ( * ) ( ns3::Ptr< ns3::Packet const > )', 'ns3::Packet::TracedCallback')
typehandlers.add_type_alias('void ( * ) ( ns3::Ptr< ns3::Packet const > )*', 'ns3::Packet::TracedCallback*')
typehandlers.add_type_alias('void ( * ) ( ns3::Ptr< ns3::Packet const > )&', 'ns3::Packet::TracedCallback&')
typehandlers.add_type_alias('void ( * ) ( ns3::Ptr< ns3::Packet const >, ns3::Address const & )', 'ns3::Packet::AddressTracedCallback')
typehandlers.add_type_alias('void ( * ) ( ns3::Ptr< ns3::Packet const >, ns3::Address const & )*', 'ns3::Packet::AddressTracedCallback*')
typehandlers.add_type_alias('void ( * ) ( ns3::Ptr< ns3::Packet const >, ns3::Address const & )&', 'ns3::Packet::AddressTracedCallback&')
typehandlers.add_type_alias('void ( * ) ( ns3::Ptr< ns3::Packet const > const, ns3::Address const &, ns3::Address const & )', 'ns3::Packet::TwoAddressTracedCallback')
typehandlers.add_type_alias('void ( * ) ( ns3::Ptr< ns3::Packet const > const, ns3::Address const &, ns3::Address const & )*', 'ns3::Packet::TwoAddressTracedCallback*')
typehandlers.add_type_alias('void ( * ) ( ns3::Ptr< ns3::Packet const > const, ns3::Address const &, ns3::Address const & )&', 'ns3::Packet::TwoAddressTracedCallback&')
typehandlers.add_type_alias('void ( * ) ( ns3::Ptr< ns3::Packet const >, ns3::Mac48Address )', 'ns3::Packet::Mac48AddressTracedCallback')
typehandlers.add_type_alias('void ( * ) ( ns3::Ptr< ns3::Packet const >, ns3::Mac48Address )*', 'ns3::Packet::Mac48AddressTracedCallback*')
typehandlers.add_type_alias('void ( * ) ( ns3::Ptr< ns3::Packet const >, ns3::Mac48Address )&', 'ns3::Packet::Mac48AddressTracedCallback&')
typehandlers.add_type_alias('void ( * ) ( uint32_t, uint32_t )', 'ns3::Packet::SizeTracedCallback')
typehandlers.add_type_alias('void ( * ) ( uint32_t, uint32_t )*', 'ns3::Packet::SizeTracedCallback*')
typehandlers.add_type_alias('void ( * ) ( uint32_t, uint32_t )&', 'ns3::Packet::SizeTracedCallback&')
typehandlers.add_type_alias('void ( * ) ( ns3::Ptr< ns3::Packet const >, double )', 'ns3::Packet::SinrTracedCallback')
typehandlers.add_type_alias('void ( * ) ( ns3::Ptr< ns3::Packet const >, double )*', 'ns3::Packet::SinrTracedCallback*')
typehandlers.add_type_alias('void ( * ) ( ns3::Ptr< ns3::Packet const >, double )&', 'ns3::Packet::SinrTracedCallback&')
## random-variable-stream.h (module 'core'): ns3::ParetoRandomVariable [class]
module.add_class('ParetoRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream'])
## tcp-l4-protocol.h (module 'internet'): ns3::TcpL4Protocol [class]
module.add_class('TcpL4Protocol', import_from_module='ns.internet', parent=root_module['ns3::IpL4Protocol'])
## nstime.h (module 'core'): ns3::TimeValue [class]
module.add_class('TimeValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue'])
## type-id.h (module 'core'): ns3::TypeIdChecker [class]
module.add_class('TypeIdChecker', import_from_module='ns.core', parent=root_module['ns3::AttributeChecker'])
## type-id.h (module 'core'): ns3::TypeIdValue [class]
module.add_class('TypeIdValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue'])
## udp-l4-protocol.h (module 'internet'): ns3::UdpL4Protocol [class]
module.add_class('UdpL4Protocol', import_from_module='ns.internet', parent=root_module['ns3::IpL4Protocol'])
## uinteger.h (module 'core'): ns3::UintegerValue [class]
module.add_class('UintegerValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue'])
## vht-capabilities.h (module 'wifi'): ns3::VhtCapabilities [class]
module.add_class('VhtCapabilities', import_from_module='ns.wifi', parent=root_module['ns3::WifiInformationElement'])
## wifi-mode.h (module 'wifi'): ns3::WifiModeChecker [class]
module.add_class('WifiModeChecker', import_from_module='ns.wifi', parent=root_module['ns3::AttributeChecker'])
## wifi-mode.h (module 'wifi'): ns3::WifiModeValue [class]
module.add_class('WifiModeValue', import_from_module='ns.wifi', parent=root_module['ns3::AttributeValue'])
## address.h (module 'network'): ns3::AddressChecker [class]
module.add_class('AddressChecker', import_from_module='ns.network', parent=root_module['ns3::AttributeChecker'])
## address.h (module 'network'): ns3::AddressValue [class]
module.add_class('AddressValue', import_from_module='ns.network', parent=root_module['ns3::AttributeValue'])
## callback.h (module 'core'): ns3::CallbackImpl<bool, ns3::Ptr<ns3::Socket>, const ns3::Address &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> [class]
module.add_class('CallbackImpl', import_from_module='ns.core', parent=root_module['ns3::CallbackImplBase'], template_parameters=['bool', 'ns3::Ptr<ns3::Socket>', 'const ns3::Address &', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'])
## callback.h (module 'core'): ns3::CallbackImpl<bool, unsigned short, unsigned char, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> [class]
module.add_class('CallbackImpl', import_from_module='ns.core', parent=root_module['ns3::CallbackImplBase'], template_parameters=['bool', 'unsigned short', 'unsigned char', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'])
## callback.h (module 'core'): ns3::CallbackImpl<ns3::ObjectBase *, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> [class]
module.add_class('CallbackImpl', import_from_module='ns.core', parent=root_module['ns3::CallbackImplBase'], template_parameters=['ns3::ObjectBase *', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'])
## callback.h (module 'core'): ns3::CallbackImpl<unsigned long, const ns3::WifiTxVector &, unsigned short, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> [class]
module.add_class('CallbackImpl', import_from_module='ns.core', parent=root_module['ns3::CallbackImplBase'], template_parameters=['unsigned long', 'const ns3::WifiTxVector &', 'unsigned short', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'])
## callback.h (module 'core'): ns3::CallbackImpl<unsigned long, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> [class]
module.add_class('CallbackImpl', import_from_module='ns.core', parent=root_module['ns3::CallbackImplBase'], template_parameters=['unsigned long', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'])
## callback.h (module 'core'): ns3::CallbackImpl<unsigned long, unsigned short, unsigned short, unsigned char, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> [class]
module.add_class('CallbackImpl', import_from_module='ns.core', parent=root_module['ns3::CallbackImplBase'], template_parameters=['unsigned long', 'unsigned short', 'unsigned short', 'unsigned char', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'])
## callback.h (module 'core'): ns3::CallbackImpl<unsigned short, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> [class]
module.add_class('CallbackImpl', import_from_module='ns.core', parent=root_module['ns3::CallbackImplBase'], template_parameters=['unsigned short', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'])
## callback.h (module 'core'): ns3::CallbackImpl<void, const ns3::Ipv4Header &, ns3::Ptr<const ns3::Packet>, ns3::Ipv4L3Protocol::DropReason, ns3::Ptr<ns3::Ipv4>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty> [class]
module.add_class('CallbackImpl', import_from_module='ns.core', parent=root_module['ns3::CallbackImplBase'], template_parameters=['void', 'const ns3::Ipv4Header &', 'ns3::Ptr<const ns3::Packet>', 'ns3::Ipv4L3Protocol::DropReason', 'ns3::Ptr<ns3::Ipv4>', 'unsigned int', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'])
## callback.h (module 'core'): ns3::CallbackImpl<void, const ns3::Ipv4Header &, ns3::Ptr<const ns3::Packet>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> [class]
module.add_class('CallbackImpl', import_from_module='ns.core', parent=root_module['ns3::CallbackImplBase'], template_parameters=['void', 'const ns3::Ipv4Header &', 'ns3::Ptr<const ns3::Packet>', 'unsigned int', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'])
## callback.h (module 'core'): ns3::CallbackImpl<void, const ns3::WifiMacHeader &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> [class]
module.add_class('CallbackImpl', import_from_module='ns.core', parent=root_module['ns3::CallbackImplBase'], template_parameters=['void', 'const ns3::WifiMacHeader &', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'])
## callback.h (module 'core'): ns3::CallbackImpl<void, const ns3::dsr::DsrOptionSRHeader &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> [class]
module.add_class('CallbackImpl', import_from_module='ns.core', parent=root_module['ns3::CallbackImplBase'], template_parameters=['void', 'const ns3::dsr::DsrOptionSRHeader &', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'])
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Ipv4Address, unsigned char, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> [class]
module.add_class('CallbackImpl', import_from_module='ns.core', parent=root_module['ns3::CallbackImplBase'], template_parameters=['void', 'ns3::Ipv4Address', 'unsigned char', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'])
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Mac48Address, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> [class]
module.add_class('CallbackImpl', import_from_module='ns.core', parent=root_module['ns3::CallbackImplBase'], template_parameters=['void', 'ns3::Mac48Address', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'])
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Ptr<const ns3::Packet>, ns3::Ptr<ns3::Ipv4>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> [class]
module.add_class('CallbackImpl', import_from_module='ns.core', parent=root_module['ns3::CallbackImplBase'], template_parameters=['void', 'ns3::Ptr<const ns3::Packet>', 'ns3::Ptr<ns3::Ipv4>', 'unsigned int', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'])
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Ptr<const ns3::Packet>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> [class]
module.add_class('CallbackImpl', import_from_module='ns.core', parent=root_module['ns3::CallbackImplBase'], template_parameters=['void', 'ns3::Ptr<const ns3::Packet>', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'])
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Ptr<ns3::NetDevice>, ns3::Ptr<const ns3::Packet>, unsigned short, const ns3::Address &, const ns3::Address &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty> [class]
module.add_class('CallbackImpl', import_from_module='ns.core', parent=root_module['ns3::CallbackImplBase'], template_parameters=['void', 'ns3::Ptr<ns3::NetDevice>', 'ns3::Ptr<const ns3::Packet>', 'unsigned short', 'const ns3::Address &', 'const ns3::Address &', 'ns3::NetDevice::PacketType', 'ns3::empty', 'ns3::empty', 'ns3::empty'])
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Ptr<ns3::NetDevice>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> [class]
module.add_class('CallbackImpl', import_from_module='ns.core', parent=root_module['ns3::CallbackImplBase'], template_parameters=['void', 'ns3::Ptr<ns3::NetDevice>', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'])
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Ptr<ns3::Packet>, ns3::Ipv4Address, ns3::Ipv4Address, unsigned char, ns3::Ptr<ns3::Ipv4Route>, ns3::empty, ns3::empty, ns3::empty, ns3::empty> [class]
module.add_class('CallbackImpl', import_from_module='ns.core', parent=root_module['ns3::CallbackImplBase'], template_parameters=['void', 'ns3::Ptr<ns3::Packet>', 'ns3::Ipv4Address', 'ns3::Ipv4Address', 'unsigned char', 'ns3::Ptr<ns3::Ipv4Route>', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'])
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Ptr<ns3::Socket>, const ns3::Address &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> [class]
module.add_class('CallbackImpl', import_from_module='ns.core', parent=root_module['ns3::CallbackImplBase'], template_parameters=['void', 'ns3::Ptr<ns3::Socket>', 'const ns3::Address &', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'])
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Ptr<ns3::Socket>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> [class]
module.add_class('CallbackImpl', import_from_module='ns.core', parent=root_module['ns3::CallbackImplBase'], template_parameters=['void', 'ns3::Ptr<ns3::Socket>', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'])
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Ptr<ns3::Socket>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> [class]
module.add_class('CallbackImpl', import_from_module='ns.core', parent=root_module['ns3::CallbackImplBase'], template_parameters=['void', 'ns3::Ptr<ns3::Socket>', 'unsigned int', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'])
## icmpv4-l4-protocol.h (module 'internet'): ns3::Icmpv4L4Protocol [class]
module.add_class('Icmpv4L4Protocol', import_from_module='ns.internet', parent=root_module['ns3::IpL4Protocol'])
module.add_container('std::list< ns3::BlockAckReqType >', 'ns3::BlockAckReqType', container_type='list')
module.add_container('std::vector< unsigned char >', 'unsigned char', container_type='vector')
module.add_container('std::map< std::string, ns3::LogComponent * >', ('std::string', 'ns3::LogComponent *'), container_type='map')
module.add_container('ns3::WifiModeList', 'ns3::WifiMode', container_type='vector')
module.add_container('std::vector< ns3::Ipv6Address >', 'ns3::Ipv6Address', container_type='vector')
module.add_container('std::unordered_map< ns3::Mac48Address, ns3::WifiRemoteStation *, ns3::WifiAddressHash, std::equal_to< ns3::Mac48Address >, std::allocator< std::pair< ns3::Mac48Address const, ns3::WifiRemoteStation * > > >', ('ns3::Mac48Address', 'ns3::WifiRemoteStation *'), container_type='map')
module.add_container('std::unordered_map< ns3::Mac48Address, ns3::WifiRemoteStationState *, ns3::WifiAddressHash, std::equal_to< ns3::Mac48Address >, std::allocator< std::pair< ns3::Mac48Address const, ns3::WifiRemoteStationState * > > >', ('ns3::Mac48Address', 'ns3::WifiRemoteStationState *'), container_type='map')
module.add_container('std::list< std::pair< ns3::Ptr< ns3::Packet >, ns3::Ipv4Header > >', 'std::pair< ns3::Ptr< ns3::Packet >, ns3::Ipv4Header >', container_type='list')
module.add_container('std::list< ns3::ArpCache::Entry * >', 'ns3::ArpCache::Entry *', container_type='list')
module.add_container('std::map< unsigned int, unsigned int >', ('unsigned int', 'unsigned int'), container_type='map')
typehandlers.add_type_alias('ns3::SequenceNumber< unsigned int, int >', 'ns3::SequenceNumber32')
typehandlers.add_type_alias('ns3::SequenceNumber< unsigned int, int >*', 'ns3::SequenceNumber32*')
typehandlers.add_type_alias('ns3::SequenceNumber< unsigned int, int >&', 'ns3::SequenceNumber32&')
typehandlers.add_type_alias('ns3::SequenceNumber< unsigned short, short >', 'ns3::SequenceNumber16')
typehandlers.add_type_alias('ns3::SequenceNumber< unsigned short, short >*', 'ns3::SequenceNumber16*')
typehandlers.add_type_alias('ns3::SequenceNumber< unsigned short, short >&', 'ns3::SequenceNumber16&')
typehandlers.add_type_alias('ns3::SequenceNumber< unsigned char, signed char >', 'ns3::SequenceNumber8')
typehandlers.add_type_alias('ns3::SequenceNumber< unsigned char, signed char >*', 'ns3::SequenceNumber8*')
typehandlers.add_type_alias('ns3::SequenceNumber< unsigned char, signed char >&', 'ns3::SequenceNumber8&')
typehandlers.add_type_alias('uint8_t', 'ns3::WifiInformationElementId')
typehandlers.add_type_alias('uint8_t*', 'ns3::WifiInformationElementId*')
typehandlers.add_type_alias('uint8_t&', 'ns3::WifiInformationElementId&')
typehandlers.add_type_alias('std::pair< ns3::Mac48Address, unsigned char >', 'ns3::WifiAddressTidPair')
typehandlers.add_type_alias('std::pair< ns3::Mac48Address, unsigned char >*', 'ns3::WifiAddressTidPair*')
typehandlers.add_type_alias('std::pair< ns3::Mac48Address, unsigned char >&', 'ns3::WifiAddressTidPair&')
typehandlers.add_type_alias('std::vector< ns3::WifiMode >', 'ns3::WifiModeList')
typehandlers.add_type_alias('std::vector< ns3::WifiMode >*', 'ns3::WifiModeList*')
typehandlers.add_type_alias('std::vector< ns3::WifiMode >&', 'ns3::WifiModeList&')
typehandlers.add_type_alias('std::vector< ns3::WifiMode > const_iterator', 'ns3::WifiModeListIterator')
typehandlers.add_type_alias('std::vector< ns3::WifiMode > const_iterator*', 'ns3::WifiModeListIterator*')
typehandlers.add_type_alias('std::vector< ns3::WifiMode > const_iterator&', 'ns3::WifiModeListIterator&')
typehandlers.add_type_alias('uint16_t', 'ns3::WifiCodeRate')
typehandlers.add_type_alias('uint16_t*', 'ns3::WifiCodeRate*')
typehandlers.add_type_alias('uint16_t&', 'ns3::WifiCodeRate&')
typehandlers.add_type_alias('void ( * ) ( std::ostream & )', 'ns3::TimePrinter')
typehandlers.add_type_alias('void ( * ) ( std::ostream & )*', 'ns3::TimePrinter*')
typehandlers.add_type_alias('void ( * ) ( std::ostream & )&', 'ns3::TimePrinter&')
typehandlers.add_type_alias('void ( * ) ( std::ostream & )', 'ns3::NodePrinter')
typehandlers.add_type_alias('void ( * ) ( std::ostream & )*', 'ns3::NodePrinter*')
typehandlers.add_type_alias('void ( * ) ( std::ostream & )&', 'ns3::NodePrinter&')
## Register a nested module for the namespace FatalImpl
nested_module = module.add_cpp_namespace('FatalImpl')
register_types_ns3_FatalImpl(nested_module)
## Register a nested module for the namespace Hash
nested_module = module.add_cpp_namespace('Hash')
register_types_ns3_Hash(nested_module)
## Register a nested module for the namespace TracedValueCallback
nested_module = module.add_cpp_namespace('TracedValueCallback')
register_types_ns3_TracedValueCallback(nested_module)
## Register a nested module for the namespace dsr
nested_module = module.add_cpp_namespace('dsr')
register_types_ns3_dsr(nested_module)
## Register a nested module for the namespace internal
nested_module = module.add_cpp_namespace('internal')
register_types_ns3_internal(nested_module)
## Register a nested module for the namespace tests
nested_module = module.add_cpp_namespace('tests')
register_types_ns3_tests(nested_module)
def register_types_ns3_FatalImpl(module):
root_module = module.get_root()
def register_types_ns3_Hash(module):
root_module = module.get_root()
## hash-function.h (module 'core'): ns3::Hash::Implementation [class]
module.add_class('Implementation', import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::Hash::Implementation, ns3::empty, ns3::DefaultDeleter<ns3::Hash::Implementation> >'])
typehandlers.add_type_alias('uint32_t ( * ) ( char const *, std::size_t const )', 'ns3::Hash::Hash32Function_ptr')
typehandlers.add_type_alias('uint32_t ( * ) ( char const *, std::size_t const )*', 'ns3::Hash::Hash32Function_ptr*')
typehandlers.add_type_alias('uint32_t ( * ) ( char const *, std::size_t const )&', 'ns3::Hash::Hash32Function_ptr&')
typehandlers.add_type_alias('uint64_t ( * ) ( char const *, std::size_t const )', 'ns3::Hash::Hash64Function_ptr')
typehandlers.add_type_alias('uint64_t ( * ) ( char const *, std::size_t const )*', 'ns3::Hash::Hash64Function_ptr*')
typehandlers.add_type_alias('uint64_t ( * ) ( char const *, std::size_t const )&', 'ns3::Hash::Hash64Function_ptr&')
## Register a nested module for the namespace Function
nested_module = module.add_cpp_namespace('Function')
register_types_ns3_Hash_Function(nested_module)
def register_types_ns3_Hash_Function(module):
root_module = module.get_root()
## hash-fnv.h (module 'core'): ns3::Hash::Function::Fnv1a [class]
module.add_class('Fnv1a', import_from_module='ns.core', parent=root_module['ns3::Hash::Implementation'])
## hash-function.h (module 'core'): ns3::Hash::Function::Hash32 [class]
module.add_class('Hash32', import_from_module='ns.core', parent=root_module['ns3::Hash::Implementation'])
## hash-function.h (module 'core'): ns3::Hash::Function::Hash64 [class]
module.add_class('Hash64', import_from_module='ns.core', parent=root_module['ns3::Hash::Implementation'])
## hash-murmur3.h (module 'core'): ns3::Hash::Function::Murmur3 [class]
module.add_class('Murmur3', import_from_module='ns.core', parent=root_module['ns3::Hash::Implementation'])
def register_types_ns3_TracedValueCallback(module):
root_module = module.get_root()
typehandlers.add_type_alias('void ( * ) ( ns3::Time, ns3::Time )', 'ns3::TracedValueCallback::Time')
typehandlers.add_type_alias('void ( * ) ( ns3::Time, ns3::Time )*', 'ns3::TracedValueCallback::Time*')
typehandlers.add_type_alias('void ( * ) ( ns3::Time, ns3::Time )&', 'ns3::TracedValueCallback::Time&')
typehandlers.add_type_alias('void ( * ) ( ns3::SequenceNumber32, ns3::SequenceNumber32 )', 'ns3::TracedValueCallback::SequenceNumber32')
typehandlers.add_type_alias('void ( * ) ( ns3::SequenceNumber32, ns3::SequenceNumber32 )*', 'ns3::TracedValueCallback::SequenceNumber32*')
typehandlers.add_type_alias('void ( * ) ( ns3::SequenceNumber32, ns3::SequenceNumber32 )&', 'ns3::TracedValueCallback::SequenceNumber32&')
typehandlers.add_type_alias('void ( * ) ( ns3::DataRate, ns3::DataRate )', 'ns3::TracedValueCallback::DataRate')
typehandlers.add_type_alias('void ( * ) ( ns3::DataRate, ns3::DataRate )*', 'ns3::TracedValueCallback::DataRate*')
typehandlers.add_type_alias('void ( * ) ( ns3::DataRate, ns3::DataRate )&', 'ns3::TracedValueCallback::DataRate&')
def register_types_ns3_dsr(module):
root_module = module.get_root()
## dsr-rreq-table.h (module 'dsr'): ns3::dsr::LinkStates [enumeration]
module.add_enum('LinkStates', ['PROBABLE', 'QUESTIONABLE'])
## dsr-network-queue.h (module 'dsr'): ns3::dsr::DsrMessageType [enumeration]
module.add_enum('DsrMessageType', ['DSR_CONTROL_PACKET', 'DSR_DATA_PACKET'])
## dsr-option-header.h (module 'dsr'): ns3::dsr::ErrorType [enumeration]
module.add_enum('ErrorType', ['NODE_UNREACHABLE', 'FLOW_STATE_NOT_SUPPORTED', 'OPTION_NOT_SUPPORTED'])
## dsr-rreq-table.h (module 'dsr'): ns3::dsr::BlackList [struct]
module.add_class('BlackList')
## dsr-errorbuff.h (module 'dsr'): ns3::dsr::DsrErrorBuffEntry [class]
module.add_class('DsrErrorBuffEntry')
## dsr-errorbuff.h (module 'dsr'): ns3::dsr::DsrErrorBuffer [class]
module.add_class('DsrErrorBuffer')
## dsr-fs-header.h (module 'dsr'): ns3::dsr::DsrFsHeader [class]
module.add_class('DsrFsHeader', parent=root_module['ns3::Header'])
## dsr-gratuitous-reply-table.h (module 'dsr'): ns3::dsr::DsrGraReply [class]
module.add_class('DsrGraReply', parent=root_module['ns3::Object'])
## dsr-rcache.h (module 'dsr'): ns3::dsr::DsrLinkStab [class]
module.add_class('DsrLinkStab')
## dsr-maintain-buff.h (module 'dsr'): ns3::dsr::DsrMaintainBuffEntry [class]
module.add_class('DsrMaintainBuffEntry')
## dsr-maintain-buff.h (module 'dsr'): ns3::dsr::DsrMaintainBuffer [class]
module.add_class('DsrMaintainBuffer')
## dsr-network-queue.h (module 'dsr'): ns3::dsr::DsrNetworkQueue [class]
module.add_class('DsrNetworkQueue', parent=root_module['ns3::Object'])
## dsr-network-queue.h (module 'dsr'): ns3::dsr::DsrNetworkQueueEntry [class]
module.add_class('DsrNetworkQueueEntry')
## dsr-rcache.h (module 'dsr'): ns3::dsr::DsrNodeStab [class]
module.add_class('DsrNodeStab')
## dsr-fs-header.h (module 'dsr'): ns3::dsr::DsrOptionField [class]
module.add_class('DsrOptionField')
## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionHeader [class]
module.add_class('DsrOptionHeader', parent=root_module['ns3::Header'])
## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionHeader::Alignment [struct]
module.add_class('Alignment', outer_class=root_module['ns3::dsr::DsrOptionHeader'])
## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionPad1Header [class]
module.add_class('DsrOptionPad1Header', parent=root_module['ns3::dsr::DsrOptionHeader'])
## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionPadnHeader [class]
module.add_class('DsrOptionPadnHeader', parent=root_module['ns3::dsr::DsrOptionHeader'])
## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionRerrHeader [class]
module.add_class('DsrOptionRerrHeader', parent=root_module['ns3::dsr::DsrOptionHeader'])
## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionRerrUnreachHeader [class]
module.add_class('DsrOptionRerrUnreachHeader', parent=root_module['ns3::dsr::DsrOptionRerrHeader'])
## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionRerrUnsupportHeader [class]
module.add_class('DsrOptionRerrUnsupportHeader', parent=root_module['ns3::dsr::DsrOptionRerrHeader'])
## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionRrepHeader [class]
module.add_class('DsrOptionRrepHeader', parent=root_module['ns3::dsr::DsrOptionHeader'])
## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionRreqHeader [class]
module.add_class('DsrOptionRreqHeader', parent=root_module['ns3::dsr::DsrOptionHeader'])
## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionSRHeader [class]
module.add_class('DsrOptionSRHeader', parent=root_module['ns3::dsr::DsrOptionHeader'])
typehandlers.add_type_alias('void ( * ) ( ns3::dsr::DsrOptionSRHeader const & )', 'ns3::dsr::DsrOptionSRHeader::TracedCallback')
typehandlers.add_type_alias('void ( * ) ( ns3::dsr::DsrOptionSRHeader const & )*', 'ns3::dsr::DsrOptionSRHeader::TracedCallback*')
typehandlers.add_type_alias('void ( * ) ( ns3::dsr::DsrOptionSRHeader const & )&', 'ns3::dsr::DsrOptionSRHeader::TracedCallback&')
## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptions [class]
module.add_class('DsrOptions', parent=root_module['ns3::Object'])
## dsr-passive-buff.h (module 'dsr'): ns3::dsr::DsrPassiveBuffEntry [class]
module.add_class('DsrPassiveBuffEntry')
## dsr-passive-buff.h (module 'dsr'): ns3::dsr::DsrPassiveBuffer [class]
module.add_class('DsrPassiveBuffer', parent=root_module['ns3::Object'])
## dsr-rreq-table.h (module 'dsr'): ns3::dsr::DsrReceivedRreqEntry [class]
module.add_class('DsrReceivedRreqEntry')
## dsr-rcache.h (module 'dsr'): ns3::dsr::DsrRouteCache [class]
module.add_class('DsrRouteCache', parent=root_module['ns3::Object'])
## dsr-rcache.h (module 'dsr'): ns3::dsr::DsrRouteCache::Neighbor [struct]
module.add_class('Neighbor', outer_class=root_module['ns3::dsr::DsrRouteCache'])
typehandlers.add_type_alias('std::list< std::vector< ns3::Ipv4Address > >', 'ns3::dsr::DsrRouteCache::routeVector')
typehandlers.add_type_alias('std::list< std::vector< ns3::Ipv4Address > >*', 'ns3::dsr::DsrRouteCache::routeVector*')
typehandlers.add_type_alias('std::list< std::vector< ns3::Ipv4Address > >&', 'ns3::dsr::DsrRouteCache::routeVector&')
## dsr-rcache.h (module 'dsr'): ns3::dsr::DsrRouteCacheEntry [class]
module.add_class('DsrRouteCacheEntry')
typehandlers.add_type_alias('std::vector< ns3::Ipv4Address >', 'ns3::dsr::DsrRouteCacheEntry::IP_VECTOR')
typehandlers.add_type_alias('std::vector< ns3::Ipv4Address >*', 'ns3::dsr::DsrRouteCacheEntry::IP_VECTOR*')
typehandlers.add_type_alias('std::vector< ns3::Ipv4Address >&', 'ns3::dsr::DsrRouteCacheEntry::IP_VECTOR&')
typehandlers.add_type_alias('std::vector< ns3::Ipv4Address > iterator', 'ns3::dsr::DsrRouteCacheEntry::Iterator')
typehandlers.add_type_alias('std::vector< ns3::Ipv4Address > iterator*', 'ns3::dsr::DsrRouteCacheEntry::Iterator*')
typehandlers.add_type_alias('std::vector< ns3::Ipv4Address > iterator&', 'ns3::dsr::DsrRouteCacheEntry::Iterator&')
## dsr-routing.h (module 'dsr'): ns3::dsr::DsrRouting [class]
module.add_class('DsrRouting', parent=root_module['ns3::IpL4Protocol'])
## dsr-fs-header.h (module 'dsr'): ns3::dsr::DsrRoutingHeader [class]
module.add_class('DsrRoutingHeader', parent=[root_module['ns3::dsr::DsrFsHeader'], root_module['ns3::dsr::DsrOptionField']])
## dsr-rreq-table.h (module 'dsr'): ns3::dsr::DsrRreqTable [class]
module.add_class('DsrRreqTable', parent=root_module['ns3::Object'])
## dsr-rsendbuff.h (module 'dsr'): ns3::dsr::DsrSendBuffEntry [class]
module.add_class('DsrSendBuffEntry')
## dsr-rsendbuff.h (module 'dsr'): ns3::dsr::DsrSendBuffer [class]
module.add_class('DsrSendBuffer')
## dsr-gratuitous-reply-table.h (module 'dsr'): ns3::dsr::GraReplyEntry [struct]
module.add_class('GraReplyEntry')
## dsr-rcache.h (module 'dsr'): ns3::dsr::Link [struct]
module.add_class('Link')
## dsr-maintain-buff.h (module 'dsr'): ns3::dsr::LinkKey [struct]
module.add_class('LinkKey')
## dsr-maintain-buff.h (module 'dsr'): ns3::dsr::NetworkKey [struct]
module.add_class('NetworkKey')
## dsr-maintain-buff.h (module 'dsr'): ns3::dsr::PassiveKey [struct]
module.add_class('PassiveKey')
## dsr-rreq-table.h (module 'dsr'): ns3::dsr::RreqTableEntry [struct]
module.add_class('RreqTableEntry')
## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptionAck [class]
module.add_class('DsrOptionAck', parent=root_module['ns3::dsr::DsrOptions'])
## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionAckHeader [class]
module.add_class('DsrOptionAckHeader', parent=root_module['ns3::dsr::DsrOptionHeader'])
## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptionAckReq [class]
module.add_class('DsrOptionAckReq', parent=root_module['ns3::dsr::DsrOptions'])
## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionAckReqHeader [class]
module.add_class('DsrOptionAckReqHeader', parent=root_module['ns3::dsr::DsrOptionHeader'])
## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptionPad1 [class]
module.add_class('DsrOptionPad1', parent=root_module['ns3::dsr::DsrOptions'])
## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptionPadn [class]
module.add_class('DsrOptionPadn', parent=root_module['ns3::dsr::DsrOptions'])
## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptionRerr [class]
module.add_class('DsrOptionRerr', parent=root_module['ns3::dsr::DsrOptions'])
## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptionRrep [class]
module.add_class('DsrOptionRrep', parent=root_module['ns3::dsr::DsrOptions'])
## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptionRreq [class]
module.add_class('DsrOptionRreq', parent=root_module['ns3::dsr::DsrOptions'])
## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptionSR [class]
module.add_class('DsrOptionSR', parent=root_module['ns3::dsr::DsrOptions'])
module.add_container('std::vector< ns3::dsr::DsrErrorBuffEntry >', 'ns3::dsr::DsrErrorBuffEntry', container_type='vector')
module.add_container('std::vector< ns3::dsr::DsrNetworkQueueEntry >', 'ns3::dsr::DsrNetworkQueueEntry', container_type='vector')
module.add_container('std::vector< ns3::Ipv4Address >', 'ns3::Ipv4Address', container_type='vector')
module.add_container('std::list< ns3::dsr::DsrRouteCacheEntry >', 'ns3::dsr::DsrRouteCacheEntry', container_type='list')
module.add_container('std::list< std::vector< ns3::Ipv4Address > >', 'std::vector< ns3::Ipv4Address >', container_type='list')
module.add_container('ns3::dsr::DsrRouteCacheEntry::IP_VECTOR', 'ns3::Ipv4Address', container_type='vector')
module.add_container('std::vector< ns3::dsr::DsrRouteCache::Neighbor >', 'ns3::dsr::DsrRouteCache::Neighbor', container_type='vector')
module.add_container('std::vector< ns3::Ptr< ns3::ArpCache > >', 'ns3::Ptr< ns3::ArpCache >', container_type='vector')
module.add_container('std::vector< std::string >', 'std::string', container_type='vector')
module.add_container('std::vector< ns3::dsr::DsrSendBuffEntry >', 'ns3::dsr::DsrSendBuffEntry', container_type='vector')
def register_types_ns3_internal(module):
root_module = module.get_root()
def register_types_ns3_tests(module):
root_module = module.get_root()
def register_methods(root_module):
register_Ns3Address_methods(root_module, root_module['ns3::Address'])
register_Ns3AttributeConstructionList_methods(root_module, root_module['ns3::AttributeConstructionList'])
register_Ns3AttributeConstructionListItem_methods(root_module, root_module['ns3::AttributeConstructionList::Item'])
register_Ns3BlockAckReqType_methods(root_module, root_module['ns3::BlockAckReqType'])
register_Ns3BlockAckType_methods(root_module, root_module['ns3::BlockAckType'])
register_Ns3Buffer_methods(root_module, root_module['ns3::Buffer'])
register_Ns3BufferIterator_methods(root_module, root_module['ns3::Buffer::Iterator'])
register_Ns3ByteTagIterator_methods(root_module, root_module['ns3::ByteTagIterator'])
register_Ns3ByteTagIteratorItem_methods(root_module, root_module['ns3::ByteTagIterator::Item'])
register_Ns3ByteTagList_methods(root_module, root_module['ns3::ByteTagList'])
register_Ns3ByteTagListIterator_methods(root_module, root_module['ns3::ByteTagList::Iterator'])
register_Ns3ByteTagListIteratorItem_methods(root_module, root_module['ns3::ByteTagList::Iterator::Item'])
register_Ns3CallbackBase_methods(root_module, root_module['ns3::CallbackBase'])
register_Ns3DataRate_methods(root_module, root_module['ns3::DataRate'])
register_Ns3DefaultDeleter__Ns3AttributeAccessor_methods(root_module, root_module['ns3::DefaultDeleter< ns3::AttributeAccessor >'])
register_Ns3DefaultDeleter__Ns3AttributeChecker_methods(root_module, root_module['ns3::DefaultDeleter< ns3::AttributeChecker >'])
register_Ns3DefaultDeleter__Ns3AttributeValue_methods(root_module, root_module['ns3::DefaultDeleter< ns3::AttributeValue >'])
register_Ns3DefaultDeleter__Ns3CallbackImplBase_methods(root_module, root_module['ns3::DefaultDeleter< ns3::CallbackImplBase >'])
register_Ns3DefaultDeleter__Ns3EventImpl_methods(root_module, root_module['ns3::DefaultDeleter< ns3::EventImpl >'])
register_Ns3DefaultDeleter__Ns3HashImplementation_methods(root_module, root_module['ns3::DefaultDeleter< ns3::Hash::Implementation >'])
register_Ns3DefaultDeleter__Ns3Ipv4Route_methods(root_module, root_module['ns3::DefaultDeleter< ns3::Ipv4Route >'])
register_Ns3DefaultDeleter__Ns3NixVector_methods(root_module, root_module['ns3::DefaultDeleter< ns3::NixVector >'])
register_Ns3DefaultDeleter__Ns3Packet_methods(root_module, root_module['ns3::DefaultDeleter< ns3::Packet >'])
register_Ns3DefaultDeleter__Ns3TraceSourceAccessor_methods(root_module, root_module['ns3::DefaultDeleter< ns3::TraceSourceAccessor >'])
register_Ns3DefaultDeleter__Ns3WifiInformationElement_methods(root_module, root_module['ns3::DefaultDeleter< ns3::WifiInformationElement >'])
register_Ns3DsrHelper_methods(root_module, root_module['ns3::DsrHelper'])
register_Ns3DsrMainHelper_methods(root_module, root_module['ns3::DsrMainHelper'])
register_Ns3EventGarbageCollector_methods(root_module, root_module['ns3::EventGarbageCollector'])
register_Ns3EventId_methods(root_module, root_module['ns3::EventId'])
register_Ns3Hasher_methods(root_module, root_module['ns3::Hasher'])
register_Ns3Inet6SocketAddress_methods(root_module, root_module['ns3::Inet6SocketAddress'])
register_Ns3InetSocketAddress_methods(root_module, root_module['ns3::InetSocketAddress'])
register_Ns3IntToType__0_methods(root_module, root_module['ns3::IntToType< 0 >'])
register_Ns3IntToType__1_methods(root_module, root_module['ns3::IntToType< 1 >'])
register_Ns3IntToType__2_methods(root_module, root_module['ns3::IntToType< 2 >'])
register_Ns3IntToType__3_methods(root_module, root_module['ns3::IntToType< 3 >'])
register_Ns3IntToType__4_methods(root_module, root_module['ns3::IntToType< 4 >'])
register_Ns3IntToType__5_methods(root_module, root_module['ns3::IntToType< 5 >'])
register_Ns3IntToType__6_methods(root_module, root_module['ns3::IntToType< 6 >'])
register_Ns3Ipv4Address_methods(root_module, root_module['ns3::Ipv4Address'])
register_Ns3Ipv4AddressHash_methods(root_module, root_module['ns3::Ipv4AddressHash'])
register_Ns3Ipv4InterfaceAddress_methods(root_module, root_module['ns3::Ipv4InterfaceAddress'])
register_Ns3Ipv4Mask_methods(root_module, root_module['ns3::Ipv4Mask'])
register_Ns3Ipv6Address_methods(root_module, root_module['ns3::Ipv6Address'])
register_Ns3Ipv6AddressHash_methods(root_module, root_module['ns3::Ipv6AddressHash'])
register_Ns3Ipv6Prefix_methods(root_module, root_module['ns3::Ipv6Prefix'])
register_Ns3LogComponent_methods(root_module, root_module['ns3::LogComponent'])
register_Ns3Mac48Address_methods(root_module, root_module['ns3::Mac48Address'])
register_Ns3Mac8Address_methods(root_module, root_module['ns3::Mac8Address'])
register_Ns3NodeContainer_methods(root_module, root_module['ns3::NodeContainer'])
register_Ns3NonCopyable_methods(root_module, root_module['ns3::NonCopyable'])
register_Ns3ObjectBase_methods(root_module, root_module['ns3::ObjectBase'])
register_Ns3ObjectDeleter_methods(root_module, root_module['ns3::ObjectDeleter'])
register_Ns3ObjectFactory_methods(root_module, root_module['ns3::ObjectFactory'])
register_Ns3PacketMetadata_methods(root_module, root_module['ns3::PacketMetadata'])
register_Ns3PacketMetadataItem_methods(root_module, root_module['ns3::PacketMetadata::Item'])
register_Ns3PacketMetadataItemIterator_methods(root_module, root_module['ns3::PacketMetadata::ItemIterator'])
register_Ns3PacketTagIterator_methods(root_module, root_module['ns3::PacketTagIterator'])
register_Ns3PacketTagIteratorItem_methods(root_module, root_module['ns3::PacketTagIterator::Item'])
register_Ns3PacketTagList_methods(root_module, root_module['ns3::PacketTagList'])
register_Ns3PacketTagListTagData_methods(root_module, root_module['ns3::PacketTagList::TagData'])
register_Ns3ParameterLogger_methods(root_module, root_module['ns3::ParameterLogger'])
register_Ns3SimpleRefCount__Ns3Object_Ns3ObjectBase_Ns3ObjectDeleter_methods(root_module, root_module['ns3::SimpleRefCount< ns3::Object, ns3::ObjectBase, ns3::ObjectDeleter >'])
register_Ns3Simulator_methods(root_module, root_module['ns3::Simulator'])
register_Ns3SystemWallClockMs_methods(root_module, root_module['ns3::SystemWallClockMs'])
register_Ns3Tag_methods(root_module, root_module['ns3::Tag'])
register_Ns3TagBuffer_methods(root_module, root_module['ns3::TagBuffer'])
register_Ns3Time_methods(root_module, root_module['ns3::Time'])
register_Ns3TimeWithUnit_methods(root_module, root_module['ns3::TimeWithUnit'])
register_Ns3Timer_methods(root_module, root_module['ns3::Timer'])
register_Ns3TimerImpl_methods(root_module, root_module['ns3::TimerImpl'])
register_Ns3TypeId_methods(root_module, root_module['ns3::TypeId'])
register_Ns3TypeIdAttributeInformation_methods(root_module, root_module['ns3::TypeId::AttributeInformation'])
register_Ns3TypeIdTraceSourceInformation_methods(root_module, root_module['ns3::TypeId::TraceSourceInformation'])
register_Ns3WifiAc_methods(root_module, root_module['ns3::WifiAc'])
register_Ns3WifiAddressHash_methods(root_module, root_module['ns3::WifiAddressHash'])
register_Ns3WifiAddressTidHash_methods(root_module, root_module['ns3::WifiAddressTidHash'])
register_Ns3WifiMode_methods(root_module, root_module['ns3::WifiMode'])
register_Ns3WifiModeFactory_methods(root_module, root_module['ns3::WifiModeFactory'])
register_Ns3WifiRemoteStation_methods(root_module, root_module['ns3::WifiRemoteStation'])
register_Ns3WifiRemoteStationInfo_methods(root_module, root_module['ns3::WifiRemoteStationInfo'])
register_Ns3WifiRemoteStationState_methods(root_module, root_module['ns3::WifiRemoteStationState'])
register_Ns3WifiStandardInfo_methods(root_module, root_module['ns3::WifiStandardInfo'])
register_Ns3Empty_methods(root_module, root_module['ns3::empty'])
register_Ns3Int64x64_t_methods(root_module, root_module['ns3::int64x64_t'])
register_Ns3Chunk_methods(root_module, root_module['ns3::Chunk'])
register_Ns3Header_methods(root_module, root_module['ns3::Header'])
register_Ns3Icmpv4DestinationUnreachable_methods(root_module, root_module['ns3::Icmpv4DestinationUnreachable'])
register_Ns3Icmpv4Echo_methods(root_module, root_module['ns3::Icmpv4Echo'])
register_Ns3Icmpv4Header_methods(root_module, root_module['ns3::Icmpv4Header'])
register_Ns3Icmpv4TimeExceeded_methods(root_module, root_module['ns3::Icmpv4TimeExceeded'])
register_Ns3Ipv4Header_methods(root_module, root_module['ns3::Ipv4Header'])
register_Ns3Ipv6Header_methods(root_module, root_module['ns3::Ipv6Header'])
register_Ns3Object_methods(root_module, root_module['ns3::Object'])
register_Ns3ObjectAggregateIterator_methods(root_module, root_module['ns3::Object::AggregateIterator'])
register_Ns3RandomVariableStream_methods(root_module, root_module['ns3::RandomVariableStream'])
register_Ns3SequentialRandomVariable_methods(root_module, root_module['ns3::SequentialRandomVariable'])
register_Ns3SimpleRefCount__Ns3AttributeAccessor_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeAccessor__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter<ns3::AttributeAccessor> >'])
register_Ns3SimpleRefCount__Ns3AttributeChecker_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeChecker__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::AttributeChecker, ns3::empty, ns3::DefaultDeleter<ns3::AttributeChecker> >'])
register_Ns3SimpleRefCount__Ns3AttributeValue_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeValue__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::AttributeValue, ns3::empty, ns3::DefaultDeleter<ns3::AttributeValue> >'])
register_Ns3SimpleRefCount__Ns3CallbackImplBase_Ns3Empty_Ns3DefaultDeleter__lt__ns3CallbackImplBase__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::CallbackImplBase, ns3::empty, ns3::DefaultDeleter<ns3::CallbackImplBase> >'])
register_Ns3SimpleRefCount__Ns3EventImpl_Ns3Empty_Ns3DefaultDeleter__lt__ns3EventImpl__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::EventImpl, ns3::empty, ns3::DefaultDeleter<ns3::EventImpl> >'])
register_Ns3SimpleRefCount__Ns3HashImplementation_Ns3Empty_Ns3DefaultDeleter__lt__ns3HashImplementation__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::Hash::Implementation, ns3::empty, ns3::DefaultDeleter<ns3::Hash::Implementation> >'])
register_Ns3SimpleRefCount__Ns3Ipv4MulticastRoute_Ns3Empty_Ns3DefaultDeleter__lt__ns3Ipv4MulticastRoute__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::Ipv4MulticastRoute, ns3::empty, ns3::DefaultDeleter<ns3::Ipv4MulticastRoute> >'])
register_Ns3SimpleRefCount__Ns3Ipv4Route_Ns3Empty_Ns3DefaultDeleter__lt__ns3Ipv4Route__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::Ipv4Route, ns3::empty, ns3::DefaultDeleter<ns3::Ipv4Route> >'])
register_Ns3SimpleRefCount__Ns3NixVector_Ns3Empty_Ns3DefaultDeleter__lt__ns3NixVector__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::NixVector, ns3::empty, ns3::DefaultDeleter<ns3::NixVector> >'])
register_Ns3SimpleRefCount__Ns3OutputStreamWrapper_Ns3Empty_Ns3DefaultDeleter__lt__ns3OutputStreamWrapper__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::OutputStreamWrapper, ns3::empty, ns3::DefaultDeleter<ns3::OutputStreamWrapper> >'])
register_Ns3SimpleRefCount__Ns3Packet_Ns3Empty_Ns3DefaultDeleter__lt__ns3Packet__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::Packet, ns3::empty, ns3::DefaultDeleter<ns3::Packet> >'])
register_Ns3SimpleRefCount__Ns3TraceSourceAccessor_Ns3Empty_Ns3DefaultDeleter__lt__ns3TraceSourceAccessor__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter<ns3::TraceSourceAccessor> >'])
register_Ns3SimpleRefCount__Ns3WifiInformationElement_Ns3Empty_Ns3DefaultDeleter__lt__ns3WifiInformationElement__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::WifiInformationElement, ns3::empty, ns3::DefaultDeleter<ns3::WifiInformationElement> >'])
register_Ns3Socket_methods(root_module, root_module['ns3::Socket'])
register_Ns3SocketIpTosTag_methods(root_module, root_module['ns3::SocketIpTosTag'])
register_Ns3SocketIpTtlTag_methods(root_module, root_module['ns3::SocketIpTtlTag'])
register_Ns3SocketIpv6HopLimitTag_methods(root_module, root_module['ns3::SocketIpv6HopLimitTag'])
register_Ns3SocketIpv6TclassTag_methods(root_module, root_module['ns3::SocketIpv6TclassTag'])
register_Ns3SocketPriorityTag_methods(root_module, root_module['ns3::SocketPriorityTag'])
register_Ns3SocketSetDontFragmentTag_methods(root_module, root_module['ns3::SocketSetDontFragmentTag'])
register_Ns3TraceSourceAccessor_methods(root_module, root_module['ns3::TraceSourceAccessor'])
register_Ns3Trailer_methods(root_module, root_module['ns3::Trailer'])
register_Ns3TriangularRandomVariable_methods(root_module, root_module['ns3::TriangularRandomVariable'])
register_Ns3UniformRandomVariable_methods(root_module, root_module['ns3::UniformRandomVariable'])
register_Ns3WeibullRandomVariable_methods(root_module, root_module['ns3::WeibullRandomVariable'])
register_Ns3WifiInformationElement_methods(root_module, root_module['ns3::WifiInformationElement'])
register_Ns3WifiMac_methods(root_module, root_module['ns3::WifiMac'])
register_Ns3WifiRemoteStationManager_methods(root_module, root_module['ns3::WifiRemoteStationManager'])
register_Ns3ZetaRandomVariable_methods(root_module, root_module['ns3::ZetaRandomVariable'])
register_Ns3ZipfRandomVariable_methods(root_module, root_module['ns3::ZipfRandomVariable'])
register_Ns3ArpCache_methods(root_module, root_module['ns3::ArpCache'])
register_Ns3ArpCacheEntry_methods(root_module, root_module['ns3::ArpCache::Entry'])
register_Ns3AttributeAccessor_methods(root_module, root_module['ns3::AttributeAccessor'])
register_Ns3AttributeChecker_methods(root_module, root_module['ns3::AttributeChecker'])
register_Ns3AttributeValue_methods(root_module, root_module['ns3::AttributeValue'])
register_Ns3CallbackChecker_methods(root_module, root_module['ns3::CallbackChecker'])
register_Ns3CallbackImplBase_methods(root_module, root_module['ns3::CallbackImplBase'])
register_Ns3CallbackValue_methods(root_module, root_module['ns3::CallbackValue'])
register_Ns3ConstantRandomVariable_methods(root_module, root_module['ns3::ConstantRandomVariable'])
register_Ns3DataRateChecker_methods(root_module, root_module['ns3::DataRateChecker'])
register_Ns3DataRateValue_methods(root_module, root_module['ns3::DataRateValue'])
register_Ns3DeterministicRandomVariable_methods(root_module, root_module['ns3::DeterministicRandomVariable'])
register_Ns3EmpiricalRandomVariable_methods(root_module, root_module['ns3::EmpiricalRandomVariable'])
register_Ns3EmptyAttributeAccessor_methods(root_module, root_module['ns3::EmptyAttributeAccessor'])
register_Ns3EmptyAttributeChecker_methods(root_module, root_module['ns3::EmptyAttributeChecker'])
register_Ns3EmptyAttributeValue_methods(root_module, root_module['ns3::EmptyAttributeValue'])
register_Ns3EnumChecker_methods(root_module, root_module['ns3::EnumChecker'])
register_Ns3EnumValue_methods(root_module, root_module['ns3::EnumValue'])
register_Ns3ErlangRandomVariable_methods(root_module, root_module['ns3::ErlangRandomVariable'])
register_Ns3EventImpl_methods(root_module, root_module['ns3::EventImpl'])
register_Ns3ExponentialRandomVariable_methods(root_module, root_module['ns3::ExponentialRandomVariable'])
register_Ns3GammaRandomVariable_methods(root_module, root_module['ns3::GammaRandomVariable'])
register_Ns3HeCapabilities_methods(root_module, root_module['ns3::HeCapabilities'])
register_Ns3HtCapabilities_methods(root_module, root_module['ns3::HtCapabilities'])
register_Ns3IpL4Protocol_methods(root_module, root_module['ns3::IpL4Protocol'])
register_Ns3Ipv4_methods(root_module, root_module['ns3::Ipv4'])
register_Ns3Ipv4AddressChecker_methods(root_module, root_module['ns3::Ipv4AddressChecker'])
register_Ns3Ipv4AddressValue_methods(root_module, root_module['ns3::Ipv4AddressValue'])
register_Ns3Ipv4Interface_methods(root_module, root_module['ns3::Ipv4Interface'])
register_Ns3Ipv4L3Protocol_methods(root_module, root_module['ns3::Ipv4L3Protocol'])
register_Ns3Ipv4MaskChecker_methods(root_module, root_module['ns3::Ipv4MaskChecker'])
register_Ns3Ipv4MaskValue_methods(root_module, root_module['ns3::Ipv4MaskValue'])
register_Ns3Ipv4MulticastRoute_methods(root_module, root_module['ns3::Ipv4MulticastRoute'])
register_Ns3Ipv4Route_methods(root_module, root_module['ns3::Ipv4Route'])
register_Ns3Ipv4RoutingProtocol_methods(root_module, root_module['ns3::Ipv4RoutingProtocol'])
register_Ns3Ipv6AddressChecker_methods(root_module, root_module['ns3::Ipv6AddressChecker'])
register_Ns3Ipv6AddressValue_methods(root_module, root_module['ns3::Ipv6AddressValue'])
register_Ns3Ipv6PrefixChecker_methods(root_module, root_module['ns3::Ipv6PrefixChecker'])
register_Ns3Ipv6PrefixValue_methods(root_module, root_module['ns3::Ipv6PrefixValue'])
register_Ns3LogNormalRandomVariable_methods(root_module, root_module['ns3::LogNormalRandomVariable'])
register_Ns3Mac48AddressChecker_methods(root_module, root_module['ns3::Mac48AddressChecker'])
register_Ns3Mac48AddressValue_methods(root_module, root_module['ns3::Mac48AddressValue'])
register_Ns3NetDevice_methods(root_module, root_module['ns3::NetDevice'])
register_Ns3NixVector_methods(root_module, root_module['ns3::NixVector'])
register_Ns3Node_methods(root_module, root_module['ns3::Node'])
register_Ns3NormalRandomVariable_methods(root_module, root_module['ns3::NormalRandomVariable'])
register_Ns3ObjectFactoryChecker_methods(root_module, root_module['ns3::ObjectFactoryChecker'])
register_Ns3ObjectFactoryValue_methods(root_module, root_module['ns3::ObjectFactoryValue'])
register_Ns3OutputStreamWrapper_methods(root_module, root_module['ns3::OutputStreamWrapper'])
register_Ns3Packet_methods(root_module, root_module['ns3::Packet'])
register_Ns3ParetoRandomVariable_methods(root_module, root_module['ns3::ParetoRandomVariable'])
register_Ns3TcpL4Protocol_methods(root_module, root_module['ns3::TcpL4Protocol'])
register_Ns3TimeValue_methods(root_module, root_module['ns3::TimeValue'])
register_Ns3TypeIdChecker_methods(root_module, root_module['ns3::TypeIdChecker'])
register_Ns3TypeIdValue_methods(root_module, root_module['ns3::TypeIdValue'])
register_Ns3UdpL4Protocol_methods(root_module, root_module['ns3::UdpL4Protocol'])
register_Ns3UintegerValue_methods(root_module, root_module['ns3::UintegerValue'])
register_Ns3VhtCapabilities_methods(root_module, root_module['ns3::VhtCapabilities'])
register_Ns3WifiModeChecker_methods(root_module, root_module['ns3::WifiModeChecker'])
register_Ns3WifiModeValue_methods(root_module, root_module['ns3::WifiModeValue'])
register_Ns3AddressChecker_methods(root_module, root_module['ns3::AddressChecker'])
register_Ns3AddressValue_methods(root_module, root_module['ns3::AddressValue'])
register_Ns3CallbackImpl__Bool_Ns3Ptr__lt__ns3Socket__gt___Const_ns3Address___amp___Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< bool, ns3::Ptr<ns3::Socket>, const ns3::Address &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >'])
register_Ns3CallbackImpl__Bool_Unsigned_short_Unsigned_char_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< bool, unsigned short, unsigned char, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >'])
register_Ns3CallbackImpl__Ns3ObjectBase___star___Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< ns3::ObjectBase *, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >'])
register_Ns3CallbackImpl__Unsigned_long_Const_ns3WifiTxVector___amp___Unsigned_short_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< unsigned long, const ns3::WifiTxVector &, unsigned short, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >'])
register_Ns3CallbackImpl__Unsigned_long_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< unsigned long, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >'])
register_Ns3CallbackImpl__Unsigned_long_Unsigned_short_Unsigned_short_Unsigned_char_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< unsigned long, unsigned short, unsigned short, unsigned char, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >'])
register_Ns3CallbackImpl__Unsigned_short_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< unsigned short, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >'])
register_Ns3CallbackImpl__Void_Const_ns3Ipv4Header___amp___Ns3Ptr__lt__const_ns3Packet__gt___Ns3Ipv4L3ProtocolDropReason_Ns3Ptr__lt__ns3Ipv4__gt___Unsigned_int_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, const ns3::Ipv4Header &, ns3::Ptr<const ns3::Packet>, ns3::Ipv4L3Protocol::DropReason, ns3::Ptr<ns3::Ipv4>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty >'])
register_Ns3CallbackImpl__Void_Const_ns3Ipv4Header___amp___Ns3Ptr__lt__const_ns3Packet__gt___Unsigned_int_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, const ns3::Ipv4Header &, ns3::Ptr<const ns3::Packet>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >'])
register_Ns3CallbackImpl__Void_Const_ns3WifiMacHeader___amp___Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, const ns3::WifiMacHeader &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >'])
register_Ns3CallbackImpl__Void_Const_ns3DsrDsrOptionSRHeader___amp___Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, const ns3::dsr::DsrOptionSRHeader &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >'])
register_Ns3CallbackImpl__Void_Ns3Ipv4Address_Unsigned_char_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, ns3::Ipv4Address, unsigned char, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >'])
register_Ns3CallbackImpl__Void_Ns3Mac48Address_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, ns3::Mac48Address, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >'])
register_Ns3CallbackImpl__Void_Ns3Ptr__lt__const_ns3Packet__gt___Ns3Ptr__lt__ns3Ipv4__gt___Unsigned_int_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, ns3::Ptr<const ns3::Packet>, ns3::Ptr<ns3::Ipv4>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >'])
register_Ns3CallbackImpl__Void_Ns3Ptr__lt__const_ns3Packet__gt___Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, ns3::Ptr<const ns3::Packet>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >'])
register_Ns3CallbackImpl__Void_Ns3Ptr__lt__ns3NetDevice__gt___Ns3Ptr__lt__const_ns3Packet__gt___Unsigned_short_Const_ns3Address___amp___Const_ns3Address___amp___Ns3NetDevicePacketType_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, ns3::Ptr<ns3::NetDevice>, ns3::Ptr<const ns3::Packet>, unsigned short, const ns3::Address &, const ns3::Address &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty >'])
register_Ns3CallbackImpl__Void_Ns3Ptr__lt__ns3NetDevice__gt___Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, ns3::Ptr<ns3::NetDevice>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >'])
register_Ns3CallbackImpl__Void_Ns3Ptr__lt__ns3Packet__gt___Ns3Ipv4Address_Ns3Ipv4Address_Unsigned_char_Ns3Ptr__lt__ns3Ipv4Route__gt___Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, ns3::Ptr<ns3::Packet>, ns3::Ipv4Address, ns3::Ipv4Address, unsigned char, ns3::Ptr<ns3::Ipv4Route>, ns3::empty, ns3::empty, ns3::empty, ns3::empty >'])
register_Ns3CallbackImpl__Void_Ns3Ptr__lt__ns3Socket__gt___Const_ns3Address___amp___Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, ns3::Ptr<ns3::Socket>, const ns3::Address &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >'])
register_Ns3CallbackImpl__Void_Ns3Ptr__lt__ns3Socket__gt___Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, ns3::Ptr<ns3::Socket>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >'])
register_Ns3CallbackImpl__Void_Ns3Ptr__lt__ns3Socket__gt___Unsigned_int_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, ns3::Ptr<ns3::Socket>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >'])
register_Ns3Icmpv4L4Protocol_methods(root_module, root_module['ns3::Icmpv4L4Protocol'])
register_Ns3HashImplementation_methods(root_module, root_module['ns3::Hash::Implementation'])
register_Ns3HashFunctionFnv1a_methods(root_module, root_module['ns3::Hash::Function::Fnv1a'])
register_Ns3HashFunctionHash32_methods(root_module, root_module['ns3::Hash::Function::Hash32'])
register_Ns3HashFunctionHash64_methods(root_module, root_module['ns3::Hash::Function::Hash64'])
register_Ns3HashFunctionMurmur3_methods(root_module, root_module['ns3::Hash::Function::Murmur3'])
register_Ns3DsrBlackList_methods(root_module, root_module['ns3::dsr::BlackList'])
register_Ns3DsrDsrErrorBuffEntry_methods(root_module, root_module['ns3::dsr::DsrErrorBuffEntry'])
register_Ns3DsrDsrErrorBuffer_methods(root_module, root_module['ns3::dsr::DsrErrorBuffer'])
register_Ns3DsrDsrFsHeader_methods(root_module, root_module['ns3::dsr::DsrFsHeader'])
register_Ns3DsrDsrGraReply_methods(root_module, root_module['ns3::dsr::DsrGraReply'])
register_Ns3DsrDsrLinkStab_methods(root_module, root_module['ns3::dsr::DsrLinkStab'])
register_Ns3DsrDsrMaintainBuffEntry_methods(root_module, root_module['ns3::dsr::DsrMaintainBuffEntry'])
register_Ns3DsrDsrMaintainBuffer_methods(root_module, root_module['ns3::dsr::DsrMaintainBuffer'])
register_Ns3DsrDsrNetworkQueue_methods(root_module, root_module['ns3::dsr::DsrNetworkQueue'])
register_Ns3DsrDsrNetworkQueueEntry_methods(root_module, root_module['ns3::dsr::DsrNetworkQueueEntry'])
register_Ns3DsrDsrNodeStab_methods(root_module, root_module['ns3::dsr::DsrNodeStab'])
register_Ns3DsrDsrOptionField_methods(root_module, root_module['ns3::dsr::DsrOptionField'])
register_Ns3DsrDsrOptionHeader_methods(root_module, root_module['ns3::dsr::DsrOptionHeader'])
register_Ns3DsrDsrOptionHeaderAlignment_methods(root_module, root_module['ns3::dsr::DsrOptionHeader::Alignment'])
register_Ns3DsrDsrOptionPad1Header_methods(root_module, root_module['ns3::dsr::DsrOptionPad1Header'])
register_Ns3DsrDsrOptionPadnHeader_methods(root_module, root_module['ns3::dsr::DsrOptionPadnHeader'])
register_Ns3DsrDsrOptionRerrHeader_methods(root_module, root_module['ns3::dsr::DsrOptionRerrHeader'])
register_Ns3DsrDsrOptionRerrUnreachHeader_methods(root_module, root_module['ns3::dsr::DsrOptionRerrUnreachHeader'])
register_Ns3DsrDsrOptionRerrUnsupportHeader_methods(root_module, root_module['ns3::dsr::DsrOptionRerrUnsupportHeader'])
register_Ns3DsrDsrOptionRrepHeader_methods(root_module, root_module['ns3::dsr::DsrOptionRrepHeader'])
register_Ns3DsrDsrOptionRreqHeader_methods(root_module, root_module['ns3::dsr::DsrOptionRreqHeader'])
register_Ns3DsrDsrOptionSRHeader_methods(root_module, root_module['ns3::dsr::DsrOptionSRHeader'])
register_Ns3DsrDsrOptions_methods(root_module, root_module['ns3::dsr::DsrOptions'])
register_Ns3DsrDsrPassiveBuffEntry_methods(root_module, root_module['ns3::dsr::DsrPassiveBuffEntry'])
register_Ns3DsrDsrPassiveBuffer_methods(root_module, root_module['ns3::dsr::DsrPassiveBuffer'])
register_Ns3DsrDsrReceivedRreqEntry_methods(root_module, root_module['ns3::dsr::DsrReceivedRreqEntry'])
register_Ns3DsrDsrRouteCache_methods(root_module, root_module['ns3::dsr::DsrRouteCache'])
register_Ns3DsrDsrRouteCacheNeighbor_methods(root_module, root_module['ns3::dsr::DsrRouteCache::Neighbor'])
register_Ns3DsrDsrRouteCacheEntry_methods(root_module, root_module['ns3::dsr::DsrRouteCacheEntry'])
register_Ns3DsrDsrRouting_methods(root_module, root_module['ns3::dsr::DsrRouting'])
register_Ns3DsrDsrRoutingHeader_methods(root_module, root_module['ns3::dsr::DsrRoutingHeader'])
register_Ns3DsrDsrRreqTable_methods(root_module, root_module['ns3::dsr::DsrRreqTable'])
register_Ns3DsrDsrSendBuffEntry_methods(root_module, root_module['ns3::dsr::DsrSendBuffEntry'])
register_Ns3DsrDsrSendBuffer_methods(root_module, root_module['ns3::dsr::DsrSendBuffer'])
register_Ns3DsrGraReplyEntry_methods(root_module, root_module['ns3::dsr::GraReplyEntry'])
register_Ns3DsrLink_methods(root_module, root_module['ns3::dsr::Link'])
register_Ns3DsrLinkKey_methods(root_module, root_module['ns3::dsr::LinkKey'])
register_Ns3DsrNetworkKey_methods(root_module, root_module['ns3::dsr::NetworkKey'])
register_Ns3DsrPassiveKey_methods(root_module, root_module['ns3::dsr::PassiveKey'])
register_Ns3DsrRreqTableEntry_methods(root_module, root_module['ns3::dsr::RreqTableEntry'])
register_Ns3DsrDsrOptionAck_methods(root_module, root_module['ns3::dsr::DsrOptionAck'])
register_Ns3DsrDsrOptionAckHeader_methods(root_module, root_module['ns3::dsr::DsrOptionAckHeader'])
register_Ns3DsrDsrOptionAckReq_methods(root_module, root_module['ns3::dsr::DsrOptionAckReq'])
register_Ns3DsrDsrOptionAckReqHeader_methods(root_module, root_module['ns3::dsr::DsrOptionAckReqHeader'])
register_Ns3DsrDsrOptionPad1_methods(root_module, root_module['ns3::dsr::DsrOptionPad1'])
register_Ns3DsrDsrOptionPadn_methods(root_module, root_module['ns3::dsr::DsrOptionPadn'])
register_Ns3DsrDsrOptionRerr_methods(root_module, root_module['ns3::dsr::DsrOptionRerr'])
register_Ns3DsrDsrOptionRrep_methods(root_module, root_module['ns3::dsr::DsrOptionRrep'])
register_Ns3DsrDsrOptionRreq_methods(root_module, root_module['ns3::dsr::DsrOptionRreq'])
register_Ns3DsrDsrOptionSR_methods(root_module, root_module['ns3::dsr::DsrOptionSR'])
return
def register_Ns3Address_methods(root_module, cls):
cls.add_binary_comparison_operator('==')
cls.add_binary_comparison_operator('!=')
cls.add_binary_comparison_operator('<')
cls.add_output_stream_operator()
## address.h (module 'network'): ns3::Address::Address() [constructor]
cls.add_constructor([])
## address.h (module 'network'): ns3::Address::Address(uint8_t type, uint8_t const * buffer, uint8_t len) [constructor]
cls.add_constructor([param('uint8_t', 'type'), param('uint8_t const *', 'buffer'), param('uint8_t', 'len')])
## address.h (module 'network'): ns3::Address::Address(ns3::Address const & address) [constructor]
cls.add_constructor([param('ns3::Address const &', 'address')])
## address.h (module 'network'): bool ns3::Address::CheckCompatible(uint8_t type, uint8_t len) const [member function]
cls.add_method('CheckCompatible',
'bool',
[param('uint8_t', 'type'), param('uint8_t', 'len')],
is_const=True)
## address.h (module 'network'): uint32_t ns3::Address::CopyAllFrom(uint8_t const * buffer, uint8_t len) [member function]
cls.add_method('CopyAllFrom',
'uint32_t',
[param('uint8_t const *', 'buffer'), param('uint8_t', 'len')])
## address.h (module 'network'): uint32_t ns3::Address::CopyAllTo(uint8_t * buffer, uint8_t len) const [member function]
cls.add_method('CopyAllTo',
'uint32_t',
[param('uint8_t *', 'buffer'), param('uint8_t', 'len')],
is_const=True)
## address.h (module 'network'): uint32_t ns3::Address::CopyFrom(uint8_t const * buffer, uint8_t len) [member function]
cls.add_method('CopyFrom',
'uint32_t',
[param('uint8_t const *', 'buffer'), param('uint8_t', 'len')])
## address.h (module 'network'): uint32_t ns3::Address::CopyTo(uint8_t * buffer) const [member function]
cls.add_method('CopyTo',
'uint32_t',
[param('uint8_t *', 'buffer')],
is_const=True)
## address.h (module 'network'): void ns3::Address::Deserialize(ns3::TagBuffer buffer) [member function]
cls.add_method('Deserialize',
'void',
[param('ns3::TagBuffer', 'buffer')])
## address.h (module 'network'): uint8_t ns3::Address::GetLength() const [member function]
cls.add_method('GetLength',
'uint8_t',
[],
is_const=True)
## address.h (module 'network'): uint32_t ns3::Address::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True)
## address.h (module 'network'): bool ns3::Address::IsInvalid() const [member function]
cls.add_method('IsInvalid',
'bool',
[],
is_const=True)
## address.h (module 'network'): bool ns3::Address::IsMatchingType(uint8_t type) const [member function]
cls.add_method('IsMatchingType',
'bool',
[param('uint8_t', 'type')],
is_const=True)
## address.h (module 'network'): static uint8_t ns3::Address::Register() [member function]
cls.add_method('Register',
'uint8_t',
[],
is_static=True)
## address.h (module 'network'): void ns3::Address::Serialize(ns3::TagBuffer buffer) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::TagBuffer', 'buffer')],
is_const=True)
return
def register_Ns3AttributeConstructionList_methods(root_module, cls):
## attribute-construction-list.h (module 'core'): ns3::AttributeConstructionList::AttributeConstructionList(ns3::AttributeConstructionList const & arg0) [constructor]
cls.add_constructor([param('ns3::AttributeConstructionList const &', 'arg0')])
## attribute-construction-list.h (module 'core'): ns3::AttributeConstructionList::AttributeConstructionList() [constructor]
cls.add_constructor([])
## attribute-construction-list.h (module 'core'): void ns3::AttributeConstructionList::Add(std::string name, ns3::Ptr<const ns3::AttributeChecker> checker, ns3::Ptr<ns3::AttributeValue> value) [member function]
cls.add_method('Add',
'void',
[param('std::string', 'name'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker'), param('ns3::Ptr< ns3::AttributeValue >', 'value')])
## attribute-construction-list.h (module 'core'): ns3::AttributeConstructionList::CIterator ns3::AttributeConstructionList::Begin() const [member function]
cls.add_method('Begin',
'ns3::AttributeConstructionList::CIterator',
[],
is_const=True)
## attribute-construction-list.h (module 'core'): ns3::AttributeConstructionList::CIterator ns3::AttributeConstructionList::End() const [member function]
cls.add_method('End',
'ns3::AttributeConstructionList::CIterator',
[],
is_const=True)
## attribute-construction-list.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::AttributeConstructionList::Find(ns3::Ptr<const ns3::AttributeChecker> checker) const [member function]
cls.add_method('Find',
'ns3::Ptr< ns3::AttributeValue >',
[param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_const=True)
return
def register_Ns3AttributeConstructionListItem_methods(root_module, cls):
## attribute-construction-list.h (module 'core'): ns3::AttributeConstructionList::Item::Item() [constructor]
cls.add_constructor([])
## attribute-construction-list.h (module 'core'): ns3::AttributeConstructionList::Item::Item(ns3::AttributeConstructionList::Item const & arg0) [constructor]
cls.add_constructor([param('ns3::AttributeConstructionList::Item const &', 'arg0')])
## attribute-construction-list.h (module 'core'): ns3::AttributeConstructionList::Item::checker [variable]
cls.add_instance_attribute('checker', 'ns3::Ptr< ns3::AttributeChecker const >', is_const=False)
## attribute-construction-list.h (module 'core'): ns3::AttributeConstructionList::Item::name [variable]
cls.add_instance_attribute('name', 'std::string', is_const=False)
## attribute-construction-list.h (module 'core'): ns3::AttributeConstructionList::Item::value [variable]
cls.add_instance_attribute('value', 'ns3::Ptr< ns3::AttributeValue >', is_const=False)
return
def register_Ns3BlockAckReqType_methods(root_module, cls):
cls.add_output_stream_operator()
## block-ack-type.h (module 'wifi'): ns3::BlockAckReqType::BlockAckReqType(ns3::BlockAckReqType const & arg0) [constructor]
cls.add_constructor([param('ns3::BlockAckReqType const &', 'arg0')])
## block-ack-type.h (module 'wifi'): ns3::BlockAckReqType::BlockAckReqType() [constructor]
cls.add_constructor([])
## block-ack-type.h (module 'wifi'): ns3::BlockAckReqType::BlockAckReqType(ns3::BlockAckReqType::Variant v) [constructor]
cls.add_constructor([param('ns3::BlockAckReqType::Variant', 'v')])
## block-ack-type.h (module 'wifi'): ns3::BlockAckReqType::BlockAckReqType(ns3::BlockAckReqType::Variant v, uint8_t nSeqControls) [constructor]
cls.add_constructor([param('ns3::BlockAckReqType::Variant', 'v'), param('uint8_t', 'nSeqControls')])
## block-ack-type.h (module 'wifi'): ns3::BlockAckReqType::m_nSeqControls [variable]
cls.add_instance_attribute('m_nSeqControls', 'uint8_t', is_const=False)
## block-ack-type.h (module 'wifi'): ns3::BlockAckReqType::m_variant [variable]
cls.add_instance_attribute('m_variant', 'ns3::BlockAckReqType::Variant', is_const=False)
return
def register_Ns3BlockAckType_methods(root_module, cls):
cls.add_output_stream_operator()
## block-ack-type.h (module 'wifi'): ns3::BlockAckType::BlockAckType(ns3::BlockAckType const & arg0) [constructor]
cls.add_constructor([param('ns3::BlockAckType const &', 'arg0')])
## block-ack-type.h (module 'wifi'): ns3::BlockAckType::BlockAckType() [constructor]
cls.add_constructor([])
## block-ack-type.h (module 'wifi'): ns3::BlockAckType::BlockAckType(ns3::BlockAckType::Variant v) [constructor]
cls.add_constructor([param('ns3::BlockAckType::Variant', 'v')])
## block-ack-type.h (module 'wifi'): ns3::BlockAckType::BlockAckType(ns3::BlockAckType::Variant v, std::vector<unsigned char, std::allocator<unsigned char> > l) [constructor]
cls.add_constructor([param('ns3::BlockAckType::Variant', 'v'), param('std::vector< unsigned char >', 'l')])
## block-ack-type.h (module 'wifi'): ns3::BlockAckType::m_bitmapLen [variable]
cls.add_instance_attribute('m_bitmapLen', 'std::vector< unsigned char >', is_const=False)
## block-ack-type.h (module 'wifi'): ns3::BlockAckType::m_variant [variable]
cls.add_instance_attribute('m_variant', 'ns3::BlockAckType::Variant', is_const=False)
return
def register_Ns3Buffer_methods(root_module, cls):
## buffer.h (module 'network'): ns3::Buffer::Buffer(ns3::Buffer const & o) [constructor]
cls.add_constructor([param('ns3::Buffer const &', 'o')])
## buffer.h (module 'network'): ns3::Buffer::Buffer() [constructor]
cls.add_constructor([])
## buffer.h (module 'network'): ns3::Buffer::Buffer(uint32_t dataSize) [constructor]
cls.add_constructor([param('uint32_t', 'dataSize')])
## buffer.h (module 'network'): ns3::Buffer::Buffer(uint32_t dataSize, bool initialize) [constructor]
cls.add_constructor([param('uint32_t', 'dataSize'), param('bool', 'initialize')])
## buffer.h (module 'network'): void ns3::Buffer::AddAtEnd(uint32_t end) [member function]
cls.add_method('AddAtEnd',
'void',
[param('uint32_t', 'end')])
## buffer.h (module 'network'): void ns3::Buffer::AddAtEnd(ns3::Buffer const & o) [member function]
cls.add_method('AddAtEnd',
'void',
[param('ns3::Buffer const &', 'o')])
## buffer.h (module 'network'): void ns3::Buffer::AddAtStart(uint32_t start) [member function]
cls.add_method('AddAtStart',
'void',
[param('uint32_t', 'start')])
## buffer.h (module 'network'): ns3::Buffer::Iterator ns3::Buffer::Begin() const [member function]
cls.add_method('Begin',
'ns3::Buffer::Iterator',
[],
is_const=True)
## buffer.h (module 'network'): void ns3::Buffer::CopyData(std::ostream * os, uint32_t size) const [member function]
cls.add_method('CopyData',
'void',
[param('std::ostream *', 'os'), param('uint32_t', 'size')],
is_const=True)
## buffer.h (module 'network'): uint32_t ns3::Buffer::CopyData(uint8_t * buffer, uint32_t size) const [member function]
cls.add_method('CopyData',
'uint32_t',
[param('uint8_t *', 'buffer'), param('uint32_t', 'size')],
is_const=True)
## buffer.h (module 'network'): ns3::Buffer ns3::Buffer::CreateFragment(uint32_t start, uint32_t length) const [member function]
cls.add_method('CreateFragment',
'ns3::Buffer',
[param('uint32_t', 'start'), param('uint32_t', 'length')],
is_const=True)
## buffer.h (module 'network'): uint32_t ns3::Buffer::Deserialize(uint8_t const * buffer, uint32_t size) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('uint8_t const *', 'buffer'), param('uint32_t', 'size')])
## buffer.h (module 'network'): ns3::Buffer::Iterator ns3::Buffer::End() const [member function]
cls.add_method('End',
'ns3::Buffer::Iterator',
[],
is_const=True)
## buffer.h (module 'network'): uint32_t ns3::Buffer::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True)
## buffer.h (module 'network'): uint32_t ns3::Buffer::GetSize() const [member function]
cls.add_method('GetSize',
'uint32_t',
[],
is_const=True)
## buffer.h (module 'network'): uint8_t const * ns3::Buffer::PeekData() const [member function]
cls.add_method('PeekData',
'uint8_t const *',
[],
is_const=True)
## buffer.h (module 'network'): void ns3::Buffer::RemoveAtEnd(uint32_t end) [member function]
cls.add_method('RemoveAtEnd',
'void',
[param('uint32_t', 'end')])
## buffer.h (module 'network'): void ns3::Buffer::RemoveAtStart(uint32_t start) [member function]
cls.add_method('RemoveAtStart',
'void',
[param('uint32_t', 'start')])
## buffer.h (module 'network'): uint32_t ns3::Buffer::Serialize(uint8_t * buffer, uint32_t maxSize) const [member function]
cls.add_method('Serialize',
'uint32_t',
[param('uint8_t *', 'buffer'), param('uint32_t', 'maxSize')],
is_const=True)
return
def register_Ns3BufferIterator_methods(root_module, cls):
## buffer.h (module 'network'): ns3::Buffer::Iterator::Iterator(ns3::Buffer::Iterator const & arg0) [constructor]
cls.add_constructor([param('ns3::Buffer::Iterator const &', 'arg0')])
## buffer.h (module 'network'): ns3::Buffer::Iterator::Iterator() [constructor]
cls.add_constructor([])
## buffer.h (module 'network'): uint16_t ns3::Buffer::Iterator::CalculateIpChecksum(uint16_t size) [member function]
cls.add_method('CalculateIpChecksum',
'uint16_t',
[param('uint16_t', 'size')])
## buffer.h (module 'network'): uint16_t ns3::Buffer::Iterator::CalculateIpChecksum(uint16_t size, uint32_t initialChecksum) [member function]
cls.add_method('CalculateIpChecksum',
'uint16_t',
[param('uint16_t', 'size'), param('uint32_t', 'initialChecksum')])
## buffer.h (module 'network'): uint32_t ns3::Buffer::Iterator::GetDistanceFrom(ns3::Buffer::Iterator const & o) const [member function]
cls.add_method('GetDistanceFrom',
'uint32_t',
[param('ns3::Buffer::Iterator const &', 'o')],
is_const=True)
## buffer.h (module 'network'): uint32_t ns3::Buffer::Iterator::GetRemainingSize() const [member function]
cls.add_method('GetRemainingSize',
'uint32_t',
[],
is_const=True)
## buffer.h (module 'network'): uint32_t ns3::Buffer::Iterator::GetSize() const [member function]
cls.add_method('GetSize',
'uint32_t',
[],
is_const=True)
## buffer.h (module 'network'): bool ns3::Buffer::Iterator::IsEnd() const [member function]
cls.add_method('IsEnd',
'bool',
[],
is_const=True)
## buffer.h (module 'network'): bool ns3::Buffer::Iterator::IsStart() const [member function]
cls.add_method('IsStart',
'bool',
[],
is_const=True)
## buffer.h (module 'network'): void ns3::Buffer::Iterator::Next() [member function]
cls.add_method('Next',
'void',
[])
## buffer.h (module 'network'): void ns3::Buffer::Iterator::Next(uint32_t delta) [member function]
cls.add_method('Next',
'void',
[param('uint32_t', 'delta')])
## buffer.h (module 'network'): uint8_t ns3::Buffer::Iterator::PeekU8() [member function]
cls.add_method('PeekU8',
'uint8_t',
[])
## buffer.h (module 'network'): void ns3::Buffer::Iterator::Prev() [member function]
cls.add_method('Prev',
'void',
[])
## buffer.h (module 'network'): void ns3::Buffer::Iterator::Prev(uint32_t delta) [member function]
cls.add_method('Prev',
'void',
[param('uint32_t', 'delta')])
## buffer.h (module 'network'): void ns3::Buffer::Iterator::Read(uint8_t * buffer, uint32_t size) [member function]
cls.add_method('Read',
'void',
[param('uint8_t *', 'buffer'), param('uint32_t', 'size')])
## buffer.h (module 'network'): void ns3::Buffer::Iterator::Read(ns3::Buffer::Iterator start, uint32_t size) [member function]
cls.add_method('Read',
'void',
[param('ns3::Buffer::Iterator', 'start'), param('uint32_t', 'size')])
## buffer.h (module 'network'): uint16_t ns3::Buffer::Iterator::ReadLsbtohU16() [member function]
cls.add_method('ReadLsbtohU16',
'uint16_t',
[])
## buffer.h (module 'network'): uint32_t ns3::Buffer::Iterator::ReadLsbtohU32() [member function]
cls.add_method('ReadLsbtohU32',
'uint32_t',
[])
## buffer.h (module 'network'): uint64_t ns3::Buffer::Iterator::ReadLsbtohU64() [member function]
cls.add_method('ReadLsbtohU64',
'uint64_t',
[])
## buffer.h (module 'network'): uint16_t ns3::Buffer::Iterator::ReadNtohU16() [member function]
cls.add_method('ReadNtohU16',
'uint16_t',
[])
## buffer.h (module 'network'): uint32_t ns3::Buffer::Iterator::ReadNtohU32() [member function]
cls.add_method('ReadNtohU32',
'uint32_t',
[])
## buffer.h (module 'network'): uint64_t ns3::Buffer::Iterator::ReadNtohU64() [member function]
cls.add_method('ReadNtohU64',
'uint64_t',
[])
## buffer.h (module 'network'): uint16_t ns3::Buffer::Iterator::ReadU16() [member function]
cls.add_method('ReadU16',
'uint16_t',
[])
## buffer.h (module 'network'): uint32_t ns3::Buffer::Iterator::ReadU32() [member function]
cls.add_method('ReadU32',
'uint32_t',
[])
## buffer.h (module 'network'): uint64_t ns3::Buffer::Iterator::ReadU64() [member function]
cls.add_method('ReadU64',
'uint64_t',
[])
## buffer.h (module 'network'): uint8_t ns3::Buffer::Iterator::ReadU8() [member function]
cls.add_method('ReadU8',
'uint8_t',
[])
## buffer.h (module 'network'): void ns3::Buffer::Iterator::Write(uint8_t const * buffer, uint32_t size) [member function]
cls.add_method('Write',
'void',
[param('uint8_t const *', 'buffer'), param('uint32_t', 'size')])
## buffer.h (module 'network'): void ns3::Buffer::Iterator::Write(ns3::Buffer::Iterator start, ns3::Buffer::Iterator end) [member function]
cls.add_method('Write',
'void',
[param('ns3::Buffer::Iterator', 'start'), param('ns3::Buffer::Iterator', 'end')])
## buffer.h (module 'network'): void ns3::Buffer::Iterator::WriteHtolsbU16(uint16_t data) [member function]
cls.add_method('WriteHtolsbU16',
'void',
[param('uint16_t', 'data')])
## buffer.h (module 'network'): void ns3::Buffer::Iterator::WriteHtolsbU32(uint32_t data) [member function]
cls.add_method('WriteHtolsbU32',
'void',
[param('uint32_t', 'data')])
## buffer.h (module 'network'): void ns3::Buffer::Iterator::WriteHtolsbU64(uint64_t data) [member function]
cls.add_method('WriteHtolsbU64',
'void',
[param('uint64_t', 'data')])
## buffer.h (module 'network'): void ns3::Buffer::Iterator::WriteHtonU16(uint16_t data) [member function]
cls.add_method('WriteHtonU16',
'void',
[param('uint16_t', 'data')])
## buffer.h (module 'network'): void ns3::Buffer::Iterator::WriteHtonU32(uint32_t data) [member function]
cls.add_method('WriteHtonU32',
'void',
[param('uint32_t', 'data')])
## buffer.h (module 'network'): void ns3::Buffer::Iterator::WriteHtonU64(uint64_t data) [member function]
cls.add_method('WriteHtonU64',
'void',
[param('uint64_t', 'data')])
## buffer.h (module 'network'): void ns3::Buffer::Iterator::WriteU16(uint16_t data) [member function]
cls.add_method('WriteU16',
'void',
[param('uint16_t', 'data')])
## buffer.h (module 'network'): void ns3::Buffer::Iterator::WriteU32(uint32_t data) [member function]
cls.add_method('WriteU32',
'void',
[param('uint32_t', 'data')])
## buffer.h (module 'network'): void ns3::Buffer::Iterator::WriteU64(uint64_t data) [member function]
cls.add_method('WriteU64',
'void',
[param('uint64_t', 'data')])
## buffer.h (module 'network'): void ns3::Buffer::Iterator::WriteU8(uint8_t data) [member function]
cls.add_method('WriteU8',
'void',
[param('uint8_t', 'data')])
## buffer.h (module 'network'): void ns3::Buffer::Iterator::WriteU8(uint8_t data, uint32_t len) [member function]
cls.add_method('WriteU8',
'void',
[param('uint8_t', 'data'), param('uint32_t', 'len')])
return
def register_Ns3ByteTagIterator_methods(root_module, cls):
## packet.h (module 'network'): ns3::ByteTagIterator::ByteTagIterator(ns3::ByteTagIterator const & arg0) [constructor]
cls.add_constructor([param('ns3::ByteTagIterator const &', 'arg0')])
## packet.h (module 'network'): bool ns3::ByteTagIterator::HasNext() const [member function]
cls.add_method('HasNext',
'bool',
[],
is_const=True)
## packet.h (module 'network'): ns3::ByteTagIterator::Item ns3::ByteTagIterator::Next() [member function]
cls.add_method('Next',
'ns3::ByteTagIterator::Item',
[])
return
def register_Ns3ByteTagIteratorItem_methods(root_module, cls):
## packet.h (module 'network'): ns3::ByteTagIterator::Item::Item(ns3::ByteTagIterator::Item const & arg0) [constructor]
cls.add_constructor([param('ns3::ByteTagIterator::Item const &', 'arg0')])
## packet.h (module 'network'): uint32_t ns3::ByteTagIterator::Item::GetEnd() const [member function]
cls.add_method('GetEnd',
'uint32_t',
[],
is_const=True)
## packet.h (module 'network'): uint32_t ns3::ByteTagIterator::Item::GetStart() const [member function]
cls.add_method('GetStart',
'uint32_t',
[],
is_const=True)
## packet.h (module 'network'): void ns3::ByteTagIterator::Item::GetTag(ns3::Tag & tag) const [member function]
cls.add_method('GetTag',
'void',
[param('ns3::Tag &', 'tag')],
is_const=True)
## packet.h (module 'network'): ns3::TypeId ns3::ByteTagIterator::Item::GetTypeId() const [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_const=True)
return
def register_Ns3ByteTagList_methods(root_module, cls):
## byte-tag-list.h (module 'network'): ns3::ByteTagList::ByteTagList() [constructor]
cls.add_constructor([])
## byte-tag-list.h (module 'network'): ns3::ByteTagList::ByteTagList(ns3::ByteTagList const & o) [constructor]
cls.add_constructor([param('ns3::ByteTagList const &', 'o')])
## byte-tag-list.h (module 'network'): ns3::TagBuffer ns3::ByteTagList::Add(ns3::TypeId tid, uint32_t bufferSize, int32_t start, int32_t end) [member function]
cls.add_method('Add',
'ns3::TagBuffer',
[param('ns3::TypeId', 'tid'), param('uint32_t', 'bufferSize'), param('int32_t', 'start'), param('int32_t', 'end')])
## byte-tag-list.h (module 'network'): void ns3::ByteTagList::Add(ns3::ByteTagList const & o) [member function]
cls.add_method('Add',
'void',
[param('ns3::ByteTagList const &', 'o')])
## byte-tag-list.h (module 'network'): void ns3::ByteTagList::AddAtEnd(int32_t appendOffset) [member function]
cls.add_method('AddAtEnd',
'void',
[param('int32_t', 'appendOffset')])
## byte-tag-list.h (module 'network'): void ns3::ByteTagList::AddAtStart(int32_t prependOffset) [member function]
cls.add_method('AddAtStart',
'void',
[param('int32_t', 'prependOffset')])
## byte-tag-list.h (module 'network'): void ns3::ByteTagList::Adjust(int32_t adjustment) [member function]
cls.add_method('Adjust',
'void',
[param('int32_t', 'adjustment')])
## byte-tag-list.h (module 'network'): ns3::ByteTagList::Iterator ns3::ByteTagList::Begin(int32_t offsetStart, int32_t offsetEnd) const [member function]
cls.add_method('Begin',
'ns3::ByteTagList::Iterator',
[param('int32_t', 'offsetStart'), param('int32_t', 'offsetEnd')],
is_const=True)
## byte-tag-list.h (module 'network'): uint32_t ns3::ByteTagList::Deserialize(uint32_t const * buffer, uint32_t size) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('uint32_t const *', 'buffer'), param('uint32_t', 'size')])
## byte-tag-list.h (module 'network'): uint32_t ns3::ByteTagList::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True)
## byte-tag-list.h (module 'network'): void ns3::ByteTagList::RemoveAll() [member function]
cls.add_method('RemoveAll',
'void',
[])
## byte-tag-list.h (module 'network'): uint32_t ns3::ByteTagList::Serialize(uint32_t * buffer, uint32_t maxSize) const [member function]
cls.add_method('Serialize',
'uint32_t',
[param('uint32_t *', 'buffer'), param('uint32_t', 'maxSize')],
is_const=True)
return
def register_Ns3ByteTagListIterator_methods(root_module, cls):
## byte-tag-list.h (module 'network'): ns3::ByteTagList::Iterator::Iterator(ns3::ByteTagList::Iterator const & arg0) [constructor]
cls.add_constructor([param('ns3::ByteTagList::Iterator const &', 'arg0')])
## byte-tag-list.h (module 'network'): uint32_t ns3::ByteTagList::Iterator::GetOffsetStart() const [member function]
cls.add_method('GetOffsetStart',
'uint32_t',
[],
is_const=True)
## byte-tag-list.h (module 'network'): bool ns3::ByteTagList::Iterator::HasNext() const [member function]
cls.add_method('HasNext',
'bool',
[],
is_const=True)
## byte-tag-list.h (module 'network'): ns3::ByteTagList::Iterator::Item ns3::ByteTagList::Iterator::Next() [member function]
cls.add_method('Next',
'ns3::ByteTagList::Iterator::Item',
[])
return
def register_Ns3ByteTagListIteratorItem_methods(root_module, cls):
## byte-tag-list.h (module 'network'): ns3::ByteTagList::Iterator::Item::Item(ns3::ByteTagList::Iterator::Item const & arg0) [constructor]
cls.add_constructor([param('ns3::ByteTagList::Iterator::Item const &', 'arg0')])
## byte-tag-list.h (module 'network'): ns3::ByteTagList::Iterator::Item::Item(ns3::TagBuffer buf) [constructor]
cls.add_constructor([param('ns3::TagBuffer', 'buf')])
## byte-tag-list.h (module 'network'): ns3::ByteTagList::Iterator::Item::buf [variable]
cls.add_instance_attribute('buf', 'ns3::TagBuffer', is_const=False)
## byte-tag-list.h (module 'network'): ns3::ByteTagList::Iterator::Item::end [variable]
cls.add_instance_attribute('end', 'int32_t', is_const=False)
## byte-tag-list.h (module 'network'): ns3::ByteTagList::Iterator::Item::size [variable]
cls.add_instance_attribute('size', 'uint32_t', is_const=False)
## byte-tag-list.h (module 'network'): ns3::ByteTagList::Iterator::Item::start [variable]
cls.add_instance_attribute('start', 'int32_t', is_const=False)
## byte-tag-list.h (module 'network'): ns3::ByteTagList::Iterator::Item::tid [variable]
cls.add_instance_attribute('tid', 'ns3::TypeId', is_const=False)
return
def register_Ns3CallbackBase_methods(root_module, cls):
## callback.h (module 'core'): ns3::CallbackBase::CallbackBase(ns3::CallbackBase const & arg0) [constructor]
cls.add_constructor([param('ns3::CallbackBase const &', 'arg0')])
## callback.h (module 'core'): ns3::CallbackBase::CallbackBase() [constructor]
cls.add_constructor([])
## callback.h (module 'core'): ns3::Ptr<ns3::CallbackImplBase> ns3::CallbackBase::GetImpl() const [member function]
cls.add_method('GetImpl',
'ns3::Ptr< ns3::CallbackImplBase >',
[],
is_const=True)
## callback.h (module 'core'): ns3::CallbackBase::CallbackBase(ns3::Ptr<ns3::CallbackImplBase> impl) [constructor]
cls.add_constructor([param('ns3::Ptr< ns3::CallbackImplBase >', 'impl')],
visibility='protected')
return
def register_Ns3DataRate_methods(root_module, cls):
cls.add_output_stream_operator()
cls.add_binary_comparison_operator('!=')
cls.add_binary_numeric_operator('*', root_module['ns3::DataRate'], root_module['ns3::DataRate'], param('double', 'right'))
cls.add_binary_numeric_operator('*', root_module['ns3::DataRate'], root_module['ns3::DataRate'], param('uint64_t', 'right'))
cls.add_inplace_numeric_operator('*=', param('double', 'right'))
cls.add_inplace_numeric_operator('*=', param('uint64_t', 'right'))
cls.add_binary_numeric_operator('+', root_module['ns3::DataRate'], root_module['ns3::DataRate'], param('ns3::DataRate', 'right'))
cls.add_inplace_numeric_operator('+=', param('ns3::DataRate', 'right'))
cls.add_binary_numeric_operator('-', root_module['ns3::DataRate'], root_module['ns3::DataRate'], param('ns3::DataRate', 'right'))
cls.add_inplace_numeric_operator('-=', param('ns3::DataRate', 'right'))
cls.add_binary_comparison_operator('<')
cls.add_binary_comparison_operator('<=')
cls.add_binary_comparison_operator('==')
cls.add_binary_comparison_operator('>')
cls.add_binary_comparison_operator('>=')
## data-rate.h (module 'network'): ns3::DataRate::DataRate(ns3::DataRate const & arg0) [constructor]
cls.add_constructor([param('ns3::DataRate const &', 'arg0')])
## data-rate.h (module 'network'): ns3::DataRate::DataRate() [constructor]
cls.add_constructor([])
## data-rate.h (module 'network'): ns3::DataRate::DataRate(uint64_t bps) [constructor]
cls.add_constructor([param('uint64_t', 'bps')])
## data-rate.h (module 'network'): ns3::DataRate::DataRate(std::string rate) [constructor]
cls.add_constructor([param('std::string', 'rate')])
## data-rate.h (module 'network'): ns3::Time ns3::DataRate::CalculateBitsTxTime(uint32_t bits) const [member function]
cls.add_method('CalculateBitsTxTime',
'ns3::Time',
[param('uint32_t', 'bits')],
is_const=True)
## data-rate.h (module 'network'): ns3::Time ns3::DataRate::CalculateBytesTxTime(uint32_t bytes) const [member function]
cls.add_method('CalculateBytesTxTime',
'ns3::Time',
[param('uint32_t', 'bytes')],
is_const=True)
## data-rate.h (module 'network'): uint64_t ns3::DataRate::GetBitRate() const [member function]
cls.add_method('GetBitRate',
'uint64_t',
[],
is_const=True)
return
def register_Ns3DefaultDeleter__Ns3AttributeAccessor_methods(root_module, cls):
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::AttributeAccessor>::DefaultDeleter() [constructor]
cls.add_constructor([])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::AttributeAccessor>::DefaultDeleter(ns3::DefaultDeleter<ns3::AttributeAccessor> const & arg0) [constructor]
cls.add_constructor([param('ns3::DefaultDeleter< ns3::AttributeAccessor > const &', 'arg0')])
## default-deleter.h (module 'core'): static void ns3::DefaultDeleter<ns3::AttributeAccessor>::Delete(ns3::AttributeAccessor * object) [member function]
cls.add_method('Delete',
'void',
[param('ns3::AttributeAccessor *', 'object')],
is_static=True)
return
def register_Ns3DefaultDeleter__Ns3AttributeChecker_methods(root_module, cls):
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::AttributeChecker>::DefaultDeleter() [constructor]
cls.add_constructor([])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::AttributeChecker>::DefaultDeleter(ns3::DefaultDeleter<ns3::AttributeChecker> const & arg0) [constructor]
cls.add_constructor([param('ns3::DefaultDeleter< ns3::AttributeChecker > const &', 'arg0')])
## default-deleter.h (module 'core'): static void ns3::DefaultDeleter<ns3::AttributeChecker>::Delete(ns3::AttributeChecker * object) [member function]
cls.add_method('Delete',
'void',
[param('ns3::AttributeChecker *', 'object')],
is_static=True)
return
def register_Ns3DefaultDeleter__Ns3AttributeValue_methods(root_module, cls):
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::AttributeValue>::DefaultDeleter() [constructor]
cls.add_constructor([])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::AttributeValue>::DefaultDeleter(ns3::DefaultDeleter<ns3::AttributeValue> const & arg0) [constructor]
cls.add_constructor([param('ns3::DefaultDeleter< ns3::AttributeValue > const &', 'arg0')])
## default-deleter.h (module 'core'): static void ns3::DefaultDeleter<ns3::AttributeValue>::Delete(ns3::AttributeValue * object) [member function]
cls.add_method('Delete',
'void',
[param('ns3::AttributeValue *', 'object')],
is_static=True)
return
def register_Ns3DefaultDeleter__Ns3CallbackImplBase_methods(root_module, cls):
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::CallbackImplBase>::DefaultDeleter() [constructor]
cls.add_constructor([])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::CallbackImplBase>::DefaultDeleter(ns3::DefaultDeleter<ns3::CallbackImplBase> const & arg0) [constructor]
cls.add_constructor([param('ns3::DefaultDeleter< ns3::CallbackImplBase > const &', 'arg0')])
## default-deleter.h (module 'core'): static void ns3::DefaultDeleter<ns3::CallbackImplBase>::Delete(ns3::CallbackImplBase * object) [member function]
cls.add_method('Delete',
'void',
[param('ns3::CallbackImplBase *', 'object')],
is_static=True)
return
def register_Ns3DefaultDeleter__Ns3EventImpl_methods(root_module, cls):
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::EventImpl>::DefaultDeleter() [constructor]
cls.add_constructor([])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::EventImpl>::DefaultDeleter(ns3::DefaultDeleter<ns3::EventImpl> const & arg0) [constructor]
cls.add_constructor([param('ns3::DefaultDeleter< ns3::EventImpl > const &', 'arg0')])
## default-deleter.h (module 'core'): static void ns3::DefaultDeleter<ns3::EventImpl>::Delete(ns3::EventImpl * object) [member function]
cls.add_method('Delete',
'void',
[param('ns3::EventImpl *', 'object')],
is_static=True)
return
def register_Ns3DefaultDeleter__Ns3HashImplementation_methods(root_module, cls):
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::Hash::Implementation>::DefaultDeleter() [constructor]
cls.add_constructor([])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::Hash::Implementation>::DefaultDeleter(ns3::DefaultDeleter<ns3::Hash::Implementation> const & arg0) [constructor]
cls.add_constructor([param('ns3::DefaultDeleter< ns3::Hash::Implementation > const &', 'arg0')])
## default-deleter.h (module 'core'): static void ns3::DefaultDeleter<ns3::Hash::Implementation>::Delete(ns3::Hash::Implementation * object) [member function]
cls.add_method('Delete',
'void',
[param('ns3::Hash::Implementation *', 'object')],
is_static=True)
return
def register_Ns3DefaultDeleter__Ns3Ipv4Route_methods(root_module, cls):
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::Ipv4Route>::DefaultDeleter() [constructor]
cls.add_constructor([])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::Ipv4Route>::DefaultDeleter(ns3::DefaultDeleter<ns3::Ipv4Route> const & arg0) [constructor]
cls.add_constructor([param('ns3::DefaultDeleter< ns3::Ipv4Route > const &', 'arg0')])
## default-deleter.h (module 'core'): static void ns3::DefaultDeleter<ns3::Ipv4Route>::Delete(ns3::Ipv4Route * object) [member function]
cls.add_method('Delete',
'void',
[param('ns3::Ipv4Route *', 'object')],
is_static=True)
return
def register_Ns3DefaultDeleter__Ns3NixVector_methods(root_module, cls):
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::NixVector>::DefaultDeleter() [constructor]
cls.add_constructor([])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::NixVector>::DefaultDeleter(ns3::DefaultDeleter<ns3::NixVector> const & arg0) [constructor]
cls.add_constructor([param('ns3::DefaultDeleter< ns3::NixVector > const &', 'arg0')])
## default-deleter.h (module 'core'): static void ns3::DefaultDeleter<ns3::NixVector>::Delete(ns3::NixVector * object) [member function]
cls.add_method('Delete',
'void',
[param('ns3::NixVector *', 'object')],
is_static=True)
return
def register_Ns3DefaultDeleter__Ns3Packet_methods(root_module, cls):
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::Packet>::DefaultDeleter() [constructor]
cls.add_constructor([])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::Packet>::DefaultDeleter(ns3::DefaultDeleter<ns3::Packet> const & arg0) [constructor]
cls.add_constructor([param('ns3::DefaultDeleter< ns3::Packet > const &', 'arg0')])
## default-deleter.h (module 'core'): static void ns3::DefaultDeleter<ns3::Packet>::Delete(ns3::Packet * object) [member function]
cls.add_method('Delete',
'void',
[param('ns3::Packet *', 'object')],
is_static=True)
return
def register_Ns3DefaultDeleter__Ns3TraceSourceAccessor_methods(root_module, cls):
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::TraceSourceAccessor>::DefaultDeleter() [constructor]
cls.add_constructor([])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::TraceSourceAccessor>::DefaultDeleter(ns3::DefaultDeleter<ns3::TraceSourceAccessor> const & arg0) [constructor]
cls.add_constructor([param('ns3::DefaultDeleter< ns3::TraceSourceAccessor > const &', 'arg0')])
## default-deleter.h (module 'core'): static void ns3::DefaultDeleter<ns3::TraceSourceAccessor>::Delete(ns3::TraceSourceAccessor * object) [member function]
cls.add_method('Delete',
'void',
[param('ns3::TraceSourceAccessor *', 'object')],
is_static=True)
return
def register_Ns3DefaultDeleter__Ns3WifiInformationElement_methods(root_module, cls):
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::WifiInformationElement>::DefaultDeleter() [constructor]
cls.add_constructor([])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::WifiInformationElement>::DefaultDeleter(ns3::DefaultDeleter<ns3::WifiInformationElement> const & arg0) [constructor]
cls.add_constructor([param('ns3::DefaultDeleter< ns3::WifiInformationElement > const &', 'arg0')])
## default-deleter.h (module 'core'): static void ns3::DefaultDeleter<ns3::WifiInformationElement>::Delete(ns3::WifiInformationElement * object) [member function]
cls.add_method('Delete',
'void',
[param('ns3::WifiInformationElement *', 'object')],
is_static=True)
return
def register_Ns3DsrHelper_methods(root_module, cls):
## dsr-helper.h (module 'dsr'): ns3::DsrHelper::DsrHelper() [constructor]
cls.add_constructor([])
## dsr-helper.h (module 'dsr'): ns3::DsrHelper::DsrHelper(ns3::DsrHelper const & o) [constructor]
cls.add_constructor([param('ns3::DsrHelper const &', 'o')])
## dsr-helper.h (module 'dsr'): ns3::DsrHelper * ns3::DsrHelper::Copy() const [member function]
cls.add_method('Copy',
'ns3::DsrHelper *',
[],
is_const=True)
## dsr-helper.h (module 'dsr'): ns3::Ptr<ns3::dsr::DsrRouting> ns3::DsrHelper::Create(ns3::Ptr<ns3::Node> node) const [member function]
cls.add_method('Create',
'ns3::Ptr< ns3::dsr::DsrRouting >',
[param('ns3::Ptr< ns3::Node >', 'node')],
is_const=True)
## dsr-helper.h (module 'dsr'): void ns3::DsrHelper::Set(std::string name, ns3::AttributeValue const & value) [member function]
cls.add_method('Set',
'void',
[param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')])
return
def register_Ns3DsrMainHelper_methods(root_module, cls):
## dsr-main-helper.h (module 'dsr'): ns3::DsrMainHelper::DsrMainHelper() [constructor]
cls.add_constructor([])
## dsr-main-helper.h (module 'dsr'): ns3::DsrMainHelper::DsrMainHelper(ns3::DsrMainHelper const & o) [constructor]
cls.add_constructor([param('ns3::DsrMainHelper const &', 'o')])
## dsr-main-helper.h (module 'dsr'): void ns3::DsrMainHelper::Install(ns3::DsrHelper & dsrHelper, ns3::NodeContainer nodes) [member function]
cls.add_method('Install',
'void',
[param('ns3::DsrHelper &', 'dsrHelper'), param('ns3::NodeContainer', 'nodes')])
## dsr-main-helper.h (module 'dsr'): void ns3::DsrMainHelper::SetDsrHelper(ns3::DsrHelper & dsrHelper) [member function]
cls.add_method('SetDsrHelper',
'void',
[param('ns3::DsrHelper &', 'dsrHelper')])
return
def register_Ns3EventGarbageCollector_methods(root_module, cls):
## event-garbage-collector.h (module 'core'): ns3::EventGarbageCollector::EventGarbageCollector() [constructor]
cls.add_constructor([])
## event-garbage-collector.h (module 'core'): void ns3::EventGarbageCollector::Track(ns3::EventId event) [member function]
cls.add_method('Track',
'void',
[param('ns3::EventId', 'event')])
## event-garbage-collector.h (module 'core'): ns3::EventGarbageCollector::EventGarbageCollector(ns3::EventGarbageCollector const & arg0) [constructor]
cls.add_constructor([param('ns3::EventGarbageCollector const &', 'arg0')])
return
def register_Ns3EventId_methods(root_module, cls):
cls.add_binary_comparison_operator('==')
cls.add_binary_comparison_operator('!=')
cls.add_binary_comparison_operator('<')
## event-id.h (module 'core'): ns3::EventId::EventId(ns3::EventId const & arg0) [constructor]
cls.add_constructor([param('ns3::EventId const &', 'arg0')])
## event-id.h (module 'core'): ns3::EventId::EventId() [constructor]
cls.add_constructor([])
## event-id.h (module 'core'): ns3::EventId::EventId(ns3::Ptr<ns3::EventImpl> const & impl, uint64_t ts, uint32_t context, uint32_t uid) [constructor]
cls.add_constructor([param('ns3::Ptr< ns3::EventImpl > const &', 'impl'), param('uint64_t', 'ts'), param('uint32_t', 'context'), param('uint32_t', 'uid')])
## event-id.h (module 'core'): void ns3::EventId::Cancel() [member function]
cls.add_method('Cancel',
'void',
[])
## event-id.h (module 'core'): uint32_t ns3::EventId::GetContext() const [member function]
cls.add_method('GetContext',
'uint32_t',
[],
is_const=True)
## event-id.h (module 'core'): uint64_t ns3::EventId::GetTs() const [member function]
cls.add_method('GetTs',
'uint64_t',
[],
is_const=True)
## event-id.h (module 'core'): uint32_t ns3::EventId::GetUid() const [member function]
cls.add_method('GetUid',
'uint32_t',
[],
is_const=True)
## event-id.h (module 'core'): bool ns3::EventId::IsExpired() const [member function]
cls.add_method('IsExpired',
'bool',
[],
is_const=True)
## event-id.h (module 'core'): bool ns3::EventId::IsRunning() const [member function]
cls.add_method('IsRunning',
'bool',
[],
is_const=True)
## event-id.h (module 'core'): ns3::EventImpl * ns3::EventId::PeekEventImpl() const [member function]
cls.add_method('PeekEventImpl',
'ns3::EventImpl *',
[],
is_const=True)
## event-id.h (module 'core'): void ns3::EventId::Remove() [member function]
cls.add_method('Remove',
'void',
[])
return
def register_Ns3Hasher_methods(root_module, cls):
## hash.h (module 'core'): ns3::Hasher::Hasher(ns3::Hasher const & arg0) [constructor]
cls.add_constructor([param('ns3::Hasher const &', 'arg0')])
## hash.h (module 'core'): ns3::Hasher::Hasher() [constructor]
cls.add_constructor([])
## hash.h (module 'core'): ns3::Hasher::Hasher(ns3::Ptr<ns3::Hash::Implementation> hp) [constructor]
cls.add_constructor([param('ns3::Ptr< ns3::Hash::Implementation >', 'hp')])
## hash.h (module 'core'): uint32_t ns3::Hasher::GetHash32(char const * buffer, std::size_t const size) [member function]
cls.add_method('GetHash32',
'uint32_t',
[param('char const *', 'buffer'), param('std::size_t const', 'size')])
## hash.h (module 'core'): uint32_t ns3::Hasher::GetHash32(std::string const s) [member function]
cls.add_method('GetHash32',
'uint32_t',
[param('std::string const', 's')])
## hash.h (module 'core'): uint64_t ns3::Hasher::GetHash64(char const * buffer, std::size_t const size) [member function]
cls.add_method('GetHash64',
'uint64_t',
[param('char const *', 'buffer'), param('std::size_t const', 'size')])
## hash.h (module 'core'): uint64_t ns3::Hasher::GetHash64(std::string const s) [member function]
cls.add_method('GetHash64',
'uint64_t',
[param('std::string const', 's')])
## hash.h (module 'core'): ns3::Hasher & ns3::Hasher::clear() [member function]
cls.add_method('clear',
'ns3::Hasher &',
[])
return
def register_Ns3Inet6SocketAddress_methods(root_module, cls):
## inet6-socket-address.h (module 'network'): ns3::Inet6SocketAddress::Inet6SocketAddress(ns3::Inet6SocketAddress const & arg0) [constructor]
cls.add_constructor([param('ns3::Inet6SocketAddress const &', 'arg0')])
## inet6-socket-address.h (module 'network'): ns3::Inet6SocketAddress::Inet6SocketAddress(ns3::Ipv6Address ipv6, uint16_t port) [constructor]
cls.add_constructor([param('ns3::Ipv6Address', 'ipv6'), param('uint16_t', 'port')])
## inet6-socket-address.h (module 'network'): ns3::Inet6SocketAddress::Inet6SocketAddress(ns3::Ipv6Address ipv6) [constructor]
cls.add_constructor([param('ns3::Ipv6Address', 'ipv6')])
## inet6-socket-address.h (module 'network'): ns3::Inet6SocketAddress::Inet6SocketAddress(uint16_t port) [constructor]
cls.add_constructor([param('uint16_t', 'port')])
## inet6-socket-address.h (module 'network'): ns3::Inet6SocketAddress::Inet6SocketAddress(char const * ipv6, uint16_t port) [constructor]
cls.add_constructor([param('char const *', 'ipv6'), param('uint16_t', 'port')])
## inet6-socket-address.h (module 'network'): ns3::Inet6SocketAddress::Inet6SocketAddress(char const * ipv6) [constructor]
cls.add_constructor([param('char const *', 'ipv6')])
## inet6-socket-address.h (module 'network'): static ns3::Inet6SocketAddress ns3::Inet6SocketAddress::ConvertFrom(ns3::Address const & addr) [member function]
cls.add_method('ConvertFrom',
'ns3::Inet6SocketAddress',
[param('ns3::Address const &', 'addr')],
is_static=True)
## inet6-socket-address.h (module 'network'): ns3::Ipv6Address ns3::Inet6SocketAddress::GetIpv6() const [member function]
cls.add_method('GetIpv6',
'ns3::Ipv6Address',
[],
is_const=True)
## inet6-socket-address.h (module 'network'): uint16_t ns3::Inet6SocketAddress::GetPort() const [member function]
cls.add_method('GetPort',
'uint16_t',
[],
is_const=True)
## inet6-socket-address.h (module 'network'): static bool ns3::Inet6SocketAddress::IsMatchingType(ns3::Address const & addr) [member function]
cls.add_method('IsMatchingType',
'bool',
[param('ns3::Address const &', 'addr')],
is_static=True)
## inet6-socket-address.h (module 'network'): void ns3::Inet6SocketAddress::SetIpv6(ns3::Ipv6Address ipv6) [member function]
cls.add_method('SetIpv6',
'void',
[param('ns3::Ipv6Address', 'ipv6')])
## inet6-socket-address.h (module 'network'): void ns3::Inet6SocketAddress::SetPort(uint16_t port) [member function]
cls.add_method('SetPort',
'void',
[param('uint16_t', 'port')])
return
def register_Ns3InetSocketAddress_methods(root_module, cls):
## inet-socket-address.h (module 'network'): ns3::InetSocketAddress::InetSocketAddress(ns3::InetSocketAddress const & arg0) [constructor]
cls.add_constructor([param('ns3::InetSocketAddress const &', 'arg0')])
## inet-socket-address.h (module 'network'): ns3::InetSocketAddress::InetSocketAddress(ns3::Ipv4Address ipv4, uint16_t port) [constructor]
cls.add_constructor([param('ns3::Ipv4Address', 'ipv4'), param('uint16_t', 'port')])
## inet-socket-address.h (module 'network'): ns3::InetSocketAddress::InetSocketAddress(ns3::Ipv4Address ipv4) [constructor]
cls.add_constructor([param('ns3::Ipv4Address', 'ipv4')])
## inet-socket-address.h (module 'network'): ns3::InetSocketAddress::InetSocketAddress(uint16_t port) [constructor]
cls.add_constructor([param('uint16_t', 'port')])
## inet-socket-address.h (module 'network'): ns3::InetSocketAddress::InetSocketAddress(char const * ipv4, uint16_t port) [constructor]
cls.add_constructor([param('char const *', 'ipv4'), param('uint16_t', 'port')])
## inet-socket-address.h (module 'network'): ns3::InetSocketAddress::InetSocketAddress(char const * ipv4) [constructor]
cls.add_constructor([param('char const *', 'ipv4')])
## inet-socket-address.h (module 'network'): static ns3::InetSocketAddress ns3::InetSocketAddress::ConvertFrom(ns3::Address const & address) [member function]
cls.add_method('ConvertFrom',
'ns3::InetSocketAddress',
[param('ns3::Address const &', 'address')],
is_static=True)
## inet-socket-address.h (module 'network'): ns3::Ipv4Address ns3::InetSocketAddress::GetIpv4() const [member function]
cls.add_method('GetIpv4',
'ns3::Ipv4Address',
[],
is_const=True)
## inet-socket-address.h (module 'network'): uint16_t ns3::InetSocketAddress::GetPort() const [member function]
cls.add_method('GetPort',
'uint16_t',
[],
is_const=True)
## inet-socket-address.h (module 'network'): uint8_t ns3::InetSocketAddress::GetTos() const [member function]
cls.add_method('GetTos',
'uint8_t',
[],
is_const=True)
## inet-socket-address.h (module 'network'): static bool ns3::InetSocketAddress::IsMatchingType(ns3::Address const & address) [member function]
cls.add_method('IsMatchingType',
'bool',
[param('ns3::Address const &', 'address')],
is_static=True)
## inet-socket-address.h (module 'network'): void ns3::InetSocketAddress::SetIpv4(ns3::Ipv4Address address) [member function]
cls.add_method('SetIpv4',
'void',
[param('ns3::Ipv4Address', 'address')])
## inet-socket-address.h (module 'network'): void ns3::InetSocketAddress::SetPort(uint16_t port) [member function]
cls.add_method('SetPort',
'void',
[param('uint16_t', 'port')])
## inet-socket-address.h (module 'network'): void ns3::InetSocketAddress::SetTos(uint8_t tos) [member function]
cls.add_method('SetTos',
'void',
[param('uint8_t', 'tos')])
return
def register_Ns3IntToType__0_methods(root_module, cls):
## int-to-type.h (module 'core'): ns3::IntToType<0>::IntToType() [constructor]
cls.add_constructor([])
## int-to-type.h (module 'core'): ns3::IntToType<0>::IntToType(ns3::IntToType<0> const & arg0) [constructor]
cls.add_constructor([param('ns3::IntToType< 0 > const &', 'arg0')])
return
def register_Ns3IntToType__1_methods(root_module, cls):
## int-to-type.h (module 'core'): ns3::IntToType<1>::IntToType() [constructor]
cls.add_constructor([])
## int-to-type.h (module 'core'): ns3::IntToType<1>::IntToType(ns3::IntToType<1> const & arg0) [constructor]
cls.add_constructor([param('ns3::IntToType< 1 > const &', 'arg0')])
return
def register_Ns3IntToType__2_methods(root_module, cls):
## int-to-type.h (module 'core'): ns3::IntToType<2>::IntToType() [constructor]
cls.add_constructor([])
## int-to-type.h (module 'core'): ns3::IntToType<2>::IntToType(ns3::IntToType<2> const & arg0) [constructor]
cls.add_constructor([param('ns3::IntToType< 2 > const &', 'arg0')])
return
def register_Ns3IntToType__3_methods(root_module, cls):
## int-to-type.h (module 'core'): ns3::IntToType<3>::IntToType() [constructor]
cls.add_constructor([])
## int-to-type.h (module 'core'): ns3::IntToType<3>::IntToType(ns3::IntToType<3> const & arg0) [constructor]
cls.add_constructor([param('ns3::IntToType< 3 > const &', 'arg0')])
return
def register_Ns3IntToType__4_methods(root_module, cls):
## int-to-type.h (module 'core'): ns3::IntToType<4>::IntToType() [constructor]
cls.add_constructor([])
## int-to-type.h (module 'core'): ns3::IntToType<4>::IntToType(ns3::IntToType<4> const & arg0) [constructor]
cls.add_constructor([param('ns3::IntToType< 4 > const &', 'arg0')])
return
def register_Ns3IntToType__5_methods(root_module, cls):
## int-to-type.h (module 'core'): ns3::IntToType<5>::IntToType() [constructor]
cls.add_constructor([])
## int-to-type.h (module 'core'): ns3::IntToType<5>::IntToType(ns3::IntToType<5> const & arg0) [constructor]
cls.add_constructor([param('ns3::IntToType< 5 > const &', 'arg0')])
return
def register_Ns3IntToType__6_methods(root_module, cls):
## int-to-type.h (module 'core'): ns3::IntToType<6>::IntToType() [constructor]
cls.add_constructor([])
## int-to-type.h (module 'core'): ns3::IntToType<6>::IntToType(ns3::IntToType<6> const & arg0) [constructor]
cls.add_constructor([param('ns3::IntToType< 6 > const &', 'arg0')])
return
def register_Ns3Ipv4Address_methods(root_module, cls):
cls.add_output_stream_operator()
cls.add_binary_comparison_operator('==')
cls.add_binary_comparison_operator('!=')
cls.add_binary_comparison_operator('<')
## ipv4-address.h (module 'network'): ns3::Ipv4Address::Ipv4Address(ns3::Ipv4Address const & arg0) [constructor]
cls.add_constructor([param('ns3::Ipv4Address const &', 'arg0')])
## ipv4-address.h (module 'network'): ns3::Ipv4Address::Ipv4Address() [constructor]
cls.add_constructor([])
## ipv4-address.h (module 'network'): ns3::Ipv4Address::Ipv4Address(uint32_t address) [constructor]
cls.add_constructor([param('uint32_t', 'address')])
## ipv4-address.h (module 'network'): ns3::Ipv4Address::Ipv4Address(char const * address) [constructor]
cls.add_constructor([param('char const *', 'address')])
## ipv4-address.h (module 'network'): ns3::Ipv4Address ns3::Ipv4Address::CombineMask(ns3::Ipv4Mask const & mask) const [member function]
cls.add_method('CombineMask',
'ns3::Ipv4Address',
[param('ns3::Ipv4Mask const &', 'mask')],
is_const=True)
## ipv4-address.h (module 'network'): static ns3::Ipv4Address ns3::Ipv4Address::ConvertFrom(ns3::Address const & address) [member function]
cls.add_method('ConvertFrom',
'ns3::Ipv4Address',
[param('ns3::Address const &', 'address')],
is_static=True)
## ipv4-address.h (module 'network'): static ns3::Ipv4Address ns3::Ipv4Address::Deserialize(uint8_t const * buf) [member function]
cls.add_method('Deserialize',
'ns3::Ipv4Address',
[param('uint8_t const *', 'buf')],
is_static=True)
## ipv4-address.h (module 'network'): uint32_t ns3::Ipv4Address::Get() const [member function]
cls.add_method('Get',
'uint32_t',
[],
is_const=True)
## ipv4-address.h (module 'network'): static ns3::Ipv4Address ns3::Ipv4Address::GetAny() [member function]
cls.add_method('GetAny',
'ns3::Ipv4Address',
[],
is_static=True)
## ipv4-address.h (module 'network'): static ns3::Ipv4Address ns3::Ipv4Address::GetBroadcast() [member function]
cls.add_method('GetBroadcast',
'ns3::Ipv4Address',
[],
is_static=True)
## ipv4-address.h (module 'network'): static ns3::Ipv4Address ns3::Ipv4Address::GetLoopback() [member function]
cls.add_method('GetLoopback',
'ns3::Ipv4Address',
[],
is_static=True)
## ipv4-address.h (module 'network'): ns3::Ipv4Address ns3::Ipv4Address::GetSubnetDirectedBroadcast(ns3::Ipv4Mask const & mask) const [member function]
cls.add_method('GetSubnetDirectedBroadcast',
'ns3::Ipv4Address',
[param('ns3::Ipv4Mask const &', 'mask')],
is_const=True)
## ipv4-address.h (module 'network'): static ns3::Ipv4Address ns3::Ipv4Address::GetZero() [member function]
cls.add_method('GetZero',
'ns3::Ipv4Address',
[],
is_static=True)
## ipv4-address.h (module 'network'): bool ns3::Ipv4Address::IsAny() const [member function]
cls.add_method('IsAny',
'bool',
[],
is_const=True)
## ipv4-address.h (module 'network'): bool ns3::Ipv4Address::IsBroadcast() const [member function]
cls.add_method('IsBroadcast',
'bool',
[],
is_const=True)
## ipv4-address.h (module 'network'): bool ns3::Ipv4Address::IsInitialized() const [member function]
cls.add_method('IsInitialized',
'bool',
[],
is_const=True)
## ipv4-address.h (module 'network'): bool ns3::Ipv4Address::IsLocalMulticast() const [member function]
cls.add_method('IsLocalMulticast',
'bool',
[],
is_const=True)
## ipv4-address.h (module 'network'): bool ns3::Ipv4Address::IsLocalhost() const [member function]
cls.add_method('IsLocalhost',
'bool',
[],
is_const=True)
## ipv4-address.h (module 'network'): static bool ns3::Ipv4Address::IsMatchingType(ns3::Address const & address) [member function]
cls.add_method('IsMatchingType',
'bool',
[param('ns3::Address const &', 'address')],
is_static=True)
## ipv4-address.h (module 'network'): bool ns3::Ipv4Address::IsMulticast() const [member function]
cls.add_method('IsMulticast',
'bool',
[],
is_const=True)
## ipv4-address.h (module 'network'): bool ns3::Ipv4Address::IsSubnetDirectedBroadcast(ns3::Ipv4Mask const & mask) const [member function]
cls.add_method('IsSubnetDirectedBroadcast',
'bool',
[param('ns3::Ipv4Mask const &', 'mask')],
is_const=True)
## ipv4-address.h (module 'network'): void ns3::Ipv4Address::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True)
## ipv4-address.h (module 'network'): void ns3::Ipv4Address::Serialize(uint8_t * buf) const [member function]
cls.add_method('Serialize',
'void',
[param('uint8_t *', 'buf')],
is_const=True)
## ipv4-address.h (module 'network'): void ns3::Ipv4Address::Set(uint32_t address) [member function]
cls.add_method('Set',
'void',
[param('uint32_t', 'address')])
## ipv4-address.h (module 'network'): void ns3::Ipv4Address::Set(char const * address) [member function]
cls.add_method('Set',
'void',
[param('char const *', 'address')])
return
def register_Ns3Ipv4AddressHash_methods(root_module, cls):
## ipv4-address.h (module 'network'): ns3::Ipv4AddressHash::Ipv4AddressHash() [constructor]
cls.add_constructor([])
## ipv4-address.h (module 'network'): ns3::Ipv4AddressHash::Ipv4AddressHash(ns3::Ipv4AddressHash const & arg0) [constructor]
cls.add_constructor([param('ns3::Ipv4AddressHash const &', 'arg0')])
## ipv4-address.h (module 'network'): size_t ns3::Ipv4AddressHash::operator()(ns3::Ipv4Address const & x) const [member operator]
cls.add_method('operator()',
'size_t',
[param('ns3::Ipv4Address const &', 'x')],
custom_name='__call__', is_const=True)
return
def register_Ns3Ipv4InterfaceAddress_methods(root_module, cls):
cls.add_output_stream_operator()
cls.add_binary_comparison_operator('==')
cls.add_binary_comparison_operator('!=')
## ipv4-interface-address.h (module 'internet'): ns3::Ipv4InterfaceAddress::Ipv4InterfaceAddress() [constructor]
cls.add_constructor([])
## ipv4-interface-address.h (module 'internet'): ns3::Ipv4InterfaceAddress::Ipv4InterfaceAddress(ns3::Ipv4Address local, ns3::Ipv4Mask mask) [constructor]
cls.add_constructor([param('ns3::Ipv4Address', 'local'), param('ns3::Ipv4Mask', 'mask')])
## ipv4-interface-address.h (module 'internet'): ns3::Ipv4InterfaceAddress::Ipv4InterfaceAddress(ns3::Ipv4InterfaceAddress const & o) [constructor]
cls.add_constructor([param('ns3::Ipv4InterfaceAddress const &', 'o')])
## ipv4-interface-address.h (module 'internet'): ns3::Ipv4Address ns3::Ipv4InterfaceAddress::GetAddress() const [member function]
cls.add_method('GetAddress',
'ns3::Ipv4Address',
[],
is_const=True)
## ipv4-interface-address.h (module 'internet'): ns3::Ipv4Address ns3::Ipv4InterfaceAddress::GetBroadcast() const [member function]
cls.add_method('GetBroadcast',
'ns3::Ipv4Address',
[],
is_const=True)
## ipv4-interface-address.h (module 'internet'): ns3::Ipv4Address ns3::Ipv4InterfaceAddress::GetLocal() const [member function]
cls.add_method('GetLocal',
'ns3::Ipv4Address',
[],
is_const=True)
## ipv4-interface-address.h (module 'internet'): ns3::Ipv4Mask ns3::Ipv4InterfaceAddress::GetMask() const [member function]
cls.add_method('GetMask',
'ns3::Ipv4Mask',
[],
is_const=True)
## ipv4-interface-address.h (module 'internet'): ns3::Ipv4InterfaceAddress::InterfaceAddressScope_e ns3::Ipv4InterfaceAddress::GetScope() const [member function]
cls.add_method('GetScope',
'ns3::Ipv4InterfaceAddress::InterfaceAddressScope_e',
[],
is_const=True)
## ipv4-interface-address.h (module 'internet'): bool ns3::Ipv4InterfaceAddress::IsInSameSubnet(ns3::Ipv4Address const b) const [member function]
cls.add_method('IsInSameSubnet',
'bool',
[param('ns3::Ipv4Address const', 'b')],
is_const=True)
## ipv4-interface-address.h (module 'internet'): bool ns3::Ipv4InterfaceAddress::IsSecondary() const [member function]
cls.add_method('IsSecondary',
'bool',
[],
is_const=True)
## ipv4-interface-address.h (module 'internet'): void ns3::Ipv4InterfaceAddress::SetAddress(ns3::Ipv4Address address) [member function]
cls.add_method('SetAddress',
'void',
[param('ns3::Ipv4Address', 'address')])
## ipv4-interface-address.h (module 'internet'): void ns3::Ipv4InterfaceAddress::SetBroadcast(ns3::Ipv4Address broadcast) [member function]
cls.add_method('SetBroadcast',
'void',
[param('ns3::Ipv4Address', 'broadcast')])
## ipv4-interface-address.h (module 'internet'): void ns3::Ipv4InterfaceAddress::SetLocal(ns3::Ipv4Address local) [member function]
cls.add_method('SetLocal',
'void',
[param('ns3::Ipv4Address', 'local')])
## ipv4-interface-address.h (module 'internet'): void ns3::Ipv4InterfaceAddress::SetMask(ns3::Ipv4Mask mask) [member function]
cls.add_method('SetMask',
'void',
[param('ns3::Ipv4Mask', 'mask')])
## ipv4-interface-address.h (module 'internet'): void ns3::Ipv4InterfaceAddress::SetPrimary() [member function]
cls.add_method('SetPrimary',
'void',
[])
## ipv4-interface-address.h (module 'internet'): void ns3::Ipv4InterfaceAddress::SetScope(ns3::Ipv4InterfaceAddress::InterfaceAddressScope_e scope) [member function]
cls.add_method('SetScope',
'void',
[param('ns3::Ipv4InterfaceAddress::InterfaceAddressScope_e', 'scope')])
## ipv4-interface-address.h (module 'internet'): void ns3::Ipv4InterfaceAddress::SetSecondary() [member function]
cls.add_method('SetSecondary',
'void',
[])
return
def register_Ns3Ipv4Mask_methods(root_module, cls):
cls.add_output_stream_operator()
cls.add_binary_comparison_operator('==')
cls.add_binary_comparison_operator('!=')
## ipv4-address.h (module 'network'): ns3::Ipv4Mask::Ipv4Mask(ns3::Ipv4Mask const & arg0) [constructor]
cls.add_constructor([param('ns3::Ipv4Mask const &', 'arg0')])
## ipv4-address.h (module 'network'): ns3::Ipv4Mask::Ipv4Mask() [constructor]
cls.add_constructor([])
## ipv4-address.h (module 'network'): ns3::Ipv4Mask::Ipv4Mask(uint32_t mask) [constructor]
cls.add_constructor([param('uint32_t', 'mask')])
## ipv4-address.h (module 'network'): ns3::Ipv4Mask::Ipv4Mask(char const * mask) [constructor]
cls.add_constructor([param('char const *', 'mask')])
## ipv4-address.h (module 'network'): uint32_t ns3::Ipv4Mask::Get() const [member function]
cls.add_method('Get',
'uint32_t',
[],
is_const=True)
## ipv4-address.h (module 'network'): uint32_t ns3::Ipv4Mask::GetInverse() const [member function]
cls.add_method('GetInverse',
'uint32_t',
[],
is_const=True)
## ipv4-address.h (module 'network'): static ns3::Ipv4Mask ns3::Ipv4Mask::GetLoopback() [member function]
cls.add_method('GetLoopback',
'ns3::Ipv4Mask',
[],
is_static=True)
## ipv4-address.h (module 'network'): static ns3::Ipv4Mask ns3::Ipv4Mask::GetOnes() [member function]
cls.add_method('GetOnes',
'ns3::Ipv4Mask',
[],
is_static=True)
## ipv4-address.h (module 'network'): uint16_t ns3::Ipv4Mask::GetPrefixLength() const [member function]
cls.add_method('GetPrefixLength',
'uint16_t',
[],
is_const=True)
## ipv4-address.h (module 'network'): static ns3::Ipv4Mask ns3::Ipv4Mask::GetZero() [member function]
cls.add_method('GetZero',
'ns3::Ipv4Mask',
[],
is_static=True)
## ipv4-address.h (module 'network'): bool ns3::Ipv4Mask::IsMatch(ns3::Ipv4Address a, ns3::Ipv4Address b) const [member function]
cls.add_method('IsMatch',
'bool',
[param('ns3::Ipv4Address', 'a'), param('ns3::Ipv4Address', 'b')],
is_const=True)
## ipv4-address.h (module 'network'): void ns3::Ipv4Mask::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True)
## ipv4-address.h (module 'network'): void ns3::Ipv4Mask::Set(uint32_t mask) [member function]
cls.add_method('Set',
'void',
[param('uint32_t', 'mask')])
return
def register_Ns3Ipv6Address_methods(root_module, cls):
cls.add_output_stream_operator()
cls.add_binary_comparison_operator('==')
cls.add_binary_comparison_operator('!=')
cls.add_binary_comparison_operator('<')
## ipv6-address.h (module 'network'): ns3::Ipv6Address::Ipv6Address() [constructor]
cls.add_constructor([])
## ipv6-address.h (module 'network'): ns3::Ipv6Address::Ipv6Address(char const * address) [constructor]
cls.add_constructor([param('char const *', 'address')])
## ipv6-address.h (module 'network'): ns3::Ipv6Address::Ipv6Address(uint8_t * address) [constructor]
cls.add_constructor([param('uint8_t *', 'address')])
## ipv6-address.h (module 'network'): ns3::Ipv6Address::Ipv6Address(ns3::Ipv6Address const & addr) [constructor]
cls.add_constructor([param('ns3::Ipv6Address const &', 'addr')])
## ipv6-address.h (module 'network'): ns3::Ipv6Address::Ipv6Address(ns3::Ipv6Address const * addr) [constructor]
cls.add_constructor([param('ns3::Ipv6Address const *', 'addr')])
## ipv6-address.h (module 'network'): ns3::Ipv6Address ns3::Ipv6Address::CombinePrefix(ns3::Ipv6Prefix const & prefix) const [member function]
cls.add_method('CombinePrefix',
'ns3::Ipv6Address',
[param('ns3::Ipv6Prefix const &', 'prefix')],
is_const=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::ConvertFrom(ns3::Address const & address) [member function]
cls.add_method('ConvertFrom',
'ns3::Ipv6Address',
[param('ns3::Address const &', 'address')],
is_static=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::Deserialize(uint8_t const * buf) [member function]
cls.add_method('Deserialize',
'ns3::Ipv6Address',
[param('uint8_t const *', 'buf')],
is_static=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::GetAllHostsMulticast() [member function]
cls.add_method('GetAllHostsMulticast',
'ns3::Ipv6Address',
[],
is_static=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::GetAllNodesMulticast() [member function]
cls.add_method('GetAllNodesMulticast',
'ns3::Ipv6Address',
[],
is_static=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::GetAllRoutersMulticast() [member function]
cls.add_method('GetAllRoutersMulticast',
'ns3::Ipv6Address',
[],
is_static=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::GetAny() [member function]
cls.add_method('GetAny',
'ns3::Ipv6Address',
[],
is_static=True)
## ipv6-address.h (module 'network'): void ns3::Ipv6Address::GetBytes(uint8_t * buf) const [member function]
cls.add_method('GetBytes',
'void',
[param('uint8_t *', 'buf')],
is_const=True)
## ipv6-address.h (module 'network'): ns3::Ipv4Address ns3::Ipv6Address::GetIpv4MappedAddress() const [member function]
cls.add_method('GetIpv4MappedAddress',
'ns3::Ipv4Address',
[],
is_const=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::GetLoopback() [member function]
cls.add_method('GetLoopback',
'ns3::Ipv6Address',
[],
is_static=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::GetOnes() [member function]
cls.add_method('GetOnes',
'ns3::Ipv6Address',
[],
is_static=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::GetZero() [member function]
cls.add_method('GetZero',
'ns3::Ipv6Address',
[],
is_static=True)
## ipv6-address.h (module 'network'): bool ns3::Ipv6Address::HasPrefix(ns3::Ipv6Prefix const & prefix) const [member function]
cls.add_method('HasPrefix',
'bool',
[param('ns3::Ipv6Prefix const &', 'prefix')],
is_const=True)
## ipv6-address.h (module 'network'): bool ns3::Ipv6Address::IsAllNodesMulticast() const [member function]
cls.add_method('IsAllNodesMulticast',
'bool',
[],
is_const=True)
## ipv6-address.h (module 'network'): bool ns3::Ipv6Address::IsAllRoutersMulticast() const [member function]
cls.add_method('IsAllRoutersMulticast',
'bool',
[],
is_const=True)
## ipv6-address.h (module 'network'): bool ns3::Ipv6Address::IsAny() const [member function]
cls.add_method('IsAny',
'bool',
[],
is_const=True)
## ipv6-address.h (module 'network'): bool ns3::Ipv6Address::IsDocumentation() const [member function]
cls.add_method('IsDocumentation',
'bool',
[],
is_const=True)
## ipv6-address.h (module 'network'): bool ns3::Ipv6Address::IsInitialized() const [member function]
cls.add_method('IsInitialized',
'bool',
[],
is_const=True)
## ipv6-address.h (module 'network'): bool ns3::Ipv6Address::IsIpv4MappedAddress() const [member function]
cls.add_method('IsIpv4MappedAddress',
'bool',
[],
is_const=True)
## ipv6-address.h (module 'network'): bool ns3::Ipv6Address::IsLinkLocal() const [member function]
cls.add_method('IsLinkLocal',
'bool',
[],
is_const=True)
## ipv6-address.h (module 'network'): bool ns3::Ipv6Address::IsLinkLocalMulticast() const [member function]
cls.add_method('IsLinkLocalMulticast',
'bool',
[],
is_const=True)
## ipv6-address.h (module 'network'): bool ns3::Ipv6Address::IsLocalhost() const [member function]
cls.add_method('IsLocalhost',
'bool',
[],
is_const=True)
## ipv6-address.h (module 'network'): static bool ns3::Ipv6Address::IsMatchingType(ns3::Address const & address) [member function]
cls.add_method('IsMatchingType',
'bool',
[param('ns3::Address const &', 'address')],
is_static=True)
## ipv6-address.h (module 'network'): bool ns3::Ipv6Address::IsMulticast() const [member function]
cls.add_method('IsMulticast',
'bool',
[],
is_const=True)
## ipv6-address.h (module 'network'): bool ns3::Ipv6Address::IsSolicitedMulticast() const [member function]
cls.add_method('IsSolicitedMulticast',
'bool',
[],
is_const=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::MakeAutoconfiguredAddress(ns3::Address addr, ns3::Ipv6Address prefix) [member function]
cls.add_method('MakeAutoconfiguredAddress',
'ns3::Ipv6Address',
[param('ns3::Address', 'addr'), param('ns3::Ipv6Address', 'prefix')],
is_static=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::MakeAutoconfiguredAddress(ns3::Address addr, ns3::Ipv6Prefix prefix) [member function]
cls.add_method('MakeAutoconfiguredAddress',
'ns3::Ipv6Address',
[param('ns3::Address', 'addr'), param('ns3::Ipv6Prefix', 'prefix')],
is_static=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::MakeAutoconfiguredAddress(ns3::Mac16Address addr, ns3::Ipv6Address prefix) [member function]
cls.add_method('MakeAutoconfiguredAddress',
'ns3::Ipv6Address',
[param('ns3::Mac16Address', 'addr'), param('ns3::Ipv6Address', 'prefix')],
is_static=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::MakeAutoconfiguredAddress(ns3::Mac48Address addr, ns3::Ipv6Address prefix) [member function]
cls.add_method('MakeAutoconfiguredAddress',
'ns3::Ipv6Address',
[param('ns3::Mac48Address', 'addr'), param('ns3::Ipv6Address', 'prefix')],
is_static=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::MakeAutoconfiguredAddress(ns3::Mac64Address addr, ns3::Ipv6Address prefix) [member function]
cls.add_method('MakeAutoconfiguredAddress',
'ns3::Ipv6Address',
[param('ns3::Mac64Address', 'addr'), param('ns3::Ipv6Address', 'prefix')],
is_static=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::MakeAutoconfiguredAddress(ns3::Mac8Address addr, ns3::Ipv6Address prefix) [member function]
cls.add_method('MakeAutoconfiguredAddress',
'ns3::Ipv6Address',
[param('ns3::Mac8Address', 'addr'), param('ns3::Ipv6Address', 'prefix')],
is_static=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::MakeAutoconfiguredLinkLocalAddress(ns3::Address mac) [member function]
cls.add_method('MakeAutoconfiguredLinkLocalAddress',
'ns3::Ipv6Address',
[param('ns3::Address', 'mac')],
is_static=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::MakeAutoconfiguredLinkLocalAddress(ns3::Mac16Address mac) [member function]
cls.add_method('MakeAutoconfiguredLinkLocalAddress',
'ns3::Ipv6Address',
[param('ns3::Mac16Address', 'mac')],
is_static=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::MakeAutoconfiguredLinkLocalAddress(ns3::Mac48Address mac) [member function]
cls.add_method('MakeAutoconfiguredLinkLocalAddress',
'ns3::Ipv6Address',
[param('ns3::Mac48Address', 'mac')],
is_static=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::MakeAutoconfiguredLinkLocalAddress(ns3::Mac64Address mac) [member function]
cls.add_method('MakeAutoconfiguredLinkLocalAddress',
'ns3::Ipv6Address',
[param('ns3::Mac64Address', 'mac')],
is_static=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::MakeAutoconfiguredLinkLocalAddress(ns3::Mac8Address mac) [member function]
cls.add_method('MakeAutoconfiguredLinkLocalAddress',
'ns3::Ipv6Address',
[param('ns3::Mac8Address', 'mac')],
is_static=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::MakeIpv4MappedAddress(ns3::Ipv4Address addr) [member function]
cls.add_method('MakeIpv4MappedAddress',
'ns3::Ipv6Address',
[param('ns3::Ipv4Address', 'addr')],
is_static=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::MakeSolicitedAddress(ns3::Ipv6Address addr) [member function]
cls.add_method('MakeSolicitedAddress',
'ns3::Ipv6Address',
[param('ns3::Ipv6Address', 'addr')],
is_static=True)
## ipv6-address.h (module 'network'): void ns3::Ipv6Address::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True)
## ipv6-address.h (module 'network'): void ns3::Ipv6Address::Serialize(uint8_t * buf) const [member function]
cls.add_method('Serialize',
'void',
[param('uint8_t *', 'buf')],
is_const=True)
## ipv6-address.h (module 'network'): void ns3::Ipv6Address::Set(char const * address) [member function]
cls.add_method('Set',
'void',
[param('char const *', 'address')])
## ipv6-address.h (module 'network'): void ns3::Ipv6Address::Set(uint8_t * address) [member function]
cls.add_method('Set',
'void',
[param('uint8_t *', 'address')])
return
def register_Ns3Ipv6AddressHash_methods(root_module, cls):
## ipv6-address.h (module 'network'): ns3::Ipv6AddressHash::Ipv6AddressHash() [constructor]
cls.add_constructor([])
## ipv6-address.h (module 'network'): ns3::Ipv6AddressHash::Ipv6AddressHash(ns3::Ipv6AddressHash const & arg0) [constructor]
cls.add_constructor([param('ns3::Ipv6AddressHash const &', 'arg0')])
## ipv6-address.h (module 'network'): size_t ns3::Ipv6AddressHash::operator()(ns3::Ipv6Address const & x) const [member operator]
cls.add_method('operator()',
'size_t',
[param('ns3::Ipv6Address const &', 'x')],
custom_name='__call__', is_const=True)
return
def register_Ns3Ipv6Prefix_methods(root_module, cls):
cls.add_output_stream_operator()
cls.add_binary_comparison_operator('==')
cls.add_binary_comparison_operator('!=')
## ipv6-address.h (module 'network'): ns3::Ipv6Prefix::Ipv6Prefix() [constructor]
cls.add_constructor([])
## ipv6-address.h (module 'network'): ns3::Ipv6Prefix::Ipv6Prefix(uint8_t * prefix) [constructor]
cls.add_constructor([param('uint8_t *', 'prefix')])
## ipv6-address.h (module 'network'): ns3::Ipv6Prefix::Ipv6Prefix(char const * prefix) [constructor]
cls.add_constructor([param('char const *', 'prefix')])
## ipv6-address.h (module 'network'): ns3::Ipv6Prefix::Ipv6Prefix(uint8_t * prefix, uint8_t prefixLength) [constructor]
cls.add_constructor([param('uint8_t *', 'prefix'), param('uint8_t', 'prefixLength')])
## ipv6-address.h (module 'network'): ns3::Ipv6Prefix::Ipv6Prefix(char const * prefix, uint8_t prefixLength) [constructor]
cls.add_constructor([param('char const *', 'prefix'), param('uint8_t', 'prefixLength')])
## ipv6-address.h (module 'network'): ns3::Ipv6Prefix::Ipv6Prefix(uint8_t prefix) [constructor]
cls.add_constructor([param('uint8_t', 'prefix')])
## ipv6-address.h (module 'network'): ns3::Ipv6Prefix::Ipv6Prefix(ns3::Ipv6Prefix const & prefix) [constructor]
cls.add_constructor([param('ns3::Ipv6Prefix const &', 'prefix')])
## ipv6-address.h (module 'network'): ns3::Ipv6Prefix::Ipv6Prefix(ns3::Ipv6Prefix const * prefix) [constructor]
cls.add_constructor([param('ns3::Ipv6Prefix const *', 'prefix')])
## ipv6-address.h (module 'network'): ns3::Ipv6Address ns3::Ipv6Prefix::ConvertToIpv6Address() const [member function]
cls.add_method('ConvertToIpv6Address',
'ns3::Ipv6Address',
[],
is_const=True)
## ipv6-address.h (module 'network'): void ns3::Ipv6Prefix::GetBytes(uint8_t * buf) const [member function]
cls.add_method('GetBytes',
'void',
[param('uint8_t *', 'buf')],
is_const=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Prefix ns3::Ipv6Prefix::GetLoopback() [member function]
cls.add_method('GetLoopback',
'ns3::Ipv6Prefix',
[],
is_static=True)
## ipv6-address.h (module 'network'): uint8_t ns3::Ipv6Prefix::GetMinimumPrefixLength() const [member function]
cls.add_method('GetMinimumPrefixLength',
'uint8_t',
[],
is_const=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Prefix ns3::Ipv6Prefix::GetOnes() [member function]
cls.add_method('GetOnes',
'ns3::Ipv6Prefix',
[],
is_static=True)
## ipv6-address.h (module 'network'): uint8_t ns3::Ipv6Prefix::GetPrefixLength() const [member function]
cls.add_method('GetPrefixLength',
'uint8_t',
[],
is_const=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Prefix ns3::Ipv6Prefix::GetZero() [member function]
cls.add_method('GetZero',
'ns3::Ipv6Prefix',
[],
is_static=True)
## ipv6-address.h (module 'network'): bool ns3::Ipv6Prefix::IsMatch(ns3::Ipv6Address a, ns3::Ipv6Address b) const [member function]
cls.add_method('IsMatch',
'bool',
[param('ns3::Ipv6Address', 'a'), param('ns3::Ipv6Address', 'b')],
is_const=True)
## ipv6-address.h (module 'network'): void ns3::Ipv6Prefix::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True)
## ipv6-address.h (module 'network'): void ns3::Ipv6Prefix::SetPrefixLength(uint8_t prefixLength) [member function]
cls.add_method('SetPrefixLength',
'void',
[param('uint8_t', 'prefixLength')])
return
def register_Ns3LogComponent_methods(root_module, cls):
## log.h (module 'core'): ns3::LogComponent::LogComponent(ns3::LogComponent const & arg0) [constructor]
cls.add_constructor([param('ns3::LogComponent const &', 'arg0')])
## log.h (module 'core'): ns3::LogComponent::LogComponent(std::string const & name, std::string const & file, ns3::LogLevel const mask=::ns3::LogLevel::LOG_NONE) [constructor]
cls.add_constructor([param('std::string const &', 'name'), param('std::string const &', 'file'), param('ns3::LogLevel const', 'mask', default_value='::ns3::LogLevel::LOG_NONE')])
## log.h (module 'core'): void ns3::LogComponent::Disable(ns3::LogLevel const level) [member function]
cls.add_method('Disable',
'void',
[param('ns3::LogLevel const', 'level')])
## log.h (module 'core'): void ns3::LogComponent::Enable(ns3::LogLevel const level) [member function]
cls.add_method('Enable',
'void',
[param('ns3::LogLevel const', 'level')])
## log.h (module 'core'): std::string ns3::LogComponent::File() const [member function]
cls.add_method('File',
'std::string',
[],
is_const=True)
## log.h (module 'core'): static ns3::LogComponent::ComponentList * ns3::LogComponent::GetComponentList() [member function]
cls.add_method('GetComponentList',
'ns3::LogComponent::ComponentList *',
[],
is_static=True)
## log.h (module 'core'): static std::string ns3::LogComponent::GetLevelLabel(ns3::LogLevel const level) [member function]
cls.add_method('GetLevelLabel',
'std::string',
[param('ns3::LogLevel const', 'level')],
is_static=True)
## log.h (module 'core'): bool ns3::LogComponent::IsEnabled(ns3::LogLevel const level) const [member function]
cls.add_method('IsEnabled',
'bool',
[param('ns3::LogLevel const', 'level')],
is_const=True)
## log.h (module 'core'): bool ns3::LogComponent::IsNoneEnabled() const [member function]
cls.add_method('IsNoneEnabled',
'bool',
[],
is_const=True)
## log.h (module 'core'): char const * ns3::LogComponent::Name() const [member function]
cls.add_method('Name',
'char const *',
[],
is_const=True)
## log.h (module 'core'): void ns3::LogComponent::SetMask(ns3::LogLevel const level) [member function]
cls.add_method('SetMask',
'void',
[param('ns3::LogLevel const', 'level')])
return
def register_Ns3Mac48Address_methods(root_module, cls):
cls.add_binary_comparison_operator('==')
cls.add_binary_comparison_operator('!=')
cls.add_binary_comparison_operator('<')
cls.add_output_stream_operator()
## mac48-address.h (module 'network'): ns3::Mac48Address::Mac48Address(ns3::Mac48Address const & arg0) [constructor]
cls.add_constructor([param('ns3::Mac48Address const &', 'arg0')])
## mac48-address.h (module 'network'): ns3::Mac48Address::Mac48Address() [constructor]
cls.add_constructor([])
## mac48-address.h (module 'network'): ns3::Mac48Address::Mac48Address(char const * str) [constructor]
cls.add_constructor([param('char const *', 'str')])
## mac48-address.h (module 'network'): static ns3::Mac48Address ns3::Mac48Address::Allocate() [member function]
cls.add_method('Allocate',
'ns3::Mac48Address',
[],
is_static=True)
## mac48-address.h (module 'network'): static ns3::Mac48Address ns3::Mac48Address::ConvertFrom(ns3::Address const & address) [member function]
cls.add_method('ConvertFrom',
'ns3::Mac48Address',
[param('ns3::Address const &', 'address')],
is_static=True)
## mac48-address.h (module 'network'): void ns3::Mac48Address::CopyFrom(uint8_t const * buffer) [member function]
cls.add_method('CopyFrom',
'void',
[param('uint8_t const *', 'buffer')])
## mac48-address.h (module 'network'): void ns3::Mac48Address::CopyTo(uint8_t * buffer) const [member function]
cls.add_method('CopyTo',
'void',
[param('uint8_t *', 'buffer')],
is_const=True)
## mac48-address.h (module 'network'): static ns3::Mac48Address ns3::Mac48Address::GetBroadcast() [member function]
cls.add_method('GetBroadcast',
'ns3::Mac48Address',
[],
is_static=True)
## mac48-address.h (module 'network'): static ns3::Mac48Address ns3::Mac48Address::GetMulticast(ns3::Ipv4Address address) [member function]
cls.add_method('GetMulticast',
'ns3::Mac48Address',
[param('ns3::Ipv4Address', 'address')],
is_static=True)
## mac48-address.h (module 'network'): static ns3::Mac48Address ns3::Mac48Address::GetMulticast(ns3::Ipv6Address address) [member function]
cls.add_method('GetMulticast',
'ns3::Mac48Address',
[param('ns3::Ipv6Address', 'address')],
is_static=True)
## mac48-address.h (module 'network'): static ns3::Mac48Address ns3::Mac48Address::GetMulticast6Prefix() [member function]
cls.add_method('GetMulticast6Prefix',
'ns3::Mac48Address',
[],
is_static=True)
## mac48-address.h (module 'network'): static ns3::Mac48Address ns3::Mac48Address::GetMulticastPrefix() [member function]
cls.add_method('GetMulticastPrefix',
'ns3::Mac48Address',
[],
is_static=True)
## mac48-address.h (module 'network'): bool ns3::Mac48Address::IsBroadcast() const [member function]
cls.add_method('IsBroadcast',
'bool',
[],
is_const=True)
## mac48-address.h (module 'network'): bool ns3::Mac48Address::IsGroup() const [member function]
cls.add_method('IsGroup',
'bool',
[],
is_const=True)
## mac48-address.h (module 'network'): static bool ns3::Mac48Address::IsMatchingType(ns3::Address const & address) [member function]
cls.add_method('IsMatchingType',
'bool',
[param('ns3::Address const &', 'address')],
is_static=True)
return
def register_Ns3Mac8Address_methods(root_module, cls):
cls.add_binary_comparison_operator('<')
cls.add_binary_comparison_operator('==')
cls.add_binary_comparison_operator('!=')
cls.add_output_stream_operator()
## mac8-address.h (module 'network'): ns3::Mac8Address::Mac8Address(ns3::Mac8Address const & arg0) [constructor]
cls.add_constructor([param('ns3::Mac8Address const &', 'arg0')])
## mac8-address.h (module 'network'): ns3::Mac8Address::Mac8Address() [constructor]
cls.add_constructor([])
## mac8-address.h (module 'network'): ns3::Mac8Address::Mac8Address(uint8_t addr) [constructor]
cls.add_constructor([param('uint8_t', 'addr')])
## mac8-address.h (module 'network'): static ns3::Mac8Address ns3::Mac8Address::Allocate() [member function]
cls.add_method('Allocate',
'ns3::Mac8Address',
[],
is_static=True)
## mac8-address.h (module 'network'): static ns3::Mac8Address ns3::Mac8Address::ConvertFrom(ns3::Address const & address) [member function]
cls.add_method('ConvertFrom',
'ns3::Mac8Address',
[param('ns3::Address const &', 'address')],
is_static=True)
## mac8-address.h (module 'network'): void ns3::Mac8Address::CopyFrom(uint8_t const * pBuffer) [member function]
cls.add_method('CopyFrom',
'void',
[param('uint8_t const *', 'pBuffer')])
## mac8-address.h (module 'network'): void ns3::Mac8Address::CopyTo(uint8_t * pBuffer) const [member function]
cls.add_method('CopyTo',
'void',
[param('uint8_t *', 'pBuffer')],
is_const=True)
## mac8-address.h (module 'network'): static ns3::Mac8Address ns3::Mac8Address::GetBroadcast() [member function]
cls.add_method('GetBroadcast',
'ns3::Mac8Address',
[],
is_static=True)
## mac8-address.h (module 'network'): static bool ns3::Mac8Address::IsMatchingType(ns3::Address const & address) [member function]
cls.add_method('IsMatchingType',
'bool',
[param('ns3::Address const &', 'address')],
is_static=True)
return
def register_Ns3NodeContainer_methods(root_module, cls):
## node-container.h (module 'network'): ns3::NodeContainer::NodeContainer(ns3::NodeContainer const & arg0) [constructor]
cls.add_constructor([param('ns3::NodeContainer const &', 'arg0')])
## node-container.h (module 'network'): ns3::NodeContainer::NodeContainer() [constructor]
cls.add_constructor([])
## node-container.h (module 'network'): ns3::NodeContainer::NodeContainer(ns3::Ptr<ns3::Node> node) [constructor]
cls.add_constructor([param('ns3::Ptr< ns3::Node >', 'node')])
## node-container.h (module 'network'): ns3::NodeContainer::NodeContainer(std::string nodeName) [constructor]
cls.add_constructor([param('std::string', 'nodeName')])
## node-container.h (module 'network'): ns3::NodeContainer::NodeContainer(uint32_t n, uint32_t systemId=0) [constructor]
cls.add_constructor([param('uint32_t', 'n'), param('uint32_t', 'systemId', default_value='0')])
## node-container.h (module 'network'): ns3::NodeContainer::NodeContainer(ns3::NodeContainer const & a, ns3::NodeContainer const & b) [constructor]
cls.add_constructor([param('ns3::NodeContainer const &', 'a'), param('ns3::NodeContainer const &', 'b')])
## node-container.h (module 'network'): ns3::NodeContainer::NodeContainer(ns3::NodeContainer const & a, ns3::NodeContainer const & b, ns3::NodeContainer const & c) [constructor]
cls.add_constructor([param('ns3::NodeContainer const &', 'a'), param('ns3::NodeContainer const &', 'b'), param('ns3::NodeContainer const &', 'c')])
## node-container.h (module 'network'): ns3::NodeContainer::NodeContainer(ns3::NodeContainer const & a, ns3::NodeContainer const & b, ns3::NodeContainer const & c, ns3::NodeContainer const & d) [constructor]
cls.add_constructor([param('ns3::NodeContainer const &', 'a'), param('ns3::NodeContainer const &', 'b'), param('ns3::NodeContainer const &', 'c'), param('ns3::NodeContainer const &', 'd')])
## node-container.h (module 'network'): ns3::NodeContainer::NodeContainer(ns3::NodeContainer const & a, ns3::NodeContainer const & b, ns3::NodeContainer const & c, ns3::NodeContainer const & d, ns3::NodeContainer const & e) [constructor]
cls.add_constructor([param('ns3::NodeContainer const &', 'a'), param('ns3::NodeContainer const &', 'b'), param('ns3::NodeContainer const &', 'c'), param('ns3::NodeContainer const &', 'd'), param('ns3::NodeContainer const &', 'e')])
## node-container.h (module 'network'): void ns3::NodeContainer::Add(ns3::NodeContainer other) [member function]
cls.add_method('Add',
'void',
[param('ns3::NodeContainer', 'other')])
## node-container.h (module 'network'): void ns3::NodeContainer::Add(ns3::Ptr<ns3::Node> node) [member function]
cls.add_method('Add',
'void',
[param('ns3::Ptr< ns3::Node >', 'node')])
## node-container.h (module 'network'): void ns3::NodeContainer::Add(std::string nodeName) [member function]
cls.add_method('Add',
'void',
[param('std::string', 'nodeName')])
## node-container.h (module 'network'): ns3::NodeContainer::Iterator ns3::NodeContainer::Begin() const [member function]
cls.add_method('Begin',
'ns3::NodeContainer::Iterator',
[],
is_const=True)
## node-container.h (module 'network'): bool ns3::NodeContainer::Contains(uint32_t id) const [member function]
cls.add_method('Contains',
'bool',
[param('uint32_t', 'id')],
is_const=True)
## node-container.h (module 'network'): void ns3::NodeContainer::Create(uint32_t n) [member function]
cls.add_method('Create',
'void',
[param('uint32_t', 'n')])
## node-container.h (module 'network'): void ns3::NodeContainer::Create(uint32_t n, uint32_t systemId) [member function]
cls.add_method('Create',
'void',
[param('uint32_t', 'n'), param('uint32_t', 'systemId')])
## node-container.h (module 'network'): ns3::NodeContainer::Iterator ns3::NodeContainer::End() const [member function]
cls.add_method('End',
'ns3::NodeContainer::Iterator',
[],
is_const=True)
## node-container.h (module 'network'): ns3::Ptr<ns3::Node> ns3::NodeContainer::Get(uint32_t i) const [member function]
cls.add_method('Get',
'ns3::Ptr< ns3::Node >',
[param('uint32_t', 'i')],
is_const=True)
## node-container.h (module 'network'): static ns3::NodeContainer ns3::NodeContainer::GetGlobal() [member function]
cls.add_method('GetGlobal',
'ns3::NodeContainer',
[],
is_static=True)
## node-container.h (module 'network'): uint32_t ns3::NodeContainer::GetN() const [member function]
cls.add_method('GetN',
'uint32_t',
[],
is_const=True)
return
def register_Ns3NonCopyable_methods(root_module, cls):
## non-copyable.h (module 'core'): ns3::NonCopyable::NonCopyable() [constructor]
cls.add_constructor([],
visibility='protected')
return
def register_Ns3ObjectBase_methods(root_module, cls):
## object-base.h (module 'core'): ns3::ObjectBase::ObjectBase() [constructor]
cls.add_constructor([])
## object-base.h (module 'core'): ns3::ObjectBase::ObjectBase(ns3::ObjectBase const & arg0) [constructor]
cls.add_constructor([param('ns3::ObjectBase const &', 'arg0')])
## object-base.h (module 'core'): void ns3::ObjectBase::GetAttribute(std::string name, ns3::AttributeValue & value) const [member function]
cls.add_method('GetAttribute',
'void',
[param('std::string', 'name'), param('ns3::AttributeValue &', 'value')],
is_const=True)
## object-base.h (module 'core'): bool ns3::ObjectBase::GetAttributeFailSafe(std::string name, ns3::AttributeValue & value) const [member function]
cls.add_method('GetAttributeFailSafe',
'bool',
[param('std::string', 'name'), param('ns3::AttributeValue &', 'value')],
is_const=True)
## object-base.h (module 'core'): ns3::TypeId ns3::ObjectBase::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_pure_virtual=True, is_virtual=True)
## object-base.h (module 'core'): static ns3::TypeId ns3::ObjectBase::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## object-base.h (module 'core'): void ns3::ObjectBase::SetAttribute(std::string name, ns3::AttributeValue const & value) [member function]
cls.add_method('SetAttribute',
'void',
[param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')])
## object-base.h (module 'core'): bool ns3::ObjectBase::SetAttributeFailSafe(std::string name, ns3::AttributeValue const & value) [member function]
cls.add_method('SetAttributeFailSafe',
'bool',
[param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')])
## object-base.h (module 'core'): bool ns3::ObjectBase::TraceConnect(std::string name, std::string context, ns3::CallbackBase const & cb) [member function]
cls.add_method('TraceConnect',
'bool',
[param('std::string', 'name'), param('std::string', 'context'), param('ns3::CallbackBase const &', 'cb')])
## object-base.h (module 'core'): bool ns3::ObjectBase::TraceConnectWithoutContext(std::string name, ns3::CallbackBase const & cb) [member function]
cls.add_method('TraceConnectWithoutContext',
'bool',
[param('std::string', 'name'), param('ns3::CallbackBase const &', 'cb')])
## object-base.h (module 'core'): bool ns3::ObjectBase::TraceDisconnect(std::string name, std::string context, ns3::CallbackBase const & cb) [member function]
cls.add_method('TraceDisconnect',
'bool',
[param('std::string', 'name'), param('std::string', 'context'), param('ns3::CallbackBase const &', 'cb')])
## object-base.h (module 'core'): bool ns3::ObjectBase::TraceDisconnectWithoutContext(std::string name, ns3::CallbackBase const & cb) [member function]
cls.add_method('TraceDisconnectWithoutContext',
'bool',
[param('std::string', 'name'), param('ns3::CallbackBase const &', 'cb')])
## object-base.h (module 'core'): void ns3::ObjectBase::ConstructSelf(ns3::AttributeConstructionList const & attributes) [member function]
cls.add_method('ConstructSelf',
'void',
[param('ns3::AttributeConstructionList const &', 'attributes')],
visibility='protected')
## object-base.h (module 'core'): void ns3::ObjectBase::NotifyConstructionCompleted() [member function]
cls.add_method('NotifyConstructionCompleted',
'void',
[],
is_virtual=True, visibility='protected')
return
def register_Ns3ObjectDeleter_methods(root_module, cls):
## object.h (module 'core'): ns3::ObjectDeleter::ObjectDeleter() [constructor]
cls.add_constructor([])
## object.h (module 'core'): ns3::ObjectDeleter::ObjectDeleter(ns3::ObjectDeleter const & arg0) [constructor]
cls.add_constructor([param('ns3::ObjectDeleter const &', 'arg0')])
## object.h (module 'core'): static void ns3::ObjectDeleter::Delete(ns3::Object * object) [member function]
cls.add_method('Delete',
'void',
[param('ns3::Object *', 'object')],
is_static=True)
return
def register_Ns3ObjectFactory_methods(root_module, cls):
cls.add_output_stream_operator()
## object-factory.h (module 'core'): ns3::ObjectFactory::ObjectFactory(ns3::ObjectFactory const & arg0) [constructor]
cls.add_constructor([param('ns3::ObjectFactory const &', 'arg0')])
## object-factory.h (module 'core'): ns3::ObjectFactory::ObjectFactory() [constructor]
cls.add_constructor([])
## object-factory.h (module 'core'): ns3::ObjectFactory::ObjectFactory(std::string const & typeId) [constructor]
cls.add_constructor([param('std::string const &', 'typeId')])
## object-factory.h (module 'core'): ns3::Ptr<ns3::Object> ns3::ObjectFactory::Create() const [member function]
cls.add_method('Create',
'ns3::Ptr< ns3::Object >',
[],
is_const=True)
## object-factory.h (module 'core'): ns3::TypeId ns3::ObjectFactory::GetTypeId() const [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_const=True)
## object-factory.h (module 'core'): bool ns3::ObjectFactory::IsTypeIdSet() const [member function]
cls.add_method('IsTypeIdSet',
'bool',
[],
is_const=True)
## object-factory.h (module 'core'): void ns3::ObjectFactory::Set() [member function]
cls.add_method('Set',
'void',
[])
## object-factory.h (module 'core'): void ns3::ObjectFactory::SetTypeId(ns3::TypeId tid) [member function]
cls.add_method('SetTypeId',
'void',
[param('ns3::TypeId', 'tid')])
## object-factory.h (module 'core'): void ns3::ObjectFactory::SetTypeId(char const * tid) [member function]
cls.add_method('SetTypeId',
'void',
[param('char const *', 'tid')])
## object-factory.h (module 'core'): void ns3::ObjectFactory::SetTypeId(std::string tid) [member function]
cls.add_method('SetTypeId',
'void',
[param('std::string', 'tid')])
return
def register_Ns3PacketMetadata_methods(root_module, cls):
## packet-metadata.h (module 'network'): ns3::PacketMetadata::PacketMetadata(uint64_t uid, uint32_t size) [constructor]
cls.add_constructor([param('uint64_t', 'uid'), param('uint32_t', 'size')])
## packet-metadata.h (module 'network'): ns3::PacketMetadata::PacketMetadata(ns3::PacketMetadata const & o) [constructor]
cls.add_constructor([param('ns3::PacketMetadata const &', 'o')])
## packet-metadata.h (module 'network'): void ns3::PacketMetadata::AddAtEnd(ns3::PacketMetadata const & o) [member function]
cls.add_method('AddAtEnd',
'void',
[param('ns3::PacketMetadata const &', 'o')])
## packet-metadata.h (module 'network'): void ns3::PacketMetadata::AddHeader(ns3::Header const & header, uint32_t size) [member function]
cls.add_method('AddHeader',
'void',
[param('ns3::Header const &', 'header'), param('uint32_t', 'size')])
## packet-metadata.h (module 'network'): void ns3::PacketMetadata::AddPaddingAtEnd(uint32_t end) [member function]
cls.add_method('AddPaddingAtEnd',
'void',
[param('uint32_t', 'end')])
## packet-metadata.h (module 'network'): void ns3::PacketMetadata::AddTrailer(ns3::Trailer const & trailer, uint32_t size) [member function]
cls.add_method('AddTrailer',
'void',
[param('ns3::Trailer const &', 'trailer'), param('uint32_t', 'size')])
## packet-metadata.h (module 'network'): ns3::PacketMetadata::ItemIterator ns3::PacketMetadata::BeginItem(ns3::Buffer buffer) const [member function]
cls.add_method('BeginItem',
'ns3::PacketMetadata::ItemIterator',
[param('ns3::Buffer', 'buffer')],
is_const=True)
## packet-metadata.h (module 'network'): ns3::PacketMetadata ns3::PacketMetadata::CreateFragment(uint32_t start, uint32_t end) const [member function]
cls.add_method('CreateFragment',
'ns3::PacketMetadata',
[param('uint32_t', 'start'), param('uint32_t', 'end')],
is_const=True)
## packet-metadata.h (module 'network'): uint32_t ns3::PacketMetadata::Deserialize(uint8_t const * buffer, uint32_t size) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('uint8_t const *', 'buffer'), param('uint32_t', 'size')])
## packet-metadata.h (module 'network'): static void ns3::PacketMetadata::Enable() [member function]
cls.add_method('Enable',
'void',
[],
is_static=True)
## packet-metadata.h (module 'network'): static void ns3::PacketMetadata::EnableChecking() [member function]
cls.add_method('EnableChecking',
'void',
[],
is_static=True)
## packet-metadata.h (module 'network'): uint32_t ns3::PacketMetadata::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True)
## packet-metadata.h (module 'network'): uint64_t ns3::PacketMetadata::GetUid() const [member function]
cls.add_method('GetUid',
'uint64_t',
[],
is_const=True)
## packet-metadata.h (module 'network'): void ns3::PacketMetadata::RemoveAtEnd(uint32_t end) [member function]
cls.add_method('RemoveAtEnd',
'void',
[param('uint32_t', 'end')])
## packet-metadata.h (module 'network'): void ns3::PacketMetadata::RemoveAtStart(uint32_t start) [member function]
cls.add_method('RemoveAtStart',
'void',
[param('uint32_t', 'start')])
## packet-metadata.h (module 'network'): void ns3::PacketMetadata::RemoveHeader(ns3::Header const & header, uint32_t size) [member function]
cls.add_method('RemoveHeader',
'void',
[param('ns3::Header const &', 'header'), param('uint32_t', 'size')])
## packet-metadata.h (module 'network'): void ns3::PacketMetadata::RemoveTrailer(ns3::Trailer const & trailer, uint32_t size) [member function]
cls.add_method('RemoveTrailer',
'void',
[param('ns3::Trailer const &', 'trailer'), param('uint32_t', 'size')])
## packet-metadata.h (module 'network'): uint32_t ns3::PacketMetadata::Serialize(uint8_t * buffer, uint32_t maxSize) const [member function]
cls.add_method('Serialize',
'uint32_t',
[param('uint8_t *', 'buffer'), param('uint32_t', 'maxSize')],
is_const=True)
return
def register_Ns3PacketMetadataItem_methods(root_module, cls):
## packet-metadata.h (module 'network'): ns3::PacketMetadata::Item::Item() [constructor]
cls.add_constructor([])
## packet-metadata.h (module 'network'): ns3::PacketMetadata::Item::Item(ns3::PacketMetadata::Item const & arg0) [constructor]
cls.add_constructor([param('ns3::PacketMetadata::Item const &', 'arg0')])
## packet-metadata.h (module 'network'): ns3::PacketMetadata::Item::current [variable]
cls.add_instance_attribute('current', 'ns3::Buffer::Iterator', is_const=False)
## packet-metadata.h (module 'network'): ns3::PacketMetadata::Item::currentSize [variable]
cls.add_instance_attribute('currentSize', 'uint32_t', is_const=False)
## packet-metadata.h (module 'network'): ns3::PacketMetadata::Item::currentTrimedFromEnd [variable]
cls.add_instance_attribute('currentTrimedFromEnd', 'uint32_t', is_const=False)
## packet-metadata.h (module 'network'): ns3::PacketMetadata::Item::currentTrimedFromStart [variable]
cls.add_instance_attribute('currentTrimedFromStart', 'uint32_t', is_const=False)
## packet-metadata.h (module 'network'): ns3::PacketMetadata::Item::isFragment [variable]
cls.add_instance_attribute('isFragment', 'bool', is_const=False)
## packet-metadata.h (module 'network'): ns3::PacketMetadata::Item::tid [variable]
cls.add_instance_attribute('tid', 'ns3::TypeId', is_const=False)
## packet-metadata.h (module 'network'): ns3::PacketMetadata::Item::type [variable]
cls.add_instance_attribute('type', 'ns3::PacketMetadata::Item::ItemType', is_const=False)
return
def register_Ns3PacketMetadataItemIterator_methods(root_module, cls):
## packet-metadata.h (module 'network'): ns3::PacketMetadata::ItemIterator::ItemIterator(ns3::PacketMetadata::ItemIterator const & arg0) [constructor]
cls.add_constructor([param('ns3::PacketMetadata::ItemIterator const &', 'arg0')])
## packet-metadata.h (module 'network'): ns3::PacketMetadata::ItemIterator::ItemIterator(ns3::PacketMetadata const * metadata, ns3::Buffer buffer) [constructor]
cls.add_constructor([param('ns3::PacketMetadata const *', 'metadata'), param('ns3::Buffer', 'buffer')])
## packet-metadata.h (module 'network'): bool ns3::PacketMetadata::ItemIterator::HasNext() const [member function]
cls.add_method('HasNext',
'bool',
[],
is_const=True)
## packet-metadata.h (module 'network'): ns3::PacketMetadata::Item ns3::PacketMetadata::ItemIterator::Next() [member function]
cls.add_method('Next',
'ns3::PacketMetadata::Item',
[])
return
def register_Ns3PacketTagIterator_methods(root_module, cls):
## packet.h (module 'network'): ns3::PacketTagIterator::PacketTagIterator(ns3::PacketTagIterator const & arg0) [constructor]
cls.add_constructor([param('ns3::PacketTagIterator const &', 'arg0')])
## packet.h (module 'network'): bool ns3::PacketTagIterator::HasNext() const [member function]
cls.add_method('HasNext',
'bool',
[],
is_const=True)
## packet.h (module 'network'): ns3::PacketTagIterator::Item ns3::PacketTagIterator::Next() [member function]
cls.add_method('Next',
'ns3::PacketTagIterator::Item',
[])
return
def register_Ns3PacketTagIteratorItem_methods(root_module, cls):
## packet.h (module 'network'): ns3::PacketTagIterator::Item::Item(ns3::PacketTagIterator::Item const & arg0) [constructor]
cls.add_constructor([param('ns3::PacketTagIterator::Item const &', 'arg0')])
## packet.h (module 'network'): void ns3::PacketTagIterator::Item::GetTag(ns3::Tag & tag) const [member function]
cls.add_method('GetTag',
'void',
[param('ns3::Tag &', 'tag')],
is_const=True)
## packet.h (module 'network'): ns3::TypeId ns3::PacketTagIterator::Item::GetTypeId() const [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_const=True)
return
def register_Ns3PacketTagList_methods(root_module, cls):
## packet-tag-list.h (module 'network'): ns3::PacketTagList::PacketTagList() [constructor]
cls.add_constructor([])
## packet-tag-list.h (module 'network'): ns3::PacketTagList::PacketTagList(ns3::PacketTagList const & o) [constructor]
cls.add_constructor([param('ns3::PacketTagList const &', 'o')])
## packet-tag-list.h (module 'network'): void ns3::PacketTagList::Add(ns3::Tag const & tag) const [member function]
cls.add_method('Add',
'void',
[param('ns3::Tag const &', 'tag')],
is_const=True)
## packet-tag-list.h (module 'network'): uint32_t ns3::PacketTagList::Deserialize(uint32_t const * buffer, uint32_t size) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('uint32_t const *', 'buffer'), param('uint32_t', 'size')])
## packet-tag-list.h (module 'network'): uint32_t ns3::PacketTagList::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True)
## packet-tag-list.h (module 'network'): ns3::PacketTagList::TagData const * ns3::PacketTagList::Head() const [member function]
cls.add_method('Head',
'ns3::PacketTagList::TagData const *',
[],
is_const=True)
## packet-tag-list.h (module 'network'): bool ns3::PacketTagList::Peek(ns3::Tag & tag) const [member function]
cls.add_method('Peek',
'bool',
[param('ns3::Tag &', 'tag')],
is_const=True)
## packet-tag-list.h (module 'network'): bool ns3::PacketTagList::Remove(ns3::Tag & tag) [member function]
cls.add_method('Remove',
'bool',
[param('ns3::Tag &', 'tag')])
## packet-tag-list.h (module 'network'): void ns3::PacketTagList::RemoveAll() [member function]
cls.add_method('RemoveAll',
'void',
[])
## packet-tag-list.h (module 'network'): bool ns3::PacketTagList::Replace(ns3::Tag & tag) [member function]
cls.add_method('Replace',
'bool',
[param('ns3::Tag &', 'tag')])
## packet-tag-list.h (module 'network'): uint32_t ns3::PacketTagList::Serialize(uint32_t * buffer, uint32_t maxSize) const [member function]
cls.add_method('Serialize',
'uint32_t',
[param('uint32_t *', 'buffer'), param('uint32_t', 'maxSize')],
is_const=True)
return
def register_Ns3PacketTagListTagData_methods(root_module, cls):
## packet-tag-list.h (module 'network'): ns3::PacketTagList::TagData::TagData() [constructor]
cls.add_constructor([])
## packet-tag-list.h (module 'network'): ns3::PacketTagList::TagData::TagData(ns3::PacketTagList::TagData const & arg0) [constructor]
cls.add_constructor([param('ns3::PacketTagList::TagData const &', 'arg0')])
## packet-tag-list.h (module 'network'): ns3::PacketTagList::TagData::count [variable]
cls.add_instance_attribute('count', 'uint32_t', is_const=False)
## packet-tag-list.h (module 'network'): ns3::PacketTagList::TagData::data [variable]
cls.add_instance_attribute('data', 'uint8_t [ 1 ]', is_const=False)
## packet-tag-list.h (module 'network'): ns3::PacketTagList::TagData::next [variable]
cls.add_instance_attribute('next', 'ns3::PacketTagList::TagData *', is_const=False)
## packet-tag-list.h (module 'network'): ns3::PacketTagList::TagData::size [variable]
cls.add_instance_attribute('size', 'uint32_t', is_const=False)
## packet-tag-list.h (module 'network'): ns3::PacketTagList::TagData::tid [variable]
cls.add_instance_attribute('tid', 'ns3::TypeId', is_const=False)
return
def register_Ns3ParameterLogger_methods(root_module, cls):
## log.h (module 'core'): ns3::ParameterLogger::ParameterLogger(ns3::ParameterLogger const & arg0) [constructor]
cls.add_constructor([param('ns3::ParameterLogger const &', 'arg0')])
## log.h (module 'core'): ns3::ParameterLogger::ParameterLogger(std::ostream & os) [constructor]
cls.add_constructor([param('std::ostream &', 'os')])
return
def register_Ns3SimpleRefCount__Ns3Object_Ns3ObjectBase_Ns3ObjectDeleter_methods(root_module, cls):
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Object, ns3::ObjectBase, ns3::ObjectDeleter>::SimpleRefCount() [constructor]
cls.add_constructor([])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Object, ns3::ObjectBase, ns3::ObjectDeleter>::SimpleRefCount(ns3::SimpleRefCount<ns3::Object, ns3::ObjectBase, ns3::ObjectDeleter> const & o) [constructor]
cls.add_constructor([param('ns3::SimpleRefCount< ns3::Object, ns3::ObjectBase, ns3::ObjectDeleter > const &', 'o')])
return
def register_Ns3Simulator_methods(root_module, cls):
## simulator.h (module 'core'): ns3::Simulator::Simulator(ns3::Simulator const & arg0) [constructor]
cls.add_constructor([param('ns3::Simulator const &', 'arg0')])
## simulator.h (module 'core'): static void ns3::Simulator::Cancel(ns3::EventId const & id) [member function]
cls.add_method('Cancel',
'void',
[param('ns3::EventId const &', 'id')],
is_static=True)
## simulator.h (module 'core'): static void ns3::Simulator::Destroy() [member function]
cls.add_method('Destroy',
'void',
[],
is_static=True)
## simulator.h (module 'core'): static uint32_t ns3::Simulator::GetContext() [member function]
cls.add_method('GetContext',
'uint32_t',
[],
is_static=True)
## simulator.h (module 'core'): static ns3::Time ns3::Simulator::GetDelayLeft(ns3::EventId const & id) [member function]
cls.add_method('GetDelayLeft',
'ns3::Time',
[param('ns3::EventId const &', 'id')],
is_static=True)
## simulator.h (module 'core'): static uint64_t ns3::Simulator::GetEventCount() [member function]
cls.add_method('GetEventCount',
'uint64_t',
[],
is_static=True)
## simulator.h (module 'core'): static ns3::Ptr<ns3::SimulatorImpl> ns3::Simulator::GetImplementation() [member function]
cls.add_method('GetImplementation',
'ns3::Ptr< ns3::SimulatorImpl >',
[],
is_static=True)
## simulator.h (module 'core'): static ns3::Time ns3::Simulator::GetMaximumSimulationTime() [member function]
cls.add_method('GetMaximumSimulationTime',
'ns3::Time',
[],
is_static=True)
## simulator.h (module 'core'): static uint32_t ns3::Simulator::GetSystemId() [member function]
cls.add_method('GetSystemId',
'uint32_t',
[],
is_static=True)
## simulator.h (module 'core'): static bool ns3::Simulator::IsExpired(ns3::EventId const & id) [member function]
cls.add_method('IsExpired',
'bool',
[param('ns3::EventId const &', 'id')],
is_static=True)
## simulator.h (module 'core'): static bool ns3::Simulator::IsFinished() [member function]
cls.add_method('IsFinished',
'bool',
[],
is_static=True)
## simulator.h (module 'core'): static ns3::Time ns3::Simulator::Now() [member function]
cls.add_method('Now',
'ns3::Time',
[],
is_static=True)
## simulator.h (module 'core'): static void ns3::Simulator::Remove(ns3::EventId const & id) [member function]
cls.add_method('Remove',
'void',
[param('ns3::EventId const &', 'id')],
is_static=True)
## simulator.h (module 'core'): static void ns3::Simulator::SetImplementation(ns3::Ptr<ns3::SimulatorImpl> impl) [member function]
cls.add_method('SetImplementation',
'void',
[param('ns3::Ptr< ns3::SimulatorImpl >', 'impl')],
is_static=True)
## simulator.h (module 'core'): static void ns3::Simulator::SetScheduler(ns3::ObjectFactory schedulerFactory) [member function]
cls.add_method('SetScheduler',
'void',
[param('ns3::ObjectFactory', 'schedulerFactory')],
is_static=True)
## simulator.h (module 'core'): static void ns3::Simulator::Stop() [member function]
cls.add_method('Stop',
'void',
[],
is_static=True)
## simulator.h (module 'core'): static void ns3::Simulator::Stop(ns3::Time const & delay) [member function]
cls.add_method('Stop',
'void',
[param('ns3::Time const &', 'delay')],
is_static=True)
return
def register_Ns3SystemWallClockMs_methods(root_module, cls):
## system-wall-clock-ms.h (module 'core'): ns3::SystemWallClockMs::SystemWallClockMs(ns3::SystemWallClockMs const & arg0) [constructor]
cls.add_constructor([param('ns3::SystemWallClockMs const &', 'arg0')])
## system-wall-clock-ms.h (module 'core'): ns3::SystemWallClockMs::SystemWallClockMs() [constructor]
cls.add_constructor([])
## system-wall-clock-ms.h (module 'core'): int64_t ns3::SystemWallClockMs::End() [member function]
cls.add_method('End',
'int64_t',
[])
## system-wall-clock-ms.h (module 'core'): int64_t ns3::SystemWallClockMs::GetElapsedReal() const [member function]
cls.add_method('GetElapsedReal',
'int64_t',
[],
is_const=True)
## system-wall-clock-ms.h (module 'core'): int64_t ns3::SystemWallClockMs::GetElapsedSystem() const [member function]
cls.add_method('GetElapsedSystem',
'int64_t',
[],
is_const=True)
## system-wall-clock-ms.h (module 'core'): int64_t ns3::SystemWallClockMs::GetElapsedUser() const [member function]
cls.add_method('GetElapsedUser',
'int64_t',
[],
is_const=True)
## system-wall-clock-ms.h (module 'core'): void ns3::SystemWallClockMs::Start() [member function]
cls.add_method('Start',
'void',
[])
return
def register_Ns3Tag_methods(root_module, cls):
## tag.h (module 'network'): ns3::Tag::Tag() [constructor]
cls.add_constructor([])
## tag.h (module 'network'): ns3::Tag::Tag(ns3::Tag const & arg0) [constructor]
cls.add_constructor([param('ns3::Tag const &', 'arg0')])
## tag.h (module 'network'): void ns3::Tag::Deserialize(ns3::TagBuffer i) [member function]
cls.add_method('Deserialize',
'void',
[param('ns3::TagBuffer', 'i')],
is_pure_virtual=True, is_virtual=True)
## tag.h (module 'network'): uint32_t ns3::Tag::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True, is_pure_virtual=True, is_virtual=True)
## tag.h (module 'network'): static ns3::TypeId ns3::Tag::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## tag.h (module 'network'): void ns3::Tag::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True, is_pure_virtual=True, is_virtual=True)
## tag.h (module 'network'): void ns3::Tag::Serialize(ns3::TagBuffer i) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::TagBuffer', 'i')],
is_const=True, is_pure_virtual=True, is_virtual=True)
return
def register_Ns3TagBuffer_methods(root_module, cls):
## tag-buffer.h (module 'network'): ns3::TagBuffer::TagBuffer(ns3::TagBuffer const & arg0) [constructor]
cls.add_constructor([param('ns3::TagBuffer const &', 'arg0')])
## tag-buffer.h (module 'network'): ns3::TagBuffer::TagBuffer(uint8_t * start, uint8_t * end) [constructor]
cls.add_constructor([param('uint8_t *', 'start'), param('uint8_t *', 'end')])
## tag-buffer.h (module 'network'): void ns3::TagBuffer::CopyFrom(ns3::TagBuffer o) [member function]
cls.add_method('CopyFrom',
'void',
[param('ns3::TagBuffer', 'o')])
## tag-buffer.h (module 'network'): void ns3::TagBuffer::Read(uint8_t * buffer, uint32_t size) [member function]
cls.add_method('Read',
'void',
[param('uint8_t *', 'buffer'), param('uint32_t', 'size')])
## tag-buffer.h (module 'network'): double ns3::TagBuffer::ReadDouble() [member function]
cls.add_method('ReadDouble',
'double',
[])
## tag-buffer.h (module 'network'): uint16_t ns3::TagBuffer::ReadU16() [member function]
cls.add_method('ReadU16',
'uint16_t',
[])
## tag-buffer.h (module 'network'): uint32_t ns3::TagBuffer::ReadU32() [member function]
cls.add_method('ReadU32',
'uint32_t',
[])
## tag-buffer.h (module 'network'): uint64_t ns3::TagBuffer::ReadU64() [member function]
cls.add_method('ReadU64',
'uint64_t',
[])
## tag-buffer.h (module 'network'): uint8_t ns3::TagBuffer::ReadU8() [member function]
cls.add_method('ReadU8',
'uint8_t',
[])
## tag-buffer.h (module 'network'): void ns3::TagBuffer::TrimAtEnd(uint32_t trim) [member function]
cls.add_method('TrimAtEnd',
'void',
[param('uint32_t', 'trim')])
## tag-buffer.h (module 'network'): void ns3::TagBuffer::Write(uint8_t const * buffer, uint32_t size) [member function]
cls.add_method('Write',
'void',
[param('uint8_t const *', 'buffer'), param('uint32_t', 'size')])
## tag-buffer.h (module 'network'): void ns3::TagBuffer::WriteDouble(double v) [member function]
cls.add_method('WriteDouble',
'void',
[param('double', 'v')])
## tag-buffer.h (module 'network'): void ns3::TagBuffer::WriteU16(uint16_t v) [member function]
cls.add_method('WriteU16',
'void',
[param('uint16_t', 'v')])
## tag-buffer.h (module 'network'): void ns3::TagBuffer::WriteU32(uint32_t v) [member function]
cls.add_method('WriteU32',
'void',
[param('uint32_t', 'v')])
## tag-buffer.h (module 'network'): void ns3::TagBuffer::WriteU64(uint64_t v) [member function]
cls.add_method('WriteU64',
'void',
[param('uint64_t', 'v')])
## tag-buffer.h (module 'network'): void ns3::TagBuffer::WriteU8(uint8_t v) [member function]
cls.add_method('WriteU8',
'void',
[param('uint8_t', 'v')])
return
def register_Ns3Time_methods(root_module, cls):
cls.add_binary_comparison_operator('==')
cls.add_binary_comparison_operator('!=')
cls.add_binary_comparison_operator('<=')
cls.add_binary_comparison_operator('>=')
cls.add_binary_comparison_operator('<')
cls.add_binary_comparison_operator('>')
cls.add_binary_numeric_operator('+', root_module['ns3::Time'], root_module['ns3::Time'], param('ns3::Time const &', 'right'))
cls.add_binary_numeric_operator('-', root_module['ns3::Time'], root_module['ns3::Time'], param('ns3::Time const &', 'right'))
cls.add_binary_numeric_operator('*', root_module['ns3::Time'], root_module['ns3::Time'], param('ns3::int64x64_t const &', 'right'))
cls.add_binary_numeric_operator('/', root_module['ns3::int64x64_t'], root_module['ns3::Time'], param('ns3::Time const &', 'right'))
cls.add_binary_numeric_operator('/', root_module['ns3::Time'], root_module['ns3::Time'], param('ns3::int64x64_t const &', 'right'))
cls.add_inplace_numeric_operator('+=', param('ns3::Time const &', 'right'))
cls.add_inplace_numeric_operator('-=', param('ns3::Time const &', 'right'))
cls.add_output_stream_operator()
## nstime.h (module 'core'): ns3::Time::Time() [constructor]
cls.add_constructor([])
## nstime.h (module 'core'): ns3::Time::Time(ns3::Time const & o) [constructor]
cls.add_constructor([param('ns3::Time const &', 'o')])
## nstime.h (module 'core'): ns3::Time::Time(double v) [constructor]
cls.add_constructor([param('double', 'v')])
## nstime.h (module 'core'): ns3::Time::Time(int v) [constructor]
cls.add_constructor([param('int', 'v')])
## nstime.h (module 'core'): ns3::Time::Time(long int v) [constructor]
cls.add_constructor([param('long int', 'v')])
## nstime.h (module 'core'): ns3::Time::Time(long long int v) [constructor]
cls.add_constructor([param('long long int', 'v')])
## nstime.h (module 'core'): ns3::Time::Time(unsigned int v) [constructor]
cls.add_constructor([param('unsigned int', 'v')])
## nstime.h (module 'core'): ns3::Time::Time(long unsigned int v) [constructor]
cls.add_constructor([param('long unsigned int', 'v')])
## nstime.h (module 'core'): ns3::Time::Time(long long unsigned int v) [constructor]
cls.add_constructor([param('long long unsigned int', 'v')])
## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & v) [constructor]
cls.add_constructor([param('ns3::int64x64_t const &', 'v')])
## nstime.h (module 'core'): ns3::Time::Time(std::string const & s) [constructor]
cls.add_constructor([param('std::string const &', 's')])
## nstime.h (module 'core'): ns3::TimeWithUnit ns3::Time::As(ns3::Time::Unit const unit=::ns3::Time::Unit::AUTO) const [member function]
cls.add_method('As',
'ns3::TimeWithUnit',
[param('ns3::Time::Unit const', 'unit', default_value='::ns3::Time::Unit::AUTO')],
is_const=True)
## nstime.h (module 'core'): int ns3::Time::Compare(ns3::Time const & o) const [member function]
cls.add_method('Compare',
'int',
[param('ns3::Time const &', 'o')],
is_const=True)
## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value) [member function]
cls.add_method('From',
'ns3::Time',
[param('ns3::int64x64_t const &', 'value')],
is_static=True)
## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value, ns3::Time::Unit unit) [member function]
cls.add_method('From',
'ns3::Time',
[param('ns3::int64x64_t const &', 'value'), param('ns3::Time::Unit', 'unit')],
is_static=True)
## nstime.h (module 'core'): static ns3::Time ns3::Time::FromDouble(double value, ns3::Time::Unit unit) [member function]
cls.add_method('FromDouble',
'ns3::Time',
[param('double', 'value'), param('ns3::Time::Unit', 'unit')],
is_static=True)
## nstime.h (module 'core'): static ns3::Time ns3::Time::FromInteger(uint64_t value, ns3::Time::Unit unit) [member function]
cls.add_method('FromInteger',
'ns3::Time',
[param('uint64_t', 'value'), param('ns3::Time::Unit', 'unit')],
is_static=True)
## nstime.h (module 'core'): double ns3::Time::GetDays() const [member function]
cls.add_method('GetDays',
'double',
[],
is_const=True)
## nstime.h (module 'core'): double ns3::Time::GetDouble() const [member function]
cls.add_method('GetDouble',
'double',
[],
is_const=True)
## nstime.h (module 'core'): int64_t ns3::Time::GetFemtoSeconds() const [member function]
cls.add_method('GetFemtoSeconds',
'int64_t',
[],
is_const=True)
## nstime.h (module 'core'): double ns3::Time::GetHours() const [member function]
cls.add_method('GetHours',
'double',
[],
is_const=True)
## nstime.h (module 'core'): int64_t ns3::Time::GetInteger() const [member function]
cls.add_method('GetInteger',
'int64_t',
[],
is_const=True)
## nstime.h (module 'core'): int64_t ns3::Time::GetMicroSeconds() const [member function]
cls.add_method('GetMicroSeconds',
'int64_t',
[],
is_const=True)
## nstime.h (module 'core'): int64_t ns3::Time::GetMilliSeconds() const [member function]
cls.add_method('GetMilliSeconds',
'int64_t',
[],
is_const=True)
## nstime.h (module 'core'): double ns3::Time::GetMinutes() const [member function]
cls.add_method('GetMinutes',
'double',
[],
is_const=True)
## nstime.h (module 'core'): int64_t ns3::Time::GetNanoSeconds() const [member function]
cls.add_method('GetNanoSeconds',
'int64_t',
[],
is_const=True)
## nstime.h (module 'core'): int64_t ns3::Time::GetPicoSeconds() const [member function]
cls.add_method('GetPicoSeconds',
'int64_t',
[],
is_const=True)
## nstime.h (module 'core'): static ns3::Time::Unit ns3::Time::GetResolution() [member function]
cls.add_method('GetResolution',
'ns3::Time::Unit',
[],
is_static=True)
## nstime.h (module 'core'): double ns3::Time::GetSeconds() const [member function]
cls.add_method('GetSeconds',
'double',
[],
is_const=True)
## nstime.h (module 'core'): int64_t ns3::Time::GetTimeStep() const [member function]
cls.add_method('GetTimeStep',
'int64_t',
[],
is_const=True)
## nstime.h (module 'core'): double ns3::Time::GetYears() const [member function]
cls.add_method('GetYears',
'double',
[],
is_const=True)
## nstime.h (module 'core'): bool ns3::Time::IsNegative() const [member function]
cls.add_method('IsNegative',
'bool',
[],
is_const=True)
## nstime.h (module 'core'): bool ns3::Time::IsPositive() const [member function]
cls.add_method('IsPositive',
'bool',
[],
is_const=True)
## nstime.h (module 'core'): bool ns3::Time::IsStrictlyNegative() const [member function]
cls.add_method('IsStrictlyNegative',
'bool',
[],
is_const=True)
## nstime.h (module 'core'): bool ns3::Time::IsStrictlyPositive() const [member function]
cls.add_method('IsStrictlyPositive',
'bool',
[],
is_const=True)
## nstime.h (module 'core'): bool ns3::Time::IsZero() const [member function]
cls.add_method('IsZero',
'bool',
[],
is_const=True)
## nstime.h (module 'core'): static ns3::Time ns3::Time::Max() [member function]
cls.add_method('Max',
'ns3::Time',
[],
is_static=True)
## nstime.h (module 'core'): static ns3::Time ns3::Time::Min() [member function]
cls.add_method('Min',
'ns3::Time',
[],
is_static=True)
## nstime.h (module 'core'): ns3::Time ns3::Time::RoundTo(ns3::Time::Unit unit) const [member function]
cls.add_method('RoundTo',
'ns3::Time',
[param('ns3::Time::Unit', 'unit')],
is_const=True)
## nstime.h (module 'core'): static void ns3::Time::SetResolution(ns3::Time::Unit resolution) [member function]
cls.add_method('SetResolution',
'void',
[param('ns3::Time::Unit', 'resolution')],
is_static=True)
## nstime.h (module 'core'): static bool ns3::Time::StaticInit() [member function]
cls.add_method('StaticInit',
'bool',
[],
is_static=True)
## nstime.h (module 'core'): ns3::int64x64_t ns3::Time::To(ns3::Time::Unit unit) const [member function]
cls.add_method('To',
'ns3::int64x64_t',
[param('ns3::Time::Unit', 'unit')],
is_const=True)
## nstime.h (module 'core'): double ns3::Time::ToDouble(ns3::Time::Unit unit) const [member function]
cls.add_method('ToDouble',
'double',
[param('ns3::Time::Unit', 'unit')],
is_const=True)
## nstime.h (module 'core'): int64_t ns3::Time::ToInteger(ns3::Time::Unit unit) const [member function]
cls.add_method('ToInteger',
'int64_t',
[param('ns3::Time::Unit', 'unit')],
is_const=True)
return
def register_Ns3TimeWithUnit_methods(root_module, cls):
cls.add_output_stream_operator()
## nstime.h (module 'core'): ns3::TimeWithUnit::TimeWithUnit(ns3::TimeWithUnit const & arg0) [constructor]
cls.add_constructor([param('ns3::TimeWithUnit const &', 'arg0')])
## nstime.h (module 'core'): ns3::TimeWithUnit::TimeWithUnit(ns3::Time const time, ns3::Time::Unit const unit) [constructor]
cls.add_constructor([param('ns3::Time const', 'time'), param('ns3::Time::Unit const', 'unit')])
return
def register_Ns3Timer_methods(root_module, cls):
## timer.h (module 'core'): ns3::Timer::Timer(ns3::Timer const & arg0) [constructor]
cls.add_constructor([param('ns3::Timer const &', 'arg0')])
## timer.h (module 'core'): ns3::Timer::Timer() [constructor]
cls.add_constructor([])
## timer.h (module 'core'): ns3::Timer::Timer(ns3::Timer::DestroyPolicy destroyPolicy) [constructor]
cls.add_constructor([param('ns3::Timer::DestroyPolicy', 'destroyPolicy')])
## timer.h (module 'core'): void ns3::Timer::Cancel() [member function]
cls.add_method('Cancel',
'void',
[])
## timer.h (module 'core'): ns3::Time ns3::Timer::GetDelay() const [member function]
cls.add_method('GetDelay',
'ns3::Time',
[],
is_const=True)
## timer.h (module 'core'): ns3::Time ns3::Timer::GetDelayLeft() const [member function]
cls.add_method('GetDelayLeft',
'ns3::Time',
[],
is_const=True)
## timer.h (module 'core'): ns3::Timer::State ns3::Timer::GetState() const [member function]
cls.add_method('GetState',
'ns3::Timer::State',
[],
is_const=True)
## timer.h (module 'core'): bool ns3::Timer::IsExpired() const [member function]
cls.add_method('IsExpired',
'bool',
[],
is_const=True)
## timer.h (module 'core'): bool ns3::Timer::IsRunning() const [member function]
cls.add_method('IsRunning',
'bool',
[],
is_const=True)
## timer.h (module 'core'): bool ns3::Timer::IsSuspended() const [member function]
cls.add_method('IsSuspended',
'bool',
[],
is_const=True)
## timer.h (module 'core'): void ns3::Timer::Remove() [member function]
cls.add_method('Remove',
'void',
[])
## timer.h (module 'core'): void ns3::Timer::Resume() [member function]
cls.add_method('Resume',
'void',
[])
## timer.h (module 'core'): void ns3::Timer::Schedule() [member function]
cls.add_method('Schedule',
'void',
[])
## timer.h (module 'core'): void ns3::Timer::Schedule(ns3::Time delay) [member function]
cls.add_method('Schedule',
'void',
[param('ns3::Time', 'delay')])
## timer.h (module 'core'): void ns3::Timer::SetDelay(ns3::Time const & delay) [member function]
cls.add_method('SetDelay',
'void',
[param('ns3::Time const &', 'delay')])
## timer.h (module 'core'): void ns3::Timer::Suspend() [member function]
cls.add_method('Suspend',
'void',
[])
return
def register_Ns3TimerImpl_methods(root_module, cls):
## timer-impl.h (module 'core'): ns3::TimerImpl::TimerImpl() [constructor]
cls.add_constructor([])
## timer-impl.h (module 'core'): ns3::TimerImpl::TimerImpl(ns3::TimerImpl const & arg0) [constructor]
cls.add_constructor([param('ns3::TimerImpl const &', 'arg0')])
## timer-impl.h (module 'core'): void ns3::TimerImpl::Invoke() [member function]
cls.add_method('Invoke',
'void',
[],
is_pure_virtual=True, is_virtual=True)
## timer-impl.h (module 'core'): ns3::EventId ns3::TimerImpl::Schedule(ns3::Time const & delay) [member function]
cls.add_method('Schedule',
'ns3::EventId',
[param('ns3::Time const &', 'delay')],
is_pure_virtual=True, is_virtual=True)
return
def register_Ns3TypeId_methods(root_module, cls):
cls.add_binary_comparison_operator('==')
cls.add_binary_comparison_operator('!=')
cls.add_output_stream_operator()
cls.add_binary_comparison_operator('<')
## type-id.h (module 'core'): ns3::TypeId::TypeId(char const * name) [constructor]
cls.add_constructor([param('char const *', 'name')])
## type-id.h (module 'core'): ns3::TypeId::TypeId() [constructor]
cls.add_constructor([])
## type-id.h (module 'core'): ns3::TypeId::TypeId(ns3::TypeId const & o) [constructor]
cls.add_constructor([param('ns3::TypeId const &', 'o')])
## type-id.h (module 'core'): ns3::TypeId ns3::TypeId::AddAttribute(std::string name, std::string help, ns3::AttributeValue const & initialValue, ns3::Ptr<const ns3::AttributeAccessor> accessor, ns3::Ptr<const ns3::AttributeChecker> checker, ns3::TypeId::SupportLevel supportLevel=::ns3::TypeId::SupportLevel::SUPPORTED, std::string const & supportMsg="") [member function]
cls.add_method('AddAttribute',
'ns3::TypeId',
[param('std::string', 'name'), param('std::string', 'help'), param('ns3::AttributeValue const &', 'initialValue'), param('ns3::Ptr< ns3::AttributeAccessor const >', 'accessor'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker'), param('ns3::TypeId::SupportLevel', 'supportLevel', default_value='::ns3::TypeId::SupportLevel::SUPPORTED'), param('std::string const &', 'supportMsg', default_value='""')])
## type-id.h (module 'core'): ns3::TypeId ns3::TypeId::AddAttribute(std::string name, std::string help, uint32_t flags, ns3::AttributeValue const & initialValue, ns3::Ptr<const ns3::AttributeAccessor> accessor, ns3::Ptr<const ns3::AttributeChecker> checker, ns3::TypeId::SupportLevel supportLevel=::ns3::TypeId::SupportLevel::SUPPORTED, std::string const & supportMsg="") [member function]
cls.add_method('AddAttribute',
'ns3::TypeId',
[param('std::string', 'name'), param('std::string', 'help'), param('uint32_t', 'flags'), param('ns3::AttributeValue const &', 'initialValue'), param('ns3::Ptr< ns3::AttributeAccessor const >', 'accessor'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker'), param('ns3::TypeId::SupportLevel', 'supportLevel', default_value='::ns3::TypeId::SupportLevel::SUPPORTED'), param('std::string const &', 'supportMsg', default_value='""')])
## type-id.h (module 'core'): ns3::TypeId ns3::TypeId::AddTraceSource(std::string name, std::string help, ns3::Ptr<const ns3::TraceSourceAccessor> accessor, std::string callback, ns3::TypeId::SupportLevel supportLevel=::ns3::TypeId::SupportLevel::SUPPORTED, std::string const & supportMsg="") [member function]
cls.add_method('AddTraceSource',
'ns3::TypeId',
[param('std::string', 'name'), param('std::string', 'help'), param('ns3::Ptr< ns3::TraceSourceAccessor const >', 'accessor'), param('std::string', 'callback'), param('ns3::TypeId::SupportLevel', 'supportLevel', default_value='::ns3::TypeId::SupportLevel::SUPPORTED'), param('std::string const &', 'supportMsg', default_value='""')])
## type-id.h (module 'core'): ns3::TypeId::AttributeInformation ns3::TypeId::GetAttribute(std::size_t i) const [member function]
cls.add_method('GetAttribute',
'ns3::TypeId::AttributeInformation',
[param('std::size_t', 'i')],
is_const=True)
## type-id.h (module 'core'): std::string ns3::TypeId::GetAttributeFullName(std::size_t i) const [member function]
cls.add_method('GetAttributeFullName',
'std::string',
[param('std::size_t', 'i')],
is_const=True)
## type-id.h (module 'core'): std::size_t ns3::TypeId::GetAttributeN() const [member function]
cls.add_method('GetAttributeN',
'std::size_t',
[],
is_const=True)
## type-id.h (module 'core'): ns3::Callback<ns3::ObjectBase *, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> ns3::TypeId::GetConstructor() const [member function]
cls.add_method('GetConstructor',
'ns3::Callback< ns3::ObjectBase *, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >',
[],
is_const=True)
## type-id.h (module 'core'): std::string ns3::TypeId::GetGroupName() const [member function]
cls.add_method('GetGroupName',
'std::string',
[],
is_const=True)
## type-id.h (module 'core'): ns3::TypeId::hash_t ns3::TypeId::GetHash() const [member function]
cls.add_method('GetHash',
'ns3::TypeId::hash_t',
[],
is_const=True)
## type-id.h (module 'core'): std::string ns3::TypeId::GetName() const [member function]
cls.add_method('GetName',
'std::string',
[],
is_const=True)
## type-id.h (module 'core'): ns3::TypeId ns3::TypeId::GetParent() const [member function]
cls.add_method('GetParent',
'ns3::TypeId',
[],
is_const=True)
## type-id.h (module 'core'): static ns3::TypeId ns3::TypeId::GetRegistered(uint16_t i) [member function]
cls.add_method('GetRegistered',
'ns3::TypeId',
[param('uint16_t', 'i')],
is_static=True)
## type-id.h (module 'core'): static uint16_t ns3::TypeId::GetRegisteredN() [member function]
cls.add_method('GetRegisteredN',
'uint16_t',
[],
is_static=True)
## type-id.h (module 'core'): std::size_t ns3::TypeId::GetSize() const [member function]
cls.add_method('GetSize',
'std::size_t',
[],
is_const=True)
## type-id.h (module 'core'): ns3::TypeId::TraceSourceInformation ns3::TypeId::GetTraceSource(std::size_t i) const [member function]
cls.add_method('GetTraceSource',
'ns3::TypeId::TraceSourceInformation',
[param('std::size_t', 'i')],
is_const=True)
## type-id.h (module 'core'): std::size_t ns3::TypeId::GetTraceSourceN() const [member function]
cls.add_method('GetTraceSourceN',
'std::size_t',
[],
is_const=True)
## type-id.h (module 'core'): uint16_t ns3::TypeId::GetUid() const [member function]
cls.add_method('GetUid',
'uint16_t',
[],
is_const=True)
## type-id.h (module 'core'): bool ns3::TypeId::HasConstructor() const [member function]
cls.add_method('HasConstructor',
'bool',
[],
is_const=True)
## type-id.h (module 'core'): bool ns3::TypeId::HasParent() const [member function]
cls.add_method('HasParent',
'bool',
[],
is_const=True)
## type-id.h (module 'core'): ns3::TypeId ns3::TypeId::HideFromDocumentation() [member function]
cls.add_method('HideFromDocumentation',
'ns3::TypeId',
[])
## type-id.h (module 'core'): bool ns3::TypeId::IsChildOf(ns3::TypeId other) const [member function]
cls.add_method('IsChildOf',
'bool',
[param('ns3::TypeId', 'other')],
is_const=True)
## type-id.h (module 'core'): bool ns3::TypeId::LookupAttributeByName(std::string name, ns3::TypeId::AttributeInformation * info) const [member function]
cls.add_method('LookupAttributeByName',
'bool',
[param('std::string', 'name'), param('ns3::TypeId::AttributeInformation *', 'info', transfer_ownership=False)],
is_const=True)
## type-id.h (module 'core'): static ns3::TypeId ns3::TypeId::LookupByHash(ns3::TypeId::hash_t hash) [member function]
cls.add_method('LookupByHash',
'ns3::TypeId',
[param('uint32_t', 'hash')],
is_static=True)
## type-id.h (module 'core'): static bool ns3::TypeId::LookupByHashFailSafe(ns3::TypeId::hash_t hash, ns3::TypeId * tid) [member function]
cls.add_method('LookupByHashFailSafe',
'bool',
[param('uint32_t', 'hash'), param('ns3::TypeId *', 'tid')],
is_static=True)
## type-id.h (module 'core'): static ns3::TypeId ns3::TypeId::LookupByName(std::string name) [member function]
cls.add_method('LookupByName',
'ns3::TypeId',
[param('std::string', 'name')],
is_static=True)
## type-id.h (module 'core'): ns3::Ptr<const ns3::TraceSourceAccessor> ns3::TypeId::LookupTraceSourceByName(std::string name) const [member function]
cls.add_method('LookupTraceSourceByName',
'ns3::Ptr< ns3::TraceSourceAccessor const >',
[param('std::string', 'name')],
is_const=True)
## type-id.h (module 'core'): ns3::Ptr<const ns3::TraceSourceAccessor> ns3::TypeId::LookupTraceSourceByName(std::string name, ns3::TypeId::TraceSourceInformation * info) const [member function]
cls.add_method('LookupTraceSourceByName',
'ns3::Ptr< ns3::TraceSourceAccessor const >',
[param('std::string', 'name'), param('ns3::TypeId::TraceSourceInformation *', 'info')],
is_const=True)
## type-id.h (module 'core'): bool ns3::TypeId::MustHideFromDocumentation() const [member function]
cls.add_method('MustHideFromDocumentation',
'bool',
[],
is_const=True)
## type-id.h (module 'core'): bool ns3::TypeId::SetAttributeInitialValue(std::size_t i, ns3::Ptr<const ns3::AttributeValue> initialValue) [member function]
cls.add_method('SetAttributeInitialValue',
'bool',
[param('std::size_t', 'i'), param('ns3::Ptr< ns3::AttributeValue const >', 'initialValue')])
## type-id.h (module 'core'): ns3::TypeId ns3::TypeId::SetGroupName(std::string groupName) [member function]
cls.add_method('SetGroupName',
'ns3::TypeId',
[param('std::string', 'groupName')])
## type-id.h (module 'core'): ns3::TypeId ns3::TypeId::SetParent(ns3::TypeId tid) [member function]
cls.add_method('SetParent',
'ns3::TypeId',
[param('ns3::TypeId', 'tid')])
## type-id.h (module 'core'): ns3::TypeId ns3::TypeId::SetSize(std::size_t size) [member function]
cls.add_method('SetSize',
'ns3::TypeId',
[param('std::size_t', 'size')])
## type-id.h (module 'core'): void ns3::TypeId::SetUid(uint16_t uid) [member function]
cls.add_method('SetUid',
'void',
[param('uint16_t', 'uid')])
return
def register_Ns3TypeIdAttributeInformation_methods(root_module, cls):
## type-id.h (module 'core'): ns3::TypeId::AttributeInformation::AttributeInformation() [constructor]
cls.add_constructor([])
## type-id.h (module 'core'): ns3::TypeId::AttributeInformation::AttributeInformation(ns3::TypeId::AttributeInformation const & arg0) [constructor]
cls.add_constructor([param('ns3::TypeId::AttributeInformation const &', 'arg0')])
## type-id.h (module 'core'): ns3::TypeId::AttributeInformation::accessor [variable]
cls.add_instance_attribute('accessor', 'ns3::Ptr< ns3::AttributeAccessor const >', is_const=False)
## type-id.h (module 'core'): ns3::TypeId::AttributeInformation::checker [variable]
cls.add_instance_attribute('checker', 'ns3::Ptr< ns3::AttributeChecker const >', is_const=False)
cls.add_instance_attribute('flags', 'uint32_t', is_const=False)
## type-id.h (module 'core'): ns3::TypeId::AttributeInformation::help [variable]
cls.add_instance_attribute('help', 'std::string', is_const=False)
## type-id.h (module 'core'): ns3::TypeId::AttributeInformation::initialValue [variable]
cls.add_instance_attribute('initialValue', 'ns3::Ptr< ns3::AttributeValue const >', is_const=False)
## type-id.h (module 'core'): ns3::TypeId::AttributeInformation::name [variable]
cls.add_instance_attribute('name', 'std::string', is_const=False)
## type-id.h (module 'core'): ns3::TypeId::AttributeInformation::originalInitialValue [variable]
cls.add_instance_attribute('originalInitialValue', 'ns3::Ptr< ns3::AttributeValue const >', is_const=False)
## type-id.h (module 'core'): ns3::TypeId::AttributeInformation::supportLevel [variable]
cls.add_instance_attribute('supportLevel', 'ns3::TypeId::SupportLevel', is_const=False)
## type-id.h (module 'core'): ns3::TypeId::AttributeInformation::supportMsg [variable]
cls.add_instance_attribute('supportMsg', 'std::string', is_const=False)
return
def register_Ns3TypeIdTraceSourceInformation_methods(root_module, cls):
## type-id.h (module 'core'): ns3::TypeId::TraceSourceInformation::TraceSourceInformation() [constructor]
cls.add_constructor([])
## type-id.h (module 'core'): ns3::TypeId::TraceSourceInformation::TraceSourceInformation(ns3::TypeId::TraceSourceInformation const & arg0) [constructor]
cls.add_constructor([param('ns3::TypeId::TraceSourceInformation const &', 'arg0')])
## type-id.h (module 'core'): ns3::TypeId::TraceSourceInformation::accessor [variable]
cls.add_instance_attribute('accessor', 'ns3::Ptr< ns3::TraceSourceAccessor const >', is_const=False)
## type-id.h (module 'core'): ns3::TypeId::TraceSourceInformation::callback [variable]
cls.add_instance_attribute('callback', 'std::string', is_const=False)
## type-id.h (module 'core'): ns3::TypeId::TraceSourceInformation::help [variable]
cls.add_instance_attribute('help', 'std::string', is_const=False)
## type-id.h (module 'core'): ns3::TypeId::TraceSourceInformation::name [variable]
cls.add_instance_attribute('name', 'std::string', is_const=False)
## type-id.h (module 'core'): ns3::TypeId::TraceSourceInformation::supportLevel [variable]
cls.add_instance_attribute('supportLevel', 'ns3::TypeId::SupportLevel', is_const=False)
## type-id.h (module 'core'): ns3::TypeId::TraceSourceInformation::supportMsg [variable]
cls.add_instance_attribute('supportMsg', 'std::string', is_const=False)
return
def register_Ns3WifiAc_methods(root_module, cls):
## qos-utils.h (module 'wifi'): ns3::WifiAc::WifiAc(ns3::WifiAc const & arg0) [constructor]
cls.add_constructor([param('ns3::WifiAc const &', 'arg0')])
## qos-utils.h (module 'wifi'): ns3::WifiAc::WifiAc(uint8_t lowTid, uint8_t highTid) [constructor]
cls.add_constructor([param('uint8_t', 'lowTid'), param('uint8_t', 'highTid')])
## qos-utils.h (module 'wifi'): uint8_t ns3::WifiAc::GetHighTid() const [member function]
cls.add_method('GetHighTid',
'uint8_t',
[],
is_const=True)
## qos-utils.h (module 'wifi'): uint8_t ns3::WifiAc::GetLowTid() const [member function]
cls.add_method('GetLowTid',
'uint8_t',
[],
is_const=True)
## qos-utils.h (module 'wifi'): uint8_t ns3::WifiAc::GetOtherTid(uint8_t tid) const [member function]
cls.add_method('GetOtherTid',
'uint8_t',
[param('uint8_t', 'tid')],
is_const=True)
return
def register_Ns3WifiAddressHash_methods(root_module, cls):
## qos-utils.h (module 'wifi'): ns3::WifiAddressHash::WifiAddressHash() [constructor]
cls.add_constructor([])
## qos-utils.h (module 'wifi'): ns3::WifiAddressHash::WifiAddressHash(ns3::WifiAddressHash const & arg0) [constructor]
cls.add_constructor([param('ns3::WifiAddressHash const &', 'arg0')])
## qos-utils.h (module 'wifi'): std::size_t ns3::WifiAddressHash::operator()(ns3::Mac48Address const & address) const [member operator]
cls.add_method('operator()',
'std::size_t',
[param('ns3::Mac48Address const &', 'address')],
custom_name='__call__', is_const=True)
return
def register_Ns3WifiAddressTidHash_methods(root_module, cls):
## qos-utils.h (module 'wifi'): ns3::WifiAddressTidHash::WifiAddressTidHash() [constructor]
cls.add_constructor([])
## qos-utils.h (module 'wifi'): ns3::WifiAddressTidHash::WifiAddressTidHash(ns3::WifiAddressTidHash const & arg0) [constructor]
cls.add_constructor([param('ns3::WifiAddressTidHash const &', 'arg0')])
## qos-utils.h (module 'wifi'): std::size_t ns3::WifiAddressTidHash::operator()(ns3::WifiAddressTidPair const & addressTidPair) const [member operator]
cls.add_method('operator()',
'std::size_t',
[param('ns3::WifiAddressTidPair const &', 'addressTidPair')],
custom_name='__call__', is_const=True)
return
def register_Ns3WifiMode_methods(root_module, cls):
cls.add_binary_comparison_operator('==')
cls.add_binary_comparison_operator('!=')
cls.add_binary_comparison_operator('<')
cls.add_output_stream_operator()
## wifi-mode.h (module 'wifi'): ns3::WifiMode::WifiMode(ns3::WifiMode const & arg0) [constructor]
cls.add_constructor([param('ns3::WifiMode const &', 'arg0')])
## wifi-mode.h (module 'wifi'): ns3::WifiMode::WifiMode() [constructor]
cls.add_constructor([])
## wifi-mode.h (module 'wifi'): ns3::WifiMode::WifiMode(std::string name) [constructor]
cls.add_constructor([param('std::string', 'name')])
## wifi-mode.h (module 'wifi'): ns3::WifiCodeRate ns3::WifiMode::GetCodeRate() const [member function]
cls.add_method('GetCodeRate',
'ns3::WifiCodeRate',
[],
is_const=True)
## wifi-mode.h (module 'wifi'): uint16_t ns3::WifiMode::GetConstellationSize() const [member function]
cls.add_method('GetConstellationSize',
'uint16_t',
[],
is_const=True)
## wifi-mode.h (module 'wifi'): uint64_t ns3::WifiMode::GetDataRate(uint16_t channelWidth, uint16_t guardInterval, uint8_t nss) const [member function]
cls.add_method('GetDataRate',
'uint64_t',
[param('uint16_t', 'channelWidth'), param('uint16_t', 'guardInterval'), param('uint8_t', 'nss')],
is_const=True)
## wifi-mode.h (module 'wifi'): uint64_t ns3::WifiMode::GetDataRate(ns3::WifiTxVector const & txVector, uint16_t staId=65535) const [member function]
cls.add_method('GetDataRate',
'uint64_t',
[param('ns3::WifiTxVector const &', 'txVector'), param('uint16_t', 'staId', default_value='65535')],
is_const=True)
## wifi-mode.h (module 'wifi'): uint64_t ns3::WifiMode::GetDataRate(uint16_t channelWidth) const [member function]
cls.add_method('GetDataRate',
'uint64_t',
[param('uint16_t', 'channelWidth')],
is_const=True)
## wifi-mode.h (module 'wifi'): uint8_t ns3::WifiMode::GetMcsValue() const [member function]
cls.add_method('GetMcsValue',
'uint8_t',
[],
is_const=True)
## wifi-mode.h (module 'wifi'): ns3::WifiModulationClass ns3::WifiMode::GetModulationClass() const [member function]
cls.add_method('GetModulationClass',
'ns3::WifiModulationClass',
[],
is_const=True)
## wifi-mode.h (module 'wifi'): uint64_t ns3::WifiMode::GetNonHtReferenceRate() const [member function]
cls.add_method('GetNonHtReferenceRate',
'uint64_t',
[],
is_const=True)
## wifi-mode.h (module 'wifi'): uint64_t ns3::WifiMode::GetPhyRate(uint16_t channelWidth, uint16_t guardInterval, uint8_t nss) const [member function]
cls.add_method('GetPhyRate',
'uint64_t',
[param('uint16_t', 'channelWidth'), param('uint16_t', 'guardInterval'), param('uint8_t', 'nss')],
is_const=True)
## wifi-mode.h (module 'wifi'): uint64_t ns3::WifiMode::GetPhyRate(ns3::WifiTxVector const & txVector, uint16_t staId=65535) const [member function]
cls.add_method('GetPhyRate',
'uint64_t',
[param('ns3::WifiTxVector const &', 'txVector'), param('uint16_t', 'staId', default_value='65535')],
is_const=True)
## wifi-mode.h (module 'wifi'): uint64_t ns3::WifiMode::GetPhyRate(uint16_t channelWidth) const [member function]
cls.add_method('GetPhyRate',
'uint64_t',
[param('uint16_t', 'channelWidth')],
is_const=True)
## wifi-mode.h (module 'wifi'): uint32_t ns3::WifiMode::GetUid() const [member function]
cls.add_method('GetUid',
'uint32_t',
[],
is_const=True)
## wifi-mode.h (module 'wifi'): std::string ns3::WifiMode::GetUniqueName() const [member function]
cls.add_method('GetUniqueName',
'std::string',
[],
is_const=True)
## wifi-mode.h (module 'wifi'): bool ns3::WifiMode::IsAllowed(uint16_t channelWidth, uint8_t nss) const [member function]
cls.add_method('IsAllowed',
'bool',
[param('uint16_t', 'channelWidth'), param('uint8_t', 'nss')],
is_const=True)
## wifi-mode.h (module 'wifi'): bool ns3::WifiMode::IsHigherCodeRate(ns3::WifiMode mode) const [member function]
cls.add_method('IsHigherCodeRate',
'bool',
[param('ns3::WifiMode', 'mode')],
is_const=True)
## wifi-mode.h (module 'wifi'): bool ns3::WifiMode::IsHigherDataRate(ns3::WifiMode mode) const [member function]
cls.add_method('IsHigherDataRate',
'bool',
[param('ns3::WifiMode', 'mode')],
is_const=True)
## wifi-mode.h (module 'wifi'): bool ns3::WifiMode::IsMandatory() const [member function]
cls.add_method('IsMandatory',
'bool',
[],
is_const=True)
return
def register_Ns3WifiModeFactory_methods(root_module, cls):
## wifi-mode.h (module 'wifi'): ns3::WifiModeFactory::WifiModeFactory(ns3::WifiModeFactory const & arg0) [constructor]
cls.add_constructor([param('ns3::WifiModeFactory const &', 'arg0')])
## wifi-mode.h (module 'wifi'): static ns3::WifiMode ns3::WifiModeFactory::CreateWifiMcs(std::string uniqueName, uint8_t mcsValue, ns3::WifiModulationClass modClass, ns3::WifiModeFactory::CodeRateCallback codeRateCallback, ns3::WifiModeFactory::ConstellationSizeCallback constellationSizeCallback, ns3::WifiModeFactory::PhyRateCallback phyRateCallback, ns3::WifiModeFactory::PhyRateFromTxVectorCallback phyRateFromTxVectorCallback, ns3::WifiModeFactory::DataRateCallback dataRateCallback, ns3::WifiModeFactory::DataRateFromTxVectorCallback dataRateFromTxVectorCallback, ns3::WifiModeFactory::NonHtReferenceRateCallback nonHtReferenceRateCallback, ns3::WifiModeFactory::ModeAllowedCallback isModeAllowedCallback) [member function]
cls.add_method('CreateWifiMcs',
'ns3::WifiMode',
[param('std::string', 'uniqueName'), param('uint8_t', 'mcsValue'), param('ns3::WifiModulationClass', 'modClass'), param('ns3::Callback< unsigned short, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'codeRateCallback'), param('ns3::Callback< unsigned short, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'constellationSizeCallback'), param('ns3::Callback< unsigned long, unsigned short, unsigned short, unsigned char, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'phyRateCallback'), param('ns3::Callback< unsigned long, ns3::WifiTxVector const &, unsigned short, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'phyRateFromTxVectorCallback'), param('ns3::Callback< unsigned long, unsigned short, unsigned short, unsigned char, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'dataRateCallback'), param('ns3::Callback< unsigned long, ns3::WifiTxVector const &, unsigned short, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'dataRateFromTxVectorCallback'), param('ns3::Callback< unsigned long, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'nonHtReferenceRateCallback'), param('ns3::Callback< bool, unsigned short, unsigned char, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'isModeAllowedCallback')],
is_static=True)
## wifi-mode.h (module 'wifi'): static ns3::WifiMode ns3::WifiModeFactory::CreateWifiMode(std::string uniqueName, ns3::WifiModulationClass modClass, bool isMandatory, ns3::WifiModeFactory::CodeRateCallback codeRateCallback, ns3::WifiModeFactory::ConstellationSizeCallback constellationSizeCallback, ns3::WifiModeFactory::PhyRateCallback phyRateCallback, ns3::WifiModeFactory::PhyRateFromTxVectorCallback phyRateFromTxVectorCallback, ns3::WifiModeFactory::DataRateCallback dataRateCallback, ns3::WifiModeFactory::DataRateFromTxVectorCallback dataRateFromTxVectorCallback, ns3::WifiModeFactory::ModeAllowedCallback isModeAllowedCallback) [member function]
cls.add_method('CreateWifiMode',
'ns3::WifiMode',
[param('std::string', 'uniqueName'), param('ns3::WifiModulationClass', 'modClass'), param('bool', 'isMandatory'), param('ns3::Callback< unsigned short, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'codeRateCallback'), param('ns3::Callback< unsigned short, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'constellationSizeCallback'), param('ns3::Callback< unsigned long, unsigned short, unsigned short, unsigned char, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'phyRateCallback'), param('ns3::Callback< unsigned long, ns3::WifiTxVector const &, unsigned short, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'phyRateFromTxVectorCallback'), param('ns3::Callback< unsigned long, unsigned short, unsigned short, unsigned char, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'dataRateCallback'), param('ns3::Callback< unsigned long, ns3::WifiTxVector const &, unsigned short, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'dataRateFromTxVectorCallback'), param('ns3::Callback< bool, unsigned short, unsigned char, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'isModeAllowedCallback')],
is_static=True)
return
def register_Ns3WifiRemoteStation_methods(root_module, cls):
## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiRemoteStation::WifiRemoteStation() [constructor]
cls.add_constructor([])
## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiRemoteStation::WifiRemoteStation(ns3::WifiRemoteStation const & arg0) [constructor]
cls.add_constructor([param('ns3::WifiRemoteStation const &', 'arg0')])
## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiRemoteStation::m_rssiAndUpdateTimePair [variable]
cls.add_instance_attribute('m_rssiAndUpdateTimePair', 'std::pair< double, ns3::Time >', is_const=False)
## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiRemoteStation::m_state [variable]
cls.add_instance_attribute('m_state', 'ns3::WifiRemoteStationState *', is_const=False)
return
def register_Ns3WifiRemoteStationInfo_methods(root_module, cls):
## wifi-remote-station-info.h (module 'wifi'): ns3::WifiRemoteStationInfo::WifiRemoteStationInfo(ns3::WifiRemoteStationInfo const & arg0) [constructor]
cls.add_constructor([param('ns3::WifiRemoteStationInfo const &', 'arg0')])
## wifi-remote-station-info.h (module 'wifi'): ns3::WifiRemoteStationInfo::WifiRemoteStationInfo() [constructor]
cls.add_constructor([])
## wifi-remote-station-info.h (module 'wifi'): double ns3::WifiRemoteStationInfo::GetFrameErrorRate() const [member function]
cls.add_method('GetFrameErrorRate',
'double',
[],
is_const=True)
## wifi-remote-station-info.h (module 'wifi'): void ns3::WifiRemoteStationInfo::NotifyTxFailed() [member function]
cls.add_method('NotifyTxFailed',
'void',
[])
## wifi-remote-station-info.h (module 'wifi'): void ns3::WifiRemoteStationInfo::NotifyTxSuccess(uint32_t retryCounter) [member function]
cls.add_method('NotifyTxSuccess',
'void',
[param('uint32_t', 'retryCounter')])
return
def register_Ns3WifiRemoteStationState_methods(root_module, cls):
## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiRemoteStationState::WifiRemoteStationState() [constructor]
cls.add_constructor([])
## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiRemoteStationState::WifiRemoteStationState(ns3::WifiRemoteStationState const & arg0) [constructor]
cls.add_constructor([param('ns3::WifiRemoteStationState const &', 'arg0')])
## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiRemoteStationState::m_address [variable]
cls.add_instance_attribute('m_address', 'ns3::Mac48Address', is_const=False)
## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiRemoteStationState::m_aggregation [variable]
cls.add_instance_attribute('m_aggregation', 'bool', is_const=False)
## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiRemoteStationState::m_aid [variable]
cls.add_instance_attribute('m_aid', 'uint16_t', is_const=False)
## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiRemoteStationState::m_channelWidth [variable]
cls.add_instance_attribute('m_channelWidth', 'uint16_t', is_const=False)
## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiRemoteStationState::m_dsssSupported [variable]
cls.add_instance_attribute('m_dsssSupported', 'bool', is_const=False)
## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiRemoteStationState::m_erpOfdmSupported [variable]
cls.add_instance_attribute('m_erpOfdmSupported', 'bool', is_const=False)
## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiRemoteStationState::m_guardInterval [variable]
cls.add_instance_attribute('m_guardInterval', 'uint16_t', is_const=False)
## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiRemoteStationState::m_heCapabilities [variable]
cls.add_instance_attribute('m_heCapabilities', 'ns3::Ptr< ns3::HeCapabilities const >', is_const=False)
## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiRemoteStationState::m_htCapabilities [variable]
cls.add_instance_attribute('m_htCapabilities', 'ns3::Ptr< ns3::HtCapabilities const >', is_const=False)
## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiRemoteStationState::m_info [variable]
cls.add_instance_attribute('m_info', 'ns3::WifiRemoteStationInfo', is_const=False)
## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiRemoteStationState::m_ness [variable]
cls.add_instance_attribute('m_ness', 'uint8_t', is_const=False)
## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiRemoteStationState::m_ofdmSupported [variable]
cls.add_instance_attribute('m_ofdmSupported', 'bool', is_const=False)
## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiRemoteStationState::m_operationalMcsSet [variable]
cls.add_instance_attribute('m_operationalMcsSet', 'ns3::WifiModeList', is_const=False)
## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiRemoteStationState::m_operationalRateSet [variable]
cls.add_instance_attribute('m_operationalRateSet', 'ns3::WifiModeList', is_const=False)
## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiRemoteStationState::m_qosSupported [variable]
cls.add_instance_attribute('m_qosSupported', 'bool', is_const=False)
## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiRemoteStationState::m_shortPreamble [variable]
cls.add_instance_attribute('m_shortPreamble', 'bool', is_const=False)
## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiRemoteStationState::m_shortSlotTime [variable]
cls.add_instance_attribute('m_shortSlotTime', 'bool', is_const=False)
## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiRemoteStationState::m_vhtCapabilities [variable]
cls.add_instance_attribute('m_vhtCapabilities', 'ns3::Ptr< ns3::VhtCapabilities const >', is_const=False)
return
def register_Ns3WifiStandardInfo_methods(root_module, cls):
## wifi-standards.h (module 'wifi'): ns3::WifiStandardInfo::WifiStandardInfo() [constructor]
cls.add_constructor([])
## wifi-standards.h (module 'wifi'): ns3::WifiStandardInfo::WifiStandardInfo(ns3::WifiStandardInfo const & arg0) [constructor]
cls.add_constructor([param('ns3::WifiStandardInfo const &', 'arg0')])
## wifi-standards.h (module 'wifi'): ns3::WifiStandardInfo::macStandard [variable]
cls.add_instance_attribute('macStandard', 'ns3::WifiMacStandard', is_const=False)
## wifi-standards.h (module 'wifi'): ns3::WifiStandardInfo::phyBand [variable]
cls.add_instance_attribute('phyBand', 'ns3::WifiPhyBand', is_const=False)
## wifi-standards.h (module 'wifi'): ns3::WifiStandardInfo::phyStandard [variable]
cls.add_instance_attribute('phyStandard', 'ns3::WifiPhyStandard', is_const=False)
return
def register_Ns3Empty_methods(root_module, cls):
## empty.h (module 'core'): ns3::empty::empty() [constructor]
cls.add_constructor([])
## empty.h (module 'core'): ns3::empty::empty(ns3::empty const & arg0) [constructor]
cls.add_constructor([param('ns3::empty const &', 'arg0')])
return
def register_Ns3Int64x64_t_methods(root_module, cls):
cls.add_binary_numeric_operator('*', root_module['ns3::Time'], root_module['ns3::int64x64_t'], param('ns3::Time const &', 'right'))
cls.add_binary_numeric_operator('+', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('ns3::int64x64_t const &', 'right'))
cls.add_binary_numeric_operator('-', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('ns3::int64x64_t const &', 'right'))
cls.add_binary_numeric_operator('*', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('ns3::int64x64_t const &', 'right'))
cls.add_binary_numeric_operator('/', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('ns3::int64x64_t const &', 'right'))
cls.add_binary_comparison_operator('!=')
cls.add_binary_comparison_operator('<=')
cls.add_binary_comparison_operator('>=')
cls.add_output_stream_operator()
cls.add_binary_comparison_operator('==')
cls.add_binary_comparison_operator('<')
cls.add_binary_comparison_operator('>')
cls.add_inplace_numeric_operator('+=', param('ns3::int64x64_t const &', 'right'))
cls.add_inplace_numeric_operator('-=', param('ns3::int64x64_t const &', 'right'))
cls.add_inplace_numeric_operator('*=', param('ns3::int64x64_t const &', 'right'))
cls.add_inplace_numeric_operator('/=', param('ns3::int64x64_t const &', 'right'))
cls.add_unary_numeric_operator('-')
## int64x64-128.h (module 'core'): ns3::int64x64_t::int64x64_t() [constructor]
cls.add_constructor([])
## int64x64-128.h (module 'core'): ns3::int64x64_t::int64x64_t(double const value) [constructor]
cls.add_constructor([param('double const', 'value')])
## int64x64-128.h (module 'core'): ns3::int64x64_t::int64x64_t(long double const value) [constructor]
cls.add_constructor([param('long double const', 'value')])
## int64x64-128.h (module 'core'): ns3::int64x64_t::int64x64_t(int const v) [constructor]
cls.add_constructor([param('int const', 'v')])
## int64x64-128.h (module 'core'): ns3::int64x64_t::int64x64_t(long int const v) [constructor]
cls.add_constructor([param('long int const', 'v')])
## int64x64-128.h (module 'core'): ns3::int64x64_t::int64x64_t(long long int const v) [constructor]
cls.add_constructor([param('long long int const', 'v')])
## int64x64-128.h (module 'core'): ns3::int64x64_t::int64x64_t(unsigned int const v) [constructor]
cls.add_constructor([param('unsigned int const', 'v')])
## int64x64-128.h (module 'core'): ns3::int64x64_t::int64x64_t(long unsigned int const v) [constructor]
cls.add_constructor([param('long unsigned int const', 'v')])
## int64x64-128.h (module 'core'): ns3::int64x64_t::int64x64_t(long long unsigned int const v) [constructor]
cls.add_constructor([param('long long unsigned int const', 'v')])
## int64x64-128.h (module 'core'): ns3::int64x64_t::int64x64_t(int64_t const hi, uint64_t const lo) [constructor]
cls.add_constructor([param('int64_t const', 'hi'), param('uint64_t const', 'lo')])
## int64x64-128.h (module 'core'): ns3::int64x64_t::int64x64_t(ns3::int64x64_t const & o) [constructor]
cls.add_constructor([param('ns3::int64x64_t const &', 'o')])
## int64x64-128.h (module 'core'): double ns3::int64x64_t::GetDouble() const [member function]
cls.add_method('GetDouble',
'double',
[],
is_const=True)
## int64x64-128.h (module 'core'): int64_t ns3::int64x64_t::GetHigh() const [member function]
cls.add_method('GetHigh',
'int64_t',
[],
is_const=True)
## int64x64-128.h (module 'core'): int64_t ns3::int64x64_t::GetInt() const [member function]
cls.add_method('GetInt',
'int64_t',
[],
is_const=True)
## int64x64-128.h (module 'core'): uint64_t ns3::int64x64_t::GetLow() const [member function]
cls.add_method('GetLow',
'uint64_t',
[],
is_const=True)
## int64x64-128.h (module 'core'): static ns3::int64x64_t ns3::int64x64_t::Invert(uint64_t const v) [member function]
cls.add_method('Invert',
'ns3::int64x64_t',
[param('uint64_t const', 'v')],
is_static=True)
## int64x64-128.h (module 'core'): void ns3::int64x64_t::MulByInvert(ns3::int64x64_t const & o) [member function]
cls.add_method('MulByInvert',
'void',
[param('ns3::int64x64_t const &', 'o')])
## int64x64-128.h (module 'core'): int64_t ns3::int64x64_t::Round() const [member function]
cls.add_method('Round',
'int64_t',
[],
is_const=True)
## int64x64-128.h (module 'core'): ns3::int64x64_t::implementation [variable]
cls.add_static_attribute('implementation', 'ns3::int64x64_t::impl_type const', is_const=True)
return
def register_Ns3Chunk_methods(root_module, cls):
## chunk.h (module 'network'): ns3::Chunk::Chunk() [constructor]
cls.add_constructor([])
## chunk.h (module 'network'): ns3::Chunk::Chunk(ns3::Chunk const & arg0) [constructor]
cls.add_constructor([param('ns3::Chunk const &', 'arg0')])
## chunk.h (module 'network'): uint32_t ns3::Chunk::Deserialize(ns3::Buffer::Iterator start) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('ns3::Buffer::Iterator', 'start')],
is_pure_virtual=True, is_virtual=True)
## chunk.h (module 'network'): uint32_t ns3::Chunk::Deserialize(ns3::Buffer::Iterator start, ns3::Buffer::Iterator end) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('ns3::Buffer::Iterator', 'start'), param('ns3::Buffer::Iterator', 'end')],
is_virtual=True)
## chunk.h (module 'network'): static ns3::TypeId ns3::Chunk::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## chunk.h (module 'network'): void ns3::Chunk::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True, is_pure_virtual=True, is_virtual=True)
return
def register_Ns3Header_methods(root_module, cls):
cls.add_output_stream_operator()
## header.h (module 'network'): ns3::Header::Header() [constructor]
cls.add_constructor([])
## header.h (module 'network'): ns3::Header::Header(ns3::Header const & arg0) [constructor]
cls.add_constructor([param('ns3::Header const &', 'arg0')])
## header.h (module 'network'): uint32_t ns3::Header::Deserialize(ns3::Buffer::Iterator start) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('ns3::Buffer::Iterator', 'start')],
is_pure_virtual=True, is_virtual=True)
## header.h (module 'network'): uint32_t ns3::Header::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True, is_pure_virtual=True, is_virtual=True)
## header.h (module 'network'): static ns3::TypeId ns3::Header::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## header.h (module 'network'): void ns3::Header::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True, is_pure_virtual=True, is_virtual=True)
## header.h (module 'network'): void ns3::Header::Serialize(ns3::Buffer::Iterator start) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::Buffer::Iterator', 'start')],
is_const=True, is_pure_virtual=True, is_virtual=True)
return
def register_Ns3Icmpv4DestinationUnreachable_methods(root_module, cls):
## icmpv4.h (module 'internet'): ns3::Icmpv4DestinationUnreachable::Icmpv4DestinationUnreachable(ns3::Icmpv4DestinationUnreachable const & arg0) [constructor]
cls.add_constructor([param('ns3::Icmpv4DestinationUnreachable const &', 'arg0')])
## icmpv4.h (module 'internet'): ns3::Icmpv4DestinationUnreachable::Icmpv4DestinationUnreachable() [constructor]
cls.add_constructor([])
## icmpv4.h (module 'internet'): void ns3::Icmpv4DestinationUnreachable::GetData(uint8_t * payload) const [member function]
cls.add_method('GetData',
'void',
[param('uint8_t *', 'payload')],
is_const=True)
## icmpv4.h (module 'internet'): ns3::Ipv4Header ns3::Icmpv4DestinationUnreachable::GetHeader() const [member function]
cls.add_method('GetHeader',
'ns3::Ipv4Header',
[],
is_const=True)
## icmpv4.h (module 'internet'): uint16_t ns3::Icmpv4DestinationUnreachable::GetNextHopMtu() const [member function]
cls.add_method('GetNextHopMtu',
'uint16_t',
[],
is_const=True)
## icmpv4.h (module 'internet'): static ns3::TypeId ns3::Icmpv4DestinationUnreachable::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## icmpv4.h (module 'internet'): void ns3::Icmpv4DestinationUnreachable::SetData(ns3::Ptr<const ns3::Packet> data) [member function]
cls.add_method('SetData',
'void',
[param('ns3::Ptr< ns3::Packet const >', 'data')])
## icmpv4.h (module 'internet'): void ns3::Icmpv4DestinationUnreachable::SetHeader(ns3::Ipv4Header header) [member function]
cls.add_method('SetHeader',
'void',
[param('ns3::Ipv4Header', 'header')])
## icmpv4.h (module 'internet'): void ns3::Icmpv4DestinationUnreachable::SetNextHopMtu(uint16_t mtu) [member function]
cls.add_method('SetNextHopMtu',
'void',
[param('uint16_t', 'mtu')])
## icmpv4.h (module 'internet'): uint32_t ns3::Icmpv4DestinationUnreachable::Deserialize(ns3::Buffer::Iterator start) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('ns3::Buffer::Iterator', 'start')],
is_virtual=True, visibility='private')
## icmpv4.h (module 'internet'): ns3::TypeId ns3::Icmpv4DestinationUnreachable::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True, visibility='private')
## icmpv4.h (module 'internet'): uint32_t ns3::Icmpv4DestinationUnreachable::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True, is_virtual=True, visibility='private')
## icmpv4.h (module 'internet'): void ns3::Icmpv4DestinationUnreachable::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True, is_virtual=True, visibility='private')
## icmpv4.h (module 'internet'): void ns3::Icmpv4DestinationUnreachable::Serialize(ns3::Buffer::Iterator start) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::Buffer::Iterator', 'start')],
is_const=True, is_virtual=True, visibility='private')
return
def register_Ns3Icmpv4Echo_methods(root_module, cls):
## icmpv4.h (module 'internet'): ns3::Icmpv4Echo::Icmpv4Echo(ns3::Icmpv4Echo const & arg0) [constructor]
cls.add_constructor([param('ns3::Icmpv4Echo const &', 'arg0')])
## icmpv4.h (module 'internet'): ns3::Icmpv4Echo::Icmpv4Echo() [constructor]
cls.add_constructor([])
## icmpv4.h (module 'internet'): uint32_t ns3::Icmpv4Echo::Deserialize(ns3::Buffer::Iterator start) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('ns3::Buffer::Iterator', 'start')],
is_virtual=True)
## icmpv4.h (module 'internet'): uint32_t ns3::Icmpv4Echo::GetData(uint8_t * payload) const [member function]
cls.add_method('GetData',
'uint32_t',
[param('uint8_t *', 'payload')],
is_const=True)
## icmpv4.h (module 'internet'): uint32_t ns3::Icmpv4Echo::GetDataSize() const [member function]
cls.add_method('GetDataSize',
'uint32_t',
[],
is_const=True)
## icmpv4.h (module 'internet'): uint16_t ns3::Icmpv4Echo::GetIdentifier() const [member function]
cls.add_method('GetIdentifier',
'uint16_t',
[],
is_const=True)
## icmpv4.h (module 'internet'): ns3::TypeId ns3::Icmpv4Echo::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## icmpv4.h (module 'internet'): uint16_t ns3::Icmpv4Echo::GetSequenceNumber() const [member function]
cls.add_method('GetSequenceNumber',
'uint16_t',
[],
is_const=True)
## icmpv4.h (module 'internet'): uint32_t ns3::Icmpv4Echo::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True, is_virtual=True)
## icmpv4.h (module 'internet'): static ns3::TypeId ns3::Icmpv4Echo::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## icmpv4.h (module 'internet'): void ns3::Icmpv4Echo::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True, is_virtual=True)
## icmpv4.h (module 'internet'): void ns3::Icmpv4Echo::Serialize(ns3::Buffer::Iterator start) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::Buffer::Iterator', 'start')],
is_const=True, is_virtual=True)
## icmpv4.h (module 'internet'): void ns3::Icmpv4Echo::SetData(ns3::Ptr<const ns3::Packet> data) [member function]
cls.add_method('SetData',
'void',
[param('ns3::Ptr< ns3::Packet const >', 'data')])
## icmpv4.h (module 'internet'): void ns3::Icmpv4Echo::SetIdentifier(uint16_t id) [member function]
cls.add_method('SetIdentifier',
'void',
[param('uint16_t', 'id')])
## icmpv4.h (module 'internet'): void ns3::Icmpv4Echo::SetSequenceNumber(uint16_t seq) [member function]
cls.add_method('SetSequenceNumber',
'void',
[param('uint16_t', 'seq')])
return
def register_Ns3Icmpv4Header_methods(root_module, cls):
## icmpv4.h (module 'internet'): ns3::Icmpv4Header::Icmpv4Header(ns3::Icmpv4Header const & arg0) [constructor]
cls.add_constructor([param('ns3::Icmpv4Header const &', 'arg0')])
## icmpv4.h (module 'internet'): ns3::Icmpv4Header::Icmpv4Header() [constructor]
cls.add_constructor([])
## icmpv4.h (module 'internet'): uint32_t ns3::Icmpv4Header::Deserialize(ns3::Buffer::Iterator start) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('ns3::Buffer::Iterator', 'start')],
is_virtual=True)
## icmpv4.h (module 'internet'): void ns3::Icmpv4Header::EnableChecksum() [member function]
cls.add_method('EnableChecksum',
'void',
[])
## icmpv4.h (module 'internet'): uint8_t ns3::Icmpv4Header::GetCode() const [member function]
cls.add_method('GetCode',
'uint8_t',
[],
is_const=True)
## icmpv4.h (module 'internet'): ns3::TypeId ns3::Icmpv4Header::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## icmpv4.h (module 'internet'): uint32_t ns3::Icmpv4Header::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True, is_virtual=True)
## icmpv4.h (module 'internet'): uint8_t ns3::Icmpv4Header::GetType() const [member function]
cls.add_method('GetType',
'uint8_t',
[],
is_const=True)
## icmpv4.h (module 'internet'): static ns3::TypeId ns3::Icmpv4Header::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## icmpv4.h (module 'internet'): void ns3::Icmpv4Header::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True, is_virtual=True)
## icmpv4.h (module 'internet'): void ns3::Icmpv4Header::Serialize(ns3::Buffer::Iterator start) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::Buffer::Iterator', 'start')],
is_const=True, is_virtual=True)
## icmpv4.h (module 'internet'): void ns3::Icmpv4Header::SetCode(uint8_t code) [member function]
cls.add_method('SetCode',
'void',
[param('uint8_t', 'code')])
## icmpv4.h (module 'internet'): void ns3::Icmpv4Header::SetType(uint8_t type) [member function]
cls.add_method('SetType',
'void',
[param('uint8_t', 'type')])
return
def register_Ns3Icmpv4TimeExceeded_methods(root_module, cls):
## icmpv4.h (module 'internet'): ns3::Icmpv4TimeExceeded::Icmpv4TimeExceeded(ns3::Icmpv4TimeExceeded const & arg0) [constructor]
cls.add_constructor([param('ns3::Icmpv4TimeExceeded const &', 'arg0')])
## icmpv4.h (module 'internet'): ns3::Icmpv4TimeExceeded::Icmpv4TimeExceeded() [constructor]
cls.add_constructor([])
## icmpv4.h (module 'internet'): uint32_t ns3::Icmpv4TimeExceeded::Deserialize(ns3::Buffer::Iterator start) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('ns3::Buffer::Iterator', 'start')],
is_virtual=True)
## icmpv4.h (module 'internet'): void ns3::Icmpv4TimeExceeded::GetData(uint8_t * payload) const [member function]
cls.add_method('GetData',
'void',
[param('uint8_t *', 'payload')],
is_const=True)
## icmpv4.h (module 'internet'): ns3::Ipv4Header ns3::Icmpv4TimeExceeded::GetHeader() const [member function]
cls.add_method('GetHeader',
'ns3::Ipv4Header',
[],
is_const=True)
## icmpv4.h (module 'internet'): ns3::TypeId ns3::Icmpv4TimeExceeded::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## icmpv4.h (module 'internet'): uint32_t ns3::Icmpv4TimeExceeded::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True, is_virtual=True)
## icmpv4.h (module 'internet'): static ns3::TypeId ns3::Icmpv4TimeExceeded::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## icmpv4.h (module 'internet'): void ns3::Icmpv4TimeExceeded::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True, is_virtual=True)
## icmpv4.h (module 'internet'): void ns3::Icmpv4TimeExceeded::Serialize(ns3::Buffer::Iterator start) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::Buffer::Iterator', 'start')],
is_const=True, is_virtual=True)
## icmpv4.h (module 'internet'): void ns3::Icmpv4TimeExceeded::SetData(ns3::Ptr<const ns3::Packet> data) [member function]
cls.add_method('SetData',
'void',
[param('ns3::Ptr< ns3::Packet const >', 'data')])
## icmpv4.h (module 'internet'): void ns3::Icmpv4TimeExceeded::SetHeader(ns3::Ipv4Header header) [member function]
cls.add_method('SetHeader',
'void',
[param('ns3::Ipv4Header', 'header')])
return
def register_Ns3Ipv4Header_methods(root_module, cls):
## ipv4-header.h (module 'internet'): ns3::Ipv4Header::Ipv4Header(ns3::Ipv4Header const & arg0) [constructor]
cls.add_constructor([param('ns3::Ipv4Header const &', 'arg0')])
## ipv4-header.h (module 'internet'): ns3::Ipv4Header::Ipv4Header() [constructor]
cls.add_constructor([])
## ipv4-header.h (module 'internet'): uint32_t ns3::Ipv4Header::Deserialize(ns3::Buffer::Iterator start) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('ns3::Buffer::Iterator', 'start')],
is_virtual=True)
## ipv4-header.h (module 'internet'): std::string ns3::Ipv4Header::DscpTypeToString(ns3::Ipv4Header::DscpType dscp) const [member function]
cls.add_method('DscpTypeToString',
'std::string',
[param('ns3::Ipv4Header::DscpType', 'dscp')],
is_const=True)
## ipv4-header.h (module 'internet'): std::string ns3::Ipv4Header::EcnTypeToString(ns3::Ipv4Header::EcnType ecn) const [member function]
cls.add_method('EcnTypeToString',
'std::string',
[param('ns3::Ipv4Header::EcnType', 'ecn')],
is_const=True)
## ipv4-header.h (module 'internet'): void ns3::Ipv4Header::EnableChecksum() [member function]
cls.add_method('EnableChecksum',
'void',
[])
## ipv4-header.h (module 'internet'): ns3::Ipv4Address ns3::Ipv4Header::GetDestination() const [member function]
cls.add_method('GetDestination',
'ns3::Ipv4Address',
[],
is_const=True)
## ipv4-header.h (module 'internet'): ns3::Ipv4Header::DscpType ns3::Ipv4Header::GetDscp() const [member function]
cls.add_method('GetDscp',
'ns3::Ipv4Header::DscpType',
[],
is_const=True)
## ipv4-header.h (module 'internet'): ns3::Ipv4Header::EcnType ns3::Ipv4Header::GetEcn() const [member function]
cls.add_method('GetEcn',
'ns3::Ipv4Header::EcnType',
[],
is_const=True)
## ipv4-header.h (module 'internet'): uint16_t ns3::Ipv4Header::GetFragmentOffset() const [member function]
cls.add_method('GetFragmentOffset',
'uint16_t',
[],
is_const=True)
## ipv4-header.h (module 'internet'): uint16_t ns3::Ipv4Header::GetIdentification() const [member function]
cls.add_method('GetIdentification',
'uint16_t',
[],
is_const=True)
## ipv4-header.h (module 'internet'): ns3::TypeId ns3::Ipv4Header::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## ipv4-header.h (module 'internet'): uint16_t ns3::Ipv4Header::GetPayloadSize() const [member function]
cls.add_method('GetPayloadSize',
'uint16_t',
[],
is_const=True)
## ipv4-header.h (module 'internet'): uint8_t ns3::Ipv4Header::GetProtocol() const [member function]
cls.add_method('GetProtocol',
'uint8_t',
[],
is_const=True)
## ipv4-header.h (module 'internet'): uint32_t ns3::Ipv4Header::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True, is_virtual=True)
## ipv4-header.h (module 'internet'): ns3::Ipv4Address ns3::Ipv4Header::GetSource() const [member function]
cls.add_method('GetSource',
'ns3::Ipv4Address',
[],
is_const=True)
## ipv4-header.h (module 'internet'): uint8_t ns3::Ipv4Header::GetTos() const [member function]
cls.add_method('GetTos',
'uint8_t',
[],
is_const=True)
## ipv4-header.h (module 'internet'): uint8_t ns3::Ipv4Header::GetTtl() const [member function]
cls.add_method('GetTtl',
'uint8_t',
[],
is_const=True)
## ipv4-header.h (module 'internet'): static ns3::TypeId ns3::Ipv4Header::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## ipv4-header.h (module 'internet'): bool ns3::Ipv4Header::IsChecksumOk() const [member function]
cls.add_method('IsChecksumOk',
'bool',
[],
is_const=True)
## ipv4-header.h (module 'internet'): bool ns3::Ipv4Header::IsDontFragment() const [member function]
cls.add_method('IsDontFragment',
'bool',
[],
is_const=True)
## ipv4-header.h (module 'internet'): bool ns3::Ipv4Header::IsLastFragment() const [member function]
cls.add_method('IsLastFragment',
'bool',
[],
is_const=True)
## ipv4-header.h (module 'internet'): void ns3::Ipv4Header::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True, is_virtual=True)
## ipv4-header.h (module 'internet'): void ns3::Ipv4Header::Serialize(ns3::Buffer::Iterator start) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::Buffer::Iterator', 'start')],
is_const=True, is_virtual=True)
## ipv4-header.h (module 'internet'): void ns3::Ipv4Header::SetDestination(ns3::Ipv4Address destination) [member function]
cls.add_method('SetDestination',
'void',
[param('ns3::Ipv4Address', 'destination')])
## ipv4-header.h (module 'internet'): void ns3::Ipv4Header::SetDontFragment() [member function]
cls.add_method('SetDontFragment',
'void',
[])
## ipv4-header.h (module 'internet'): void ns3::Ipv4Header::SetDscp(ns3::Ipv4Header::DscpType dscp) [member function]
cls.add_method('SetDscp',
'void',
[param('ns3::Ipv4Header::DscpType', 'dscp')])
## ipv4-header.h (module 'internet'): void ns3::Ipv4Header::SetEcn(ns3::Ipv4Header::EcnType ecn) [member function]
cls.add_method('SetEcn',
'void',
[param('ns3::Ipv4Header::EcnType', 'ecn')])
## ipv4-header.h (module 'internet'): void ns3::Ipv4Header::SetFragmentOffset(uint16_t offsetBytes) [member function]
cls.add_method('SetFragmentOffset',
'void',
[param('uint16_t', 'offsetBytes')])
## ipv4-header.h (module 'internet'): void ns3::Ipv4Header::SetIdentification(uint16_t identification) [member function]
cls.add_method('SetIdentification',
'void',
[param('uint16_t', 'identification')])
## ipv4-header.h (module 'internet'): void ns3::Ipv4Header::SetLastFragment() [member function]
cls.add_method('SetLastFragment',
'void',
[])
## ipv4-header.h (module 'internet'): void ns3::Ipv4Header::SetMayFragment() [member function]
cls.add_method('SetMayFragment',
'void',
[])
## ipv4-header.h (module 'internet'): void ns3::Ipv4Header::SetMoreFragments() [member function]
cls.add_method('SetMoreFragments',
'void',
[])
## ipv4-header.h (module 'internet'): void ns3::Ipv4Header::SetPayloadSize(uint16_t size) [member function]
cls.add_method('SetPayloadSize',
'void',
[param('uint16_t', 'size')])
## ipv4-header.h (module 'internet'): void ns3::Ipv4Header::SetProtocol(uint8_t num) [member function]
cls.add_method('SetProtocol',
'void',
[param('uint8_t', 'num')])
## ipv4-header.h (module 'internet'): void ns3::Ipv4Header::SetSource(ns3::Ipv4Address source) [member function]
cls.add_method('SetSource',
'void',
[param('ns3::Ipv4Address', 'source')])
## ipv4-header.h (module 'internet'): void ns3::Ipv4Header::SetTos(uint8_t tos) [member function]
cls.add_method('SetTos',
'void',
[param('uint8_t', 'tos')])
## ipv4-header.h (module 'internet'): void ns3::Ipv4Header::SetTtl(uint8_t ttl) [member function]
cls.add_method('SetTtl',
'void',
[param('uint8_t', 'ttl')])
return
def register_Ns3Ipv6Header_methods(root_module, cls):
## ipv6-header.h (module 'internet'): ns3::Ipv6Header::Ipv6Header(ns3::Ipv6Header const & arg0) [constructor]
cls.add_constructor([param('ns3::Ipv6Header const &', 'arg0')])
## ipv6-header.h (module 'internet'): ns3::Ipv6Header::Ipv6Header() [constructor]
cls.add_constructor([])
## ipv6-header.h (module 'internet'): uint32_t ns3::Ipv6Header::Deserialize(ns3::Buffer::Iterator start) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('ns3::Buffer::Iterator', 'start')],
is_virtual=True)
## ipv6-header.h (module 'internet'): std::string ns3::Ipv6Header::DscpTypeToString(ns3::Ipv6Header::DscpType dscp) const [member function]
cls.add_method('DscpTypeToString',
'std::string',
[param('ns3::Ipv6Header::DscpType', 'dscp')],
is_const=True)
## ipv6-header.h (module 'internet'): std::string ns3::Ipv6Header::EcnTypeToString(ns3::Ipv6Header::EcnType ecn) const [member function]
cls.add_method('EcnTypeToString',
'std::string',
[param('ns3::Ipv6Header::EcnType', 'ecn')],
is_const=True)
## ipv6-header.h (module 'internet'): ns3::Ipv6Address ns3::Ipv6Header::GetDestination() const [member function]
cls.add_method('GetDestination',
'ns3::Ipv6Address',
[],
is_const=True)
## ipv6-header.h (module 'internet'): ns3::Ipv6Address ns3::Ipv6Header::GetDestinationAddress() const [member function]
cls.add_method('GetDestinationAddress',
'ns3::Ipv6Address',
[],
deprecated=True, is_const=True)
## ipv6-header.h (module 'internet'): ns3::Ipv6Header::DscpType ns3::Ipv6Header::GetDscp() const [member function]
cls.add_method('GetDscp',
'ns3::Ipv6Header::DscpType',
[],
is_const=True)
## ipv6-header.h (module 'internet'): ns3::Ipv6Header::EcnType ns3::Ipv6Header::GetEcn() const [member function]
cls.add_method('GetEcn',
'ns3::Ipv6Header::EcnType',
[],
is_const=True)
## ipv6-header.h (module 'internet'): uint32_t ns3::Ipv6Header::GetFlowLabel() const [member function]
cls.add_method('GetFlowLabel',
'uint32_t',
[],
is_const=True)
## ipv6-header.h (module 'internet'): uint8_t ns3::Ipv6Header::GetHopLimit() const [member function]
cls.add_method('GetHopLimit',
'uint8_t',
[],
is_const=True)
## ipv6-header.h (module 'internet'): ns3::TypeId ns3::Ipv6Header::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## ipv6-header.h (module 'internet'): uint8_t ns3::Ipv6Header::GetNextHeader() const [member function]
cls.add_method('GetNextHeader',
'uint8_t',
[],
is_const=True)
## ipv6-header.h (module 'internet'): uint16_t ns3::Ipv6Header::GetPayloadLength() const [member function]
cls.add_method('GetPayloadLength',
'uint16_t',
[],
is_const=True)
## ipv6-header.h (module 'internet'): uint32_t ns3::Ipv6Header::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True, is_virtual=True)
## ipv6-header.h (module 'internet'): ns3::Ipv6Address ns3::Ipv6Header::GetSource() const [member function]
cls.add_method('GetSource',
'ns3::Ipv6Address',
[],
is_const=True)
## ipv6-header.h (module 'internet'): ns3::Ipv6Address ns3::Ipv6Header::GetSourceAddress() const [member function]
cls.add_method('GetSourceAddress',
'ns3::Ipv6Address',
[],
deprecated=True, is_const=True)
## ipv6-header.h (module 'internet'): uint8_t ns3::Ipv6Header::GetTrafficClass() const [member function]
cls.add_method('GetTrafficClass',
'uint8_t',
[],
is_const=True)
## ipv6-header.h (module 'internet'): static ns3::TypeId ns3::Ipv6Header::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## ipv6-header.h (module 'internet'): void ns3::Ipv6Header::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True, is_virtual=True)
## ipv6-header.h (module 'internet'): void ns3::Ipv6Header::Serialize(ns3::Buffer::Iterator start) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::Buffer::Iterator', 'start')],
is_const=True, is_virtual=True)
## ipv6-header.h (module 'internet'): void ns3::Ipv6Header::SetDestination(ns3::Ipv6Address dst) [member function]
cls.add_method('SetDestination',
'void',
[param('ns3::Ipv6Address', 'dst')])
## ipv6-header.h (module 'internet'): void ns3::Ipv6Header::SetDestinationAddress(ns3::Ipv6Address dst) [member function]
cls.add_method('SetDestinationAddress',
'void',
[param('ns3::Ipv6Address', 'dst')],
deprecated=True)
## ipv6-header.h (module 'internet'): void ns3::Ipv6Header::SetDscp(ns3::Ipv6Header::DscpType dscp) [member function]
cls.add_method('SetDscp',
'void',
[param('ns3::Ipv6Header::DscpType', 'dscp')])
## ipv6-header.h (module 'internet'): void ns3::Ipv6Header::SetEcn(ns3::Ipv6Header::EcnType ecn) [member function]
cls.add_method('SetEcn',
'void',
[param('ns3::Ipv6Header::EcnType', 'ecn')])
## ipv6-header.h (module 'internet'): void ns3::Ipv6Header::SetFlowLabel(uint32_t flow) [member function]
cls.add_method('SetFlowLabel',
'void',
[param('uint32_t', 'flow')])
## ipv6-header.h (module 'internet'): void ns3::Ipv6Header::SetHopLimit(uint8_t limit) [member function]
cls.add_method('SetHopLimit',
'void',
[param('uint8_t', 'limit')])
## ipv6-header.h (module 'internet'): void ns3::Ipv6Header::SetNextHeader(uint8_t next) [member function]
cls.add_method('SetNextHeader',
'void',
[param('uint8_t', 'next')])
## ipv6-header.h (module 'internet'): void ns3::Ipv6Header::SetPayloadLength(uint16_t len) [member function]
cls.add_method('SetPayloadLength',
'void',
[param('uint16_t', 'len')])
## ipv6-header.h (module 'internet'): void ns3::Ipv6Header::SetSource(ns3::Ipv6Address src) [member function]
cls.add_method('SetSource',
'void',
[param('ns3::Ipv6Address', 'src')])
## ipv6-header.h (module 'internet'): void ns3::Ipv6Header::SetSourceAddress(ns3::Ipv6Address src) [member function]
cls.add_method('SetSourceAddress',
'void',
[param('ns3::Ipv6Address', 'src')],
deprecated=True)
## ipv6-header.h (module 'internet'): void ns3::Ipv6Header::SetTrafficClass(uint8_t traffic) [member function]
cls.add_method('SetTrafficClass',
'void',
[param('uint8_t', 'traffic')])
return
def register_Ns3Object_methods(root_module, cls):
## object.h (module 'core'): ns3::Object::Object() [constructor]
cls.add_constructor([])
## object.h (module 'core'): void ns3::Object::AggregateObject(ns3::Ptr<ns3::Object> other) [member function]
cls.add_method('AggregateObject',
'void',
[param('ns3::Ptr< ns3::Object >', 'other')])
## object.h (module 'core'): void ns3::Object::Dispose() [member function]
cls.add_method('Dispose',
'void',
[])
## object.h (module 'core'): ns3::Object::AggregateIterator ns3::Object::GetAggregateIterator() const [member function]
cls.add_method('GetAggregateIterator',
'ns3::Object::AggregateIterator',
[],
is_const=True)
## object.h (module 'core'): ns3::TypeId ns3::Object::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## object.h (module 'core'): ns3::Ptr<ns3::Object> ns3::Object::GetObject() const [member function]
cls.add_method('GetObject',
'ns3::Ptr< ns3::Object >',
[],
custom_template_method_name='GetObject', is_const=True, template_parameters=['ns3::Object'])
## object.h (module 'core'): ns3::Ptr<ns3::Object> ns3::Object::GetObject(ns3::TypeId tid) const [member function]
cls.add_method('GetObject',
'ns3::Ptr< ns3::Object >',
[param('ns3::TypeId', 'tid')],
custom_template_method_name='GetObject', is_const=True, template_parameters=['ns3::Object'])
## object.h (module 'core'): static ns3::TypeId ns3::Object::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## object.h (module 'core'): void ns3::Object::Initialize() [member function]
cls.add_method('Initialize',
'void',
[])
## object.h (module 'core'): bool ns3::Object::IsInitialized() const [member function]
cls.add_method('IsInitialized',
'bool',
[],
is_const=True)
## object.h (module 'core'): ns3::Object::Object(ns3::Object const & o) [constructor]
cls.add_constructor([param('ns3::Object const &', 'o')],
visibility='protected')
## object.h (module 'core'): void ns3::Object::DoDispose() [member function]
cls.add_method('DoDispose',
'void',
[],
is_virtual=True, visibility='protected')
## object.h (module 'core'): void ns3::Object::DoInitialize() [member function]
cls.add_method('DoInitialize',
'void',
[],
is_virtual=True, visibility='protected')
## object.h (module 'core'): void ns3::Object::NotifyNewAggregate() [member function]
cls.add_method('NotifyNewAggregate',
'void',
[],
is_virtual=True, visibility='protected')
return
def register_Ns3ObjectAggregateIterator_methods(root_module, cls):
## object.h (module 'core'): ns3::Object::AggregateIterator::AggregateIterator(ns3::Object::AggregateIterator const & arg0) [constructor]
cls.add_constructor([param('ns3::Object::AggregateIterator const &', 'arg0')])
## object.h (module 'core'): ns3::Object::AggregateIterator::AggregateIterator() [constructor]
cls.add_constructor([])
## object.h (module 'core'): bool ns3::Object::AggregateIterator::HasNext() const [member function]
cls.add_method('HasNext',
'bool',
[],
is_const=True)
## object.h (module 'core'): ns3::Ptr<const ns3::Object> ns3::Object::AggregateIterator::Next() [member function]
cls.add_method('Next',
'ns3::Ptr< ns3::Object const >',
[])
return
def register_Ns3RandomVariableStream_methods(root_module, cls):
## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::RandomVariableStream::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## random-variable-stream.h (module 'core'): ns3::RandomVariableStream::RandomVariableStream() [constructor]
cls.add_constructor([])
## random-variable-stream.h (module 'core'): void ns3::RandomVariableStream::SetStream(int64_t stream) [member function]
cls.add_method('SetStream',
'void',
[param('int64_t', 'stream')])
## random-variable-stream.h (module 'core'): int64_t ns3::RandomVariableStream::GetStream() const [member function]
cls.add_method('GetStream',
'int64_t',
[],
is_const=True)
## random-variable-stream.h (module 'core'): void ns3::RandomVariableStream::SetAntithetic(bool isAntithetic) [member function]
cls.add_method('SetAntithetic',
'void',
[param('bool', 'isAntithetic')])
## random-variable-stream.h (module 'core'): bool ns3::RandomVariableStream::IsAntithetic() const [member function]
cls.add_method('IsAntithetic',
'bool',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::RandomVariableStream::GetValue() [member function]
cls.add_method('GetValue',
'double',
[],
is_pure_virtual=True, is_virtual=True)
## random-variable-stream.h (module 'core'): uint32_t ns3::RandomVariableStream::GetInteger() [member function]
cls.add_method('GetInteger',
'uint32_t',
[],
is_pure_virtual=True, is_virtual=True)
## random-variable-stream.h (module 'core'): ns3::RngStream * ns3::RandomVariableStream::Peek() const [member function]
cls.add_method('Peek',
'ns3::RngStream *',
[],
is_const=True, visibility='protected')
return
def register_Ns3SequentialRandomVariable_methods(root_module, cls):
## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::SequentialRandomVariable::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## random-variable-stream.h (module 'core'): ns3::SequentialRandomVariable::SequentialRandomVariable() [constructor]
cls.add_constructor([])
## random-variable-stream.h (module 'core'): double ns3::SequentialRandomVariable::GetMin() const [member function]
cls.add_method('GetMin',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::SequentialRandomVariable::GetMax() const [member function]
cls.add_method('GetMax',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): ns3::Ptr<ns3::RandomVariableStream> ns3::SequentialRandomVariable::GetIncrement() const [member function]
cls.add_method('GetIncrement',
'ns3::Ptr< ns3::RandomVariableStream >',
[],
is_const=True)
## random-variable-stream.h (module 'core'): uint32_t ns3::SequentialRandomVariable::GetConsecutive() const [member function]
cls.add_method('GetConsecutive',
'uint32_t',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::SequentialRandomVariable::GetValue() [member function]
cls.add_method('GetValue',
'double',
[],
is_virtual=True)
## random-variable-stream.h (module 'core'): uint32_t ns3::SequentialRandomVariable::GetInteger() [member function]
cls.add_method('GetInteger',
'uint32_t',
[],
is_virtual=True)
return
def register_Ns3SimpleRefCount__Ns3AttributeAccessor_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeAccessor__gt___methods(root_module, cls):
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter<ns3::AttributeAccessor> >::SimpleRefCount() [constructor]
cls.add_constructor([])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter<ns3::AttributeAccessor> >::SimpleRefCount(ns3::SimpleRefCount<ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter<ns3::AttributeAccessor> > const & o) [constructor]
cls.add_constructor([param('ns3::SimpleRefCount< ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter< ns3::AttributeAccessor > > const &', 'o')])
return
def register_Ns3SimpleRefCount__Ns3AttributeChecker_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeChecker__gt___methods(root_module, cls):
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeChecker, ns3::empty, ns3::DefaultDeleter<ns3::AttributeChecker> >::SimpleRefCount() [constructor]
cls.add_constructor([])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeChecker, ns3::empty, ns3::DefaultDeleter<ns3::AttributeChecker> >::SimpleRefCount(ns3::SimpleRefCount<ns3::AttributeChecker, ns3::empty, ns3::DefaultDeleter<ns3::AttributeChecker> > const & o) [constructor]
cls.add_constructor([param('ns3::SimpleRefCount< ns3::AttributeChecker, ns3::empty, ns3::DefaultDeleter< ns3::AttributeChecker > > const &', 'o')])
return
def register_Ns3SimpleRefCount__Ns3AttributeValue_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeValue__gt___methods(root_module, cls):
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeValue, ns3::empty, ns3::DefaultDeleter<ns3::AttributeValue> >::SimpleRefCount() [constructor]
cls.add_constructor([])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeValue, ns3::empty, ns3::DefaultDeleter<ns3::AttributeValue> >::SimpleRefCount(ns3::SimpleRefCount<ns3::AttributeValue, ns3::empty, ns3::DefaultDeleter<ns3::AttributeValue> > const & o) [constructor]
cls.add_constructor([param('ns3::SimpleRefCount< ns3::AttributeValue, ns3::empty, ns3::DefaultDeleter< ns3::AttributeValue > > const &', 'o')])
return
def register_Ns3SimpleRefCount__Ns3CallbackImplBase_Ns3Empty_Ns3DefaultDeleter__lt__ns3CallbackImplBase__gt___methods(root_module, cls):
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::CallbackImplBase, ns3::empty, ns3::DefaultDeleter<ns3::CallbackImplBase> >::SimpleRefCount() [constructor]
cls.add_constructor([])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::CallbackImplBase, ns3::empty, ns3::DefaultDeleter<ns3::CallbackImplBase> >::SimpleRefCount(ns3::SimpleRefCount<ns3::CallbackImplBase, ns3::empty, ns3::DefaultDeleter<ns3::CallbackImplBase> > const & o) [constructor]
cls.add_constructor([param('ns3::SimpleRefCount< ns3::CallbackImplBase, ns3::empty, ns3::DefaultDeleter< ns3::CallbackImplBase > > const &', 'o')])
return
def register_Ns3SimpleRefCount__Ns3EventImpl_Ns3Empty_Ns3DefaultDeleter__lt__ns3EventImpl__gt___methods(root_module, cls):
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::EventImpl, ns3::empty, ns3::DefaultDeleter<ns3::EventImpl> >::SimpleRefCount() [constructor]
cls.add_constructor([])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::EventImpl, ns3::empty, ns3::DefaultDeleter<ns3::EventImpl> >::SimpleRefCount(ns3::SimpleRefCount<ns3::EventImpl, ns3::empty, ns3::DefaultDeleter<ns3::EventImpl> > const & o) [constructor]
cls.add_constructor([param('ns3::SimpleRefCount< ns3::EventImpl, ns3::empty, ns3::DefaultDeleter< ns3::EventImpl > > const &', 'o')])
return
def register_Ns3SimpleRefCount__Ns3HashImplementation_Ns3Empty_Ns3DefaultDeleter__lt__ns3HashImplementation__gt___methods(root_module, cls):
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Hash::Implementation, ns3::empty, ns3::DefaultDeleter<ns3::Hash::Implementation> >::SimpleRefCount() [constructor]
cls.add_constructor([])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Hash::Implementation, ns3::empty, ns3::DefaultDeleter<ns3::Hash::Implementation> >::SimpleRefCount(ns3::SimpleRefCount<ns3::Hash::Implementation, ns3::empty, ns3::DefaultDeleter<ns3::Hash::Implementation> > const & o) [constructor]
cls.add_constructor([param('ns3::SimpleRefCount< ns3::Hash::Implementation, ns3::empty, ns3::DefaultDeleter< ns3::Hash::Implementation > > const &', 'o')])
return
def register_Ns3SimpleRefCount__Ns3Ipv4MulticastRoute_Ns3Empty_Ns3DefaultDeleter__lt__ns3Ipv4MulticastRoute__gt___methods(root_module, cls):
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Ipv4MulticastRoute, ns3::empty, ns3::DefaultDeleter<ns3::Ipv4MulticastRoute> >::SimpleRefCount() [constructor]
cls.add_constructor([])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Ipv4MulticastRoute, ns3::empty, ns3::DefaultDeleter<ns3::Ipv4MulticastRoute> >::SimpleRefCount(ns3::SimpleRefCount<ns3::Ipv4MulticastRoute, ns3::empty, ns3::DefaultDeleter<ns3::Ipv4MulticastRoute> > const & o) [constructor]
cls.add_constructor([param('ns3::SimpleRefCount< ns3::Ipv4MulticastRoute, ns3::empty, ns3::DefaultDeleter< ns3::Ipv4MulticastRoute > > const &', 'o')])
return
def register_Ns3SimpleRefCount__Ns3Ipv4Route_Ns3Empty_Ns3DefaultDeleter__lt__ns3Ipv4Route__gt___methods(root_module, cls):
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Ipv4Route, ns3::empty, ns3::DefaultDeleter<ns3::Ipv4Route> >::SimpleRefCount() [constructor]
cls.add_constructor([])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Ipv4Route, ns3::empty, ns3::DefaultDeleter<ns3::Ipv4Route> >::SimpleRefCount(ns3::SimpleRefCount<ns3::Ipv4Route, ns3::empty, ns3::DefaultDeleter<ns3::Ipv4Route> > const & o) [constructor]
cls.add_constructor([param('ns3::SimpleRefCount< ns3::Ipv4Route, ns3::empty, ns3::DefaultDeleter< ns3::Ipv4Route > > const &', 'o')])
return
def register_Ns3SimpleRefCount__Ns3NixVector_Ns3Empty_Ns3DefaultDeleter__lt__ns3NixVector__gt___methods(root_module, cls):
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::NixVector, ns3::empty, ns3::DefaultDeleter<ns3::NixVector> >::SimpleRefCount() [constructor]
cls.add_constructor([])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::NixVector, ns3::empty, ns3::DefaultDeleter<ns3::NixVector> >::SimpleRefCount(ns3::SimpleRefCount<ns3::NixVector, ns3::empty, ns3::DefaultDeleter<ns3::NixVector> > const & o) [constructor]
cls.add_constructor([param('ns3::SimpleRefCount< ns3::NixVector, ns3::empty, ns3::DefaultDeleter< ns3::NixVector > > const &', 'o')])
return
def register_Ns3SimpleRefCount__Ns3OutputStreamWrapper_Ns3Empty_Ns3DefaultDeleter__lt__ns3OutputStreamWrapper__gt___methods(root_module, cls):
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::OutputStreamWrapper, ns3::empty, ns3::DefaultDeleter<ns3::OutputStreamWrapper> >::SimpleRefCount() [constructor]
cls.add_constructor([])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::OutputStreamWrapper, ns3::empty, ns3::DefaultDeleter<ns3::OutputStreamWrapper> >::SimpleRefCount(ns3::SimpleRefCount<ns3::OutputStreamWrapper, ns3::empty, ns3::DefaultDeleter<ns3::OutputStreamWrapper> > const & o) [constructor]
cls.add_constructor([param('ns3::SimpleRefCount< ns3::OutputStreamWrapper, ns3::empty, ns3::DefaultDeleter< ns3::OutputStreamWrapper > > const &', 'o')])
return
def register_Ns3SimpleRefCount__Ns3Packet_Ns3Empty_Ns3DefaultDeleter__lt__ns3Packet__gt___methods(root_module, cls):
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Packet, ns3::empty, ns3::DefaultDeleter<ns3::Packet> >::SimpleRefCount() [constructor]
cls.add_constructor([])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Packet, ns3::empty, ns3::DefaultDeleter<ns3::Packet> >::SimpleRefCount(ns3::SimpleRefCount<ns3::Packet, ns3::empty, ns3::DefaultDeleter<ns3::Packet> > const & o) [constructor]
cls.add_constructor([param('ns3::SimpleRefCount< ns3::Packet, ns3::empty, ns3::DefaultDeleter< ns3::Packet > > const &', 'o')])
return
def register_Ns3SimpleRefCount__Ns3TraceSourceAccessor_Ns3Empty_Ns3DefaultDeleter__lt__ns3TraceSourceAccessor__gt___methods(root_module, cls):
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter<ns3::TraceSourceAccessor> >::SimpleRefCount() [constructor]
cls.add_constructor([])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter<ns3::TraceSourceAccessor> >::SimpleRefCount(ns3::SimpleRefCount<ns3::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter<ns3::TraceSourceAccessor> > const & o) [constructor]
cls.add_constructor([param('ns3::SimpleRefCount< ns3::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter< ns3::TraceSourceAccessor > > const &', 'o')])
return
def register_Ns3SimpleRefCount__Ns3WifiInformationElement_Ns3Empty_Ns3DefaultDeleter__lt__ns3WifiInformationElement__gt___methods(root_module, cls):
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::WifiInformationElement, ns3::empty, ns3::DefaultDeleter<ns3::WifiInformationElement> >::SimpleRefCount() [constructor]
cls.add_constructor([])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::WifiInformationElement, ns3::empty, ns3::DefaultDeleter<ns3::WifiInformationElement> >::SimpleRefCount(ns3::SimpleRefCount<ns3::WifiInformationElement, ns3::empty, ns3::DefaultDeleter<ns3::WifiInformationElement> > const & o) [constructor]
cls.add_constructor([param('ns3::SimpleRefCount< ns3::WifiInformationElement, ns3::empty, ns3::DefaultDeleter< ns3::WifiInformationElement > > const &', 'o')])
return
def register_Ns3Socket_methods(root_module, cls):
## socket.h (module 'network'): ns3::Socket::Socket(ns3::Socket const & arg0) [constructor]
cls.add_constructor([param('ns3::Socket const &', 'arg0')])
## socket.h (module 'network'): ns3::Socket::Socket() [constructor]
cls.add_constructor([])
## socket.h (module 'network'): int ns3::Socket::Bind(ns3::Address const & address) [member function]
cls.add_method('Bind',
'int',
[param('ns3::Address const &', 'address')],
is_pure_virtual=True, is_virtual=True)
## socket.h (module 'network'): int ns3::Socket::Bind() [member function]
cls.add_method('Bind',
'int',
[],
is_pure_virtual=True, is_virtual=True)
## socket.h (module 'network'): int ns3::Socket::Bind6() [member function]
cls.add_method('Bind6',
'int',
[],
is_pure_virtual=True, is_virtual=True)
## socket.h (module 'network'): void ns3::Socket::BindToNetDevice(ns3::Ptr<ns3::NetDevice> netdevice) [member function]
cls.add_method('BindToNetDevice',
'void',
[param('ns3::Ptr< ns3::NetDevice >', 'netdevice')],
is_virtual=True)
## socket.h (module 'network'): int ns3::Socket::Close() [member function]
cls.add_method('Close',
'int',
[],
is_pure_virtual=True, is_virtual=True)
## socket.h (module 'network'): int ns3::Socket::Connect(ns3::Address const & address) [member function]
cls.add_method('Connect',
'int',
[param('ns3::Address const &', 'address')],
is_pure_virtual=True, is_virtual=True)
## socket.h (module 'network'): static ns3::Ptr<ns3::Socket> ns3::Socket::CreateSocket(ns3::Ptr<ns3::Node> node, ns3::TypeId tid) [member function]
cls.add_method('CreateSocket',
'ns3::Ptr< ns3::Socket >',
[param('ns3::Ptr< ns3::Node >', 'node'), param('ns3::TypeId', 'tid')],
is_static=True)
## socket.h (module 'network'): bool ns3::Socket::GetAllowBroadcast() const [member function]
cls.add_method('GetAllowBroadcast',
'bool',
[],
is_const=True, is_pure_virtual=True, is_virtual=True)
## socket.h (module 'network'): ns3::Ptr<ns3::NetDevice> ns3::Socket::GetBoundNetDevice() [member function]
cls.add_method('GetBoundNetDevice',
'ns3::Ptr< ns3::NetDevice >',
[])
## socket.h (module 'network'): ns3::Socket::SocketErrno ns3::Socket::GetErrno() const [member function]
cls.add_method('GetErrno',
'ns3::Socket::SocketErrno',
[],
is_const=True, is_pure_virtual=True, is_virtual=True)
## socket.h (module 'network'): uint8_t ns3::Socket::GetIpTos() const [member function]
cls.add_method('GetIpTos',
'uint8_t',
[],
is_const=True)
## socket.h (module 'network'): uint8_t ns3::Socket::GetIpTtl() const [member function]
cls.add_method('GetIpTtl',
'uint8_t',
[],
is_const=True, is_virtual=True)
## socket.h (module 'network'): uint8_t ns3::Socket::GetIpv6HopLimit() const [member function]
cls.add_method('GetIpv6HopLimit',
'uint8_t',
[],
is_const=True, is_virtual=True)
## socket.h (module 'network'): uint8_t ns3::Socket::GetIpv6Tclass() const [member function]
cls.add_method('GetIpv6Tclass',
'uint8_t',
[],
is_const=True)
## socket.h (module 'network'): ns3::Ptr<ns3::Node> ns3::Socket::GetNode() const [member function]
cls.add_method('GetNode',
'ns3::Ptr< ns3::Node >',
[],
is_const=True, is_pure_virtual=True, is_virtual=True)
## socket.h (module 'network'): int ns3::Socket::GetPeerName(ns3::Address & address) const [member function]
cls.add_method('GetPeerName',
'int',
[param('ns3::Address &', 'address')],
is_const=True, is_pure_virtual=True, is_virtual=True)
## socket.h (module 'network'): uint8_t ns3::Socket::GetPriority() const [member function]
cls.add_method('GetPriority',
'uint8_t',
[],
is_const=True)
## socket.h (module 'network'): uint32_t ns3::Socket::GetRxAvailable() const [member function]
cls.add_method('GetRxAvailable',
'uint32_t',
[],
is_const=True, is_pure_virtual=True, is_virtual=True)
## socket.h (module 'network'): int ns3::Socket::GetSockName(ns3::Address & address) const [member function]
cls.add_method('GetSockName',
'int',
[param('ns3::Address &', 'address')],
is_const=True, is_pure_virtual=True, is_virtual=True)
## socket.h (module 'network'): ns3::Socket::SocketType ns3::Socket::GetSocketType() const [member function]
cls.add_method('GetSocketType',
'ns3::Socket::SocketType',
[],
is_const=True, is_pure_virtual=True, is_virtual=True)
## socket.h (module 'network'): uint32_t ns3::Socket::GetTxAvailable() const [member function]
cls.add_method('GetTxAvailable',
'uint32_t',
[],
is_const=True, is_pure_virtual=True, is_virtual=True)
## socket.h (module 'network'): static ns3::TypeId ns3::Socket::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## socket.h (module 'network'): static uint8_t ns3::Socket::IpTos2Priority(uint8_t ipTos) [member function]
cls.add_method('IpTos2Priority',
'uint8_t',
[param('uint8_t', 'ipTos')],
is_static=True)
## socket.h (module 'network'): void ns3::Socket::Ipv6JoinGroup(ns3::Ipv6Address address, ns3::Socket::Ipv6MulticastFilterMode filterMode, std::vector<ns3::Ipv6Address, std::allocator<ns3::Ipv6Address> > sourceAddresses) [member function]
cls.add_method('Ipv6JoinGroup',
'void',
[param('ns3::Ipv6Address', 'address'), param('ns3::Socket::Ipv6MulticastFilterMode', 'filterMode'), param('std::vector< ns3::Ipv6Address >', 'sourceAddresses')],
is_virtual=True)
## socket.h (module 'network'): void ns3::Socket::Ipv6JoinGroup(ns3::Ipv6Address address) [member function]
cls.add_method('Ipv6JoinGroup',
'void',
[param('ns3::Ipv6Address', 'address')],
is_virtual=True)
## socket.h (module 'network'): void ns3::Socket::Ipv6LeaveGroup() [member function]
cls.add_method('Ipv6LeaveGroup',
'void',
[],
is_virtual=True)
## socket.h (module 'network'): bool ns3::Socket::IsIpRecvTos() const [member function]
cls.add_method('IsIpRecvTos',
'bool',
[],
is_const=True)
## socket.h (module 'network'): bool ns3::Socket::IsIpRecvTtl() const [member function]
cls.add_method('IsIpRecvTtl',
'bool',
[],
is_const=True)
## socket.h (module 'network'): bool ns3::Socket::IsIpv6RecvHopLimit() const [member function]
cls.add_method('IsIpv6RecvHopLimit',
'bool',
[],
is_const=True)
## socket.h (module 'network'): bool ns3::Socket::IsIpv6RecvTclass() const [member function]
cls.add_method('IsIpv6RecvTclass',
'bool',
[],
is_const=True)
## socket.h (module 'network'): bool ns3::Socket::IsRecvPktInfo() const [member function]
cls.add_method('IsRecvPktInfo',
'bool',
[],
is_const=True)
## socket.h (module 'network'): int ns3::Socket::Listen() [member function]
cls.add_method('Listen',
'int',
[],
is_pure_virtual=True, is_virtual=True)
## socket.h (module 'network'): ns3::Ptr<ns3::Packet> ns3::Socket::Recv(uint32_t maxSize, uint32_t flags) [member function]
cls.add_method('Recv',
'ns3::Ptr< ns3::Packet >',
[param('uint32_t', 'maxSize'), param('uint32_t', 'flags')],
is_pure_virtual=True, is_virtual=True)
## socket.h (module 'network'): ns3::Ptr<ns3::Packet> ns3::Socket::Recv() [member function]
cls.add_method('Recv',
'ns3::Ptr< ns3::Packet >',
[])
## socket.h (module 'network'): int ns3::Socket::Recv(uint8_t * buf, uint32_t size, uint32_t flags) [member function]
cls.add_method('Recv',
'int',
[param('uint8_t *', 'buf'), param('uint32_t', 'size'), param('uint32_t', 'flags')])
## socket.h (module 'network'): ns3::Ptr<ns3::Packet> ns3::Socket::RecvFrom(uint32_t maxSize, uint32_t flags, ns3::Address & fromAddress) [member function]
cls.add_method('RecvFrom',
'ns3::Ptr< ns3::Packet >',
[param('uint32_t', 'maxSize'), param('uint32_t', 'flags'), param('ns3::Address &', 'fromAddress')],
is_pure_virtual=True, is_virtual=True)
## socket.h (module 'network'): ns3::Ptr<ns3::Packet> ns3::Socket::RecvFrom(ns3::Address & fromAddress) [member function]
cls.add_method('RecvFrom',
'ns3::Ptr< ns3::Packet >',
[param('ns3::Address &', 'fromAddress')])
## socket.h (module 'network'): int ns3::Socket::RecvFrom(uint8_t * buf, uint32_t size, uint32_t flags, ns3::Address & fromAddress) [member function]
cls.add_method('RecvFrom',
'int',
[param('uint8_t *', 'buf'), param('uint32_t', 'size'), param('uint32_t', 'flags'), param('ns3::Address &', 'fromAddress')])
## socket.h (module 'network'): int ns3::Socket::Send(ns3::Ptr<ns3::Packet> p, uint32_t flags) [member function]
cls.add_method('Send',
'int',
[param('ns3::Ptr< ns3::Packet >', 'p'), param('uint32_t', 'flags')],
is_pure_virtual=True, is_virtual=True)
## socket.h (module 'network'): int ns3::Socket::Send(ns3::Ptr<ns3::Packet> p) [member function]
cls.add_method('Send',
'int',
[param('ns3::Ptr< ns3::Packet >', 'p')])
## socket.h (module 'network'): int ns3::Socket::Send(uint8_t const * buf, uint32_t size, uint32_t flags) [member function]
cls.add_method('Send',
'int',
[param('uint8_t const *', 'buf'), param('uint32_t', 'size'), param('uint32_t', 'flags')])
## socket.h (module 'network'): int ns3::Socket::SendTo(ns3::Ptr<ns3::Packet> p, uint32_t flags, ns3::Address const & toAddress) [member function]
cls.add_method('SendTo',
'int',
[param('ns3::Ptr< ns3::Packet >', 'p'), param('uint32_t', 'flags'), param('ns3::Address const &', 'toAddress')],
is_pure_virtual=True, is_virtual=True)
## socket.h (module 'network'): int ns3::Socket::SendTo(uint8_t const * buf, uint32_t size, uint32_t flags, ns3::Address const & address) [member function]
cls.add_method('SendTo',
'int',
[param('uint8_t const *', 'buf'), param('uint32_t', 'size'), param('uint32_t', 'flags'), param('ns3::Address const &', 'address')])
## socket.h (module 'network'): void ns3::Socket::SetAcceptCallback(ns3::Callback<bool, ns3::Ptr<ns3::Socket>, const ns3::Address &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> connectionRequest, ns3::Callback<void, ns3::Ptr<ns3::Socket>, const ns3::Address &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> newConnectionCreated) [member function]
cls.add_method('SetAcceptCallback',
'void',
[param('ns3::Callback< bool, ns3::Ptr< ns3::Socket >, ns3::Address const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'connectionRequest'), param('ns3::Callback< void, ns3::Ptr< ns3::Socket >, ns3::Address const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'newConnectionCreated')])
## socket.h (module 'network'): bool ns3::Socket::SetAllowBroadcast(bool allowBroadcast) [member function]
cls.add_method('SetAllowBroadcast',
'bool',
[param('bool', 'allowBroadcast')],
is_pure_virtual=True, is_virtual=True)
## socket.h (module 'network'): void ns3::Socket::SetCloseCallbacks(ns3::Callback<void, ns3::Ptr<ns3::Socket>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> normalClose, ns3::Callback<void, ns3::Ptr<ns3::Socket>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> errorClose) [member function]
cls.add_method('SetCloseCallbacks',
'void',
[param('ns3::Callback< void, ns3::Ptr< ns3::Socket >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'normalClose'), param('ns3::Callback< void, ns3::Ptr< ns3::Socket >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'errorClose')])
## socket.h (module 'network'): void ns3::Socket::SetConnectCallback(ns3::Callback<void, ns3::Ptr<ns3::Socket>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> connectionSucceeded, ns3::Callback<void, ns3::Ptr<ns3::Socket>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> connectionFailed) [member function]
cls.add_method('SetConnectCallback',
'void',
[param('ns3::Callback< void, ns3::Ptr< ns3::Socket >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'connectionSucceeded'), param('ns3::Callback< void, ns3::Ptr< ns3::Socket >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'connectionFailed')])
## socket.h (module 'network'): void ns3::Socket::SetDataSentCallback(ns3::Callback<void, ns3::Ptr<ns3::Socket>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> dataSent) [member function]
cls.add_method('SetDataSentCallback',
'void',
[param('ns3::Callback< void, ns3::Ptr< ns3::Socket >, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'dataSent')])
## socket.h (module 'network'): void ns3::Socket::SetIpRecvTos(bool ipv4RecvTos) [member function]
cls.add_method('SetIpRecvTos',
'void',
[param('bool', 'ipv4RecvTos')])
## socket.h (module 'network'): void ns3::Socket::SetIpRecvTtl(bool ipv4RecvTtl) [member function]
cls.add_method('SetIpRecvTtl',
'void',
[param('bool', 'ipv4RecvTtl')])
## socket.h (module 'network'): void ns3::Socket::SetIpTos(uint8_t ipTos) [member function]
cls.add_method('SetIpTos',
'void',
[param('uint8_t', 'ipTos')])
## socket.h (module 'network'): void ns3::Socket::SetIpTtl(uint8_t ipTtl) [member function]
cls.add_method('SetIpTtl',
'void',
[param('uint8_t', 'ipTtl')],
is_virtual=True)
## socket.h (module 'network'): void ns3::Socket::SetIpv6HopLimit(uint8_t ipHopLimit) [member function]
cls.add_method('SetIpv6HopLimit',
'void',
[param('uint8_t', 'ipHopLimit')],
is_virtual=True)
## socket.h (module 'network'): void ns3::Socket::SetIpv6RecvHopLimit(bool ipv6RecvHopLimit) [member function]
cls.add_method('SetIpv6RecvHopLimit',
'void',
[param('bool', 'ipv6RecvHopLimit')])
## socket.h (module 'network'): void ns3::Socket::SetIpv6RecvTclass(bool ipv6RecvTclass) [member function]
cls.add_method('SetIpv6RecvTclass',
'void',
[param('bool', 'ipv6RecvTclass')])
## socket.h (module 'network'): void ns3::Socket::SetIpv6Tclass(int ipTclass) [member function]
cls.add_method('SetIpv6Tclass',
'void',
[param('int', 'ipTclass')])
## socket.h (module 'network'): void ns3::Socket::SetPriority(uint8_t priority) [member function]
cls.add_method('SetPriority',
'void',
[param('uint8_t', 'priority')])
## socket.h (module 'network'): void ns3::Socket::SetRecvCallback(ns3::Callback<void, ns3::Ptr<ns3::Socket>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> receivedData) [member function]
cls.add_method('SetRecvCallback',
'void',
[param('ns3::Callback< void, ns3::Ptr< ns3::Socket >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'receivedData')])
## socket.h (module 'network'): void ns3::Socket::SetRecvPktInfo(bool flag) [member function]
cls.add_method('SetRecvPktInfo',
'void',
[param('bool', 'flag')])
## socket.h (module 'network'): void ns3::Socket::SetSendCallback(ns3::Callback<void, ns3::Ptr<ns3::Socket>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> sendCb) [member function]
cls.add_method('SetSendCallback',
'void',
[param('ns3::Callback< void, ns3::Ptr< ns3::Socket >, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'sendCb')])
## socket.h (module 'network'): int ns3::Socket::ShutdownRecv() [member function]
cls.add_method('ShutdownRecv',
'int',
[],
is_pure_virtual=True, is_virtual=True)
## socket.h (module 'network'): int ns3::Socket::ShutdownSend() [member function]
cls.add_method('ShutdownSend',
'int',
[],
is_pure_virtual=True, is_virtual=True)
## socket.h (module 'network'): void ns3::Socket::DoDispose() [member function]
cls.add_method('DoDispose',
'void',
[],
is_virtual=True, visibility='protected')
## socket.h (module 'network'): bool ns3::Socket::IsManualIpTtl() const [member function]
cls.add_method('IsManualIpTtl',
'bool',
[],
is_const=True, visibility='protected')
## socket.h (module 'network'): bool ns3::Socket::IsManualIpv6HopLimit() const [member function]
cls.add_method('IsManualIpv6HopLimit',
'bool',
[],
is_const=True, visibility='protected')
## socket.h (module 'network'): bool ns3::Socket::IsManualIpv6Tclass() const [member function]
cls.add_method('IsManualIpv6Tclass',
'bool',
[],
is_const=True, visibility='protected')
## socket.h (module 'network'): void ns3::Socket::NotifyConnectionFailed() [member function]
cls.add_method('NotifyConnectionFailed',
'void',
[],
visibility='protected')
## socket.h (module 'network'): bool ns3::Socket::NotifyConnectionRequest(ns3::Address const & from) [member function]
cls.add_method('NotifyConnectionRequest',
'bool',
[param('ns3::Address const &', 'from')],
visibility='protected')
## socket.h (module 'network'): void ns3::Socket::NotifyConnectionSucceeded() [member function]
cls.add_method('NotifyConnectionSucceeded',
'void',
[],
visibility='protected')
## socket.h (module 'network'): void ns3::Socket::NotifyDataRecv() [member function]
cls.add_method('NotifyDataRecv',
'void',
[],
visibility='protected')
## socket.h (module 'network'): void ns3::Socket::NotifyDataSent(uint32_t size) [member function]
cls.add_method('NotifyDataSent',
'void',
[param('uint32_t', 'size')],
visibility='protected')
## socket.h (module 'network'): void ns3::Socket::NotifyErrorClose() [member function]
cls.add_method('NotifyErrorClose',
'void',
[],
visibility='protected')
## socket.h (module 'network'): void ns3::Socket::NotifyNewConnectionCreated(ns3::Ptr<ns3::Socket> socket, ns3::Address const & from) [member function]
cls.add_method('NotifyNewConnectionCreated',
'void',
[param('ns3::Ptr< ns3::Socket >', 'socket'), param('ns3::Address const &', 'from')],
visibility='protected')
## socket.h (module 'network'): void ns3::Socket::NotifyNormalClose() [member function]
cls.add_method('NotifyNormalClose',
'void',
[],
visibility='protected')
## socket.h (module 'network'): void ns3::Socket::NotifySend(uint32_t spaceAvailable) [member function]
cls.add_method('NotifySend',
'void',
[param('uint32_t', 'spaceAvailable')],
visibility='protected')
return
def register_Ns3SocketIpTosTag_methods(root_module, cls):
## socket.h (module 'network'): ns3::SocketIpTosTag::SocketIpTosTag(ns3::SocketIpTosTag const & arg0) [constructor]
cls.add_constructor([param('ns3::SocketIpTosTag const &', 'arg0')])
## socket.h (module 'network'): ns3::SocketIpTosTag::SocketIpTosTag() [constructor]
cls.add_constructor([])
## socket.h (module 'network'): void ns3::SocketIpTosTag::Deserialize(ns3::TagBuffer i) [member function]
cls.add_method('Deserialize',
'void',
[param('ns3::TagBuffer', 'i')],
is_virtual=True)
## socket.h (module 'network'): ns3::TypeId ns3::SocketIpTosTag::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## socket.h (module 'network'): uint32_t ns3::SocketIpTosTag::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True, is_virtual=True)
## socket.h (module 'network'): uint8_t ns3::SocketIpTosTag::GetTos() const [member function]
cls.add_method('GetTos',
'uint8_t',
[],
is_const=True)
## socket.h (module 'network'): static ns3::TypeId ns3::SocketIpTosTag::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## socket.h (module 'network'): void ns3::SocketIpTosTag::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True, is_virtual=True)
## socket.h (module 'network'): void ns3::SocketIpTosTag::Serialize(ns3::TagBuffer i) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::TagBuffer', 'i')],
is_const=True, is_virtual=True)
## socket.h (module 'network'): void ns3::SocketIpTosTag::SetTos(uint8_t tos) [member function]
cls.add_method('SetTos',
'void',
[param('uint8_t', 'tos')])
return
def register_Ns3SocketIpTtlTag_methods(root_module, cls):
## socket.h (module 'network'): ns3::SocketIpTtlTag::SocketIpTtlTag(ns3::SocketIpTtlTag const & arg0) [constructor]
cls.add_constructor([param('ns3::SocketIpTtlTag const &', 'arg0')])
## socket.h (module 'network'): ns3::SocketIpTtlTag::SocketIpTtlTag() [constructor]
cls.add_constructor([])
## socket.h (module 'network'): void ns3::SocketIpTtlTag::Deserialize(ns3::TagBuffer i) [member function]
cls.add_method('Deserialize',
'void',
[param('ns3::TagBuffer', 'i')],
is_virtual=True)
## socket.h (module 'network'): ns3::TypeId ns3::SocketIpTtlTag::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## socket.h (module 'network'): uint32_t ns3::SocketIpTtlTag::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True, is_virtual=True)
## socket.h (module 'network'): uint8_t ns3::SocketIpTtlTag::GetTtl() const [member function]
cls.add_method('GetTtl',
'uint8_t',
[],
is_const=True)
## socket.h (module 'network'): static ns3::TypeId ns3::SocketIpTtlTag::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## socket.h (module 'network'): void ns3::SocketIpTtlTag::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True, is_virtual=True)
## socket.h (module 'network'): void ns3::SocketIpTtlTag::Serialize(ns3::TagBuffer i) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::TagBuffer', 'i')],
is_const=True, is_virtual=True)
## socket.h (module 'network'): void ns3::SocketIpTtlTag::SetTtl(uint8_t ttl) [member function]
cls.add_method('SetTtl',
'void',
[param('uint8_t', 'ttl')])
return
def register_Ns3SocketIpv6HopLimitTag_methods(root_module, cls):
## socket.h (module 'network'): ns3::SocketIpv6HopLimitTag::SocketIpv6HopLimitTag(ns3::SocketIpv6HopLimitTag const & arg0) [constructor]
cls.add_constructor([param('ns3::SocketIpv6HopLimitTag const &', 'arg0')])
## socket.h (module 'network'): ns3::SocketIpv6HopLimitTag::SocketIpv6HopLimitTag() [constructor]
cls.add_constructor([])
## socket.h (module 'network'): void ns3::SocketIpv6HopLimitTag::Deserialize(ns3::TagBuffer i) [member function]
cls.add_method('Deserialize',
'void',
[param('ns3::TagBuffer', 'i')],
is_virtual=True)
## socket.h (module 'network'): uint8_t ns3::SocketIpv6HopLimitTag::GetHopLimit() const [member function]
cls.add_method('GetHopLimit',
'uint8_t',
[],
is_const=True)
## socket.h (module 'network'): ns3::TypeId ns3::SocketIpv6HopLimitTag::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## socket.h (module 'network'): uint32_t ns3::SocketIpv6HopLimitTag::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True, is_virtual=True)
## socket.h (module 'network'): static ns3::TypeId ns3::SocketIpv6HopLimitTag::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## socket.h (module 'network'): void ns3::SocketIpv6HopLimitTag::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True, is_virtual=True)
## socket.h (module 'network'): void ns3::SocketIpv6HopLimitTag::Serialize(ns3::TagBuffer i) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::TagBuffer', 'i')],
is_const=True, is_virtual=True)
## socket.h (module 'network'): void ns3::SocketIpv6HopLimitTag::SetHopLimit(uint8_t hopLimit) [member function]
cls.add_method('SetHopLimit',
'void',
[param('uint8_t', 'hopLimit')])
return
def register_Ns3SocketIpv6TclassTag_methods(root_module, cls):
## socket.h (module 'network'): ns3::SocketIpv6TclassTag::SocketIpv6TclassTag(ns3::SocketIpv6TclassTag const & arg0) [constructor]
cls.add_constructor([param('ns3::SocketIpv6TclassTag const &', 'arg0')])
## socket.h (module 'network'): ns3::SocketIpv6TclassTag::SocketIpv6TclassTag() [constructor]
cls.add_constructor([])
## socket.h (module 'network'): void ns3::SocketIpv6TclassTag::Deserialize(ns3::TagBuffer i) [member function]
cls.add_method('Deserialize',
'void',
[param('ns3::TagBuffer', 'i')],
is_virtual=True)
## socket.h (module 'network'): ns3::TypeId ns3::SocketIpv6TclassTag::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## socket.h (module 'network'): uint32_t ns3::SocketIpv6TclassTag::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True, is_virtual=True)
## socket.h (module 'network'): uint8_t ns3::SocketIpv6TclassTag::GetTclass() const [member function]
cls.add_method('GetTclass',
'uint8_t',
[],
is_const=True)
## socket.h (module 'network'): static ns3::TypeId ns3::SocketIpv6TclassTag::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## socket.h (module 'network'): void ns3::SocketIpv6TclassTag::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True, is_virtual=True)
## socket.h (module 'network'): void ns3::SocketIpv6TclassTag::Serialize(ns3::TagBuffer i) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::TagBuffer', 'i')],
is_const=True, is_virtual=True)
## socket.h (module 'network'): void ns3::SocketIpv6TclassTag::SetTclass(uint8_t tclass) [member function]
cls.add_method('SetTclass',
'void',
[param('uint8_t', 'tclass')])
return
def register_Ns3SocketPriorityTag_methods(root_module, cls):
## socket.h (module 'network'): ns3::SocketPriorityTag::SocketPriorityTag(ns3::SocketPriorityTag const & arg0) [constructor]
cls.add_constructor([param('ns3::SocketPriorityTag const &', 'arg0')])
## socket.h (module 'network'): ns3::SocketPriorityTag::SocketPriorityTag() [constructor]
cls.add_constructor([])
## socket.h (module 'network'): void ns3::SocketPriorityTag::Deserialize(ns3::TagBuffer i) [member function]
cls.add_method('Deserialize',
'void',
[param('ns3::TagBuffer', 'i')],
is_virtual=True)
## socket.h (module 'network'): ns3::TypeId ns3::SocketPriorityTag::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## socket.h (module 'network'): uint8_t ns3::SocketPriorityTag::GetPriority() const [member function]
cls.add_method('GetPriority',
'uint8_t',
[],
is_const=True)
## socket.h (module 'network'): uint32_t ns3::SocketPriorityTag::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True, is_virtual=True)
## socket.h (module 'network'): static ns3::TypeId ns3::SocketPriorityTag::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## socket.h (module 'network'): void ns3::SocketPriorityTag::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True, is_virtual=True)
## socket.h (module 'network'): void ns3::SocketPriorityTag::Serialize(ns3::TagBuffer i) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::TagBuffer', 'i')],
is_const=True, is_virtual=True)
## socket.h (module 'network'): void ns3::SocketPriorityTag::SetPriority(uint8_t priority) [member function]
cls.add_method('SetPriority',
'void',
[param('uint8_t', 'priority')])
return
def register_Ns3SocketSetDontFragmentTag_methods(root_module, cls):
## socket.h (module 'network'): ns3::SocketSetDontFragmentTag::SocketSetDontFragmentTag(ns3::SocketSetDontFragmentTag const & arg0) [constructor]
cls.add_constructor([param('ns3::SocketSetDontFragmentTag const &', 'arg0')])
## socket.h (module 'network'): ns3::SocketSetDontFragmentTag::SocketSetDontFragmentTag() [constructor]
cls.add_constructor([])
## socket.h (module 'network'): void ns3::SocketSetDontFragmentTag::Deserialize(ns3::TagBuffer i) [member function]
cls.add_method('Deserialize',
'void',
[param('ns3::TagBuffer', 'i')],
is_virtual=True)
## socket.h (module 'network'): void ns3::SocketSetDontFragmentTag::Disable() [member function]
cls.add_method('Disable',
'void',
[])
## socket.h (module 'network'): void ns3::SocketSetDontFragmentTag::Enable() [member function]
cls.add_method('Enable',
'void',
[])
## socket.h (module 'network'): ns3::TypeId ns3::SocketSetDontFragmentTag::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## socket.h (module 'network'): uint32_t ns3::SocketSetDontFragmentTag::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True, is_virtual=True)
## socket.h (module 'network'): static ns3::TypeId ns3::SocketSetDontFragmentTag::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## socket.h (module 'network'): bool ns3::SocketSetDontFragmentTag::IsEnabled() const [member function]
cls.add_method('IsEnabled',
'bool',
[],
is_const=True)
## socket.h (module 'network'): void ns3::SocketSetDontFragmentTag::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True, is_virtual=True)
## socket.h (module 'network'): void ns3::SocketSetDontFragmentTag::Serialize(ns3::TagBuffer i) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::TagBuffer', 'i')],
is_const=True, is_virtual=True)
return
def register_Ns3TraceSourceAccessor_methods(root_module, cls):
## trace-source-accessor.h (module 'core'): ns3::TraceSourceAccessor::TraceSourceAccessor(ns3::TraceSourceAccessor const & arg0) [constructor]
cls.add_constructor([param('ns3::TraceSourceAccessor const &', 'arg0')])
## trace-source-accessor.h (module 'core'): ns3::TraceSourceAccessor::TraceSourceAccessor() [constructor]
cls.add_constructor([])
## trace-source-accessor.h (module 'core'): bool ns3::TraceSourceAccessor::Connect(ns3::ObjectBase * obj, std::string context, ns3::CallbackBase const & cb) const [member function]
cls.add_method('Connect',
'bool',
[param('ns3::ObjectBase *', 'obj', transfer_ownership=False), param('std::string', 'context'), param('ns3::CallbackBase const &', 'cb')],
is_const=True, is_pure_virtual=True, is_virtual=True)
## trace-source-accessor.h (module 'core'): bool ns3::TraceSourceAccessor::ConnectWithoutContext(ns3::ObjectBase * obj, ns3::CallbackBase const & cb) const [member function]
cls.add_method('ConnectWithoutContext',
'bool',
[param('ns3::ObjectBase *', 'obj', transfer_ownership=False), param('ns3::CallbackBase const &', 'cb')],
is_const=True, is_pure_virtual=True, is_virtual=True)
## trace-source-accessor.h (module 'core'): bool ns3::TraceSourceAccessor::Disconnect(ns3::ObjectBase * obj, std::string context, ns3::CallbackBase const & cb) const [member function]
cls.add_method('Disconnect',
'bool',
[param('ns3::ObjectBase *', 'obj', transfer_ownership=False), param('std::string', 'context'), param('ns3::CallbackBase const &', 'cb')],
is_const=True, is_pure_virtual=True, is_virtual=True)
## trace-source-accessor.h (module 'core'): bool ns3::TraceSourceAccessor::DisconnectWithoutContext(ns3::ObjectBase * obj, ns3::CallbackBase const & cb) const [member function]
cls.add_method('DisconnectWithoutContext',
'bool',
[param('ns3::ObjectBase *', 'obj', transfer_ownership=False), param('ns3::CallbackBase const &', 'cb')],
is_const=True, is_pure_virtual=True, is_virtual=True)
return
def register_Ns3Trailer_methods(root_module, cls):
cls.add_output_stream_operator()
## trailer.h (module 'network'): ns3::Trailer::Trailer() [constructor]
cls.add_constructor([])
## trailer.h (module 'network'): ns3::Trailer::Trailer(ns3::Trailer const & arg0) [constructor]
cls.add_constructor([param('ns3::Trailer const &', 'arg0')])
## trailer.h (module 'network'): uint32_t ns3::Trailer::Deserialize(ns3::Buffer::Iterator end) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('ns3::Buffer::Iterator', 'end')],
is_pure_virtual=True, is_virtual=True)
## trailer.h (module 'network'): uint32_t ns3::Trailer::Deserialize(ns3::Buffer::Iterator start, ns3::Buffer::Iterator end) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('ns3::Buffer::Iterator', 'start'), param('ns3::Buffer::Iterator', 'end')],
is_virtual=True)
## trailer.h (module 'network'): uint32_t ns3::Trailer::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True, is_pure_virtual=True, is_virtual=True)
## trailer.h (module 'network'): static ns3::TypeId ns3::Trailer::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## trailer.h (module 'network'): void ns3::Trailer::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True, is_pure_virtual=True, is_virtual=True)
## trailer.h (module 'network'): void ns3::Trailer::Serialize(ns3::Buffer::Iterator start) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::Buffer::Iterator', 'start')],
is_const=True, is_pure_virtual=True, is_virtual=True)
return
def register_Ns3TriangularRandomVariable_methods(root_module, cls):
## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::TriangularRandomVariable::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## random-variable-stream.h (module 'core'): ns3::TriangularRandomVariable::TriangularRandomVariable() [constructor]
cls.add_constructor([])
## random-variable-stream.h (module 'core'): double ns3::TriangularRandomVariable::GetMean() const [member function]
cls.add_method('GetMean',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::TriangularRandomVariable::GetMin() const [member function]
cls.add_method('GetMin',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::TriangularRandomVariable::GetMax() const [member function]
cls.add_method('GetMax',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::TriangularRandomVariable::GetValue(double mean, double min, double max) [member function]
cls.add_method('GetValue',
'double',
[param('double', 'mean'), param('double', 'min'), param('double', 'max')])
## random-variable-stream.h (module 'core'): uint32_t ns3::TriangularRandomVariable::GetInteger(uint32_t mean, uint32_t min, uint32_t max) [member function]
cls.add_method('GetInteger',
'uint32_t',
[param('uint32_t', 'mean'), param('uint32_t', 'min'), param('uint32_t', 'max')])
## random-variable-stream.h (module 'core'): double ns3::TriangularRandomVariable::GetValue() [member function]
cls.add_method('GetValue',
'double',
[],
is_virtual=True)
## random-variable-stream.h (module 'core'): uint32_t ns3::TriangularRandomVariable::GetInteger() [member function]
cls.add_method('GetInteger',
'uint32_t',
[],
is_virtual=True)
return
def register_Ns3UniformRandomVariable_methods(root_module, cls):
## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::UniformRandomVariable::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## random-variable-stream.h (module 'core'): ns3::UniformRandomVariable::UniformRandomVariable() [constructor]
cls.add_constructor([])
## random-variable-stream.h (module 'core'): double ns3::UniformRandomVariable::GetMin() const [member function]
cls.add_method('GetMin',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::UniformRandomVariable::GetMax() const [member function]
cls.add_method('GetMax',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::UniformRandomVariable::GetValue(double min, double max) [member function]
cls.add_method('GetValue',
'double',
[param('double', 'min'), param('double', 'max')])
## random-variable-stream.h (module 'core'): uint32_t ns3::UniformRandomVariable::GetInteger(uint32_t min, uint32_t max) [member function]
cls.add_method('GetInteger',
'uint32_t',
[param('uint32_t', 'min'), param('uint32_t', 'max')])
## random-variable-stream.h (module 'core'): double ns3::UniformRandomVariable::GetValue() [member function]
cls.add_method('GetValue',
'double',
[],
is_virtual=True)
## random-variable-stream.h (module 'core'): uint32_t ns3::UniformRandomVariable::GetInteger() [member function]
cls.add_method('GetInteger',
'uint32_t',
[],
is_virtual=True)
return
def register_Ns3WeibullRandomVariable_methods(root_module, cls):
## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::WeibullRandomVariable::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## random-variable-stream.h (module 'core'): ns3::WeibullRandomVariable::WeibullRandomVariable() [constructor]
cls.add_constructor([])
## random-variable-stream.h (module 'core'): double ns3::WeibullRandomVariable::GetScale() const [member function]
cls.add_method('GetScale',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::WeibullRandomVariable::GetShape() const [member function]
cls.add_method('GetShape',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::WeibullRandomVariable::GetBound() const [member function]
cls.add_method('GetBound',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::WeibullRandomVariable::GetValue(double scale, double shape, double bound) [member function]
cls.add_method('GetValue',
'double',
[param('double', 'scale'), param('double', 'shape'), param('double', 'bound')])
## random-variable-stream.h (module 'core'): uint32_t ns3::WeibullRandomVariable::GetInteger(uint32_t scale, uint32_t shape, uint32_t bound) [member function]
cls.add_method('GetInteger',
'uint32_t',
[param('uint32_t', 'scale'), param('uint32_t', 'shape'), param('uint32_t', 'bound')])
## random-variable-stream.h (module 'core'): double ns3::WeibullRandomVariable::GetValue() [member function]
cls.add_method('GetValue',
'double',
[],
is_virtual=True)
## random-variable-stream.h (module 'core'): uint32_t ns3::WeibullRandomVariable::GetInteger() [member function]
cls.add_method('GetInteger',
'uint32_t',
[],
is_virtual=True)
return
def register_Ns3WifiInformationElement_methods(root_module, cls):
cls.add_binary_comparison_operator('==')
## wifi-information-element.h (module 'wifi'): ns3::WifiInformationElement::WifiInformationElement() [constructor]
cls.add_constructor([])
## wifi-information-element.h (module 'wifi'): ns3::WifiInformationElement::WifiInformationElement(ns3::WifiInformationElement const & arg0) [constructor]
cls.add_constructor([param('ns3::WifiInformationElement const &', 'arg0')])
## wifi-information-element.h (module 'wifi'): ns3::Buffer::Iterator ns3::WifiInformationElement::Deserialize(ns3::Buffer::Iterator i) [member function]
cls.add_method('Deserialize',
'ns3::Buffer::Iterator',
[param('ns3::Buffer::Iterator', 'i')])
## wifi-information-element.h (module 'wifi'): ns3::Buffer::Iterator ns3::WifiInformationElement::DeserializeIfPresent(ns3::Buffer::Iterator i) [member function]
cls.add_method('DeserializeIfPresent',
'ns3::Buffer::Iterator',
[param('ns3::Buffer::Iterator', 'i')])
## wifi-information-element.h (module 'wifi'): uint8_t ns3::WifiInformationElement::DeserializeInformationField(ns3::Buffer::Iterator start, uint8_t length) [member function]
cls.add_method('DeserializeInformationField',
'uint8_t',
[param('ns3::Buffer::Iterator', 'start'), param('uint8_t', 'length')],
is_pure_virtual=True, is_virtual=True)
## wifi-information-element.h (module 'wifi'): ns3::WifiInformationElementId ns3::WifiInformationElement::ElementId() const [member function]
cls.add_method('ElementId',
'ns3::WifiInformationElementId',
[],
is_const=True, is_pure_virtual=True, is_virtual=True)
## wifi-information-element.h (module 'wifi'): ns3::WifiInformationElementId ns3::WifiInformationElement::ElementIdExt() const [member function]
cls.add_method('ElementIdExt',
'ns3::WifiInformationElementId',
[],
is_const=True, is_virtual=True)
## wifi-information-element.h (module 'wifi'): uint8_t ns3::WifiInformationElement::GetInformationFieldSize() const [member function]
cls.add_method('GetInformationFieldSize',
'uint8_t',
[],
is_const=True, is_pure_virtual=True, is_virtual=True)
## wifi-information-element.h (module 'wifi'): uint16_t ns3::WifiInformationElement::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint16_t',
[],
is_const=True, is_virtual=True)
## wifi-information-element.h (module 'wifi'): void ns3::WifiInformationElement::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True, is_virtual=True)
## wifi-information-element.h (module 'wifi'): ns3::Buffer::Iterator ns3::WifiInformationElement::Serialize(ns3::Buffer::Iterator i) const [member function]
cls.add_method('Serialize',
'ns3::Buffer::Iterator',
[param('ns3::Buffer::Iterator', 'i')],
is_const=True, is_virtual=True)
## wifi-information-element.h (module 'wifi'): void ns3::WifiInformationElement::SerializeInformationField(ns3::Buffer::Iterator start) const [member function]
cls.add_method('SerializeInformationField',
'void',
[param('ns3::Buffer::Iterator', 'start')],
is_const=True, is_pure_virtual=True, is_virtual=True)
return
def register_Ns3WifiMac_methods(root_module, cls):
## wifi-mac.h (module 'wifi'): ns3::WifiMac::WifiMac() [constructor]
cls.add_constructor([])
## wifi-mac.h (module 'wifi'): ns3::WifiMac::WifiMac(ns3::WifiMac const & arg0) [constructor]
cls.add_constructor([param('ns3::WifiMac const &', 'arg0')])
## wifi-mac.h (module 'wifi'): void ns3::WifiMac::ConfigureStandard(ns3::WifiStandard standard) [member function]
cls.add_method('ConfigureStandard',
'void',
[param('ns3::WifiStandard', 'standard')],
is_pure_virtual=True, is_virtual=True)
## wifi-mac.h (module 'wifi'): void ns3::WifiMac::DoDispose() [member function]
cls.add_method('DoDispose',
'void',
[],
is_virtual=True)
## wifi-mac.h (module 'wifi'): void ns3::WifiMac::Enqueue(ns3::Ptr<ns3::Packet> packet, ns3::Mac48Address to, ns3::Mac48Address from) [member function]
cls.add_method('Enqueue',
'void',
[param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Mac48Address', 'to'), param('ns3::Mac48Address', 'from')],
is_pure_virtual=True, is_virtual=True)
## wifi-mac.h (module 'wifi'): void ns3::WifiMac::Enqueue(ns3::Ptr<ns3::Packet> packet, ns3::Mac48Address to) [member function]
cls.add_method('Enqueue',
'void',
[param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Mac48Address', 'to')],
is_pure_virtual=True, is_virtual=True)
## wifi-mac.h (module 'wifi'): ns3::Mac48Address ns3::WifiMac::GetAddress() const [member function]
cls.add_method('GetAddress',
'ns3::Mac48Address',
[],
is_const=True, is_pure_virtual=True, is_virtual=True)
## wifi-mac.h (module 'wifi'): ns3::Mac48Address ns3::WifiMac::GetBssid() const [member function]
cls.add_method('GetBssid',
'ns3::Mac48Address',
[],
is_const=True, is_pure_virtual=True, is_virtual=True)
## wifi-mac.h (module 'wifi'): ns3::Ptr<ns3::NetDevice> ns3::WifiMac::GetDevice() const [member function]
cls.add_method('GetDevice',
'ns3::Ptr< ns3::NetDevice >',
[],
is_const=True)
## wifi-mac.h (module 'wifi'): ns3::Ptr<ns3::HeConfiguration> ns3::WifiMac::GetHeConfiguration() const [member function]
cls.add_method('GetHeConfiguration',
'ns3::Ptr< ns3::HeConfiguration >',
[],
is_const=True)
## wifi-mac.h (module 'wifi'): ns3::Ptr<ns3::HtConfiguration> ns3::WifiMac::GetHtConfiguration() const [member function]
cls.add_method('GetHtConfiguration',
'ns3::Ptr< ns3::HtConfiguration >',
[],
is_const=True)
## wifi-mac.h (module 'wifi'): bool ns3::WifiMac::GetShortSlotTimeSupported() const [member function]
cls.add_method('GetShortSlotTimeSupported',
'bool',
[],
is_const=True, is_pure_virtual=True, is_virtual=True)
## wifi-mac.h (module 'wifi'): ns3::Ssid ns3::WifiMac::GetSsid() const [member function]
cls.add_method('GetSsid',
'ns3::Ssid',
[],
is_const=True, is_pure_virtual=True, is_virtual=True)
## wifi-mac.h (module 'wifi'): static ns3::TypeId ns3::WifiMac::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## wifi-mac.h (module 'wifi'): ns3::TypeOfStation ns3::WifiMac::GetTypeOfStation() const [member function]
cls.add_method('GetTypeOfStation',
'ns3::TypeOfStation',
[],
is_const=True, is_pure_virtual=True, is_virtual=True)
## wifi-mac.h (module 'wifi'): ns3::Ptr<ns3::VhtConfiguration> ns3::WifiMac::GetVhtConfiguration() const [member function]
cls.add_method('GetVhtConfiguration',
'ns3::Ptr< ns3::VhtConfiguration >',
[],
is_const=True)
## wifi-mac.h (module 'wifi'): ns3::Ptr<ns3::WifiPhy> ns3::WifiMac::GetWifiPhy() const [member function]
cls.add_method('GetWifiPhy',
'ns3::Ptr< ns3::WifiPhy >',
[],
is_const=True, is_pure_virtual=True, is_virtual=True)
## wifi-mac.h (module 'wifi'): ns3::Ptr<ns3::WifiRemoteStationManager> ns3::WifiMac::GetWifiRemoteStationManager() const [member function]
cls.add_method('GetWifiRemoteStationManager',
'ns3::Ptr< ns3::WifiRemoteStationManager >',
[],
is_const=True, is_pure_virtual=True, is_virtual=True)
## wifi-mac.h (module 'wifi'): void ns3::WifiMac::NotifyPromiscRx(ns3::Ptr<const ns3::Packet> packet) [member function]
cls.add_method('NotifyPromiscRx',
'void',
[param('ns3::Ptr< ns3::Packet const >', 'packet')])
## wifi-mac.h (module 'wifi'): void ns3::WifiMac::NotifyRx(ns3::Ptr<const ns3::Packet> packet) [member function]
cls.add_method('NotifyRx',
'void',
[param('ns3::Ptr< ns3::Packet const >', 'packet')])
## wifi-mac.h (module 'wifi'): void ns3::WifiMac::NotifyRxDrop(ns3::Ptr<const ns3::Packet> packet) [member function]
cls.add_method('NotifyRxDrop',
'void',
[param('ns3::Ptr< ns3::Packet const >', 'packet')])
## wifi-mac.h (module 'wifi'): void ns3::WifiMac::NotifyTx(ns3::Ptr<const ns3::Packet> packet) [member function]
cls.add_method('NotifyTx',
'void',
[param('ns3::Ptr< ns3::Packet const >', 'packet')])
## wifi-mac.h (module 'wifi'): void ns3::WifiMac::NotifyTxDrop(ns3::Ptr<const ns3::Packet> packet) [member function]
cls.add_method('NotifyTxDrop',
'void',
[param('ns3::Ptr< ns3::Packet const >', 'packet')])
## wifi-mac.h (module 'wifi'): void ns3::WifiMac::ResetWifiPhy() [member function]
cls.add_method('ResetWifiPhy',
'void',
[],
is_pure_virtual=True, is_virtual=True)
## wifi-mac.h (module 'wifi'): void ns3::WifiMac::SetAddress(ns3::Mac48Address address) [member function]
cls.add_method('SetAddress',
'void',
[param('ns3::Mac48Address', 'address')],
is_pure_virtual=True, is_virtual=True)
## wifi-mac.h (module 'wifi'): void ns3::WifiMac::SetDevice(ns3::Ptr<ns3::NetDevice> const device) [member function]
cls.add_method('SetDevice',
'void',
[param('ns3::Ptr< ns3::NetDevice > const', 'device')])
## wifi-mac.h (module 'wifi'): void ns3::WifiMac::SetForwardUpCallback(ns3::WifiMac::ForwardUpCallback upCallback) [member function]
cls.add_method('SetForwardUpCallback',
'void',
[param('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::Mac48Address, ns3::Mac48Address, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'upCallback')],
is_pure_virtual=True, is_virtual=True)
## wifi-mac.h (module 'wifi'): void ns3::WifiMac::SetLinkDownCallback(ns3::Callback<void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> linkDown) [member function]
cls.add_method('SetLinkDownCallback',
'void',
[param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'linkDown')],
is_pure_virtual=True, is_virtual=True)
## wifi-mac.h (module 'wifi'): void ns3::WifiMac::SetLinkUpCallback(ns3::Callback<void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> linkUp) [member function]
cls.add_method('SetLinkUpCallback',
'void',
[param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'linkUp')],
is_pure_virtual=True, is_virtual=True)
## wifi-mac.h (module 'wifi'): void ns3::WifiMac::SetPromisc() [member function]
cls.add_method('SetPromisc',
'void',
[],
is_pure_virtual=True, is_virtual=True)
## wifi-mac.h (module 'wifi'): void ns3::WifiMac::SetShortSlotTimeSupported(bool enable) [member function]
cls.add_method('SetShortSlotTimeSupported',
'void',
[param('bool', 'enable')],
is_pure_virtual=True, is_virtual=True)
## wifi-mac.h (module 'wifi'): void ns3::WifiMac::SetSsid(ns3::Ssid ssid) [member function]
cls.add_method('SetSsid',
'void',
[param('ns3::Ssid', 'ssid')],
is_pure_virtual=True, is_virtual=True)
## wifi-mac.h (module 'wifi'): void ns3::WifiMac::SetTypeOfStation(ns3::TypeOfStation type) [member function]
cls.add_method('SetTypeOfStation',
'void',
[param('ns3::TypeOfStation', 'type')],
is_pure_virtual=True, is_virtual=True)
## wifi-mac.h (module 'wifi'): void ns3::WifiMac::SetWifiPhy(ns3::Ptr<ns3::WifiPhy> phy) [member function]
cls.add_method('SetWifiPhy',
'void',
[param('ns3::Ptr< ns3::WifiPhy >', 'phy')],
is_pure_virtual=True, is_virtual=True)
## wifi-mac.h (module 'wifi'): void ns3::WifiMac::SetWifiRemoteStationManager(ns3::Ptr<ns3::WifiRemoteStationManager> stationManager) [member function]
cls.add_method('SetWifiRemoteStationManager',
'void',
[param('ns3::Ptr< ns3::WifiRemoteStationManager >', 'stationManager')],
is_pure_virtual=True, is_virtual=True)
## wifi-mac.h (module 'wifi'): bool ns3::WifiMac::SupportsSendFrom() const [member function]
cls.add_method('SupportsSendFrom',
'bool',
[],
is_const=True, is_pure_virtual=True, is_virtual=True)
## wifi-mac.h (module 'wifi'): void ns3::WifiMac::ConfigureDcf(ns3::Ptr<ns3::Txop> dcf, uint32_t cwmin, uint32_t cwmax, bool isDsss, ns3::AcIndex ac) [member function]
cls.add_method('ConfigureDcf',
'void',
[param('ns3::Ptr< ns3::Txop >', 'dcf'), param('uint32_t', 'cwmin'), param('uint32_t', 'cwmax'), param('bool', 'isDsss'), param('ns3::AcIndex', 'ac')],
visibility='protected')
return
def register_Ns3WifiRemoteStationManager_methods(root_module, cls):
## wifi-remote-station-manager.h (module 'wifi'): static ns3::TypeId ns3::WifiRemoteStationManager::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiRemoteStationManager::WifiRemoteStationManager() [constructor]
cls.add_constructor([])
## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::SetupPhy(ns3::Ptr<ns3::WifiPhy> const phy) [member function]
cls.add_method('SetupPhy',
'void',
[param('ns3::Ptr< ns3::WifiPhy > const', 'phy')],
is_virtual=True)
## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::SetupMac(ns3::Ptr<ns3::WifiMac> const mac) [member function]
cls.add_method('SetupMac',
'void',
[param('ns3::Ptr< ns3::WifiMac > const', 'mac')],
is_virtual=True)
## wifi-remote-station-manager.h (module 'wifi'): int64_t ns3::WifiRemoteStationManager::AssignStreams(int64_t stream) [member function]
cls.add_method('AssignStreams',
'int64_t',
[param('int64_t', 'stream')],
is_virtual=True)
## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::SetMaxSsrc(uint32_t maxSsrc) [member function]
cls.add_method('SetMaxSsrc',
'void',
[param('uint32_t', 'maxSsrc')])
## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::SetMaxSlrc(uint32_t maxSlrc) [member function]
cls.add_method('SetMaxSlrc',
'void',
[param('uint32_t', 'maxSlrc')])
## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::SetRtsCtsThreshold(uint32_t threshold) [member function]
cls.add_method('SetRtsCtsThreshold',
'void',
[param('uint32_t', 'threshold')])
## wifi-remote-station-manager.h (module 'wifi'): uint32_t ns3::WifiRemoteStationManager::GetFragmentationThreshold() const [member function]
cls.add_method('GetFragmentationThreshold',
'uint32_t',
[],
is_const=True)
## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::SetFragmentationThreshold(uint32_t threshold) [member function]
cls.add_method('SetFragmentationThreshold',
'void',
[param('uint32_t', 'threshold')])
## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::SetAssociationId(ns3::Mac48Address remoteAddress, uint16_t aid) [member function]
cls.add_method('SetAssociationId',
'void',
[param('ns3::Mac48Address', 'remoteAddress'), param('uint16_t', 'aid')])
## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::SetQosSupport(ns3::Mac48Address from, bool qosSupported) [member function]
cls.add_method('SetQosSupport',
'void',
[param('ns3::Mac48Address', 'from'), param('bool', 'qosSupported')])
## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::AddStationHtCapabilities(ns3::Mac48Address from, ns3::HtCapabilities htCapabilities) [member function]
cls.add_method('AddStationHtCapabilities',
'void',
[param('ns3::Mac48Address', 'from'), param('ns3::HtCapabilities', 'htCapabilities')])
## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::AddStationVhtCapabilities(ns3::Mac48Address from, ns3::VhtCapabilities vhtCapabilities) [member function]
cls.add_method('AddStationVhtCapabilities',
'void',
[param('ns3::Mac48Address', 'from'), param('ns3::VhtCapabilities', 'vhtCapabilities')])
## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::AddStationHeCapabilities(ns3::Mac48Address from, ns3::HeCapabilities heCapabilities) [member function]
cls.add_method('AddStationHeCapabilities',
'void',
[param('ns3::Mac48Address', 'from'), param('ns3::HeCapabilities', 'heCapabilities')])
## wifi-remote-station-manager.h (module 'wifi'): ns3::Ptr<const ns3::HtCapabilities> ns3::WifiRemoteStationManager::GetStationHtCapabilities(ns3::Mac48Address from) [member function]
cls.add_method('GetStationHtCapabilities',
'ns3::Ptr< ns3::HtCapabilities const >',
[param('ns3::Mac48Address', 'from')])
## wifi-remote-station-manager.h (module 'wifi'): ns3::Ptr<const ns3::VhtCapabilities> ns3::WifiRemoteStationManager::GetStationVhtCapabilities(ns3::Mac48Address from) [member function]
cls.add_method('GetStationVhtCapabilities',
'ns3::Ptr< ns3::VhtCapabilities const >',
[param('ns3::Mac48Address', 'from')])
## wifi-remote-station-manager.h (module 'wifi'): ns3::Ptr<const ns3::HeCapabilities> ns3::WifiRemoteStationManager::GetStationHeCapabilities(ns3::Mac48Address from) [member function]
cls.add_method('GetStationHeCapabilities',
'ns3::Ptr< ns3::HeCapabilities const >',
[param('ns3::Mac48Address', 'from')])
## wifi-remote-station-manager.h (module 'wifi'): bool ns3::WifiRemoteStationManager::GetHtSupported() const [member function]
cls.add_method('GetHtSupported',
'bool',
[],
is_const=True)
## wifi-remote-station-manager.h (module 'wifi'): bool ns3::WifiRemoteStationManager::GetVhtSupported() const [member function]
cls.add_method('GetVhtSupported',
'bool',
[],
is_const=True)
## wifi-remote-station-manager.h (module 'wifi'): bool ns3::WifiRemoteStationManager::GetHeSupported() const [member function]
cls.add_method('GetHeSupported',
'bool',
[],
is_const=True)
## wifi-remote-station-manager.h (module 'wifi'): bool ns3::WifiRemoteStationManager::GetLdpcSupported() const [member function]
cls.add_method('GetLdpcSupported',
'bool',
[],
is_const=True)
## wifi-remote-station-manager.h (module 'wifi'): bool ns3::WifiRemoteStationManager::GetShortGuardIntervalSupported() const [member function]
cls.add_method('GetShortGuardIntervalSupported',
'bool',
[],
is_const=True)
## wifi-remote-station-manager.h (module 'wifi'): uint16_t ns3::WifiRemoteStationManager::GetGuardInterval() const [member function]
cls.add_method('GetGuardInterval',
'uint16_t',
[],
is_const=True)
## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::SetUseNonErpProtection(bool enable) [member function]
cls.add_method('SetUseNonErpProtection',
'void',
[param('bool', 'enable')])
## wifi-remote-station-manager.h (module 'wifi'): bool ns3::WifiRemoteStationManager::GetUseNonErpProtection() const [member function]
cls.add_method('GetUseNonErpProtection',
'bool',
[],
is_const=True)
## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::SetUseNonHtProtection(bool enable) [member function]
cls.add_method('SetUseNonHtProtection',
'void',
[param('bool', 'enable')])
## wifi-remote-station-manager.h (module 'wifi'): bool ns3::WifiRemoteStationManager::GetUseNonHtProtection() const [member function]
cls.add_method('GetUseNonHtProtection',
'bool',
[],
is_const=True)
## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::SetShortPreambleEnabled(bool enable) [member function]
cls.add_method('SetShortPreambleEnabled',
'void',
[param('bool', 'enable')])
## wifi-remote-station-manager.h (module 'wifi'): bool ns3::WifiRemoteStationManager::GetShortPreambleEnabled() const [member function]
cls.add_method('GetShortPreambleEnabled',
'bool',
[],
is_const=True)
## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::SetShortSlotTimeEnabled(bool enable) [member function]
cls.add_method('SetShortSlotTimeEnabled',
'void',
[param('bool', 'enable')])
## wifi-remote-station-manager.h (module 'wifi'): bool ns3::WifiRemoteStationManager::GetShortSlotTimeEnabled() const [member function]
cls.add_method('GetShortSlotTimeEnabled',
'bool',
[],
is_const=True)
## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::Reset() [member function]
cls.add_method('Reset',
'void',
[])
## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::AddBasicMode(ns3::WifiMode mode) [member function]
cls.add_method('AddBasicMode',
'void',
[param('ns3::WifiMode', 'mode')])
## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiMode ns3::WifiRemoteStationManager::GetDefaultMode() const [member function]
cls.add_method('GetDefaultMode',
'ns3::WifiMode',
[],
is_const=True)
## wifi-remote-station-manager.h (module 'wifi'): uint8_t ns3::WifiRemoteStationManager::GetNBasicModes() const [member function]
cls.add_method('GetNBasicModes',
'uint8_t',
[],
is_const=True)
## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiMode ns3::WifiRemoteStationManager::GetBasicMode(uint8_t i) const [member function]
cls.add_method('GetBasicMode',
'ns3::WifiMode',
[param('uint8_t', 'i')],
is_const=True)
## wifi-remote-station-manager.h (module 'wifi'): uint32_t ns3::WifiRemoteStationManager::GetNNonErpBasicModes() const [member function]
cls.add_method('GetNNonErpBasicModes',
'uint32_t',
[],
is_const=True)
## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiMode ns3::WifiRemoteStationManager::GetNonErpBasicMode(uint8_t i) const [member function]
cls.add_method('GetNonErpBasicMode',
'ns3::WifiMode',
[param('uint8_t', 'i')],
is_const=True)
## wifi-remote-station-manager.h (module 'wifi'): bool ns3::WifiRemoteStationManager::GetLdpcSupported(ns3::Mac48Address address) const [member function]
cls.add_method('GetLdpcSupported',
'bool',
[param('ns3::Mac48Address', 'address')],
is_const=True)
## wifi-remote-station-manager.h (module 'wifi'): bool ns3::WifiRemoteStationManager::GetShortPreambleSupported(ns3::Mac48Address address) const [member function]
cls.add_method('GetShortPreambleSupported',
'bool',
[param('ns3::Mac48Address', 'address')],
is_const=True)
## wifi-remote-station-manager.h (module 'wifi'): bool ns3::WifiRemoteStationManager::GetShortSlotTimeSupported(ns3::Mac48Address address) const [member function]
cls.add_method('GetShortSlotTimeSupported',
'bool',
[param('ns3::Mac48Address', 'address')],
is_const=True)
## wifi-remote-station-manager.h (module 'wifi'): bool ns3::WifiRemoteStationManager::GetQosSupported(ns3::Mac48Address address) const [member function]
cls.add_method('GetQosSupported',
'bool',
[param('ns3::Mac48Address', 'address')],
is_const=True)
## wifi-remote-station-manager.h (module 'wifi'): uint16_t ns3::WifiRemoteStationManager::GetAssociationId(ns3::Mac48Address remoteAddress) const [member function]
cls.add_method('GetAssociationId',
'uint16_t',
[param('ns3::Mac48Address', 'remoteAddress')],
is_const=True)
## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::AddBasicMcs(ns3::WifiMode mcs) [member function]
cls.add_method('AddBasicMcs',
'void',
[param('ns3::WifiMode', 'mcs')])
## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiMode ns3::WifiRemoteStationManager::GetDefaultMcs() const [member function]
cls.add_method('GetDefaultMcs',
'ns3::WifiMode',
[],
is_const=True)
## wifi-remote-station-manager.h (module 'wifi'): uint8_t ns3::WifiRemoteStationManager::GetNBasicMcs() const [member function]
cls.add_method('GetNBasicMcs',
'uint8_t',
[],
is_const=True)
## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiMode ns3::WifiRemoteStationManager::GetBasicMcs(uint8_t i) const [member function]
cls.add_method('GetBasicMcs',
'ns3::WifiMode',
[param('uint8_t', 'i')],
is_const=True)
## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::AddSupportedMcs(ns3::Mac48Address address, ns3::WifiMode mcs) [member function]
cls.add_method('AddSupportedMcs',
'void',
[param('ns3::Mac48Address', 'address'), param('ns3::WifiMode', 'mcs')])
## wifi-remote-station-manager.h (module 'wifi'): uint16_t ns3::WifiRemoteStationManager::GetChannelWidthSupported(ns3::Mac48Address address) const [member function]
cls.add_method('GetChannelWidthSupported',
'uint16_t',
[param('ns3::Mac48Address', 'address')],
is_const=True)
## wifi-remote-station-manager.h (module 'wifi'): bool ns3::WifiRemoteStationManager::GetShortGuardIntervalSupported(ns3::Mac48Address address) const [member function]
cls.add_method('GetShortGuardIntervalSupported',
'bool',
[param('ns3::Mac48Address', 'address')],
is_const=True)
## wifi-remote-station-manager.h (module 'wifi'): uint8_t ns3::WifiRemoteStationManager::GetNumberOfSupportedStreams(ns3::Mac48Address address) const [member function]
cls.add_method('GetNumberOfSupportedStreams',
'uint8_t',
[param('ns3::Mac48Address', 'address')],
is_const=True)
## wifi-remote-station-manager.h (module 'wifi'): uint8_t ns3::WifiRemoteStationManager::GetNMcsSupported(ns3::Mac48Address address) const [member function]
cls.add_method('GetNMcsSupported',
'uint8_t',
[param('ns3::Mac48Address', 'address')],
is_const=True)
## wifi-remote-station-manager.h (module 'wifi'): bool ns3::WifiRemoteStationManager::GetDsssSupported(ns3::Mac48Address const & address) const [member function]
cls.add_method('GetDsssSupported',
'bool',
[param('ns3::Mac48Address const &', 'address')],
is_const=True)
## wifi-remote-station-manager.h (module 'wifi'): bool ns3::WifiRemoteStationManager::GetErpOfdmSupported(ns3::Mac48Address const & address) const [member function]
cls.add_method('GetErpOfdmSupported',
'bool',
[param('ns3::Mac48Address const &', 'address')],
is_const=True)
## wifi-remote-station-manager.h (module 'wifi'): bool ns3::WifiRemoteStationManager::GetOfdmSupported(ns3::Mac48Address const & address) const [member function]
cls.add_method('GetOfdmSupported',
'bool',
[param('ns3::Mac48Address const &', 'address')],
is_const=True)
## wifi-remote-station-manager.h (module 'wifi'): bool ns3::WifiRemoteStationManager::GetHtSupported(ns3::Mac48Address address) const [member function]
cls.add_method('GetHtSupported',
'bool',
[param('ns3::Mac48Address', 'address')],
is_const=True)
## wifi-remote-station-manager.h (module 'wifi'): bool ns3::WifiRemoteStationManager::GetVhtSupported(ns3::Mac48Address address) const [member function]
cls.add_method('GetVhtSupported',
'bool',
[param('ns3::Mac48Address', 'address')],
is_const=True)
## wifi-remote-station-manager.h (module 'wifi'): bool ns3::WifiRemoteStationManager::GetHeSupported(ns3::Mac48Address address) const [member function]
cls.add_method('GetHeSupported',
'bool',
[param('ns3::Mac48Address', 'address')],
is_const=True)
## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiMode ns3::WifiRemoteStationManager::GetNonUnicastMode() const [member function]
cls.add_method('GetNonUnicastMode',
'ns3::WifiMode',
[],
is_const=True)
## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::AddSupportedMode(ns3::Mac48Address address, ns3::WifiMode mode) [member function]
cls.add_method('AddSupportedMode',
'void',
[param('ns3::Mac48Address', 'address'), param('ns3::WifiMode', 'mode')])
## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::AddAllSupportedModes(ns3::Mac48Address address) [member function]
cls.add_method('AddAllSupportedModes',
'void',
[param('ns3::Mac48Address', 'address')])
## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::AddAllSupportedMcs(ns3::Mac48Address address) [member function]
cls.add_method('AddAllSupportedMcs',
'void',
[param('ns3::Mac48Address', 'address')])
## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::RemoveAllSupportedMcs(ns3::Mac48Address address) [member function]
cls.add_method('RemoveAllSupportedMcs',
'void',
[param('ns3::Mac48Address', 'address')])
## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::AddSupportedPhyPreamble(ns3::Mac48Address address, bool isShortPreambleSupported) [member function]
cls.add_method('AddSupportedPhyPreamble',
'void',
[param('ns3::Mac48Address', 'address'), param('bool', 'isShortPreambleSupported')])
## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::AddSupportedErpSlotTime(ns3::Mac48Address address, bool isShortSlotTimeSupported) [member function]
cls.add_method('AddSupportedErpSlotTime',
'void',
[param('ns3::Mac48Address', 'address'), param('bool', 'isShortSlotTimeSupported')])
## wifi-remote-station-manager.h (module 'wifi'): bool ns3::WifiRemoteStationManager::IsBrandNew(ns3::Mac48Address address) const [member function]
cls.add_method('IsBrandNew',
'bool',
[param('ns3::Mac48Address', 'address')],
is_const=True)
## wifi-remote-station-manager.h (module 'wifi'): bool ns3::WifiRemoteStationManager::IsAssociated(ns3::Mac48Address address) const [member function]
cls.add_method('IsAssociated',
'bool',
[param('ns3::Mac48Address', 'address')],
is_const=True)
## wifi-remote-station-manager.h (module 'wifi'): bool ns3::WifiRemoteStationManager::IsWaitAssocTxOk(ns3::Mac48Address address) const [member function]
cls.add_method('IsWaitAssocTxOk',
'bool',
[param('ns3::Mac48Address', 'address')],
is_const=True)
## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::RecordWaitAssocTxOk(ns3::Mac48Address address) [member function]
cls.add_method('RecordWaitAssocTxOk',
'void',
[param('ns3::Mac48Address', 'address')])
## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::RecordGotAssocTxOk(ns3::Mac48Address address) [member function]
cls.add_method('RecordGotAssocTxOk',
'void',
[param('ns3::Mac48Address', 'address')])
## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::RecordGotAssocTxFailed(ns3::Mac48Address address) [member function]
cls.add_method('RecordGotAssocTxFailed',
'void',
[param('ns3::Mac48Address', 'address')])
## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::RecordDisassociated(ns3::Mac48Address address) [member function]
cls.add_method('RecordDisassociated',
'void',
[param('ns3::Mac48Address', 'address')])
## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiTxVector ns3::WifiRemoteStationManager::GetDataTxVector(ns3::WifiMacHeader const & header) [member function]
cls.add_method('GetDataTxVector',
'ns3::WifiTxVector',
[param('ns3::WifiMacHeader const &', 'header')])
## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiTxVector ns3::WifiRemoteStationManager::GetRtsTxVector(ns3::Mac48Address address) [member function]
cls.add_method('GetRtsTxVector',
'ns3::WifiTxVector',
[param('ns3::Mac48Address', 'address')])
## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiTxVector ns3::WifiRemoteStationManager::GetCtsTxVector(ns3::Mac48Address to, ns3::WifiMode rtsTxMode) const [member function]
cls.add_method('GetCtsTxVector',
'ns3::WifiTxVector',
[param('ns3::Mac48Address', 'to'), param('ns3::WifiMode', 'rtsTxMode')],
is_const=True)
## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiTxVector ns3::WifiRemoteStationManager::GetCtsToSelfTxVector() [member function]
cls.add_method('GetCtsToSelfTxVector',
'ns3::WifiTxVector',
[])
## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiTxVector ns3::WifiRemoteStationManager::GetAckTxVector(ns3::Mac48Address to, ns3::WifiTxVector const & dataTxVector) const [member function]
cls.add_method('GetAckTxVector',
'ns3::WifiTxVector',
[param('ns3::Mac48Address', 'to'), param('ns3::WifiTxVector const &', 'dataTxVector')],
is_const=True)
## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiTxVector ns3::WifiRemoteStationManager::GetBlockAckTxVector(ns3::Mac48Address to, ns3::WifiTxVector const & dataTxVector) const [member function]
cls.add_method('GetBlockAckTxVector',
'ns3::WifiTxVector',
[param('ns3::Mac48Address', 'to'), param('ns3::WifiTxVector const &', 'dataTxVector')],
is_const=True)
## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiMode ns3::WifiRemoteStationManager::GetControlAnswerMode(ns3::WifiMode reqMode) const [member function]
cls.add_method('GetControlAnswerMode',
'ns3::WifiMode',
[param('ns3::WifiMode', 'reqMode')],
is_const=True)
## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::ReportRtsFailed(ns3::WifiMacHeader const & header) [member function]
cls.add_method('ReportRtsFailed',
'void',
[param('ns3::WifiMacHeader const &', 'header')])
## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::ReportDataFailed(ns3::Ptr<const ns3::WifiMacQueueItem> mpdu) [member function]
cls.add_method('ReportDataFailed',
'void',
[param('ns3::Ptr< ns3::WifiMacQueueItem const >', 'mpdu')])
## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::ReportRtsOk(ns3::WifiMacHeader const & header, double ctsSnr, ns3::WifiMode ctsMode, double rtsSnr) [member function]
cls.add_method('ReportRtsOk',
'void',
[param('ns3::WifiMacHeader const &', 'header'), param('double', 'ctsSnr'), param('ns3::WifiMode', 'ctsMode'), param('double', 'rtsSnr')])
## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::ReportDataOk(ns3::Ptr<const ns3::WifiMacQueueItem> mpdu, double ackSnr, ns3::WifiMode ackMode, double dataSnr, ns3::WifiTxVector dataTxVector) [member function]
cls.add_method('ReportDataOk',
'void',
[param('ns3::Ptr< ns3::WifiMacQueueItem const >', 'mpdu'), param('double', 'ackSnr'), param('ns3::WifiMode', 'ackMode'), param('double', 'dataSnr'), param('ns3::WifiTxVector', 'dataTxVector')])
## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::ReportFinalRtsFailed(ns3::WifiMacHeader const & header) [member function]
cls.add_method('ReportFinalRtsFailed',
'void',
[param('ns3::WifiMacHeader const &', 'header')])
## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::ReportFinalDataFailed(ns3::Ptr<const ns3::WifiMacQueueItem> mpdu) [member function]
cls.add_method('ReportFinalDataFailed',
'void',
[param('ns3::Ptr< ns3::WifiMacQueueItem const >', 'mpdu')])
## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::ReportAmpduTxStatus(ns3::Mac48Address address, uint16_t nSuccessfulMpdus, uint16_t nFailedMpdus, double rxSnr, double dataSnr, ns3::WifiTxVector dataTxVector) [member function]
cls.add_method('ReportAmpduTxStatus',
'void',
[param('ns3::Mac48Address', 'address'), param('uint16_t', 'nSuccessfulMpdus'), param('uint16_t', 'nFailedMpdus'), param('double', 'rxSnr'), param('double', 'dataSnr'), param('ns3::WifiTxVector', 'dataTxVector')])
## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::ReportRxOk(ns3::Mac48Address address, ns3::RxSignalInfo rxSignalInfo, ns3::WifiTxVector txVector) [member function]
cls.add_method('ReportRxOk',
'void',
[param('ns3::Mac48Address', 'address'), param('ns3::RxSignalInfo', 'rxSignalInfo'), param('ns3::WifiTxVector', 'txVector')])
## wifi-remote-station-manager.h (module 'wifi'): bool ns3::WifiRemoteStationManager::NeedRts(ns3::WifiMacHeader const & header, uint32_t size) [member function]
cls.add_method('NeedRts',
'bool',
[param('ns3::WifiMacHeader const &', 'header'), param('uint32_t', 'size')])
## wifi-remote-station-manager.h (module 'wifi'): bool ns3::WifiRemoteStationManager::NeedCtsToSelf(ns3::WifiTxVector txVector) [member function]
cls.add_method('NeedCtsToSelf',
'bool',
[param('ns3::WifiTxVector', 'txVector')])
## wifi-remote-station-manager.h (module 'wifi'): bool ns3::WifiRemoteStationManager::NeedRetransmission(ns3::Ptr<const ns3::WifiMacQueueItem> mpdu) [member function]
cls.add_method('NeedRetransmission',
'bool',
[param('ns3::Ptr< ns3::WifiMacQueueItem const >', 'mpdu')])
## wifi-remote-station-manager.h (module 'wifi'): bool ns3::WifiRemoteStationManager::NeedFragmentation(ns3::Ptr<const ns3::WifiMacQueueItem> mpdu) [member function]
cls.add_method('NeedFragmentation',
'bool',
[param('ns3::Ptr< ns3::WifiMacQueueItem const >', 'mpdu')])
## wifi-remote-station-manager.h (module 'wifi'): uint32_t ns3::WifiRemoteStationManager::GetFragmentSize(ns3::Ptr<const ns3::WifiMacQueueItem> mpdu, uint32_t fragmentNumber) [member function]
cls.add_method('GetFragmentSize',
'uint32_t',
[param('ns3::Ptr< ns3::WifiMacQueueItem const >', 'mpdu'), param('uint32_t', 'fragmentNumber')])
## wifi-remote-station-manager.h (module 'wifi'): uint32_t ns3::WifiRemoteStationManager::GetFragmentOffset(ns3::Ptr<const ns3::WifiMacQueueItem> mpdu, uint32_t fragmentNumber) [member function]
cls.add_method('GetFragmentOffset',
'uint32_t',
[param('ns3::Ptr< ns3::WifiMacQueueItem const >', 'mpdu'), param('uint32_t', 'fragmentNumber')])
## wifi-remote-station-manager.h (module 'wifi'): bool ns3::WifiRemoteStationManager::IsLastFragment(ns3::Ptr<const ns3::WifiMacQueueItem> mpdu, uint32_t fragmentNumber) [member function]
cls.add_method('IsLastFragment',
'bool',
[param('ns3::Ptr< ns3::WifiMacQueueItem const >', 'mpdu'), param('uint32_t', 'fragmentNumber')])
## wifi-remote-station-manager.h (module 'wifi'): uint8_t ns3::WifiRemoteStationManager::GetDefaultTxPowerLevel() const [member function]
cls.add_method('GetDefaultTxPowerLevel',
'uint8_t',
[],
is_const=True)
## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiRemoteStationInfo ns3::WifiRemoteStationManager::GetInfo(ns3::Mac48Address address) [member function]
cls.add_method('GetInfo',
'ns3::WifiRemoteStationInfo',
[param('ns3::Mac48Address', 'address')])
## wifi-remote-station-manager.h (module 'wifi'): double ns3::WifiRemoteStationManager::GetMostRecentRssi(ns3::Mac48Address address) const [member function]
cls.add_method('GetMostRecentRssi',
'double',
[param('ns3::Mac48Address', 'address')],
is_const=True)
## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::SetDefaultTxPowerLevel(uint8_t txPower) [member function]
cls.add_method('SetDefaultTxPowerLevel',
'void',
[param('uint8_t', 'txPower')])
## wifi-remote-station-manager.h (module 'wifi'): uint8_t ns3::WifiRemoteStationManager::GetNumberOfAntennas() const [member function]
cls.add_method('GetNumberOfAntennas',
'uint8_t',
[],
is_const=True)
## wifi-remote-station-manager.h (module 'wifi'): uint8_t ns3::WifiRemoteStationManager::GetMaxNumberOfTransmitStreams() const [member function]
cls.add_method('GetMaxNumberOfTransmitStreams',
'uint8_t',
[],
is_const=True)
## wifi-remote-station-manager.h (module 'wifi'): bool ns3::WifiRemoteStationManager::UseLdpcForDestination(ns3::Mac48Address dest) const [member function]
cls.add_method('UseLdpcForDestination',
'bool',
[param('ns3::Mac48Address', 'dest')],
is_const=True)
## wifi-remote-station-manager.h (module 'wifi'): ns3::Ptr<ns3::WifiPhy> ns3::WifiRemoteStationManager::GetPhy() const [member function]
cls.add_method('GetPhy',
'ns3::Ptr< ns3::WifiPhy >',
[],
is_const=True)
## wifi-remote-station-manager.h (module 'wifi'): ns3::Ptr<ns3::WifiMac> ns3::WifiRemoteStationManager::GetMac() const [member function]
cls.add_method('GetMac',
'ns3::Ptr< ns3::WifiMac >',
[],
is_const=True)
## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiRemoteStationManager::WifiRemoteStationManager(ns3::WifiRemoteStationManager const & arg0) [constructor]
cls.add_constructor([param('ns3::WifiRemoteStationManager const &', 'arg0')])
## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::DoDispose() [member function]
cls.add_method('DoDispose',
'void',
[],
is_virtual=True, visibility='protected')
## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiMode ns3::WifiRemoteStationManager::GetSupported(ns3::WifiRemoteStation const * station, uint8_t i) const [member function]
cls.add_method('GetSupported',
'ns3::WifiMode',
[param('ns3::WifiRemoteStation const *', 'station'), param('uint8_t', 'i')],
is_const=True, visibility='protected')
## wifi-remote-station-manager.h (module 'wifi'): uint8_t ns3::WifiRemoteStationManager::GetNSupported(ns3::WifiRemoteStation const * station) const [member function]
cls.add_method('GetNSupported',
'uint8_t',
[param('ns3::WifiRemoteStation const *', 'station')],
is_const=True, visibility='protected')
## wifi-remote-station-manager.h (module 'wifi'): bool ns3::WifiRemoteStationManager::GetQosSupported(ns3::WifiRemoteStation const * station) const [member function]
cls.add_method('GetQosSupported',
'bool',
[param('ns3::WifiRemoteStation const *', 'station')],
is_const=True, visibility='protected')
## wifi-remote-station-manager.h (module 'wifi'): bool ns3::WifiRemoteStationManager::GetHtSupported(ns3::WifiRemoteStation const * station) const [member function]
cls.add_method('GetHtSupported',
'bool',
[param('ns3::WifiRemoteStation const *', 'station')],
is_const=True, visibility='protected')
## wifi-remote-station-manager.h (module 'wifi'): bool ns3::WifiRemoteStationManager::GetVhtSupported(ns3::WifiRemoteStation const * station) const [member function]
cls.add_method('GetVhtSupported',
'bool',
[param('ns3::WifiRemoteStation const *', 'station')],
is_const=True, visibility='protected')
## wifi-remote-station-manager.h (module 'wifi'): bool ns3::WifiRemoteStationManager::GetHeSupported(ns3::WifiRemoteStation const * station) const [member function]
cls.add_method('GetHeSupported',
'bool',
[param('ns3::WifiRemoteStation const *', 'station')],
is_const=True, visibility='protected')
## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiMode ns3::WifiRemoteStationManager::GetMcsSupported(ns3::WifiRemoteStation const * station, uint8_t i) const [member function]
cls.add_method('GetMcsSupported',
'ns3::WifiMode',
[param('ns3::WifiRemoteStation const *', 'station'), param('uint8_t', 'i')],
is_const=True, visibility='protected')
## wifi-remote-station-manager.h (module 'wifi'): uint8_t ns3::WifiRemoteStationManager::GetNMcsSupported(ns3::WifiRemoteStation const * station) const [member function]
cls.add_method('GetNMcsSupported',
'uint8_t',
[param('ns3::WifiRemoteStation const *', 'station')],
is_const=True, visibility='protected')
## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiMode ns3::WifiRemoteStationManager::GetNonErpSupported(ns3::WifiRemoteStation const * station, uint8_t i) const [member function]
cls.add_method('GetNonErpSupported',
'ns3::WifiMode',
[param('ns3::WifiRemoteStation const *', 'station'), param('uint8_t', 'i')],
is_const=True, visibility='protected')
## wifi-remote-station-manager.h (module 'wifi'): uint32_t ns3::WifiRemoteStationManager::GetNNonErpSupported(ns3::WifiRemoteStation const * station) const [member function]
cls.add_method('GetNNonErpSupported',
'uint32_t',
[param('ns3::WifiRemoteStation const *', 'station')],
is_const=True, visibility='protected')
## wifi-remote-station-manager.h (module 'wifi'): ns3::Mac48Address ns3::WifiRemoteStationManager::GetAddress(ns3::WifiRemoteStation const * station) const [member function]
cls.add_method('GetAddress',
'ns3::Mac48Address',
[param('ns3::WifiRemoteStation const *', 'station')],
is_const=True, visibility='protected')
## wifi-remote-station-manager.h (module 'wifi'): uint16_t ns3::WifiRemoteStationManager::GetChannelWidth(ns3::WifiRemoteStation const * station) const [member function]
cls.add_method('GetChannelWidth',
'uint16_t',
[param('ns3::WifiRemoteStation const *', 'station')],
is_const=True, visibility='protected')
## wifi-remote-station-manager.h (module 'wifi'): bool ns3::WifiRemoteStationManager::GetShortGuardIntervalSupported(ns3::WifiRemoteStation const * station) const [member function]
cls.add_method('GetShortGuardIntervalSupported',
'bool',
[param('ns3::WifiRemoteStation const *', 'station')],
is_const=True, visibility='protected')
## wifi-remote-station-manager.h (module 'wifi'): uint16_t ns3::WifiRemoteStationManager::GetGuardInterval(ns3::WifiRemoteStation const * station) const [member function]
cls.add_method('GetGuardInterval',
'uint16_t',
[param('ns3::WifiRemoteStation const *', 'station')],
is_const=True, visibility='protected')
## wifi-remote-station-manager.h (module 'wifi'): bool ns3::WifiRemoteStationManager::GetAggregation(ns3::WifiRemoteStation const * station) const [member function]
cls.add_method('GetAggregation',
'bool',
[param('ns3::WifiRemoteStation const *', 'station')],
is_const=True, visibility='protected')
## wifi-remote-station-manager.h (module 'wifi'): uint8_t ns3::WifiRemoteStationManager::GetNumberOfSupportedStreams(ns3::WifiRemoteStation const * station) const [member function]
cls.add_method('GetNumberOfSupportedStreams',
'uint8_t',
[param('ns3::WifiRemoteStation const *', 'station')],
is_const=True, visibility='protected')
## wifi-remote-station-manager.h (module 'wifi'): uint8_t ns3::WifiRemoteStationManager::GetNess(ns3::WifiRemoteStation const * station) const [member function]
cls.add_method('GetNess',
'uint8_t',
[param('ns3::WifiRemoteStation const *', 'station')],
is_const=True, visibility='protected')
## wifi-remote-station-manager.h (module 'wifi'): bool ns3::WifiRemoteStationManager::DoNeedRts(ns3::WifiRemoteStation * station, uint32_t size, bool normally) [member function]
cls.add_method('DoNeedRts',
'bool',
[param('ns3::WifiRemoteStation *', 'station'), param('uint32_t', 'size'), param('bool', 'normally')],
is_virtual=True, visibility='private')
## wifi-remote-station-manager.h (module 'wifi'): bool ns3::WifiRemoteStationManager::DoNeedRetransmission(ns3::WifiRemoteStation * station, ns3::Ptr<const ns3::Packet> packet, bool normally) [member function]
cls.add_method('DoNeedRetransmission',
'bool',
[param('ns3::WifiRemoteStation *', 'station'), param('ns3::Ptr< ns3::Packet const >', 'packet'), param('bool', 'normally')],
is_virtual=True, visibility='private')
## wifi-remote-station-manager.h (module 'wifi'): bool ns3::WifiRemoteStationManager::DoNeedFragmentation(ns3::WifiRemoteStation * station, ns3::Ptr<const ns3::Packet> packet, bool normally) [member function]
cls.add_method('DoNeedFragmentation',
'bool',
[param('ns3::WifiRemoteStation *', 'station'), param('ns3::Ptr< ns3::Packet const >', 'packet'), param('bool', 'normally')],
is_virtual=True, visibility='private')
## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiRemoteStation * ns3::WifiRemoteStationManager::DoCreateStation() const [member function]
cls.add_method('DoCreateStation',
'ns3::WifiRemoteStation *',
[],
is_const=True, is_pure_virtual=True, is_virtual=True, visibility='private')
## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiTxVector ns3::WifiRemoteStationManager::DoGetDataTxVector(ns3::WifiRemoteStation * station) [member function]
cls.add_method('DoGetDataTxVector',
'ns3::WifiTxVector',
[param('ns3::WifiRemoteStation *', 'station')],
is_pure_virtual=True, is_virtual=True, visibility='private')
## wifi-remote-station-manager.h (module 'wifi'): ns3::WifiTxVector ns3::WifiRemoteStationManager::DoGetRtsTxVector(ns3::WifiRemoteStation * station) [member function]
cls.add_method('DoGetRtsTxVector',
'ns3::WifiTxVector',
[param('ns3::WifiRemoteStation *', 'station')],
is_pure_virtual=True, is_virtual=True, visibility='private')
## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::DoReportRtsFailed(ns3::WifiRemoteStation * station) [member function]
cls.add_method('DoReportRtsFailed',
'void',
[param('ns3::WifiRemoteStation *', 'station')],
is_pure_virtual=True, is_virtual=True, visibility='private')
## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::DoReportDataFailed(ns3::WifiRemoteStation * station) [member function]
cls.add_method('DoReportDataFailed',
'void',
[param('ns3::WifiRemoteStation *', 'station')],
is_pure_virtual=True, is_virtual=True, visibility='private')
## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::DoReportRtsOk(ns3::WifiRemoteStation * station, double ctsSnr, ns3::WifiMode ctsMode, double rtsSnr) [member function]
cls.add_method('DoReportRtsOk',
'void',
[param('ns3::WifiRemoteStation *', 'station'), param('double', 'ctsSnr'), param('ns3::WifiMode', 'ctsMode'), param('double', 'rtsSnr')],
is_pure_virtual=True, is_virtual=True, visibility='private')
## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::DoReportDataOk(ns3::WifiRemoteStation * station, double ackSnr, ns3::WifiMode ackMode, double dataSnr, uint16_t dataChannelWidth, uint8_t dataNss) [member function]
cls.add_method('DoReportDataOk',
'void',
[param('ns3::WifiRemoteStation *', 'station'), param('double', 'ackSnr'), param('ns3::WifiMode', 'ackMode'), param('double', 'dataSnr'), param('uint16_t', 'dataChannelWidth'), param('uint8_t', 'dataNss')],
is_pure_virtual=True, is_virtual=True, visibility='private')
## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::DoReportFinalRtsFailed(ns3::WifiRemoteStation * station) [member function]
cls.add_method('DoReportFinalRtsFailed',
'void',
[param('ns3::WifiRemoteStation *', 'station')],
is_pure_virtual=True, is_virtual=True, visibility='private')
## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::DoReportFinalDataFailed(ns3::WifiRemoteStation * station) [member function]
cls.add_method('DoReportFinalDataFailed',
'void',
[param('ns3::WifiRemoteStation *', 'station')],
is_pure_virtual=True, is_virtual=True, visibility='private')
## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::DoReportRxOk(ns3::WifiRemoteStation * station, double rxSnr, ns3::WifiMode txMode) [member function]
cls.add_method('DoReportRxOk',
'void',
[param('ns3::WifiRemoteStation *', 'station'), param('double', 'rxSnr'), param('ns3::WifiMode', 'txMode')],
is_pure_virtual=True, is_virtual=True, visibility='private')
## wifi-remote-station-manager.h (module 'wifi'): void ns3::WifiRemoteStationManager::DoReportAmpduTxStatus(ns3::WifiRemoteStation * station, uint16_t nSuccessfulMpdus, uint16_t nFailedMpdus, double rxSnr, double dataSnr, uint16_t dataChannelWidth, uint8_t dataNss) [member function]
cls.add_method('DoReportAmpduTxStatus',
'void',
[param('ns3::WifiRemoteStation *', 'station'), param('uint16_t', 'nSuccessfulMpdus'), param('uint16_t', 'nFailedMpdus'), param('double', 'rxSnr'), param('double', 'dataSnr'), param('uint16_t', 'dataChannelWidth'), param('uint8_t', 'dataNss')],
is_virtual=True, visibility='private')
return
def register_Ns3ZetaRandomVariable_methods(root_module, cls):
## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::ZetaRandomVariable::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## random-variable-stream.h (module 'core'): ns3::ZetaRandomVariable::ZetaRandomVariable() [constructor]
cls.add_constructor([])
## random-variable-stream.h (module 'core'): double ns3::ZetaRandomVariable::GetAlpha() const [member function]
cls.add_method('GetAlpha',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::ZetaRandomVariable::GetValue(double alpha) [member function]
cls.add_method('GetValue',
'double',
[param('double', 'alpha')])
## random-variable-stream.h (module 'core'): uint32_t ns3::ZetaRandomVariable::GetInteger(uint32_t alpha) [member function]
cls.add_method('GetInteger',
'uint32_t',
[param('uint32_t', 'alpha')])
## random-variable-stream.h (module 'core'): double ns3::ZetaRandomVariable::GetValue() [member function]
cls.add_method('GetValue',
'double',
[],
is_virtual=True)
## random-variable-stream.h (module 'core'): uint32_t ns3::ZetaRandomVariable::GetInteger() [member function]
cls.add_method('GetInteger',
'uint32_t',
[],
is_virtual=True)
return
def register_Ns3ZipfRandomVariable_methods(root_module, cls):
## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::ZipfRandomVariable::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## random-variable-stream.h (module 'core'): ns3::ZipfRandomVariable::ZipfRandomVariable() [constructor]
cls.add_constructor([])
## random-variable-stream.h (module 'core'): uint32_t ns3::ZipfRandomVariable::GetN() const [member function]
cls.add_method('GetN',
'uint32_t',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::ZipfRandomVariable::GetAlpha() const [member function]
cls.add_method('GetAlpha',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::ZipfRandomVariable::GetValue(uint32_t n, double alpha) [member function]
cls.add_method('GetValue',
'double',
[param('uint32_t', 'n'), param('double', 'alpha')])
## random-variable-stream.h (module 'core'): uint32_t ns3::ZipfRandomVariable::GetInteger(uint32_t n, uint32_t alpha) [member function]
cls.add_method('GetInteger',
'uint32_t',
[param('uint32_t', 'n'), param('uint32_t', 'alpha')])
## random-variable-stream.h (module 'core'): double ns3::ZipfRandomVariable::GetValue() [member function]
cls.add_method('GetValue',
'double',
[],
is_virtual=True)
## random-variable-stream.h (module 'core'): uint32_t ns3::ZipfRandomVariable::GetInteger() [member function]
cls.add_method('GetInteger',
'uint32_t',
[],
is_virtual=True)
return
def register_Ns3ArpCache_methods(root_module, cls):
## arp-cache.h (module 'internet'): ns3::ArpCache::ArpCache() [constructor]
cls.add_constructor([])
## arp-cache.h (module 'internet'): ns3::ArpCache::Entry * ns3::ArpCache::Add(ns3::Ipv4Address to) [member function]
cls.add_method('Add',
'ns3::ArpCache::Entry *',
[param('ns3::Ipv4Address', 'to')])
## arp-cache.h (module 'internet'): void ns3::ArpCache::Flush() [member function]
cls.add_method('Flush',
'void',
[])
## arp-cache.h (module 'internet'): ns3::Time ns3::ArpCache::GetAliveTimeout() const [member function]
cls.add_method('GetAliveTimeout',
'ns3::Time',
[],
is_const=True)
## arp-cache.h (module 'internet'): ns3::Time ns3::ArpCache::GetDeadTimeout() const [member function]
cls.add_method('GetDeadTimeout',
'ns3::Time',
[],
is_const=True)
## arp-cache.h (module 'internet'): ns3::Ptr<ns3::NetDevice> ns3::ArpCache::GetDevice() const [member function]
cls.add_method('GetDevice',
'ns3::Ptr< ns3::NetDevice >',
[],
is_const=True)
## arp-cache.h (module 'internet'): ns3::Ptr<ns3::Ipv4Interface> ns3::ArpCache::GetInterface() const [member function]
cls.add_method('GetInterface',
'ns3::Ptr< ns3::Ipv4Interface >',
[],
is_const=True)
## arp-cache.h (module 'internet'): static ns3::TypeId ns3::ArpCache::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## arp-cache.h (module 'internet'): ns3::Time ns3::ArpCache::GetWaitReplyTimeout() const [member function]
cls.add_method('GetWaitReplyTimeout',
'ns3::Time',
[],
is_const=True)
## arp-cache.h (module 'internet'): ns3::ArpCache::Entry * ns3::ArpCache::Lookup(ns3::Ipv4Address destination) [member function]
cls.add_method('Lookup',
'ns3::ArpCache::Entry *',
[param('ns3::Ipv4Address', 'destination')])
## arp-cache.h (module 'internet'): std::list<ns3::ArpCache::Entry *, std::allocator<ns3::ArpCache::Entry *> > ns3::ArpCache::LookupInverse(ns3::Address destination) [member function]
cls.add_method('LookupInverse',
'std::list< ns3::ArpCache::Entry * >',
[param('ns3::Address', 'destination')])
## arp-cache.h (module 'internet'): void ns3::ArpCache::PrintArpCache(ns3::Ptr<ns3::OutputStreamWrapper> stream) [member function]
cls.add_method('PrintArpCache',
'void',
[param('ns3::Ptr< ns3::OutputStreamWrapper >', 'stream')])
## arp-cache.h (module 'internet'): void ns3::ArpCache::Remove(ns3::ArpCache::Entry * entry) [member function]
cls.add_method('Remove',
'void',
[param('ns3::ArpCache::Entry *', 'entry')])
## arp-cache.h (module 'internet'): void ns3::ArpCache::SetAliveTimeout(ns3::Time aliveTimeout) [member function]
cls.add_method('SetAliveTimeout',
'void',
[param('ns3::Time', 'aliveTimeout')])
## arp-cache.h (module 'internet'): void ns3::ArpCache::SetArpRequestCallback(ns3::Callback<void, ns3::Ptr<const ns3::ArpCache>, ns3::Ipv4Address, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> arpRequestCallback) [member function]
cls.add_method('SetArpRequestCallback',
'void',
[param('ns3::Callback< void, ns3::Ptr< ns3::ArpCache const >, ns3::Ipv4Address, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'arpRequestCallback')])
## arp-cache.h (module 'internet'): void ns3::ArpCache::SetDeadTimeout(ns3::Time deadTimeout) [member function]
cls.add_method('SetDeadTimeout',
'void',
[param('ns3::Time', 'deadTimeout')])
## arp-cache.h (module 'internet'): void ns3::ArpCache::SetDevice(ns3::Ptr<ns3::NetDevice> device, ns3::Ptr<ns3::Ipv4Interface> interface) [member function]
cls.add_method('SetDevice',
'void',
[param('ns3::Ptr< ns3::NetDevice >', 'device'), param('ns3::Ptr< ns3::Ipv4Interface >', 'interface')])
## arp-cache.h (module 'internet'): void ns3::ArpCache::SetWaitReplyTimeout(ns3::Time waitReplyTimeout) [member function]
cls.add_method('SetWaitReplyTimeout',
'void',
[param('ns3::Time', 'waitReplyTimeout')])
## arp-cache.h (module 'internet'): void ns3::ArpCache::StartWaitReplyTimer() [member function]
cls.add_method('StartWaitReplyTimer',
'void',
[])
## arp-cache.h (module 'internet'): void ns3::ArpCache::DoDispose() [member function]
cls.add_method('DoDispose',
'void',
[],
is_virtual=True, visibility='private')
return
def register_Ns3ArpCacheEntry_methods(root_module, cls):
## arp-cache.h (module 'internet'): ns3::ArpCache::Entry::Entry(ns3::ArpCache::Entry const & arg0) [constructor]
cls.add_constructor([param('ns3::ArpCache::Entry const &', 'arg0')])
## arp-cache.h (module 'internet'): ns3::ArpCache::Entry::Entry(ns3::ArpCache * arp) [constructor]
cls.add_constructor([param('ns3::ArpCache *', 'arp')])
## arp-cache.h (module 'internet'): void ns3::ArpCache::Entry::ClearPendingPacket() [member function]
cls.add_method('ClearPendingPacket',
'void',
[])
## arp-cache.h (module 'internet'): void ns3::ArpCache::Entry::ClearRetries() [member function]
cls.add_method('ClearRetries',
'void',
[])
## arp-cache.h (module 'internet'): ns3::ArpCache::Ipv4PayloadHeaderPair ns3::ArpCache::Entry::DequeuePending() [member function]
cls.add_method('DequeuePending',
'ns3::ArpCache::Ipv4PayloadHeaderPair',
[])
## arp-cache.h (module 'internet'): ns3::Ipv4Address ns3::ArpCache::Entry::GetIpv4Address() const [member function]
cls.add_method('GetIpv4Address',
'ns3::Ipv4Address',
[],
is_const=True)
## arp-cache.h (module 'internet'): ns3::Address ns3::ArpCache::Entry::GetMacAddress() const [member function]
cls.add_method('GetMacAddress',
'ns3::Address',
[],
is_const=True)
## arp-cache.h (module 'internet'): uint32_t ns3::ArpCache::Entry::GetRetries() const [member function]
cls.add_method('GetRetries',
'uint32_t',
[],
is_const=True)
## arp-cache.h (module 'internet'): void ns3::ArpCache::Entry::IncrementRetries() [member function]
cls.add_method('IncrementRetries',
'void',
[])
## arp-cache.h (module 'internet'): bool ns3::ArpCache::Entry::IsAlive() [member function]
cls.add_method('IsAlive',
'bool',
[])
## arp-cache.h (module 'internet'): bool ns3::ArpCache::Entry::IsDead() [member function]
cls.add_method('IsDead',
'bool',
[])
## arp-cache.h (module 'internet'): bool ns3::ArpCache::Entry::IsExpired() const [member function]
cls.add_method('IsExpired',
'bool',
[],
is_const=True)
## arp-cache.h (module 'internet'): bool ns3::ArpCache::Entry::IsPermanent() [member function]
cls.add_method('IsPermanent',
'bool',
[])
## arp-cache.h (module 'internet'): bool ns3::ArpCache::Entry::IsWaitReply() [member function]
cls.add_method('IsWaitReply',
'bool',
[])
## arp-cache.h (module 'internet'): void ns3::ArpCache::Entry::MarkAlive(ns3::Address macAddress) [member function]
cls.add_method('MarkAlive',
'void',
[param('ns3::Address', 'macAddress')])
## arp-cache.h (module 'internet'): void ns3::ArpCache::Entry::MarkDead() [member function]
cls.add_method('MarkDead',
'void',
[])
## arp-cache.h (module 'internet'): void ns3::ArpCache::Entry::MarkPermanent() [member function]
cls.add_method('MarkPermanent',
'void',
[])
## arp-cache.h (module 'internet'): void ns3::ArpCache::Entry::MarkWaitReply(ns3::ArpCache::Ipv4PayloadHeaderPair waiting) [member function]
cls.add_method('MarkWaitReply',
'void',
[param('std::pair< ns3::Ptr< ns3::Packet >, ns3::Ipv4Header >', 'waiting')])
## arp-cache.h (module 'internet'): void ns3::ArpCache::Entry::SetIpv4Address(ns3::Ipv4Address destination) [member function]
cls.add_method('SetIpv4Address',
'void',
[param('ns3::Ipv4Address', 'destination')])
## arp-cache.h (module 'internet'): void ns3::ArpCache::Entry::SetMacAddress(ns3::Address macAddress) [member function]
cls.add_method('SetMacAddress',
'void',
[param('ns3::Address', 'macAddress')])
## arp-cache.h (module 'internet'): void ns3::ArpCache::Entry::UpdateSeen() [member function]
cls.add_method('UpdateSeen',
'void',
[])
## arp-cache.h (module 'internet'): bool ns3::ArpCache::Entry::UpdateWaitReply(ns3::ArpCache::Ipv4PayloadHeaderPair waiting) [member function]
cls.add_method('UpdateWaitReply',
'bool',
[param('std::pair< ns3::Ptr< ns3::Packet >, ns3::Ipv4Header >', 'waiting')])
return
def register_Ns3AttributeAccessor_methods(root_module, cls):
## attribute.h (module 'core'): ns3::AttributeAccessor::AttributeAccessor(ns3::AttributeAccessor const & arg0) [constructor]
cls.add_constructor([param('ns3::AttributeAccessor const &', 'arg0')])
## attribute.h (module 'core'): ns3::AttributeAccessor::AttributeAccessor() [constructor]
cls.add_constructor([])
## attribute.h (module 'core'): bool ns3::AttributeAccessor::Get(ns3::ObjectBase const * object, ns3::AttributeValue & attribute) const [member function]
cls.add_method('Get',
'bool',
[param('ns3::ObjectBase const *', 'object'), param('ns3::AttributeValue &', 'attribute')],
is_const=True, is_pure_virtual=True, is_virtual=True)
## attribute.h (module 'core'): bool ns3::AttributeAccessor::HasGetter() const [member function]
cls.add_method('HasGetter',
'bool',
[],
is_const=True, is_pure_virtual=True, is_virtual=True)
## attribute.h (module 'core'): bool ns3::AttributeAccessor::HasSetter() const [member function]
cls.add_method('HasSetter',
'bool',
[],
is_const=True, is_pure_virtual=True, is_virtual=True)
## attribute.h (module 'core'): bool ns3::AttributeAccessor::Set(ns3::ObjectBase * object, ns3::AttributeValue const & value) const [member function]
cls.add_method('Set',
'bool',
[param('ns3::ObjectBase *', 'object', transfer_ownership=False), param('ns3::AttributeValue const &', 'value')],
is_const=True, is_pure_virtual=True, is_virtual=True)
return
def register_Ns3AttributeChecker_methods(root_module, cls):
## attribute.h (module 'core'): ns3::AttributeChecker::AttributeChecker(ns3::AttributeChecker const & arg0) [constructor]
cls.add_constructor([param('ns3::AttributeChecker const &', 'arg0')])
## attribute.h (module 'core'): ns3::AttributeChecker::AttributeChecker() [constructor]
cls.add_constructor([])
## attribute.h (module 'core'): bool ns3::AttributeChecker::Check(ns3::AttributeValue const & value) const [member function]
cls.add_method('Check',
'bool',
[param('ns3::AttributeValue const &', 'value')],
is_const=True, is_pure_virtual=True, is_virtual=True)
## attribute.h (module 'core'): bool ns3::AttributeChecker::Copy(ns3::AttributeValue const & source, ns3::AttributeValue & destination) const [member function]
cls.add_method('Copy',
'bool',
[param('ns3::AttributeValue const &', 'source'), param('ns3::AttributeValue &', 'destination')],
is_const=True, is_pure_virtual=True, is_virtual=True)
## attribute.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::AttributeChecker::Create() const [member function]
cls.add_method('Create',
'ns3::Ptr< ns3::AttributeValue >',
[],
is_const=True, is_pure_virtual=True, is_virtual=True)
## attribute.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::AttributeChecker::CreateValidValue(ns3::AttributeValue const & value) const [member function]
cls.add_method('CreateValidValue',
'ns3::Ptr< ns3::AttributeValue >',
[param('ns3::AttributeValue const &', 'value')],
is_const=True)
## attribute.h (module 'core'): std::string ns3::AttributeChecker::GetUnderlyingTypeInformation() const [member function]
cls.add_method('GetUnderlyingTypeInformation',
'std::string',
[],
is_const=True, is_pure_virtual=True, is_virtual=True)
## attribute.h (module 'core'): std::string ns3::AttributeChecker::GetValueTypeName() const [member function]
cls.add_method('GetValueTypeName',
'std::string',
[],
is_const=True, is_pure_virtual=True, is_virtual=True)
## attribute.h (module 'core'): bool ns3::AttributeChecker::HasUnderlyingTypeInformation() const [member function]
cls.add_method('HasUnderlyingTypeInformation',
'bool',
[],
is_const=True, is_pure_virtual=True, is_virtual=True)
return
def register_Ns3AttributeValue_methods(root_module, cls):
## attribute.h (module 'core'): ns3::AttributeValue::AttributeValue(ns3::AttributeValue const & arg0) [constructor]
cls.add_constructor([param('ns3::AttributeValue const &', 'arg0')])
## attribute.h (module 'core'): ns3::AttributeValue::AttributeValue() [constructor]
cls.add_constructor([])
## attribute.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::AttributeValue::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::AttributeValue >',
[],
is_const=True, is_pure_virtual=True, is_virtual=True)
## attribute.h (module 'core'): bool ns3::AttributeValue::DeserializeFromString(std::string value, ns3::Ptr<const ns3::AttributeChecker> checker) [member function]
cls.add_method('DeserializeFromString',
'bool',
[param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_pure_virtual=True, is_virtual=True)
## attribute.h (module 'core'): std::string ns3::AttributeValue::SerializeToString(ns3::Ptr<const ns3::AttributeChecker> checker) const [member function]
cls.add_method('SerializeToString',
'std::string',
[param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_const=True, is_pure_virtual=True, is_virtual=True)
return
def register_Ns3CallbackChecker_methods(root_module, cls):
## callback.h (module 'core'): ns3::CallbackChecker::CallbackChecker() [constructor]
cls.add_constructor([])
## callback.h (module 'core'): ns3::CallbackChecker::CallbackChecker(ns3::CallbackChecker const & arg0) [constructor]
cls.add_constructor([param('ns3::CallbackChecker const &', 'arg0')])
return
def register_Ns3CallbackImplBase_methods(root_module, cls):
## callback.h (module 'core'): ns3::CallbackImplBase::CallbackImplBase() [constructor]
cls.add_constructor([])
## callback.h (module 'core'): ns3::CallbackImplBase::CallbackImplBase(ns3::CallbackImplBase const & arg0) [constructor]
cls.add_constructor([param('ns3::CallbackImplBase const &', 'arg0')])
## callback.h (module 'core'): std::string ns3::CallbackImplBase::GetTypeid() const [member function]
cls.add_method('GetTypeid',
'std::string',
[],
is_const=True, is_pure_virtual=True, is_virtual=True)
## callback.h (module 'core'): bool ns3::CallbackImplBase::IsEqual(ns3::Ptr<const ns3::CallbackImplBase> other) const [member function]
cls.add_method('IsEqual',
'bool',
[param('ns3::Ptr< ns3::CallbackImplBase const >', 'other')],
is_const=True, is_pure_virtual=True, is_virtual=True)
## callback.h (module 'core'): static std::string ns3::CallbackImplBase::Demangle(std::string const & mangled) [member function]
cls.add_method('Demangle',
'std::string',
[param('std::string const &', 'mangled')],
is_static=True, visibility='protected')
## callback.h (module 'core'): static std::string ns3::CallbackImplBase::GetCppTypeid() [member function]
cls.add_method('GetCppTypeid',
'std::string',
[],
is_static=True, template_parameters=['ns3::ObjectBase*'], visibility='protected')
## callback.h (module 'core'): static std::string ns3::CallbackImplBase::GetCppTypeid() [member function]
cls.add_method('GetCppTypeid',
'std::string',
[],
is_static=True, template_parameters=['void'], visibility='protected')
## callback.h (module 'core'): static std::string ns3::CallbackImplBase::GetCppTypeid() [member function]
cls.add_method('GetCppTypeid',
'std::string',
[],
is_static=True, template_parameters=['ns3::Ipv4Address'], visibility='protected')
## callback.h (module 'core'): static std::string ns3::CallbackImplBase::GetCppTypeid() [member function]
cls.add_method('GetCppTypeid',
'std::string',
[],
is_static=True, template_parameters=['unsigned char'], visibility='protected')
## callback.h (module 'core'): static std::string ns3::CallbackImplBase::GetCppTypeid() [member function]
cls.add_method('GetCppTypeid',
'std::string',
[],
is_static=True, template_parameters=['ns3::Ptr<ns3::Socket> '], visibility='protected')
## callback.h (module 'core'): static std::string ns3::CallbackImplBase::GetCppTypeid() [member function]
cls.add_method('GetCppTypeid',
'std::string',
[],
is_static=True, template_parameters=['bool'], visibility='protected')
## callback.h (module 'core'): static std::string ns3::CallbackImplBase::GetCppTypeid() [member function]
cls.add_method('GetCppTypeid',
'std::string',
[],
is_static=True, template_parameters=['ns3::Address const&'], visibility='protected')
## callback.h (module 'core'): static std::string ns3::CallbackImplBase::GetCppTypeid() [member function]
cls.add_method('GetCppTypeid',
'std::string',
[],
is_static=True, template_parameters=['unsigned int'], visibility='protected')
## callback.h (module 'core'): static std::string ns3::CallbackImplBase::GetCppTypeid() [member function]
cls.add_method('GetCppTypeid',
'std::string',
[],
is_static=True, template_parameters=['ns3::Ptr<ns3::NetDevice> '], visibility='protected')
## callback.h (module 'core'): static std::string ns3::CallbackImplBase::GetCppTypeid() [member function]
cls.add_method('GetCppTypeid',
'std::string',
[],
is_static=True, template_parameters=['ns3::Ptr<ns3::Packet const> '], visibility='protected')
## callback.h (module 'core'): static std::string ns3::CallbackImplBase::GetCppTypeid() [member function]
cls.add_method('GetCppTypeid',
'std::string',
[],
is_static=True, template_parameters=['unsigned short'], visibility='protected')
## callback.h (module 'core'): static std::string ns3::CallbackImplBase::GetCppTypeid() [member function]
cls.add_method('GetCppTypeid',
'std::string',
[],
is_static=True, template_parameters=['ns3::NetDevice::PacketType'], visibility='protected')
## callback.h (module 'core'): static std::string ns3::CallbackImplBase::GetCppTypeid() [member function]
cls.add_method('GetCppTypeid',
'std::string',
[],
is_static=True, template_parameters=['ns3::Ipv4Header const&'], visibility='protected')
## callback.h (module 'core'): static std::string ns3::CallbackImplBase::GetCppTypeid() [member function]
cls.add_method('GetCppTypeid',
'std::string',
[],
is_static=True, template_parameters=['ns3::Ptr<ns3::Ipv4> '], visibility='protected')
## callback.h (module 'core'): static std::string ns3::CallbackImplBase::GetCppTypeid() [member function]
cls.add_method('GetCppTypeid',
'std::string',
[],
is_static=True, template_parameters=['ns3::Ipv4L3Protocol::DropReason'], visibility='protected')
## callback.h (module 'core'): static std::string ns3::CallbackImplBase::GetCppTypeid() [member function]
cls.add_method('GetCppTypeid',
'std::string',
[],
is_static=True, template_parameters=['ns3::Ptr<ns3::Packet> '], visibility='protected')
## callback.h (module 'core'): static std::string ns3::CallbackImplBase::GetCppTypeid() [member function]
cls.add_method('GetCppTypeid',
'std::string',
[],
is_static=True, template_parameters=['ns3::Ptr<ns3::Ipv4Route> '], visibility='protected')
## callback.h (module 'core'): static std::string ns3::CallbackImplBase::GetCppTypeid() [member function]
cls.add_method('GetCppTypeid',
'std::string',
[],
is_static=True, template_parameters=['unsigned long'], visibility='protected')
## callback.h (module 'core'): static std::string ns3::CallbackImplBase::GetCppTypeid() [member function]
cls.add_method('GetCppTypeid',
'std::string',
[],
is_static=True, template_parameters=['ns3::Mac48Address'], visibility='protected')
## callback.h (module 'core'): static std::string ns3::CallbackImplBase::GetCppTypeid() [member function]
cls.add_method('GetCppTypeid',
'std::string',
[],
is_static=True, template_parameters=['ns3::dsr::DsrOptionSRHeader const&'], visibility='protected')
return
def register_Ns3CallbackValue_methods(root_module, cls):
## callback.h (module 'core'): ns3::CallbackValue::CallbackValue(ns3::CallbackValue const & arg0) [constructor]
cls.add_constructor([param('ns3::CallbackValue const &', 'arg0')])
## callback.h (module 'core'): ns3::CallbackValue::CallbackValue() [constructor]
cls.add_constructor([])
## callback.h (module 'core'): ns3::CallbackValue::CallbackValue(ns3::CallbackBase const & base) [constructor]
cls.add_constructor([param('ns3::CallbackBase const &', 'base')])
## callback.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::CallbackValue::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::AttributeValue >',
[],
is_const=True, is_virtual=True)
## callback.h (module 'core'): bool ns3::CallbackValue::DeserializeFromString(std::string value, ns3::Ptr<const ns3::AttributeChecker> checker) [member function]
cls.add_method('DeserializeFromString',
'bool',
[param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_virtual=True)
## callback.h (module 'core'): std::string ns3::CallbackValue::SerializeToString(ns3::Ptr<const ns3::AttributeChecker> checker) const [member function]
cls.add_method('SerializeToString',
'std::string',
[param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_const=True, is_virtual=True)
## callback.h (module 'core'): void ns3::CallbackValue::Set(ns3::CallbackBase base) [member function]
cls.add_method('Set',
'void',
[param('ns3::CallbackBase', 'base')])
return
def register_Ns3ConstantRandomVariable_methods(root_module, cls):
## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::ConstantRandomVariable::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## random-variable-stream.h (module 'core'): ns3::ConstantRandomVariable::ConstantRandomVariable() [constructor]
cls.add_constructor([])
## random-variable-stream.h (module 'core'): double ns3::ConstantRandomVariable::GetConstant() const [member function]
cls.add_method('GetConstant',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::ConstantRandomVariable::GetValue(double constant) [member function]
cls.add_method('GetValue',
'double',
[param('double', 'constant')])
## random-variable-stream.h (module 'core'): uint32_t ns3::ConstantRandomVariable::GetInteger(uint32_t constant) [member function]
cls.add_method('GetInteger',
'uint32_t',
[param('uint32_t', 'constant')])
## random-variable-stream.h (module 'core'): double ns3::ConstantRandomVariable::GetValue() [member function]
cls.add_method('GetValue',
'double',
[],
is_virtual=True)
## random-variable-stream.h (module 'core'): uint32_t ns3::ConstantRandomVariable::GetInteger() [member function]
cls.add_method('GetInteger',
'uint32_t',
[],
is_virtual=True)
return
def register_Ns3DataRateChecker_methods(root_module, cls):
## data-rate.h (module 'network'): ns3::DataRateChecker::DataRateChecker() [constructor]
cls.add_constructor([])
## data-rate.h (module 'network'): ns3::DataRateChecker::DataRateChecker(ns3::DataRateChecker const & arg0) [constructor]
cls.add_constructor([param('ns3::DataRateChecker const &', 'arg0')])
return
def register_Ns3DataRateValue_methods(root_module, cls):
## data-rate.h (module 'network'): ns3::DataRateValue::DataRateValue() [constructor]
cls.add_constructor([])
## data-rate.h (module 'network'): ns3::DataRateValue::DataRateValue(ns3::DataRate const & value) [constructor]
cls.add_constructor([param('ns3::DataRate const &', 'value')])
## data-rate.h (module 'network'): ns3::DataRateValue::DataRateValue(ns3::DataRateValue const & arg0) [constructor]
cls.add_constructor([param('ns3::DataRateValue const &', 'arg0')])
## data-rate.h (module 'network'): ns3::Ptr<ns3::AttributeValue> ns3::DataRateValue::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::AttributeValue >',
[],
is_const=True, is_virtual=True)
## data-rate.h (module 'network'): bool ns3::DataRateValue::DeserializeFromString(std::string value, ns3::Ptr<const ns3::AttributeChecker> checker) [member function]
cls.add_method('DeserializeFromString',
'bool',
[param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_virtual=True)
## data-rate.h (module 'network'): ns3::DataRate ns3::DataRateValue::Get() const [member function]
cls.add_method('Get',
'ns3::DataRate',
[],
is_const=True)
## data-rate.h (module 'network'): std::string ns3::DataRateValue::SerializeToString(ns3::Ptr<const ns3::AttributeChecker> checker) const [member function]
cls.add_method('SerializeToString',
'std::string',
[param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_const=True, is_virtual=True)
## data-rate.h (module 'network'): void ns3::DataRateValue::Set(ns3::DataRate const & value) [member function]
cls.add_method('Set',
'void',
[param('ns3::DataRate const &', 'value')])
return
def register_Ns3DeterministicRandomVariable_methods(root_module, cls):
## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::DeterministicRandomVariable::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## random-variable-stream.h (module 'core'): ns3::DeterministicRandomVariable::DeterministicRandomVariable() [constructor]
cls.add_constructor([])
## random-variable-stream.h (module 'core'): void ns3::DeterministicRandomVariable::SetValueArray(double * values, std::size_t length) [member function]
cls.add_method('SetValueArray',
'void',
[param('double *', 'values'), param('std::size_t', 'length')])
## random-variable-stream.h (module 'core'): double ns3::DeterministicRandomVariable::GetValue() [member function]
cls.add_method('GetValue',
'double',
[],
is_virtual=True)
## random-variable-stream.h (module 'core'): uint32_t ns3::DeterministicRandomVariable::GetInteger() [member function]
cls.add_method('GetInteger',
'uint32_t',
[],
is_virtual=True)
return
def register_Ns3EmpiricalRandomVariable_methods(root_module, cls):
## random-variable-stream.h (module 'core'): ns3::EmpiricalRandomVariable::EmpiricalRandomVariable() [constructor]
cls.add_constructor([])
## random-variable-stream.h (module 'core'): void ns3::EmpiricalRandomVariable::CDF(double v, double c) [member function]
cls.add_method('CDF',
'void',
[param('double', 'v'), param('double', 'c')])
## random-variable-stream.h (module 'core'): uint32_t ns3::EmpiricalRandomVariable::GetInteger() [member function]
cls.add_method('GetInteger',
'uint32_t',
[],
is_virtual=True)
## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::EmpiricalRandomVariable::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## random-variable-stream.h (module 'core'): double ns3::EmpiricalRandomVariable::GetValue() [member function]
cls.add_method('GetValue',
'double',
[],
is_virtual=True)
## random-variable-stream.h (module 'core'): double ns3::EmpiricalRandomVariable::Interpolate() [member function]
cls.add_method('Interpolate',
'double',
[],
is_virtual=True)
## random-variable-stream.h (module 'core'): bool ns3::EmpiricalRandomVariable::SetInterpolate(bool interpolate) [member function]
cls.add_method('SetInterpolate',
'bool',
[param('bool', 'interpolate')])
return
def register_Ns3EmptyAttributeAccessor_methods(root_module, cls):
## attribute.h (module 'core'): ns3::EmptyAttributeAccessor::EmptyAttributeAccessor(ns3::EmptyAttributeAccessor const & arg0) [constructor]
cls.add_constructor([param('ns3::EmptyAttributeAccessor const &', 'arg0')])
## attribute.h (module 'core'): ns3::EmptyAttributeAccessor::EmptyAttributeAccessor() [constructor]
cls.add_constructor([])
## attribute.h (module 'core'): bool ns3::EmptyAttributeAccessor::Get(ns3::ObjectBase const * object, ns3::AttributeValue & attribute) const [member function]
cls.add_method('Get',
'bool',
[param('ns3::ObjectBase const *', 'object'), param('ns3::AttributeValue &', 'attribute')],
is_const=True, is_virtual=True)
## attribute.h (module 'core'): bool ns3::EmptyAttributeAccessor::HasGetter() const [member function]
cls.add_method('HasGetter',
'bool',
[],
is_const=True, is_virtual=True)
## attribute.h (module 'core'): bool ns3::EmptyAttributeAccessor::HasSetter() const [member function]
cls.add_method('HasSetter',
'bool',
[],
is_const=True, is_virtual=True)
## attribute.h (module 'core'): bool ns3::EmptyAttributeAccessor::Set(ns3::ObjectBase * object, ns3::AttributeValue const & value) const [member function]
cls.add_method('Set',
'bool',
[param('ns3::ObjectBase *', 'object'), param('ns3::AttributeValue const &', 'value')],
is_const=True, is_virtual=True)
return
def register_Ns3EmptyAttributeChecker_methods(root_module, cls):
## attribute.h (module 'core'): ns3::EmptyAttributeChecker::EmptyAttributeChecker(ns3::EmptyAttributeChecker const & arg0) [constructor]
cls.add_constructor([param('ns3::EmptyAttributeChecker const &', 'arg0')])
## attribute.h (module 'core'): ns3::EmptyAttributeChecker::EmptyAttributeChecker() [constructor]
cls.add_constructor([])
## attribute.h (module 'core'): bool ns3::EmptyAttributeChecker::Check(ns3::AttributeValue const & value) const [member function]
cls.add_method('Check',
'bool',
[param('ns3::AttributeValue const &', 'value')],
is_const=True, is_virtual=True)
## attribute.h (module 'core'): bool ns3::EmptyAttributeChecker::Copy(ns3::AttributeValue const & source, ns3::AttributeValue & destination) const [member function]
cls.add_method('Copy',
'bool',
[param('ns3::AttributeValue const &', 'source'), param('ns3::AttributeValue &', 'destination')],
is_const=True, is_virtual=True)
## attribute.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::EmptyAttributeChecker::Create() const [member function]
cls.add_method('Create',
'ns3::Ptr< ns3::AttributeValue >',
[],
is_const=True, is_virtual=True)
## attribute.h (module 'core'): std::string ns3::EmptyAttributeChecker::GetUnderlyingTypeInformation() const [member function]
cls.add_method('GetUnderlyingTypeInformation',
'std::string',
[],
is_const=True, is_virtual=True)
## attribute.h (module 'core'): std::string ns3::EmptyAttributeChecker::GetValueTypeName() const [member function]
cls.add_method('GetValueTypeName',
'std::string',
[],
is_const=True, is_virtual=True)
## attribute.h (module 'core'): bool ns3::EmptyAttributeChecker::HasUnderlyingTypeInformation() const [member function]
cls.add_method('HasUnderlyingTypeInformation',
'bool',
[],
is_const=True, is_virtual=True)
return
def register_Ns3EmptyAttributeValue_methods(root_module, cls):
## attribute.h (module 'core'): ns3::EmptyAttributeValue::EmptyAttributeValue(ns3::EmptyAttributeValue const & arg0) [constructor]
cls.add_constructor([param('ns3::EmptyAttributeValue const &', 'arg0')])
## attribute.h (module 'core'): ns3::EmptyAttributeValue::EmptyAttributeValue() [constructor]
cls.add_constructor([])
## attribute.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::EmptyAttributeValue::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::AttributeValue >',
[],
is_const=True, is_virtual=True, visibility='private')
## attribute.h (module 'core'): bool ns3::EmptyAttributeValue::DeserializeFromString(std::string value, ns3::Ptr<const ns3::AttributeChecker> checker) [member function]
cls.add_method('DeserializeFromString',
'bool',
[param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_virtual=True, visibility='private')
## attribute.h (module 'core'): std::string ns3::EmptyAttributeValue::SerializeToString(ns3::Ptr<const ns3::AttributeChecker> checker) const [member function]
cls.add_method('SerializeToString',
'std::string',
[param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_const=True, is_virtual=True, visibility='private')
return
def register_Ns3EnumChecker_methods(root_module, cls):
## enum.h (module 'core'): ns3::EnumChecker::EnumChecker(ns3::EnumChecker const & arg0) [constructor]
cls.add_constructor([param('ns3::EnumChecker const &', 'arg0')])
## enum.h (module 'core'): ns3::EnumChecker::EnumChecker() [constructor]
cls.add_constructor([])
## enum.h (module 'core'): void ns3::EnumChecker::Add(int value, std::string name) [member function]
cls.add_method('Add',
'void',
[param('int', 'value'), param('std::string', 'name')])
## enum.h (module 'core'): void ns3::EnumChecker::AddDefault(int value, std::string name) [member function]
cls.add_method('AddDefault',
'void',
[param('int', 'value'), param('std::string', 'name')])
## enum.h (module 'core'): bool ns3::EnumChecker::Check(ns3::AttributeValue const & value) const [member function]
cls.add_method('Check',
'bool',
[param('ns3::AttributeValue const &', 'value')],
is_const=True, is_virtual=True)
## enum.h (module 'core'): bool ns3::EnumChecker::Copy(ns3::AttributeValue const & src, ns3::AttributeValue & dst) const [member function]
cls.add_method('Copy',
'bool',
[param('ns3::AttributeValue const &', 'src'), param('ns3::AttributeValue &', 'dst')],
is_const=True, is_virtual=True)
## enum.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::EnumChecker::Create() const [member function]
cls.add_method('Create',
'ns3::Ptr< ns3::AttributeValue >',
[],
is_const=True, is_virtual=True)
## enum.h (module 'core'): std::string ns3::EnumChecker::GetName(int value) const [member function]
cls.add_method('GetName',
'std::string',
[param('int', 'value')],
is_const=True)
## enum.h (module 'core'): std::string ns3::EnumChecker::GetUnderlyingTypeInformation() const [member function]
cls.add_method('GetUnderlyingTypeInformation',
'std::string',
[],
is_const=True, is_virtual=True)
## enum.h (module 'core'): int ns3::EnumChecker::GetValue(std::string const name) const [member function]
cls.add_method('GetValue',
'int',
[param('std::string const', 'name')],
is_const=True)
## enum.h (module 'core'): std::string ns3::EnumChecker::GetValueTypeName() const [member function]
cls.add_method('GetValueTypeName',
'std::string',
[],
is_const=True, is_virtual=True)
## enum.h (module 'core'): bool ns3::EnumChecker::HasUnderlyingTypeInformation() const [member function]
cls.add_method('HasUnderlyingTypeInformation',
'bool',
[],
is_const=True, is_virtual=True)
return
def register_Ns3EnumValue_methods(root_module, cls):
## enum.h (module 'core'): ns3::EnumValue::EnumValue(ns3::EnumValue const & arg0) [constructor]
cls.add_constructor([param('ns3::EnumValue const &', 'arg0')])
## enum.h (module 'core'): ns3::EnumValue::EnumValue() [constructor]
cls.add_constructor([])
## enum.h (module 'core'): ns3::EnumValue::EnumValue(int value) [constructor]
cls.add_constructor([param('int', 'value')])
## enum.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::EnumValue::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::AttributeValue >',
[],
is_const=True, is_virtual=True)
## enum.h (module 'core'): bool ns3::EnumValue::DeserializeFromString(std::string value, ns3::Ptr<const ns3::AttributeChecker> checker) [member function]
cls.add_method('DeserializeFromString',
'bool',
[param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_virtual=True)
## enum.h (module 'core'): int ns3::EnumValue::Get() const [member function]
cls.add_method('Get',
'int',
[],
is_const=True)
## enum.h (module 'core'): std::string ns3::EnumValue::SerializeToString(ns3::Ptr<const ns3::AttributeChecker> checker) const [member function]
cls.add_method('SerializeToString',
'std::string',
[param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_const=True, is_virtual=True)
## enum.h (module 'core'): void ns3::EnumValue::Set(int value) [member function]
cls.add_method('Set',
'void',
[param('int', 'value')])
return
def register_Ns3ErlangRandomVariable_methods(root_module, cls):
## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::ErlangRandomVariable::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## random-variable-stream.h (module 'core'): ns3::ErlangRandomVariable::ErlangRandomVariable() [constructor]
cls.add_constructor([])
## random-variable-stream.h (module 'core'): uint32_t ns3::ErlangRandomVariable::GetK() const [member function]
cls.add_method('GetK',
'uint32_t',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::ErlangRandomVariable::GetLambda() const [member function]
cls.add_method('GetLambda',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::ErlangRandomVariable::GetValue(uint32_t k, double lambda) [member function]
cls.add_method('GetValue',
'double',
[param('uint32_t', 'k'), param('double', 'lambda')])
## random-variable-stream.h (module 'core'): uint32_t ns3::ErlangRandomVariable::GetInteger(uint32_t k, uint32_t lambda) [member function]
cls.add_method('GetInteger',
'uint32_t',
[param('uint32_t', 'k'), param('uint32_t', 'lambda')])
## random-variable-stream.h (module 'core'): double ns3::ErlangRandomVariable::GetValue() [member function]
cls.add_method('GetValue',
'double',
[],
is_virtual=True)
## random-variable-stream.h (module 'core'): uint32_t ns3::ErlangRandomVariable::GetInteger() [member function]
cls.add_method('GetInteger',
'uint32_t',
[],
is_virtual=True)
return
def register_Ns3EventImpl_methods(root_module, cls):
## event-impl.h (module 'core'): ns3::EventImpl::EventImpl(ns3::EventImpl const & arg0) [constructor]
cls.add_constructor([param('ns3::EventImpl const &', 'arg0')])
## event-impl.h (module 'core'): ns3::EventImpl::EventImpl() [constructor]
cls.add_constructor([])
## event-impl.h (module 'core'): void ns3::EventImpl::Cancel() [member function]
cls.add_method('Cancel',
'void',
[])
## event-impl.h (module 'core'): void ns3::EventImpl::Invoke() [member function]
cls.add_method('Invoke',
'void',
[])
## event-impl.h (module 'core'): bool ns3::EventImpl::IsCancelled() [member function]
cls.add_method('IsCancelled',
'bool',
[])
## event-impl.h (module 'core'): void ns3::EventImpl::Notify() [member function]
cls.add_method('Notify',
'void',
[],
is_pure_virtual=True, is_virtual=True, visibility='protected')
return
def register_Ns3ExponentialRandomVariable_methods(root_module, cls):
## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::ExponentialRandomVariable::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## random-variable-stream.h (module 'core'): ns3::ExponentialRandomVariable::ExponentialRandomVariable() [constructor]
cls.add_constructor([])
## random-variable-stream.h (module 'core'): double ns3::ExponentialRandomVariable::GetMean() const [member function]
cls.add_method('GetMean',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::ExponentialRandomVariable::GetBound() const [member function]
cls.add_method('GetBound',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::ExponentialRandomVariable::GetValue(double mean, double bound) [member function]
cls.add_method('GetValue',
'double',
[param('double', 'mean'), param('double', 'bound')])
## random-variable-stream.h (module 'core'): uint32_t ns3::ExponentialRandomVariable::GetInteger(uint32_t mean, uint32_t bound) [member function]
cls.add_method('GetInteger',
'uint32_t',
[param('uint32_t', 'mean'), param('uint32_t', 'bound')])
## random-variable-stream.h (module 'core'): double ns3::ExponentialRandomVariable::GetValue() [member function]
cls.add_method('GetValue',
'double',
[],
is_virtual=True)
## random-variable-stream.h (module 'core'): uint32_t ns3::ExponentialRandomVariable::GetInteger() [member function]
cls.add_method('GetInteger',
'uint32_t',
[],
is_virtual=True)
return
def register_Ns3GammaRandomVariable_methods(root_module, cls):
## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::GammaRandomVariable::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## random-variable-stream.h (module 'core'): ns3::GammaRandomVariable::GammaRandomVariable() [constructor]
cls.add_constructor([])
## random-variable-stream.h (module 'core'): double ns3::GammaRandomVariable::GetAlpha() const [member function]
cls.add_method('GetAlpha',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::GammaRandomVariable::GetBeta() const [member function]
cls.add_method('GetBeta',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::GammaRandomVariable::GetValue(double alpha, double beta) [member function]
cls.add_method('GetValue',
'double',
[param('double', 'alpha'), param('double', 'beta')])
## random-variable-stream.h (module 'core'): uint32_t ns3::GammaRandomVariable::GetInteger(uint32_t alpha, uint32_t beta) [member function]
cls.add_method('GetInteger',
'uint32_t',
[param('uint32_t', 'alpha'), param('uint32_t', 'beta')])
## random-variable-stream.h (module 'core'): double ns3::GammaRandomVariable::GetValue() [member function]
cls.add_method('GetValue',
'double',
[],
is_virtual=True)
## random-variable-stream.h (module 'core'): uint32_t ns3::GammaRandomVariable::GetInteger() [member function]
cls.add_method('GetInteger',
'uint32_t',
[],
is_virtual=True)
return
def register_Ns3HeCapabilities_methods(root_module, cls):
cls.add_output_stream_operator()
## he-capabilities.h (module 'wifi'): ns3::HeCapabilities::HeCapabilities(ns3::HeCapabilities const & arg0) [constructor]
cls.add_constructor([param('ns3::HeCapabilities const &', 'arg0')])
## he-capabilities.h (module 'wifi'): ns3::HeCapabilities::HeCapabilities() [constructor]
cls.add_constructor([])
## he-capabilities.h (module 'wifi'): uint8_t ns3::HeCapabilities::DeserializeInformationField(ns3::Buffer::Iterator start, uint8_t length) [member function]
cls.add_method('DeserializeInformationField',
'uint8_t',
[param('ns3::Buffer::Iterator', 'start'), param('uint8_t', 'length')],
is_virtual=True)
## he-capabilities.h (module 'wifi'): ns3::WifiInformationElementId ns3::HeCapabilities::ElementId() const [member function]
cls.add_method('ElementId',
'ns3::WifiInformationElementId',
[],
is_const=True, is_virtual=True)
## he-capabilities.h (module 'wifi'): ns3::WifiInformationElementId ns3::HeCapabilities::ElementIdExt() const [member function]
cls.add_method('ElementIdExt',
'ns3::WifiInformationElementId',
[],
is_const=True, is_virtual=True)
## he-capabilities.h (module 'wifi'): uint8_t ns3::HeCapabilities::GetChannelWidthSet() const [member function]
cls.add_method('GetChannelWidthSet',
'uint8_t',
[],
is_const=True)
## he-capabilities.h (module 'wifi'): uint8_t ns3::HeCapabilities::GetHeLtfAndGiForHePpdus() const [member function]
cls.add_method('GetHeLtfAndGiForHePpdus',
'uint8_t',
[],
is_const=True)
## he-capabilities.h (module 'wifi'): uint32_t ns3::HeCapabilities::GetHeMacCapabilitiesInfo1() const [member function]
cls.add_method('GetHeMacCapabilitiesInfo1',
'uint32_t',
[],
is_const=True)
## he-capabilities.h (module 'wifi'): uint8_t ns3::HeCapabilities::GetHeMacCapabilitiesInfo2() const [member function]
cls.add_method('GetHeMacCapabilitiesInfo2',
'uint8_t',
[],
is_const=True)
## he-capabilities.h (module 'wifi'): uint64_t ns3::HeCapabilities::GetHePhyCapabilitiesInfo1() const [member function]
cls.add_method('GetHePhyCapabilitiesInfo1',
'uint64_t',
[],
is_const=True)
## he-capabilities.h (module 'wifi'): uint8_t ns3::HeCapabilities::GetHePhyCapabilitiesInfo2() const [member function]
cls.add_method('GetHePhyCapabilitiesInfo2',
'uint8_t',
[],
is_const=True)
## he-capabilities.h (module 'wifi'): uint8_t ns3::HeCapabilities::GetHighestMcsSupported() const [member function]
cls.add_method('GetHighestMcsSupported',
'uint8_t',
[],
is_const=True)
## he-capabilities.h (module 'wifi'): uint8_t ns3::HeCapabilities::GetHighestNssSupported() const [member function]
cls.add_method('GetHighestNssSupported',
'uint8_t',
[],
is_const=True)
## he-capabilities.h (module 'wifi'): uint8_t ns3::HeCapabilities::GetInformationFieldSize() const [member function]
cls.add_method('GetInformationFieldSize',
'uint8_t',
[],
is_const=True, is_virtual=True)
## he-capabilities.h (module 'wifi'): uint8_t ns3::HeCapabilities::GetLdpcCodingInPayload() const [member function]
cls.add_method('GetLdpcCodingInPayload',
'uint8_t',
[],
is_const=True)
## he-capabilities.h (module 'wifi'): uint32_t ns3::HeCapabilities::GetMaxAmpduLength() const [member function]
cls.add_method('GetMaxAmpduLength',
'uint32_t',
[],
is_const=True)
## he-capabilities.h (module 'wifi'): uint16_t ns3::HeCapabilities::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint16_t',
[],
is_const=True, is_virtual=True)
## he-capabilities.h (module 'wifi'): uint16_t ns3::HeCapabilities::GetSupportedMcsAndNss() const [member function]
cls.add_method('GetSupportedMcsAndNss',
'uint16_t',
[],
is_const=True)
## he-capabilities.h (module 'wifi'): bool ns3::HeCapabilities::IsSupportedRxMcs(uint8_t mcs) const [member function]
cls.add_method('IsSupportedRxMcs',
'bool',
[param('uint8_t', 'mcs')],
is_const=True)
## he-capabilities.h (module 'wifi'): bool ns3::HeCapabilities::IsSupportedTxMcs(uint8_t mcs) const [member function]
cls.add_method('IsSupportedTxMcs',
'bool',
[param('uint8_t', 'mcs')],
is_const=True)
## he-capabilities.h (module 'wifi'): ns3::Buffer::Iterator ns3::HeCapabilities::Serialize(ns3::Buffer::Iterator start) const [member function]
cls.add_method('Serialize',
'ns3::Buffer::Iterator',
[param('ns3::Buffer::Iterator', 'start')],
is_const=True, is_virtual=True)
## he-capabilities.h (module 'wifi'): void ns3::HeCapabilities::SerializeInformationField(ns3::Buffer::Iterator start) const [member function]
cls.add_method('SerializeInformationField',
'void',
[param('ns3::Buffer::Iterator', 'start')],
is_const=True, is_virtual=True)
## he-capabilities.h (module 'wifi'): void ns3::HeCapabilities::SetChannelWidthSet(uint8_t channelWidthSet) [member function]
cls.add_method('SetChannelWidthSet',
'void',
[param('uint8_t', 'channelWidthSet')])
## he-capabilities.h (module 'wifi'): void ns3::HeCapabilities::SetHeLtfAndGiForHePpdus(uint8_t heLtfAndGiForHePpdus) [member function]
cls.add_method('SetHeLtfAndGiForHePpdus',
'void',
[param('uint8_t', 'heLtfAndGiForHePpdus')])
## he-capabilities.h (module 'wifi'): void ns3::HeCapabilities::SetHeMacCapabilitiesInfo(uint32_t ctrl1, uint8_t ctrl2) [member function]
cls.add_method('SetHeMacCapabilitiesInfo',
'void',
[param('uint32_t', 'ctrl1'), param('uint8_t', 'ctrl2')])
## he-capabilities.h (module 'wifi'): void ns3::HeCapabilities::SetHePhyCapabilitiesInfo(uint64_t ctrl1, uint8_t ctrl2) [member function]
cls.add_method('SetHePhyCapabilitiesInfo',
'void',
[param('uint64_t', 'ctrl1'), param('uint8_t', 'ctrl2')])
## he-capabilities.h (module 'wifi'): void ns3::HeCapabilities::SetHeSupported(uint8_t heSupported) [member function]
cls.add_method('SetHeSupported',
'void',
[param('uint8_t', 'heSupported')])
## he-capabilities.h (module 'wifi'): void ns3::HeCapabilities::SetHighestMcsSupported(uint8_t mcs) [member function]
cls.add_method('SetHighestMcsSupported',
'void',
[param('uint8_t', 'mcs')])
## he-capabilities.h (module 'wifi'): void ns3::HeCapabilities::SetHighestNssSupported(uint8_t nss) [member function]
cls.add_method('SetHighestNssSupported',
'void',
[param('uint8_t', 'nss')])
## he-capabilities.h (module 'wifi'): void ns3::HeCapabilities::SetLdpcCodingInPayload(uint8_t ldpcCodingInPayload) [member function]
cls.add_method('SetLdpcCodingInPayload',
'void',
[param('uint8_t', 'ldpcCodingInPayload')])
## he-capabilities.h (module 'wifi'): void ns3::HeCapabilities::SetMaxAmpduLength(uint32_t maxAmpduLength) [member function]
cls.add_method('SetMaxAmpduLength',
'void',
[param('uint32_t', 'maxAmpduLength')])
## he-capabilities.h (module 'wifi'): void ns3::HeCapabilities::SetSupportedMcsAndNss(uint16_t ctrl) [member function]
cls.add_method('SetSupportedMcsAndNss',
'void',
[param('uint16_t', 'ctrl')])
return
def register_Ns3HtCapabilities_methods(root_module, cls):
cls.add_output_stream_operator()
## ht-capabilities.h (module 'wifi'): ns3::HtCapabilities::HtCapabilities(ns3::HtCapabilities const & arg0) [constructor]
cls.add_constructor([param('ns3::HtCapabilities const &', 'arg0')])
## ht-capabilities.h (module 'wifi'): ns3::HtCapabilities::HtCapabilities() [constructor]
cls.add_constructor([])
## ht-capabilities.h (module 'wifi'): uint8_t ns3::HtCapabilities::DeserializeInformationField(ns3::Buffer::Iterator start, uint8_t length) [member function]
cls.add_method('DeserializeInformationField',
'uint8_t',
[param('ns3::Buffer::Iterator', 'start'), param('uint8_t', 'length')],
is_virtual=True)
## ht-capabilities.h (module 'wifi'): ns3::WifiInformationElementId ns3::HtCapabilities::ElementId() const [member function]
cls.add_method('ElementId',
'ns3::WifiInformationElementId',
[],
is_const=True, is_virtual=True)
## ht-capabilities.h (module 'wifi'): uint8_t ns3::HtCapabilities::GetAmpduParameters() const [member function]
cls.add_method('GetAmpduParameters',
'uint8_t',
[],
is_const=True)
## ht-capabilities.h (module 'wifi'): uint8_t ns3::HtCapabilities::GetAntennaSelectionCapabilities() const [member function]
cls.add_method('GetAntennaSelectionCapabilities',
'uint8_t',
[],
is_const=True)
## ht-capabilities.h (module 'wifi'): uint16_t ns3::HtCapabilities::GetExtendedHtCapabilities() const [member function]
cls.add_method('GetExtendedHtCapabilities',
'uint16_t',
[],
is_const=True)
## ht-capabilities.h (module 'wifi'): uint16_t ns3::HtCapabilities::GetHtCapabilitiesInfo() const [member function]
cls.add_method('GetHtCapabilitiesInfo',
'uint16_t',
[],
is_const=True)
## ht-capabilities.h (module 'wifi'): uint8_t ns3::HtCapabilities::GetInformationFieldSize() const [member function]
cls.add_method('GetInformationFieldSize',
'uint8_t',
[],
is_const=True, is_virtual=True)
## ht-capabilities.h (module 'wifi'): uint8_t ns3::HtCapabilities::GetLdpc() const [member function]
cls.add_method('GetLdpc',
'uint8_t',
[],
is_const=True)
## ht-capabilities.h (module 'wifi'): uint32_t ns3::HtCapabilities::GetMaxAmpduLength() const [member function]
cls.add_method('GetMaxAmpduLength',
'uint32_t',
[],
is_const=True)
## ht-capabilities.h (module 'wifi'): uint16_t ns3::HtCapabilities::GetMaxAmsduLength() const [member function]
cls.add_method('GetMaxAmsduLength',
'uint16_t',
[],
is_const=True)
## ht-capabilities.h (module 'wifi'): uint8_t ns3::HtCapabilities::GetRxHighestSupportedAntennas() const [member function]
cls.add_method('GetRxHighestSupportedAntennas',
'uint8_t',
[],
is_const=True)
## ht-capabilities.h (module 'wifi'): uint16_t ns3::HtCapabilities::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint16_t',
[],
is_const=True, is_virtual=True)
## ht-capabilities.h (module 'wifi'): uint8_t ns3::HtCapabilities::GetShortGuardInterval20() const [member function]
cls.add_method('GetShortGuardInterval20',
'uint8_t',
[],
is_const=True)
## ht-capabilities.h (module 'wifi'): uint8_t ns3::HtCapabilities::GetSupportedChannelWidth() const [member function]
cls.add_method('GetSupportedChannelWidth',
'uint8_t',
[],
is_const=True)
## ht-capabilities.h (module 'wifi'): uint64_t ns3::HtCapabilities::GetSupportedMcsSet1() const [member function]
cls.add_method('GetSupportedMcsSet1',
'uint64_t',
[],
is_const=True)
## ht-capabilities.h (module 'wifi'): uint64_t ns3::HtCapabilities::GetSupportedMcsSet2() const [member function]
cls.add_method('GetSupportedMcsSet2',
'uint64_t',
[],
is_const=True)
## ht-capabilities.h (module 'wifi'): uint32_t ns3::HtCapabilities::GetTxBfCapabilities() const [member function]
cls.add_method('GetTxBfCapabilities',
'uint32_t',
[],
is_const=True)
## ht-capabilities.h (module 'wifi'): bool ns3::HtCapabilities::IsSupportedMcs(uint8_t mcs) const [member function]
cls.add_method('IsSupportedMcs',
'bool',
[param('uint8_t', 'mcs')],
is_const=True)
## ht-capabilities.h (module 'wifi'): ns3::Buffer::Iterator ns3::HtCapabilities::Serialize(ns3::Buffer::Iterator start) const [member function]
cls.add_method('Serialize',
'ns3::Buffer::Iterator',
[param('ns3::Buffer::Iterator', 'start')],
is_const=True, is_virtual=True)
## ht-capabilities.h (module 'wifi'): void ns3::HtCapabilities::SerializeInformationField(ns3::Buffer::Iterator start) const [member function]
cls.add_method('SerializeInformationField',
'void',
[param('ns3::Buffer::Iterator', 'start')],
is_const=True, is_virtual=True)
## ht-capabilities.h (module 'wifi'): void ns3::HtCapabilities::SetAmpduParameters(uint8_t ctrl) [member function]
cls.add_method('SetAmpduParameters',
'void',
[param('uint8_t', 'ctrl')])
## ht-capabilities.h (module 'wifi'): void ns3::HtCapabilities::SetAntennaSelectionCapabilities(uint8_t ctrl) [member function]
cls.add_method('SetAntennaSelectionCapabilities',
'void',
[param('uint8_t', 'ctrl')])
## ht-capabilities.h (module 'wifi'): void ns3::HtCapabilities::SetExtendedHtCapabilities(uint16_t ctrl) [member function]
cls.add_method('SetExtendedHtCapabilities',
'void',
[param('uint16_t', 'ctrl')])
## ht-capabilities.h (module 'wifi'): void ns3::HtCapabilities::SetHtCapabilitiesInfo(uint16_t ctrl) [member function]
cls.add_method('SetHtCapabilitiesInfo',
'void',
[param('uint16_t', 'ctrl')])
## ht-capabilities.h (module 'wifi'): void ns3::HtCapabilities::SetHtSupported(uint8_t htSupported) [member function]
cls.add_method('SetHtSupported',
'void',
[param('uint8_t', 'htSupported')])
## ht-capabilities.h (module 'wifi'): void ns3::HtCapabilities::SetLSigProtectionSupport(uint8_t lSigProtection) [member function]
cls.add_method('SetLSigProtectionSupport',
'void',
[param('uint8_t', 'lSigProtection')])
## ht-capabilities.h (module 'wifi'): void ns3::HtCapabilities::SetLdpc(uint8_t ldpc) [member function]
cls.add_method('SetLdpc',
'void',
[param('uint8_t', 'ldpc')])
## ht-capabilities.h (module 'wifi'): void ns3::HtCapabilities::SetMaxAmpduLength(uint32_t maxAmpduLength) [member function]
cls.add_method('SetMaxAmpduLength',
'void',
[param('uint32_t', 'maxAmpduLength')])
## ht-capabilities.h (module 'wifi'): void ns3::HtCapabilities::SetMaxAmsduLength(uint16_t maxAmsduLength) [member function]
cls.add_method('SetMaxAmsduLength',
'void',
[param('uint16_t', 'maxAmsduLength')])
## ht-capabilities.h (module 'wifi'): void ns3::HtCapabilities::SetRxHighestSupportedDataRate(uint16_t maxSupportedRate) [member function]
cls.add_method('SetRxHighestSupportedDataRate',
'void',
[param('uint16_t', 'maxSupportedRate')])
## ht-capabilities.h (module 'wifi'): void ns3::HtCapabilities::SetRxMcsBitmask(uint8_t index) [member function]
cls.add_method('SetRxMcsBitmask',
'void',
[param('uint8_t', 'index')])
## ht-capabilities.h (module 'wifi'): void ns3::HtCapabilities::SetShortGuardInterval20(uint8_t shortGuardInterval) [member function]
cls.add_method('SetShortGuardInterval20',
'void',
[param('uint8_t', 'shortGuardInterval')])
## ht-capabilities.h (module 'wifi'): void ns3::HtCapabilities::SetShortGuardInterval40(uint8_t shortGuardInterval) [member function]
cls.add_method('SetShortGuardInterval40',
'void',
[param('uint8_t', 'shortGuardInterval')])
## ht-capabilities.h (module 'wifi'): void ns3::HtCapabilities::SetSupportedChannelWidth(uint8_t supportedChannelWidth) [member function]
cls.add_method('SetSupportedChannelWidth',
'void',
[param('uint8_t', 'supportedChannelWidth')])
## ht-capabilities.h (module 'wifi'): void ns3::HtCapabilities::SetSupportedMcsSet(uint64_t ctrl1, uint64_t ctrl2) [member function]
cls.add_method('SetSupportedMcsSet',
'void',
[param('uint64_t', 'ctrl1'), param('uint64_t', 'ctrl2')])
## ht-capabilities.h (module 'wifi'): void ns3::HtCapabilities::SetTxBfCapabilities(uint32_t ctrl) [member function]
cls.add_method('SetTxBfCapabilities',
'void',
[param('uint32_t', 'ctrl')])
## ht-capabilities.h (module 'wifi'): void ns3::HtCapabilities::SetTxMaxNSpatialStreams(uint8_t maxTxSpatialStreams) [member function]
cls.add_method('SetTxMaxNSpatialStreams',
'void',
[param('uint8_t', 'maxTxSpatialStreams')])
## ht-capabilities.h (module 'wifi'): void ns3::HtCapabilities::SetTxMcsSetDefined(uint8_t txMcsSetDefined) [member function]
cls.add_method('SetTxMcsSetDefined',
'void',
[param('uint8_t', 'txMcsSetDefined')])
## ht-capabilities.h (module 'wifi'): void ns3::HtCapabilities::SetTxRxMcsSetUnequal(uint8_t txRxMcsSetUnequal) [member function]
cls.add_method('SetTxRxMcsSetUnequal',
'void',
[param('uint8_t', 'txRxMcsSetUnequal')])
## ht-capabilities.h (module 'wifi'): void ns3::HtCapabilities::SetTxUnequalModulation(uint8_t txUnequalModulation) [member function]
cls.add_method('SetTxUnequalModulation',
'void',
[param('uint8_t', 'txUnequalModulation')])
return
def register_Ns3IpL4Protocol_methods(root_module, cls):
## ip-l4-protocol.h (module 'internet'): ns3::IpL4Protocol::IpL4Protocol() [constructor]
cls.add_constructor([])
## ip-l4-protocol.h (module 'internet'): ns3::IpL4Protocol::IpL4Protocol(ns3::IpL4Protocol const & arg0) [constructor]
cls.add_constructor([param('ns3::IpL4Protocol const &', 'arg0')])
## ip-l4-protocol.h (module 'internet'): ns3::IpL4Protocol::DownTargetCallback ns3::IpL4Protocol::GetDownTarget() const [member function]
cls.add_method('GetDownTarget',
'ns3::IpL4Protocol::DownTargetCallback',
[],
is_const=True, is_pure_virtual=True, is_virtual=True)
## ip-l4-protocol.h (module 'internet'): ns3::IpL4Protocol::DownTargetCallback6 ns3::IpL4Protocol::GetDownTarget6() const [member function]
cls.add_method('GetDownTarget6',
'ns3::IpL4Protocol::DownTargetCallback6',
[],
is_const=True, is_pure_virtual=True, is_virtual=True)
## ip-l4-protocol.h (module 'internet'): int ns3::IpL4Protocol::GetProtocolNumber() const [member function]
cls.add_method('GetProtocolNumber',
'int',
[],
is_const=True, is_pure_virtual=True, is_virtual=True)
## ip-l4-protocol.h (module 'internet'): static ns3::TypeId ns3::IpL4Protocol::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## ip-l4-protocol.h (module 'internet'): ns3::IpL4Protocol::RxStatus ns3::IpL4Protocol::Receive(ns3::Ptr<ns3::Packet> p, ns3::Ipv4Header const & header, ns3::Ptr<ns3::Ipv4Interface> incomingInterface) [member function]
cls.add_method('Receive',
'ns3::IpL4Protocol::RxStatus',
[param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ipv4Header const &', 'header'), param('ns3::Ptr< ns3::Ipv4Interface >', 'incomingInterface')],
is_pure_virtual=True, is_virtual=True)
## ip-l4-protocol.h (module 'internet'): ns3::IpL4Protocol::RxStatus ns3::IpL4Protocol::Receive(ns3::Ptr<ns3::Packet> p, ns3::Ipv6Header const & header, ns3::Ptr<ns3::Ipv6Interface> incomingInterface) [member function]
cls.add_method('Receive',
'ns3::IpL4Protocol::RxStatus',
[param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ipv6Header const &', 'header'), param('ns3::Ptr< ns3::Ipv6Interface >', 'incomingInterface')],
is_pure_virtual=True, is_virtual=True)
## ip-l4-protocol.h (module 'internet'): void ns3::IpL4Protocol::ReceiveIcmp(ns3::Ipv4Address icmpSource, uint8_t icmpTtl, uint8_t icmpType, uint8_t icmpCode, uint32_t icmpInfo, ns3::Ipv4Address payloadSource, ns3::Ipv4Address payloadDestination, uint8_t const * payload) [member function]
cls.add_method('ReceiveIcmp',
'void',
[param('ns3::Ipv4Address', 'icmpSource'), param('uint8_t', 'icmpTtl'), param('uint8_t', 'icmpType'), param('uint8_t', 'icmpCode'), param('uint32_t', 'icmpInfo'), param('ns3::Ipv4Address', 'payloadSource'), param('ns3::Ipv4Address', 'payloadDestination'), param('uint8_t const *', 'payload')],
is_virtual=True)
## ip-l4-protocol.h (module 'internet'): void ns3::IpL4Protocol::ReceiveIcmp(ns3::Ipv6Address icmpSource, uint8_t icmpTtl, uint8_t icmpType, uint8_t icmpCode, uint32_t icmpInfo, ns3::Ipv6Address payloadSource, ns3::Ipv6Address payloadDestination, uint8_t const * payload) [member function]
cls.add_method('ReceiveIcmp',
'void',
[param('ns3::Ipv6Address', 'icmpSource'), param('uint8_t', 'icmpTtl'), param('uint8_t', 'icmpType'), param('uint8_t', 'icmpCode'), param('uint32_t', 'icmpInfo'), param('ns3::Ipv6Address', 'payloadSource'), param('ns3::Ipv6Address', 'payloadDestination'), param('uint8_t const *', 'payload')],
is_virtual=True)
## ip-l4-protocol.h (module 'internet'): void ns3::IpL4Protocol::SetDownTarget(ns3::IpL4Protocol::DownTargetCallback cb) [member function]
cls.add_method('SetDownTarget',
'void',
[param('ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::Ipv4Address, ns3::Ipv4Address, unsigned char, ns3::Ptr< ns3::Ipv4Route >, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'cb')],
is_pure_virtual=True, is_virtual=True)
## ip-l4-protocol.h (module 'internet'): void ns3::IpL4Protocol::SetDownTarget6(ns3::IpL4Protocol::DownTargetCallback6 cb) [member function]
cls.add_method('SetDownTarget6',
'void',
[param('ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::Ipv6Address, ns3::Ipv6Address, unsigned char, ns3::Ptr< ns3::Ipv6Route >, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'cb')],
is_pure_virtual=True, is_virtual=True)
return
def register_Ns3Ipv4_methods(root_module, cls):
## ipv4.h (module 'internet'): ns3::Ipv4::Ipv4(ns3::Ipv4 const & arg0) [constructor]
cls.add_constructor([param('ns3::Ipv4 const &', 'arg0')])
## ipv4.h (module 'internet'): ns3::Ipv4::Ipv4() [constructor]
cls.add_constructor([])
## ipv4.h (module 'internet'): bool ns3::Ipv4::AddAddress(uint32_t interface, ns3::Ipv4InterfaceAddress address) [member function]
cls.add_method('AddAddress',
'bool',
[param('uint32_t', 'interface'), param('ns3::Ipv4InterfaceAddress', 'address')],
is_pure_virtual=True, is_virtual=True)
## ipv4.h (module 'internet'): uint32_t ns3::Ipv4::AddInterface(ns3::Ptr<ns3::NetDevice> device) [member function]
cls.add_method('AddInterface',
'uint32_t',
[param('ns3::Ptr< ns3::NetDevice >', 'device')],
is_pure_virtual=True, is_virtual=True)
## ipv4.h (module 'internet'): ns3::Ptr<ns3::Socket> ns3::Ipv4::CreateRawSocket() [member function]
cls.add_method('CreateRawSocket',
'ns3::Ptr< ns3::Socket >',
[],
is_pure_virtual=True, is_virtual=True)
## ipv4.h (module 'internet'): void ns3::Ipv4::DeleteRawSocket(ns3::Ptr<ns3::Socket> socket) [member function]
cls.add_method('DeleteRawSocket',
'void',
[param('ns3::Ptr< ns3::Socket >', 'socket')],
is_pure_virtual=True, is_virtual=True)
## ipv4.h (module 'internet'): ns3::Ipv4InterfaceAddress ns3::Ipv4::GetAddress(uint32_t interface, uint32_t addressIndex) const [member function]
cls.add_method('GetAddress',
'ns3::Ipv4InterfaceAddress',
[param('uint32_t', 'interface'), param('uint32_t', 'addressIndex')],
is_const=True, is_pure_virtual=True, is_virtual=True)
## ipv4.h (module 'internet'): int32_t ns3::Ipv4::GetInterfaceForAddress(ns3::Ipv4Address address) const [member function]
cls.add_method('GetInterfaceForAddress',
'int32_t',
[param('ns3::Ipv4Address', 'address')],
is_const=True, is_pure_virtual=True, is_virtual=True)
## ipv4.h (module 'internet'): int32_t ns3::Ipv4::GetInterfaceForDevice(ns3::Ptr<const ns3::NetDevice> device) const [member function]
cls.add_method('GetInterfaceForDevice',
'int32_t',
[param('ns3::Ptr< ns3::NetDevice const >', 'device')],
is_const=True, is_pure_virtual=True, is_virtual=True)
## ipv4.h (module 'internet'): int32_t ns3::Ipv4::GetInterfaceForPrefix(ns3::Ipv4Address address, ns3::Ipv4Mask mask) const [member function]
cls.add_method('GetInterfaceForPrefix',
'int32_t',
[param('ns3::Ipv4Address', 'address'), param('ns3::Ipv4Mask', 'mask')],
is_const=True, is_pure_virtual=True, is_virtual=True)
## ipv4.h (module 'internet'): uint16_t ns3::Ipv4::GetMetric(uint32_t interface) const [member function]
cls.add_method('GetMetric',
'uint16_t',
[param('uint32_t', 'interface')],
is_const=True, is_pure_virtual=True, is_virtual=True)
## ipv4.h (module 'internet'): uint16_t ns3::Ipv4::GetMtu(uint32_t interface) const [member function]
cls.add_method('GetMtu',
'uint16_t',
[param('uint32_t', 'interface')],
is_const=True, is_pure_virtual=True, is_virtual=True)
## ipv4.h (module 'internet'): uint32_t ns3::Ipv4::GetNAddresses(uint32_t interface) const [member function]
cls.add_method('GetNAddresses',
'uint32_t',
[param('uint32_t', 'interface')],
is_const=True, is_pure_virtual=True, is_virtual=True)
## ipv4.h (module 'internet'): uint32_t ns3::Ipv4::GetNInterfaces() const [member function]
cls.add_method('GetNInterfaces',
'uint32_t',
[],
is_const=True, is_pure_virtual=True, is_virtual=True)
## ipv4.h (module 'internet'): ns3::Ptr<ns3::NetDevice> ns3::Ipv4::GetNetDevice(uint32_t interface) [member function]
cls.add_method('GetNetDevice',
'ns3::Ptr< ns3::NetDevice >',
[param('uint32_t', 'interface')],
is_pure_virtual=True, is_virtual=True)
## ipv4.h (module 'internet'): ns3::Ptr<ns3::IpL4Protocol> ns3::Ipv4::GetProtocol(int protocolNumber) const [member function]
cls.add_method('GetProtocol',
'ns3::Ptr< ns3::IpL4Protocol >',
[param('int', 'protocolNumber')],
is_const=True, is_pure_virtual=True, is_virtual=True)
## ipv4.h (module 'internet'): ns3::Ptr<ns3::IpL4Protocol> ns3::Ipv4::GetProtocol(int protocolNumber, int32_t interfaceIndex) const [member function]
cls.add_method('GetProtocol',
'ns3::Ptr< ns3::IpL4Protocol >',
[param('int', 'protocolNumber'), param('int32_t', 'interfaceIndex')],
is_const=True, is_pure_virtual=True, is_virtual=True)
## ipv4.h (module 'internet'): ns3::Ptr<ns3::Ipv4RoutingProtocol> ns3::Ipv4::GetRoutingProtocol() const [member function]
cls.add_method('GetRoutingProtocol',
'ns3::Ptr< ns3::Ipv4RoutingProtocol >',
[],
is_const=True, is_pure_virtual=True, is_virtual=True)
## ipv4.h (module 'internet'): static ns3::TypeId ns3::Ipv4::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## ipv4.h (module 'internet'): void ns3::Ipv4::Insert(ns3::Ptr<ns3::IpL4Protocol> protocol) [member function]
cls.add_method('Insert',
'void',
[param('ns3::Ptr< ns3::IpL4Protocol >', 'protocol')],
is_pure_virtual=True, is_virtual=True)
## ipv4.h (module 'internet'): void ns3::Ipv4::Insert(ns3::Ptr<ns3::IpL4Protocol> protocol, uint32_t interfaceIndex) [member function]
cls.add_method('Insert',
'void',
[param('ns3::Ptr< ns3::IpL4Protocol >', 'protocol'), param('uint32_t', 'interfaceIndex')],
is_pure_virtual=True, is_virtual=True)
## ipv4.h (module 'internet'): bool ns3::Ipv4::IsDestinationAddress(ns3::Ipv4Address address, uint32_t iif) const [member function]
cls.add_method('IsDestinationAddress',
'bool',
[param('ns3::Ipv4Address', 'address'), param('uint32_t', 'iif')],
is_const=True, is_pure_virtual=True, is_virtual=True)
## ipv4.h (module 'internet'): bool ns3::Ipv4::IsForwarding(uint32_t interface) const [member function]
cls.add_method('IsForwarding',
'bool',
[param('uint32_t', 'interface')],
is_const=True, is_pure_virtual=True, is_virtual=True)
## ipv4.h (module 'internet'): bool ns3::Ipv4::IsUp(uint32_t interface) const [member function]
cls.add_method('IsUp',
'bool',
[param('uint32_t', 'interface')],
is_const=True, is_pure_virtual=True, is_virtual=True)
## ipv4.h (module 'internet'): void ns3::Ipv4::Remove(ns3::Ptr<ns3::IpL4Protocol> protocol) [member function]
cls.add_method('Remove',
'void',
[param('ns3::Ptr< ns3::IpL4Protocol >', 'protocol')],
is_pure_virtual=True, is_virtual=True)
## ipv4.h (module 'internet'): void ns3::Ipv4::Remove(ns3::Ptr<ns3::IpL4Protocol> protocol, uint32_t interfaceIndex) [member function]
cls.add_method('Remove',
'void',
[param('ns3::Ptr< ns3::IpL4Protocol >', 'protocol'), param('uint32_t', 'interfaceIndex')],
is_pure_virtual=True, is_virtual=True)
## ipv4.h (module 'internet'): bool ns3::Ipv4::RemoveAddress(uint32_t interface, uint32_t addressIndex) [member function]
cls.add_method('RemoveAddress',
'bool',
[param('uint32_t', 'interface'), param('uint32_t', 'addressIndex')],
is_pure_virtual=True, is_virtual=True)
## ipv4.h (module 'internet'): bool ns3::Ipv4::RemoveAddress(uint32_t interface, ns3::Ipv4Address address) [member function]
cls.add_method('RemoveAddress',
'bool',
[param('uint32_t', 'interface'), param('ns3::Ipv4Address', 'address')],
is_pure_virtual=True, is_virtual=True)
## ipv4.h (module 'internet'): ns3::Ipv4Address ns3::Ipv4::SelectSourceAddress(ns3::Ptr<const ns3::NetDevice> device, ns3::Ipv4Address dst, ns3::Ipv4InterfaceAddress::InterfaceAddressScope_e scope) [member function]
cls.add_method('SelectSourceAddress',
'ns3::Ipv4Address',
[param('ns3::Ptr< ns3::NetDevice const >', 'device'), param('ns3::Ipv4Address', 'dst'), param('ns3::Ipv4InterfaceAddress::InterfaceAddressScope_e', 'scope')],
is_pure_virtual=True, is_virtual=True)
## ipv4.h (module 'internet'): void ns3::Ipv4::Send(ns3::Ptr<ns3::Packet> packet, ns3::Ipv4Address source, ns3::Ipv4Address destination, uint8_t protocol, ns3::Ptr<ns3::Ipv4Route> route) [member function]
cls.add_method('Send',
'void',
[param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Address', 'destination'), param('uint8_t', 'protocol'), param('ns3::Ptr< ns3::Ipv4Route >', 'route')],
is_pure_virtual=True, is_virtual=True)
## ipv4.h (module 'internet'): void ns3::Ipv4::SendWithHeader(ns3::Ptr<ns3::Packet> packet, ns3::Ipv4Header ipHeader, ns3::Ptr<ns3::Ipv4Route> route) [member function]
cls.add_method('SendWithHeader',
'void',
[param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ipv4Header', 'ipHeader'), param('ns3::Ptr< ns3::Ipv4Route >', 'route')],
is_pure_virtual=True, is_virtual=True)
## ipv4.h (module 'internet'): void ns3::Ipv4::SetDown(uint32_t interface) [member function]
cls.add_method('SetDown',
'void',
[param('uint32_t', 'interface')],
is_pure_virtual=True, is_virtual=True)
## ipv4.h (module 'internet'): void ns3::Ipv4::SetForwarding(uint32_t interface, bool val) [member function]
cls.add_method('SetForwarding',
'void',
[param('uint32_t', 'interface'), param('bool', 'val')],
is_pure_virtual=True, is_virtual=True)
## ipv4.h (module 'internet'): void ns3::Ipv4::SetMetric(uint32_t interface, uint16_t metric) [member function]
cls.add_method('SetMetric',
'void',
[param('uint32_t', 'interface'), param('uint16_t', 'metric')],
is_pure_virtual=True, is_virtual=True)
## ipv4.h (module 'internet'): void ns3::Ipv4::SetRoutingProtocol(ns3::Ptr<ns3::Ipv4RoutingProtocol> routingProtocol) [member function]
cls.add_method('SetRoutingProtocol',
'void',
[param('ns3::Ptr< ns3::Ipv4RoutingProtocol >', 'routingProtocol')],
is_pure_virtual=True, is_virtual=True)
## ipv4.h (module 'internet'): void ns3::Ipv4::SetUp(uint32_t interface) [member function]
cls.add_method('SetUp',
'void',
[param('uint32_t', 'interface')],
is_pure_virtual=True, is_virtual=True)
## ipv4.h (module 'internet'): ns3::Ipv4Address ns3::Ipv4::SourceAddressSelection(uint32_t interface, ns3::Ipv4Address dest) [member function]
cls.add_method('SourceAddressSelection',
'ns3::Ipv4Address',
[param('uint32_t', 'interface'), param('ns3::Ipv4Address', 'dest')],
is_pure_virtual=True, is_virtual=True)
## ipv4.h (module 'internet'): ns3::Ipv4::IF_ANY [variable]
cls.add_static_attribute('IF_ANY', 'uint32_t const', is_const=True)
## ipv4.h (module 'internet'): bool ns3::Ipv4::GetIpForward() const [member function]
cls.add_method('GetIpForward',
'bool',
[],
is_const=True, is_pure_virtual=True, is_virtual=True, visibility='private')
## ipv4.h (module 'internet'): bool ns3::Ipv4::GetWeakEsModel() const [member function]
cls.add_method('GetWeakEsModel',
'bool',
[],
is_const=True, is_pure_virtual=True, is_virtual=True, visibility='private')
## ipv4.h (module 'internet'): void ns3::Ipv4::SetIpForward(bool forward) [member function]
cls.add_method('SetIpForward',
'void',
[param('bool', 'forward')],
is_pure_virtual=True, is_virtual=True, visibility='private')
## ipv4.h (module 'internet'): void ns3::Ipv4::SetWeakEsModel(bool model) [member function]
cls.add_method('SetWeakEsModel',
'void',
[param('bool', 'model')],
is_pure_virtual=True, is_virtual=True, visibility='private')
return
def register_Ns3Ipv4AddressChecker_methods(root_module, cls):
## ipv4-address.h (module 'network'): ns3::Ipv4AddressChecker::Ipv4AddressChecker() [constructor]
cls.add_constructor([])
## ipv4-address.h (module 'network'): ns3::Ipv4AddressChecker::Ipv4AddressChecker(ns3::Ipv4AddressChecker const & arg0) [constructor]
cls.add_constructor([param('ns3::Ipv4AddressChecker const &', 'arg0')])
return
def register_Ns3Ipv4AddressValue_methods(root_module, cls):
## ipv4-address.h (module 'network'): ns3::Ipv4AddressValue::Ipv4AddressValue() [constructor]
cls.add_constructor([])
## ipv4-address.h (module 'network'): ns3::Ipv4AddressValue::Ipv4AddressValue(ns3::Ipv4Address const & value) [constructor]
cls.add_constructor([param('ns3::Ipv4Address const &', 'value')])
## ipv4-address.h (module 'network'): ns3::Ipv4AddressValue::Ipv4AddressValue(ns3::Ipv4AddressValue const & arg0) [constructor]
cls.add_constructor([param('ns3::Ipv4AddressValue const &', 'arg0')])
## ipv4-address.h (module 'network'): ns3::Ptr<ns3::AttributeValue> ns3::Ipv4AddressValue::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::AttributeValue >',
[],
is_const=True, is_virtual=True)
## ipv4-address.h (module 'network'): bool ns3::Ipv4AddressValue::DeserializeFromString(std::string value, ns3::Ptr<const ns3::AttributeChecker> checker) [member function]
cls.add_method('DeserializeFromString',
'bool',
[param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_virtual=True)
## ipv4-address.h (module 'network'): ns3::Ipv4Address ns3::Ipv4AddressValue::Get() const [member function]
cls.add_method('Get',
'ns3::Ipv4Address',
[],
is_const=True)
## ipv4-address.h (module 'network'): std::string ns3::Ipv4AddressValue::SerializeToString(ns3::Ptr<const ns3::AttributeChecker> checker) const [member function]
cls.add_method('SerializeToString',
'std::string',
[param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_const=True, is_virtual=True)
## ipv4-address.h (module 'network'): void ns3::Ipv4AddressValue::Set(ns3::Ipv4Address const & value) [member function]
cls.add_method('Set',
'void',
[param('ns3::Ipv4Address const &', 'value')])
return
def register_Ns3Ipv4Interface_methods(root_module, cls):
## ipv4-interface.h (module 'internet'): static ns3::TypeId ns3::Ipv4Interface::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## ipv4-interface.h (module 'internet'): ns3::Ipv4Interface::Ipv4Interface() [constructor]
cls.add_constructor([])
## ipv4-interface.h (module 'internet'): void ns3::Ipv4Interface::SetNode(ns3::Ptr<ns3::Node> node) [member function]
cls.add_method('SetNode',
'void',
[param('ns3::Ptr< ns3::Node >', 'node')])
## ipv4-interface.h (module 'internet'): void ns3::Ipv4Interface::SetDevice(ns3::Ptr<ns3::NetDevice> device) [member function]
cls.add_method('SetDevice',
'void',
[param('ns3::Ptr< ns3::NetDevice >', 'device')])
## ipv4-interface.h (module 'internet'): void ns3::Ipv4Interface::SetTrafficControl(ns3::Ptr<ns3::TrafficControlLayer> tc) [member function]
cls.add_method('SetTrafficControl',
'void',
[param('ns3::Ptr< ns3::TrafficControlLayer >', 'tc')])
## ipv4-interface.h (module 'internet'): void ns3::Ipv4Interface::SetArpCache(ns3::Ptr<ns3::ArpCache> arpCache) [member function]
cls.add_method('SetArpCache',
'void',
[param('ns3::Ptr< ns3::ArpCache >', 'arpCache')])
## ipv4-interface.h (module 'internet'): ns3::Ptr<ns3::NetDevice> ns3::Ipv4Interface::GetDevice() const [member function]
cls.add_method('GetDevice',
'ns3::Ptr< ns3::NetDevice >',
[],
is_const=True)
## ipv4-interface.h (module 'internet'): ns3::Ptr<ns3::ArpCache> ns3::Ipv4Interface::GetArpCache() const [member function]
cls.add_method('GetArpCache',
'ns3::Ptr< ns3::ArpCache >',
[],
is_const=True)
## ipv4-interface.h (module 'internet'): void ns3::Ipv4Interface::SetMetric(uint16_t metric) [member function]
cls.add_method('SetMetric',
'void',
[param('uint16_t', 'metric')])
## ipv4-interface.h (module 'internet'): uint16_t ns3::Ipv4Interface::GetMetric() const [member function]
cls.add_method('GetMetric',
'uint16_t',
[],
is_const=True)
## ipv4-interface.h (module 'internet'): bool ns3::Ipv4Interface::IsUp() const [member function]
cls.add_method('IsUp',
'bool',
[],
is_const=True)
## ipv4-interface.h (module 'internet'): bool ns3::Ipv4Interface::IsDown() const [member function]
cls.add_method('IsDown',
'bool',
[],
is_const=True)
## ipv4-interface.h (module 'internet'): void ns3::Ipv4Interface::SetUp() [member function]
cls.add_method('SetUp',
'void',
[])
## ipv4-interface.h (module 'internet'): void ns3::Ipv4Interface::SetDown() [member function]
cls.add_method('SetDown',
'void',
[])
## ipv4-interface.h (module 'internet'): bool ns3::Ipv4Interface::IsForwarding() const [member function]
cls.add_method('IsForwarding',
'bool',
[],
is_const=True)
## ipv4-interface.h (module 'internet'): void ns3::Ipv4Interface::SetForwarding(bool val) [member function]
cls.add_method('SetForwarding',
'void',
[param('bool', 'val')])
## ipv4-interface.h (module 'internet'): void ns3::Ipv4Interface::Send(ns3::Ptr<ns3::Packet> p, ns3::Ipv4Header const & hdr, ns3::Ipv4Address dest) [member function]
cls.add_method('Send',
'void',
[param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ipv4Header const &', 'hdr'), param('ns3::Ipv4Address', 'dest')])
## ipv4-interface.h (module 'internet'): bool ns3::Ipv4Interface::AddAddress(ns3::Ipv4InterfaceAddress address) [member function]
cls.add_method('AddAddress',
'bool',
[param('ns3::Ipv4InterfaceAddress', 'address')])
## ipv4-interface.h (module 'internet'): ns3::Ipv4InterfaceAddress ns3::Ipv4Interface::GetAddress(uint32_t index) const [member function]
cls.add_method('GetAddress',
'ns3::Ipv4InterfaceAddress',
[param('uint32_t', 'index')],
is_const=True)
## ipv4-interface.h (module 'internet'): uint32_t ns3::Ipv4Interface::GetNAddresses() const [member function]
cls.add_method('GetNAddresses',
'uint32_t',
[],
is_const=True)
## ipv4-interface.h (module 'internet'): ns3::Ipv4InterfaceAddress ns3::Ipv4Interface::RemoveAddress(uint32_t index) [member function]
cls.add_method('RemoveAddress',
'ns3::Ipv4InterfaceAddress',
[param('uint32_t', 'index')])
## ipv4-interface.h (module 'internet'): ns3::Ipv4InterfaceAddress ns3::Ipv4Interface::RemoveAddress(ns3::Ipv4Address address) [member function]
cls.add_method('RemoveAddress',
'ns3::Ipv4InterfaceAddress',
[param('ns3::Ipv4Address', 'address')])
## ipv4-interface.h (module 'internet'): void ns3::Ipv4Interface::DoDispose() [member function]
cls.add_method('DoDispose',
'void',
[],
is_virtual=True, visibility='protected')
return
def register_Ns3Ipv4L3Protocol_methods(root_module, cls):
## ipv4-l3-protocol.h (module 'internet'): ns3::Ipv4L3Protocol::Ipv4L3Protocol() [constructor]
cls.add_constructor([])
## ipv4-l3-protocol.h (module 'internet'): bool ns3::Ipv4L3Protocol::AddAddress(uint32_t i, ns3::Ipv4InterfaceAddress address) [member function]
cls.add_method('AddAddress',
'bool',
[param('uint32_t', 'i'), param('ns3::Ipv4InterfaceAddress', 'address')],
is_virtual=True)
## ipv4-l3-protocol.h (module 'internet'): uint32_t ns3::Ipv4L3Protocol::AddInterface(ns3::Ptr<ns3::NetDevice> device) [member function]
cls.add_method('AddInterface',
'uint32_t',
[param('ns3::Ptr< ns3::NetDevice >', 'device')],
is_virtual=True)
## ipv4-l3-protocol.h (module 'internet'): ns3::Ptr<ns3::Socket> ns3::Ipv4L3Protocol::CreateRawSocket() [member function]
cls.add_method('CreateRawSocket',
'ns3::Ptr< ns3::Socket >',
[],
is_virtual=True)
## ipv4-l3-protocol.h (module 'internet'): void ns3::Ipv4L3Protocol::DeleteRawSocket(ns3::Ptr<ns3::Socket> socket) [member function]
cls.add_method('DeleteRawSocket',
'void',
[param('ns3::Ptr< ns3::Socket >', 'socket')],
is_virtual=True)
## ipv4-l3-protocol.h (module 'internet'): ns3::Ipv4InterfaceAddress ns3::Ipv4L3Protocol::GetAddress(uint32_t interfaceIndex, uint32_t addressIndex) const [member function]
cls.add_method('GetAddress',
'ns3::Ipv4InterfaceAddress',
[param('uint32_t', 'interfaceIndex'), param('uint32_t', 'addressIndex')],
is_const=True, is_virtual=True)
## ipv4-l3-protocol.h (module 'internet'): ns3::Ptr<ns3::Ipv4Interface> ns3::Ipv4L3Protocol::GetInterface(uint32_t i) const [member function]
cls.add_method('GetInterface',
'ns3::Ptr< ns3::Ipv4Interface >',
[param('uint32_t', 'i')],
is_const=True)
## ipv4-l3-protocol.h (module 'internet'): int32_t ns3::Ipv4L3Protocol::GetInterfaceForAddress(ns3::Ipv4Address addr) const [member function]
cls.add_method('GetInterfaceForAddress',
'int32_t',
[param('ns3::Ipv4Address', 'addr')],
is_const=True, is_virtual=True)
## ipv4-l3-protocol.h (module 'internet'): int32_t ns3::Ipv4L3Protocol::GetInterfaceForDevice(ns3::Ptr<const ns3::NetDevice> device) const [member function]
cls.add_method('GetInterfaceForDevice',
'int32_t',
[param('ns3::Ptr< ns3::NetDevice const >', 'device')],
is_const=True, is_virtual=True)
## ipv4-l3-protocol.h (module 'internet'): int32_t ns3::Ipv4L3Protocol::GetInterfaceForPrefix(ns3::Ipv4Address addr, ns3::Ipv4Mask mask) const [member function]
cls.add_method('GetInterfaceForPrefix',
'int32_t',
[param('ns3::Ipv4Address', 'addr'), param('ns3::Ipv4Mask', 'mask')],
is_const=True, is_virtual=True)
## ipv4-l3-protocol.h (module 'internet'): uint16_t ns3::Ipv4L3Protocol::GetMetric(uint32_t i) const [member function]
cls.add_method('GetMetric',
'uint16_t',
[param('uint32_t', 'i')],
is_const=True, is_virtual=True)
## ipv4-l3-protocol.h (module 'internet'): uint16_t ns3::Ipv4L3Protocol::GetMtu(uint32_t i) const [member function]
cls.add_method('GetMtu',
'uint16_t',
[param('uint32_t', 'i')],
is_const=True, is_virtual=True)
## ipv4-l3-protocol.h (module 'internet'): uint32_t ns3::Ipv4L3Protocol::GetNAddresses(uint32_t interface) const [member function]
cls.add_method('GetNAddresses',
'uint32_t',
[param('uint32_t', 'interface')],
is_const=True, is_virtual=True)
## ipv4-l3-protocol.h (module 'internet'): uint32_t ns3::Ipv4L3Protocol::GetNInterfaces() const [member function]
cls.add_method('GetNInterfaces',
'uint32_t',
[],
is_const=True, is_virtual=True)
## ipv4-l3-protocol.h (module 'internet'): ns3::Ptr<ns3::NetDevice> ns3::Ipv4L3Protocol::GetNetDevice(uint32_t i) [member function]
cls.add_method('GetNetDevice',
'ns3::Ptr< ns3::NetDevice >',
[param('uint32_t', 'i')],
is_virtual=True)
## ipv4-l3-protocol.h (module 'internet'): ns3::Ptr<ns3::IpL4Protocol> ns3::Ipv4L3Protocol::GetProtocol(int protocolNumber) const [member function]
cls.add_method('GetProtocol',
'ns3::Ptr< ns3::IpL4Protocol >',
[param('int', 'protocolNumber')],
is_const=True, is_virtual=True)
## ipv4-l3-protocol.h (module 'internet'): ns3::Ptr<ns3::IpL4Protocol> ns3::Ipv4L3Protocol::GetProtocol(int protocolNumber, int32_t interfaceIndex) const [member function]
cls.add_method('GetProtocol',
'ns3::Ptr< ns3::IpL4Protocol >',
[param('int', 'protocolNumber'), param('int32_t', 'interfaceIndex')],
is_const=True, is_virtual=True)
## ipv4-l3-protocol.h (module 'internet'): ns3::Ptr<ns3::Ipv4RoutingProtocol> ns3::Ipv4L3Protocol::GetRoutingProtocol() const [member function]
cls.add_method('GetRoutingProtocol',
'ns3::Ptr< ns3::Ipv4RoutingProtocol >',
[],
is_const=True, is_virtual=True)
## ipv4-l3-protocol.h (module 'internet'): static ns3::TypeId ns3::Ipv4L3Protocol::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## ipv4-l3-protocol.h (module 'internet'): void ns3::Ipv4L3Protocol::Insert(ns3::Ptr<ns3::IpL4Protocol> protocol) [member function]
cls.add_method('Insert',
'void',
[param('ns3::Ptr< ns3::IpL4Protocol >', 'protocol')],
is_virtual=True)
## ipv4-l3-protocol.h (module 'internet'): void ns3::Ipv4L3Protocol::Insert(ns3::Ptr<ns3::IpL4Protocol> protocol, uint32_t interfaceIndex) [member function]
cls.add_method('Insert',
'void',
[param('ns3::Ptr< ns3::IpL4Protocol >', 'protocol'), param('uint32_t', 'interfaceIndex')],
is_virtual=True)
## ipv4-l3-protocol.h (module 'internet'): bool ns3::Ipv4L3Protocol::IsDestinationAddress(ns3::Ipv4Address address, uint32_t iif) const [member function]
cls.add_method('IsDestinationAddress',
'bool',
[param('ns3::Ipv4Address', 'address'), param('uint32_t', 'iif')],
is_const=True, is_virtual=True)
## ipv4-l3-protocol.h (module 'internet'): bool ns3::Ipv4L3Protocol::IsForwarding(uint32_t i) const [member function]
cls.add_method('IsForwarding',
'bool',
[param('uint32_t', 'i')],
is_const=True, is_virtual=True)
## ipv4-l3-protocol.h (module 'internet'): bool ns3::Ipv4L3Protocol::IsUnicast(ns3::Ipv4Address ad) const [member function]
cls.add_method('IsUnicast',
'bool',
[param('ns3::Ipv4Address', 'ad')],
is_const=True)
## ipv4-l3-protocol.h (module 'internet'): bool ns3::Ipv4L3Protocol::IsUp(uint32_t i) const [member function]
cls.add_method('IsUp',
'bool',
[param('uint32_t', 'i')],
is_const=True, is_virtual=True)
## ipv4-l3-protocol.h (module 'internet'): void ns3::Ipv4L3Protocol::Receive(ns3::Ptr<ns3::NetDevice> device, ns3::Ptr<const ns3::Packet> p, uint16_t protocol, ns3::Address const & from, ns3::Address const & to, ns3::NetDevice::PacketType packetType) [member function]
cls.add_method('Receive',
'void',
[param('ns3::Ptr< ns3::NetDevice >', 'device'), param('ns3::Ptr< ns3::Packet const >', 'p'), param('uint16_t', 'protocol'), param('ns3::Address const &', 'from'), param('ns3::Address const &', 'to'), param('ns3::NetDevice::PacketType', 'packetType')])
## ipv4-l3-protocol.h (module 'internet'): void ns3::Ipv4L3Protocol::Remove(ns3::Ptr<ns3::IpL4Protocol> protocol) [member function]
cls.add_method('Remove',
'void',
[param('ns3::Ptr< ns3::IpL4Protocol >', 'protocol')],
is_virtual=True)
## ipv4-l3-protocol.h (module 'internet'): void ns3::Ipv4L3Protocol::Remove(ns3::Ptr<ns3::IpL4Protocol> protocol, uint32_t interfaceIndex) [member function]
cls.add_method('Remove',
'void',
[param('ns3::Ptr< ns3::IpL4Protocol >', 'protocol'), param('uint32_t', 'interfaceIndex')],
is_virtual=True)
## ipv4-l3-protocol.h (module 'internet'): bool ns3::Ipv4L3Protocol::RemoveAddress(uint32_t interfaceIndex, uint32_t addressIndex) [member function]
cls.add_method('RemoveAddress',
'bool',
[param('uint32_t', 'interfaceIndex'), param('uint32_t', 'addressIndex')],
is_virtual=True)
## ipv4-l3-protocol.h (module 'internet'): bool ns3::Ipv4L3Protocol::RemoveAddress(uint32_t interface, ns3::Ipv4Address address) [member function]
cls.add_method('RemoveAddress',
'bool',
[param('uint32_t', 'interface'), param('ns3::Ipv4Address', 'address')],
is_virtual=True)
## ipv4-l3-protocol.h (module 'internet'): ns3::Ipv4Address ns3::Ipv4L3Protocol::SelectSourceAddress(ns3::Ptr<const ns3::NetDevice> device, ns3::Ipv4Address dst, ns3::Ipv4InterfaceAddress::InterfaceAddressScope_e scope) [member function]
cls.add_method('SelectSourceAddress',
'ns3::Ipv4Address',
[param('ns3::Ptr< ns3::NetDevice const >', 'device'), param('ns3::Ipv4Address', 'dst'), param('ns3::Ipv4InterfaceAddress::InterfaceAddressScope_e', 'scope')],
is_virtual=True)
## ipv4-l3-protocol.h (module 'internet'): void ns3::Ipv4L3Protocol::Send(ns3::Ptr<ns3::Packet> packet, ns3::Ipv4Address source, ns3::Ipv4Address destination, uint8_t protocol, ns3::Ptr<ns3::Ipv4Route> route) [member function]
cls.add_method('Send',
'void',
[param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Address', 'destination'), param('uint8_t', 'protocol'), param('ns3::Ptr< ns3::Ipv4Route >', 'route')],
is_virtual=True)
## ipv4-l3-protocol.h (module 'internet'): void ns3::Ipv4L3Protocol::SendWithHeader(ns3::Ptr<ns3::Packet> packet, ns3::Ipv4Header ipHeader, ns3::Ptr<ns3::Ipv4Route> route) [member function]
cls.add_method('SendWithHeader',
'void',
[param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ipv4Header', 'ipHeader'), param('ns3::Ptr< ns3::Ipv4Route >', 'route')],
is_virtual=True)
## ipv4-l3-protocol.h (module 'internet'): void ns3::Ipv4L3Protocol::SetDefaultTtl(uint8_t ttl) [member function]
cls.add_method('SetDefaultTtl',
'void',
[param('uint8_t', 'ttl')])
## ipv4-l3-protocol.h (module 'internet'): void ns3::Ipv4L3Protocol::SetDown(uint32_t i) [member function]
cls.add_method('SetDown',
'void',
[param('uint32_t', 'i')],
is_virtual=True)
## ipv4-l3-protocol.h (module 'internet'): void ns3::Ipv4L3Protocol::SetForwarding(uint32_t i, bool val) [member function]
cls.add_method('SetForwarding',
'void',
[param('uint32_t', 'i'), param('bool', 'val')],
is_virtual=True)
## ipv4-l3-protocol.h (module 'internet'): void ns3::Ipv4L3Protocol::SetMetric(uint32_t i, uint16_t metric) [member function]
cls.add_method('SetMetric',
'void',
[param('uint32_t', 'i'), param('uint16_t', 'metric')],
is_virtual=True)
## ipv4-l3-protocol.h (module 'internet'): void ns3::Ipv4L3Protocol::SetNode(ns3::Ptr<ns3::Node> node) [member function]
cls.add_method('SetNode',
'void',
[param('ns3::Ptr< ns3::Node >', 'node')])
## ipv4-l3-protocol.h (module 'internet'): void ns3::Ipv4L3Protocol::SetRoutingProtocol(ns3::Ptr<ns3::Ipv4RoutingProtocol> routingProtocol) [member function]
cls.add_method('SetRoutingProtocol',
'void',
[param('ns3::Ptr< ns3::Ipv4RoutingProtocol >', 'routingProtocol')],
is_virtual=True)
## ipv4-l3-protocol.h (module 'internet'): void ns3::Ipv4L3Protocol::SetUp(uint32_t i) [member function]
cls.add_method('SetUp',
'void',
[param('uint32_t', 'i')],
is_virtual=True)
## ipv4-l3-protocol.h (module 'internet'): ns3::Ipv4Address ns3::Ipv4L3Protocol::SourceAddressSelection(uint32_t interface, ns3::Ipv4Address dest) [member function]
cls.add_method('SourceAddressSelection',
'ns3::Ipv4Address',
[param('uint32_t', 'interface'), param('ns3::Ipv4Address', 'dest')],
is_virtual=True)
## ipv4-l3-protocol.h (module 'internet'): ns3::Ipv4L3Protocol::PROT_NUMBER [variable]
cls.add_static_attribute('PROT_NUMBER', 'uint16_t const', is_const=True)
## ipv4-l3-protocol.h (module 'internet'): void ns3::Ipv4L3Protocol::DoDispose() [member function]
cls.add_method('DoDispose',
'void',
[],
is_virtual=True, visibility='protected')
## ipv4-l3-protocol.h (module 'internet'): void ns3::Ipv4L3Protocol::NotifyNewAggregate() [member function]
cls.add_method('NotifyNewAggregate',
'void',
[],
is_virtual=True, visibility='protected')
## ipv4-l3-protocol.h (module 'internet'): bool ns3::Ipv4L3Protocol::GetIpForward() const [member function]
cls.add_method('GetIpForward',
'bool',
[],
is_const=True, is_virtual=True, visibility='private')
## ipv4-l3-protocol.h (module 'internet'): bool ns3::Ipv4L3Protocol::GetWeakEsModel() const [member function]
cls.add_method('GetWeakEsModel',
'bool',
[],
is_const=True, is_virtual=True, visibility='private')
## ipv4-l3-protocol.h (module 'internet'): void ns3::Ipv4L3Protocol::SetIpForward(bool forward) [member function]
cls.add_method('SetIpForward',
'void',
[param('bool', 'forward')],
is_virtual=True, visibility='private')
## ipv4-l3-protocol.h (module 'internet'): void ns3::Ipv4L3Protocol::SetWeakEsModel(bool model) [member function]
cls.add_method('SetWeakEsModel',
'void',
[param('bool', 'model')],
is_virtual=True, visibility='private')
return
def register_Ns3Ipv4MaskChecker_methods(root_module, cls):
## ipv4-address.h (module 'network'): ns3::Ipv4MaskChecker::Ipv4MaskChecker() [constructor]
cls.add_constructor([])
## ipv4-address.h (module 'network'): ns3::Ipv4MaskChecker::Ipv4MaskChecker(ns3::Ipv4MaskChecker const & arg0) [constructor]
cls.add_constructor([param('ns3::Ipv4MaskChecker const &', 'arg0')])
return
def register_Ns3Ipv4MaskValue_methods(root_module, cls):
## ipv4-address.h (module 'network'): ns3::Ipv4MaskValue::Ipv4MaskValue() [constructor]
cls.add_constructor([])
## ipv4-address.h (module 'network'): ns3::Ipv4MaskValue::Ipv4MaskValue(ns3::Ipv4Mask const & value) [constructor]
cls.add_constructor([param('ns3::Ipv4Mask const &', 'value')])
## ipv4-address.h (module 'network'): ns3::Ipv4MaskValue::Ipv4MaskValue(ns3::Ipv4MaskValue const & arg0) [constructor]
cls.add_constructor([param('ns3::Ipv4MaskValue const &', 'arg0')])
## ipv4-address.h (module 'network'): ns3::Ptr<ns3::AttributeValue> ns3::Ipv4MaskValue::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::AttributeValue >',
[],
is_const=True, is_virtual=True)
## ipv4-address.h (module 'network'): bool ns3::Ipv4MaskValue::DeserializeFromString(std::string value, ns3::Ptr<const ns3::AttributeChecker> checker) [member function]
cls.add_method('DeserializeFromString',
'bool',
[param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_virtual=True)
## ipv4-address.h (module 'network'): ns3::Ipv4Mask ns3::Ipv4MaskValue::Get() const [member function]
cls.add_method('Get',
'ns3::Ipv4Mask',
[],
is_const=True)
## ipv4-address.h (module 'network'): std::string ns3::Ipv4MaskValue::SerializeToString(ns3::Ptr<const ns3::AttributeChecker> checker) const [member function]
cls.add_method('SerializeToString',
'std::string',
[param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_const=True, is_virtual=True)
## ipv4-address.h (module 'network'): void ns3::Ipv4MaskValue::Set(ns3::Ipv4Mask const & value) [member function]
cls.add_method('Set',
'void',
[param('ns3::Ipv4Mask const &', 'value')])
return
def register_Ns3Ipv4MulticastRoute_methods(root_module, cls):
## ipv4-route.h (module 'internet'): ns3::Ipv4MulticastRoute::Ipv4MulticastRoute(ns3::Ipv4MulticastRoute const & arg0) [constructor]
cls.add_constructor([param('ns3::Ipv4MulticastRoute const &', 'arg0')])
## ipv4-route.h (module 'internet'): ns3::Ipv4MulticastRoute::Ipv4MulticastRoute() [constructor]
cls.add_constructor([])
## ipv4-route.h (module 'internet'): ns3::Ipv4Address ns3::Ipv4MulticastRoute::GetGroup() const [member function]
cls.add_method('GetGroup',
'ns3::Ipv4Address',
[],
is_const=True)
## ipv4-route.h (module 'internet'): ns3::Ipv4Address ns3::Ipv4MulticastRoute::GetOrigin() const [member function]
cls.add_method('GetOrigin',
'ns3::Ipv4Address',
[],
is_const=True)
## ipv4-route.h (module 'internet'): std::map<unsigned int, unsigned int, std::less<unsigned int>, std::allocator<std::pair<const unsigned int, unsigned int> > > ns3::Ipv4MulticastRoute::GetOutputTtlMap() const [member function]
cls.add_method('GetOutputTtlMap',
'std::map< unsigned int, unsigned int >',
[],
is_const=True)
## ipv4-route.h (module 'internet'): uint32_t ns3::Ipv4MulticastRoute::GetParent() const [member function]
cls.add_method('GetParent',
'uint32_t',
[],
is_const=True)
## ipv4-route.h (module 'internet'): void ns3::Ipv4MulticastRoute::SetGroup(ns3::Ipv4Address const group) [member function]
cls.add_method('SetGroup',
'void',
[param('ns3::Ipv4Address const', 'group')])
## ipv4-route.h (module 'internet'): void ns3::Ipv4MulticastRoute::SetOrigin(ns3::Ipv4Address const origin) [member function]
cls.add_method('SetOrigin',
'void',
[param('ns3::Ipv4Address const', 'origin')])
## ipv4-route.h (module 'internet'): void ns3::Ipv4MulticastRoute::SetOutputTtl(uint32_t oif, uint32_t ttl) [member function]
cls.add_method('SetOutputTtl',
'void',
[param('uint32_t', 'oif'), param('uint32_t', 'ttl')])
## ipv4-route.h (module 'internet'): void ns3::Ipv4MulticastRoute::SetParent(uint32_t iif) [member function]
cls.add_method('SetParent',
'void',
[param('uint32_t', 'iif')])
## ipv4-route.h (module 'internet'): ns3::Ipv4MulticastRoute::MAX_INTERFACES [variable]
cls.add_static_attribute('MAX_INTERFACES', 'uint32_t const', is_const=True)
## ipv4-route.h (module 'internet'): ns3::Ipv4MulticastRoute::MAX_TTL [variable]
cls.add_static_attribute('MAX_TTL', 'uint32_t const', is_const=True)
return
def register_Ns3Ipv4Route_methods(root_module, cls):
cls.add_output_stream_operator()
## ipv4-route.h (module 'internet'): ns3::Ipv4Route::Ipv4Route(ns3::Ipv4Route const & arg0) [constructor]
cls.add_constructor([param('ns3::Ipv4Route const &', 'arg0')])
## ipv4-route.h (module 'internet'): ns3::Ipv4Route::Ipv4Route() [constructor]
cls.add_constructor([])
## ipv4-route.h (module 'internet'): ns3::Ipv4Address ns3::Ipv4Route::GetDestination() const [member function]
cls.add_method('GetDestination',
'ns3::Ipv4Address',
[],
is_const=True)
## ipv4-route.h (module 'internet'): ns3::Ipv4Address ns3::Ipv4Route::GetGateway() const [member function]
cls.add_method('GetGateway',
'ns3::Ipv4Address',
[],
is_const=True)
## ipv4-route.h (module 'internet'): ns3::Ptr<ns3::NetDevice> ns3::Ipv4Route::GetOutputDevice() const [member function]
cls.add_method('GetOutputDevice',
'ns3::Ptr< ns3::NetDevice >',
[],
is_const=True)
## ipv4-route.h (module 'internet'): ns3::Ipv4Address ns3::Ipv4Route::GetSource() const [member function]
cls.add_method('GetSource',
'ns3::Ipv4Address',
[],
is_const=True)
## ipv4-route.h (module 'internet'): void ns3::Ipv4Route::SetDestination(ns3::Ipv4Address dest) [member function]
cls.add_method('SetDestination',
'void',
[param('ns3::Ipv4Address', 'dest')])
## ipv4-route.h (module 'internet'): void ns3::Ipv4Route::SetGateway(ns3::Ipv4Address gw) [member function]
cls.add_method('SetGateway',
'void',
[param('ns3::Ipv4Address', 'gw')])
## ipv4-route.h (module 'internet'): void ns3::Ipv4Route::SetOutputDevice(ns3::Ptr<ns3::NetDevice> outputDevice) [member function]
cls.add_method('SetOutputDevice',
'void',
[param('ns3::Ptr< ns3::NetDevice >', 'outputDevice')])
## ipv4-route.h (module 'internet'): void ns3::Ipv4Route::SetSource(ns3::Ipv4Address src) [member function]
cls.add_method('SetSource',
'void',
[param('ns3::Ipv4Address', 'src')])
return
def register_Ns3Ipv4RoutingProtocol_methods(root_module, cls):
## ipv4-routing-protocol.h (module 'internet'): ns3::Ipv4RoutingProtocol::Ipv4RoutingProtocol() [constructor]
cls.add_constructor([])
## ipv4-routing-protocol.h (module 'internet'): ns3::Ipv4RoutingProtocol::Ipv4RoutingProtocol(ns3::Ipv4RoutingProtocol const & arg0) [constructor]
cls.add_constructor([param('ns3::Ipv4RoutingProtocol const &', 'arg0')])
## ipv4-routing-protocol.h (module 'internet'): static ns3::TypeId ns3::Ipv4RoutingProtocol::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## ipv4-routing-protocol.h (module 'internet'): void ns3::Ipv4RoutingProtocol::NotifyAddAddress(uint32_t interface, ns3::Ipv4InterfaceAddress address) [member function]
cls.add_method('NotifyAddAddress',
'void',
[param('uint32_t', 'interface'), param('ns3::Ipv4InterfaceAddress', 'address')],
is_pure_virtual=True, is_virtual=True)
## ipv4-routing-protocol.h (module 'internet'): void ns3::Ipv4RoutingProtocol::NotifyInterfaceDown(uint32_t interface) [member function]
cls.add_method('NotifyInterfaceDown',
'void',
[param('uint32_t', 'interface')],
is_pure_virtual=True, is_virtual=True)
## ipv4-routing-protocol.h (module 'internet'): void ns3::Ipv4RoutingProtocol::NotifyInterfaceUp(uint32_t interface) [member function]
cls.add_method('NotifyInterfaceUp',
'void',
[param('uint32_t', 'interface')],
is_pure_virtual=True, is_virtual=True)
## ipv4-routing-protocol.h (module 'internet'): void ns3::Ipv4RoutingProtocol::NotifyRemoveAddress(uint32_t interface, ns3::Ipv4InterfaceAddress address) [member function]
cls.add_method('NotifyRemoveAddress',
'void',
[param('uint32_t', 'interface'), param('ns3::Ipv4InterfaceAddress', 'address')],
is_pure_virtual=True, is_virtual=True)
## ipv4-routing-protocol.h (module 'internet'): void ns3::Ipv4RoutingProtocol::PrintRoutingTable(ns3::Ptr<ns3::OutputStreamWrapper> stream, ns3::Time::Unit unit=::ns3::Time::Unit::S) const [member function]
cls.add_method('PrintRoutingTable',
'void',
[param('ns3::Ptr< ns3::OutputStreamWrapper >', 'stream'), param('ns3::Time::Unit', 'unit', default_value='::ns3::Time::Unit::S')],
is_const=True, is_pure_virtual=True, is_virtual=True)
## ipv4-routing-protocol.h (module 'internet'): bool ns3::Ipv4RoutingProtocol::RouteInput(ns3::Ptr<const ns3::Packet> p, ns3::Ipv4Header const & header, ns3::Ptr<const ns3::NetDevice> idev, ns3::Ipv4RoutingProtocol::UnicastForwardCallback ucb, ns3::Ipv4RoutingProtocol::MulticastForwardCallback mcb, ns3::Ipv4RoutingProtocol::LocalDeliverCallback lcb, ns3::Ipv4RoutingProtocol::ErrorCallback ecb) [member function]
cls.add_method('RouteInput',
'bool',
[param('ns3::Ptr< ns3::Packet const >', 'p'), param('ns3::Ipv4Header const &', 'header'), param('ns3::Ptr< ns3::NetDevice const >', 'idev'), param('ns3::Callback< void, ns3::Ptr< ns3::Ipv4Route >, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ucb'), param('ns3::Callback< void, ns3::Ptr< ns3::Ipv4MulticastRoute >, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'mcb'), param('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'lcb'), param('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::Socket::SocketErrno, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ecb')],
is_pure_virtual=True, is_virtual=True)
## ipv4-routing-protocol.h (module 'internet'): ns3::Ptr<ns3::Ipv4Route> ns3::Ipv4RoutingProtocol::RouteOutput(ns3::Ptr<ns3::Packet> p, ns3::Ipv4Header const & header, ns3::Ptr<ns3::NetDevice> oif, ns3::Socket::SocketErrno & sockerr) [member function]
cls.add_method('RouteOutput',
'ns3::Ptr< ns3::Ipv4Route >',
[param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ipv4Header const &', 'header'), param('ns3::Ptr< ns3::NetDevice >', 'oif'), param('ns3::Socket::SocketErrno &', 'sockerr')],
is_pure_virtual=True, is_virtual=True)
## ipv4-routing-protocol.h (module 'internet'): void ns3::Ipv4RoutingProtocol::SetIpv4(ns3::Ptr<ns3::Ipv4> ipv4) [member function]
cls.add_method('SetIpv4',
'void',
[param('ns3::Ptr< ns3::Ipv4 >', 'ipv4')],
is_pure_virtual=True, is_virtual=True)
return
def register_Ns3Ipv6AddressChecker_methods(root_module, cls):
## ipv6-address.h (module 'network'): ns3::Ipv6AddressChecker::Ipv6AddressChecker() [constructor]
cls.add_constructor([])
## ipv6-address.h (module 'network'): ns3::Ipv6AddressChecker::Ipv6AddressChecker(ns3::Ipv6AddressChecker const & arg0) [constructor]
cls.add_constructor([param('ns3::Ipv6AddressChecker const &', 'arg0')])
return
def register_Ns3Ipv6AddressValue_methods(root_module, cls):
## ipv6-address.h (module 'network'): ns3::Ipv6AddressValue::Ipv6AddressValue() [constructor]
cls.add_constructor([])
## ipv6-address.h (module 'network'): ns3::Ipv6AddressValue::Ipv6AddressValue(ns3::Ipv6Address const & value) [constructor]
cls.add_constructor([param('ns3::Ipv6Address const &', 'value')])
## ipv6-address.h (module 'network'): ns3::Ipv6AddressValue::Ipv6AddressValue(ns3::Ipv6AddressValue const & arg0) [constructor]
cls.add_constructor([param('ns3::Ipv6AddressValue const &', 'arg0')])
## ipv6-address.h (module 'network'): ns3::Ptr<ns3::AttributeValue> ns3::Ipv6AddressValue::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::AttributeValue >',
[],
is_const=True, is_virtual=True)
## ipv6-address.h (module 'network'): bool ns3::Ipv6AddressValue::DeserializeFromString(std::string value, ns3::Ptr<const ns3::AttributeChecker> checker) [member function]
cls.add_method('DeserializeFromString',
'bool',
[param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_virtual=True)
## ipv6-address.h (module 'network'): ns3::Ipv6Address ns3::Ipv6AddressValue::Get() const [member function]
cls.add_method('Get',
'ns3::Ipv6Address',
[],
is_const=True)
## ipv6-address.h (module 'network'): std::string ns3::Ipv6AddressValue::SerializeToString(ns3::Ptr<const ns3::AttributeChecker> checker) const [member function]
cls.add_method('SerializeToString',
'std::string',
[param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_const=True, is_virtual=True)
## ipv6-address.h (module 'network'): void ns3::Ipv6AddressValue::Set(ns3::Ipv6Address const & value) [member function]
cls.add_method('Set',
'void',
[param('ns3::Ipv6Address const &', 'value')])
return
def register_Ns3Ipv6PrefixChecker_methods(root_module, cls):
## ipv6-address.h (module 'network'): ns3::Ipv6PrefixChecker::Ipv6PrefixChecker() [constructor]
cls.add_constructor([])
## ipv6-address.h (module 'network'): ns3::Ipv6PrefixChecker::Ipv6PrefixChecker(ns3::Ipv6PrefixChecker const & arg0) [constructor]
cls.add_constructor([param('ns3::Ipv6PrefixChecker const &', 'arg0')])
return
def register_Ns3Ipv6PrefixValue_methods(root_module, cls):
## ipv6-address.h (module 'network'): ns3::Ipv6PrefixValue::Ipv6PrefixValue() [constructor]
cls.add_constructor([])
## ipv6-address.h (module 'network'): ns3::Ipv6PrefixValue::Ipv6PrefixValue(ns3::Ipv6Prefix const & value) [constructor]
cls.add_constructor([param('ns3::Ipv6Prefix const &', 'value')])
## ipv6-address.h (module 'network'): ns3::Ipv6PrefixValue::Ipv6PrefixValue(ns3::Ipv6PrefixValue const & arg0) [constructor]
cls.add_constructor([param('ns3::Ipv6PrefixValue const &', 'arg0')])
## ipv6-address.h (module 'network'): ns3::Ptr<ns3::AttributeValue> ns3::Ipv6PrefixValue::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::AttributeValue >',
[],
is_const=True, is_virtual=True)
## ipv6-address.h (module 'network'): bool ns3::Ipv6PrefixValue::DeserializeFromString(std::string value, ns3::Ptr<const ns3::AttributeChecker> checker) [member function]
cls.add_method('DeserializeFromString',
'bool',
[param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_virtual=True)
## ipv6-address.h (module 'network'): ns3::Ipv6Prefix ns3::Ipv6PrefixValue::Get() const [member function]
cls.add_method('Get',
'ns3::Ipv6Prefix',
[],
is_const=True)
## ipv6-address.h (module 'network'): std::string ns3::Ipv6PrefixValue::SerializeToString(ns3::Ptr<const ns3::AttributeChecker> checker) const [member function]
cls.add_method('SerializeToString',
'std::string',
[param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_const=True, is_virtual=True)
## ipv6-address.h (module 'network'): void ns3::Ipv6PrefixValue::Set(ns3::Ipv6Prefix const & value) [member function]
cls.add_method('Set',
'void',
[param('ns3::Ipv6Prefix const &', 'value')])
return
def register_Ns3LogNormalRandomVariable_methods(root_module, cls):
## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::LogNormalRandomVariable::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## random-variable-stream.h (module 'core'): ns3::LogNormalRandomVariable::LogNormalRandomVariable() [constructor]
cls.add_constructor([])
## random-variable-stream.h (module 'core'): double ns3::LogNormalRandomVariable::GetMu() const [member function]
cls.add_method('GetMu',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::LogNormalRandomVariable::GetSigma() const [member function]
cls.add_method('GetSigma',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::LogNormalRandomVariable::GetValue(double mu, double sigma) [member function]
cls.add_method('GetValue',
'double',
[param('double', 'mu'), param('double', 'sigma')])
## random-variable-stream.h (module 'core'): uint32_t ns3::LogNormalRandomVariable::GetInteger(uint32_t mu, uint32_t sigma) [member function]
cls.add_method('GetInteger',
'uint32_t',
[param('uint32_t', 'mu'), param('uint32_t', 'sigma')])
## random-variable-stream.h (module 'core'): double ns3::LogNormalRandomVariable::GetValue() [member function]
cls.add_method('GetValue',
'double',
[],
is_virtual=True)
## random-variable-stream.h (module 'core'): uint32_t ns3::LogNormalRandomVariable::GetInteger() [member function]
cls.add_method('GetInteger',
'uint32_t',
[],
is_virtual=True)
return
def register_Ns3Mac48AddressChecker_methods(root_module, cls):
## mac48-address.h (module 'network'): ns3::Mac48AddressChecker::Mac48AddressChecker() [constructor]
cls.add_constructor([])
## mac48-address.h (module 'network'): ns3::Mac48AddressChecker::Mac48AddressChecker(ns3::Mac48AddressChecker const & arg0) [constructor]
cls.add_constructor([param('ns3::Mac48AddressChecker const &', 'arg0')])
return
def register_Ns3Mac48AddressValue_methods(root_module, cls):
## mac48-address.h (module 'network'): ns3::Mac48AddressValue::Mac48AddressValue() [constructor]
cls.add_constructor([])
## mac48-address.h (module 'network'): ns3::Mac48AddressValue::Mac48AddressValue(ns3::Mac48Address const & value) [constructor]
cls.add_constructor([param('ns3::Mac48Address const &', 'value')])
## mac48-address.h (module 'network'): ns3::Mac48AddressValue::Mac48AddressValue(ns3::Mac48AddressValue const & arg0) [constructor]
cls.add_constructor([param('ns3::Mac48AddressValue const &', 'arg0')])
## mac48-address.h (module 'network'): ns3::Ptr<ns3::AttributeValue> ns3::Mac48AddressValue::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::AttributeValue >',
[],
is_const=True, is_virtual=True)
## mac48-address.h (module 'network'): bool ns3::Mac48AddressValue::DeserializeFromString(std::string value, ns3::Ptr<const ns3::AttributeChecker> checker) [member function]
cls.add_method('DeserializeFromString',
'bool',
[param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_virtual=True)
## mac48-address.h (module 'network'): ns3::Mac48Address ns3::Mac48AddressValue::Get() const [member function]
cls.add_method('Get',
'ns3::Mac48Address',
[],
is_const=True)
## mac48-address.h (module 'network'): std::string ns3::Mac48AddressValue::SerializeToString(ns3::Ptr<const ns3::AttributeChecker> checker) const [member function]
cls.add_method('SerializeToString',
'std::string',
[param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_const=True, is_virtual=True)
## mac48-address.h (module 'network'): void ns3::Mac48AddressValue::Set(ns3::Mac48Address const & value) [member function]
cls.add_method('Set',
'void',
[param('ns3::Mac48Address const &', 'value')])
return
def register_Ns3NetDevice_methods(root_module, cls):
## net-device.h (module 'network'): ns3::NetDevice::NetDevice() [constructor]
cls.add_constructor([])
## net-device.h (module 'network'): ns3::NetDevice::NetDevice(ns3::NetDevice const & arg0) [constructor]
cls.add_constructor([param('ns3::NetDevice const &', 'arg0')])
## net-device.h (module 'network'): void ns3::NetDevice::AddLinkChangeCallback(ns3::Callback<void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> callback) [member function]
cls.add_method('AddLinkChangeCallback',
'void',
[param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')],
is_pure_virtual=True, is_virtual=True)
## net-device.h (module 'network'): ns3::Address ns3::NetDevice::GetAddress() const [member function]
cls.add_method('GetAddress',
'ns3::Address',
[],
is_const=True, is_pure_virtual=True, is_virtual=True)
## net-device.h (module 'network'): ns3::Address ns3::NetDevice::GetBroadcast() const [member function]
cls.add_method('GetBroadcast',
'ns3::Address',
[],
is_const=True, is_pure_virtual=True, is_virtual=True)
## net-device.h (module 'network'): ns3::Ptr<ns3::Channel> ns3::NetDevice::GetChannel() const [member function]
cls.add_method('GetChannel',
'ns3::Ptr< ns3::Channel >',
[],
is_const=True, is_pure_virtual=True, is_virtual=True)
## net-device.h (module 'network'): uint32_t ns3::NetDevice::GetIfIndex() const [member function]
cls.add_method('GetIfIndex',
'uint32_t',
[],
is_const=True, is_pure_virtual=True, is_virtual=True)
## net-device.h (module 'network'): uint16_t ns3::NetDevice::GetMtu() const [member function]
cls.add_method('GetMtu',
'uint16_t',
[],
is_const=True, is_pure_virtual=True, is_virtual=True)
## net-device.h (module 'network'): ns3::Address ns3::NetDevice::GetMulticast(ns3::Ipv4Address multicastGroup) const [member function]
cls.add_method('GetMulticast',
'ns3::Address',
[param('ns3::Ipv4Address', 'multicastGroup')],
is_const=True, is_pure_virtual=True, is_virtual=True)
## net-device.h (module 'network'): ns3::Address ns3::NetDevice::GetMulticast(ns3::Ipv6Address addr) const [member function]
cls.add_method('GetMulticast',
'ns3::Address',
[param('ns3::Ipv6Address', 'addr')],
is_const=True, is_pure_virtual=True, is_virtual=True)
## net-device.h (module 'network'): ns3::Ptr<ns3::Node> ns3::NetDevice::GetNode() const [member function]
cls.add_method('GetNode',
'ns3::Ptr< ns3::Node >',
[],
is_const=True, is_pure_virtual=True, is_virtual=True)
## net-device.h (module 'network'): static ns3::TypeId ns3::NetDevice::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## net-device.h (module 'network'): bool ns3::NetDevice::IsBridge() const [member function]
cls.add_method('IsBridge',
'bool',
[],
is_const=True, is_pure_virtual=True, is_virtual=True)
## net-device.h (module 'network'): bool ns3::NetDevice::IsBroadcast() const [member function]
cls.add_method('IsBroadcast',
'bool',
[],
is_const=True, is_pure_virtual=True, is_virtual=True)
## net-device.h (module 'network'): bool ns3::NetDevice::IsLinkUp() const [member function]
cls.add_method('IsLinkUp',
'bool',
[],
is_const=True, is_pure_virtual=True, is_virtual=True)
## net-device.h (module 'network'): bool ns3::NetDevice::IsMulticast() const [member function]
cls.add_method('IsMulticast',
'bool',
[],
is_const=True, is_pure_virtual=True, is_virtual=True)
## net-device.h (module 'network'): bool ns3::NetDevice::IsPointToPoint() const [member function]
cls.add_method('IsPointToPoint',
'bool',
[],
is_const=True, is_pure_virtual=True, is_virtual=True)
## net-device.h (module 'network'): bool ns3::NetDevice::NeedsArp() const [member function]
cls.add_method('NeedsArp',
'bool',
[],
is_const=True, is_pure_virtual=True, is_virtual=True)
## net-device.h (module 'network'): bool ns3::NetDevice::Send(ns3::Ptr<ns3::Packet> packet, ns3::Address const & dest, uint16_t protocolNumber) [member function]
cls.add_method('Send',
'bool',
[param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address const &', 'dest'), param('uint16_t', 'protocolNumber')],
is_pure_virtual=True, is_virtual=True)
## net-device.h (module 'network'): bool ns3::NetDevice::SendFrom(ns3::Ptr<ns3::Packet> packet, ns3::Address const & source, ns3::Address const & dest, uint16_t protocolNumber) [member function]
cls.add_method('SendFrom',
'bool',
[param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address const &', 'source'), param('ns3::Address const &', 'dest'), param('uint16_t', 'protocolNumber')],
is_pure_virtual=True, is_virtual=True)
## net-device.h (module 'network'): void ns3::NetDevice::SetAddress(ns3::Address address) [member function]
cls.add_method('SetAddress',
'void',
[param('ns3::Address', 'address')],
is_pure_virtual=True, is_virtual=True)
## net-device.h (module 'network'): void ns3::NetDevice::SetIfIndex(uint32_t const index) [member function]
cls.add_method('SetIfIndex',
'void',
[param('uint32_t const', 'index')],
is_pure_virtual=True, is_virtual=True)
## net-device.h (module 'network'): bool ns3::NetDevice::SetMtu(uint16_t const mtu) [member function]
cls.add_method('SetMtu',
'bool',
[param('uint16_t const', 'mtu')],
is_pure_virtual=True, is_virtual=True)
## net-device.h (module 'network'): void ns3::NetDevice::SetNode(ns3::Ptr<ns3::Node> node) [member function]
cls.add_method('SetNode',
'void',
[param('ns3::Ptr< ns3::Node >', 'node')],
is_pure_virtual=True, is_virtual=True)
## net-device.h (module 'network'): void ns3::NetDevice::SetPromiscReceiveCallback(ns3::NetDevice::PromiscReceiveCallback cb) [member function]
cls.add_method('SetPromiscReceiveCallback',
'void',
[param('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::Address const &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty >', 'cb')],
is_pure_virtual=True, is_virtual=True)
## net-device.h (module 'network'): void ns3::NetDevice::SetReceiveCallback(ns3::NetDevice::ReceiveCallback cb) [member function]
cls.add_method('SetReceiveCallback',
'void',
[param('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'cb')],
is_pure_virtual=True, is_virtual=True)
## net-device.h (module 'network'): bool ns3::NetDevice::SupportsSendFrom() const [member function]
cls.add_method('SupportsSendFrom',
'bool',
[],
is_const=True, is_pure_virtual=True, is_virtual=True)
return
def register_Ns3NixVector_methods(root_module, cls):
cls.add_output_stream_operator()
## nix-vector.h (module 'network'): ns3::NixVector::NixVector() [constructor]
cls.add_constructor([])
## nix-vector.h (module 'network'): ns3::NixVector::NixVector(ns3::NixVector const & o) [constructor]
cls.add_constructor([param('ns3::NixVector const &', 'o')])
## nix-vector.h (module 'network'): void ns3::NixVector::AddNeighborIndex(uint32_t newBits, uint32_t numberOfBits) [member function]
cls.add_method('AddNeighborIndex',
'void',
[param('uint32_t', 'newBits'), param('uint32_t', 'numberOfBits')])
## nix-vector.h (module 'network'): uint32_t ns3::NixVector::BitCount(uint32_t numberOfNeighbors) const [member function]
cls.add_method('BitCount',
'uint32_t',
[param('uint32_t', 'numberOfNeighbors')],
is_const=True)
## nix-vector.h (module 'network'): ns3::Ptr<ns3::NixVector> ns3::NixVector::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::NixVector >',
[],
is_const=True)
## nix-vector.h (module 'network'): uint32_t ns3::NixVector::Deserialize(uint32_t const * buffer, uint32_t size) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('uint32_t const *', 'buffer'), param('uint32_t', 'size')])
## nix-vector.h (module 'network'): uint32_t ns3::NixVector::ExtractNeighborIndex(uint32_t numberOfBits) [member function]
cls.add_method('ExtractNeighborIndex',
'uint32_t',
[param('uint32_t', 'numberOfBits')])
## nix-vector.h (module 'network'): uint32_t ns3::NixVector::GetRemainingBits() [member function]
cls.add_method('GetRemainingBits',
'uint32_t',
[])
## nix-vector.h (module 'network'): uint32_t ns3::NixVector::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True)
## nix-vector.h (module 'network'): uint32_t ns3::NixVector::Serialize(uint32_t * buffer, uint32_t maxSize) const [member function]
cls.add_method('Serialize',
'uint32_t',
[param('uint32_t *', 'buffer'), param('uint32_t', 'maxSize')],
is_const=True)
return
def register_Ns3Node_methods(root_module, cls):
## node.h (module 'network'): ns3::Node::Node(ns3::Node const & arg0) [constructor]
cls.add_constructor([param('ns3::Node const &', 'arg0')])
## node.h (module 'network'): ns3::Node::Node() [constructor]
cls.add_constructor([])
## node.h (module 'network'): ns3::Node::Node(uint32_t systemId) [constructor]
cls.add_constructor([param('uint32_t', 'systemId')])
## node.h (module 'network'): uint32_t ns3::Node::AddApplication(ns3::Ptr<ns3::Application> application) [member function]
cls.add_method('AddApplication',
'uint32_t',
[param('ns3::Ptr< ns3::Application >', 'application')])
## node.h (module 'network'): uint32_t ns3::Node::AddDevice(ns3::Ptr<ns3::NetDevice> device) [member function]
cls.add_method('AddDevice',
'uint32_t',
[param('ns3::Ptr< ns3::NetDevice >', 'device')])
## node.h (module 'network'): static bool ns3::Node::ChecksumEnabled() [member function]
cls.add_method('ChecksumEnabled',
'bool',
[],
is_static=True)
## node.h (module 'network'): ns3::Ptr<ns3::Application> ns3::Node::GetApplication(uint32_t index) const [member function]
cls.add_method('GetApplication',
'ns3::Ptr< ns3::Application >',
[param('uint32_t', 'index')],
is_const=True)
## node.h (module 'network'): ns3::Ptr<ns3::NetDevice> ns3::Node::GetDevice(uint32_t index) const [member function]
cls.add_method('GetDevice',
'ns3::Ptr< ns3::NetDevice >',
[param('uint32_t', 'index')],
is_const=True)
## node.h (module 'network'): uint32_t ns3::Node::GetId() const [member function]
cls.add_method('GetId',
'uint32_t',
[],
is_const=True)
## node.h (module 'network'): ns3::Time ns3::Node::GetLocalTime() const [member function]
cls.add_method('GetLocalTime',
'ns3::Time',
[],
is_const=True)
## node.h (module 'network'): uint32_t ns3::Node::GetNApplications() const [member function]
cls.add_method('GetNApplications',
'uint32_t',
[],
is_const=True)
## node.h (module 'network'): uint32_t ns3::Node::GetNDevices() const [member function]
cls.add_method('GetNDevices',
'uint32_t',
[],
is_const=True)
## node.h (module 'network'): uint32_t ns3::Node::GetSystemId() const [member function]
cls.add_method('GetSystemId',
'uint32_t',
[],
is_const=True)
## node.h (module 'network'): static ns3::TypeId ns3::Node::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## node.h (module 'network'): void ns3::Node::RegisterDeviceAdditionListener(ns3::Node::DeviceAdditionListener listener) [member function]
cls.add_method('RegisterDeviceAdditionListener',
'void',
[param('ns3::Callback< void, ns3::Ptr< ns3::NetDevice >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'listener')])
## node.h (module 'network'): void ns3::Node::RegisterProtocolHandler(ns3::Node::ProtocolHandler handler, uint16_t protocolType, ns3::Ptr<ns3::NetDevice> device, bool promiscuous=false) [member function]
cls.add_method('RegisterProtocolHandler',
'void',
[param('ns3::Callback< void, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::Address const &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty >', 'handler'), param('uint16_t', 'protocolType'), param('ns3::Ptr< ns3::NetDevice >', 'device'), param('bool', 'promiscuous', default_value='false')])
## node.h (module 'network'): void ns3::Node::UnregisterDeviceAdditionListener(ns3::Node::DeviceAdditionListener listener) [member function]
cls.add_method('UnregisterDeviceAdditionListener',
'void',
[param('ns3::Callback< void, ns3::Ptr< ns3::NetDevice >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'listener')])
## node.h (module 'network'): void ns3::Node::UnregisterProtocolHandler(ns3::Node::ProtocolHandler handler) [member function]
cls.add_method('UnregisterProtocolHandler',
'void',
[param('ns3::Callback< void, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::Address const &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty >', 'handler')])
## node.h (module 'network'): void ns3::Node::DoDispose() [member function]
cls.add_method('DoDispose',
'void',
[],
is_virtual=True, visibility='protected')
## node.h (module 'network'): void ns3::Node::DoInitialize() [member function]
cls.add_method('DoInitialize',
'void',
[],
is_virtual=True, visibility='protected')
return
def register_Ns3NormalRandomVariable_methods(root_module, cls):
## random-variable-stream.h (module 'core'): ns3::NormalRandomVariable::INFINITE_VALUE [variable]
cls.add_static_attribute('INFINITE_VALUE', 'double const', is_const=True)
## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::NormalRandomVariable::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## random-variable-stream.h (module 'core'): ns3::NormalRandomVariable::NormalRandomVariable() [constructor]
cls.add_constructor([])
## random-variable-stream.h (module 'core'): double ns3::NormalRandomVariable::GetMean() const [member function]
cls.add_method('GetMean',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::NormalRandomVariable::GetVariance() const [member function]
cls.add_method('GetVariance',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::NormalRandomVariable::GetBound() const [member function]
cls.add_method('GetBound',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::NormalRandomVariable::GetValue(double mean, double variance, double bound=ns3::NormalRandomVariable::INFINITE_VALUE) [member function]
cls.add_method('GetValue',
'double',
[param('double', 'mean'), param('double', 'variance'), param('double', 'bound', default_value='ns3::NormalRandomVariable::INFINITE_VALUE')])
## random-variable-stream.h (module 'core'): uint32_t ns3::NormalRandomVariable::GetInteger(uint32_t mean, uint32_t variance, uint32_t bound) [member function]
cls.add_method('GetInteger',
'uint32_t',
[param('uint32_t', 'mean'), param('uint32_t', 'variance'), param('uint32_t', 'bound')])
## random-variable-stream.h (module 'core'): double ns3::NormalRandomVariable::GetValue() [member function]
cls.add_method('GetValue',
'double',
[],
is_virtual=True)
## random-variable-stream.h (module 'core'): uint32_t ns3::NormalRandomVariable::GetInteger() [member function]
cls.add_method('GetInteger',
'uint32_t',
[],
is_virtual=True)
return
def register_Ns3ObjectFactoryChecker_methods(root_module, cls):
## object-factory.h (module 'core'): ns3::ObjectFactoryChecker::ObjectFactoryChecker() [constructor]
cls.add_constructor([])
## object-factory.h (module 'core'): ns3::ObjectFactoryChecker::ObjectFactoryChecker(ns3::ObjectFactoryChecker const & arg0) [constructor]
cls.add_constructor([param('ns3::ObjectFactoryChecker const &', 'arg0')])
return
def register_Ns3ObjectFactoryValue_methods(root_module, cls):
## object-factory.h (module 'core'): ns3::ObjectFactoryValue::ObjectFactoryValue() [constructor]
cls.add_constructor([])
## object-factory.h (module 'core'): ns3::ObjectFactoryValue::ObjectFactoryValue(ns3::ObjectFactory const & value) [constructor]
cls.add_constructor([param('ns3::ObjectFactory const &', 'value')])
## object-factory.h (module 'core'): ns3::ObjectFactoryValue::ObjectFactoryValue(ns3::ObjectFactoryValue const & arg0) [constructor]
cls.add_constructor([param('ns3::ObjectFactoryValue const &', 'arg0')])
## object-factory.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::ObjectFactoryValue::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::AttributeValue >',
[],
is_const=True, is_virtual=True)
## object-factory.h (module 'core'): bool ns3::ObjectFactoryValue::DeserializeFromString(std::string value, ns3::Ptr<const ns3::AttributeChecker> checker) [member function]
cls.add_method('DeserializeFromString',
'bool',
[param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_virtual=True)
## object-factory.h (module 'core'): ns3::ObjectFactory ns3::ObjectFactoryValue::Get() const [member function]
cls.add_method('Get',
'ns3::ObjectFactory',
[],
is_const=True)
## object-factory.h (module 'core'): std::string ns3::ObjectFactoryValue::SerializeToString(ns3::Ptr<const ns3::AttributeChecker> checker) const [member function]
cls.add_method('SerializeToString',
'std::string',
[param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_const=True, is_virtual=True)
## object-factory.h (module 'core'): void ns3::ObjectFactoryValue::Set(ns3::ObjectFactory const & value) [member function]
cls.add_method('Set',
'void',
[param('ns3::ObjectFactory const &', 'value')])
return
def register_Ns3OutputStreamWrapper_methods(root_module, cls):
## output-stream-wrapper.h (module 'network'): ns3::OutputStreamWrapper::OutputStreamWrapper(ns3::OutputStreamWrapper const & arg0) [constructor]
cls.add_constructor([param('ns3::OutputStreamWrapper const &', 'arg0')])
## output-stream-wrapper.h (module 'network'): ns3::OutputStreamWrapper::OutputStreamWrapper(std::string filename, std::ios_base::openmode filemode) [constructor]
cls.add_constructor([param('std::string', 'filename'), param('std::ios_base::openmode', 'filemode')])
## output-stream-wrapper.h (module 'network'): ns3::OutputStreamWrapper::OutputStreamWrapper(std::ostream * os) [constructor]
cls.add_constructor([param('std::ostream *', 'os')])
## output-stream-wrapper.h (module 'network'): std::ostream * ns3::OutputStreamWrapper::GetStream() [member function]
cls.add_method('GetStream',
'std::ostream *',
[])
return
def register_Ns3Packet_methods(root_module, cls):
cls.add_output_stream_operator()
## packet.h (module 'network'): ns3::Packet::Packet() [constructor]
cls.add_constructor([])
## packet.h (module 'network'): ns3::Packet::Packet(ns3::Packet const & o) [constructor]
cls.add_constructor([param('ns3::Packet const &', 'o')])
## packet.h (module 'network'): ns3::Packet::Packet(uint32_t size) [constructor]
cls.add_constructor([param('uint32_t', 'size')])
## packet.h (module 'network'): ns3::Packet::Packet(uint8_t const * buffer, uint32_t size, bool magic) [constructor]
cls.add_constructor([param('uint8_t const *', 'buffer'), param('uint32_t', 'size'), param('bool', 'magic')])
## packet.h (module 'network'): ns3::Packet::Packet(uint8_t const * buffer, uint32_t size) [constructor]
cls.add_constructor([param('uint8_t const *', 'buffer'), param('uint32_t', 'size')])
## packet.h (module 'network'): void ns3::Packet::AddAtEnd(ns3::Ptr<const ns3::Packet> packet) [member function]
cls.add_method('AddAtEnd',
'void',
[param('ns3::Ptr< ns3::Packet const >', 'packet')])
## packet.h (module 'network'): void ns3::Packet::AddByteTag(ns3::Tag const & tag) const [member function]
cls.add_method('AddByteTag',
'void',
[param('ns3::Tag const &', 'tag')],
is_const=True)
## packet.h (module 'network'): void ns3::Packet::AddByteTag(ns3::Tag const & tag, uint32_t start, uint32_t end) const [member function]
cls.add_method('AddByteTag',
'void',
[param('ns3::Tag const &', 'tag'), param('uint32_t', 'start'), param('uint32_t', 'end')],
is_const=True)
## packet.h (module 'network'): void ns3::Packet::AddHeader(ns3::Header const & header) [member function]
cls.add_method('AddHeader',
'void',
[param('ns3::Header const &', 'header')])
## packet.h (module 'network'): void ns3::Packet::AddPacketTag(ns3::Tag const & tag) const [member function]
cls.add_method('AddPacketTag',
'void',
[param('ns3::Tag const &', 'tag')],
is_const=True)
## packet.h (module 'network'): void ns3::Packet::AddPaddingAtEnd(uint32_t size) [member function]
cls.add_method('AddPaddingAtEnd',
'void',
[param('uint32_t', 'size')])
## packet.h (module 'network'): void ns3::Packet::AddTrailer(ns3::Trailer const & trailer) [member function]
cls.add_method('AddTrailer',
'void',
[param('ns3::Trailer const &', 'trailer')])
## packet.h (module 'network'): ns3::PacketMetadata::ItemIterator ns3::Packet::BeginItem() const [member function]
cls.add_method('BeginItem',
'ns3::PacketMetadata::ItemIterator',
[],
is_const=True)
## packet.h (module 'network'): ns3::Ptr<ns3::Packet> ns3::Packet::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::Packet >',
[],
is_const=True)
## packet.h (module 'network'): uint32_t ns3::Packet::CopyData(uint8_t * buffer, uint32_t size) const [member function]
cls.add_method('CopyData',
'uint32_t',
[param('uint8_t *', 'buffer'), param('uint32_t', 'size')],
is_const=True)
## packet.h (module 'network'): void ns3::Packet::CopyData(std::ostream * os, uint32_t size) const [member function]
cls.add_method('CopyData',
'void',
[param('std::ostream *', 'os'), param('uint32_t', 'size')],
is_const=True)
## packet.h (module 'network'): ns3::Ptr<ns3::Packet> ns3::Packet::CreateFragment(uint32_t start, uint32_t length) const [member function]
cls.add_method('CreateFragment',
'ns3::Ptr< ns3::Packet >',
[param('uint32_t', 'start'), param('uint32_t', 'length')],
is_const=True)
## packet.h (module 'network'): static void ns3::Packet::EnableChecking() [member function]
cls.add_method('EnableChecking',
'void',
[],
is_static=True)
## packet.h (module 'network'): static void ns3::Packet::EnablePrinting() [member function]
cls.add_method('EnablePrinting',
'void',
[],
is_static=True)
## packet.h (module 'network'): bool ns3::Packet::FindFirstMatchingByteTag(ns3::Tag & tag) const [member function]
cls.add_method('FindFirstMatchingByteTag',
'bool',
[param('ns3::Tag &', 'tag')],
is_const=True)
## packet.h (module 'network'): ns3::ByteTagIterator ns3::Packet::GetByteTagIterator() const [member function]
cls.add_method('GetByteTagIterator',
'ns3::ByteTagIterator',
[],
is_const=True)
## packet.h (module 'network'): ns3::Ptr<ns3::NixVector> ns3::Packet::GetNixVector() const [member function]
cls.add_method('GetNixVector',
'ns3::Ptr< ns3::NixVector >',
[],
is_const=True)
## packet.h (module 'network'): ns3::PacketTagIterator ns3::Packet::GetPacketTagIterator() const [member function]
cls.add_method('GetPacketTagIterator',
'ns3::PacketTagIterator',
[],
is_const=True)
## packet.h (module 'network'): uint32_t ns3::Packet::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True)
## packet.h (module 'network'): uint32_t ns3::Packet::GetSize() const [member function]
cls.add_method('GetSize',
'uint32_t',
[],
is_const=True)
## packet.h (module 'network'): uint64_t ns3::Packet::GetUid() const [member function]
cls.add_method('GetUid',
'uint64_t',
[],
is_const=True)
## packet.h (module 'network'): uint32_t ns3::Packet::PeekHeader(ns3::Header & header) const [member function]
cls.add_method('PeekHeader',
'uint32_t',
[param('ns3::Header &', 'header')],
is_const=True)
## packet.h (module 'network'): uint32_t ns3::Packet::PeekHeader(ns3::Header & header, uint32_t size) const [member function]
cls.add_method('PeekHeader',
'uint32_t',
[param('ns3::Header &', 'header'), param('uint32_t', 'size')],
is_const=True)
## packet.h (module 'network'): bool ns3::Packet::PeekPacketTag(ns3::Tag & tag) const [member function]
cls.add_method('PeekPacketTag',
'bool',
[param('ns3::Tag &', 'tag')],
is_const=True)
## packet.h (module 'network'): uint32_t ns3::Packet::PeekTrailer(ns3::Trailer & trailer) [member function]
cls.add_method('PeekTrailer',
'uint32_t',
[param('ns3::Trailer &', 'trailer')])
## packet.h (module 'network'): void ns3::Packet::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True)
## packet.h (module 'network'): void ns3::Packet::PrintByteTags(std::ostream & os) const [member function]
cls.add_method('PrintByteTags',
'void',
[param('std::ostream &', 'os')],
is_const=True)
## packet.h (module 'network'): void ns3::Packet::PrintPacketTags(std::ostream & os) const [member function]
cls.add_method('PrintPacketTags',
'void',
[param('std::ostream &', 'os')],
is_const=True)
## packet.h (module 'network'): void ns3::Packet::RemoveAllByteTags() [member function]
cls.add_method('RemoveAllByteTags',
'void',
[])
## packet.h (module 'network'): void ns3::Packet::RemoveAllPacketTags() [member function]
cls.add_method('RemoveAllPacketTags',
'void',
[])
## packet.h (module 'network'): void ns3::Packet::RemoveAtEnd(uint32_t size) [member function]
cls.add_method('RemoveAtEnd',
'void',
[param('uint32_t', 'size')])
## packet.h (module 'network'): void ns3::Packet::RemoveAtStart(uint32_t size) [member function]
cls.add_method('RemoveAtStart',
'void',
[param('uint32_t', 'size')])
## packet.h (module 'network'): uint32_t ns3::Packet::RemoveHeader(ns3::Header & header) [member function]
cls.add_method('RemoveHeader',
'uint32_t',
[param('ns3::Header &', 'header')])
## packet.h (module 'network'): uint32_t ns3::Packet::RemoveHeader(ns3::Header & header, uint32_t size) [member function]
cls.add_method('RemoveHeader',
'uint32_t',
[param('ns3::Header &', 'header'), param('uint32_t', 'size')])
## packet.h (module 'network'): bool ns3::Packet::RemovePacketTag(ns3::Tag & tag) [member function]
cls.add_method('RemovePacketTag',
'bool',
[param('ns3::Tag &', 'tag')])
## packet.h (module 'network'): uint32_t ns3::Packet::RemoveTrailer(ns3::Trailer & trailer) [member function]
cls.add_method('RemoveTrailer',
'uint32_t',
[param('ns3::Trailer &', 'trailer')])
## packet.h (module 'network'): bool ns3::Packet::ReplacePacketTag(ns3::Tag & tag) [member function]
cls.add_method('ReplacePacketTag',
'bool',
[param('ns3::Tag &', 'tag')])
## packet.h (module 'network'): uint32_t ns3::Packet::Serialize(uint8_t * buffer, uint32_t maxSize) const [member function]
cls.add_method('Serialize',
'uint32_t',
[param('uint8_t *', 'buffer'), param('uint32_t', 'maxSize')],
is_const=True)
## packet.h (module 'network'): void ns3::Packet::SetNixVector(ns3::Ptr<ns3::NixVector> nixVector) [member function]
cls.add_method('SetNixVector',
'void',
[param('ns3::Ptr< ns3::NixVector >', 'nixVector')])
## packet.h (module 'network'): std::string ns3::Packet::ToString() const [member function]
cls.add_method('ToString',
'std::string',
[],
is_const=True)
return
def register_Ns3ParetoRandomVariable_methods(root_module, cls):
## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::ParetoRandomVariable::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## random-variable-stream.h (module 'core'): ns3::ParetoRandomVariable::ParetoRandomVariable() [constructor]
cls.add_constructor([])
## random-variable-stream.h (module 'core'): double ns3::ParetoRandomVariable::GetScale() const [member function]
cls.add_method('GetScale',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::ParetoRandomVariable::GetShape() const [member function]
cls.add_method('GetShape',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::ParetoRandomVariable::GetBound() const [member function]
cls.add_method('GetBound',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::ParetoRandomVariable::GetValue(double scale, double shape, double bound) [member function]
cls.add_method('GetValue',
'double',
[param('double', 'scale'), param('double', 'shape'), param('double', 'bound')])
## random-variable-stream.h (module 'core'): uint32_t ns3::ParetoRandomVariable::GetInteger(uint32_t scale, uint32_t shape, uint32_t bound) [member function]
cls.add_method('GetInteger',
'uint32_t',
[param('uint32_t', 'scale'), param('uint32_t', 'shape'), param('uint32_t', 'bound')])
## random-variable-stream.h (module 'core'): double ns3::ParetoRandomVariable::GetValue() [member function]
cls.add_method('GetValue',
'double',
[],
is_virtual=True)
## random-variable-stream.h (module 'core'): uint32_t ns3::ParetoRandomVariable::GetInteger() [member function]
cls.add_method('GetInteger',
'uint32_t',
[],
is_virtual=True)
return
def register_Ns3TcpL4Protocol_methods(root_module, cls):
## tcp-l4-protocol.h (module 'internet'): static ns3::TypeId ns3::TcpL4Protocol::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## tcp-l4-protocol.h (module 'internet'): ns3::TcpL4Protocol::PROT_NUMBER [variable]
cls.add_static_attribute('PROT_NUMBER', 'uint8_t const', is_const=True)
## tcp-l4-protocol.h (module 'internet'): ns3::TcpL4Protocol::TcpL4Protocol() [constructor]
cls.add_constructor([])
## tcp-l4-protocol.h (module 'internet'): void ns3::TcpL4Protocol::SetNode(ns3::Ptr<ns3::Node> node) [member function]
cls.add_method('SetNode',
'void',
[param('ns3::Ptr< ns3::Node >', 'node')])
## tcp-l4-protocol.h (module 'internet'): ns3::Ptr<ns3::Socket> ns3::TcpL4Protocol::CreateSocket() [member function]
cls.add_method('CreateSocket',
'ns3::Ptr< ns3::Socket >',
[])
## tcp-l4-protocol.h (module 'internet'): ns3::Ptr<ns3::Socket> ns3::TcpL4Protocol::CreateSocket(ns3::TypeId congestionTypeId, ns3::TypeId recoveryTypeId) [member function]
cls.add_method('CreateSocket',
'ns3::Ptr< ns3::Socket >',
[param('ns3::TypeId', 'congestionTypeId'), param('ns3::TypeId', 'recoveryTypeId')])
## tcp-l4-protocol.h (module 'internet'): ns3::Ptr<ns3::Socket> ns3::TcpL4Protocol::CreateSocket(ns3::TypeId congestionTypeId) [member function]
cls.add_method('CreateSocket',
'ns3::Ptr< ns3::Socket >',
[param('ns3::TypeId', 'congestionTypeId')])
## tcp-l4-protocol.h (module 'internet'): ns3::Ipv4EndPoint * ns3::TcpL4Protocol::Allocate() [member function]
cls.add_method('Allocate',
'ns3::Ipv4EndPoint *',
[])
## tcp-l4-protocol.h (module 'internet'): ns3::Ipv4EndPoint * ns3::TcpL4Protocol::Allocate(ns3::Ipv4Address address) [member function]
cls.add_method('Allocate',
'ns3::Ipv4EndPoint *',
[param('ns3::Ipv4Address', 'address')])
## tcp-l4-protocol.h (module 'internet'): ns3::Ipv4EndPoint * ns3::TcpL4Protocol::Allocate(ns3::Ptr<ns3::NetDevice> boundNetDevice, uint16_t port) [member function]
cls.add_method('Allocate',
'ns3::Ipv4EndPoint *',
[param('ns3::Ptr< ns3::NetDevice >', 'boundNetDevice'), param('uint16_t', 'port')])
## tcp-l4-protocol.h (module 'internet'): ns3::Ipv4EndPoint * ns3::TcpL4Protocol::Allocate(ns3::Ptr<ns3::NetDevice> boundNetDevice, ns3::Ipv4Address address, uint16_t port) [member function]
cls.add_method('Allocate',
'ns3::Ipv4EndPoint *',
[param('ns3::Ptr< ns3::NetDevice >', 'boundNetDevice'), param('ns3::Ipv4Address', 'address'), param('uint16_t', 'port')])
## tcp-l4-protocol.h (module 'internet'): ns3::Ipv4EndPoint * ns3::TcpL4Protocol::Allocate(ns3::Ptr<ns3::NetDevice> boundNetDevice, ns3::Ipv4Address localAddress, uint16_t localPort, ns3::Ipv4Address peerAddress, uint16_t peerPort) [member function]
cls.add_method('Allocate',
'ns3::Ipv4EndPoint *',
[param('ns3::Ptr< ns3::NetDevice >', 'boundNetDevice'), param('ns3::Ipv4Address', 'localAddress'), param('uint16_t', 'localPort'), param('ns3::Ipv4Address', 'peerAddress'), param('uint16_t', 'peerPort')])
## tcp-l4-protocol.h (module 'internet'): ns3::Ipv6EndPoint * ns3::TcpL4Protocol::Allocate6() [member function]
cls.add_method('Allocate6',
'ns3::Ipv6EndPoint *',
[])
## tcp-l4-protocol.h (module 'internet'): ns3::Ipv6EndPoint * ns3::TcpL4Protocol::Allocate6(ns3::Ipv6Address address) [member function]
cls.add_method('Allocate6',
'ns3::Ipv6EndPoint *',
[param('ns3::Ipv6Address', 'address')])
## tcp-l4-protocol.h (module 'internet'): ns3::Ipv6EndPoint * ns3::TcpL4Protocol::Allocate6(ns3::Ptr<ns3::NetDevice> boundNetDevice, uint16_t port) [member function]
cls.add_method('Allocate6',
'ns3::Ipv6EndPoint *',
[param('ns3::Ptr< ns3::NetDevice >', 'boundNetDevice'), param('uint16_t', 'port')])
## tcp-l4-protocol.h (module 'internet'): ns3::Ipv6EndPoint * ns3::TcpL4Protocol::Allocate6(ns3::Ptr<ns3::NetDevice> boundNetDevice, ns3::Ipv6Address address, uint16_t port) [member function]
cls.add_method('Allocate6',
'ns3::Ipv6EndPoint *',
[param('ns3::Ptr< ns3::NetDevice >', 'boundNetDevice'), param('ns3::Ipv6Address', 'address'), param('uint16_t', 'port')])
## tcp-l4-protocol.h (module 'internet'): ns3::Ipv6EndPoint * ns3::TcpL4Protocol::Allocate6(ns3::Ptr<ns3::NetDevice> boundNetDevice, ns3::Ipv6Address localAddress, uint16_t localPort, ns3::Ipv6Address peerAddress, uint16_t peerPort) [member function]
cls.add_method('Allocate6',
'ns3::Ipv6EndPoint *',
[param('ns3::Ptr< ns3::NetDevice >', 'boundNetDevice'), param('ns3::Ipv6Address', 'localAddress'), param('uint16_t', 'localPort'), param('ns3::Ipv6Address', 'peerAddress'), param('uint16_t', 'peerPort')])
## tcp-l4-protocol.h (module 'internet'): void ns3::TcpL4Protocol::SendPacket(ns3::Ptr<ns3::Packet> pkt, ns3::TcpHeader const & outgoing, ns3::Address const & saddr, ns3::Address const & daddr, ns3::Ptr<ns3::NetDevice> oif=0) const [member function]
cls.add_method('SendPacket',
'void',
[param('ns3::Ptr< ns3::Packet >', 'pkt'), param('ns3::TcpHeader const &', 'outgoing'), param('ns3::Address const &', 'saddr'), param('ns3::Address const &', 'daddr'), param('ns3::Ptr< ns3::NetDevice >', 'oif', default_value='0')],
is_const=True)
## tcp-l4-protocol.h (module 'internet'): void ns3::TcpL4Protocol::AddSocket(ns3::Ptr<ns3::TcpSocketBase> socket) [member function]
cls.add_method('AddSocket',
'void',
[param('ns3::Ptr< ns3::TcpSocketBase >', 'socket')])
## tcp-l4-protocol.h (module 'internet'): bool ns3::TcpL4Protocol::RemoveSocket(ns3::Ptr<ns3::TcpSocketBase> socket) [member function]
cls.add_method('RemoveSocket',
'bool',
[param('ns3::Ptr< ns3::TcpSocketBase >', 'socket')])
## tcp-l4-protocol.h (module 'internet'): void ns3::TcpL4Protocol::DeAllocate(ns3::Ipv4EndPoint * endPoint) [member function]
cls.add_method('DeAllocate',
'void',
[param('ns3::Ipv4EndPoint *', 'endPoint')])
## tcp-l4-protocol.h (module 'internet'): void ns3::TcpL4Protocol::DeAllocate(ns3::Ipv6EndPoint * endPoint) [member function]
cls.add_method('DeAllocate',
'void',
[param('ns3::Ipv6EndPoint *', 'endPoint')])
## tcp-l4-protocol.h (module 'internet'): ns3::IpL4Protocol::RxStatus ns3::TcpL4Protocol::Receive(ns3::Ptr<ns3::Packet> p, ns3::Ipv4Header const & incomingIpHeader, ns3::Ptr<ns3::Ipv4Interface> incomingInterface) [member function]
cls.add_method('Receive',
'ns3::IpL4Protocol::RxStatus',
[param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ipv4Header const &', 'incomingIpHeader'), param('ns3::Ptr< ns3::Ipv4Interface >', 'incomingInterface')],
is_virtual=True)
## tcp-l4-protocol.h (module 'internet'): ns3::IpL4Protocol::RxStatus ns3::TcpL4Protocol::Receive(ns3::Ptr<ns3::Packet> p, ns3::Ipv6Header const & incomingIpHeader, ns3::Ptr<ns3::Ipv6Interface> incomingInterface) [member function]
cls.add_method('Receive',
'ns3::IpL4Protocol::RxStatus',
[param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ipv6Header const &', 'incomingIpHeader'), param('ns3::Ptr< ns3::Ipv6Interface >', 'incomingInterface')],
is_virtual=True)
## tcp-l4-protocol.h (module 'internet'): void ns3::TcpL4Protocol::ReceiveIcmp(ns3::Ipv4Address icmpSource, uint8_t icmpTtl, uint8_t icmpType, uint8_t icmpCode, uint32_t icmpInfo, ns3::Ipv4Address payloadSource, ns3::Ipv4Address payloadDestination, uint8_t const * payload) [member function]
cls.add_method('ReceiveIcmp',
'void',
[param('ns3::Ipv4Address', 'icmpSource'), param('uint8_t', 'icmpTtl'), param('uint8_t', 'icmpType'), param('uint8_t', 'icmpCode'), param('uint32_t', 'icmpInfo'), param('ns3::Ipv4Address', 'payloadSource'), param('ns3::Ipv4Address', 'payloadDestination'), param('uint8_t const *', 'payload')],
is_virtual=True)
## tcp-l4-protocol.h (module 'internet'): void ns3::TcpL4Protocol::ReceiveIcmp(ns3::Ipv6Address icmpSource, uint8_t icmpTtl, uint8_t icmpType, uint8_t icmpCode, uint32_t icmpInfo, ns3::Ipv6Address payloadSource, ns3::Ipv6Address payloadDestination, uint8_t const * payload) [member function]
cls.add_method('ReceiveIcmp',
'void',
[param('ns3::Ipv6Address', 'icmpSource'), param('uint8_t', 'icmpTtl'), param('uint8_t', 'icmpType'), param('uint8_t', 'icmpCode'), param('uint32_t', 'icmpInfo'), param('ns3::Ipv6Address', 'payloadSource'), param('ns3::Ipv6Address', 'payloadDestination'), param('uint8_t const *', 'payload')],
is_virtual=True)
## tcp-l4-protocol.h (module 'internet'): void ns3::TcpL4Protocol::SetDownTarget(ns3::IpL4Protocol::DownTargetCallback cb) [member function]
cls.add_method('SetDownTarget',
'void',
[param('ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::Ipv4Address, ns3::Ipv4Address, unsigned char, ns3::Ptr< ns3::Ipv4Route >, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'cb')],
is_virtual=True)
## tcp-l4-protocol.h (module 'internet'): void ns3::TcpL4Protocol::SetDownTarget6(ns3::IpL4Protocol::DownTargetCallback6 cb) [member function]
cls.add_method('SetDownTarget6',
'void',
[param('ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::Ipv6Address, ns3::Ipv6Address, unsigned char, ns3::Ptr< ns3::Ipv6Route >, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'cb')],
is_virtual=True)
## tcp-l4-protocol.h (module 'internet'): int ns3::TcpL4Protocol::GetProtocolNumber() const [member function]
cls.add_method('GetProtocolNumber',
'int',
[],
is_const=True, is_virtual=True)
## tcp-l4-protocol.h (module 'internet'): ns3::IpL4Protocol::DownTargetCallback ns3::TcpL4Protocol::GetDownTarget() const [member function]
cls.add_method('GetDownTarget',
'ns3::IpL4Protocol::DownTargetCallback',
[],
is_const=True, is_virtual=True)
## tcp-l4-protocol.h (module 'internet'): ns3::IpL4Protocol::DownTargetCallback6 ns3::TcpL4Protocol::GetDownTarget6() const [member function]
cls.add_method('GetDownTarget6',
'ns3::IpL4Protocol::DownTargetCallback6',
[],
is_const=True, is_virtual=True)
## tcp-l4-protocol.h (module 'internet'): void ns3::TcpL4Protocol::DoDispose() [member function]
cls.add_method('DoDispose',
'void',
[],
is_virtual=True, visibility='protected')
## tcp-l4-protocol.h (module 'internet'): void ns3::TcpL4Protocol::NotifyNewAggregate() [member function]
cls.add_method('NotifyNewAggregate',
'void',
[],
is_virtual=True, visibility='protected')
## tcp-l4-protocol.h (module 'internet'): ns3::IpL4Protocol::RxStatus ns3::TcpL4Protocol::PacketReceived(ns3::Ptr<ns3::Packet> packet, ns3::TcpHeader & incomingTcpHeader, ns3::Address const & source, ns3::Address const & destination) [member function]
cls.add_method('PacketReceived',
'ns3::IpL4Protocol::RxStatus',
[param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::TcpHeader &', 'incomingTcpHeader'), param('ns3::Address const &', 'source'), param('ns3::Address const &', 'destination')],
visibility='protected')
## tcp-l4-protocol.h (module 'internet'): void ns3::TcpL4Protocol::NoEndPointsFound(ns3::TcpHeader const & incomingHeader, ns3::Address const & incomingSAddr, ns3::Address const & incomingDAddr) [member function]
cls.add_method('NoEndPointsFound',
'void',
[param('ns3::TcpHeader const &', 'incomingHeader'), param('ns3::Address const &', 'incomingSAddr'), param('ns3::Address const &', 'incomingDAddr')],
visibility='protected')
return
def register_Ns3TimeValue_methods(root_module, cls):
## nstime.h (module 'core'): ns3::TimeValue::TimeValue() [constructor]
cls.add_constructor([])
## nstime.h (module 'core'): ns3::TimeValue::TimeValue(ns3::Time const & value) [constructor]
cls.add_constructor([param('ns3::Time const &', 'value')])
## nstime.h (module 'core'): ns3::TimeValue::TimeValue(ns3::TimeValue const & arg0) [constructor]
cls.add_constructor([param('ns3::TimeValue const &', 'arg0')])
## nstime.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::TimeValue::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::AttributeValue >',
[],
is_const=True, is_virtual=True)
## nstime.h (module 'core'): bool ns3::TimeValue::DeserializeFromString(std::string value, ns3::Ptr<const ns3::AttributeChecker> checker) [member function]
cls.add_method('DeserializeFromString',
'bool',
[param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_virtual=True)
## nstime.h (module 'core'): ns3::Time ns3::TimeValue::Get() const [member function]
cls.add_method('Get',
'ns3::Time',
[],
is_const=True)
## nstime.h (module 'core'): std::string ns3::TimeValue::SerializeToString(ns3::Ptr<const ns3::AttributeChecker> checker) const [member function]
cls.add_method('SerializeToString',
'std::string',
[param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_const=True, is_virtual=True)
## nstime.h (module 'core'): void ns3::TimeValue::Set(ns3::Time const & value) [member function]
cls.add_method('Set',
'void',
[param('ns3::Time const &', 'value')])
return
def register_Ns3TypeIdChecker_methods(root_module, cls):
## type-id.h (module 'core'): ns3::TypeIdChecker::TypeIdChecker() [constructor]
cls.add_constructor([])
## type-id.h (module 'core'): ns3::TypeIdChecker::TypeIdChecker(ns3::TypeIdChecker const & arg0) [constructor]
cls.add_constructor([param('ns3::TypeIdChecker const &', 'arg0')])
return
def register_Ns3TypeIdValue_methods(root_module, cls):
## type-id.h (module 'core'): ns3::TypeIdValue::TypeIdValue() [constructor]
cls.add_constructor([])
## type-id.h (module 'core'): ns3::TypeIdValue::TypeIdValue(ns3::TypeId const & value) [constructor]
cls.add_constructor([param('ns3::TypeId const &', 'value')])
## type-id.h (module 'core'): ns3::TypeIdValue::TypeIdValue(ns3::TypeIdValue const & arg0) [constructor]
cls.add_constructor([param('ns3::TypeIdValue const &', 'arg0')])
## type-id.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::TypeIdValue::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::AttributeValue >',
[],
is_const=True, is_virtual=True)
## type-id.h (module 'core'): bool ns3::TypeIdValue::DeserializeFromString(std::string value, ns3::Ptr<const ns3::AttributeChecker> checker) [member function]
cls.add_method('DeserializeFromString',
'bool',
[param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_virtual=True)
## type-id.h (module 'core'): ns3::TypeId ns3::TypeIdValue::Get() const [member function]
cls.add_method('Get',
'ns3::TypeId',
[],
is_const=True)
## type-id.h (module 'core'): std::string ns3::TypeIdValue::SerializeToString(ns3::Ptr<const ns3::AttributeChecker> checker) const [member function]
cls.add_method('SerializeToString',
'std::string',
[param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_const=True, is_virtual=True)
## type-id.h (module 'core'): void ns3::TypeIdValue::Set(ns3::TypeId const & value) [member function]
cls.add_method('Set',
'void',
[param('ns3::TypeId const &', 'value')])
return
def register_Ns3UdpL4Protocol_methods(root_module, cls):
## udp-l4-protocol.h (module 'internet'): static ns3::TypeId ns3::UdpL4Protocol::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## udp-l4-protocol.h (module 'internet'): ns3::UdpL4Protocol::PROT_NUMBER [variable]
cls.add_static_attribute('PROT_NUMBER', 'uint8_t const', is_const=True)
## udp-l4-protocol.h (module 'internet'): ns3::UdpL4Protocol::UdpL4Protocol() [constructor]
cls.add_constructor([])
## udp-l4-protocol.h (module 'internet'): void ns3::UdpL4Protocol::SetNode(ns3::Ptr<ns3::Node> node) [member function]
cls.add_method('SetNode',
'void',
[param('ns3::Ptr< ns3::Node >', 'node')])
## udp-l4-protocol.h (module 'internet'): int ns3::UdpL4Protocol::GetProtocolNumber() const [member function]
cls.add_method('GetProtocolNumber',
'int',
[],
is_const=True, is_virtual=True)
## udp-l4-protocol.h (module 'internet'): ns3::Ptr<ns3::Socket> ns3::UdpL4Protocol::CreateSocket() [member function]
cls.add_method('CreateSocket',
'ns3::Ptr< ns3::Socket >',
[])
## udp-l4-protocol.h (module 'internet'): ns3::Ipv4EndPoint * ns3::UdpL4Protocol::Allocate() [member function]
cls.add_method('Allocate',
'ns3::Ipv4EndPoint *',
[])
## udp-l4-protocol.h (module 'internet'): ns3::Ipv4EndPoint * ns3::UdpL4Protocol::Allocate(ns3::Ipv4Address address) [member function]
cls.add_method('Allocate',
'ns3::Ipv4EndPoint *',
[param('ns3::Ipv4Address', 'address')])
## udp-l4-protocol.h (module 'internet'): ns3::Ipv4EndPoint * ns3::UdpL4Protocol::Allocate(ns3::Ptr<ns3::NetDevice> boundNetDevice, uint16_t port) [member function]
cls.add_method('Allocate',
'ns3::Ipv4EndPoint *',
[param('ns3::Ptr< ns3::NetDevice >', 'boundNetDevice'), param('uint16_t', 'port')])
## udp-l4-protocol.h (module 'internet'): ns3::Ipv4EndPoint * ns3::UdpL4Protocol::Allocate(ns3::Ptr<ns3::NetDevice> boundNetDevice, ns3::Ipv4Address address, uint16_t port) [member function]
cls.add_method('Allocate',
'ns3::Ipv4EndPoint *',
[param('ns3::Ptr< ns3::NetDevice >', 'boundNetDevice'), param('ns3::Ipv4Address', 'address'), param('uint16_t', 'port')])
## udp-l4-protocol.h (module 'internet'): ns3::Ipv4EndPoint * ns3::UdpL4Protocol::Allocate(ns3::Ptr<ns3::NetDevice> boundNetDevice, ns3::Ipv4Address localAddress, uint16_t localPort, ns3::Ipv4Address peerAddress, uint16_t peerPort) [member function]
cls.add_method('Allocate',
'ns3::Ipv4EndPoint *',
[param('ns3::Ptr< ns3::NetDevice >', 'boundNetDevice'), param('ns3::Ipv4Address', 'localAddress'), param('uint16_t', 'localPort'), param('ns3::Ipv4Address', 'peerAddress'), param('uint16_t', 'peerPort')])
## udp-l4-protocol.h (module 'internet'): ns3::Ipv6EndPoint * ns3::UdpL4Protocol::Allocate6() [member function]
cls.add_method('Allocate6',
'ns3::Ipv6EndPoint *',
[])
## udp-l4-protocol.h (module 'internet'): ns3::Ipv6EndPoint * ns3::UdpL4Protocol::Allocate6(ns3::Ipv6Address address) [member function]
cls.add_method('Allocate6',
'ns3::Ipv6EndPoint *',
[param('ns3::Ipv6Address', 'address')])
## udp-l4-protocol.h (module 'internet'): ns3::Ipv6EndPoint * ns3::UdpL4Protocol::Allocate6(ns3::Ptr<ns3::NetDevice> boundNetDevice, uint16_t port) [member function]
cls.add_method('Allocate6',
'ns3::Ipv6EndPoint *',
[param('ns3::Ptr< ns3::NetDevice >', 'boundNetDevice'), param('uint16_t', 'port')])
## udp-l4-protocol.h (module 'internet'): ns3::Ipv6EndPoint * ns3::UdpL4Protocol::Allocate6(ns3::Ptr<ns3::NetDevice> boundNetDevice, ns3::Ipv6Address address, uint16_t port) [member function]
cls.add_method('Allocate6',
'ns3::Ipv6EndPoint *',
[param('ns3::Ptr< ns3::NetDevice >', 'boundNetDevice'), param('ns3::Ipv6Address', 'address'), param('uint16_t', 'port')])
## udp-l4-protocol.h (module 'internet'): ns3::Ipv6EndPoint * ns3::UdpL4Protocol::Allocate6(ns3::Ptr<ns3::NetDevice> boundNetDevice, ns3::Ipv6Address localAddress, uint16_t localPort, ns3::Ipv6Address peerAddress, uint16_t peerPort) [member function]
cls.add_method('Allocate6',
'ns3::Ipv6EndPoint *',
[param('ns3::Ptr< ns3::NetDevice >', 'boundNetDevice'), param('ns3::Ipv6Address', 'localAddress'), param('uint16_t', 'localPort'), param('ns3::Ipv6Address', 'peerAddress'), param('uint16_t', 'peerPort')])
## udp-l4-protocol.h (module 'internet'): void ns3::UdpL4Protocol::DeAllocate(ns3::Ipv4EndPoint * endPoint) [member function]
cls.add_method('DeAllocate',
'void',
[param('ns3::Ipv4EndPoint *', 'endPoint')])
## udp-l4-protocol.h (module 'internet'): void ns3::UdpL4Protocol::DeAllocate(ns3::Ipv6EndPoint * endPoint) [member function]
cls.add_method('DeAllocate',
'void',
[param('ns3::Ipv6EndPoint *', 'endPoint')])
## udp-l4-protocol.h (module 'internet'): void ns3::UdpL4Protocol::Send(ns3::Ptr<ns3::Packet> packet, ns3::Ipv4Address saddr, ns3::Ipv4Address daddr, uint16_t sport, uint16_t dport) [member function]
cls.add_method('Send',
'void',
[param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ipv4Address', 'saddr'), param('ns3::Ipv4Address', 'daddr'), param('uint16_t', 'sport'), param('uint16_t', 'dport')])
## udp-l4-protocol.h (module 'internet'): void ns3::UdpL4Protocol::Send(ns3::Ptr<ns3::Packet> packet, ns3::Ipv4Address saddr, ns3::Ipv4Address daddr, uint16_t sport, uint16_t dport, ns3::Ptr<ns3::Ipv4Route> route) [member function]
cls.add_method('Send',
'void',
[param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ipv4Address', 'saddr'), param('ns3::Ipv4Address', 'daddr'), param('uint16_t', 'sport'), param('uint16_t', 'dport'), param('ns3::Ptr< ns3::Ipv4Route >', 'route')])
## udp-l4-protocol.h (module 'internet'): void ns3::UdpL4Protocol::Send(ns3::Ptr<ns3::Packet> packet, ns3::Ipv6Address saddr, ns3::Ipv6Address daddr, uint16_t sport, uint16_t dport) [member function]
cls.add_method('Send',
'void',
[param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ipv6Address', 'saddr'), param('ns3::Ipv6Address', 'daddr'), param('uint16_t', 'sport'), param('uint16_t', 'dport')])
## udp-l4-protocol.h (module 'internet'): void ns3::UdpL4Protocol::Send(ns3::Ptr<ns3::Packet> packet, ns3::Ipv6Address saddr, ns3::Ipv6Address daddr, uint16_t sport, uint16_t dport, ns3::Ptr<ns3::Ipv6Route> route) [member function]
cls.add_method('Send',
'void',
[param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ipv6Address', 'saddr'), param('ns3::Ipv6Address', 'daddr'), param('uint16_t', 'sport'), param('uint16_t', 'dport'), param('ns3::Ptr< ns3::Ipv6Route >', 'route')])
## udp-l4-protocol.h (module 'internet'): ns3::IpL4Protocol::RxStatus ns3::UdpL4Protocol::Receive(ns3::Ptr<ns3::Packet> p, ns3::Ipv4Header const & header, ns3::Ptr<ns3::Ipv4Interface> interface) [member function]
cls.add_method('Receive',
'ns3::IpL4Protocol::RxStatus',
[param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ipv4Header const &', 'header'), param('ns3::Ptr< ns3::Ipv4Interface >', 'interface')],
is_virtual=True)
## udp-l4-protocol.h (module 'internet'): ns3::IpL4Protocol::RxStatus ns3::UdpL4Protocol::Receive(ns3::Ptr<ns3::Packet> p, ns3::Ipv6Header const & header, ns3::Ptr<ns3::Ipv6Interface> interface) [member function]
cls.add_method('Receive',
'ns3::IpL4Protocol::RxStatus',
[param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ipv6Header const &', 'header'), param('ns3::Ptr< ns3::Ipv6Interface >', 'interface')],
is_virtual=True)
## udp-l4-protocol.h (module 'internet'): void ns3::UdpL4Protocol::ReceiveIcmp(ns3::Ipv4Address icmpSource, uint8_t icmpTtl, uint8_t icmpType, uint8_t icmpCode, uint32_t icmpInfo, ns3::Ipv4Address payloadSource, ns3::Ipv4Address payloadDestination, uint8_t const * payload) [member function]
cls.add_method('ReceiveIcmp',
'void',
[param('ns3::Ipv4Address', 'icmpSource'), param('uint8_t', 'icmpTtl'), param('uint8_t', 'icmpType'), param('uint8_t', 'icmpCode'), param('uint32_t', 'icmpInfo'), param('ns3::Ipv4Address', 'payloadSource'), param('ns3::Ipv4Address', 'payloadDestination'), param('uint8_t const *', 'payload')],
is_virtual=True)
## udp-l4-protocol.h (module 'internet'): void ns3::UdpL4Protocol::ReceiveIcmp(ns3::Ipv6Address icmpSource, uint8_t icmpTtl, uint8_t icmpType, uint8_t icmpCode, uint32_t icmpInfo, ns3::Ipv6Address payloadSource, ns3::Ipv6Address payloadDestination, uint8_t const * payload) [member function]
cls.add_method('ReceiveIcmp',
'void',
[param('ns3::Ipv6Address', 'icmpSource'), param('uint8_t', 'icmpTtl'), param('uint8_t', 'icmpType'), param('uint8_t', 'icmpCode'), param('uint32_t', 'icmpInfo'), param('ns3::Ipv6Address', 'payloadSource'), param('ns3::Ipv6Address', 'payloadDestination'), param('uint8_t const *', 'payload')],
is_virtual=True)
## udp-l4-protocol.h (module 'internet'): void ns3::UdpL4Protocol::SetDownTarget(ns3::IpL4Protocol::DownTargetCallback cb) [member function]
cls.add_method('SetDownTarget',
'void',
[param('ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::Ipv4Address, ns3::Ipv4Address, unsigned char, ns3::Ptr< ns3::Ipv4Route >, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'cb')],
is_virtual=True)
## udp-l4-protocol.h (module 'internet'): void ns3::UdpL4Protocol::SetDownTarget6(ns3::IpL4Protocol::DownTargetCallback6 cb) [member function]
cls.add_method('SetDownTarget6',
'void',
[param('ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::Ipv6Address, ns3::Ipv6Address, unsigned char, ns3::Ptr< ns3::Ipv6Route >, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'cb')],
is_virtual=True)
## udp-l4-protocol.h (module 'internet'): ns3::IpL4Protocol::DownTargetCallback ns3::UdpL4Protocol::GetDownTarget() const [member function]
cls.add_method('GetDownTarget',
'ns3::IpL4Protocol::DownTargetCallback',
[],
is_const=True, is_virtual=True)
## udp-l4-protocol.h (module 'internet'): ns3::IpL4Protocol::DownTargetCallback6 ns3::UdpL4Protocol::GetDownTarget6() const [member function]
cls.add_method('GetDownTarget6',
'ns3::IpL4Protocol::DownTargetCallback6',
[],
is_const=True, is_virtual=True)
## udp-l4-protocol.h (module 'internet'): void ns3::UdpL4Protocol::DoDispose() [member function]
cls.add_method('DoDispose',
'void',
[],
is_virtual=True, visibility='protected')
## udp-l4-protocol.h (module 'internet'): void ns3::UdpL4Protocol::NotifyNewAggregate() [member function]
cls.add_method('NotifyNewAggregate',
'void',
[],
is_virtual=True, visibility='protected')
return
def register_Ns3UintegerValue_methods(root_module, cls):
## uinteger.h (module 'core'): ns3::UintegerValue::UintegerValue() [constructor]
cls.add_constructor([])
## uinteger.h (module 'core'): ns3::UintegerValue::UintegerValue(uint64_t const & value) [constructor]
cls.add_constructor([param('uint64_t const &', 'value')])
## uinteger.h (module 'core'): ns3::UintegerValue::UintegerValue(ns3::UintegerValue const & arg0) [constructor]
cls.add_constructor([param('ns3::UintegerValue const &', 'arg0')])
## uinteger.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::UintegerValue::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::AttributeValue >',
[],
is_const=True, is_virtual=True)
## uinteger.h (module 'core'): bool ns3::UintegerValue::DeserializeFromString(std::string value, ns3::Ptr<const ns3::AttributeChecker> checker) [member function]
cls.add_method('DeserializeFromString',
'bool',
[param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_virtual=True)
## uinteger.h (module 'core'): uint64_t ns3::UintegerValue::Get() const [member function]
cls.add_method('Get',
'uint64_t',
[],
is_const=True)
## uinteger.h (module 'core'): std::string ns3::UintegerValue::SerializeToString(ns3::Ptr<const ns3::AttributeChecker> checker) const [member function]
cls.add_method('SerializeToString',
'std::string',
[param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_const=True, is_virtual=True)
## uinteger.h (module 'core'): void ns3::UintegerValue::Set(uint64_t const & value) [member function]
cls.add_method('Set',
'void',
[param('uint64_t const &', 'value')])
return
def register_Ns3VhtCapabilities_methods(root_module, cls):
cls.add_output_stream_operator()
## vht-capabilities.h (module 'wifi'): ns3::VhtCapabilities::VhtCapabilities(ns3::VhtCapabilities const & arg0) [constructor]
cls.add_constructor([param('ns3::VhtCapabilities const &', 'arg0')])
## vht-capabilities.h (module 'wifi'): ns3::VhtCapabilities::VhtCapabilities() [constructor]
cls.add_constructor([])
## vht-capabilities.h (module 'wifi'): uint8_t ns3::VhtCapabilities::DeserializeInformationField(ns3::Buffer::Iterator start, uint8_t length) [member function]
cls.add_method('DeserializeInformationField',
'uint8_t',
[param('ns3::Buffer::Iterator', 'start'), param('uint8_t', 'length')],
is_virtual=True)
## vht-capabilities.h (module 'wifi'): ns3::WifiInformationElementId ns3::VhtCapabilities::ElementId() const [member function]
cls.add_method('ElementId',
'ns3::WifiInformationElementId',
[],
is_const=True, is_virtual=True)
## vht-capabilities.h (module 'wifi'): uint8_t ns3::VhtCapabilities::GetInformationFieldSize() const [member function]
cls.add_method('GetInformationFieldSize',
'uint8_t',
[],
is_const=True, is_virtual=True)
## vht-capabilities.h (module 'wifi'): uint32_t ns3::VhtCapabilities::GetMaxAmpduLength() const [member function]
cls.add_method('GetMaxAmpduLength',
'uint32_t',
[],
is_const=True)
## vht-capabilities.h (module 'wifi'): uint16_t ns3::VhtCapabilities::GetMaxMpduLength() const [member function]
cls.add_method('GetMaxMpduLength',
'uint16_t',
[],
is_const=True)
## vht-capabilities.h (module 'wifi'): uint16_t ns3::VhtCapabilities::GetRxHighestSupportedLgiDataRate() const [member function]
cls.add_method('GetRxHighestSupportedLgiDataRate',
'uint16_t',
[],
is_const=True)
## vht-capabilities.h (module 'wifi'): uint8_t ns3::VhtCapabilities::GetRxLdpc() const [member function]
cls.add_method('GetRxLdpc',
'uint8_t',
[],
is_const=True)
## vht-capabilities.h (module 'wifi'): uint8_t ns3::VhtCapabilities::GetRxStbc() const [member function]
cls.add_method('GetRxStbc',
'uint8_t',
[],
is_const=True)
## vht-capabilities.h (module 'wifi'): uint16_t ns3::VhtCapabilities::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint16_t',
[],
is_const=True, is_virtual=True)
## vht-capabilities.h (module 'wifi'): uint8_t ns3::VhtCapabilities::GetSupportedChannelWidthSet() const [member function]
cls.add_method('GetSupportedChannelWidthSet',
'uint8_t',
[],
is_const=True)
## vht-capabilities.h (module 'wifi'): uint64_t ns3::VhtCapabilities::GetSupportedMcsAndNssSet() const [member function]
cls.add_method('GetSupportedMcsAndNssSet',
'uint64_t',
[],
is_const=True)
## vht-capabilities.h (module 'wifi'): uint8_t ns3::VhtCapabilities::GetTxStbc() const [member function]
cls.add_method('GetTxStbc',
'uint8_t',
[],
is_const=True)
## vht-capabilities.h (module 'wifi'): uint32_t ns3::VhtCapabilities::GetVhtCapabilitiesInfo() const [member function]
cls.add_method('GetVhtCapabilitiesInfo',
'uint32_t',
[],
is_const=True)
## vht-capabilities.h (module 'wifi'): bool ns3::VhtCapabilities::IsSupportedMcs(uint8_t mcs, uint8_t nss) const [member function]
cls.add_method('IsSupportedMcs',
'bool',
[param('uint8_t', 'mcs'), param('uint8_t', 'nss')],
is_const=True)
## vht-capabilities.h (module 'wifi'): bool ns3::VhtCapabilities::IsSupportedRxMcs(uint8_t mcs) const [member function]
cls.add_method('IsSupportedRxMcs',
'bool',
[param('uint8_t', 'mcs')],
is_const=True)
## vht-capabilities.h (module 'wifi'): bool ns3::VhtCapabilities::IsSupportedTxMcs(uint8_t mcs) const [member function]
cls.add_method('IsSupportedTxMcs',
'bool',
[param('uint8_t', 'mcs')],
is_const=True)
## vht-capabilities.h (module 'wifi'): ns3::Buffer::Iterator ns3::VhtCapabilities::Serialize(ns3::Buffer::Iterator start) const [member function]
cls.add_method('Serialize',
'ns3::Buffer::Iterator',
[param('ns3::Buffer::Iterator', 'start')],
is_const=True, is_virtual=True)
## vht-capabilities.h (module 'wifi'): void ns3::VhtCapabilities::SerializeInformationField(ns3::Buffer::Iterator start) const [member function]
cls.add_method('SerializeInformationField',
'void',
[param('ns3::Buffer::Iterator', 'start')],
is_const=True, is_virtual=True)
## vht-capabilities.h (module 'wifi'): void ns3::VhtCapabilities::SetMaxAmpduLength(uint32_t maxAmpduLength) [member function]
cls.add_method('SetMaxAmpduLength',
'void',
[param('uint32_t', 'maxAmpduLength')])
## vht-capabilities.h (module 'wifi'): void ns3::VhtCapabilities::SetMaxMpduLength(uint16_t length) [member function]
cls.add_method('SetMaxMpduLength',
'void',
[param('uint16_t', 'length')])
## vht-capabilities.h (module 'wifi'): void ns3::VhtCapabilities::SetRxHighestSupportedLgiDataRate(uint16_t supportedDatarate) [member function]
cls.add_method('SetRxHighestSupportedLgiDataRate',
'void',
[param('uint16_t', 'supportedDatarate')])
## vht-capabilities.h (module 'wifi'): void ns3::VhtCapabilities::SetRxLdpc(uint8_t rxLdpc) [member function]
cls.add_method('SetRxLdpc',
'void',
[param('uint8_t', 'rxLdpc')])
## vht-capabilities.h (module 'wifi'): void ns3::VhtCapabilities::SetRxMcsMap(uint8_t mcs, uint8_t nss) [member function]
cls.add_method('SetRxMcsMap',
'void',
[param('uint8_t', 'mcs'), param('uint8_t', 'nss')])
## vht-capabilities.h (module 'wifi'): void ns3::VhtCapabilities::SetRxStbc(uint8_t rxStbc) [member function]
cls.add_method('SetRxStbc',
'void',
[param('uint8_t', 'rxStbc')])
## vht-capabilities.h (module 'wifi'): void ns3::VhtCapabilities::SetShortGuardIntervalFor160Mhz(uint8_t shortGuardInterval) [member function]
cls.add_method('SetShortGuardIntervalFor160Mhz',
'void',
[param('uint8_t', 'shortGuardInterval')])
## vht-capabilities.h (module 'wifi'): void ns3::VhtCapabilities::SetShortGuardIntervalFor80Mhz(uint8_t shortGuardInterval) [member function]
cls.add_method('SetShortGuardIntervalFor80Mhz',
'void',
[param('uint8_t', 'shortGuardInterval')])
## vht-capabilities.h (module 'wifi'): void ns3::VhtCapabilities::SetSupportedChannelWidthSet(uint8_t channelWidthSet) [member function]
cls.add_method('SetSupportedChannelWidthSet',
'void',
[param('uint8_t', 'channelWidthSet')])
## vht-capabilities.h (module 'wifi'): void ns3::VhtCapabilities::SetSupportedMcsAndNssSet(uint64_t ctrl) [member function]
cls.add_method('SetSupportedMcsAndNssSet',
'void',
[param('uint64_t', 'ctrl')])
## vht-capabilities.h (module 'wifi'): void ns3::VhtCapabilities::SetTxHighestSupportedLgiDataRate(uint16_t supportedDatarate) [member function]
cls.add_method('SetTxHighestSupportedLgiDataRate',
'void',
[param('uint16_t', 'supportedDatarate')])
## vht-capabilities.h (module 'wifi'): void ns3::VhtCapabilities::SetTxMcsMap(uint8_t mcs, uint8_t nss) [member function]
cls.add_method('SetTxMcsMap',
'void',
[param('uint8_t', 'mcs'), param('uint8_t', 'nss')])
## vht-capabilities.h (module 'wifi'): void ns3::VhtCapabilities::SetTxStbc(uint8_t txStbc) [member function]
cls.add_method('SetTxStbc',
'void',
[param('uint8_t', 'txStbc')])
## vht-capabilities.h (module 'wifi'): void ns3::VhtCapabilities::SetVhtCapabilitiesInfo(uint32_t ctrl) [member function]
cls.add_method('SetVhtCapabilitiesInfo',
'void',
[param('uint32_t', 'ctrl')])
## vht-capabilities.h (module 'wifi'): void ns3::VhtCapabilities::SetVhtSupported(uint8_t vhtSupported) [member function]
cls.add_method('SetVhtSupported',
'void',
[param('uint8_t', 'vhtSupported')])
return
def register_Ns3WifiModeChecker_methods(root_module, cls):
## wifi-mode.h (module 'wifi'): ns3::WifiModeChecker::WifiModeChecker() [constructor]
cls.add_constructor([])
## wifi-mode.h (module 'wifi'): ns3::WifiModeChecker::WifiModeChecker(ns3::WifiModeChecker const & arg0) [constructor]
cls.add_constructor([param('ns3::WifiModeChecker const &', 'arg0')])
return
def register_Ns3WifiModeValue_methods(root_module, cls):
## wifi-mode.h (module 'wifi'): ns3::WifiModeValue::WifiModeValue() [constructor]
cls.add_constructor([])
## wifi-mode.h (module 'wifi'): ns3::WifiModeValue::WifiModeValue(ns3::WifiMode const & value) [constructor]
cls.add_constructor([param('ns3::WifiMode const &', 'value')])
## wifi-mode.h (module 'wifi'): ns3::WifiModeValue::WifiModeValue(ns3::WifiModeValue const & arg0) [constructor]
cls.add_constructor([param('ns3::WifiModeValue const &', 'arg0')])
## wifi-mode.h (module 'wifi'): ns3::Ptr<ns3::AttributeValue> ns3::WifiModeValue::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::AttributeValue >',
[],
is_const=True, is_virtual=True)
## wifi-mode.h (module 'wifi'): bool ns3::WifiModeValue::DeserializeFromString(std::string value, ns3::Ptr<const ns3::AttributeChecker> checker) [member function]
cls.add_method('DeserializeFromString',
'bool',
[param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_virtual=True)
## wifi-mode.h (module 'wifi'): ns3::WifiMode ns3::WifiModeValue::Get() const [member function]
cls.add_method('Get',
'ns3::WifiMode',
[],
is_const=True)
## wifi-mode.h (module 'wifi'): std::string ns3::WifiModeValue::SerializeToString(ns3::Ptr<const ns3::AttributeChecker> checker) const [member function]
cls.add_method('SerializeToString',
'std::string',
[param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_const=True, is_virtual=True)
## wifi-mode.h (module 'wifi'): void ns3::WifiModeValue::Set(ns3::WifiMode const & value) [member function]
cls.add_method('Set',
'void',
[param('ns3::WifiMode const &', 'value')])
return
def register_Ns3AddressChecker_methods(root_module, cls):
## address.h (module 'network'): ns3::AddressChecker::AddressChecker() [constructor]
cls.add_constructor([])
## address.h (module 'network'): ns3::AddressChecker::AddressChecker(ns3::AddressChecker const & arg0) [constructor]
cls.add_constructor([param('ns3::AddressChecker const &', 'arg0')])
return
def register_Ns3AddressValue_methods(root_module, cls):
## address.h (module 'network'): ns3::AddressValue::AddressValue() [constructor]
cls.add_constructor([])
## address.h (module 'network'): ns3::AddressValue::AddressValue(ns3::Address const & value) [constructor]
cls.add_constructor([param('ns3::Address const &', 'value')])
## address.h (module 'network'): ns3::AddressValue::AddressValue(ns3::AddressValue const & arg0) [constructor]
cls.add_constructor([param('ns3::AddressValue const &', 'arg0')])
## address.h (module 'network'): ns3::Ptr<ns3::AttributeValue> ns3::AddressValue::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::AttributeValue >',
[],
is_const=True, is_virtual=True)
## address.h (module 'network'): bool ns3::AddressValue::DeserializeFromString(std::string value, ns3::Ptr<const ns3::AttributeChecker> checker) [member function]
cls.add_method('DeserializeFromString',
'bool',
[param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_virtual=True)
## address.h (module 'network'): ns3::Address ns3::AddressValue::Get() const [member function]
cls.add_method('Get',
'ns3::Address',
[],
is_const=True)
## address.h (module 'network'): std::string ns3::AddressValue::SerializeToString(ns3::Ptr<const ns3::AttributeChecker> checker) const [member function]
cls.add_method('SerializeToString',
'std::string',
[param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_const=True, is_virtual=True)
## address.h (module 'network'): void ns3::AddressValue::Set(ns3::Address const & value) [member function]
cls.add_method('Set',
'void',
[param('ns3::Address const &', 'value')])
return
def register_Ns3CallbackImpl__Bool_Ns3Ptr__lt__ns3Socket__gt___Const_ns3Address___amp___Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, cls):
## callback.h (module 'core'): ns3::CallbackImpl<bool, ns3::Ptr<ns3::Socket>, const ns3::Address &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl() [constructor]
cls.add_constructor([])
## callback.h (module 'core'): ns3::CallbackImpl<bool, ns3::Ptr<ns3::Socket>, const ns3::Address &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl(ns3::CallbackImpl<bool, ns3::Ptr<ns3::Socket>, const ns3::Address &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> const & arg0) [constructor]
cls.add_constructor([param('ns3::CallbackImpl< bool, ns3::Ptr< ns3::Socket >, ns3::Address const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty > const &', 'arg0')])
## callback.h (module 'core'): static std::string ns3::CallbackImpl<bool, ns3::Ptr<ns3::Socket>, const ns3::Address &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::DoGetTypeid() [member function]
cls.add_method('DoGetTypeid',
'std::string',
[],
is_static=True)
## callback.h (module 'core'): std::string ns3::CallbackImpl<bool, ns3::Ptr<ns3::Socket>, const ns3::Address &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::GetTypeid() const [member function]
cls.add_method('GetTypeid',
'std::string',
[],
is_const=True, is_virtual=True)
## callback.h (module 'core'): bool ns3::CallbackImpl<bool, ns3::Ptr<ns3::Socket>, const ns3::Address &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::operator()(ns3::Ptr<ns3::Socket> arg0, ns3::Address const & arg1) [member operator]
cls.add_method('operator()',
'bool',
[param('ns3::Ptr< ns3::Socket >', 'arg0'), param('ns3::Address const &', 'arg1')],
custom_name='__call__', is_pure_virtual=True, is_virtual=True)
return
def register_Ns3CallbackImpl__Bool_Unsigned_short_Unsigned_char_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, cls):
## callback.h (module 'core'): ns3::CallbackImpl<bool, unsigned short, unsigned char, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl() [constructor]
cls.add_constructor([])
## callback.h (module 'core'): ns3::CallbackImpl<bool, unsigned short, unsigned char, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl(ns3::CallbackImpl<bool, unsigned short, unsigned char, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> const & arg0) [constructor]
cls.add_constructor([param('ns3::CallbackImpl< bool, unsigned short, unsigned char, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty > const &', 'arg0')])
## callback.h (module 'core'): static std::string ns3::CallbackImpl<bool, unsigned short, unsigned char, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::DoGetTypeid() [member function]
cls.add_method('DoGetTypeid',
'std::string',
[],
is_static=True)
## callback.h (module 'core'): std::string ns3::CallbackImpl<bool, unsigned short, unsigned char, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::GetTypeid() const [member function]
cls.add_method('GetTypeid',
'std::string',
[],
is_const=True, is_virtual=True)
## callback.h (module 'core'): bool ns3::CallbackImpl<bool, unsigned short, unsigned char, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::operator()(short unsigned int arg0, unsigned char arg1) [member operator]
cls.add_method('operator()',
'bool',
[param('short unsigned int', 'arg0'), param('unsigned char', 'arg1')],
custom_name='__call__', is_pure_virtual=True, is_virtual=True)
return
def register_Ns3CallbackImpl__Ns3ObjectBase___star___Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, cls):
## callback.h (module 'core'): ns3::CallbackImpl<ns3::ObjectBase *, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl() [constructor]
cls.add_constructor([])
## callback.h (module 'core'): ns3::CallbackImpl<ns3::ObjectBase *, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl(ns3::CallbackImpl<ns3::ObjectBase *, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> const & arg0) [constructor]
cls.add_constructor([param('ns3::CallbackImpl< ns3::ObjectBase *, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty > const &', 'arg0')])
## callback.h (module 'core'): static std::string ns3::CallbackImpl<ns3::ObjectBase *, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::DoGetTypeid() [member function]
cls.add_method('DoGetTypeid',
'std::string',
[],
is_static=True)
## callback.h (module 'core'): std::string ns3::CallbackImpl<ns3::ObjectBase *, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::GetTypeid() const [member function]
cls.add_method('GetTypeid',
'std::string',
[],
is_const=True, is_virtual=True)
## callback.h (module 'core'): ns3::ObjectBase * ns3::CallbackImpl<ns3::ObjectBase *, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::operator()() [member operator]
cls.add_method('operator()',
'ns3::ObjectBase *',
[],
custom_name='__call__', is_pure_virtual=True, is_virtual=True)
return
def register_Ns3CallbackImpl__Unsigned_long_Const_ns3WifiTxVector___amp___Unsigned_short_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, cls):
## callback.h (module 'core'): ns3::CallbackImpl<unsigned long, const ns3::WifiTxVector &, unsigned short, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl() [constructor]
cls.add_constructor([])
## callback.h (module 'core'): ns3::CallbackImpl<unsigned long, const ns3::WifiTxVector &, unsigned short, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl(ns3::CallbackImpl<unsigned long, const ns3::WifiTxVector &, unsigned short, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> const & arg0) [constructor]
cls.add_constructor([param('ns3::CallbackImpl< unsigned long, ns3::WifiTxVector const &, unsigned short, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty > const &', 'arg0')])
## callback.h (module 'core'): static std::string ns3::CallbackImpl<unsigned long, const ns3::WifiTxVector &, unsigned short, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::DoGetTypeid() [member function]
cls.add_method('DoGetTypeid',
'std::string',
[],
is_static=True)
## callback.h (module 'core'): std::string ns3::CallbackImpl<unsigned long, const ns3::WifiTxVector &, unsigned short, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::GetTypeid() const [member function]
cls.add_method('GetTypeid',
'std::string',
[],
is_const=True, is_virtual=True)
## callback.h (module 'core'): long unsigned int ns3::CallbackImpl<unsigned long, const ns3::WifiTxVector &, unsigned short, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::operator()(ns3::WifiTxVector const & arg0, short unsigned int arg1) [member operator]
cls.add_method('operator()',
'long unsigned int',
[param('ns3::WifiTxVector const &', 'arg0'), param('short unsigned int', 'arg1')],
custom_name='__call__', is_pure_virtual=True, is_virtual=True)
return
def register_Ns3CallbackImpl__Unsigned_long_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, cls):
## callback.h (module 'core'): ns3::CallbackImpl<unsigned long, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl() [constructor]
cls.add_constructor([])
## callback.h (module 'core'): ns3::CallbackImpl<unsigned long, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl(ns3::CallbackImpl<unsigned long, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> const & arg0) [constructor]
cls.add_constructor([param('ns3::CallbackImpl< unsigned long, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty > const &', 'arg0')])
## callback.h (module 'core'): static std::string ns3::CallbackImpl<unsigned long, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::DoGetTypeid() [member function]
cls.add_method('DoGetTypeid',
'std::string',
[],
is_static=True)
## callback.h (module 'core'): std::string ns3::CallbackImpl<unsigned long, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::GetTypeid() const [member function]
cls.add_method('GetTypeid',
'std::string',
[],
is_const=True, is_virtual=True)
## callback.h (module 'core'): long unsigned int ns3::CallbackImpl<unsigned long, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::operator()() [member operator]
cls.add_method('operator()',
'long unsigned int',
[],
custom_name='__call__', is_pure_virtual=True, is_virtual=True)
return
def register_Ns3CallbackImpl__Unsigned_long_Unsigned_short_Unsigned_short_Unsigned_char_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, cls):
## callback.h (module 'core'): ns3::CallbackImpl<unsigned long, unsigned short, unsigned short, unsigned char, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl() [constructor]
cls.add_constructor([])
## callback.h (module 'core'): ns3::CallbackImpl<unsigned long, unsigned short, unsigned short, unsigned char, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl(ns3::CallbackImpl<unsigned long, unsigned short, unsigned short, unsigned char, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> const & arg0) [constructor]
cls.add_constructor([param('ns3::CallbackImpl< unsigned long, unsigned short, unsigned short, unsigned char, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty > const &', 'arg0')])
## callback.h (module 'core'): static std::string ns3::CallbackImpl<unsigned long, unsigned short, unsigned short, unsigned char, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::DoGetTypeid() [member function]
cls.add_method('DoGetTypeid',
'std::string',
[],
is_static=True)
## callback.h (module 'core'): std::string ns3::CallbackImpl<unsigned long, unsigned short, unsigned short, unsigned char, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::GetTypeid() const [member function]
cls.add_method('GetTypeid',
'std::string',
[],
is_const=True, is_virtual=True)
## callback.h (module 'core'): long unsigned int ns3::CallbackImpl<unsigned long, unsigned short, unsigned short, unsigned char, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::operator()(short unsigned int arg0, short unsigned int arg1, unsigned char arg2) [member operator]
cls.add_method('operator()',
'long unsigned int',
[param('short unsigned int', 'arg0'), param('short unsigned int', 'arg1'), param('unsigned char', 'arg2')],
custom_name='__call__', is_pure_virtual=True, is_virtual=True)
return
def register_Ns3CallbackImpl__Unsigned_short_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, cls):
## callback.h (module 'core'): ns3::CallbackImpl<unsigned short, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl() [constructor]
cls.add_constructor([])
## callback.h (module 'core'): ns3::CallbackImpl<unsigned short, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl(ns3::CallbackImpl<unsigned short, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> const & arg0) [constructor]
cls.add_constructor([param('ns3::CallbackImpl< unsigned short, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty > const &', 'arg0')])
## callback.h (module 'core'): static std::string ns3::CallbackImpl<unsigned short, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::DoGetTypeid() [member function]
cls.add_method('DoGetTypeid',
'std::string',
[],
is_static=True)
## callback.h (module 'core'): std::string ns3::CallbackImpl<unsigned short, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::GetTypeid() const [member function]
cls.add_method('GetTypeid',
'std::string',
[],
is_const=True, is_virtual=True)
## callback.h (module 'core'): short unsigned int ns3::CallbackImpl<unsigned short, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::operator()() [member operator]
cls.add_method('operator()',
'short unsigned int',
[],
custom_name='__call__', is_pure_virtual=True, is_virtual=True)
return
def register_Ns3CallbackImpl__Void_Const_ns3Ipv4Header___amp___Ns3Ptr__lt__const_ns3Packet__gt___Ns3Ipv4L3ProtocolDropReason_Ns3Ptr__lt__ns3Ipv4__gt___Unsigned_int_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, cls):
## callback.h (module 'core'): ns3::CallbackImpl<void, const ns3::Ipv4Header &, ns3::Ptr<const ns3::Packet>, ns3::Ipv4L3Protocol::DropReason, ns3::Ptr<ns3::Ipv4>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl() [constructor]
cls.add_constructor([])
## callback.h (module 'core'): ns3::CallbackImpl<void, const ns3::Ipv4Header &, ns3::Ptr<const ns3::Packet>, ns3::Ipv4L3Protocol::DropReason, ns3::Ptr<ns3::Ipv4>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl(ns3::CallbackImpl<void, const ns3::Ipv4Header &, ns3::Ptr<const ns3::Packet>, ns3::Ipv4L3Protocol::DropReason, ns3::Ptr<ns3::Ipv4>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty> const & arg0) [constructor]
cls.add_constructor([param('ns3::CallbackImpl< void, ns3::Ipv4Header const &, ns3::Ptr< ns3::Packet const >, ns3::Ipv4L3Protocol::DropReason, ns3::Ptr< ns3::Ipv4 >, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty > const &', 'arg0')])
## callback.h (module 'core'): static std::string ns3::CallbackImpl<void, const ns3::Ipv4Header &, ns3::Ptr<const ns3::Packet>, ns3::Ipv4L3Protocol::DropReason, ns3::Ptr<ns3::Ipv4>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::DoGetTypeid() [member function]
cls.add_method('DoGetTypeid',
'std::string',
[],
is_static=True)
## callback.h (module 'core'): std::string ns3::CallbackImpl<void, const ns3::Ipv4Header &, ns3::Ptr<const ns3::Packet>, ns3::Ipv4L3Protocol::DropReason, ns3::Ptr<ns3::Ipv4>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::GetTypeid() const [member function]
cls.add_method('GetTypeid',
'std::string',
[],
is_const=True, is_virtual=True)
## callback.h (module 'core'): void ns3::CallbackImpl<void, const ns3::Ipv4Header &, ns3::Ptr<const ns3::Packet>, ns3::Ipv4L3Protocol::DropReason, ns3::Ptr<ns3::Ipv4>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::operator()(ns3::Ipv4Header const & arg0, ns3::Ptr<const ns3::Packet> arg1, ns3::Ipv4L3Protocol::DropReason arg2, ns3::Ptr<ns3::Ipv4> arg3, unsigned int arg4) [member operator]
cls.add_method('operator()',
'void',
[param('ns3::Ipv4Header const &', 'arg0'), param('ns3::Ptr< ns3::Packet const >', 'arg1'), param('ns3::Ipv4L3Protocol::DropReason', 'arg2'), param('ns3::Ptr< ns3::Ipv4 >', 'arg3'), param('unsigned int', 'arg4')],
custom_name='__call__', is_pure_virtual=True, is_virtual=True)
return
def register_Ns3CallbackImpl__Void_Const_ns3Ipv4Header___amp___Ns3Ptr__lt__const_ns3Packet__gt___Unsigned_int_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, cls):
## callback.h (module 'core'): ns3::CallbackImpl<void, const ns3::Ipv4Header &, ns3::Ptr<const ns3::Packet>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl() [constructor]
cls.add_constructor([])
## callback.h (module 'core'): ns3::CallbackImpl<void, const ns3::Ipv4Header &, ns3::Ptr<const ns3::Packet>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl(ns3::CallbackImpl<void, const ns3::Ipv4Header &, ns3::Ptr<const ns3::Packet>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> const & arg0) [constructor]
cls.add_constructor([param('ns3::CallbackImpl< void, ns3::Ipv4Header const &, ns3::Ptr< ns3::Packet const >, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty > const &', 'arg0')])
## callback.h (module 'core'): static std::string ns3::CallbackImpl<void, const ns3::Ipv4Header &, ns3::Ptr<const ns3::Packet>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::DoGetTypeid() [member function]
cls.add_method('DoGetTypeid',
'std::string',
[],
is_static=True)
## callback.h (module 'core'): std::string ns3::CallbackImpl<void, const ns3::Ipv4Header &, ns3::Ptr<const ns3::Packet>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::GetTypeid() const [member function]
cls.add_method('GetTypeid',
'std::string',
[],
is_const=True, is_virtual=True)
## callback.h (module 'core'): void ns3::CallbackImpl<void, const ns3::Ipv4Header &, ns3::Ptr<const ns3::Packet>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::operator()(ns3::Ipv4Header const & arg0, ns3::Ptr<const ns3::Packet> arg1, unsigned int arg2) [member operator]
cls.add_method('operator()',
'void',
[param('ns3::Ipv4Header const &', 'arg0'), param('ns3::Ptr< ns3::Packet const >', 'arg1'), param('unsigned int', 'arg2')],
custom_name='__call__', is_pure_virtual=True, is_virtual=True)
return
def register_Ns3CallbackImpl__Void_Const_ns3WifiMacHeader___amp___Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, cls):
## callback.h (module 'core'): ns3::CallbackImpl<void, const ns3::WifiMacHeader &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl() [constructor]
cls.add_constructor([])
## callback.h (module 'core'): ns3::CallbackImpl<void, const ns3::WifiMacHeader &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl(ns3::CallbackImpl<void, const ns3::WifiMacHeader &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> const & arg0) [constructor]
cls.add_constructor([param('ns3::CallbackImpl< void, ns3::WifiMacHeader const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty > const &', 'arg0')])
## callback.h (module 'core'): static std::string ns3::CallbackImpl<void, const ns3::WifiMacHeader &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::DoGetTypeid() [member function]
cls.add_method('DoGetTypeid',
'std::string',
[],
is_static=True)
## callback.h (module 'core'): std::string ns3::CallbackImpl<void, const ns3::WifiMacHeader &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::GetTypeid() const [member function]
cls.add_method('GetTypeid',
'std::string',
[],
is_const=True, is_virtual=True)
## callback.h (module 'core'): void ns3::CallbackImpl<void, const ns3::WifiMacHeader &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::operator()(ns3::WifiMacHeader const & arg0) [member operator]
cls.add_method('operator()',
'void',
[param('ns3::WifiMacHeader const &', 'arg0')],
custom_name='__call__', is_pure_virtual=True, is_virtual=True)
return
def register_Ns3CallbackImpl__Void_Const_ns3DsrDsrOptionSRHeader___amp___Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, cls):
## callback.h (module 'core'): ns3::CallbackImpl<void, const ns3::dsr::DsrOptionSRHeader &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl() [constructor]
cls.add_constructor([])
## callback.h (module 'core'): ns3::CallbackImpl<void, const ns3::dsr::DsrOptionSRHeader &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl(ns3::CallbackImpl<void, const ns3::dsr::DsrOptionSRHeader &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> const & arg0) [constructor]
cls.add_constructor([param('ns3::CallbackImpl< void, ns3::dsr::DsrOptionSRHeader const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty > const &', 'arg0')])
## callback.h (module 'core'): static std::string ns3::CallbackImpl<void, const ns3::dsr::DsrOptionSRHeader &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::DoGetTypeid() [member function]
cls.add_method('DoGetTypeid',
'std::string',
[],
is_static=True)
## callback.h (module 'core'): std::string ns3::CallbackImpl<void, const ns3::dsr::DsrOptionSRHeader &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::GetTypeid() const [member function]
cls.add_method('GetTypeid',
'std::string',
[],
is_const=True, is_virtual=True)
## callback.h (module 'core'): void ns3::CallbackImpl<void, const ns3::dsr::DsrOptionSRHeader &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::operator()(ns3::dsr::DsrOptionSRHeader const & arg0) [member operator]
cls.add_method('operator()',
'void',
[param('ns3::dsr::DsrOptionSRHeader const &', 'arg0')],
custom_name='__call__', is_pure_virtual=True, is_virtual=True)
return
def register_Ns3CallbackImpl__Void_Ns3Ipv4Address_Unsigned_char_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, cls):
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Ipv4Address, unsigned char, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl() [constructor]
cls.add_constructor([])
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Ipv4Address, unsigned char, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl(ns3::CallbackImpl<void, ns3::Ipv4Address, unsigned char, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> const & arg0) [constructor]
cls.add_constructor([param('ns3::CallbackImpl< void, ns3::Ipv4Address, unsigned char, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty > const &', 'arg0')])
## callback.h (module 'core'): static std::string ns3::CallbackImpl<void, ns3::Ipv4Address, unsigned char, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::DoGetTypeid() [member function]
cls.add_method('DoGetTypeid',
'std::string',
[],
is_static=True)
## callback.h (module 'core'): std::string ns3::CallbackImpl<void, ns3::Ipv4Address, unsigned char, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::GetTypeid() const [member function]
cls.add_method('GetTypeid',
'std::string',
[],
is_const=True, is_virtual=True)
## callback.h (module 'core'): void ns3::CallbackImpl<void, ns3::Ipv4Address, unsigned char, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::operator()(ns3::Ipv4Address arg0, unsigned char arg1) [member operator]
cls.add_method('operator()',
'void',
[param('ns3::Ipv4Address', 'arg0'), param('unsigned char', 'arg1')],
custom_name='__call__', is_pure_virtual=True, is_virtual=True)
return
def register_Ns3CallbackImpl__Void_Ns3Mac48Address_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, cls):
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Mac48Address, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl() [constructor]
cls.add_constructor([])
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Mac48Address, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl(ns3::CallbackImpl<void, ns3::Mac48Address, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> const & arg0) [constructor]
cls.add_constructor([param('ns3::CallbackImpl< void, ns3::Mac48Address, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty > const &', 'arg0')])
## callback.h (module 'core'): static std::string ns3::CallbackImpl<void, ns3::Mac48Address, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::DoGetTypeid() [member function]
cls.add_method('DoGetTypeid',
'std::string',
[],
is_static=True)
## callback.h (module 'core'): std::string ns3::CallbackImpl<void, ns3::Mac48Address, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::GetTypeid() const [member function]
cls.add_method('GetTypeid',
'std::string',
[],
is_const=True, is_virtual=True)
## callback.h (module 'core'): void ns3::CallbackImpl<void, ns3::Mac48Address, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::operator()(ns3::Mac48Address arg0) [member operator]
cls.add_method('operator()',
'void',
[param('ns3::Mac48Address', 'arg0')],
custom_name='__call__', is_pure_virtual=True, is_virtual=True)
return
def register_Ns3CallbackImpl__Void_Ns3Ptr__lt__const_ns3Packet__gt___Ns3Ptr__lt__ns3Ipv4__gt___Unsigned_int_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, cls):
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Ptr<const ns3::Packet>, ns3::Ptr<ns3::Ipv4>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl() [constructor]
cls.add_constructor([])
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Ptr<const ns3::Packet>, ns3::Ptr<ns3::Ipv4>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl(ns3::CallbackImpl<void, ns3::Ptr<const ns3::Packet>, ns3::Ptr<ns3::Ipv4>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> const & arg0) [constructor]
cls.add_constructor([param('ns3::CallbackImpl< void, ns3::Ptr< ns3::Packet const >, ns3::Ptr< ns3::Ipv4 >, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty > const &', 'arg0')])
## callback.h (module 'core'): static std::string ns3::CallbackImpl<void, ns3::Ptr<const ns3::Packet>, ns3::Ptr<ns3::Ipv4>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::DoGetTypeid() [member function]
cls.add_method('DoGetTypeid',
'std::string',
[],
is_static=True)
## callback.h (module 'core'): std::string ns3::CallbackImpl<void, ns3::Ptr<const ns3::Packet>, ns3::Ptr<ns3::Ipv4>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::GetTypeid() const [member function]
cls.add_method('GetTypeid',
'std::string',
[],
is_const=True, is_virtual=True)
## callback.h (module 'core'): void ns3::CallbackImpl<void, ns3::Ptr<const ns3::Packet>, ns3::Ptr<ns3::Ipv4>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::operator()(ns3::Ptr<const ns3::Packet> arg0, ns3::Ptr<ns3::Ipv4> arg1, unsigned int arg2) [member operator]
cls.add_method('operator()',
'void',
[param('ns3::Ptr< ns3::Packet const >', 'arg0'), param('ns3::Ptr< ns3::Ipv4 >', 'arg1'), param('unsigned int', 'arg2')],
custom_name='__call__', is_pure_virtual=True, is_virtual=True)
return
def register_Ns3CallbackImpl__Void_Ns3Ptr__lt__const_ns3Packet__gt___Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, cls):
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Ptr<const ns3::Packet>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl() [constructor]
cls.add_constructor([])
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Ptr<const ns3::Packet>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl(ns3::CallbackImpl<void, ns3::Ptr<const ns3::Packet>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> const & arg0) [constructor]
cls.add_constructor([param('ns3::CallbackImpl< void, ns3::Ptr< ns3::Packet const >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty > const &', 'arg0')])
## callback.h (module 'core'): static std::string ns3::CallbackImpl<void, ns3::Ptr<const ns3::Packet>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::DoGetTypeid() [member function]
cls.add_method('DoGetTypeid',
'std::string',
[],
is_static=True)
## callback.h (module 'core'): std::string ns3::CallbackImpl<void, ns3::Ptr<const ns3::Packet>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::GetTypeid() const [member function]
cls.add_method('GetTypeid',
'std::string',
[],
is_const=True, is_virtual=True)
## callback.h (module 'core'): void ns3::CallbackImpl<void, ns3::Ptr<const ns3::Packet>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::operator()(ns3::Ptr<const ns3::Packet> arg0) [member operator]
cls.add_method('operator()',
'void',
[param('ns3::Ptr< ns3::Packet const >', 'arg0')],
custom_name='__call__', is_pure_virtual=True, is_virtual=True)
return
def register_Ns3CallbackImpl__Void_Ns3Ptr__lt__ns3NetDevice__gt___Ns3Ptr__lt__const_ns3Packet__gt___Unsigned_short_Const_ns3Address___amp___Const_ns3Address___amp___Ns3NetDevicePacketType_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, cls):
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Ptr<ns3::NetDevice>, ns3::Ptr<const ns3::Packet>, unsigned short, const ns3::Address &, const ns3::Address &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl() [constructor]
cls.add_constructor([])
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Ptr<ns3::NetDevice>, ns3::Ptr<const ns3::Packet>, unsigned short, const ns3::Address &, const ns3::Address &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl(ns3::CallbackImpl<void, ns3::Ptr<ns3::NetDevice>, ns3::Ptr<const ns3::Packet>, unsigned short, const ns3::Address &, const ns3::Address &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty> const & arg0) [constructor]
cls.add_constructor([param('ns3::CallbackImpl< void, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::Address const &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty > const &', 'arg0')])
## callback.h (module 'core'): static std::string ns3::CallbackImpl<void, ns3::Ptr<ns3::NetDevice>, ns3::Ptr<const ns3::Packet>, unsigned short, const ns3::Address &, const ns3::Address &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty>::DoGetTypeid() [member function]
cls.add_method('DoGetTypeid',
'std::string',
[],
is_static=True)
## callback.h (module 'core'): std::string ns3::CallbackImpl<void, ns3::Ptr<ns3::NetDevice>, ns3::Ptr<const ns3::Packet>, unsigned short, const ns3::Address &, const ns3::Address &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty>::GetTypeid() const [member function]
cls.add_method('GetTypeid',
'std::string',
[],
is_const=True, is_virtual=True)
## callback.h (module 'core'): void ns3::CallbackImpl<void, ns3::Ptr<ns3::NetDevice>, ns3::Ptr<const ns3::Packet>, unsigned short, const ns3::Address &, const ns3::Address &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty>::operator()(ns3::Ptr<ns3::NetDevice> arg0, ns3::Ptr<const ns3::Packet> arg1, short unsigned int arg2, ns3::Address const & arg3, ns3::Address const & arg4, ns3::NetDevice::PacketType arg5) [member operator]
cls.add_method('operator()',
'void',
[param('ns3::Ptr< ns3::NetDevice >', 'arg0'), param('ns3::Ptr< ns3::Packet const >', 'arg1'), param('short unsigned int', 'arg2'), param('ns3::Address const &', 'arg3'), param('ns3::Address const &', 'arg4'), param('ns3::NetDevice::PacketType', 'arg5')],
custom_name='__call__', is_pure_virtual=True, is_virtual=True)
return
def register_Ns3CallbackImpl__Void_Ns3Ptr__lt__ns3NetDevice__gt___Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, cls):
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Ptr<ns3::NetDevice>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl() [constructor]
cls.add_constructor([])
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Ptr<ns3::NetDevice>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl(ns3::CallbackImpl<void, ns3::Ptr<ns3::NetDevice>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> const & arg0) [constructor]
cls.add_constructor([param('ns3::CallbackImpl< void, ns3::Ptr< ns3::NetDevice >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty > const &', 'arg0')])
## callback.h (module 'core'): static std::string ns3::CallbackImpl<void, ns3::Ptr<ns3::NetDevice>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::DoGetTypeid() [member function]
cls.add_method('DoGetTypeid',
'std::string',
[],
is_static=True)
## callback.h (module 'core'): std::string ns3::CallbackImpl<void, ns3::Ptr<ns3::NetDevice>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::GetTypeid() const [member function]
cls.add_method('GetTypeid',
'std::string',
[],
is_const=True, is_virtual=True)
## callback.h (module 'core'): void ns3::CallbackImpl<void, ns3::Ptr<ns3::NetDevice>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::operator()(ns3::Ptr<ns3::NetDevice> arg0) [member operator]
cls.add_method('operator()',
'void',
[param('ns3::Ptr< ns3::NetDevice >', 'arg0')],
custom_name='__call__', is_pure_virtual=True, is_virtual=True)
return
def register_Ns3CallbackImpl__Void_Ns3Ptr__lt__ns3Packet__gt___Ns3Ipv4Address_Ns3Ipv4Address_Unsigned_char_Ns3Ptr__lt__ns3Ipv4Route__gt___Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, cls):
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Ptr<ns3::Packet>, ns3::Ipv4Address, ns3::Ipv4Address, unsigned char, ns3::Ptr<ns3::Ipv4Route>, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl() [constructor]
cls.add_constructor([])
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Ptr<ns3::Packet>, ns3::Ipv4Address, ns3::Ipv4Address, unsigned char, ns3::Ptr<ns3::Ipv4Route>, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl(ns3::CallbackImpl<void, ns3::Ptr<ns3::Packet>, ns3::Ipv4Address, ns3::Ipv4Address, unsigned char, ns3::Ptr<ns3::Ipv4Route>, ns3::empty, ns3::empty, ns3::empty, ns3::empty> const & arg0) [constructor]
cls.add_constructor([param('ns3::CallbackImpl< void, ns3::Ptr< ns3::Packet >, ns3::Ipv4Address, ns3::Ipv4Address, unsigned char, ns3::Ptr< ns3::Ipv4Route >, ns3::empty, ns3::empty, ns3::empty, ns3::empty > const &', 'arg0')])
## callback.h (module 'core'): static std::string ns3::CallbackImpl<void, ns3::Ptr<ns3::Packet>, ns3::Ipv4Address, ns3::Ipv4Address, unsigned char, ns3::Ptr<ns3::Ipv4Route>, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::DoGetTypeid() [member function]
cls.add_method('DoGetTypeid',
'std::string',
[],
is_static=True)
## callback.h (module 'core'): std::string ns3::CallbackImpl<void, ns3::Ptr<ns3::Packet>, ns3::Ipv4Address, ns3::Ipv4Address, unsigned char, ns3::Ptr<ns3::Ipv4Route>, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::GetTypeid() const [member function]
cls.add_method('GetTypeid',
'std::string',
[],
is_const=True, is_virtual=True)
## callback.h (module 'core'): void ns3::CallbackImpl<void, ns3::Ptr<ns3::Packet>, ns3::Ipv4Address, ns3::Ipv4Address, unsigned char, ns3::Ptr<ns3::Ipv4Route>, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::operator()(ns3::Ptr<ns3::Packet> arg0, ns3::Ipv4Address arg1, ns3::Ipv4Address arg2, unsigned char arg3, ns3::Ptr<ns3::Ipv4Route> arg4) [member operator]
cls.add_method('operator()',
'void',
[param('ns3::Ptr< ns3::Packet >', 'arg0'), param('ns3::Ipv4Address', 'arg1'), param('ns3::Ipv4Address', 'arg2'), param('unsigned char', 'arg3'), param('ns3::Ptr< ns3::Ipv4Route >', 'arg4')],
custom_name='__call__', is_pure_virtual=True, is_virtual=True)
return
def register_Ns3CallbackImpl__Void_Ns3Ptr__lt__ns3Socket__gt___Const_ns3Address___amp___Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, cls):
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Ptr<ns3::Socket>, const ns3::Address &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl() [constructor]
cls.add_constructor([])
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Ptr<ns3::Socket>, const ns3::Address &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl(ns3::CallbackImpl<void, ns3::Ptr<ns3::Socket>, const ns3::Address &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> const & arg0) [constructor]
cls.add_constructor([param('ns3::CallbackImpl< void, ns3::Ptr< ns3::Socket >, ns3::Address const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty > const &', 'arg0')])
## callback.h (module 'core'): static std::string ns3::CallbackImpl<void, ns3::Ptr<ns3::Socket>, const ns3::Address &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::DoGetTypeid() [member function]
cls.add_method('DoGetTypeid',
'std::string',
[],
is_static=True)
## callback.h (module 'core'): std::string ns3::CallbackImpl<void, ns3::Ptr<ns3::Socket>, const ns3::Address &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::GetTypeid() const [member function]
cls.add_method('GetTypeid',
'std::string',
[],
is_const=True, is_virtual=True)
## callback.h (module 'core'): void ns3::CallbackImpl<void, ns3::Ptr<ns3::Socket>, const ns3::Address &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::operator()(ns3::Ptr<ns3::Socket> arg0, ns3::Address const & arg1) [member operator]
cls.add_method('operator()',
'void',
[param('ns3::Ptr< ns3::Socket >', 'arg0'), param('ns3::Address const &', 'arg1')],
custom_name='__call__', is_pure_virtual=True, is_virtual=True)
return
def register_Ns3CallbackImpl__Void_Ns3Ptr__lt__ns3Socket__gt___Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, cls):
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Ptr<ns3::Socket>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl() [constructor]
cls.add_constructor([])
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Ptr<ns3::Socket>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl(ns3::CallbackImpl<void, ns3::Ptr<ns3::Socket>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> const & arg0) [constructor]
cls.add_constructor([param('ns3::CallbackImpl< void, ns3::Ptr< ns3::Socket >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty > const &', 'arg0')])
## callback.h (module 'core'): static std::string ns3::CallbackImpl<void, ns3::Ptr<ns3::Socket>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::DoGetTypeid() [member function]
cls.add_method('DoGetTypeid',
'std::string',
[],
is_static=True)
## callback.h (module 'core'): std::string ns3::CallbackImpl<void, ns3::Ptr<ns3::Socket>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::GetTypeid() const [member function]
cls.add_method('GetTypeid',
'std::string',
[],
is_const=True, is_virtual=True)
## callback.h (module 'core'): void ns3::CallbackImpl<void, ns3::Ptr<ns3::Socket>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::operator()(ns3::Ptr<ns3::Socket> arg0) [member operator]
cls.add_method('operator()',
'void',
[param('ns3::Ptr< ns3::Socket >', 'arg0')],
custom_name='__call__', is_pure_virtual=True, is_virtual=True)
return
def register_Ns3CallbackImpl__Void_Ns3Ptr__lt__ns3Socket__gt___Unsigned_int_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, cls):
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Ptr<ns3::Socket>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl() [constructor]
cls.add_constructor([])
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Ptr<ns3::Socket>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl(ns3::CallbackImpl<void, ns3::Ptr<ns3::Socket>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> const & arg0) [constructor]
cls.add_constructor([param('ns3::CallbackImpl< void, ns3::Ptr< ns3::Socket >, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty > const &', 'arg0')])
## callback.h (module 'core'): static std::string ns3::CallbackImpl<void, ns3::Ptr<ns3::Socket>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::DoGetTypeid() [member function]
cls.add_method('DoGetTypeid',
'std::string',
[],
is_static=True)
## callback.h (module 'core'): std::string ns3::CallbackImpl<void, ns3::Ptr<ns3::Socket>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::GetTypeid() const [member function]
cls.add_method('GetTypeid',
'std::string',
[],
is_const=True, is_virtual=True)
## callback.h (module 'core'): void ns3::CallbackImpl<void, ns3::Ptr<ns3::Socket>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::operator()(ns3::Ptr<ns3::Socket> arg0, unsigned int arg1) [member operator]
cls.add_method('operator()',
'void',
[param('ns3::Ptr< ns3::Socket >', 'arg0'), param('unsigned int', 'arg1')],
custom_name='__call__', is_pure_virtual=True, is_virtual=True)
return
def register_Ns3Icmpv4L4Protocol_methods(root_module, cls):
## icmpv4-l4-protocol.h (module 'internet'): ns3::Icmpv4L4Protocol::Icmpv4L4Protocol(ns3::Icmpv4L4Protocol const & arg0) [constructor]
cls.add_constructor([param('ns3::Icmpv4L4Protocol const &', 'arg0')])
## icmpv4-l4-protocol.h (module 'internet'): ns3::Icmpv4L4Protocol::Icmpv4L4Protocol() [constructor]
cls.add_constructor([])
## icmpv4-l4-protocol.h (module 'internet'): ns3::IpL4Protocol::DownTargetCallback ns3::Icmpv4L4Protocol::GetDownTarget() const [member function]
cls.add_method('GetDownTarget',
'ns3::IpL4Protocol::DownTargetCallback',
[],
is_const=True, is_virtual=True)
## icmpv4-l4-protocol.h (module 'internet'): ns3::IpL4Protocol::DownTargetCallback6 ns3::Icmpv4L4Protocol::GetDownTarget6() const [member function]
cls.add_method('GetDownTarget6',
'ns3::IpL4Protocol::DownTargetCallback6',
[],
is_const=True, is_virtual=True)
## icmpv4-l4-protocol.h (module 'internet'): int ns3::Icmpv4L4Protocol::GetProtocolNumber() const [member function]
cls.add_method('GetProtocolNumber',
'int',
[],
is_const=True, is_virtual=True)
## icmpv4-l4-protocol.h (module 'internet'): static uint16_t ns3::Icmpv4L4Protocol::GetStaticProtocolNumber() [member function]
cls.add_method('GetStaticProtocolNumber',
'uint16_t',
[],
is_static=True)
## icmpv4-l4-protocol.h (module 'internet'): static ns3::TypeId ns3::Icmpv4L4Protocol::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## icmpv4-l4-protocol.h (module 'internet'): ns3::IpL4Protocol::RxStatus ns3::Icmpv4L4Protocol::Receive(ns3::Ptr<ns3::Packet> p, ns3::Ipv4Header const & header, ns3::Ptr<ns3::Ipv4Interface> incomingInterface) [member function]
cls.add_method('Receive',
'ns3::IpL4Protocol::RxStatus',
[param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ipv4Header const &', 'header'), param('ns3::Ptr< ns3::Ipv4Interface >', 'incomingInterface')],
is_virtual=True)
## icmpv4-l4-protocol.h (module 'internet'): ns3::IpL4Protocol::RxStatus ns3::Icmpv4L4Protocol::Receive(ns3::Ptr<ns3::Packet> p, ns3::Ipv6Header const & header, ns3::Ptr<ns3::Ipv6Interface> incomingInterface) [member function]
cls.add_method('Receive',
'ns3::IpL4Protocol::RxStatus',
[param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ipv6Header const &', 'header'), param('ns3::Ptr< ns3::Ipv6Interface >', 'incomingInterface')],
is_virtual=True)
## icmpv4-l4-protocol.h (module 'internet'): void ns3::Icmpv4L4Protocol::SendDestUnreachFragNeeded(ns3::Ipv4Header header, ns3::Ptr<const ns3::Packet> orgData, uint16_t nextHopMtu) [member function]
cls.add_method('SendDestUnreachFragNeeded',
'void',
[param('ns3::Ipv4Header', 'header'), param('ns3::Ptr< ns3::Packet const >', 'orgData'), param('uint16_t', 'nextHopMtu')])
## icmpv4-l4-protocol.h (module 'internet'): void ns3::Icmpv4L4Protocol::SendDestUnreachPort(ns3::Ipv4Header header, ns3::Ptr<const ns3::Packet> orgData) [member function]
cls.add_method('SendDestUnreachPort',
'void',
[param('ns3::Ipv4Header', 'header'), param('ns3::Ptr< ns3::Packet const >', 'orgData')])
## icmpv4-l4-protocol.h (module 'internet'): void ns3::Icmpv4L4Protocol::SendTimeExceededTtl(ns3::Ipv4Header header, ns3::Ptr<const ns3::Packet> orgData, bool isFragment) [member function]
cls.add_method('SendTimeExceededTtl',
'void',
[param('ns3::Ipv4Header', 'header'), param('ns3::Ptr< ns3::Packet const >', 'orgData'), param('bool', 'isFragment')])
## icmpv4-l4-protocol.h (module 'internet'): void ns3::Icmpv4L4Protocol::SetDownTarget(ns3::IpL4Protocol::DownTargetCallback cb) [member function]
cls.add_method('SetDownTarget',
'void',
[param('ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::Ipv4Address, ns3::Ipv4Address, unsigned char, ns3::Ptr< ns3::Ipv4Route >, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'cb')],
is_virtual=True)
## icmpv4-l4-protocol.h (module 'internet'): void ns3::Icmpv4L4Protocol::SetDownTarget6(ns3::IpL4Protocol::DownTargetCallback6 cb) [member function]
cls.add_method('SetDownTarget6',
'void',
[param('ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::Ipv6Address, ns3::Ipv6Address, unsigned char, ns3::Ptr< ns3::Ipv6Route >, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'cb')],
is_virtual=True)
## icmpv4-l4-protocol.h (module 'internet'): void ns3::Icmpv4L4Protocol::SetNode(ns3::Ptr<ns3::Node> node) [member function]
cls.add_method('SetNode',
'void',
[param('ns3::Ptr< ns3::Node >', 'node')])
## icmpv4-l4-protocol.h (module 'internet'): ns3::Icmpv4L4Protocol::PROT_NUMBER [variable]
cls.add_static_attribute('PROT_NUMBER', 'uint8_t const', is_const=True)
## icmpv4-l4-protocol.h (module 'internet'): void ns3::Icmpv4L4Protocol::NotifyNewAggregate() [member function]
cls.add_method('NotifyNewAggregate',
'void',
[],
is_virtual=True, visibility='protected')
## icmpv4-l4-protocol.h (module 'internet'): void ns3::Icmpv4L4Protocol::DoDispose() [member function]
cls.add_method('DoDispose',
'void',
[],
is_virtual=True, visibility='private')
return
def register_Ns3HashImplementation_methods(root_module, cls):
## hash-function.h (module 'core'): ns3::Hash::Implementation::Implementation(ns3::Hash::Implementation const & arg0) [constructor]
cls.add_constructor([param('ns3::Hash::Implementation const &', 'arg0')])
## hash-function.h (module 'core'): ns3::Hash::Implementation::Implementation() [constructor]
cls.add_constructor([])
## hash-function.h (module 'core'): uint32_t ns3::Hash::Implementation::GetHash32(char const * buffer, std::size_t const size) [member function]
cls.add_method('GetHash32',
'uint32_t',
[param('char const *', 'buffer'), param('std::size_t const', 'size')],
is_pure_virtual=True, is_virtual=True)
## hash-function.h (module 'core'): uint64_t ns3::Hash::Implementation::GetHash64(char const * buffer, std::size_t const size) [member function]
cls.add_method('GetHash64',
'uint64_t',
[param('char const *', 'buffer'), param('std::size_t const', 'size')],
is_virtual=True)
## hash-function.h (module 'core'): void ns3::Hash::Implementation::clear() [member function]
cls.add_method('clear',
'void',
[],
is_pure_virtual=True, is_virtual=True)
return
def register_Ns3HashFunctionFnv1a_methods(root_module, cls):
## hash-fnv.h (module 'core'): ns3::Hash::Function::Fnv1a::Fnv1a(ns3::Hash::Function::Fnv1a const & arg0) [constructor]
cls.add_constructor([param('ns3::Hash::Function::Fnv1a const &', 'arg0')])
## hash-fnv.h (module 'core'): ns3::Hash::Function::Fnv1a::Fnv1a() [constructor]
cls.add_constructor([])
## hash-fnv.h (module 'core'): uint32_t ns3::Hash::Function::Fnv1a::GetHash32(char const * buffer, size_t const size) [member function]
cls.add_method('GetHash32',
'uint32_t',
[param('char const *', 'buffer'), param('size_t const', 'size')],
is_virtual=True)
## hash-fnv.h (module 'core'): uint64_t ns3::Hash::Function::Fnv1a::GetHash64(char const * buffer, size_t const size) [member function]
cls.add_method('GetHash64',
'uint64_t',
[param('char const *', 'buffer'), param('size_t const', 'size')],
is_virtual=True)
## hash-fnv.h (module 'core'): void ns3::Hash::Function::Fnv1a::clear() [member function]
cls.add_method('clear',
'void',
[],
is_virtual=True)
return
def register_Ns3HashFunctionHash32_methods(root_module, cls):
## hash-function.h (module 'core'): ns3::Hash::Function::Hash32::Hash32(ns3::Hash::Function::Hash32 const & arg0) [constructor]
cls.add_constructor([param('ns3::Hash::Function::Hash32 const &', 'arg0')])
## hash-function.h (module 'core'): ns3::Hash::Function::Hash32::Hash32(ns3::Hash::Hash32Function_ptr hp) [constructor]
cls.add_constructor([param('ns3::Hash::Hash32Function_ptr', 'hp')])
## hash-function.h (module 'core'): uint32_t ns3::Hash::Function::Hash32::GetHash32(char const * buffer, std::size_t const size) [member function]
cls.add_method('GetHash32',
'uint32_t',
[param('char const *', 'buffer'), param('std::size_t const', 'size')],
is_virtual=True)
## hash-function.h (module 'core'): void ns3::Hash::Function::Hash32::clear() [member function]
cls.add_method('clear',
'void',
[],
is_virtual=True)
return
def register_Ns3HashFunctionHash64_methods(root_module, cls):
## hash-function.h (module 'core'): ns3::Hash::Function::Hash64::Hash64(ns3::Hash::Function::Hash64 const & arg0) [constructor]
cls.add_constructor([param('ns3::Hash::Function::Hash64 const &', 'arg0')])
## hash-function.h (module 'core'): ns3::Hash::Function::Hash64::Hash64(ns3::Hash::Hash64Function_ptr hp) [constructor]
cls.add_constructor([param('ns3::Hash::Hash64Function_ptr', 'hp')])
## hash-function.h (module 'core'): uint32_t ns3::Hash::Function::Hash64::GetHash32(char const * buffer, std::size_t const size) [member function]
cls.add_method('GetHash32',
'uint32_t',
[param('char const *', 'buffer'), param('std::size_t const', 'size')],
is_virtual=True)
## hash-function.h (module 'core'): uint64_t ns3::Hash::Function::Hash64::GetHash64(char const * buffer, std::size_t const size) [member function]
cls.add_method('GetHash64',
'uint64_t',
[param('char const *', 'buffer'), param('std::size_t const', 'size')],
is_virtual=True)
## hash-function.h (module 'core'): void ns3::Hash::Function::Hash64::clear() [member function]
cls.add_method('clear',
'void',
[],
is_virtual=True)
return
def register_Ns3HashFunctionMurmur3_methods(root_module, cls):
## hash-murmur3.h (module 'core'): ns3::Hash::Function::Murmur3::Murmur3(ns3::Hash::Function::Murmur3 const & arg0) [constructor]
cls.add_constructor([param('ns3::Hash::Function::Murmur3 const &', 'arg0')])
## hash-murmur3.h (module 'core'): ns3::Hash::Function::Murmur3::Murmur3() [constructor]
cls.add_constructor([])
## hash-murmur3.h (module 'core'): uint32_t ns3::Hash::Function::Murmur3::GetHash32(char const * buffer, std::size_t const size) [member function]
cls.add_method('GetHash32',
'uint32_t',
[param('char const *', 'buffer'), param('std::size_t const', 'size')],
is_virtual=True)
## hash-murmur3.h (module 'core'): uint64_t ns3::Hash::Function::Murmur3::GetHash64(char const * buffer, std::size_t const size) [member function]
cls.add_method('GetHash64',
'uint64_t',
[param('char const *', 'buffer'), param('std::size_t const', 'size')],
is_virtual=True)
## hash-murmur3.h (module 'core'): void ns3::Hash::Function::Murmur3::clear() [member function]
cls.add_method('clear',
'void',
[],
is_virtual=True)
return
def register_Ns3DsrBlackList_methods(root_module, cls):
## dsr-rreq-table.h (module 'dsr'): ns3::dsr::BlackList::BlackList(ns3::dsr::BlackList const & arg0) [constructor]
cls.add_constructor([param('ns3::dsr::BlackList const &', 'arg0')])
## dsr-rreq-table.h (module 'dsr'): ns3::dsr::BlackList::BlackList(ns3::Ipv4Address ip, ns3::Time t) [constructor]
cls.add_constructor([param('ns3::Ipv4Address', 'ip'), param('ns3::Time', 't')])
## dsr-rreq-table.h (module 'dsr'): ns3::dsr::BlackList::m_expireTime [variable]
cls.add_instance_attribute('m_expireTime', 'ns3::Time', is_const=False)
## dsr-rreq-table.h (module 'dsr'): ns3::dsr::BlackList::m_linkStates [variable]
cls.add_instance_attribute('m_linkStates', 'ns3::dsr::LinkStates', is_const=False)
## dsr-rreq-table.h (module 'dsr'): ns3::dsr::BlackList::m_neighborAddress [variable]
cls.add_instance_attribute('m_neighborAddress', 'ns3::Ipv4Address', is_const=False)
return
def register_Ns3DsrDsrErrorBuffEntry_methods(root_module, cls):
cls.add_binary_comparison_operator('==')
## dsr-errorbuff.h (module 'dsr'): ns3::dsr::DsrErrorBuffEntry::DsrErrorBuffEntry(ns3::dsr::DsrErrorBuffEntry const & arg0) [constructor]
cls.add_constructor([param('ns3::dsr::DsrErrorBuffEntry const &', 'arg0')])
## dsr-errorbuff.h (module 'dsr'): ns3::dsr::DsrErrorBuffEntry::DsrErrorBuffEntry(ns3::Ptr<const ns3::Packet> pa=0, ns3::Ipv4Address d=ns3::Ipv4Address(), ns3::Ipv4Address s=ns3::Ipv4Address(), ns3::Ipv4Address n=ns3::Ipv4Address(), ns3::Time exp=ns3::Simulator::Now(), uint8_t p=0) [constructor]
cls.add_constructor([param('ns3::Ptr< ns3::Packet const >', 'pa', default_value='0'), param('ns3::Ipv4Address', 'd', default_value='ns3::Ipv4Address()'), param('ns3::Ipv4Address', 's', default_value='ns3::Ipv4Address()'), param('ns3::Ipv4Address', 'n', default_value='ns3::Ipv4Address()'), param('ns3::Time', 'exp', default_value='ns3::Simulator::Now()'), param('uint8_t', 'p', default_value='0')])
## dsr-errorbuff.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::DsrErrorBuffEntry::GetDestination() const [member function]
cls.add_method('GetDestination',
'ns3::Ipv4Address',
[],
is_const=True)
## dsr-errorbuff.h (module 'dsr'): ns3::Time ns3::dsr::DsrErrorBuffEntry::GetExpireTime() const [member function]
cls.add_method('GetExpireTime',
'ns3::Time',
[],
is_const=True)
## dsr-errorbuff.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::DsrErrorBuffEntry::GetNextHop() const [member function]
cls.add_method('GetNextHop',
'ns3::Ipv4Address',
[],
is_const=True)
## dsr-errorbuff.h (module 'dsr'): ns3::Ptr<const ns3::Packet> ns3::dsr::DsrErrorBuffEntry::GetPacket() const [member function]
cls.add_method('GetPacket',
'ns3::Ptr< ns3::Packet const >',
[],
is_const=True)
## dsr-errorbuff.h (module 'dsr'): uint8_t ns3::dsr::DsrErrorBuffEntry::GetProtocol() const [member function]
cls.add_method('GetProtocol',
'uint8_t',
[],
is_const=True)
## dsr-errorbuff.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::DsrErrorBuffEntry::GetSource() const [member function]
cls.add_method('GetSource',
'ns3::Ipv4Address',
[],
is_const=True)
## dsr-errorbuff.h (module 'dsr'): void ns3::dsr::DsrErrorBuffEntry::SetDestination(ns3::Ipv4Address d) [member function]
cls.add_method('SetDestination',
'void',
[param('ns3::Ipv4Address', 'd')])
## dsr-errorbuff.h (module 'dsr'): void ns3::dsr::DsrErrorBuffEntry::SetExpireTime(ns3::Time exp) [member function]
cls.add_method('SetExpireTime',
'void',
[param('ns3::Time', 'exp')])
## dsr-errorbuff.h (module 'dsr'): void ns3::dsr::DsrErrorBuffEntry::SetNextHop(ns3::Ipv4Address n) [member function]
cls.add_method('SetNextHop',
'void',
[param('ns3::Ipv4Address', 'n')])
## dsr-errorbuff.h (module 'dsr'): void ns3::dsr::DsrErrorBuffEntry::SetPacket(ns3::Ptr<const ns3::Packet> p) [member function]
cls.add_method('SetPacket',
'void',
[param('ns3::Ptr< ns3::Packet const >', 'p')])
## dsr-errorbuff.h (module 'dsr'): void ns3::dsr::DsrErrorBuffEntry::SetProtocol(uint8_t p) [member function]
cls.add_method('SetProtocol',
'void',
[param('uint8_t', 'p')])
## dsr-errorbuff.h (module 'dsr'): void ns3::dsr::DsrErrorBuffEntry::SetSource(ns3::Ipv4Address s) [member function]
cls.add_method('SetSource',
'void',
[param('ns3::Ipv4Address', 's')])
return
def register_Ns3DsrDsrErrorBuffer_methods(root_module, cls):
## dsr-errorbuff.h (module 'dsr'): ns3::dsr::DsrErrorBuffer::DsrErrorBuffer(ns3::dsr::DsrErrorBuffer const & arg0) [constructor]
cls.add_constructor([param('ns3::dsr::DsrErrorBuffer const &', 'arg0')])
## dsr-errorbuff.h (module 'dsr'): ns3::dsr::DsrErrorBuffer::DsrErrorBuffer() [constructor]
cls.add_constructor([])
## dsr-errorbuff.h (module 'dsr'): bool ns3::dsr::DsrErrorBuffer::Dequeue(ns3::Ipv4Address dst, ns3::dsr::DsrErrorBuffEntry & entry) [member function]
cls.add_method('Dequeue',
'bool',
[param('ns3::Ipv4Address', 'dst'), param('ns3::dsr::DsrErrorBuffEntry &', 'entry')])
## dsr-errorbuff.h (module 'dsr'): void ns3::dsr::DsrErrorBuffer::DropPacketForErrLink(ns3::Ipv4Address source, ns3::Ipv4Address nextHop) [member function]
cls.add_method('DropPacketForErrLink',
'void',
[param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Address', 'nextHop')])
## dsr-errorbuff.h (module 'dsr'): bool ns3::dsr::DsrErrorBuffer::Enqueue(ns3::dsr::DsrErrorBuffEntry & entry) [member function]
cls.add_method('Enqueue',
'bool',
[param('ns3::dsr::DsrErrorBuffEntry &', 'entry')])
## dsr-errorbuff.h (module 'dsr'): bool ns3::dsr::DsrErrorBuffer::Find(ns3::Ipv4Address dst) [member function]
cls.add_method('Find',
'bool',
[param('ns3::Ipv4Address', 'dst')])
## dsr-errorbuff.h (module 'dsr'): std::vector<ns3::dsr::DsrErrorBuffEntry, std::allocator<ns3::dsr::DsrErrorBuffEntry> > & ns3::dsr::DsrErrorBuffer::GetBuffer() [member function]
cls.add_method('GetBuffer',
'std::vector< ns3::dsr::DsrErrorBuffEntry > &',
[])
## dsr-errorbuff.h (module 'dsr'): ns3::Time ns3::dsr::DsrErrorBuffer::GetErrorBufferTimeout() const [member function]
cls.add_method('GetErrorBufferTimeout',
'ns3::Time',
[],
is_const=True)
## dsr-errorbuff.h (module 'dsr'): uint32_t ns3::dsr::DsrErrorBuffer::GetMaxQueueLen() const [member function]
cls.add_method('GetMaxQueueLen',
'uint32_t',
[],
is_const=True)
## dsr-errorbuff.h (module 'dsr'): uint32_t ns3::dsr::DsrErrorBuffer::GetSize() [member function]
cls.add_method('GetSize',
'uint32_t',
[])
## dsr-errorbuff.h (module 'dsr'): void ns3::dsr::DsrErrorBuffer::SetErrorBufferTimeout(ns3::Time t) [member function]
cls.add_method('SetErrorBufferTimeout',
'void',
[param('ns3::Time', 't')])
## dsr-errorbuff.h (module 'dsr'): void ns3::dsr::DsrErrorBuffer::SetMaxQueueLen(uint32_t len) [member function]
cls.add_method('SetMaxQueueLen',
'void',
[param('uint32_t', 'len')])
return
def register_Ns3DsrDsrFsHeader_methods(root_module, cls):
## dsr-fs-header.h (module 'dsr'): ns3::dsr::DsrFsHeader::DsrFsHeader(ns3::dsr::DsrFsHeader const & arg0) [constructor]
cls.add_constructor([param('ns3::dsr::DsrFsHeader const &', 'arg0')])
## dsr-fs-header.h (module 'dsr'): ns3::dsr::DsrFsHeader::DsrFsHeader() [constructor]
cls.add_constructor([])
## dsr-fs-header.h (module 'dsr'): uint32_t ns3::dsr::DsrFsHeader::Deserialize(ns3::Buffer::Iterator start) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('ns3::Buffer::Iterator', 'start')],
is_virtual=True)
## dsr-fs-header.h (module 'dsr'): uint16_t ns3::dsr::DsrFsHeader::GetDestId() const [member function]
cls.add_method('GetDestId',
'uint16_t',
[],
is_const=True)
## dsr-fs-header.h (module 'dsr'): ns3::TypeId ns3::dsr::DsrFsHeader::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## dsr-fs-header.h (module 'dsr'): uint8_t ns3::dsr::DsrFsHeader::GetMessageType() const [member function]
cls.add_method('GetMessageType',
'uint8_t',
[],
is_const=True)
## dsr-fs-header.h (module 'dsr'): uint8_t ns3::dsr::DsrFsHeader::GetNextHeader() const [member function]
cls.add_method('GetNextHeader',
'uint8_t',
[],
is_const=True)
## dsr-fs-header.h (module 'dsr'): uint16_t ns3::dsr::DsrFsHeader::GetPayloadLength() const [member function]
cls.add_method('GetPayloadLength',
'uint16_t',
[],
is_const=True)
## dsr-fs-header.h (module 'dsr'): uint32_t ns3::dsr::DsrFsHeader::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True, is_virtual=True)
## dsr-fs-header.h (module 'dsr'): uint16_t ns3::dsr::DsrFsHeader::GetSourceId() const [member function]
cls.add_method('GetSourceId',
'uint16_t',
[],
is_const=True)
## dsr-fs-header.h (module 'dsr'): static ns3::TypeId ns3::dsr::DsrFsHeader::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## dsr-fs-header.h (module 'dsr'): void ns3::dsr::DsrFsHeader::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True, is_virtual=True)
## dsr-fs-header.h (module 'dsr'): void ns3::dsr::DsrFsHeader::Serialize(ns3::Buffer::Iterator start) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::Buffer::Iterator', 'start')],
is_const=True, is_virtual=True)
## dsr-fs-header.h (module 'dsr'): void ns3::dsr::DsrFsHeader::SetDestId(uint16_t destId) [member function]
cls.add_method('SetDestId',
'void',
[param('uint16_t', 'destId')])
## dsr-fs-header.h (module 'dsr'): void ns3::dsr::DsrFsHeader::SetMessageType(uint8_t messageType) [member function]
cls.add_method('SetMessageType',
'void',
[param('uint8_t', 'messageType')])
## dsr-fs-header.h (module 'dsr'): void ns3::dsr::DsrFsHeader::SetNextHeader(uint8_t protocol) [member function]
cls.add_method('SetNextHeader',
'void',
[param('uint8_t', 'protocol')])
## dsr-fs-header.h (module 'dsr'): void ns3::dsr::DsrFsHeader::SetPayloadLength(uint16_t length) [member function]
cls.add_method('SetPayloadLength',
'void',
[param('uint16_t', 'length')])
## dsr-fs-header.h (module 'dsr'): void ns3::dsr::DsrFsHeader::SetSourceId(uint16_t sourceId) [member function]
cls.add_method('SetSourceId',
'void',
[param('uint16_t', 'sourceId')])
return
def register_Ns3DsrDsrGraReply_methods(root_module, cls):
## dsr-gratuitous-reply-table.h (module 'dsr'): ns3::dsr::DsrGraReply::DsrGraReply(ns3::dsr::DsrGraReply const & arg0) [constructor]
cls.add_constructor([param('ns3::dsr::DsrGraReply const &', 'arg0')])
## dsr-gratuitous-reply-table.h (module 'dsr'): ns3::dsr::DsrGraReply::DsrGraReply() [constructor]
cls.add_constructor([])
## dsr-gratuitous-reply-table.h (module 'dsr'): bool ns3::dsr::DsrGraReply::AddEntry(ns3::dsr::GraReplyEntry & graTableEntry) [member function]
cls.add_method('AddEntry',
'bool',
[param('ns3::dsr::GraReplyEntry &', 'graTableEntry')])
## dsr-gratuitous-reply-table.h (module 'dsr'): void ns3::dsr::DsrGraReply::Clear() [member function]
cls.add_method('Clear',
'void',
[])
## dsr-gratuitous-reply-table.h (module 'dsr'): bool ns3::dsr::DsrGraReply::FindAndUpdate(ns3::Ipv4Address replyTo, ns3::Ipv4Address replyFrom, ns3::Time gratReplyHoldoff) [member function]
cls.add_method('FindAndUpdate',
'bool',
[param('ns3::Ipv4Address', 'replyTo'), param('ns3::Ipv4Address', 'replyFrom'), param('ns3::Time', 'gratReplyHoldoff')])
## dsr-gratuitous-reply-table.h (module 'dsr'): uint32_t ns3::dsr::DsrGraReply::GetGraTableSize() const [member function]
cls.add_method('GetGraTableSize',
'uint32_t',
[],
is_const=True)
## dsr-gratuitous-reply-table.h (module 'dsr'): static ns3::TypeId ns3::dsr::DsrGraReply::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## dsr-gratuitous-reply-table.h (module 'dsr'): void ns3::dsr::DsrGraReply::Purge() [member function]
cls.add_method('Purge',
'void',
[])
## dsr-gratuitous-reply-table.h (module 'dsr'): void ns3::dsr::DsrGraReply::SetGraTableSize(uint32_t g) [member function]
cls.add_method('SetGraTableSize',
'void',
[param('uint32_t', 'g')])
return
def register_Ns3DsrDsrLinkStab_methods(root_module, cls):
## dsr-rcache.h (module 'dsr'): ns3::dsr::DsrLinkStab::DsrLinkStab(ns3::dsr::DsrLinkStab const & arg0) [constructor]
cls.add_constructor([param('ns3::dsr::DsrLinkStab const &', 'arg0')])
## dsr-rcache.h (module 'dsr'): ns3::dsr::DsrLinkStab::DsrLinkStab(ns3::Time linkStab=ns3::Simulator::Now()) [constructor]
cls.add_constructor([param('ns3::Time', 'linkStab', default_value='ns3::Simulator::Now()')])
## dsr-rcache.h (module 'dsr'): ns3::Time ns3::dsr::DsrLinkStab::GetLinkStability() const [member function]
cls.add_method('GetLinkStability',
'ns3::Time',
[],
is_const=True)
## dsr-rcache.h (module 'dsr'): void ns3::dsr::DsrLinkStab::Print() const [member function]
cls.add_method('Print',
'void',
[],
is_const=True)
## dsr-rcache.h (module 'dsr'): void ns3::dsr::DsrLinkStab::SetLinkStability(ns3::Time linkStab) [member function]
cls.add_method('SetLinkStability',
'void',
[param('ns3::Time', 'linkStab')])
return
def register_Ns3DsrDsrMaintainBuffEntry_methods(root_module, cls):
## dsr-maintain-buff.h (module 'dsr'): ns3::dsr::DsrMaintainBuffEntry::DsrMaintainBuffEntry(ns3::dsr::DsrMaintainBuffEntry const & arg0) [constructor]
cls.add_constructor([param('ns3::dsr::DsrMaintainBuffEntry const &', 'arg0')])
## dsr-maintain-buff.h (module 'dsr'): ns3::dsr::DsrMaintainBuffEntry::DsrMaintainBuffEntry(ns3::Ptr<const ns3::Packet> pa=0, ns3::Ipv4Address us=ns3::Ipv4Address(), ns3::Ipv4Address n=ns3::Ipv4Address(), ns3::Ipv4Address s=ns3::Ipv4Address(), ns3::Ipv4Address dst=ns3::Ipv4Address(), uint16_t ackId=0, uint8_t segs=0, ns3::Time exp=ns3::Simulator::Now()) [constructor]
cls.add_constructor([param('ns3::Ptr< ns3::Packet const >', 'pa', default_value='0'), param('ns3::Ipv4Address', 'us', default_value='ns3::Ipv4Address()'), param('ns3::Ipv4Address', 'n', default_value='ns3::Ipv4Address()'), param('ns3::Ipv4Address', 's', default_value='ns3::Ipv4Address()'), param('ns3::Ipv4Address', 'dst', default_value='ns3::Ipv4Address()'), param('uint16_t', 'ackId', default_value='0'), param('uint8_t', 'segs', default_value='0'), param('ns3::Time', 'exp', default_value='ns3::Simulator::Now()')])
## dsr-maintain-buff.h (module 'dsr'): uint16_t ns3::dsr::DsrMaintainBuffEntry::GetAckId() const [member function]
cls.add_method('GetAckId',
'uint16_t',
[],
is_const=True)
## dsr-maintain-buff.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::DsrMaintainBuffEntry::GetDst() const [member function]
cls.add_method('GetDst',
'ns3::Ipv4Address',
[],
is_const=True)
## dsr-maintain-buff.h (module 'dsr'): ns3::Time ns3::dsr::DsrMaintainBuffEntry::GetExpireTime() const [member function]
cls.add_method('GetExpireTime',
'ns3::Time',
[],
is_const=True)
## dsr-maintain-buff.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::DsrMaintainBuffEntry::GetNextHop() const [member function]
cls.add_method('GetNextHop',
'ns3::Ipv4Address',
[],
is_const=True)
## dsr-maintain-buff.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::DsrMaintainBuffEntry::GetOurAdd() const [member function]
cls.add_method('GetOurAdd',
'ns3::Ipv4Address',
[],
is_const=True)
## dsr-maintain-buff.h (module 'dsr'): ns3::Ptr<const ns3::Packet> ns3::dsr::DsrMaintainBuffEntry::GetPacket() const [member function]
cls.add_method('GetPacket',
'ns3::Ptr< ns3::Packet const >',
[],
is_const=True)
## dsr-maintain-buff.h (module 'dsr'): uint8_t ns3::dsr::DsrMaintainBuffEntry::GetSegsLeft() const [member function]
cls.add_method('GetSegsLeft',
'uint8_t',
[],
is_const=True)
## dsr-maintain-buff.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::DsrMaintainBuffEntry::GetSrc() const [member function]
cls.add_method('GetSrc',
'ns3::Ipv4Address',
[],
is_const=True)
## dsr-maintain-buff.h (module 'dsr'): void ns3::dsr::DsrMaintainBuffEntry::SetAckId(uint16_t ackId) [member function]
cls.add_method('SetAckId',
'void',
[param('uint16_t', 'ackId')])
## dsr-maintain-buff.h (module 'dsr'): void ns3::dsr::DsrMaintainBuffEntry::SetDst(ns3::Ipv4Address n) [member function]
cls.add_method('SetDst',
'void',
[param('ns3::Ipv4Address', 'n')])
## dsr-maintain-buff.h (module 'dsr'): void ns3::dsr::DsrMaintainBuffEntry::SetExpireTime(ns3::Time exp) [member function]
cls.add_method('SetExpireTime',
'void',
[param('ns3::Time', 'exp')])
## dsr-maintain-buff.h (module 'dsr'): void ns3::dsr::DsrMaintainBuffEntry::SetNextHop(ns3::Ipv4Address n) [member function]
cls.add_method('SetNextHop',
'void',
[param('ns3::Ipv4Address', 'n')])
## dsr-maintain-buff.h (module 'dsr'): void ns3::dsr::DsrMaintainBuffEntry::SetOurAdd(ns3::Ipv4Address us) [member function]
cls.add_method('SetOurAdd',
'void',
[param('ns3::Ipv4Address', 'us')])
## dsr-maintain-buff.h (module 'dsr'): void ns3::dsr::DsrMaintainBuffEntry::SetPacket(ns3::Ptr<const ns3::Packet> p) [member function]
cls.add_method('SetPacket',
'void',
[param('ns3::Ptr< ns3::Packet const >', 'p')])
## dsr-maintain-buff.h (module 'dsr'): void ns3::dsr::DsrMaintainBuffEntry::SetSegsLeft(uint8_t segs) [member function]
cls.add_method('SetSegsLeft',
'void',
[param('uint8_t', 'segs')])
## dsr-maintain-buff.h (module 'dsr'): void ns3::dsr::DsrMaintainBuffEntry::SetSrc(ns3::Ipv4Address s) [member function]
cls.add_method('SetSrc',
'void',
[param('ns3::Ipv4Address', 's')])
return
def register_Ns3DsrDsrMaintainBuffer_methods(root_module, cls):
## dsr-maintain-buff.h (module 'dsr'): ns3::dsr::DsrMaintainBuffer::DsrMaintainBuffer(ns3::dsr::DsrMaintainBuffer const & arg0) [constructor]
cls.add_constructor([param('ns3::dsr::DsrMaintainBuffer const &', 'arg0')])
## dsr-maintain-buff.h (module 'dsr'): ns3::dsr::DsrMaintainBuffer::DsrMaintainBuffer() [constructor]
cls.add_constructor([])
## dsr-maintain-buff.h (module 'dsr'): bool ns3::dsr::DsrMaintainBuffer::AllEqual(ns3::dsr::DsrMaintainBuffEntry & entry) [member function]
cls.add_method('AllEqual',
'bool',
[param('ns3::dsr::DsrMaintainBuffEntry &', 'entry')])
## dsr-maintain-buff.h (module 'dsr'): bool ns3::dsr::DsrMaintainBuffer::Dequeue(ns3::Ipv4Address dst, ns3::dsr::DsrMaintainBuffEntry & entry) [member function]
cls.add_method('Dequeue',
'bool',
[param('ns3::Ipv4Address', 'dst'), param('ns3::dsr::DsrMaintainBuffEntry &', 'entry')])
## dsr-maintain-buff.h (module 'dsr'): void ns3::dsr::DsrMaintainBuffer::DropPacketWithNextHop(ns3::Ipv4Address nextHop) [member function]
cls.add_method('DropPacketWithNextHop',
'void',
[param('ns3::Ipv4Address', 'nextHop')])
## dsr-maintain-buff.h (module 'dsr'): bool ns3::dsr::DsrMaintainBuffer::Enqueue(ns3::dsr::DsrMaintainBuffEntry & entry) [member function]
cls.add_method('Enqueue',
'bool',
[param('ns3::dsr::DsrMaintainBuffEntry &', 'entry')])
## dsr-maintain-buff.h (module 'dsr'): bool ns3::dsr::DsrMaintainBuffer::Find(ns3::Ipv4Address nextHop) [member function]
cls.add_method('Find',
'bool',
[param('ns3::Ipv4Address', 'nextHop')])
## dsr-maintain-buff.h (module 'dsr'): ns3::Time ns3::dsr::DsrMaintainBuffer::GetMaintainBufferTimeout() const [member function]
cls.add_method('GetMaintainBufferTimeout',
'ns3::Time',
[],
is_const=True)
## dsr-maintain-buff.h (module 'dsr'): uint32_t ns3::dsr::DsrMaintainBuffer::GetMaxQueueLen() const [member function]
cls.add_method('GetMaxQueueLen',
'uint32_t',
[],
is_const=True)
## dsr-maintain-buff.h (module 'dsr'): uint32_t ns3::dsr::DsrMaintainBuffer::GetSize() [member function]
cls.add_method('GetSize',
'uint32_t',
[])
## dsr-maintain-buff.h (module 'dsr'): bool ns3::dsr::DsrMaintainBuffer::LinkEqual(ns3::dsr::DsrMaintainBuffEntry & entry) [member function]
cls.add_method('LinkEqual',
'bool',
[param('ns3::dsr::DsrMaintainBuffEntry &', 'entry')])
## dsr-maintain-buff.h (module 'dsr'): bool ns3::dsr::DsrMaintainBuffer::NetworkEqual(ns3::dsr::DsrMaintainBuffEntry & entry) [member function]
cls.add_method('NetworkEqual',
'bool',
[param('ns3::dsr::DsrMaintainBuffEntry &', 'entry')])
## dsr-maintain-buff.h (module 'dsr'): bool ns3::dsr::DsrMaintainBuffer::PromiscEqual(ns3::dsr::DsrMaintainBuffEntry & entry) [member function]
cls.add_method('PromiscEqual',
'bool',
[param('ns3::dsr::DsrMaintainBuffEntry &', 'entry')])
## dsr-maintain-buff.h (module 'dsr'): void ns3::dsr::DsrMaintainBuffer::SetMaintainBufferTimeout(ns3::Time t) [member function]
cls.add_method('SetMaintainBufferTimeout',
'void',
[param('ns3::Time', 't')])
## dsr-maintain-buff.h (module 'dsr'): void ns3::dsr::DsrMaintainBuffer::SetMaxQueueLen(uint32_t len) [member function]
cls.add_method('SetMaxQueueLen',
'void',
[param('uint32_t', 'len')])
return
def register_Ns3DsrDsrNetworkQueue_methods(root_module, cls):
## dsr-network-queue.h (module 'dsr'): ns3::dsr::DsrNetworkQueue::DsrNetworkQueue(ns3::dsr::DsrNetworkQueue const & arg0) [constructor]
cls.add_constructor([param('ns3::dsr::DsrNetworkQueue const &', 'arg0')])
## dsr-network-queue.h (module 'dsr'): ns3::dsr::DsrNetworkQueue::DsrNetworkQueue() [constructor]
cls.add_constructor([])
## dsr-network-queue.h (module 'dsr'): ns3::dsr::DsrNetworkQueue::DsrNetworkQueue(uint32_t maxLen, ns3::Time maxDelay) [constructor]
cls.add_constructor([param('uint32_t', 'maxLen'), param('ns3::Time', 'maxDelay')])
## dsr-network-queue.h (module 'dsr'): bool ns3::dsr::DsrNetworkQueue::Dequeue(ns3::dsr::DsrNetworkQueueEntry & entry) [member function]
cls.add_method('Dequeue',
'bool',
[param('ns3::dsr::DsrNetworkQueueEntry &', 'entry')])
## dsr-network-queue.h (module 'dsr'): bool ns3::dsr::DsrNetworkQueue::Enqueue(ns3::dsr::DsrNetworkQueueEntry & entry) [member function]
cls.add_method('Enqueue',
'bool',
[param('ns3::dsr::DsrNetworkQueueEntry &', 'entry')])
## dsr-network-queue.h (module 'dsr'): bool ns3::dsr::DsrNetworkQueue::Find(ns3::Ipv4Address nextHop) [member function]
cls.add_method('Find',
'bool',
[param('ns3::Ipv4Address', 'nextHop')])
## dsr-network-queue.h (module 'dsr'): bool ns3::dsr::DsrNetworkQueue::FindPacketWithNexthop(ns3::Ipv4Address nextHop, ns3::dsr::DsrNetworkQueueEntry & entry) [member function]
cls.add_method('FindPacketWithNexthop',
'bool',
[param('ns3::Ipv4Address', 'nextHop'), param('ns3::dsr::DsrNetworkQueueEntry &', 'entry')])
## dsr-network-queue.h (module 'dsr'): void ns3::dsr::DsrNetworkQueue::Flush() [member function]
cls.add_method('Flush',
'void',
[])
## dsr-network-queue.h (module 'dsr'): ns3::Time ns3::dsr::DsrNetworkQueue::GetMaxNetworkDelay() const [member function]
cls.add_method('GetMaxNetworkDelay',
'ns3::Time',
[],
is_const=True)
## dsr-network-queue.h (module 'dsr'): uint32_t ns3::dsr::DsrNetworkQueue::GetMaxNetworkSize() const [member function]
cls.add_method('GetMaxNetworkSize',
'uint32_t',
[],
is_const=True)
## dsr-network-queue.h (module 'dsr'): std::vector<ns3::dsr::DsrNetworkQueueEntry, std::allocator<ns3::dsr::DsrNetworkQueueEntry> > & ns3::dsr::DsrNetworkQueue::GetQueue() [member function]
cls.add_method('GetQueue',
'std::vector< ns3::dsr::DsrNetworkQueueEntry > &',
[])
## dsr-network-queue.h (module 'dsr'): uint32_t ns3::dsr::DsrNetworkQueue::GetSize() [member function]
cls.add_method('GetSize',
'uint32_t',
[])
## dsr-network-queue.h (module 'dsr'): static ns3::TypeId ns3::dsr::DsrNetworkQueue::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## dsr-network-queue.h (module 'dsr'): void ns3::dsr::DsrNetworkQueue::SetMaxNetworkDelay(ns3::Time delay) [member function]
cls.add_method('SetMaxNetworkDelay',
'void',
[param('ns3::Time', 'delay')])
## dsr-network-queue.h (module 'dsr'): void ns3::dsr::DsrNetworkQueue::SetMaxNetworkSize(uint32_t maxSize) [member function]
cls.add_method('SetMaxNetworkSize',
'void',
[param('uint32_t', 'maxSize')])
return
def register_Ns3DsrDsrNetworkQueueEntry_methods(root_module, cls):
cls.add_binary_comparison_operator('==')
## dsr-network-queue.h (module 'dsr'): ns3::dsr::DsrNetworkQueueEntry::DsrNetworkQueueEntry(ns3::dsr::DsrNetworkQueueEntry const & arg0) [constructor]
cls.add_constructor([param('ns3::dsr::DsrNetworkQueueEntry const &', 'arg0')])
## dsr-network-queue.h (module 'dsr'): ns3::dsr::DsrNetworkQueueEntry::DsrNetworkQueueEntry(ns3::Ptr<const ns3::Packet> pa=0, ns3::Ipv4Address s=ns3::Ipv4Address(), ns3::Ipv4Address n=ns3::Ipv4Address(), ns3::Time exp=ns3::Simulator::Now(), ns3::Ptr<ns3::Ipv4Route> r=0) [constructor]
cls.add_constructor([param('ns3::Ptr< ns3::Packet const >', 'pa', default_value='0'), param('ns3::Ipv4Address', 's', default_value='ns3::Ipv4Address()'), param('ns3::Ipv4Address', 'n', default_value='ns3::Ipv4Address()'), param('ns3::Time', 'exp', default_value='ns3::Simulator::Now()'), param('ns3::Ptr< ns3::Ipv4Route >', 'r', default_value='0')])
## dsr-network-queue.h (module 'dsr'): ns3::Time ns3::dsr::DsrNetworkQueueEntry::GetInsertedTimeStamp() const [member function]
cls.add_method('GetInsertedTimeStamp',
'ns3::Time',
[],
is_const=True)
## dsr-network-queue.h (module 'dsr'): ns3::Ptr<ns3::Ipv4Route> ns3::dsr::DsrNetworkQueueEntry::GetIpv4Route() const [member function]
cls.add_method('GetIpv4Route',
'ns3::Ptr< ns3::Ipv4Route >',
[],
is_const=True)
## dsr-network-queue.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::DsrNetworkQueueEntry::GetNextHopAddress() const [member function]
cls.add_method('GetNextHopAddress',
'ns3::Ipv4Address',
[],
is_const=True)
## dsr-network-queue.h (module 'dsr'): ns3::Ptr<const ns3::Packet> ns3::dsr::DsrNetworkQueueEntry::GetPacket() const [member function]
cls.add_method('GetPacket',
'ns3::Ptr< ns3::Packet const >',
[],
is_const=True)
## dsr-network-queue.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::DsrNetworkQueueEntry::GetSourceAddress() const [member function]
cls.add_method('GetSourceAddress',
'ns3::Ipv4Address',
[],
is_const=True)
## dsr-network-queue.h (module 'dsr'): void ns3::dsr::DsrNetworkQueueEntry::SetInsertedTimeStamp(ns3::Time time) [member function]
cls.add_method('SetInsertedTimeStamp',
'void',
[param('ns3::Time', 'time')])
## dsr-network-queue.h (module 'dsr'): void ns3::dsr::DsrNetworkQueueEntry::SetIpv4Route(ns3::Ptr<ns3::Ipv4Route> route) [member function]
cls.add_method('SetIpv4Route',
'void',
[param('ns3::Ptr< ns3::Ipv4Route >', 'route')])
## dsr-network-queue.h (module 'dsr'): void ns3::dsr::DsrNetworkQueueEntry::SetNextHopAddress(ns3::Ipv4Address addr) [member function]
cls.add_method('SetNextHopAddress',
'void',
[param('ns3::Ipv4Address', 'addr')])
## dsr-network-queue.h (module 'dsr'): void ns3::dsr::DsrNetworkQueueEntry::SetPacket(ns3::Ptr<const ns3::Packet> p) [member function]
cls.add_method('SetPacket',
'void',
[param('ns3::Ptr< ns3::Packet const >', 'p')])
## dsr-network-queue.h (module 'dsr'): void ns3::dsr::DsrNetworkQueueEntry::SetSourceAddress(ns3::Ipv4Address addr) [member function]
cls.add_method('SetSourceAddress',
'void',
[param('ns3::Ipv4Address', 'addr')])
return
def register_Ns3DsrDsrNodeStab_methods(root_module, cls):
## dsr-rcache.h (module 'dsr'): ns3::dsr::DsrNodeStab::DsrNodeStab(ns3::dsr::DsrNodeStab const & arg0) [constructor]
cls.add_constructor([param('ns3::dsr::DsrNodeStab const &', 'arg0')])
## dsr-rcache.h (module 'dsr'): ns3::dsr::DsrNodeStab::DsrNodeStab(ns3::Time nodeStab=ns3::Simulator::Now()) [constructor]
cls.add_constructor([param('ns3::Time', 'nodeStab', default_value='ns3::Simulator::Now()')])
## dsr-rcache.h (module 'dsr'): ns3::Time ns3::dsr::DsrNodeStab::GetNodeStability() const [member function]
cls.add_method('GetNodeStability',
'ns3::Time',
[],
is_const=True)
## dsr-rcache.h (module 'dsr'): void ns3::dsr::DsrNodeStab::SetNodeStability(ns3::Time nodeStab) [member function]
cls.add_method('SetNodeStability',
'void',
[param('ns3::Time', 'nodeStab')])
return
def register_Ns3DsrDsrOptionField_methods(root_module, cls):
## dsr-fs-header.h (module 'dsr'): ns3::dsr::DsrOptionField::DsrOptionField(ns3::dsr::DsrOptionField const & arg0) [constructor]
cls.add_constructor([param('ns3::dsr::DsrOptionField const &', 'arg0')])
## dsr-fs-header.h (module 'dsr'): ns3::dsr::DsrOptionField::DsrOptionField(uint32_t optionsOffset) [constructor]
cls.add_constructor([param('uint32_t', 'optionsOffset')])
## dsr-fs-header.h (module 'dsr'): void ns3::dsr::DsrOptionField::AddDsrOption(ns3::dsr::DsrOptionHeader const & option) [member function]
cls.add_method('AddDsrOption',
'void',
[param('ns3::dsr::DsrOptionHeader const &', 'option')])
## dsr-fs-header.h (module 'dsr'): uint32_t ns3::dsr::DsrOptionField::Deserialize(ns3::Buffer::Iterator start, uint32_t length) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('ns3::Buffer::Iterator', 'start'), param('uint32_t', 'length')])
## dsr-fs-header.h (module 'dsr'): ns3::Buffer ns3::dsr::DsrOptionField::GetDsrOptionBuffer() [member function]
cls.add_method('GetDsrOptionBuffer',
'ns3::Buffer',
[])
## dsr-fs-header.h (module 'dsr'): uint32_t ns3::dsr::DsrOptionField::GetDsrOptionsOffset() [member function]
cls.add_method('GetDsrOptionsOffset',
'uint32_t',
[])
## dsr-fs-header.h (module 'dsr'): uint32_t ns3::dsr::DsrOptionField::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True)
## dsr-fs-header.h (module 'dsr'): void ns3::dsr::DsrOptionField::Serialize(ns3::Buffer::Iterator start) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::Buffer::Iterator', 'start')],
is_const=True)
return
def register_Ns3DsrDsrOptionHeader_methods(root_module, cls):
## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionHeader::DsrOptionHeader(ns3::dsr::DsrOptionHeader const & arg0) [constructor]
cls.add_constructor([param('ns3::dsr::DsrOptionHeader const &', 'arg0')])
## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionHeader::DsrOptionHeader() [constructor]
cls.add_constructor([])
## dsr-option-header.h (module 'dsr'): uint32_t ns3::dsr::DsrOptionHeader::Deserialize(ns3::Buffer::Iterator start) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('ns3::Buffer::Iterator', 'start')],
is_virtual=True)
## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionHeader::Alignment ns3::dsr::DsrOptionHeader::GetAlignment() const [member function]
cls.add_method('GetAlignment',
'ns3::dsr::DsrOptionHeader::Alignment',
[],
is_const=True, is_virtual=True)
## dsr-option-header.h (module 'dsr'): ns3::TypeId ns3::dsr::DsrOptionHeader::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## dsr-option-header.h (module 'dsr'): uint8_t ns3::dsr::DsrOptionHeader::GetLength() const [member function]
cls.add_method('GetLength',
'uint8_t',
[],
is_const=True)
## dsr-option-header.h (module 'dsr'): uint32_t ns3::dsr::DsrOptionHeader::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True, is_virtual=True)
## dsr-option-header.h (module 'dsr'): uint8_t ns3::dsr::DsrOptionHeader::GetType() const [member function]
cls.add_method('GetType',
'uint8_t',
[],
is_const=True)
## dsr-option-header.h (module 'dsr'): static ns3::TypeId ns3::dsr::DsrOptionHeader::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionHeader::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True, is_virtual=True)
## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionHeader::Serialize(ns3::Buffer::Iterator start) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::Buffer::Iterator', 'start')],
is_const=True, is_virtual=True)
## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionHeader::SetLength(uint8_t length) [member function]
cls.add_method('SetLength',
'void',
[param('uint8_t', 'length')])
## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionHeader::SetType(uint8_t type) [member function]
cls.add_method('SetType',
'void',
[param('uint8_t', 'type')])
return
def register_Ns3DsrDsrOptionHeaderAlignment_methods(root_module, cls):
## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionHeader::Alignment::Alignment() [constructor]
cls.add_constructor([])
## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionHeader::Alignment::Alignment(ns3::dsr::DsrOptionHeader::Alignment const & arg0) [constructor]
cls.add_constructor([param('ns3::dsr::DsrOptionHeader::Alignment const &', 'arg0')])
## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionHeader::Alignment::factor [variable]
cls.add_instance_attribute('factor', 'uint8_t', is_const=False)
## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionHeader::Alignment::offset [variable]
cls.add_instance_attribute('offset', 'uint8_t', is_const=False)
return
def register_Ns3DsrDsrOptionPad1Header_methods(root_module, cls):
## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionPad1Header::DsrOptionPad1Header(ns3::dsr::DsrOptionPad1Header const & arg0) [constructor]
cls.add_constructor([param('ns3::dsr::DsrOptionPad1Header const &', 'arg0')])
## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionPad1Header::DsrOptionPad1Header() [constructor]
cls.add_constructor([])
## dsr-option-header.h (module 'dsr'): uint32_t ns3::dsr::DsrOptionPad1Header::Deserialize(ns3::Buffer::Iterator start) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('ns3::Buffer::Iterator', 'start')],
is_virtual=True)
## dsr-option-header.h (module 'dsr'): ns3::TypeId ns3::dsr::DsrOptionPad1Header::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## dsr-option-header.h (module 'dsr'): uint32_t ns3::dsr::DsrOptionPad1Header::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True, is_virtual=True)
## dsr-option-header.h (module 'dsr'): static ns3::TypeId ns3::dsr::DsrOptionPad1Header::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionPad1Header::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True, is_virtual=True)
## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionPad1Header::Serialize(ns3::Buffer::Iterator start) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::Buffer::Iterator', 'start')],
is_const=True, is_virtual=True)
return
def register_Ns3DsrDsrOptionPadnHeader_methods(root_module, cls):
## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionPadnHeader::DsrOptionPadnHeader(ns3::dsr::DsrOptionPadnHeader const & arg0) [constructor]
cls.add_constructor([param('ns3::dsr::DsrOptionPadnHeader const &', 'arg0')])
## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionPadnHeader::DsrOptionPadnHeader(uint32_t pad=2) [constructor]
cls.add_constructor([param('uint32_t', 'pad', default_value='2')])
## dsr-option-header.h (module 'dsr'): uint32_t ns3::dsr::DsrOptionPadnHeader::Deserialize(ns3::Buffer::Iterator start) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('ns3::Buffer::Iterator', 'start')],
is_virtual=True)
## dsr-option-header.h (module 'dsr'): ns3::TypeId ns3::dsr::DsrOptionPadnHeader::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## dsr-option-header.h (module 'dsr'): uint32_t ns3::dsr::DsrOptionPadnHeader::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True, is_virtual=True)
## dsr-option-header.h (module 'dsr'): static ns3::TypeId ns3::dsr::DsrOptionPadnHeader::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionPadnHeader::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True, is_virtual=True)
## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionPadnHeader::Serialize(ns3::Buffer::Iterator start) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::Buffer::Iterator', 'start')],
is_const=True, is_virtual=True)
return
def register_Ns3DsrDsrOptionRerrHeader_methods(root_module, cls):
## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionRerrHeader::DsrOptionRerrHeader(ns3::dsr::DsrOptionRerrHeader const & arg0) [constructor]
cls.add_constructor([param('ns3::dsr::DsrOptionRerrHeader const &', 'arg0')])
## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionRerrHeader::DsrOptionRerrHeader() [constructor]
cls.add_constructor([])
## dsr-option-header.h (module 'dsr'): uint32_t ns3::dsr::DsrOptionRerrHeader::Deserialize(ns3::Buffer::Iterator start) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('ns3::Buffer::Iterator', 'start')],
is_virtual=True)
## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionHeader::Alignment ns3::dsr::DsrOptionRerrHeader::GetAlignment() const [member function]
cls.add_method('GetAlignment',
'ns3::dsr::DsrOptionHeader::Alignment',
[],
is_const=True, is_virtual=True)
## dsr-option-header.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::DsrOptionRerrHeader::GetErrorDst() const [member function]
cls.add_method('GetErrorDst',
'ns3::Ipv4Address',
[],
is_const=True, is_virtual=True)
## dsr-option-header.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::DsrOptionRerrHeader::GetErrorSrc() const [member function]
cls.add_method('GetErrorSrc',
'ns3::Ipv4Address',
[],
is_const=True, is_virtual=True)
## dsr-option-header.h (module 'dsr'): uint8_t ns3::dsr::DsrOptionRerrHeader::GetErrorType() const [member function]
cls.add_method('GetErrorType',
'uint8_t',
[],
is_const=True)
## dsr-option-header.h (module 'dsr'): ns3::TypeId ns3::dsr::DsrOptionRerrHeader::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## dsr-option-header.h (module 'dsr'): uint8_t ns3::dsr::DsrOptionRerrHeader::GetSalvage() const [member function]
cls.add_method('GetSalvage',
'uint8_t',
[],
is_const=True, is_virtual=True)
## dsr-option-header.h (module 'dsr'): uint32_t ns3::dsr::DsrOptionRerrHeader::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True, is_virtual=True)
## dsr-option-header.h (module 'dsr'): static ns3::TypeId ns3::dsr::DsrOptionRerrHeader::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionRerrHeader::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True, is_virtual=True)
## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionRerrHeader::Serialize(ns3::Buffer::Iterator start) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::Buffer::Iterator', 'start')],
is_const=True, is_virtual=True)
## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionRerrHeader::SetErrorDst(ns3::Ipv4Address errorDstAddress) [member function]
cls.add_method('SetErrorDst',
'void',
[param('ns3::Ipv4Address', 'errorDstAddress')],
is_virtual=True)
## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionRerrHeader::SetErrorSrc(ns3::Ipv4Address errorSrcAddress) [member function]
cls.add_method('SetErrorSrc',
'void',
[param('ns3::Ipv4Address', 'errorSrcAddress')],
is_virtual=True)
## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionRerrHeader::SetErrorType(uint8_t errorType) [member function]
cls.add_method('SetErrorType',
'void',
[param('uint8_t', 'errorType')])
## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionRerrHeader::SetSalvage(uint8_t salvage) [member function]
cls.add_method('SetSalvage',
'void',
[param('uint8_t', 'salvage')],
is_virtual=True)
return
def register_Ns3DsrDsrOptionRerrUnreachHeader_methods(root_module, cls):
## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionRerrUnreachHeader::DsrOptionRerrUnreachHeader(ns3::dsr::DsrOptionRerrUnreachHeader const & arg0) [constructor]
cls.add_constructor([param('ns3::dsr::DsrOptionRerrUnreachHeader const &', 'arg0')])
## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionRerrUnreachHeader::DsrOptionRerrUnreachHeader() [constructor]
cls.add_constructor([])
## dsr-option-header.h (module 'dsr'): uint32_t ns3::dsr::DsrOptionRerrUnreachHeader::Deserialize(ns3::Buffer::Iterator start) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('ns3::Buffer::Iterator', 'start')],
is_virtual=True)
## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionHeader::Alignment ns3::dsr::DsrOptionRerrUnreachHeader::GetAlignment() const [member function]
cls.add_method('GetAlignment',
'ns3::dsr::DsrOptionHeader::Alignment',
[],
is_const=True, is_virtual=True)
## dsr-option-header.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::DsrOptionRerrUnreachHeader::GetErrorDst() const [member function]
cls.add_method('GetErrorDst',
'ns3::Ipv4Address',
[],
is_const=True, is_virtual=True)
## dsr-option-header.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::DsrOptionRerrUnreachHeader::GetErrorSrc() const [member function]
cls.add_method('GetErrorSrc',
'ns3::Ipv4Address',
[],
is_const=True, is_virtual=True)
## dsr-option-header.h (module 'dsr'): ns3::TypeId ns3::dsr::DsrOptionRerrUnreachHeader::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## dsr-option-header.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::DsrOptionRerrUnreachHeader::GetOriginalDst() const [member function]
cls.add_method('GetOriginalDst',
'ns3::Ipv4Address',
[],
is_const=True)
## dsr-option-header.h (module 'dsr'): uint8_t ns3::dsr::DsrOptionRerrUnreachHeader::GetSalvage() const [member function]
cls.add_method('GetSalvage',
'uint8_t',
[],
is_const=True, is_virtual=True)
## dsr-option-header.h (module 'dsr'): uint32_t ns3::dsr::DsrOptionRerrUnreachHeader::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True, is_virtual=True)
## dsr-option-header.h (module 'dsr'): static ns3::TypeId ns3::dsr::DsrOptionRerrUnreachHeader::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## dsr-option-header.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::DsrOptionRerrUnreachHeader::GetUnreachNode() const [member function]
cls.add_method('GetUnreachNode',
'ns3::Ipv4Address',
[],
is_const=True)
## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionRerrUnreachHeader::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True, is_virtual=True)
## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionRerrUnreachHeader::Serialize(ns3::Buffer::Iterator start) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::Buffer::Iterator', 'start')],
is_const=True, is_virtual=True)
## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionRerrUnreachHeader::SetErrorDst(ns3::Ipv4Address errorDstAddress) [member function]
cls.add_method('SetErrorDst',
'void',
[param('ns3::Ipv4Address', 'errorDstAddress')],
is_virtual=True)
## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionRerrUnreachHeader::SetErrorSrc(ns3::Ipv4Address errorSrcAddress) [member function]
cls.add_method('SetErrorSrc',
'void',
[param('ns3::Ipv4Address', 'errorSrcAddress')],
is_virtual=True)
## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionRerrUnreachHeader::SetOriginalDst(ns3::Ipv4Address originalDst) [member function]
cls.add_method('SetOriginalDst',
'void',
[param('ns3::Ipv4Address', 'originalDst')])
## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionRerrUnreachHeader::SetSalvage(uint8_t salvage) [member function]
cls.add_method('SetSalvage',
'void',
[param('uint8_t', 'salvage')],
is_virtual=True)
## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionRerrUnreachHeader::SetUnreachNode(ns3::Ipv4Address unreachNode) [member function]
cls.add_method('SetUnreachNode',
'void',
[param('ns3::Ipv4Address', 'unreachNode')])
return
def register_Ns3DsrDsrOptionRerrUnsupportHeader_methods(root_module, cls):
## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionRerrUnsupportHeader::DsrOptionRerrUnsupportHeader(ns3::dsr::DsrOptionRerrUnsupportHeader const & arg0) [constructor]
cls.add_constructor([param('ns3::dsr::DsrOptionRerrUnsupportHeader const &', 'arg0')])
## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionRerrUnsupportHeader::DsrOptionRerrUnsupportHeader() [constructor]
cls.add_constructor([])
## dsr-option-header.h (module 'dsr'): uint32_t ns3::dsr::DsrOptionRerrUnsupportHeader::Deserialize(ns3::Buffer::Iterator start) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('ns3::Buffer::Iterator', 'start')],
is_virtual=True)
## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionHeader::Alignment ns3::dsr::DsrOptionRerrUnsupportHeader::GetAlignment() const [member function]
cls.add_method('GetAlignment',
'ns3::dsr::DsrOptionHeader::Alignment',
[],
is_const=True, is_virtual=True)
## dsr-option-header.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::DsrOptionRerrUnsupportHeader::GetErrorDst() const [member function]
cls.add_method('GetErrorDst',
'ns3::Ipv4Address',
[],
is_const=True, is_virtual=True)
## dsr-option-header.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::DsrOptionRerrUnsupportHeader::GetErrorSrc() const [member function]
cls.add_method('GetErrorSrc',
'ns3::Ipv4Address',
[],
is_const=True, is_virtual=True)
## dsr-option-header.h (module 'dsr'): ns3::TypeId ns3::dsr::DsrOptionRerrUnsupportHeader::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## dsr-option-header.h (module 'dsr'): uint8_t ns3::dsr::DsrOptionRerrUnsupportHeader::GetSalvage() const [member function]
cls.add_method('GetSalvage',
'uint8_t',
[],
is_const=True, is_virtual=True)
## dsr-option-header.h (module 'dsr'): uint32_t ns3::dsr::DsrOptionRerrUnsupportHeader::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True, is_virtual=True)
## dsr-option-header.h (module 'dsr'): static ns3::TypeId ns3::dsr::DsrOptionRerrUnsupportHeader::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## dsr-option-header.h (module 'dsr'): uint16_t ns3::dsr::DsrOptionRerrUnsupportHeader::GetUnsupported() const [member function]
cls.add_method('GetUnsupported',
'uint16_t',
[],
is_const=True)
## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionRerrUnsupportHeader::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True, is_virtual=True)
## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionRerrUnsupportHeader::Serialize(ns3::Buffer::Iterator start) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::Buffer::Iterator', 'start')],
is_const=True, is_virtual=True)
## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionRerrUnsupportHeader::SetErrorDst(ns3::Ipv4Address errorDstAddress) [member function]
cls.add_method('SetErrorDst',
'void',
[param('ns3::Ipv4Address', 'errorDstAddress')],
is_virtual=True)
## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionRerrUnsupportHeader::SetErrorSrc(ns3::Ipv4Address errorSrcAddress) [member function]
cls.add_method('SetErrorSrc',
'void',
[param('ns3::Ipv4Address', 'errorSrcAddress')],
is_virtual=True)
## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionRerrUnsupportHeader::SetSalvage(uint8_t salvage) [member function]
cls.add_method('SetSalvage',
'void',
[param('uint8_t', 'salvage')],
is_virtual=True)
## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionRerrUnsupportHeader::SetUnsupported(uint16_t optionType) [member function]
cls.add_method('SetUnsupported',
'void',
[param('uint16_t', 'optionType')])
return
def register_Ns3DsrDsrOptionRrepHeader_methods(root_module, cls):
## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionRrepHeader::DsrOptionRrepHeader(ns3::dsr::DsrOptionRrepHeader const & arg0) [constructor]
cls.add_constructor([param('ns3::dsr::DsrOptionRrepHeader const &', 'arg0')])
## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionRrepHeader::DsrOptionRrepHeader() [constructor]
cls.add_constructor([])
## dsr-option-header.h (module 'dsr'): uint32_t ns3::dsr::DsrOptionRrepHeader::Deserialize(ns3::Buffer::Iterator start) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('ns3::Buffer::Iterator', 'start')],
is_virtual=True)
## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionHeader::Alignment ns3::dsr::DsrOptionRrepHeader::GetAlignment() const [member function]
cls.add_method('GetAlignment',
'ns3::dsr::DsrOptionHeader::Alignment',
[],
is_const=True, is_virtual=True)
## dsr-option-header.h (module 'dsr'): ns3::TypeId ns3::dsr::DsrOptionRrepHeader::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## dsr-option-header.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::DsrOptionRrepHeader::GetNodeAddress(uint8_t index) const [member function]
cls.add_method('GetNodeAddress',
'ns3::Ipv4Address',
[param('uint8_t', 'index')],
is_const=True)
## dsr-option-header.h (module 'dsr'): std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> > ns3::dsr::DsrOptionRrepHeader::GetNodesAddress() const [member function]
cls.add_method('GetNodesAddress',
'std::vector< ns3::Ipv4Address >',
[],
is_const=True)
## dsr-option-header.h (module 'dsr'): uint32_t ns3::dsr::DsrOptionRrepHeader::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True, is_virtual=True)
## dsr-option-header.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::DsrOptionRrepHeader::GetTargetAddress(std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> > ipv4Address) const [member function]
cls.add_method('GetTargetAddress',
'ns3::Ipv4Address',
[param('std::vector< ns3::Ipv4Address >', 'ipv4Address')],
is_const=True)
## dsr-option-header.h (module 'dsr'): static ns3::TypeId ns3::dsr::DsrOptionRrepHeader::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionRrepHeader::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True, is_virtual=True)
## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionRrepHeader::Serialize(ns3::Buffer::Iterator start) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::Buffer::Iterator', 'start')],
is_const=True, is_virtual=True)
## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionRrepHeader::SetNodeAddress(uint8_t index, ns3::Ipv4Address addr) [member function]
cls.add_method('SetNodeAddress',
'void',
[param('uint8_t', 'index'), param('ns3::Ipv4Address', 'addr')])
## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionRrepHeader::SetNodesAddress(std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> > ipv4Address) [member function]
cls.add_method('SetNodesAddress',
'void',
[param('std::vector< ns3::Ipv4Address >', 'ipv4Address')])
## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionRrepHeader::SetNumberAddress(uint8_t n) [member function]
cls.add_method('SetNumberAddress',
'void',
[param('uint8_t', 'n')])
return
def register_Ns3DsrDsrOptionRreqHeader_methods(root_module, cls):
## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionRreqHeader::DsrOptionRreqHeader(ns3::dsr::DsrOptionRreqHeader const & arg0) [constructor]
cls.add_constructor([param('ns3::dsr::DsrOptionRreqHeader const &', 'arg0')])
## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionRreqHeader::DsrOptionRreqHeader() [constructor]
cls.add_constructor([])
## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionRreqHeader::AddNodeAddress(ns3::Ipv4Address ipv4) [member function]
cls.add_method('AddNodeAddress',
'void',
[param('ns3::Ipv4Address', 'ipv4')])
## dsr-option-header.h (module 'dsr'): uint32_t ns3::dsr::DsrOptionRreqHeader::Deserialize(ns3::Buffer::Iterator start) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('ns3::Buffer::Iterator', 'start')],
is_virtual=True)
## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionHeader::Alignment ns3::dsr::DsrOptionRreqHeader::GetAlignment() const [member function]
cls.add_method('GetAlignment',
'ns3::dsr::DsrOptionHeader::Alignment',
[],
is_const=True, is_virtual=True)
## dsr-option-header.h (module 'dsr'): uint16_t ns3::dsr::DsrOptionRreqHeader::GetId() const [member function]
cls.add_method('GetId',
'uint16_t',
[],
is_const=True)
## dsr-option-header.h (module 'dsr'): ns3::TypeId ns3::dsr::DsrOptionRreqHeader::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## dsr-option-header.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::DsrOptionRreqHeader::GetNodeAddress(uint8_t index) const [member function]
cls.add_method('GetNodeAddress',
'ns3::Ipv4Address',
[param('uint8_t', 'index')],
is_const=True)
## dsr-option-header.h (module 'dsr'): std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> > ns3::dsr::DsrOptionRreqHeader::GetNodesAddresses() const [member function]
cls.add_method('GetNodesAddresses',
'std::vector< ns3::Ipv4Address >',
[],
is_const=True)
## dsr-option-header.h (module 'dsr'): uint32_t ns3::dsr::DsrOptionRreqHeader::GetNodesNumber() const [member function]
cls.add_method('GetNodesNumber',
'uint32_t',
[],
is_const=True)
## dsr-option-header.h (module 'dsr'): uint32_t ns3::dsr::DsrOptionRreqHeader::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True, is_virtual=True)
## dsr-option-header.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::DsrOptionRreqHeader::GetTarget() [member function]
cls.add_method('GetTarget',
'ns3::Ipv4Address',
[])
## dsr-option-header.h (module 'dsr'): static ns3::TypeId ns3::dsr::DsrOptionRreqHeader::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionRreqHeader::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True, is_virtual=True)
## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionRreqHeader::Serialize(ns3::Buffer::Iterator start) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::Buffer::Iterator', 'start')],
is_const=True, is_virtual=True)
## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionRreqHeader::SetId(uint16_t identification) [member function]
cls.add_method('SetId',
'void',
[param('uint16_t', 'identification')])
## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionRreqHeader::SetNodeAddress(uint8_t index, ns3::Ipv4Address addr) [member function]
cls.add_method('SetNodeAddress',
'void',
[param('uint8_t', 'index'), param('ns3::Ipv4Address', 'addr')])
## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionRreqHeader::SetNodesAddress(std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> > ipv4Address) [member function]
cls.add_method('SetNodesAddress',
'void',
[param('std::vector< ns3::Ipv4Address >', 'ipv4Address')])
## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionRreqHeader::SetNumberAddress(uint8_t n) [member function]
cls.add_method('SetNumberAddress',
'void',
[param('uint8_t', 'n')])
## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionRreqHeader::SetTarget(ns3::Ipv4Address target) [member function]
cls.add_method('SetTarget',
'void',
[param('ns3::Ipv4Address', 'target')])
return
def register_Ns3DsrDsrOptionSRHeader_methods(root_module, cls):
cls.add_output_stream_operator()
## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionSRHeader::DsrOptionSRHeader(ns3::dsr::DsrOptionSRHeader const & arg0) [constructor]
cls.add_constructor([param('ns3::dsr::DsrOptionSRHeader const &', 'arg0')])
## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionSRHeader::DsrOptionSRHeader() [constructor]
cls.add_constructor([])
## dsr-option-header.h (module 'dsr'): uint32_t ns3::dsr::DsrOptionSRHeader::Deserialize(ns3::Buffer::Iterator start) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('ns3::Buffer::Iterator', 'start')],
is_virtual=True)
## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionHeader::Alignment ns3::dsr::DsrOptionSRHeader::GetAlignment() const [member function]
cls.add_method('GetAlignment',
'ns3::dsr::DsrOptionHeader::Alignment',
[],
is_const=True, is_virtual=True)
## dsr-option-header.h (module 'dsr'): ns3::TypeId ns3::dsr::DsrOptionSRHeader::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## dsr-option-header.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::DsrOptionSRHeader::GetNodeAddress(uint8_t index) const [member function]
cls.add_method('GetNodeAddress',
'ns3::Ipv4Address',
[param('uint8_t', 'index')],
is_const=True)
## dsr-option-header.h (module 'dsr'): uint8_t ns3::dsr::DsrOptionSRHeader::GetNodeListSize() const [member function]
cls.add_method('GetNodeListSize',
'uint8_t',
[],
is_const=True)
## dsr-option-header.h (module 'dsr'): std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> > ns3::dsr::DsrOptionSRHeader::GetNodesAddress() const [member function]
cls.add_method('GetNodesAddress',
'std::vector< ns3::Ipv4Address >',
[],
is_const=True)
## dsr-option-header.h (module 'dsr'): uint8_t ns3::dsr::DsrOptionSRHeader::GetSalvage() const [member function]
cls.add_method('GetSalvage',
'uint8_t',
[],
is_const=True)
## dsr-option-header.h (module 'dsr'): uint8_t ns3::dsr::DsrOptionSRHeader::GetSegmentsLeft() const [member function]
cls.add_method('GetSegmentsLeft',
'uint8_t',
[],
is_const=True)
## dsr-option-header.h (module 'dsr'): uint32_t ns3::dsr::DsrOptionSRHeader::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True, is_virtual=True)
## dsr-option-header.h (module 'dsr'): static ns3::TypeId ns3::dsr::DsrOptionSRHeader::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionSRHeader::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True, is_virtual=True)
## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionSRHeader::Serialize(ns3::Buffer::Iterator start) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::Buffer::Iterator', 'start')],
is_const=True, is_virtual=True)
## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionSRHeader::SetNodeAddress(uint8_t index, ns3::Ipv4Address addr) [member function]
cls.add_method('SetNodeAddress',
'void',
[param('uint8_t', 'index'), param('ns3::Ipv4Address', 'addr')])
## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionSRHeader::SetNodesAddress(std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> > ipv4Address) [member function]
cls.add_method('SetNodesAddress',
'void',
[param('std::vector< ns3::Ipv4Address >', 'ipv4Address')])
## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionSRHeader::SetNumberAddress(uint8_t n) [member function]
cls.add_method('SetNumberAddress',
'void',
[param('uint8_t', 'n')])
## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionSRHeader::SetSalvage(uint8_t salvage) [member function]
cls.add_method('SetSalvage',
'void',
[param('uint8_t', 'salvage')])
## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionSRHeader::SetSegmentsLeft(uint8_t segmentsLeft) [member function]
cls.add_method('SetSegmentsLeft',
'void',
[param('uint8_t', 'segmentsLeft')])
return
def register_Ns3DsrDsrOptions_methods(root_module, cls):
## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptions::DsrOptions(ns3::dsr::DsrOptions const & arg0) [constructor]
cls.add_constructor([param('ns3::dsr::DsrOptions const &', 'arg0')])
## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptions::DsrOptions() [constructor]
cls.add_constructor([])
## dsr-options.h (module 'dsr'): bool ns3::dsr::DsrOptions::CheckDuplicates(ns3::Ipv4Address ipv4Address, std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> > & vec) [member function]
cls.add_method('CheckDuplicates',
'bool',
[param('ns3::Ipv4Address', 'ipv4Address'), param('std::vector< ns3::Ipv4Address > &', 'vec')])
## dsr-options.h (module 'dsr'): bool ns3::dsr::DsrOptions::ContainAddressAfter(ns3::Ipv4Address ipv4Address, ns3::Ipv4Address destAddress, std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> > & nodeList) [member function]
cls.add_method('ContainAddressAfter',
'bool',
[param('ns3::Ipv4Address', 'ipv4Address'), param('ns3::Ipv4Address', 'destAddress'), param('std::vector< ns3::Ipv4Address > &', 'nodeList')])
## dsr-options.h (module 'dsr'): std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> > ns3::dsr::DsrOptions::CutRoute(ns3::Ipv4Address ipv4Address, std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> > & nodeList) [member function]
cls.add_method('CutRoute',
'std::vector< ns3::Ipv4Address >',
[param('ns3::Ipv4Address', 'ipv4Address'), param('std::vector< ns3::Ipv4Address > &', 'nodeList')])
## dsr-options.h (module 'dsr'): uint32_t ns3::dsr::DsrOptions::GetIDfromIP(ns3::Ipv4Address address) [member function]
cls.add_method('GetIDfromIP',
'uint32_t',
[param('ns3::Ipv4Address', 'address')])
## dsr-options.h (module 'dsr'): ns3::Ptr<ns3::Node> ns3::dsr::DsrOptions::GetNode() const [member function]
cls.add_method('GetNode',
'ns3::Ptr< ns3::Node >',
[],
is_const=True)
## dsr-options.h (module 'dsr'): ns3::Ptr<ns3::Node> ns3::dsr::DsrOptions::GetNodeWithAddress(ns3::Ipv4Address ipv4Address) [member function]
cls.add_method('GetNodeWithAddress',
'ns3::Ptr< ns3::Node >',
[param('ns3::Ipv4Address', 'ipv4Address')])
## dsr-options.h (module 'dsr'): uint8_t ns3::dsr::DsrOptions::GetOptionNumber() const [member function]
cls.add_method('GetOptionNumber',
'uint8_t',
[],
is_const=True, is_pure_virtual=True, is_virtual=True)
## dsr-options.h (module 'dsr'): static ns3::TypeId ns3::dsr::DsrOptions::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## dsr-options.h (module 'dsr'): bool ns3::dsr::DsrOptions::IfDuplicates(std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> > & vec, std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> > & vec2) [member function]
cls.add_method('IfDuplicates',
'bool',
[param('std::vector< ns3::Ipv4Address > &', 'vec'), param('std::vector< ns3::Ipv4Address > &', 'vec2')])
## dsr-options.h (module 'dsr'): void ns3::dsr::DsrOptions::PrintVector(std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> > & vec) [member function]
cls.add_method('PrintVector',
'void',
[param('std::vector< ns3::Ipv4Address > &', 'vec')])
## dsr-options.h (module 'dsr'): uint8_t ns3::dsr::DsrOptions::Process(ns3::Ptr<ns3::Packet> packet, ns3::Ptr<ns3::Packet> dsrP, ns3::Ipv4Address ipv4Address, ns3::Ipv4Address source, ns3::Ipv4Header const & ipv4Header, uint8_t protocol, bool & isPromisc, ns3::Ipv4Address promiscSource) [member function]
cls.add_method('Process',
'uint8_t',
[param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ptr< ns3::Packet >', 'dsrP'), param('ns3::Ipv4Address', 'ipv4Address'), param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Header const &', 'ipv4Header'), param('uint8_t', 'protocol'), param('bool &', 'isPromisc'), param('ns3::Ipv4Address', 'promiscSource')],
is_pure_virtual=True, is_virtual=True)
## dsr-options.h (module 'dsr'): void ns3::dsr::DsrOptions::RemoveDuplicates(std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> > & vec) [member function]
cls.add_method('RemoveDuplicates',
'void',
[param('std::vector< ns3::Ipv4Address > &', 'vec')])
## dsr-options.h (module 'dsr'): bool ns3::dsr::DsrOptions::ReverseRoutes(std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> > & vec) [member function]
cls.add_method('ReverseRoutes',
'bool',
[param('std::vector< ns3::Ipv4Address > &', 'vec')])
## dsr-options.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::DsrOptions::ReverseSearchNextHop(ns3::Ipv4Address ipv4Address, std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> > & vec) [member function]
cls.add_method('ReverseSearchNextHop',
'ns3::Ipv4Address',
[param('ns3::Ipv4Address', 'ipv4Address'), param('std::vector< ns3::Ipv4Address > &', 'vec')])
## dsr-options.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::DsrOptions::ReverseSearchNextTwoHop(ns3::Ipv4Address ipv4Address, std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> > & vec) [member function]
cls.add_method('ReverseSearchNextTwoHop',
'ns3::Ipv4Address',
[param('ns3::Ipv4Address', 'ipv4Address'), param('std::vector< ns3::Ipv4Address > &', 'vec')])
## dsr-options.h (module 'dsr'): void ns3::dsr::DsrOptions::ScheduleReply(ns3::Ptr<ns3::Packet> & packet, std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> > & nodeList, ns3::Ipv4Address & source, ns3::Ipv4Address & destination) [member function]
cls.add_method('ScheduleReply',
'void',
[param('ns3::Ptr< ns3::Packet > &', 'packet'), param('std::vector< ns3::Ipv4Address > &', 'nodeList'), param('ns3::Ipv4Address &', 'source'), param('ns3::Ipv4Address &', 'destination')])
## dsr-options.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::DsrOptions::SearchNextHop(ns3::Ipv4Address ipv4Address, std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> > & vec) [member function]
cls.add_method('SearchNextHop',
'ns3::Ipv4Address',
[param('ns3::Ipv4Address', 'ipv4Address'), param('std::vector< ns3::Ipv4Address > &', 'vec')])
## dsr-options.h (module 'dsr'): void ns3::dsr::DsrOptions::SetNode(ns3::Ptr<ns3::Node> node) [member function]
cls.add_method('SetNode',
'void',
[param('ns3::Ptr< ns3::Node >', 'node')])
## dsr-options.h (module 'dsr'): ns3::Ptr<ns3::Ipv4Route> ns3::dsr::DsrOptions::SetRoute(ns3::Ipv4Address nextHop, ns3::Ipv4Address srcAddress) [member function]
cls.add_method('SetRoute',
'ns3::Ptr< ns3::Ipv4Route >',
[param('ns3::Ipv4Address', 'nextHop'), param('ns3::Ipv4Address', 'srcAddress')],
is_virtual=True)
return
def register_Ns3DsrDsrPassiveBuffEntry_methods(root_module, cls):
cls.add_binary_comparison_operator('==')
## dsr-passive-buff.h (module 'dsr'): ns3::dsr::DsrPassiveBuffEntry::DsrPassiveBuffEntry(ns3::dsr::DsrPassiveBuffEntry const & arg0) [constructor]
cls.add_constructor([param('ns3::dsr::DsrPassiveBuffEntry const &', 'arg0')])
## dsr-passive-buff.h (module 'dsr'): ns3::dsr::DsrPassiveBuffEntry::DsrPassiveBuffEntry(ns3::Ptr<const ns3::Packet> pa=0, ns3::Ipv4Address d=ns3::Ipv4Address(), ns3::Ipv4Address s=ns3::Ipv4Address(), ns3::Ipv4Address n=ns3::Ipv4Address(), uint16_t i=0, uint16_t f=0, uint8_t seg=0, ns3::Time exp=ns3::Simulator::Now(), uint8_t p=0) [constructor]
cls.add_constructor([param('ns3::Ptr< ns3::Packet const >', 'pa', default_value='0'), param('ns3::Ipv4Address', 'd', default_value='ns3::Ipv4Address()'), param('ns3::Ipv4Address', 's', default_value='ns3::Ipv4Address()'), param('ns3::Ipv4Address', 'n', default_value='ns3::Ipv4Address()'), param('uint16_t', 'i', default_value='0'), param('uint16_t', 'f', default_value='0'), param('uint8_t', 'seg', default_value='0'), param('ns3::Time', 'exp', default_value='ns3::Simulator::Now()'), param('uint8_t', 'p', default_value='0')])
## dsr-passive-buff.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::DsrPassiveBuffEntry::GetDestination() const [member function]
cls.add_method('GetDestination',
'ns3::Ipv4Address',
[],
is_const=True)
## dsr-passive-buff.h (module 'dsr'): ns3::Time ns3::dsr::DsrPassiveBuffEntry::GetExpireTime() const [member function]
cls.add_method('GetExpireTime',
'ns3::Time',
[],
is_const=True)
## dsr-passive-buff.h (module 'dsr'): uint16_t ns3::dsr::DsrPassiveBuffEntry::GetFragmentOffset() const [member function]
cls.add_method('GetFragmentOffset',
'uint16_t',
[],
is_const=True)
## dsr-passive-buff.h (module 'dsr'): uint16_t ns3::dsr::DsrPassiveBuffEntry::GetIdentification() const [member function]
cls.add_method('GetIdentification',
'uint16_t',
[],
is_const=True)
## dsr-passive-buff.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::DsrPassiveBuffEntry::GetNextHop() const [member function]
cls.add_method('GetNextHop',
'ns3::Ipv4Address',
[],
is_const=True)
## dsr-passive-buff.h (module 'dsr'): ns3::Ptr<const ns3::Packet> ns3::dsr::DsrPassiveBuffEntry::GetPacket() const [member function]
cls.add_method('GetPacket',
'ns3::Ptr< ns3::Packet const >',
[],
is_const=True)
## dsr-passive-buff.h (module 'dsr'): uint8_t ns3::dsr::DsrPassiveBuffEntry::GetProtocol() const [member function]
cls.add_method('GetProtocol',
'uint8_t',
[],
is_const=True)
## dsr-passive-buff.h (module 'dsr'): uint8_t ns3::dsr::DsrPassiveBuffEntry::GetSegsLeft() const [member function]
cls.add_method('GetSegsLeft',
'uint8_t',
[],
is_const=True)
## dsr-passive-buff.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::DsrPassiveBuffEntry::GetSource() const [member function]
cls.add_method('GetSource',
'ns3::Ipv4Address',
[],
is_const=True)
## dsr-passive-buff.h (module 'dsr'): void ns3::dsr::DsrPassiveBuffEntry::SetDestination(ns3::Ipv4Address d) [member function]
cls.add_method('SetDestination',
'void',
[param('ns3::Ipv4Address', 'd')])
## dsr-passive-buff.h (module 'dsr'): void ns3::dsr::DsrPassiveBuffEntry::SetExpireTime(ns3::Time exp) [member function]
cls.add_method('SetExpireTime',
'void',
[param('ns3::Time', 'exp')])
## dsr-passive-buff.h (module 'dsr'): void ns3::dsr::DsrPassiveBuffEntry::SetFragmentOffset(uint16_t f) [member function]
cls.add_method('SetFragmentOffset',
'void',
[param('uint16_t', 'f')])
## dsr-passive-buff.h (module 'dsr'): void ns3::dsr::DsrPassiveBuffEntry::SetIdentification(uint16_t i) [member function]
cls.add_method('SetIdentification',
'void',
[param('uint16_t', 'i')])
## dsr-passive-buff.h (module 'dsr'): void ns3::dsr::DsrPassiveBuffEntry::SetNextHop(ns3::Ipv4Address n) [member function]
cls.add_method('SetNextHop',
'void',
[param('ns3::Ipv4Address', 'n')])
## dsr-passive-buff.h (module 'dsr'): void ns3::dsr::DsrPassiveBuffEntry::SetPacket(ns3::Ptr<const ns3::Packet> p) [member function]
cls.add_method('SetPacket',
'void',
[param('ns3::Ptr< ns3::Packet const >', 'p')])
## dsr-passive-buff.h (module 'dsr'): void ns3::dsr::DsrPassiveBuffEntry::SetProtocol(uint8_t p) [member function]
cls.add_method('SetProtocol',
'void',
[param('uint8_t', 'p')])
## dsr-passive-buff.h (module 'dsr'): void ns3::dsr::DsrPassiveBuffEntry::SetSegsLeft(uint8_t seg) [member function]
cls.add_method('SetSegsLeft',
'void',
[param('uint8_t', 'seg')])
## dsr-passive-buff.h (module 'dsr'): void ns3::dsr::DsrPassiveBuffEntry::SetSource(ns3::Ipv4Address s) [member function]
cls.add_method('SetSource',
'void',
[param('ns3::Ipv4Address', 's')])
return
def register_Ns3DsrDsrPassiveBuffer_methods(root_module, cls):
## dsr-passive-buff.h (module 'dsr'): ns3::dsr::DsrPassiveBuffer::DsrPassiveBuffer(ns3::dsr::DsrPassiveBuffer const & arg0) [constructor]
cls.add_constructor([param('ns3::dsr::DsrPassiveBuffer const &', 'arg0')])
## dsr-passive-buff.h (module 'dsr'): ns3::dsr::DsrPassiveBuffer::DsrPassiveBuffer() [constructor]
cls.add_constructor([])
## dsr-passive-buff.h (module 'dsr'): bool ns3::dsr::DsrPassiveBuffer::AllEqual(ns3::dsr::DsrPassiveBuffEntry & entry) [member function]
cls.add_method('AllEqual',
'bool',
[param('ns3::dsr::DsrPassiveBuffEntry &', 'entry')])
## dsr-passive-buff.h (module 'dsr'): bool ns3::dsr::DsrPassiveBuffer::Dequeue(ns3::Ipv4Address dst, ns3::dsr::DsrPassiveBuffEntry & entry) [member function]
cls.add_method('Dequeue',
'bool',
[param('ns3::Ipv4Address', 'dst'), param('ns3::dsr::DsrPassiveBuffEntry &', 'entry')])
## dsr-passive-buff.h (module 'dsr'): bool ns3::dsr::DsrPassiveBuffer::Enqueue(ns3::dsr::DsrPassiveBuffEntry & entry) [member function]
cls.add_method('Enqueue',
'bool',
[param('ns3::dsr::DsrPassiveBuffEntry &', 'entry')])
## dsr-passive-buff.h (module 'dsr'): bool ns3::dsr::DsrPassiveBuffer::Find(ns3::Ipv4Address dst) [member function]
cls.add_method('Find',
'bool',
[param('ns3::Ipv4Address', 'dst')])
## dsr-passive-buff.h (module 'dsr'): uint32_t ns3::dsr::DsrPassiveBuffer::GetMaxQueueLen() const [member function]
cls.add_method('GetMaxQueueLen',
'uint32_t',
[],
is_const=True)
## dsr-passive-buff.h (module 'dsr'): ns3::Time ns3::dsr::DsrPassiveBuffer::GetPassiveBufferTimeout() const [member function]
cls.add_method('GetPassiveBufferTimeout',
'ns3::Time',
[],
is_const=True)
## dsr-passive-buff.h (module 'dsr'): uint32_t ns3::dsr::DsrPassiveBuffer::GetSize() [member function]
cls.add_method('GetSize',
'uint32_t',
[])
## dsr-passive-buff.h (module 'dsr'): static ns3::TypeId ns3::dsr::DsrPassiveBuffer::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## dsr-passive-buff.h (module 'dsr'): void ns3::dsr::DsrPassiveBuffer::SetMaxQueueLen(uint32_t len) [member function]
cls.add_method('SetMaxQueueLen',
'void',
[param('uint32_t', 'len')])
## dsr-passive-buff.h (module 'dsr'): void ns3::dsr::DsrPassiveBuffer::SetPassiveBufferTimeout(ns3::Time t) [member function]
cls.add_method('SetPassiveBufferTimeout',
'void',
[param('ns3::Time', 't')])
return
def register_Ns3DsrDsrReceivedRreqEntry_methods(root_module, cls):
cls.add_binary_comparison_operator('==')
## dsr-rreq-table.h (module 'dsr'): ns3::dsr::DsrReceivedRreqEntry::DsrReceivedRreqEntry(ns3::dsr::DsrReceivedRreqEntry const & arg0) [constructor]
cls.add_constructor([param('ns3::dsr::DsrReceivedRreqEntry const &', 'arg0')])
## dsr-rreq-table.h (module 'dsr'): ns3::dsr::DsrReceivedRreqEntry::DsrReceivedRreqEntry(ns3::Ipv4Address d=ns3::Ipv4Address(), uint16_t i=0) [constructor]
cls.add_constructor([param('ns3::Ipv4Address', 'd', default_value='ns3::Ipv4Address()'), param('uint16_t', 'i', default_value='0')])
## dsr-rreq-table.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::DsrReceivedRreqEntry::GetDestination() const [member function]
cls.add_method('GetDestination',
'ns3::Ipv4Address',
[],
is_const=True)
## dsr-rreq-table.h (module 'dsr'): ns3::Time ns3::dsr::DsrReceivedRreqEntry::GetExpireTime() const [member function]
cls.add_method('GetExpireTime',
'ns3::Time',
[],
is_const=True)
## dsr-rreq-table.h (module 'dsr'): uint16_t ns3::dsr::DsrReceivedRreqEntry::GetIdentification() const [member function]
cls.add_method('GetIdentification',
'uint16_t',
[],
is_const=True)
## dsr-rreq-table.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::DsrReceivedRreqEntry::GetSource() const [member function]
cls.add_method('GetSource',
'ns3::Ipv4Address',
[],
is_const=True)
## dsr-rreq-table.h (module 'dsr'): void ns3::dsr::DsrReceivedRreqEntry::SetDestination(ns3::Ipv4Address d) [member function]
cls.add_method('SetDestination',
'void',
[param('ns3::Ipv4Address', 'd')])
## dsr-rreq-table.h (module 'dsr'): void ns3::dsr::DsrReceivedRreqEntry::SetExpireTime(ns3::Time exp) [member function]
cls.add_method('SetExpireTime',
'void',
[param('ns3::Time', 'exp')])
## dsr-rreq-table.h (module 'dsr'): void ns3::dsr::DsrReceivedRreqEntry::SetIdentification(uint16_t i) [member function]
cls.add_method('SetIdentification',
'void',
[param('uint16_t', 'i')])
## dsr-rreq-table.h (module 'dsr'): void ns3::dsr::DsrReceivedRreqEntry::SetSource(ns3::Ipv4Address s) [member function]
cls.add_method('SetSource',
'void',
[param('ns3::Ipv4Address', 's')])
return
def register_Ns3DsrDsrRouteCache_methods(root_module, cls):
## dsr-rcache.h (module 'dsr'): ns3::dsr::DsrRouteCache::DsrRouteCache(ns3::dsr::DsrRouteCache const & arg0) [constructor]
cls.add_constructor([param('ns3::dsr::DsrRouteCache const &', 'arg0')])
## dsr-rcache.h (module 'dsr'): ns3::dsr::DsrRouteCache::DsrRouteCache() [constructor]
cls.add_constructor([])
## dsr-rcache.h (module 'dsr'): void ns3::dsr::DsrRouteCache::AddArpCache(ns3::Ptr<ns3::ArpCache> a) [member function]
cls.add_method('AddArpCache',
'void',
[param('ns3::Ptr< ns3::ArpCache >', 'a')])
## dsr-rcache.h (module 'dsr'): void ns3::dsr::DsrRouteCache::AddNeighbor(std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> > nodeList, ns3::Ipv4Address ownAddress, ns3::Time expire) [member function]
cls.add_method('AddNeighbor',
'void',
[param('std::vector< ns3::Ipv4Address >', 'nodeList'), param('ns3::Ipv4Address', 'ownAddress'), param('ns3::Time', 'expire')])
## dsr-rcache.h (module 'dsr'): bool ns3::dsr::DsrRouteCache::AddRoute(ns3::dsr::DsrRouteCacheEntry & rt) [member function]
cls.add_method('AddRoute',
'bool',
[param('ns3::dsr::DsrRouteCacheEntry &', 'rt')])
## dsr-rcache.h (module 'dsr'): bool ns3::dsr::DsrRouteCache::AddRoute_Link(ns3::dsr::DsrRouteCacheEntry::IP_VECTOR nodelist, ns3::Ipv4Address node) [member function]
cls.add_method('AddRoute_Link',
'bool',
[param('std::vector< ns3::Ipv4Address >', 'nodelist'), param('ns3::Ipv4Address', 'node')])
## dsr-rcache.h (module 'dsr'): uint16_t ns3::dsr::DsrRouteCache::CheckUniqueAckId(ns3::Ipv4Address nextHop) [member function]
cls.add_method('CheckUniqueAckId',
'uint16_t',
[param('ns3::Ipv4Address', 'nextHop')])
## dsr-rcache.h (module 'dsr'): void ns3::dsr::DsrRouteCache::Clear() [member function]
cls.add_method('Clear',
'void',
[])
## dsr-rcache.h (module 'dsr'): void ns3::dsr::DsrRouteCache::ClearMac() [member function]
cls.add_method('ClearMac',
'void',
[])
## dsr-rcache.h (module 'dsr'): void ns3::dsr::DsrRouteCache::DelArpCache(ns3::Ptr<ns3::ArpCache> arg0) [member function]
cls.add_method('DelArpCache',
'void',
[param('ns3::Ptr< ns3::ArpCache >', 'arg0')])
## dsr-rcache.h (module 'dsr'): void ns3::dsr::DsrRouteCache::DeleteAllRoutesIncludeLink(ns3::Ipv4Address errorSrc, ns3::Ipv4Address unreachNode, ns3::Ipv4Address node) [member function]
cls.add_method('DeleteAllRoutesIncludeLink',
'void',
[param('ns3::Ipv4Address', 'errorSrc'), param('ns3::Ipv4Address', 'unreachNode'), param('ns3::Ipv4Address', 'node')])
## dsr-rcache.h (module 'dsr'): bool ns3::dsr::DsrRouteCache::DeleteRoute(ns3::Ipv4Address dst) [member function]
cls.add_method('DeleteRoute',
'bool',
[param('ns3::Ipv4Address', 'dst')])
## dsr-rcache.h (module 'dsr'): bool ns3::dsr::DsrRouteCache::FindSameRoute(ns3::dsr::DsrRouteCacheEntry & rt, std::list<ns3::dsr::DsrRouteCacheEntry, std::allocator<ns3::dsr::DsrRouteCacheEntry> > & rtVector) [member function]
cls.add_method('FindSameRoute',
'bool',
[param('ns3::dsr::DsrRouteCacheEntry &', 'rt'), param('std::list< ns3::dsr::DsrRouteCacheEntry > &', 'rtVector')])
## dsr-rcache.h (module 'dsr'): uint16_t ns3::dsr::DsrRouteCache::GetAckSize() [member function]
cls.add_method('GetAckSize',
'uint16_t',
[])
## dsr-rcache.h (module 'dsr'): ns3::Time ns3::dsr::DsrRouteCache::GetBadLinkLifetime() const [member function]
cls.add_method('GetBadLinkLifetime',
'ns3::Time',
[],
is_const=True)
## dsr-rcache.h (module 'dsr'): ns3::Time ns3::dsr::DsrRouteCache::GetCacheTimeout() const [member function]
cls.add_method('GetCacheTimeout',
'ns3::Time',
[],
is_const=True)
## dsr-rcache.h (module 'dsr'): ns3::Callback<void, ns3::Ipv4Address, unsigned char, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> ns3::dsr::DsrRouteCache::GetCallback() const [member function]
cls.add_method('GetCallback',
'ns3::Callback< void, ns3::Ipv4Address, unsigned char, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >',
[],
is_const=True)
## dsr-rcache.h (module 'dsr'): ns3::Time ns3::dsr::DsrRouteCache::GetExpireTime(ns3::Ipv4Address addr) [member function]
cls.add_method('GetExpireTime',
'ns3::Time',
[param('ns3::Ipv4Address', 'addr')])
## dsr-rcache.h (module 'dsr'): ns3::Time ns3::dsr::DsrRouteCache::GetInitStability() const [member function]
cls.add_method('GetInitStability',
'ns3::Time',
[],
is_const=True)
## dsr-rcache.h (module 'dsr'): uint32_t ns3::dsr::DsrRouteCache::GetMaxCacheLen() const [member function]
cls.add_method('GetMaxCacheLen',
'uint32_t',
[],
is_const=True)
## dsr-rcache.h (module 'dsr'): uint32_t ns3::dsr::DsrRouteCache::GetMaxEntriesEachDst() const [member function]
cls.add_method('GetMaxEntriesEachDst',
'uint32_t',
[],
is_const=True)
## dsr-rcache.h (module 'dsr'): ns3::Time ns3::dsr::DsrRouteCache::GetMinLifeTime() const [member function]
cls.add_method('GetMinLifeTime',
'ns3::Time',
[],
is_const=True)
## dsr-rcache.h (module 'dsr'): uint64_t ns3::dsr::DsrRouteCache::GetStabilityDecrFactor() const [member function]
cls.add_method('GetStabilityDecrFactor',
'uint64_t',
[],
is_const=True)
## dsr-rcache.h (module 'dsr'): uint64_t ns3::dsr::DsrRouteCache::GetStabilityIncrFactor() const [member function]
cls.add_method('GetStabilityIncrFactor',
'uint64_t',
[],
is_const=True)
## dsr-rcache.h (module 'dsr'): bool ns3::dsr::DsrRouteCache::GetSubRoute() const [member function]
cls.add_method('GetSubRoute',
'bool',
[],
is_const=True)
## dsr-rcache.h (module 'dsr'): ns3::Callback<void, const ns3::WifiMacHeader &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> ns3::dsr::DsrRouteCache::GetTxErrorCallback() const [member function]
cls.add_method('GetTxErrorCallback',
'ns3::Callback< void, ns3::WifiMacHeader const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >',
[],
is_const=True)
## dsr-rcache.h (module 'dsr'): static ns3::TypeId ns3::dsr::DsrRouteCache::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## dsr-rcache.h (module 'dsr'): ns3::Time ns3::dsr::DsrRouteCache::GetUseExtends() const [member function]
cls.add_method('GetUseExtends',
'ns3::Time',
[],
is_const=True)
## dsr-rcache.h (module 'dsr'): bool ns3::dsr::DsrRouteCache::IsLinkCache() [member function]
cls.add_method('IsLinkCache',
'bool',
[])
## dsr-rcache.h (module 'dsr'): bool ns3::dsr::DsrRouteCache::IsNeighbor(ns3::Ipv4Address addr) [member function]
cls.add_method('IsNeighbor',
'bool',
[param('ns3::Ipv4Address', 'addr')])
## dsr-rcache.h (module 'dsr'): ns3::Mac48Address ns3::dsr::DsrRouteCache::LookupMacAddress(ns3::Ipv4Address addr) [member function]
cls.add_method('LookupMacAddress',
'ns3::Mac48Address',
[param('ns3::Ipv4Address', 'addr')])
## dsr-rcache.h (module 'dsr'): bool ns3::dsr::DsrRouteCache::LookupRoute(ns3::Ipv4Address id, ns3::dsr::DsrRouteCacheEntry & rt) [member function]
cls.add_method('LookupRoute',
'bool',
[param('ns3::Ipv4Address', 'id'), param('ns3::dsr::DsrRouteCacheEntry &', 'rt')])
## dsr-rcache.h (module 'dsr'): void ns3::dsr::DsrRouteCache::Print(std::ostream & os) [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')])
## dsr-rcache.h (module 'dsr'): void ns3::dsr::DsrRouteCache::PrintRouteVector(std::list<ns3::dsr::DsrRouteCacheEntry, std::allocator<ns3::dsr::DsrRouteCacheEntry> > route) [member function]
cls.add_method('PrintRouteVector',
'void',
[param('std::list< ns3::dsr::DsrRouteCacheEntry >', 'route')])
## dsr-rcache.h (module 'dsr'): void ns3::dsr::DsrRouteCache::PrintVector(std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> > & vec) [member function]
cls.add_method('PrintVector',
'void',
[param('std::vector< ns3::Ipv4Address > &', 'vec')])
## dsr-rcache.h (module 'dsr'): void ns3::dsr::DsrRouteCache::ProcessTxError(ns3::WifiMacHeader const & hdr) [member function]
cls.add_method('ProcessTxError',
'void',
[param('ns3::WifiMacHeader const &', 'hdr')])
## dsr-rcache.h (module 'dsr'): void ns3::dsr::DsrRouteCache::Purge() [member function]
cls.add_method('Purge',
'void',
[])
## dsr-rcache.h (module 'dsr'): void ns3::dsr::DsrRouteCache::PurgeLinkNode() [member function]
cls.add_method('PurgeLinkNode',
'void',
[])
## dsr-rcache.h (module 'dsr'): void ns3::dsr::DsrRouteCache::PurgeMac() [member function]
cls.add_method('PurgeMac',
'void',
[])
## dsr-rcache.h (module 'dsr'): void ns3::dsr::DsrRouteCache::RebuildBestRouteTable(ns3::Ipv4Address source) [member function]
cls.add_method('RebuildBestRouteTable',
'void',
[param('ns3::Ipv4Address', 'source')])
## dsr-rcache.h (module 'dsr'): void ns3::dsr::DsrRouteCache::RemoveLastEntry(std::list<ns3::dsr::DsrRouteCacheEntry, std::allocator<ns3::dsr::DsrRouteCacheEntry> > & rtVector) [member function]
cls.add_method('RemoveLastEntry',
'void',
[param('std::list< ns3::dsr::DsrRouteCacheEntry > &', 'rtVector')])
## dsr-rcache.h (module 'dsr'): void ns3::dsr::DsrRouteCache::ScheduleTimer() [member function]
cls.add_method('ScheduleTimer',
'void',
[])
## dsr-rcache.h (module 'dsr'): void ns3::dsr::DsrRouteCache::SetBadLinkLifetime(ns3::Time t) [member function]
cls.add_method('SetBadLinkLifetime',
'void',
[param('ns3::Time', 't')])
## dsr-rcache.h (module 'dsr'): void ns3::dsr::DsrRouteCache::SetCacheTimeout(ns3::Time t) [member function]
cls.add_method('SetCacheTimeout',
'void',
[param('ns3::Time', 't')])
## dsr-rcache.h (module 'dsr'): void ns3::dsr::DsrRouteCache::SetCacheType(std::string type) [member function]
cls.add_method('SetCacheType',
'void',
[param('std::string', 'type')])
## dsr-rcache.h (module 'dsr'): void ns3::dsr::DsrRouteCache::SetCallback(ns3::Callback<void, ns3::Ipv4Address, unsigned char, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> cb) [member function]
cls.add_method('SetCallback',
'void',
[param('ns3::Callback< void, ns3::Ipv4Address, unsigned char, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'cb')])
## dsr-rcache.h (module 'dsr'): void ns3::dsr::DsrRouteCache::SetInitStability(ns3::Time initStability) [member function]
cls.add_method('SetInitStability',
'void',
[param('ns3::Time', 'initStability')])
## dsr-rcache.h (module 'dsr'): void ns3::dsr::DsrRouteCache::SetMaxCacheLen(uint32_t len) [member function]
cls.add_method('SetMaxCacheLen',
'void',
[param('uint32_t', 'len')])
## dsr-rcache.h (module 'dsr'): void ns3::dsr::DsrRouteCache::SetMaxEntriesEachDst(uint32_t entries) [member function]
cls.add_method('SetMaxEntriesEachDst',
'void',
[param('uint32_t', 'entries')])
## dsr-rcache.h (module 'dsr'): void ns3::dsr::DsrRouteCache::SetMinLifeTime(ns3::Time minLifeTime) [member function]
cls.add_method('SetMinLifeTime',
'void',
[param('ns3::Time', 'minLifeTime')])
## dsr-rcache.h (module 'dsr'): void ns3::dsr::DsrRouteCache::SetStabilityDecrFactor(uint64_t decrFactor) [member function]
cls.add_method('SetStabilityDecrFactor',
'void',
[param('uint64_t', 'decrFactor')])
## dsr-rcache.h (module 'dsr'): void ns3::dsr::DsrRouteCache::SetStabilityIncrFactor(uint64_t incrFactor) [member function]
cls.add_method('SetStabilityIncrFactor',
'void',
[param('uint64_t', 'incrFactor')])
## dsr-rcache.h (module 'dsr'): void ns3::dsr::DsrRouteCache::SetSubRoute(bool subRoute) [member function]
cls.add_method('SetSubRoute',
'void',
[param('bool', 'subRoute')])
## dsr-rcache.h (module 'dsr'): void ns3::dsr::DsrRouteCache::SetUseExtends(ns3::Time useExtends) [member function]
cls.add_method('SetUseExtends',
'void',
[param('ns3::Time', 'useExtends')])
## dsr-rcache.h (module 'dsr'): void ns3::dsr::DsrRouteCache::UpdateNeighbor(std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> > nodeList, ns3::Time expire) [member function]
cls.add_method('UpdateNeighbor',
'void',
[param('std::vector< ns3::Ipv4Address >', 'nodeList'), param('ns3::Time', 'expire')])
## dsr-rcache.h (module 'dsr'): void ns3::dsr::DsrRouteCache::UpdateNetGraph() [member function]
cls.add_method('UpdateNetGraph',
'void',
[])
## dsr-rcache.h (module 'dsr'): bool ns3::dsr::DsrRouteCache::UpdateRouteEntry(ns3::Ipv4Address dst) [member function]
cls.add_method('UpdateRouteEntry',
'bool',
[param('ns3::Ipv4Address', 'dst')])
## dsr-rcache.h (module 'dsr'): void ns3::dsr::DsrRouteCache::UseExtends(ns3::dsr::DsrRouteCacheEntry::IP_VECTOR rt) [member function]
cls.add_method('UseExtends',
'void',
[param('std::vector< ns3::Ipv4Address >', 'rt')])
## dsr-rcache.h (module 'dsr'): ns3::dsr::DsrRouteCache::m_arp [variable]
cls.add_instance_attribute('m_arp', 'std::vector< ns3::Ptr< ns3::ArpCache > >', is_const=False)
## dsr-rcache.h (module 'dsr'): ns3::dsr::DsrRouteCache::m_delay [variable]
cls.add_instance_attribute('m_delay', 'ns3::Time', is_const=False)
## dsr-rcache.h (module 'dsr'): ns3::dsr::DsrRouteCache::m_handleLinkFailure [variable]
cls.add_instance_attribute('m_handleLinkFailure', 'ns3::Callback< void, ns3::Ipv4Address, unsigned char, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', is_const=False)
## dsr-rcache.h (module 'dsr'): ns3::dsr::DsrRouteCache::m_nb [variable]
cls.add_instance_attribute('m_nb', 'std::vector< ns3::dsr::DsrRouteCache::Neighbor >', is_const=False)
## dsr-rcache.h (module 'dsr'): ns3::dsr::DsrRouteCache::m_ntimer [variable]
cls.add_instance_attribute('m_ntimer', 'ns3::Timer', is_const=False)
## dsr-rcache.h (module 'dsr'): ns3::dsr::DsrRouteCache::m_txErrorCallback [variable]
cls.add_instance_attribute('m_txErrorCallback', 'ns3::Callback< void, ns3::WifiMacHeader const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', is_const=False)
return
def register_Ns3DsrDsrRouteCacheNeighbor_methods(root_module, cls):
## dsr-rcache.h (module 'dsr'): ns3::dsr::DsrRouteCache::Neighbor::Neighbor(ns3::dsr::DsrRouteCache::Neighbor const & arg0) [constructor]
cls.add_constructor([param('ns3::dsr::DsrRouteCache::Neighbor const &', 'arg0')])
## dsr-rcache.h (module 'dsr'): ns3::dsr::DsrRouteCache::Neighbor::Neighbor(ns3::Ipv4Address ip, ns3::Mac48Address mac, ns3::Time t) [constructor]
cls.add_constructor([param('ns3::Ipv4Address', 'ip'), param('ns3::Mac48Address', 'mac'), param('ns3::Time', 't')])
## dsr-rcache.h (module 'dsr'): ns3::dsr::DsrRouteCache::Neighbor::Neighbor() [constructor]
cls.add_constructor([])
## dsr-rcache.h (module 'dsr'): ns3::dsr::DsrRouteCache::Neighbor::close [variable]
cls.add_instance_attribute('close', 'bool', is_const=False)
## dsr-rcache.h (module 'dsr'): ns3::dsr::DsrRouteCache::Neighbor::m_expireTime [variable]
cls.add_instance_attribute('m_expireTime', 'ns3::Time', is_const=False)
## dsr-rcache.h (module 'dsr'): ns3::dsr::DsrRouteCache::Neighbor::m_hardwareAddress [variable]
cls.add_instance_attribute('m_hardwareAddress', 'ns3::Mac48Address', is_const=False)
## dsr-rcache.h (module 'dsr'): ns3::dsr::DsrRouteCache::Neighbor::m_neighborAddress [variable]
cls.add_instance_attribute('m_neighborAddress', 'ns3::Ipv4Address', is_const=False)
return
def register_Ns3DsrDsrRouteCacheEntry_methods(root_module, cls):
cls.add_binary_comparison_operator('==')
## dsr-rcache.h (module 'dsr'): ns3::dsr::DsrRouteCacheEntry::DsrRouteCacheEntry(ns3::dsr::DsrRouteCacheEntry const & arg0) [constructor]
cls.add_constructor([param('ns3::dsr::DsrRouteCacheEntry const &', 'arg0')])
## dsr-rcache.h (module 'dsr'): ns3::dsr::DsrRouteCacheEntry::DsrRouteCacheEntry(ns3::dsr::DsrRouteCacheEntry::IP_VECTOR const & ip=ns3::dsr::DsrRouteCacheEntry::IP_VECTOR(), ns3::Ipv4Address dst=ns3::Ipv4Address(), ns3::Time exp=ns3::Simulator::Now()) [constructor]
cls.add_constructor([param('ns3::dsr::DsrRouteCacheEntry::IP_VECTOR const &', 'ip', default_value='ns3::dsr::DsrRouteCacheEntry::IP_VECTOR()'), param('ns3::Ipv4Address', 'dst', default_value='ns3::Ipv4Address()'), param('ns3::Time', 'exp', default_value='ns3::Simulator::Now()')])
## dsr-rcache.h (module 'dsr'): ns3::Time ns3::dsr::DsrRouteCacheEntry::GetBlacklistTimeout() const [member function]
cls.add_method('GetBlacklistTimeout',
'ns3::Time',
[],
is_const=True)
## dsr-rcache.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::DsrRouteCacheEntry::GetDestination() const [member function]
cls.add_method('GetDestination',
'ns3::Ipv4Address',
[],
is_const=True)
## dsr-rcache.h (module 'dsr'): ns3::Time ns3::dsr::DsrRouteCacheEntry::GetExpireTime() const [member function]
cls.add_method('GetExpireTime',
'ns3::Time',
[],
is_const=True)
## dsr-rcache.h (module 'dsr'): ns3::dsr::DsrRouteCacheEntry::IP_VECTOR ns3::dsr::DsrRouteCacheEntry::GetVector() const [member function]
cls.add_method('GetVector',
'ns3::dsr::DsrRouteCacheEntry::IP_VECTOR',
[],
is_const=True)
## dsr-rcache.h (module 'dsr'): void ns3::dsr::DsrRouteCacheEntry::Invalidate(ns3::Time badLinkLifetime) [member function]
cls.add_method('Invalidate',
'void',
[param('ns3::Time', 'badLinkLifetime')])
## dsr-rcache.h (module 'dsr'): bool ns3::dsr::DsrRouteCacheEntry::IsUnidirectional() const [member function]
cls.add_method('IsUnidirectional',
'bool',
[],
is_const=True)
## dsr-rcache.h (module 'dsr'): void ns3::dsr::DsrRouteCacheEntry::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True)
## dsr-rcache.h (module 'dsr'): void ns3::dsr::DsrRouteCacheEntry::SetBlacklistTimeout(ns3::Time t) [member function]
cls.add_method('SetBlacklistTimeout',
'void',
[param('ns3::Time', 't')])
## dsr-rcache.h (module 'dsr'): void ns3::dsr::DsrRouteCacheEntry::SetDestination(ns3::Ipv4Address d) [member function]
cls.add_method('SetDestination',
'void',
[param('ns3::Ipv4Address', 'd')])
## dsr-rcache.h (module 'dsr'): void ns3::dsr::DsrRouteCacheEntry::SetExpireTime(ns3::Time exp) [member function]
cls.add_method('SetExpireTime',
'void',
[param('ns3::Time', 'exp')])
## dsr-rcache.h (module 'dsr'): void ns3::dsr::DsrRouteCacheEntry::SetUnidirectional(bool u) [member function]
cls.add_method('SetUnidirectional',
'void',
[param('bool', 'u')])
## dsr-rcache.h (module 'dsr'): void ns3::dsr::DsrRouteCacheEntry::SetVector(ns3::dsr::DsrRouteCacheEntry::IP_VECTOR v) [member function]
cls.add_method('SetVector',
'void',
[param('std::vector< ns3::Ipv4Address >', 'v')])
return
def register_Ns3DsrDsrRouting_methods(root_module, cls):
## dsr-routing.h (module 'dsr'): ns3::dsr::DsrRouting::DsrRouting(ns3::dsr::DsrRouting const & arg0) [constructor]
cls.add_constructor([param('ns3::dsr::DsrRouting const &', 'arg0')])
## dsr-routing.h (module 'dsr'): ns3::dsr::DsrRouting::DsrRouting() [constructor]
cls.add_constructor([])
## dsr-routing.h (module 'dsr'): uint16_t ns3::dsr::DsrRouting::AddAckReqHeader(ns3::Ptr<ns3::Packet> & packet, ns3::Ipv4Address nextHop) [member function]
cls.add_method('AddAckReqHeader',
'uint16_t',
[param('ns3::Ptr< ns3::Packet > &', 'packet'), param('ns3::Ipv4Address', 'nextHop')])
## dsr-routing.h (module 'dsr'): bool ns3::dsr::DsrRouting::AddRoute(ns3::dsr::DsrRouteCacheEntry & rt) [member function]
cls.add_method('AddRoute',
'bool',
[param('ns3::dsr::DsrRouteCacheEntry &', 'rt')])
## dsr-routing.h (module 'dsr'): bool ns3::dsr::DsrRouting::AddRoute_Link(ns3::dsr::DsrRouteCacheEntry::IP_VECTOR nodelist, ns3::Ipv4Address source) [member function]
cls.add_method('AddRoute_Link',
'bool',
[param('std::vector< ns3::Ipv4Address >', 'nodelist'), param('ns3::Ipv4Address', 'source')])
## dsr-routing.h (module 'dsr'): int64_t ns3::dsr::DsrRouting::AssignStreams(int64_t stream) [member function]
cls.add_method('AssignStreams',
'int64_t',
[param('int64_t', 'stream')])
## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::CallCancelPacketTimer(uint16_t ackId, ns3::Ipv4Header const & ipv4Header, ns3::Ipv4Address realSrc, ns3::Ipv4Address realDst) [member function]
cls.add_method('CallCancelPacketTimer',
'void',
[param('uint16_t', 'ackId'), param('ns3::Ipv4Header const &', 'ipv4Header'), param('ns3::Ipv4Address', 'realSrc'), param('ns3::Ipv4Address', 'realDst')])
## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::CancelLinkPacketTimer(ns3::dsr::DsrMaintainBuffEntry & mb) [member function]
cls.add_method('CancelLinkPacketTimer',
'void',
[param('ns3::dsr::DsrMaintainBuffEntry &', 'mb')])
## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::CancelNetworkPacketTimer(ns3::dsr::DsrMaintainBuffEntry & mb) [member function]
cls.add_method('CancelNetworkPacketTimer',
'void',
[param('ns3::dsr::DsrMaintainBuffEntry &', 'mb')])
## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::CancelPacketAllTimer(ns3::dsr::DsrMaintainBuffEntry & mb) [member function]
cls.add_method('CancelPacketAllTimer',
'void',
[param('ns3::dsr::DsrMaintainBuffEntry &', 'mb')])
## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::CancelPacketTimerNextHop(ns3::Ipv4Address nextHop, uint8_t protocol) [member function]
cls.add_method('CancelPacketTimerNextHop',
'void',
[param('ns3::Ipv4Address', 'nextHop'), param('uint8_t', 'protocol')])
## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::CancelPassivePacketTimer(ns3::dsr::DsrMaintainBuffEntry & mb) [member function]
cls.add_method('CancelPassivePacketTimer',
'void',
[param('ns3::dsr::DsrMaintainBuffEntry &', 'mb')])
## dsr-routing.h (module 'dsr'): bool ns3::dsr::DsrRouting::CancelPassiveTimer(ns3::Ptr<ns3::Packet> packet, ns3::Ipv4Address source, ns3::Ipv4Address destination, uint8_t segsLeft) [member function]
cls.add_method('CancelPassiveTimer',
'bool',
[param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Address', 'destination'), param('uint8_t', 'segsLeft')])
## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::CancelRreqTimer(ns3::Ipv4Address dst, bool isRemove) [member function]
cls.add_method('CancelRreqTimer',
'void',
[param('ns3::Ipv4Address', 'dst'), param('bool', 'isRemove')])
## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::CheckSendBuffer() [member function]
cls.add_method('CheckSendBuffer',
'void',
[])
## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::DeleteAllRoutesIncludeLink(ns3::Ipv4Address errorSrc, ns3::Ipv4Address unreachNode, ns3::Ipv4Address node) [member function]
cls.add_method('DeleteAllRoutesIncludeLink',
'void',
[param('ns3::Ipv4Address', 'errorSrc'), param('ns3::Ipv4Address', 'unreachNode'), param('ns3::Ipv4Address', 'node')])
## dsr-routing.h (module 'dsr'): bool ns3::dsr::DsrRouting::FindSourceEntry(ns3::Ipv4Address src, ns3::Ipv4Address dst, uint16_t id) [member function]
cls.add_method('FindSourceEntry',
'bool',
[param('ns3::Ipv4Address', 'src'), param('ns3::Ipv4Address', 'dst'), param('uint16_t', 'id')])
## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::ForwardErrPacket(ns3::dsr::DsrOptionRerrUnreachHeader & rerr, ns3::dsr::DsrOptionSRHeader & sourceRoute, ns3::Ipv4Address nextHop, uint8_t protocol, ns3::Ptr<ns3::Ipv4Route> route) [member function]
cls.add_method('ForwardErrPacket',
'void',
[param('ns3::dsr::DsrOptionRerrUnreachHeader &', 'rerr'), param('ns3::dsr::DsrOptionSRHeader &', 'sourceRoute'), param('ns3::Ipv4Address', 'nextHop'), param('uint8_t', 'protocol'), param('ns3::Ptr< ns3::Ipv4Route >', 'route')])
## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::ForwardPacket(ns3::Ptr<const ns3::Packet> packet, ns3::dsr::DsrOptionSRHeader & sourceRoute, ns3::Ipv4Header const & ipv4Header, ns3::Ipv4Address source, ns3::Ipv4Address destination, ns3::Ipv4Address targetAddress, uint8_t protocol, ns3::Ptr<ns3::Ipv4Route> route) [member function]
cls.add_method('ForwardPacket',
'void',
[param('ns3::Ptr< ns3::Packet const >', 'packet'), param('ns3::dsr::DsrOptionSRHeader &', 'sourceRoute'), param('ns3::Ipv4Header const &', 'ipv4Header'), param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Address', 'destination'), param('ns3::Ipv4Address', 'targetAddress'), param('uint8_t', 'protocol'), param('ns3::Ptr< ns3::Ipv4Route >', 'route')])
## dsr-routing.h (module 'dsr'): ns3::IpL4Protocol::DownTargetCallback ns3::dsr::DsrRouting::GetDownTarget() const [member function]
cls.add_method('GetDownTarget',
'ns3::IpL4Protocol::DownTargetCallback',
[],
is_const=True, is_virtual=True)
## dsr-routing.h (module 'dsr'): ns3::IpL4Protocol::DownTargetCallback6 ns3::dsr::DsrRouting::GetDownTarget6() const [member function]
cls.add_method('GetDownTarget6',
'ns3::IpL4Protocol::DownTargetCallback6',
[],
is_const=True, is_virtual=True)
## dsr-routing.h (module 'dsr'): std::vector<std::basic_string<char>, std::allocator<std::basic_string<char> > > ns3::dsr::DsrRouting::GetElementsFromContext(std::string context) [member function]
cls.add_method('GetElementsFromContext',
'std::vector< std::string >',
[param('std::string', 'context')])
## dsr-routing.h (module 'dsr'): uint16_t ns3::dsr::DsrRouting::GetIDfromIP(ns3::Ipv4Address address) [member function]
cls.add_method('GetIDfromIP',
'uint16_t',
[param('ns3::Ipv4Address', 'address')])
## dsr-routing.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::DsrRouting::GetIPfromID(uint16_t id) [member function]
cls.add_method('GetIPfromID',
'ns3::Ipv4Address',
[param('uint16_t', 'id')])
## dsr-routing.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::DsrRouting::GetIPfromMAC(ns3::Mac48Address address) [member function]
cls.add_method('GetIPfromMAC',
'ns3::Ipv4Address',
[param('ns3::Mac48Address', 'address')])
## dsr-routing.h (module 'dsr'): ns3::Ptr<ns3::NetDevice> ns3::dsr::DsrRouting::GetNetDeviceFromContext(std::string context) [member function]
cls.add_method('GetNetDeviceFromContext',
'ns3::Ptr< ns3::NetDevice >',
[param('std::string', 'context')])
## dsr-routing.h (module 'dsr'): ns3::Ptr<ns3::Node> ns3::dsr::DsrRouting::GetNode() const [member function]
cls.add_method('GetNode',
'ns3::Ptr< ns3::Node >',
[],
is_const=True)
## dsr-routing.h (module 'dsr'): ns3::Ptr<ns3::Node> ns3::dsr::DsrRouting::GetNodeWithAddress(ns3::Ipv4Address ipv4Address) [member function]
cls.add_method('GetNodeWithAddress',
'ns3::Ptr< ns3::Node >',
[param('ns3::Ipv4Address', 'ipv4Address')])
## dsr-routing.h (module 'dsr'): ns3::Ptr<ns3::dsr::DsrOptions> ns3::dsr::DsrRouting::GetOption(int optionNumber) [member function]
cls.add_method('GetOption',
'ns3::Ptr< ns3::dsr::DsrOptions >',
[param('int', 'optionNumber')])
## dsr-routing.h (module 'dsr'): ns3::Ptr<ns3::dsr::DsrPassiveBuffer> ns3::dsr::DsrRouting::GetPassiveBuffer() const [member function]
cls.add_method('GetPassiveBuffer',
'ns3::Ptr< ns3::dsr::DsrPassiveBuffer >',
[],
is_const=True)
## dsr-routing.h (module 'dsr'): uint32_t ns3::dsr::DsrRouting::GetPriority(ns3::dsr::DsrMessageType messageType) [member function]
cls.add_method('GetPriority',
'uint32_t',
[param('ns3::dsr::DsrMessageType', 'messageType')])
## dsr-routing.h (module 'dsr'): int ns3::dsr::DsrRouting::GetProtocolNumber() const [member function]
cls.add_method('GetProtocolNumber',
'int',
[],
is_const=True, is_virtual=True)
## dsr-routing.h (module 'dsr'): ns3::Ptr<ns3::dsr::DsrRreqTable> ns3::dsr::DsrRouting::GetRequestTable() const [member function]
cls.add_method('GetRequestTable',
'ns3::Ptr< ns3::dsr::DsrRreqTable >',
[],
is_const=True)
## dsr-routing.h (module 'dsr'): ns3::Ptr<ns3::dsr::DsrRouteCache> ns3::dsr::DsrRouting::GetRouteCache() const [member function]
cls.add_method('GetRouteCache',
'ns3::Ptr< ns3::dsr::DsrRouteCache >',
[],
is_const=True)
## dsr-routing.h (module 'dsr'): static ns3::TypeId ns3::dsr::DsrRouting::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::IncreaseRetransTimer() [member function]
cls.add_method('IncreaseRetransTimer',
'void',
[])
## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::Insert(ns3::Ptr<ns3::dsr::DsrOptions> option) [member function]
cls.add_method('Insert',
'void',
[param('ns3::Ptr< ns3::dsr::DsrOptions >', 'option')])
## dsr-routing.h (module 'dsr'): bool ns3::dsr::DsrRouting::IsLinkCache() [member function]
cls.add_method('IsLinkCache',
'bool',
[])
## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::LinkScheduleTimerExpire(ns3::dsr::DsrMaintainBuffEntry & mb, uint8_t protocol) [member function]
cls.add_method('LinkScheduleTimerExpire',
'void',
[param('ns3::dsr::DsrMaintainBuffEntry &', 'mb'), param('uint8_t', 'protocol')])
## dsr-routing.h (module 'dsr'): bool ns3::dsr::DsrRouting::LookupRoute(ns3::Ipv4Address id, ns3::dsr::DsrRouteCacheEntry & rt) [member function]
cls.add_method('LookupRoute',
'bool',
[param('ns3::Ipv4Address', 'id'), param('ns3::dsr::DsrRouteCacheEntry &', 'rt')])
## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::NetworkScheduleTimerExpire(ns3::dsr::DsrMaintainBuffEntry & mb, uint8_t protocol) [member function]
cls.add_method('NetworkScheduleTimerExpire',
'void',
[param('ns3::dsr::DsrMaintainBuffEntry &', 'mb'), param('uint8_t', 'protocol')])
## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::PacketNewRoute(ns3::Ptr<ns3::Packet> packet, ns3::Ipv4Address source, ns3::Ipv4Address destination, uint8_t protocol) [member function]
cls.add_method('PacketNewRoute',
'void',
[param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Address', 'destination'), param('uint8_t', 'protocol')])
## dsr-routing.h (module 'dsr'): bool ns3::dsr::DsrRouting::PassiveEntryCheck(ns3::Ptr<ns3::Packet> packet, ns3::Ipv4Address source, ns3::Ipv4Address destination, uint8_t segsLeft, uint16_t fragmentOffset, uint16_t identification, bool saveEntry) [member function]
cls.add_method('PassiveEntryCheck',
'bool',
[param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Address', 'destination'), param('uint8_t', 'segsLeft'), param('uint16_t', 'fragmentOffset'), param('uint16_t', 'identification'), param('bool', 'saveEntry')])
## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::PassiveScheduleTimerExpire(ns3::dsr::DsrMaintainBuffEntry & mb, uint8_t protocol) [member function]
cls.add_method('PassiveScheduleTimerExpire',
'void',
[param('ns3::dsr::DsrMaintainBuffEntry &', 'mb'), param('uint8_t', 'protocol')])
## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::PrintVector(std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> > & vec) [member function]
cls.add_method('PrintVector',
'void',
[param('std::vector< ns3::Ipv4Address > &', 'vec')])
## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::PriorityScheduler(uint32_t priority, bool continueWithFirst) [member function]
cls.add_method('PriorityScheduler',
'void',
[param('uint32_t', 'priority'), param('bool', 'continueWithFirst')])
## dsr-routing.h (module 'dsr'): uint8_t ns3::dsr::DsrRouting::Process(ns3::Ptr<ns3::Packet> & packet, ns3::Ipv4Header const & ipv4Header, ns3::Ipv4Address dst, uint8_t * nextHeader, uint8_t protocol, bool & isDropped) [member function]
cls.add_method('Process',
'uint8_t',
[param('ns3::Ptr< ns3::Packet > &', 'packet'), param('ns3::Ipv4Header const &', 'ipv4Header'), param('ns3::Ipv4Address', 'dst'), param('uint8_t *', 'nextHeader'), param('uint8_t', 'protocol'), param('bool &', 'isDropped')])
## dsr-routing.h (module 'dsr'): ns3::IpL4Protocol::RxStatus ns3::dsr::DsrRouting::Receive(ns3::Ptr<ns3::Packet> p, ns3::Ipv4Header const & header, ns3::Ptr<ns3::Ipv4Interface> incomingInterface) [member function]
cls.add_method('Receive',
'ns3::IpL4Protocol::RxStatus',
[param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ipv4Header const &', 'header'), param('ns3::Ptr< ns3::Ipv4Interface >', 'incomingInterface')],
is_virtual=True)
## dsr-routing.h (module 'dsr'): ns3::IpL4Protocol::RxStatus ns3::dsr::DsrRouting::Receive(ns3::Ptr<ns3::Packet> p, ns3::Ipv6Header const & header, ns3::Ptr<ns3::Ipv6Interface> incomingInterface) [member function]
cls.add_method('Receive',
'ns3::IpL4Protocol::RxStatus',
[param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ipv6Header const &', 'header'), param('ns3::Ptr< ns3::Ipv6Interface >', 'incomingInterface')],
is_virtual=True)
## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::RouteRequestTimerExpire(ns3::Ptr<ns3::Packet> packet, std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> > address, uint32_t requestId, uint8_t protocol) [member function]
cls.add_method('RouteRequestTimerExpire',
'void',
[param('ns3::Ptr< ns3::Packet >', 'packet'), param('std::vector< ns3::Ipv4Address >', 'address'), param('uint32_t', 'requestId'), param('uint8_t', 'protocol')])
## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::SalvagePacket(ns3::Ptr<const ns3::Packet> packet, ns3::Ipv4Address source, ns3::Ipv4Address dst, uint8_t protocol) [member function]
cls.add_method('SalvagePacket',
'void',
[param('ns3::Ptr< ns3::Packet const >', 'packet'), param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Address', 'dst'), param('uint8_t', 'protocol')])
## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::ScheduleCachedReply(ns3::Ptr<ns3::Packet> packet, ns3::Ipv4Address source, ns3::Ipv4Address destination, ns3::Ptr<ns3::Ipv4Route> route, double hops) [member function]
cls.add_method('ScheduleCachedReply',
'void',
[param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Address', 'destination'), param('ns3::Ptr< ns3::Ipv4Route >', 'route'), param('double', 'hops')])
## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::ScheduleInitialReply(ns3::Ptr<ns3::Packet> packet, ns3::Ipv4Address source, ns3::Ipv4Address nextHop, ns3::Ptr<ns3::Ipv4Route> route) [member function]
cls.add_method('ScheduleInitialReply',
'void',
[param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Address', 'nextHop'), param('ns3::Ptr< ns3::Ipv4Route >', 'route')])
## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::ScheduleInterRequest(ns3::Ptr<ns3::Packet> packet) [member function]
cls.add_method('ScheduleInterRequest',
'void',
[param('ns3::Ptr< ns3::Packet >', 'packet')])
## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::ScheduleLinkPacketRetry(ns3::dsr::DsrMaintainBuffEntry & mb, uint8_t protocol) [member function]
cls.add_method('ScheduleLinkPacketRetry',
'void',
[param('ns3::dsr::DsrMaintainBuffEntry &', 'mb'), param('uint8_t', 'protocol')])
## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::ScheduleNetworkPacketRetry(ns3::dsr::DsrMaintainBuffEntry & mb, bool isFirst, uint8_t protocol) [member function]
cls.add_method('ScheduleNetworkPacketRetry',
'void',
[param('ns3::dsr::DsrMaintainBuffEntry &', 'mb'), param('bool', 'isFirst'), param('uint8_t', 'protocol')])
## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::SchedulePassivePacketRetry(ns3::dsr::DsrMaintainBuffEntry & mb, uint8_t protocol) [member function]
cls.add_method('SchedulePassivePacketRetry',
'void',
[param('ns3::dsr::DsrMaintainBuffEntry &', 'mb'), param('uint8_t', 'protocol')])
## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::ScheduleRreqRetry(ns3::Ptr<ns3::Packet> packet, std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> > address, bool nonProp, uint32_t requestId, uint8_t protocol) [member function]
cls.add_method('ScheduleRreqRetry',
'void',
[param('ns3::Ptr< ns3::Packet >', 'packet'), param('std::vector< ns3::Ipv4Address >', 'address'), param('bool', 'nonProp'), param('uint32_t', 'requestId'), param('uint8_t', 'protocol')])
## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::Scheduler(uint32_t priority) [member function]
cls.add_method('Scheduler',
'void',
[param('uint32_t', 'priority')])
## dsr-routing.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::DsrRouting::SearchNextHop(ns3::Ipv4Address ipv4Address, std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> > & vec) [member function]
cls.add_method('SearchNextHop',
'ns3::Ipv4Address',
[param('ns3::Ipv4Address', 'ipv4Address'), param('std::vector< ns3::Ipv4Address > &', 'vec')])
## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::Send(ns3::Ptr<ns3::Packet> packet, ns3::Ipv4Address source, ns3::Ipv4Address destination, uint8_t protocol, ns3::Ptr<ns3::Ipv4Route> route) [member function]
cls.add_method('Send',
'void',
[param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Address', 'destination'), param('uint8_t', 'protocol'), param('ns3::Ptr< ns3::Ipv4Route >', 'route')])
## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::SendAck(uint16_t ackId, ns3::Ipv4Address destination, ns3::Ipv4Address realSrc, ns3::Ipv4Address realDst, uint8_t protocol, ns3::Ptr<ns3::Ipv4Route> route) [member function]
cls.add_method('SendAck',
'void',
[param('uint16_t', 'ackId'), param('ns3::Ipv4Address', 'destination'), param('ns3::Ipv4Address', 'realSrc'), param('ns3::Ipv4Address', 'realDst'), param('uint8_t', 'protocol'), param('ns3::Ptr< ns3::Ipv4Route >', 'route')])
## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::SendBuffTimerExpire() [member function]
cls.add_method('SendBuffTimerExpire',
'void',
[])
## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::SendErrorRequest(ns3::dsr::DsrOptionRerrUnreachHeader & rerr, uint8_t protocol) [member function]
cls.add_method('SendErrorRequest',
'void',
[param('ns3::dsr::DsrOptionRerrUnreachHeader &', 'rerr'), param('uint8_t', 'protocol')])
## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::SendGratuitousReply(ns3::Ipv4Address replyTo, ns3::Ipv4Address replyFrom, std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> > & nodeList, uint8_t protocol) [member function]
cls.add_method('SendGratuitousReply',
'void',
[param('ns3::Ipv4Address', 'replyTo'), param('ns3::Ipv4Address', 'replyFrom'), param('std::vector< ns3::Ipv4Address > &', 'nodeList'), param('uint8_t', 'protocol')])
## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::SendInitialRequest(ns3::Ipv4Address source, ns3::Ipv4Address destination, uint8_t protocol) [member function]
cls.add_method('SendInitialRequest',
'void',
[param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Address', 'destination'), param('uint8_t', 'protocol')])
## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::SendPacket(ns3::Ptr<ns3::Packet> packet, ns3::Ipv4Address source, ns3::Ipv4Address nextHop, uint8_t protocol) [member function]
cls.add_method('SendPacket',
'void',
[param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Address', 'nextHop'), param('uint8_t', 'protocol')])
## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::SendPacketFromBuffer(ns3::dsr::DsrOptionSRHeader const & sourceRoute, ns3::Ipv4Address nextHop, uint8_t protocol) [member function]
cls.add_method('SendPacketFromBuffer',
'void',
[param('ns3::dsr::DsrOptionSRHeader const &', 'sourceRoute'), param('ns3::Ipv4Address', 'nextHop'), param('uint8_t', 'protocol')])
## dsr-routing.h (module 'dsr'): bool ns3::dsr::DsrRouting::SendRealDown(ns3::dsr::DsrNetworkQueueEntry & newEntry) [member function]
cls.add_method('SendRealDown',
'bool',
[param('ns3::dsr::DsrNetworkQueueEntry &', 'newEntry')])
## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::SendReply(ns3::Ptr<ns3::Packet> packet, ns3::Ipv4Address source, ns3::Ipv4Address nextHop, ns3::Ptr<ns3::Ipv4Route> route) [member function]
cls.add_method('SendReply',
'void',
[param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Address', 'nextHop'), param('ns3::Ptr< ns3::Ipv4Route >', 'route')])
## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::SendRequest(ns3::Ptr<ns3::Packet> packet, ns3::Ipv4Address source) [member function]
cls.add_method('SendRequest',
'void',
[param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ipv4Address', 'source')])
## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::SendUnreachError(ns3::Ipv4Address unreachNode, ns3::Ipv4Address destination, ns3::Ipv4Address originalDst, uint8_t salvage, uint8_t protocol) [member function]
cls.add_method('SendUnreachError',
'void',
[param('ns3::Ipv4Address', 'unreachNode'), param('ns3::Ipv4Address', 'destination'), param('ns3::Ipv4Address', 'originalDst'), param('uint8_t', 'salvage'), param('uint8_t', 'protocol')])
## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::SetDownTarget(ns3::IpL4Protocol::DownTargetCallback callback) [member function]
cls.add_method('SetDownTarget',
'void',
[param('ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::Ipv4Address, ns3::Ipv4Address, unsigned char, ns3::Ptr< ns3::Ipv4Route >, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')],
is_virtual=True)
## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::SetDownTarget6(ns3::IpL4Protocol::DownTargetCallback6 callback) [member function]
cls.add_method('SetDownTarget6',
'void',
[param('ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::Ipv6Address, ns3::Ipv6Address, unsigned char, ns3::Ptr< ns3::Ipv6Route >, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')],
is_virtual=True)
## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::SetNode(ns3::Ptr<ns3::Node> node) [member function]
cls.add_method('SetNode',
'void',
[param('ns3::Ptr< ns3::Node >', 'node')])
## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::SetPassiveBuffer(ns3::Ptr<ns3::dsr::DsrPassiveBuffer> r) [member function]
cls.add_method('SetPassiveBuffer',
'void',
[param('ns3::Ptr< ns3::dsr::DsrPassiveBuffer >', 'r')])
## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::SetRequestTable(ns3::Ptr<ns3::dsr::DsrRreqTable> r) [member function]
cls.add_method('SetRequestTable',
'void',
[param('ns3::Ptr< ns3::dsr::DsrRreqTable >', 'r')])
## dsr-routing.h (module 'dsr'): ns3::Ptr<ns3::Ipv4Route> ns3::dsr::DsrRouting::SetRoute(ns3::Ipv4Address nextHop, ns3::Ipv4Address srcAddress) [member function]
cls.add_method('SetRoute',
'ns3::Ptr< ns3::Ipv4Route >',
[param('ns3::Ipv4Address', 'nextHop'), param('ns3::Ipv4Address', 'srcAddress')])
## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::SetRouteCache(ns3::Ptr<ns3::dsr::DsrRouteCache> r) [member function]
cls.add_method('SetRouteCache',
'void',
[param('ns3::Ptr< ns3::dsr::DsrRouteCache >', 'r')])
## dsr-routing.h (module 'dsr'): bool ns3::dsr::DsrRouting::UpdateRouteEntry(ns3::Ipv4Address dst) [member function]
cls.add_method('UpdateRouteEntry',
'bool',
[param('ns3::Ipv4Address', 'dst')])
## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::UseExtends(ns3::dsr::DsrRouteCacheEntry::IP_VECTOR rt) [member function]
cls.add_method('UseExtends',
'void',
[param('std::vector< ns3::Ipv4Address >', 'rt')])
## dsr-routing.h (module 'dsr'): ns3::dsr::DsrRouting::PROT_NUMBER [variable]
cls.add_static_attribute('PROT_NUMBER', 'uint8_t const', is_const=True)
## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::DoDispose() [member function]
cls.add_method('DoDispose',
'void',
[],
is_virtual=True, visibility='protected')
## dsr-routing.h (module 'dsr'): void ns3::dsr::DsrRouting::NotifyNewAggregate() [member function]
cls.add_method('NotifyNewAggregate',
'void',
[],
is_virtual=True, visibility='protected')
return
def register_Ns3DsrDsrRoutingHeader_methods(root_module, cls):
cls.add_output_stream_operator()
## dsr-fs-header.h (module 'dsr'): ns3::dsr::DsrRoutingHeader::DsrRoutingHeader(ns3::dsr::DsrRoutingHeader const & arg0) [constructor]
cls.add_constructor([param('ns3::dsr::DsrRoutingHeader const &', 'arg0')])
## dsr-fs-header.h (module 'dsr'): ns3::dsr::DsrRoutingHeader::DsrRoutingHeader() [constructor]
cls.add_constructor([])
## dsr-fs-header.h (module 'dsr'): uint32_t ns3::dsr::DsrRoutingHeader::Deserialize(ns3::Buffer::Iterator start) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('ns3::Buffer::Iterator', 'start')],
is_virtual=True)
## dsr-fs-header.h (module 'dsr'): ns3::TypeId ns3::dsr::DsrRoutingHeader::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## dsr-fs-header.h (module 'dsr'): uint32_t ns3::dsr::DsrRoutingHeader::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True, is_virtual=True)
## dsr-fs-header.h (module 'dsr'): static ns3::TypeId ns3::dsr::DsrRoutingHeader::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## dsr-fs-header.h (module 'dsr'): void ns3::dsr::DsrRoutingHeader::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True, is_virtual=True)
## dsr-fs-header.h (module 'dsr'): void ns3::dsr::DsrRoutingHeader::Serialize(ns3::Buffer::Iterator start) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::Buffer::Iterator', 'start')],
is_const=True, is_virtual=True)
return
def register_Ns3DsrDsrRreqTable_methods(root_module, cls):
## dsr-rreq-table.h (module 'dsr'): ns3::dsr::DsrRreqTable::DsrRreqTable(ns3::dsr::DsrRreqTable const & arg0) [constructor]
cls.add_constructor([param('ns3::dsr::DsrRreqTable const &', 'arg0')])
## dsr-rreq-table.h (module 'dsr'): ns3::dsr::DsrRreqTable::DsrRreqTable() [constructor]
cls.add_constructor([])
## dsr-rreq-table.h (module 'dsr'): uint32_t ns3::dsr::DsrRreqTable::CheckUniqueRreqId(ns3::Ipv4Address dst) [member function]
cls.add_method('CheckUniqueRreqId',
'uint32_t',
[param('ns3::Ipv4Address', 'dst')])
## dsr-rreq-table.h (module 'dsr'): void ns3::dsr::DsrRreqTable::FindAndUpdate(ns3::Ipv4Address dst) [member function]
cls.add_method('FindAndUpdate',
'void',
[param('ns3::Ipv4Address', 'dst')])
## dsr-rreq-table.h (module 'dsr'): bool ns3::dsr::DsrRreqTable::FindSourceEntry(ns3::Ipv4Address src, ns3::Ipv4Address dst, uint16_t id) [member function]
cls.add_method('FindSourceEntry',
'bool',
[param('ns3::Ipv4Address', 'src'), param('ns3::Ipv4Address', 'dst'), param('uint16_t', 'id')])
## dsr-rreq-table.h (module 'dsr'): ns3::dsr::BlackList * ns3::dsr::DsrRreqTable::FindUnidirectional(ns3::Ipv4Address neighbor) [member function]
cls.add_method('FindUnidirectional',
'ns3::dsr::BlackList *',
[param('ns3::Ipv4Address', 'neighbor')])
## dsr-rreq-table.h (module 'dsr'): uint32_t ns3::dsr::DsrRreqTable::GetInitHopLimit() const [member function]
cls.add_method('GetInitHopLimit',
'uint32_t',
[],
is_const=True)
## dsr-rreq-table.h (module 'dsr'): uint32_t ns3::dsr::DsrRreqTable::GetRreqCnt(ns3::Ipv4Address dst) [member function]
cls.add_method('GetRreqCnt',
'uint32_t',
[param('ns3::Ipv4Address', 'dst')])
## dsr-rreq-table.h (module 'dsr'): uint32_t ns3::dsr::DsrRreqTable::GetRreqIdSize() const [member function]
cls.add_method('GetRreqIdSize',
'uint32_t',
[],
is_const=True)
## dsr-rreq-table.h (module 'dsr'): uint32_t ns3::dsr::DsrRreqTable::GetRreqSize() [member function]
cls.add_method('GetRreqSize',
'uint32_t',
[])
## dsr-rreq-table.h (module 'dsr'): uint32_t ns3::dsr::DsrRreqTable::GetRreqTableSize() const [member function]
cls.add_method('GetRreqTableSize',
'uint32_t',
[],
is_const=True)
## dsr-rreq-table.h (module 'dsr'): static ns3::TypeId ns3::dsr::DsrRreqTable::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## dsr-rreq-table.h (module 'dsr'): uint32_t ns3::dsr::DsrRreqTable::GetUniqueRreqIdSize() const [member function]
cls.add_method('GetUniqueRreqIdSize',
'uint32_t',
[],
is_const=True)
## dsr-rreq-table.h (module 'dsr'): void ns3::dsr::DsrRreqTable::Invalidate() [member function]
cls.add_method('Invalidate',
'void',
[])
## dsr-rreq-table.h (module 'dsr'): bool ns3::dsr::DsrRreqTable::MarkLinkAsUnidirectional(ns3::Ipv4Address neighbor, ns3::Time blacklistTimeout) [member function]
cls.add_method('MarkLinkAsUnidirectional',
'bool',
[param('ns3::Ipv4Address', 'neighbor'), param('ns3::Time', 'blacklistTimeout')])
## dsr-rreq-table.h (module 'dsr'): void ns3::dsr::DsrRreqTable::PurgeNeighbor() [member function]
cls.add_method('PurgeNeighbor',
'void',
[])
## dsr-rreq-table.h (module 'dsr'): void ns3::dsr::DsrRreqTable::RemoveLeastExpire() [member function]
cls.add_method('RemoveLeastExpire',
'void',
[])
## dsr-rreq-table.h (module 'dsr'): void ns3::dsr::DsrRreqTable::RemoveRreqEntry(ns3::Ipv4Address dst) [member function]
cls.add_method('RemoveRreqEntry',
'void',
[param('ns3::Ipv4Address', 'dst')])
## dsr-rreq-table.h (module 'dsr'): void ns3::dsr::DsrRreqTable::SetInitHopLimit(uint32_t hl) [member function]
cls.add_method('SetInitHopLimit',
'void',
[param('uint32_t', 'hl')])
## dsr-rreq-table.h (module 'dsr'): void ns3::dsr::DsrRreqTable::SetRreqIdSize(uint32_t id) [member function]
cls.add_method('SetRreqIdSize',
'void',
[param('uint32_t', 'id')])
## dsr-rreq-table.h (module 'dsr'): void ns3::dsr::DsrRreqTable::SetRreqTableSize(uint32_t rt) [member function]
cls.add_method('SetRreqTableSize',
'void',
[param('uint32_t', 'rt')])
## dsr-rreq-table.h (module 'dsr'): void ns3::dsr::DsrRreqTable::SetUniqueRreqIdSize(uint32_t uid) [member function]
cls.add_method('SetUniqueRreqIdSize',
'void',
[param('uint32_t', 'uid')])
return
def register_Ns3DsrDsrSendBuffEntry_methods(root_module, cls):
cls.add_binary_comparison_operator('==')
## dsr-rsendbuff.h (module 'dsr'): ns3::dsr::DsrSendBuffEntry::DsrSendBuffEntry(ns3::dsr::DsrSendBuffEntry const & arg0) [constructor]
cls.add_constructor([param('ns3::dsr::DsrSendBuffEntry const &', 'arg0')])
## dsr-rsendbuff.h (module 'dsr'): ns3::dsr::DsrSendBuffEntry::DsrSendBuffEntry(ns3::Ptr<const ns3::Packet> pa=0, ns3::Ipv4Address d=ns3::Ipv4Address(), ns3::Time exp=ns3::Simulator::Now(), uint8_t p=0) [constructor]
cls.add_constructor([param('ns3::Ptr< ns3::Packet const >', 'pa', default_value='0'), param('ns3::Ipv4Address', 'd', default_value='ns3::Ipv4Address()'), param('ns3::Time', 'exp', default_value='ns3::Simulator::Now()'), param('uint8_t', 'p', default_value='0')])
## dsr-rsendbuff.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::DsrSendBuffEntry::GetDestination() const [member function]
cls.add_method('GetDestination',
'ns3::Ipv4Address',
[],
is_const=True)
## dsr-rsendbuff.h (module 'dsr'): ns3::Time ns3::dsr::DsrSendBuffEntry::GetExpireTime() const [member function]
cls.add_method('GetExpireTime',
'ns3::Time',
[],
is_const=True)
## dsr-rsendbuff.h (module 'dsr'): ns3::Ptr<const ns3::Packet> ns3::dsr::DsrSendBuffEntry::GetPacket() const [member function]
cls.add_method('GetPacket',
'ns3::Ptr< ns3::Packet const >',
[],
is_const=True)
## dsr-rsendbuff.h (module 'dsr'): uint8_t ns3::dsr::DsrSendBuffEntry::GetProtocol() const [member function]
cls.add_method('GetProtocol',
'uint8_t',
[],
is_const=True)
## dsr-rsendbuff.h (module 'dsr'): void ns3::dsr::DsrSendBuffEntry::SetDestination(ns3::Ipv4Address d) [member function]
cls.add_method('SetDestination',
'void',
[param('ns3::Ipv4Address', 'd')])
## dsr-rsendbuff.h (module 'dsr'): void ns3::dsr::DsrSendBuffEntry::SetExpireTime(ns3::Time exp) [member function]
cls.add_method('SetExpireTime',
'void',
[param('ns3::Time', 'exp')])
## dsr-rsendbuff.h (module 'dsr'): void ns3::dsr::DsrSendBuffEntry::SetPacket(ns3::Ptr<const ns3::Packet> p) [member function]
cls.add_method('SetPacket',
'void',
[param('ns3::Ptr< ns3::Packet const >', 'p')])
## dsr-rsendbuff.h (module 'dsr'): void ns3::dsr::DsrSendBuffEntry::SetProtocol(uint8_t p) [member function]
cls.add_method('SetProtocol',
'void',
[param('uint8_t', 'p')])
return
def register_Ns3DsrDsrSendBuffer_methods(root_module, cls):
## dsr-rsendbuff.h (module 'dsr'): ns3::dsr::DsrSendBuffer::DsrSendBuffer(ns3::dsr::DsrSendBuffer const & arg0) [constructor]
cls.add_constructor([param('ns3::dsr::DsrSendBuffer const &', 'arg0')])
## dsr-rsendbuff.h (module 'dsr'): ns3::dsr::DsrSendBuffer::DsrSendBuffer() [constructor]
cls.add_constructor([])
## dsr-rsendbuff.h (module 'dsr'): bool ns3::dsr::DsrSendBuffer::Dequeue(ns3::Ipv4Address dst, ns3::dsr::DsrSendBuffEntry & entry) [member function]
cls.add_method('Dequeue',
'bool',
[param('ns3::Ipv4Address', 'dst'), param('ns3::dsr::DsrSendBuffEntry &', 'entry')])
## dsr-rsendbuff.h (module 'dsr'): void ns3::dsr::DsrSendBuffer::DropPacketWithDst(ns3::Ipv4Address dst) [member function]
cls.add_method('DropPacketWithDst',
'void',
[param('ns3::Ipv4Address', 'dst')])
## dsr-rsendbuff.h (module 'dsr'): bool ns3::dsr::DsrSendBuffer::Enqueue(ns3::dsr::DsrSendBuffEntry & entry) [member function]
cls.add_method('Enqueue',
'bool',
[param('ns3::dsr::DsrSendBuffEntry &', 'entry')])
## dsr-rsendbuff.h (module 'dsr'): bool ns3::dsr::DsrSendBuffer::Find(ns3::Ipv4Address dst) [member function]
cls.add_method('Find',
'bool',
[param('ns3::Ipv4Address', 'dst')])
## dsr-rsendbuff.h (module 'dsr'): std::vector<ns3::dsr::DsrSendBuffEntry, std::allocator<ns3::dsr::DsrSendBuffEntry> > & ns3::dsr::DsrSendBuffer::GetBuffer() [member function]
cls.add_method('GetBuffer',
'std::vector< ns3::dsr::DsrSendBuffEntry > &',
[])
## dsr-rsendbuff.h (module 'dsr'): uint32_t ns3::dsr::DsrSendBuffer::GetMaxQueueLen() const [member function]
cls.add_method('GetMaxQueueLen',
'uint32_t',
[],
is_const=True)
## dsr-rsendbuff.h (module 'dsr'): ns3::Time ns3::dsr::DsrSendBuffer::GetSendBufferTimeout() const [member function]
cls.add_method('GetSendBufferTimeout',
'ns3::Time',
[],
is_const=True)
## dsr-rsendbuff.h (module 'dsr'): uint32_t ns3::dsr::DsrSendBuffer::GetSize() [member function]
cls.add_method('GetSize',
'uint32_t',
[])
## dsr-rsendbuff.h (module 'dsr'): void ns3::dsr::DsrSendBuffer::SetMaxQueueLen(uint32_t len) [member function]
cls.add_method('SetMaxQueueLen',
'void',
[param('uint32_t', 'len')])
## dsr-rsendbuff.h (module 'dsr'): void ns3::dsr::DsrSendBuffer::SetSendBufferTimeout(ns3::Time t) [member function]
cls.add_method('SetSendBufferTimeout',
'void',
[param('ns3::Time', 't')])
return
def register_Ns3DsrGraReplyEntry_methods(root_module, cls):
## dsr-gratuitous-reply-table.h (module 'dsr'): ns3::dsr::GraReplyEntry::GraReplyEntry(ns3::dsr::GraReplyEntry const & arg0) [constructor]
cls.add_constructor([param('ns3::dsr::GraReplyEntry const &', 'arg0')])
## dsr-gratuitous-reply-table.h (module 'dsr'): ns3::dsr::GraReplyEntry::GraReplyEntry(ns3::Ipv4Address t, ns3::Ipv4Address f, ns3::Time h) [constructor]
cls.add_constructor([param('ns3::Ipv4Address', 't'), param('ns3::Ipv4Address', 'f'), param('ns3::Time', 'h')])
## dsr-gratuitous-reply-table.h (module 'dsr'): ns3::dsr::GraReplyEntry::m_gratReplyHoldoff [variable]
cls.add_instance_attribute('m_gratReplyHoldoff', 'ns3::Time', is_const=False)
## dsr-gratuitous-reply-table.h (module 'dsr'): ns3::dsr::GraReplyEntry::m_hearFrom [variable]
cls.add_instance_attribute('m_hearFrom', 'ns3::Ipv4Address', is_const=False)
## dsr-gratuitous-reply-table.h (module 'dsr'): ns3::dsr::GraReplyEntry::m_replyTo [variable]
cls.add_instance_attribute('m_replyTo', 'ns3::Ipv4Address', is_const=False)
return
def register_Ns3DsrLink_methods(root_module, cls):
cls.add_binary_comparison_operator('<')
## dsr-rcache.h (module 'dsr'): ns3::dsr::Link::Link(ns3::dsr::Link const & arg0) [constructor]
cls.add_constructor([param('ns3::dsr::Link const &', 'arg0')])
## dsr-rcache.h (module 'dsr'): ns3::dsr::Link::Link(ns3::Ipv4Address ip1, ns3::Ipv4Address ip2) [constructor]
cls.add_constructor([param('ns3::Ipv4Address', 'ip1'), param('ns3::Ipv4Address', 'ip2')])
## dsr-rcache.h (module 'dsr'): void ns3::dsr::Link::Print() const [member function]
cls.add_method('Print',
'void',
[],
is_const=True)
## dsr-rcache.h (module 'dsr'): ns3::dsr::Link::m_high [variable]
cls.add_instance_attribute('m_high', 'ns3::Ipv4Address', is_const=False)
## dsr-rcache.h (module 'dsr'): ns3::dsr::Link::m_low [variable]
cls.add_instance_attribute('m_low', 'ns3::Ipv4Address', is_const=False)
return
def register_Ns3DsrLinkKey_methods(root_module, cls):
cls.add_binary_comparison_operator('<')
## dsr-maintain-buff.h (module 'dsr'): ns3::dsr::LinkKey::LinkKey() [constructor]
cls.add_constructor([])
## dsr-maintain-buff.h (module 'dsr'): ns3::dsr::LinkKey::LinkKey(ns3::dsr::LinkKey const & arg0) [constructor]
cls.add_constructor([param('ns3::dsr::LinkKey const &', 'arg0')])
## dsr-maintain-buff.h (module 'dsr'): ns3::dsr::LinkKey::m_destination [variable]
cls.add_instance_attribute('m_destination', 'ns3::Ipv4Address', is_const=False)
## dsr-maintain-buff.h (module 'dsr'): ns3::dsr::LinkKey::m_nextHop [variable]
cls.add_instance_attribute('m_nextHop', 'ns3::Ipv4Address', is_const=False)
## dsr-maintain-buff.h (module 'dsr'): ns3::dsr::LinkKey::m_ourAdd [variable]
cls.add_instance_attribute('m_ourAdd', 'ns3::Ipv4Address', is_const=False)
## dsr-maintain-buff.h (module 'dsr'): ns3::dsr::LinkKey::m_source [variable]
cls.add_instance_attribute('m_source', 'ns3::Ipv4Address', is_const=False)
return
def register_Ns3DsrNetworkKey_methods(root_module, cls):
cls.add_binary_comparison_operator('<')
## dsr-maintain-buff.h (module 'dsr'): ns3::dsr::NetworkKey::NetworkKey() [constructor]
cls.add_constructor([])
## dsr-maintain-buff.h (module 'dsr'): ns3::dsr::NetworkKey::NetworkKey(ns3::dsr::NetworkKey const & arg0) [constructor]
cls.add_constructor([param('ns3::dsr::NetworkKey const &', 'arg0')])
## dsr-maintain-buff.h (module 'dsr'): ns3::dsr::NetworkKey::m_ackId [variable]
cls.add_instance_attribute('m_ackId', 'uint16_t', is_const=False)
## dsr-maintain-buff.h (module 'dsr'): ns3::dsr::NetworkKey::m_destination [variable]
cls.add_instance_attribute('m_destination', 'ns3::Ipv4Address', is_const=False)
## dsr-maintain-buff.h (module 'dsr'): ns3::dsr::NetworkKey::m_nextHop [variable]
cls.add_instance_attribute('m_nextHop', 'ns3::Ipv4Address', is_const=False)
## dsr-maintain-buff.h (module 'dsr'): ns3::dsr::NetworkKey::m_ourAdd [variable]
cls.add_instance_attribute('m_ourAdd', 'ns3::Ipv4Address', is_const=False)
## dsr-maintain-buff.h (module 'dsr'): ns3::dsr::NetworkKey::m_source [variable]
cls.add_instance_attribute('m_source', 'ns3::Ipv4Address', is_const=False)
return
def register_Ns3DsrPassiveKey_methods(root_module, cls):
cls.add_binary_comparison_operator('<')
## dsr-maintain-buff.h (module 'dsr'): ns3::dsr::PassiveKey::PassiveKey() [constructor]
cls.add_constructor([])
## dsr-maintain-buff.h (module 'dsr'): ns3::dsr::PassiveKey::PassiveKey(ns3::dsr::PassiveKey const & arg0) [constructor]
cls.add_constructor([param('ns3::dsr::PassiveKey const &', 'arg0')])
## dsr-maintain-buff.h (module 'dsr'): ns3::dsr::PassiveKey::m_ackId [variable]
cls.add_instance_attribute('m_ackId', 'uint16_t', is_const=False)
## dsr-maintain-buff.h (module 'dsr'): ns3::dsr::PassiveKey::m_destination [variable]
cls.add_instance_attribute('m_destination', 'ns3::Ipv4Address', is_const=False)
## dsr-maintain-buff.h (module 'dsr'): ns3::dsr::PassiveKey::m_segsLeft [variable]
cls.add_instance_attribute('m_segsLeft', 'uint8_t', is_const=False)
## dsr-maintain-buff.h (module 'dsr'): ns3::dsr::PassiveKey::m_source [variable]
cls.add_instance_attribute('m_source', 'ns3::Ipv4Address', is_const=False)
return
def register_Ns3DsrRreqTableEntry_methods(root_module, cls):
## dsr-rreq-table.h (module 'dsr'): ns3::dsr::RreqTableEntry::RreqTableEntry() [constructor]
cls.add_constructor([])
## dsr-rreq-table.h (module 'dsr'): ns3::dsr::RreqTableEntry::RreqTableEntry(ns3::dsr::RreqTableEntry const & arg0) [constructor]
cls.add_constructor([param('ns3::dsr::RreqTableEntry const &', 'arg0')])
## dsr-rreq-table.h (module 'dsr'): ns3::dsr::RreqTableEntry::m_expire [variable]
cls.add_instance_attribute('m_expire', 'ns3::Time', is_const=False)
## dsr-rreq-table.h (module 'dsr'): ns3::dsr::RreqTableEntry::m_reqNo [variable]
cls.add_instance_attribute('m_reqNo', 'uint32_t', is_const=False)
return
def register_Ns3DsrDsrOptionAck_methods(root_module, cls):
## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptionAck::DsrOptionAck(ns3::dsr::DsrOptionAck const & arg0) [constructor]
cls.add_constructor([param('ns3::dsr::DsrOptionAck const &', 'arg0')])
## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptionAck::DsrOptionAck() [constructor]
cls.add_constructor([])
## dsr-options.h (module 'dsr'): ns3::TypeId ns3::dsr::DsrOptionAck::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## dsr-options.h (module 'dsr'): uint8_t ns3::dsr::DsrOptionAck::GetOptionNumber() const [member function]
cls.add_method('GetOptionNumber',
'uint8_t',
[],
is_const=True, is_virtual=True)
## dsr-options.h (module 'dsr'): static ns3::TypeId ns3::dsr::DsrOptionAck::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## dsr-options.h (module 'dsr'): uint8_t ns3::dsr::DsrOptionAck::Process(ns3::Ptr<ns3::Packet> packet, ns3::Ptr<ns3::Packet> dsrP, ns3::Ipv4Address ipv4Address, ns3::Ipv4Address source, ns3::Ipv4Header const & ipv4Header, uint8_t protocol, bool & isPromisc, ns3::Ipv4Address promiscSource) [member function]
cls.add_method('Process',
'uint8_t',
[param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ptr< ns3::Packet >', 'dsrP'), param('ns3::Ipv4Address', 'ipv4Address'), param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Header const &', 'ipv4Header'), param('uint8_t', 'protocol'), param('bool &', 'isPromisc'), param('ns3::Ipv4Address', 'promiscSource')],
is_virtual=True)
## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptionAck::OPT_NUMBER [variable]
cls.add_static_attribute('OPT_NUMBER', 'uint8_t const', is_const=True)
return
def register_Ns3DsrDsrOptionAckHeader_methods(root_module, cls):
## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionAckHeader::DsrOptionAckHeader(ns3::dsr::DsrOptionAckHeader const & arg0) [constructor]
cls.add_constructor([param('ns3::dsr::DsrOptionAckHeader const &', 'arg0')])
## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionAckHeader::DsrOptionAckHeader() [constructor]
cls.add_constructor([])
## dsr-option-header.h (module 'dsr'): uint32_t ns3::dsr::DsrOptionAckHeader::Deserialize(ns3::Buffer::Iterator start) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('ns3::Buffer::Iterator', 'start')],
is_virtual=True)
## dsr-option-header.h (module 'dsr'): uint16_t ns3::dsr::DsrOptionAckHeader::GetAckId() const [member function]
cls.add_method('GetAckId',
'uint16_t',
[],
is_const=True)
## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionHeader::Alignment ns3::dsr::DsrOptionAckHeader::GetAlignment() const [member function]
cls.add_method('GetAlignment',
'ns3::dsr::DsrOptionHeader::Alignment',
[],
is_const=True, is_virtual=True)
## dsr-option-header.h (module 'dsr'): ns3::TypeId ns3::dsr::DsrOptionAckHeader::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## dsr-option-header.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::DsrOptionAckHeader::GetRealDst() const [member function]
cls.add_method('GetRealDst',
'ns3::Ipv4Address',
[],
is_const=True)
## dsr-option-header.h (module 'dsr'): ns3::Ipv4Address ns3::dsr::DsrOptionAckHeader::GetRealSrc() const [member function]
cls.add_method('GetRealSrc',
'ns3::Ipv4Address',
[],
is_const=True)
## dsr-option-header.h (module 'dsr'): uint32_t ns3::dsr::DsrOptionAckHeader::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True, is_virtual=True)
## dsr-option-header.h (module 'dsr'): static ns3::TypeId ns3::dsr::DsrOptionAckHeader::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionAckHeader::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True, is_virtual=True)
## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionAckHeader::Serialize(ns3::Buffer::Iterator start) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::Buffer::Iterator', 'start')],
is_const=True, is_virtual=True)
## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionAckHeader::SetAckId(uint16_t identification) [member function]
cls.add_method('SetAckId',
'void',
[param('uint16_t', 'identification')])
## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionAckHeader::SetRealDst(ns3::Ipv4Address realDstAddress) [member function]
cls.add_method('SetRealDst',
'void',
[param('ns3::Ipv4Address', 'realDstAddress')])
## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionAckHeader::SetRealSrc(ns3::Ipv4Address realSrcAddress) [member function]
cls.add_method('SetRealSrc',
'void',
[param('ns3::Ipv4Address', 'realSrcAddress')])
return
def register_Ns3DsrDsrOptionAckReq_methods(root_module, cls):
## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptionAckReq::DsrOptionAckReq(ns3::dsr::DsrOptionAckReq const & arg0) [constructor]
cls.add_constructor([param('ns3::dsr::DsrOptionAckReq const &', 'arg0')])
## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptionAckReq::DsrOptionAckReq() [constructor]
cls.add_constructor([])
## dsr-options.h (module 'dsr'): ns3::TypeId ns3::dsr::DsrOptionAckReq::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## dsr-options.h (module 'dsr'): uint8_t ns3::dsr::DsrOptionAckReq::GetOptionNumber() const [member function]
cls.add_method('GetOptionNumber',
'uint8_t',
[],
is_const=True, is_virtual=True)
## dsr-options.h (module 'dsr'): static ns3::TypeId ns3::dsr::DsrOptionAckReq::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## dsr-options.h (module 'dsr'): uint8_t ns3::dsr::DsrOptionAckReq::Process(ns3::Ptr<ns3::Packet> packet, ns3::Ptr<ns3::Packet> dsrP, ns3::Ipv4Address ipv4Address, ns3::Ipv4Address source, ns3::Ipv4Header const & ipv4Header, uint8_t protocol, bool & isPromisc, ns3::Ipv4Address promiscSource) [member function]
cls.add_method('Process',
'uint8_t',
[param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ptr< ns3::Packet >', 'dsrP'), param('ns3::Ipv4Address', 'ipv4Address'), param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Header const &', 'ipv4Header'), param('uint8_t', 'protocol'), param('bool &', 'isPromisc'), param('ns3::Ipv4Address', 'promiscSource')],
is_virtual=True)
## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptionAckReq::OPT_NUMBER [variable]
cls.add_static_attribute('OPT_NUMBER', 'uint8_t const', is_const=True)
return
def register_Ns3DsrDsrOptionAckReqHeader_methods(root_module, cls):
## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionAckReqHeader::DsrOptionAckReqHeader(ns3::dsr::DsrOptionAckReqHeader const & arg0) [constructor]
cls.add_constructor([param('ns3::dsr::DsrOptionAckReqHeader const &', 'arg0')])
## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionAckReqHeader::DsrOptionAckReqHeader() [constructor]
cls.add_constructor([])
## dsr-option-header.h (module 'dsr'): uint32_t ns3::dsr::DsrOptionAckReqHeader::Deserialize(ns3::Buffer::Iterator start) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('ns3::Buffer::Iterator', 'start')],
is_virtual=True)
## dsr-option-header.h (module 'dsr'): uint16_t ns3::dsr::DsrOptionAckReqHeader::GetAckId() const [member function]
cls.add_method('GetAckId',
'uint16_t',
[],
is_const=True)
## dsr-option-header.h (module 'dsr'): ns3::dsr::DsrOptionHeader::Alignment ns3::dsr::DsrOptionAckReqHeader::GetAlignment() const [member function]
cls.add_method('GetAlignment',
'ns3::dsr::DsrOptionHeader::Alignment',
[],
is_const=True, is_virtual=True)
## dsr-option-header.h (module 'dsr'): ns3::TypeId ns3::dsr::DsrOptionAckReqHeader::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## dsr-option-header.h (module 'dsr'): uint32_t ns3::dsr::DsrOptionAckReqHeader::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True, is_virtual=True)
## dsr-option-header.h (module 'dsr'): static ns3::TypeId ns3::dsr::DsrOptionAckReqHeader::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionAckReqHeader::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True, is_virtual=True)
## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionAckReqHeader::Serialize(ns3::Buffer::Iterator start) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::Buffer::Iterator', 'start')],
is_const=True, is_virtual=True)
## dsr-option-header.h (module 'dsr'): void ns3::dsr::DsrOptionAckReqHeader::SetAckId(uint16_t identification) [member function]
cls.add_method('SetAckId',
'void',
[param('uint16_t', 'identification')])
return
def register_Ns3DsrDsrOptionPad1_methods(root_module, cls):
## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptionPad1::DsrOptionPad1(ns3::dsr::DsrOptionPad1 const & arg0) [constructor]
cls.add_constructor([param('ns3::dsr::DsrOptionPad1 const &', 'arg0')])
## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptionPad1::DsrOptionPad1() [constructor]
cls.add_constructor([])
## dsr-options.h (module 'dsr'): uint8_t ns3::dsr::DsrOptionPad1::GetOptionNumber() const [member function]
cls.add_method('GetOptionNumber',
'uint8_t',
[],
is_const=True, is_virtual=True)
## dsr-options.h (module 'dsr'): static ns3::TypeId ns3::dsr::DsrOptionPad1::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## dsr-options.h (module 'dsr'): uint8_t ns3::dsr::DsrOptionPad1::Process(ns3::Ptr<ns3::Packet> packet, ns3::Ptr<ns3::Packet> dsrP, ns3::Ipv4Address ipv4Address, ns3::Ipv4Address source, ns3::Ipv4Header const & ipv4Header, uint8_t protocol, bool & isPromisc, ns3::Ipv4Address promiscSource) [member function]
cls.add_method('Process',
'uint8_t',
[param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ptr< ns3::Packet >', 'dsrP'), param('ns3::Ipv4Address', 'ipv4Address'), param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Header const &', 'ipv4Header'), param('uint8_t', 'protocol'), param('bool &', 'isPromisc'), param('ns3::Ipv4Address', 'promiscSource')],
is_virtual=True)
## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptionPad1::OPT_NUMBER [variable]
cls.add_static_attribute('OPT_NUMBER', 'uint8_t const', is_const=True)
return
def register_Ns3DsrDsrOptionPadn_methods(root_module, cls):
## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptionPadn::DsrOptionPadn(ns3::dsr::DsrOptionPadn const & arg0) [constructor]
cls.add_constructor([param('ns3::dsr::DsrOptionPadn const &', 'arg0')])
## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptionPadn::DsrOptionPadn() [constructor]
cls.add_constructor([])
## dsr-options.h (module 'dsr'): uint8_t ns3::dsr::DsrOptionPadn::GetOptionNumber() const [member function]
cls.add_method('GetOptionNumber',
'uint8_t',
[],
is_const=True, is_virtual=True)
## dsr-options.h (module 'dsr'): static ns3::TypeId ns3::dsr::DsrOptionPadn::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## dsr-options.h (module 'dsr'): uint8_t ns3::dsr::DsrOptionPadn::Process(ns3::Ptr<ns3::Packet> packet, ns3::Ptr<ns3::Packet> dsrP, ns3::Ipv4Address ipv4Address, ns3::Ipv4Address source, ns3::Ipv4Header const & ipv4Header, uint8_t protocol, bool & isPromisc, ns3::Ipv4Address promiscSource) [member function]
cls.add_method('Process',
'uint8_t',
[param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ptr< ns3::Packet >', 'dsrP'), param('ns3::Ipv4Address', 'ipv4Address'), param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Header const &', 'ipv4Header'), param('uint8_t', 'protocol'), param('bool &', 'isPromisc'), param('ns3::Ipv4Address', 'promiscSource')],
is_virtual=True)
## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptionPadn::OPT_NUMBER [variable]
cls.add_static_attribute('OPT_NUMBER', 'uint8_t const', is_const=True)
return
def register_Ns3DsrDsrOptionRerr_methods(root_module, cls):
## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptionRerr::DsrOptionRerr(ns3::dsr::DsrOptionRerr const & arg0) [constructor]
cls.add_constructor([param('ns3::dsr::DsrOptionRerr const &', 'arg0')])
## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptionRerr::DsrOptionRerr() [constructor]
cls.add_constructor([])
## dsr-options.h (module 'dsr'): uint8_t ns3::dsr::DsrOptionRerr::DoSendError(ns3::Ptr<ns3::Packet> p, ns3::dsr::DsrOptionRerrUnreachHeader & rerr, uint32_t rerrSize, ns3::Ipv4Address ipv4Address, uint8_t protocol) [member function]
cls.add_method('DoSendError',
'uint8_t',
[param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::dsr::DsrOptionRerrUnreachHeader &', 'rerr'), param('uint32_t', 'rerrSize'), param('ns3::Ipv4Address', 'ipv4Address'), param('uint8_t', 'protocol')])
## dsr-options.h (module 'dsr'): ns3::TypeId ns3::dsr::DsrOptionRerr::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## dsr-options.h (module 'dsr'): uint8_t ns3::dsr::DsrOptionRerr::GetOptionNumber() const [member function]
cls.add_method('GetOptionNumber',
'uint8_t',
[],
is_const=True, is_virtual=True)
## dsr-options.h (module 'dsr'): static ns3::TypeId ns3::dsr::DsrOptionRerr::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## dsr-options.h (module 'dsr'): uint8_t ns3::dsr::DsrOptionRerr::Process(ns3::Ptr<ns3::Packet> packet, ns3::Ptr<ns3::Packet> dsrP, ns3::Ipv4Address ipv4Address, ns3::Ipv4Address source, ns3::Ipv4Header const & ipv4Header, uint8_t protocol, bool & isPromisc, ns3::Ipv4Address promiscSource) [member function]
cls.add_method('Process',
'uint8_t',
[param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ptr< ns3::Packet >', 'dsrP'), param('ns3::Ipv4Address', 'ipv4Address'), param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Header const &', 'ipv4Header'), param('uint8_t', 'protocol'), param('bool &', 'isPromisc'), param('ns3::Ipv4Address', 'promiscSource')],
is_virtual=True)
## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptionRerr::OPT_NUMBER [variable]
cls.add_static_attribute('OPT_NUMBER', 'uint8_t const', is_const=True)
return
def register_Ns3DsrDsrOptionRrep_methods(root_module, cls):
## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptionRrep::DsrOptionRrep(ns3::dsr::DsrOptionRrep const & arg0) [constructor]
cls.add_constructor([param('ns3::dsr::DsrOptionRrep const &', 'arg0')])
## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptionRrep::DsrOptionRrep() [constructor]
cls.add_constructor([])
## dsr-options.h (module 'dsr'): ns3::TypeId ns3::dsr::DsrOptionRrep::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## dsr-options.h (module 'dsr'): uint8_t ns3::dsr::DsrOptionRrep::GetOptionNumber() const [member function]
cls.add_method('GetOptionNumber',
'uint8_t',
[],
is_const=True, is_virtual=True)
## dsr-options.h (module 'dsr'): static ns3::TypeId ns3::dsr::DsrOptionRrep::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## dsr-options.h (module 'dsr'): uint8_t ns3::dsr::DsrOptionRrep::Process(ns3::Ptr<ns3::Packet> packet, ns3::Ptr<ns3::Packet> dsrP, ns3::Ipv4Address ipv4Address, ns3::Ipv4Address source, ns3::Ipv4Header const & ipv4Header, uint8_t protocol, bool & isPromisc, ns3::Ipv4Address promiscSource) [member function]
cls.add_method('Process',
'uint8_t',
[param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ptr< ns3::Packet >', 'dsrP'), param('ns3::Ipv4Address', 'ipv4Address'), param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Header const &', 'ipv4Header'), param('uint8_t', 'protocol'), param('bool &', 'isPromisc'), param('ns3::Ipv4Address', 'promiscSource')],
is_virtual=True)
## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptionRrep::OPT_NUMBER [variable]
cls.add_static_attribute('OPT_NUMBER', 'uint8_t const', is_const=True)
return
def register_Ns3DsrDsrOptionRreq_methods(root_module, cls):
## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptionRreq::DsrOptionRreq(ns3::dsr::DsrOptionRreq const & arg0) [constructor]
cls.add_constructor([param('ns3::dsr::DsrOptionRreq const &', 'arg0')])
## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptionRreq::DsrOptionRreq() [constructor]
cls.add_constructor([])
## dsr-options.h (module 'dsr'): ns3::TypeId ns3::dsr::DsrOptionRreq::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## dsr-options.h (module 'dsr'): uint8_t ns3::dsr::DsrOptionRreq::GetOptionNumber() const [member function]
cls.add_method('GetOptionNumber',
'uint8_t',
[],
is_const=True, is_virtual=True)
## dsr-options.h (module 'dsr'): static ns3::TypeId ns3::dsr::DsrOptionRreq::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## dsr-options.h (module 'dsr'): uint8_t ns3::dsr::DsrOptionRreq::Process(ns3::Ptr<ns3::Packet> packet, ns3::Ptr<ns3::Packet> dsrP, ns3::Ipv4Address ipv4Address, ns3::Ipv4Address source, ns3::Ipv4Header const & ipv4Header, uint8_t protocol, bool & isPromisc, ns3::Ipv4Address promiscSource) [member function]
cls.add_method('Process',
'uint8_t',
[param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ptr< ns3::Packet >', 'dsrP'), param('ns3::Ipv4Address', 'ipv4Address'), param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Header const &', 'ipv4Header'), param('uint8_t', 'protocol'), param('bool &', 'isPromisc'), param('ns3::Ipv4Address', 'promiscSource')],
is_virtual=True)
## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptionRreq::OPT_NUMBER [variable]
cls.add_static_attribute('OPT_NUMBER', 'uint8_t const', is_const=True)
return
def register_Ns3DsrDsrOptionSR_methods(root_module, cls):
## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptionSR::DsrOptionSR(ns3::dsr::DsrOptionSR const & arg0) [constructor]
cls.add_constructor([param('ns3::dsr::DsrOptionSR const &', 'arg0')])
## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptionSR::DsrOptionSR() [constructor]
cls.add_constructor([])
## dsr-options.h (module 'dsr'): ns3::TypeId ns3::dsr::DsrOptionSR::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## dsr-options.h (module 'dsr'): uint8_t ns3::dsr::DsrOptionSR::GetOptionNumber() const [member function]
cls.add_method('GetOptionNumber',
'uint8_t',
[],
is_const=True, is_virtual=True)
## dsr-options.h (module 'dsr'): static ns3::TypeId ns3::dsr::DsrOptionSR::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## dsr-options.h (module 'dsr'): uint8_t ns3::dsr::DsrOptionSR::Process(ns3::Ptr<ns3::Packet> packet, ns3::Ptr<ns3::Packet> dsrP, ns3::Ipv4Address ipv4Address, ns3::Ipv4Address source, ns3::Ipv4Header const & ipv4Header, uint8_t protocol, bool & isPromisc, ns3::Ipv4Address promiscSource) [member function]
cls.add_method('Process',
'uint8_t',
[param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ptr< ns3::Packet >', 'dsrP'), param('ns3::Ipv4Address', 'ipv4Address'), param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Header const &', 'ipv4Header'), param('uint8_t', 'protocol'), param('bool &', 'isPromisc'), param('ns3::Ipv4Address', 'promiscSource')],
is_virtual=True)
## dsr-options.h (module 'dsr'): ns3::dsr::DsrOptionSR::OPT_NUMBER [variable]
cls.add_static_attribute('OPT_NUMBER', 'uint8_t const', is_const=True)
return
def register_functions(root_module):
module = root_module
register_functions_ns3_FatalImpl(module.add_cpp_namespace('FatalImpl'), root_module)
register_functions_ns3_Hash(module.add_cpp_namespace('Hash'), root_module)
register_functions_ns3_TracedValueCallback(module.add_cpp_namespace('TracedValueCallback'), root_module)
register_functions_ns3_dsr(module.add_cpp_namespace('dsr'), root_module)
register_functions_ns3_internal(module.add_cpp_namespace('internal'), root_module)
register_functions_ns3_tests(module.add_cpp_namespace('tests'), root_module)
return
def register_functions_ns3_FatalImpl(module, root_module):
return
def register_functions_ns3_Hash(module, root_module):
register_functions_ns3_Hash_Function(module.add_cpp_namespace('Function'), root_module)
return
def register_functions_ns3_Hash_Function(module, root_module):
return
def register_functions_ns3_TracedValueCallback(module, root_module):
return
def register_functions_ns3_dsr(module, root_module):
return
def register_functions_ns3_internal(module, root_module):
return
def register_functions_ns3_tests(module, root_module):
return
def main():
out = FileCodeSink(sys.stdout)
root_module = module_init()
register_types(root_module)
register_methods(root_module)
register_functions(root_module)
root_module.generate(out)
if __name__ == '__main__':
main()
| 68.715514
| 1,592
| 0.628867
| 102,127
| 958,925
| 5.769219
| 0.024097
| 0.038672
| 0.045357
| 0.074746
| 0.879537
| 0.82805
| 0.786102
| 0.753478
| 0.691514
| 0.633091
| 0
| 0.030836
| 0.211946
| 958,925
| 13,954
| 1,593
| 68.720439
| 0.748845
| 0.413644
| 0
| 0.714589
| 0
| 0.020634
| 0.310984
| 0.06417
| 0
| 0
| 0
| 0.000072
| 0
| 1
| 0.027577
| false
| 0.002507
| 0.025841
| 0.000579
| 0.080224
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
07636df254679f98c9ab59fda82fa403c589c795
| 831
|
py
|
Python
|
tests/test_provider_hashicorp_cloudinit.py
|
mjuenema/python-terrascript
|
6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d
|
[
"BSD-2-Clause"
] | 507
|
2017-07-26T02:58:38.000Z
|
2022-01-21T12:35:13.000Z
|
tests/test_provider_hashicorp_cloudinit.py
|
mjuenema/python-terrascript
|
6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d
|
[
"BSD-2-Clause"
] | 135
|
2017-07-20T12:01:59.000Z
|
2021-10-04T22:25:40.000Z
|
tests/test_provider_hashicorp_cloudinit.py
|
mjuenema/python-terrascript
|
6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d
|
[
"BSD-2-Clause"
] | 81
|
2018-02-20T17:55:28.000Z
|
2022-01-31T07:08:40.000Z
|
# tests/test_provider_hashicorp_cloudinit.py
# Automatically generated by tools/makecode.py (24-Sep-2021 15:14:09 UTC)
def test_provider_import():
import terrascript.provider.hashicorp.cloudinit
def test_resource_import():
from terrascript.resource.hashicorp.cloudinit import cloudinit_config
def test_datasource_import():
from terrascript.data.hashicorp.cloudinit import cloudinit_config
# TODO: Shortcut imports without namespace for official and supported providers.
# TODO: This has to be moved into a required_providers block.
# def test_version_source():
#
# import terrascript.provider.hashicorp.cloudinit
#
# t = terrascript.provider.hashicorp.cloudinit.cloudinit()
# s = str(t)
#
# assert 'https://github.com/hashicorp/terraform-provider-cloudinit' in s
# assert '2.2.0' in s
| 28.655172
| 80
| 0.76414
| 107
| 831
| 5.803738
| 0.542056
| 0.173913
| 0.167472
| 0.178744
| 0.26409
| 0
| 0
| 0
| 0
| 0
| 0
| 0.021127
| 0.145608
| 831
| 28
| 81
| 29.678571
| 0.853521
| 0.617329
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0.035714
| 0
| 1
| 0.5
| true
| 0
| 1
| 0
| 1.5
| 0
| 0
| 0
| 0
| null | 0
| 0
| 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
| 1
| 0
| 0
| 1
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 7
|
4ad4fd16dab476db44d8e204be52f17a7b76eb27
| 2,334
|
py
|
Python
|
code/cluster_keywords.py
|
JonaBenja/lad-assignment1
|
d4eeafda1032dd8dbe2b049b3008f3b4ad8c6c74
|
[
"Apache-2.0"
] | null | null | null |
code/cluster_keywords.py
|
JonaBenja/lad-assignment1
|
d4eeafda1032dd8dbe2b049b3008f3b4ad8c6c74
|
[
"Apache-2.0"
] | null | null | null |
code/cluster_keywords.py
|
JonaBenja/lad-assignment1
|
d4eeafda1032dd8dbe2b049b3008f3b4ad8c6c74
|
[
"Apache-2.0"
] | null | null | null |
import pandas as pd
import pickle
from collections import defaultdict, Counter
import json
tsv_file = "../data/clusters/nl_4_topic_clusters.tsv"
content = pd.read_csv(tsv_file, sep="\t", keep_default_na=False, header=0, encoding = 'utf-8')
clusters = content['Cluster']
with open("../data/clusters/nl_keywords.json", 'r') as infile:
keywords = json.load(infile)
keyword_clusters = {0:defaultdict(int), 1:defaultdict(int), 2:defaultdict(int), 3:defaultdict(int)}
for doc, cluster in zip(keywords, clusters):
for word in keywords[doc]:
if word not in keyword_clusters[cluster]:
keyword_clusters[cluster][word] = 1
else:
keyword_clusters[cluster][word] += 1
sorted_cluster0 = sorted(keyword_clusters[0].items(), key=lambda item:item[1], reverse=True)
sorted_cluster1 = sorted(keyword_clusters[1].items(), key=lambda item:item[1], reverse=True)
sorted_cluster2 = sorted(keyword_clusters[2].items(), key=lambda item:item[1], reverse=True)
sorted_cluster3 = sorted(keyword_clusters[3].items(), key=lambda item:item[1], reverse=True)
print(sorted_cluster0[:20])
print(sorted_cluster1[:20])
print(sorted_cluster2[:20])
print(sorted_cluster3[:20])
"""
ITALIAN CLUSTER KEYWORDS
"""
tsv_file = "../data/clusters/it_4_topic_clusters.tsv"
content = pd.read_csv(tsv_file, sep="\t", keep_default_na=False, header=0, encoding = 'utf-8')
clusters = content['Cluster']
with open("../data/clusters/it_keywords.json", 'r') as infile:
keywords = json.load(infile)
keyword_clusters = {0:defaultdict(int), 1:defaultdict(int), 2:defaultdict(int), 3:defaultdict(int)}
for doc, cluster in zip(keywords, clusters):
for word in keywords[doc]:
if word not in keyword_clusters[cluster]:
keyword_clusters[cluster][word] = 1
else:
keyword_clusters[cluster][word] += 1
sorted_cluster0 = sorted(keyword_clusters[0].items(), key=lambda item:item[1], reverse=True)
sorted_cluster1 = sorted(keyword_clusters[1].items(), key=lambda item:item[1], reverse=True)
sorted_cluster2 = sorted(keyword_clusters[2].items(), key=lambda item:item[1], reverse=True)
sorted_cluster3 = sorted(keyword_clusters[3].items(), key=lambda item:item[1], reverse=True)
print(sorted_cluster0[:20])
print(sorted_cluster1[:20])
print(sorted_cluster2[:20])
print(sorted_cluster3[:20])
| 35.363636
| 99
| 0.726221
| 334
| 2,334
| 4.92515
| 0.197605
| 0.145897
| 0.102128
| 0.087538
| 0.911854
| 0.911854
| 0.911854
| 0.911854
| 0.911854
| 0.911854
| 0
| 0.03229
| 0.12425
| 2,334
| 65
| 100
| 35.907692
| 0.772505
| 0
| 0
| 0.818182
| 0
| 0
| 0.076588
| 0.063534
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.090909
| 0
| 0.090909
| 0.181818
| 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
|
4ae3f071ed0ef635c30bf27eb22675554225461e
| 159
|
py
|
Python
|
soapbox/blueprint/admin.py
|
jonmoshier/soapbox
|
945193edf4a7dfc4bf6aa214be1a30991072a052
|
[
"MIT"
] | 1
|
2019-09-10T21:19:42.000Z
|
2019-09-10T21:19:42.000Z
|
soapbox/blueprint/admin.py
|
jonmoshier/soapbox
|
945193edf4a7dfc4bf6aa214be1a30991072a052
|
[
"MIT"
] | null | null | null |
soapbox/blueprint/admin.py
|
jonmoshier/soapbox
|
945193edf4a7dfc4bf6aa214be1a30991072a052
|
[
"MIT"
] | null | null | null |
from django.contrib import admin
from .models import Blueprint
class BlueprintAdmin(admin.ModelAdmin):
pass
admin.site.register(Blueprint, BlueprintAdmin)
| 26.5
| 46
| 0.823899
| 19
| 159
| 6.894737
| 0.684211
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.106918
| 159
| 6
| 46
| 26.5
| 0.922535
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.2
| 0.4
| 0
| 0.6
| 0.6
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 1
| 1
|
0
| 7
|
4ae489996e0acafed7d22b5f49b574e277ba2ac2
| 14,839
|
py
|
Python
|
sdk/python/pulumi_vault/pkisecret/secret_backend_config_urls.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_config_urls.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_config_urls.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__ = ['SecretBackendConfigUrlsArgs', 'SecretBackendConfigUrls']
@pulumi.input_type
class SecretBackendConfigUrlsArgs:
def __init__(__self__, *,
backend: pulumi.Input[str],
crl_distribution_points: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
issuing_certificates: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
ocsp_servers: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None):
"""
The set of arguments for constructing a SecretBackendConfigUrls resource.
:param pulumi.Input[str] backend: The path the PKI secret backend is mounted at, with no leading or trailing `/`s.
:param pulumi.Input[Sequence[pulumi.Input[str]]] crl_distribution_points: Specifies the URL values for the CRL Distribution Points field.
:param pulumi.Input[Sequence[pulumi.Input[str]]] issuing_certificates: Specifies the URL values for the Issuing Certificate field.
:param pulumi.Input[Sequence[pulumi.Input[str]]] ocsp_servers: Specifies the URL values for the OCSP Servers field.
"""
pulumi.set(__self__, "backend", backend)
if crl_distribution_points is not None:
pulumi.set(__self__, "crl_distribution_points", crl_distribution_points)
if issuing_certificates is not None:
pulumi.set(__self__, "issuing_certificates", issuing_certificates)
if ocsp_servers is not None:
pulumi.set(__self__, "ocsp_servers", ocsp_servers)
@property
@pulumi.getter
def backend(self) -> pulumi.Input[str]:
"""
The path the PKI secret backend is mounted at, with no leading or trailing `/`s.
"""
return pulumi.get(self, "backend")
@backend.setter
def backend(self, value: pulumi.Input[str]):
pulumi.set(self, "backend", value)
@property
@pulumi.getter(name="crlDistributionPoints")
def crl_distribution_points(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
"""
Specifies the URL values for the CRL Distribution Points field.
"""
return pulumi.get(self, "crl_distribution_points")
@crl_distribution_points.setter
def crl_distribution_points(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]):
pulumi.set(self, "crl_distribution_points", value)
@property
@pulumi.getter(name="issuingCertificates")
def issuing_certificates(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
"""
Specifies the URL values for the Issuing Certificate field.
"""
return pulumi.get(self, "issuing_certificates")
@issuing_certificates.setter
def issuing_certificates(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]):
pulumi.set(self, "issuing_certificates", value)
@property
@pulumi.getter(name="ocspServers")
def ocsp_servers(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
"""
Specifies the URL values for the OCSP Servers field.
"""
return pulumi.get(self, "ocsp_servers")
@ocsp_servers.setter
def ocsp_servers(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]):
pulumi.set(self, "ocsp_servers", value)
@pulumi.input_type
class _SecretBackendConfigUrlsState:
def __init__(__self__, *,
backend: Optional[pulumi.Input[str]] = None,
crl_distribution_points: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
issuing_certificates: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
ocsp_servers: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None):
"""
Input properties used for looking up and filtering SecretBackendConfigUrls resources.
:param pulumi.Input[str] backend: The path the PKI secret backend is mounted at, with no leading or trailing `/`s.
:param pulumi.Input[Sequence[pulumi.Input[str]]] crl_distribution_points: Specifies the URL values for the CRL Distribution Points field.
:param pulumi.Input[Sequence[pulumi.Input[str]]] issuing_certificates: Specifies the URL values for the Issuing Certificate field.
:param pulumi.Input[Sequence[pulumi.Input[str]]] ocsp_servers: Specifies the URL values for the OCSP Servers field.
"""
if backend is not None:
pulumi.set(__self__, "backend", backend)
if crl_distribution_points is not None:
pulumi.set(__self__, "crl_distribution_points", crl_distribution_points)
if issuing_certificates is not None:
pulumi.set(__self__, "issuing_certificates", issuing_certificates)
if ocsp_servers is not None:
pulumi.set(__self__, "ocsp_servers", ocsp_servers)
@property
@pulumi.getter
def backend(self) -> Optional[pulumi.Input[str]]:
"""
The path the PKI secret backend is mounted at, with no leading or trailing `/`s.
"""
return pulumi.get(self, "backend")
@backend.setter
def backend(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "backend", value)
@property
@pulumi.getter(name="crlDistributionPoints")
def crl_distribution_points(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
"""
Specifies the URL values for the CRL Distribution Points field.
"""
return pulumi.get(self, "crl_distribution_points")
@crl_distribution_points.setter
def crl_distribution_points(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]):
pulumi.set(self, "crl_distribution_points", value)
@property
@pulumi.getter(name="issuingCertificates")
def issuing_certificates(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
"""
Specifies the URL values for the Issuing Certificate field.
"""
return pulumi.get(self, "issuing_certificates")
@issuing_certificates.setter
def issuing_certificates(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]):
pulumi.set(self, "issuing_certificates", value)
@property
@pulumi.getter(name="ocspServers")
def ocsp_servers(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
"""
Specifies the URL values for the OCSP Servers field.
"""
return pulumi.get(self, "ocsp_servers")
@ocsp_servers.setter
def ocsp_servers(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]):
pulumi.set(self, "ocsp_servers", value)
class SecretBackendConfigUrls(pulumi.CustomResource):
@overload
def __init__(__self__,
resource_name: str,
opts: Optional[pulumi.ResourceOptions] = None,
backend: Optional[pulumi.Input[str]] = None,
crl_distribution_points: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
issuing_certificates: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
ocsp_servers: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
__props__=None):
"""
Allows setting the issuing certificate endpoints, CRL distribution points, and OCSP server endpoints that will be encoded into issued certificates.
## Example Usage
```python
import pulumi
import pulumi_vault as vault
config_urls = vault.pki_secret.SecretBackendConfigUrls("configUrls",
backend=vault_mount["pki"]["path"],
issuing_certificates=["http://127.0.0.1:8200/v1/pki/ca"])
```
:param str resource_name: The name of the resource.
:param pulumi.ResourceOptions opts: Options for the resource.
:param pulumi.Input[str] backend: The path the PKI secret backend is mounted at, with no leading or trailing `/`s.
:param pulumi.Input[Sequence[pulumi.Input[str]]] crl_distribution_points: Specifies the URL values for the CRL Distribution Points field.
:param pulumi.Input[Sequence[pulumi.Input[str]]] issuing_certificates: Specifies the URL values for the Issuing Certificate field.
:param pulumi.Input[Sequence[pulumi.Input[str]]] ocsp_servers: Specifies the URL values for the OCSP Servers field.
"""
...
@overload
def __init__(__self__,
resource_name: str,
args: SecretBackendConfigUrlsArgs,
opts: Optional[pulumi.ResourceOptions] = None):
"""
Allows setting the issuing certificate endpoints, CRL distribution points, and OCSP server endpoints that will be encoded into issued certificates.
## Example Usage
```python
import pulumi
import pulumi_vault as vault
config_urls = vault.pki_secret.SecretBackendConfigUrls("configUrls",
backend=vault_mount["pki"]["path"],
issuing_certificates=["http://127.0.0.1:8200/v1/pki/ca"])
```
:param str resource_name: The name of the resource.
:param SecretBackendConfigUrlsArgs 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(SecretBackendConfigUrlsArgs, 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,
backend: Optional[pulumi.Input[str]] = None,
crl_distribution_points: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
issuing_certificates: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
ocsp_servers: 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__ = SecretBackendConfigUrlsArgs.__new__(SecretBackendConfigUrlsArgs)
if backend is None and not opts.urn:
raise TypeError("Missing required property 'backend'")
__props__.__dict__["backend"] = backend
__props__.__dict__["crl_distribution_points"] = crl_distribution_points
__props__.__dict__["issuing_certificates"] = issuing_certificates
__props__.__dict__["ocsp_servers"] = ocsp_servers
super(SecretBackendConfigUrls, __self__).__init__(
'vault:pkiSecret/secretBackendConfigUrls:SecretBackendConfigUrls',
resource_name,
__props__,
opts)
@staticmethod
def get(resource_name: str,
id: pulumi.Input[str],
opts: Optional[pulumi.ResourceOptions] = None,
backend: Optional[pulumi.Input[str]] = None,
crl_distribution_points: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
issuing_certificates: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
ocsp_servers: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None) -> 'SecretBackendConfigUrls':
"""
Get an existing SecretBackendConfigUrls 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] backend: The path the PKI secret backend is mounted at, with no leading or trailing `/`s.
:param pulumi.Input[Sequence[pulumi.Input[str]]] crl_distribution_points: Specifies the URL values for the CRL Distribution Points field.
:param pulumi.Input[Sequence[pulumi.Input[str]]] issuing_certificates: Specifies the URL values for the Issuing Certificate field.
:param pulumi.Input[Sequence[pulumi.Input[str]]] ocsp_servers: Specifies the URL values for the OCSP Servers field.
"""
opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))
__props__ = _SecretBackendConfigUrlsState.__new__(_SecretBackendConfigUrlsState)
__props__.__dict__["backend"] = backend
__props__.__dict__["crl_distribution_points"] = crl_distribution_points
__props__.__dict__["issuing_certificates"] = issuing_certificates
__props__.__dict__["ocsp_servers"] = ocsp_servers
return SecretBackendConfigUrls(resource_name, opts=opts, __props__=__props__)
@property
@pulumi.getter
def backend(self) -> pulumi.Output[str]:
"""
The path the PKI secret backend is mounted at, with no leading or trailing `/`s.
"""
return pulumi.get(self, "backend")
@property
@pulumi.getter(name="crlDistributionPoints")
def crl_distribution_points(self) -> pulumi.Output[Optional[Sequence[str]]]:
"""
Specifies the URL values for the CRL Distribution Points field.
"""
return pulumi.get(self, "crl_distribution_points")
@property
@pulumi.getter(name="issuingCertificates")
def issuing_certificates(self) -> pulumi.Output[Optional[Sequence[str]]]:
"""
Specifies the URL values for the Issuing Certificate field.
"""
return pulumi.get(self, "issuing_certificates")
@property
@pulumi.getter(name="ocspServers")
def ocsp_servers(self) -> pulumi.Output[Optional[Sequence[str]]]:
"""
Specifies the URL values for the OCSP Servers field.
"""
return pulumi.get(self, "ocsp_servers")
| 47.560897
| 155
| 0.674978
| 1,679
| 14,839
| 5.742108
| 0.103038
| 0.108391
| 0.078415
| 0.101131
| 0.802303
| 0.787055
| 0.78467
| 0.772327
| 0.767037
| 0.755212
| 0
| 0.001999
| 0.224476
| 14,839
| 311
| 156
| 47.713826
| 0.835766
| 0.309118
| 0
| 0.701149
| 1
| 0
| 0.109036
| 0.042607
| 0
| 0
| 0
| 0
| 0
| 1
| 0.155172
| false
| 0.005747
| 0.028736
| 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
|
ab597af2f8733e4abb4ebf47cf2fa873871a9660
| 60,629
|
py
|
Python
|
test/kv/yy3.py
|
IWantToClearMyHead/IWantToClearMyHead.github.io
|
13968b46bf6da5e61fc628309ed2a7e7529af58e
|
[
"MIT"
] | null | null | null |
test/kv/yy3.py
|
IWantToClearMyHead/IWantToClearMyHead.github.io
|
13968b46bf6da5e61fc628309ed2a7e7529af58e
|
[
"MIT"
] | null | null | null |
test/kv/yy3.py
|
IWantToClearMyHead/IWantToClearMyHead.github.io
|
13968b46bf6da5e61fc628309ed2a7e7529af58e
|
[
"MIT"
] | null | null | null |
canvas:
Color:
rgba: 1,1,1,1
Rectangle:
size: 140, 10
pos: 140, 240
Rectangle:
size: 140, 10
pos: 140, 200
Rectangle:
size: 60, 10
pos: 140, 160
Rectangle:
size: 60, 10
pos: 220, 160
Rectangle:
size: 140, 10
pos: 140, 120
Rectangle:
size: 140, 10
pos: 140, 80
Rectangle:
size: 60, 10
pos: 140, 40
Rectangle:
size: 60, 10
pos: 220, 40
BoxLayout:
orientation: 'vertical'
Label:
text: '上九巽在床下丧其资斧贞凶'
font_name: './yahei.ttf'
Label:
text: '九五贞吉悔亡无不利无初有终先庚三日后庚三日吉'
font_name: './yahei.ttf'
Label:
text: '六四悔亡田获三品'
font_name: './yahei.ttf'
Label:
text: '九三频巽吝'
font_name: './yahei.ttf'
Label:
text: '九二巽在床下用史巫纷若吉无咎'
font_name: './yahei.ttf'
Label:
text: '初六进退利武人之贞'
font_name: './yahei.ttf'
<Screen48>:
name: '48'
BoxLayout:
orientation: 'vertical'
padding: [10,40,40,30]
BoxLayout:
size_hint_y: .3
Label:
text:''
font_name: './yahei.ttf'
font_size: 60
markup: True
Button:
background_normal: ''
background_color: 0,0,0,0
text: '井'
font_size: 60
font_name: './yahei.ttf'
on_release:
root.manager.current = 'menu'
root.manager.transition.direction = 'right'
Button:
background_normal: ''
background_color: 0,0,0,0
text: '枯井破费已多年\\n一朝流泉出来鲜\\n资生济渴人称羡\\n时来运转喜自然'
font_name: './yahei.ttf'
BoxLayout:
Image:
id: 48
source: '48.png'
allow_stretch: False
Label:
text: '井改邑不改井无丧无得往来井井汔至亦未繘井羸其瓶凶'
font_name: './yahei.ttf'
BoxLayout:
BoxLayout:
orientation: 'vertical'
canvas:
Color:
rgba: 1,1,1,1
Rectangle:
size: 60, 10
pos: 140, 240
Rectangle:
size: 60, 10
pos: 220, 240
Rectangle:
size: 140, 10
pos: 140, 200
Rectangle:
size: 60, 10
pos: 140, 160
Rectangle:
size: 60, 10
pos: 220, 160
Rectangle:
size: 140, 10
pos: 140, 120
Rectangle:
size: 140, 10
pos: 140, 80
Rectangle:
size: 60, 10
pos: 140, 40
Rectangle:
size: 60, 10
pos: 220, 40
BoxLayout:
orientation: 'vertical'
Label:
text: '上六井收勿幕有孚元吉'
font_name: './yahei.ttf'
Label:
text: '九五井洌寒泉食'
font_name: './yahei.ttf'
Label:
text: '六四井甃无咎'
font_name: './yahei.ttf'
Label:
text: '九三井渫不食为我心恻可用汲王明并受其福'
font_name: './yahei.ttf'
Label:
text: '九二井谷射鲋瓮敝漏'
font_name: './yahei.ttf'
Label:
text: '初六井泥不食旧井无禽'
font_name: './yahei.ttf'
<Screen18>:
name: '18'
BoxLayout:
orientation: 'vertical'
padding: [10,40,40,30]
BoxLayout:
size_hint_y: .3
Label:
text:''
font_name: './yahei.ttf'
font_size: 60
markup: True
Button:
background_normal: ''
background_color: 0,0,0,0
text: '蛊'
font_size: 60
font_name: './yahei.ttf'
on_release:
root.manager.current = 'menu'
root.manager.transition.direction = 'right'
Button:
background_normal: ''
background_color: 0,0,0,0
text: '卦中爻象如推磨\\n顺当为福反为祸\\n心中有益且迟迟\\n凡事尽从忙处错'
font_name: './yahei.ttf'
BoxLayout:
Image:
id: 18
source: '18.png'
allow_stretch: False
Label:
text: '蛊元亨利涉大川先甲三日后甲三日'
font_name: './yahei.ttf'
BoxLayout:
BoxLayout:
orientation: 'vertical'
canvas:
Color:
rgba: 1,1,1,1
Rectangle:
size: 140, 10
pos: 140, 240
Rectangle:
size: 60, 10
pos: 140, 200
Rectangle:
size: 60, 10
pos: 220, 200
Rectangle:
size: 60, 10
pos: 140, 160
Rectangle:
size: 60, 10
pos: 220, 160
Rectangle:
size: 140, 10
pos: 140, 120
Rectangle:
size: 140, 10
pos: 140, 80
Rectangle:
size: 60, 10
pos: 140, 40
Rectangle:
size: 60, 10
pos: 220, 40
BoxLayout:
orientation: 'vertical'
Label:
text: '上九不事王侯高尚其事'
font_name: './yahei.ttf'
Label:
text: '六五干父之蛊用誉'
font_name: './yahei.ttf'
Label:
text: '六四裕父之蛊往见吝'
font_name: './yahei.ttf'
Label:
text: '九三干父之蛊小有悔无大咎'
font_name: './yahei.ttf'
Label:
text: '九二干母之蛊不可贞'
font_name: './yahei.ttf'
Label:
text: '初六干父之蛊有子考无咎厉终吉'
font_name: './yahei.ttf'
<Screen46>:
name: '46'
BoxLayout:
orientation: 'vertical'
padding: [10,40,40,30]
BoxLayout:
size_hint_y: .3
Label:
text:''
font_name: './yahei.ttf'
font_size: 60
markup: True
Button:
background_normal: ''
background_color: 0,0,0,0
text: '升'
font_size: 60
font_name: './yahei.ttf'
on_release:
root.manager.current = 'menu'
root.manager.transition.direction = 'right'
Button:
background_normal: ''
background_color: 0,0,0,0
text: '士人来占必得名\\n生意买卖也兴隆\\n匠艺逢之交易好\\n农间庄稼亦收成'
font_name: './yahei.ttf'
BoxLayout:
Image:
id: 46
source: '46.png'
allow_stretch: False
Label:
text: '升元亨用见大人勿恤南征吉'
font_name: './yahei.ttf'
BoxLayout:
BoxLayout:
orientation: 'vertical'
canvas:
Color:
rgba: 1,1,1,1
Rectangle:
size: 60, 10
pos: 140, 240
Rectangle:
size: 60, 10
pos: 220, 240
Rectangle:
size: 60, 10
pos: 140, 200
Rectangle:
size: 60, 10
pos: 220, 200
Rectangle:
size: 60, 10
pos: 140, 160
Rectangle:
size: 60, 10
pos: 220, 160
Rectangle:
size: 140, 10
pos: 140, 120
Rectangle:
size: 140, 10
pos: 140, 80
Rectangle:
size: 60, 10
pos: 140, 40
Rectangle:
size: 60, 10
pos: 220, 40
BoxLayout:
orientation: 'vertical'
Label:
text: '上六冥升利于不息之贞'
font_name: './yahei.ttf'
Label:
text: '六五贞吉升阶'
font_name: './yahei.ttf'
Label:
text: '六四王用亨于岐山吉无咎'
font_name: './yahei.ttf'
Label:
text: '九三升虚邑'
font_name: './yahei.ttf'
Label:
text: '九二孚乃利用禴无咎'
font_name: './yahei.ttf'
Label:
text: '初六允升大吉'
font_name: './yahei.ttf'
<Screen6>:
name: '6'
BoxLayout:
orientation: 'vertical'
padding: [10,40,40,30]
BoxLayout:
size_hint_y: .3
Label:
text:''
font_name: './yahei.ttf'
font_size: 60
markup: True
Button:
background_normal: ''
background_color: 0,0,0,0
text: '讼'
font_size: 60
font_name: './yahei.ttf'
on_release:
root.manager.current = 'menu'
root.manager.transition.direction = 'right'
Button:
background_normal: ''
background_color: 0,0,0,0
text: '心中有事事难做\\n恰是二人争路走\\n雨下俱是要占先\\n谁肯让谁走一步'
font_name: './yahei.ttf'
BoxLayout:
Image:
id: 6
source: '6.png'
allow_stretch: False
Label:
text: '讼有孚窒惕中吉终凶利见大人不利涉大川'
font_name: './yahei.ttf'
BoxLayout:
BoxLayout:
orientation: 'vertical'
canvas:
Color:
rgba: 1,1,1,1
Rectangle:
size: 140, 10
pos: 140, 240
Rectangle:
size: 140, 10
pos: 140, 200
Rectangle:
size: 140, 10
pos: 140, 160
Rectangle:
size: 60, 10
pos: 140, 120
Rectangle:
size: 60, 10
pos: 220, 120
Rectangle:
size: 140, 10
pos: 140, 80
Rectangle:
size: 60, 10
pos: 140, 40
Rectangle:
size: 60, 10
pos: 220, 40
BoxLayout:
orientation: 'vertical'
Label:
text: '上九或锡之鞶带终朝三褫之'
font_name: './yahei.ttf'
Label:
text: '九五讼元吉'
font_name: './yahei.ttf'
Label:
text: '九四不克讼复既命渝安贞吉'
font_name: './yahei.ttf'
Label:
text: '六三食旧德贞厉终吉或従王事无成'
font_name: './yahei.ttf'
Label:
text: '九二不克讼归而逋其邑人三百户无眚'
font_name: './yahei.ttf'
Label:
text: '初六不永所事小有言终吉'
font_name: './yahei.ttf'
<Screen47>:
name: '47'
BoxLayout:
orientation: 'vertical'
padding: [10,40,40,30]
BoxLayout:
size_hint_y: .3
Label:
text:''
font_name: './yahei.ttf'
font_size: 60
markup: True
Button:
background_normal: ''
background_color: 0,0,0,0
text: '困'
font_size: 60
font_name: './yahei.ttf'
on_release:
root.manager.current = 'menu'
root.manager.transition.direction = 'right'
Button:
background_normal: ''
background_color: 0,0,0,0
text: '时运不来好伤怀\\n撮上押去把梯抬\\n一筒虫翼无到手\\n转了上去下不来'
font_name: './yahei.ttf'
BoxLayout:
Image:
id: 47
source: '47.png'
allow_stretch: False
Label:
text: '困亨贞大人吉无咎有言不信'
font_name: './yahei.ttf'
BoxLayout:
BoxLayout:
orientation: 'vertical'
canvas:
Color:
rgba: 1,1,1,1
Rectangle:
size: 60, 10
pos: 140, 240
Rectangle:
size: 60, 10
pos: 220, 240
Rectangle:
size: 140, 10
pos: 140, 200
Rectangle:
size: 140, 10
pos: 140, 160
Rectangle:
size: 60, 10
pos: 140, 120
Rectangle:
size: 60, 10
pos: 220, 120
Rectangle:
size: 140, 10
pos: 140, 80
Rectangle:
size: 60, 10
pos: 140, 40
Rectangle:
size: 60, 10
pos: 220, 40
BoxLayout:
orientation: 'vertical'
Label:
text: '上六困于葛藟于臲臬兀曰动悔有悔征吉'
font_name: './yahei.ttf'
Label:
text: '九五劓刖困于赤绂乃徐有说利用祭祀'
font_name: './yahei.ttf'
Label:
text: '九四来徐徐困于金车吝有终'
font_name: './yahei.ttf'
Label:
text: '六三困于石据于蒺藜入于其宫不见其妻凶'
font_name: './yahei.ttf'
Label:
text: '九二困于酒食朱绂方来利用享祀征凶无咎'
font_name: './yahei.ttf'
Label:
text: '初六臀困于株木入于幽谷三岁不觌'
font_name: './yahei.ttf'
<Screen64>:
name: '64'
BoxLayout:
orientation: 'vertical'
padding: [10,40,40,30]
BoxLayout:
size_hint_y: .3
Label:
text:''
font_name: './yahei.ttf'
font_size: 60
markup: True
Button:
background_normal: ''
background_color: 0,0,0,0
text: '未济'
font_size: 60
font_name: './yahei.ttf'
on_release:
root.manager.current = 'menu'
root.manager.transition.direction = 'right'
Button:
background_normal: ''
background_color: 0,0,0,0
text: '离地着人几丈深\\n是防偷营劫寨人\\n后封太岁为凶煞\\n时加谨慎祸不侵'
font_name: './yahei.ttf'
BoxLayout:
Image:
id: 64
source: '64.png'
allow_stretch: False
Label:
text: '未济亨小狐汔济濡其尾无攸利'
font_name: './yahei.ttf'
BoxLayout:
BoxLayout:
orientation: 'vertical'
canvas:
Color:
rgba: 1,1,1,1
Rectangle:
size: 140, 10
pos: 140, 240
Rectangle:
size: 60, 10
pos: 140, 200
Rectangle:
size: 60, 10
pos: 220, 200
Rectangle:
size: 140, 10
pos: 140, 160
Rectangle:
size: 60, 10
pos: 140, 120
Rectangle:
size: 60, 10
pos: 220, 120
Rectangle:
size: 140, 10
pos: 140, 80
Rectangle:
size: 60, 10
pos: 140, 40
Rectangle:
size: 60, 10
pos: 220, 40
BoxLayout:
orientation: 'vertical'
Label:
text: '上九有孚于饮酒无咎濡其首有孚失是'
font_name: './yahei.ttf'
Label:
text: '六五贞吉无悔君子之光有孚吉'
font_name: './yahei.ttf'
Label:
text: '九四贞吉悔亡震用伐鬼方三年有赏于大国'
font_name: './yahei.ttf'
Label:
text: '六三未济征凶利涉大川'
font_name: './yahei.ttf'
Label:
text: '九二曳其轮贞吉'
font_name: './yahei.ttf'
Label:
text: '初六濡其尾吝'
font_name: './yahei.ttf'
<Screen40>:
name: '40'
BoxLayout:
orientation: 'vertical'
padding: [10,40,40,30]
BoxLayout:
size_hint_y: .3
Label:
text:''
font_name: './yahei.ttf'
font_size: 60
markup: True
Button:
background_normal: ''
background_color: 0,0,0,0
text: '解'
font_size: 60
font_name: './yahei.ttf'
on_release:
root.manager.current = 'menu'
root.manager.transition.direction = 'right'
Button:
background_normal: ''
background_color: 0,0,0,0
text: '目下月令如过关\\n千辛万苦受熬煎\\n时来恰相有人救\\n任意所为不相干'
font_name: './yahei.ttf'
BoxLayout:
Image:
id: 40
source: '40.png'
allow_stretch: False
Label:
text: '解利西南无所往其来复吉有攸往夙吉'
font_name: './yahei.ttf'
BoxLayout:
BoxLayout:
orientation: 'vertical'
canvas:
Color:
rgba: 1,1,1,1
Rectangle:
size: 60, 10
pos: 140, 240
Rectangle:
size: 60, 10
pos: 220, 240
Rectangle:
size: 60, 10
pos: 140, 200
Rectangle:
size: 60, 10
pos: 220, 200
Rectangle:
size: 140, 10
pos: 140, 160
Rectangle:
size: 60, 10
pos: 140, 120
Rectangle:
size: 60, 10
pos: 220, 120
Rectangle:
size: 140, 10
pos: 140, 80
Rectangle:
size: 60, 10
pos: 140, 40
Rectangle:
size: 60, 10
pos: 220, 40
BoxLayout:
orientation: 'vertical'
Label:
text: '上六公用射隼于高墉之上获之无不利'
font_name: './yahei.ttf'
Label:
text: '六五君子维有解吉有孚于小人'
font_name: './yahei.ttf'
Label:
text: '九四解而拇朋至斯孚'
font_name: './yahei.ttf'
Label:
text: '六三负且乘致寇至贞吝'
font_name: './yahei.ttf'
Label:
text: '九二田获三狐得黄矢贞吉'
font_name: './yahei.ttf'
Label:
text: '初六无咎'
font_name: './yahei.ttf'
<Screen59>:
name: '59'
BoxLayout:
orientation: 'vertical'
padding: [10,40,40,30]
BoxLayout:
size_hint_y: .3
Label:
text:''
font_name: './yahei.ttf'
font_size: 60
markup: True
Button:
background_normal: ''
background_color: 0,0,0,0
text: '涣'
font_size: 60
font_name: './yahei.ttf'
on_release:
root.manager.current = 'menu'
root.manager.transition.direction = 'right'
Button:
background_normal: ''
background_color: 0,0,0,0
text: '隔河望见一锭金\\n欲取岸宽水又深\\n指望资财难到手\\n尽夜资财枉费心'
font_name: './yahei.ttf'
BoxLayout:
Image:
id: 59
source: '59.png'
allow_stretch: False
Label:
text: '涣亨王假有庙利涉大川利贞'
font_name: './yahei.ttf'
BoxLayout:
BoxLayout:
orientation: 'vertical'
canvas:
Color:
rgba: 1,1,1,1
Rectangle:
size: 140, 10
pos: 140, 240
Rectangle:
size: 140, 10
pos: 140, 200
Rectangle:
size: 60, 10
pos: 140, 160
Rectangle:
size: 60, 10
pos: 220, 160
Rectangle:
size: 60, 10
pos: 140, 120
Rectangle:
size: 60, 10
pos: 220, 120
Rectangle:
size: 140, 10
pos: 140, 80
Rectangle:
size: 60, 10
pos: 140, 40
Rectangle:
size: 60, 10
pos: 220, 40
BoxLayout:
orientation: 'vertical'
Label:
text: '上九涣其血去逖出无咎'
font_name: './yahei.ttf'
Label:
text: '九五涣汗其大号涣王居无咎'
font_name: './yahei.ttf'
Label:
text: '六四涣其群元吉涣有丘匪夷所思'
font_name: './yahei.ttf'
Label:
text: '六三涣其躬无悔'
font_name: './yahei.ttf'
Label:
text: '九二涣奔其机悔亡'
font_name: './yahei.ttf'
Label:
text: '初六用拯马壮吉'
font_name: './yahei.ttf'
<Screen29>:
name: '29'
BoxLayout:
orientation: 'vertical'
padding: [10,40,40,30]
BoxLayout:
size_hint_y: .3
Label:
text:''
font_name: './yahei.ttf'
font_size: 60
markup: True
Button:
background_normal: ''
background_color: 0,0,0,0
text: '坎'
font_size: 60
font_name: './yahei.ttf'
on_release:
root.manager.current = 'menu'
root.manager.transition.direction = 'right'
Button:
background_normal: ''
background_color: 0,0,0,0
text: '一轮明月照水中\\n只见影儿不见踪\\n愚夫当财下去取\\n摸来摸去一场空'
font_name: './yahei.ttf'
BoxLayout:
Image:
id: 29
source: '29.png'
allow_stretch: False
Label:
text: '习坎有孚维心亨行有尚'
font_name: './yahei.ttf'
BoxLayout:
BoxLayout:
orientation: 'vertical'
canvas:
Color:
rgba: 1,1,1,1
Rectangle:
size: 60, 10
pos: 140, 240
Rectangle:
size: 60, 10
pos: 220, 240
Rectangle:
size: 140, 10
pos: 140, 200
Rectangle:
size: 60, 10
pos: 140, 160
Rectangle:
size: 60, 10
pos: 220, 160
Rectangle:
size: 60, 10
pos: 140, 120
Rectangle:
size: 60, 10
pos: 220, 120
Rectangle:
size: 140, 10
pos: 140, 80
Rectangle:
size: 60, 10
pos: 140, 40
Rectangle:
size: 60, 10
pos: 220, 40
BoxLayout:
orientation: 'vertical'
Label:
text: '上六系用徽纆窴于丛棘三岁不得凶'
font_name: './yahei.ttf'
Label:
text: '九五坎不盈祗既平无咎'
font_name: './yahei.ttf'
Label:
text: '六四樽酒簋贰用缶纳约自牖终无咎'
font_name: './yahei.ttf'
Label:
text: '六三来之坎坎险且枕入于坎窞勿用'
font_name: './yahei.ttf'
Label:
text: '九二坎有险求小得'
font_name: './yahei.ttf'
Label:
text: '初六习坎入于坎窞凶'
font_name: './yahei.ttf'
<Screen4>:
name: '4'
BoxLayout:
orientation: 'vertical'
padding: [10,40,40,30]
BoxLayout:
size_hint_y: .3
Label:
text:''
font_name: './yahei.ttf'
font_size: 60
markup: True
Button:
background_normal: ''
background_color: 0,0,0,0
text: '蒙'
font_size: 60
font_name: './yahei.ttf'
on_release:
root.manager.current = 'menu'
root.manager.transition.direction = 'right'
Button:
background_normal: ''
background_color: 0,0,0,0
text: '卦中爻象犯小耗\\n君子占之运不高\\n婚姻合伙有琐碎\\n做事必然受苦劳'
font_name: './yahei.ttf'
BoxLayout:
Image:
id: 4
source: '4.png'
allow_stretch: False
Label:
text: '蒙亨匪我求童蒙童蒙求我初筮告再三渎渎则不告利贞'
font_name: './yahei.ttf'
BoxLayout:
BoxLayout:
orientation: 'vertical'
canvas:
Color:
rgba: 1,1,1,1
Rectangle:
size: 140, 10
pos: 140, 240
Rectangle:
size: 60, 10
pos: 140, 200
Rectangle:
size: 60, 10
pos: 220, 200
Rectangle:
size: 60, 10
pos: 140, 160
Rectangle:
size: 60, 10
pos: 220, 160
Rectangle:
size: 60, 10
pos: 140, 120
Rectangle:
size: 60, 10
pos: 220, 120
Rectangle:
size: 140, 10
pos: 140, 80
Rectangle:
size: 60, 10
pos: 140, 40
Rectangle:
size: 60, 10
pos: 220, 40
BoxLayout:
orientation: 'vertical'
Label:
text: '上九击蒙不利为寇利御寇'
font_name: './yahei.ttf'
Label:
text: '六五童蒙吉'
font_name: './yahei.ttf'
Label:
text: '六四困蒙吝'
font_name: './yahei.ttf'
Label:
text: '六三勿用取女见金夫不有躬无攸利'
font_name: './yahei.ttf'
Label:
text: '九二包蒙吉纳妇吉子克家'
font_name: './yahei.ttf'
Label:
text: '初六发蒙利用刑人用说桎梏以往吝'
font_name: './yahei.ttf'
<Screen7>:
name: '7'
BoxLayout:
orientation: 'vertical'
padding: [10,40,40,30]
BoxLayout:
size_hint_y: .3
Label:
text:''
font_name: './yahei.ttf'
font_size: 60
markup: True
Button:
background_normal: ''
background_color: 0,0,0,0
text: '师'
font_size: 60
font_name: './yahei.ttf'
on_release:
root.manager.current = 'menu'
root.manager.transition.direction = 'right'
Button:
background_normal: ''
background_color: 0,0,0,0
text: '将帅领旨去出征\\n骑着烈马拉硬弓\\n百步穿杨去得准\\n箭中金钱喜气生'
font_name: './yahei.ttf'
BoxLayout:
Image:
id: 7
source: '7.png'
allow_stretch: False
Label:
text: '师贞丈人吉无咎'
font_name: './yahei.ttf'
BoxLayout:
BoxLayout:
orientation: 'vertical'
canvas:
Color:
rgba: 1,1,1,1
Rectangle:
size: 60, 10
pos: 140, 240
Rectangle:
size: 60, 10
pos: 220, 240
Rectangle:
size: 60, 10
pos: 140, 200
Rectangle:
size: 60, 10
pos: 220, 200
Rectangle:
size: 60, 10
pos: 140, 160
Rectangle:
size: 60, 10
pos: 220, 160
Rectangle:
size: 60, 10
pos: 140, 120
Rectangle:
size: 60, 10
pos: 220, 120
Rectangle:
size: 140, 10
pos: 140, 80
Rectangle:
size: 60, 10
pos: 140, 40
Rectangle:
size: 60, 10
pos: 220, 40
BoxLayout:
orientation: 'vertical'
Label:
text: '上六大君有命开国承家小人勿用'
font_name: './yahei.ttf'
Label:
text: '六五田有禽利执言无咎长子帅师弟子舆尸贞凶'
font_name: './yahei.ttf'
Label:
text: '六四师左次无咎'
font_name: './yahei.ttf'
Label:
text: '六三师或舆尸凶'
font_name: './yahei.ttf'
Label:
text: '九二在师中吉无咎王三锡命'
font_name: './yahei.ttf'
Label:
text: '初六师出以律否臧凶'
font_name: './yahei.ttf'
<Screen33>:
name: '33'
BoxLayout:
orientation: 'vertical'
padding: [10,40,40,30]
BoxLayout:
size_hint_y: .3
Label:
text:'六月\\n小暑\\n羊'
font_name: './yahei.ttf'
markup: True
Button:
background_normal: ''
background_color: 0,0,0,0
text: '遁'
font_size: 60
font_name: './yahei.ttf'
on_release:
root.manager.current = 'menu'
root.manager.transition.direction = 'right'
Button:
background_normal: ''
background_color: 0,0,0,0
text: '浓云蔽日不光明\\n劝君且莫出远行\\n婚姻求财皆不利\\n提防口舌到门庭'
font_name: './yahei.ttf'
BoxLayout:
Image:
id: 33
source: '33.png'
allow_stretch: False
Label:
text: '遁亨小利贞'
font_name: './yahei.ttf'
BoxLayout:
BoxLayout:
orientation: 'vertical'
canvas:
Color:
rgba: 1,1,1,1
Rectangle:
size: 140, 10
pos: 140, 240
Rectangle:
size: 140, 10
pos: 140, 200
Rectangle:
size: 140, 10
pos: 140, 160
Rectangle:
size: 140, 10
pos: 140, 120
Rectangle:
size: 60, 10
pos: 140, 80
Rectangle:
size: 60, 10
pos: 220, 80
Rectangle:
size: 60, 10
pos: 140, 40
Rectangle:
size: 60, 10
pos: 220, 40
BoxLayout:
orientation: 'vertical'
Label:
text: '上九肥遁无不利'
font_name: './yahei.ttf'
Label:
text: '九五嘉遁贞吉'
font_name: './yahei.ttf'
Label:
text: '九四好遁君子吉小人否'
font_name: './yahei.ttf'
Label:
text: '九三系遁有疾厉畜臣妾吉'
font_name: './yahei.ttf'
Label:
text: '六二执之用黄牛之革莫之胜说'
font_name: './yahei.ttf'
Label:
text: '初六遁尾厉勿用有攸往'
font_name: './yahei.ttf'
<Screen31>:
name: '31'
BoxLayout:
orientation: 'vertical'
padding: [10,40,40,30]
BoxLayout:
size_hint_y: .3
Label:
text:''
font_name: './yahei.ttf'
font_size: 60
markup: True
Button:
background_normal: ''
background_color: 0,0,0,0
text: '咸'
font_size: 60
font_name: './yahei.ttf'
on_release:
root.manager.current = 'menu'
root.manager.transition.direction = 'right'
Button:
background_normal: ''
background_color: 0,0,0,0
text: '运去黄金失色\\n时来棒槌发芽\\n月令极好无差\\n且喜心宽意大'
font_name: './yahei.ttf'
BoxLayout:
Image:
id: 31
source: '31.png'
allow_stretch: False
Label:
text: '咸亨利贞取女吉'
font_name: './yahei.ttf'
BoxLayout:
BoxLayout:
orientation: 'vertical'
canvas:
Color:
rgba: 1,1,1,1
Rectangle:
size: 60, 10
pos: 140, 240
Rectangle:
size: 60, 10
pos: 220, 240
Rectangle:
size: 140, 10
pos: 140, 200
Rectangle:
size: 140, 10
pos: 140, 160
Rectangle:
size: 140, 10
pos: 140, 120
Rectangle:
size: 60, 10
pos: 140, 80
Rectangle:
size: 60, 10
pos: 220, 80
Rectangle:
size: 60, 10
pos: 140, 40
Rectangle:
size: 60, 10
pos: 220, 40
BoxLayout:
orientation: 'vertical'
Label:
text: '上六咸其辅颊舌'
font_name: './yahei.ttf'
Label:
text: '九五咸其脢无悔'
font_name: './yahei.ttf'
Label:
text: '九四贞吉悔亡憧憧往来朋従尔思'
font_name: './yahei.ttf'
Label:
text: '九三咸其股执其随往吝'
font_name: './yahei.ttf'
Label:
text: '六二咸其腓凶居吉'
font_name: './yahei.ttf'
Label:
text: '初六咸其拇'
font_name: './yahei.ttf'
<Screen56>:
name: '56'
BoxLayout:
orientation: 'vertical'
padding: [10,40,40,30]
BoxLayout:
size_hint_y: .3
Label:
text:''
font_name: './yahei.ttf'
font_size: 60
markup: True
Button:
background_normal: ''
background_color: 0,0,0,0
text: '旅'
font_size: 60
font_name: './yahei.ttf'
on_release:
root.manager.current = 'menu'
root.manager.transition.direction = 'right'
Button:
background_normal: ''
background_color: 0,0,0,0
text: '飞鸟树上垒窝巢\\n小人使计举火烧\\n君占此卦为不吉\\n一切谋望枉徒劳'
font_name: './yahei.ttf'
BoxLayout:
Image:
id: 56
source: '56.png'
allow_stretch: False
Label:
text: '旅小亨旅贞吉'
font_name: './yahei.ttf'
BoxLayout:
BoxLayout:
orientation: 'vertical'
canvas:
Color:
rgba: 1,1,1,1
Rectangle:
size: 140, 10
pos: 140, 240
Rectangle:
size: 60, 10
pos: 140, 200
Rectangle:
size: 60, 10
pos: 220, 200
Rectangle:
size: 140, 10
pos: 140, 160
Rectangle:
size: 140, 10
pos: 140, 120
Rectangle:
size: 60, 10
pos: 140, 80
Rectangle:
size: 60, 10
pos: 220, 80
Rectangle:
size: 60, 10
pos: 140, 40
Rectangle:
size: 60, 10
pos: 220, 40
BoxLayout:
orientation: 'vertical'
Label:
text: '上九鸟焚其巢旅人先笑后号咷丧牛于易凶'
font_name: './yahei.ttf'
Label:
text: '六五射雉一矢亡终以誉命'
font_name: './yahei.ttf'
Label:
text: '九四旅于处得其资斧我心不快'
font_name: './yahei.ttf'
Label:
text: '九三旅焚其次丧其童仆贞厉'
font_name: './yahei.ttf'
Label:
text: '六二旅即次怀其资得童仆贞'
font_name: './yahei.ttf'
Label:
text: '初六旅琐琐斯其所取灾'
font_name: './yahei.ttf'
<Screen62>:
name: '62'
BoxLayout:
orientation: 'vertical'
padding: [10,40,40,30]
BoxLayout:
size_hint_y: .3
Label:
text:''
font_name: './yahei.ttf'
font_size: 60
markup: True
Button:
background_normal: ''
background_color: 0,0,0,0
text: '小过'
font_size: 60
font_name: './yahei.ttf'
on_release:
root.manager.current = 'menu'
root.manager.transition.direction = 'right'
Button:
background_normal: ''
background_color: 0,0,0,0
text: '行人路过独木桥\\n心内惶恐眼里瞧\\n爽利保保过得去\\n慢行一定不安牢'
font_name: './yahei.ttf'
BoxLayout:
Image:
id: 62
source: '62.png'
allow_stretch: False
Label:
text: '小过亨利贞可小事不可大事飞鸟遗之音不宜上宜下大吉'
font_name: './yahei.ttf'
BoxLayout:
BoxLayout:
orientation: 'vertical'
canvas:
Color:
rgba: 1,1,1,1
Rectangle:
size: 60, 10
pos: 140, 240
Rectangle:
size: 60, 10
pos: 220, 240
Rectangle:
size: 60, 10
pos: 140, 200
Rectangle:
size: 60, 10
pos: 220, 200
Rectangle:
size: 140, 10
pos: 140, 160
Rectangle:
size: 140, 10
pos: 140, 120
Rectangle:
size: 60, 10
pos: 140, 80
Rectangle:
size: 60, 10
pos: 220, 80
Rectangle:
size: 60, 10
pos: 140, 40
Rectangle:
size: 60, 10
pos: 220, 40
BoxLayout:
orientation: 'vertical'
Label:
text: '上六弗遇过之飞鸟离之凶是谓灾眚'
font_name: './yahei.ttf'
Label:
text: '六五密云不雨自我西郊公弋取彼在穴'
font_name: './yahei.ttf'
Label:
text: '九四无咎弗过遇之往厉必戒勿用永贞'
font_name: './yahei.ttf'
Label:
text: '九三弗过防之従或戕之凶'
font_name: './yahei.ttf'
Label:
text: '六二过其祖遇其妣不及其君遇其臣无咎'
font_name: './yahei.ttf'
Label:
text: '初六飞鸟以凶'
font_name: './yahei.ttf'
<Screen53>:
name: '53'
BoxLayout:
orientation: 'vertical'
padding: [10,40,40,30]
BoxLayout:
size_hint_y: .3
Label:
text:''
font_name: './yahei.ttf'
font_size: 60
markup: True
Button:
background_normal: ''
background_color: 0,0,0,0
text: '渐'
font_size: 60
font_name: './yahei.ttf'
on_release:
root.manager.current = 'menu'
root.manager.transition.direction = 'right'
Button:
background_normal: ''
background_color: 0,0,0,0
text: '俊鸟幸得出笼中\\n脱离灾难显威风\\n一朝得意福力至\\n东西南北任意行'
font_name: './yahei.ttf'
BoxLayout:
Image:
id: 53
source: '53.png'
allow_stretch: False
Label:
text: '渐女归吉利贞'
font_name: './yahei.ttf'
BoxLayout:
BoxLayout:
orientation: 'vertical'
canvas:
Color:
rgba: 1,1,1,1
Rectangle:
size: 140, 10
pos: 140, 240
Rectangle:
size: 140, 10
pos: 140, 200
Rectangle:
size: 60, 10
pos: 140, 160
Rectangle:
size: 60, 10
pos: 220, 160
Rectangle:
size: 140, 10
pos: 140, 120
Rectangle:
size: 60, 10
pos: 140, 80
Rectangle:
size: 60, 10
pos: 220, 80
Rectangle:
size: 60, 10
pos: 140, 40
Rectangle:
size: 60, 10
pos: 220, 40
BoxLayout:
orientation: 'vertical'
Label:
text: '上九鸿渐于陆其羽可用为仪吉'
font_name: './yahei.ttf'
Label:
text: '九五鸿渐于陵妇三岁不孕终莫之胜吉'
font_name: './yahei.ttf'
Label:
text: '六四鸿渐于木或得其桷无咎'
font_name: './yahei.ttf'
Label:
text: '九三鸿渐于陆夫征不复妇孕不育凶利御寇'
font_name: './yahei.ttf'
Label:
text: '六二鸿渐于磐饮食衎衎吉'
font_name: './yahei.ttf'
Label:
text: '初六鸿渐于干小子厉有言无咎'
font_name: './yahei.ttf'
<Screen39>:
name: '39'
BoxLayout:
orientation: 'vertical'
padding: [10,40,40,30]
BoxLayout:
size_hint_y: .3
Label:
text:''
font_name: './yahei.ttf'
font_size: 60
markup: True
Button:
background_normal: ''
background_color: 0,0,0,0
text: '蹇'
font_size: 60
font_name: './yahei.ttf'
on_release:
root.manager.current = 'menu'
root.manager.transition.direction = 'right'
Button:
background_normal: ''
background_color: 0,0,0,0
text: '大雨倾地雪满天\\n路上行人苦又寒\\n拖泥带水费尽力\\n事不遂心且耐烦'
font_name: './yahei.ttf'
BoxLayout:
Image:
id: 39
source: '39.png'
allow_stretch: False
Label:
text: '蹇利西南不利东北利见大人贞吉'
font_name: './yahei.ttf'
BoxLayout:
BoxLayout:
orientation: 'vertical'
canvas:
Color:
rgba: 1,1,1,1
Rectangle:
size: 60, 10
pos: 140, 240
Rectangle:
size: 60, 10
pos: 220, 240
Rectangle:
size: 140, 10
pos: 140, 200
Rectangle:
size: 60, 10
pos: 140, 160
Rectangle:
size: 60, 10
pos: 220, 160
Rectangle:
size: 140, 10
pos: 140, 120
Rectangle:
size: 60, 10
pos: 140, 80
Rectangle:
size: 60, 10
pos: 220, 80
Rectangle:
size: 60, 10
pos: 140, 40
Rectangle:
size: 60, 10
pos: 220, 40
BoxLayout:
orientation: 'vertical'
Label:
text: '上六往蹇来硕吉利见大人'
font_name: './yahei.ttf'
Label:
text: '九五大蹇朋来'
font_name: './yahei.ttf'
Label:
text: '六四往蹇来连'
font_name: './yahei.ttf'
Label:
text: '九三往蹇来反'
font_name: './yahei.ttf'
Label:
text: '六二王臣蹇蹇匪躬之故'
font_name: './yahei.ttf'
Label:
text: '初六往蹇来誉'
font_name: './yahei.ttf'
<Screen52>:
name: '52'
BoxLayout:
orientation: 'vertical'
padding: [10,40,40,30]
BoxLayout:
size_hint_y: .3
Label:
text:''
font_name: './yahei.ttf'
font_size: 60
markup: True
Button:
background_normal: ''
background_color: 0,0,0,0
text: '艮'
font_size: 60
font_name: './yahei.ttf'
on_release:
root.manager.current = 'menu'
root.manager.transition.direction = 'right'
Button:
background_normal: ''
background_color: 0,0,0,0
text: '财帛常打心头走\\n可惜眼前难到手\\n不如意时且忍耐\\n逢着闲事休开口'
font_name: './yahei.ttf'
BoxLayout:
Image:
id: 52
source: '52.png'
allow_stretch: False
Label:
text: '艮其背不获其身行其庭不见其人无咎'
font_name: './yahei.ttf'
BoxLayout:
BoxLayout:
orientation: 'vertical'
canvas:
Color:
rgba: 1,1,1,1
Rectangle:
size: 140, 10
pos: 140, 240
Rectangle:
size: 60, 10
pos: 140, 200
Rectangle:
size: 60, 10
pos: 220, 200
Rectangle:
size: 60, 10
pos: 140, 160
Rectangle:
size: 60, 10
pos: 220, 160
Rectangle:
size: 140, 10
pos: 140, 120
Rectangle:
size: 60, 10
pos: 140, 80
Rectangle:
size: 60, 10
pos: 220, 80
Rectangle:
size: 60, 10
pos: 140, 40
Rectangle:
size: 60, 10
pos: 220, 40
BoxLayout:
orientation: 'vertical'
Label:
text: '上九敦艮吉'
font_name: './yahei.ttf'
Label:
text: '六五艮其辅言有序悔亡'
font_name: './yahei.ttf'
Label:
text: '六四艮其身无咎'
font_name: './yahei.ttf'
Label:
text: '九三艮其限列其夤厉熏心'
font_name: './yahei.ttf'
Label:
text: '六二艮其腓不拯其随其心不快'
font_name: './yahei.ttf'
Label:
text: '初六艮其趾无咎利永贞'
font_name: './yahei.ttf'
<Screen15>:
name: '15'
BoxLayout:
orientation: 'vertical'
padding: [10,40,40,30]
BoxLayout:
size_hint_y: .3
Label:
text:''
font_name: './yahei.ttf'
font_size: 60
markup: True
Button:
background_normal: ''
background_color: 0,0,0,0
text: '谦'
font_size: 60
font_name: './yahei.ttf'
on_release:
root.manager.current = 'menu'
root.manager.transition.direction = 'right'
Button:
background_normal: ''
background_color: 0,0,0,0
text: '天赐贫人一封金\\n不争不抢两平分\\n彼此分得金到手\\n一切谋望皆遂心'
font_name: './yahei.ttf'
BoxLayout:
Image:
id: 15
source: '15.png'
allow_stretch: False
Label:
text: '谦亨君子有终'
font_name: './yahei.ttf'
BoxLayout:
BoxLayout:
orientation: 'vertical'
canvas:
Color:
rgba: 1,1,1,1
Rectangle:
size: 60, 10
pos: 140, 240
Rectangle:
size: 60, 10
pos: 220, 240
Rectangle:
size: 60, 10
pos: 140, 200
Rectangle:
size: 60, 10
pos: 220, 200
Rectangle:
size: 60, 10
pos: 140, 160
Rectangle:
size: 60, 10
pos: 220, 160
Rectangle:
size: 140, 10
pos: 140, 120
Rectangle:
size: 60, 10
pos: 140, 80
Rectangle:
size: 60, 10
pos: 220, 80
Rectangle:
size: 60, 10
pos: 140, 40
Rectangle:
size: 60, 10
pos: 220, 40
BoxLayout:
orientation: 'vertical'
Label:
text: '上六鸣谦利用行师征邑国'
font_name: './yahei.ttf'
Label:
text: '六五不富以其邻利用侵伐无不利'
font_name: './yahei.ttf'
Label:
text: '六四无不利捴谦'
font_name: './yahei.ttf'
Label:
text: '九三劳谦君子有终吉'
font_name: './yahei.ttf'
Label:
text: '六二鸣谦贞吉'
font_name: './yahei.ttf'
Label:
text: '初六谦谦君子用涉大川吉'
font_name: './yahei.ttf'
<Screen12>:
name: '12'
BoxLayout:
orientation: 'vertical'
padding: [10,40,40,30]
BoxLayout:
size_hint_y: .3
Label:
text:'七月\\n立秋\\n猴'
font_name: './yahei.ttf'
markup: True
Button:
background_normal: ''
background_color: 0,0,0,0
text: '否'
font_size: 60
font_name: './yahei.ttf'
on_release:
root.manager.current = 'menu'
root.manager.transition.direction = 'right'
Button:
background_normal: ''
background_color: 0,0,0,0
text: '虎落陷坑不堪言\\n进前容易退后难\\n谋望不遂自己便\\n疾病口舌事牵连'
font_name: './yahei.ttf'
BoxLayout:
Image:
id: 12
source: '12.png'
allow_stretch: False
Label:
text: '否之匪人不利君子貞大往小來'
font_name: './yahei.ttf'
BoxLayout:
BoxLayout:
orientation: 'vertical'
canvas:
Color:
rgba: 1,1,1,1
Rectangle:
size: 140, 10
pos: 140, 240
Rectangle:
size: 140, 10
pos: 140, 200
Rectangle:
size: 140, 10
pos: 140, 160
Rectangle:
size: 60, 10
pos: 140, 120
| 30.29935
| 63
| 0.330914
| 4,291
| 60,629
| 4.582848
| 0.07877
| 0.081363
| 0.132215
| 0.162726
| 0.847089
| 0.847089
| 0.690465
| 0.65792
| 0.65792
| 0.65792
| 0
| 0.103967
| 0.594666
| 60,629
| 2,000
| 64
| 30.3145
| 0.696236
| 0
| 0
| 0.852561
| 0
| 0
| 0.088423
| 0.013673
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0
| null | null | 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 1
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 7
|
ab5fda66652c3d24b1429a51fab6de22cfa11194
| 154
|
py
|
Python
|
LegacyCode/quantmark/vqe/__init__.py
|
QuantMarkFramework/LibMark
|
1fcf2107d97e11c9b91be7e59bfa2f78cf953a0e
|
[
"MIT"
] | 1
|
2021-03-04T13:00:07.000Z
|
2021-03-04T13:00:07.000Z
|
LegacyCode/quantmark/vqe/__init__.py
|
QuantMarkFramework/LibMark
|
1fcf2107d97e11c9b91be7e59bfa2f78cf953a0e
|
[
"MIT"
] | 13
|
2021-02-25T13:42:33.000Z
|
2021-05-10T16:22:07.000Z
|
LegacyCode/quantmark/vqe/__init__.py
|
QuantMarkFramework/LibMark
|
1fcf2107d97e11c9b91be7e59bfa2f78cf953a0e
|
[
"MIT"
] | 1
|
2021-05-19T10:23:45.000Z
|
2021-05-19T10:23:45.000Z
|
from quantmark.vqe.vqe_benchmark import vqe_benchmark
from quantmark.vqe.vqe_result import VQEResult
from quantmark.vqe.vqe_algorithm import VQEAlgorithm
| 38.5
| 53
| 0.883117
| 22
| 154
| 6
| 0.409091
| 0.295455
| 0.363636
| 0.431818
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.077922
| 154
| 3
| 54
| 51.333333
| 0.929577
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 8
|
db681c2a2677206771f5b290559834de769aa9e5
| 7,676
|
py
|
Python
|
engineer/datasets/loader/build_loader.py
|
lingtengqiu/Open-PIFuhd
|
3a66b647bcf5591e818af62735e64a93c4aaef85
|
[
"MIT"
] | 191
|
2021-03-18T08:09:06.000Z
|
2022-03-21T05:48:02.000Z
|
engineer/datasets/loader/build_loader.py
|
lingtengqiu/Open-PIFuhd
|
3a66b647bcf5591e818af62735e64a93c4aaef85
|
[
"MIT"
] | 9
|
2021-03-18T10:34:25.000Z
|
2022-01-05T19:22:48.000Z
|
engineer/datasets/loader/build_loader.py
|
lingtengqiu/Open-PIFuhd
|
3a66b647bcf5591e818af62735e64a93c4aaef85
|
[
"MIT"
] | 26
|
2021-03-18T08:09:08.000Z
|
2022-03-28T01:07:19.000Z
|
'''
@author: lingteng qiu
@version:1.0
'''
from einops import rearrange
import torch
import torchvision.transforms as transforms
def train_fine_pifu_loader_collate_fn(batches):
'''collection function of dataloder for training
'''
img_list = []
calib_list = []
samples_list = []
labels_list = []
name_list = []
front_normal = []
back_normal = []
crop_img = []
crop_front_normal = []
crop_back_normal = []
crop_query_points_list = []
for batch in batches:
name = batch['name']
image_tensor = batch['img']
calib_tensor = batch['calib']
sample_tensor = batch['samples']
label_tensor = batch['labels']
front_normal_tensor = batch['front_normal']
back_normal_tensor = batch['back_normal']
img_list.append(image_tensor)
calib_list.append(calib_tensor)
samples_list.append(rearrange(sample_tensor,'d n -> 1 d n'))
labels_list.append( rearrange(label_tensor,'d n -> 1 d n'))
name_list.append(name)
front_normal.append(front_normal_tensor)
back_normal.append(back_normal_tensor)
#crop infos
crop_query_points = batch['crop_pts']
crop_query_points_list.append(rearrange(crop_query_points,'d n -> 1 d n'))
crop_image_tensor = batch['crop_img']
crop_front_normal_tensor = batch['crop_front_normal']
crop_back_normal_tensor = batch['crop_back_normal']
crop_img.append(crop_image_tensor)
crop_front_normal.append(crop_front_normal_tensor)
crop_back_normal.append(crop_back_normal_tensor)
imgs = torch.cat(img_list,dim=0)
calibs = torch.cat(calib_list,dim=0)
samples = torch.cat(samples_list,dim=0)
labels = torch.cat(labels_list,dim=0)
front_normal = torch.cat(front_normal,dim = 0)
back_normal = torch.cat(back_normal,dim = 0)
#crop_infos
crop_query_points = torch.cat(crop_query_points_list,dim=0)
crop_img = torch.cat(crop_img,dim=0)
crop_front_normal = torch.cat(crop_front_normal,dim = 0)
crop_back_normal = torch.cat(crop_back_normal,dim = 0)
return dict(name=name_list,img=imgs,calib=calibs,samples=samples,labels=labels, front_normal = front_normal,back_normal =back_normal, \
crop_img = crop_img,crop_front_normal = crop_front_normal,crop_back_normal = crop_back_normal,crop_query_points=crop_query_points)
def test_fine_pifu_loader_collate_fn(batches):
'''collection function of dataloder for training
'''
img_list = []
calib_list = []
samples_list = []
labels_list = []
name_list = []
front_normal = []
back_normal = []
crop_img = []
crop_front_normal = []
crop_back_normal = []
crop_query_points_list = []
for batch in batches:
name = batch['name']
image_tensor = batch['img']
calib_tensor = batch['calib']
sample_tensor = batch['samples']
label_tensor = batch['labels']
front_normal_tensor = batch['front_normal']
back_normal_tensor = batch['back_normal']
img_list.append(image_tensor)
calib_list.append(calib_tensor)
samples_list.append(rearrange(sample_tensor,'d n -> 1 d n'))
labels_list.append( rearrange(label_tensor,'d n -> 1 d n'))
name_list.append(name)
front_normal.append(front_normal_tensor)
back_normal.append(back_normal_tensor)
#crop infos
crop_query_points = batch['crop_pts']
crop_query_points_list.append(rearrange(crop_query_points,'d n -> 1 d n'))
crop_image_tensor = batch['crop_img']
crop_front_normal_tensor = batch['crop_front_normal']
crop_back_normal_tensor = batch['crop_back_normal']
crop_img.append(crop_image_tensor)
crop_front_normal.append(crop_front_normal_tensor)
crop_back_normal.append(crop_back_normal_tensor)
imgs = torch.cat(img_list,dim=0)
calibs = torch.cat(calib_list,dim=0)
samples = torch.cat(samples_list,dim=0)
labels = torch.cat(labels_list,dim=0)
front_normal = torch.cat(front_normal,dim = 0)
back_normal = torch.cat(back_normal,dim = 0)
#crop_infos
crop_query_points = torch.cat(crop_query_points_list,dim=0)
crop_img = torch.cat(crop_img,dim=0)
crop_front_normal = torch.cat(crop_front_normal,dim = 0)
crop_back_normal = torch.cat(crop_back_normal,dim = 0)
return dict(name=name_list,img=imgs,calib=calibs,samples=samples,labels=labels, front_normal = front_normal,back_normal =back_normal, \
crop_img = crop_img,crop_front_normal = crop_front_normal,crop_back_normal = crop_back_normal,crop_query_points=crop_query_points)
def train_loader_collate_fn(batches):
'''collection function of dataloder for training
'''
img_list = []
calib_list = []
samples_list = []
labels_list = []
name_list = []
front_normal = []
back_normal = []
for batch in batches:
name = batch['name']
image_tensor = batch['img']
calib_tensor = batch['calib']
sample_tensor = batch['samples']
label_tensor = batch['labels']
front_normal_tensor = batch['front_normal']
back_normal_tensor = batch['back_normal']
img_list.append(image_tensor)
calib_list.append(calib_tensor)
samples_list.append(rearrange(sample_tensor,'d n -> 1 d n'))
labels_list.append( rearrange(label_tensor,'d n -> 1 d n'))
name_list.append(name)
front_normal.append(front_normal_tensor)
back_normal.append(back_normal_tensor)
imgs = torch.cat(img_list,dim=0)
calibs = torch.cat(calib_list,dim=0)
samples = torch.cat(samples_list,dim=0)
labels = torch.cat(labels_list,dim=0)
front_normal = torch.cat(front_normal,dim = 0)
back_normal = torch.cat(back_normal,dim = 0)
return dict(name=name_list,img=imgs,calib=calibs,samples=samples,labels=labels, front_normal = front_normal,back_normal =back_normal)
def test_loader_collate_fn(batches):
'''collection function of dataloder for testing
'''
img_list = []
calib_list = []
samples_list = []
labels_list = []
name_list = []
front_normal = []
back_normal = []
for batch in batches:
name = batch['name']
image_tensor = batch['img']
calib_tensor = batch['calib']
sample_tensor = batch['samples']
label_tensor = batch['labels']
front_normal_tensor = batch['front_normal']
back_normal_tensor = batch['back_normal']
img_list.append(image_tensor)
calib_list.append(calib_tensor)
samples_list.append(rearrange(sample_tensor,'d n -> 1 d n'))
labels_list.append( rearrange(label_tensor,'d n -> 1 d n'))
name_list.append(name)
front_normal.append(front_normal_tensor)
back_normal.append(back_normal_tensor)
imgs = torch.cat(img_list,dim=0)
calibs = torch.cat(calib_list,dim=0)
samples = torch.cat(samples_list,dim=0)
labels = torch.cat(labels_list,dim=0)
front_normal = torch.cat(front_normal,dim = 0)
back_normal = torch.cat(back_normal,dim = 0)
return dict(name=name_list,img=imgs,calib=calibs,samples=samples,labels=labels, front_normal = front_normal,back_normal =back_normal)
def carton_test_loader_collate_fn(batches):
'''collection function of dataloder for testing
'''
img_list = []
name_list = []
for batch in batches:
img = batch['img']
img_list.append(img)
name_list.append(batch['name'])
imgs = torch.cat(img_list,dim=0)
return dict(name=name_list,img=imgs)
| 31.719008
| 139
| 0.676133
| 1,046
| 7,676
| 4.627151
| 0.057361
| 0.122727
| 0.031405
| 0.052066
| 0.963223
| 0.958884
| 0.958884
| 0.954959
| 0.954959
| 0.948141
| 0
| 0.00747
| 0.215216
| 7,676
| 242
| 140
| 31.719008
| 0.795983
| 0.042731
| 0
| 0.927711
| 0
| 0
| 0.057022
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.03012
| false
| 0
| 0.018072
| 0
| 0.078313
| 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
|
db946d5f87f623c1841597e44766e4858e1396a8
| 680,993
|
py
|
Python
|
examples/python_pred_prey_grass/pyflamegpu/pyflamegpu.py
|
jcbpyle/FLAMEGPU2_example_template
|
5f5567611f13ee448f506cbd1813836112b07715
|
[
"MIT"
] | null | null | null |
examples/python_pred_prey_grass/pyflamegpu/pyflamegpu.py
|
jcbpyle/FLAMEGPU2_example_template
|
5f5567611f13ee448f506cbd1813836112b07715
|
[
"MIT"
] | null | null | null |
examples/python_pred_prey_grass/pyflamegpu/pyflamegpu.py
|
jcbpyle/FLAMEGPU2_example_template
|
5f5567611f13ee448f506cbd1813836112b07715
|
[
"MIT"
] | null | null | null |
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 4.0.2
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info as _swig_python_version_info
if _swig_python_version_info < (2, 7, 0):
raise RuntimeError("Python 2.7 or later required")
# Import the low-level C/C++ module
if __package__ or "." in __name__:
from . import _pyflamegpu
else:
import _pyflamegpu
try:
import builtins as __builtin__
except ImportError:
import __builtin__
def _swig_repr(self):
try:
strthis = "proxy of " + self.this.__repr__()
except __builtin__.Exception:
strthis = ""
return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
def _swig_setattr_nondynamic_instance_variable(set):
def set_instance_attr(self, name, value):
if name == "thisown":
self.this.own(value)
elif name == "this":
set(self, name, value)
elif hasattr(self, name) and isinstance(getattr(type(self), name), property):
set(self, name, value)
else:
raise AttributeError("You cannot add instance attributes to %s" % self)
return set_instance_attr
def _swig_setattr_nondynamic_class_variable(set):
def set_class_attr(cls, name, value):
if hasattr(cls, name) and not isinstance(getattr(cls, name), property):
set(cls, name, value)
else:
raise AttributeError("You cannot add class attributes to %s" % cls)
return set_class_attr
def _swig_add_metaclass(metaclass):
"""Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclass"""
def wrapper(cls):
return metaclass(cls.__name__, cls.__bases__, cls.__dict__.copy())
return wrapper
class _SwigNonDynamicMeta(type):
"""Meta class to enforce nondynamic attributes (no new attributes) for a class"""
__setattr__ = _swig_setattr_nondynamic_class_variable(type.__setattr__)
import weakref
class SwigPyIterator(object):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
def __init__(self, *args, **kwargs):
raise AttributeError("No constructor defined - class is abstract")
__repr__ = _swig_repr
__swig_destroy__ = _pyflamegpu.delete_SwigPyIterator
def value(self):
return _pyflamegpu.SwigPyIterator_value(self)
def incr(self, n=1):
return _pyflamegpu.SwigPyIterator_incr(self, n)
def decr(self, n=1):
return _pyflamegpu.SwigPyIterator_decr(self, n)
def distance(self, x):
return _pyflamegpu.SwigPyIterator_distance(self, x)
def equal(self, x):
return _pyflamegpu.SwigPyIterator_equal(self, x)
def copy(self):
return _pyflamegpu.SwigPyIterator_copy(self)
def next(self):
return _pyflamegpu.SwigPyIterator_next(self)
def __next__(self):
return _pyflamegpu.SwigPyIterator___next__(self)
def previous(self):
return _pyflamegpu.SwigPyIterator_previous(self)
def advance(self, n):
return _pyflamegpu.SwigPyIterator_advance(self, n)
def __eq__(self, x):
return _pyflamegpu.SwigPyIterator___eq__(self, x)
def __ne__(self, x):
return _pyflamegpu.SwigPyIterator___ne__(self, x)
def __iadd__(self, n):
return _pyflamegpu.SwigPyIterator___iadd__(self, n)
def __isub__(self, n):
return _pyflamegpu.SwigPyIterator___isub__(self, n)
def __add__(self, n):
return _pyflamegpu.SwigPyIterator___add__(self, n)
def __sub__(self, *args):
return _pyflamegpu.SwigPyIterator___sub__(self, *args)
def __iter__(self):
return self
# Register SwigPyIterator in _pyflamegpu:
_pyflamegpu.SwigPyIterator_swigregister(SwigPyIterator)
class Int8Vector(object):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def iterator(self):
return _pyflamegpu.Int8Vector_iterator(self)
def __iter__(self):
return self.iterator()
def __nonzero__(self):
return _pyflamegpu.Int8Vector___nonzero__(self)
def __bool__(self):
return _pyflamegpu.Int8Vector___bool__(self)
def __len__(self):
return _pyflamegpu.Int8Vector___len__(self)
def __getslice__(self, i, j):
return _pyflamegpu.Int8Vector___getslice__(self, i, j)
def __setslice__(self, *args):
return _pyflamegpu.Int8Vector___setslice__(self, *args)
def __delslice__(self, i, j):
return _pyflamegpu.Int8Vector___delslice__(self, i, j)
def __delitem__(self, *args):
return _pyflamegpu.Int8Vector___delitem__(self, *args)
def __getitem__(self, *args):
return _pyflamegpu.Int8Vector___getitem__(self, *args)
def __setitem__(self, *args):
return _pyflamegpu.Int8Vector___setitem__(self, *args)
def pop(self):
return _pyflamegpu.Int8Vector_pop(self)
def append(self, x):
return _pyflamegpu.Int8Vector_append(self, x)
def empty(self):
return _pyflamegpu.Int8Vector_empty(self)
def size(self):
return _pyflamegpu.Int8Vector_size(self)
def swap(self, v):
return _pyflamegpu.Int8Vector_swap(self, v)
def begin(self):
return _pyflamegpu.Int8Vector_begin(self)
def end(self):
return _pyflamegpu.Int8Vector_end(self)
def rbegin(self):
return _pyflamegpu.Int8Vector_rbegin(self)
def rend(self):
return _pyflamegpu.Int8Vector_rend(self)
def clear(self):
return _pyflamegpu.Int8Vector_clear(self)
def get_allocator(self):
return _pyflamegpu.Int8Vector_get_allocator(self)
def pop_back(self):
return _pyflamegpu.Int8Vector_pop_back(self)
def erase(self, *args):
return _pyflamegpu.Int8Vector_erase(self, *args)
def __init__(self, *args):
_pyflamegpu.Int8Vector_swiginit(self, _pyflamegpu.new_Int8Vector(*args))
def push_back(self, x):
return _pyflamegpu.Int8Vector_push_back(self, x)
def front(self):
return _pyflamegpu.Int8Vector_front(self)
def back(self):
return _pyflamegpu.Int8Vector_back(self)
def assign(self, n, x):
return _pyflamegpu.Int8Vector_assign(self, n, x)
def resize(self, *args):
return _pyflamegpu.Int8Vector_resize(self, *args)
def insert(self, *args):
return _pyflamegpu.Int8Vector_insert(self, *args)
def reserve(self, n):
return _pyflamegpu.Int8Vector_reserve(self, n)
def capacity(self):
return _pyflamegpu.Int8Vector_capacity(self)
__swig_destroy__ = _pyflamegpu.delete_Int8Vector
# Register Int8Vector in _pyflamegpu:
_pyflamegpu.Int8Vector_swigregister(Int8Vector)
class Int16Vector(object):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def iterator(self):
return _pyflamegpu.Int16Vector_iterator(self)
def __iter__(self):
return self.iterator()
def __nonzero__(self):
return _pyflamegpu.Int16Vector___nonzero__(self)
def __bool__(self):
return _pyflamegpu.Int16Vector___bool__(self)
def __len__(self):
return _pyflamegpu.Int16Vector___len__(self)
def __getslice__(self, i, j):
return _pyflamegpu.Int16Vector___getslice__(self, i, j)
def __setslice__(self, *args):
return _pyflamegpu.Int16Vector___setslice__(self, *args)
def __delslice__(self, i, j):
return _pyflamegpu.Int16Vector___delslice__(self, i, j)
def __delitem__(self, *args):
return _pyflamegpu.Int16Vector___delitem__(self, *args)
def __getitem__(self, *args):
return _pyflamegpu.Int16Vector___getitem__(self, *args)
def __setitem__(self, *args):
return _pyflamegpu.Int16Vector___setitem__(self, *args)
def pop(self):
return _pyflamegpu.Int16Vector_pop(self)
def append(self, x):
return _pyflamegpu.Int16Vector_append(self, x)
def empty(self):
return _pyflamegpu.Int16Vector_empty(self)
def size(self):
return _pyflamegpu.Int16Vector_size(self)
def swap(self, v):
return _pyflamegpu.Int16Vector_swap(self, v)
def begin(self):
return _pyflamegpu.Int16Vector_begin(self)
def end(self):
return _pyflamegpu.Int16Vector_end(self)
def rbegin(self):
return _pyflamegpu.Int16Vector_rbegin(self)
def rend(self):
return _pyflamegpu.Int16Vector_rend(self)
def clear(self):
return _pyflamegpu.Int16Vector_clear(self)
def get_allocator(self):
return _pyflamegpu.Int16Vector_get_allocator(self)
def pop_back(self):
return _pyflamegpu.Int16Vector_pop_back(self)
def erase(self, *args):
return _pyflamegpu.Int16Vector_erase(self, *args)
def __init__(self, *args):
_pyflamegpu.Int16Vector_swiginit(self, _pyflamegpu.new_Int16Vector(*args))
def push_back(self, x):
return _pyflamegpu.Int16Vector_push_back(self, x)
def front(self):
return _pyflamegpu.Int16Vector_front(self)
def back(self):
return _pyflamegpu.Int16Vector_back(self)
def assign(self, n, x):
return _pyflamegpu.Int16Vector_assign(self, n, x)
def resize(self, *args):
return _pyflamegpu.Int16Vector_resize(self, *args)
def insert(self, *args):
return _pyflamegpu.Int16Vector_insert(self, *args)
def reserve(self, n):
return _pyflamegpu.Int16Vector_reserve(self, n)
def capacity(self):
return _pyflamegpu.Int16Vector_capacity(self)
__swig_destroy__ = _pyflamegpu.delete_Int16Vector
# Register Int16Vector in _pyflamegpu:
_pyflamegpu.Int16Vector_swigregister(Int16Vector)
class Int32Vector(object):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def iterator(self):
return _pyflamegpu.Int32Vector_iterator(self)
def __iter__(self):
return self.iterator()
def __nonzero__(self):
return _pyflamegpu.Int32Vector___nonzero__(self)
def __bool__(self):
return _pyflamegpu.Int32Vector___bool__(self)
def __len__(self):
return _pyflamegpu.Int32Vector___len__(self)
def __getslice__(self, i, j):
return _pyflamegpu.Int32Vector___getslice__(self, i, j)
def __setslice__(self, *args):
return _pyflamegpu.Int32Vector___setslice__(self, *args)
def __delslice__(self, i, j):
return _pyflamegpu.Int32Vector___delslice__(self, i, j)
def __delitem__(self, *args):
return _pyflamegpu.Int32Vector___delitem__(self, *args)
def __getitem__(self, *args):
return _pyflamegpu.Int32Vector___getitem__(self, *args)
def __setitem__(self, *args):
return _pyflamegpu.Int32Vector___setitem__(self, *args)
def pop(self):
return _pyflamegpu.Int32Vector_pop(self)
def append(self, x):
return _pyflamegpu.Int32Vector_append(self, x)
def empty(self):
return _pyflamegpu.Int32Vector_empty(self)
def size(self):
return _pyflamegpu.Int32Vector_size(self)
def swap(self, v):
return _pyflamegpu.Int32Vector_swap(self, v)
def begin(self):
return _pyflamegpu.Int32Vector_begin(self)
def end(self):
return _pyflamegpu.Int32Vector_end(self)
def rbegin(self):
return _pyflamegpu.Int32Vector_rbegin(self)
def rend(self):
return _pyflamegpu.Int32Vector_rend(self)
def clear(self):
return _pyflamegpu.Int32Vector_clear(self)
def get_allocator(self):
return _pyflamegpu.Int32Vector_get_allocator(self)
def pop_back(self):
return _pyflamegpu.Int32Vector_pop_back(self)
def erase(self, *args):
return _pyflamegpu.Int32Vector_erase(self, *args)
def __init__(self, *args):
_pyflamegpu.Int32Vector_swiginit(self, _pyflamegpu.new_Int32Vector(*args))
def push_back(self, x):
return _pyflamegpu.Int32Vector_push_back(self, x)
def front(self):
return _pyflamegpu.Int32Vector_front(self)
def back(self):
return _pyflamegpu.Int32Vector_back(self)
def assign(self, n, x):
return _pyflamegpu.Int32Vector_assign(self, n, x)
def resize(self, *args):
return _pyflamegpu.Int32Vector_resize(self, *args)
def insert(self, *args):
return _pyflamegpu.Int32Vector_insert(self, *args)
def reserve(self, n):
return _pyflamegpu.Int32Vector_reserve(self, n)
def capacity(self):
return _pyflamegpu.Int32Vector_capacity(self)
__swig_destroy__ = _pyflamegpu.delete_Int32Vector
# Register Int32Vector in _pyflamegpu:
_pyflamegpu.Int32Vector_swigregister(Int32Vector)
class Int64Vector(object):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def iterator(self):
return _pyflamegpu.Int64Vector_iterator(self)
def __iter__(self):
return self.iterator()
def __nonzero__(self):
return _pyflamegpu.Int64Vector___nonzero__(self)
def __bool__(self):
return _pyflamegpu.Int64Vector___bool__(self)
def __len__(self):
return _pyflamegpu.Int64Vector___len__(self)
def __getslice__(self, i, j):
return _pyflamegpu.Int64Vector___getslice__(self, i, j)
def __setslice__(self, *args):
return _pyflamegpu.Int64Vector___setslice__(self, *args)
def __delslice__(self, i, j):
return _pyflamegpu.Int64Vector___delslice__(self, i, j)
def __delitem__(self, *args):
return _pyflamegpu.Int64Vector___delitem__(self, *args)
def __getitem__(self, *args):
return _pyflamegpu.Int64Vector___getitem__(self, *args)
def __setitem__(self, *args):
return _pyflamegpu.Int64Vector___setitem__(self, *args)
def pop(self):
return _pyflamegpu.Int64Vector_pop(self)
def append(self, x):
return _pyflamegpu.Int64Vector_append(self, x)
def empty(self):
return _pyflamegpu.Int64Vector_empty(self)
def size(self):
return _pyflamegpu.Int64Vector_size(self)
def swap(self, v):
return _pyflamegpu.Int64Vector_swap(self, v)
def begin(self):
return _pyflamegpu.Int64Vector_begin(self)
def end(self):
return _pyflamegpu.Int64Vector_end(self)
def rbegin(self):
return _pyflamegpu.Int64Vector_rbegin(self)
def rend(self):
return _pyflamegpu.Int64Vector_rend(self)
def clear(self):
return _pyflamegpu.Int64Vector_clear(self)
def get_allocator(self):
return _pyflamegpu.Int64Vector_get_allocator(self)
def pop_back(self):
return _pyflamegpu.Int64Vector_pop_back(self)
def erase(self, *args):
return _pyflamegpu.Int64Vector_erase(self, *args)
def __init__(self, *args):
_pyflamegpu.Int64Vector_swiginit(self, _pyflamegpu.new_Int64Vector(*args))
def push_back(self, x):
return _pyflamegpu.Int64Vector_push_back(self, x)
def front(self):
return _pyflamegpu.Int64Vector_front(self)
def back(self):
return _pyflamegpu.Int64Vector_back(self)
def assign(self, n, x):
return _pyflamegpu.Int64Vector_assign(self, n, x)
def resize(self, *args):
return _pyflamegpu.Int64Vector_resize(self, *args)
def insert(self, *args):
return _pyflamegpu.Int64Vector_insert(self, *args)
def reserve(self, n):
return _pyflamegpu.Int64Vector_reserve(self, n)
def capacity(self):
return _pyflamegpu.Int64Vector_capacity(self)
__swig_destroy__ = _pyflamegpu.delete_Int64Vector
# Register Int64Vector in _pyflamegpu:
_pyflamegpu.Int64Vector_swigregister(Int64Vector)
class UInt8Vector(object):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def iterator(self):
return _pyflamegpu.UInt8Vector_iterator(self)
def __iter__(self):
return self.iterator()
def __nonzero__(self):
return _pyflamegpu.UInt8Vector___nonzero__(self)
def __bool__(self):
return _pyflamegpu.UInt8Vector___bool__(self)
def __len__(self):
return _pyflamegpu.UInt8Vector___len__(self)
def __getslice__(self, i, j):
return _pyflamegpu.UInt8Vector___getslice__(self, i, j)
def __setslice__(self, *args):
return _pyflamegpu.UInt8Vector___setslice__(self, *args)
def __delslice__(self, i, j):
return _pyflamegpu.UInt8Vector___delslice__(self, i, j)
def __delitem__(self, *args):
return _pyflamegpu.UInt8Vector___delitem__(self, *args)
def __getitem__(self, *args):
return _pyflamegpu.UInt8Vector___getitem__(self, *args)
def __setitem__(self, *args):
return _pyflamegpu.UInt8Vector___setitem__(self, *args)
def pop(self):
return _pyflamegpu.UInt8Vector_pop(self)
def append(self, x):
return _pyflamegpu.UInt8Vector_append(self, x)
def empty(self):
return _pyflamegpu.UInt8Vector_empty(self)
def size(self):
return _pyflamegpu.UInt8Vector_size(self)
def swap(self, v):
return _pyflamegpu.UInt8Vector_swap(self, v)
def begin(self):
return _pyflamegpu.UInt8Vector_begin(self)
def end(self):
return _pyflamegpu.UInt8Vector_end(self)
def rbegin(self):
return _pyflamegpu.UInt8Vector_rbegin(self)
def rend(self):
return _pyflamegpu.UInt8Vector_rend(self)
def clear(self):
return _pyflamegpu.UInt8Vector_clear(self)
def get_allocator(self):
return _pyflamegpu.UInt8Vector_get_allocator(self)
def pop_back(self):
return _pyflamegpu.UInt8Vector_pop_back(self)
def erase(self, *args):
return _pyflamegpu.UInt8Vector_erase(self, *args)
def __init__(self, *args):
_pyflamegpu.UInt8Vector_swiginit(self, _pyflamegpu.new_UInt8Vector(*args))
def push_back(self, x):
return _pyflamegpu.UInt8Vector_push_back(self, x)
def front(self):
return _pyflamegpu.UInt8Vector_front(self)
def back(self):
return _pyflamegpu.UInt8Vector_back(self)
def assign(self, n, x):
return _pyflamegpu.UInt8Vector_assign(self, n, x)
def resize(self, *args):
return _pyflamegpu.UInt8Vector_resize(self, *args)
def insert(self, *args):
return _pyflamegpu.UInt8Vector_insert(self, *args)
def reserve(self, n):
return _pyflamegpu.UInt8Vector_reserve(self, n)
def capacity(self):
return _pyflamegpu.UInt8Vector_capacity(self)
__swig_destroy__ = _pyflamegpu.delete_UInt8Vector
# Register UInt8Vector in _pyflamegpu:
_pyflamegpu.UInt8Vector_swigregister(UInt8Vector)
class UInt16Vector(object):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def iterator(self):
return _pyflamegpu.UInt16Vector_iterator(self)
def __iter__(self):
return self.iterator()
def __nonzero__(self):
return _pyflamegpu.UInt16Vector___nonzero__(self)
def __bool__(self):
return _pyflamegpu.UInt16Vector___bool__(self)
def __len__(self):
return _pyflamegpu.UInt16Vector___len__(self)
def __getslice__(self, i, j):
return _pyflamegpu.UInt16Vector___getslice__(self, i, j)
def __setslice__(self, *args):
return _pyflamegpu.UInt16Vector___setslice__(self, *args)
def __delslice__(self, i, j):
return _pyflamegpu.UInt16Vector___delslice__(self, i, j)
def __delitem__(self, *args):
return _pyflamegpu.UInt16Vector___delitem__(self, *args)
def __getitem__(self, *args):
return _pyflamegpu.UInt16Vector___getitem__(self, *args)
def __setitem__(self, *args):
return _pyflamegpu.UInt16Vector___setitem__(self, *args)
def pop(self):
return _pyflamegpu.UInt16Vector_pop(self)
def append(self, x):
return _pyflamegpu.UInt16Vector_append(self, x)
def empty(self):
return _pyflamegpu.UInt16Vector_empty(self)
def size(self):
return _pyflamegpu.UInt16Vector_size(self)
def swap(self, v):
return _pyflamegpu.UInt16Vector_swap(self, v)
def begin(self):
return _pyflamegpu.UInt16Vector_begin(self)
def end(self):
return _pyflamegpu.UInt16Vector_end(self)
def rbegin(self):
return _pyflamegpu.UInt16Vector_rbegin(self)
def rend(self):
return _pyflamegpu.UInt16Vector_rend(self)
def clear(self):
return _pyflamegpu.UInt16Vector_clear(self)
def get_allocator(self):
return _pyflamegpu.UInt16Vector_get_allocator(self)
def pop_back(self):
return _pyflamegpu.UInt16Vector_pop_back(self)
def erase(self, *args):
return _pyflamegpu.UInt16Vector_erase(self, *args)
def __init__(self, *args):
_pyflamegpu.UInt16Vector_swiginit(self, _pyflamegpu.new_UInt16Vector(*args))
def push_back(self, x):
return _pyflamegpu.UInt16Vector_push_back(self, x)
def front(self):
return _pyflamegpu.UInt16Vector_front(self)
def back(self):
return _pyflamegpu.UInt16Vector_back(self)
def assign(self, n, x):
return _pyflamegpu.UInt16Vector_assign(self, n, x)
def resize(self, *args):
return _pyflamegpu.UInt16Vector_resize(self, *args)
def insert(self, *args):
return _pyflamegpu.UInt16Vector_insert(self, *args)
def reserve(self, n):
return _pyflamegpu.UInt16Vector_reserve(self, n)
def capacity(self):
return _pyflamegpu.UInt16Vector_capacity(self)
__swig_destroy__ = _pyflamegpu.delete_UInt16Vector
# Register UInt16Vector in _pyflamegpu:
_pyflamegpu.UInt16Vector_swigregister(UInt16Vector)
class UInt32Vector(object):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def iterator(self):
return _pyflamegpu.UInt32Vector_iterator(self)
def __iter__(self):
return self.iterator()
def __nonzero__(self):
return _pyflamegpu.UInt32Vector___nonzero__(self)
def __bool__(self):
return _pyflamegpu.UInt32Vector___bool__(self)
def __len__(self):
return _pyflamegpu.UInt32Vector___len__(self)
def __getslice__(self, i, j):
return _pyflamegpu.UInt32Vector___getslice__(self, i, j)
def __setslice__(self, *args):
return _pyflamegpu.UInt32Vector___setslice__(self, *args)
def __delslice__(self, i, j):
return _pyflamegpu.UInt32Vector___delslice__(self, i, j)
def __delitem__(self, *args):
return _pyflamegpu.UInt32Vector___delitem__(self, *args)
def __getitem__(self, *args):
return _pyflamegpu.UInt32Vector___getitem__(self, *args)
def __setitem__(self, *args):
return _pyflamegpu.UInt32Vector___setitem__(self, *args)
def pop(self):
return _pyflamegpu.UInt32Vector_pop(self)
def append(self, x):
return _pyflamegpu.UInt32Vector_append(self, x)
def empty(self):
return _pyflamegpu.UInt32Vector_empty(self)
def size(self):
return _pyflamegpu.UInt32Vector_size(self)
def swap(self, v):
return _pyflamegpu.UInt32Vector_swap(self, v)
def begin(self):
return _pyflamegpu.UInt32Vector_begin(self)
def end(self):
return _pyflamegpu.UInt32Vector_end(self)
def rbegin(self):
return _pyflamegpu.UInt32Vector_rbegin(self)
def rend(self):
return _pyflamegpu.UInt32Vector_rend(self)
def clear(self):
return _pyflamegpu.UInt32Vector_clear(self)
def get_allocator(self):
return _pyflamegpu.UInt32Vector_get_allocator(self)
def pop_back(self):
return _pyflamegpu.UInt32Vector_pop_back(self)
def erase(self, *args):
return _pyflamegpu.UInt32Vector_erase(self, *args)
def __init__(self, *args):
_pyflamegpu.UInt32Vector_swiginit(self, _pyflamegpu.new_UInt32Vector(*args))
def push_back(self, x):
return _pyflamegpu.UInt32Vector_push_back(self, x)
def front(self):
return _pyflamegpu.UInt32Vector_front(self)
def back(self):
return _pyflamegpu.UInt32Vector_back(self)
def assign(self, n, x):
return _pyflamegpu.UInt32Vector_assign(self, n, x)
def resize(self, *args):
return _pyflamegpu.UInt32Vector_resize(self, *args)
def insert(self, *args):
return _pyflamegpu.UInt32Vector_insert(self, *args)
def reserve(self, n):
return _pyflamegpu.UInt32Vector_reserve(self, n)
def capacity(self):
return _pyflamegpu.UInt32Vector_capacity(self)
__swig_destroy__ = _pyflamegpu.delete_UInt32Vector
# Register UInt32Vector in _pyflamegpu:
_pyflamegpu.UInt32Vector_swigregister(UInt32Vector)
class UInt64Vector(object):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def iterator(self):
return _pyflamegpu.UInt64Vector_iterator(self)
def __iter__(self):
return self.iterator()
def __nonzero__(self):
return _pyflamegpu.UInt64Vector___nonzero__(self)
def __bool__(self):
return _pyflamegpu.UInt64Vector___bool__(self)
def __len__(self):
return _pyflamegpu.UInt64Vector___len__(self)
def __getslice__(self, i, j):
return _pyflamegpu.UInt64Vector___getslice__(self, i, j)
def __setslice__(self, *args):
return _pyflamegpu.UInt64Vector___setslice__(self, *args)
def __delslice__(self, i, j):
return _pyflamegpu.UInt64Vector___delslice__(self, i, j)
def __delitem__(self, *args):
return _pyflamegpu.UInt64Vector___delitem__(self, *args)
def __getitem__(self, *args):
return _pyflamegpu.UInt64Vector___getitem__(self, *args)
def __setitem__(self, *args):
return _pyflamegpu.UInt64Vector___setitem__(self, *args)
def pop(self):
return _pyflamegpu.UInt64Vector_pop(self)
def append(self, x):
return _pyflamegpu.UInt64Vector_append(self, x)
def empty(self):
return _pyflamegpu.UInt64Vector_empty(self)
def size(self):
return _pyflamegpu.UInt64Vector_size(self)
def swap(self, v):
return _pyflamegpu.UInt64Vector_swap(self, v)
def begin(self):
return _pyflamegpu.UInt64Vector_begin(self)
def end(self):
return _pyflamegpu.UInt64Vector_end(self)
def rbegin(self):
return _pyflamegpu.UInt64Vector_rbegin(self)
def rend(self):
return _pyflamegpu.UInt64Vector_rend(self)
def clear(self):
return _pyflamegpu.UInt64Vector_clear(self)
def get_allocator(self):
return _pyflamegpu.UInt64Vector_get_allocator(self)
def pop_back(self):
return _pyflamegpu.UInt64Vector_pop_back(self)
def erase(self, *args):
return _pyflamegpu.UInt64Vector_erase(self, *args)
def __init__(self, *args):
_pyflamegpu.UInt64Vector_swiginit(self, _pyflamegpu.new_UInt64Vector(*args))
def push_back(self, x):
return _pyflamegpu.UInt64Vector_push_back(self, x)
def front(self):
return _pyflamegpu.UInt64Vector_front(self)
def back(self):
return _pyflamegpu.UInt64Vector_back(self)
def assign(self, n, x):
return _pyflamegpu.UInt64Vector_assign(self, n, x)
def resize(self, *args):
return _pyflamegpu.UInt64Vector_resize(self, *args)
def insert(self, *args):
return _pyflamegpu.UInt64Vector_insert(self, *args)
def reserve(self, n):
return _pyflamegpu.UInt64Vector_reserve(self, n)
def capacity(self):
return _pyflamegpu.UInt64Vector_capacity(self)
__swig_destroy__ = _pyflamegpu.delete_UInt64Vector
# Register UInt64Vector in _pyflamegpu:
_pyflamegpu.UInt64Vector_swigregister(UInt64Vector)
class FloatVector(object):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def iterator(self):
return _pyflamegpu.FloatVector_iterator(self)
def __iter__(self):
return self.iterator()
def __nonzero__(self):
return _pyflamegpu.FloatVector___nonzero__(self)
def __bool__(self):
return _pyflamegpu.FloatVector___bool__(self)
def __len__(self):
return _pyflamegpu.FloatVector___len__(self)
def __getslice__(self, i, j):
return _pyflamegpu.FloatVector___getslice__(self, i, j)
def __setslice__(self, *args):
return _pyflamegpu.FloatVector___setslice__(self, *args)
def __delslice__(self, i, j):
return _pyflamegpu.FloatVector___delslice__(self, i, j)
def __delitem__(self, *args):
return _pyflamegpu.FloatVector___delitem__(self, *args)
def __getitem__(self, *args):
return _pyflamegpu.FloatVector___getitem__(self, *args)
def __setitem__(self, *args):
return _pyflamegpu.FloatVector___setitem__(self, *args)
def pop(self):
return _pyflamegpu.FloatVector_pop(self)
def append(self, x):
return _pyflamegpu.FloatVector_append(self, x)
def empty(self):
return _pyflamegpu.FloatVector_empty(self)
def size(self):
return _pyflamegpu.FloatVector_size(self)
def swap(self, v):
return _pyflamegpu.FloatVector_swap(self, v)
def begin(self):
return _pyflamegpu.FloatVector_begin(self)
def end(self):
return _pyflamegpu.FloatVector_end(self)
def rbegin(self):
return _pyflamegpu.FloatVector_rbegin(self)
def rend(self):
return _pyflamegpu.FloatVector_rend(self)
def clear(self):
return _pyflamegpu.FloatVector_clear(self)
def get_allocator(self):
return _pyflamegpu.FloatVector_get_allocator(self)
def pop_back(self):
return _pyflamegpu.FloatVector_pop_back(self)
def erase(self, *args):
return _pyflamegpu.FloatVector_erase(self, *args)
def __init__(self, *args):
_pyflamegpu.FloatVector_swiginit(self, _pyflamegpu.new_FloatVector(*args))
def push_back(self, x):
return _pyflamegpu.FloatVector_push_back(self, x)
def front(self):
return _pyflamegpu.FloatVector_front(self)
def back(self):
return _pyflamegpu.FloatVector_back(self)
def assign(self, n, x):
return _pyflamegpu.FloatVector_assign(self, n, x)
def resize(self, *args):
return _pyflamegpu.FloatVector_resize(self, *args)
def insert(self, *args):
return _pyflamegpu.FloatVector_insert(self, *args)
def reserve(self, n):
return _pyflamegpu.FloatVector_reserve(self, n)
def capacity(self):
return _pyflamegpu.FloatVector_capacity(self)
__swig_destroy__ = _pyflamegpu.delete_FloatVector
# Register FloatVector in _pyflamegpu:
_pyflamegpu.FloatVector_swigregister(FloatVector)
class DoubleVector(object):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def iterator(self):
return _pyflamegpu.DoubleVector_iterator(self)
def __iter__(self):
return self.iterator()
def __nonzero__(self):
return _pyflamegpu.DoubleVector___nonzero__(self)
def __bool__(self):
return _pyflamegpu.DoubleVector___bool__(self)
def __len__(self):
return _pyflamegpu.DoubleVector___len__(self)
def __getslice__(self, i, j):
return _pyflamegpu.DoubleVector___getslice__(self, i, j)
def __setslice__(self, *args):
return _pyflamegpu.DoubleVector___setslice__(self, *args)
def __delslice__(self, i, j):
return _pyflamegpu.DoubleVector___delslice__(self, i, j)
def __delitem__(self, *args):
return _pyflamegpu.DoubleVector___delitem__(self, *args)
def __getitem__(self, *args):
return _pyflamegpu.DoubleVector___getitem__(self, *args)
def __setitem__(self, *args):
return _pyflamegpu.DoubleVector___setitem__(self, *args)
def pop(self):
return _pyflamegpu.DoubleVector_pop(self)
def append(self, x):
return _pyflamegpu.DoubleVector_append(self, x)
def empty(self):
return _pyflamegpu.DoubleVector_empty(self)
def size(self):
return _pyflamegpu.DoubleVector_size(self)
def swap(self, v):
return _pyflamegpu.DoubleVector_swap(self, v)
def begin(self):
return _pyflamegpu.DoubleVector_begin(self)
def end(self):
return _pyflamegpu.DoubleVector_end(self)
def rbegin(self):
return _pyflamegpu.DoubleVector_rbegin(self)
def rend(self):
return _pyflamegpu.DoubleVector_rend(self)
def clear(self):
return _pyflamegpu.DoubleVector_clear(self)
def get_allocator(self):
return _pyflamegpu.DoubleVector_get_allocator(self)
def pop_back(self):
return _pyflamegpu.DoubleVector_pop_back(self)
def erase(self, *args):
return _pyflamegpu.DoubleVector_erase(self, *args)
def __init__(self, *args):
_pyflamegpu.DoubleVector_swiginit(self, _pyflamegpu.new_DoubleVector(*args))
def push_back(self, x):
return _pyflamegpu.DoubleVector_push_back(self, x)
def front(self):
return _pyflamegpu.DoubleVector_front(self)
def back(self):
return _pyflamegpu.DoubleVector_back(self)
def assign(self, n, x):
return _pyflamegpu.DoubleVector_assign(self, n, x)
def resize(self, *args):
return _pyflamegpu.DoubleVector_resize(self, *args)
def insert(self, *args):
return _pyflamegpu.DoubleVector_insert(self, *args)
def reserve(self, n):
return _pyflamegpu.DoubleVector_reserve(self, n)
def capacity(self):
return _pyflamegpu.DoubleVector_capacity(self)
__swig_destroy__ = _pyflamegpu.delete_DoubleVector
# Register DoubleVector in _pyflamegpu:
_pyflamegpu.DoubleVector_swigregister(DoubleVector)
class FLAMEGPUIterator(object):
def __init__(self, pointerToVector):
self.pointerToVector = pointerToVector
self.index = -1
def __next__(self):
self.index += 1
if self.index < len(self.pointerToVector):
return self.pointerToVector[self.index]
else:
raise StopIteration
class UIntArray2(object):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def iterator(self):
return _pyflamegpu.UIntArray2_iterator(self)
def __iter__(self):
return self.iterator()
def __nonzero__(self):
return _pyflamegpu.UIntArray2___nonzero__(self)
def __bool__(self):
return _pyflamegpu.UIntArray2___bool__(self)
def __len__(self):
return _pyflamegpu.UIntArray2___len__(self)
def __getslice__(self, i, j):
return _pyflamegpu.UIntArray2___getslice__(self, i, j)
def __setslice__(self, *args):
return _pyflamegpu.UIntArray2___setslice__(self, *args)
def __delslice__(self, i, j):
return _pyflamegpu.UIntArray2___delslice__(self, i, j)
def __delitem__(self, *args):
return _pyflamegpu.UIntArray2___delitem__(self, *args)
def __getitem__(self, *args):
return _pyflamegpu.UIntArray2___getitem__(self, *args)
def __setitem__(self, *args):
return _pyflamegpu.UIntArray2___setitem__(self, *args)
def __init__(self, *args):
_pyflamegpu.UIntArray2_swiginit(self, _pyflamegpu.new_UIntArray2(*args))
def empty(self):
return _pyflamegpu.UIntArray2_empty(self)
def size(self):
return _pyflamegpu.UIntArray2_size(self)
def swap(self, v):
return _pyflamegpu.UIntArray2_swap(self, v)
def begin(self):
return _pyflamegpu.UIntArray2_begin(self)
def end(self):
return _pyflamegpu.UIntArray2_end(self)
def rbegin(self):
return _pyflamegpu.UIntArray2_rbegin(self)
def rend(self):
return _pyflamegpu.UIntArray2_rend(self)
def front(self):
return _pyflamegpu.UIntArray2_front(self)
def back(self):
return _pyflamegpu.UIntArray2_back(self)
def fill(self, u):
return _pyflamegpu.UIntArray2_fill(self, u)
__swig_destroy__ = _pyflamegpu.delete_UIntArray2
# Register UIntArray2 in _pyflamegpu:
_pyflamegpu.UIntArray2_swigregister(UIntArray2)
class UIntArray3(object):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def iterator(self):
return _pyflamegpu.UIntArray3_iterator(self)
def __iter__(self):
return self.iterator()
def __nonzero__(self):
return _pyflamegpu.UIntArray3___nonzero__(self)
def __bool__(self):
return _pyflamegpu.UIntArray3___bool__(self)
def __len__(self):
return _pyflamegpu.UIntArray3___len__(self)
def __getslice__(self, i, j):
return _pyflamegpu.UIntArray3___getslice__(self, i, j)
def __setslice__(self, *args):
return _pyflamegpu.UIntArray3___setslice__(self, *args)
def __delslice__(self, i, j):
return _pyflamegpu.UIntArray3___delslice__(self, i, j)
def __delitem__(self, *args):
return _pyflamegpu.UIntArray3___delitem__(self, *args)
def __getitem__(self, *args):
return _pyflamegpu.UIntArray3___getitem__(self, *args)
def __setitem__(self, *args):
return _pyflamegpu.UIntArray3___setitem__(self, *args)
def __init__(self, *args):
_pyflamegpu.UIntArray3_swiginit(self, _pyflamegpu.new_UIntArray3(*args))
def empty(self):
return _pyflamegpu.UIntArray3_empty(self)
def size(self):
return _pyflamegpu.UIntArray3_size(self)
def swap(self, v):
return _pyflamegpu.UIntArray3_swap(self, v)
def begin(self):
return _pyflamegpu.UIntArray3_begin(self)
def end(self):
return _pyflamegpu.UIntArray3_end(self)
def rbegin(self):
return _pyflamegpu.UIntArray3_rbegin(self)
def rend(self):
return _pyflamegpu.UIntArray3_rend(self)
def front(self):
return _pyflamegpu.UIntArray3_front(self)
def back(self):
return _pyflamegpu.UIntArray3_back(self)
def fill(self, u):
return _pyflamegpu.UIntArray3_fill(self, u)
__swig_destroy__ = _pyflamegpu.delete_UIntArray3
# Register UIntArray3 in _pyflamegpu:
_pyflamegpu.UIntArray3_swigregister(UIntArray3)
class FGPURuntimeException(Exception):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self, msg, type):
_pyflamegpu.FGPURuntimeException_swiginit(self, _pyflamegpu.new_FGPURuntimeException(msg, type))
def what(self):
return _pyflamegpu.FGPURuntimeException_what(self)
def type(self):
return _pyflamegpu.FGPURuntimeException_type(self)
def __str__(self):
return _pyflamegpu.FGPURuntimeException___str__(self)
__swig_destroy__ = _pyflamegpu.delete_FGPURuntimeException
# Register FGPURuntimeException in _pyflamegpu:
_pyflamegpu.FGPURuntimeException_swigregister(FGPURuntimeException)
def typeName(type):
return _pyflamegpu.typeName(type)
class IntType(object):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
@staticmethod
def size():
return _pyflamegpu.IntType_size()
@staticmethod
def typeName():
return _pyflamegpu.IntType_typeName()
@staticmethod
def empty():
return _pyflamegpu.IntType_empty()
@staticmethod
def fromValue(value):
return _pyflamegpu.IntType_fromValue(value)
def __init__(self):
_pyflamegpu.IntType_swiginit(self, _pyflamegpu.new_IntType())
__swig_destroy__ = _pyflamegpu.delete_IntType
# Register IntType in _pyflamegpu:
_pyflamegpu.IntType_swigregister(IntType)
def IntType_size():
return _pyflamegpu.IntType_size()
def IntType_typeName():
return _pyflamegpu.IntType_typeName()
def IntType_empty():
return _pyflamegpu.IntType_empty()
def IntType_fromValue(value):
return _pyflamegpu.IntType_fromValue(value)
class Int8Type(object):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
@staticmethod
def size():
return _pyflamegpu.Int8Type_size()
@staticmethod
def typeName():
return _pyflamegpu.Int8Type_typeName()
@staticmethod
def empty():
return _pyflamegpu.Int8Type_empty()
@staticmethod
def fromValue(value):
return _pyflamegpu.Int8Type_fromValue(value)
def __init__(self):
_pyflamegpu.Int8Type_swiginit(self, _pyflamegpu.new_Int8Type())
__swig_destroy__ = _pyflamegpu.delete_Int8Type
# Register Int8Type in _pyflamegpu:
_pyflamegpu.Int8Type_swigregister(Int8Type)
def Int8Type_size():
return _pyflamegpu.Int8Type_size()
def Int8Type_typeName():
return _pyflamegpu.Int8Type_typeName()
def Int8Type_empty():
return _pyflamegpu.Int8Type_empty()
def Int8Type_fromValue(value):
return _pyflamegpu.Int8Type_fromValue(value)
class Int16Type(object):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
@staticmethod
def size():
return _pyflamegpu.Int16Type_size()
@staticmethod
def typeName():
return _pyflamegpu.Int16Type_typeName()
@staticmethod
def empty():
return _pyflamegpu.Int16Type_empty()
@staticmethod
def fromValue(value):
return _pyflamegpu.Int16Type_fromValue(value)
def __init__(self):
_pyflamegpu.Int16Type_swiginit(self, _pyflamegpu.new_Int16Type())
__swig_destroy__ = _pyflamegpu.delete_Int16Type
# Register Int16Type in _pyflamegpu:
_pyflamegpu.Int16Type_swigregister(Int16Type)
def Int16Type_size():
return _pyflamegpu.Int16Type_size()
def Int16Type_typeName():
return _pyflamegpu.Int16Type_typeName()
def Int16Type_empty():
return _pyflamegpu.Int16Type_empty()
def Int16Type_fromValue(value):
return _pyflamegpu.Int16Type_fromValue(value)
class Int32Type(object):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
@staticmethod
def size():
return _pyflamegpu.Int32Type_size()
@staticmethod
def typeName():
return _pyflamegpu.Int32Type_typeName()
@staticmethod
def empty():
return _pyflamegpu.Int32Type_empty()
@staticmethod
def fromValue(value):
return _pyflamegpu.Int32Type_fromValue(value)
def __init__(self):
_pyflamegpu.Int32Type_swiginit(self, _pyflamegpu.new_Int32Type())
__swig_destroy__ = _pyflamegpu.delete_Int32Type
# Register Int32Type in _pyflamegpu:
_pyflamegpu.Int32Type_swigregister(Int32Type)
def Int32Type_size():
return _pyflamegpu.Int32Type_size()
def Int32Type_typeName():
return _pyflamegpu.Int32Type_typeName()
def Int32Type_empty():
return _pyflamegpu.Int32Type_empty()
def Int32Type_fromValue(value):
return _pyflamegpu.Int32Type_fromValue(value)
class Int64Type(object):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
@staticmethod
def size():
return _pyflamegpu.Int64Type_size()
@staticmethod
def typeName():
return _pyflamegpu.Int64Type_typeName()
@staticmethod
def empty():
return _pyflamegpu.Int64Type_empty()
@staticmethod
def fromValue(value):
return _pyflamegpu.Int64Type_fromValue(value)
def __init__(self):
_pyflamegpu.Int64Type_swiginit(self, _pyflamegpu.new_Int64Type())
__swig_destroy__ = _pyflamegpu.delete_Int64Type
# Register Int64Type in _pyflamegpu:
_pyflamegpu.Int64Type_swigregister(Int64Type)
def Int64Type_size():
return _pyflamegpu.Int64Type_size()
def Int64Type_typeName():
return _pyflamegpu.Int64Type_typeName()
def Int64Type_empty():
return _pyflamegpu.Int64Type_empty()
def Int64Type_fromValue(value):
return _pyflamegpu.Int64Type_fromValue(value)
class UIntType(object):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
@staticmethod
def size():
return _pyflamegpu.UIntType_size()
@staticmethod
def typeName():
return _pyflamegpu.UIntType_typeName()
@staticmethod
def empty():
return _pyflamegpu.UIntType_empty()
@staticmethod
def fromValue(value):
return _pyflamegpu.UIntType_fromValue(value)
def __init__(self):
_pyflamegpu.UIntType_swiginit(self, _pyflamegpu.new_UIntType())
__swig_destroy__ = _pyflamegpu.delete_UIntType
# Register UIntType in _pyflamegpu:
_pyflamegpu.UIntType_swigregister(UIntType)
def UIntType_size():
return _pyflamegpu.UIntType_size()
def UIntType_typeName():
return _pyflamegpu.UIntType_typeName()
def UIntType_empty():
return _pyflamegpu.UIntType_empty()
def UIntType_fromValue(value):
return _pyflamegpu.UIntType_fromValue(value)
class UInt8Type(object):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
@staticmethod
def size():
return _pyflamegpu.UInt8Type_size()
@staticmethod
def typeName():
return _pyflamegpu.UInt8Type_typeName()
@staticmethod
def empty():
return _pyflamegpu.UInt8Type_empty()
@staticmethod
def fromValue(value):
return _pyflamegpu.UInt8Type_fromValue(value)
def __init__(self):
_pyflamegpu.UInt8Type_swiginit(self, _pyflamegpu.new_UInt8Type())
__swig_destroy__ = _pyflamegpu.delete_UInt8Type
# Register UInt8Type in _pyflamegpu:
_pyflamegpu.UInt8Type_swigregister(UInt8Type)
def UInt8Type_size():
return _pyflamegpu.UInt8Type_size()
def UInt8Type_typeName():
return _pyflamegpu.UInt8Type_typeName()
def UInt8Type_empty():
return _pyflamegpu.UInt8Type_empty()
def UInt8Type_fromValue(value):
return _pyflamegpu.UInt8Type_fromValue(value)
class UInt16Type(object):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
@staticmethod
def size():
return _pyflamegpu.UInt16Type_size()
@staticmethod
def typeName():
return _pyflamegpu.UInt16Type_typeName()
@staticmethod
def empty():
return _pyflamegpu.UInt16Type_empty()
@staticmethod
def fromValue(value):
return _pyflamegpu.UInt16Type_fromValue(value)
def __init__(self):
_pyflamegpu.UInt16Type_swiginit(self, _pyflamegpu.new_UInt16Type())
__swig_destroy__ = _pyflamegpu.delete_UInt16Type
# Register UInt16Type in _pyflamegpu:
_pyflamegpu.UInt16Type_swigregister(UInt16Type)
def UInt16Type_size():
return _pyflamegpu.UInt16Type_size()
def UInt16Type_typeName():
return _pyflamegpu.UInt16Type_typeName()
def UInt16Type_empty():
return _pyflamegpu.UInt16Type_empty()
def UInt16Type_fromValue(value):
return _pyflamegpu.UInt16Type_fromValue(value)
class UInt32Type(object):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
@staticmethod
def size():
return _pyflamegpu.UInt32Type_size()
@staticmethod
def typeName():
return _pyflamegpu.UInt32Type_typeName()
@staticmethod
def empty():
return _pyflamegpu.UInt32Type_empty()
@staticmethod
def fromValue(value):
return _pyflamegpu.UInt32Type_fromValue(value)
def __init__(self):
_pyflamegpu.UInt32Type_swiginit(self, _pyflamegpu.new_UInt32Type())
__swig_destroy__ = _pyflamegpu.delete_UInt32Type
# Register UInt32Type in _pyflamegpu:
_pyflamegpu.UInt32Type_swigregister(UInt32Type)
def UInt32Type_size():
return _pyflamegpu.UInt32Type_size()
def UInt32Type_typeName():
return _pyflamegpu.UInt32Type_typeName()
def UInt32Type_empty():
return _pyflamegpu.UInt32Type_empty()
def UInt32Type_fromValue(value):
return _pyflamegpu.UInt32Type_fromValue(value)
class UInt64Type(object):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
@staticmethod
def size():
return _pyflamegpu.UInt64Type_size()
@staticmethod
def typeName():
return _pyflamegpu.UInt64Type_typeName()
@staticmethod
def empty():
return _pyflamegpu.UInt64Type_empty()
@staticmethod
def fromValue(value):
return _pyflamegpu.UInt64Type_fromValue(value)
def __init__(self):
_pyflamegpu.UInt64Type_swiginit(self, _pyflamegpu.new_UInt64Type())
__swig_destroy__ = _pyflamegpu.delete_UInt64Type
# Register UInt64Type in _pyflamegpu:
_pyflamegpu.UInt64Type_swigregister(UInt64Type)
def UInt64Type_size():
return _pyflamegpu.UInt64Type_size()
def UInt64Type_typeName():
return _pyflamegpu.UInt64Type_typeName()
def UInt64Type_empty():
return _pyflamegpu.UInt64Type_empty()
def UInt64Type_fromValue(value):
return _pyflamegpu.UInt64Type_fromValue(value)
class FloatType(object):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
@staticmethod
def size():
return _pyflamegpu.FloatType_size()
@staticmethod
def typeName():
return _pyflamegpu.FloatType_typeName()
@staticmethod
def empty():
return _pyflamegpu.FloatType_empty()
@staticmethod
def fromValue(value):
return _pyflamegpu.FloatType_fromValue(value)
def __init__(self):
_pyflamegpu.FloatType_swiginit(self, _pyflamegpu.new_FloatType())
__swig_destroy__ = _pyflamegpu.delete_FloatType
# Register FloatType in _pyflamegpu:
_pyflamegpu.FloatType_swigregister(FloatType)
def FloatType_size():
return _pyflamegpu.FloatType_size()
def FloatType_typeName():
return _pyflamegpu.FloatType_typeName()
def FloatType_empty():
return _pyflamegpu.FloatType_empty()
def FloatType_fromValue(value):
return _pyflamegpu.FloatType_fromValue(value)
class DoubleType(object):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
@staticmethod
def size():
return _pyflamegpu.DoubleType_size()
@staticmethod
def typeName():
return _pyflamegpu.DoubleType_typeName()
@staticmethod
def empty():
return _pyflamegpu.DoubleType_empty()
@staticmethod
def fromValue(value):
return _pyflamegpu.DoubleType_fromValue(value)
def __init__(self):
_pyflamegpu.DoubleType_swiginit(self, _pyflamegpu.new_DoubleType())
__swig_destroy__ = _pyflamegpu.delete_DoubleType
# Register DoubleType in _pyflamegpu:
_pyflamegpu.DoubleType_swigregister(DoubleType)
def DoubleType_size():
return _pyflamegpu.DoubleType_size()
def DoubleType_typeName():
return _pyflamegpu.DoubleType_typeName()
def DoubleType_empty():
return _pyflamegpu.DoubleType_empty()
def DoubleType_fromValue(value):
return _pyflamegpu.DoubleType_fromValue(value)
class HostFunctionCallback(object):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def run(self, arg0):
return _pyflamegpu.HostFunctionCallback_run(self, arg0)
__swig_destroy__ = _pyflamegpu.delete_HostFunctionCallback
def __init__(self):
if self.__class__ == HostFunctionCallback:
_self = None
else:
_self = self
_pyflamegpu.HostFunctionCallback_swiginit(self, _pyflamegpu.new_HostFunctionCallback(_self, ))
def __disown__(self):
self.this.disown()
_pyflamegpu.disown_HostFunctionCallback(self)
return weakref.proxy(self)
# Register HostFunctionCallback in _pyflamegpu:
_pyflamegpu.HostFunctionCallback_swigregister(HostFunctionCallback)
class HostFunctionConditionCallback(object):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def run(self, arg0):
return _pyflamegpu.HostFunctionConditionCallback_run(self, arg0)
__swig_destroy__ = _pyflamegpu.delete_HostFunctionConditionCallback
def __init__(self):
if self.__class__ == HostFunctionConditionCallback:
_self = None
else:
_self = self
_pyflamegpu.HostFunctionConditionCallback_swiginit(self, _pyflamegpu.new_HostFunctionConditionCallback(_self, ))
def __disown__(self):
self.this.disown()
_pyflamegpu.disown_HostFunctionConditionCallback(self)
return weakref.proxy(self)
# Register HostFunctionConditionCallback in _pyflamegpu:
_pyflamegpu.HostFunctionConditionCallback_swigregister(HostFunctionConditionCallback)
CONTINUE = _pyflamegpu.CONTINUE
EXIT = _pyflamegpu.EXIT
class DependencyNode(object):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
__swig_destroy__ = _pyflamegpu.delete_DependencyNode
def dependsOn(self, dep):
r"""
Specifies that this agent function depends on the completion of all of the provided functions
:param dependencyList: The host functions, agent functions and submodels which this depends on
"""
return _pyflamegpu.DependencyNode_dependsOn(self, dep)
def __init__(self):
_pyflamegpu.DependencyNode_swiginit(self, _pyflamegpu.new_DependencyNode())
# Register DependencyNode in _pyflamegpu:
_pyflamegpu.DependencyNode_swigregister(DependencyNode)
class DependencyGraph(object):
r"""
This class represents the dependency tree for agent functions, host functions and submodels. Each DependencyNode has its own dependencies/dependents, the purpose of this class is to
walk the dependency tree and provide utility such as validation/layering.
See also: DependencyNode
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self, *args):
r"""
*Overload 1:*
Constructors
|
*Overload 2:*
Used by ModelData for instantiation
|
*Overload 3:*
Deep copy
"""
_pyflamegpu.DependencyGraph_swiginit(self, _pyflamegpu.new_DependencyGraph(*args))
def __eq__(self, rhs):
r"""
Equality operator, checks whether DependencyGraphs are functionally the same, i.e, do they represent the same execution graph
:rtype: boolean
:return: True when both graphs represent the same execution graph
Notes: Instead compare pointers if you wish to check that they are the same instance
"""
return _pyflamegpu.DependencyGraph___eq__(self, rhs)
def addRoot(self, root):
r"""
Add an AgentFunctionDescription, host function or submodel as a root node
:type root: :py:class:`DependencyNode`
:param root: The function or submodel to add to the graph as a root
"""
return _pyflamegpu.DependencyGraph_addRoot(self, root)
def validateDependencyGraph(self):
r"""
Checks the dependency graph for cycles and validates that all agent functions belong to the same model
:rtype: boolean
:return: True when the graph is valid, i.e. it contains no cycles
"""
return _pyflamegpu.DependencyGraph_validateDependencyGraph(self)
def generateLayers(self, model):
r"""
Generates optimal layers based on the dependencies specified and adds them to the model
:type model: :py:class:`ModelDescription`
:param model: The model the layers should be added to
:raises: InvalidDependencyGraph if the model already has layers attached
"""
return _pyflamegpu.DependencyGraph_generateLayers(self, model)
def generateDOTDiagram(self, outputFileName):
r"""
Generates a .gv file containing the DOT representation of the dependencies specified
:type outputFileName: string
:param outputFileName: The name of the output file
"""
return _pyflamegpu.DependencyGraph_generateDOTDiagram(self, outputFileName)
def getConstructedLayersString(self):
r"""
Returns a string representation of the constructed layers
:rtype: string
:return: A string representation of the constructed layers
"""
return _pyflamegpu.DependencyGraph_getConstructedLayersString(self)
__swig_destroy__ = _pyflamegpu.delete_DependencyGraph
# Register DependencyGraph in _pyflamegpu:
_pyflamegpu.DependencyGraph_swigregister(DependencyGraph)
class HostFunctionDescription(DependencyNode):
r"""Within the model hierarchy, this class represents a host function for a FLAMEGPU model"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self, *args):
_pyflamegpu.HostFunctionDescription_swiginit(self, _pyflamegpu.new_HostFunctionDescription(*args))
def __eq__(self, rhs):
r"""
Equality operator, checks whether HostFunctionDescription hierarchies are functionally the same
:rtype: boolean
:return: True when agent functions are the same
Notes: Instead compare pointers if you wish to check that they are the same instance
"""
return _pyflamegpu.HostFunctionDescription___eq__(self, rhs)
def __ne__(self, rhs):
r"""
Equality operator, checks whether HostFunctionDescription hierarchies are functionally different
:rtype: boolean
:return: True when agent functions are not the same
Notes: Instead compare pointers if you wish to check that they are not the same instance
"""
return _pyflamegpu.HostFunctionDescription___ne__(self, rhs)
def getFunctionPtr(self):
r"""
:rtype: FLAMEGPU_HOST_FUNCTION_POINTER
:return: The cuda kernel entry point for executing the agent function
"""
return _pyflamegpu.HostFunctionDescription_getFunctionPtr(self)
def getCallbackObject(self):
return _pyflamegpu.HostFunctionDescription_getCallbackObject(self)
def getName(self):
return _pyflamegpu.HostFunctionDescription_getName(self)
__swig_destroy__ = _pyflamegpu.delete_HostFunctionDescription
# Register HostFunctionDescription in _pyflamegpu:
_pyflamegpu.HostFunctionDescription_swigregister(HostFunctionDescription)
class ModelDescription(object):
r"""
This class represents the hierarchy of components for a FLAMEGPU model
This is the initial class that should be created by a modeller
See also: ModelData The internal data store for this class
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self, model_name):
r"""
Constructor
:type model_name: string
:param model_name: Name of the model, this must be unique between models currently held by instances of CUDASimulation
"""
_pyflamegpu.ModelDescription_swiginit(self, _pyflamegpu.new_ModelDescription(model_name))
def __eq__(self, rhs):
r"""
Equality operator, checks whether ModelDescription hierarchies are functionally the same
:rtype: boolean
:return: True when models are the same
Notes: Instead compare pointers if you wish to check that they are the same instance
"""
return _pyflamegpu.ModelDescription___eq__(self, rhs)
def __ne__(self, rhs):
r"""
Equality operator, checks whether ModelDescription hierarchies are functionally different
:rtype: boolean
:return: True when models are not the same
Notes: Instead compare pointers if you wish to check that they are not the same instance
"""
return _pyflamegpu.ModelDescription___ne__(self, rhs)
def newAgent(self, agent_name):
r"""
Creates a new agent with the specified name
:type agent_name: string
:param agent_name: Name which can be used to refer to the agent within the model description hierarchy
:rtype: :py:class:`AgentDescription`
:return: A mutable reference to the specified AgentDescription
:raises: InvalidAgentName If an agent with the same name already exists within the model description hierarchy
"""
return _pyflamegpu.ModelDescription_newAgent(self, agent_name)
def Agent(self, agent_name):
r"""
Returns a mutable reference to the named agent, which can be used to configure the agent
:type agent_name: string
:param agent_name: Name which can be used to the refer to the desired agent within the model description hierarchy
:rtype: :py:class:`AgentDescription`
:return: A mutable reference to the specified AgentDescription
:raises: InvalidAgentName If an agent with the name does not exist within the model description hierarchy
See also: ModelDescription::getAgent(const std::string &) for the immutable version
"""
return _pyflamegpu.ModelDescription_Agent(self, agent_name)
def newMessage(self, message_name):
return _pyflamegpu.ModelDescription_newMessage(self, message_name)
def Message(self, message_name):
return _pyflamegpu.ModelDescription_Message(self, message_name)
def Environment(self):
r"""
Returns a mutable reference to the environment description for the model description hierarchy
This can be used to configure environment properties
See also: ModelDescription::getEnvironment() for the immutable version
"""
return _pyflamegpu.ModelDescription_Environment(self)
def newSubModel(self, submodel_name, submodel_description):
r"""
Add a submodel to the Model Description hierarchy
The return value can be used to map agent variables
:type submodel_name: string
:param submodel_name: The name used to refer to the submodel (e.g. when adding it to the layer)
:type submodel_description: :py:class:`ModelDescription`
:param submodel_description: The actual definition of the submodel
"""
return _pyflamegpu.ModelDescription_newSubModel(self, submodel_name, submodel_description)
def SubModel(self, submodel_name):
r"""
Returns a mutable reference to the named submodel
:type submodel_name: string
:param submodel_name: Name which can be used to the refer to the desired submodel within the model description hierarchy
:rtype: :py:class:`SubModelDescription`
:return: A mutable reference to the specified SubModelDescription
:raises: InvalidSubModelName If a submodel with the name does not exist within the model description hierarchy
See also: ModelDescription::getSubModel(const std::string &) for the immutable version
"""
return _pyflamegpu.ModelDescription_SubModel(self, submodel_name)
def newLayer(self, *args):
r"""
Creates a new layer with the specified name
:type name: string, optional
:param name: Name which can be used to refer to the message within the model description hierarchy
:rtype: :py:class:`LayerDescription`
:return: A mutable reference to the new LayerDescription
:raises: InvalidFuncLayerIndx If a layer with the same name already exists within the model description hierarchy
Notes: Layer names are not required, passing empty string will not set a name
"""
return _pyflamegpu.ModelDescription_newLayer(self, *args)
def Layer(self, *args):
r"""
*Overload 1:*
Returns a mutable reference to the named layer, which can be used to configure the layer
:type name: string
:param name: Name used to refer to the desired layer within the model description hierarchy
:rtype: :py:class:`LayerDescription`
:return: A mutable reference to the specified LayerDescription
:raises: InvalidFuncLayerIndx If a layer with the name does not exist within the model description hierarchy
See also: ModelDescription::Layer(const ModelData::size_type &)
See also: ModelDescription::getLayer(const std::string &) for the immutable version
|
*Overload 2:*
Returns a mutable reference to the named layer, which can be used to configure the layer
:type layer_index: int
:param layer_index: Index of the desired layer within the model description hierarchy
:rtype: :py:class:`LayerDescription`
:return: A mutable reference to the specified LayerDescription
:raises: InvalidFuncLayerIndx If a layer with the name does not exist within the model description hierarchy
See also: ModelDescription::Layer(const std::string &)
See also: ModelDescription::getLayer(const ModelData::size_type &) for the immutable version
"""
return _pyflamegpu.ModelDescription_Layer(self, *args)
def addInitFunctionCallback(self, func_callback):
r"""
Adds an init function callback to the simulation. The callback objects is similar to adding via addInitFunction
however the runnable function is encapsulated within an object which permits cross language support in swig.
Init functions execute once before the simulation begins
:type func_callback: :py:class:`HostFunctionCallback`
:param func_callback: Pointer to the desired init function callback
:raises: InvalidHostFunc If the init function has already been added to this model description
Notes: There is no guarantee on the order in which multiple init functions will be executed
"""
return _pyflamegpu.ModelDescription_addInitFunctionCallback(self, func_callback)
def addStepFunctionCallback(self, func_callback):
r"""
Adds an step function callback to the simulation. The callback objects is similar to adding via addStepFunction
however the runnable function is encapsulated within an object which permits cross language support in swig.
Exit functions execute once after the simulation ends
:type func_callback: :py:class:`HostFunctionCallback`
:param func_callback: Pointer to the desired exit function callback
:raises: InvalidHostFunc If the step function has already been added to this model description
Notes: There is no guarantee on the order in which multiple step functions will be executed, host-layer functions can be used if order is required.
"""
return _pyflamegpu.ModelDescription_addStepFunctionCallback(self, func_callback)
def addExitFunctionCallback(self, func_callback):
r"""
Adds an exit function callback to the simulation. The callback objects is similar to adding via addExitFunction
however the runnable function is encapsulated within an object which permits cross language support in swig.
Exit functions execute once after all simulation steps have completed or an exit conditions has returned EXIT
:type func_callback: :py:class:`HostFunctionCallback`
:param func_callback: Pointer to the desired exit function callback
:raises: InvalidHostFunc If the exit function has already been added to this model description
Notes: There is no guarantee on the order in which multiple exit functions will be executed
"""
return _pyflamegpu.ModelDescription_addExitFunctionCallback(self, func_callback)
def addExitConditionCallback(self, func_callback):
r"""
Adds an exit condition callback to the simulation
Exit conditions execute once per step, after all layers and step functions have been executed
If the condition returns false, the simulation exits early
:type func_callback: :py:class:`HostFunctionConditionCallback`
:param func_callback: Pointer to the desired exit condition callback
:raises: InvalidHostFunc If the exit condition has already been added to this model description
Notes: Exit conditions are the last functions to operate each step and can still make changes to the model
The step counter is updated after exit conditions have completed
There is no guarantee on the order in which multiple exit conditions will be executed
"""
return _pyflamegpu.ModelDescription_addExitConditionCallback(self, func_callback)
def getName(self):
r"""
:rtype: string
:return: The model's name
"""
return _pyflamegpu.ModelDescription_getName(self)
def getDependencyGraph(self):
r"""
:rtype: :py:class:`DependencyGraph`
:return: A reference to the this model's DependencyGraph
"""
return _pyflamegpu.ModelDescription_getDependencyGraph(self)
def generateLayers(self):
r"""Generates layers from the dependency graph"""
return _pyflamegpu.ModelDescription_generateLayers(self)
def getAgent(self, agent_name):
r"""
Returns an immutable reference to the specified agent, which can be used to view the agent's configuration
:type agent_name: string
:param agent_name: Name which can be used to the refer to the desired agent within the model description hierarchy
:rtype: :py:class:`AgentDescription`
:return: An immutable reference to the specified AgentDescription
:raises: InvalidAgentName If an agent with the name does not exist within the model description hierarchy
See also: ModelDescription::Agent(const std::string &) for the mutable version
"""
return _pyflamegpu.ModelDescription_getAgent(self, agent_name)
def getMessage(self, message_name):
return _pyflamegpu.ModelDescription_getMessage(self, message_name)
def getSubModel(self, submodel_name):
r"""
Returns an immutable reference to the specified submodel, which can be used to view the submodel's configuration
:type submodel_name: string
:param submodel_name: Name which can be used to the refer to the desired submodel within the model description hierarchy
:rtype: :py:class:`SubModelDescription`
:return: An immutable reference to the specified SubModelDescription
:raises: InvalidSubModelName If a submodel with the name does not exist within the model description hierarchy
See also: ModelDescription::SubModel(const std::string &) for the mutable version
"""
return _pyflamegpu.ModelDescription_getSubModel(self, submodel_name)
def getEnvironment(self):
r"""
Returns a mutable reference to the environment description for the model description hierarchy
This can be used to configure environment properties
See also: ModelDescription::Environment() for the mutable version
"""
return _pyflamegpu.ModelDescription_getEnvironment(self)
def getLayer(self, *args):
r"""
*Overload 1:*
Returns a mutable reference to the named layer, which can be used to configure the layer
:type name: string
:param name: Name used to refer to the desired layer within the model description hierarchy
:rtype: :py:class:`LayerDescription`
:return: An immutable reference to the specified LayerDescription
:raises: InvalidFuncLayerIndx If a layer with the name does not exist within the model description hierarchy
See also: ModelDescription::getLayer(const ModelData::size_type &)
See also: ModelDescription::Layer(const std::string &) for the mutable version
|
*Overload 2:*
Returns a mutable reference to the named layer, which can be used to configure the layer
:type layer_index: int
:param layer_index: Index of the desired layer within the model description hierarchy
:rtype: :py:class:`LayerDescription`
:return: An immutable reference to the specified LayerDescription
:raises: InvalidFuncLayerIndx If a layer with the name does not exist within the model description hierarchy
See also: ModelDescription::getLayer(const std::string &)
See also: ModelDescription::Layer(const ModelData::size_type &) for the mutable version
"""
return _pyflamegpu.ModelDescription_getLayer(self, *args)
def hasAgent(self, agent_name):
r"""
:type agent_name: string
:param agent_name: Name of the agent to check
:rtype: boolean
:return: True when an agent with the specified name exists within the model's hierarchy
"""
return _pyflamegpu.ModelDescription_hasAgent(self, agent_name)
def hasMessage(self, message_name):
return _pyflamegpu.ModelDescription_hasMessage(self, message_name)
def hasLayer(self, *args):
r"""
*Overload 1:*
:type name: string
:param name: Name of the layer to check
:rtype: boolean
:return: True when a layer with the specified name exists within the model's hierarchy
|
*Overload 2:*
:type layer_index: int
:param layer_index: Index of the agent to check
:rtype: boolean
:return: True when a layer with the specified index exists within the model's hierarchy
"""
return _pyflamegpu.ModelDescription_hasLayer(self, *args)
def hasSubModel(self, submodel_name):
r"""
:type submodel_name: string
:param submodel_name: Name of the submodel to check
:rtype: boolean
:return: True when a submodel with the specified name exists within the model's hierarchy
"""
return _pyflamegpu.ModelDescription_hasSubModel(self, submodel_name)
def getAgentsCount(self):
r"""
:rtype: int
:return: The number of agents within the model's hierarchy
"""
return _pyflamegpu.ModelDescription_getAgentsCount(self)
def getMessagesCount(self):
r"""
:rtype: int
:return: The number of messages within the model's hierarchy
"""
return _pyflamegpu.ModelDescription_getMessagesCount(self)
def getLayersCount(self):
r"""
:rtype: int
:return: The number of layers within the model's hierarchy
"""
return _pyflamegpu.ModelDescription_getLayersCount(self)
def newMessageBruteForce(self, message_name):
r"""
Creates a new message with the specified name
:type message_name: string
:param message_name: Name which can be used to refer to the message within the model description hierarchy
:rtype: :py:class:`Description`
:return: A mutable reference to the new MessageDescription
:raises: InvalidMessageName If a message with the same name already exists within the model description hierarchy
"""
return _pyflamegpu.ModelDescription_newMessageBruteForce(self, message_name)
def newMessageSpatial2D(self, message_name):
r"""
Creates a new message with the specified name
:type message_name: string
:param message_name: Name which can be used to refer to the message within the model description hierarchy
:rtype: :py:class:`Description`
:return: A mutable reference to the new MessageDescription
:raises: InvalidMessageName If a message with the same name already exists within the model description hierarchy
"""
return _pyflamegpu.ModelDescription_newMessageSpatial2D(self, message_name)
def newMessageSpatial3D(self, message_name):
r"""
Creates a new message with the specified name
:type message_name: string
:param message_name: Name which can be used to refer to the message within the model description hierarchy
:rtype: :py:class:`Description`
:return: A mutable reference to the new MessageDescription
:raises: InvalidMessageName If a message with the same name already exists within the model description hierarchy
"""
return _pyflamegpu.ModelDescription_newMessageSpatial3D(self, message_name)
def newMessageArray(self, message_name):
r"""
Creates a new message with the specified name
:type message_name: string
:param message_name: Name which can be used to refer to the message within the model description hierarchy
:rtype: :py:class:`Description`
:return: A mutable reference to the new MessageDescription
:raises: InvalidMessageName If a message with the same name already exists within the model description hierarchy
"""
return _pyflamegpu.ModelDescription_newMessageArray(self, message_name)
def newMessageArray2D(self, message_name):
r"""
Creates a new message with the specified name
:type message_name: string
:param message_name: Name which can be used to refer to the message within the model description hierarchy
:rtype: :py:class:`Description`
:return: A mutable reference to the new MessageDescription
:raises: InvalidMessageName If a message with the same name already exists within the model description hierarchy
"""
return _pyflamegpu.ModelDescription_newMessageArray2D(self, message_name)
def newMessageArray3D(self, message_name):
r"""
Creates a new message with the specified name
:type message_name: string
:param message_name: Name which can be used to refer to the message within the model description hierarchy
:rtype: :py:class:`Description`
:return: A mutable reference to the new MessageDescription
:raises: InvalidMessageName If a message with the same name already exists within the model description hierarchy
"""
return _pyflamegpu.ModelDescription_newMessageArray3D(self, message_name)
def newMessageBucket(self, message_name):
r"""
Creates a new message with the specified name
:type message_name: string
:param message_name: Name which can be used to refer to the message within the model description hierarchy
:rtype: :py:class:`Description`
:return: A mutable reference to the new MessageDescription
:raises: InvalidMessageName If a message with the same name already exists within the model description hierarchy
"""
return _pyflamegpu.ModelDescription_newMessageBucket(self, message_name)
def getMessageBruteForce(self, message_name):
r"""
Returns a mutable reference to the named message, which can be used to configure the message
:type message_name: string
:param message_name: Name used to refer to the desired message within the model description hierarchy
:rtype: :py:class:`Description`
:return: An immutable reference to the specified MessageDescription
:raises: InvalidMessageName If a message with the name does not exist within the model description hierarchy
See also: ModelDescription::Message(const std::string &) for the mutable version
"""
return _pyflamegpu.ModelDescription_getMessageBruteForce(self, message_name)
def getMessageSpatial2D(self, message_name):
r"""
Returns a mutable reference to the named message, which can be used to configure the message
:type message_name: string
:param message_name: Name used to refer to the desired message within the model description hierarchy
:rtype: :py:class:`Description`
:return: An immutable reference to the specified MessageDescription
:raises: InvalidMessageName If a message with the name does not exist within the model description hierarchy
See also: ModelDescription::Message(const std::string &) for the mutable version
"""
return _pyflamegpu.ModelDescription_getMessageSpatial2D(self, message_name)
def getMessageSpatial3D(self, message_name):
r"""
Returns a mutable reference to the named message, which can be used to configure the message
:type message_name: string
:param message_name: Name used to refer to the desired message within the model description hierarchy
:rtype: :py:class:`Description`
:return: An immutable reference to the specified MessageDescription
:raises: InvalidMessageName If a message with the name does not exist within the model description hierarchy
See also: ModelDescription::Message(const std::string &) for the mutable version
"""
return _pyflamegpu.ModelDescription_getMessageSpatial3D(self, message_name)
def getMessageArray(self, message_name):
r"""
Returns a mutable reference to the named message, which can be used to configure the message
:type message_name: string
:param message_name: Name used to refer to the desired message within the model description hierarchy
:rtype: :py:class:`Description`
:return: An immutable reference to the specified MessageDescription
:raises: InvalidMessageName If a message with the name does not exist within the model description hierarchy
See also: ModelDescription::Message(const std::string &) for the mutable version
"""
return _pyflamegpu.ModelDescription_getMessageArray(self, message_name)
def getMessageArray2D(self, message_name):
r"""
Returns a mutable reference to the named message, which can be used to configure the message
:type message_name: string
:param message_name: Name used to refer to the desired message within the model description hierarchy
:rtype: :py:class:`Description`
:return: An immutable reference to the specified MessageDescription
:raises: InvalidMessageName If a message with the name does not exist within the model description hierarchy
See also: ModelDescription::Message(const std::string &) for the mutable version
"""
return _pyflamegpu.ModelDescription_getMessageArray2D(self, message_name)
def getMessageArray3D(self, message_name):
r"""
Returns a mutable reference to the named message, which can be used to configure the message
:type message_name: string
:param message_name: Name used to refer to the desired message within the model description hierarchy
:rtype: :py:class:`Description`
:return: An immutable reference to the specified MessageDescription
:raises: InvalidMessageName If a message with the name does not exist within the model description hierarchy
See also: ModelDescription::Message(const std::string &) for the mutable version
"""
return _pyflamegpu.ModelDescription_getMessageArray3D(self, message_name)
def getMessageBucket(self, message_name):
r"""
Returns a mutable reference to the named message, which can be used to configure the message
:type message_name: string
:param message_name: Name used to refer to the desired message within the model description hierarchy
:rtype: :py:class:`Description`
:return: An immutable reference to the specified MessageDescription
:raises: InvalidMessageName If a message with the name does not exist within the model description hierarchy
See also: ModelDescription::Message(const std::string &) for the mutable version
"""
return _pyflamegpu.ModelDescription_getMessageBucket(self, message_name)
__swig_destroy__ = _pyflamegpu.delete_ModelDescription
# Register ModelDescription in _pyflamegpu:
_pyflamegpu.ModelDescription_swigregister(ModelDescription)
class AgentDescription(object):
r"""
Within the model hierarchy, this class represents the definition of an agent for a FLAMEGPU model
This class is used to configure external elements of agents, such as variables and functions
See also: AgentData The internal data store for this class
See also: ModelDescription::newAgent(const std::string&) For creating instances of this class
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
def __init__(self, *args, **kwargs):
raise AttributeError("No constructor defined")
__repr__ = _swig_repr
def __eq__(self, rhs):
r"""
Equality operator, checks whether AgentDescription hierarchies are functionally the same
:rtype: boolean
:return: True when agents are the same
Notes: Instead compare pointers if you wish to check that they are the same instance
"""
return _pyflamegpu.AgentDescription___eq__(self, rhs)
def __ne__(self, rhs):
r"""
Equality operator, checks whether AgentDescription hierarchies are functionally different
:rtype: boolean
:return: True when agents are not the same
Notes: Instead compare pointers if you wish to check that they are not the same instance
"""
return _pyflamegpu.AgentDescription___ne__(self, rhs)
def newState(self, state_name):
r"""
Adds a new state to the possible states this agent can enter
State's only exist as strings and have no additional configuration
:type state_name: string
:param state_name: Name of the state
:raises: InvalidStateName If the agent already has a state with the same name
"""
return _pyflamegpu.AgentDescription_newState(self, state_name)
def setInitialState(self, initial_state):
r"""
Sets the initial state which new agents begin in
:type initial_state: string
:param initial_state: Name of the desired state
:raises: InvalidStateName If the named state is not found within the agent
"""
return _pyflamegpu.AgentDescription_setInitialState(self, initial_state)
def newRTCFunction(self, function_name, func_src):
r"""
Adds a new runtime (device) function to the agent
:type function_name: string
:param function_name: Name of the functions
:type func_src: string
:param func_src: representation of an agent function
Should be declared using FLAMEGPU_AGENT_FUNCTION notation
:rtype: :py:class:`AgentFunctionDescription`
:return: A mutable reference to the new AgentFunctionDescription
:raises: InvalidAgentFunc If a variable already exists within the agent with the same name
Notes: The same agent function can be passed to the same agent twice
"""
return _pyflamegpu.AgentDescription_newRTCFunction(self, function_name, func_src)
def Function(self, function_name):
r"""
Returns a mutable reference to the named agent function, which can be used to configure the function
:type function_name: string
:param function_name: Name used to refer to the desired agent function
:rtype: :py:class:`AgentFunctionDescription`
:return: A mutable reference to the specified AgentFunctionDescription
:raises: InvalidAgentFunc If a functions with the name does not exist within the agent
See also: AgentDescription::getFunction(const std::string &) for the immutable version
"""
return _pyflamegpu.AgentDescription_Function(self, function_name)
def getName(self):
r"""
:rtype: string
:return: The agent's name
"""
return _pyflamegpu.AgentDescription_getName(self)
def getStatesCount(self):
r"""
:rtype: int
:return: The number of possible states agents of this type can enter
"""
return _pyflamegpu.AgentDescription_getStatesCount(self)
def getInitialState(self):
r"""
:rtype: string
:return: The state which newly created agents of this type begin in
"""
return _pyflamegpu.AgentDescription_getInitialState(self)
def getVariableType(self, variable_name):
r"""
:type variable_name: string
:param variable_name: Name used to refer to the desired variable
:rtype: std::type_index
:return: The type of the named variable
:raises: InvalidAgentVar If a variable with the name does not exist within the agent
"""
return _pyflamegpu.AgentDescription_getVariableType(self, variable_name)
def getVariableSize(self, variable_name):
r"""
:type variable_name: string
:param variable_name: Name used to refer to the desired variable
:rtype: int
:return: The size of the named variable's type
:raises: InvalidAgentVar If a variable with the name does not exist within the agent
"""
return _pyflamegpu.AgentDescription_getVariableSize(self, variable_name)
def getVariableLength(self, variable_name):
r"""
:type variable_name: string
:param variable_name: Name used to refer to the desired variable
:rtype: int
:return: The number of elements in the name variable (1 if it isn't an array)
:raises: InvalidAgentVar If a variable with the name does not exist within the agent
"""
return _pyflamegpu.AgentDescription_getVariableLength(self, variable_name)
def getVariablesCount(self):
r"""The total number of variables within the agent"""
return _pyflamegpu.AgentDescription_getVariablesCount(self)
def getFunction(self, function_name):
r"""
Returns an immutable reference to the named agent function
:type function_name: string
:param function_name: Name used to refer to the desired agent function
:rtype: :py:class:`AgentFunctionDescription`
:return: An immutable reference to the specified AgentFunctionDescription
:raises: InvalidAgentFunc If a function with the name does not exist within the agent
See also: AgentDescription::Function(const std::string &) for the mutable version
"""
return _pyflamegpu.AgentDescription_getFunction(self, function_name)
def getFunctionsCount(self):
r"""The total number of functions within the agent"""
return _pyflamegpu.AgentDescription_getFunctionsCount(self)
def getAgentOutputsCount(self):
r"""
The total number of agent functions, within the model hierarchy, which create new agents of this type
See also: AgentDescription::isOutputOnDevice()
"""
return _pyflamegpu.AgentDescription_getAgentOutputsCount(self)
def hasState(self, state_name):
r"""
:type state_name: string
:param state_name: Name of the state to check
:rtype: boolean
:return: True when a state with the specified name exists within the agent
"""
return _pyflamegpu.AgentDescription_hasState(self, state_name)
def hasVariable(self, variable_name):
r"""
:type variable_name: string
:param variable_name: Name of the variable to check
:rtype: boolean
:return: True when a variable with the specified name exists within the agent
"""
return _pyflamegpu.AgentDescription_hasVariable(self, variable_name)
def hasFunction(self, function_name):
r"""
:type function_name: string
:param function_name: Name of the function to check
:rtype: boolean
:return: True when a function with the specified name exists within the agent
"""
return _pyflamegpu.AgentDescription_hasFunction(self, function_name)
def isOutputOnDevice(self):
return _pyflamegpu.AgentDescription_isOutputOnDevice(self)
def getStates(self):
return _pyflamegpu.AgentDescription_getStates(self)
def newVariableFloat(self, variable_name, default_value=0):
return _pyflamegpu.AgentDescription_newVariableFloat(self, variable_name, default_value)
def newVariableDouble(self, variable_name, default_value=0):
return _pyflamegpu.AgentDescription_newVariableDouble(self, variable_name, default_value)
def newVariableInt16(self, variable_name, default_value=0):
return _pyflamegpu.AgentDescription_newVariableInt16(self, variable_name, default_value)
def newVariableInt32(self, variable_name, default_value=0):
return _pyflamegpu.AgentDescription_newVariableInt32(self, variable_name, default_value)
def newVariableInt64(self, variable_name, default_value=0):
return _pyflamegpu.AgentDescription_newVariableInt64(self, variable_name, default_value)
def newVariableUInt16(self, variable_name, default_value=0):
return _pyflamegpu.AgentDescription_newVariableUInt16(self, variable_name, default_value)
def newVariableUInt32(self, variable_name, default_value=0):
return _pyflamegpu.AgentDescription_newVariableUInt32(self, variable_name, default_value)
def newVariableUInt64(self, variable_name, default_value=0):
return _pyflamegpu.AgentDescription_newVariableUInt64(self, variable_name, default_value)
def newVariableInt(self, variable_name, default_value=0):
return _pyflamegpu.AgentDescription_newVariableInt(self, variable_name, default_value)
def newVariableUInt(self, variable_name, default_value=0):
return _pyflamegpu.AgentDescription_newVariableUInt(self, variable_name, default_value)
def newVariableInt8(self, variable_name, default_value=0):
return _pyflamegpu.AgentDescription_newVariableInt8(self, variable_name, default_value)
def newVariableUInt8(self, variable_name, default_value=0):
return _pyflamegpu.AgentDescription_newVariableUInt8(self, variable_name, default_value)
def newVariableChar(self, variable_name, default_value=0):
return _pyflamegpu.AgentDescription_newVariableChar(self, variable_name, default_value)
def newVariableUChar(self, variable_name, default_value=0):
return _pyflamegpu.AgentDescription_newVariableUChar(self, variable_name, default_value)
def newVariableArrayFloat(self, *args):
return _pyflamegpu.AgentDescription_newVariableArrayFloat(self, *args)
def newVariableArrayDouble(self, *args):
return _pyflamegpu.AgentDescription_newVariableArrayDouble(self, *args)
def newVariableArrayInt16(self, *args):
return _pyflamegpu.AgentDescription_newVariableArrayInt16(self, *args)
def newVariableArrayInt32(self, *args):
return _pyflamegpu.AgentDescription_newVariableArrayInt32(self, *args)
def newVariableArrayInt64(self, *args):
return _pyflamegpu.AgentDescription_newVariableArrayInt64(self, *args)
def newVariableArrayUInt16(self, *args):
return _pyflamegpu.AgentDescription_newVariableArrayUInt16(self, *args)
def newVariableArrayUInt32(self, *args):
return _pyflamegpu.AgentDescription_newVariableArrayUInt32(self, *args)
def newVariableArrayUInt64(self, *args):
return _pyflamegpu.AgentDescription_newVariableArrayUInt64(self, *args)
def newVariableArrayInt(self, *args):
return _pyflamegpu.AgentDescription_newVariableArrayInt(self, *args)
def newVariableArrayUInt(self, *args):
return _pyflamegpu.AgentDescription_newVariableArrayUInt(self, *args)
def newVariableArrayInt8(self, *args):
return _pyflamegpu.AgentDescription_newVariableArrayInt8(self, *args)
def newVariableArrayUInt8(self, *args):
return _pyflamegpu.AgentDescription_newVariableArrayUInt8(self, *args)
def newVariableArrayChar(self, *args):
return _pyflamegpu.AgentDescription_newVariableArrayChar(self, *args)
def newVariableArrayUChar(self, *args):
return _pyflamegpu.AgentDescription_newVariableArrayUChar(self, *args)
__swig_destroy__ = _pyflamegpu.delete_AgentDescription
# Register AgentDescription in _pyflamegpu:
_pyflamegpu.AgentDescription_swigregister(AgentDescription)
class AgentFunctionDescription(DependencyNode):
r"""
Within the model hierarchy, this class represents an agent function for a FLAMEGPU model
This class is used to configure external elements of agent functions, such as inputs and outputs
See also: AgentDescription::newFunction(const std::string&, AgentFunction) For creating instances of this class
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
def __init__(self, *args, **kwargs):
raise AttributeError("No constructor defined")
__repr__ = _swig_repr
def __eq__(self, rhs):
r"""
Equality operator, checks whether AgentFunctionDescription hierarchies are functionally the same
:rtype: boolean
:return: True when agent functions are the same
Notes: Instead compare pointers if you wish to check that they are the same instance
"""
return _pyflamegpu.AgentFunctionDescription___eq__(self, rhs)
def __ne__(self, rhs):
r"""
Equality operator, checks whether AgentFunctionDescription hierarchies are functionally different
:rtype: boolean
:return: True when agent functions are not the same
Notes: Instead compare pointers if you wish to check that they are not the same instance
"""
return _pyflamegpu.AgentFunctionDescription___ne__(self, rhs)
def setInitialState(self, initial_state):
r"""
Sets the initial state which agents must be in to execute this function
:type initial_state: string
:param initial_state: Name of the desired state
:raises: InvalidStateName If the named state is not found within the agent
See also: AgentFunctionDescription::setEndState(const std::string &)
"""
return _pyflamegpu.AgentFunctionDescription_setInitialState(self, initial_state)
def setEndState(self, end_state):
r"""
Sets the end state which agents enter after executing this function
:type end_state: string
:param end_state: Name of the desired state
:raises: InvalidStateName If the named state is not found within the agent
See also: AgentFunctionDescription::setInitialState(const std::string &)
"""
return _pyflamegpu.AgentFunctionDescription_setEndState(self, end_state)
def setMessageInput(self, *args):
r"""
*Overload 1:*
Sets the message type that can be read during this agent function
This is optional, and only one type of message can be read per agent function
:type message_name: string
:param message_name: Name of the message type to be input
:raises: InvalidMessageName If a message with the same name is not found within the model's hierarchy
:raises: InvalidMessageName If the same message is already bound to the message output of this agent function
See also: AgentFunctionDescription::setMessageInput(MessageDescription &)
|
*Overload 2:*
Sets the message type that can be read during this agent function
This is optional, and only one type of message can be read per agent function
:type message: :py:class:`Description`
:param message: Type of message to be input
:raises: DifferentModel If the message is not from this model hierarchy
:raises: InvalidMessageName If a message with the same name is not found within the model's hierarchy
:raises: InvalidMessageName If the same message is already bound to the message output of this agent function
See also: AgentFunctionDescription::setMessageInput(const std::string &)
"""
return _pyflamegpu.AgentFunctionDescription_setMessageInput(self, *args)
def setMessageOutput(self, *args):
r"""
*Overload 1:*
Sets the message type that can be output during this agent function
This is optional, and only one type of message can be output per agent function
:type message_name: string
:param message_name: Name of the message type to be output
:raises: InvalidMessageName If a message with the same name is not found within the model's hierarchy
:raises: InvalidMessageName If the same message is already bound to the message input of this agent function
See also: AgentFunctionDescription::setMessageOutput(MessageDescription &)
See also: AgentFunctionDescription::setMessageOutputOptional(const bool &) To configure whether all agents must output messages
|
*Overload 2:*
Sets the message type that can be output during this agent function
This is optional, and only one type of message can be output per agent function
:type message: :py:class:`Description`
:param message: Type of message to be output
:raises: DifferentModel If the message is not from this model hierarchy
:raises: InvalidMessageName If a message with the same name is not found within the model's hierarchy
:raises: InvalidMessageName If the same message is already bound to the message input of this agent function
See also: AgentFunctionDescription::setMessageInput(const std::string &)
See also: AgentFunctionDescription::setMessageOutputOptional(const bool &) To configure whether all agents must output messages
"""
return _pyflamegpu.AgentFunctionDescription_setMessageOutput(self, *args)
def setMessageOutputOptional(self, output_is_optional):
r"""
Configures whether message output from this agent function is optional
(e.g. whether all agents must output a message each time the function is called)
If the function has no message output, this can be ignored
:type output_is_optional: boolean
:param output_is_optional: True if not all agents executing this function will output messages
Notes: Defaults to false
"""
return _pyflamegpu.AgentFunctionDescription_setMessageOutputOptional(self, output_is_optional)
def setAgentOutput(self, *args):
r"""
*Overload 1:*
Sets the agent type that can be output during this agent function
This is optional, and only one type of agent can be output per agent function
:type agent_name: string
:param agent_name: Name of the agent type to be output
:type state: string, optional
:param state: The stage agents should be created in
:raises: InvalidAgentName If an agent with the same name is not found within the model's hierarchy
:raises: InvalidStateName If the named agent does not contain the named state
See also: AgentFunctionDescription::setAgentOutput(AgentDescription &)
|
*Overload 2:*
Sets the agent type that can be output during this agent function
This is optional, and only one type of agent can be output per agent function
:type agent: :py:class:`AgentDescription`
:param agent: Type of agent to be output
:type state: string, optional
:param state: The stage agents should be created in
:raises: DifferentModel If the agent is not from this model hierarchy
:raises: InvalidAgentName If an agent with the same name is not found within the model's hierarchy
:raises: InvalidStateName If the named agent does not contain the named state
See also: AgentFunctionDescription::setAgentOutput(AgentDescription &)
|
*Overload 3:*
Sets the agent type that can be output during this agent function
This is optional, and only one type of agent can be output per agent function
:type agent: :py:class:`AgentDescription`
:param agent: Type of agent to be output
:param state: The stage agents should be created in
:raises: DifferentModel If the agent is not from this model hierarchy
:raises: InvalidAgentName If an agent with the same name is not found within the model's hierarchy
:raises: InvalidStateName If the named agent does not contain the named state
See also: AgentFunctionDescription::setAgentOutput(AgentDescription &)
"""
return _pyflamegpu.AgentFunctionDescription_setAgentOutput(self, *args)
def setAllowAgentDeath(self, has_death):
r"""
Configures whether agents can die during execution of this function
(e.g. by returning FLAME_GPU_AGENT_STATUS::DEAD from the agent function)
:type has_death: boolean
:param has_death: True if some agents executing this agent function may die
See also: AgentFunctionDescription::AllowAgentDeath()
See also: AgentFunctionDescription::getAllowAgentDeath()
Notes: Defaults to false
"""
return _pyflamegpu.AgentFunctionDescription_setAllowAgentDeath(self, has_death)
def setRTCFunctionCondition(self, func_cond_src):
r"""
Sets the RTC function condition for the agent function
This is string containing a definition of an FLAMEGPU_AGENT_FUNCTION_CONDITION which returns a boolean value (true or false)
Only agents which return true perform the attached FLAMEGPU_AGENT_FUNCTION
and transition from the initial to end state.
The string will be compiled at runtime.
"""
return _pyflamegpu.AgentFunctionDescription_setRTCFunctionCondition(self, func_cond_src)
def MessageInput(self):
r"""
:rtype: :py:class:`Description`
:return: A mutable reference to the message input of this agent function
See also: AgentFunctionDescription::getMessageInput() for the immutable version
:raises: OutOfBoundsException If the message input has not been set
"""
return _pyflamegpu.AgentFunctionDescription_MessageInput(self)
def MessageOutput(self):
r"""
:rtype: :py:class:`Description`
:return: An mutable reference to the message output of this agent function
See also: AgentFunctionDescription::getMessageOutput() for the immutable version
:raises: OutOfBoundsException If the message output has not been set
"""
return _pyflamegpu.AgentFunctionDescription_MessageOutput(self)
def MessageOutputOptional(self):
r"""
:rtype: boolean
:return: A mutable reference to the message output optional configuration flag
See also: AgentFunctionDescription::getAgentOutputOptional()
See also: AgentFunctionDescription::setAgentOutputOptional(const bool &)
"""
return _pyflamegpu.AgentFunctionDescription_MessageOutputOptional(self)
def AllowAgentDeath(self):
r"""
:rtype: boolean
:return: A mutable reference to the allow agent death configuration flag
See also: AgentFunctionDescription::getAllowAgentDeath()
See also: AgentFunctionDescription::setAllowAgentDeath(const bool &)
"""
return _pyflamegpu.AgentFunctionDescription_AllowAgentDeath(self)
def getName(self):
r"""
:rtype: string
:return: The function's name
"""
return _pyflamegpu.AgentFunctionDescription_getName(self)
def getInitialState(self):
r"""
:rtype: string
:return: The state which agents must be in to execute this agent function
"""
return _pyflamegpu.AgentFunctionDescription_getInitialState(self)
def getEndState(self):
r"""
:rtype: string
:return: The state which agents executing this function enter
"""
return _pyflamegpu.AgentFunctionDescription_getEndState(self)
def getMessageInput(self):
r"""
:rtype: :py:class:`Description`
:return: An immutable reference to the message input of this agent function
See also: AgentFunctionDescription::MessageInput() for the mutable version
:raises: OutOfBoundsException If the message input has not been set
"""
return _pyflamegpu.AgentFunctionDescription_getMessageInput(self)
def getMessageOutput(self):
r"""
:rtype: :py:class:`Description`
:return: An immutable reference to the message output of this agent function
See also: AgentFunctionDescription::MessageOutput() for the mutable version
:raises: OutOfBoundsException If the message output has not been set
"""
return _pyflamegpu.AgentFunctionDescription_getMessageOutput(self)
def getMessageOutputOptional(self):
r"""
:rtype: boolean
:return: True if message output from this agent function is optional
"""
return _pyflamegpu.AgentFunctionDescription_getMessageOutputOptional(self)
def getAgentOutput(self):
r"""
:rtype: :py:class:`AgentDescription`
:return: An immutable reference to the agent output of this agent function
:raises: OutOfBoundsException If the agent output has not been set
"""
return _pyflamegpu.AgentFunctionDescription_getAgentOutput(self)
def getAgentOutputState(self):
r"""
:rtype: string
:return: The state output agents will be output in
:raises: OutOfBoundsException If the agent output has not been set
"""
return _pyflamegpu.AgentFunctionDescription_getAgentOutputState(self)
def getAllowAgentDeath(self):
r"""
:rtype: boolean
:return: True if this agent function can kill agents
"""
return _pyflamegpu.AgentFunctionDescription_getAllowAgentDeath(self)
def hasMessageInput(self):
r"""
:rtype: boolean
:return: True if setMessageInput() has been called successfully
See also: AgentFunctionDescription::setMessageInput(const std::string &)
See also: AgentFunctionDescription::setMessageInput(MessageDescription &)
"""
return _pyflamegpu.AgentFunctionDescription_hasMessageInput(self)
def hasMessageOutput(self):
r"""
:rtype: boolean
:return: True if setMessageOutput() has been called successfully
See also: AgentFunctionDescription::setMessageOutput(const std::string &)
See also: AgentFunctionDescription::setMessageOutput(MessageDescription &)
"""
return _pyflamegpu.AgentFunctionDescription_hasMessageOutput(self)
def hasAgentOutput(self):
r"""
:rtype: boolean
:return: True if setAgentOutput() has been called successfully
See also: AgentFunctionDescription::setAgentOutput(const std::string &)
See also: AgentFunctionDescription::setAgentOutput(AgentDescription &)
"""
return _pyflamegpu.AgentFunctionDescription_hasAgentOutput(self)
def hasFunctionCondition(self):
r"""
:rtype: boolean
:return: True if setFunctionCondition() has been called successfully
See also: AgentFunctionDescription::setFunctionCondition(AgentFunctionCondition)
"""
return _pyflamegpu.AgentFunctionDescription_hasFunctionCondition(self)
def isRTC(self):
r"""
:rtype: boolean
:return: True if the function is a runtime time specified function
"""
return _pyflamegpu.AgentFunctionDescription_isRTC(self)
__swig_destroy__ = _pyflamegpu.delete_AgentFunctionDescription
# Register AgentFunctionDescription in _pyflamegpu:
_pyflamegpu.AgentFunctionDescription_swigregister(AgentFunctionDescription)
class EnvironmentDescription(object):
r"""
Description class for environment properties
Allows environment properties to be prepared and attached to a ModelDescription.
Properties can be any arithmetic or enum type.
Properties marked as const within the EnvironmentDescription cannot be changed during the simulation
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self):
r"""Default destruction"""
_pyflamegpu.EnvironmentDescription_swiginit(self, _pyflamegpu.new_EnvironmentDescription())
def __eq__(self, rhs):
return _pyflamegpu.EnvironmentDescription___eq__(self, rhs)
def __ne__(self, rhs):
return _pyflamegpu.EnvironmentDescription___ne__(self, rhs)
def getConst(self, name):
r"""
Returns whether an environment property is marked as const
:type name: string
:param name: name used for accessing the property
:raises: InvalidEnvProperty If a property of the name does not exist
"""
return _pyflamegpu.EnvironmentDescription_getConst(self, name)
def getPropertiesMap(self):
return _pyflamegpu.EnvironmentDescription_getPropertiesMap(self)
def newPropertyFloat(self, name, value, isConst=False):
r"""
Adds a new environment property
:type name: string
:param name: name used for accessing the property
:type value: float
:param value: stored value of the property
:type isConst: boolean, optional
:param isConst: If set to true, it is not possible to change the value during the simulation
:param T: Type of the environmental property to be created
:raises: DuplicateEnvProperty If a property of the same name already exists
"""
return _pyflamegpu.EnvironmentDescription_newPropertyFloat(self, name, value, isConst)
def newPropertyDouble(self, name, value, isConst=False):
r"""
Adds a new environment property
:type name: string
:param name: name used for accessing the property
:type value: float
:param value: stored value of the property
:type isConst: boolean, optional
:param isConst: If set to true, it is not possible to change the value during the simulation
:param T: Type of the environmental property to be created
:raises: DuplicateEnvProperty If a property of the same name already exists
"""
return _pyflamegpu.EnvironmentDescription_newPropertyDouble(self, name, value, isConst)
def newPropertyInt16(self, name, value, isConst=False):
r"""
Adds a new environment property
:type name: string
:param name: name used for accessing the property
:type value: int
:param value: stored value of the property
:type isConst: boolean, optional
:param isConst: If set to true, it is not possible to change the value during the simulation
:param T: Type of the environmental property to be created
:raises: DuplicateEnvProperty If a property of the same name already exists
"""
return _pyflamegpu.EnvironmentDescription_newPropertyInt16(self, name, value, isConst)
def newPropertyInt32(self, name, value, isConst=False):
r"""
Adds a new environment property
:type name: string
:param name: name used for accessing the property
:type value: int
:param value: stored value of the property
:type isConst: boolean, optional
:param isConst: If set to true, it is not possible to change the value during the simulation
:param T: Type of the environmental property to be created
:raises: DuplicateEnvProperty If a property of the same name already exists
"""
return _pyflamegpu.EnvironmentDescription_newPropertyInt32(self, name, value, isConst)
def newPropertyInt64(self, name, value, isConst=False):
r"""
Adds a new environment property
:type name: string
:param name: name used for accessing the property
:type value: int
:param value: stored value of the property
:type isConst: boolean, optional
:param isConst: If set to true, it is not possible to change the value during the simulation
:param T: Type of the environmental property to be created
:raises: DuplicateEnvProperty If a property of the same name already exists
"""
return _pyflamegpu.EnvironmentDescription_newPropertyInt64(self, name, value, isConst)
def newPropertyUInt16(self, name, value, isConst=False):
r"""
Adds a new environment property
:type name: string
:param name: name used for accessing the property
:type value: int
:param value: stored value of the property
:type isConst: boolean, optional
:param isConst: If set to true, it is not possible to change the value during the simulation
:param T: Type of the environmental property to be created
:raises: DuplicateEnvProperty If a property of the same name already exists
"""
return _pyflamegpu.EnvironmentDescription_newPropertyUInt16(self, name, value, isConst)
def newPropertyUInt32(self, name, value, isConst=False):
r"""
Adds a new environment property
:type name: string
:param name: name used for accessing the property
:type value: int
:param value: stored value of the property
:type isConst: boolean, optional
:param isConst: If set to true, it is not possible to change the value during the simulation
:param T: Type of the environmental property to be created
:raises: DuplicateEnvProperty If a property of the same name already exists
"""
return _pyflamegpu.EnvironmentDescription_newPropertyUInt32(self, name, value, isConst)
def newPropertyUInt64(self, name, value, isConst=False):
r"""
Adds a new environment property
:type name: string
:param name: name used for accessing the property
:type value: int
:param value: stored value of the property
:type isConst: boolean, optional
:param isConst: If set to true, it is not possible to change the value during the simulation
:param T: Type of the environmental property to be created
:raises: DuplicateEnvProperty If a property of the same name already exists
"""
return _pyflamegpu.EnvironmentDescription_newPropertyUInt64(self, name, value, isConst)
def newPropertyInt(self, name, value, isConst=False):
r"""
Adds a new environment property
:type name: string
:param name: name used for accessing the property
:type value: int
:param value: stored value of the property
:type isConst: boolean, optional
:param isConst: If set to true, it is not possible to change the value during the simulation
:param T: Type of the environmental property to be created
:raises: DuplicateEnvProperty If a property of the same name already exists
"""
return _pyflamegpu.EnvironmentDescription_newPropertyInt(self, name, value, isConst)
def newPropertyUInt(self, name, value, isConst=False):
r"""
Adds a new environment property
:type name: string
:param name: name used for accessing the property
:type value: int
:param value: stored value of the property
:type isConst: boolean, optional
:param isConst: If set to true, it is not possible to change the value during the simulation
:param T: Type of the environmental property to be created
:raises: DuplicateEnvProperty If a property of the same name already exists
"""
return _pyflamegpu.EnvironmentDescription_newPropertyUInt(self, name, value, isConst)
def newPropertyInt8(self, name, value, isConst=False):
r"""
Adds a new environment property
:type name: string
:param name: name used for accessing the property
:type value: signed char
:param value: stored value of the property
:type isConst: boolean, optional
:param isConst: If set to true, it is not possible to change the value during the simulation
:param T: Type of the environmental property to be created
:raises: DuplicateEnvProperty If a property of the same name already exists
"""
return _pyflamegpu.EnvironmentDescription_newPropertyInt8(self, name, value, isConst)
def newPropertyUInt8(self, name, value, isConst=False):
r"""
Adds a new environment property
:type name: string
:param name: name used for accessing the property
:type value: unsigned char
:param value: stored value of the property
:type isConst: boolean, optional
:param isConst: If set to true, it is not possible to change the value during the simulation
:param T: Type of the environmental property to be created
:raises: DuplicateEnvProperty If a property of the same name already exists
"""
return _pyflamegpu.EnvironmentDescription_newPropertyUInt8(self, name, value, isConst)
def newPropertyChar(self, name, value, isConst=False):
r"""
Adds a new environment property
:type name: string
:param name: name used for accessing the property
:type value: char
:param value: stored value of the property
:type isConst: boolean, optional
:param isConst: If set to true, it is not possible to change the value during the simulation
:param T: Type of the environmental property to be created
:raises: DuplicateEnvProperty If a property of the same name already exists
"""
return _pyflamegpu.EnvironmentDescription_newPropertyChar(self, name, value, isConst)
def newPropertyUChar(self, name, value, isConst=False):
r"""
Adds a new environment property
:type name: string
:param name: name used for accessing the property
:type value: unsigned char
:param value: stored value of the property
:type isConst: boolean, optional
:param isConst: If set to true, it is not possible to change the value during the simulation
:param T: Type of the environmental property to be created
:raises: DuplicateEnvProperty If a property of the same name already exists
"""
return _pyflamegpu.EnvironmentDescription_newPropertyUChar(self, name, value, isConst)
def newPropertyArrayFloat(self, name, length, value, isConst=False):
r"""
Adds a new environment property array
:type name: string
:param name: Name used for accessing the property
:type length: int
:param length: Length of the environmental property array to be created
:type value: std::vector< float,std::allocator< float > >
:param value: Stored value of the property
:type isConst: boolean, optional
:param isConst: If set to true, it is not possible to change the value during the simulation
:param T: Type of the environmental property array to be created
:raises: DuplicateEnvProperty If a property of the same name already exists
"""
return _pyflamegpu.EnvironmentDescription_newPropertyArrayFloat(self, name, length, value, isConst)
def newPropertyArrayDouble(self, name, length, value, isConst=False):
r"""
Adds a new environment property array
:type name: string
:param name: Name used for accessing the property
:type length: int
:param length: Length of the environmental property array to be created
:type value: std::vector< double,std::allocator< double > >
:param value: Stored value of the property
:type isConst: boolean, optional
:param isConst: If set to true, it is not possible to change the value during the simulation
:param T: Type of the environmental property array to be created
:raises: DuplicateEnvProperty If a property of the same name already exists
"""
return _pyflamegpu.EnvironmentDescription_newPropertyArrayDouble(self, name, length, value, isConst)
def newPropertyArrayInt16(self, name, length, value, isConst=False):
r"""
Adds a new environment property array
:type name: string
:param name: Name used for accessing the property
:type length: int
:param length: Length of the environmental property array to be created
:type value: std::vector< short,std::allocator< short > >
:param value: Stored value of the property
:type isConst: boolean, optional
:param isConst: If set to true, it is not possible to change the value during the simulation
:param T: Type of the environmental property array to be created
:raises: DuplicateEnvProperty If a property of the same name already exists
"""
return _pyflamegpu.EnvironmentDescription_newPropertyArrayInt16(self, name, length, value, isConst)
def newPropertyArrayInt32(self, name, length, value, isConst=False):
r"""
Adds a new environment property array
:type name: string
:param name: Name used for accessing the property
:type length: int
:param length: Length of the environmental property array to be created
:type value: std::vector< int,std::allocator< int > >
:param value: Stored value of the property
:type isConst: boolean, optional
:param isConst: If set to true, it is not possible to change the value during the simulation
:param T: Type of the environmental property array to be created
:raises: DuplicateEnvProperty If a property of the same name already exists
"""
return _pyflamegpu.EnvironmentDescription_newPropertyArrayInt32(self, name, length, value, isConst)
def newPropertyArrayInt64(self, name, length, value, isConst=False):
r"""
Adds a new environment property array
:type name: string
:param name: Name used for accessing the property
:type length: int
:param length: Length of the environmental property array to be created
:type value: std::vector< long long,std::allocator< long long > >
:param value: Stored value of the property
:type isConst: boolean, optional
:param isConst: If set to true, it is not possible to change the value during the simulation
:param T: Type of the environmental property array to be created
:raises: DuplicateEnvProperty If a property of the same name already exists
"""
return _pyflamegpu.EnvironmentDescription_newPropertyArrayInt64(self, name, length, value, isConst)
def newPropertyArrayUInt16(self, name, length, value, isConst=False):
r"""
Adds a new environment property array
:type name: string
:param name: Name used for accessing the property
:type length: int
:param length: Length of the environmental property array to be created
:type value: std::vector< unsigned short,std::allocator< unsigned short > >
:param value: Stored value of the property
:type isConst: boolean, optional
:param isConst: If set to true, it is not possible to change the value during the simulation
:param T: Type of the environmental property array to be created
:raises: DuplicateEnvProperty If a property of the same name already exists
"""
return _pyflamegpu.EnvironmentDescription_newPropertyArrayUInt16(self, name, length, value, isConst)
def newPropertyArrayUInt32(self, name, length, value, isConst=False):
r"""
Adds a new environment property array
:type name: string
:param name: Name used for accessing the property
:type length: int
:param length: Length of the environmental property array to be created
:type value: std::vector< unsigned int,std::allocator< unsigned int > >
:param value: Stored value of the property
:type isConst: boolean, optional
:param isConst: If set to true, it is not possible to change the value during the simulation
:param T: Type of the environmental property array to be created
:raises: DuplicateEnvProperty If a property of the same name already exists
"""
return _pyflamegpu.EnvironmentDescription_newPropertyArrayUInt32(self, name, length, value, isConst)
def newPropertyArrayUInt64(self, name, length, value, isConst=False):
r"""
Adds a new environment property array
:type name: string
:param name: Name used for accessing the property
:type length: int
:param length: Length of the environmental property array to be created
:type value: std::vector< unsigned long long,std::allocator< unsigned long long > >
:param value: Stored value of the property
:type isConst: boolean, optional
:param isConst: If set to true, it is not possible to change the value during the simulation
:param T: Type of the environmental property array to be created
:raises: DuplicateEnvProperty If a property of the same name already exists
"""
return _pyflamegpu.EnvironmentDescription_newPropertyArrayUInt64(self, name, length, value, isConst)
def newPropertyArrayInt(self, name, length, value, isConst=False):
r"""
Adds a new environment property array
:type name: string
:param name: Name used for accessing the property
:type length: int
:param length: Length of the environmental property array to be created
:type value: std::vector< int,std::allocator< int > >
:param value: Stored value of the property
:type isConst: boolean, optional
:param isConst: If set to true, it is not possible to change the value during the simulation
:param T: Type of the environmental property array to be created
:raises: DuplicateEnvProperty If a property of the same name already exists
"""
return _pyflamegpu.EnvironmentDescription_newPropertyArrayInt(self, name, length, value, isConst)
def newPropertyArrayUInt(self, name, length, value, isConst=False):
r"""
Adds a new environment property array
:type name: string
:param name: Name used for accessing the property
:type length: int
:param length: Length of the environmental property array to be created
:type value: std::vector< unsigned int,std::allocator< unsigned int > >
:param value: Stored value of the property
:type isConst: boolean, optional
:param isConst: If set to true, it is not possible to change the value during the simulation
:param T: Type of the environmental property array to be created
:raises: DuplicateEnvProperty If a property of the same name already exists
"""
return _pyflamegpu.EnvironmentDescription_newPropertyArrayUInt(self, name, length, value, isConst)
def newPropertyArrayInt8(self, name, length, value, isConst=False):
r"""
Adds a new environment property array
:type name: string
:param name: Name used for accessing the property
:type length: int
:param length: Length of the environmental property array to be created
:type value: std::vector< signed char,std::allocator< signed char > >
:param value: Stored value of the property
:type isConst: boolean, optional
:param isConst: If set to true, it is not possible to change the value during the simulation
:param T: Type of the environmental property array to be created
:raises: DuplicateEnvProperty If a property of the same name already exists
"""
return _pyflamegpu.EnvironmentDescription_newPropertyArrayInt8(self, name, length, value, isConst)
def newPropertyArrayUInt8(self, name, length, value, isConst=False):
r"""
Adds a new environment property array
:type name: string
:param name: Name used for accessing the property
:type length: int
:param length: Length of the environmental property array to be created
:type value: std::vector< unsigned char,std::allocator< unsigned char > >
:param value: Stored value of the property
:type isConst: boolean, optional
:param isConst: If set to true, it is not possible to change the value during the simulation
:param T: Type of the environmental property array to be created
:raises: DuplicateEnvProperty If a property of the same name already exists
"""
return _pyflamegpu.EnvironmentDescription_newPropertyArrayUInt8(self, name, length, value, isConst)
def newPropertyArrayChar(self, name, length, value, isConst=False):
r"""
Adds a new environment property array
:type name: string
:param name: Name used for accessing the property
:type length: int
:param length: Length of the environmental property array to be created
:type value: std::vector< char,std::allocator< char > >
:param value: Stored value of the property
:type isConst: boolean, optional
:param isConst: If set to true, it is not possible to change the value during the simulation
:param T: Type of the environmental property array to be created
:raises: DuplicateEnvProperty If a property of the same name already exists
"""
return _pyflamegpu.EnvironmentDescription_newPropertyArrayChar(self, name, length, value, isConst)
def newPropertyArrayUChar(self, name, length, value, isConst=False):
r"""
Adds a new environment property array
:type name: string
:param name: Name used for accessing the property
:type length: int
:param length: Length of the environmental property array to be created
:type value: std::vector< unsigned char,std::allocator< unsigned char > >
:param value: Stored value of the property
:type isConst: boolean, optional
:param isConst: If set to true, it is not possible to change the value during the simulation
:param T: Type of the environmental property array to be created
:raises: DuplicateEnvProperty If a property of the same name already exists
"""
return _pyflamegpu.EnvironmentDescription_newPropertyArrayUChar(self, name, length, value, isConst)
def getPropertyFloat(self, *args):
r"""
*Overload 1:*
Gets an environment property
:type name: string
:param name: name used for accessing the property
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
|
*Overload 2:*
Gets an element of an environment property array
:type name: string
:param name: name used for accessing the property
:type index: int
:param index: element from the environment property array to return
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
"""
return _pyflamegpu.EnvironmentDescription_getPropertyFloat(self, *args)
def getPropertyDouble(self, *args):
r"""
*Overload 1:*
Gets an environment property
:type name: string
:param name: name used for accessing the property
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
|
*Overload 2:*
Gets an element of an environment property array
:type name: string
:param name: name used for accessing the property
:type index: int
:param index: element from the environment property array to return
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
"""
return _pyflamegpu.EnvironmentDescription_getPropertyDouble(self, *args)
def getPropertyInt16(self, *args):
r"""
*Overload 1:*
Gets an environment property
:type name: string
:param name: name used for accessing the property
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
|
*Overload 2:*
Gets an element of an environment property array
:type name: string
:param name: name used for accessing the property
:type index: int
:param index: element from the environment property array to return
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
"""
return _pyflamegpu.EnvironmentDescription_getPropertyInt16(self, *args)
def getPropertyInt32(self, *args):
r"""
*Overload 1:*
Gets an environment property
:type name: string
:param name: name used for accessing the property
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
|
*Overload 2:*
Gets an element of an environment property array
:type name: string
:param name: name used for accessing the property
:type index: int
:param index: element from the environment property array to return
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
"""
return _pyflamegpu.EnvironmentDescription_getPropertyInt32(self, *args)
def getPropertyInt64(self, *args):
r"""
*Overload 1:*
Gets an environment property
:type name: string
:param name: name used for accessing the property
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
|
*Overload 2:*
Gets an element of an environment property array
:type name: string
:param name: name used for accessing the property
:type index: int
:param index: element from the environment property array to return
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
"""
return _pyflamegpu.EnvironmentDescription_getPropertyInt64(self, *args)
def getPropertyUInt16(self, *args):
r"""
*Overload 1:*
Gets an environment property
:type name: string
:param name: name used for accessing the property
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
|
*Overload 2:*
Gets an element of an environment property array
:type name: string
:param name: name used for accessing the property
:type index: int
:param index: element from the environment property array to return
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
"""
return _pyflamegpu.EnvironmentDescription_getPropertyUInt16(self, *args)
def getPropertyUInt32(self, *args):
r"""
*Overload 1:*
Gets an environment property
:type name: string
:param name: name used for accessing the property
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
|
*Overload 2:*
Gets an element of an environment property array
:type name: string
:param name: name used for accessing the property
:type index: int
:param index: element from the environment property array to return
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
"""
return _pyflamegpu.EnvironmentDescription_getPropertyUInt32(self, *args)
def getPropertyUInt64(self, *args):
r"""
*Overload 1:*
Gets an environment property
:type name: string
:param name: name used for accessing the property
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
|
*Overload 2:*
Gets an element of an environment property array
:type name: string
:param name: name used for accessing the property
:type index: int
:param index: element from the environment property array to return
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
"""
return _pyflamegpu.EnvironmentDescription_getPropertyUInt64(self, *args)
def getPropertyInt(self, *args):
r"""
*Overload 1:*
Gets an environment property
:type name: string
:param name: name used for accessing the property
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
|
*Overload 2:*
Gets an element of an environment property array
:type name: string
:param name: name used for accessing the property
:type index: int
:param index: element from the environment property array to return
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
"""
return _pyflamegpu.EnvironmentDescription_getPropertyInt(self, *args)
def getPropertyUInt(self, *args):
r"""
*Overload 1:*
Gets an environment property
:type name: string
:param name: name used for accessing the property
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
|
*Overload 2:*
Gets an element of an environment property array
:type name: string
:param name: name used for accessing the property
:type index: int
:param index: element from the environment property array to return
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
"""
return _pyflamegpu.EnvironmentDescription_getPropertyUInt(self, *args)
def getPropertyInt8(self, *args):
r"""
*Overload 1:*
Gets an environment property
:type name: string
:param name: name used for accessing the property
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
|
*Overload 2:*
Gets an element of an environment property array
:type name: string
:param name: name used for accessing the property
:type index: int
:param index: element from the environment property array to return
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
"""
return _pyflamegpu.EnvironmentDescription_getPropertyInt8(self, *args)
def getPropertyUInt8(self, *args):
r"""
*Overload 1:*
Gets an environment property
:type name: string
:param name: name used for accessing the property
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
|
*Overload 2:*
Gets an element of an environment property array
:type name: string
:param name: name used for accessing the property
:type index: int
:param index: element from the environment property array to return
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
"""
return _pyflamegpu.EnvironmentDescription_getPropertyUInt8(self, *args)
def getPropertyChar(self, *args):
r"""
*Overload 1:*
Gets an environment property
:type name: string
:param name: name used for accessing the property
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
|
*Overload 2:*
Gets an element of an environment property array
:type name: string
:param name: name used for accessing the property
:type index: int
:param index: element from the environment property array to return
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
"""
return _pyflamegpu.EnvironmentDescription_getPropertyChar(self, *args)
def getPropertyUChar(self, *args):
r"""
*Overload 1:*
Gets an environment property
:type name: string
:param name: name used for accessing the property
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
|
*Overload 2:*
Gets an element of an environment property array
:type name: string
:param name: name used for accessing the property
:type index: int
:param index: element from the environment property array to return
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
"""
return _pyflamegpu.EnvironmentDescription_getPropertyUChar(self, *args)
def getPropertyArrayFloat(self, name):
r"""
Gets an environment property array
:type name: string
:param name: name used for accessing the property
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
"""
return _pyflamegpu.EnvironmentDescription_getPropertyArrayFloat(self, name)
def getPropertyArrayDouble(self, name):
r"""
Gets an environment property array
:type name: string
:param name: name used for accessing the property
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
"""
return _pyflamegpu.EnvironmentDescription_getPropertyArrayDouble(self, name)
def getPropertyArrayInt16(self, name):
r"""
Gets an environment property array
:type name: string
:param name: name used for accessing the property
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
"""
return _pyflamegpu.EnvironmentDescription_getPropertyArrayInt16(self, name)
def getPropertyArrayInt32(self, name):
r"""
Gets an environment property array
:type name: string
:param name: name used for accessing the property
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
"""
return _pyflamegpu.EnvironmentDescription_getPropertyArrayInt32(self, name)
def getPropertyArrayInt64(self, name):
r"""
Gets an environment property array
:type name: string
:param name: name used for accessing the property
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
"""
return _pyflamegpu.EnvironmentDescription_getPropertyArrayInt64(self, name)
def getPropertyArrayUInt16(self, name):
r"""
Gets an environment property array
:type name: string
:param name: name used for accessing the property
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
"""
return _pyflamegpu.EnvironmentDescription_getPropertyArrayUInt16(self, name)
def getPropertyArrayUInt32(self, name):
r"""
Gets an environment property array
:type name: string
:param name: name used for accessing the property
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
"""
return _pyflamegpu.EnvironmentDescription_getPropertyArrayUInt32(self, name)
def getPropertyArrayUInt64(self, name):
r"""
Gets an environment property array
:type name: string
:param name: name used for accessing the property
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
"""
return _pyflamegpu.EnvironmentDescription_getPropertyArrayUInt64(self, name)
def getPropertyArrayInt(self, name):
r"""
Gets an environment property array
:type name: string
:param name: name used for accessing the property
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
"""
return _pyflamegpu.EnvironmentDescription_getPropertyArrayInt(self, name)
def getPropertyArrayUInt(self, name):
r"""
Gets an environment property array
:type name: string
:param name: name used for accessing the property
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
"""
return _pyflamegpu.EnvironmentDescription_getPropertyArrayUInt(self, name)
def getPropertyArrayInt8(self, name):
r"""
Gets an environment property array
:type name: string
:param name: name used for accessing the property
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
"""
return _pyflamegpu.EnvironmentDescription_getPropertyArrayInt8(self, name)
def getPropertyArrayUInt8(self, name):
r"""
Gets an environment property array
:type name: string
:param name: name used for accessing the property
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
"""
return _pyflamegpu.EnvironmentDescription_getPropertyArrayUInt8(self, name)
def getPropertyArrayChar(self, name):
r"""
Gets an environment property array
:type name: string
:param name: name used for accessing the property
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
"""
return _pyflamegpu.EnvironmentDescription_getPropertyArrayChar(self, name)
def getPropertyArrayUChar(self, name):
r"""
Gets an environment property array
:type name: string
:param name: name used for accessing the property
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
"""
return _pyflamegpu.EnvironmentDescription_getPropertyArrayUChar(self, name)
def setPropertyFloat(self, *args):
r"""
*Overload 1:*
Sets an environment property
:type name: string
:param name: name used for accessing the property
:type value: float
:param value: value to set the property
:param T: Type of the value to be returned
:rtype: float
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
|
*Overload 2:*
Sets an element of an environment property array
:type name: string
:param name: name used for accessing the property
:type index: int
:param index: element from the environment property array to set
:type value: float
:param value: value to set the property
:param T: Type of the value to be returned
:rtype: float
:return: Returns the previous value of the environment property array element which has been set
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
See also: set(const std::string &, const T &value)
"""
return _pyflamegpu.EnvironmentDescription_setPropertyFloat(self, *args)
def setPropertyDouble(self, *args):
r"""
*Overload 1:*
Sets an environment property
:type name: string
:param name: name used for accessing the property
:type value: float
:param value: value to set the property
:param T: Type of the value to be returned
:rtype: float
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
|
*Overload 2:*
Sets an element of an environment property array
:type name: string
:param name: name used for accessing the property
:type index: int
:param index: element from the environment property array to set
:type value: float
:param value: value to set the property
:param T: Type of the value to be returned
:rtype: float
:return: Returns the previous value of the environment property array element which has been set
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
See also: set(const std::string &, const T &value)
"""
return _pyflamegpu.EnvironmentDescription_setPropertyDouble(self, *args)
def setPropertyInt16(self, *args):
r"""
*Overload 1:*
Sets an environment property
:type name: string
:param name: name used for accessing the property
:type value: int
:param value: value to set the property
:param T: Type of the value to be returned
:rtype: int
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
|
*Overload 2:*
Sets an element of an environment property array
:type name: string
:param name: name used for accessing the property
:type index: int
:param index: element from the environment property array to set
:type value: int
:param value: value to set the property
:param T: Type of the value to be returned
:rtype: int
:return: Returns the previous value of the environment property array element which has been set
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
See also: set(const std::string &, const T &value)
"""
return _pyflamegpu.EnvironmentDescription_setPropertyInt16(self, *args)
def setPropertyInt32(self, *args):
r"""
*Overload 1:*
Sets an environment property
:type name: string
:param name: name used for accessing the property
:type value: int
:param value: value to set the property
:param T: Type of the value to be returned
:rtype: int
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
|
*Overload 2:*
Sets an element of an environment property array
:type name: string
:param name: name used for accessing the property
:type index: int
:param index: element from the environment property array to set
:type value: int
:param value: value to set the property
:param T: Type of the value to be returned
:rtype: int
:return: Returns the previous value of the environment property array element which has been set
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
See also: set(const std::string &, const T &value)
"""
return _pyflamegpu.EnvironmentDescription_setPropertyInt32(self, *args)
def setPropertyInt64(self, *args):
r"""
*Overload 1:*
Sets an environment property
:type name: string
:param name: name used for accessing the property
:type value: int
:param value: value to set the property
:param T: Type of the value to be returned
:rtype: int
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
|
*Overload 2:*
Sets an element of an environment property array
:type name: string
:param name: name used for accessing the property
:type index: int
:param index: element from the environment property array to set
:type value: int
:param value: value to set the property
:param T: Type of the value to be returned
:rtype: int
:return: Returns the previous value of the environment property array element which has been set
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
See also: set(const std::string &, const T &value)
"""
return _pyflamegpu.EnvironmentDescription_setPropertyInt64(self, *args)
def setPropertyUInt16(self, *args):
r"""
*Overload 1:*
Sets an environment property
:type name: string
:param name: name used for accessing the property
:type value: int
:param value: value to set the property
:param T: Type of the value to be returned
:rtype: int
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
|
*Overload 2:*
Sets an element of an environment property array
:type name: string
:param name: name used for accessing the property
:type index: int
:param index: element from the environment property array to set
:type value: int
:param value: value to set the property
:param T: Type of the value to be returned
:rtype: int
:return: Returns the previous value of the environment property array element which has been set
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
See also: set(const std::string &, const T &value)
"""
return _pyflamegpu.EnvironmentDescription_setPropertyUInt16(self, *args)
def setPropertyUInt32(self, *args):
r"""
*Overload 1:*
Sets an environment property
:type name: string
:param name: name used for accessing the property
:type value: int
:param value: value to set the property
:param T: Type of the value to be returned
:rtype: int
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
|
*Overload 2:*
Sets an element of an environment property array
:type name: string
:param name: name used for accessing the property
:type index: int
:param index: element from the environment property array to set
:type value: int
:param value: value to set the property
:param T: Type of the value to be returned
:rtype: int
:return: Returns the previous value of the environment property array element which has been set
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
See also: set(const std::string &, const T &value)
"""
return _pyflamegpu.EnvironmentDescription_setPropertyUInt32(self, *args)
def setPropertyUInt64(self, *args):
r"""
*Overload 1:*
Sets an environment property
:type name: string
:param name: name used for accessing the property
:type value: int
:param value: value to set the property
:param T: Type of the value to be returned
:rtype: int
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
|
*Overload 2:*
Sets an element of an environment property array
:type name: string
:param name: name used for accessing the property
:type index: int
:param index: element from the environment property array to set
:type value: int
:param value: value to set the property
:param T: Type of the value to be returned
:rtype: int
:return: Returns the previous value of the environment property array element which has been set
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
See also: set(const std::string &, const T &value)
"""
return _pyflamegpu.EnvironmentDescription_setPropertyUInt64(self, *args)
def setPropertyInt(self, *args):
r"""
*Overload 1:*
Sets an environment property
:type name: string
:param name: name used for accessing the property
:type value: int
:param value: value to set the property
:param T: Type of the value to be returned
:rtype: int
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
|
*Overload 2:*
Sets an element of an environment property array
:type name: string
:param name: name used for accessing the property
:type index: int
:param index: element from the environment property array to set
:type value: int
:param value: value to set the property
:param T: Type of the value to be returned
:rtype: int
:return: Returns the previous value of the environment property array element which has been set
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
See also: set(const std::string &, const T &value)
"""
return _pyflamegpu.EnvironmentDescription_setPropertyInt(self, *args)
def setPropertyUInt(self, *args):
r"""
*Overload 1:*
Sets an environment property
:type name: string
:param name: name used for accessing the property
:type value: int
:param value: value to set the property
:param T: Type of the value to be returned
:rtype: int
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
|
*Overload 2:*
Sets an element of an environment property array
:type name: string
:param name: name used for accessing the property
:type index: int
:param index: element from the environment property array to set
:type value: int
:param value: value to set the property
:param T: Type of the value to be returned
:rtype: int
:return: Returns the previous value of the environment property array element which has been set
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
See also: set(const std::string &, const T &value)
"""
return _pyflamegpu.EnvironmentDescription_setPropertyUInt(self, *args)
def setPropertyInt8(self, *args):
r"""
*Overload 1:*
Sets an environment property
:type name: string
:param name: name used for accessing the property
:type value: signed char
:param value: value to set the property
:param T: Type of the value to be returned
:rtype: signed char
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
|
*Overload 2:*
Sets an element of an environment property array
:type name: string
:param name: name used for accessing the property
:type index: int
:param index: element from the environment property array to set
:type value: signed char
:param value: value to set the property
:param T: Type of the value to be returned
:rtype: signed char
:return: Returns the previous value of the environment property array element which has been set
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
See also: set(const std::string &, const T &value)
"""
return _pyflamegpu.EnvironmentDescription_setPropertyInt8(self, *args)
def setPropertyUInt8(self, *args):
r"""
*Overload 1:*
Sets an environment property
:type name: string
:param name: name used for accessing the property
:type value: unsigned char
:param value: value to set the property
:param T: Type of the value to be returned
:rtype: unsigned char
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
|
*Overload 2:*
Sets an element of an environment property array
:type name: string
:param name: name used for accessing the property
:type index: int
:param index: element from the environment property array to set
:type value: unsigned char
:param value: value to set the property
:param T: Type of the value to be returned
:rtype: unsigned char
:return: Returns the previous value of the environment property array element which has been set
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
See also: set(const std::string &, const T &value)
"""
return _pyflamegpu.EnvironmentDescription_setPropertyUInt8(self, *args)
def setPropertyChar(self, *args):
r"""
*Overload 1:*
Sets an environment property
:type name: string
:param name: name used for accessing the property
:type value: char
:param value: value to set the property
:param T: Type of the value to be returned
:rtype: char
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
|
*Overload 2:*
Sets an element of an environment property array
:type name: string
:param name: name used for accessing the property
:type index: int
:param index: element from the environment property array to set
:type value: char
:param value: value to set the property
:param T: Type of the value to be returned
:rtype: char
:return: Returns the previous value of the environment property array element which has been set
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
See also: set(const std::string &, const T &value)
"""
return _pyflamegpu.EnvironmentDescription_setPropertyChar(self, *args)
def setPropertyUChar(self, *args):
r"""
*Overload 1:*
Sets an environment property
:type name: string
:param name: name used for accessing the property
:type value: unsigned char
:param value: value to set the property
:param T: Type of the value to be returned
:rtype: unsigned char
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
|
*Overload 2:*
Sets an element of an environment property array
:type name: string
:param name: name used for accessing the property
:type index: int
:param index: element from the environment property array to set
:type value: unsigned char
:param value: value to set the property
:param T: Type of the value to be returned
:rtype: unsigned char
:return: Returns the previous value of the environment property array element which has been set
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
See also: set(const std::string &, const T &value)
"""
return _pyflamegpu.EnvironmentDescription_setPropertyUChar(self, *args)
def setPropertyArrayFloat(self, name, value):
r"""
Sets an environment property array
:type name: string
:param name: name used for accessing the property
:type value: std::vector< float,std::allocator< float > >
:param value: value to set the property (vector must be of the correct length)
:param T: Type of the value to be returned
:rtype: std::vector< float,std::allocator< float > >
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
"""
return _pyflamegpu.EnvironmentDescription_setPropertyArrayFloat(self, name, value)
def setPropertyArrayDouble(self, name, value):
r"""
Sets an environment property array
:type name: string
:param name: name used for accessing the property
:type value: std::vector< double,std::allocator< double > >
:param value: value to set the property (vector must be of the correct length)
:param T: Type of the value to be returned
:rtype: std::vector< double,std::allocator< double > >
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
"""
return _pyflamegpu.EnvironmentDescription_setPropertyArrayDouble(self, name, value)
def setPropertyArrayInt16(self, name, value):
r"""
Sets an environment property array
:type name: string
:param name: name used for accessing the property
:type value: std::vector< short,std::allocator< short > >
:param value: value to set the property (vector must be of the correct length)
:param T: Type of the value to be returned
:rtype: std::vector< short,std::allocator< short > >
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
"""
return _pyflamegpu.EnvironmentDescription_setPropertyArrayInt16(self, name, value)
def setPropertyArrayInt32(self, name, value):
r"""
Sets an environment property array
:type name: string
:param name: name used for accessing the property
:type value: std::vector< int,std::allocator< int > >
:param value: value to set the property (vector must be of the correct length)
:param T: Type of the value to be returned
:rtype: std::vector< int,std::allocator< int > >
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
"""
return _pyflamegpu.EnvironmentDescription_setPropertyArrayInt32(self, name, value)
def setPropertyArrayInt64(self, name, value):
r"""
Sets an environment property array
:type name: string
:param name: name used for accessing the property
:type value: std::vector< long long,std::allocator< long long > >
:param value: value to set the property (vector must be of the correct length)
:param T: Type of the value to be returned
:rtype: std::vector< long long,std::allocator< long long > >
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
"""
return _pyflamegpu.EnvironmentDescription_setPropertyArrayInt64(self, name, value)
def setPropertyArrayUInt16(self, name, value):
r"""
Sets an environment property array
:type name: string
:param name: name used for accessing the property
:type value: std::vector< unsigned short,std::allocator< unsigned short > >
:param value: value to set the property (vector must be of the correct length)
:param T: Type of the value to be returned
:rtype: std::vector< unsigned short,std::allocator< unsigned short > >
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
"""
return _pyflamegpu.EnvironmentDescription_setPropertyArrayUInt16(self, name, value)
def setPropertyArrayUInt32(self, name, value):
r"""
Sets an environment property array
:type name: string
:param name: name used for accessing the property
:type value: std::vector< unsigned int,std::allocator< unsigned int > >
:param value: value to set the property (vector must be of the correct length)
:param T: Type of the value to be returned
:rtype: std::vector< unsigned int,std::allocator< unsigned int > >
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
"""
return _pyflamegpu.EnvironmentDescription_setPropertyArrayUInt32(self, name, value)
def setPropertyArrayUInt64(self, name, value):
r"""
Sets an environment property array
:type name: string
:param name: name used for accessing the property
:type value: std::vector< unsigned long long,std::allocator< unsigned long long > >
:param value: value to set the property (vector must be of the correct length)
:param T: Type of the value to be returned
:rtype: std::vector< unsigned long long,std::allocator< unsigned long long > >
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
"""
return _pyflamegpu.EnvironmentDescription_setPropertyArrayUInt64(self, name, value)
def setPropertyArrayInt(self, name, value):
r"""
Sets an environment property array
:type name: string
:param name: name used for accessing the property
:type value: std::vector< int,std::allocator< int > >
:param value: value to set the property (vector must be of the correct length)
:param T: Type of the value to be returned
:rtype: std::vector< int,std::allocator< int > >
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
"""
return _pyflamegpu.EnvironmentDescription_setPropertyArrayInt(self, name, value)
def setPropertyArrayUInt(self, name, value):
r"""
Sets an environment property array
:type name: string
:param name: name used for accessing the property
:type value: std::vector< unsigned int,std::allocator< unsigned int > >
:param value: value to set the property (vector must be of the correct length)
:param T: Type of the value to be returned
:rtype: std::vector< unsigned int,std::allocator< unsigned int > >
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
"""
return _pyflamegpu.EnvironmentDescription_setPropertyArrayUInt(self, name, value)
def setPropertyArrayInt8(self, name, value):
r"""
Sets an environment property array
:type name: string
:param name: name used for accessing the property
:type value: std::vector< signed char,std::allocator< signed char > >
:param value: value to set the property (vector must be of the correct length)
:param T: Type of the value to be returned
:rtype: std::vector< signed char,std::allocator< signed char > >
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
"""
return _pyflamegpu.EnvironmentDescription_setPropertyArrayInt8(self, name, value)
def setPropertyArrayUInt8(self, name, value):
r"""
Sets an environment property array
:type name: string
:param name: name used for accessing the property
:type value: std::vector< unsigned char,std::allocator< unsigned char > >
:param value: value to set the property (vector must be of the correct length)
:param T: Type of the value to be returned
:rtype: std::vector< unsigned char,std::allocator< unsigned char > >
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
"""
return _pyflamegpu.EnvironmentDescription_setPropertyArrayUInt8(self, name, value)
def setPropertyArrayChar(self, name, value):
r"""
Sets an environment property array
:type name: string
:param name: name used for accessing the property
:type value: std::vector< char,std::allocator< char > >
:param value: value to set the property (vector must be of the correct length)
:param T: Type of the value to be returned
:rtype: std::vector< char,std::allocator< char > >
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
"""
return _pyflamegpu.EnvironmentDescription_setPropertyArrayChar(self, name, value)
def setPropertyArrayUChar(self, name, value):
r"""
Sets an environment property array
:type name: string
:param name: name used for accessing the property
:type value: std::vector< unsigned char,std::allocator< unsigned char > >
:param value: value to set the property (vector must be of the correct length)
:param T: Type of the value to be returned
:rtype: std::vector< unsigned char,std::allocator< unsigned char > >
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
"""
return _pyflamegpu.EnvironmentDescription_setPropertyArrayUChar(self, name, value)
__swig_destroy__ = _pyflamegpu.delete_EnvironmentDescription
# Register EnvironmentDescription in _pyflamegpu:
_pyflamegpu.EnvironmentDescription_swigregister(EnvironmentDescription)
class LayerDescription(object):
r"""
Within the model hierarchy, this class represents an execution layer for a FLAMEGPU model
This class is used to configure which agent and host functions execute at a stage of the model's execution
See also: ModelDescription::newLayer(const std::string&) For creating instances of this class
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
def __init__(self, *args, **kwargs):
raise AttributeError("No constructor defined")
__repr__ = _swig_repr
def __eq__(self, rhs):
r"""
Equality operator, checks whether LayerDescription hierarchies are functionally the same
:rtype: boolean
:return: True when layers are the same
Notes: Instead compare pointers if you wish to check that they are the same instance
"""
return _pyflamegpu.LayerDescription___eq__(self, rhs)
def __ne__(self, rhs):
r"""
Equality operator, checks whether LayerDescription hierarchies are functionally different
:rtype: boolean
:return: True when layers are not the same
Notes: Instead compare pointers if you wish to check that they are not the same instance
"""
return _pyflamegpu.LayerDescription___ne__(self, rhs)
def addAgentFunction(self, *args):
r"""
*Overload 1:*
Adds an agent function to this layer
The agent function will be called during this stage of model execution
:type afd: :py:class:`AgentFunctionDescription`
:param afd: Agent function description to execute during this layer
:raises: InvalidAgentFunc If the agent function does not exist within the model hierarchy
:raises: InvalidAgentFunc If the agent function has already been added to the layer
:raises: InvalidLayerMember If the layer already contains a SubModel
:raises: InvalidLayerMember If the agent function outputs to a message list output to by an existing agent function of the layer
:raises: InvalidLayerMember If the agent function outputs an agent in the same agent state as an existing agent function's input state (or vice versa)
|
*Overload 2:*
Adds an agent function to this layer
The agent function will be called during this stage of model execution
:type agentName: string
:param agentName: Name of the agent which owns the function to execute during this layer
:type functionName: string
:param functionName: Name of the agent function description to execute during this layer
:raises: InvalidAgentFunc If the agent function does not exist within the model hierarchy
:raises: InvalidAgentFunc If the agent function has already been added to the layer
:raises: InvalidLayerMember If the layer already contains a SubModel
:raises: InvalidLayerMember If the agent function outputs to a message list output to by an existing agent function of the layer
:raises: InvalidLayerMember If the agent function outputs an agent in the same agent state as an existing agent function's input state (or vice versa)
|
*Overload 3:*
Adds an agent function to this layer
The agent function will be called during this stage of model execution
:type agentName: string
:param agentName: Name of the agent which owns the function to execute during this layer
:type functionName: string
:param functionName: Name of the agent function description to execute during this layer
:raises: InvalidAgentFunc If the agent function does not exist within the model hierarchy
:raises: InvalidAgentFunc If the agent function has already been added to the layer
:raises: InvalidLayerMember If the layer already contains a SubModel
:raises: InvalidLayerMember If the agent function outputs to a message list output to by an existing agent function of the layer
:raises: InvalidLayerMember If the agent function outputs an agent in the same agent state as an existing agent function's input state (or vice versa)
Notes: This version exists because the template overload was preventing implicit cast to std::string
"""
return _pyflamegpu.LayerDescription_addAgentFunction(self, *args)
def addSubModel(self, *args):
r"""
*Overload 1:*
Adds a submodel to a layer
If layer contains a submodel, it may contain nothing else
:type name: string
:param name: Name of the submodel (passed to ModelDescription::newSubModel() was called)
:raises: InvalidLayerMember If the layer already contains any agent functions or host functions
:raises: InvalidSubModel If the layer already contains a submodel
See also: addSubModel(const SubModelDescription &)
|
*Overload 2:*
Adds a submodel to a layer
If layer contains a submodel, it may contain nothing else
:type submodel: :py:class:`SubModelDescription`
:param submodel: SubModel description of the layer to be bound
:raises: InvalidLayerMember If the layer already contains any agent functions or host functions
:raises: InvalidSubModel If the layer already contains a submodel
See also: addSubModel(const std::string &)
"""
return _pyflamegpu.LayerDescription_addSubModel(self, *args)
def _addHostFunctionCallback(self, func_callback):
r"""
Adds a host function to this layer, similar to addHostFunction
however the runnable function is encapsulated within an object which permits cross language support in swig.
The host function will be called during this stage of model execution
:type func_callback: :py:class:`HostFunctionCallback`
:param func_callback: a Host function callback object
:raises: InvalidHostFunc If the function has already been added to the layer
Notes: ONLY USED INTERNALLY AND BY PYTHON API - DO NOT CALL IN C++ BUILD
"""
return _pyflamegpu.LayerDescription__addHostFunctionCallback(self, func_callback)
def getName(self):
r"""
:rtype: string
:return: The layer's name
"""
return _pyflamegpu.LayerDescription_getName(self)
def getIndex(self):
r"""
:rtype: int
:return: The index of the layer within the model's execution
"""
return _pyflamegpu.LayerDescription_getIndex(self)
def getAgentFunctionsCount(self):
r"""
:rtype: int
:return: The total number of agent functions within the layer
"""
return _pyflamegpu.LayerDescription_getAgentFunctionsCount(self)
def getHostFunctionsCount(self):
r"""
:rtype: int
:return: The total number of host functions within the layer
"""
return _pyflamegpu.LayerDescription_getHostFunctionsCount(self)
def getHostFunctionCallbackCount(self):
r"""
:rtype: int
:return: The total number of host function callbacks within the layer
"""
return _pyflamegpu.LayerDescription_getHostFunctionCallbackCount(self)
def addHostFunctionCallback(self, func_callback):
r"""
Adds a host function to this layer, similar to addHostFunction
however the runnable function is encapsulated within an object which permits cross language support in swig.
The host function will be called during this stage of model execution
:type func_callback: :py:class:`HostFunctionCallback`
:param func_callback: a Host function callback object
:raises: InvalidHostFunc If the function has already been added to the layer
Notes: ONLY USED INTERNALLY AND BY PYTHON API - DO NOT CALL IN C++ BUILD
"""
return _pyflamegpu.LayerDescription_addHostFunctionCallback(self, func_callback)
def getAgentFunction(self, index):
r"""
:type index: int
:param index: Index of the function to return
:rtype: :py:class:`AgentFunctionDescription`
:return: An immutable reference to the agent function at the provided index
:raises: OutOfBoundsException When index exceeds number of agent functions in the layer
See also: LayerDescription::getAgentFunctionsCount()
Notes: Functions are stored in a set, so order may change as new functions are added
"""
return _pyflamegpu.LayerDescription_getAgentFunction(self, index)
def getHostFunction(self, index):
r"""
:type index: int
:param index: Index of the function to return
:rtype: FLAMEGPU_HOST_FUNCTION_POINTER
:return: A function pointer to the host function at the provided index
:raises: OutOfBoundsException When index exceeds number of host functions in the layer
See also: LayerDescription::getHostFunctionsCount()
Notes: Functions are stored in a set, so order may change as new functions are added
"""
return _pyflamegpu.LayerDescription_getHostFunction(self, index)
def getHostFunctionCallback(self, index):
r"""
:type index: int
:param index: Index of the function to return
:rtype: :py:class:`HostFunctionCallback`
:return: A function callback to the host function at the provided index
:raises: OutOfBoundsException When index exceeds number of host functions in the layer
See also: LayerDescription::getHostFunctionCallbackCount()
Notes: Functions are stored in a set, so order may change as new functions are added
"""
return _pyflamegpu.LayerDescription_getHostFunctionCallback(self, index)
__swig_destroy__ = _pyflamegpu.delete_LayerDescription
# Register LayerDescription in _pyflamegpu:
_pyflamegpu.LayerDescription_swigregister(LayerDescription)
class SubModelDescription(DependencyNode):
r"""This class provides an interface to a mapping between the parent and sub-model"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
def __init__(self, *args, **kwargs):
raise AttributeError("No constructor defined")
__repr__ = _swig_repr
def bindAgent(self, sub_agent_name, master_agent_name, auto_map_vars=False, auto_map_states=True):
r"""
Defines which agent from the parent/master model will be mapped to which agent in the submodel
Only 1 master agent can be bound to each sub agent, however the same master agent can be bound to many sub agents
Binding an agent to a subagent, ensures the population of subagents is always the same size.
Furthermore, agent variables can be mapped so that they are shared between the two agents.
Returns SubAgentDescription which can be used to manually map variables
If auto_map_vars is enabled, variables with matching name, type and length will be automatically mapped
:type sub_agent_name: string
:param sub_agent_name: Name of the agent in the submodel (must be unique, 1 bind per subagent)
:type master_agent_name: string
:param master_agent_name: Name of the agent in the parent/host/master model
:type auto_map_vars: boolean, optional
:param auto_map_vars: Whether to automatically map matching variables of the two agents
:type auto_map_states: boolean, optional
:param auto_map_states: Whether to automatically map matching states of the two agents
:raises: InvalidSubAgentName If the sub agent name does not map to a valid agent
:raises: InvalidAgentName If the master agent has already been bound
:raises: InvalidSubAgentName If the sub agent name does not map to a valid agent
:raises: InvalidAgentName If the master agent has already been bound
"""
return _pyflamegpu.SubModelDescription_bindAgent(self, sub_agent_name, master_agent_name, auto_map_vars, auto_map_states)
def SubAgent(self, sub_agent_name):
r"""
Returns a mutable reference to the named SubAgent description if it has already been bound to a master agent
:type sub_agent_name: string
:param sub_agent_name: Name of the sub agent, who's description to return
:rtype: :py:class:`SubAgentDescription`
:return: A mutable reference to the named SubAgent description
:raises: InvalidSubAgentName If the sub_agent_name does not exist within the sub_model and/or has not been bound yet
See also: SubModelDescription::getSubAgent(const std::string &) for the immutable version
"""
return _pyflamegpu.SubModelDescription_SubAgent(self, sub_agent_name)
def getSubAgent(self, sub_agent_name):
r"""
Returns an immutable reference to the named SubAgent description if it has already been bound to a master agent
:type sub_agent_name: string
:param sub_agent_name: Name of the sub agent, who's description to return
:rtype: :py:class:`SubAgentDescription`
:return: An immutable reference to the named SubAgent description
:raises: InvalidSubAgentName If the sub_agent_name does not exist within the sub_model and/or has not been bound yet
See also: SubModelDescription::SubAgent(const std::string &) for the mutable version
"""
return _pyflamegpu.SubModelDescription_getSubAgent(self, sub_agent_name)
def SubEnvironment(self, auto_map_props=False):
return _pyflamegpu.SubModelDescription_SubEnvironment(self, auto_map_props)
def getSubEnvironment(self, auto_map_props=False):
return _pyflamegpu.SubModelDescription_getSubEnvironment(self, auto_map_props)
def setMaxSteps(self, max_steps):
r"""
Set the maximum number of steps per execution of the submodel
If 0 (default), unlimited however an exit condition is required
"""
return _pyflamegpu.SubModelDescription_setMaxSteps(self, max_steps)
def getMaxSteps(self):
r"""
Return the current value of max steps, defaults to 0
This is the maximum number of steps per call of the submodel
0 is unlimited, however requires the model to have an exit condition
"""
return _pyflamegpu.SubModelDescription_getMaxSteps(self)
def getName(self):
return _pyflamegpu.SubModelDescription_getName(self)
__swig_destroy__ = _pyflamegpu.delete_SubModelDescription
# Register SubModelDescription in _pyflamegpu:
_pyflamegpu.SubModelDescription_swigregister(SubModelDescription)
class SubAgentDescription(object):
r"""This class provides an interface to a mapping between a parent and submodel agent"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
def __init__(self, *args, **kwargs):
raise AttributeError("No constructor defined")
__repr__ = _swig_repr
def mapState(self, sub_state_name, master_state_name):
r"""
Links the named states between the master and sub agent
:type sub_state_name: string
:param sub_state_name: Name of the state in the sub models agent
:type master_state_name: string
:param master_state_name: Name of the state in the master models agent
:raises: InvalidParent If the sub agent or master agent weak_ptrs have expired (this should never happen)
:raises: InvalidAgentState If the named state does not exist within the bound sub or master agent
"""
return _pyflamegpu.SubAgentDescription_mapState(self, sub_state_name, master_state_name)
def mapVariable(self, sub_variable_name, master_variable_name):
r"""
Links the named variables between the master and sub agent
These variables must have the same type and number of elements (1 unless they're an array variable)
:type sub_variable_name: string
:param sub_variable_name: Name of the variable in the sub models agent
:type master_variable_name: string
:param master_variable_name: Name of the variable in the master models agent
:raises: InvalidParent If the sub agent or master agent weak_ptrs have expired (this should never happen)
:raises: InvalidAgentVar If the named variable does not exist within the bound sub or master agent
:raises: InvalidAgentVar If there is a mismatch between the variables types or number of elements
"""
return _pyflamegpu.SubAgentDescription_mapVariable(self, sub_variable_name, master_variable_name)
def getStateMapping(self, sub_state_name):
r"""
Returns the master agent state which has been mapped to the name subagent state
:type sub_state_name: string
:param sub_state_name: Name of the state in the sub agent to check
:rtype: string
:return: The name of the state within the master agent which is mapped
:raises: InvalidAgentState If the sub agent state does not exist or has not been mapped yet
"""
return _pyflamegpu.SubAgentDescription_getStateMapping(self, sub_state_name)
def getVariableMapping(self, sub_variable_name):
r"""
Returns the master agent variable which has been mapped to the name subagent variable
:type sub_variable_name: string
:param sub_variable_name: Name of the variable in the sub agent to check
:rtype: string
:return: The name of the variable within the master agent which is mapped
:raises: InvalidAgentVar If the sub agent variable does not exist or has not been mapped yet
"""
return _pyflamegpu.SubAgentDescription_getVariableMapping(self, sub_variable_name)
__swig_destroy__ = _pyflamegpu.delete_SubAgentDescription
# Register SubAgentDescription in _pyflamegpu:
_pyflamegpu.SubAgentDescription_swigregister(SubAgentDescription)
class SubEnvironmentDescription(object):
r"""This class provides an interface to a mapping between a parent and submodel's environment properties"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
def __init__(self, *args, **kwargs):
raise AttributeError("No constructor defined")
__repr__ = _swig_repr
def autoMapProperties(self):
r"""
Automatically map all compatible properties
In order to be compatible, properties must share the same name, type, length (number of elements)
Const master properties cannot be mapped to non-const sub properties, however the inverse is permitted
"""
return _pyflamegpu.SubEnvironmentDescription_autoMapProperties(self)
def mapProperty(self, sub_property_name, master_property_name):
r"""
Links the named properties between the master and sub environment
In order to be compatible, properties must share the same name, type, length (number of elements)
Const master properties cannot be mapped to non-const sub properties, however the inverse is permitted
:type sub_property_name: string
:param sub_property_name: Name of the property in the sub models agent
:type master_property_name: string
:param master_property_name: Name of the property in the master models agent
:raises: InvalidParent If the sub agent or master agent weak_ptrs have expired (this should never happen)
:raises: InvalidEnvProperty If the named property does not exist within the bound sub or master environment
:raises: InvalidEnvProperty If the named properties do not share the same type and length
"""
return _pyflamegpu.SubEnvironmentDescription_mapProperty(self, sub_property_name, master_property_name)
def getPropertyMapping(self, sub_property_name):
r"""
Returns the master agent property which has been mapped to the name subagent state
:type sub_property_name: string
:param sub_property_name: Name of the state in the sub agent to check
:rtype: string
:return: The name of the state within the master agent which is mapped
:raises: InvalidEnvProperty If the sub environment property does not exist or has not been mapped yet
"""
return _pyflamegpu.SubEnvironmentDescription_getPropertyMapping(self, sub_property_name)
__swig_destroy__ = _pyflamegpu.delete_SubEnvironmentDescription
# Register SubEnvironmentDescription in _pyflamegpu:
_pyflamegpu.SubEnvironmentDescription_swigregister(SubEnvironmentDescription)
class AgentVector(object):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self, *args):
r"""
*Overload 1:*
Constructs the container with count copies of the agent described by agent_desc
initialised with the default values specified by agent_desc.
:type agent_desc: :py:class:`AgentDescription`
:param agent_desc: agent_desc Agent description specifying the agent variables to be represented
:type count: int, optional
:param count: The size of the container
|
*Overload 2:*
Copy constructor.
Constructs the container with the copy of the contents of other
:type other: :py:class:`AgentVector`
:param other: another container to be used as source to initialize the elements of the container with
|
*Overload 3:*
Move constructor
Constructs the container with the contents of other using move semantics.
other is left in an empty but functional state.
:type other: :py:class:`AgentVector`
:param other: another container to be used as source to initialize the elements of the container with
"""
_pyflamegpu.AgentVector_swiginit(self, _pyflamegpu.new_AgentVector(*args))
__swig_destroy__ = _pyflamegpu.delete_AgentVector
def at(self, *args):
return _pyflamegpu.AgentVector_at(self, *args)
def front(self, *args):
return _pyflamegpu.AgentVector_front(self, *args)
def back(self, *args):
return _pyflamegpu.AgentVector_back(self, *args)
def empty(self):
r"""
Checks if the container has no elements, i.e. whether begin() == end()
:rtype: boolean
:return: `true` if the container is empty, `false` otherwise
"""
return _pyflamegpu.AgentVector_empty(self)
def size(self):
r"""
Returns the number of elements in the container, i.e. std::distance(begin(), end())
:rtype: int
:return: The number of elements in the container.
"""
return _pyflamegpu.AgentVector_size(self)
@staticmethod
def max_size():
r"""
Returns the maximum number of elements the container is able to hold due to system or library implementation limitations,
i.e. std::distance(begin(), end()) for the largest container.
:rtype: int
:return: Maximum number of elements.
Notes: This value typically reflects the theoretical limit on the size of the container, at most `std::numeric_limits<difference_type>::max()`.
At runtime, the size of the container may be limited to a value smaller than max_size() by the amount of RAM available.
"""
return _pyflamegpu.AgentVector_max_size()
def reserve(self, new_cap):
r"""
Increase the capacity of the vector to a value that's greater or equal to new_cap. If new_cap is greater than the current capacity(),
new storage is allocated, otherwise the method does nothing.
reserve() does not change the size of the vector.
If new_cap is greater than capacity(), all iterators, including the past-the-end iterator, and all AgentViews are invalidated.
Otherwise, no iterators or references are invalidated.
:type new_cap: int
:param new_cap: new capacity of the vector
:raises: std::length_error if new_cap > max_size().
"""
return _pyflamegpu.AgentVector_reserve(self, new_cap)
def capacity(self):
r"""
Returns the number of elements that the container has currently allocated space for.
:rtype: int
:return: Capacity of the currently allocated storage.
"""
return _pyflamegpu.AgentVector_capacity(self)
def shrink_to_fit(self):
r"""
Requests the removal of unused capacity.
If reallocation occurs, all iterators, including the past the end iterator, and all references to the elements are invalidated.
If no reallocation takes place, no iterators or references are invalidated.
"""
return _pyflamegpu.AgentVector_shrink_to_fit(self)
def clear(self):
r"""
Erases all elements from the container. After this call, size() returns zero.
Invalidates any references, pointers, or iterators referring to contained elements. Any past-the-end iterators are also invalidated.
Leaves the capacity() of the vector unchanged
"""
return _pyflamegpu.AgentVector_clear(self)
def insert(self, *args):
return _pyflamegpu.AgentVector_insert(self, *args)
def erase(self, *args):
return _pyflamegpu.AgentVector_erase(self, *args)
def push_back(self, *args):
r"""
*Overload 1:*
Appends the given agent to the end of the container.
The new element is initialized as a copy of value
If the new size() is greater than capacity() then all iterators and references (including the past-the-end iterator) are invalidated.
Otherwise only the past-the-end iterator is invalidated.
:type value: :py:class:`AgentInstance`
:param value: the value of the agent to append
:raises: InvalidAgent If the agent type of the AgentInstance doesn't match the agent type of the AgentVector
|
*Overload 2:*
Appends a default initialised agent to the end of the container
"""
return _pyflamegpu.AgentVector_push_back(self, *args)
def pop_back(self):
r"""
Removes the last agent of the container.
Calling pop_back on an empty container results in undefined behavior.
Iterators and references to the last element, as well as the end() iterator, are invalidated.
"""
return _pyflamegpu.AgentVector_pop_back(self)
def resize(self, count):
r"""
Resizes the vector to contain count agents.
If the current size is greater than count, the container is reduced to its first count elements.
If the current size is less than count, additional default agents are appended
:type count: int
:param count: size of the container
"""
return _pyflamegpu.AgentVector_resize(self, count)
def swap(self, other):
r"""
Exchanges the contents of the container with those of other. Does not invoke any move, copy, or swap operations on individual elements.
All iterators and references remain valid. The past-the-end iterator is invalidated.
"""
return _pyflamegpu.AgentVector_swap(self, other)
def __eq__(self, other):
r"""
Checks if the contents of lhs and rhs are equal,
that is, they have the same number of elements and each element in lhs compares equal with the element in rhs at the same position.
"""
return _pyflamegpu.AgentVector___eq__(self, other)
def __ne__(self, other):
return _pyflamegpu.AgentVector___ne__(self, other)
def getAgentName(self):
r"""Returns the agent name from the internal agent description"""
return _pyflamegpu.AgentVector_getAgentName(self)
def matchesAgentType(self, *args):
return _pyflamegpu.AgentVector_matchesAgentType(self, *args)
def getInitialState(self):
r"""Returns the initial state of the internal agent description"""
return _pyflamegpu.AgentVector_getInitialState(self)
def __iter__(self):
return FLAMEGPUIterator(self)
def __len__(self):
return self.size()
def __getitem__(self, index):
return _pyflamegpu.AgentVector___getitem__(self, index)
def __setitem__(self, index, value):
return _pyflamegpu.AgentVector___setitem__(self, index, value)
# Register AgentVector in _pyflamegpu:
_pyflamegpu.AgentVector_swigregister(AgentVector)
def AgentVector_max_size():
r"""
Returns the maximum number of elements the container is able to hold due to system or library implementation limitations,
i.e. std::distance(begin(), end()) for the largest container.
:rtype: int
:return: Maximum number of elements.
Notes: This value typically reflects the theoretical limit on the size of the container, at most `std::numeric_limits<difference_type>::max()`.
At runtime, the size of the container may be limited to a value smaller than max_size() by the amount of RAM available.
"""
return _pyflamegpu.AgentVector_max_size()
class AgentVector_CAgent(object):
r"""const view into AgentVector"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
def __init__(self, *args, **kwargs):
raise AttributeError("No constructor defined")
__repr__ = _swig_repr
__swig_destroy__ = _pyflamegpu.delete_AgentVector_CAgent
def getVariableFloat(self, *args):
return _pyflamegpu.AgentVector_CAgent_getVariableFloat(self, *args)
def getVariableDouble(self, *args):
return _pyflamegpu.AgentVector_CAgent_getVariableDouble(self, *args)
def getVariableInt16(self, *args):
return _pyflamegpu.AgentVector_CAgent_getVariableInt16(self, *args)
def getVariableInt32(self, *args):
return _pyflamegpu.AgentVector_CAgent_getVariableInt32(self, *args)
def getVariableInt64(self, *args):
return _pyflamegpu.AgentVector_CAgent_getVariableInt64(self, *args)
def getVariableUInt16(self, *args):
return _pyflamegpu.AgentVector_CAgent_getVariableUInt16(self, *args)
def getVariableUInt32(self, *args):
return _pyflamegpu.AgentVector_CAgent_getVariableUInt32(self, *args)
def getVariableUInt64(self, *args):
return _pyflamegpu.AgentVector_CAgent_getVariableUInt64(self, *args)
def getVariableInt(self, *args):
return _pyflamegpu.AgentVector_CAgent_getVariableInt(self, *args)
def getVariableUInt(self, *args):
return _pyflamegpu.AgentVector_CAgent_getVariableUInt(self, *args)
def getVariableInt8(self, *args):
return _pyflamegpu.AgentVector_CAgent_getVariableInt8(self, *args)
def getVariableUInt8(self, *args):
return _pyflamegpu.AgentVector_CAgent_getVariableUInt8(self, *args)
def getVariableChar(self, *args):
return _pyflamegpu.AgentVector_CAgent_getVariableChar(self, *args)
def getVariableUChar(self, *args):
return _pyflamegpu.AgentVector_CAgent_getVariableUChar(self, *args)
def getVariableArrayFloat(self, variable_name):
return _pyflamegpu.AgentVector_CAgent_getVariableArrayFloat(self, variable_name)
def getVariableArrayDouble(self, variable_name):
return _pyflamegpu.AgentVector_CAgent_getVariableArrayDouble(self, variable_name)
def getVariableArrayInt16(self, variable_name):
return _pyflamegpu.AgentVector_CAgent_getVariableArrayInt16(self, variable_name)
def getVariableArrayInt32(self, variable_name):
return _pyflamegpu.AgentVector_CAgent_getVariableArrayInt32(self, variable_name)
def getVariableArrayInt64(self, variable_name):
return _pyflamegpu.AgentVector_CAgent_getVariableArrayInt64(self, variable_name)
def getVariableArrayUInt16(self, variable_name):
return _pyflamegpu.AgentVector_CAgent_getVariableArrayUInt16(self, variable_name)
def getVariableArrayUInt32(self, variable_name):
return _pyflamegpu.AgentVector_CAgent_getVariableArrayUInt32(self, variable_name)
def getVariableArrayUInt64(self, variable_name):
return _pyflamegpu.AgentVector_CAgent_getVariableArrayUInt64(self, variable_name)
def getVariableArrayInt(self, variable_name):
return _pyflamegpu.AgentVector_CAgent_getVariableArrayInt(self, variable_name)
def getVariableArrayUInt(self, variable_name):
return _pyflamegpu.AgentVector_CAgent_getVariableArrayUInt(self, variable_name)
def getVariableArrayInt8(self, variable_name):
return _pyflamegpu.AgentVector_CAgent_getVariableArrayInt8(self, variable_name)
def getVariableArrayUInt8(self, variable_name):
return _pyflamegpu.AgentVector_CAgent_getVariableArrayUInt8(self, variable_name)
def getVariableArrayChar(self, variable_name):
return _pyflamegpu.AgentVector_CAgent_getVariableArrayChar(self, variable_name)
def getVariableArrayUChar(self, variable_name):
return _pyflamegpu.AgentVector_CAgent_getVariableArrayUChar(self, variable_name)
# Register AgentVector_CAgent in _pyflamegpu:
_pyflamegpu.AgentVector_CAgent_swigregister(AgentVector_CAgent)
class AgentVector_Agent(AgentVector_CAgent):
r"""non-const view into AgentVector"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
def __init__(self, *args, **kwargs):
raise AttributeError("No constructor defined")
__repr__ = _swig_repr
def setData(self, other):
return _pyflamegpu.AgentVector_Agent_setData(self, other)
def setVariableFloat(self, *args):
return _pyflamegpu.AgentVector_Agent_setVariableFloat(self, *args)
def setVariableDouble(self, *args):
return _pyflamegpu.AgentVector_Agent_setVariableDouble(self, *args)
def setVariableInt16(self, *args):
return _pyflamegpu.AgentVector_Agent_setVariableInt16(self, *args)
def setVariableInt32(self, *args):
return _pyflamegpu.AgentVector_Agent_setVariableInt32(self, *args)
def setVariableInt64(self, *args):
return _pyflamegpu.AgentVector_Agent_setVariableInt64(self, *args)
def setVariableUInt16(self, *args):
return _pyflamegpu.AgentVector_Agent_setVariableUInt16(self, *args)
def setVariableUInt32(self, *args):
return _pyflamegpu.AgentVector_Agent_setVariableUInt32(self, *args)
def setVariableUInt64(self, *args):
return _pyflamegpu.AgentVector_Agent_setVariableUInt64(self, *args)
def setVariableInt(self, *args):
return _pyflamegpu.AgentVector_Agent_setVariableInt(self, *args)
def setVariableUInt(self, *args):
return _pyflamegpu.AgentVector_Agent_setVariableUInt(self, *args)
def setVariableInt8(self, *args):
return _pyflamegpu.AgentVector_Agent_setVariableInt8(self, *args)
def setVariableUInt8(self, *args):
return _pyflamegpu.AgentVector_Agent_setVariableUInt8(self, *args)
def setVariableChar(self, *args):
return _pyflamegpu.AgentVector_Agent_setVariableChar(self, *args)
def setVariableUChar(self, *args):
return _pyflamegpu.AgentVector_Agent_setVariableUChar(self, *args)
def setVariableArrayFloat(self, variable_name, value):
return _pyflamegpu.AgentVector_Agent_setVariableArrayFloat(self, variable_name, value)
def setVariableArrayDouble(self, variable_name, value):
return _pyflamegpu.AgentVector_Agent_setVariableArrayDouble(self, variable_name, value)
def setVariableArrayInt16(self, variable_name, value):
return _pyflamegpu.AgentVector_Agent_setVariableArrayInt16(self, variable_name, value)
def setVariableArrayInt32(self, variable_name, value):
return _pyflamegpu.AgentVector_Agent_setVariableArrayInt32(self, variable_name, value)
def setVariableArrayInt64(self, variable_name, value):
return _pyflamegpu.AgentVector_Agent_setVariableArrayInt64(self, variable_name, value)
def setVariableArrayUInt16(self, variable_name, value):
return _pyflamegpu.AgentVector_Agent_setVariableArrayUInt16(self, variable_name, value)
def setVariableArrayUInt32(self, variable_name, value):
return _pyflamegpu.AgentVector_Agent_setVariableArrayUInt32(self, variable_name, value)
def setVariableArrayUInt64(self, variable_name, value):
return _pyflamegpu.AgentVector_Agent_setVariableArrayUInt64(self, variable_name, value)
def setVariableArrayInt(self, variable_name, value):
return _pyflamegpu.AgentVector_Agent_setVariableArrayInt(self, variable_name, value)
def setVariableArrayUInt(self, variable_name, value):
return _pyflamegpu.AgentVector_Agent_setVariableArrayUInt(self, variable_name, value)
def setVariableArrayInt8(self, variable_name, value):
return _pyflamegpu.AgentVector_Agent_setVariableArrayInt8(self, variable_name, value)
def setVariableArrayUInt8(self, variable_name, value):
return _pyflamegpu.AgentVector_Agent_setVariableArrayUInt8(self, variable_name, value)
def setVariableArrayChar(self, variable_name, value):
return _pyflamegpu.AgentVector_Agent_setVariableArrayChar(self, variable_name, value)
def setVariableArrayUChar(self, variable_name, value):
return _pyflamegpu.AgentVector_Agent_setVariableArrayUChar(self, variable_name, value)
__swig_destroy__ = _pyflamegpu.delete_AgentVector_Agent
# Register AgentVector_Agent in _pyflamegpu:
_pyflamegpu.AgentVector_Agent_swigregister(AgentVector_Agent)
class AgentInstance(object):
r"""
This class represents standalone copy of a single agent
It stores all the data internally, unlike an AgentVector::Agent
Notes: Not 100% on the name, might change
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self, *args):
r"""
*Overload 1:*
Initialises the agent variables with their default values
|
*Overload 2:*
Copy constructors
|
*Overload 3:*
Move constructor
"""
_pyflamegpu.AgentInstance_swiginit(self, _pyflamegpu.new_AgentInstance(*args))
def setVariableFloat(self, *args):
return _pyflamegpu.AgentInstance_setVariableFloat(self, *args)
def setVariableDouble(self, *args):
return _pyflamegpu.AgentInstance_setVariableDouble(self, *args)
def setVariableInt16(self, *args):
return _pyflamegpu.AgentInstance_setVariableInt16(self, *args)
def setVariableInt32(self, *args):
return _pyflamegpu.AgentInstance_setVariableInt32(self, *args)
def setVariableInt64(self, *args):
return _pyflamegpu.AgentInstance_setVariableInt64(self, *args)
def setVariableUInt16(self, *args):
return _pyflamegpu.AgentInstance_setVariableUInt16(self, *args)
def setVariableUInt32(self, *args):
return _pyflamegpu.AgentInstance_setVariableUInt32(self, *args)
def setVariableUInt64(self, *args):
return _pyflamegpu.AgentInstance_setVariableUInt64(self, *args)
def setVariableInt(self, *args):
return _pyflamegpu.AgentInstance_setVariableInt(self, *args)
def setVariableUInt(self, *args):
return _pyflamegpu.AgentInstance_setVariableUInt(self, *args)
def setVariableInt8(self, *args):
return _pyflamegpu.AgentInstance_setVariableInt8(self, *args)
def setVariableUInt8(self, *args):
return _pyflamegpu.AgentInstance_setVariableUInt8(self, *args)
def setVariableChar(self, *args):
return _pyflamegpu.AgentInstance_setVariableChar(self, *args)
def setVariableUChar(self, *args):
return _pyflamegpu.AgentInstance_setVariableUChar(self, *args)
def setVariableArrayFloat(self, variable_name, value):
return _pyflamegpu.AgentInstance_setVariableArrayFloat(self, variable_name, value)
def setVariableArrayDouble(self, variable_name, value):
return _pyflamegpu.AgentInstance_setVariableArrayDouble(self, variable_name, value)
def setVariableArrayInt16(self, variable_name, value):
return _pyflamegpu.AgentInstance_setVariableArrayInt16(self, variable_name, value)
def setVariableArrayInt32(self, variable_name, value):
return _pyflamegpu.AgentInstance_setVariableArrayInt32(self, variable_name, value)
def setVariableArrayInt64(self, variable_name, value):
return _pyflamegpu.AgentInstance_setVariableArrayInt64(self, variable_name, value)
def setVariableArrayUInt16(self, variable_name, value):
return _pyflamegpu.AgentInstance_setVariableArrayUInt16(self, variable_name, value)
def setVariableArrayUInt32(self, variable_name, value):
return _pyflamegpu.AgentInstance_setVariableArrayUInt32(self, variable_name, value)
def setVariableArrayUInt64(self, variable_name, value):
return _pyflamegpu.AgentInstance_setVariableArrayUInt64(self, variable_name, value)
def setVariableArrayInt(self, variable_name, value):
return _pyflamegpu.AgentInstance_setVariableArrayInt(self, variable_name, value)
def setVariableArrayUInt(self, variable_name, value):
return _pyflamegpu.AgentInstance_setVariableArrayUInt(self, variable_name, value)
def setVariableArrayInt8(self, variable_name, value):
return _pyflamegpu.AgentInstance_setVariableArrayInt8(self, variable_name, value)
def setVariableArrayUInt8(self, variable_name, value):
return _pyflamegpu.AgentInstance_setVariableArrayUInt8(self, variable_name, value)
def setVariableArrayChar(self, variable_name, value):
return _pyflamegpu.AgentInstance_setVariableArrayChar(self, variable_name, value)
def setVariableArrayUChar(self, variable_name, value):
return _pyflamegpu.AgentInstance_setVariableArrayUChar(self, variable_name, value)
def getVariableFloat(self, *args):
return _pyflamegpu.AgentInstance_getVariableFloat(self, *args)
def getVariableDouble(self, *args):
return _pyflamegpu.AgentInstance_getVariableDouble(self, *args)
def getVariableInt16(self, *args):
return _pyflamegpu.AgentInstance_getVariableInt16(self, *args)
def getVariableInt32(self, *args):
return _pyflamegpu.AgentInstance_getVariableInt32(self, *args)
def getVariableInt64(self, *args):
return _pyflamegpu.AgentInstance_getVariableInt64(self, *args)
def getVariableUInt16(self, *args):
return _pyflamegpu.AgentInstance_getVariableUInt16(self, *args)
def getVariableUInt32(self, *args):
return _pyflamegpu.AgentInstance_getVariableUInt32(self, *args)
def getVariableUInt64(self, *args):
return _pyflamegpu.AgentInstance_getVariableUInt64(self, *args)
def getVariableInt(self, *args):
return _pyflamegpu.AgentInstance_getVariableInt(self, *args)
def getVariableUInt(self, *args):
return _pyflamegpu.AgentInstance_getVariableUInt(self, *args)
def getVariableInt8(self, *args):
return _pyflamegpu.AgentInstance_getVariableInt8(self, *args)
def getVariableUInt8(self, *args):
return _pyflamegpu.AgentInstance_getVariableUInt8(self, *args)
def getVariableChar(self, *args):
return _pyflamegpu.AgentInstance_getVariableChar(self, *args)
def getVariableUChar(self, *args):
return _pyflamegpu.AgentInstance_getVariableUChar(self, *args)
def getVariableArrayFloat(self, variable_name):
return _pyflamegpu.AgentInstance_getVariableArrayFloat(self, variable_name)
def getVariableArrayDouble(self, variable_name):
return _pyflamegpu.AgentInstance_getVariableArrayDouble(self, variable_name)
def getVariableArrayInt16(self, variable_name):
return _pyflamegpu.AgentInstance_getVariableArrayInt16(self, variable_name)
def getVariableArrayInt32(self, variable_name):
return _pyflamegpu.AgentInstance_getVariableArrayInt32(self, variable_name)
def getVariableArrayInt64(self, variable_name):
return _pyflamegpu.AgentInstance_getVariableArrayInt64(self, variable_name)
def getVariableArrayUInt16(self, variable_name):
return _pyflamegpu.AgentInstance_getVariableArrayUInt16(self, variable_name)
def getVariableArrayUInt32(self, variable_name):
return _pyflamegpu.AgentInstance_getVariableArrayUInt32(self, variable_name)
def getVariableArrayUInt64(self, variable_name):
return _pyflamegpu.AgentInstance_getVariableArrayUInt64(self, variable_name)
def getVariableArrayInt(self, variable_name):
return _pyflamegpu.AgentInstance_getVariableArrayInt(self, variable_name)
def getVariableArrayUInt(self, variable_name):
return _pyflamegpu.AgentInstance_getVariableArrayUInt(self, variable_name)
def getVariableArrayInt8(self, variable_name):
return _pyflamegpu.AgentInstance_getVariableArrayInt8(self, variable_name)
def getVariableArrayUInt8(self, variable_name):
return _pyflamegpu.AgentInstance_getVariableArrayUInt8(self, variable_name)
def getVariableArrayChar(self, variable_name):
return _pyflamegpu.AgentInstance_getVariableArrayChar(self, variable_name)
def getVariableArrayUChar(self, variable_name):
return _pyflamegpu.AgentInstance_getVariableArrayUChar(self, variable_name)
__swig_destroy__ = _pyflamegpu.delete_AgentInstance
# Register AgentInstance in _pyflamegpu:
_pyflamegpu.AgentInstance_swigregister(AgentInstance)
class Simulation(object):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
def __init__(self, *args, **kwargs):
raise AttributeError("No constructor defined - class is abstract")
__repr__ = _swig_repr
__swig_destroy__ = _pyflamegpu.delete_Simulation
def initialise(self, argc):
return _pyflamegpu.Simulation_initialise(self, argc)
def initFunctions(self):
return _pyflamegpu.Simulation_initFunctions(self)
def step(self):
return _pyflamegpu.Simulation_step(self)
def exitFunctions(self):
return _pyflamegpu.Simulation_exitFunctions(self)
def simulate(self):
return _pyflamegpu.Simulation_simulate(self)
def reset(self):
r"""
Returns the simulation to a clean state
This clears all agents and message lists, resets environment properties and reseeds random generation.
Also calls resetStepCounter();
Notes: If triggered on a submodel, agent states and environment properties mapped to a parent agent, and random generation are not affected.
If random was manually seeded, it will return to it's original state. If random was seeded from time, it will return to a new random state.
"""
return _pyflamegpu.Simulation_reset(self)
def getStepCounter(self):
return _pyflamegpu.Simulation_getStepCounter(self)
def resetStepCounter(self):
return _pyflamegpu.Simulation_resetStepCounter(self)
def getModelDescription(self):
return _pyflamegpu.Simulation_getModelDescription(self)
def exportData(self, path, prettyPrint=True):
r"""
Export model state to file
Export includes config structures, environment and agent data
:type path: string
:param path: The file to output (must end '.json' or '.xml')
:type prettyPrint: boolean, optional
:param prettyPrint: Whether to include indentation and line breaks to aide human reading
Notes: XML export does not currently includes config structures, only the same data present in FLAMEGPU1
"""
return _pyflamegpu.Simulation_exportData(self, path, prettyPrint)
def exportLog(self, path, steps, exit, prettyPrint=True):
r"""
Export the data logged by the last call to simulate() (and/or step) to the given path
:type path: string
:param path: The file to output (must end '.json' or '.xml')
:type steps: boolean
:param steps: Whether the step log should be included in the log file
:type exit: boolean
:param exit: Whether the exit log should be included in the log file
:type prettyPrint: boolean, optional
:param prettyPrint: Whether the log file should be minified or not
Notes: The config (possibly just random seed) is always output
"""
return _pyflamegpu.Simulation_exportLog(self, path, steps, exit, prettyPrint)
def setPopulationData(self, *args):
return _pyflamegpu.Simulation_setPopulationData(self, *args)
def getPopulationData(self, *args):
return _pyflamegpu.Simulation_getPopulationData(self, *args)
def getRunLog(self):
return _pyflamegpu.Simulation_getRunLog(self)
def getAgent(self, name):
return _pyflamegpu.Simulation_getAgent(self, name)
def SimulationConfig(self):
return _pyflamegpu.Simulation_SimulationConfig(self)
def getSimulationConfig(self):
return _pyflamegpu.Simulation_getSimulationConfig(self)
def applyConfig(self):
return _pyflamegpu.Simulation_applyConfig(self)
# Register Simulation in _pyflamegpu:
_pyflamegpu.Simulation_swigregister(Simulation)
class Simulation_Config(object):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self):
_pyflamegpu.Simulation_Config_swiginit(self, _pyflamegpu.new_Simulation_Config())
input_file = property(_pyflamegpu.Simulation_Config_input_file_get, _pyflamegpu.Simulation_Config_input_file_set)
step_log_file = property(_pyflamegpu.Simulation_Config_step_log_file_get, _pyflamegpu.Simulation_Config_step_log_file_set)
exit_log_file = property(_pyflamegpu.Simulation_Config_exit_log_file_get, _pyflamegpu.Simulation_Config_exit_log_file_set)
common_log_file = property(_pyflamegpu.Simulation_Config_common_log_file_get, _pyflamegpu.Simulation_Config_common_log_file_set)
truncate_log_files = property(_pyflamegpu.Simulation_Config_truncate_log_files_get, _pyflamegpu.Simulation_Config_truncate_log_files_set)
random_seed = property(_pyflamegpu.Simulation_Config_random_seed_get, _pyflamegpu.Simulation_Config_random_seed_set)
steps = property(_pyflamegpu.Simulation_Config_steps_get, _pyflamegpu.Simulation_Config_steps_set)
verbose = property(_pyflamegpu.Simulation_Config_verbose_get, _pyflamegpu.Simulation_Config_verbose_set)
timing = property(_pyflamegpu.Simulation_Config_timing_get, _pyflamegpu.Simulation_Config_timing_set)
console_mode = property(_pyflamegpu.Simulation_Config_console_mode_get, _pyflamegpu.Simulation_Config_console_mode_set)
__swig_destroy__ = _pyflamegpu.delete_Simulation_Config
# Register Simulation_Config in _pyflamegpu:
_pyflamegpu.Simulation_Config_swigregister(Simulation_Config)
class CUDASimulation(Simulation):
r"""
CUDA runner for Simulation interface
Executes a FGPU2 model using GPU
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self, model, argc=0):
r"""
Initialise cuda runner
Allocates memory for agents/messages, copies environment properties to device etc
If provided, you can pass runtime arguments to this constructor, to automatically call inititialise()
This is not required, you can call inititialise() manually later, or not at all.
:type model: :py:class:`ModelDescription`
:param model: The model description to initialise the runner to execute
:type argc: int, optional
:param argc: Runtime argument count
:type argv: string, optional
:param argv: Runtime argument list ptr
"""
_pyflamegpu.CUDASimulation_swiginit(self, _pyflamegpu.new_CUDASimulation(model, argc))
__swig_destroy__ = _pyflamegpu.delete_CUDASimulation
def initFunctions(self):
r"""Run the initFunctions of Simulation"""
return _pyflamegpu.CUDASimulation_initFunctions(self)
def step(self):
r"""
Steps the simulation once
:rtype: boolean
:return: False if an exit condition was triggered
"""
return _pyflamegpu.CUDASimulation_step(self)
def exitFunctions(self):
r"""
Run the exitFunctions of the Simulation..
:rtype: void
:return: False if an exit condition was triggered
"""
return _pyflamegpu.CUDASimulation_exitFunctions(self)
def simulate(self):
r"""
Execute the simulation until config.steps have been executed, or an exit condition trips
Includes init and exit functions calls.
"""
return _pyflamegpu.CUDASimulation_simulate(self)
def setPopulationData(self, *args):
r"""
Replaces internal population data for the specified agent
:type population: :py:class:`AgentVector`
:param population: The agent type and data to replace agents with
:type state_name: string, optional
:param state_name: The agent state to add the agents to
:raises: InvalidCudaAgent If the agent type is not recognised
"""
return _pyflamegpu.CUDASimulation_setPopulationData(self, *args)
def getPopulationData(self, *args):
r"""
Returns the internal population data for the specified agent
:type population: :py:class:`AgentVector`
:param population: The agent type and data to fetch
:type state_name: string, optional
:param state_name: The agent state to get the agents from
:raises: InvalidCudaAgent If the agent type is not recognised
"""
return _pyflamegpu.CUDASimulation_getPopulationData(self, *args)
def getCUDAAgent(self, agent_name):
r"""
Returns the manager for the specified agent
TODO: remove? this is mostly internal methods that modeller doesn't need access to
"""
return _pyflamegpu.CUDASimulation_getCUDAAgent(self, agent_name)
def getAgent(self, name):
return _pyflamegpu.CUDASimulation_getAgent(self, name)
def getCUDAMessage(self, message_name):
r"""
Returns the manager for the specified agent
TODO: remove? this is mostly internal methods that modeller doesn't need access to
"""
return _pyflamegpu.CUDASimulation_getCUDAMessage(self, message_name)
def CUDAConfig(self):
r"""
:rtype: :py:class:`Config`
:return: A mutable reference to the cuda model specific configuration struct
See also: Simulation::applyConfig() Should be called afterwards to apply changes
"""
return _pyflamegpu.CUDASimulation_CUDAConfig(self)
def getStepCounter(self):
r"""Returns the number of times step() has been called since the simulation was last reset/init"""
return _pyflamegpu.CUDASimulation_getStepCounter(self)
def resetStepCounter(self):
r"""Manually resets the step counter"""
return _pyflamegpu.CUDASimulation_resetStepCounter(self)
def getCUDAConfig(self):
r"""
:rtype: :py:class:`Config`
:return: An immutable reference to the cuda model specific configuration struct
"""
return _pyflamegpu.CUDASimulation_getCUDAConfig(self)
def setStepLog(self, stepConfig):
r"""
Configure which step data should be logged
:type stepConfig: :py:class:`StepLoggingConfig`
:param stepConfig: The step logging config for the CUDASimulation
Notes: This must be for the same model description hierarchy as the CUDASimulation
"""
return _pyflamegpu.CUDASimulation_setStepLog(self, stepConfig)
def setExitLog(self, exitConfig):
r"""
Configure which exit data should be logged
:type exitConfig: :py:class:`LoggingConfig`
:param exitConfig: The logging config for the CUDASimulation
Notes: This must be for the same model description hierarchy as the CUDASimulation
"""
return _pyflamegpu.CUDASimulation_setExitLog(self, exitConfig)
def getRunLog(self):
r"""Returns a reference to the current exit log"""
return _pyflamegpu.CUDASimulation_getRunLog(self)
def getVisualisation(self):
r"""Creates (on first call) and returns the visualisation configuration options for this model instance"""
return _pyflamegpu.CUDASimulation_getVisualisation(self)
def RTCSafeCudaMemcpyToSymbol(self, symbol, rtc_symbol_name, src, count, offset=0):
r"""
Performs a cudaMemCopyToSymbol in the runtime library and also updates the symbols of any RTC functions (which exist separately within their own cuda module)
Will thrown an error if any of the calls fail.
:type symbol: void
:param symbol: A device symbol
:type rtc_symbol_name: string
:param rtc_symbol_name: The name of the symbol
:type src: void
:param src: Source memory address
:type count: int
:param count: Size in bytes to copy
:type offset: int, optional
:param offset: Offset from start of symbol in bytes
"""
return _pyflamegpu.CUDASimulation_RTCSafeCudaMemcpyToSymbol(self, symbol, rtc_symbol_name, src, count, offset)
def RTCSafeCudaMemcpyToSymbolAddress(self, ptr, rtc_symbol_name, src, count, offset=0):
r"""
Performs a cudaMemCopy to a pointer in the runtime library and also updates the symbols of any RTC functions (which exist separately within their own cuda module)
Will thrown an error if any of the calls fail.
:type ptr: void
:param ptr: a pointer to a symbol in device memory
:type rtc_symbol_name: string
:param rtc_symbol_name: The name of the symbol
:type src: void
:param src: Source memory address
:type count: int
:param count: Size in bytes to copy
:type offset: int, optional
:param offset: Offset from start of symbol in bytes
"""
return _pyflamegpu.CUDASimulation_RTCSafeCudaMemcpyToSymbolAddress(self, ptr, rtc_symbol_name, src, count, offset)
def getElapsedTimeRTCInitialisation(self):
r"""
Get the duration of the last time RTC was iniitliased
With a resolution of around 0.5 microseconds (cudaEventElapsedtime)
:rtype: float
:return: elapsed time of last simulation call in milliseconds.
"""
return _pyflamegpu.CUDASimulation_getElapsedTimeRTCInitialisation(self)
def getElapsedTimeSimulation(self):
r"""
Get the duration of the last call to simulate() in milliseconds.
With a resolution of around 0.5 microseconds (cudaEventElapsedtime)
:rtype: float
:return: elapsed time of last simulation call in milliseconds.
"""
return _pyflamegpu.CUDASimulation_getElapsedTimeSimulation(self)
def getElapsedTimeInitFunctions(self):
r"""
Get the duration of the last call to initFunctions() in milliseconds.
With a resolution of around 0.5 microseconds (cudaEventElapsedtime)
:rtype: float
:return: elapsed time of last simulation call in milliseconds.
"""
return _pyflamegpu.CUDASimulation_getElapsedTimeInitFunctions(self)
def getElapsedTimeExitFunctions(self):
r"""
Get the duration of the last call to stepFunctions() in milliseconds.
With a resolution of around 0.5 microseconds (cudaEventElapsedtime)
:rtype: float
:return: elapsed time of last simulation call in milliseconds.
"""
return _pyflamegpu.CUDASimulation_getElapsedTimeExitFunctions(self)
def getElapsedTimeSteps(self):
r"""
Get the duration of each step() since the last call to `reset`
Timing resolution of around 0.5 microseconds (CudaEventElapsedTime)
:rtype: std::vector< float,std::allocator< float > >
:return: vector of step times
"""
return _pyflamegpu.CUDASimulation_getElapsedTimeSteps(self)
def getElapsedTimeStep(self, step):
r"""
Get the duration of an individual step in milliseconds.
Timing resolution of around 0.5 microseconds.
:type step: int
:param step: Index of step, must be less than the number of steps executed.
:rtype: float
:return: elapsed time of required step in milliseconds
"""
return _pyflamegpu.CUDASimulation_getElapsedTimeStep(self, step)
def getInstanceID(self):
r"""
Returns the unique instance id of this CUDASimulation instance
Notes: This value is used internally for environment property storage
"""
return _pyflamegpu.CUDASimulation_getInstanceID(self)
AUTO_CUDA_DEVICE_RESET = property(_pyflamegpu.CUDASimulation_AUTO_CUDA_DEVICE_RESET_get, _pyflamegpu.CUDASimulation_AUTO_CUDA_DEVICE_RESET_set, doc=r"""If changed to false, will not auto cudaDeviceReset when final CUDASimulation instance is destructed""")
# Register CUDASimulation in _pyflamegpu:
_pyflamegpu.CUDASimulation_swigregister(CUDASimulation)
cvar = _pyflamegpu.cvar
class CUDASimulation_Config(object):
r"""CUDA runner specific config"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
device_id = property(_pyflamegpu.CUDASimulation_Config_device_id_get, _pyflamegpu.CUDASimulation_Config_device_id_set, doc=r"""
GPU to execute model on
Defaults to device 0, this is most performant device as detected by CUDA
""")
inLayerConcurrency = property(_pyflamegpu.CUDASimulation_Config_inLayerConcurrency_get, _pyflamegpu.CUDASimulation_Config_inLayerConcurrency_set, doc=r"""
Enable / disable the use of concurrency within a layer.
Defaults to enabled.
""")
def __init__(self):
_pyflamegpu.CUDASimulation_Config_swiginit(self, _pyflamegpu.new_CUDASimulation_Config())
__swig_destroy__ = _pyflamegpu.delete_CUDASimulation_Config
# Register CUDASimulation_Config in _pyflamegpu:
_pyflamegpu.CUDASimulation_Config_swigregister(CUDASimulation_Config)
class HostAPI(object):
r"""
A flame gpu api class for use by host functions only
This class should only be used by init/step/exit/exitcondition functions.
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self, _agentModel, rng, scatter, agentOffsets, agentData, streamId, stream):
r"""
Initailises pointers to 0
Stores reference of CUDASimulation
"""
_pyflamegpu.HostAPI_swiginit(self, _pyflamegpu.new_HostAPI(_agentModel, rng, scatter, agentOffsets, agentData, streamId, stream))
__swig_destroy__ = _pyflamegpu.delete_HostAPI
def agent(self, *args):
r"""Returns methods that work on all agents of a certain type currently in a given state"""
return _pyflamegpu.HostAPI_agent(self, *args)
random = property(_pyflamegpu.HostAPI_random_get, doc=r"""Host API access to seeded random number generation""")
environment = property(_pyflamegpu.HostAPI_environment_get, doc=r"""Host API access to environmental properties""")
def getStepCounter(self):
r"""
Access the current stepCount
:rtype: int
:return: the current step count, 0 indexed unsigned.
"""
return _pyflamegpu.HostAPI_getStepCounter(self)
# Register HostAPI in _pyflamegpu:
_pyflamegpu.HostAPI_swigregister(HostAPI)
class NewAgentStorage(object):
r"""This struct provides a compact memory store for storing generic variables in a single struct"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self, *args):
_pyflamegpu.NewAgentStorage_swiginit(self, _pyflamegpu.new_NewAgentStorage(*args))
__swig_destroy__ = _pyflamegpu.delete_NewAgentStorage
# Register NewAgentStorage in _pyflamegpu:
_pyflamegpu.NewAgentStorage_swigregister(NewAgentStorage)
class HostNewAgentAPI(object):
r"""This is the main API class used by a user for creating new agents on the host"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self, *args):
r"""
*Overload 1:*
Assigns a new agent it's storage
|
*Overload 2:*
Copy Constructor
This does not duplicate the agent, they both point to the same data, it updates the pointed to agent data
"""
_pyflamegpu.HostNewAgentAPI_swiginit(self, _pyflamegpu.new_HostNewAgentAPI(*args))
def getVariableFloat(self, *args):
return _pyflamegpu.HostNewAgentAPI_getVariableFloat(self, *args)
def getVariableDouble(self, *args):
return _pyflamegpu.HostNewAgentAPI_getVariableDouble(self, *args)
def getVariableInt16(self, *args):
return _pyflamegpu.HostNewAgentAPI_getVariableInt16(self, *args)
def getVariableInt32(self, *args):
return _pyflamegpu.HostNewAgentAPI_getVariableInt32(self, *args)
def getVariableInt64(self, *args):
return _pyflamegpu.HostNewAgentAPI_getVariableInt64(self, *args)
def getVariableUInt16(self, *args):
return _pyflamegpu.HostNewAgentAPI_getVariableUInt16(self, *args)
def getVariableUInt32(self, *args):
return _pyflamegpu.HostNewAgentAPI_getVariableUInt32(self, *args)
def getVariableUInt64(self, *args):
return _pyflamegpu.HostNewAgentAPI_getVariableUInt64(self, *args)
def getVariableInt(self, *args):
return _pyflamegpu.HostNewAgentAPI_getVariableInt(self, *args)
def getVariableUInt(self, *args):
return _pyflamegpu.HostNewAgentAPI_getVariableUInt(self, *args)
def getVariableInt8(self, *args):
return _pyflamegpu.HostNewAgentAPI_getVariableInt8(self, *args)
def getVariableUInt8(self, *args):
return _pyflamegpu.HostNewAgentAPI_getVariableUInt8(self, *args)
def getVariableChar(self, *args):
return _pyflamegpu.HostNewAgentAPI_getVariableChar(self, *args)
def getVariableUChar(self, *args):
return _pyflamegpu.HostNewAgentAPI_getVariableUChar(self, *args)
def getVariableArrayFloat(self, var_name):
return _pyflamegpu.HostNewAgentAPI_getVariableArrayFloat(self, var_name)
def getVariableArrayDouble(self, var_name):
return _pyflamegpu.HostNewAgentAPI_getVariableArrayDouble(self, var_name)
def getVariableArrayInt16(self, var_name):
return _pyflamegpu.HostNewAgentAPI_getVariableArrayInt16(self, var_name)
def getVariableArrayInt32(self, var_name):
return _pyflamegpu.HostNewAgentAPI_getVariableArrayInt32(self, var_name)
def getVariableArrayInt64(self, var_name):
return _pyflamegpu.HostNewAgentAPI_getVariableArrayInt64(self, var_name)
def getVariableArrayUInt16(self, var_name):
return _pyflamegpu.HostNewAgentAPI_getVariableArrayUInt16(self, var_name)
def getVariableArrayUInt32(self, var_name):
return _pyflamegpu.HostNewAgentAPI_getVariableArrayUInt32(self, var_name)
def getVariableArrayUInt64(self, var_name):
return _pyflamegpu.HostNewAgentAPI_getVariableArrayUInt64(self, var_name)
def getVariableArrayInt(self, var_name):
return _pyflamegpu.HostNewAgentAPI_getVariableArrayInt(self, var_name)
def getVariableArrayUInt(self, var_name):
return _pyflamegpu.HostNewAgentAPI_getVariableArrayUInt(self, var_name)
def getVariableArrayInt8(self, var_name):
return _pyflamegpu.HostNewAgentAPI_getVariableArrayInt8(self, var_name)
def getVariableArrayUInt8(self, var_name):
return _pyflamegpu.HostNewAgentAPI_getVariableArrayUInt8(self, var_name)
def getVariableArrayChar(self, var_name):
return _pyflamegpu.HostNewAgentAPI_getVariableArrayChar(self, var_name)
def getVariableArrayUChar(self, var_name):
return _pyflamegpu.HostNewAgentAPI_getVariableArrayUChar(self, var_name)
def setVariableFloat(self, *args):
return _pyflamegpu.HostNewAgentAPI_setVariableFloat(self, *args)
def setVariableDouble(self, *args):
return _pyflamegpu.HostNewAgentAPI_setVariableDouble(self, *args)
def setVariableInt16(self, *args):
return _pyflamegpu.HostNewAgentAPI_setVariableInt16(self, *args)
def setVariableInt32(self, *args):
return _pyflamegpu.HostNewAgentAPI_setVariableInt32(self, *args)
def setVariableInt64(self, *args):
return _pyflamegpu.HostNewAgentAPI_setVariableInt64(self, *args)
def setVariableUInt16(self, *args):
return _pyflamegpu.HostNewAgentAPI_setVariableUInt16(self, *args)
def setVariableUInt32(self, *args):
return _pyflamegpu.HostNewAgentAPI_setVariableUInt32(self, *args)
def setVariableUInt64(self, *args):
return _pyflamegpu.HostNewAgentAPI_setVariableUInt64(self, *args)
def setVariableInt(self, *args):
return _pyflamegpu.HostNewAgentAPI_setVariableInt(self, *args)
def setVariableUInt(self, *args):
return _pyflamegpu.HostNewAgentAPI_setVariableUInt(self, *args)
def setVariableInt8(self, *args):
return _pyflamegpu.HostNewAgentAPI_setVariableInt8(self, *args)
def setVariableUInt8(self, *args):
return _pyflamegpu.HostNewAgentAPI_setVariableUInt8(self, *args)
def setVariableChar(self, *args):
return _pyflamegpu.HostNewAgentAPI_setVariableChar(self, *args)
def setVariableUChar(self, *args):
return _pyflamegpu.HostNewAgentAPI_setVariableUChar(self, *args)
def setVariableArrayFloat(self, var_name, val):
return _pyflamegpu.HostNewAgentAPI_setVariableArrayFloat(self, var_name, val)
def setVariableArrayDouble(self, var_name, val):
return _pyflamegpu.HostNewAgentAPI_setVariableArrayDouble(self, var_name, val)
def setVariableArrayInt16(self, var_name, val):
return _pyflamegpu.HostNewAgentAPI_setVariableArrayInt16(self, var_name, val)
def setVariableArrayInt32(self, var_name, val):
return _pyflamegpu.HostNewAgentAPI_setVariableArrayInt32(self, var_name, val)
def setVariableArrayInt64(self, var_name, val):
return _pyflamegpu.HostNewAgentAPI_setVariableArrayInt64(self, var_name, val)
def setVariableArrayUInt16(self, var_name, val):
return _pyflamegpu.HostNewAgentAPI_setVariableArrayUInt16(self, var_name, val)
def setVariableArrayUInt32(self, var_name, val):
return _pyflamegpu.HostNewAgentAPI_setVariableArrayUInt32(self, var_name, val)
def setVariableArrayUInt64(self, var_name, val):
return _pyflamegpu.HostNewAgentAPI_setVariableArrayUInt64(self, var_name, val)
def setVariableArrayInt(self, var_name, val):
return _pyflamegpu.HostNewAgentAPI_setVariableArrayInt(self, var_name, val)
def setVariableArrayUInt(self, var_name, val):
return _pyflamegpu.HostNewAgentAPI_setVariableArrayUInt(self, var_name, val)
def setVariableArrayInt8(self, var_name, val):
return _pyflamegpu.HostNewAgentAPI_setVariableArrayInt8(self, var_name, val)
def setVariableArrayUInt8(self, var_name, val):
return _pyflamegpu.HostNewAgentAPI_setVariableArrayUInt8(self, var_name, val)
def setVariableArrayChar(self, var_name, val):
return _pyflamegpu.HostNewAgentAPI_setVariableArrayChar(self, var_name, val)
def setVariableArrayUChar(self, var_name, val):
return _pyflamegpu.HostNewAgentAPI_setVariableArrayUChar(self, var_name, val)
__swig_destroy__ = _pyflamegpu.delete_HostNewAgentAPI
# Register HostNewAgentAPI in _pyflamegpu:
_pyflamegpu.HostNewAgentAPI_swigregister(HostNewAgentAPI)
class HostAgentAPI(object):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
__swig_destroy__ = _pyflamegpu.delete_HostAgentAPI
def __init__(self, *args):
_pyflamegpu.HostAgentAPI_swiginit(self, _pyflamegpu.new_HostAgentAPI(*args))
def newAgent(self):
r"""
Creates a new agent in the current agent and returns an object for configuring it's member variables
This mode of agent creation is more efficient than manipulating the vector returned by getPopulationData(),
as it batches agent creation to a single scatter kernel if possible (e.g. no data dependencies).
"""
return _pyflamegpu.HostAgentAPI_newAgent(self)
def count(self):
return _pyflamegpu.HostAgentAPI_count(self)
Asc = _pyflamegpu.HostAgentAPI_Asc
Desc = _pyflamegpu.HostAgentAPI_Desc
def getPopulationData(self):
r"""
Downloads the current agent state from device into an AgentVector which is returned
This function is considered expensive, as it triggers a high number of host-device memory transfers.
It should be used as a last resort
"""
return _pyflamegpu.HostAgentAPI_getPopulationData(self)
def sortFloat(self, *args):
r"""
Sorts agents according to the named variable
:type variable: string
:param variable: The agent variable to sort the agents according to
:type order: int
:param order: Whether the agents should be sorted in ascending or descending order of the variable
:type beginBit: int, optional
:param beginBit: Advanced Option, see note
:type endBit: int, optional
:param endBit: Advanced Option, see note
:param VarT: The type of the variable as specified in the model description hierarchy
:raises: UnsupportedVarType Array variables are not supported
:raises: InvalidAgentVar If the agent does not contain a variable of the same name
:raises: InvalidVarType If the passed variable type does not match that specified in the model description hierarchy
Notes: An optional bit subrange [begin_bit, end_bit) of differentiating variable bits can be specified. This can reduce overall sorting overhead and yield a corresponding performance improvement.
The sort provides no guarantee of stability
"""
return _pyflamegpu.HostAgentAPI_sortFloat(self, *args)
def sortDouble(self, *args):
r"""
Sorts agents according to the named variable
:type variable: string
:param variable: The agent variable to sort the agents according to
:type order: int
:param order: Whether the agents should be sorted in ascending or descending order of the variable
:type beginBit: int, optional
:param beginBit: Advanced Option, see note
:type endBit: int, optional
:param endBit: Advanced Option, see note
:param VarT: The type of the variable as specified in the model description hierarchy
:raises: UnsupportedVarType Array variables are not supported
:raises: InvalidAgentVar If the agent does not contain a variable of the same name
:raises: InvalidVarType If the passed variable type does not match that specified in the model description hierarchy
Notes: An optional bit subrange [begin_bit, end_bit) of differentiating variable bits can be specified. This can reduce overall sorting overhead and yield a corresponding performance improvement.
The sort provides no guarantee of stability
"""
return _pyflamegpu.HostAgentAPI_sortDouble(self, *args)
def sortInt16(self, *args):
r"""
Sorts agents according to the named variable
:type variable: string
:param variable: The agent variable to sort the agents according to
:type order: int
:param order: Whether the agents should be sorted in ascending or descending order of the variable
:type beginBit: int, optional
:param beginBit: Advanced Option, see note
:type endBit: int, optional
:param endBit: Advanced Option, see note
:param VarT: The type of the variable as specified in the model description hierarchy
:raises: UnsupportedVarType Array variables are not supported
:raises: InvalidAgentVar If the agent does not contain a variable of the same name
:raises: InvalidVarType If the passed variable type does not match that specified in the model description hierarchy
Notes: An optional bit subrange [begin_bit, end_bit) of differentiating variable bits can be specified. This can reduce overall sorting overhead and yield a corresponding performance improvement.
The sort provides no guarantee of stability
"""
return _pyflamegpu.HostAgentAPI_sortInt16(self, *args)
def sortInt32(self, *args):
r"""
Sorts agents according to the named variable
:type variable: string
:param variable: The agent variable to sort the agents according to
:type order: int
:param order: Whether the agents should be sorted in ascending or descending order of the variable
:type beginBit: int, optional
:param beginBit: Advanced Option, see note
:type endBit: int, optional
:param endBit: Advanced Option, see note
:param VarT: The type of the variable as specified in the model description hierarchy
:raises: UnsupportedVarType Array variables are not supported
:raises: InvalidAgentVar If the agent does not contain a variable of the same name
:raises: InvalidVarType If the passed variable type does not match that specified in the model description hierarchy
Notes: An optional bit subrange [begin_bit, end_bit) of differentiating variable bits can be specified. This can reduce overall sorting overhead and yield a corresponding performance improvement.
The sort provides no guarantee of stability
"""
return _pyflamegpu.HostAgentAPI_sortInt32(self, *args)
def sortInt64(self, *args):
r"""
Sorts agents according to the named variable
:type variable: string
:param variable: The agent variable to sort the agents according to
:type order: int
:param order: Whether the agents should be sorted in ascending or descending order of the variable
:type beginBit: int, optional
:param beginBit: Advanced Option, see note
:type endBit: int, optional
:param endBit: Advanced Option, see note
:param VarT: The type of the variable as specified in the model description hierarchy
:raises: UnsupportedVarType Array variables are not supported
:raises: InvalidAgentVar If the agent does not contain a variable of the same name
:raises: InvalidVarType If the passed variable type does not match that specified in the model description hierarchy
Notes: An optional bit subrange [begin_bit, end_bit) of differentiating variable bits can be specified. This can reduce overall sorting overhead and yield a corresponding performance improvement.
The sort provides no guarantee of stability
"""
return _pyflamegpu.HostAgentAPI_sortInt64(self, *args)
def sortUInt16(self, *args):
r"""
Sorts agents according to the named variable
:type variable: string
:param variable: The agent variable to sort the agents according to
:type order: int
:param order: Whether the agents should be sorted in ascending or descending order of the variable
:type beginBit: int, optional
:param beginBit: Advanced Option, see note
:type endBit: int, optional
:param endBit: Advanced Option, see note
:param VarT: The type of the variable as specified in the model description hierarchy
:raises: UnsupportedVarType Array variables are not supported
:raises: InvalidAgentVar If the agent does not contain a variable of the same name
:raises: InvalidVarType If the passed variable type does not match that specified in the model description hierarchy
Notes: An optional bit subrange [begin_bit, end_bit) of differentiating variable bits can be specified. This can reduce overall sorting overhead and yield a corresponding performance improvement.
The sort provides no guarantee of stability
"""
return _pyflamegpu.HostAgentAPI_sortUInt16(self, *args)
def sortUInt32(self, *args):
r"""
Sorts agents according to the named variable
:type variable: string
:param variable: The agent variable to sort the agents according to
:type order: int
:param order: Whether the agents should be sorted in ascending or descending order of the variable
:type beginBit: int, optional
:param beginBit: Advanced Option, see note
:type endBit: int, optional
:param endBit: Advanced Option, see note
:param VarT: The type of the variable as specified in the model description hierarchy
:raises: UnsupportedVarType Array variables are not supported
:raises: InvalidAgentVar If the agent does not contain a variable of the same name
:raises: InvalidVarType If the passed variable type does not match that specified in the model description hierarchy
Notes: An optional bit subrange [begin_bit, end_bit) of differentiating variable bits can be specified. This can reduce overall sorting overhead and yield a corresponding performance improvement.
The sort provides no guarantee of stability
"""
return _pyflamegpu.HostAgentAPI_sortUInt32(self, *args)
def sortUInt64(self, *args):
r"""
Sorts agents according to the named variable
:type variable: string
:param variable: The agent variable to sort the agents according to
:type order: int
:param order: Whether the agents should be sorted in ascending or descending order of the variable
:type beginBit: int, optional
:param beginBit: Advanced Option, see note
:type endBit: int, optional
:param endBit: Advanced Option, see note
:param VarT: The type of the variable as specified in the model description hierarchy
:raises: UnsupportedVarType Array variables are not supported
:raises: InvalidAgentVar If the agent does not contain a variable of the same name
:raises: InvalidVarType If the passed variable type does not match that specified in the model description hierarchy
Notes: An optional bit subrange [begin_bit, end_bit) of differentiating variable bits can be specified. This can reduce overall sorting overhead and yield a corresponding performance improvement.
The sort provides no guarantee of stability
"""
return _pyflamegpu.HostAgentAPI_sortUInt64(self, *args)
def sortInt(self, *args):
r"""
Sorts agents according to the named variable
:type variable: string
:param variable: The agent variable to sort the agents according to
:type order: int
:param order: Whether the agents should be sorted in ascending or descending order of the variable
:type beginBit: int, optional
:param beginBit: Advanced Option, see note
:type endBit: int, optional
:param endBit: Advanced Option, see note
:param VarT: The type of the variable as specified in the model description hierarchy
:raises: UnsupportedVarType Array variables are not supported
:raises: InvalidAgentVar If the agent does not contain a variable of the same name
:raises: InvalidVarType If the passed variable type does not match that specified in the model description hierarchy
Notes: An optional bit subrange [begin_bit, end_bit) of differentiating variable bits can be specified. This can reduce overall sorting overhead and yield a corresponding performance improvement.
The sort provides no guarantee of stability
"""
return _pyflamegpu.HostAgentAPI_sortInt(self, *args)
def sortUInt(self, *args):
r"""
Sorts agents according to the named variable
:type variable: string
:param variable: The agent variable to sort the agents according to
:type order: int
:param order: Whether the agents should be sorted in ascending or descending order of the variable
:type beginBit: int, optional
:param beginBit: Advanced Option, see note
:type endBit: int, optional
:param endBit: Advanced Option, see note
:param VarT: The type of the variable as specified in the model description hierarchy
:raises: UnsupportedVarType Array variables are not supported
:raises: InvalidAgentVar If the agent does not contain a variable of the same name
:raises: InvalidVarType If the passed variable type does not match that specified in the model description hierarchy
Notes: An optional bit subrange [begin_bit, end_bit) of differentiating variable bits can be specified. This can reduce overall sorting overhead and yield a corresponding performance improvement.
The sort provides no guarantee of stability
"""
return _pyflamegpu.HostAgentAPI_sortUInt(self, *args)
def sortInt8(self, *args):
r"""
Sorts agents according to the named variable
:type variable: string
:param variable: The agent variable to sort the agents according to
:type order: int
:param order: Whether the agents should be sorted in ascending or descending order of the variable
:type beginBit: int, optional
:param beginBit: Advanced Option, see note
:type endBit: int, optional
:param endBit: Advanced Option, see note
:param VarT: The type of the variable as specified in the model description hierarchy
:raises: UnsupportedVarType Array variables are not supported
:raises: InvalidAgentVar If the agent does not contain a variable of the same name
:raises: InvalidVarType If the passed variable type does not match that specified in the model description hierarchy
Notes: An optional bit subrange [begin_bit, end_bit) of differentiating variable bits can be specified. This can reduce overall sorting overhead and yield a corresponding performance improvement.
The sort provides no guarantee of stability
"""
return _pyflamegpu.HostAgentAPI_sortInt8(self, *args)
def sortUInt8(self, *args):
r"""
Sorts agents according to the named variable
:type variable: string
:param variable: The agent variable to sort the agents according to
:type order: int
:param order: Whether the agents should be sorted in ascending or descending order of the variable
:type beginBit: int, optional
:param beginBit: Advanced Option, see note
:type endBit: int, optional
:param endBit: Advanced Option, see note
:param VarT: The type of the variable as specified in the model description hierarchy
:raises: UnsupportedVarType Array variables are not supported
:raises: InvalidAgentVar If the agent does not contain a variable of the same name
:raises: InvalidVarType If the passed variable type does not match that specified in the model description hierarchy
Notes: An optional bit subrange [begin_bit, end_bit) of differentiating variable bits can be specified. This can reduce overall sorting overhead and yield a corresponding performance improvement.
The sort provides no guarantee of stability
"""
return _pyflamegpu.HostAgentAPI_sortUInt8(self, *args)
def sortChar(self, *args):
r"""
Sorts agents according to the named variable
:type variable: string
:param variable: The agent variable to sort the agents according to
:type order: int
:param order: Whether the agents should be sorted in ascending or descending order of the variable
:type beginBit: int, optional
:param beginBit: Advanced Option, see note
:type endBit: int, optional
:param endBit: Advanced Option, see note
:param VarT: The type of the variable as specified in the model description hierarchy
:raises: UnsupportedVarType Array variables are not supported
:raises: InvalidAgentVar If the agent does not contain a variable of the same name
:raises: InvalidVarType If the passed variable type does not match that specified in the model description hierarchy
Notes: An optional bit subrange [begin_bit, end_bit) of differentiating variable bits can be specified. This can reduce overall sorting overhead and yield a corresponding performance improvement.
The sort provides no guarantee of stability
"""
return _pyflamegpu.HostAgentAPI_sortChar(self, *args)
def sortUChar(self, *args):
r"""
Sorts agents according to the named variable
:type variable: string
:param variable: The agent variable to sort the agents according to
:type order: int
:param order: Whether the agents should be sorted in ascending or descending order of the variable
:type beginBit: int, optional
:param beginBit: Advanced Option, see note
:type endBit: int, optional
:param endBit: Advanced Option, see note
:param VarT: The type of the variable as specified in the model description hierarchy
:raises: UnsupportedVarType Array variables are not supported
:raises: InvalidAgentVar If the agent does not contain a variable of the same name
:raises: InvalidVarType If the passed variable type does not match that specified in the model description hierarchy
Notes: An optional bit subrange [begin_bit, end_bit) of differentiating variable bits can be specified. This can reduce overall sorting overhead and yield a corresponding performance improvement.
The sort provides no guarantee of stability
"""
return _pyflamegpu.HostAgentAPI_sortUChar(self, *args)
def countFloat(self, variable, value):
r"""
Wraps thrust::count(), to count the number of occurences of the provided value
:type variable: string
:param variable: The agent variable to perform the count reduction across
:type value: float
:param value: The value to count occurences of
:param InT: The type of the variable as specified in the model description hierarchy
:raises: UnsupportedVarType Array variables are not supported
:raises: InvalidAgentVar If the agent does not contain a variable of the same name
:raises: InvalidVarType If the passed variable type does not match that specified in the model description hierarchy
"""
return _pyflamegpu.HostAgentAPI_countFloat(self, variable, value)
def countDouble(self, variable, value):
r"""
Wraps thrust::count(), to count the number of occurences of the provided value
:type variable: string
:param variable: The agent variable to perform the count reduction across
:type value: float
:param value: The value to count occurences of
:param InT: The type of the variable as specified in the model description hierarchy
:raises: UnsupportedVarType Array variables are not supported
:raises: InvalidAgentVar If the agent does not contain a variable of the same name
:raises: InvalidVarType If the passed variable type does not match that specified in the model description hierarchy
"""
return _pyflamegpu.HostAgentAPI_countDouble(self, variable, value)
def countInt16(self, variable, value):
r"""
Wraps thrust::count(), to count the number of occurences of the provided value
:type variable: string
:param variable: The agent variable to perform the count reduction across
:type value: int
:param value: The value to count occurences of
:param InT: The type of the variable as specified in the model description hierarchy
:raises: UnsupportedVarType Array variables are not supported
:raises: InvalidAgentVar If the agent does not contain a variable of the same name
:raises: InvalidVarType If the passed variable type does not match that specified in the model description hierarchy
"""
return _pyflamegpu.HostAgentAPI_countInt16(self, variable, value)
def countInt32(self, variable, value):
r"""
Wraps thrust::count(), to count the number of occurences of the provided value
:type variable: string
:param variable: The agent variable to perform the count reduction across
:type value: int
:param value: The value to count occurences of
:param InT: The type of the variable as specified in the model description hierarchy
:raises: UnsupportedVarType Array variables are not supported
:raises: InvalidAgentVar If the agent does not contain a variable of the same name
:raises: InvalidVarType If the passed variable type does not match that specified in the model description hierarchy
"""
return _pyflamegpu.HostAgentAPI_countInt32(self, variable, value)
def countInt64(self, variable, value):
r"""
Wraps thrust::count(), to count the number of occurences of the provided value
:type variable: string
:param variable: The agent variable to perform the count reduction across
:type value: int
:param value: The value to count occurences of
:param InT: The type of the variable as specified in the model description hierarchy
:raises: UnsupportedVarType Array variables are not supported
:raises: InvalidAgentVar If the agent does not contain a variable of the same name
:raises: InvalidVarType If the passed variable type does not match that specified in the model description hierarchy
"""
return _pyflamegpu.HostAgentAPI_countInt64(self, variable, value)
def countUInt16(self, variable, value):
r"""
Wraps thrust::count(), to count the number of occurences of the provided value
:type variable: string
:param variable: The agent variable to perform the count reduction across
:type value: int
:param value: The value to count occurences of
:param InT: The type of the variable as specified in the model description hierarchy
:raises: UnsupportedVarType Array variables are not supported
:raises: InvalidAgentVar If the agent does not contain a variable of the same name
:raises: InvalidVarType If the passed variable type does not match that specified in the model description hierarchy
"""
return _pyflamegpu.HostAgentAPI_countUInt16(self, variable, value)
def countUInt32(self, variable, value):
r"""
Wraps thrust::count(), to count the number of occurences of the provided value
:type variable: string
:param variable: The agent variable to perform the count reduction across
:type value: int
:param value: The value to count occurences of
:param InT: The type of the variable as specified in the model description hierarchy
:raises: UnsupportedVarType Array variables are not supported
:raises: InvalidAgentVar If the agent does not contain a variable of the same name
:raises: InvalidVarType If the passed variable type does not match that specified in the model description hierarchy
"""
return _pyflamegpu.HostAgentAPI_countUInt32(self, variable, value)
def countUInt64(self, variable, value):
r"""
Wraps thrust::count(), to count the number of occurences of the provided value
:type variable: string
:param variable: The agent variable to perform the count reduction across
:type value: int
:param value: The value to count occurences of
:param InT: The type of the variable as specified in the model description hierarchy
:raises: UnsupportedVarType Array variables are not supported
:raises: InvalidAgentVar If the agent does not contain a variable of the same name
:raises: InvalidVarType If the passed variable type does not match that specified in the model description hierarchy
"""
return _pyflamegpu.HostAgentAPI_countUInt64(self, variable, value)
def countInt(self, variable, value):
r"""
Wraps thrust::count(), to count the number of occurences of the provided value
:type variable: string
:param variable: The agent variable to perform the count reduction across
:type value: int
:param value: The value to count occurences of
:param InT: The type of the variable as specified in the model description hierarchy
:raises: UnsupportedVarType Array variables are not supported
:raises: InvalidAgentVar If the agent does not contain a variable of the same name
:raises: InvalidVarType If the passed variable type does not match that specified in the model description hierarchy
"""
return _pyflamegpu.HostAgentAPI_countInt(self, variable, value)
def countUInt(self, variable, value):
r"""
Wraps thrust::count(), to count the number of occurences of the provided value
:type variable: string
:param variable: The agent variable to perform the count reduction across
:type value: int
:param value: The value to count occurences of
:param InT: The type of the variable as specified in the model description hierarchy
:raises: UnsupportedVarType Array variables are not supported
:raises: InvalidAgentVar If the agent does not contain a variable of the same name
:raises: InvalidVarType If the passed variable type does not match that specified in the model description hierarchy
"""
return _pyflamegpu.HostAgentAPI_countUInt(self, variable, value)
def countInt8(self, variable, value):
r"""
Wraps thrust::count(), to count the number of occurences of the provided value
:type variable: string
:param variable: The agent variable to perform the count reduction across
:type value: signed char
:param value: The value to count occurences of
:param InT: The type of the variable as specified in the model description hierarchy
:raises: UnsupportedVarType Array variables are not supported
:raises: InvalidAgentVar If the agent does not contain a variable of the same name
:raises: InvalidVarType If the passed variable type does not match that specified in the model description hierarchy
"""
return _pyflamegpu.HostAgentAPI_countInt8(self, variable, value)
def countUInt8(self, variable, value):
r"""
Wraps thrust::count(), to count the number of occurences of the provided value
:type variable: string
:param variable: The agent variable to perform the count reduction across
:type value: unsigned char
:param value: The value to count occurences of
:param InT: The type of the variable as specified in the model description hierarchy
:raises: UnsupportedVarType Array variables are not supported
:raises: InvalidAgentVar If the agent does not contain a variable of the same name
:raises: InvalidVarType If the passed variable type does not match that specified in the model description hierarchy
"""
return _pyflamegpu.HostAgentAPI_countUInt8(self, variable, value)
def countChar(self, variable, value):
r"""
Wraps thrust::count(), to count the number of occurences of the provided value
:type variable: string
:param variable: The agent variable to perform the count reduction across
:type value: char
:param value: The value to count occurences of
:param InT: The type of the variable as specified in the model description hierarchy
:raises: UnsupportedVarType Array variables are not supported
:raises: InvalidAgentVar If the agent does not contain a variable of the same name
:raises: InvalidVarType If the passed variable type does not match that specified in the model description hierarchy
"""
return _pyflamegpu.HostAgentAPI_countChar(self, variable, value)
def countUChar(self, variable, value):
r"""
Wraps thrust::count(), to count the number of occurences of the provided value
:type variable: string
:param variable: The agent variable to perform the count reduction across
:type value: unsigned char
:param value: The value to count occurences of
:param InT: The type of the variable as specified in the model description hierarchy
:raises: UnsupportedVarType Array variables are not supported
:raises: InvalidAgentVar If the agent does not contain a variable of the same name
:raises: InvalidVarType If the passed variable type does not match that specified in the model description hierarchy
"""
return _pyflamegpu.HostAgentAPI_countUChar(self, variable, value)
def minFloat(self, variable):
r"""
Wraps cub::DeviceReduce::Min()
:type variable: string
:param variable: The agent variable to perform the lowerBound reduction across
:param InT: The type of the variable as specified in the model description hierarchy
:raises: UnsupportedVarType Array variables are not supported
:raises: InvalidAgentVar If the agent does not contain a variable of the same name
:raises: InvalidVarType If the passed variable type does not match that specified in the model description hierarchy
"""
return _pyflamegpu.HostAgentAPI_minFloat(self, variable)
def minDouble(self, variable):
r"""
Wraps cub::DeviceReduce::Min()
:type variable: string
:param variable: The agent variable to perform the lowerBound reduction across
:param InT: The type of the variable as specified in the model description hierarchy
:raises: UnsupportedVarType Array variables are not supported
:raises: InvalidAgentVar If the agent does not contain a variable of the same name
:raises: InvalidVarType If the passed variable type does not match that specified in the model description hierarchy
"""
return _pyflamegpu.HostAgentAPI_minDouble(self, variable)
def minInt16(self, variable):
r"""
Wraps cub::DeviceReduce::Min()
:type variable: string
:param variable: The agent variable to perform the lowerBound reduction across
:param InT: The type of the variable as specified in the model description hierarchy
:raises: UnsupportedVarType Array variables are not supported
:raises: InvalidAgentVar If the agent does not contain a variable of the same name
:raises: InvalidVarType If the passed variable type does not match that specified in the model description hierarchy
"""
return _pyflamegpu.HostAgentAPI_minInt16(self, variable)
def minInt32(self, variable):
r"""
Wraps cub::DeviceReduce::Min()
:type variable: string
:param variable: The agent variable to perform the lowerBound reduction across
:param InT: The type of the variable as specified in the model description hierarchy
:raises: UnsupportedVarType Array variables are not supported
:raises: InvalidAgentVar If the agent does not contain a variable of the same name
:raises: InvalidVarType If the passed variable type does not match that specified in the model description hierarchy
"""
return _pyflamegpu.HostAgentAPI_minInt32(self, variable)
def minInt64(self, variable):
r"""
Wraps cub::DeviceReduce::Min()
:type variable: string
:param variable: The agent variable to perform the lowerBound reduction across
:param InT: The type of the variable as specified in the model description hierarchy
:raises: UnsupportedVarType Array variables are not supported
:raises: InvalidAgentVar If the agent does not contain a variable of the same name
:raises: InvalidVarType If the passed variable type does not match that specified in the model description hierarchy
"""
return _pyflamegpu.HostAgentAPI_minInt64(self, variable)
def minUInt16(self, variable):
r"""
Wraps cub::DeviceReduce::Min()
:type variable: string
:param variable: The agent variable to perform the lowerBound reduction across
:param InT: The type of the variable as specified in the model description hierarchy
:raises: UnsupportedVarType Array variables are not supported
:raises: InvalidAgentVar If the agent does not contain a variable of the same name
:raises: InvalidVarType If the passed variable type does not match that specified in the model description hierarchy
"""
return _pyflamegpu.HostAgentAPI_minUInt16(self, variable)
def minUInt32(self, variable):
r"""
Wraps cub::DeviceReduce::Min()
:type variable: string
:param variable: The agent variable to perform the lowerBound reduction across
:param InT: The type of the variable as specified in the model description hierarchy
:raises: UnsupportedVarType Array variables are not supported
:raises: InvalidAgentVar If the agent does not contain a variable of the same name
:raises: InvalidVarType If the passed variable type does not match that specified in the model description hierarchy
"""
return _pyflamegpu.HostAgentAPI_minUInt32(self, variable)
def minUInt64(self, variable):
r"""
Wraps cub::DeviceReduce::Min()
:type variable: string
:param variable: The agent variable to perform the lowerBound reduction across
:param InT: The type of the variable as specified in the model description hierarchy
:raises: UnsupportedVarType Array variables are not supported
:raises: InvalidAgentVar If the agent does not contain a variable of the same name
:raises: InvalidVarType If the passed variable type does not match that specified in the model description hierarchy
"""
return _pyflamegpu.HostAgentAPI_minUInt64(self, variable)
def minInt(self, variable):
r"""
Wraps cub::DeviceReduce::Min()
:type variable: string
:param variable: The agent variable to perform the lowerBound reduction across
:param InT: The type of the variable as specified in the model description hierarchy
:raises: UnsupportedVarType Array variables are not supported
:raises: InvalidAgentVar If the agent does not contain a variable of the same name
:raises: InvalidVarType If the passed variable type does not match that specified in the model description hierarchy
"""
return _pyflamegpu.HostAgentAPI_minInt(self, variable)
def minUInt(self, variable):
r"""
Wraps cub::DeviceReduce::Min()
:type variable: string
:param variable: The agent variable to perform the lowerBound reduction across
:param InT: The type of the variable as specified in the model description hierarchy
:raises: UnsupportedVarType Array variables are not supported
:raises: InvalidAgentVar If the agent does not contain a variable of the same name
:raises: InvalidVarType If the passed variable type does not match that specified in the model description hierarchy
"""
return _pyflamegpu.HostAgentAPI_minUInt(self, variable)
def minInt8(self, variable):
r"""
Wraps cub::DeviceReduce::Min()
:type variable: string
:param variable: The agent variable to perform the lowerBound reduction across
:param InT: The type of the variable as specified in the model description hierarchy
:raises: UnsupportedVarType Array variables are not supported
:raises: InvalidAgentVar If the agent does not contain a variable of the same name
:raises: InvalidVarType If the passed variable type does not match that specified in the model description hierarchy
"""
return _pyflamegpu.HostAgentAPI_minInt8(self, variable)
def minUInt8(self, variable):
r"""
Wraps cub::DeviceReduce::Min()
:type variable: string
:param variable: The agent variable to perform the lowerBound reduction across
:param InT: The type of the variable as specified in the model description hierarchy
:raises: UnsupportedVarType Array variables are not supported
:raises: InvalidAgentVar If the agent does not contain a variable of the same name
:raises: InvalidVarType If the passed variable type does not match that specified in the model description hierarchy
"""
return _pyflamegpu.HostAgentAPI_minUInt8(self, variable)
def minChar(self, variable):
r"""
Wraps cub::DeviceReduce::Min()
:type variable: string
:param variable: The agent variable to perform the lowerBound reduction across
:param InT: The type of the variable as specified in the model description hierarchy
:raises: UnsupportedVarType Array variables are not supported
:raises: InvalidAgentVar If the agent does not contain a variable of the same name
:raises: InvalidVarType If the passed variable type does not match that specified in the model description hierarchy
"""
return _pyflamegpu.HostAgentAPI_minChar(self, variable)
def minUChar(self, variable):
r"""
Wraps cub::DeviceReduce::Min()
:type variable: string
:param variable: The agent variable to perform the lowerBound reduction across
:param InT: The type of the variable as specified in the model description hierarchy
:raises: UnsupportedVarType Array variables are not supported
:raises: InvalidAgentVar If the agent does not contain a variable of the same name
:raises: InvalidVarType If the passed variable type does not match that specified in the model description hierarchy
"""
return _pyflamegpu.HostAgentAPI_minUChar(self, variable)
def maxFloat(self, variable):
r"""
Wraps cub::DeviceReduce::Max()
:type variable: string
:param variable: The agent variable to perform the upperBound reduction across
:param InT: The type of the variable as specified in the model description hierarchy
:raises: UnsupportedVarType Array variables are not supported
:raises: InvalidAgentVar If the agent does not contain a variable of the same name
:raises: InvalidVarType If the passed variable type does not match that specified in the model description hierarchy
"""
return _pyflamegpu.HostAgentAPI_maxFloat(self, variable)
def maxDouble(self, variable):
r"""
Wraps cub::DeviceReduce::Max()
:type variable: string
:param variable: The agent variable to perform the upperBound reduction across
:param InT: The type of the variable as specified in the model description hierarchy
:raises: UnsupportedVarType Array variables are not supported
:raises: InvalidAgentVar If the agent does not contain a variable of the same name
:raises: InvalidVarType If the passed variable type does not match that specified in the model description hierarchy
"""
return _pyflamegpu.HostAgentAPI_maxDouble(self, variable)
def maxInt16(self, variable):
r"""
Wraps cub::DeviceReduce::Max()
:type variable: string
:param variable: The agent variable to perform the upperBound reduction across
:param InT: The type of the variable as specified in the model description hierarchy
:raises: UnsupportedVarType Array variables are not supported
:raises: InvalidAgentVar If the agent does not contain a variable of the same name
:raises: InvalidVarType If the passed variable type does not match that specified in the model description hierarchy
"""
return _pyflamegpu.HostAgentAPI_maxInt16(self, variable)
def maxInt32(self, variable):
r"""
Wraps cub::DeviceReduce::Max()
:type variable: string
:param variable: The agent variable to perform the upperBound reduction across
:param InT: The type of the variable as specified in the model description hierarchy
:raises: UnsupportedVarType Array variables are not supported
:raises: InvalidAgentVar If the agent does not contain a variable of the same name
:raises: InvalidVarType If the passed variable type does not match that specified in the model description hierarchy
"""
return _pyflamegpu.HostAgentAPI_maxInt32(self, variable)
def maxInt64(self, variable):
r"""
Wraps cub::DeviceReduce::Max()
:type variable: string
:param variable: The agent variable to perform the upperBound reduction across
:param InT: The type of the variable as specified in the model description hierarchy
:raises: UnsupportedVarType Array variables are not supported
:raises: InvalidAgentVar If the agent does not contain a variable of the same name
:raises: InvalidVarType If the passed variable type does not match that specified in the model description hierarchy
"""
return _pyflamegpu.HostAgentAPI_maxInt64(self, variable)
def maxUInt16(self, variable):
r"""
Wraps cub::DeviceReduce::Max()
:type variable: string
:param variable: The agent variable to perform the upperBound reduction across
:param InT: The type of the variable as specified in the model description hierarchy
:raises: UnsupportedVarType Array variables are not supported
:raises: InvalidAgentVar If the agent does not contain a variable of the same name
:raises: InvalidVarType If the passed variable type does not match that specified in the model description hierarchy
"""
return _pyflamegpu.HostAgentAPI_maxUInt16(self, variable)
def maxUInt32(self, variable):
r"""
Wraps cub::DeviceReduce::Max()
:type variable: string
:param variable: The agent variable to perform the upperBound reduction across
:param InT: The type of the variable as specified in the model description hierarchy
:raises: UnsupportedVarType Array variables are not supported
:raises: InvalidAgentVar If the agent does not contain a variable of the same name
:raises: InvalidVarType If the passed variable type does not match that specified in the model description hierarchy
"""
return _pyflamegpu.HostAgentAPI_maxUInt32(self, variable)
def maxUInt64(self, variable):
r"""
Wraps cub::DeviceReduce::Max()
:type variable: string
:param variable: The agent variable to perform the upperBound reduction across
:param InT: The type of the variable as specified in the model description hierarchy
:raises: UnsupportedVarType Array variables are not supported
:raises: InvalidAgentVar If the agent does not contain a variable of the same name
:raises: InvalidVarType If the passed variable type does not match that specified in the model description hierarchy
"""
return _pyflamegpu.HostAgentAPI_maxUInt64(self, variable)
def maxInt(self, variable):
r"""
Wraps cub::DeviceReduce::Max()
:type variable: string
:param variable: The agent variable to perform the upperBound reduction across
:param InT: The type of the variable as specified in the model description hierarchy
:raises: UnsupportedVarType Array variables are not supported
:raises: InvalidAgentVar If the agent does not contain a variable of the same name
:raises: InvalidVarType If the passed variable type does not match that specified in the model description hierarchy
"""
return _pyflamegpu.HostAgentAPI_maxInt(self, variable)
def maxUInt(self, variable):
r"""
Wraps cub::DeviceReduce::Max()
:type variable: string
:param variable: The agent variable to perform the upperBound reduction across
:param InT: The type of the variable as specified in the model description hierarchy
:raises: UnsupportedVarType Array variables are not supported
:raises: InvalidAgentVar If the agent does not contain a variable of the same name
:raises: InvalidVarType If the passed variable type does not match that specified in the model description hierarchy
"""
return _pyflamegpu.HostAgentAPI_maxUInt(self, variable)
def maxInt8(self, variable):
r"""
Wraps cub::DeviceReduce::Max()
:type variable: string
:param variable: The agent variable to perform the upperBound reduction across
:param InT: The type of the variable as specified in the model description hierarchy
:raises: UnsupportedVarType Array variables are not supported
:raises: InvalidAgentVar If the agent does not contain a variable of the same name
:raises: InvalidVarType If the passed variable type does not match that specified in the model description hierarchy
"""
return _pyflamegpu.HostAgentAPI_maxInt8(self, variable)
def maxUInt8(self, variable):
r"""
Wraps cub::DeviceReduce::Max()
:type variable: string
:param variable: The agent variable to perform the upperBound reduction across
:param InT: The type of the variable as specified in the model description hierarchy
:raises: UnsupportedVarType Array variables are not supported
:raises: InvalidAgentVar If the agent does not contain a variable of the same name
:raises: InvalidVarType If the passed variable type does not match that specified in the model description hierarchy
"""
return _pyflamegpu.HostAgentAPI_maxUInt8(self, variable)
def maxChar(self, variable):
r"""
Wraps cub::DeviceReduce::Max()
:type variable: string
:param variable: The agent variable to perform the upperBound reduction across
:param InT: The type of the variable as specified in the model description hierarchy
:raises: UnsupportedVarType Array variables are not supported
:raises: InvalidAgentVar If the agent does not contain a variable of the same name
:raises: InvalidVarType If the passed variable type does not match that specified in the model description hierarchy
"""
return _pyflamegpu.HostAgentAPI_maxChar(self, variable)
def maxUChar(self, variable):
r"""
Wraps cub::DeviceReduce::Max()
:type variable: string
:param variable: The agent variable to perform the upperBound reduction across
:param InT: The type of the variable as specified in the model description hierarchy
:raises: UnsupportedVarType Array variables are not supported
:raises: InvalidAgentVar If the agent does not contain a variable of the same name
:raises: InvalidVarType If the passed variable type does not match that specified in the model description hierarchy
"""
return _pyflamegpu.HostAgentAPI_maxUChar(self, variable)
def sumFloat(self, variable):
r"""
Wraps cub::DeviceReduce::Sum()
:type variable: string
:param variable: The agent variable to perform the sum reduction across
:param InT: The type of the variable as specified in the model description hierarchy
:raises: UnsupportedVarType Array variables are not supported
:raises: InvalidAgentVar If the agent does not contain a variable of the same name
:raises: InvalidVarType If the passed variable type does not match that specified in the model description hierarchy
"""
return _pyflamegpu.HostAgentAPI_sumFloat(self, variable)
def sumDouble(self, variable):
r"""
Wraps cub::DeviceReduce::Sum()
:type variable: string
:param variable: The agent variable to perform the sum reduction across
:param InT: The type of the variable as specified in the model description hierarchy
:raises: UnsupportedVarType Array variables are not supported
:raises: InvalidAgentVar If the agent does not contain a variable of the same name
:raises: InvalidVarType If the passed variable type does not match that specified in the model description hierarchy
"""
return _pyflamegpu.HostAgentAPI_sumDouble(self, variable)
def sumInt8(self, variable):
return _pyflamegpu.HostAgentAPI_sumInt8(self, variable)
def sumUInt8(self, variable):
return _pyflamegpu.HostAgentAPI_sumUInt8(self, variable)
def sumInt16(self, variable):
return _pyflamegpu.HostAgentAPI_sumInt16(self, variable)
def sumUInt16(self, variable):
return _pyflamegpu.HostAgentAPI_sumUInt16(self, variable)
def sumInt32(self, variable):
return _pyflamegpu.HostAgentAPI_sumInt32(self, variable)
def sumUInt32(self, variable):
return _pyflamegpu.HostAgentAPI_sumUInt32(self, variable)
def sumInt64(self, variable):
return _pyflamegpu.HostAgentAPI_sumInt64(self, variable)
def sumUInt64(self, variable):
return _pyflamegpu.HostAgentAPI_sumUInt64(self, variable)
def sumInt(self, variable):
return _pyflamegpu.HostAgentAPI_sumInt(self, variable)
def sumUInt(self, variable):
return _pyflamegpu.HostAgentAPI_sumUInt(self, variable)
# Register HostAgentAPI in _pyflamegpu:
_pyflamegpu.HostAgentAPI_swigregister(HostAgentAPI)
class HostRandom(object):
r"""
Utility for accessing random generation within host functions
This is prefered over using std random, as it uses a common seed with the device random
This should only be instantiated by HostAPI
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
def __init__(self, *args, **kwargs):
raise AttributeError("No constructor defined")
__repr__ = _swig_repr
def setSeed(self, seed):
r"""
Change the seed used for random generation
:type seed: int
:param seed: New random seed
"""
return _pyflamegpu.HostRandom_setSeed(self, seed)
def getSeed(self):
r"""Returns the last value used to seed random generation"""
return _pyflamegpu.HostRandom_getSeed(self)
def uniformFloat(self):
return _pyflamegpu.HostRandom_uniformFloat(self)
def uniformDouble(self):
return _pyflamegpu.HostRandom_uniformDouble(self)
def uniformInt16(self, min, max):
return _pyflamegpu.HostRandom_uniformInt16(self, min, max)
def uniformInt32(self, min, max):
return _pyflamegpu.HostRandom_uniformInt32(self, min, max)
def uniformInt64(self, min, max):
return _pyflamegpu.HostRandom_uniformInt64(self, min, max)
def uniformUInt16(self, min, max):
return _pyflamegpu.HostRandom_uniformUInt16(self, min, max)
def uniformUInt32(self, min, max):
return _pyflamegpu.HostRandom_uniformUInt32(self, min, max)
def uniformUInt64(self, min, max):
return _pyflamegpu.HostRandom_uniformUInt64(self, min, max)
def uniformInt(self, min, max):
return _pyflamegpu.HostRandom_uniformInt(self, min, max)
def uniformUInt(self, min, max):
return _pyflamegpu.HostRandom_uniformUInt(self, min, max)
def normalFloat(self):
r"""
Returns a normally distributed float with mean 0.0 and standard deviation 1.0.
:param T: return type (must be floating point)
Notes: This result can be scaled and shifted to produce normally distributed values with any mean/stddev.
Available as float or double
"""
return _pyflamegpu.HostRandom_normalFloat(self)
def normalDouble(self):
r"""
Returns a normally distributed float with mean 0.0 and standard deviation 1.0.
:param T: return type (must be floating point)
Notes: This result can be scaled and shifted to produce normally distributed values with any mean/stddev.
Available as float or double
"""
return _pyflamegpu.HostRandom_normalDouble(self)
def logNormalFloat(self, mean, stddev):
r"""
Returns a log-normally distributed float based on a normal distribution with the given mean and standard deviation.
:param T: return type (must be floating point)
Notes: Available as float or double
"""
return _pyflamegpu.HostRandom_logNormalFloat(self, mean, stddev)
def logNormalDouble(self, mean, stddev):
r"""
Returns a log-normally distributed float based on a normal distribution with the given mean and standard deviation.
:param T: return type (must be floating point)
Notes: Available as float or double
"""
return _pyflamegpu.HostRandom_logNormalDouble(self, mean, stddev)
__swig_destroy__ = _pyflamegpu.delete_HostRandom
# Register HostRandom in _pyflamegpu:
_pyflamegpu.HostRandom_swigregister(HostRandom)
class HostEnvironment(object):
r"""
This class provides host function access to Environment Properties
It acts as a wrapper to EnvironmentManager, proxying calls, converting variable name and model_name into a combined hash
Pairs with EnvironmentManager, AgentEnvironment and EnvironmentDescription
This class is only to be constructed by HostAPI
Notes: Not thread-safe
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
def __init__(self, *args, **kwargs):
raise AttributeError("No constructor defined")
__repr__ = _swig_repr
def getPropertyFloat(self, *args):
r"""
*Overload 1:*
Gets an environment property
:type name: string
:param name: name used for accessing the property
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
|
*Overload 2:*
Gets an element of an environment property array
:type name: string
:param name: name used for accessing the property
:param T: Type of the elements of the environment property array
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
See also: get(const std::string &)
"""
return _pyflamegpu.HostEnvironment_getPropertyFloat(self, *args)
def getPropertyDouble(self, *args):
r"""
*Overload 1:*
Gets an environment property
:type name: string
:param name: name used for accessing the property
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
|
*Overload 2:*
Gets an element of an environment property array
:type name: string
:param name: name used for accessing the property
:param T: Type of the elements of the environment property array
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
See also: get(const std::string &)
"""
return _pyflamegpu.HostEnvironment_getPropertyDouble(self, *args)
def getPropertyInt16(self, *args):
r"""
*Overload 1:*
Gets an environment property
:type name: string
:param name: name used for accessing the property
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
|
*Overload 2:*
Gets an element of an environment property array
:type name: string
:param name: name used for accessing the property
:param T: Type of the elements of the environment property array
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
See also: get(const std::string &)
"""
return _pyflamegpu.HostEnvironment_getPropertyInt16(self, *args)
def getPropertyInt32(self, *args):
r"""
*Overload 1:*
Gets an environment property
:type name: string
:param name: name used for accessing the property
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
|
*Overload 2:*
Gets an element of an environment property array
:type name: string
:param name: name used for accessing the property
:param T: Type of the elements of the environment property array
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
See also: get(const std::string &)
"""
return _pyflamegpu.HostEnvironment_getPropertyInt32(self, *args)
def getPropertyInt64(self, *args):
r"""
*Overload 1:*
Gets an environment property
:type name: string
:param name: name used for accessing the property
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
|
*Overload 2:*
Gets an element of an environment property array
:type name: string
:param name: name used for accessing the property
:param T: Type of the elements of the environment property array
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
See also: get(const std::string &)
"""
return _pyflamegpu.HostEnvironment_getPropertyInt64(self, *args)
def getPropertyUInt16(self, *args):
r"""
*Overload 1:*
Gets an environment property
:type name: string
:param name: name used for accessing the property
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
|
*Overload 2:*
Gets an element of an environment property array
:type name: string
:param name: name used for accessing the property
:param T: Type of the elements of the environment property array
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
See also: get(const std::string &)
"""
return _pyflamegpu.HostEnvironment_getPropertyUInt16(self, *args)
def getPropertyUInt32(self, *args):
r"""
*Overload 1:*
Gets an environment property
:type name: string
:param name: name used for accessing the property
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
|
*Overload 2:*
Gets an element of an environment property array
:type name: string
:param name: name used for accessing the property
:param T: Type of the elements of the environment property array
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
See also: get(const std::string &)
"""
return _pyflamegpu.HostEnvironment_getPropertyUInt32(self, *args)
def getPropertyUInt64(self, *args):
r"""
*Overload 1:*
Gets an environment property
:type name: string
:param name: name used for accessing the property
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
|
*Overload 2:*
Gets an element of an environment property array
:type name: string
:param name: name used for accessing the property
:param T: Type of the elements of the environment property array
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
See also: get(const std::string &)
"""
return _pyflamegpu.HostEnvironment_getPropertyUInt64(self, *args)
def getPropertyInt(self, *args):
r"""
*Overload 1:*
Gets an environment property
:type name: string
:param name: name used for accessing the property
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
|
*Overload 2:*
Gets an element of an environment property array
:type name: string
:param name: name used for accessing the property
:param T: Type of the elements of the environment property array
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
See also: get(const std::string &)
"""
return _pyflamegpu.HostEnvironment_getPropertyInt(self, *args)
def getPropertyUInt(self, *args):
r"""
*Overload 1:*
Gets an environment property
:type name: string
:param name: name used for accessing the property
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
|
*Overload 2:*
Gets an element of an environment property array
:type name: string
:param name: name used for accessing the property
:param T: Type of the elements of the environment property array
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
See also: get(const std::string &)
"""
return _pyflamegpu.HostEnvironment_getPropertyUInt(self, *args)
def getPropertyInt8(self, *args):
r"""
*Overload 1:*
Gets an environment property
:type name: string
:param name: name used for accessing the property
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
|
*Overload 2:*
Gets an element of an environment property array
:type name: string
:param name: name used for accessing the property
:param T: Type of the elements of the environment property array
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
See also: get(const std::string &)
"""
return _pyflamegpu.HostEnvironment_getPropertyInt8(self, *args)
def getPropertyUInt8(self, *args):
r"""
*Overload 1:*
Gets an environment property
:type name: string
:param name: name used for accessing the property
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
|
*Overload 2:*
Gets an element of an environment property array
:type name: string
:param name: name used for accessing the property
:param T: Type of the elements of the environment property array
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
See also: get(const std::string &)
"""
return _pyflamegpu.HostEnvironment_getPropertyUInt8(self, *args)
def getPropertyChar(self, *args):
r"""
*Overload 1:*
Gets an environment property
:type name: string
:param name: name used for accessing the property
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
|
*Overload 2:*
Gets an element of an environment property array
:type name: string
:param name: name used for accessing the property
:param T: Type of the elements of the environment property array
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
See also: get(const std::string &)
"""
return _pyflamegpu.HostEnvironment_getPropertyChar(self, *args)
def getPropertyUChar(self, *args):
r"""
*Overload 1:*
Gets an environment property
:type name: string
:param name: name used for accessing the property
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
|
*Overload 2:*
Gets an element of an environment property array
:type name: string
:param name: name used for accessing the property
:param T: Type of the elements of the environment property array
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
See also: get(const std::string &)
"""
return _pyflamegpu.HostEnvironment_getPropertyUChar(self, *args)
def getPropertyArrayFloat(self, name):
r"""
Gets an environment property array
:type name: string
:param name: name used for accessing the property
:param T: Type of the elements of the environment property array
:raises: InvalidEnvProperty If a property array of the name does not exist
"""
return _pyflamegpu.HostEnvironment_getPropertyArrayFloat(self, name)
def getPropertyArrayDouble(self, name):
r"""
Gets an environment property array
:type name: string
:param name: name used for accessing the property
:param T: Type of the elements of the environment property array
:raises: InvalidEnvProperty If a property array of the name does not exist
"""
return _pyflamegpu.HostEnvironment_getPropertyArrayDouble(self, name)
def getPropertyArrayInt16(self, name):
r"""
Gets an environment property array
:type name: string
:param name: name used for accessing the property
:param T: Type of the elements of the environment property array
:raises: InvalidEnvProperty If a property array of the name does not exist
"""
return _pyflamegpu.HostEnvironment_getPropertyArrayInt16(self, name)
def getPropertyArrayInt32(self, name):
r"""
Gets an environment property array
:type name: string
:param name: name used for accessing the property
:param T: Type of the elements of the environment property array
:raises: InvalidEnvProperty If a property array of the name does not exist
"""
return _pyflamegpu.HostEnvironment_getPropertyArrayInt32(self, name)
def getPropertyArrayInt64(self, name):
r"""
Gets an environment property array
:type name: string
:param name: name used for accessing the property
:param T: Type of the elements of the environment property array
:raises: InvalidEnvProperty If a property array of the name does not exist
"""
return _pyflamegpu.HostEnvironment_getPropertyArrayInt64(self, name)
def getPropertyArrayUInt16(self, name):
r"""
Gets an environment property array
:type name: string
:param name: name used for accessing the property
:param T: Type of the elements of the environment property array
:raises: InvalidEnvProperty If a property array of the name does not exist
"""
return _pyflamegpu.HostEnvironment_getPropertyArrayUInt16(self, name)
def getPropertyArrayUInt32(self, name):
r"""
Gets an environment property array
:type name: string
:param name: name used for accessing the property
:param T: Type of the elements of the environment property array
:raises: InvalidEnvProperty If a property array of the name does not exist
"""
return _pyflamegpu.HostEnvironment_getPropertyArrayUInt32(self, name)
def getPropertyArrayUInt64(self, name):
r"""
Gets an environment property array
:type name: string
:param name: name used for accessing the property
:param T: Type of the elements of the environment property array
:raises: InvalidEnvProperty If a property array of the name does not exist
"""
return _pyflamegpu.HostEnvironment_getPropertyArrayUInt64(self, name)
def getPropertyArrayInt(self, name):
r"""
Gets an environment property array
:type name: string
:param name: name used for accessing the property
:param T: Type of the elements of the environment property array
:raises: InvalidEnvProperty If a property array of the name does not exist
"""
return _pyflamegpu.HostEnvironment_getPropertyArrayInt(self, name)
def getPropertyArrayUInt(self, name):
r"""
Gets an environment property array
:type name: string
:param name: name used for accessing the property
:param T: Type of the elements of the environment property array
:raises: InvalidEnvProperty If a property array of the name does not exist
"""
return _pyflamegpu.HostEnvironment_getPropertyArrayUInt(self, name)
def getPropertyArrayInt8(self, name):
r"""
Gets an environment property array
:type name: string
:param name: name used for accessing the property
:param T: Type of the elements of the environment property array
:raises: InvalidEnvProperty If a property array of the name does not exist
"""
return _pyflamegpu.HostEnvironment_getPropertyArrayInt8(self, name)
def getPropertyArrayUInt8(self, name):
r"""
Gets an environment property array
:type name: string
:param name: name used for accessing the property
:param T: Type of the elements of the environment property array
:raises: InvalidEnvProperty If a property array of the name does not exist
"""
return _pyflamegpu.HostEnvironment_getPropertyArrayUInt8(self, name)
def getPropertyArrayChar(self, name):
r"""
Gets an environment property array
:type name: string
:param name: name used for accessing the property
:param T: Type of the elements of the environment property array
:raises: InvalidEnvProperty If a property array of the name does not exist
"""
return _pyflamegpu.HostEnvironment_getPropertyArrayChar(self, name)
def getPropertyArrayUChar(self, name):
r"""
Gets an environment property array
:type name: string
:param name: name used for accessing the property
:param T: Type of the elements of the environment property array
:raises: InvalidEnvProperty If a property array of the name does not exist
"""
return _pyflamegpu.HostEnvironment_getPropertyArrayUChar(self, name)
def setPropertyFloat(self, *args):
r"""
*Overload 1:*
Sets an environment property
:type name: string
:param name: name used for accessing the property
:type value: float
:param value: to set the property
:param T: Type of the elements of the environment property
:rtype: float
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: ReadOnlyEnvProperty If the named property is marked as const
|
*Overload 2:*
Sets an element of an environment property array
:type name: string
:param name: name used for accessing the property array
:type index: int
:param index: element within the environemtn property array to set
:type value: float
:param value: to set the element of the property array
:param T: Type of the environmental property array
:rtype: float
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
See also: get(const std::string &)
"""
return _pyflamegpu.HostEnvironment_setPropertyFloat(self, *args)
def setPropertyDouble(self, *args):
r"""
*Overload 1:*
Sets an environment property
:type name: string
:param name: name used for accessing the property
:type value: float
:param value: to set the property
:param T: Type of the elements of the environment property
:rtype: float
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: ReadOnlyEnvProperty If the named property is marked as const
|
*Overload 2:*
Sets an element of an environment property array
:type name: string
:param name: name used for accessing the property array
:type index: int
:param index: element within the environemtn property array to set
:type value: float
:param value: to set the element of the property array
:param T: Type of the environmental property array
:rtype: float
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
See also: get(const std::string &)
"""
return _pyflamegpu.HostEnvironment_setPropertyDouble(self, *args)
def setPropertyInt16(self, *args):
r"""
*Overload 1:*
Sets an environment property
:type name: string
:param name: name used for accessing the property
:type value: int
:param value: to set the property
:param T: Type of the elements of the environment property
:rtype: int
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: ReadOnlyEnvProperty If the named property is marked as const
|
*Overload 2:*
Sets an element of an environment property array
:type name: string
:param name: name used for accessing the property array
:type index: int
:param index: element within the environemtn property array to set
:type value: int
:param value: to set the element of the property array
:param T: Type of the environmental property array
:rtype: int
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
See also: get(const std::string &)
"""
return _pyflamegpu.HostEnvironment_setPropertyInt16(self, *args)
def setPropertyInt32(self, *args):
r"""
*Overload 1:*
Sets an environment property
:type name: string
:param name: name used for accessing the property
:type value: int
:param value: to set the property
:param T: Type of the elements of the environment property
:rtype: int
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: ReadOnlyEnvProperty If the named property is marked as const
|
*Overload 2:*
Sets an element of an environment property array
:type name: string
:param name: name used for accessing the property array
:type index: int
:param index: element within the environemtn property array to set
:type value: int
:param value: to set the element of the property array
:param T: Type of the environmental property array
:rtype: int
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
See also: get(const std::string &)
"""
return _pyflamegpu.HostEnvironment_setPropertyInt32(self, *args)
def setPropertyInt64(self, *args):
r"""
*Overload 1:*
Sets an environment property
:type name: string
:param name: name used for accessing the property
:type value: int
:param value: to set the property
:param T: Type of the elements of the environment property
:rtype: int
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: ReadOnlyEnvProperty If the named property is marked as const
|
*Overload 2:*
Sets an element of an environment property array
:type name: string
:param name: name used for accessing the property array
:type index: int
:param index: element within the environemtn property array to set
:type value: int
:param value: to set the element of the property array
:param T: Type of the environmental property array
:rtype: int
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
See also: get(const std::string &)
"""
return _pyflamegpu.HostEnvironment_setPropertyInt64(self, *args)
def setPropertyUInt16(self, *args):
r"""
*Overload 1:*
Sets an environment property
:type name: string
:param name: name used for accessing the property
:type value: int
:param value: to set the property
:param T: Type of the elements of the environment property
:rtype: int
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: ReadOnlyEnvProperty If the named property is marked as const
|
*Overload 2:*
Sets an element of an environment property array
:type name: string
:param name: name used for accessing the property array
:type index: int
:param index: element within the environemtn property array to set
:type value: int
:param value: to set the element of the property array
:param T: Type of the environmental property array
:rtype: int
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
See also: get(const std::string &)
"""
return _pyflamegpu.HostEnvironment_setPropertyUInt16(self, *args)
def setPropertyUInt32(self, *args):
r"""
*Overload 1:*
Sets an environment property
:type name: string
:param name: name used for accessing the property
:type value: int
:param value: to set the property
:param T: Type of the elements of the environment property
:rtype: int
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: ReadOnlyEnvProperty If the named property is marked as const
|
*Overload 2:*
Sets an element of an environment property array
:type name: string
:param name: name used for accessing the property array
:type index: int
:param index: element within the environemtn property array to set
:type value: int
:param value: to set the element of the property array
:param T: Type of the environmental property array
:rtype: int
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
See also: get(const std::string &)
"""
return _pyflamegpu.HostEnvironment_setPropertyUInt32(self, *args)
def setPropertyUInt64(self, *args):
r"""
*Overload 1:*
Sets an environment property
:type name: string
:param name: name used for accessing the property
:type value: int
:param value: to set the property
:param T: Type of the elements of the environment property
:rtype: int
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: ReadOnlyEnvProperty If the named property is marked as const
|
*Overload 2:*
Sets an element of an environment property array
:type name: string
:param name: name used for accessing the property array
:type index: int
:param index: element within the environemtn property array to set
:type value: int
:param value: to set the element of the property array
:param T: Type of the environmental property array
:rtype: int
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
See also: get(const std::string &)
"""
return _pyflamegpu.HostEnvironment_setPropertyUInt64(self, *args)
def setPropertyInt(self, *args):
r"""
*Overload 1:*
Sets an environment property
:type name: string
:param name: name used for accessing the property
:type value: int
:param value: to set the property
:param T: Type of the elements of the environment property
:rtype: int
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: ReadOnlyEnvProperty If the named property is marked as const
|
*Overload 2:*
Sets an element of an environment property array
:type name: string
:param name: name used for accessing the property array
:type index: int
:param index: element within the environemtn property array to set
:type value: int
:param value: to set the element of the property array
:param T: Type of the environmental property array
:rtype: int
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
See also: get(const std::string &)
"""
return _pyflamegpu.HostEnvironment_setPropertyInt(self, *args)
def setPropertyUInt(self, *args):
r"""
*Overload 1:*
Sets an environment property
:type name: string
:param name: name used for accessing the property
:type value: int
:param value: to set the property
:param T: Type of the elements of the environment property
:rtype: int
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: ReadOnlyEnvProperty If the named property is marked as const
|
*Overload 2:*
Sets an element of an environment property array
:type name: string
:param name: name used for accessing the property array
:type index: int
:param index: element within the environemtn property array to set
:type value: int
:param value: to set the element of the property array
:param T: Type of the environmental property array
:rtype: int
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
See also: get(const std::string &)
"""
return _pyflamegpu.HostEnvironment_setPropertyUInt(self, *args)
def setPropertyInt8(self, *args):
r"""
*Overload 1:*
Sets an environment property
:type name: string
:param name: name used for accessing the property
:type value: signed char
:param value: to set the property
:param T: Type of the elements of the environment property
:rtype: signed char
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: ReadOnlyEnvProperty If the named property is marked as const
|
*Overload 2:*
Sets an element of an environment property array
:type name: string
:param name: name used for accessing the property array
:type index: int
:param index: element within the environemtn property array to set
:type value: signed char
:param value: to set the element of the property array
:param T: Type of the environmental property array
:rtype: signed char
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
See also: get(const std::string &)
"""
return _pyflamegpu.HostEnvironment_setPropertyInt8(self, *args)
def setPropertyUInt8(self, *args):
r"""
*Overload 1:*
Sets an environment property
:type name: string
:param name: name used for accessing the property
:type value: unsigned char
:param value: to set the property
:param T: Type of the elements of the environment property
:rtype: unsigned char
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: ReadOnlyEnvProperty If the named property is marked as const
|
*Overload 2:*
Sets an element of an environment property array
:type name: string
:param name: name used for accessing the property array
:type index: int
:param index: element within the environemtn property array to set
:type value: unsigned char
:param value: to set the element of the property array
:param T: Type of the environmental property array
:rtype: unsigned char
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
See also: get(const std::string &)
"""
return _pyflamegpu.HostEnvironment_setPropertyUInt8(self, *args)
def setPropertyChar(self, *args):
r"""
*Overload 1:*
Sets an environment property
:type name: string
:param name: name used for accessing the property
:type value: char
:param value: to set the property
:param T: Type of the elements of the environment property
:rtype: char
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: ReadOnlyEnvProperty If the named property is marked as const
|
*Overload 2:*
Sets an element of an environment property array
:type name: string
:param name: name used for accessing the property array
:type index: int
:param index: element within the environemtn property array to set
:type value: char
:param value: to set the element of the property array
:param T: Type of the environmental property array
:rtype: char
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
See also: get(const std::string &)
"""
return _pyflamegpu.HostEnvironment_setPropertyChar(self, *args)
def setPropertyUChar(self, *args):
r"""
*Overload 1:*
Sets an environment property
:type name: string
:param name: name used for accessing the property
:type value: unsigned char
:param value: to set the property
:param T: Type of the elements of the environment property
:rtype: unsigned char
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: ReadOnlyEnvProperty If the named property is marked as const
|
*Overload 2:*
Sets an element of an environment property array
:type name: string
:param name: name used for accessing the property array
:type index: int
:param index: element within the environemtn property array to set
:type value: unsigned char
:param value: to set the element of the property array
:param T: Type of the environmental property array
:rtype: unsigned char
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: std::out_of_range
See also: get(const std::string &)
"""
return _pyflamegpu.HostEnvironment_setPropertyUChar(self, *args)
def setPropertyArrayFloat(self, name, value):
r"""
Sets an environment property array
:type name: string
:param name: name used for accessing the property array
:type value: std::vector< float,std::allocator< float > >
:param value: to set the property array
:param T: Type of the elements of the environment property array
:rtype: std::vector< float,std::allocator< float > >
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: ReadOnlyEnvProperty If the named property is marked as const
"""
return _pyflamegpu.HostEnvironment_setPropertyArrayFloat(self, name, value)
def setPropertyArrayDouble(self, name, value):
r"""
Sets an environment property array
:type name: string
:param name: name used for accessing the property array
:type value: std::vector< double,std::allocator< double > >
:param value: to set the property array
:param T: Type of the elements of the environment property array
:rtype: std::vector< double,std::allocator< double > >
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: ReadOnlyEnvProperty If the named property is marked as const
"""
return _pyflamegpu.HostEnvironment_setPropertyArrayDouble(self, name, value)
def setPropertyArrayInt16(self, name, value):
r"""
Sets an environment property array
:type name: string
:param name: name used for accessing the property array
:type value: std::vector< short,std::allocator< short > >
:param value: to set the property array
:param T: Type of the elements of the environment property array
:rtype: std::vector< short,std::allocator< short > >
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: ReadOnlyEnvProperty If the named property is marked as const
"""
return _pyflamegpu.HostEnvironment_setPropertyArrayInt16(self, name, value)
def setPropertyArrayInt32(self, name, value):
r"""
Sets an environment property array
:type name: string
:param name: name used for accessing the property array
:type value: std::vector< int,std::allocator< int > >
:param value: to set the property array
:param T: Type of the elements of the environment property array
:rtype: std::vector< int,std::allocator< int > >
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: ReadOnlyEnvProperty If the named property is marked as const
"""
return _pyflamegpu.HostEnvironment_setPropertyArrayInt32(self, name, value)
def setPropertyArrayInt64(self, name, value):
r"""
Sets an environment property array
:type name: string
:param name: name used for accessing the property array
:type value: std::vector< long long,std::allocator< long long > >
:param value: to set the property array
:param T: Type of the elements of the environment property array
:rtype: std::vector< long long,std::allocator< long long > >
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: ReadOnlyEnvProperty If the named property is marked as const
"""
return _pyflamegpu.HostEnvironment_setPropertyArrayInt64(self, name, value)
def setPropertyArrayUInt16(self, name, value):
r"""
Sets an environment property array
:type name: string
:param name: name used for accessing the property array
:type value: std::vector< unsigned short,std::allocator< unsigned short > >
:param value: to set the property array
:param T: Type of the elements of the environment property array
:rtype: std::vector< unsigned short,std::allocator< unsigned short > >
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: ReadOnlyEnvProperty If the named property is marked as const
"""
return _pyflamegpu.HostEnvironment_setPropertyArrayUInt16(self, name, value)
def setPropertyArrayUInt32(self, name, value):
r"""
Sets an environment property array
:type name: string
:param name: name used for accessing the property array
:type value: std::vector< unsigned int,std::allocator< unsigned int > >
:param value: to set the property array
:param T: Type of the elements of the environment property array
:rtype: std::vector< unsigned int,std::allocator< unsigned int > >
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: ReadOnlyEnvProperty If the named property is marked as const
"""
return _pyflamegpu.HostEnvironment_setPropertyArrayUInt32(self, name, value)
def setPropertyArrayUInt64(self, name, value):
r"""
Sets an environment property array
:type name: string
:param name: name used for accessing the property array
:type value: std::vector< unsigned long long,std::allocator< unsigned long long > >
:param value: to set the property array
:param T: Type of the elements of the environment property array
:rtype: std::vector< unsigned long long,std::allocator< unsigned long long > >
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: ReadOnlyEnvProperty If the named property is marked as const
"""
return _pyflamegpu.HostEnvironment_setPropertyArrayUInt64(self, name, value)
def setPropertyArrayInt(self, name, value):
r"""
Sets an environment property array
:type name: string
:param name: name used for accessing the property array
:type value: std::vector< int,std::allocator< int > >
:param value: to set the property array
:param T: Type of the elements of the environment property array
:rtype: std::vector< int,std::allocator< int > >
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: ReadOnlyEnvProperty If the named property is marked as const
"""
return _pyflamegpu.HostEnvironment_setPropertyArrayInt(self, name, value)
def setPropertyArrayUInt(self, name, value):
r"""
Sets an environment property array
:type name: string
:param name: name used for accessing the property array
:type value: std::vector< unsigned int,std::allocator< unsigned int > >
:param value: to set the property array
:param T: Type of the elements of the environment property array
:rtype: std::vector< unsigned int,std::allocator< unsigned int > >
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: ReadOnlyEnvProperty If the named property is marked as const
"""
return _pyflamegpu.HostEnvironment_setPropertyArrayUInt(self, name, value)
def setPropertyArrayInt8(self, name, value):
r"""
Sets an environment property array
:type name: string
:param name: name used for accessing the property array
:type value: std::vector< signed char,std::allocator< signed char > >
:param value: to set the property array
:param T: Type of the elements of the environment property array
:rtype: std::vector< signed char,std::allocator< signed char > >
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: ReadOnlyEnvProperty If the named property is marked as const
"""
return _pyflamegpu.HostEnvironment_setPropertyArrayInt8(self, name, value)
def setPropertyArrayUInt8(self, name, value):
r"""
Sets an environment property array
:type name: string
:param name: name used for accessing the property array
:type value: std::vector< unsigned char,std::allocator< unsigned char > >
:param value: to set the property array
:param T: Type of the elements of the environment property array
:rtype: std::vector< unsigned char,std::allocator< unsigned char > >
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: ReadOnlyEnvProperty If the named property is marked as const
"""
return _pyflamegpu.HostEnvironment_setPropertyArrayUInt8(self, name, value)
def setPropertyArrayChar(self, name, value):
r"""
Sets an environment property array
:type name: string
:param name: name used for accessing the property array
:type value: std::vector< char,std::allocator< char > >
:param value: to set the property array
:param T: Type of the elements of the environment property array
:rtype: std::vector< char,std::allocator< char > >
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: ReadOnlyEnvProperty If the named property is marked as const
"""
return _pyflamegpu.HostEnvironment_setPropertyArrayChar(self, name, value)
def setPropertyArrayUChar(self, name, value):
r"""
Sets an environment property array
:type name: string
:param name: name used for accessing the property array
:type value: std::vector< unsigned char,std::allocator< unsigned char > >
:param value: to set the property array
:param T: Type of the elements of the environment property array
:rtype: std::vector< unsigned char,std::allocator< unsigned char > >
:return: Returns the previous value
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: ReadOnlyEnvProperty If the named property is marked as const
"""
return _pyflamegpu.HostEnvironment_setPropertyArrayUChar(self, name, value)
__swig_destroy__ = _pyflamegpu.delete_HostEnvironment
# Register HostEnvironment in _pyflamegpu:
_pyflamegpu.HostEnvironment_swigregister(HostEnvironment)
class MsgNone(object):
r"""
This empty class is used when messaging is not enabled for an agent function
It also provides the best overview of the required components of a new messsaging type
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self):
_pyflamegpu.MsgNone_swiginit(self, _pyflamegpu.new_MsgNone())
__swig_destroy__ = _pyflamegpu.delete_MsgNone
# Register MsgNone in _pyflamegpu:
_pyflamegpu.MsgNone_swigregister(MsgNone)
class MsgSpecialisationHandler(object):
r"""
Interface for message specialisation
A derived implementation of this is required for each combination of message type (e.g. MsgBruteForce) and simulation type (e.g. CUDASimulation)
Notes: It is recommended that derived classes require an object that provides access to the model specialisation's representation of messages (e.g. CUDAMessage)
: this is slightly CUDA aware. Future abstraction DevicePtr should be in a CUDANone message or similar.
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
def __init__(self, *args, **kwargs):
raise AttributeError("No constructor defined - class is abstract")
__repr__ = _swig_repr
__swig_destroy__ = _pyflamegpu.delete_MsgSpecialisationHandler
def init(self, scatter, streamId):
r"""
Allocate and fill metadata, as though message list was empty
:type scatter: CUDAScatter
:param scatter: Scatter instance and scan arrays to be used (CUDASimulation::singletons->scatter)
:type streamId: int
:param streamId: Index of stream specific structures used
"""
return _pyflamegpu.MsgSpecialisationHandler_init(self, scatter, streamId)
def buildIndex(self, arg2, streamId, stream):
r"""
Constructs an index for the message data structure (e.g. Partition boundary matrix for spatial message types)
This is called the first time messages are read, after new messages have been output
:param scatter: Scatter instance and scan arrays to be used (CUDASimulation::singletons->scatter)
:type streamId: int
:param streamId: Index of stream specific structures used
"""
return _pyflamegpu.MsgSpecialisationHandler_buildIndex(self, arg2, streamId, stream)
def allocateMetaDataDevicePtr(self):
r"""
Allocates memory for the constructed index.
The memory allocation is checked by build index.
"""
return _pyflamegpu.MsgSpecialisationHandler_allocateMetaDataDevicePtr(self)
def freeMetaDataDevicePtr(self):
r"""Releases memory for the constructed index."""
return _pyflamegpu.MsgSpecialisationHandler_freeMetaDataDevicePtr(self)
def getMetaDataDevicePtr(self):
r"""
Returns a pointer to metadata for message access during agent functions
(For CUDASimulation this is a device pointer)
Notes: : this is slightly CUDA aware. Future abstraction this should be base CUDANone or similar.
"""
return _pyflamegpu.MsgSpecialisationHandler_getMetaDataDevicePtr(self)
# Register MsgSpecialisationHandler in _pyflamegpu:
_pyflamegpu.MsgSpecialisationHandler_swigregister(MsgSpecialisationHandler)
class MsgBruteForce(object):
r"""
Brute force messaging functionality
Every agent accesses all messages
This technique is expensive, and other techniques are preferable if operating with more than 1000 messages.
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self):
_pyflamegpu.MsgBruteForce_swiginit(self, _pyflamegpu.new_MsgBruteForce())
__swig_destroy__ = _pyflamegpu.delete_MsgBruteForce
# Register MsgBruteForce in _pyflamegpu:
_pyflamegpu.MsgBruteForce_swigregister(MsgBruteForce)
class MsgBruteForce_Description(object):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
def __init__(self, *args, **kwargs):
raise AttributeError("No constructor defined")
__repr__ = _swig_repr
def __eq__(self, rhs):
r"""
Equality operator, checks whether MessageDescription hierarchies are functionally the same
:rtype: boolean
:return: True when messages are the same
Notes: Instead compare pointers if you wish to check that they are the same instance
"""
return _pyflamegpu.MsgBruteForce_Description___eq__(self, rhs)
def __ne__(self, rhs):
r"""
Equality operator, checks whether MessageDescription hierarchies are functionally different
:rtype: boolean
:return: True when messages are not the same
Notes: Instead compare pointers if you wish to check that they are not the same instance
"""
return _pyflamegpu.MsgBruteForce_Description___ne__(self, rhs)
def getName(self):
r"""
:rtype: string
:return: The message's name
"""
return _pyflamegpu.MsgBruteForce_Description_getName(self)
def getVariableType(self, variable_name):
r"""
:type variable_name: string
:param variable_name: Name used to refer to the desired variable
:rtype: std::type_index
:return: The type of the named variable
:raises: InvalidAgentVar If a variable with the name does not exist within the message
"""
return _pyflamegpu.MsgBruteForce_Description_getVariableType(self, variable_name)
def getVariableSize(self, variable_name):
r"""
:type variable_name: string
:param variable_name: Name used to refer to the desired variable
:rtype: int
:return: The size of the named variable's type
:raises: InvalidAgentVar If a variable with the name does not exist within the message
"""
return _pyflamegpu.MsgBruteForce_Description_getVariableSize(self, variable_name)
def getVariablesCount(self):
r"""
:rtype: int
:return: The total number of variables within the message
"""
return _pyflamegpu.MsgBruteForce_Description_getVariablesCount(self)
def hasVariable(self, variable_name):
r"""
:type variable_name: string
:param variable_name: Name of the variable to check
:rtype: boolean
:return: True when a variable with the specified name exists within the message
"""
return _pyflamegpu.MsgBruteForce_Description_hasVariable(self, variable_name)
def newVariableFloat(self, variable_name):
return _pyflamegpu.MsgBruteForce_Description_newVariableFloat(self, variable_name)
def newVariableDouble(self, variable_name):
return _pyflamegpu.MsgBruteForce_Description_newVariableDouble(self, variable_name)
def newVariableInt16(self, variable_name):
return _pyflamegpu.MsgBruteForce_Description_newVariableInt16(self, variable_name)
def newVariableInt32(self, variable_name):
return _pyflamegpu.MsgBruteForce_Description_newVariableInt32(self, variable_name)
def newVariableInt64(self, variable_name):
return _pyflamegpu.MsgBruteForce_Description_newVariableInt64(self, variable_name)
def newVariableUInt16(self, variable_name):
return _pyflamegpu.MsgBruteForce_Description_newVariableUInt16(self, variable_name)
def newVariableUInt32(self, variable_name):
return _pyflamegpu.MsgBruteForce_Description_newVariableUInt32(self, variable_name)
def newVariableUInt64(self, variable_name):
return _pyflamegpu.MsgBruteForce_Description_newVariableUInt64(self, variable_name)
def newVariableInt(self, variable_name):
return _pyflamegpu.MsgBruteForce_Description_newVariableInt(self, variable_name)
def newVariableUInt(self, variable_name):
return _pyflamegpu.MsgBruteForce_Description_newVariableUInt(self, variable_name)
def newVariableInt8(self, variable_name):
return _pyflamegpu.MsgBruteForce_Description_newVariableInt8(self, variable_name)
def newVariableUInt8(self, variable_name):
return _pyflamegpu.MsgBruteForce_Description_newVariableUInt8(self, variable_name)
def newVariableChar(self, variable_name):
return _pyflamegpu.MsgBruteForce_Description_newVariableChar(self, variable_name)
def newVariableUChar(self, variable_name):
return _pyflamegpu.MsgBruteForce_Description_newVariableUChar(self, variable_name)
__swig_destroy__ = _pyflamegpu.delete_MsgBruteForce_Description
# Register MsgBruteForce_Description in _pyflamegpu:
_pyflamegpu.MsgBruteForce_Description_swigregister(MsgBruteForce_Description)
class MsgSpatial2D(object):
r"""
2D Continuous spatial messaging functionality
User specifies the environment bounds and search radius
When accessing messages, a search origin is specified
A subset of messages, including those within radius of the search origin are returned
The user must distance check that they fall within the search radius manually
Unlike FLAMEGPU1, these spatial messages do not wrap over environment bounds.
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self):
_pyflamegpu.MsgSpatial2D_swiginit(self, _pyflamegpu.new_MsgSpatial2D())
__swig_destroy__ = _pyflamegpu.delete_MsgSpatial2D
# Register MsgSpatial2D in _pyflamegpu:
_pyflamegpu.MsgSpatial2D_swigregister(MsgSpatial2D)
class GridPos2D(object):
r"""
Basic class to group 3 dimensional bin coordinates
Would use glm::ivec3, but project does not currently have glm
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
x = property(_pyflamegpu.GridPos2D_x_get, _pyflamegpu.GridPos2D_x_set)
y = property(_pyflamegpu.GridPos2D_y_get, _pyflamegpu.GridPos2D_y_set)
def __init__(self):
_pyflamegpu.GridPos2D_swiginit(self, _pyflamegpu.new_GridPos2D())
__swig_destroy__ = _pyflamegpu.delete_GridPos2D
# Register GridPos2D in _pyflamegpu:
_pyflamegpu.GridPos2D_swigregister(GridPos2D)
class MsgSpatial2D_Description(MsgBruteForce_Description):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
def __init__(self, *args, **kwargs):
raise AttributeError("No constructor defined")
__repr__ = _swig_repr
def setRadius(self, r):
return _pyflamegpu.MsgSpatial2D_Description_setRadius(self, r)
def setMinX(self, x):
return _pyflamegpu.MsgSpatial2D_Description_setMinX(self, x)
def setMinY(self, y):
return _pyflamegpu.MsgSpatial2D_Description_setMinY(self, y)
def setMin(self, x, y):
return _pyflamegpu.MsgSpatial2D_Description_setMin(self, x, y)
def setMaxX(self, x):
return _pyflamegpu.MsgSpatial2D_Description_setMaxX(self, x)
def setMaxY(self, y):
return _pyflamegpu.MsgSpatial2D_Description_setMaxY(self, y)
def setMax(self, x, y):
return _pyflamegpu.MsgSpatial2D_Description_setMax(self, x, y)
def getRadius(self):
return _pyflamegpu.MsgSpatial2D_Description_getRadius(self)
def getMinX(self):
return _pyflamegpu.MsgSpatial2D_Description_getMinX(self)
def getMinY(self):
return _pyflamegpu.MsgSpatial2D_Description_getMinY(self)
def getMaxX(self):
return _pyflamegpu.MsgSpatial2D_Description_getMaxX(self)
def getMaxY(self):
return _pyflamegpu.MsgSpatial2D_Description_getMaxY(self)
__swig_destroy__ = _pyflamegpu.delete_MsgSpatial2D_Description
# Register MsgSpatial2D_Description in _pyflamegpu:
_pyflamegpu.MsgSpatial2D_Description_swigregister(MsgSpatial2D_Description)
class MsgSpatial3D(object):
r"""
3D Continuous spatial messaging functionality
User specifies the environment bounds and search radius
When accessing messages, a search origin is specified
A subset of messages, including those within radius of the search origin are returned
The user must distance check that they fall within the search radius manually
Unlike FLAMEGPU1, these spatial messages do not wrap over environment bounds.
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self):
_pyflamegpu.MsgSpatial3D_swiginit(self, _pyflamegpu.new_MsgSpatial3D())
__swig_destroy__ = _pyflamegpu.delete_MsgSpatial3D
# Register MsgSpatial3D in _pyflamegpu:
_pyflamegpu.MsgSpatial3D_swigregister(MsgSpatial3D)
class GridPos3D(object):
r"""
Basic class to group 3 dimensional bin coordinates
Would use glm::ivec3, but project does not currently have glm
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
x = property(_pyflamegpu.GridPos3D_x_get, _pyflamegpu.GridPos3D_x_set)
y = property(_pyflamegpu.GridPos3D_y_get, _pyflamegpu.GridPos3D_y_set)
z = property(_pyflamegpu.GridPos3D_z_get, _pyflamegpu.GridPos3D_z_set)
def __init__(self):
_pyflamegpu.GridPos3D_swiginit(self, _pyflamegpu.new_GridPos3D())
__swig_destroy__ = _pyflamegpu.delete_GridPos3D
# Register GridPos3D in _pyflamegpu:
_pyflamegpu.GridPos3D_swigregister(GridPos3D)
class MsgSpatial3D_MetaData(object):
r"""MetaData required by spatial partitioning during message reads"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
def __init__(self, *args, **kwargs):
raise AttributeError("No constructor defined")
__repr__ = _swig_repr
min = property(_pyflamegpu.MsgSpatial3D_MetaData_min_get, _pyflamegpu.MsgSpatial3D_MetaData_min_set, doc=r"""Minimum environment bounds""")
max = property(_pyflamegpu.MsgSpatial3D_MetaData_max_get, _pyflamegpu.MsgSpatial3D_MetaData_max_set, doc=r"""Maximum environment bounds""")
radius = property(_pyflamegpu.MsgSpatial3D_MetaData_radius_get, _pyflamegpu.MsgSpatial3D_MetaData_radius_set, doc=r"""Search radius (also used as subdividision bin width)""")
PBM = property(_pyflamegpu.MsgSpatial3D_MetaData_PBM_get, _pyflamegpu.MsgSpatial3D_MetaData_PBM_set, doc=r"""
Pointer to the partition boundary matrix in device memory
The PBM is never stored on the host
""")
gridDim = property(_pyflamegpu.MsgSpatial3D_MetaData_gridDim_get, _pyflamegpu.MsgSpatial3D_MetaData_gridDim_set, doc=r"""The number of subdividision bins in each dimensions""")
environmentWidth = property(_pyflamegpu.MsgSpatial3D_MetaData_environmentWidth_get, _pyflamegpu.MsgSpatial3D_MetaData_environmentWidth_set, doc=r"""max-lowerBound""")
__swig_destroy__ = _pyflamegpu.delete_MsgSpatial3D_MetaData
# Register MsgSpatial3D_MetaData in _pyflamegpu:
_pyflamegpu.MsgSpatial3D_MetaData_swigregister(MsgSpatial3D_MetaData)
class MsgSpatial3D_Description(MsgBruteForce_Description):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
def __init__(self, *args, **kwargs):
raise AttributeError("No constructor defined")
__repr__ = _swig_repr
def setRadius(self, r):
return _pyflamegpu.MsgSpatial3D_Description_setRadius(self, r)
def setMinX(self, x):
return _pyflamegpu.MsgSpatial3D_Description_setMinX(self, x)
def setMinY(self, y):
return _pyflamegpu.MsgSpatial3D_Description_setMinY(self, y)
def setMinZ(self, z):
return _pyflamegpu.MsgSpatial3D_Description_setMinZ(self, z)
def setMin(self, x, y, z):
return _pyflamegpu.MsgSpatial3D_Description_setMin(self, x, y, z)
def setMaxX(self, x):
return _pyflamegpu.MsgSpatial3D_Description_setMaxX(self, x)
def setMaxY(self, y):
return _pyflamegpu.MsgSpatial3D_Description_setMaxY(self, y)
def setMaxZ(self, z):
return _pyflamegpu.MsgSpatial3D_Description_setMaxZ(self, z)
def setMax(self, x, y, z):
return _pyflamegpu.MsgSpatial3D_Description_setMax(self, x, y, z)
def getRadius(self):
return _pyflamegpu.MsgSpatial3D_Description_getRadius(self)
def getMinX(self):
return _pyflamegpu.MsgSpatial3D_Description_getMinX(self)
def getMinY(self):
return _pyflamegpu.MsgSpatial3D_Description_getMinY(self)
def getMinZ(self):
return _pyflamegpu.MsgSpatial3D_Description_getMinZ(self)
def getMaxX(self):
return _pyflamegpu.MsgSpatial3D_Description_getMaxX(self)
def getMaxY(self):
return _pyflamegpu.MsgSpatial3D_Description_getMaxY(self)
def getMaxZ(self):
return _pyflamegpu.MsgSpatial3D_Description_getMaxZ(self)
__swig_destroy__ = _pyflamegpu.delete_MsgSpatial3D_Description
# Register MsgSpatial3D_Description in _pyflamegpu:
_pyflamegpu.MsgSpatial3D_Description_swigregister(MsgSpatial3D_Description)
class MsgArray(object):
r"""
Array messaging functionality
Like an array, each message is assigned an index within a known range
Only one message may exist at each index
Agent functions can access individual messages by requesting them with their index
Algorithm:
Every agent outputs a message to the array based on their thread index
They also set the __index variable with the intended output bin
When buildIndex() is called, messages are sorted and errors (multiple messages per bin) are detected
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self):
_pyflamegpu.MsgArray_swiginit(self, _pyflamegpu.new_MsgArray())
__swig_destroy__ = _pyflamegpu.delete_MsgArray
# Register MsgArray in _pyflamegpu:
_pyflamegpu.MsgArray_swigregister(MsgArray)
class MsgArray_Description(MsgBruteForce_Description):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
def __init__(self, *args, **kwargs):
raise AttributeError("No constructor defined")
__repr__ = _swig_repr
def setLength(self, len):
return _pyflamegpu.MsgArray_Description_setLength(self, len)
def getLength(self):
return _pyflamegpu.MsgArray_Description_getLength(self)
__swig_destroy__ = _pyflamegpu.delete_MsgArray_Description
# Register MsgArray_Description in _pyflamegpu:
_pyflamegpu.MsgArray_Description_swigregister(MsgArray_Description)
class MsgArray2D(object):
r"""
Array messaging functionality
Like an array, each message is assigned an index within a known range
Only one message may exist at each index
Agent functions can access individual messages by requesting them with their index
Algorithm:
Every agent outputs a message to the array based on their thread index
They also set the __index variable with the intended output bin
When buildIndex() is called, messages are sorted and errors (multiple messages per bin) are detected
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self):
_pyflamegpu.MsgArray2D_swiginit(self, _pyflamegpu.new_MsgArray2D())
__swig_destroy__ = _pyflamegpu.delete_MsgArray2D
# Register MsgArray2D in _pyflamegpu:
_pyflamegpu.MsgArray2D_swigregister(MsgArray2D)
class MsgArray2D_Description(MsgBruteForce_Description):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
def __init__(self, *args, **kwargs):
raise AttributeError("No constructor defined")
__repr__ = _swig_repr
def setDimensions(self, *args):
return _pyflamegpu.MsgArray2D_Description_setDimensions(self, *args)
def getDimensions(self):
return _pyflamegpu.MsgArray2D_Description_getDimensions(self)
def getDimX(self):
return _pyflamegpu.MsgArray2D_Description_getDimX(self)
def getDimY(self):
return _pyflamegpu.MsgArray2D_Description_getDimY(self)
__swig_destroy__ = _pyflamegpu.delete_MsgArray2D_Description
# Register MsgArray2D_Description in _pyflamegpu:
_pyflamegpu.MsgArray2D_Description_swigregister(MsgArray2D_Description)
class MsgArray3D(object):
r"""
Array messaging functionality
Like an array, each message is assigned an index within a known range
Only one message may exist at each index
Agent functions can access individual messages by requesting them with their index
Algorithm:
Every agent outputs a message to the array based on their thread index
They also set the __index variable with the intended output bin
When buildIndex() is called, messages are sorted and errors (multiple messages per bin) are detected
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self):
_pyflamegpu.MsgArray3D_swiginit(self, _pyflamegpu.new_MsgArray3D())
__swig_destroy__ = _pyflamegpu.delete_MsgArray3D
# Register MsgArray3D in _pyflamegpu:
_pyflamegpu.MsgArray3D_swigregister(MsgArray3D)
class MsgArray3D_Description(MsgBruteForce_Description):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
def __init__(self, *args, **kwargs):
raise AttributeError("No constructor defined")
__repr__ = _swig_repr
def setDimensions(self, *args):
return _pyflamegpu.MsgArray3D_Description_setDimensions(self, *args)
def getDimensions(self):
return _pyflamegpu.MsgArray3D_Description_getDimensions(self)
def getDimX(self):
return _pyflamegpu.MsgArray3D_Description_getDimX(self)
def getDimY(self):
return _pyflamegpu.MsgArray3D_Description_getDimY(self)
def getDimZ(self):
return _pyflamegpu.MsgArray3D_Description_getDimZ(self)
__swig_destroy__ = _pyflamegpu.delete_MsgArray3D_Description
# Register MsgArray3D_Description in _pyflamegpu:
_pyflamegpu.MsgArray3D_Description_swigregister(MsgArray3D_Description)
class MsgBucket(object):
r"""
Bucket messaging functionality
User specifies an integer upper and lower bound, these form a set of consecutive indices which act as keys to buckets.
Each bucket may contain 0 to many messages, however an index is generated such that empty bins still consume a small amount of space.
As such, this is similar to a multi-map, however the key space must be a set of consecutive integers.
By using your own hash function you can convert non-integer keys to suitable integer keys.
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self):
_pyflamegpu.MsgBucket_swiginit(self, _pyflamegpu.new_MsgBucket())
__swig_destroy__ = _pyflamegpu.delete_MsgBucket
# Register MsgBucket in _pyflamegpu:
_pyflamegpu.MsgBucket_swigregister(MsgBucket)
class MsgBucket_Description(MsgBruteForce_Description):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
def __init__(self, *args, **kwargs):
raise AttributeError("No constructor defined")
__repr__ = _swig_repr
def setLowerBound(self, key):
r"""Set the (inclusive) minimum bound, this is the first valid key"""
return _pyflamegpu.MsgBucket_Description_setLowerBound(self, key)
def setUpperBound(self, key):
r"""Set the (inclusive) maximum bound, this is the last valid key"""
return _pyflamegpu.MsgBucket_Description_setUpperBound(self, key)
def setBounds(self, min, max):
return _pyflamegpu.MsgBucket_Description_setBounds(self, min, max)
def getLowerBound(self):
r"""Return the currently set (inclusive) lower bound, this is the first valid key"""
return _pyflamegpu.MsgBucket_Description_getLowerBound(self)
def getUpperBound(self):
r"""Return the currently set (inclusive) upper bound, this is the last valid key"""
return _pyflamegpu.MsgBucket_Description_getUpperBound(self)
__swig_destroy__ = _pyflamegpu.delete_MsgBucket_Description
# Register MsgBucket_Description in _pyflamegpu:
_pyflamegpu.MsgBucket_Description_swigregister(MsgBucket_Description)
class LoggingConfig(object):
r"""Interface to the data structure for controlling how model data is logged"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
Mean = _pyflamegpu.LoggingConfig_Mean
StandardDev = _pyflamegpu.LoggingConfig_StandardDev
Min = _pyflamegpu.LoggingConfig_Min
Max = _pyflamegpu.LoggingConfig_Max
Sum = _pyflamegpu.LoggingConfig_Sum
@staticmethod
def toString(r):
return _pyflamegpu.LoggingConfig_toString(r)
def __init__(self, *args):
r"""
*Overload 1:*
Constructor
:type model: :py:class:`ModelDescription`
:param model: The ModelDescriptionHierarchy to produce a logging config for
|
*Overload 2:*
Copy Constructor
"""
_pyflamegpu.LoggingConfig_swiginit(self, _pyflamegpu.new_LoggingConfig(*args))
def agent(self, *args):
r"""Returns an interface to the logging config for the named agent state"""
return _pyflamegpu.LoggingConfig_agent(self, *args)
def logEnvironment(self, property_name):
r"""
Mark a named environment property to be logged
:type property_name: string
:param property_name: Name of the environment property to be logged
:raises: InvalidEnvironment
"""
return _pyflamegpu.LoggingConfig_logEnvironment(self, property_name)
__swig_destroy__ = _pyflamegpu.delete_LoggingConfig
# Register LoggingConfig in _pyflamegpu:
_pyflamegpu.LoggingConfig_swigregister(LoggingConfig)
def LoggingConfig_toString(r):
return _pyflamegpu.LoggingConfig_toString(r)
class StepLoggingConfig(LoggingConfig):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self, *args):
_pyflamegpu.StepLoggingConfig_swiginit(self, _pyflamegpu.new_StepLoggingConfig(*args))
def setFrequency(self, steps):
r"""
Set the frequency of step log collection
How many steps between each log collection, defaults to 1, so a log is collected every step
A value of 0 disables step log collection
"""
return _pyflamegpu.StepLoggingConfig_setFrequency(self, steps)
__swig_destroy__ = _pyflamegpu.delete_StepLoggingConfig
# Register StepLoggingConfig in _pyflamegpu:
_pyflamegpu.StepLoggingConfig_swigregister(StepLoggingConfig)
class AgentLoggingConfig(object):
r"""Interface to the data structure for controlling how a specific agent-state's data is logged"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
def __init__(self, *args, **kwargs):
raise AttributeError("No constructor defined")
__repr__ = _swig_repr
def logCount(self):
r"""Log the number of agents in this specific agent state"""
return _pyflamegpu.AgentLoggingConfig_logCount(self)
def logMeanFloat(self, variable_name):
r"""
Mark the mean of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's mean logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's mean has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logMeanFloat(self, variable_name)
def logMeanDouble(self, variable_name):
r"""
Mark the mean of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's mean logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's mean has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logMeanDouble(self, variable_name)
def logMeanInt16(self, variable_name):
r"""
Mark the mean of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's mean logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's mean has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logMeanInt16(self, variable_name)
def logMeanInt32(self, variable_name):
r"""
Mark the mean of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's mean logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's mean has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logMeanInt32(self, variable_name)
def logMeanInt64(self, variable_name):
r"""
Mark the mean of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's mean logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's mean has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logMeanInt64(self, variable_name)
def logMeanUInt16(self, variable_name):
r"""
Mark the mean of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's mean logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's mean has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logMeanUInt16(self, variable_name)
def logMeanUInt32(self, variable_name):
r"""
Mark the mean of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's mean logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's mean has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logMeanUInt32(self, variable_name)
def logMeanUInt64(self, variable_name):
r"""
Mark the mean of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's mean logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's mean has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logMeanUInt64(self, variable_name)
def logMeanInt(self, variable_name):
r"""
Mark the mean of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's mean logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's mean has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logMeanInt(self, variable_name)
def logMeanUInt(self, variable_name):
r"""
Mark the mean of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's mean logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's mean has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logMeanUInt(self, variable_name)
def logMeanInt8(self, variable_name):
r"""
Mark the mean of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's mean logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's mean has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logMeanInt8(self, variable_name)
def logMeanUInt8(self, variable_name):
r"""
Mark the mean of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's mean logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's mean has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logMeanUInt8(self, variable_name)
def logMeanChar(self, variable_name):
r"""
Mark the mean of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's mean logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's mean has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logMeanChar(self, variable_name)
def logMeanUChar(self, variable_name):
r"""
Mark the mean of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's mean logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's mean has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logMeanUChar(self, variable_name)
def logMinFloat(self, variable_name):
r"""
Mark the min of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's min logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's min has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logMinFloat(self, variable_name)
def logMinDouble(self, variable_name):
r"""
Mark the min of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's min logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's min has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logMinDouble(self, variable_name)
def logMinInt16(self, variable_name):
r"""
Mark the min of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's min logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's min has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logMinInt16(self, variable_name)
def logMinInt32(self, variable_name):
r"""
Mark the min of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's min logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's min has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logMinInt32(self, variable_name)
def logMinInt64(self, variable_name):
r"""
Mark the min of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's min logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's min has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logMinInt64(self, variable_name)
def logMinUInt16(self, variable_name):
r"""
Mark the min of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's min logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's min has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logMinUInt16(self, variable_name)
def logMinUInt32(self, variable_name):
r"""
Mark the min of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's min logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's min has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logMinUInt32(self, variable_name)
def logMinUInt64(self, variable_name):
r"""
Mark the min of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's min logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's min has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logMinUInt64(self, variable_name)
def logMinInt(self, variable_name):
r"""
Mark the min of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's min logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's min has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logMinInt(self, variable_name)
def logMinUInt(self, variable_name):
r"""
Mark the min of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's min logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's min has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logMinUInt(self, variable_name)
def logMinInt8(self, variable_name):
r"""
Mark the min of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's min logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's min has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logMinInt8(self, variable_name)
def logMinUInt8(self, variable_name):
r"""
Mark the min of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's min logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's min has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logMinUInt8(self, variable_name)
def logMinChar(self, variable_name):
r"""
Mark the min of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's min logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's min has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logMinChar(self, variable_name)
def logMinUChar(self, variable_name):
r"""
Mark the min of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's min logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's min has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logMinUChar(self, variable_name)
def logMaxFloat(self, variable_name):
r"""
Mark the max of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's max logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's max has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logMaxFloat(self, variable_name)
def logMaxDouble(self, variable_name):
r"""
Mark the max of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's max logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's max has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logMaxDouble(self, variable_name)
def logMaxInt16(self, variable_name):
r"""
Mark the max of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's max logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's max has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logMaxInt16(self, variable_name)
def logMaxInt32(self, variable_name):
r"""
Mark the max of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's max logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's max has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logMaxInt32(self, variable_name)
def logMaxInt64(self, variable_name):
r"""
Mark the max of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's max logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's max has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logMaxInt64(self, variable_name)
def logMaxUInt16(self, variable_name):
r"""
Mark the max of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's max logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's max has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logMaxUInt16(self, variable_name)
def logMaxUInt32(self, variable_name):
r"""
Mark the max of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's max logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's max has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logMaxUInt32(self, variable_name)
def logMaxUInt64(self, variable_name):
r"""
Mark the max of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's max logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's max has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logMaxUInt64(self, variable_name)
def logMaxInt(self, variable_name):
r"""
Mark the max of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's max logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's max has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logMaxInt(self, variable_name)
def logMaxUInt(self, variable_name):
r"""
Mark the max of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's max logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's max has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logMaxUInt(self, variable_name)
def logMaxInt8(self, variable_name):
r"""
Mark the max of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's max logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's max has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logMaxInt8(self, variable_name)
def logMaxUInt8(self, variable_name):
r"""
Mark the max of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's max logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's max has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logMaxUInt8(self, variable_name)
def logMaxChar(self, variable_name):
r"""
Mark the max of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's max logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's max has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logMaxChar(self, variable_name)
def logMaxUChar(self, variable_name):
r"""
Mark the max of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's max logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's max has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logMaxUChar(self, variable_name)
def logStandardDevFloat(self, variable_name):
r"""
Mark the standard deviation of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's standard deviation logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's standard deviation has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logStandardDevFloat(self, variable_name)
def logStandardDevDouble(self, variable_name):
r"""
Mark the standard deviation of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's standard deviation logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's standard deviation has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logStandardDevDouble(self, variable_name)
def logStandardDevInt16(self, variable_name):
r"""
Mark the standard deviation of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's standard deviation logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's standard deviation has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logStandardDevInt16(self, variable_name)
def logStandardDevInt32(self, variable_name):
r"""
Mark the standard deviation of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's standard deviation logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's standard deviation has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logStandardDevInt32(self, variable_name)
def logStandardDevInt64(self, variable_name):
r"""
Mark the standard deviation of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's standard deviation logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's standard deviation has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logStandardDevInt64(self, variable_name)
def logStandardDevUInt16(self, variable_name):
r"""
Mark the standard deviation of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's standard deviation logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's standard deviation has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logStandardDevUInt16(self, variable_name)
def logStandardDevUInt32(self, variable_name):
r"""
Mark the standard deviation of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's standard deviation logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's standard deviation has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logStandardDevUInt32(self, variable_name)
def logStandardDevUInt64(self, variable_name):
r"""
Mark the standard deviation of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's standard deviation logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's standard deviation has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logStandardDevUInt64(self, variable_name)
def logStandardDevInt(self, variable_name):
r"""
Mark the standard deviation of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's standard deviation logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's standard deviation has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logStandardDevInt(self, variable_name)
def logStandardDevUInt(self, variable_name):
r"""
Mark the standard deviation of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's standard deviation logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's standard deviation has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logStandardDevUInt(self, variable_name)
def logStandardDevInt8(self, variable_name):
r"""
Mark the standard deviation of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's standard deviation logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's standard deviation has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logStandardDevInt8(self, variable_name)
def logStandardDevUInt8(self, variable_name):
r"""
Mark the standard deviation of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's standard deviation logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's standard deviation has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logStandardDevUInt8(self, variable_name)
def logStandardDevChar(self, variable_name):
r"""
Mark the standard deviation of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's standard deviation logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's standard deviation has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logStandardDevChar(self, variable_name)
def logStandardDevUChar(self, variable_name):
r"""
Mark the standard deviation of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's standard deviation logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's standard deviation has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logStandardDevUChar(self, variable_name)
def logSumFloat(self, variable_name):
r"""
Mark the sum of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's sum logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's sum has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logSumFloat(self, variable_name)
def logSumDouble(self, variable_name):
r"""
Mark the sum of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's sum logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's sum has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logSumDouble(self, variable_name)
def logSumInt16(self, variable_name):
r"""
Mark the sum of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's sum logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's sum has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logSumInt16(self, variable_name)
def logSumInt32(self, variable_name):
r"""
Mark the sum of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's sum logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's sum has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logSumInt32(self, variable_name)
def logSumInt64(self, variable_name):
r"""
Mark the sum of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's sum logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's sum has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logSumInt64(self, variable_name)
def logSumUInt16(self, variable_name):
r"""
Mark the sum of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's sum logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's sum has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logSumUInt16(self, variable_name)
def logSumUInt32(self, variable_name):
r"""
Mark the sum of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's sum logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's sum has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logSumUInt32(self, variable_name)
def logSumUInt64(self, variable_name):
r"""
Mark the sum of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's sum logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's sum has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logSumUInt64(self, variable_name)
def logSumInt(self, variable_name):
r"""
Mark the sum of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's sum logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's sum has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logSumInt(self, variable_name)
def logSumUInt(self, variable_name):
r"""
Mark the sum of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's sum logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's sum has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logSumUInt(self, variable_name)
def logSumInt8(self, variable_name):
r"""
Mark the sum of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's sum logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's sum has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logSumInt8(self, variable_name)
def logSumUInt8(self, variable_name):
r"""
Mark the sum of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's sum logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's sum has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logSumUInt8(self, variable_name)
def logSumChar(self, variable_name):
r"""
Mark the sum of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's sum logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's sum has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logSumChar(self, variable_name)
def logSumUChar(self, variable_name):
r"""
Mark the sum of the named agent variable to be logged
:type variable_name: string
:param variable_name: Name of the agent variable to have it's sum logged
:param T: The type of the named variable
:raises: InvalidAgentVar If the agent var was not found inside the specified agent
:raises: InvalidArgument If the agent var's sum has already been marked for logging
"""
return _pyflamegpu.AgentLoggingConfig_logSumUChar(self, variable_name)
__swig_destroy__ = _pyflamegpu.delete_AgentLoggingConfig
# Register AgentLoggingConfig in _pyflamegpu:
_pyflamegpu.AgentLoggingConfig_swigregister(AgentLoggingConfig)
class LogFrame(object):
r"""Perhaps separate the data and interface in these classes?"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self, *args):
r"""
*Overload 1:*
Default constructor, creates an empty log
|
*Overload 2:*
Creates a log with pre-populated data
"""
_pyflamegpu.LogFrame_swiginit(self, _pyflamegpu.new_LogFrame(*args))
def getStepCount(self):
r"""
Returns the step count of the log
0 is the state prior to the first step
"""
return _pyflamegpu.LogFrame_getStepCount(self)
def hasEnvironmentProperty(self, property_name):
r"""Environment log accessors"""
return _pyflamegpu.LogFrame_hasEnvironmentProperty(self, property_name)
def getAgent(self, *args):
r"""Agent log accessor"""
return _pyflamegpu.LogFrame_getAgent(self, *args)
def getEnvironment(self):
r"""Raw access to environment log map"""
return _pyflamegpu.LogFrame_getEnvironment(self)
def getAgents(self):
r"""Raw access to agent log map"""
return _pyflamegpu.LogFrame_getAgents(self)
def getEnvironmentPropertyFloat(self, property_name):
return _pyflamegpu.LogFrame_getEnvironmentPropertyFloat(self, property_name)
def getEnvironmentPropertyDouble(self, property_name):
return _pyflamegpu.LogFrame_getEnvironmentPropertyDouble(self, property_name)
def getEnvironmentPropertyInt16(self, property_name):
return _pyflamegpu.LogFrame_getEnvironmentPropertyInt16(self, property_name)
def getEnvironmentPropertyInt32(self, property_name):
return _pyflamegpu.LogFrame_getEnvironmentPropertyInt32(self, property_name)
def getEnvironmentPropertyInt64(self, property_name):
return _pyflamegpu.LogFrame_getEnvironmentPropertyInt64(self, property_name)
def getEnvironmentPropertyUInt16(self, property_name):
return _pyflamegpu.LogFrame_getEnvironmentPropertyUInt16(self, property_name)
def getEnvironmentPropertyUInt32(self, property_name):
return _pyflamegpu.LogFrame_getEnvironmentPropertyUInt32(self, property_name)
def getEnvironmentPropertyUInt64(self, property_name):
return _pyflamegpu.LogFrame_getEnvironmentPropertyUInt64(self, property_name)
def getEnvironmentPropertyInt(self, property_name):
return _pyflamegpu.LogFrame_getEnvironmentPropertyInt(self, property_name)
def getEnvironmentPropertyUInt(self, property_name):
return _pyflamegpu.LogFrame_getEnvironmentPropertyUInt(self, property_name)
def getEnvironmentPropertyInt8(self, property_name):
return _pyflamegpu.LogFrame_getEnvironmentPropertyInt8(self, property_name)
def getEnvironmentPropertyUInt8(self, property_name):
return _pyflamegpu.LogFrame_getEnvironmentPropertyUInt8(self, property_name)
def getEnvironmentPropertyChar(self, property_name):
return _pyflamegpu.LogFrame_getEnvironmentPropertyChar(self, property_name)
def getEnvironmentPropertyUChar(self, property_name):
return _pyflamegpu.LogFrame_getEnvironmentPropertyUChar(self, property_name)
def getEnvironmentPropertyArrayFloat(self, property_name):
r"""
Gets an environment property array
:param name: name used for accessing the property
:param T: Type of the elements of the environment property array
:raises: InvalidEnvProperty If a property array of the name does not exist
"""
return _pyflamegpu.LogFrame_getEnvironmentPropertyArrayFloat(self, property_name)
def getEnvironmentPropertyArrayDouble(self, property_name):
r"""
Gets an environment property array
:param name: name used for accessing the property
:param T: Type of the elements of the environment property array
:raises: InvalidEnvProperty If a property array of the name does not exist
"""
return _pyflamegpu.LogFrame_getEnvironmentPropertyArrayDouble(self, property_name)
def getEnvironmentPropertyArrayInt16(self, property_name):
r"""
Gets an environment property array
:param name: name used for accessing the property
:param T: Type of the elements of the environment property array
:raises: InvalidEnvProperty If a property array of the name does not exist
"""
return _pyflamegpu.LogFrame_getEnvironmentPropertyArrayInt16(self, property_name)
def getEnvironmentPropertyArrayInt32(self, property_name):
r"""
Gets an environment property array
:param name: name used for accessing the property
:param T: Type of the elements of the environment property array
:raises: InvalidEnvProperty If a property array of the name does not exist
"""
return _pyflamegpu.LogFrame_getEnvironmentPropertyArrayInt32(self, property_name)
def getEnvironmentPropertyArrayInt64(self, property_name):
r"""
Gets an environment property array
:param name: name used for accessing the property
:param T: Type of the elements of the environment property array
:raises: InvalidEnvProperty If a property array of the name does not exist
"""
return _pyflamegpu.LogFrame_getEnvironmentPropertyArrayInt64(self, property_name)
def getEnvironmentPropertyArrayUInt16(self, property_name):
r"""
Gets an environment property array
:param name: name used for accessing the property
:param T: Type of the elements of the environment property array
:raises: InvalidEnvProperty If a property array of the name does not exist
"""
return _pyflamegpu.LogFrame_getEnvironmentPropertyArrayUInt16(self, property_name)
def getEnvironmentPropertyArrayUInt32(self, property_name):
r"""
Gets an environment property array
:param name: name used for accessing the property
:param T: Type of the elements of the environment property array
:raises: InvalidEnvProperty If a property array of the name does not exist
"""
return _pyflamegpu.LogFrame_getEnvironmentPropertyArrayUInt32(self, property_name)
def getEnvironmentPropertyArrayUInt64(self, property_name):
r"""
Gets an environment property array
:param name: name used for accessing the property
:param T: Type of the elements of the environment property array
:raises: InvalidEnvProperty If a property array of the name does not exist
"""
return _pyflamegpu.LogFrame_getEnvironmentPropertyArrayUInt64(self, property_name)
def getEnvironmentPropertyArrayInt(self, property_name):
r"""
Gets an environment property array
:param name: name used for accessing the property
:param T: Type of the elements of the environment property array
:raises: InvalidEnvProperty If a property array of the name does not exist
"""
return _pyflamegpu.LogFrame_getEnvironmentPropertyArrayInt(self, property_name)
def getEnvironmentPropertyArrayUInt(self, property_name):
r"""
Gets an environment property array
:param name: name used for accessing the property
:param T: Type of the elements of the environment property array
:raises: InvalidEnvProperty If a property array of the name does not exist
"""
return _pyflamegpu.LogFrame_getEnvironmentPropertyArrayUInt(self, property_name)
def getEnvironmentPropertyArrayInt8(self, property_name):
r"""
Gets an environment property array
:param name: name used for accessing the property
:param T: Type of the elements of the environment property array
:raises: InvalidEnvProperty If a property array of the name does not exist
"""
return _pyflamegpu.LogFrame_getEnvironmentPropertyArrayInt8(self, property_name)
def getEnvironmentPropertyArrayUInt8(self, property_name):
r"""
Gets an environment property array
:param name: name used for accessing the property
:param T: Type of the elements of the environment property array
:raises: InvalidEnvProperty If a property array of the name does not exist
"""
return _pyflamegpu.LogFrame_getEnvironmentPropertyArrayUInt8(self, property_name)
def getEnvironmentPropertyArrayChar(self, property_name):
r"""
Gets an environment property array
:param name: name used for accessing the property
:param T: Type of the elements of the environment property array
:raises: InvalidEnvProperty If a property array of the name does not exist
"""
return _pyflamegpu.LogFrame_getEnvironmentPropertyArrayChar(self, property_name)
def getEnvironmentPropertyArrayUChar(self, property_name):
r"""
Gets an environment property array
:param name: name used for accessing the property
:param T: Type of the elements of the environment property array
:raises: InvalidEnvProperty If a property array of the name does not exist
"""
return _pyflamegpu.LogFrame_getEnvironmentPropertyArrayUChar(self, property_name)
__swig_destroy__ = _pyflamegpu.delete_LogFrame
# Register LogFrame in _pyflamegpu:
_pyflamegpu.LogFrame_swigregister(LogFrame)
class RunLog(object):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self, *args):
_pyflamegpu.RunLog_swiginit(self, _pyflamegpu.new_RunLog(*args))
def getExitLog(self):
return _pyflamegpu.RunLog_getExitLog(self)
def getStepLog(self):
return _pyflamegpu.RunLog_getStepLog(self)
def getRandomSeed(self):
return _pyflamegpu.RunLog_getRandomSeed(self)
__swig_destroy__ = _pyflamegpu.delete_RunLog
# Register RunLog in _pyflamegpu:
_pyflamegpu.RunLog_swigregister(RunLog)
class AgentLogFrame(object):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self, data, count):
_pyflamegpu.AgentLogFrame_swiginit(self, _pyflamegpu.new_AgentLogFrame(data, count))
def getCount(self):
return _pyflamegpu.AgentLogFrame_getCount(self)
def getMean(self, variable_name):
return _pyflamegpu.AgentLogFrame_getMean(self, variable_name)
def getStandardDev(self, variable_name):
return _pyflamegpu.AgentLogFrame_getStandardDev(self, variable_name)
def getMinFloat(self, variable_name):
return _pyflamegpu.AgentLogFrame_getMinFloat(self, variable_name)
def getMinDouble(self, variable_name):
return _pyflamegpu.AgentLogFrame_getMinDouble(self, variable_name)
def getMinInt16(self, variable_name):
return _pyflamegpu.AgentLogFrame_getMinInt16(self, variable_name)
def getMinInt32(self, variable_name):
return _pyflamegpu.AgentLogFrame_getMinInt32(self, variable_name)
def getMinInt64(self, variable_name):
return _pyflamegpu.AgentLogFrame_getMinInt64(self, variable_name)
def getMinUInt16(self, variable_name):
return _pyflamegpu.AgentLogFrame_getMinUInt16(self, variable_name)
def getMinUInt32(self, variable_name):
return _pyflamegpu.AgentLogFrame_getMinUInt32(self, variable_name)
def getMinUInt64(self, variable_name):
return _pyflamegpu.AgentLogFrame_getMinUInt64(self, variable_name)
def getMinInt(self, variable_name):
return _pyflamegpu.AgentLogFrame_getMinInt(self, variable_name)
def getMinUInt(self, variable_name):
return _pyflamegpu.AgentLogFrame_getMinUInt(self, variable_name)
def getMinInt8(self, variable_name):
return _pyflamegpu.AgentLogFrame_getMinInt8(self, variable_name)
def getMinUInt8(self, variable_name):
return _pyflamegpu.AgentLogFrame_getMinUInt8(self, variable_name)
def getMinChar(self, variable_name):
return _pyflamegpu.AgentLogFrame_getMinChar(self, variable_name)
def getMinUChar(self, variable_name):
return _pyflamegpu.AgentLogFrame_getMinUChar(self, variable_name)
def getMaxFloat(self, variable_name):
return _pyflamegpu.AgentLogFrame_getMaxFloat(self, variable_name)
def getMaxDouble(self, variable_name):
return _pyflamegpu.AgentLogFrame_getMaxDouble(self, variable_name)
def getMaxInt16(self, variable_name):
return _pyflamegpu.AgentLogFrame_getMaxInt16(self, variable_name)
def getMaxInt32(self, variable_name):
return _pyflamegpu.AgentLogFrame_getMaxInt32(self, variable_name)
def getMaxInt64(self, variable_name):
return _pyflamegpu.AgentLogFrame_getMaxInt64(self, variable_name)
def getMaxUInt16(self, variable_name):
return _pyflamegpu.AgentLogFrame_getMaxUInt16(self, variable_name)
def getMaxUInt32(self, variable_name):
return _pyflamegpu.AgentLogFrame_getMaxUInt32(self, variable_name)
def getMaxUInt64(self, variable_name):
return _pyflamegpu.AgentLogFrame_getMaxUInt64(self, variable_name)
def getMaxInt(self, variable_name):
return _pyflamegpu.AgentLogFrame_getMaxInt(self, variable_name)
def getMaxUInt(self, variable_name):
return _pyflamegpu.AgentLogFrame_getMaxUInt(self, variable_name)
def getMaxInt8(self, variable_name):
return _pyflamegpu.AgentLogFrame_getMaxInt8(self, variable_name)
def getMaxUInt8(self, variable_name):
return _pyflamegpu.AgentLogFrame_getMaxUInt8(self, variable_name)
def getMaxChar(self, variable_name):
return _pyflamegpu.AgentLogFrame_getMaxChar(self, variable_name)
def getMaxUChar(self, variable_name):
return _pyflamegpu.AgentLogFrame_getMaxUChar(self, variable_name)
def getSumFloat(self, variable_name):
return _pyflamegpu.AgentLogFrame_getSumFloat(self, variable_name)
def getSumDouble(self, variable_name):
return _pyflamegpu.AgentLogFrame_getSumDouble(self, variable_name)
def getSumInt16(self, variable_name):
return _pyflamegpu.AgentLogFrame_getSumInt16(self, variable_name)
def getSumInt32(self, variable_name):
return _pyflamegpu.AgentLogFrame_getSumInt32(self, variable_name)
def getSumInt64(self, variable_name):
return _pyflamegpu.AgentLogFrame_getSumInt64(self, variable_name)
def getSumUInt16(self, variable_name):
return _pyflamegpu.AgentLogFrame_getSumUInt16(self, variable_name)
def getSumUInt32(self, variable_name):
return _pyflamegpu.AgentLogFrame_getSumUInt32(self, variable_name)
def getSumUInt64(self, variable_name):
return _pyflamegpu.AgentLogFrame_getSumUInt64(self, variable_name)
def getSumInt(self, variable_name):
return _pyflamegpu.AgentLogFrame_getSumInt(self, variable_name)
def getSumUInt(self, variable_name):
return _pyflamegpu.AgentLogFrame_getSumUInt(self, variable_name)
def getSumInt8(self, variable_name):
return _pyflamegpu.AgentLogFrame_getSumInt8(self, variable_name)
def getSumUInt8(self, variable_name):
return _pyflamegpu.AgentLogFrame_getSumUInt8(self, variable_name)
def getSumChar(self, variable_name):
return _pyflamegpu.AgentLogFrame_getSumChar(self, variable_name)
def getSumUChar(self, variable_name):
return _pyflamegpu.AgentLogFrame_getSumUChar(self, variable_name)
__swig_destroy__ = _pyflamegpu.delete_AgentLogFrame
# Register AgentLogFrame in _pyflamegpu:
_pyflamegpu.AgentLogFrame_swigregister(AgentLogFrame)
class LogFrameList(object):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def iterator(self):
return _pyflamegpu.LogFrameList_iterator(self)
def __iter__(self):
return self.iterator()
def __nonzero__(self):
return _pyflamegpu.LogFrameList___nonzero__(self)
def __bool__(self):
return _pyflamegpu.LogFrameList___bool__(self)
def __len__(self):
return _pyflamegpu.LogFrameList___len__(self)
def __getslice__(self, i, j):
return _pyflamegpu.LogFrameList___getslice__(self, i, j)
def __setslice__(self, *args):
return _pyflamegpu.LogFrameList___setslice__(self, *args)
def __delslice__(self, i, j):
return _pyflamegpu.LogFrameList___delslice__(self, i, j)
def __delitem__(self, *args):
return _pyflamegpu.LogFrameList___delitem__(self, *args)
def __getitem__(self, *args):
return _pyflamegpu.LogFrameList___getitem__(self, *args)
def __setitem__(self, *args):
return _pyflamegpu.LogFrameList___setitem__(self, *args)
def pop(self):
return _pyflamegpu.LogFrameList_pop(self)
def append(self, x):
return _pyflamegpu.LogFrameList_append(self, x)
def empty(self):
return _pyflamegpu.LogFrameList_empty(self)
def size(self):
return _pyflamegpu.LogFrameList_size(self)
def swap(self, v):
return _pyflamegpu.LogFrameList_swap(self, v)
def begin(self):
return _pyflamegpu.LogFrameList_begin(self)
def end(self):
return _pyflamegpu.LogFrameList_end(self)
def rbegin(self):
return _pyflamegpu.LogFrameList_rbegin(self)
def rend(self):
return _pyflamegpu.LogFrameList_rend(self)
def clear(self):
return _pyflamegpu.LogFrameList_clear(self)
def get_allocator(self):
return _pyflamegpu.LogFrameList_get_allocator(self)
def pop_back(self):
return _pyflamegpu.LogFrameList_pop_back(self)
def erase(self, *args):
return _pyflamegpu.LogFrameList_erase(self, *args)
def __init__(self, *args):
_pyflamegpu.LogFrameList_swiginit(self, _pyflamegpu.new_LogFrameList(*args))
def push_back(self, x):
return _pyflamegpu.LogFrameList_push_back(self, x)
def front(self):
return _pyflamegpu.LogFrameList_front(self)
def back(self):
return _pyflamegpu.LogFrameList_back(self)
def assign(self, n, x):
return _pyflamegpu.LogFrameList_assign(self, n, x)
def resize(self, *args):
return _pyflamegpu.LogFrameList_resize(self, *args)
def insert(self, *args):
return _pyflamegpu.LogFrameList_insert(self, *args)
def pop_front(self):
return _pyflamegpu.LogFrameList_pop_front(self)
def push_front(self, x):
return _pyflamegpu.LogFrameList_push_front(self, x)
def reverse(self):
return _pyflamegpu.LogFrameList_reverse(self)
__swig_destroy__ = _pyflamegpu.delete_LogFrameList
# Register LogFrameList in _pyflamegpu:
_pyflamegpu.LogFrameList_swigregister(LogFrameList)
class RunPlan(object):
r"""Individual run config"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self, environment):
r"""
Constructor this will need to set the random seed to a default value, +1 of previous EnsembleRun would make sense
:type environment: :py:class:`ModelDescription`
:param environment: EnvironmentDescription to limit properties by
TODO: Where will default steps and random seed come from?
"""
_pyflamegpu.RunPlan_swiginit(self, _pyflamegpu.new_RunPlan(environment))
def setRandomSimulationSeed(self, random_seed):
r"""
Set the random seed passed to this run of the simulation
:type random_seed: int
:param random_seed: Seed for random generation during execution
"""
return _pyflamegpu.RunPlan_setRandomSimulationSeed(self, random_seed)
def setSteps(self, steps):
r"""
Set the number of steps for this instance of the simulation
A steps value of 0 requires the ModelDescription to have atleast 1 exit condition
:type steps: int
:param steps: The number of steps to execute, 0 is unlimited but requires an exit condition
"""
return _pyflamegpu.RunPlan_setSteps(self, steps)
def setOutputSubdirectory(self, subdir):
r"""
Set the sub directory within the output directory for outputs of this run
If left empty, output will not goto subdirectories
:param steps: The number of steps to execute, 0 is unlimited but requires an exit condition
"""
return _pyflamegpu.RunPlan_setOutputSubdirectory(self, subdir)
def getRandomSimulationSeed(self):
r"""Returns the random seed used for this simulation run"""
return _pyflamegpu.RunPlan_getRandomSimulationSeed(self)
def getSteps(self):
r"""
Returns the number of steps to be executed for this simulation run
0 means unlimited, and is only available if the model description has an exit condition
"""
return _pyflamegpu.RunPlan_getSteps(self)
def getOutputSubdirectory(self):
r"""
Returns the currently configured output subdirectory directory
Empty string means output for this run will not be placed into a subdirectory
"""
return _pyflamegpu.RunPlan_getOutputSubdirectory(self)
def __add__(self, *args):
return _pyflamegpu.RunPlan___add__(self, *args)
def __mul__(self, rhs):
return _pyflamegpu.RunPlan___mul__(self, rhs)
def setPropertyFloat(self, *args):
r"""
*Overload 1:*
Set the environment property override for this run of the model
:type name: string
:param name: Environment property name
:type value: float
:param value: Environment property value (override)
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
|
*Overload 2:*
Set the environment property override for this run of the model
This version should be used for setting individual elements of array properties
:type name: string
:param name: Environment property name
:type index: int
:param index: Length of the array to be returned
:type value: float
:param value: Environment property value (override)
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is not in range of the length of the property array
"""
return _pyflamegpu.RunPlan_setPropertyFloat(self, *args)
def setPropertyDouble(self, *args):
r"""
*Overload 1:*
Set the environment property override for this run of the model
:type name: string
:param name: Environment property name
:type value: float
:param value: Environment property value (override)
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
|
*Overload 2:*
Set the environment property override for this run of the model
This version should be used for setting individual elements of array properties
:type name: string
:param name: Environment property name
:type index: int
:param index: Length of the array to be returned
:type value: float
:param value: Environment property value (override)
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is not in range of the length of the property array
"""
return _pyflamegpu.RunPlan_setPropertyDouble(self, *args)
def setPropertyInt16(self, *args):
r"""
*Overload 1:*
Set the environment property override for this run of the model
:type name: string
:param name: Environment property name
:type value: int
:param value: Environment property value (override)
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
|
*Overload 2:*
Set the environment property override for this run of the model
This version should be used for setting individual elements of array properties
:type name: string
:param name: Environment property name
:type index: int
:param index: Length of the array to be returned
:type value: int
:param value: Environment property value (override)
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is not in range of the length of the property array
"""
return _pyflamegpu.RunPlan_setPropertyInt16(self, *args)
def setPropertyInt32(self, *args):
r"""
*Overload 1:*
Set the environment property override for this run of the model
:type name: string
:param name: Environment property name
:type value: int
:param value: Environment property value (override)
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
|
*Overload 2:*
Set the environment property override for this run of the model
This version should be used for setting individual elements of array properties
:type name: string
:param name: Environment property name
:type index: int
:param index: Length of the array to be returned
:type value: int
:param value: Environment property value (override)
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is not in range of the length of the property array
"""
return _pyflamegpu.RunPlan_setPropertyInt32(self, *args)
def setPropertyInt64(self, *args):
r"""
*Overload 1:*
Set the environment property override for this run of the model
:type name: string
:param name: Environment property name
:type value: int
:param value: Environment property value (override)
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
|
*Overload 2:*
Set the environment property override for this run of the model
This version should be used for setting individual elements of array properties
:type name: string
:param name: Environment property name
:type index: int
:param index: Length of the array to be returned
:type value: int
:param value: Environment property value (override)
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is not in range of the length of the property array
"""
return _pyflamegpu.RunPlan_setPropertyInt64(self, *args)
def setPropertyUInt16(self, *args):
r"""
*Overload 1:*
Set the environment property override for this run of the model
:type name: string
:param name: Environment property name
:type value: int
:param value: Environment property value (override)
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
|
*Overload 2:*
Set the environment property override for this run of the model
This version should be used for setting individual elements of array properties
:type name: string
:param name: Environment property name
:type index: int
:param index: Length of the array to be returned
:type value: int
:param value: Environment property value (override)
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is not in range of the length of the property array
"""
return _pyflamegpu.RunPlan_setPropertyUInt16(self, *args)
def setPropertyUInt32(self, *args):
r"""
*Overload 1:*
Set the environment property override for this run of the model
:type name: string
:param name: Environment property name
:type value: int
:param value: Environment property value (override)
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
|
*Overload 2:*
Set the environment property override for this run of the model
This version should be used for setting individual elements of array properties
:type name: string
:param name: Environment property name
:type index: int
:param index: Length of the array to be returned
:type value: int
:param value: Environment property value (override)
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is not in range of the length of the property array
"""
return _pyflamegpu.RunPlan_setPropertyUInt32(self, *args)
def setPropertyUInt64(self, *args):
r"""
*Overload 1:*
Set the environment property override for this run of the model
:type name: string
:param name: Environment property name
:type value: int
:param value: Environment property value (override)
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
|
*Overload 2:*
Set the environment property override for this run of the model
This version should be used for setting individual elements of array properties
:type name: string
:param name: Environment property name
:type index: int
:param index: Length of the array to be returned
:type value: int
:param value: Environment property value (override)
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is not in range of the length of the property array
"""
return _pyflamegpu.RunPlan_setPropertyUInt64(self, *args)
def setPropertyInt(self, *args):
r"""
*Overload 1:*
Set the environment property override for this run of the model
:type name: string
:param name: Environment property name
:type value: int
:param value: Environment property value (override)
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
|
*Overload 2:*
Set the environment property override for this run of the model
This version should be used for setting individual elements of array properties
:type name: string
:param name: Environment property name
:type index: int
:param index: Length of the array to be returned
:type value: int
:param value: Environment property value (override)
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is not in range of the length of the property array
"""
return _pyflamegpu.RunPlan_setPropertyInt(self, *args)
def setPropertyUInt(self, *args):
r"""
*Overload 1:*
Set the environment property override for this run of the model
:type name: string
:param name: Environment property name
:type value: int
:param value: Environment property value (override)
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
|
*Overload 2:*
Set the environment property override for this run of the model
This version should be used for setting individual elements of array properties
:type name: string
:param name: Environment property name
:type index: int
:param index: Length of the array to be returned
:type value: int
:param value: Environment property value (override)
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is not in range of the length of the property array
"""
return _pyflamegpu.RunPlan_setPropertyUInt(self, *args)
def setPropertyInt8(self, *args):
r"""
*Overload 1:*
Set the environment property override for this run of the model
:type name: string
:param name: Environment property name
:type value: signed char
:param value: Environment property value (override)
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
|
*Overload 2:*
Set the environment property override for this run of the model
This version should be used for setting individual elements of array properties
:type name: string
:param name: Environment property name
:type index: int
:param index: Length of the array to be returned
:type value: signed char
:param value: Environment property value (override)
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is not in range of the length of the property array
"""
return _pyflamegpu.RunPlan_setPropertyInt8(self, *args)
def setPropertyUInt8(self, *args):
r"""
*Overload 1:*
Set the environment property override for this run of the model
:type name: string
:param name: Environment property name
:type value: unsigned char
:param value: Environment property value (override)
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
|
*Overload 2:*
Set the environment property override for this run of the model
This version should be used for setting individual elements of array properties
:type name: string
:param name: Environment property name
:type index: int
:param index: Length of the array to be returned
:type value: unsigned char
:param value: Environment property value (override)
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is not in range of the length of the property array
"""
return _pyflamegpu.RunPlan_setPropertyUInt8(self, *args)
def setPropertyChar(self, *args):
r"""
*Overload 1:*
Set the environment property override for this run of the model
:type name: string
:param name: Environment property name
:type value: char
:param value: Environment property value (override)
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
|
*Overload 2:*
Set the environment property override for this run of the model
This version should be used for setting individual elements of array properties
:type name: string
:param name: Environment property name
:type index: int
:param index: Length of the array to be returned
:type value: char
:param value: Environment property value (override)
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is not in range of the length of the property array
"""
return _pyflamegpu.RunPlan_setPropertyChar(self, *args)
def setPropertyUChar(self, *args):
r"""
*Overload 1:*
Set the environment property override for this run of the model
:type name: string
:param name: Environment property name
:type value: unsigned char
:param value: Environment property value (override)
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
|
*Overload 2:*
Set the environment property override for this run of the model
This version should be used for setting individual elements of array properties
:type name: string
:param name: Environment property name
:type index: int
:param index: Length of the array to be returned
:type value: unsigned char
:param value: Environment property value (override)
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is not in range of the length of the property array
"""
return _pyflamegpu.RunPlan_setPropertyUChar(self, *args)
def setPropertyArrayFloat(self, name, length, value):
r"""
Set the environment property override for this run of the model
This version should be used for array properties
:type name: string
:param name: Environment property name
:type length: int
:param length: Length of the environmental property array to be created
:type value: std::vector< float,std::allocator< float > >
:param value: Environment property value (override)
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvProperty If value.size() != length
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length to N
"""
return _pyflamegpu.RunPlan_setPropertyArrayFloat(self, name, length, value)
def setPropertyArrayDouble(self, name, length, value):
r"""
Set the environment property override for this run of the model
This version should be used for array properties
:type name: string
:param name: Environment property name
:type length: int
:param length: Length of the environmental property array to be created
:type value: std::vector< double,std::allocator< double > >
:param value: Environment property value (override)
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvProperty If value.size() != length
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length to N
"""
return _pyflamegpu.RunPlan_setPropertyArrayDouble(self, name, length, value)
def setPropertyArrayInt16(self, name, length, value):
r"""
Set the environment property override for this run of the model
This version should be used for array properties
:type name: string
:param name: Environment property name
:type length: int
:param length: Length of the environmental property array to be created
:type value: std::vector< short,std::allocator< short > >
:param value: Environment property value (override)
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvProperty If value.size() != length
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length to N
"""
return _pyflamegpu.RunPlan_setPropertyArrayInt16(self, name, length, value)
def setPropertyArrayInt32(self, name, length, value):
r"""
Set the environment property override for this run of the model
This version should be used for array properties
:type name: string
:param name: Environment property name
:type length: int
:param length: Length of the environmental property array to be created
:type value: std::vector< int,std::allocator< int > >
:param value: Environment property value (override)
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvProperty If value.size() != length
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length to N
"""
return _pyflamegpu.RunPlan_setPropertyArrayInt32(self, name, length, value)
def setPropertyArrayInt64(self, name, length, value):
r"""
Set the environment property override for this run of the model
This version should be used for array properties
:type name: string
:param name: Environment property name
:type length: int
:param length: Length of the environmental property array to be created
:type value: std::vector< long long,std::allocator< long long > >
:param value: Environment property value (override)
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvProperty If value.size() != length
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length to N
"""
return _pyflamegpu.RunPlan_setPropertyArrayInt64(self, name, length, value)
def setPropertyArrayUInt16(self, name, length, value):
r"""
Set the environment property override for this run of the model
This version should be used for array properties
:type name: string
:param name: Environment property name
:type length: int
:param length: Length of the environmental property array to be created
:type value: std::vector< unsigned short,std::allocator< unsigned short > >
:param value: Environment property value (override)
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvProperty If value.size() != length
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length to N
"""
return _pyflamegpu.RunPlan_setPropertyArrayUInt16(self, name, length, value)
def setPropertyArrayUInt32(self, name, length, value):
r"""
Set the environment property override for this run of the model
This version should be used for array properties
:type name: string
:param name: Environment property name
:type length: int
:param length: Length of the environmental property array to be created
:type value: std::vector< unsigned int,std::allocator< unsigned int > >
:param value: Environment property value (override)
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvProperty If value.size() != length
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length to N
"""
return _pyflamegpu.RunPlan_setPropertyArrayUInt32(self, name, length, value)
def setPropertyArrayUInt64(self, name, length, value):
r"""
Set the environment property override for this run of the model
This version should be used for array properties
:type name: string
:param name: Environment property name
:type length: int
:param length: Length of the environmental property array to be created
:type value: std::vector< unsigned long long,std::allocator< unsigned long long > >
:param value: Environment property value (override)
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvProperty If value.size() != length
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length to N
"""
return _pyflamegpu.RunPlan_setPropertyArrayUInt64(self, name, length, value)
def setPropertyArrayInt(self, name, length, value):
r"""
Set the environment property override for this run of the model
This version should be used for array properties
:type name: string
:param name: Environment property name
:type length: int
:param length: Length of the environmental property array to be created
:type value: std::vector< int,std::allocator< int > >
:param value: Environment property value (override)
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvProperty If value.size() != length
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length to N
"""
return _pyflamegpu.RunPlan_setPropertyArrayInt(self, name, length, value)
def setPropertyArrayUInt(self, name, length, value):
r"""
Set the environment property override for this run of the model
This version should be used for array properties
:type name: string
:param name: Environment property name
:type length: int
:param length: Length of the environmental property array to be created
:type value: std::vector< unsigned int,std::allocator< unsigned int > >
:param value: Environment property value (override)
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvProperty If value.size() != length
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length to N
"""
return _pyflamegpu.RunPlan_setPropertyArrayUInt(self, name, length, value)
def setPropertyArrayInt8(self, name, length, value):
r"""
Set the environment property override for this run of the model
This version should be used for array properties
:type name: string
:param name: Environment property name
:type length: int
:param length: Length of the environmental property array to be created
:type value: std::vector< signed char,std::allocator< signed char > >
:param value: Environment property value (override)
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvProperty If value.size() != length
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length to N
"""
return _pyflamegpu.RunPlan_setPropertyArrayInt8(self, name, length, value)
def setPropertyArrayUInt8(self, name, length, value):
r"""
Set the environment property override for this run of the model
This version should be used for array properties
:type name: string
:param name: Environment property name
:type length: int
:param length: Length of the environmental property array to be created
:type value: std::vector< unsigned char,std::allocator< unsigned char > >
:param value: Environment property value (override)
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvProperty If value.size() != length
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length to N
"""
return _pyflamegpu.RunPlan_setPropertyArrayUInt8(self, name, length, value)
def setPropertyArrayChar(self, name, length, value):
r"""
Set the environment property override for this run of the model
This version should be used for array properties
:type name: string
:param name: Environment property name
:type length: int
:param length: Length of the environmental property array to be created
:type value: std::vector< char,std::allocator< char > >
:param value: Environment property value (override)
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvProperty If value.size() != length
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length to N
"""
return _pyflamegpu.RunPlan_setPropertyArrayChar(self, name, length, value)
def setPropertyArrayUChar(self, name, length, value):
r"""
Set the environment property override for this run of the model
This version should be used for array properties
:type name: string
:param name: Environment property name
:type length: int
:param length: Length of the environmental property array to be created
:type value: std::vector< unsigned char,std::allocator< unsigned char > >
:param value: Environment property value (override)
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvProperty If value.size() != length
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length to N
"""
return _pyflamegpu.RunPlan_setPropertyArrayUChar(self, name, length, value)
def getPropertyFloat(self, *args):
r"""
*Overload 1:*
Gets the currently configured environment property value
:type name: string
:param name: name used for accessing the property
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
|
*Overload 2:*
Gets an element of the currently configured environment property array
:type name: string
:param name: name used for accessing the property
:type index: int
:param index: element from the environment property array to return
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is not in range of the length of the property array
"""
return _pyflamegpu.RunPlan_getPropertyFloat(self, *args)
def getPropertyDouble(self, *args):
r"""
*Overload 1:*
Gets the currently configured environment property value
:type name: string
:param name: name used for accessing the property
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
|
*Overload 2:*
Gets an element of the currently configured environment property array
:type name: string
:param name: name used for accessing the property
:type index: int
:param index: element from the environment property array to return
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is not in range of the length of the property array
"""
return _pyflamegpu.RunPlan_getPropertyDouble(self, *args)
def getPropertyInt16(self, *args):
r"""
*Overload 1:*
Gets the currently configured environment property value
:type name: string
:param name: name used for accessing the property
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
|
*Overload 2:*
Gets an element of the currently configured environment property array
:type name: string
:param name: name used for accessing the property
:type index: int
:param index: element from the environment property array to return
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is not in range of the length of the property array
"""
return _pyflamegpu.RunPlan_getPropertyInt16(self, *args)
def getPropertyInt32(self, *args):
r"""
*Overload 1:*
Gets the currently configured environment property value
:type name: string
:param name: name used for accessing the property
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
|
*Overload 2:*
Gets an element of the currently configured environment property array
:type name: string
:param name: name used for accessing the property
:type index: int
:param index: element from the environment property array to return
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is not in range of the length of the property array
"""
return _pyflamegpu.RunPlan_getPropertyInt32(self, *args)
def getPropertyInt64(self, *args):
r"""
*Overload 1:*
Gets the currently configured environment property value
:type name: string
:param name: name used for accessing the property
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
|
*Overload 2:*
Gets an element of the currently configured environment property array
:type name: string
:param name: name used for accessing the property
:type index: int
:param index: element from the environment property array to return
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is not in range of the length of the property array
"""
return _pyflamegpu.RunPlan_getPropertyInt64(self, *args)
def getPropertyUInt16(self, *args):
r"""
*Overload 1:*
Gets the currently configured environment property value
:type name: string
:param name: name used for accessing the property
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
|
*Overload 2:*
Gets an element of the currently configured environment property array
:type name: string
:param name: name used for accessing the property
:type index: int
:param index: element from the environment property array to return
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is not in range of the length of the property array
"""
return _pyflamegpu.RunPlan_getPropertyUInt16(self, *args)
def getPropertyUInt32(self, *args):
r"""
*Overload 1:*
Gets the currently configured environment property value
:type name: string
:param name: name used for accessing the property
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
|
*Overload 2:*
Gets an element of the currently configured environment property array
:type name: string
:param name: name used for accessing the property
:type index: int
:param index: element from the environment property array to return
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is not in range of the length of the property array
"""
return _pyflamegpu.RunPlan_getPropertyUInt32(self, *args)
def getPropertyUInt64(self, *args):
r"""
*Overload 1:*
Gets the currently configured environment property value
:type name: string
:param name: name used for accessing the property
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
|
*Overload 2:*
Gets an element of the currently configured environment property array
:type name: string
:param name: name used for accessing the property
:type index: int
:param index: element from the environment property array to return
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is not in range of the length of the property array
"""
return _pyflamegpu.RunPlan_getPropertyUInt64(self, *args)
def getPropertyInt(self, *args):
r"""
*Overload 1:*
Gets the currently configured environment property value
:type name: string
:param name: name used for accessing the property
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
|
*Overload 2:*
Gets an element of the currently configured environment property array
:type name: string
:param name: name used for accessing the property
:type index: int
:param index: element from the environment property array to return
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is not in range of the length of the property array
"""
return _pyflamegpu.RunPlan_getPropertyInt(self, *args)
def getPropertyUInt(self, *args):
r"""
*Overload 1:*
Gets the currently configured environment property value
:type name: string
:param name: name used for accessing the property
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
|
*Overload 2:*
Gets an element of the currently configured environment property array
:type name: string
:param name: name used for accessing the property
:type index: int
:param index: element from the environment property array to return
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is not in range of the length of the property array
"""
return _pyflamegpu.RunPlan_getPropertyUInt(self, *args)
def getPropertyInt8(self, *args):
r"""
*Overload 1:*
Gets the currently configured environment property value
:type name: string
:param name: name used for accessing the property
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
|
*Overload 2:*
Gets an element of the currently configured environment property array
:type name: string
:param name: name used for accessing the property
:type index: int
:param index: element from the environment property array to return
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is not in range of the length of the property array
"""
return _pyflamegpu.RunPlan_getPropertyInt8(self, *args)
def getPropertyUInt8(self, *args):
r"""
*Overload 1:*
Gets the currently configured environment property value
:type name: string
:param name: name used for accessing the property
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
|
*Overload 2:*
Gets an element of the currently configured environment property array
:type name: string
:param name: name used for accessing the property
:type index: int
:param index: element from the environment property array to return
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is not in range of the length of the property array
"""
return _pyflamegpu.RunPlan_getPropertyUInt8(self, *args)
def getPropertyChar(self, *args):
r"""
*Overload 1:*
Gets the currently configured environment property value
:type name: string
:param name: name used for accessing the property
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
|
*Overload 2:*
Gets an element of the currently configured environment property array
:type name: string
:param name: name used for accessing the property
:type index: int
:param index: element from the environment property array to return
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is not in range of the length of the property array
"""
return _pyflamegpu.RunPlan_getPropertyChar(self, *args)
def getPropertyUChar(self, *args):
r"""
*Overload 1:*
Gets the currently configured environment property value
:type name: string
:param name: name used for accessing the property
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
|
*Overload 2:*
Gets an element of the currently configured environment property array
:type name: string
:param name: name used for accessing the property
:type index: int
:param index: element from the environment property array to return
:param T: Type of the value to be returned
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is not in range of the length of the property array
"""
return _pyflamegpu.RunPlan_getPropertyUChar(self, *args)
def getPropertyArrayFloat(self, name):
r"""
Gets the currently configured environment property array value
:type name: string
:param name: Environment property name
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
"""
return _pyflamegpu.RunPlan_getPropertyArrayFloat(self, name)
def getPropertyArrayDouble(self, name):
r"""
Gets the currently configured environment property array value
:type name: string
:param name: Environment property name
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
"""
return _pyflamegpu.RunPlan_getPropertyArrayDouble(self, name)
def getPropertyArrayInt16(self, name):
r"""
Gets the currently configured environment property array value
:type name: string
:param name: Environment property name
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
"""
return _pyflamegpu.RunPlan_getPropertyArrayInt16(self, name)
def getPropertyArrayInt32(self, name):
r"""
Gets the currently configured environment property array value
:type name: string
:param name: Environment property name
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
"""
return _pyflamegpu.RunPlan_getPropertyArrayInt32(self, name)
def getPropertyArrayInt64(self, name):
r"""
Gets the currently configured environment property array value
:type name: string
:param name: Environment property name
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
"""
return _pyflamegpu.RunPlan_getPropertyArrayInt64(self, name)
def getPropertyArrayUInt16(self, name):
r"""
Gets the currently configured environment property array value
:type name: string
:param name: Environment property name
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
"""
return _pyflamegpu.RunPlan_getPropertyArrayUInt16(self, name)
def getPropertyArrayUInt32(self, name):
r"""
Gets the currently configured environment property array value
:type name: string
:param name: Environment property name
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
"""
return _pyflamegpu.RunPlan_getPropertyArrayUInt32(self, name)
def getPropertyArrayUInt64(self, name):
r"""
Gets the currently configured environment property array value
:type name: string
:param name: Environment property name
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
"""
return _pyflamegpu.RunPlan_getPropertyArrayUInt64(self, name)
def getPropertyArrayInt(self, name):
r"""
Gets the currently configured environment property array value
:type name: string
:param name: Environment property name
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
"""
return _pyflamegpu.RunPlan_getPropertyArrayInt(self, name)
def getPropertyArrayUInt(self, name):
r"""
Gets the currently configured environment property array value
:type name: string
:param name: Environment property name
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
"""
return _pyflamegpu.RunPlan_getPropertyArrayUInt(self, name)
def getPropertyArrayInt8(self, name):
r"""
Gets the currently configured environment property array value
:type name: string
:param name: Environment property name
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
"""
return _pyflamegpu.RunPlan_getPropertyArrayInt8(self, name)
def getPropertyArrayUInt8(self, name):
r"""
Gets the currently configured environment property array value
:type name: string
:param name: Environment property name
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
"""
return _pyflamegpu.RunPlan_getPropertyArrayUInt8(self, name)
def getPropertyArrayChar(self, name):
r"""
Gets the currently configured environment property array value
:type name: string
:param name: Environment property name
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
"""
return _pyflamegpu.RunPlan_getPropertyArrayChar(self, name)
def getPropertyArrayUChar(self, name):
r"""
Gets the currently configured environment property array value
:type name: string
:param name: Environment property name
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
"""
return _pyflamegpu.RunPlan_getPropertyArrayUChar(self, name)
__swig_destroy__ = _pyflamegpu.delete_RunPlan
# Register RunPlan in _pyflamegpu:
_pyflamegpu.RunPlan_swigregister(RunPlan)
class RunPlanVec(object):
r"""
Vector of RunPlan
Contains additional methods for generating collections of RunPlans and combining RunPlanVecs
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self, model, initial_length):
r"""
Constructor, requires the model description to validate environment properties match up
TODO: Unsure if this will require additional info, e.g. steps?
"""
_pyflamegpu.RunPlanVec_swiginit(self, _pyflamegpu.new_RunPlanVec(model, initial_length))
def setRandomSimulationSeed(self, initial_seed, step=0):
r"""
Set the random simulation seed of each RunPlan currently within this vector
:type initial_seed: int
:param initial_seed: The random seed applied to the first item
:type step: int, optional
:param step: The value added to the previous seed to calculate the next seed
Notes: A step of 0, will give the exact same seed to all RunPlans
"""
return _pyflamegpu.RunPlanVec_setRandomSimulationSeed(self, initial_seed, step)
def setSteps(self, steps):
r"""
Set the steps of each RunPlan currently within this vector
:type steps: int
:param steps: The number of steps to be executed
Notes: If 0 is provided, the model must have an exit condition
"""
return _pyflamegpu.RunPlanVec_setSteps(self, steps)
def setOutputSubdirectory(self, subdir):
r"""
Set the the sub directory within the output directory for outputs of runplans in this vector
:type subdir: string
:param subdir: The name of the subdirectory
Notes: Defaults to empty string, where no subdirectory is used
"""
return _pyflamegpu.RunPlanVec_setOutputSubdirectory(self, subdir)
def setRandomPropertySeed(self, seed):
r"""
Seed the internal random generator used for random property distributions
This will only affect subsequent calls to setPropertyRandom()
:type seed: int
:param seed: The random seed to be used
"""
return _pyflamegpu.RunPlanVec_setRandomPropertySeed(self, seed)
def size(self):
r"""Expose inherited std::vector methods/classes"""
return _pyflamegpu.RunPlanVec_size(self)
def __add__(self, *args):
return _pyflamegpu.RunPlanVec___add__(self, *args)
def __iadd__(self, *args):
return _pyflamegpu.RunPlanVec___iadd__(self, *args)
def __imul__(self, rhs):
return _pyflamegpu.RunPlanVec___imul__(self, rhs)
def __mul__(self, rhs):
return _pyflamegpu.RunPlanVec___mul__(self, rhs)
def __iter__(self):
return FLAMEGPUIterator(self)
def __len__(self):
return self.size()
def insert(self, i, x):
if isinstance(i, int): # "insert" is used as if the vector is a Python list
self.insert(self, self.begin() + i, x)
else: # "insert" is used as if the vector is a native C++ container
return self.insert(self, i, x)
def __getitem__(self, index):
return _pyflamegpu.RunPlanVec___getitem__(self, index)
def __setitem__(self, index, value):
return _pyflamegpu.RunPlanVec___setitem__(self, index, value)
def setPropertyFloat(self, *args):
r"""
*Overload 1:*
Set named environment property to a specific value
:type name: string
:param name: The name of the environment property to set
:type value: float
:param value: The value of the environment property to set
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length > 1
|
*Overload 2:*
Array property element equivalent of setProperty()
:type name: string
:param name: The name of the environment property array to affect
:type index: int
:param index: The index of the environment property array to set
:type value: float
:param value: The value of the environment property array to set
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is not in range of the length of the property array
See also: setProperty(const std::string &name, const T &value)
"""
return _pyflamegpu.RunPlanVec_setPropertyFloat(self, *args)
def setPropertyDouble(self, *args):
r"""
*Overload 1:*
Set named environment property to a specific value
:type name: string
:param name: The name of the environment property to set
:type value: float
:param value: The value of the environment property to set
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length > 1
|
*Overload 2:*
Array property element equivalent of setProperty()
:type name: string
:param name: The name of the environment property array to affect
:type index: int
:param index: The index of the environment property array to set
:type value: float
:param value: The value of the environment property array to set
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is not in range of the length of the property array
See also: setProperty(const std::string &name, const T &value)
"""
return _pyflamegpu.RunPlanVec_setPropertyDouble(self, *args)
def setPropertyInt16(self, *args):
r"""
*Overload 1:*
Set named environment property to a specific value
:type name: string
:param name: The name of the environment property to set
:type value: int
:param value: The value of the environment property to set
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length > 1
|
*Overload 2:*
Array property element equivalent of setProperty()
:type name: string
:param name: The name of the environment property array to affect
:type index: int
:param index: The index of the environment property array to set
:type value: int
:param value: The value of the environment property array to set
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is not in range of the length of the property array
See also: setProperty(const std::string &name, const T &value)
"""
return _pyflamegpu.RunPlanVec_setPropertyInt16(self, *args)
def setPropertyInt32(self, *args):
r"""
*Overload 1:*
Set named environment property to a specific value
:type name: string
:param name: The name of the environment property to set
:type value: int
:param value: The value of the environment property to set
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length > 1
|
*Overload 2:*
Array property element equivalent of setProperty()
:type name: string
:param name: The name of the environment property array to affect
:type index: int
:param index: The index of the environment property array to set
:type value: int
:param value: The value of the environment property array to set
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is not in range of the length of the property array
See also: setProperty(const std::string &name, const T &value)
"""
return _pyflamegpu.RunPlanVec_setPropertyInt32(self, *args)
def setPropertyInt64(self, *args):
r"""
*Overload 1:*
Set named environment property to a specific value
:type name: string
:param name: The name of the environment property to set
:type value: int
:param value: The value of the environment property to set
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length > 1
|
*Overload 2:*
Array property element equivalent of setProperty()
:type name: string
:param name: The name of the environment property array to affect
:type index: int
:param index: The index of the environment property array to set
:type value: int
:param value: The value of the environment property array to set
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is not in range of the length of the property array
See also: setProperty(const std::string &name, const T &value)
"""
return _pyflamegpu.RunPlanVec_setPropertyInt64(self, *args)
def setPropertyUInt16(self, *args):
r"""
*Overload 1:*
Set named environment property to a specific value
:type name: string
:param name: The name of the environment property to set
:type value: int
:param value: The value of the environment property to set
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length > 1
|
*Overload 2:*
Array property element equivalent of setProperty()
:type name: string
:param name: The name of the environment property array to affect
:type index: int
:param index: The index of the environment property array to set
:type value: int
:param value: The value of the environment property array to set
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is not in range of the length of the property array
See also: setProperty(const std::string &name, const T &value)
"""
return _pyflamegpu.RunPlanVec_setPropertyUInt16(self, *args)
def setPropertyUInt32(self, *args):
r"""
*Overload 1:*
Set named environment property to a specific value
:type name: string
:param name: The name of the environment property to set
:type value: int
:param value: The value of the environment property to set
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length > 1
|
*Overload 2:*
Array property element equivalent of setProperty()
:type name: string
:param name: The name of the environment property array to affect
:type index: int
:param index: The index of the environment property array to set
:type value: int
:param value: The value of the environment property array to set
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is not in range of the length of the property array
See also: setProperty(const std::string &name, const T &value)
"""
return _pyflamegpu.RunPlanVec_setPropertyUInt32(self, *args)
def setPropertyUInt64(self, *args):
r"""
*Overload 1:*
Set named environment property to a specific value
:type name: string
:param name: The name of the environment property to set
:type value: int
:param value: The value of the environment property to set
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length > 1
|
*Overload 2:*
Array property element equivalent of setProperty()
:type name: string
:param name: The name of the environment property array to affect
:type index: int
:param index: The index of the environment property array to set
:type value: int
:param value: The value of the environment property array to set
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is not in range of the length of the property array
See also: setProperty(const std::string &name, const T &value)
"""
return _pyflamegpu.RunPlanVec_setPropertyUInt64(self, *args)
def setPropertyInt(self, *args):
r"""
*Overload 1:*
Set named environment property to a specific value
:type name: string
:param name: The name of the environment property to set
:type value: int
:param value: The value of the environment property to set
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length > 1
|
*Overload 2:*
Array property element equivalent of setProperty()
:type name: string
:param name: The name of the environment property array to affect
:type index: int
:param index: The index of the environment property array to set
:type value: int
:param value: The value of the environment property array to set
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is not in range of the length of the property array
See also: setProperty(const std::string &name, const T &value)
"""
return _pyflamegpu.RunPlanVec_setPropertyInt(self, *args)
def setPropertyUInt(self, *args):
r"""
*Overload 1:*
Set named environment property to a specific value
:type name: string
:param name: The name of the environment property to set
:type value: int
:param value: The value of the environment property to set
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length > 1
|
*Overload 2:*
Array property element equivalent of setProperty()
:type name: string
:param name: The name of the environment property array to affect
:type index: int
:param index: The index of the environment property array to set
:type value: int
:param value: The value of the environment property array to set
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is not in range of the length of the property array
See also: setProperty(const std::string &name, const T &value)
"""
return _pyflamegpu.RunPlanVec_setPropertyUInt(self, *args)
def setPropertyInt8(self, *args):
r"""
*Overload 1:*
Set named environment property to a specific value
:type name: string
:param name: The name of the environment property to set
:type value: signed char
:param value: The value of the environment property to set
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length > 1
|
*Overload 2:*
Array property element equivalent of setProperty()
:type name: string
:param name: The name of the environment property array to affect
:type index: int
:param index: The index of the environment property array to set
:type value: signed char
:param value: The value of the environment property array to set
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is not in range of the length of the property array
See also: setProperty(const std::string &name, const T &value)
"""
return _pyflamegpu.RunPlanVec_setPropertyInt8(self, *args)
def setPropertyUInt8(self, *args):
r"""
*Overload 1:*
Set named environment property to a specific value
:type name: string
:param name: The name of the environment property to set
:type value: unsigned char
:param value: The value of the environment property to set
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length > 1
|
*Overload 2:*
Array property element equivalent of setProperty()
:type name: string
:param name: The name of the environment property array to affect
:type index: int
:param index: The index of the environment property array to set
:type value: unsigned char
:param value: The value of the environment property array to set
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is not in range of the length of the property array
See also: setProperty(const std::string &name, const T &value)
"""
return _pyflamegpu.RunPlanVec_setPropertyUInt8(self, *args)
def setPropertyChar(self, *args):
r"""
*Overload 1:*
Set named environment property to a specific value
:type name: string
:param name: The name of the environment property to set
:type value: char
:param value: The value of the environment property to set
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length > 1
|
*Overload 2:*
Array property element equivalent of setProperty()
:type name: string
:param name: The name of the environment property array to affect
:type index: int
:param index: The index of the environment property array to set
:type value: char
:param value: The value of the environment property array to set
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is not in range of the length of the property array
See also: setProperty(const std::string &name, const T &value)
"""
return _pyflamegpu.RunPlanVec_setPropertyChar(self, *args)
def setPropertyUChar(self, *args):
r"""
*Overload 1:*
Set named environment property to a specific value
:type name: string
:param name: The name of the environment property to set
:type value: unsigned char
:param value: The value of the environment property to set
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length > 1
|
*Overload 2:*
Array property element equivalent of setProperty()
:type name: string
:param name: The name of the environment property array to affect
:type index: int
:param index: The index of the environment property array to set
:type value: unsigned char
:param value: The value of the environment property array to set
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is not in range of the length of the property array
See also: setProperty(const std::string &name, const T &value)
"""
return _pyflamegpu.RunPlanVec_setPropertyUChar(self, *args)
def setPropertyArrayFloat(self, name, length, value):
r"""
Set named environment property array to a specific value
This version should be used for array properties
:type name: string
:param name: Environment property name
:type length: int
:param length: Length of the environmental property array to be created
:type value: std::vector< float,std::allocator< float > >
:param value: Environment property value (override)
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvProperty If value.size() != length
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length to N
"""
return _pyflamegpu.RunPlanVec_setPropertyArrayFloat(self, name, length, value)
def setPropertyArrayDouble(self, name, length, value):
r"""
Set named environment property array to a specific value
This version should be used for array properties
:type name: string
:param name: Environment property name
:type length: int
:param length: Length of the environmental property array to be created
:type value: std::vector< double,std::allocator< double > >
:param value: Environment property value (override)
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvProperty If value.size() != length
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length to N
"""
return _pyflamegpu.RunPlanVec_setPropertyArrayDouble(self, name, length, value)
def setPropertyArrayInt16(self, name, length, value):
r"""
Set named environment property array to a specific value
This version should be used for array properties
:type name: string
:param name: Environment property name
:type length: int
:param length: Length of the environmental property array to be created
:type value: std::vector< short,std::allocator< short > >
:param value: Environment property value (override)
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvProperty If value.size() != length
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length to N
"""
return _pyflamegpu.RunPlanVec_setPropertyArrayInt16(self, name, length, value)
def setPropertyArrayInt32(self, name, length, value):
r"""
Set named environment property array to a specific value
This version should be used for array properties
:type name: string
:param name: Environment property name
:type length: int
:param length: Length of the environmental property array to be created
:type value: std::vector< int,std::allocator< int > >
:param value: Environment property value (override)
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvProperty If value.size() != length
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length to N
"""
return _pyflamegpu.RunPlanVec_setPropertyArrayInt32(self, name, length, value)
def setPropertyArrayInt64(self, name, length, value):
r"""
Set named environment property array to a specific value
This version should be used for array properties
:type name: string
:param name: Environment property name
:type length: int
:param length: Length of the environmental property array to be created
:type value: std::vector< long long,std::allocator< long long > >
:param value: Environment property value (override)
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvProperty If value.size() != length
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length to N
"""
return _pyflamegpu.RunPlanVec_setPropertyArrayInt64(self, name, length, value)
def setPropertyArrayUInt16(self, name, length, value):
r"""
Set named environment property array to a specific value
This version should be used for array properties
:type name: string
:param name: Environment property name
:type length: int
:param length: Length of the environmental property array to be created
:type value: std::vector< unsigned short,std::allocator< unsigned short > >
:param value: Environment property value (override)
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvProperty If value.size() != length
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length to N
"""
return _pyflamegpu.RunPlanVec_setPropertyArrayUInt16(self, name, length, value)
def setPropertyArrayUInt32(self, name, length, value):
r"""
Set named environment property array to a specific value
This version should be used for array properties
:type name: string
:param name: Environment property name
:type length: int
:param length: Length of the environmental property array to be created
:type value: std::vector< unsigned int,std::allocator< unsigned int > >
:param value: Environment property value (override)
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvProperty If value.size() != length
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length to N
"""
return _pyflamegpu.RunPlanVec_setPropertyArrayUInt32(self, name, length, value)
def setPropertyArrayUInt64(self, name, length, value):
r"""
Set named environment property array to a specific value
This version should be used for array properties
:type name: string
:param name: Environment property name
:type length: int
:param length: Length of the environmental property array to be created
:type value: std::vector< unsigned long long,std::allocator< unsigned long long > >
:param value: Environment property value (override)
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvProperty If value.size() != length
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length to N
"""
return _pyflamegpu.RunPlanVec_setPropertyArrayUInt64(self, name, length, value)
def setPropertyArrayInt(self, name, length, value):
r"""
Set named environment property array to a specific value
This version should be used for array properties
:type name: string
:param name: Environment property name
:type length: int
:param length: Length of the environmental property array to be created
:type value: std::vector< int,std::allocator< int > >
:param value: Environment property value (override)
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvProperty If value.size() != length
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length to N
"""
return _pyflamegpu.RunPlanVec_setPropertyArrayInt(self, name, length, value)
def setPropertyArrayUInt(self, name, length, value):
r"""
Set named environment property array to a specific value
This version should be used for array properties
:type name: string
:param name: Environment property name
:type length: int
:param length: Length of the environmental property array to be created
:type value: std::vector< unsigned int,std::allocator< unsigned int > >
:param value: Environment property value (override)
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvProperty If value.size() != length
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length to N
"""
return _pyflamegpu.RunPlanVec_setPropertyArrayUInt(self, name, length, value)
def setPropertyArrayInt8(self, name, length, value):
r"""
Set named environment property array to a specific value
This version should be used for array properties
:type name: string
:param name: Environment property name
:type length: int
:param length: Length of the environmental property array to be created
:type value: std::vector< signed char,std::allocator< signed char > >
:param value: Environment property value (override)
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvProperty If value.size() != length
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length to N
"""
return _pyflamegpu.RunPlanVec_setPropertyArrayInt8(self, name, length, value)
def setPropertyArrayUInt8(self, name, length, value):
r"""
Set named environment property array to a specific value
This version should be used for array properties
:type name: string
:param name: Environment property name
:type length: int
:param length: Length of the environmental property array to be created
:type value: std::vector< unsigned char,std::allocator< unsigned char > >
:param value: Environment property value (override)
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvProperty If value.size() != length
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length to N
"""
return _pyflamegpu.RunPlanVec_setPropertyArrayUInt8(self, name, length, value)
def setPropertyArrayChar(self, name, length, value):
r"""
Set named environment property array to a specific value
This version should be used for array properties
:type name: string
:param name: Environment property name
:type length: int
:param length: Length of the environmental property array to be created
:type value: std::vector< char,std::allocator< char > >
:param value: Environment property value (override)
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvProperty If value.size() != length
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length to N
"""
return _pyflamegpu.RunPlanVec_setPropertyArrayChar(self, name, length, value)
def setPropertyArrayUChar(self, name, length, value):
r"""
Set named environment property array to a specific value
This version should be used for array properties
:type name: string
:param name: Environment property name
:type length: int
:param length: Length of the environmental property array to be created
:type value: std::vector< unsigned char,std::allocator< unsigned char > >
:param value: Environment property value (override)
:param T: Type of the environment property
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvProperty If value.size() != length
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length to N
"""
return _pyflamegpu.RunPlanVec_setPropertyArrayUChar(self, name, length, value)
def setPropertyUniformDistributionFloat(self, *args):
r"""
*Overload 1:*
Sweep named environment property over an inclusive uniform distribution
value = min * (1.0 - a) + max * a, where a = index/(size()-1)
:type name: string
:param name: The name of the environment property to set
:type min: float
:param min: The value to set the first environment property
:type max: float
:param max: The value to set the last environment property
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length > 1
:raises: std::out_of_range If this vector has a length less than 2
|
*Overload 2:*
Array property element equivalent of setPropertyUniformDistribution()
Sweep element of named environment property array over an inclusive uniform distribution
value = min * (1.0 - a) + max * a, where a = index/(size()-1)
:type name: string
:param name: The name of the environment property to set
:type index: int
:param index: The index of the element within the environment property array to set
:type min: float
:param min: The value to set the first environment property array element
:type max: float
:param max: The value to set the last environment property array element
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is greater than or equal to the length of the environment property array
:raises: std::out_of_range If this vector has a length less than 2
See also: setPropertyUniformDistribution(const std::string &name, const T &min, const T &max)
"""
return _pyflamegpu.RunPlanVec_setPropertyUniformDistributionFloat(self, *args)
def setPropertyUniformDistributionDouble(self, *args):
r"""
*Overload 1:*
Sweep named environment property over an inclusive uniform distribution
value = min * (1.0 - a) + max * a, where a = index/(size()-1)
:type name: string
:param name: The name of the environment property to set
:type min: float
:param min: The value to set the first environment property
:type max: float
:param max: The value to set the last environment property
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length > 1
:raises: std::out_of_range If this vector has a length less than 2
|
*Overload 2:*
Array property element equivalent of setPropertyUniformDistribution()
Sweep element of named environment property array over an inclusive uniform distribution
value = min * (1.0 - a) + max * a, where a = index/(size()-1)
:type name: string
:param name: The name of the environment property to set
:type index: int
:param index: The index of the element within the environment property array to set
:type min: float
:param min: The value to set the first environment property array element
:type max: float
:param max: The value to set the last environment property array element
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is greater than or equal to the length of the environment property array
:raises: std::out_of_range If this vector has a length less than 2
See also: setPropertyUniformDistribution(const std::string &name, const T &min, const T &max)
"""
return _pyflamegpu.RunPlanVec_setPropertyUniformDistributionDouble(self, *args)
def setPropertyUniformDistributionInt16(self, *args):
r"""
*Overload 1:*
Sweep named environment property over an inclusive uniform distribution
value = min * (1.0 - a) + max * a, where a = index/(size()-1)
:type name: string
:param name: The name of the environment property to set
:type min: int
:param min: The value to set the first environment property
:type max: int
:param max: The value to set the last environment property
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length > 1
:raises: std::out_of_range If this vector has a length less than 2
|
*Overload 2:*
Array property element equivalent of setPropertyUniformDistribution()
Sweep element of named environment property array over an inclusive uniform distribution
value = min * (1.0 - a) + max * a, where a = index/(size()-1)
:type name: string
:param name: The name of the environment property to set
:type index: int
:param index: The index of the element within the environment property array to set
:type min: int
:param min: The value to set the first environment property array element
:type max: int
:param max: The value to set the last environment property array element
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is greater than or equal to the length of the environment property array
:raises: std::out_of_range If this vector has a length less than 2
See also: setPropertyUniformDistribution(const std::string &name, const T &min, const T &max)
"""
return _pyflamegpu.RunPlanVec_setPropertyUniformDistributionInt16(self, *args)
def setPropertyUniformDistributionInt32(self, *args):
r"""
*Overload 1:*
Sweep named environment property over an inclusive uniform distribution
value = min * (1.0 - a) + max * a, where a = index/(size()-1)
:type name: string
:param name: The name of the environment property to set
:type min: int
:param min: The value to set the first environment property
:type max: int
:param max: The value to set the last environment property
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length > 1
:raises: std::out_of_range If this vector has a length less than 2
|
*Overload 2:*
Array property element equivalent of setPropertyUniformDistribution()
Sweep element of named environment property array over an inclusive uniform distribution
value = min * (1.0 - a) + max * a, where a = index/(size()-1)
:type name: string
:param name: The name of the environment property to set
:type index: int
:param index: The index of the element within the environment property array to set
:type min: int
:param min: The value to set the first environment property array element
:type max: int
:param max: The value to set the last environment property array element
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is greater than or equal to the length of the environment property array
:raises: std::out_of_range If this vector has a length less than 2
See also: setPropertyUniformDistribution(const std::string &name, const T &min, const T &max)
"""
return _pyflamegpu.RunPlanVec_setPropertyUniformDistributionInt32(self, *args)
def setPropertyUniformDistributionInt64(self, *args):
r"""
*Overload 1:*
Sweep named environment property over an inclusive uniform distribution
value = min * (1.0 - a) + max * a, where a = index/(size()-1)
:type name: string
:param name: The name of the environment property to set
:type min: int
:param min: The value to set the first environment property
:type max: int
:param max: The value to set the last environment property
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length > 1
:raises: std::out_of_range If this vector has a length less than 2
|
*Overload 2:*
Array property element equivalent of setPropertyUniformDistribution()
Sweep element of named environment property array over an inclusive uniform distribution
value = min * (1.0 - a) + max * a, where a = index/(size()-1)
:type name: string
:param name: The name of the environment property to set
:type index: int
:param index: The index of the element within the environment property array to set
:type min: int
:param min: The value to set the first environment property array element
:type max: int
:param max: The value to set the last environment property array element
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is greater than or equal to the length of the environment property array
:raises: std::out_of_range If this vector has a length less than 2
See also: setPropertyUniformDistribution(const std::string &name, const T &min, const T &max)
"""
return _pyflamegpu.RunPlanVec_setPropertyUniformDistributionInt64(self, *args)
def setPropertyUniformDistributionUInt16(self, *args):
r"""
*Overload 1:*
Sweep named environment property over an inclusive uniform distribution
value = min * (1.0 - a) + max * a, where a = index/(size()-1)
:type name: string
:param name: The name of the environment property to set
:type min: int
:param min: The value to set the first environment property
:type max: int
:param max: The value to set the last environment property
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length > 1
:raises: std::out_of_range If this vector has a length less than 2
|
*Overload 2:*
Array property element equivalent of setPropertyUniformDistribution()
Sweep element of named environment property array over an inclusive uniform distribution
value = min * (1.0 - a) + max * a, where a = index/(size()-1)
:type name: string
:param name: The name of the environment property to set
:type index: int
:param index: The index of the element within the environment property array to set
:type min: int
:param min: The value to set the first environment property array element
:type max: int
:param max: The value to set the last environment property array element
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is greater than or equal to the length of the environment property array
:raises: std::out_of_range If this vector has a length less than 2
See also: setPropertyUniformDistribution(const std::string &name, const T &min, const T &max)
"""
return _pyflamegpu.RunPlanVec_setPropertyUniformDistributionUInt16(self, *args)
def setPropertyUniformDistributionUInt32(self, *args):
r"""
*Overload 1:*
Sweep named environment property over an inclusive uniform distribution
value = min * (1.0 - a) + max * a, where a = index/(size()-1)
:type name: string
:param name: The name of the environment property to set
:type min: int
:param min: The value to set the first environment property
:type max: int
:param max: The value to set the last environment property
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length > 1
:raises: std::out_of_range If this vector has a length less than 2
|
*Overload 2:*
Array property element equivalent of setPropertyUniformDistribution()
Sweep element of named environment property array over an inclusive uniform distribution
value = min * (1.0 - a) + max * a, where a = index/(size()-1)
:type name: string
:param name: The name of the environment property to set
:type index: int
:param index: The index of the element within the environment property array to set
:type min: int
:param min: The value to set the first environment property array element
:type max: int
:param max: The value to set the last environment property array element
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is greater than or equal to the length of the environment property array
:raises: std::out_of_range If this vector has a length less than 2
See also: setPropertyUniformDistribution(const std::string &name, const T &min, const T &max)
"""
return _pyflamegpu.RunPlanVec_setPropertyUniformDistributionUInt32(self, *args)
def setPropertyUniformDistributionUInt64(self, *args):
r"""
*Overload 1:*
Sweep named environment property over an inclusive uniform distribution
value = min * (1.0 - a) + max * a, where a = index/(size()-1)
:type name: string
:param name: The name of the environment property to set
:type min: int
:param min: The value to set the first environment property
:type max: int
:param max: The value to set the last environment property
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length > 1
:raises: std::out_of_range If this vector has a length less than 2
|
*Overload 2:*
Array property element equivalent of setPropertyUniformDistribution()
Sweep element of named environment property array over an inclusive uniform distribution
value = min * (1.0 - a) + max * a, where a = index/(size()-1)
:type name: string
:param name: The name of the environment property to set
:type index: int
:param index: The index of the element within the environment property array to set
:type min: int
:param min: The value to set the first environment property array element
:type max: int
:param max: The value to set the last environment property array element
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is greater than or equal to the length of the environment property array
:raises: std::out_of_range If this vector has a length less than 2
See also: setPropertyUniformDistribution(const std::string &name, const T &min, const T &max)
"""
return _pyflamegpu.RunPlanVec_setPropertyUniformDistributionUInt64(self, *args)
def setPropertyUniformDistributionInt(self, *args):
r"""
*Overload 1:*
Sweep named environment property over an inclusive uniform distribution
value = min * (1.0 - a) + max * a, where a = index/(size()-1)
:type name: string
:param name: The name of the environment property to set
:type min: int
:param min: The value to set the first environment property
:type max: int
:param max: The value to set the last environment property
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length > 1
:raises: std::out_of_range If this vector has a length less than 2
|
*Overload 2:*
Array property element equivalent of setPropertyUniformDistribution()
Sweep element of named environment property array over an inclusive uniform distribution
value = min * (1.0 - a) + max * a, where a = index/(size()-1)
:type name: string
:param name: The name of the environment property to set
:type index: int
:param index: The index of the element within the environment property array to set
:type min: int
:param min: The value to set the first environment property array element
:type max: int
:param max: The value to set the last environment property array element
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is greater than or equal to the length of the environment property array
:raises: std::out_of_range If this vector has a length less than 2
See also: setPropertyUniformDistribution(const std::string &name, const T &min, const T &max)
"""
return _pyflamegpu.RunPlanVec_setPropertyUniformDistributionInt(self, *args)
def setPropertyUniformDistributionUInt(self, *args):
r"""
*Overload 1:*
Sweep named environment property over an inclusive uniform distribution
value = min * (1.0 - a) + max * a, where a = index/(size()-1)
:type name: string
:param name: The name of the environment property to set
:type min: int
:param min: The value to set the first environment property
:type max: int
:param max: The value to set the last environment property
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length > 1
:raises: std::out_of_range If this vector has a length less than 2
|
*Overload 2:*
Array property element equivalent of setPropertyUniformDistribution()
Sweep element of named environment property array over an inclusive uniform distribution
value = min * (1.0 - a) + max * a, where a = index/(size()-1)
:type name: string
:param name: The name of the environment property to set
:type index: int
:param index: The index of the element within the environment property array to set
:type min: int
:param min: The value to set the first environment property array element
:type max: int
:param max: The value to set the last environment property array element
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is greater than or equal to the length of the environment property array
:raises: std::out_of_range If this vector has a length less than 2
See also: setPropertyUniformDistribution(const std::string &name, const T &min, const T &max)
"""
return _pyflamegpu.RunPlanVec_setPropertyUniformDistributionUInt(self, *args)
def setPropertyUniformDistributionInt8(self, *args):
r"""
*Overload 1:*
Sweep named environment property over an inclusive uniform distribution
value = min * (1.0 - a) + max * a, where a = index/(size()-1)
:type name: string
:param name: The name of the environment property to set
:type min: signed char
:param min: The value to set the first environment property
:type max: signed char
:param max: The value to set the last environment property
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length > 1
:raises: std::out_of_range If this vector has a length less than 2
|
*Overload 2:*
Array property element equivalent of setPropertyUniformDistribution()
Sweep element of named environment property array over an inclusive uniform distribution
value = min * (1.0 - a) + max * a, where a = index/(size()-1)
:type name: string
:param name: The name of the environment property to set
:type index: int
:param index: The index of the element within the environment property array to set
:type min: signed char
:param min: The value to set the first environment property array element
:type max: signed char
:param max: The value to set the last environment property array element
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is greater than or equal to the length of the environment property array
:raises: std::out_of_range If this vector has a length less than 2
See also: setPropertyUniformDistribution(const std::string &name, const T &min, const T &max)
"""
return _pyflamegpu.RunPlanVec_setPropertyUniformDistributionInt8(self, *args)
def setPropertyUniformDistributionUInt8(self, *args):
r"""
*Overload 1:*
Sweep named environment property over an inclusive uniform distribution
value = min * (1.0 - a) + max * a, where a = index/(size()-1)
:type name: string
:param name: The name of the environment property to set
:type min: unsigned char
:param min: The value to set the first environment property
:type max: unsigned char
:param max: The value to set the last environment property
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length > 1
:raises: std::out_of_range If this vector has a length less than 2
|
*Overload 2:*
Array property element equivalent of setPropertyUniformDistribution()
Sweep element of named environment property array over an inclusive uniform distribution
value = min * (1.0 - a) + max * a, where a = index/(size()-1)
:type name: string
:param name: The name of the environment property to set
:type index: int
:param index: The index of the element within the environment property array to set
:type min: unsigned char
:param min: The value to set the first environment property array element
:type max: unsigned char
:param max: The value to set the last environment property array element
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is greater than or equal to the length of the environment property array
:raises: std::out_of_range If this vector has a length less than 2
See also: setPropertyUniformDistribution(const std::string &name, const T &min, const T &max)
"""
return _pyflamegpu.RunPlanVec_setPropertyUniformDistributionUInt8(self, *args)
def setPropertyUniformDistributionChar(self, *args):
r"""
*Overload 1:*
Sweep named environment property over an inclusive uniform distribution
value = min * (1.0 - a) + max * a, where a = index/(size()-1)
:type name: string
:param name: The name of the environment property to set
:type min: char
:param min: The value to set the first environment property
:type max: char
:param max: The value to set the last environment property
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length > 1
:raises: std::out_of_range If this vector has a length less than 2
|
*Overload 2:*
Array property element equivalent of setPropertyUniformDistribution()
Sweep element of named environment property array over an inclusive uniform distribution
value = min * (1.0 - a) + max * a, where a = index/(size()-1)
:type name: string
:param name: The name of the environment property to set
:type index: int
:param index: The index of the element within the environment property array to set
:type min: char
:param min: The value to set the first environment property array element
:type max: char
:param max: The value to set the last environment property array element
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is greater than or equal to the length of the environment property array
:raises: std::out_of_range If this vector has a length less than 2
See also: setPropertyUniformDistribution(const std::string &name, const T &min, const T &max)
"""
return _pyflamegpu.RunPlanVec_setPropertyUniformDistributionChar(self, *args)
def setPropertyUniformDistributionUChar(self, *args):
r"""
*Overload 1:*
Sweep named environment property over an inclusive uniform distribution
value = min * (1.0 - a) + max * a, where a = index/(size()-1)
:type name: string
:param name: The name of the environment property to set
:type min: unsigned char
:param min: The value to set the first environment property
:type max: unsigned char
:param max: The value to set the last environment property
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length > 1
:raises: std::out_of_range If this vector has a length less than 2
|
*Overload 2:*
Array property element equivalent of setPropertyUniformDistribution()
Sweep element of named environment property array over an inclusive uniform distribution
value = min * (1.0 - a) + max * a, where a = index/(size()-1)
:type name: string
:param name: The name of the environment property to set
:type index: int
:param index: The index of the element within the environment property array to set
:type min: unsigned char
:param min: The value to set the first environment property array element
:type max: unsigned char
:param max: The value to set the last environment property array element
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is greater than or equal to the length of the environment property array
:raises: std::out_of_range If this vector has a length less than 2
See also: setPropertyUniformDistribution(const std::string &name, const T &min, const T &max)
"""
return _pyflamegpu.RunPlanVec_setPropertyUniformDistributionUChar(self, *args)
def setPropertyUniformRandomDistributionFloat(self, *args):
r"""
*Overload 1:*
Sweep named environment property over a uniform random distribution
Integer types have a range [min, max]
Floating point types have a range [min, max)
:type name: string
:param name: The name of the environment property to set
:type min: float
:param min: The value of the range to set the first environment property
:type max: float
:param max: The value of the range to set the last environment property
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length > 1
:raises: std::out_of_range If this vector has a length less than 2
|
*Overload 2:*
Array property element equivalent of setPropertyUniformRandom()
Sweep named environment property over a uniform random distribution
Integer types have a range [min, max]
Floating point types have a range [min, max)
:type name: string
:param name: The name of the environment property to set
:type min: float
:param min: The value of the range to set the first environment property
:type max: float
:param max: The value of the range to set the last environment property
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is greater than or equal to the length of the environment property array
:raises: std::out_of_range If this vector has a length less than 2
See also: setPropertyUniformRandom(const std::string &name, const T &min, const T &max)
"""
return _pyflamegpu.RunPlanVec_setPropertyUniformRandomDistributionFloat(self, *args)
def setPropertyUniformRandomDistributionDouble(self, *args):
r"""
*Overload 1:*
Sweep named environment property over a uniform random distribution
Integer types have a range [min, max]
Floating point types have a range [min, max)
:type name: string
:param name: The name of the environment property to set
:type min: float
:param min: The value of the range to set the first environment property
:type max: float
:param max: The value of the range to set the last environment property
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length > 1
:raises: std::out_of_range If this vector has a length less than 2
|
*Overload 2:*
Array property element equivalent of setPropertyUniformRandom()
Sweep named environment property over a uniform random distribution
Integer types have a range [min, max]
Floating point types have a range [min, max)
:type name: string
:param name: The name of the environment property to set
:type min: float
:param min: The value of the range to set the first environment property
:type max: float
:param max: The value of the range to set the last environment property
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is greater than or equal to the length of the environment property array
:raises: std::out_of_range If this vector has a length less than 2
See also: setPropertyUniformRandom(const std::string &name, const T &min, const T &max)
"""
return _pyflamegpu.RunPlanVec_setPropertyUniformRandomDistributionDouble(self, *args)
def setPropertyUniformRandomDistributionInt16(self, *args):
r"""
*Overload 1:*
Sweep named environment property over a uniform random distribution
Integer types have a range [min, max]
Floating point types have a range [min, max)
:type name: string
:param name: The name of the environment property to set
:type min: int
:param min: The value of the range to set the first environment property
:type max: int
:param max: The value of the range to set the last environment property
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length > 1
:raises: std::out_of_range If this vector has a length less than 2
|
*Overload 2:*
Array property element equivalent of setPropertyUniformRandom()
Sweep named environment property over a uniform random distribution
Integer types have a range [min, max]
Floating point types have a range [min, max)
:type name: string
:param name: The name of the environment property to set
:type min: int
:param min: The value of the range to set the first environment property
:type max: int
:param max: The value of the range to set the last environment property
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is greater than or equal to the length of the environment property array
:raises: std::out_of_range If this vector has a length less than 2
See also: setPropertyUniformRandom(const std::string &name, const T &min, const T &max)
"""
return _pyflamegpu.RunPlanVec_setPropertyUniformRandomDistributionInt16(self, *args)
def setPropertyUniformRandomDistributionInt32(self, *args):
r"""
*Overload 1:*
Sweep named environment property over a uniform random distribution
Integer types have a range [min, max]
Floating point types have a range [min, max)
:type name: string
:param name: The name of the environment property to set
:type min: int
:param min: The value of the range to set the first environment property
:type max: int
:param max: The value of the range to set the last environment property
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length > 1
:raises: std::out_of_range If this vector has a length less than 2
|
*Overload 2:*
Array property element equivalent of setPropertyUniformRandom()
Sweep named environment property over a uniform random distribution
Integer types have a range [min, max]
Floating point types have a range [min, max)
:type name: string
:param name: The name of the environment property to set
:type min: int
:param min: The value of the range to set the first environment property
:type max: int
:param max: The value of the range to set the last environment property
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is greater than or equal to the length of the environment property array
:raises: std::out_of_range If this vector has a length less than 2
See also: setPropertyUniformRandom(const std::string &name, const T &min, const T &max)
"""
return _pyflamegpu.RunPlanVec_setPropertyUniformRandomDistributionInt32(self, *args)
def setPropertyUniformRandomDistributionInt64(self, *args):
r"""
*Overload 1:*
Sweep named environment property over a uniform random distribution
Integer types have a range [min, max]
Floating point types have a range [min, max)
:type name: string
:param name: The name of the environment property to set
:type min: int
:param min: The value of the range to set the first environment property
:type max: int
:param max: The value of the range to set the last environment property
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length > 1
:raises: std::out_of_range If this vector has a length less than 2
|
*Overload 2:*
Array property element equivalent of setPropertyUniformRandom()
Sweep named environment property over a uniform random distribution
Integer types have a range [min, max]
Floating point types have a range [min, max)
:type name: string
:param name: The name of the environment property to set
:type min: int
:param min: The value of the range to set the first environment property
:type max: int
:param max: The value of the range to set the last environment property
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is greater than or equal to the length of the environment property array
:raises: std::out_of_range If this vector has a length less than 2
See also: setPropertyUniformRandom(const std::string &name, const T &min, const T &max)
"""
return _pyflamegpu.RunPlanVec_setPropertyUniformRandomDistributionInt64(self, *args)
def setPropertyUniformRandomDistributionUInt16(self, *args):
r"""
*Overload 1:*
Sweep named environment property over a uniform random distribution
Integer types have a range [min, max]
Floating point types have a range [min, max)
:type name: string
:param name: The name of the environment property to set
:type min: int
:param min: The value of the range to set the first environment property
:type max: int
:param max: The value of the range to set the last environment property
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length > 1
:raises: std::out_of_range If this vector has a length less than 2
|
*Overload 2:*
Array property element equivalent of setPropertyUniformRandom()
Sweep named environment property over a uniform random distribution
Integer types have a range [min, max]
Floating point types have a range [min, max)
:type name: string
:param name: The name of the environment property to set
:type min: int
:param min: The value of the range to set the first environment property
:type max: int
:param max: The value of the range to set the last environment property
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is greater than or equal to the length of the environment property array
:raises: std::out_of_range If this vector has a length less than 2
See also: setPropertyUniformRandom(const std::string &name, const T &min, const T &max)
"""
return _pyflamegpu.RunPlanVec_setPropertyUniformRandomDistributionUInt16(self, *args)
def setPropertyUniformRandomDistributionUInt32(self, *args):
r"""
*Overload 1:*
Sweep named environment property over a uniform random distribution
Integer types have a range [min, max]
Floating point types have a range [min, max)
:type name: string
:param name: The name of the environment property to set
:type min: int
:param min: The value of the range to set the first environment property
:type max: int
:param max: The value of the range to set the last environment property
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length > 1
:raises: std::out_of_range If this vector has a length less than 2
|
*Overload 2:*
Array property element equivalent of setPropertyUniformRandom()
Sweep named environment property over a uniform random distribution
Integer types have a range [min, max]
Floating point types have a range [min, max)
:type name: string
:param name: The name of the environment property to set
:type min: int
:param min: The value of the range to set the first environment property
:type max: int
:param max: The value of the range to set the last environment property
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is greater than or equal to the length of the environment property array
:raises: std::out_of_range If this vector has a length less than 2
See also: setPropertyUniformRandom(const std::string &name, const T &min, const T &max)
"""
return _pyflamegpu.RunPlanVec_setPropertyUniformRandomDistributionUInt32(self, *args)
def setPropertyUniformRandomDistributionUInt64(self, *args):
r"""
*Overload 1:*
Sweep named environment property over a uniform random distribution
Integer types have a range [min, max]
Floating point types have a range [min, max)
:type name: string
:param name: The name of the environment property to set
:type min: int
:param min: The value of the range to set the first environment property
:type max: int
:param max: The value of the range to set the last environment property
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length > 1
:raises: std::out_of_range If this vector has a length less than 2
|
*Overload 2:*
Array property element equivalent of setPropertyUniformRandom()
Sweep named environment property over a uniform random distribution
Integer types have a range [min, max]
Floating point types have a range [min, max)
:type name: string
:param name: The name of the environment property to set
:type min: int
:param min: The value of the range to set the first environment property
:type max: int
:param max: The value of the range to set the last environment property
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is greater than or equal to the length of the environment property array
:raises: std::out_of_range If this vector has a length less than 2
See also: setPropertyUniformRandom(const std::string &name, const T &min, const T &max)
"""
return _pyflamegpu.RunPlanVec_setPropertyUniformRandomDistributionUInt64(self, *args)
def setPropertyUniformRandomDistributionInt(self, *args):
r"""
*Overload 1:*
Sweep named environment property over a uniform random distribution
Integer types have a range [min, max]
Floating point types have a range [min, max)
:type name: string
:param name: The name of the environment property to set
:type min: int
:param min: The value of the range to set the first environment property
:type max: int
:param max: The value of the range to set the last environment property
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length > 1
:raises: std::out_of_range If this vector has a length less than 2
|
*Overload 2:*
Array property element equivalent of setPropertyUniformRandom()
Sweep named environment property over a uniform random distribution
Integer types have a range [min, max]
Floating point types have a range [min, max)
:type name: string
:param name: The name of the environment property to set
:type min: int
:param min: The value of the range to set the first environment property
:type max: int
:param max: The value of the range to set the last environment property
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is greater than or equal to the length of the environment property array
:raises: std::out_of_range If this vector has a length less than 2
See also: setPropertyUniformRandom(const std::string &name, const T &min, const T &max)
"""
return _pyflamegpu.RunPlanVec_setPropertyUniformRandomDistributionInt(self, *args)
def setPropertyUniformRandomDistributionUInt(self, *args):
r"""
*Overload 1:*
Sweep named environment property over a uniform random distribution
Integer types have a range [min, max]
Floating point types have a range [min, max)
:type name: string
:param name: The name of the environment property to set
:type min: int
:param min: The value of the range to set the first environment property
:type max: int
:param max: The value of the range to set the last environment property
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length > 1
:raises: std::out_of_range If this vector has a length less than 2
|
*Overload 2:*
Array property element equivalent of setPropertyUniformRandom()
Sweep named environment property over a uniform random distribution
Integer types have a range [min, max]
Floating point types have a range [min, max)
:type name: string
:param name: The name of the environment property to set
:type min: int
:param min: The value of the range to set the first environment property
:type max: int
:param max: The value of the range to set the last environment property
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is greater than or equal to the length of the environment property array
:raises: std::out_of_range If this vector has a length less than 2
See also: setPropertyUniformRandom(const std::string &name, const T &min, const T &max)
"""
return _pyflamegpu.RunPlanVec_setPropertyUniformRandomDistributionUInt(self, *args)
def setPropertyUniformRandomDistributionInt8(self, *args):
r"""
*Overload 1:*
Sweep named environment property over a uniform random distribution
Integer types have a range [min, max]
Floating point types have a range [min, max)
:type name: string
:param name: The name of the environment property to set
:type min: signed char
:param min: The value of the range to set the first environment property
:type max: signed char
:param max: The value of the range to set the last environment property
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length > 1
:raises: std::out_of_range If this vector has a length less than 2
|
*Overload 2:*
Array property element equivalent of setPropertyUniformRandom()
Sweep named environment property over a uniform random distribution
Integer types have a range [min, max]
Floating point types have a range [min, max)
:type name: string
:param name: The name of the environment property to set
:type min: signed char
:param min: The value of the range to set the first environment property
:type max: signed char
:param max: The value of the range to set the last environment property
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is greater than or equal to the length of the environment property array
:raises: std::out_of_range If this vector has a length less than 2
See also: setPropertyUniformRandom(const std::string &name, const T &min, const T &max)
"""
return _pyflamegpu.RunPlanVec_setPropertyUniformRandomDistributionInt8(self, *args)
def setPropertyUniformRandomDistributionUInt8(self, *args):
r"""
*Overload 1:*
Sweep named environment property over a uniform random distribution
Integer types have a range [min, max]
Floating point types have a range [min, max)
:type name: string
:param name: The name of the environment property to set
:type min: unsigned char
:param min: The value of the range to set the first environment property
:type max: unsigned char
:param max: The value of the range to set the last environment property
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length > 1
:raises: std::out_of_range If this vector has a length less than 2
|
*Overload 2:*
Array property element equivalent of setPropertyUniformRandom()
Sweep named environment property over a uniform random distribution
Integer types have a range [min, max]
Floating point types have a range [min, max)
:type name: string
:param name: The name of the environment property to set
:type min: unsigned char
:param min: The value of the range to set the first environment property
:type max: unsigned char
:param max: The value of the range to set the last environment property
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is greater than or equal to the length of the environment property array
:raises: std::out_of_range If this vector has a length less than 2
See also: setPropertyUniformRandom(const std::string &name, const T &min, const T &max)
"""
return _pyflamegpu.RunPlanVec_setPropertyUniformRandomDistributionUInt8(self, *args)
def setPropertyUniformRandomDistributionChar(self, *args):
r"""
*Overload 1:*
Sweep named environment property over a uniform random distribution
Integer types have a range [min, max]
Floating point types have a range [min, max)
:type name: string
:param name: The name of the environment property to set
:type min: char
:param min: The value of the range to set the first environment property
:type max: char
:param max: The value of the range to set the last environment property
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length > 1
:raises: std::out_of_range If this vector has a length less than 2
|
*Overload 2:*
Array property element equivalent of setPropertyUniformRandom()
Sweep named environment property over a uniform random distribution
Integer types have a range [min, max]
Floating point types have a range [min, max)
:type name: string
:param name: The name of the environment property to set
:type min: char
:param min: The value of the range to set the first environment property
:type max: char
:param max: The value of the range to set the last environment property
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is greater than or equal to the length of the environment property array
:raises: std::out_of_range If this vector has a length less than 2
See also: setPropertyUniformRandom(const std::string &name, const T &min, const T &max)
"""
return _pyflamegpu.RunPlanVec_setPropertyUniformRandomDistributionChar(self, *args)
def setPropertyUniformRandomDistributionUChar(self, *args):
r"""
*Overload 1:*
Sweep named environment property over a uniform random distribution
Integer types have a range [min, max]
Floating point types have a range [min, max)
:type name: string
:param name: The name of the environment property to set
:type min: unsigned char
:param min: The value of the range to set the first environment property
:type max: unsigned char
:param max: The value of the range to set the last environment property
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length > 1
:raises: std::out_of_range If this vector has a length less than 2
|
*Overload 2:*
Array property element equivalent of setPropertyUniformRandom()
Sweep named environment property over a uniform random distribution
Integer types have a range [min, max]
Floating point types have a range [min, max)
:type name: string
:param name: The name of the environment property to set
:type min: unsigned char
:param min: The value of the range to set the first environment property
:type max: unsigned char
:param max: The value of the range to set the last environment property
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is greater than or equal to the length of the environment property array
:raises: std::out_of_range If this vector has a length less than 2
See also: setPropertyUniformRandom(const std::string &name, const T &min, const T &max)
"""
return _pyflamegpu.RunPlanVec_setPropertyUniformRandomDistributionUChar(self, *args)
def setPropertyNormalRandomDistributionFloat(self, *args):
r"""
*Overload 1:*
Sweep named environment property over a normal random distribution
Only floating point types are supported
:type name: string
:param name: The name of the environment property to set
:type mean: float
:param mean: Mean of the distribution (its expected value). Which coincides with the location of its peak.
:type stddev: float
:param stddev: Standard deviation: The square root of variance, representing the dispersion of values from the distribution mean.
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length > 1
:raises: std::out_of_range If this vector has a length less than 2
|
*Overload 2:*
Array property element equivalent of setPropertyNormalRandom()
Sweep named environment property over a normal random distribution
Only floating point types are supported
:type name: string
:param name: The name of the environment property to set
:type mean: float
:param mean: Mean of the distribution (its expected value). Which coincides with the location of its peak.
:type stddev: float
:param stddev: Standard deviation: The square root of variance, representing the dispersion of values from the distribution mean.
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is greater than or equal to the length of the environment property array
:raises: std::out_of_range If this vector has a length less than 2
See also: setPropertyNormalRandom(const std::string &name, const T &mean, const T &stddev)
"""
return _pyflamegpu.RunPlanVec_setPropertyNormalRandomDistributionFloat(self, *args)
def setPropertyNormalRandomDistributionDouble(self, *args):
r"""
*Overload 1:*
Sweep named environment property over a normal random distribution
Only floating point types are supported
:type name: string
:param name: The name of the environment property to set
:type mean: float
:param mean: Mean of the distribution (its expected value). Which coincides with the location of its peak.
:type stddev: float
:param stddev: Standard deviation: The square root of variance, representing the dispersion of values from the distribution mean.
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length > 1
:raises: std::out_of_range If this vector has a length less than 2
|
*Overload 2:*
Array property element equivalent of setPropertyNormalRandom()
Sweep named environment property over a normal random distribution
Only floating point types are supported
:type name: string
:param name: The name of the environment property to set
:type mean: float
:param mean: Mean of the distribution (its expected value). Which coincides with the location of its peak.
:type stddev: float
:param stddev: Standard deviation: The square root of variance, representing the dispersion of values from the distribution mean.
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is greater than or equal to the length of the environment property array
:raises: std::out_of_range If this vector has a length less than 2
See also: setPropertyNormalRandom(const std::string &name, const T &mean, const T &stddev)
"""
return _pyflamegpu.RunPlanVec_setPropertyNormalRandomDistributionDouble(self, *args)
def setPropertyLogNormalRandomDistributionFloat(self, *args):
r"""
*Overload 1:*
Sweep named environment property over a log normal random distribution
Only floating point types are supported
:type name: string
:param name: The name of the environment property to set
:type mean: float
:param mean: Mean of the underlying normal distribution formed by the logarithm transformations of the possible values in this distribution.
:type stddev: float
:param stddev: Standard deviation of the underlying normal distribution formed by the logarithm transformations of the possible values in this distribution.
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length > 1
:raises: std::out_of_range If this vector has a length less than 2
|
*Overload 2:*
Array property element equivalent of setPropertyLogNormalRandom()
Sweep named environment property over a log normal random distribution
Only floating point types are supported
:type name: string
:param name: The name of the environment property to set
:type mean: float
:param mean: Mean of the underlying normal distribution formed by the logarithm transformations of the possible values in this distribution.
:type stddev: float
:param stddev: Standard deviation of the underlying normal distribution formed by the logarithm transformations of the possible values in this distribution.
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is greater than or equal to the length of the environment property array
:raises: std::out_of_range If this vector has a length less than 2
See also: setPropertyNormalRandom(const std::string &name, const T &mean, const T &stddev)
"""
return _pyflamegpu.RunPlanVec_setPropertyLogNormalRandomDistributionFloat(self, *args)
def setPropertyLogNormalRandomDistributionDouble(self, *args):
r"""
*Overload 1:*
Sweep named environment property over a log normal random distribution
Only floating point types are supported
:type name: string
:param name: The name of the environment property to set
:type mean: float
:param mean: Mean of the underlying normal distribution formed by the logarithm transformations of the possible values in this distribution.
:type stddev: float
:param stddev: Standard deviation of the underlying normal distribution formed by the logarithm transformations of the possible values in this distribution.
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T, or length > 1
:raises: std::out_of_range If this vector has a length less than 2
|
*Overload 2:*
Array property element equivalent of setPropertyLogNormalRandom()
Sweep named environment property over a log normal random distribution
Only floating point types are supported
:type name: string
:param name: The name of the environment property to set
:type mean: float
:param mean: Mean of the underlying normal distribution formed by the logarithm transformations of the possible values in this distribution.
:type stddev: float
:param stddev: Standard deviation of the underlying normal distribution formed by the logarithm transformations of the possible values in this distribution.
:param T: The type of the environment property, this must match the ModelDescription
:raises: InvalidEnvProperty If a property of the name does not exist
:raises: InvalidEnvPropertyType If a property with the name has a type different to T
:raises: std::out_of_range If index is greater than or equal to the length of the environment property array
:raises: std::out_of_range If this vector has a length less than 2
See also: setPropertyNormalRandom(const std::string &name, const T &mean, const T &stddev)
"""
return _pyflamegpu.RunPlanVec_setPropertyLogNormalRandomDistributionDouble(self, *args)
__swig_destroy__ = _pyflamegpu.delete_RunPlanVec
# Register RunPlanVec in _pyflamegpu:
_pyflamegpu.RunPlanVec_swigregister(RunPlanVec)
class CUDAEnsemble(object):
r"""
Manager for automatically executing multiple copies of a model simultaneously
This can be used to conveniently execute parameter sweeps and batch validation runs
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self, model, argc=0):
r"""
Initialise CUDA Ensemble
If provided, you can pass runtime arguments to this constructor, to automatically call initialise()
This is not required, you can call initialise() manually later, or not at all.
:type model: :py:class:`ModelDescription`
:param model: The model description to initialise the runner to execute
:type argc: int, optional
:param argc: Runtime argument count
:type argv: string, optional
:param argv: Runtime argument list ptr
"""
_pyflamegpu.CUDAEnsemble_swiginit(self, _pyflamegpu.new_CUDAEnsemble(model, argc))
__swig_destroy__ = _pyflamegpu.delete_CUDAEnsemble
def simulate(self, plan):
r"""
Execute the ensemble of simulations.
This call will block until all simulations have completed or MAX_ERRORS simulations exit with an error
:type plan: :py:class:`RunPlanVec`
:param plan: The plan of individual runs to execute during the ensemble
"""
return _pyflamegpu.CUDAEnsemble_simulate(self, plan)
def Config(self):
r"""
:rtype: :py:class:`EnsembleConfig`
:return: A mutable reference to the ensemble configuration struct
See also: CUDAEnsemble::applyConfig() Should be called afterwards to apply changes
"""
return _pyflamegpu.CUDAEnsemble_Config(self)
def getConfig(self):
r"""
:rtype: :py:class:`EnsembleConfig`
:return: An immutable reference to the ensemble configuration struct
"""
return _pyflamegpu.CUDAEnsemble_getConfig(self)
def initialise(self, argc):
return _pyflamegpu.CUDAEnsemble_initialise(self, argc)
def setStepLog(self, stepConfig):
r"""
Configure which step data should be logged
:type stepConfig: :py:class:`StepLoggingConfig`
:param stepConfig: The step logging config for the CUDAEnsemble
Notes: This must be for the same model description hierarchy as the CUDAEnsemble
"""
return _pyflamegpu.CUDAEnsemble_setStepLog(self, stepConfig)
def setExitLog(self, exitConfig):
r"""
Configure which exit data should be logged
:type exitConfig: :py:class:`LoggingConfig`
:param exitConfig: The logging config for the CUDAEnsemble
Notes: This must be for the same model description hierarchy as the CUDAEnsemble
"""
return _pyflamegpu.CUDAEnsemble_setExitLog(self, exitConfig)
def getEnsembleElapsedTime(self):
r"""Get the duration of the last call to simulate() in milliseconds."""
return _pyflamegpu.CUDAEnsemble_getEnsembleElapsedTime(self)
def getLogs(self):
r"""Return the list of logs collected from the last call to simulate()"""
return _pyflamegpu.CUDAEnsemble_getLogs(self)
# Register CUDAEnsemble in _pyflamegpu:
_pyflamegpu.CUDAEnsemble_swigregister(CUDAEnsemble)
class CUDAEnsembleConfig(object):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
out_directory = property(_pyflamegpu.CUDAEnsembleConfig_out_directory_get, _pyflamegpu.CUDAEnsembleConfig_out_directory_set)
out_format = property(_pyflamegpu.CUDAEnsembleConfig_out_format_get, _pyflamegpu.CUDAEnsembleConfig_out_format_set)
concurrent_runs = property(_pyflamegpu.CUDAEnsembleConfig_concurrent_runs_get, _pyflamegpu.CUDAEnsembleConfig_concurrent_runs_set)
devices = property(_pyflamegpu.CUDAEnsembleConfig_devices_get, _pyflamegpu.CUDAEnsembleConfig_devices_set)
silent = property(_pyflamegpu.CUDAEnsembleConfig_silent_get, _pyflamegpu.CUDAEnsembleConfig_silent_set)
timing = property(_pyflamegpu.CUDAEnsembleConfig_timing_get, _pyflamegpu.CUDAEnsembleConfig_timing_set)
def __init__(self):
_pyflamegpu.CUDAEnsembleConfig_swiginit(self, _pyflamegpu.new_CUDAEnsembleConfig())
__swig_destroy__ = _pyflamegpu.delete_CUDAEnsembleConfig
# Register CUDAEnsembleConfig in _pyflamegpu:
_pyflamegpu.CUDAEnsembleConfig_swigregister(CUDAEnsembleConfig)
class RunLogVec(object):
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def iterator(self):
return _pyflamegpu.RunLogVec_iterator(self)
def __iter__(self):
return self.iterator()
def __nonzero__(self):
return _pyflamegpu.RunLogVec___nonzero__(self)
def __bool__(self):
return _pyflamegpu.RunLogVec___bool__(self)
def __len__(self):
return _pyflamegpu.RunLogVec___len__(self)
def __getslice__(self, i, j):
return _pyflamegpu.RunLogVec___getslice__(self, i, j)
def __setslice__(self, *args):
return _pyflamegpu.RunLogVec___setslice__(self, *args)
def __delslice__(self, i, j):
return _pyflamegpu.RunLogVec___delslice__(self, i, j)
def __delitem__(self, *args):
return _pyflamegpu.RunLogVec___delitem__(self, *args)
def __getitem__(self, *args):
return _pyflamegpu.RunLogVec___getitem__(self, *args)
def __setitem__(self, *args):
return _pyflamegpu.RunLogVec___setitem__(self, *args)
def pop(self):
return _pyflamegpu.RunLogVec_pop(self)
def append(self, x):
return _pyflamegpu.RunLogVec_append(self, x)
def empty(self):
return _pyflamegpu.RunLogVec_empty(self)
def size(self):
return _pyflamegpu.RunLogVec_size(self)
def swap(self, v):
return _pyflamegpu.RunLogVec_swap(self, v)
def begin(self):
return _pyflamegpu.RunLogVec_begin(self)
def end(self):
return _pyflamegpu.RunLogVec_end(self)
def rbegin(self):
return _pyflamegpu.RunLogVec_rbegin(self)
def rend(self):
return _pyflamegpu.RunLogVec_rend(self)
def clear(self):
return _pyflamegpu.RunLogVec_clear(self)
def get_allocator(self):
return _pyflamegpu.RunLogVec_get_allocator(self)
def pop_back(self):
return _pyflamegpu.RunLogVec_pop_back(self)
def erase(self, *args):
return _pyflamegpu.RunLogVec_erase(self, *args)
def __init__(self, *args):
_pyflamegpu.RunLogVec_swiginit(self, _pyflamegpu.new_RunLogVec(*args))
def push_back(self, x):
return _pyflamegpu.RunLogVec_push_back(self, x)
def front(self):
return _pyflamegpu.RunLogVec_front(self)
def back(self):
return _pyflamegpu.RunLogVec_back(self)
def assign(self, n, x):
return _pyflamegpu.RunLogVec_assign(self, n, x)
def resize(self, *args):
return _pyflamegpu.RunLogVec_resize(self, *args)
def insert(self, *args):
return _pyflamegpu.RunLogVec_insert(self, *args)
def reserve(self, n):
return _pyflamegpu.RunLogVec_reserve(self, n)
def capacity(self):
return _pyflamegpu.RunLogVec_capacity(self)
__swig_destroy__ = _pyflamegpu.delete_RunLogVec
# Register RunLogVec in _pyflamegpu:
_pyflamegpu.RunLogVec_swigregister(RunLogVec)
class AgentStateVis(object):
r"""
This provides an interface for managing the render options for all agents within a specific state
Options default to values set within their parent
Even if the default is changed after the agent state is constructed
TODO: Block everything non-const from being called whilst VIS is active
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self, parent, state_name):
r"""
Creates a new AgentStateVis to configure visualisation options for a particular agent-state
:type parent: :py:class:`AgentVis`
:param parent: Visualisation options for the agent
:type state_name: string
:param state_name: State of the agent for which this options should represent
"""
_pyflamegpu.AgentStateVis_swiginit(self, _pyflamegpu.new_AgentStateVis(parent, state_name))
def setModel(self, *args):
r"""
*Overload 1:*
Use a model from file
:type modelPath: string
:param modelPath: File path of model
:type texturePath: string, optional
:param texturePath: Optional path to a texture for the model
Notes: Model must be .obj format
|
*Overload 2:*
Use a stock model
:type model: :py:class:`Model`
:param model: Model from internal resources
See also: Stock::Models::Model
"""
return _pyflamegpu.AgentStateVis_setModel(self, *args)
def setModelScale(self, *args):
r"""
*Overload 1:*
Scale each dimension of the model to the corresponding world scales
:type xLen: float
:param xLen: World scale of the model's on the x axis
:type yLen: float
:param yLen: World scale of the model's on the y axis
:type zLen: float
:param zLen: World scale of the model's on the z axis
Notes: Y is considered the vertical axis
|
*Overload 2:*
Uniformly scale model so that max dimension equals this
:type maxLen: float
:param maxLen: World scale of the model's relative to the axis which it is
largest
"""
return _pyflamegpu.AgentStateVis_setModelScale(self, *args)
def clearColor(self):
r"""Disable custom color, e.g. if you're using a textured model"""
return _pyflamegpu.AgentStateVis_clearColor(self)
def setColor(self, *args):
return _pyflamegpu.AgentStateVis_setColor(self, *args)
__swig_destroy__ = _pyflamegpu.delete_AgentStateVis
# Register AgentStateVis in _pyflamegpu:
_pyflamegpu.AgentStateVis_swigregister(AgentStateVis)
class AgentVis(object):
r"""
This provides an interface for managing the render options for all agents of a specific type
State() can be called to specialise options for agents within a specific state
TODO: Block everything non-const from being called whilst VIS is active
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self, agent, autopalette=0):
r"""
:type agent: CUDAAgent
:param agent: The CUDAAgent this class is configuring the visualisation for
:type autopalette: std::shared_ptr< AutoPalette >, optional
:param autopalette: Automatic source of colors for individual agent states
Notes: Agent states only receive colors from the autopalette when AgentVis::State() is called for each state
By default, all states share the same color from the autopalette
"""
_pyflamegpu.AgentVis_swiginit(self, _pyflamegpu.new_AgentVis(agent, autopalette))
def State(self, state_name):
r"""
Returns the configuration handler for the named state
On first use for each state this will assign the state a color from the AutoPalette if available
Clear the autopalette first if you wish for it to use the default color
"""
return _pyflamegpu.AgentVis_State(self, state_name)
def setXVariable(self, var_name):
r"""
Set the name of the variable representing the agents x/y/z location coordinates
:type var_name: string
:param var_name: Name of the agent variable
Notes: unnecessary if the variables are named "x", "y", "z" respectively
"""
return _pyflamegpu.AgentVis_setXVariable(self, var_name)
def setYVariable(self, var_name):
return _pyflamegpu.AgentVis_setYVariable(self, var_name)
def setZVariable(self, var_name):
return _pyflamegpu.AgentVis_setZVariable(self, var_name)
def setForwardXVariable(self, var_name):
r"""
Set the name of the variable representing the agents x/y/z direction vector components
Single axis rotation only requires x/z components
Double axis rotation requires all 3 components
Triple axis rotation requires all 3 components and additionally all 3 Up components
:type var_name: string
:param var_name: Name of the agent variable
Notes: setForwardXVariable() and setForwardZVariable() are an alternate to providing a yaw angle, setting either of these will erase yaw if bound
See also: setYawVariable(const std::string&)
setForwardYVariable() is an alternate to providing a pitch angle, setting this will erase pitch if bound
See also: setPitchVariable(const std::string&)
Forward is a synonym for Direction
"""
return _pyflamegpu.AgentVis_setForwardXVariable(self, var_name)
def setForwardYVariable(self, var_name):
return _pyflamegpu.AgentVis_setForwardYVariable(self, var_name)
def setForwardZVariable(self, var_name):
return _pyflamegpu.AgentVis_setForwardZVariable(self, var_name)
def setUpXVariable(self, var_name):
r"""
Set the name of the variable representing the agents x/y/z UP vector
This should be 90 degrees perpendicular to the direction vector
:type var_name: string
:param var_name: Name of the agent variable
Notes: setUpXVariable(), setUpYVariable() and setUpZVariable() are an alternate to providing a roll angle, setting any of these will erase roll if bound
See also: setRollVariable(const std::string&)
"""
return _pyflamegpu.AgentVis_setUpXVariable(self, var_name)
def setUpYVariable(self, var_name):
return _pyflamegpu.AgentVis_setUpYVariable(self, var_name)
def setUpZVariable(self, var_name):
return _pyflamegpu.AgentVis_setUpZVariable(self, var_name)
def setYawVariable(self, var_name):
r"""
Set the name of the variable representing the agents yaw rotation angle (radians)
:type var_name: string
:param var_name: Name of the agent variable
Notes: This is an alternate to providing a direction vector, setting this will erase forward x/z if bound
See also: setForwardXVariable(const std::string&)
See also: setForwardZVariable(const std::string&)
Heading is a synonym for Yaw
"""
return _pyflamegpu.AgentVis_setYawVariable(self, var_name)
def setPitchVariable(self, var_name):
r"""
Set the name of the variable representing the agents pitch rotation angle (radians)
:type var_name: string
:param var_name: Name of the agent variable
Notes: This is an alternate to providing a direction vector, setting this will erase forward y if bound
See also: setForwardYVariable(const std::string&)
"""
return _pyflamegpu.AgentVis_setPitchVariable(self, var_name)
def setRollVariable(self, var_name):
r"""
Set the name of the variable representing the agents yaw rotation angle (radians)
:type var_name: string
:param var_name: Name of the agent variable
Notes: This is an alternate to providing an UP vector, setting this will erase up x/y/z if bound
See also: setUpXVariable(const std::string&)
See also: setUpYVariable(const std::string&)
See also: setUpZVariable(const std::string&)
Bank is a synonym for Roll
"""
return _pyflamegpu.AgentVis_setRollVariable(self, var_name)
def setUniformScaleVariable(self, var_name):
r"""
Set the name of the variable representing the agents uniform scale multiplier
The scale multiplier is multiplied by the model scale
:type var_name: string
:param var_name: Name of the agent variable
Notes: This is an alternate to providing individual scale components, setting this will erase scale x/y/z if bound
See also: setScaleXVariable(const std::string&)
See also: setScaleYVariable(const std::string&)
See also: setScaleZVariable(const std::string&)
See also: setModelScale(float)
See also: setModelScale(float, float, float)
"""
return _pyflamegpu.AgentVis_setUniformScaleVariable(self, var_name)
def setScaleXVariable(self, var_name):
r"""
Set the name of the variable representing the agents x/y/z scale multiplier components
It is not necessary to set all 3 components if only 1 or 2 are required. Unset values will be treated as a 1.0 multiplier
The scale multiplier is multiplied by the model scale
:type var_name: string
:param var_name: Name of the agent variable
Notes: This is an alternate to providing a single uniform scale multiplier, setting this will erase uniform scale if bound
See also: setUniformScaleVariable(const std::string&)
See also: setModelScale(float)
See also: setModelScale(float, float, float)
"""
return _pyflamegpu.AgentVis_setScaleXVariable(self, var_name)
def setScaleYVariable(self, var_name):
return _pyflamegpu.AgentVis_setScaleYVariable(self, var_name)
def setScaleZVariable(self, var_name):
return _pyflamegpu.AgentVis_setScaleZVariable(self, var_name)
def clearXVariable(self):
r"""
Clears the agent's x/y/z location variable bindings
See also: setXVariable(conCst std::string &)
See also: setYVariable(conCst std::string &)
See also: setZVariable(conCst std::string &)
"""
return _pyflamegpu.AgentVis_clearXVariable(self)
def clearYVariable(self):
return _pyflamegpu.AgentVis_clearYVariable(self)
def clearZVariable(self):
return _pyflamegpu.AgentVis_clearZVariable(self)
def clearForwardXVariable(self):
r"""
Clears the agent's x/y/z forward variable bindings
See also: setForwardXVariable(const std::string &)
See also: setForwardYVariable(const std::string &)
See also: setForwardZVariable(const std::string &)
"""
return _pyflamegpu.AgentVis_clearForwardXVariable(self)
def clearForwardYVariable(self):
return _pyflamegpu.AgentVis_clearForwardYVariable(self)
def clearForwardZVariable(self):
return _pyflamegpu.AgentVis_clearForwardZVariable(self)
def clearUpXVariable(self):
r"""
Clears the agent's x/y/z UP variable bindings
See also: setUpXVariable(const std::string &)
See also: setUpYVariable(const std::string &)
See also: setUpZVariable(const std::string &)
"""
return _pyflamegpu.AgentVis_clearUpXVariable(self)
def clearUpYVariable(self):
return _pyflamegpu.AgentVis_clearUpYVariable(self)
def clearUpZVariable(self):
return _pyflamegpu.AgentVis_clearUpZVariable(self)
def clearYawVariable(self):
r"""
Clears the agent's yaw angle variable bindings
See also: setYawVariable(const std::string &)
"""
return _pyflamegpu.AgentVis_clearYawVariable(self)
def clearPitchVariable(self):
r"""
Clears the agent's pitch angle variable bindings
See also: setPitchVariable(const std::string &)
"""
return _pyflamegpu.AgentVis_clearPitchVariable(self)
def clearRollVariable(self):
r"""
Clears the agent's roll angle variable bindings
See also: setRollVariable(const std::string &)
"""
return _pyflamegpu.AgentVis_clearRollVariable(self)
def clearUniformScaleVariable(self):
r"""
Clears the agent's uniform scale multiplier variable bindings
See also: setUniformScaleVariable(const std::string &)
"""
return _pyflamegpu.AgentVis_clearUniformScaleVariable(self)
def clearScaleXVariable(self):
r"""
Clears the agent's x/y/z scale multiplier variable bindings
See also: setScaleXVariable(const std::string &)
See also: setScaleYVariable(const std::string &)
See also: setScaleZVariable(const std::string &)
"""
return _pyflamegpu.AgentVis_clearScaleXVariable(self)
def clearScaleYVariable(self):
return _pyflamegpu.AgentVis_clearScaleYVariable(self)
def clearScaleZVariable(self):
return _pyflamegpu.AgentVis_clearScaleZVariable(self)
def getXVariable(self):
r"""Returns the variable used for the agent's x/y/z location coordinates"""
return _pyflamegpu.AgentVis_getXVariable(self)
def getYVariable(self):
return _pyflamegpu.AgentVis_getYVariable(self)
def getZVariable(self):
return _pyflamegpu.AgentVis_getZVariable(self)
def getForwardXVariable(self):
r"""Returns the variable used for the agent's x/y/z forward vector components"""
return _pyflamegpu.AgentVis_getForwardXVariable(self)
def getForwardYVariable(self):
return _pyflamegpu.AgentVis_getForwardYVariable(self)
def getForwardZVariable(self):
return _pyflamegpu.AgentVis_getForwardZVariable(self)
def getUpXVariable(self):
r"""Returns the variable used for the agent's x/y/z up vector components"""
return _pyflamegpu.AgentVis_getUpXVariable(self)
def getUpYVariable(self):
return _pyflamegpu.AgentVis_getUpYVariable(self)
def getUpZVariable(self):
return _pyflamegpu.AgentVis_getUpZVariable(self)
def getYawVariable(self):
r"""Returns the variable used for the agent's yaw angle"""
return _pyflamegpu.AgentVis_getYawVariable(self)
def getPitchVariable(self):
r"""Returns the variable used for the agent's pitch angle"""
return _pyflamegpu.AgentVis_getPitchVariable(self)
def getRollVariable(self):
r"""Returns the variable used for the agent's roll angle"""
return _pyflamegpu.AgentVis_getRollVariable(self)
def getUniformScaleVariable(self):
r"""Returns the variable used for the agent's uniform scaling multiplier"""
return _pyflamegpu.AgentVis_getUniformScaleVariable(self)
def getScaleXVariable(self):
r"""Returns the variable used for the agent's x/y/z scale multiplier components"""
return _pyflamegpu.AgentVis_getScaleXVariable(self)
def getScaleYVariable(self):
return _pyflamegpu.AgentVis_getScaleYVariable(self)
def getScaleZVariable(self):
return _pyflamegpu.AgentVis_getScaleZVariable(self)
def setModel(self, *args):
r"""
*Overload 1:*
Use a model from file
:type modelPath: string
:param modelPath: The path to the model's file (must be .obj)
:type texturePath: string, optional
:param texturePath: Optional path to the texture used by the model
|
*Overload 2:*
Use a stock model
:type model: :py:class:`Model`
:param model: Model from the libraries internal resources
"""
return _pyflamegpu.AgentVis_setModel(self, *args)
def setModelScale(self, *args):
r"""
*Overload 1:*
Scale each dimension of the model to the corresponding world scales
:type xLen: float
:param xLen: World scale of the model's on the x axis
:type yLen: float
:param yLen: World scale of the model's on the y axis
:type zLen: float
:param zLen: World scale of the model's on the z axis
Notes: Y is considered the vertical axis
|
*Overload 2:*
Uniformly scale model so that max dimension equals this
:type maxLen: float
:param maxLen: World scale of the model's relative to the axis which it is largest
"""
return _pyflamegpu.AgentVis_setModelScale(self, *args)
def setAutoPalette(self, ap):
r"""
Set the auto-palette used to assign agent-state's colors
Notes: The color is assigned the first time State() is called, otherwise agents use the default color
"""
return _pyflamegpu.AgentVis_setAutoPalette(self, ap)
def clearColor(self):
r"""Disable custom color and/or auto-palette, e.g. if you're using a textured model"""
return _pyflamegpu.AgentVis_clearColor(self)
def setColor(self, *args):
return _pyflamegpu.AgentVis_setColor(self, *args)
__swig_destroy__ = _pyflamegpu.delete_AgentVis
# Register AgentVis in _pyflamegpu:
_pyflamegpu.AgentVis_swigregister(AgentVis)
class LineVis(object):
r"""Interface for managing a LineConfig"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self, l, r, g, b, a):
r"""
Create a new interface for managing a LineConfig
:type l: std::shared_ptr< LineConfig >
:param l: The line config being constructed
:type r: float
:param r: Initial color's red component
:type g: float
:param g: Initial color's green component
:type b: float
:param b: Initial color's blue component
:type a: float
:param a: Initial color's alpha component
"""
_pyflamegpu.LineVis_swiginit(self, _pyflamegpu.new_LineVis(l, r, g, b, a))
def setColor(self, r, g, b, a=1.0):
r"""
Update the color for following vertices
:type r: float
:param r: Color's red component
:type g: float
:param g: Color's green component
:type b: float
:param b: Color's blue component
:type a: float, optional
:param a: Color's alpha component
"""
return _pyflamegpu.LineVis_setColor(self, r, g, b, a)
def addVertex(self, x, y, z=0.0):
r"""
Adds a new vertex to the drawing
:type x: float
:param x: Vertex's x coord
:type y: float
:param y: Vertex's y coord
:type z: float, optional
:param z: Vertex's z coord
Notes: Y is considered the vertical axis
"""
return _pyflamegpu.LineVis_addVertex(self, x, y, z)
__swig_destroy__ = _pyflamegpu.delete_LineVis
# Register LineVis in _pyflamegpu:
_pyflamegpu.LineVis_swigregister(LineVis)
class ModelVis(object):
r"""This provides an interface for managing the render options for a specific CUDASimulation"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self, model):
r"""
This class is constructed by/with a CUDASimulation
Constructor will be clarified later, once requirements are clearer
Requires:
> texturise agent variable pointers
> On resize, also update textures
"""
_pyflamegpu.ModelVis_swiginit(self, _pyflamegpu.new_ModelVis(model))
__swig_destroy__ = _pyflamegpu.delete_ModelVis
def setAutoPalette(self, palette):
r"""
Sets the palette to automatically give color to agent added to the model
This can be overriden at an agent level or disabled
Similarly, individual agent-states can have their colour overriden
"""
return _pyflamegpu.ModelVis_setAutoPalette(self, palette)
def clearAutoPalette(self):
r"""
Disables the auto-palette, subsequently created AgentVis/AgentStateVis will not take colors from it
Notes: AgentVis/AgentStateVis which have already sampled a color will not lose their existing color
"""
return _pyflamegpu.ModelVis_clearAutoPalette(self)
def addAgent(self, agent_name):
r"""
Enables visualisation of the named agent and returns the configuration handler
See also: Agent(const std::string&)
TODO: Block this from being called whilst visualiser is allocated
"""
return _pyflamegpu.ModelVis_addAgent(self, agent_name)
def Agent(self, agent_name):
r"""
Returns the configuration handler if the agent has been marked for visualisation
See also: addAgent(const std::string&)
"""
return _pyflamegpu.ModelVis_Agent(self, agent_name)
def setWindowTitle(self, title):
r"""
Set the title for the visualisation window
This value defaults to the model's name
:type title: string
:param title: The title for the viusalisation window
"""
return _pyflamegpu.ModelVis_setWindowTitle(self, title)
def setWindowDimensions(self, width, height):
r"""
Set the dimensions of the visualisation window
This value defaults to 1280x720 (720p)
:type width: int
:param width: Window width
:type height: int
:param height: Window height
"""
return _pyflamegpu.ModelVis_setWindowDimensions(self, width, height)
def setClearColor(self, red, green, blue):
r"""
Set the clear color (the background color) of the visualisation
This value defaults to black (0,0,0)
:type red: float
:param red: Red color value 0.0f-1.0f
:type green: float
:param green: Green color value 0.0f-1.0f
:type blue: float
:param blue: Blue color value 0.0f-1.0f
"""
return _pyflamegpu.ModelVis_setClearColor(self, red, green, blue)
def setFPSVisible(self, showFPS):
r"""
Sets the FPS overlay as visible or not
This value defaults to true
:type showFPS: boolean
:param showFPS: True if the FPS should be shown
Notes: The visualisation executes in an independent thread to the simulation,
so the FPS does not correspond to the speed of the simulation's execution
See also: setFPSColor(const float &, const float &, const float &)
"""
return _pyflamegpu.ModelVis_setFPSVisible(self, showFPS)
def setFPSColor(self, red, green, blue):
r"""
Sets the color of the FPS overlay's text
This value defaults to white (1,1,1)
This may be useful if you have changed the clear color
:type red: float
:param red: Red color value 0.0f-1.0f
:type green: float
:param green: Green color value 0.0f-1.0f
:type blue: float
:param blue: Blue color value 0.0f-1.0f
"""
return _pyflamegpu.ModelVis_setFPSColor(self, red, green, blue)
def setInitialCameraLocation(self, x, y, z):
r"""
The location at which the camera of the visualisation 'camera' begins
This value defaults to (1.5, 1.5, 1.5)
:type x: float
:param x: The x coordinate
:type y: float
:param y: The y coordinate
:type z: float
:param z: The z coordinate
"""
return _pyflamegpu.ModelVis_setInitialCameraLocation(self, x, y, z)
def setInitialCameraTarget(self, x, y, z):
r"""
The location at which the camera of the visualisation initially looks towards
This is used with the camera location to derive the direction
This value defaults to (0,0,0)
:type x: float
:param x: The x coordinate
:type y: float
:param y: The y coordinate
:type z: float
:param z: The z coordinate
"""
return _pyflamegpu.ModelVis_setInitialCameraTarget(self, x, y, z)
def setCameraSpeed(self, speed, shiftMultiplier=5.0):
r"""
The speed of camera movement, in units travelled per millisecond
This value defaults to (0.05, 5.0)
:type speed: float
:param speed: The camera speed
:type shiftMultiplier: float, optional
:param shiftMultiplier: The multiplier applied to the speed when shift is pressed
"""
return _pyflamegpu.ModelVis_setCameraSpeed(self, speed, shiftMultiplier)
def setViewClips(self, nearClip, farClip):
r"""
Sets the near and far clipping planes of the view frustum
This value defaults to (0.05 5000.0)
Notes: This is for advanced configuration of the visualisation and the default values likely suffice
"""
return _pyflamegpu.ModelVis_setViewClips(self, nearClip, farClip)
def setStepVisible(self, showStep):
r"""
Sets the Step count overlay as visible or not
This value defaults to true
:type showStep: boolean
:param showStep: True if the count should be shown
Notes: This uses the FPSColor
See also: setFPSColor(const float &, const float &, const float &)
"""
return _pyflamegpu.ModelVis_setStepVisible(self, showStep)
def setSimulationSpeed(self, stepsPerSecond):
r"""
Sets a limit on the rate of simulation
A value of 0 leaves the rate unlimited
This value defaults to 0
:type stepsPerSecond: int
:param stepsPerSecond: The number of simulation steps to execute per second
"""
return _pyflamegpu.ModelVis_setSimulationSpeed(self, stepsPerSecond)
def setBeginPaused(self, beginPaused):
r"""
Sets whether the simulation should begin in a paused state or not
This value defaults to false
The simulation can be resumed (or re-paused) by pressing 'p'
:type beginPaused: boolean
:param beginPaused: True if the simulation should begin paused
"""
return _pyflamegpu.ModelVis_setBeginPaused(self, beginPaused)
def addStaticModel(self, *args):
r"""
Adds a static model to the visualisation
:type modelPath: string
:param modelPath: Path of the model on disk
:type texturePath: string, optional
:param texturePath: Optional path to a texture fore the model on disk
"""
return _pyflamegpu.ModelVis_addStaticModel(self, *args)
def newLineSketch(self, r, g, b, a=1.0):
r"""
Create a new sketch constructed from individual line segments to the visualisation
:type r: float
:param r: Initial color's red component
:type g: float
:param g: Initial color's green component
:type b: float
:param b: Initial color's blue component
:type a: float, optional
:param a: Initial color's alpha component
"""
return _pyflamegpu.ModelVis_newLineSketch(self, r, g, b, a)
def newPolylineSketch(self, r, g, b, a=1.0):
r"""
Create a new sketch constructed from a single line of connected vertices to the visualisation
:type r: float
:param r: Initial color's red component
:type g: float
:param g: Initial color's green component
:type b: float
:param b: Initial color's blue component
:type a: float, optional
:param a: Initial color's alpha component
"""
return _pyflamegpu.ModelVis_newPolylineSketch(self, r, g, b, a)
def activate(self):
r"""Sets the visualisation running in a background thread"""
return _pyflamegpu.ModelVis_activate(self)
def deactivate(self):
r"""
Kills the background thread
Does nothing visualisation is not running
"""
return _pyflamegpu.ModelVis_deactivate(self)
def join(self):
r"""
Blocks the main thread until the background visualisation thread has returned
Does nothing visualisation is not running
Notes: It is expected that you will close the visualiser window with the cross in the corner if join is called
"""
return _pyflamegpu.ModelVis_join(self)
def isRunning(self):
r"""Returns whether the background thread is active or not"""
return _pyflamegpu.ModelVis_isRunning(self)
def updateBuffers(self, *args):
r"""
Updates all agent renders from corresponding
:type sc: int, optional
:param sc: Step count, the step count value shown in visualisation HUD
"""
return _pyflamegpu.ModelVis_updateBuffers(self, *args)
# Register ModelVis in _pyflamegpu:
_pyflamegpu.ModelVis_swigregister(ModelVis)
class StaticModelVis(object):
r"""This class serves as an interface for managing an instance of ModelConfig::StaticModel"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self, _m):
r"""
:type _m: std::shared_ptr< ModelConfig::StaticModel >
:param _m: Reference which this interface manages
Notes: This should only be constructed by ModelVis
See also: ModelVis::addStaticModel(const std::string &, const std::string &)
"""
_pyflamegpu.StaticModelVis_swiginit(self, _pyflamegpu.new_StaticModelVis(_m))
def setModelScale(self, *args):
r"""
*Overload 1:*
Scale each dimension of the model to the corresponding world scales
:type xLen: float
:param xLen: World scale of the model's on the x axis
:type yLen: float
:param yLen: World scale of the model's on the y axis
:type zLen: float
:param zLen: World scale of the model's on the z axis
Notes: Y is considered the vertical axis
|
*Overload 2:*
Uniformly scale model so that max dimension equals this
:type maxLen: float
:param maxLen: World scale of the model's relative to the axis which it is
largest
"""
return _pyflamegpu.StaticModelVis_setModelScale(self, *args)
def setModelLocation(self, x, y, z):
r"""
Translation applied to the model
:type x: float
:param x: X coordinate
:type y: float
:param y: Y coordinate
:type z: float
:param z: Z coordinate
Notes: Y is considered the vertical axis
"""
return _pyflamegpu.StaticModelVis_setModelLocation(self, x, y, z)
def setModelRotation(self, x, y, z, radians):
r"""
Rotation applied to the model (before translation)
:type x: float
:param x: X component of axis vector
:type y: float
:param y: Y component of axis vector
:type z: float
:param z: Z component of axis vector
:type radians: float
:param radians: How far the model is rotated about the axis
Notes: Y is considered the vertical axis
"""
return _pyflamegpu.StaticModelVis_setModelRotation(self, x, y, z, radians)
__swig_destroy__ = _pyflamegpu.delete_StaticModelVis
# Register StaticModelVis in _pyflamegpu:
_pyflamegpu.StaticModelVis_swigregister(StaticModelVis)
class Color(object):
r"""
Store for a floating point rgba color
Each component should be in the inclusive range [0, 1] in-order for the color to be considered valid
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
r = property(_pyflamegpu.Color_r_get, _pyflamegpu.Color_r_set, doc=r"""Color components: red, green, blue, alpha""")
g = property(_pyflamegpu.Color_g_get, _pyflamegpu.Color_g_set)
b = property(_pyflamegpu.Color_b_get, _pyflamegpu.Color_b_set)
a = property(_pyflamegpu.Color_a_get, _pyflamegpu.Color_a_set)
def __init__(self, *args):
r"""
*Overload 1:*
Default constructor, initialises to white
|
*Overload 2:*
Construct a color with red, green, blue (and alpha) components
Each component should be in the range [0, 1]
|
*Overload 3:*
Construct a color with red, green, blue (and alpha) components
Each component should be in the range [0, 1]
|
*Overload 4:*
Construct a color with red, green, blue (and alpha) components
Each component should be in the range [0, 255]
|
*Overload 5:*
Construct a color with red, green, blue (and alpha) components
Each component should be in the range [0, 255]
|
*Overload 6:*
Construct a color with red, green and blue components
Each component should be in the range [0, 1]
|
*Overload 7:*
Construct a color with red, green, blue and alpha components
Each component should be in the range [0, 1]
|
*Overload 8:*
Construct a color with red, green and blue components
Each component should be in the range [0, 255]
|
*Overload 9:*
Construct a color with red, green, blue and alpha components
Each component should be in the range [0, 255]
|
*Overload 10:*
Construct a color from a hexcode
Supported formats:
#abcdef
#abc
abcdef
abc
:raises: InvalidArgument If parsing fails
"""
_pyflamegpu.Color_swiginit(self, _pyflamegpu.new_Color(*args))
def validate(self):
r"""Return true if all color components are in the inclusive range [0.0, 1.0]"""
return _pyflamegpu.Color_validate(self)
def __eq__(self, other):
r"""
Equality operator
Notes: It performs equality comparison on floats, this isn't too useful as very similar floats can be deemed different
"""
return _pyflamegpu.Color___eq__(self, other)
def __ne__(self, other):
r"""
Inequality operator
Notes: It performs equality comparison on floats, this isn't too useful as very similar floats can be deemed different
"""
return _pyflamegpu.Color___ne__(self, other)
def __add__(self, other):
r"""Add the components of 2 colors"""
return _pyflamegpu.Color___add__(self, other)
def __mul__(self, i):
r"""
Multiple the components of a color by i
TODO: Rework this to the other format, so color doesnt need to be the first item
"""
return _pyflamegpu.Color___mul__(self, i)
__swig_destroy__ = _pyflamegpu.delete_Color
# Register Color in _pyflamegpu:
_pyflamegpu.Color_swigregister(Color)
class Palette(object):
r"""
Abstract class for representing collections of const colors
Optionally, an enum can be added to sub-classes to allow them to be accessed via a name
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
def __init__(self, *args, **kwargs):
raise AttributeError("No constructor defined - class is abstract")
__repr__ = _swig_repr
Qualitative = _pyflamegpu.Palette_Qualitative
Sequential = _pyflamegpu.Palette_Sequential
Diverging = _pyflamegpu.Palette_Diverging
__swig_destroy__ = _pyflamegpu.delete_Palette
def size(self):
r"""Returns the number of colors in the palette"""
return _pyflamegpu.Palette_size(self)
def __eq__(self, other):
r"""Compares two palettes for equality (whether they contain the same colors)"""
return _pyflamegpu.Palette___eq__(self, other)
def getColorBlindFriendly(self):
r"""Returns whether the palette is confirmed as suitable for colorblind viewers"""
return _pyflamegpu.Palette_getColorBlindFriendly(self)
def getCategory(self):
r"""
Returns the category of the palette
See also: Category
"""
return _pyflamegpu.Palette_getCategory(self)
def __iter__(self):
return FLAMEGPUIterator(self)
def __len__(self):
return self.size()
def __getitem__(self, index):
return _pyflamegpu.Palette___getitem__(self, index)
# Register Palette in _pyflamegpu:
_pyflamegpu.Palette_swigregister(Palette)
BLACK = cvar.BLACK
WHITE = cvar.WHITE
RED = cvar.RED
GREEN = cvar.GREEN
BLUE = cvar.BLUE
class Set1(Palette):
r"""
Qualitative palette
Set1 from Colorbrewer
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self):
_pyflamegpu.Set1_swiginit(self, _pyflamegpu.new_Set1())
def getCategory(self):
return _pyflamegpu.Set1_getCategory(self)
def getColorBlindFriendly(self):
return _pyflamegpu.Set1_getColorBlindFriendly(self)
RED = _pyflamegpu.Set1_RED
BLUE = _pyflamegpu.Set1_BLUE
GREEN = _pyflamegpu.Set1_GREEN
PURPLE = _pyflamegpu.Set1_PURPLE
ORANGE = _pyflamegpu.Set1_ORANGE
YELLOW = _pyflamegpu.Set1_YELLOW
BROWN = _pyflamegpu.Set1_BROWN
PINK = _pyflamegpu.Set1_PINK
GREY = _pyflamegpu.Set1_GREY
__swig_destroy__ = _pyflamegpu.delete_Set1
# Register Set1 in _pyflamegpu:
_pyflamegpu.Set1_swigregister(Set1)
class Set2(Palette):
r"""
Color blind friendly qualitative palette
Set2 from Colorbrewer
Notes: Color names are approximations using https://www.color-blindness.com/color-name-hue/
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self):
_pyflamegpu.Set2_swiginit(self, _pyflamegpu.new_Set2())
def getCategory(self):
return _pyflamegpu.Set2_getCategory(self)
def getColorBlindFriendly(self):
return _pyflamegpu.Set2_getColorBlindFriendly(self)
PUERTO_RICO = _pyflamegpu.Set2_PUERTO_RICO
ATOMIC_TANGERINE = _pyflamegpu.Set2_ATOMIC_TANGERINE
POLO_BLUE = _pyflamegpu.Set2_POLO_BLUE
SHOCKING = _pyflamegpu.Set2_SHOCKING
CONIFER = _pyflamegpu.Set2_CONIFER
SUNGLOW = _pyflamegpu.Set2_SUNGLOW
CHAMOIS = _pyflamegpu.Set2_CHAMOIS
DARK_GREY = _pyflamegpu.Set2_DARK_GREY
__swig_destroy__ = _pyflamegpu.delete_Set2
# Register Set2 in _pyflamegpu:
_pyflamegpu.Set2_swigregister(Set2)
class Dark2(Palette):
r"""
Color blind friendly qualitative palette
Dark2 from Colorbrewer
Notes: Color names are approximations using https://www.color-blindness.com/color-name-hue/
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self):
_pyflamegpu.Dark2_swiginit(self, _pyflamegpu.new_Dark2())
def getCategory(self):
return _pyflamegpu.Dark2_getCategory(self)
def getColorBlindFriendly(self):
return _pyflamegpu.Dark2_getColorBlindFriendly(self)
ELF_GREEN = _pyflamegpu.Dark2_ELF_GREEN
TAWNY = _pyflamegpu.Dark2_TAWNY
RICH_BLUE = _pyflamegpu.Dark2_RICH_BLUE
RAZZMATAZZ = _pyflamegpu.Dark2_RAZZMATAZZ
CHRISTI = _pyflamegpu.Dark2_CHRISTI
GAMBOGE = _pyflamegpu.Dark2_GAMBOGE
GOLDEN_BROWN = _pyflamegpu.Dark2_GOLDEN_BROWN
MORTAR = _pyflamegpu.Dark2_MORTAR
__swig_destroy__ = _pyflamegpu.delete_Dark2
# Register Dark2 in _pyflamegpu:
_pyflamegpu.Dark2_swigregister(Dark2)
class Pastel(Palette):
r"""
Qualitative palette
pastel palette from seaborn
Blue light filters may cause MACARONI_AND_CHEESE(1) and ROSEBUD(3) to appear similar
Notes: Color names are approximations using https://www.color-blindness.com/color-name-hue/
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self):
_pyflamegpu.Pastel_swiginit(self, _pyflamegpu.new_Pastel())
def getCategory(self):
return _pyflamegpu.Pastel_getCategory(self)
def getColorBlindFriendly(self):
return _pyflamegpu.Pastel_getColorBlindFriendly(self)
PALE_CORNFLOWER_BLUE = _pyflamegpu.Pastel_PALE_CORNFLOWER_BLUE
MACARONI_AND_CHEESE = _pyflamegpu.Pastel_MACARONI_AND_CHEESE
GRANNY_SMITH_APPLE = _pyflamegpu.Pastel_GRANNY_SMITH_APPLE
ROSEBUD = _pyflamegpu.Pastel_ROSEBUD
MAUVE = _pyflamegpu.Pastel_MAUVE
PANCHO = _pyflamegpu.Pastel_PANCHO
LAVENDER_ROSE = _pyflamegpu.Pastel_LAVENDER_ROSE
VERY_LIGHT_GREY = _pyflamegpu.Pastel_VERY_LIGHT_GREY
CANARY = _pyflamegpu.Pastel_CANARY
PALE_TURQUOISE = _pyflamegpu.Pastel_PALE_TURQUOISE
__swig_destroy__ = _pyflamegpu.delete_Pastel
# Register Pastel in _pyflamegpu:
_pyflamegpu.Pastel_swigregister(Pastel)
class YlOrRd(Palette):
r"""
Color blind friendly Sequential palette
YlOrRd palette from Colorbrewer
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self):
_pyflamegpu.YlOrRd_swiginit(self, _pyflamegpu.new_YlOrRd())
def getCategory(self):
return _pyflamegpu.YlOrRd_getCategory(self)
def getColorBlindFriendly(self):
return _pyflamegpu.YlOrRd_getColorBlindFriendly(self)
__swig_destroy__ = _pyflamegpu.delete_YlOrRd
# Register YlOrRd in _pyflamegpu:
_pyflamegpu.YlOrRd_swigregister(YlOrRd)
class YlGn(Palette):
r"""
Color blind friendly Sequential palette
YlGn palette from Colorbrewer
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self):
_pyflamegpu.YlGn_swiginit(self, _pyflamegpu.new_YlGn())
def getCategory(self):
return _pyflamegpu.YlGn_getCategory(self)
def getColorBlindFriendly(self):
return _pyflamegpu.YlGn_getColorBlindFriendly(self)
__swig_destroy__ = _pyflamegpu.delete_YlGn
# Register YlGn in _pyflamegpu:
_pyflamegpu.YlGn_swigregister(YlGn)
class Greys(Palette):
r"""
Color blind friendly Sequential palette
Greys palette from Colorbrewer
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self):
_pyflamegpu.Greys_swiginit(self, _pyflamegpu.new_Greys())
def getCategory(self):
return _pyflamegpu.Greys_getCategory(self)
def getColorBlindFriendly(self):
return _pyflamegpu.Greys_getColorBlindFriendly(self)
__swig_destroy__ = _pyflamegpu.delete_Greys
# Register Greys in _pyflamegpu:
_pyflamegpu.Greys_swigregister(Greys)
class RdYlBu(Palette):
r"""
Color blind friendly Diverging palette
RdYlBu palette from Colorbrewer
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self):
_pyflamegpu.RdYlBu_swiginit(self, _pyflamegpu.new_RdYlBu())
def getCategory(self):
return _pyflamegpu.RdYlBu_getCategory(self)
def getColorBlindFriendly(self):
return _pyflamegpu.RdYlBu_getColorBlindFriendly(self)
__swig_destroy__ = _pyflamegpu.delete_RdYlBu
# Register RdYlBu in _pyflamegpu:
_pyflamegpu.RdYlBu_swigregister(RdYlBu)
class PiYG(Palette):
r"""
Color blind friendly Diverging palette
PiYG palette from Colorbrewer
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self):
_pyflamegpu.PiYG_swiginit(self, _pyflamegpu.new_PiYG())
def getCategory(self):
return _pyflamegpu.PiYG_getCategory(self)
def getColorBlindFriendly(self):
return _pyflamegpu.PiYG_getColorBlindFriendly(self)
__swig_destroy__ = _pyflamegpu.delete_PiYG
# Register PiYG in _pyflamegpu:
_pyflamegpu.PiYG_swigregister(PiYG)
class Viridis(Palette):
r"""
Color blind friendly dynamic sequential palette
Viridis from BIDS/MatPlotLib: https://github.com/BIDS/colormap
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def getCategory(self):
return _pyflamegpu.Viridis_getCategory(self)
def getColorBlindFriendly(self):
return _pyflamegpu.Viridis_getColorBlindFriendly(self)
def __init__(self, *args):
r"""Construct the Palette by specifying how many color values are required"""
_pyflamegpu.Viridis_swiginit(self, _pyflamegpu.new_Viridis(*args))
__swig_destroy__ = _pyflamegpu.delete_Viridis
# Register Viridis in _pyflamegpu:
_pyflamegpu.Viridis_swigregister(Viridis)
class StaticColor(object):
r"""
Creates a color function returning a static color
You probably don't need to use this class directly, instances of Color are implicitly converted to a StaticColor
Notes: Currently ignores alpha channel of colors as Alpha support isn't properly tested
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self, rgba):
r"""
Constructs a static color function generator
All components must be provided in the inclusive range [0.0, 1.0]
:type rgba: :py:class:`Color`
:param rgba: Color to represent
"""
_pyflamegpu.StaticColor_swiginit(self, _pyflamegpu.new_StaticColor(rgba))
def getSrc(self):
r"""
Returns a function returning a constant color in the form:
vec4 calculateColor() {
return vec4(1.0, 0.0, 0.0, 1.0);
}
"""
return _pyflamegpu.StaticColor_getSrc(self)
__swig_destroy__ = _pyflamegpu.delete_StaticColor
# Register StaticColor in _pyflamegpu:
_pyflamegpu.StaticColor_swigregister(StaticColor)
SET1 = cvar.SET1
SET2 = cvar.SET2
DARK2 = cvar.DARK2
PASTEL = cvar.PASTEL
YLORRD = cvar.YLORRD
YLGN = cvar.YLGN
GREYS = cvar.GREYS
RDYLBU = cvar.RDYLBU
PIYG = cvar.PIYG
class HSVInterpolation(object):
r"""Agent color function for mapping a floating point value to a HSV hue"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
@staticmethod
def REDGREEN(variable_name, min_bound=0.0, max_bound=1.0):
r"""
0 = Red, 1 = Green
:type variable_name: string
:param variable_name: agent variable of type float to map to the color
:type min_bound: float, optional
:param min_bound: The value of the agent variable which should map to the Red
:type max_bound: float, optional
:param max_bound: The value of the agent variable which should map to the Green
"""
return _pyflamegpu.HSVInterpolation_REDGREEN(variable_name, min_bound, max_bound)
@staticmethod
def GREENRED(variable_name, min_bound=0.0, max_bound=1.0):
r"""
0 = Green, 1 = Red
:type variable_name: string
:param variable_name: agent variable of type float to map to the color
:type min_bound: float, optional
:param min_bound: The value of the agent variable which should map to Green
:type max_bound: float, optional
:param max_bound: The value of the agent variable which should map to Red
"""
return _pyflamegpu.HSVInterpolation_GREENRED(variable_name, min_bound, max_bound)
def __init__(self, variable_name, hMin, hMax, s=1.0, v=0.88):
r"""
Constructs a HSV interpolation function generator
All components must be provided in the inclusive range [0.0, 1.0]
:type variable_name: string
:param variable_name: Name of the agent variable which maps to hue, the variable type must be float
:type hMin: float
:param hMin: Hue value when the agent variable is 0.0
:type hMax: float
:param hMax: Hue value when the agent variable is 1.0
:type s: float, optional
:param s: Saturation (the inverse amount of grey)
:type v: float, optional
:param v: Value (brightness)
"""
_pyflamegpu.HSVInterpolation_swiginit(self, _pyflamegpu.new_HSVInterpolation(variable_name, hMin, hMax, s, v))
def setBounds(self, min_bound, max_bound):
r"""
Set the bounds to clamp an agent variable to before using for HSV interpolation
:type min_bound: float
:param min_bound: The agent variable value that should map to the minimum hue, must be smaller than max_bound
:type max_bound: float
:param max_bound: The agent variable value that should map to the maximum hue, must be larger than min_bound
:rtype: :py:class:`HSVInterpolation`
:return: Returns itself, so that you can chain the method (otherwise constructor would have too many optional args)
:raises: InvalidArgument if min_bound > max_bound
Notes: Defaults to (0.0, 1.0)
"""
return _pyflamegpu.HSVInterpolation_setBounds(self, min_bound, max_bound)
def setWrapHue(self, _wrapHue):
r"""
If set to true, hue will interpolate over the 0/360 boundary
If set false, hue will interpolate without wrapping (e.g. if hMax is < hMin), hMin will be assigned to the lower_bound
By default this is set to false
"""
return _pyflamegpu.HSVInterpolation_setWrapHue(self, _wrapHue)
def getSrc(self):
r"""Returns GLSL for a function that returns a color based on the configured HSV interpolation"""
return _pyflamegpu.HSVInterpolation_getSrc(self)
def getSamplerName(self):
r'''Always returns "color_arg"'''
return _pyflamegpu.HSVInterpolation_getSamplerName(self)
def getAgentVariableName(self):
r"""Returns variable_name"""
return _pyflamegpu.HSVInterpolation_getAgentVariableName(self)
__swig_destroy__ = _pyflamegpu.delete_HSVInterpolation
# Register HSVInterpolation in _pyflamegpu:
_pyflamegpu.HSVInterpolation_swigregister(HSVInterpolation)
def HSVInterpolation_REDGREEN(variable_name, min_bound=0.0, max_bound=1.0):
r"""
0 = Red, 1 = Green
:type variable_name: string
:param variable_name: agent variable of type float to map to the color
:type min_bound: float, optional
:param min_bound: The value of the agent variable which should map to the Red
:type max_bound: float, optional
:param max_bound: The value of the agent variable which should map to the Green
"""
return _pyflamegpu.HSVInterpolation_REDGREEN(variable_name, min_bound, max_bound)
def HSVInterpolation_GREENRED(variable_name, min_bound=0.0, max_bound=1.0):
r"""
0 = Green, 1 = Red
:type variable_name: string
:param variable_name: agent variable of type float to map to the color
:type min_bound: float, optional
:param min_bound: The value of the agent variable which should map to Green
:type max_bound: float, optional
:param max_bound: The value of the agent variable which should map to Red
"""
return _pyflamegpu.HSVInterpolation_GREENRED(variable_name, min_bound, max_bound)
class Model(object):
r"""Path to model file and optional texture within integrated resources"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
modelPath = property(_pyflamegpu.Model_modelPath_get, _pyflamegpu.Model_modelPath_set)
texturePath = property(_pyflamegpu.Model_texturePath_get, _pyflamegpu.Model_texturePath_set)
def __init__(self):
_pyflamegpu.Model_swiginit(self, _pyflamegpu.new_Model())
__swig_destroy__ = _pyflamegpu.delete_Model
# Register Model in _pyflamegpu:
_pyflamegpu.Model_swigregister(Model)
class iDiscreteColor(object):
r"""
Used to define a discrete color selection function
Integer keys are mapped to static colors
Add key:color pairs to this class as you would a std::map *
This class only supports being instantiated with types int32_t, and uint32_t
These have been typedef as iDiscreteColor and uDiscreteColor respectively
The agent variable which provides the key should be of the corresponding type
Notes: Currently ignores alpha channel of colors as Alpha support isn't properly tested
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self, *args):
r"""
*Overload 1:*
Constructs a discrete color function generator
:type variable_name: string
:param variable_name: Name of the agent variable which provides the integer key, this key must have type T within the model
:type fallback: :py:class:`Color`
:param fallback: Color that is returned when the provided integer is not found within the map
|
*Overload 2:*
Constructs a discrete color function generator from a palette, with a separate fallback color
:type variable_name: string
:param variable_name: Name of the agent variable which provides the integer key
:type palette: :py:class:`Palette`
:param palette: The colors to use
:type fallback: :py:class:`Color`
:param fallback: The color to return when they lookup doesn't have a matching int
:type offset: int, optional
:param offset: The key to map to the first palette color
:type stride: int, optional
:param stride: The value to added to every subsequent key
See also: DiscreteColor(const std::string&, const Palette&, T, T);
|
*Overload 3:*
Constructs a discrete color function generator from a palette, with a separate fallback color
:type variable_name: string
:param variable_name: Name of the agent variable which provides the integer key
:type palette: :py:class:`Palette`
:param palette: The colors to use
:type fallback: :py:class:`Color`
:param fallback: The color to return when they lookup doesn't have a matching int
:type offset: int, optional
:param offset: The key to map to the first palette color
:param stride: The value to added to every subsequent key
See also: DiscreteColor(const std::string&, const Palette&, T, T);
|
*Overload 4:*
Constructs a discrete color function generator from a palette, with a separate fallback color
:type variable_name: string
:param variable_name: Name of the agent variable which provides the integer key
:type palette: :py:class:`Palette`
:param palette: The colors to use
:type fallback: :py:class:`Color`
:param fallback: The color to return when they lookup doesn't have a matching int
:param offset: The key to map to the first palette color
:param stride: The value to added to every subsequent key
See also: DiscreteColor(const std::string&, const Palette&, T, T);
|
*Overload 5:*
Constructs a discrete color function generator from a palette, with the palette's final color used as the fallback color
This version maps the final color of the palette to the fallback, rather than an integer key
:type variable_name: string
:param variable_name: Name of the agent variable which provides the integer key
:type palette: :py:class:`Palette`
:param palette: The colors to use
:type offset: int, optional
:param offset: The key to map to the first palette color
:type stride: int, optional
:param stride: The value to added to every subsequent key
See also: DiscreteColor(const std::string&, const Palette&, const Color&, T, T);
|
*Overload 6:*
Constructs a discrete color function generator from a palette, with the palette's final color used as the fallback color
This version maps the final color of the palette to the fallback, rather than an integer key
:type variable_name: string
:param variable_name: Name of the agent variable which provides the integer key
:type palette: :py:class:`Palette`
:param palette: The colors to use
:type offset: int, optional
:param offset: The key to map to the first palette color
:param stride: The value to added to every subsequent key
See also: DiscreteColor(const std::string&, const Palette&, const Color&, T, T);
|
*Overload 7:*
Constructs a discrete color function generator from a palette, with the palette's final color used as the fallback color
This version maps the final color of the palette to the fallback, rather than an integer key
:type variable_name: string
:param variable_name: Name of the agent variable which provides the integer key
:type palette: :py:class:`Palette`
:param palette: The colors to use
:param offset: The key to map to the first palette color
:param stride: The value to added to every subsequent key
See also: DiscreteColor(const std::string&, const Palette&, const Color&, T, T);
"""
_pyflamegpu.iDiscreteColor_swiginit(self, _pyflamegpu.new_iDiscreteColor(*args))
def getSrc(self):
r"""
Returns a function containing a switch statement through the entries of the map, e.g.
uniform samplerBuffer color_arg;
vec4 calculateColor() {
const int category = floatBitsToInt(texelFetch(color_arg, gl_InstanceID).x);
switch (category) {
case 12: return vec4(1, 0, 0, 1);
default: return vec4(0, 1, 0, 1);
}
}
"""
return _pyflamegpu.iDiscreteColor_getSrc(self)
def getSamplerName(self):
r'''Always returns "color_arg"'''
return _pyflamegpu.iDiscreteColor_getSamplerName(self)
def getAgentVariableName(self):
r"""Returns variable_name"""
return _pyflamegpu.iDiscreteColor_getAgentVariableName(self)
def validate(self):
r"""
Checks whether the current components can be used as a valid RGBA colour
Returns false if any contained color components are outside of the range [0.0, 1.0]
"""
return _pyflamegpu.iDiscreteColor_validate(self)
__swig_destroy__ = _pyflamegpu.delete_iDiscreteColor
# Register iDiscreteColor in _pyflamegpu:
_pyflamegpu.iDiscreteColor_swigregister(iDiscreteColor)
SPHERE = cvar.SPHERE
ICOSPHERE = cvar.ICOSPHERE
CUBE = cvar.CUBE
TEAPOT = cvar.TEAPOT
STUNTPLANE = cvar.STUNTPLANE
class uDiscreteColor(object):
r"""
Used to define a discrete color selection function
Integer keys are mapped to static colors
Add key:color pairs to this class as you would a std::map *
This class only supports being instantiated with types int32_t, and uint32_t
These have been typedef as iDiscreteColor and uDiscreteColor respectively
The agent variable which provides the key should be of the corresponding type
Notes: Currently ignores alpha channel of colors as Alpha support isn't properly tested
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
__repr__ = _swig_repr
def __init__(self, *args):
r"""
*Overload 1:*
Constructs a discrete color function generator
:type variable_name: string
:param variable_name: Name of the agent variable which provides the integer key, this key must have type T within the model
:type fallback: :py:class:`Color`
:param fallback: Color that is returned when the provided integer is not found within the map
|
*Overload 2:*
Constructs a discrete color function generator from a palette, with a separate fallback color
:type variable_name: string
:param variable_name: Name of the agent variable which provides the integer key
:type palette: :py:class:`Palette`
:param palette: The colors to use
:type fallback: :py:class:`Color`
:param fallback: The color to return when they lookup doesn't have a matching int
:type offset: int, optional
:param offset: The key to map to the first palette color
:type stride: int, optional
:param stride: The value to added to every subsequent key
See also: DiscreteColor(const std::string&, const Palette&, T, T);
|
*Overload 3:*
Constructs a discrete color function generator from a palette, with a separate fallback color
:type variable_name: string
:param variable_name: Name of the agent variable which provides the integer key
:type palette: :py:class:`Palette`
:param palette: The colors to use
:type fallback: :py:class:`Color`
:param fallback: The color to return when they lookup doesn't have a matching int
:type offset: int, optional
:param offset: The key to map to the first palette color
:param stride: The value to added to every subsequent key
See also: DiscreteColor(const std::string&, const Palette&, T, T);
|
*Overload 4:*
Constructs a discrete color function generator from a palette, with a separate fallback color
:type variable_name: string
:param variable_name: Name of the agent variable which provides the integer key
:type palette: :py:class:`Palette`
:param palette: The colors to use
:type fallback: :py:class:`Color`
:param fallback: The color to return when they lookup doesn't have a matching int
:param offset: The key to map to the first palette color
:param stride: The value to added to every subsequent key
See also: DiscreteColor(const std::string&, const Palette&, T, T);
|
*Overload 5:*
Constructs a discrete color function generator from a palette, with the palette's final color used as the fallback color
This version maps the final color of the palette to the fallback, rather than an integer key
:type variable_name: string
:param variable_name: Name of the agent variable which provides the integer key
:type palette: :py:class:`Palette`
:param palette: The colors to use
:type offset: int, optional
:param offset: The key to map to the first palette color
:type stride: int, optional
:param stride: The value to added to every subsequent key
See also: DiscreteColor(const std::string&, const Palette&, const Color&, T, T);
|
*Overload 6:*
Constructs a discrete color function generator from a palette, with the palette's final color used as the fallback color
This version maps the final color of the palette to the fallback, rather than an integer key
:type variable_name: string
:param variable_name: Name of the agent variable which provides the integer key
:type palette: :py:class:`Palette`
:param palette: The colors to use
:type offset: int, optional
:param offset: The key to map to the first palette color
:param stride: The value to added to every subsequent key
See also: DiscreteColor(const std::string&, const Palette&, const Color&, T, T);
|
*Overload 7:*
Constructs a discrete color function generator from a palette, with the palette's final color used as the fallback color
This version maps the final color of the palette to the fallback, rather than an integer key
:type variable_name: string
:param variable_name: Name of the agent variable which provides the integer key
:type palette: :py:class:`Palette`
:param palette: The colors to use
:param offset: The key to map to the first palette color
:param stride: The value to added to every subsequent key
See also: DiscreteColor(const std::string&, const Palette&, const Color&, T, T);
"""
_pyflamegpu.uDiscreteColor_swiginit(self, _pyflamegpu.new_uDiscreteColor(*args))
def getSrc(self):
r"""
Returns a function containing a switch statement through the entries of the map, e.g.
uniform samplerBuffer color_arg;
vec4 calculateColor() {
const int category = floatBitsToInt(texelFetch(color_arg, gl_InstanceID).x);
switch (category) {
case 12: return vec4(1, 0, 0, 1);
default: return vec4(0, 1, 0, 1);
}
}
"""
return _pyflamegpu.uDiscreteColor_getSrc(self)
def getSamplerName(self):
r'''Always returns "color_arg"'''
return _pyflamegpu.uDiscreteColor_getSamplerName(self)
def getAgentVariableName(self):
r"""Returns variable_name"""
return _pyflamegpu.uDiscreteColor_getAgentVariableName(self)
def validate(self):
r"""
Checks whether the current components can be used as a valid RGBA colour
Returns false if any contained color components are outside of the range [0.0, 1.0]
"""
return _pyflamegpu.uDiscreteColor_validate(self)
__swig_destroy__ = _pyflamegpu.delete_uDiscreteColor
# Register uDiscreteColor in _pyflamegpu:
_pyflamegpu.uDiscreteColor_swigregister(uDiscreteColor)
VISUALISATION = _pyflamegpu.VISUALISATION
SEATBELTS = _pyflamegpu.SEATBELTS
| 42.972992
| 259
| 0.694597
| 84,013
| 680,993
| 5.51273
| 0.026472
| 0.020825
| 0.014037
| 0.022127
| 0.822918
| 0.790599
| 0.758618
| 0.731168
| 0.713901
| 0.682984
| 0
| 0.00634
| 0.244524
| 680,993
| 15,846
| 260
| 42.975704
| 0.893882
| 0.553981
| 0
| 0.293924
| 1
| 0
| 0.014562
| 0
| 0
| 0
| 0
| 0.000505
| 0
| 1
| 0.350806
| false
| 0
| 0.001359
| 0.191031
| 0.780819
| 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
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 10
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.