repo
stringlengths
7
55
path
stringlengths
4
127
func_name
stringlengths
1
88
original_string
stringlengths
75
19.8k
language
stringclasses
1 value
code
stringlengths
75
19.8k
code_tokens
list
docstring
stringlengths
3
17.3k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
87
242
partition
stringclasses
1 value
F5Networks/f5-common-python
f5/bigip/tm/ltm/policy.py
Policy._update
def _update(self, **kwargs): '''Update only draft or legacy policies Published policies cannot be updated :raises: OperationNotSupportedOnPublishedPolicy ''' legacy = kwargs.pop('legacy', False) tmos_ver = self._meta_data['bigip']._meta_data['tmos_version'] self...
python
def _update(self, **kwargs): '''Update only draft or legacy policies Published policies cannot be updated :raises: OperationNotSupportedOnPublishedPolicy ''' legacy = kwargs.pop('legacy', False) tmos_ver = self._meta_data['bigip']._meta_data['tmos_version'] self...
[ "def", "_update", "(", "self", ",", "**", "kwargs", ")", ":", "legacy", "=", "kwargs", ".", "pop", "(", "'legacy'", ",", "False", ")", "tmos_ver", "=", "self", ".", "_meta_data", "[", "'bigip'", "]", ".", "_meta_data", "[", "'tmos_version'", "]", "self...
Update only draft or legacy policies Published policies cannot be updated :raises: OperationNotSupportedOnPublishedPolicy
[ "Update", "only", "draft", "or", "legacy", "policies" ]
7e67d5acd757a60e3d5f8c88c534bd72208f5494
https://github.com/F5Networks/f5-common-python/blob/7e67d5acd757a60e3d5f8c88c534bd72208f5494/f5/bigip/tm/ltm/policy.py#L127-L142
train
F5Networks/f5-common-python
f5/bigip/tm/ltm/policy.py
Policy.publish
def publish(self, **kwargs): '''Publishing a draft policy is only applicable in TMOS 12.1 and up. This operation updates the meta_data['uri'] of the existing object and effectively moves a draft into a published state on the device. The self object is also updated with the response from...
python
def publish(self, **kwargs): '''Publishing a draft policy is only applicable in TMOS 12.1 and up. This operation updates the meta_data['uri'] of the existing object and effectively moves a draft into a published state on the device. The self object is also updated with the response from...
[ "def", "publish", "(", "self", ",", "**", "kwargs", ")", ":", "assert", "'Drafts'", "in", "self", ".", "_meta_data", "[", "'uri'", "]", "assert", "self", ".", "status", ".", "lower", "(", ")", "==", "'draft'", "base_uri", "=", "self", ".", "_meta_data"...
Publishing a draft policy is only applicable in TMOS 12.1 and up. This operation updates the meta_data['uri'] of the existing object and effectively moves a draft into a published state on the device. The self object is also updated with the response from a GET to the device. :...
[ "Publishing", "a", "draft", "policy", "is", "only", "applicable", "in", "TMOS", "12", ".", "1", "and", "up", "." ]
7e67d5acd757a60e3d5f8c88c534bd72208f5494
https://github.com/F5Networks/f5-common-python/blob/7e67d5acd757a60e3d5f8c88c534bd72208f5494/f5/bigip/tm/ltm/policy.py#L144-L172
train
F5Networks/f5-common-python
f5/bigip/tm/ltm/policy.py
Policy.draft
def draft(self, **kwargs): '''Allows for easily re-drafting a policy After a policy has been created, it was not previously possible to re-draft the published policy. This method makes it possible for a user with existing, published, policies to create drafts from them so that t...
python
def draft(self, **kwargs): '''Allows for easily re-drafting a policy After a policy has been created, it was not previously possible to re-draft the published policy. This method makes it possible for a user with existing, published, policies to create drafts from them so that t...
[ "def", "draft", "(", "self", ",", "**", "kwargs", ")", ":", "tmos_ver", "=", "self", ".", "_meta_data", "[", "'bigip'", "]", ".", "_meta_data", "[", "'tmos_version'", "]", "legacy", "=", "kwargs", ".", "pop", "(", "'legacy'", ",", "False", ")", "if", ...
Allows for easily re-drafting a policy After a policy has been created, it was not previously possible to re-draft the published policy. This method makes it possible for a user with existing, published, policies to create drafts from them so that they are modifiable. See https:...
[ "Allows", "for", "easily", "re", "-", "drafting", "a", "policy" ]
7e67d5acd757a60e3d5f8c88c534bd72208f5494
https://github.com/F5Networks/f5-common-python/blob/7e67d5acd757a60e3d5f8c88c534bd72208f5494/f5/bigip/tm/ltm/policy.py#L174-L208
train
F5Networks/f5-common-python
f5/bigiq/cm/shared/licensing/pools.py
Member.delete
def delete(self, **kwargs): """Deletes a member from an unmanaged license pool You need to be careful with this method. When you use it, and it succeeds on the remote BIG-IP, the configuration of the BIG-IP will be reloaded. During this process, you will not be able to access th...
python
def delete(self, **kwargs): """Deletes a member from an unmanaged license pool You need to be careful with this method. When you use it, and it succeeds on the remote BIG-IP, the configuration of the BIG-IP will be reloaded. During this process, you will not be able to access th...
[ "def", "delete", "(", "self", ",", "**", "kwargs", ")", ":", "if", "'uuid'", "not", "in", "kwargs", ":", "kwargs", "[", "'uuid'", "]", "=", "str", "(", "self", ".", "uuid", ")", "requests_params", "=", "self", ".", "_handle_requests_params", "(", "kwar...
Deletes a member from an unmanaged license pool You need to be careful with this method. When you use it, and it succeeds on the remote BIG-IP, the configuration of the BIG-IP will be reloaded. During this process, you will not be able to access the REST interface. This method ...
[ "Deletes", "a", "member", "from", "an", "unmanaged", "license", "pool" ]
7e67d5acd757a60e3d5f8c88c534bd72208f5494
https://github.com/F5Networks/f5-common-python/blob/7e67d5acd757a60e3d5f8c88c534bd72208f5494/f5/bigiq/cm/shared/licensing/pools.py#L101-L133
train
F5Networks/f5-common-python
f5/bigip/tm/sys/failover.py
Failover.exec_cmd
def exec_cmd(self, command, **kwargs): """Defining custom method to append 'exclusive_attributes'. WARNING: Some parameters are hyphenated therefore the function will need to utilize variable keyword argument syntax. This only applies when utilCmdArgs method is not in ...
python
def exec_cmd(self, command, **kwargs): """Defining custom method to append 'exclusive_attributes'. WARNING: Some parameters are hyphenated therefore the function will need to utilize variable keyword argument syntax. This only applies when utilCmdArgs method is not in ...
[ "def", "exec_cmd", "(", "self", ",", "command", ",", "**", "kwargs", ")", ":", "kwargs", "=", "self", ".", "_reduce_boolean_pair", "(", "kwargs", ",", "'online'", ",", "'offline'", ")", "if", "'offline'", "in", "kwargs", ":", "self", ".", "_meta_data", "...
Defining custom method to append 'exclusive_attributes'. WARNING: Some parameters are hyphenated therefore the function will need to utilize variable keyword argument syntax. This only applies when utilCmdArgs method is not in use. eg. param...
[ "Defining", "custom", "method", "to", "append", "exclusive_attributes", "." ]
7e67d5acd757a60e3d5f8c88c534bd72208f5494
https://github.com/F5Networks/f5-common-python/blob/7e67d5acd757a60e3d5f8c88c534bd72208f5494/f5/bigip/tm/sys/failover.py#L65-L103
train
F5Networks/f5-common-python
f5/bigip/tm/sys/failover.py
Failover.toggle_standby
def toggle_standby(self, **kwargs): """Toggle the standby status of a traffic group. WARNING: This method which used POST obtains json keys from the device that are not available in the response to a GET against the same URI. NOTE: This method method is deprecated and probably will ...
python
def toggle_standby(self, **kwargs): """Toggle the standby status of a traffic group. WARNING: This method which used POST obtains json keys from the device that are not available in the response to a GET against the same URI. NOTE: This method method is deprecated and probably will ...
[ "def", "toggle_standby", "(", "self", ",", "**", "kwargs", ")", ":", "trafficgroup", "=", "kwargs", ".", "pop", "(", "'trafficgroup'", ")", "state", "=", "kwargs", ".", "pop", "(", "'state'", ")", "if", "kwargs", ":", "raise", "TypeError", "(", "'Unexpec...
Toggle the standby status of a traffic group. WARNING: This method which used POST obtains json keys from the device that are not available in the response to a GET against the same URI. NOTE: This method method is deprecated and probably will be removed, usage of exec_cmd is...
[ "Toggle", "the", "standby", "status", "of", "a", "traffic", "group", "." ]
7e67d5acd757a60e3d5f8c88c534bd72208f5494
https://github.com/F5Networks/f5-common-python/blob/7e67d5acd757a60e3d5f8c88c534bd72208f5494/f5/bigip/tm/sys/failover.py#L105-L120
train
F5Networks/f5-common-python
f5/bigip/tm/ltm/profile.py
Ocsp_Stapling_Params.update
def update(self, **kwargs): """When setting useProxyServer to enable we need to supply proxyServerPool value as well """ if 'useProxyServer' in kwargs and kwargs['useProxyServer'] == 'enabled': if 'proxyServerPool' not in kwargs: error = 'Missing proxySer...
python
def update(self, **kwargs): """When setting useProxyServer to enable we need to supply proxyServerPool value as well """ if 'useProxyServer' in kwargs and kwargs['useProxyServer'] == 'enabled': if 'proxyServerPool' not in kwargs: error = 'Missing proxySer...
[ "def", "update", "(", "self", ",", "**", "kwargs", ")", ":", "if", "'useProxyServer'", "in", "kwargs", "and", "kwargs", "[", "'useProxyServer'", "]", "==", "'enabled'", ":", "if", "'proxyServerPool'", "not", "in", "kwargs", ":", "error", "=", "'Missing proxy...
When setting useProxyServer to enable we need to supply proxyServerPool value as well
[ "When", "setting", "useProxyServer", "to", "enable", "we", "need", "to", "supply" ]
7e67d5acd757a60e3d5f8c88c534bd72208f5494
https://github.com/F5Networks/f5-common-python/blob/7e67d5acd757a60e3d5f8c88c534bd72208f5494/f5/bigip/tm/ltm/profile.py#L678-L694
train
F5Networks/f5-common-python
f5/bigip/tm/net/vlan.py
Interfaces._check_tagmode_and_tmos_version
def _check_tagmode_and_tmos_version(self, **kwargs): '''Raise an exception if tagMode in kwargs and tmos version < 11.6.0 :param kwargs: dict -- keyword arguments for request :raises: TagModeDisallowedForTMOSVersion ''' tmos_version = self._meta_data['bigip']._meta_data['tmos_v...
python
def _check_tagmode_and_tmos_version(self, **kwargs): '''Raise an exception if tagMode in kwargs and tmos version < 11.6.0 :param kwargs: dict -- keyword arguments for request :raises: TagModeDisallowedForTMOSVersion ''' tmos_version = self._meta_data['bigip']._meta_data['tmos_v...
[ "def", "_check_tagmode_and_tmos_version", "(", "self", ",", "**", "kwargs", ")", ":", "tmos_version", "=", "self", ".", "_meta_data", "[", "'bigip'", "]", ".", "_meta_data", "[", "'tmos_version'", "]", "if", "LooseVersion", "(", "tmos_version", ")", "<", "Loos...
Raise an exception if tagMode in kwargs and tmos version < 11.6.0 :param kwargs: dict -- keyword arguments for request :raises: TagModeDisallowedForTMOSVersion
[ "Raise", "an", "exception", "if", "tagMode", "in", "kwargs", "and", "tmos", "version", "<", "11", ".", "6", ".", "0" ]
7e67d5acd757a60e3d5f8c88c534bd72208f5494
https://github.com/F5Networks/f5-common-python/blob/7e67d5acd757a60e3d5f8c88c534bd72208f5494/f5/bigip/tm/net/vlan.py#L97-L109
train
F5Networks/f5-common-python
f5/bigip/tm/ltm/virtual.py
Policies.load
def load(self, **kwargs): """Override load to retrieve object based on exists above.""" tmos_v = self._meta_data['bigip']._meta_data['tmos_version'] if self._check_existence_by_collection( self._meta_data['container'], kwargs['name']): if LooseVersion(tmos_v) == Loose...
python
def load(self, **kwargs): """Override load to retrieve object based on exists above.""" tmos_v = self._meta_data['bigip']._meta_data['tmos_version'] if self._check_existence_by_collection( self._meta_data['container'], kwargs['name']): if LooseVersion(tmos_v) == Loose...
[ "def", "load", "(", "self", ",", "**", "kwargs", ")", ":", "tmos_v", "=", "self", ".", "_meta_data", "[", "'bigip'", "]", ".", "_meta_data", "[", "'tmos_version'", "]", "if", "self", ".", "_check_existence_by_collection", "(", "self", ".", "_meta_data", "[...
Override load to retrieve object based on exists above.
[ "Override", "load", "to", "retrieve", "object", "based", "on", "exists", "above", "." ]
7e67d5acd757a60e3d5f8c88c534bd72208f5494
https://github.com/F5Networks/f5-common-python/blob/7e67d5acd757a60e3d5f8c88c534bd72208f5494/f5/bigip/tm/ltm/virtual.py#L127-L138
train
F5Networks/f5-common-python
f5/bigip/tm/ltm/virtual.py
Policies._load_11_5_4
def _load_11_5_4(self, **kwargs): """Custom _load method to accommodate for issue in 11.5.4, where an existing object would return 404 HTTP response. """ if 'uri' in self._meta_data: error = "There was an attempt to assign a new uri to this " \ "resource,...
python
def _load_11_5_4(self, **kwargs): """Custom _load method to accommodate for issue in 11.5.4, where an existing object would return 404 HTTP response. """ if 'uri' in self._meta_data: error = "There was an attempt to assign a new uri to this " \ "resource,...
[ "def", "_load_11_5_4", "(", "self", ",", "**", "kwargs", ")", ":", "if", "'uri'", "in", "self", ".", "_meta_data", ":", "error", "=", "\"There was an attempt to assign a new uri to this \"", "\"resource, the _meta_data['uri'] is %s and it should\"", "\" not be changed.\"", ...
Custom _load method to accommodate for issue in 11.5.4, where an existing object would return 404 HTTP response.
[ "Custom", "_load", "method", "to", "accommodate", "for", "issue", "in", "11", ".", "5", ".", "4" ]
7e67d5acd757a60e3d5f8c88c534bd72208f5494
https://github.com/F5Networks/f5-common-python/blob/7e67d5acd757a60e3d5f8c88c534bd72208f5494/f5/bigip/tm/ltm/virtual.py#L140-L169
train
F5Networks/f5-common-python
f5/bigip/tm/ltm/virtual.py
Policies.create
def create(self, **kwargs): """Custom _create method to accommodate for issue 11.5.4 and 12.1.1, Where creation of an object would return 404, despite the object being created. """ tmos_v = self._meta_data['bigip']._meta_data['tmos_version'] if LooseVersion(tmos_v) == Lo...
python
def create(self, **kwargs): """Custom _create method to accommodate for issue 11.5.4 and 12.1.1, Where creation of an object would return 404, despite the object being created. """ tmos_v = self._meta_data['bigip']._meta_data['tmos_version'] if LooseVersion(tmos_v) == Lo...
[ "def", "create", "(", "self", ",", "**", "kwargs", ")", ":", "tmos_v", "=", "self", ".", "_meta_data", "[", "'bigip'", "]", ".", "_meta_data", "[", "'tmos_version'", "]", "if", "LooseVersion", "(", "tmos_v", ")", "==", "LooseVersion", "(", "'11.5.4'", ")...
Custom _create method to accommodate for issue 11.5.4 and 12.1.1, Where creation of an object would return 404, despite the object being created.
[ "Custom", "_create", "method", "to", "accommodate", "for", "issue", "11", ".", "5", ".", "4", "and", "12", ".", "1", ".", "1" ]
7e67d5acd757a60e3d5f8c88c534bd72208f5494
https://github.com/F5Networks/f5-common-python/blob/7e67d5acd757a60e3d5f8c88c534bd72208f5494/f5/bigip/tm/ltm/virtual.py#L171-L212
train
F5Networks/f5-common-python
f5/bigip/tm/ltm/virtual.py
Policies_s.get_collection
def get_collection(self, **kwargs): """We need special get collection method to address issue in 11.5.4 In 11.5.4 collection 'items' were nested under 'policiesReference' key. This has caused get_collection() calls to return empty list. This fix will update the list if the policiesRefer...
python
def get_collection(self, **kwargs): """We need special get collection method to address issue in 11.5.4 In 11.5.4 collection 'items' were nested under 'policiesReference' key. This has caused get_collection() calls to return empty list. This fix will update the list if the policiesRefer...
[ "def", "get_collection", "(", "self", ",", "**", "kwargs", ")", ":", "list_of_contents", "=", "[", "]", "self", ".", "refresh", "(", "**", "kwargs", ")", "if", "'items'", "in", "self", ".", "__dict__", ":", "for", "item", "in", "self", ".", "items", ...
We need special get collection method to address issue in 11.5.4 In 11.5.4 collection 'items' were nested under 'policiesReference' key. This has caused get_collection() calls to return empty list. This fix will update the list if the policiesReference key is found and 'items' key do no...
[ "We", "need", "special", "get", "collection", "method", "to", "address", "issue", "in", "11", ".", "5", ".", "4" ]
7e67d5acd757a60e3d5f8c88c534bd72208f5494
https://github.com/F5Networks/f5-common-python/blob/7e67d5acd757a60e3d5f8c88c534bd72208f5494/f5/bigip/tm/ltm/virtual.py#L223-L271
train
F5Networks/f5-common-python
f5/multi_device/utils.py
get_device_names_to_objects
def get_device_names_to_objects(devices): '''Map a list of devices to their hostnames. :param devices: list -- list of ManagementRoot objects :returns: dict -- mapping of hostnames to ManagementRoot objects ''' name_to_object = {} for device in devices: device_name = get_device_info(de...
python
def get_device_names_to_objects(devices): '''Map a list of devices to their hostnames. :param devices: list -- list of ManagementRoot objects :returns: dict -- mapping of hostnames to ManagementRoot objects ''' name_to_object = {} for device in devices: device_name = get_device_info(de...
[ "def", "get_device_names_to_objects", "(", "devices", ")", ":", "name_to_object", "=", "{", "}", "for", "device", "in", "devices", ":", "device_name", "=", "get_device_info", "(", "device", ")", ".", "name", "name_to_object", "[", "device_name", "]", "=", "dev...
Map a list of devices to their hostnames. :param devices: list -- list of ManagementRoot objects :returns: dict -- mapping of hostnames to ManagementRoot objects
[ "Map", "a", "list", "of", "devices", "to", "their", "hostnames", "." ]
7e67d5acd757a60e3d5f8c88c534bd72208f5494
https://github.com/F5Networks/f5-common-python/blob/7e67d5acd757a60e3d5f8c88c534bd72208f5494/f5/multi_device/utils.py#L42-L53
train
F5Networks/f5-common-python
f5/bigip/tm/asm/policies/parameters.py
UrlParametersResource.create
def create(self, **kwargs): """Custom create method for v12.x and above. Change of behavior in v12 where the returned selfLink is different from target resource, requires us to append URI after object is created. So any modify() calls will not lead to json kind inconsistency wh...
python
def create(self, **kwargs): """Custom create method for v12.x and above. Change of behavior in v12 where the returned selfLink is different from target resource, requires us to append URI after object is created. So any modify() calls will not lead to json kind inconsistency wh...
[ "def", "create", "(", "self", ",", "**", "kwargs", ")", ":", "if", "LooseVersion", "(", "self", ".", "tmos_v", ")", "<", "LooseVersion", "(", "'12.0.0'", ")", ":", "return", "self", ".", "_create", "(", "**", "kwargs", ")", "else", ":", "new_instance",...
Custom create method for v12.x and above. Change of behavior in v12 where the returned selfLink is different from target resource, requires us to append URI after object is created. So any modify() calls will not lead to json kind inconsistency when changing the resource attribute. ...
[ "Custom", "create", "method", "for", "v12", ".", "x", "and", "above", "." ]
7e67d5acd757a60e3d5f8c88c534bd72208f5494
https://github.com/F5Networks/f5-common-python/blob/7e67d5acd757a60e3d5f8c88c534bd72208f5494/f5/bigip/tm/asm/policies/parameters.py#L88-L107
train
F5Networks/f5-common-python
f5/bigip/tm/ltm/pool.py
Pool._format_monitor_parameter
def _format_monitor_parameter(param): """This is a workaround for a known issue ID645289, which affects all versions of TMOS at this time. """ if '{' in param and '}': tmp = param.strip('}').split('{') monitor = ''.join(tmp).rstrip() return monitor ...
python
def _format_monitor_parameter(param): """This is a workaround for a known issue ID645289, which affects all versions of TMOS at this time. """ if '{' in param and '}': tmp = param.strip('}').split('{') monitor = ''.join(tmp).rstrip() return monitor ...
[ "def", "_format_monitor_parameter", "(", "param", ")", ":", "if", "'{'", "in", "param", "and", "'}'", ":", "tmp", "=", "param", ".", "strip", "(", "'}'", ")", ".", "split", "(", "'{'", ")", "monitor", "=", "''", ".", "join", "(", "tmp", ")", ".", ...
This is a workaround for a known issue ID645289, which affects all versions of TMOS at this time.
[ "This", "is", "a", "workaround", "for", "a", "known", "issue", "ID645289", "which", "affects" ]
7e67d5acd757a60e3d5f8c88c534bd72208f5494
https://github.com/F5Networks/f5-common-python/blob/7e67d5acd757a60e3d5f8c88c534bd72208f5494/f5/bigip/tm/ltm/pool.py#L57-L67
train
F5Networks/f5-common-python
f5/bigip/tm/ltm/pool.py
Pool.create
def create(self, **kwargs): """Custom create method to implement monitor parameter formatting.""" if 'monitor' in kwargs: value = self._format_monitor_parameter(kwargs['monitor']) kwargs['monitor'] = value return super(Pool, self)._create(**kwargs)
python
def create(self, **kwargs): """Custom create method to implement monitor parameter formatting.""" if 'monitor' in kwargs: value = self._format_monitor_parameter(kwargs['monitor']) kwargs['monitor'] = value return super(Pool, self)._create(**kwargs)
[ "def", "create", "(", "self", ",", "**", "kwargs", ")", ":", "if", "'monitor'", "in", "kwargs", ":", "value", "=", "self", ".", "_format_monitor_parameter", "(", "kwargs", "[", "'monitor'", "]", ")", "kwargs", "[", "'monitor'", "]", "=", "value", "return...
Custom create method to implement monitor parameter formatting.
[ "Custom", "create", "method", "to", "implement", "monitor", "parameter", "formatting", "." ]
7e67d5acd757a60e3d5f8c88c534bd72208f5494
https://github.com/F5Networks/f5-common-python/blob/7e67d5acd757a60e3d5f8c88c534bd72208f5494/f5/bigip/tm/ltm/pool.py#L69-L74
train
F5Networks/f5-common-python
f5/bigip/tm/ltm/pool.py
Pool.update
def update(self, **kwargs): """Custom update method to implement monitor parameter formatting.""" if 'monitor' in kwargs: value = self._format_monitor_parameter(kwargs['monitor']) kwargs['monitor'] = value elif 'monitor' in self.__dict__: value = self._format_...
python
def update(self, **kwargs): """Custom update method to implement monitor parameter formatting.""" if 'monitor' in kwargs: value = self._format_monitor_parameter(kwargs['monitor']) kwargs['monitor'] = value elif 'monitor' in self.__dict__: value = self._format_...
[ "def", "update", "(", "self", ",", "**", "kwargs", ")", ":", "if", "'monitor'", "in", "kwargs", ":", "value", "=", "self", ".", "_format_monitor_parameter", "(", "kwargs", "[", "'monitor'", "]", ")", "kwargs", "[", "'monitor'", "]", "=", "value", "elif",...
Custom update method to implement monitor parameter formatting.
[ "Custom", "update", "method", "to", "implement", "monitor", "parameter", "formatting", "." ]
7e67d5acd757a60e3d5f8c88c534bd72208f5494
https://github.com/F5Networks/f5-common-python/blob/7e67d5acd757a60e3d5f8c88c534bd72208f5494/f5/bigip/tm/ltm/pool.py#L76-L84
train
F5Networks/f5-common-python
f5/bigip/tm/ltm/pool.py
Pool.modify
def modify(self, **patch): """Custom modify method to implement monitor parameter formatting.""" if 'monitor' in patch: value = self._format_monitor_parameter(patch['monitor']) patch['monitor'] = value return super(Pool, self)._modify(**patch)
python
def modify(self, **patch): """Custom modify method to implement monitor parameter formatting.""" if 'monitor' in patch: value = self._format_monitor_parameter(patch['monitor']) patch['monitor'] = value return super(Pool, self)._modify(**patch)
[ "def", "modify", "(", "self", ",", "**", "patch", ")", ":", "if", "'monitor'", "in", "patch", ":", "value", "=", "self", ".", "_format_monitor_parameter", "(", "patch", "[", "'monitor'", "]", ")", "patch", "[", "'monitor'", "]", "=", "value", "return", ...
Custom modify method to implement monitor parameter formatting.
[ "Custom", "modify", "method", "to", "implement", "monitor", "parameter", "formatting", "." ]
7e67d5acd757a60e3d5f8c88c534bd72208f5494
https://github.com/F5Networks/f5-common-python/blob/7e67d5acd757a60e3d5f8c88c534bd72208f5494/f5/bigip/tm/ltm/pool.py#L86-L91
train
F5Networks/f5-common-python
f5/bigip/tm/ltm/pool.py
Members.exists
def exists(self, **kwargs): """Check for the existence of the named object on the BigIP Sends an HTTP GET to the URI of the named object and if it fails with a :exc:~requests.HTTPError` exception it checks the exception for status code of 404 and returns :obj:`False` in that case. ...
python
def exists(self, **kwargs): """Check for the existence of the named object on the BigIP Sends an HTTP GET to the URI of the named object and if it fails with a :exc:~requests.HTTPError` exception it checks the exception for status code of 404 and returns :obj:`False` in that case. ...
[ "def", "exists", "(", "self", ",", "**", "kwargs", ")", ":", "requests_params", "=", "self", ".", "_handle_requests_params", "(", "kwargs", ")", "self", ".", "_check_load_parameters", "(", "**", "kwargs", ")", "kwargs", "[", "'uri_as_parts'", "]", "=", "True...
Check for the existence of the named object on the BigIP Sends an HTTP GET to the URI of the named object and if it fails with a :exc:~requests.HTTPError` exception it checks the exception for status code of 404 and returns :obj:`False` in that case. If the GET is successful it must th...
[ "Check", "for", "the", "existence", "of", "the", "named", "object", "on", "the", "BigIP" ]
7e67d5acd757a60e3d5f8c88c534bd72208f5494
https://github.com/F5Networks/f5-common-python/blob/7e67d5acd757a60e3d5f8c88c534bd72208f5494/f5/bigip/tm/ltm/pool.py#L162-L206
train
F5Networks/f5-common-python
f5/bigip/tm/sys/ucs.py
Ucs.exec_cmd
def exec_cmd(self, command, **kwargs): """Due to ID476518 the load command need special treatment.""" self._is_allowed_command(command) self._check_command_parameters(**kwargs) if command == 'load': kwargs['command'] = command self._check_exclusive_parameters(**k...
python
def exec_cmd(self, command, **kwargs): """Due to ID476518 the load command need special treatment.""" self._is_allowed_command(command) self._check_command_parameters(**kwargs) if command == 'load': kwargs['command'] = command self._check_exclusive_parameters(**k...
[ "def", "exec_cmd", "(", "self", ",", "command", ",", "**", "kwargs", ")", ":", "self", ".", "_is_allowed_command", "(", "command", ")", "self", ".", "_check_command_parameters", "(", "**", "kwargs", ")", "if", "command", "==", "'load'", ":", "kwargs", "[",...
Due to ID476518 the load command need special treatment.
[ "Due", "to", "ID476518", "the", "load", "command", "need", "special", "treatment", "." ]
7e67d5acd757a60e3d5f8c88c534bd72208f5494
https://github.com/F5Networks/f5-common-python/blob/7e67d5acd757a60e3d5f8c88c534bd72208f5494/f5/bigip/tm/sys/ucs.py#L60-L81
train
F5Networks/f5-common-python
f5/bigip/tm/sys/ucs.py
Ucs.load
def load(self, **kwargs): """Method to list the UCS on the system Since this is only fixed in 12.1.0 and up we implemented version check here """ # Check if we are using 12.1.0 version or above when using this method self._is_version_supported_method('12.1.0') n...
python
def load(self, **kwargs): """Method to list the UCS on the system Since this is only fixed in 12.1.0 and up we implemented version check here """ # Check if we are using 12.1.0 version or above when using this method self._is_version_supported_method('12.1.0') n...
[ "def", "load", "(", "self", ",", "**", "kwargs", ")", ":", "self", ".", "_is_version_supported_method", "(", "'12.1.0'", ")", "newinst", "=", "self", ".", "_stamp_out_core", "(", ")", "newinst", ".", "_refresh", "(", "**", "kwargs", ")", "return", "newinst...
Method to list the UCS on the system Since this is only fixed in 12.1.0 and up we implemented version check here
[ "Method", "to", "list", "the", "UCS", "on", "the", "system" ]
7e67d5acd757a60e3d5f8c88c534bd72208f5494
https://github.com/F5Networks/f5-common-python/blob/7e67d5acd757a60e3d5f8c88c534bd72208f5494/f5/bigip/tm/sys/ucs.py#L83-L95
train
F5Networks/f5-common-python
f5/multi_device/device_group.py
DeviceGroup._set_attributes
def _set_attributes(self, **kwargs): '''Set instance attributes based on kwargs :param kwargs: dict -- kwargs to set as attributes ''' try: self.devices = kwargs['devices'][:] self.name = kwargs['device_group_name'] self.type = kwargs['device_group_t...
python
def _set_attributes(self, **kwargs): '''Set instance attributes based on kwargs :param kwargs: dict -- kwargs to set as attributes ''' try: self.devices = kwargs['devices'][:] self.name = kwargs['device_group_name'] self.type = kwargs['device_group_t...
[ "def", "_set_attributes", "(", "self", ",", "**", "kwargs", ")", ":", "try", ":", "self", ".", "devices", "=", "kwargs", "[", "'devices'", "]", "[", ":", "]", "self", ".", "name", "=", "kwargs", "[", "'device_group_name'", "]", "self", ".", "type", "...
Set instance attributes based on kwargs :param kwargs: dict -- kwargs to set as attributes
[ "Set", "instance", "attributes", "based", "on", "kwargs" ]
7e67d5acd757a60e3d5f8c88c534bd72208f5494
https://github.com/F5Networks/f5-common-python/blob/7e67d5acd757a60e3d5f8c88c534bd72208f5494/f5/multi_device/device_group.py#L104-L116
train
F5Networks/f5-common-python
f5/multi_device/device_group.py
DeviceGroup.validate
def validate(self, **kwargs): '''Validate device group state among given devices. :param kwargs: dict -- keyword args of device group information :raises: UnexpectedDeviceGroupType, UnexpectedDeviceGroupDevices ''' self._set_attributes(**kwargs) self._check_type() ...
python
def validate(self, **kwargs): '''Validate device group state among given devices. :param kwargs: dict -- keyword args of device group information :raises: UnexpectedDeviceGroupType, UnexpectedDeviceGroupDevices ''' self._set_attributes(**kwargs) self._check_type() ...
[ "def", "validate", "(", "self", ",", "**", "kwargs", ")", ":", "self", ".", "_set_attributes", "(", "**", "kwargs", ")", "self", ".", "_check_type", "(", ")", "self", ".", "dev_group_uri_res", "=", "self", ".", "_get_device_group", "(", "self", ".", "dev...
Validate device group state among given devices. :param kwargs: dict -- keyword args of device group information :raises: UnexpectedDeviceGroupType, UnexpectedDeviceGroupDevices
[ "Validate", "device", "group", "state", "among", "given", "devices", "." ]
7e67d5acd757a60e3d5f8c88c534bd72208f5494
https://github.com/F5Networks/f5-common-python/blob/7e67d5acd757a60e3d5f8c88c534bd72208f5494/f5/multi_device/device_group.py#L118-L142
train
F5Networks/f5-common-python
f5/multi_device/device_group.py
DeviceGroup._check_type
def _check_type(self): '''Check that the device group type is correct. :raises: DeviceGroupOperationNotSupported, DeviceGroupNotSupported ''' if self.type not in self.available_types: msg = 'Unsupported cluster type was given: %s' % self.type raise DeviceGroupNo...
python
def _check_type(self): '''Check that the device group type is correct. :raises: DeviceGroupOperationNotSupported, DeviceGroupNotSupported ''' if self.type not in self.available_types: msg = 'Unsupported cluster type was given: %s' % self.type raise DeviceGroupNo...
[ "def", "_check_type", "(", "self", ")", ":", "if", "self", ".", "type", "not", "in", "self", ".", "available_types", ":", "msg", "=", "'Unsupported cluster type was given: %s'", "%", "self", ".", "type", "raise", "DeviceGroupNotSupported", "(", "msg", ")", "el...
Check that the device group type is correct. :raises: DeviceGroupOperationNotSupported, DeviceGroupNotSupported
[ "Check", "that", "the", "device", "group", "type", "is", "correct", "." ]
7e67d5acd757a60e3d5f8c88c534bd72208f5494
https://github.com/F5Networks/f5-common-python/blob/7e67d5acd757a60e3d5f8c88c534bd72208f5494/f5/multi_device/device_group.py#L144-L156
train
F5Networks/f5-common-python
f5/multi_device/device_group.py
DeviceGroup.create
def create(self, **kwargs): '''Create the device service cluster group and add devices to it.''' self._set_attributes(**kwargs) self._check_type() pollster(self._check_all_devices_in_sync)() dg = self.devices[0].tm.cm.device_groups.device_group dg.create(name=self.name, ...
python
def create(self, **kwargs): '''Create the device service cluster group and add devices to it.''' self._set_attributes(**kwargs) self._check_type() pollster(self._check_all_devices_in_sync)() dg = self.devices[0].tm.cm.device_groups.device_group dg.create(name=self.name, ...
[ "def", "create", "(", "self", ",", "**", "kwargs", ")", ":", "self", ".", "_set_attributes", "(", "**", "kwargs", ")", "self", ".", "_check_type", "(", ")", "pollster", "(", "self", ".", "_check_all_devices_in_sync", ")", "(", ")", "dg", "=", "self", "...
Create the device service cluster group and add devices to it.
[ "Create", "the", "device", "service", "cluster", "group", "and", "add", "devices", "to", "it", "." ]
7e67d5acd757a60e3d5f8c88c534bd72208f5494
https://github.com/F5Networks/f5-common-python/blob/7e67d5acd757a60e3d5f8c88c534bd72208f5494/f5/multi_device/device_group.py#L161-L172
train
F5Networks/f5-common-python
f5/multi_device/device_group.py
DeviceGroup.teardown
def teardown(self): '''Teardown device service cluster group.''' self.ensure_all_devices_in_sync() for device in self.devices: self._delete_device_from_device_group(device) self._sync_to_group(device) pollster(self._ensure_device_active)(device) s...
python
def teardown(self): '''Teardown device service cluster group.''' self.ensure_all_devices_in_sync() for device in self.devices: self._delete_device_from_device_group(device) self._sync_to_group(device) pollster(self._ensure_device_active)(device) s...
[ "def", "teardown", "(", "self", ")", ":", "self", ".", "ensure_all_devices_in_sync", "(", ")", "for", "device", "in", "self", ".", "devices", ":", "self", ".", "_delete_device_from_device_group", "(", "device", ")", "self", ".", "_sync_to_group", "(", "device"...
Teardown device service cluster group.
[ "Teardown", "device", "service", "cluster", "group", "." ]
7e67d5acd757a60e3d5f8c88c534bd72208f5494
https://github.com/F5Networks/f5-common-python/blob/7e67d5acd757a60e3d5f8c88c534bd72208f5494/f5/multi_device/device_group.py#L174-L186
train
F5Networks/f5-common-python
f5/multi_device/device_group.py
DeviceGroup._get_device_group
def _get_device_group(self, device): '''Get the device group through a device. :param device: bigip object -- device :returns: tm.cm.device_groups.device_group object ''' return device.tm.cm.device_groups.device_group.load( name=self.name, partition=self.partition ...
python
def _get_device_group(self, device): '''Get the device group through a device. :param device: bigip object -- device :returns: tm.cm.device_groups.device_group object ''' return device.tm.cm.device_groups.device_group.load( name=self.name, partition=self.partition ...
[ "def", "_get_device_group", "(", "self", ",", "device", ")", ":", "return", "device", ".", "tm", ".", "cm", ".", "device_groups", ".", "device_group", ".", "load", "(", "name", "=", "self", ".", "name", ",", "partition", "=", "self", ".", "partition", ...
Get the device group through a device. :param device: bigip object -- device :returns: tm.cm.device_groups.device_group object
[ "Get", "the", "device", "group", "through", "a", "device", "." ]
7e67d5acd757a60e3d5f8c88c534bd72208f5494
https://github.com/F5Networks/f5-common-python/blob/7e67d5acd757a60e3d5f8c88c534bd72208f5494/f5/multi_device/device_group.py#L202-L211
train
F5Networks/f5-common-python
f5/multi_device/device_group.py
DeviceGroup._add_device_to_device_group
def _add_device_to_device_group(self, device): '''Add device to device service cluster group. :param device: bigip object -- device to add to group ''' device_name = get_device_info(device).name dg = pollster(self._get_device_group)(device) dg.devices_s.devices.create(n...
python
def _add_device_to_device_group(self, device): '''Add device to device service cluster group. :param device: bigip object -- device to add to group ''' device_name = get_device_info(device).name dg = pollster(self._get_device_group)(device) dg.devices_s.devices.create(n...
[ "def", "_add_device_to_device_group", "(", "self", ",", "device", ")", ":", "device_name", "=", "get_device_info", "(", "device", ")", ".", "name", "dg", "=", "pollster", "(", "self", ".", "_get_device_group", ")", "(", "device", ")", "dg", ".", "devices_s",...
Add device to device service cluster group. :param device: bigip object -- device to add to group
[ "Add", "device", "to", "device", "service", "cluster", "group", "." ]
7e67d5acd757a60e3d5f8c88c534bd72208f5494
https://github.com/F5Networks/f5-common-python/blob/7e67d5acd757a60e3d5f8c88c534bd72208f5494/f5/multi_device/device_group.py#L224-L233
train
F5Networks/f5-common-python
f5/multi_device/device_group.py
DeviceGroup._check_device_exists_in_device_group
def _check_device_exists_in_device_group(self, device_name): '''Check whether a device exists in the device group :param device: ManagementRoot object -- device to look for ''' dg = self._get_device_group(self.devices[0]) dg.devices_s.devices.load(name=device_name, partition=se...
python
def _check_device_exists_in_device_group(self, device_name): '''Check whether a device exists in the device group :param device: ManagementRoot object -- device to look for ''' dg = self._get_device_group(self.devices[0]) dg.devices_s.devices.load(name=device_name, partition=se...
[ "def", "_check_device_exists_in_device_group", "(", "self", ",", "device_name", ")", ":", "dg", "=", "self", ".", "_get_device_group", "(", "self", ".", "devices", "[", "0", "]", ")", "dg", ".", "devices_s", ".", "devices", ".", "load", "(", "name", "=", ...
Check whether a device exists in the device group :param device: ManagementRoot object -- device to look for
[ "Check", "whether", "a", "device", "exists", "in", "the", "device", "group" ]
7e67d5acd757a60e3d5f8c88c534bd72208f5494
https://github.com/F5Networks/f5-common-python/blob/7e67d5acd757a60e3d5f8c88c534bd72208f5494/f5/multi_device/device_group.py#L235-L242
train
F5Networks/f5-common-python
f5/multi_device/device_group.py
DeviceGroup._delete_device_from_device_group
def _delete_device_from_device_group(self, device): '''Remove device from device service cluster group. :param device: ManagementRoot object -- device to delete from group ''' device_name = get_device_info(device).name dg = pollster(self._get_device_group)(device) devic...
python
def _delete_device_from_device_group(self, device): '''Remove device from device service cluster group. :param device: ManagementRoot object -- device to delete from group ''' device_name = get_device_info(device).name dg = pollster(self._get_device_group)(device) devic...
[ "def", "_delete_device_from_device_group", "(", "self", ",", "device", ")", ":", "device_name", "=", "get_device_info", "(", "device", ")", ".", "name", "dg", "=", "pollster", "(", "self", ".", "_get_device_group", ")", "(", "device", ")", "device_to_remove", ...
Remove device from device service cluster group. :param device: ManagementRoot object -- device to delete from group
[ "Remove", "device", "from", "device", "service", "cluster", "group", "." ]
7e67d5acd757a60e3d5f8c88c534bd72208f5494
https://github.com/F5Networks/f5-common-python/blob/7e67d5acd757a60e3d5f8c88c534bd72208f5494/f5/multi_device/device_group.py#L244-L255
train
F5Networks/f5-common-python
f5/multi_device/device_group.py
DeviceGroup._ensure_device_active
def _ensure_device_active(self, device): '''Ensure a single device is in an active state :param device: ManagementRoot object -- device to inspect :raises: UnexpectedClusterState ''' act = device.tm.cm.devices.device.load( name=get_device_info(device).name, ...
python
def _ensure_device_active(self, device): '''Ensure a single device is in an active state :param device: ManagementRoot object -- device to inspect :raises: UnexpectedClusterState ''' act = device.tm.cm.devices.device.load( name=get_device_info(device).name, ...
[ "def", "_ensure_device_active", "(", "self", ",", "device", ")", ":", "act", "=", "device", ".", "tm", ".", "cm", ".", "devices", ".", "device", ".", "load", "(", "name", "=", "get_device_info", "(", "device", ")", ".", "name", ",", "partition", "=", ...
Ensure a single device is in an active state :param device: ManagementRoot object -- device to inspect :raises: UnexpectedClusterState
[ "Ensure", "a", "single", "device", "is", "in", "an", "active", "state" ]
7e67d5acd757a60e3d5f8c88c534bd72208f5494
https://github.com/F5Networks/f5-common-python/blob/7e67d5acd757a60e3d5f8c88c534bd72208f5494/f5/multi_device/device_group.py#L257-L270
train
F5Networks/f5-common-python
f5/multi_device/device_group.py
DeviceGroup._sync_to_group
def _sync_to_group(self, device): '''Sync the device to the cluster group :param device: bigip object -- device to sync to group ''' config_sync_cmd = 'config-sync to-group %s' % self.name device.tm.cm.exec_cmd('run', utilCmdArgs=config_sync_cmd)
python
def _sync_to_group(self, device): '''Sync the device to the cluster group :param device: bigip object -- device to sync to group ''' config_sync_cmd = 'config-sync to-group %s' % self.name device.tm.cm.exec_cmd('run', utilCmdArgs=config_sync_cmd)
[ "def", "_sync_to_group", "(", "self", ",", "device", ")", ":", "config_sync_cmd", "=", "'config-sync to-group %s'", "%", "self", ".", "name", "device", ".", "tm", ".", "cm", ".", "exec_cmd", "(", "'run'", ",", "utilCmdArgs", "=", "config_sync_cmd", ")" ]
Sync the device to the cluster group :param device: bigip object -- device to sync to group
[ "Sync", "the", "device", "to", "the", "cluster", "group" ]
7e67d5acd757a60e3d5f8c88c534bd72208f5494
https://github.com/F5Networks/f5-common-python/blob/7e67d5acd757a60e3d5f8c88c534bd72208f5494/f5/multi_device/device_group.py#L272-L279
train
F5Networks/f5-common-python
f5/multi_device/device_group.py
DeviceGroup._check_all_devices_in_sync
def _check_all_devices_in_sync(self): '''Wait until all devices have failover status of 'In Sync'. :raises: UnexpectedClusterState ''' if len(self._get_devices_by_failover_status('In Sync')) != \ len(self.devices): msg = "Expected all devices in group to hav...
python
def _check_all_devices_in_sync(self): '''Wait until all devices have failover status of 'In Sync'. :raises: UnexpectedClusterState ''' if len(self._get_devices_by_failover_status('In Sync')) != \ len(self.devices): msg = "Expected all devices in group to hav...
[ "def", "_check_all_devices_in_sync", "(", "self", ")", ":", "if", "len", "(", "self", ".", "_get_devices_by_failover_status", "(", "'In Sync'", ")", ")", "!=", "len", "(", "self", ".", "devices", ")", ":", "msg", "=", "\"Expected all devices in group to have 'In S...
Wait until all devices have failover status of 'In Sync'. :raises: UnexpectedClusterState
[ "Wait", "until", "all", "devices", "have", "failover", "status", "of", "In", "Sync", "." ]
7e67d5acd757a60e3d5f8c88c534bd72208f5494
https://github.com/F5Networks/f5-common-python/blob/7e67d5acd757a60e3d5f8c88c534bd72208f5494/f5/multi_device/device_group.py#L287-L296
train
F5Networks/f5-common-python
f5/multi_device/device_group.py
DeviceGroup._get_devices_by_failover_status
def _get_devices_by_failover_status(self, status): '''Get a list of bigips by failover status. :param status: str -- status to filter the returned list of devices :returns: list -- list of devices that have the given status ''' devices_with_status = [] for device in sel...
python
def _get_devices_by_failover_status(self, status): '''Get a list of bigips by failover status. :param status: str -- status to filter the returned list of devices :returns: list -- list of devices that have the given status ''' devices_with_status = [] for device in sel...
[ "def", "_get_devices_by_failover_status", "(", "self", ",", "status", ")", ":", "devices_with_status", "=", "[", "]", "for", "device", "in", "self", ".", "devices", ":", "if", "(", "self", ".", "_check_device_failover_status", "(", "device", ",", "status", ")"...
Get a list of bigips by failover status. :param status: str -- status to filter the returned list of devices :returns: list -- list of devices that have the given status
[ "Get", "a", "list", "of", "bigips", "by", "failover", "status", "." ]
7e67d5acd757a60e3d5f8c88c534bd72208f5494
https://github.com/F5Networks/f5-common-python/blob/7e67d5acd757a60e3d5f8c88c534bd72208f5494/f5/multi_device/device_group.py#L298-L309
train
F5Networks/f5-common-python
f5/multi_device/device_group.py
DeviceGroup._check_device_failover_status
def _check_device_failover_status(self, device, status): '''Determine if a device has a specific failover status. :param status: str -- status to check against :returns: bool -- True is it has status, False otherwise ''' sync_status = device.tm.cm.sync_status sync_statu...
python
def _check_device_failover_status(self, device, status): '''Determine if a device has a specific failover status. :param status: str -- status to check against :returns: bool -- True is it has status, False otherwise ''' sync_status = device.tm.cm.sync_status sync_statu...
[ "def", "_check_device_failover_status", "(", "self", ",", "device", ",", "status", ")", ":", "sync_status", "=", "device", ".", "tm", ".", "cm", ".", "sync_status", "sync_status", ".", "refresh", "(", ")", "current_status", "=", "(", "sync_status", ".", "ent...
Determine if a device has a specific failover status. :param status: str -- status to check against :returns: bool -- True is it has status, False otherwise
[ "Determine", "if", "a", "device", "has", "a", "specific", "failover", "status", "." ]
7e67d5acd757a60e3d5f8c88c534bd72208f5494
https://github.com/F5Networks/f5-common-python/blob/7e67d5acd757a60e3d5f8c88c534bd72208f5494/f5/multi_device/device_group.py#L311-L325
train
F5Networks/f5-common-python
f5/multi_device/device_group.py
DeviceGroup._get_devices_by_activation_state
def _get_devices_by_activation_state(self, state): '''Get a list of bigips by activation statue. :param state: str -- state to filter the returned list of devices :returns: list -- list of devices that are in the given state ''' devices_with_state = [] for device in sel...
python
def _get_devices_by_activation_state(self, state): '''Get a list of bigips by activation statue. :param state: str -- state to filter the returned list of devices :returns: list -- list of devices that are in the given state ''' devices_with_state = [] for device in sel...
[ "def", "_get_devices_by_activation_state", "(", "self", ",", "state", ")", ":", "devices_with_state", "=", "[", "]", "for", "device", "in", "self", ".", "devices", ":", "act", "=", "device", ".", "tm", ".", "cm", ".", "devices", ".", "device", ".", "load...
Get a list of bigips by activation statue. :param state: str -- state to filter the returned list of devices :returns: list -- list of devices that are in the given state
[ "Get", "a", "list", "of", "bigips", "by", "activation", "statue", "." ]
7e67d5acd757a60e3d5f8c88c534bd72208f5494
https://github.com/F5Networks/f5-common-python/blob/7e67d5acd757a60e3d5f8c88c534bd72208f5494/f5/multi_device/device_group.py#L327-L342
train
F5Networks/f5-common-python
f5/bigip/tm/asm/policies/__init__.py
Policy._set_attr_reg
def _set_attr_reg(self): """Helper method. Appends correct attribute registry, depending on TMOS version """ tmos_v = self._meta_data['bigip']._meta_data['tmos_version'] attributes = self._meta_data['attribute_registry'] v12kind = 'tm:asm:policies:blocking-settings:bloc...
python
def _set_attr_reg(self): """Helper method. Appends correct attribute registry, depending on TMOS version """ tmos_v = self._meta_data['bigip']._meta_data['tmos_version'] attributes = self._meta_data['attribute_registry'] v12kind = 'tm:asm:policies:blocking-settings:bloc...
[ "def", "_set_attr_reg", "(", "self", ")", ":", "tmos_v", "=", "self", ".", "_meta_data", "[", "'bigip'", "]", ".", "_meta_data", "[", "'tmos_version'", "]", "attributes", "=", "self", ".", "_meta_data", "[", "'attribute_registry'", "]", "v12kind", "=", "'tm:...
Helper method. Appends correct attribute registry, depending on TMOS version
[ "Helper", "method", "." ]
7e67d5acd757a60e3d5f8c88c534bd72208f5494
https://github.com/F5Networks/f5-common-python/blob/7e67d5acd757a60e3d5f8c88c534bd72208f5494/f5/bigip/tm/asm/policies/__init__.py#L132-L149
train
F5Networks/f5-common-python
f5/bigip/tm/asm/policies/__init__.py
Policy.create
def create(self, **kwargs): """Custom creation logic to handle edge cases This shouldn't be needed, but ASM has a tendency to raise various errors that are painful to handle from a customer point-of-view The error itself are described in their exception handler To address thes...
python
def create(self, **kwargs): """Custom creation logic to handle edge cases This shouldn't be needed, but ASM has a tendency to raise various errors that are painful to handle from a customer point-of-view The error itself are described in their exception handler To address thes...
[ "def", "create", "(", "self", ",", "**", "kwargs", ")", ":", "for", "x", "in", "range", "(", "0", ",", "30", ")", ":", "try", ":", "return", "self", ".", "_create", "(", "**", "kwargs", ")", "except", "iControlUnexpectedHTTPError", "as", "ex", ":", ...
Custom creation logic to handle edge cases This shouldn't be needed, but ASM has a tendency to raise various errors that are painful to handle from a customer point-of-view The error itself are described in their exception handler To address these failure, we try a number of exception...
[ "Custom", "creation", "logic", "to", "handle", "edge", "cases" ]
7e67d5acd757a60e3d5f8c88c534bd72208f5494
https://github.com/F5Networks/f5-common-python/blob/7e67d5acd757a60e3d5f8c88c534bd72208f5494/f5/bigip/tm/asm/policies/__init__.py#L151-L172
train
F5Networks/f5-common-python
f5/bigip/tm/asm/policies/__init__.py
Policy.delete
def delete(self, **kwargs): """Custom deletion logic to handle edge cases This shouldn't be needed, but ASM has a tendency to raise various errors that are painful to handle from a customer point-of-view The error itself are described in their exception handler To address thes...
python
def delete(self, **kwargs): """Custom deletion logic to handle edge cases This shouldn't be needed, but ASM has a tendency to raise various errors that are painful to handle from a customer point-of-view The error itself are described in their exception handler To address thes...
[ "def", "delete", "(", "self", ",", "**", "kwargs", ")", ":", "for", "x", "in", "range", "(", "0", ",", "30", ")", ":", "try", ":", "return", "self", ".", "_delete", "(", "**", "kwargs", ")", "except", "iControlUnexpectedHTTPError", "as", "ex", ":", ...
Custom deletion logic to handle edge cases This shouldn't be needed, but ASM has a tendency to raise various errors that are painful to handle from a customer point-of-view The error itself are described in their exception handler To address these failure, we try a number of exception...
[ "Custom", "deletion", "logic", "to", "handle", "edge", "cases" ]
7e67d5acd757a60e3d5f8c88c534bd72208f5494
https://github.com/F5Networks/f5-common-python/blob/7e67d5acd757a60e3d5f8c88c534bd72208f5494/f5/bigip/tm/asm/policies/__init__.py#L174-L195
train
laurencium/Causalinference
causalinference/causal.py
CausalModel.reset
def reset(self): """ Reinitializes data to original inputs, and drops any estimated results. """ Y, D, X = self.old_data['Y'], self.old_data['D'], self.old_data['X'] self.raw_data = Data(Y, D, X) self.summary_stats = Summary(self.raw_data) self.propensity = None self.cutoff = None self.blocks = No...
python
def reset(self): """ Reinitializes data to original inputs, and drops any estimated results. """ Y, D, X = self.old_data['Y'], self.old_data['D'], self.old_data['X'] self.raw_data = Data(Y, D, X) self.summary_stats = Summary(self.raw_data) self.propensity = None self.cutoff = None self.blocks = No...
[ "def", "reset", "(", "self", ")", ":", "Y", ",", "D", ",", "X", "=", "self", ".", "old_data", "[", "'Y'", "]", ",", "self", ".", "old_data", "[", "'D'", "]", ",", "self", ".", "old_data", "[", "'X'", "]", "self", ".", "raw_data", "=", "Data", ...
Reinitializes data to original inputs, and drops any estimated results.
[ "Reinitializes", "data", "to", "original", "inputs", "and", "drops", "any", "estimated", "results", "." ]
3b20ae0560c711628fba47975180c8484d8aa3e7
https://github.com/laurencium/Causalinference/blob/3b20ae0560c711628fba47975180c8484d8aa3e7/causalinference/causal.py#L21-L35
train
laurencium/Causalinference
causalinference/causal.py
CausalModel.est_propensity
def est_propensity(self, lin='all', qua=None): """ Estimates the propensity scores given list of covariates to include linearly or quadratically. The propensity score is the conditional probability of receiving the treatment given the observed covariates. Estimation is done via a logistic regression. P...
python
def est_propensity(self, lin='all', qua=None): """ Estimates the propensity scores given list of covariates to include linearly or quadratically. The propensity score is the conditional probability of receiving the treatment given the observed covariates. Estimation is done via a logistic regression. P...
[ "def", "est_propensity", "(", "self", ",", "lin", "=", "'all'", ",", "qua", "=", "None", ")", ":", "lin_terms", "=", "parse_lin_terms", "(", "self", ".", "raw_data", "[", "'K'", "]", ",", "lin", ")", "qua_terms", "=", "parse_qua_terms", "(", "self", "....
Estimates the propensity scores given list of covariates to include linearly or quadratically. The propensity score is the conditional probability of receiving the treatment given the observed covariates. Estimation is done via a logistic regression. Parameters ---------- lin: string or list, optional ...
[ "Estimates", "the", "propensity", "scores", "given", "list", "of", "covariates", "to", "include", "linearly", "or", "quadratically", "." ]
3b20ae0560c711628fba47975180c8484d8aa3e7
https://github.com/laurencium/Causalinference/blob/3b20ae0560c711628fba47975180c8484d8aa3e7/causalinference/causal.py#L38-L69
train
laurencium/Causalinference
causalinference/causal.py
CausalModel.trim
def trim(self): """ Trims data based on propensity score to create a subsample with better covariate balance. The default cutoff value is set to 0.1. To set a custom cutoff value, modify the object attribute named cutoff directly. This method should only be executed after the propensity score has bee...
python
def trim(self): """ Trims data based on propensity score to create a subsample with better covariate balance. The default cutoff value is set to 0.1. To set a custom cutoff value, modify the object attribute named cutoff directly. This method should only be executed after the propensity score has bee...
[ "def", "trim", "(", "self", ")", ":", "if", "0", "<", "self", ".", "cutoff", "<=", "0.5", ":", "pscore", "=", "self", ".", "raw_data", "[", "'pscore'", "]", "keep", "=", "(", "pscore", ">=", "self", ".", "cutoff", ")", "&", "(", "pscore", "<=", ...
Trims data based on propensity score to create a subsample with better covariate balance. The default cutoff value is set to 0.1. To set a custom cutoff value, modify the object attribute named cutoff directly. This method should only be executed after the propensity score has been estimated.
[ "Trims", "data", "based", "on", "propensity", "score", "to", "create", "a", "subsample", "with", "better", "covariate", "balance", ".", "The", "default", "cutoff", "value", "is", "set", "to", "0", ".", "1", ".", "To", "set", "a", "custom", "cutoff", "val...
3b20ae0560c711628fba47975180c8484d8aa3e7
https://github.com/laurencium/Causalinference/blob/3b20ae0560c711628fba47975180c8484d8aa3e7/causalinference/causal.py#L118-L145
train
laurencium/Causalinference
causalinference/causal.py
CausalModel.stratify
def stratify(self): """ Stratifies the sample based on propensity score. By default the sample is divided into five equal-sized bins. The number of bins can be set by modifying the object attribute named blocks. Alternatively, custom-sized bins can be created by setting blocks equal to a sorted list of ...
python
def stratify(self): """ Stratifies the sample based on propensity score. By default the sample is divided into five equal-sized bins. The number of bins can be set by modifying the object attribute named blocks. Alternatively, custom-sized bins can be created by setting blocks equal to a sorted list of ...
[ "def", "stratify", "(", "self", ")", ":", "Y", ",", "D", ",", "X", "=", "self", ".", "raw_data", "[", "'Y'", "]", ",", "self", ".", "raw_data", "[", "'D'", "]", ",", "self", ".", "raw_data", "[", "'X'", "]", "pscore", "=", "self", ".", "raw_dat...
Stratifies the sample based on propensity score. By default the sample is divided into five equal-sized bins. The number of bins can be set by modifying the object attribute named blocks. Alternatively, custom-sized bins can be created by setting blocks equal to a sorted list of numbers between 0 and 1 ind...
[ "Stratifies", "the", "sample", "based", "on", "propensity", "score", ".", "By", "default", "the", "sample", "is", "divided", "into", "five", "equal", "-", "sized", "bins", ".", "The", "number", "of", "bins", "can", "be", "set", "by", "modifying", "the", ...
3b20ae0560c711628fba47975180c8484d8aa3e7
https://github.com/laurencium/Causalinference/blob/3b20ae0560c711628fba47975180c8484d8aa3e7/causalinference/causal.py#L171-L199
train
laurencium/Causalinference
causalinference/causal.py
CausalModel.est_via_matching
def est_via_matching(self, weights='inv', matches=1, bias_adj=False): """ Estimates average treatment effects using nearest- neighborhood matching. Matching is done with replacement. Method supports multiple matching. Correcting bias that arise due to imperfect matches is also supported. For details on me...
python
def est_via_matching(self, weights='inv', matches=1, bias_adj=False): """ Estimates average treatment effects using nearest- neighborhood matching. Matching is done with replacement. Method supports multiple matching. Correcting bias that arise due to imperfect matches is also supported. For details on me...
[ "def", "est_via_matching", "(", "self", ",", "weights", "=", "'inv'", ",", "matches", "=", "1", ",", "bias_adj", "=", "False", ")", ":", "X", ",", "K", "=", "self", ".", "raw_data", "[", "'X'", "]", ",", "self", ".", "raw_data", "[", "'K'", "]", ...
Estimates average treatment effects using nearest- neighborhood matching. Matching is done with replacement. Method supports multiple matching. Correcting bias that arise due to imperfect matches is also supported. For details on methodology, see [1]_. Parameters ---------- weights: str or positive defi...
[ "Estimates", "average", "treatment", "effects", "using", "nearest", "-", "neighborhood", "matching", "." ]
3b20ae0560c711628fba47975180c8484d8aa3e7
https://github.com/laurencium/Causalinference/blob/3b20ae0560c711628fba47975180c8484d8aa3e7/causalinference/causal.py#L285-L332
train
laurencium/Causalinference
causalinference/utils/tools.py
random_data
def random_data(N=5000, K=3, unobservables=False, **kwargs): """ Function that generates data according to one of two simple models that satisfies the unconfoundedness assumption. The covariates and error terms are generated according to X ~ N(mu, Sigma), epsilon ~ N(0, Gamma). The counterfactual outcomes are...
python
def random_data(N=5000, K=3, unobservables=False, **kwargs): """ Function that generates data according to one of two simple models that satisfies the unconfoundedness assumption. The covariates and error terms are generated according to X ~ N(mu, Sigma), epsilon ~ N(0, Gamma). The counterfactual outcomes are...
[ "def", "random_data", "(", "N", "=", "5000", ",", "K", "=", "3", ",", "unobservables", "=", "False", ",", "**", "kwargs", ")", ":", "mu", "=", "kwargs", ".", "get", "(", "'mu'", ",", "np", ".", "zeros", "(", "K", ")", ")", "beta", "=", "kwargs"...
Function that generates data according to one of two simple models that satisfies the unconfoundedness assumption. The covariates and error terms are generated according to X ~ N(mu, Sigma), epsilon ~ N(0, Gamma). The counterfactual outcomes are generated by Y0 = X*beta + epsilon_0, Y1 = delta + X*(beta+thet...
[ "Function", "that", "generates", "data", "according", "to", "one", "of", "two", "simple", "models", "that", "satisfies", "the", "unconfoundedness", "assumption", "." ]
3b20ae0560c711628fba47975180c8484d8aa3e7
https://github.com/laurencium/Causalinference/blob/3b20ae0560c711628fba47975180c8484d8aa3e7/causalinference/utils/tools.py#L54-L113
train
laurencium/Causalinference
causalinference/core/summary.py
Summary._summarize_pscore
def _summarize_pscore(self, pscore_c, pscore_t): """ Called by Strata class during initialization. """ self._dict['p_min'] = min(pscore_c.min(), pscore_t.min()) self._dict['p_max'] = max(pscore_c.max(), pscore_t.max()) self._dict['p_c_mean'] = pscore_c.mean() self._dict['p_t_mean'] = pscore_t.mean()
python
def _summarize_pscore(self, pscore_c, pscore_t): """ Called by Strata class during initialization. """ self._dict['p_min'] = min(pscore_c.min(), pscore_t.min()) self._dict['p_max'] = max(pscore_c.max(), pscore_t.max()) self._dict['p_c_mean'] = pscore_c.mean() self._dict['p_t_mean'] = pscore_t.mean()
[ "def", "_summarize_pscore", "(", "self", ",", "pscore_c", ",", "pscore_t", ")", ":", "self", ".", "_dict", "[", "'p_min'", "]", "=", "min", "(", "pscore_c", ".", "min", "(", ")", ",", "pscore_t", ".", "min", "(", ")", ")", "self", ".", "_dict", "["...
Called by Strata class during initialization.
[ "Called", "by", "Strata", "class", "during", "initialization", "." ]
3b20ae0560c711628fba47975180c8484d8aa3e7
https://github.com/laurencium/Causalinference/blob/3b20ae0560c711628fba47975180c8484d8aa3e7/causalinference/core/summary.py#L40-L49
train
yoavaviram/python-amazon-simple-product-api
amazon/api.py
AmazonAPI.lookup_bulk
def lookup_bulk(self, ResponseGroup="Large", **kwargs): """Lookup Amazon Products in bulk. Returns all products matching requested ASINs, ignoring invalid entries. :return: A list of :class:`~.AmazonProduct` instances. """ response = self.api.ItemLookup(Res...
python
def lookup_bulk(self, ResponseGroup="Large", **kwargs): """Lookup Amazon Products in bulk. Returns all products matching requested ASINs, ignoring invalid entries. :return: A list of :class:`~.AmazonProduct` instances. """ response = self.api.ItemLookup(Res...
[ "def", "lookup_bulk", "(", "self", ",", "ResponseGroup", "=", "\"Large\"", ",", "**", "kwargs", ")", ":", "response", "=", "self", ".", "api", ".", "ItemLookup", "(", "ResponseGroup", "=", "ResponseGroup", ",", "**", "kwargs", ")", "root", "=", "objectify"...
Lookup Amazon Products in bulk. Returns all products matching requested ASINs, ignoring invalid entries. :return: A list of :class:`~.AmazonProduct` instances.
[ "Lookup", "Amazon", "Products", "in", "bulk", "." ]
f1cb0e209145fcfac9444e4c733dd19deb59d31a
https://github.com/yoavaviram/python-amazon-simple-product-api/blob/f1cb0e209145fcfac9444e4c733dd19deb59d31a/amazon/api.py#L200-L219
train
yoavaviram/python-amazon-simple-product-api
amazon/api.py
AmazonAPI.similarity_lookup
def similarity_lookup(self, ResponseGroup="Large", **kwargs): """Similarty Lookup. Returns up to ten products that are similar to all items specified in the request. Example: >>> api.similarity_lookup(ItemId='B002L3XLBO,B000LQTBKI') """ response = self.api.S...
python
def similarity_lookup(self, ResponseGroup="Large", **kwargs): """Similarty Lookup. Returns up to ten products that are similar to all items specified in the request. Example: >>> api.similarity_lookup(ItemId='B002L3XLBO,B000LQTBKI') """ response = self.api.S...
[ "def", "similarity_lookup", "(", "self", ",", "ResponseGroup", "=", "\"Large\"", ",", "**", "kwargs", ")", ":", "response", "=", "self", ".", "api", ".", "SimilarityLookup", "(", "ResponseGroup", "=", "ResponseGroup", ",", "**", "kwargs", ")", "root", "=", ...
Similarty Lookup. Returns up to ten products that are similar to all items specified in the request. Example: >>> api.similarity_lookup(ItemId='B002L3XLBO,B000LQTBKI')
[ "Similarty", "Lookup", "." ]
f1cb0e209145fcfac9444e4c733dd19deb59d31a
https://github.com/yoavaviram/python-amazon-simple-product-api/blob/f1cb0e209145fcfac9444e4c733dd19deb59d31a/amazon/api.py#L221-L247
train
yoavaviram/python-amazon-simple-product-api
amazon/api.py
AmazonAPI.browse_node_lookup
def browse_node_lookup(self, ResponseGroup="BrowseNodeInfo", **kwargs): """Browse Node Lookup. Returns the specified browse node's name, children, and ancestors. Example: >>> api.browse_node_lookup(BrowseNodeId='163357') """ response = self.api.BrowseNodeLookup( ...
python
def browse_node_lookup(self, ResponseGroup="BrowseNodeInfo", **kwargs): """Browse Node Lookup. Returns the specified browse node's name, children, and ancestors. Example: >>> api.browse_node_lookup(BrowseNodeId='163357') """ response = self.api.BrowseNodeLookup( ...
[ "def", "browse_node_lookup", "(", "self", ",", "ResponseGroup", "=", "\"BrowseNodeInfo\"", ",", "**", "kwargs", ")", ":", "response", "=", "self", ".", "api", ".", "BrowseNodeLookup", "(", "ResponseGroup", "=", "ResponseGroup", ",", "**", "kwargs", ")", "root"...
Browse Node Lookup. Returns the specified browse node's name, children, and ancestors. Example: >>> api.browse_node_lookup(BrowseNodeId='163357')
[ "Browse", "Node", "Lookup", "." ]
f1cb0e209145fcfac9444e4c733dd19deb59d31a
https://github.com/yoavaviram/python-amazon-simple-product-api/blob/f1cb0e209145fcfac9444e4c733dd19deb59d31a/amazon/api.py#L249-L265
train
yoavaviram/python-amazon-simple-product-api
amazon/api.py
AmazonAPI.search_n
def search_n(self, n, **kwargs): """Search and return first N results.. :param n: An integer specifying the number of results to return. :return: A list of :class:`~.AmazonProduct`. """ region = kwargs.get('region', self.region) kwargs.update({'re...
python
def search_n(self, n, **kwargs): """Search and return first N results.. :param n: An integer specifying the number of results to return. :return: A list of :class:`~.AmazonProduct`. """ region = kwargs.get('region', self.region) kwargs.update({'re...
[ "def", "search_n", "(", "self", ",", "n", ",", "**", "kwargs", ")", ":", "region", "=", "kwargs", ".", "get", "(", "'region'", ",", "self", ".", "region", ")", "kwargs", ".", "update", "(", "{", "'region'", ":", "region", "}", ")", "items", "=", ...
Search and return first N results.. :param n: An integer specifying the number of results to return. :return: A list of :class:`~.AmazonProduct`.
[ "Search", "and", "return", "first", "N", "results", ".." ]
f1cb0e209145fcfac9444e4c733dd19deb59d31a
https://github.com/yoavaviram/python-amazon-simple-product-api/blob/f1cb0e209145fcfac9444e4c733dd19deb59d31a/amazon/api.py#L277-L288
train
yoavaviram/python-amazon-simple-product-api
amazon/api.py
LXMLWrapper._safe_get_element_date
def _safe_get_element_date(self, path, root=None): """Safe get elemnent date. Get element as datetime.date or None, :param root: Lxml element. :param path: String path (i.e. 'Items.Item.Offers.Offer'). :return: datetime.date or None. "...
python
def _safe_get_element_date(self, path, root=None): """Safe get elemnent date. Get element as datetime.date or None, :param root: Lxml element. :param path: String path (i.e. 'Items.Item.Offers.Offer'). :return: datetime.date or None. "...
[ "def", "_safe_get_element_date", "(", "self", ",", "path", ",", "root", "=", "None", ")", ":", "value", "=", "self", ".", "_safe_get_element_text", "(", "path", "=", "path", ",", "root", "=", "root", ")", "if", "value", "is", "not", "None", ":", "try",...
Safe get elemnent date. Get element as datetime.date or None, :param root: Lxml element. :param path: String path (i.e. 'Items.Item.Offers.Offer'). :return: datetime.date or None.
[ "Safe", "get", "elemnent", "date", "." ]
f1cb0e209145fcfac9444e4c733dd19deb59d31a
https://github.com/yoavaviram/python-amazon-simple-product-api/blob/f1cb0e209145fcfac9444e4c733dd19deb59d31a/amazon/api.py#L490-L510
train
yoavaviram/python-amazon-simple-product-api
amazon/api.py
AmazonSearch.iterate_pages
def iterate_pages(self): """Iterate Pages. A generator which iterates over all pages. Keep in mind that Amazon limits the number of pages it makes available. :return: Yields lxml root elements. """ try: while not self.is_last_page: ...
python
def iterate_pages(self): """Iterate Pages. A generator which iterates over all pages. Keep in mind that Amazon limits the number of pages it makes available. :return: Yields lxml root elements. """ try: while not self.is_last_page: ...
[ "def", "iterate_pages", "(", "self", ")", ":", "try", ":", "while", "not", "self", ".", "is_last_page", ":", "self", ".", "current_page", "+=", "1", "yield", "self", ".", "_query", "(", "ItemPage", "=", "self", ".", "current_page", ",", "**", "self", "...
Iterate Pages. A generator which iterates over all pages. Keep in mind that Amazon limits the number of pages it makes available. :return: Yields lxml root elements.
[ "Iterate", "Pages", "." ]
f1cb0e209145fcfac9444e4c733dd19deb59d31a
https://github.com/yoavaviram/python-amazon-simple-product-api/blob/f1cb0e209145fcfac9444e4c733dd19deb59d31a/amazon/api.py#L549-L563
train
yoavaviram/python-amazon-simple-product-api
amazon/api.py
AmazonBrowseNode.ancestor
def ancestor(self): """This browse node's immediate ancestor in the browse node tree. :return: The ancestor as an :class:`~.AmazonBrowseNode`, or None. """ ancestors = getattr(self.parsed_response, 'Ancestors', None) if hasattr(ancestors, 'BrowseNode'): r...
python
def ancestor(self): """This browse node's immediate ancestor in the browse node tree. :return: The ancestor as an :class:`~.AmazonBrowseNode`, or None. """ ancestors = getattr(self.parsed_response, 'Ancestors', None) if hasattr(ancestors, 'BrowseNode'): r...
[ "def", "ancestor", "(", "self", ")", ":", "ancestors", "=", "getattr", "(", "self", ".", "parsed_response", ",", "'Ancestors'", ",", "None", ")", "if", "hasattr", "(", "ancestors", ",", "'BrowseNode'", ")", ":", "return", "AmazonBrowseNode", "(", "ancestors"...
This browse node's immediate ancestor in the browse node tree. :return: The ancestor as an :class:`~.AmazonBrowseNode`, or None.
[ "This", "browse", "node", "s", "immediate", "ancestor", "in", "the", "browse", "node", "tree", "." ]
f1cb0e209145fcfac9444e4c733dd19deb59d31a
https://github.com/yoavaviram/python-amazon-simple-product-api/blob/f1cb0e209145fcfac9444e4c733dd19deb59d31a/amazon/api.py#L624-L633
train
yoavaviram/python-amazon-simple-product-api
amazon/api.py
AmazonBrowseNode.ancestors
def ancestors(self): """A list of this browse node's ancestors in the browse node tree. :return: List of :class:`~.AmazonBrowseNode` objects. """ ancestors = [] node = self.ancestor while node is not None: ancestors.append(node) node =...
python
def ancestors(self): """A list of this browse node's ancestors in the browse node tree. :return: List of :class:`~.AmazonBrowseNode` objects. """ ancestors = [] node = self.ancestor while node is not None: ancestors.append(node) node =...
[ "def", "ancestors", "(", "self", ")", ":", "ancestors", "=", "[", "]", "node", "=", "self", ".", "ancestor", "while", "node", "is", "not", "None", ":", "ancestors", ".", "append", "(", "node", ")", "node", "=", "node", ".", "ancestor", "return", "anc...
A list of this browse node's ancestors in the browse node tree. :return: List of :class:`~.AmazonBrowseNode` objects.
[ "A", "list", "of", "this", "browse", "node", "s", "ancestors", "in", "the", "browse", "node", "tree", "." ]
f1cb0e209145fcfac9444e4c733dd19deb59d31a
https://github.com/yoavaviram/python-amazon-simple-product-api/blob/f1cb0e209145fcfac9444e4c733dd19deb59d31a/amazon/api.py#L636-L647
train
yoavaviram/python-amazon-simple-product-api
amazon/api.py
AmazonBrowseNode.children
def children(self): """This browse node's children in the browse node tree. :return: A list of this browse node's children in the browse node tree. """ children = [] child_nodes = getattr(self.parsed_response, 'Children') for child in getattr(child_nodes, 'BrowseNode', []): ...
python
def children(self): """This browse node's children in the browse node tree. :return: A list of this browse node's children in the browse node tree. """ children = [] child_nodes = getattr(self.parsed_response, 'Children') for child in getattr(child_nodes, 'BrowseNode', []): ...
[ "def", "children", "(", "self", ")", ":", "children", "=", "[", "]", "child_nodes", "=", "getattr", "(", "self", ".", "parsed_response", ",", "'Children'", ")", "for", "child", "in", "getattr", "(", "child_nodes", ",", "'BrowseNode'", ",", "[", "]", ")",...
This browse node's children in the browse node tree. :return: A list of this browse node's children in the browse node tree.
[ "This", "browse", "node", "s", "children", "in", "the", "browse", "node", "tree", "." ]
f1cb0e209145fcfac9444e4c733dd19deb59d31a
https://github.com/yoavaviram/python-amazon-simple-product-api/blob/f1cb0e209145fcfac9444e4c733dd19deb59d31a/amazon/api.py#L650-L660
train
yoavaviram/python-amazon-simple-product-api
amazon/api.py
AmazonProduct.price_and_currency
def price_and_currency(self): """Get Offer Price and Currency. Return price according to the following process: * If product has a sale return Sales Price, otherwise, * Return Price, otherwise, * Return lowest offer price, otherwise, * Return None. :return: ...
python
def price_and_currency(self): """Get Offer Price and Currency. Return price according to the following process: * If product has a sale return Sales Price, otherwise, * Return Price, otherwise, * Return lowest offer price, otherwise, * Return None. :return: ...
[ "def", "price_and_currency", "(", "self", ")", ":", "price", "=", "self", ".", "_safe_get_element_text", "(", "'Offers.Offer.OfferListing.SalePrice.Amount'", ")", "if", "price", ":", "currency", "=", "self", ".", "_safe_get_element_text", "(", "'Offers.Offer.OfferListin...
Get Offer Price and Currency. Return price according to the following process: * If product has a sale return Sales Price, otherwise, * Return Price, otherwise, * Return lowest offer price, otherwise, * Return None. :return: A tuple containing: ...
[ "Get", "Offer", "Price", "and", "Currency", "." ]
f1cb0e209145fcfac9444e4c733dd19deb59d31a
https://github.com/yoavaviram/python-amazon-simple-product-api/blob/f1cb0e209145fcfac9444e4c733dd19deb59d31a/amazon/api.py#L687-L724
train
yoavaviram/python-amazon-simple-product-api
amazon/api.py
AmazonProduct.reviews
def reviews(self): """Customer Reviews. Get a iframe URL for customer reviews. :return: A tuple of: has_reviews (bool), reviews url (string) """ iframe = self._safe_get_element_text('CustomerReviews.IFrameURL') has_reviews = self._safe_get_element_text('Cust...
python
def reviews(self): """Customer Reviews. Get a iframe URL for customer reviews. :return: A tuple of: has_reviews (bool), reviews url (string) """ iframe = self._safe_get_element_text('CustomerReviews.IFrameURL') has_reviews = self._safe_get_element_text('Cust...
[ "def", "reviews", "(", "self", ")", ":", "iframe", "=", "self", ".", "_safe_get_element_text", "(", "'CustomerReviews.IFrameURL'", ")", "has_reviews", "=", "self", ".", "_safe_get_element_text", "(", "'CustomerReviews.HasReviews'", ")", "if", "has_reviews", "is", "n...
Customer Reviews. Get a iframe URL for customer reviews. :return: A tuple of: has_reviews (bool), reviews url (string)
[ "Customer", "Reviews", "." ]
f1cb0e209145fcfac9444e4c733dd19deb59d31a
https://github.com/yoavaviram/python-amazon-simple-product-api/blob/f1cb0e209145fcfac9444e4c733dd19deb59d31a/amazon/api.py#L954-L968
train
yoavaviram/python-amazon-simple-product-api
amazon/api.py
AmazonProduct.editorial_reviews
def editorial_reviews(self): """Editorial Review. Returns a list of all editorial reviews. :return: A list containing: Editorial Review (string) """ result = [] reviews_node = self._safe_get_element('EditorialReviews') if reviews_no...
python
def editorial_reviews(self): """Editorial Review. Returns a list of all editorial reviews. :return: A list containing: Editorial Review (string) """ result = [] reviews_node = self._safe_get_element('EditorialReviews') if reviews_no...
[ "def", "editorial_reviews", "(", "self", ")", ":", "result", "=", "[", "]", "reviews_node", "=", "self", ".", "_safe_get_element", "(", "'EditorialReviews'", ")", "if", "reviews_node", "is", "not", "None", ":", "for", "review_node", "in", "reviews_node", ".", ...
Editorial Review. Returns a list of all editorial reviews. :return: A list containing: Editorial Review (string)
[ "Editorial", "Review", "." ]
f1cb0e209145fcfac9444e4c733dd19deb59d31a
https://github.com/yoavaviram/python-amazon-simple-product-api/blob/f1cb0e209145fcfac9444e4c733dd19deb59d31a/amazon/api.py#L1069-L1087
train
yoavaviram/python-amazon-simple-product-api
amazon/api.py
AmazonProduct.list_price
def list_price(self): """List Price. :return: A tuple containing: 1. Decimal representation of price. 2. ISO Currency code (string). """ price = self._safe_get_element_text('ItemAttributes.ListPrice.Amount') currency = self._safe_get_...
python
def list_price(self): """List Price. :return: A tuple containing: 1. Decimal representation of price. 2. ISO Currency code (string). """ price = self._safe_get_element_text('ItemAttributes.ListPrice.Amount') currency = self._safe_get_...
[ "def", "list_price", "(", "self", ")", ":", "price", "=", "self", ".", "_safe_get_element_text", "(", "'ItemAttributes.ListPrice.Amount'", ")", "currency", "=", "self", ".", "_safe_get_element_text", "(", "'ItemAttributes.ListPrice.CurrencyCode'", ")", "if", "price", ...
List Price. :return: A tuple containing: 1. Decimal representation of price. 2. ISO Currency code (string).
[ "List", "Price", "." ]
f1cb0e209145fcfac9444e4c733dd19deb59d31a
https://github.com/yoavaviram/python-amazon-simple-product-api/blob/f1cb0e209145fcfac9444e4c733dd19deb59d31a/amazon/api.py#L1124-L1141
train
yoavaviram/python-amazon-simple-product-api
amazon/api.py
AmazonProduct.get_parent
def get_parent(self): """Get Parent. Fetch parent product if it exists. Use `parent_asin` to check if a parent exist before fetching. :return: An instance of :class:`~.AmazonProduct` representing the parent product. """ if not self.parent: ...
python
def get_parent(self): """Get Parent. Fetch parent product if it exists. Use `parent_asin` to check if a parent exist before fetching. :return: An instance of :class:`~.AmazonProduct` representing the parent product. """ if not self.parent: ...
[ "def", "get_parent", "(", "self", ")", ":", "if", "not", "self", ".", "parent", ":", "parent", "=", "self", ".", "_safe_get_element", "(", "'ParentASIN'", ")", "if", "parent", ":", "self", ".", "parent", "=", "self", ".", "api", ".", "lookup", "(", "...
Get Parent. Fetch parent product if it exists. Use `parent_asin` to check if a parent exist before fetching. :return: An instance of :class:`~.AmazonProduct` representing the parent product.
[ "Get", "Parent", "." ]
f1cb0e209145fcfac9444e4c733dd19deb59d31a
https://github.com/yoavaviram/python-amazon-simple-product-api/blob/f1cb0e209145fcfac9444e4c733dd19deb59d31a/amazon/api.py#L1196-L1210
train
yoavaviram/python-amazon-simple-product-api
amazon/api.py
AmazonProduct.browse_nodes
def browse_nodes(self): """Browse Nodes. :return: A list of :class:`~.AmazonBrowseNode` objects. """ root = self._safe_get_element('BrowseNodes') if root is None: return [] return [AmazonBrowseNode(child) for child in root.iterchildren()]
python
def browse_nodes(self): """Browse Nodes. :return: A list of :class:`~.AmazonBrowseNode` objects. """ root = self._safe_get_element('BrowseNodes') if root is None: return [] return [AmazonBrowseNode(child) for child in root.iterchildren()]
[ "def", "browse_nodes", "(", "self", ")", ":", "root", "=", "self", ".", "_safe_get_element", "(", "'BrowseNodes'", ")", "if", "root", "is", "None", ":", "return", "[", "]", "return", "[", "AmazonBrowseNode", "(", "child", ")", "for", "child", "in", "root...
Browse Nodes. :return: A list of :class:`~.AmazonBrowseNode` objects.
[ "Browse", "Nodes", "." ]
f1cb0e209145fcfac9444e4c733dd19deb59d31a
https://github.com/yoavaviram/python-amazon-simple-product-api/blob/f1cb0e209145fcfac9444e4c733dd19deb59d31a/amazon/api.py#L1213-L1223
train
yoavaviram/python-amazon-simple-product-api
amazon/api.py
AmazonProduct.images
def images(self): """List of images for a response. When using lookup with RespnoseGroup 'Images', you'll get a list of images. Parse them so they are returned in an easily used list format. :return: A list of `ObjectifiedElement` images """ try: ...
python
def images(self): """List of images for a response. When using lookup with RespnoseGroup 'Images', you'll get a list of images. Parse them so they are returned in an easily used list format. :return: A list of `ObjectifiedElement` images """ try: ...
[ "def", "images", "(", "self", ")", ":", "try", ":", "images", "=", "[", "image", "for", "image", "in", "self", ".", "_safe_get_element", "(", "'ImageSets.ImageSet'", ")", "]", "except", "TypeError", ":", "images", "=", "[", "]", "return", "images" ]
List of images for a response. When using lookup with RespnoseGroup 'Images', you'll get a list of images. Parse them so they are returned in an easily used list format. :return: A list of `ObjectifiedElement` images
[ "List", "of", "images", "for", "a", "response", ".", "When", "using", "lookup", "with", "RespnoseGroup", "Images", "you", "ll", "get", "a", "list", "of", "images", ".", "Parse", "them", "so", "they", "are", "returned", "in", "an", "easily", "used", "list...
f1cb0e209145fcfac9444e4c733dd19deb59d31a
https://github.com/yoavaviram/python-amazon-simple-product-api/blob/f1cb0e209145fcfac9444e4c733dd19deb59d31a/amazon/api.py#L1226-L1240
train
yoavaviram/python-amazon-simple-product-api
amazon/api.py
AmazonProduct.actors
def actors(self): """Movie Actors. :return: A list of actors names. """ result = [] actors = self._safe_get_element('ItemAttributes.Actor') or [] for actor in actors: result.append(actor.text) return result
python
def actors(self): """Movie Actors. :return: A list of actors names. """ result = [] actors = self._safe_get_element('ItemAttributes.Actor') or [] for actor in actors: result.append(actor.text) return result
[ "def", "actors", "(", "self", ")", ":", "result", "=", "[", "]", "actors", "=", "self", ".", "_safe_get_element", "(", "'ItemAttributes.Actor'", ")", "or", "[", "]", "for", "actor", "in", "actors", ":", "result", ".", "append", "(", "actor", ".", "text...
Movie Actors. :return: A list of actors names.
[ "Movie", "Actors", "." ]
f1cb0e209145fcfac9444e4c733dd19deb59d31a
https://github.com/yoavaviram/python-amazon-simple-product-api/blob/f1cb0e209145fcfac9444e4c733dd19deb59d31a/amazon/api.py#L1252-L1262
train
yoavaviram/python-amazon-simple-product-api
amazon/api.py
AmazonProduct.directors
def directors(self): """Movie Directors. :return: A list of directors for a movie. """ result = [] directors = self._safe_get_element('ItemAttributes.Director') or [] for director in directors: result.append(director.text) return result
python
def directors(self): """Movie Directors. :return: A list of directors for a movie. """ result = [] directors = self._safe_get_element('ItemAttributes.Director') or [] for director in directors: result.append(director.text) return result
[ "def", "directors", "(", "self", ")", ":", "result", "=", "[", "]", "directors", "=", "self", ".", "_safe_get_element", "(", "'ItemAttributes.Director'", ")", "or", "[", "]", "for", "director", "in", "directors", ":", "result", ".", "append", "(", "directo...
Movie Directors. :return: A list of directors for a movie.
[ "Movie", "Directors", "." ]
f1cb0e209145fcfac9444e4c733dd19deb59d31a
https://github.com/yoavaviram/python-amazon-simple-product-api/blob/f1cb0e209145fcfac9444e4c733dd19deb59d31a/amazon/api.py#L1265-L1275
train
etingof/pysnmp
pysnmp/smi/rfc1902.py
ObjectIdentity.getMibSymbol
def getMibSymbol(self): """Returns MIB variable symbolic identification. Returns ------- str MIB module name str MIB variable symbolic name : :py:class:`~pysnmp.proto.rfc1902.ObjectName` class instance representing MIB variable inst...
python
def getMibSymbol(self): """Returns MIB variable symbolic identification. Returns ------- str MIB module name str MIB variable symbolic name : :py:class:`~pysnmp.proto.rfc1902.ObjectName` class instance representing MIB variable inst...
[ "def", "getMibSymbol", "(", "self", ")", ":", "if", "self", ".", "_state", "&", "self", ".", "ST_CLEAN", ":", "return", "self", ".", "_modName", ",", "self", ".", "_symName", ",", "self", ".", "_indices", "else", ":", "raise", "SmiError", "(", "'%s obj...
Returns MIB variable symbolic identification. Returns ------- str MIB module name str MIB variable symbolic name : :py:class:`~pysnmp.proto.rfc1902.ObjectName` class instance representing MIB variable instance index. Raises ...
[ "Returns", "MIB", "variable", "symbolic", "identification", "." ]
cde062dd42f67dfd2d7686286a322d40e9c3a4b7
https://github.com/etingof/pysnmp/blob/cde062dd42f67dfd2d7686286a322d40e9c3a4b7/pysnmp/smi/rfc1902.py#L98-L128
train
etingof/pysnmp
pysnmp/smi/rfc1902.py
ObjectIdentity.getOid
def getOid(self): """Returns OID identifying MIB variable. Returns ------- : :py:class:`~pysnmp.proto.rfc1902.ObjectName` full OID identifying MIB variable including possible index part. Raises ------ SmiError If MIB variable conversion ha...
python
def getOid(self): """Returns OID identifying MIB variable. Returns ------- : :py:class:`~pysnmp.proto.rfc1902.ObjectName` full OID identifying MIB variable including possible index part. Raises ------ SmiError If MIB variable conversion ha...
[ "def", "getOid", "(", "self", ")", ":", "if", "self", ".", "_state", "&", "self", ".", "ST_CLEAN", ":", "return", "self", ".", "_oid", "else", ":", "raise", "SmiError", "(", "'%s object not fully initialized'", "%", "self", ".", "__class__", ".", "__name__...
Returns OID identifying MIB variable. Returns ------- : :py:class:`~pysnmp.proto.rfc1902.ObjectName` full OID identifying MIB variable including possible index part. Raises ------ SmiError If MIB variable conversion has not been performed. ...
[ "Returns", "OID", "identifying", "MIB", "variable", "." ]
cde062dd42f67dfd2d7686286a322d40e9c3a4b7
https://github.com/etingof/pysnmp/blob/cde062dd42f67dfd2d7686286a322d40e9c3a4b7/pysnmp/smi/rfc1902.py#L130-L156
train
etingof/pysnmp
pysnmp/smi/rfc1902.py
ObjectIdentity.getLabel
def getLabel(self): """Returns symbolic path to this MIB variable. Meaning a sequence of symbolic identifications for each of parent MIB objects in MIB tree. Returns ------- tuple sequence of names of nodes in a MIB tree from the top of the tree ...
python
def getLabel(self): """Returns symbolic path to this MIB variable. Meaning a sequence of symbolic identifications for each of parent MIB objects in MIB tree. Returns ------- tuple sequence of names of nodes in a MIB tree from the top of the tree ...
[ "def", "getLabel", "(", "self", ")", ":", "if", "self", ".", "_state", "&", "self", ".", "ST_CLEAN", ":", "return", "self", ".", "_label", "else", ":", "raise", "SmiError", "(", "'%s object not fully initialized'", "%", "self", ".", "__class__", ".", "__na...
Returns symbolic path to this MIB variable. Meaning a sequence of symbolic identifications for each of parent MIB objects in MIB tree. Returns ------- tuple sequence of names of nodes in a MIB tree from the top of the tree towards this MIB variable. ...
[ "Returns", "symbolic", "path", "to", "this", "MIB", "variable", "." ]
cde062dd42f67dfd2d7686286a322d40e9c3a4b7
https://github.com/etingof/pysnmp/blob/cde062dd42f67dfd2d7686286a322d40e9c3a4b7/pysnmp/smi/rfc1902.py#L158-L193
train
etingof/pysnmp
pysnmp/smi/rfc1902.py
ObjectIdentity.addMibSource
def addMibSource(self, *mibSources): """Adds path to repository to search PySNMP MIB files. Parameters ---------- *mibSources : one or more paths to search or Python package names to import and search for PySNMP MIB modules. Returns ------- ...
python
def addMibSource(self, *mibSources): """Adds path to repository to search PySNMP MIB files. Parameters ---------- *mibSources : one or more paths to search or Python package names to import and search for PySNMP MIB modules. Returns ------- ...
[ "def", "addMibSource", "(", "self", ",", "*", "mibSources", ")", ":", "if", "self", ".", "_mibSourcesToAdd", "is", "None", ":", "self", ".", "_mibSourcesToAdd", "=", "mibSources", "else", ":", "self", ".", "_mibSourcesToAdd", "+=", "mibSources", "return", "s...
Adds path to repository to search PySNMP MIB files. Parameters ---------- *mibSources : one or more paths to search or Python package names to import and search for PySNMP MIB modules. Returns ------- : :py:class:`~pysnmp.smi.rfc1902.ObjectIdenti...
[ "Adds", "path", "to", "repository", "to", "search", "PySNMP", "MIB", "files", "." ]
cde062dd42f67dfd2d7686286a322d40e9c3a4b7
https://github.com/etingof/pysnmp/blob/cde062dd42f67dfd2d7686286a322d40e9c3a4b7/pysnmp/smi/rfc1902.py#L253-L287
train
etingof/pysnmp
pysnmp/smi/rfc1902.py
ObjectIdentity.loadMibs
def loadMibs(self, *modNames): """Schedules search and load of given MIB modules. Parameters ---------- *modNames: one or more MIB module names to load up and use for MIB variables resolution purposes. Returns ------- : :py:class:`~pysnmp...
python
def loadMibs(self, *modNames): """Schedules search and load of given MIB modules. Parameters ---------- *modNames: one or more MIB module names to load up and use for MIB variables resolution purposes. Returns ------- : :py:class:`~pysnmp...
[ "def", "loadMibs", "(", "self", ",", "*", "modNames", ")", ":", "if", "self", ".", "_modNamesToLoad", "is", "None", ":", "self", ".", "_modNamesToLoad", "=", "modNames", "else", ":", "self", ".", "_modNamesToLoad", "+=", "modNames", "return", "self" ]
Schedules search and load of given MIB modules. Parameters ---------- *modNames: one or more MIB module names to load up and use for MIB variables resolution purposes. Returns ------- : :py:class:`~pysnmp.smi.rfc1902.ObjectIdentity` r...
[ "Schedules", "search", "and", "load", "of", "given", "MIB", "modules", "." ]
cde062dd42f67dfd2d7686286a322d40e9c3a4b7
https://github.com/etingof/pysnmp/blob/cde062dd42f67dfd2d7686286a322d40e9c3a4b7/pysnmp/smi/rfc1902.py#L290-L316
train
etingof/pysnmp
pysnmp/smi/rfc1902.py
ObjectType.resolveWithMib
def resolveWithMib(self, mibViewController): """Perform MIB variable ID and associated value conversion. Parameters ---------- mibViewController : :py:class:`~pysnmp.smi.view.MibViewController` class instance representing MIB browsing functionality. Returns ...
python
def resolveWithMib(self, mibViewController): """Perform MIB variable ID and associated value conversion. Parameters ---------- mibViewController : :py:class:`~pysnmp.smi.view.MibViewController` class instance representing MIB browsing functionality. Returns ...
[ "def", "resolveWithMib", "(", "self", ",", "mibViewController", ")", ":", "if", "self", ".", "_state", "&", "self", ".", "ST_CLEAM", ":", "return", "self", "self", ".", "_args", "[", "0", "]", ".", "resolveWithMib", "(", "mibViewController", ")", "MibScala...
Perform MIB variable ID and associated value conversion. Parameters ---------- mibViewController : :py:class:`~pysnmp.smi.view.MibViewController` class instance representing MIB browsing functionality. Returns ------- : :py:class:`~pysnmp.smi.rfc1902.ObjectT...
[ "Perform", "MIB", "variable", "ID", "and", "associated", "value", "conversion", "." ]
cde062dd42f67dfd2d7686286a322d40e9c3a4b7
https://github.com/etingof/pysnmp/blob/cde062dd42f67dfd2d7686286a322d40e9c3a4b7/pysnmp/smi/rfc1902.py#L911-L993
train
etingof/pysnmp
pysnmp/smi/rfc1902.py
NotificationType.addVarBinds
def addVarBinds(self, *varBinds): """Appends variable-binding to notification. Parameters ---------- *varBinds : :py:class:`~pysnmp.smi.rfc1902.ObjectType` One or more :py:class:`~pysnmp.smi.rfc1902.ObjectType` class instances. Returns ------- ...
python
def addVarBinds(self, *varBinds): """Appends variable-binding to notification. Parameters ---------- *varBinds : :py:class:`~pysnmp.smi.rfc1902.ObjectType` One or more :py:class:`~pysnmp.smi.rfc1902.ObjectType` class instances. Returns ------- ...
[ "def", "addVarBinds", "(", "self", ",", "*", "varBinds", ")", ":", "debug", ".", "logger", "&", "debug", ".", "FLAG_MIB", "and", "debug", ".", "logger", "(", "'additional var-binds: %r'", "%", "(", "varBinds", ",", ")", ")", "if", "self", ".", "_state", ...
Appends variable-binding to notification. Parameters ---------- *varBinds : :py:class:`~pysnmp.smi.rfc1902.ObjectType` One or more :py:class:`~pysnmp.smi.rfc1902.ObjectType` class instances. Returns ------- : :py:class:`~pysnmp.smi.rfc1902.Notifi...
[ "Appends", "variable", "-", "binding", "to", "notification", "." ]
cde062dd42f67dfd2d7686286a322d40e9c3a4b7
https://github.com/etingof/pysnmp/blob/cde062dd42f67dfd2d7686286a322d40e9c3a4b7/pysnmp/smi/rfc1902.py#L1096-L1133
train
etingof/pysnmp
pysnmp/smi/rfc1902.py
NotificationType.resolveWithMib
def resolveWithMib(self, mibViewController): """Perform MIB variable ID conversion and notification objects expansion. Parameters ---------- mibViewController : :py:class:`~pysnmp.smi.view.MibViewController` class instance representing MIB browsing functionality. Re...
python
def resolveWithMib(self, mibViewController): """Perform MIB variable ID conversion and notification objects expansion. Parameters ---------- mibViewController : :py:class:`~pysnmp.smi.view.MibViewController` class instance representing MIB browsing functionality. Re...
[ "def", "resolveWithMib", "(", "self", ",", "mibViewController", ")", ":", "if", "self", ".", "_state", "&", "self", ".", "ST_CLEAN", ":", "return", "self", "self", ".", "_objectIdentity", ".", "resolveWithMib", "(", "mibViewController", ")", "self", ".", "_v...
Perform MIB variable ID conversion and notification objects expansion. Parameters ---------- mibViewController : :py:class:`~pysnmp.smi.view.MibViewController` class instance representing MIB browsing functionality. Returns ------- : :py:class:`~pysnmp.smi.r...
[ "Perform", "MIB", "variable", "ID", "conversion", "and", "notification", "objects", "expansion", "." ]
cde062dd42f67dfd2d7686286a322d40e9c3a4b7
https://github.com/etingof/pysnmp/blob/cde062dd42f67dfd2d7686286a322d40e9c3a4b7/pysnmp/smi/rfc1902.py#L1224-L1319
train
etingof/pysnmp
pysnmp/proto/rfc1902.py
Integer32.withValues
def withValues(cls, *values): """Creates a subclass with discreet values constraint. """ class X(cls): subtypeSpec = cls.subtypeSpec + constraint.SingleValueConstraint( *values) X.__name__ = cls.__name__ return X
python
def withValues(cls, *values): """Creates a subclass with discreet values constraint. """ class X(cls): subtypeSpec = cls.subtypeSpec + constraint.SingleValueConstraint( *values) X.__name__ = cls.__name__ return X
[ "def", "withValues", "(", "cls", ",", "*", "values", ")", ":", "class", "X", "(", "cls", ")", ":", "subtypeSpec", "=", "cls", ".", "subtypeSpec", "+", "constraint", ".", "SingleValueConstraint", "(", "*", "values", ")", "X", ".", "__name__", "=", "cls"...
Creates a subclass with discreet values constraint.
[ "Creates", "a", "subclass", "with", "discreet", "values", "constraint", "." ]
cde062dd42f67dfd2d7686286a322d40e9c3a4b7
https://github.com/etingof/pysnmp/blob/cde062dd42f67dfd2d7686286a322d40e9c3a4b7/pysnmp/proto/rfc1902.py#L93-L102
train
etingof/pysnmp
pysnmp/proto/rfc1902.py
Integer32.withRange
def withRange(cls, minimum, maximum): """Creates a subclass with value range constraint. """ class X(cls): subtypeSpec = cls.subtypeSpec + constraint.ValueRangeConstraint( minimum, maximum) X.__name__ = cls.__name__ return X
python
def withRange(cls, minimum, maximum): """Creates a subclass with value range constraint. """ class X(cls): subtypeSpec = cls.subtypeSpec + constraint.ValueRangeConstraint( minimum, maximum) X.__name__ = cls.__name__ return X
[ "def", "withRange", "(", "cls", ",", "minimum", ",", "maximum", ")", ":", "class", "X", "(", "cls", ")", ":", "subtypeSpec", "=", "cls", ".", "subtypeSpec", "+", "constraint", ".", "ValueRangeConstraint", "(", "minimum", ",", "maximum", ")", "X", ".", ...
Creates a subclass with value range constraint.
[ "Creates", "a", "subclass", "with", "value", "range", "constraint", "." ]
cde062dd42f67dfd2d7686286a322d40e9c3a4b7
https://github.com/etingof/pysnmp/blob/cde062dd42f67dfd2d7686286a322d40e9c3a4b7/pysnmp/proto/rfc1902.py#L105-L114
train
etingof/pysnmp
pysnmp/proto/rfc1902.py
Integer.withNamedValues
def withNamedValues(cls, **values): """Create a subclass with discreet named values constraint. Reduce fully duplicate enumerations along the way. """ enums = set(cls.namedValues.items()) enums.update(values.items()) class X(cls): namedValues = namedval.Name...
python
def withNamedValues(cls, **values): """Create a subclass with discreet named values constraint. Reduce fully duplicate enumerations along the way. """ enums = set(cls.namedValues.items()) enums.update(values.items()) class X(cls): namedValues = namedval.Name...
[ "def", "withNamedValues", "(", "cls", ",", "**", "values", ")", ":", "enums", "=", "set", "(", "cls", ".", "namedValues", ".", "items", "(", ")", ")", "enums", ".", "update", "(", "values", ".", "items", "(", ")", ")", "class", "X", "(", "cls", "...
Create a subclass with discreet named values constraint. Reduce fully duplicate enumerations along the way.
[ "Create", "a", "subclass", "with", "discreet", "named", "values", "constraint", "." ]
cde062dd42f67dfd2d7686286a322d40e9c3a4b7
https://github.com/etingof/pysnmp/blob/cde062dd42f67dfd2d7686286a322d40e9c3a4b7/pysnmp/proto/rfc1902.py#L162-L177
train
etingof/pysnmp
pysnmp/proto/rfc1902.py
OctetString.withSize
def withSize(cls, minimum, maximum): """Creates a subclass with value size constraint. """ class X(cls): subtypeSpec = cls.subtypeSpec + constraint.ValueSizeConstraint( minimum, maximum) X.__name__ = cls.__name__ return X
python
def withSize(cls, minimum, maximum): """Creates a subclass with value size constraint. """ class X(cls): subtypeSpec = cls.subtypeSpec + constraint.ValueSizeConstraint( minimum, maximum) X.__name__ = cls.__name__ return X
[ "def", "withSize", "(", "cls", ",", "minimum", ",", "maximum", ")", ":", "class", "X", "(", "cls", ")", ":", "subtypeSpec", "=", "cls", ".", "subtypeSpec", "+", "constraint", ".", "ValueSizeConstraint", "(", "minimum", ",", "maximum", ")", "X", ".", "_...
Creates a subclass with value size constraint.
[ "Creates", "a", "subclass", "with", "value", "size", "constraint", "." ]
cde062dd42f67dfd2d7686286a322d40e9c3a4b7
https://github.com/etingof/pysnmp/blob/cde062dd42f67dfd2d7686286a322d40e9c3a4b7/pysnmp/proto/rfc1902.py#L248-L257
train
etingof/pysnmp
pysnmp/proto/rfc1902.py
Bits.withNamedBits
def withNamedBits(cls, **values): """Creates a subclass with discreet named bits constraint. Reduce fully duplicate enumerations along the way. """ enums = set(cls.namedValues.items()) enums.update(values.items()) class X(cls): namedValues = namedval.NamedVa...
python
def withNamedBits(cls, **values): """Creates a subclass with discreet named bits constraint. Reduce fully duplicate enumerations along the way. """ enums = set(cls.namedValues.items()) enums.update(values.items()) class X(cls): namedValues = namedval.NamedVa...
[ "def", "withNamedBits", "(", "cls", ",", "**", "values", ")", ":", "enums", "=", "set", "(", "cls", ".", "namedValues", ".", "items", "(", ")", ")", "enums", ".", "update", "(", "values", ".", "items", "(", ")", ")", "class", "X", "(", "cls", ")"...
Creates a subclass with discreet named bits constraint. Reduce fully duplicate enumerations along the way.
[ "Creates", "a", "subclass", "with", "discreet", "named", "bits", "constraint", "." ]
cde062dd42f67dfd2d7686286a322d40e9c3a4b7
https://github.com/etingof/pysnmp/blob/cde062dd42f67dfd2d7686286a322d40e9c3a4b7/pysnmp/proto/rfc1902.py#L698-L710
train
etingof/pysnmp
pysnmp/smi/builder.py
MibBuilder.loadModule
def loadModule(self, modName, **userCtx): """Load and execute MIB modules as Python code""" for mibSource in self._mibSources: debug.logger & debug.FLAG_BLD and debug.logger( 'loadModule: trying %s at %s' % (modName, mibSource)) try: codeObj, sfx ...
python
def loadModule(self, modName, **userCtx): """Load and execute MIB modules as Python code""" for mibSource in self._mibSources: debug.logger & debug.FLAG_BLD and debug.logger( 'loadModule: trying %s at %s' % (modName, mibSource)) try: codeObj, sfx ...
[ "def", "loadModule", "(", "self", ",", "modName", ",", "**", "userCtx", ")", ":", "for", "mibSource", "in", "self", ".", "_mibSources", ":", "debug", ".", "logger", "&", "debug", ".", "FLAG_BLD", "and", "debug", ".", "logger", "(", "'loadModule: trying %s ...
Load and execute MIB modules as Python code
[ "Load", "and", "execute", "MIB", "modules", "as", "Python", "code" ]
cde062dd42f67dfd2d7686286a322d40e9c3a4b7
https://github.com/etingof/pysnmp/blob/cde062dd42f67dfd2d7686286a322d40e9c3a4b7/pysnmp/smi/builder.py#L354-L407
train
etingof/pysnmp
pysnmp/hlapi/v1arch/asyncore/sync/cmdgen.py
nextCmd
def nextCmd(snmpDispatcher, authData, transportTarget, *varBinds, **options): """Create a generator to perform one or more SNMP GETNEXT queries. On each iteration, new SNMP GETNEXT request is send (:RFC:`1905#section-4.2.2`). The iterator blocks waiting for response to arrive or error to oc...
python
def nextCmd(snmpDispatcher, authData, transportTarget, *varBinds, **options): """Create a generator to perform one or more SNMP GETNEXT queries. On each iteration, new SNMP GETNEXT request is send (:RFC:`1905#section-4.2.2`). The iterator blocks waiting for response to arrive or error to oc...
[ "def", "nextCmd", "(", "snmpDispatcher", ",", "authData", ",", "transportTarget", ",", "*", "varBinds", ",", "**", "options", ")", ":", "def", "cbFun", "(", "*", "args", ",", "**", "kwargs", ")", ":", "response", "[", ":", "]", "=", "args", "+", "(",...
Create a generator to perform one or more SNMP GETNEXT queries. On each iteration, new SNMP GETNEXT request is send (:RFC:`1905#section-4.2.2`). The iterator blocks waiting for response to arrive or error to occur. Parameters ---------- snmpDispatcher : :py:class:`~pysnmp.hlapi.snmpDispatcher`...
[ "Create", "a", "generator", "to", "perform", "one", "or", "more", "SNMP", "GETNEXT", "queries", "." ]
cde062dd42f67dfd2d7686286a322d40e9c3a4b7
https://github.com/etingof/pysnmp/blob/cde062dd42f67dfd2d7686286a322d40e9c3a4b7/pysnmp/hlapi/v1arch/asyncore/sync/cmdgen.py#L201-L363
train
etingof/pysnmp
pysnmp/proto/rfc3412.py
MsgAndPduDispatcher.registerContextEngineId
def registerContextEngineId(self, contextEngineId, pduTypes, processPdu): """Register application with dispatcher""" # 4.3.2 -> no-op # 4.3.3 for pduType in pduTypes: k = contextEngineId, pduType if k in self._appsRegistration: raise error.Protoco...
python
def registerContextEngineId(self, contextEngineId, pduTypes, processPdu): """Register application with dispatcher""" # 4.3.2 -> no-op # 4.3.3 for pduType in pduTypes: k = contextEngineId, pduType if k in self._appsRegistration: raise error.Protoco...
[ "def", "registerContextEngineId", "(", "self", ",", "contextEngineId", ",", "pduTypes", ",", "processPdu", ")", ":", "for", "pduType", "in", "pduTypes", ":", "k", "=", "contextEngineId", ",", "pduType", "if", "k", "in", "self", ".", "_appsRegistration", ":", ...
Register application with dispatcher
[ "Register", "application", "with", "dispatcher" ]
cde062dd42f67dfd2d7686286a322d40e9c3a4b7
https://github.com/etingof/pysnmp/blob/cde062dd42f67dfd2d7686286a322d40e9c3a4b7/pysnmp/proto/rfc3412.py#L64-L80
train
etingof/pysnmp
pysnmp/proto/rfc3412.py
MsgAndPduDispatcher.unregisterContextEngineId
def unregisterContextEngineId(self, contextEngineId, pduTypes): """Unregister application with dispatcher""" # 4.3.4 if contextEngineId is None: # Default to local snmpEngineId contextEngineId, = self.mibInstrumController.mibBuilder.importSymbols( '__SNMP...
python
def unregisterContextEngineId(self, contextEngineId, pduTypes): """Unregister application with dispatcher""" # 4.3.4 if contextEngineId is None: # Default to local snmpEngineId contextEngineId, = self.mibInstrumController.mibBuilder.importSymbols( '__SNMP...
[ "def", "unregisterContextEngineId", "(", "self", ",", "contextEngineId", ",", "pduTypes", ")", ":", "if", "contextEngineId", "is", "None", ":", "contextEngineId", ",", "=", "self", ".", "mibInstrumController", ".", "mibBuilder", ".", "importSymbols", "(", "'__SNMP...
Unregister application with dispatcher
[ "Unregister", "application", "with", "dispatcher" ]
cde062dd42f67dfd2d7686286a322d40e9c3a4b7
https://github.com/etingof/pysnmp/blob/cde062dd42f67dfd2d7686286a322d40e9c3a4b7/pysnmp/proto/rfc3412.py#L83-L99
train
etingof/pysnmp
pysnmp/hlapi/v3arch/twisted/ntforg.py
sendNotification
def sendNotification(snmpEngine, authData, transportTarget, contextData, notifyType, *varBinds, **options): """Sends SNMP notification. Based on passed parameters, prepares SNMP TRAP or INFORM message (:RFC:`1905#section-4.2.6`) and schedules its transmission by :mod:`twisted` I/O ...
python
def sendNotification(snmpEngine, authData, transportTarget, contextData, notifyType, *varBinds, **options): """Sends SNMP notification. Based on passed parameters, prepares SNMP TRAP or INFORM message (:RFC:`1905#section-4.2.6`) and schedules its transmission by :mod:`twisted` I/O ...
[ "def", "sendNotification", "(", "snmpEngine", ",", "authData", ",", "transportTarget", ",", "contextData", ",", "notifyType", ",", "*", "varBinds", ",", "**", "options", ")", ":", "def", "__cbFun", "(", "snmpEngine", ",", "sendRequestHandle", ",", "errorIndicati...
Sends SNMP notification. Based on passed parameters, prepares SNMP TRAP or INFORM message (:RFC:`1905#section-4.2.6`) and schedules its transmission by :mod:`twisted` I/O framework at a later point of time. Parameters ---------- snmpEngine: :py:class:`~pysnmp.hlapi.SnmpEngine` Class in...
[ "Sends", "SNMP", "notification", "." ]
cde062dd42f67dfd2d7686286a322d40e9c3a4b7
https://github.com/etingof/pysnmp/blob/cde062dd42f67dfd2d7686286a322d40e9c3a4b7/pysnmp/hlapi/v3arch/twisted/ntforg.py#L25-L189
train
etingof/pysnmp
pysnmp/hlapi/v3arch/twisted/cmdgen.py
nextCmd
def nextCmd(snmpEngine, authData, transportTarget, contextData, *varBinds, **options): """Performs SNMP GETNEXT query. Based on passed parameters, prepares SNMP GETNEXT packet (:RFC:`1905#section-4.2.2`) and schedules its transmission by :mod:`twisted` I/O framework at a later point of time...
python
def nextCmd(snmpEngine, authData, transportTarget, contextData, *varBinds, **options): """Performs SNMP GETNEXT query. Based on passed parameters, prepares SNMP GETNEXT packet (:RFC:`1905#section-4.2.2`) and schedules its transmission by :mod:`twisted` I/O framework at a later point of time...
[ "def", "nextCmd", "(", "snmpEngine", ",", "authData", ",", "transportTarget", ",", "contextData", ",", "*", "varBinds", ",", "**", "options", ")", ":", "def", "__cbFun", "(", "snmpEngine", ",", "sendRequestHandle", ",", "errorIndication", ",", "errorStatus", "...
Performs SNMP GETNEXT query. Based on passed parameters, prepares SNMP GETNEXT packet (:RFC:`1905#section-4.2.2`) and schedules its transmission by :mod:`twisted` I/O framework at a later point of time. Parameters ---------- snmpEngine : :class:`~pysnmp.hlapi.SnmpEngine` Class instance...
[ "Performs", "SNMP", "GETNEXT", "query", "." ]
cde062dd42f67dfd2d7686286a322d40e9c3a4b7
https://github.com/etingof/pysnmp/blob/cde062dd42f67dfd2d7686286a322d40e9c3a4b7/pysnmp/hlapi/v3arch/twisted/cmdgen.py#L268-L401
train
etingof/pysnmp
pysnmp/smi/mibs/SNMPv2-SMI.py
ManagedMibObject.getBranch
def getBranch(self, name, **context): """Return a branch of this tree where the 'name' OID may reside""" for keyLen in self._vars.getKeysLens(): subName = name[:keyLen] if subName in self._vars: return self._vars[subName] raise error.NoSuchObjectError(nam...
python
def getBranch(self, name, **context): """Return a branch of this tree where the 'name' OID may reside""" for keyLen in self._vars.getKeysLens(): subName = name[:keyLen] if subName in self._vars: return self._vars[subName] raise error.NoSuchObjectError(nam...
[ "def", "getBranch", "(", "self", ",", "name", ",", "**", "context", ")", ":", "for", "keyLen", "in", "self", ".", "_vars", ".", "getKeysLens", "(", ")", ":", "subName", "=", "name", "[", ":", "keyLen", "]", "if", "subName", "in", "self", ".", "_var...
Return a branch of this tree where the 'name' OID may reside
[ "Return", "a", "branch", "of", "this", "tree", "where", "the", "name", "OID", "may", "reside" ]
cde062dd42f67dfd2d7686286a322d40e9c3a4b7
https://github.com/etingof/pysnmp/blob/cde062dd42f67dfd2d7686286a322d40e9c3a4b7/pysnmp/smi/mibs/SNMPv2-SMI.py#L455-L462
train
etingof/pysnmp
pysnmp/smi/mibs/SNMPv2-SMI.py
ManagedMibObject.getNode
def getNode(self, name, **context): """Return tree node found by name""" if name == self.name: return self else: return self.getBranch(name, **context).getNode(name, **context)
python
def getNode(self, name, **context): """Return tree node found by name""" if name == self.name: return self else: return self.getBranch(name, **context).getNode(name, **context)
[ "def", "getNode", "(", "self", ",", "name", ",", "**", "context", ")", ":", "if", "name", "==", "self", ".", "name", ":", "return", "self", "else", ":", "return", "self", ".", "getBranch", "(", "name", ",", "**", "context", ")", ".", "getNode", "("...
Return tree node found by name
[ "Return", "tree", "node", "found", "by", "name" ]
cde062dd42f67dfd2d7686286a322d40e9c3a4b7
https://github.com/etingof/pysnmp/blob/cde062dd42f67dfd2d7686286a322d40e9c3a4b7/pysnmp/smi/mibs/SNMPv2-SMI.py#L478-L483
train
etingof/pysnmp
pysnmp/smi/mibs/SNMPv2-SMI.py
ManagedMibObject.getNextNode
def getNextNode(self, name, **context): """Return tree node next to name""" try: nextNode = self.getBranch(name, **context) except (error.NoSuchInstanceError, error.NoSuchObjectError): return self.getNextBranch(name, **context) else: try: ...
python
def getNextNode(self, name, **context): """Return tree node next to name""" try: nextNode = self.getBranch(name, **context) except (error.NoSuchInstanceError, error.NoSuchObjectError): return self.getNextBranch(name, **context) else: try: ...
[ "def", "getNextNode", "(", "self", ",", "name", ",", "**", "context", ")", ":", "try", ":", "nextNode", "=", "self", ".", "getBranch", "(", "name", ",", "**", "context", ")", "except", "(", "error", ".", "NoSuchInstanceError", ",", "error", ".", "NoSuc...
Return tree node next to name
[ "Return", "tree", "node", "next", "to", "name" ]
cde062dd42f67dfd2d7686286a322d40e9c3a4b7
https://github.com/etingof/pysnmp/blob/cde062dd42f67dfd2d7686286a322d40e9c3a4b7/pysnmp/smi/mibs/SNMPv2-SMI.py#L485-L498
train
etingof/pysnmp
pysnmp/smi/mibs/SNMPv2-SMI.py
ManagedMibObject.writeCommit
def writeCommit(self, varBind, **context): """Commit new value of the Managed Object Instance. Implements the second of the multi-step workflow of the SNMP SET command processing (:RFC:`1905#section-4.2.5`). The goal of the second phase is to actually modify the requested Managed ...
python
def writeCommit(self, varBind, **context): """Commit new value of the Managed Object Instance. Implements the second of the multi-step workflow of the SNMP SET command processing (:RFC:`1905#section-4.2.5`). The goal of the second phase is to actually modify the requested Managed ...
[ "def", "writeCommit", "(", "self", ",", "varBind", ",", "**", "context", ")", ":", "name", ",", "val", "=", "varBind", "(", "debug", ".", "logger", "&", "debug", ".", "FLAG_INS", "and", "debug", ".", "logger", "(", "'%s: writeCommit(%s, %r)'", "%", "(", ...
Commit new value of the Managed Object Instance. Implements the second of the multi-step workflow of the SNMP SET command processing (:RFC:`1905#section-4.2.5`). The goal of the second phase is to actually modify the requested Managed Object Instance. When multiple Managed Objects Inst...
[ "Commit", "new", "value", "of", "the", "Managed", "Object", "Instance", "." ]
cde062dd42f67dfd2d7686286a322d40e9c3a4b7
https://github.com/etingof/pysnmp/blob/cde062dd42f67dfd2d7686286a322d40e9c3a4b7/pysnmp/smi/mibs/SNMPv2-SMI.py#L860-L925
train
etingof/pysnmp
pysnmp/smi/mibs/SNMPv2-SMI.py
MibScalar.readGet
def readGet(self, varBind, **context): """Read Managed Object Instance. Implements the second of the two phases of the SNMP GET command processing (:RFC:`1905#section-4.2.1`). The goal of the second phase is to actually read the requested Managed Object Instance. When multiple ...
python
def readGet(self, varBind, **context): """Read Managed Object Instance. Implements the second of the two phases of the SNMP GET command processing (:RFC:`1905#section-4.2.1`). The goal of the second phase is to actually read the requested Managed Object Instance. When multiple ...
[ "def", "readGet", "(", "self", ",", "varBind", ",", "**", "context", ")", ":", "name", ",", "val", "=", "varBind", "(", "debug", ".", "logger", "&", "debug", ".", "FLAG_INS", "and", "debug", ".", "logger", "(", "'%s: readGet(%s, %r)'", "%", "(", "self"...
Read Managed Object Instance. Implements the second of the two phases of the SNMP GET command processing (:RFC:`1905#section-4.2.1`). The goal of the second phase is to actually read the requested Managed Object Instance. When multiple Managed Objects Instances are read at once...
[ "Read", "Managed", "Object", "Instance", "." ]
cde062dd42f67dfd2d7686286a322d40e9c3a4b7
https://github.com/etingof/pysnmp/blob/cde062dd42f67dfd2d7686286a322d40e9c3a4b7/pysnmp/smi/mibs/SNMPv2-SMI.py#L1139-L1203
train
etingof/pysnmp
pysnmp/smi/mibs/SNMPv2-SMI.py
MibScalar.readGetNext
def readGetNext(self, varBind, **context): """Read the next Managed Object Instance. Implements the second of the two phases of the SNMP GETNEXT command processing (:RFC:`1905#section-4.2.2`). The goal of the second phase is to actually read the Managed Object Instance which is...
python
def readGetNext(self, varBind, **context): """Read the next Managed Object Instance. Implements the second of the two phases of the SNMP GETNEXT command processing (:RFC:`1905#section-4.2.2`). The goal of the second phase is to actually read the Managed Object Instance which is...
[ "def", "readGetNext", "(", "self", ",", "varBind", ",", "**", "context", ")", ":", "name", ",", "val", "=", "varBind", "(", "debug", ".", "logger", "&", "debug", ".", "FLAG_INS", "and", "debug", ".", "logger", "(", "'%s: readGetNext(%s, %r)'", "%", "(", ...
Read the next Managed Object Instance. Implements the second of the two phases of the SNMP GETNEXT command processing (:RFC:`1905#section-4.2.2`). The goal of the second phase is to actually read the Managed Object Instance which is next in the MIB tree to the one being requested. ...
[ "Read", "the", "next", "Managed", "Object", "Instance", "." ]
cde062dd42f67dfd2d7686286a322d40e9c3a4b7
https://github.com/etingof/pysnmp/blob/cde062dd42f67dfd2d7686286a322d40e9c3a4b7/pysnmp/smi/mibs/SNMPv2-SMI.py#L1205-L1274
train
etingof/pysnmp
pysnmp/smi/mibs/SNMPv2-SMI.py
MibScalar.createCommit
def createCommit(self, varBind, **context): """Create Managed Object Instance. Implements the second of the multi-step workflow similar to the SNMP SET command processing (:RFC:`1905#section-4.2.5`). The goal of the second phase is to actually create requested Managed Object In...
python
def createCommit(self, varBind, **context): """Create Managed Object Instance. Implements the second of the multi-step workflow similar to the SNMP SET command processing (:RFC:`1905#section-4.2.5`). The goal of the second phase is to actually create requested Managed Object In...
[ "def", "createCommit", "(", "self", ",", "varBind", ",", "**", "context", ")", ":", "name", ",", "val", "=", "varBind", "(", "debug", ".", "logger", "&", "debug", ".", "FLAG_INS", "and", "debug", ".", "logger", "(", "'%s: writeCommit(%s, %r)'", "%", "(",...
Create Managed Object Instance. Implements the second of the multi-step workflow similar to the SNMP SET command processing (:RFC:`1905#section-4.2.5`). The goal of the second phase is to actually create requested Managed Object Instance. When multiple Managed Objects Instances are cre...
[ "Create", "Managed", "Object", "Instance", "." ]
cde062dd42f67dfd2d7686286a322d40e9c3a4b7
https://github.com/etingof/pysnmp/blob/cde062dd42f67dfd2d7686286a322d40e9c3a4b7/pysnmp/smi/mibs/SNMPv2-SMI.py#L1420-L1481
train
etingof/pysnmp
pysnmp/smi/mibs/SNMPv2-SMI.py
MibScalar.createCleanup
def createCleanup(self, varBind, **context): """Finalize Managed Object Instance creation. Implements the successful third step of the multi-step workflow similar to the SNMP SET command processing (:RFC:`1905#section-4.2.5`). The goal of the third (successful) phase is to seal the new...
python
def createCleanup(self, varBind, **context): """Finalize Managed Object Instance creation. Implements the successful third step of the multi-step workflow similar to the SNMP SET command processing (:RFC:`1905#section-4.2.5`). The goal of the third (successful) phase is to seal the new...
[ "def", "createCleanup", "(", "self", ",", "varBind", ",", "**", "context", ")", ":", "name", ",", "val", "=", "varBind", "(", "debug", ".", "logger", "&", "debug", ".", "FLAG_INS", "and", "debug", ".", "logger", "(", "'%s: createCleanup(%s, %r)'", "%", "...
Finalize Managed Object Instance creation. Implements the successful third step of the multi-step workflow similar to the SNMP SET command processing (:RFC:`1905#section-4.2.5`). The goal of the third (successful) phase is to seal the new Managed Object Instance. Once the system transi...
[ "Finalize", "Managed", "Object", "Instance", "creation", "." ]
cde062dd42f67dfd2d7686286a322d40e9c3a4b7
https://github.com/etingof/pysnmp/blob/cde062dd42f67dfd2d7686286a322d40e9c3a4b7/pysnmp/smi/mibs/SNMPv2-SMI.py#L1483-L1534
train
etingof/pysnmp
pysnmp/smi/mibs/SNMPv2-SMI.py
MibTableColumn.destroyCommit
def destroyCommit(self, varBind, **context): """Destroy Managed Object Instance. Implements the second of the multi-step workflow similar to the SNMP SET command processing (:RFC:`1905#section-4.2.5`). The goal of the second phase is to actually remove requested Managed Object ...
python
def destroyCommit(self, varBind, **context): """Destroy Managed Object Instance. Implements the second of the multi-step workflow similar to the SNMP SET command processing (:RFC:`1905#section-4.2.5`). The goal of the second phase is to actually remove requested Managed Object ...
[ "def", "destroyCommit", "(", "self", ",", "varBind", ",", "**", "context", ")", ":", "name", ",", "val", "=", "varBind", "(", "debug", ".", "logger", "&", "debug", ".", "FLAG_INS", "and", "debug", ".", "logger", "(", "'%s: destroyCommit(%s, %r)'", "%", "...
Destroy Managed Object Instance. Implements the second of the multi-step workflow similar to the SNMP SET command processing (:RFC:`1905#section-4.2.5`). The goal of the second phase is to actually remove requested Managed Object Instance from the MIB tree. When multiple Managed Object...
[ "Destroy", "Managed", "Object", "Instance", "." ]
cde062dd42f67dfd2d7686286a322d40e9c3a4b7
https://github.com/etingof/pysnmp/blob/cde062dd42f67dfd2d7686286a322d40e9c3a4b7/pysnmp/smi/mibs/SNMPv2-SMI.py#L2267-L2327
train
etingof/pysnmp
pysnmp/smi/mibs/SNMPv2-SMI.py
MibTableRow.oidToValue
def oidToValue(self, syntax, identifier, impliedFlag=False, parentIndices=None): """Turn SMI table instance identifier into a value object. SNMP SMI table objects are identified by OIDs composed of columnar object ID and instance index. The index part can be composed from the values of ...
python
def oidToValue(self, syntax, identifier, impliedFlag=False, parentIndices=None): """Turn SMI table instance identifier into a value object. SNMP SMI table objects are identified by OIDs composed of columnar object ID and instance index. The index part can be composed from the values of ...
[ "def", "oidToValue", "(", "self", ",", "syntax", ",", "identifier", ",", "impliedFlag", "=", "False", ",", "parentIndices", "=", "None", ")", ":", "if", "not", "identifier", ":", "raise", "error", ".", "SmiError", "(", "'Short OID for index %r'", "%", "(", ...
Turn SMI table instance identifier into a value object. SNMP SMI table objects are identified by OIDs composed of columnar object ID and instance index. The index part can be composed from the values of one or more tabular objects. This method takes sequence of integers, representing t...
[ "Turn", "SMI", "table", "instance", "identifier", "into", "a", "value", "object", "." ]
cde062dd42f67dfd2d7686286a322d40e9c3a4b7
https://github.com/etingof/pysnmp/blob/cde062dd42f67dfd2d7686286a322d40e9c3a4b7/pysnmp/smi/mibs/SNMPv2-SMI.py#L2478-L2548
train
etingof/pysnmp
pysnmp/smi/mibs/SNMPv2-SMI.py
MibTableRow.valueToOid
def valueToOid(self, value, impliedFlag=False, parentIndices=None): """Turn value object into SMI table instance identifier. SNMP SMI table objects are identified by OIDs composed of columnar object ID and instance index. The index part can be composed from the values of one or more tab...
python
def valueToOid(self, value, impliedFlag=False, parentIndices=None): """Turn value object into SMI table instance identifier. SNMP SMI table objects are identified by OIDs composed of columnar object ID and instance index. The index part can be composed from the values of one or more tab...
[ "def", "valueToOid", "(", "self", ",", "value", ",", "impliedFlag", "=", "False", ",", "parentIndices", "=", "None", ")", ":", "if", "hasattr", "(", "value", ",", "'cloneAsName'", ")", ":", "return", "value", ".", "cloneAsName", "(", "impliedFlag", ",", ...
Turn value object into SMI table instance identifier. SNMP SMI table objects are identified by OIDs composed of columnar object ID and instance index. The index part can be composed from the values of one or more tabular objects. This method takes an arbitrary value object and turns it...
[ "Turn", "value", "object", "into", "SMI", "table", "instance", "identifier", "." ]
cde062dd42f67dfd2d7686286a322d40e9c3a4b7
https://github.com/etingof/pysnmp/blob/cde062dd42f67dfd2d7686286a322d40e9c3a4b7/pysnmp/smi/mibs/SNMPv2-SMI.py#L2552-L2608
train
etingof/pysnmp
pysnmp/smi/mibs/SNMPv2-SMI.py
MibTableRow.announceManagementEvent
def announceManagementEvent(self, action, varBind, **context): """Announce mass operation on parent table's row. SNMP SMI provides a way to extend already existing SMI table with another table. Whenever a mass operation on parent table's column is performed (e.g. row creation or destruc...
python
def announceManagementEvent(self, action, varBind, **context): """Announce mass operation on parent table's row. SNMP SMI provides a way to extend already existing SMI table with another table. Whenever a mass operation on parent table's column is performed (e.g. row creation or destruc...
[ "def", "announceManagementEvent", "(", "self", ",", "action", ",", "varBind", ",", "**", "context", ")", ":", "name", ",", "val", "=", "varBind", "cbFun", "=", "context", "[", "'cbFun'", "]", "if", "not", "self", ".", "_augmentingRows", ":", "cbFun", "("...
Announce mass operation on parent table's row. SNMP SMI provides a way to extend already existing SMI table with another table. Whenever a mass operation on parent table's column is performed (e.g. row creation or destruction), this operation has to be propagated over all the extending ...
[ "Announce", "mass", "operation", "on", "parent", "table", "s", "row", "." ]
cde062dd42f67dfd2d7686286a322d40e9c3a4b7
https://github.com/etingof/pysnmp/blob/cde062dd42f67dfd2d7686286a322d40e9c3a4b7/pysnmp/smi/mibs/SNMPv2-SMI.py#L2612-L2693
train
etingof/pysnmp
pysnmp/smi/mibs/SNMPv2-SMI.py
MibTableRow.receiveManagementEvent
def receiveManagementEvent(self, action, varBind, **context): """Apply mass operation on extending table's row. SNMP SMI provides a way to extend already existing SMI table with another table. Whenever a mass operation on parent table's column is performed (e.g. row creation or destruct...
python
def receiveManagementEvent(self, action, varBind, **context): """Apply mass operation on extending table's row. SNMP SMI provides a way to extend already existing SMI table with another table. Whenever a mass operation on parent table's column is performed (e.g. row creation or destruct...
[ "def", "receiveManagementEvent", "(", "self", ",", "action", ",", "varBind", ",", "**", "context", ")", ":", "baseIndices", ",", "val", "=", "varBind", "instId", "=", "(", ")", "for", "impliedFlag", ",", "modName", ",", "symName", "in", "self", ".", "_in...
Apply mass operation on extending table's row. SNMP SMI provides a way to extend already existing SMI table with another table. Whenever a mass operation on parent table's column is performed (e.g. row creation or destruction), this operation has to be propagated over all the extending ...
[ "Apply", "mass", "operation", "on", "extending", "table", "s", "row", "." ]
cde062dd42f67dfd2d7686286a322d40e9c3a4b7
https://github.com/etingof/pysnmp/blob/cde062dd42f67dfd2d7686286a322d40e9c3a4b7/pysnmp/smi/mibs/SNMPv2-SMI.py#L2695-L2751
train
etingof/pysnmp
pysnmp/smi/mibs/SNMPv2-SMI.py
MibTableRow.registerAugmentation
def registerAugmentation(self, *names): """Register table extension. SNMP SMI provides a way to extend already existing SMI table with another table. This method registers dependent (extending) table (or type :py:class:`MibTableRow`) to already existing table. Whenever a row of...
python
def registerAugmentation(self, *names): """Register table extension. SNMP SMI provides a way to extend already existing SMI table with another table. This method registers dependent (extending) table (or type :py:class:`MibTableRow`) to already existing table. Whenever a row of...
[ "def", "registerAugmentation", "(", "self", ",", "*", "names", ")", ":", "for", "name", "in", "names", ":", "if", "name", "in", "self", ".", "_augmentingRows", ":", "raise", "error", ".", "SmiError", "(", "'Row %s already augmented by %s::%s'", "%", "(", "se...
Register table extension. SNMP SMI provides a way to extend already existing SMI table with another table. This method registers dependent (extending) table (or type :py:class:`MibTableRow`) to already existing table. Whenever a row of the parent table is created or destroyed, the ...
[ "Register", "table", "extension", "." ]
cde062dd42f67dfd2d7686286a322d40e9c3a4b7
https://github.com/etingof/pysnmp/blob/cde062dd42f67dfd2d7686286a322d40e9c3a4b7/pysnmp/smi/mibs/SNMPv2-SMI.py#L2753-L2779
train
etingof/pysnmp
pysnmp/smi/mibs/SNMPv2-SMI.py
MibTableRow._manageColumns
def _manageColumns(self, action, varBind, **context): """Apply a management action on all columns Parameters ---------- action: :py:class:`str` any of :py:class:`MibInstrumController`'s states to apply on all columns but the one passed in `varBind` varBind: :py:clas...
python
def _manageColumns(self, action, varBind, **context): """Apply a management action on all columns Parameters ---------- action: :py:class:`str` any of :py:class:`MibInstrumController`'s states to apply on all columns but the one passed in `varBind` varBind: :py:clas...
[ "def", "_manageColumns", "(", "self", ",", "action", ",", "varBind", ",", "**", "context", ")", ":", "name", ",", "val", "=", "varBind", "(", "debug", ".", "logger", "&", "debug", ".", "FLAG_INS", "and", "debug", ".", "logger", "(", "'%s: _manageColumns(...
Apply a management action on all columns Parameters ---------- action: :py:class:`str` any of :py:class:`MibInstrumController`'s states to apply on all columns but the one passed in `varBind` varBind: :py:class:`~pysnmp.smi.rfc1902.ObjectType` object representing ...
[ "Apply", "a", "management", "action", "on", "all", "columns" ]
cde062dd42f67dfd2d7686286a322d40e9c3a4b7
https://github.com/etingof/pysnmp/blob/cde062dd42f67dfd2d7686286a322d40e9c3a4b7/pysnmp/smi/mibs/SNMPv2-SMI.py#L2791-L2879
train
etingof/pysnmp
pysnmp/smi/mibs/SNMPv2-SMI.py
MibTableRow._checkColumns
def _checkColumns(self, varBind, **context): """Check the consistency of all columns. Parameters ---------- varBind: :py:class:`~pysnmp.smi.rfc1902.ObjectType` object representing new :py:class:`RowStatus` Managed Object Instance value being set on table row ...
python
def _checkColumns(self, varBind, **context): """Check the consistency of all columns. Parameters ---------- varBind: :py:class:`~pysnmp.smi.rfc1902.ObjectType` object representing new :py:class:`RowStatus` Managed Object Instance value being set on table row ...
[ "def", "_checkColumns", "(", "self", ",", "varBind", ",", "**", "context", ")", ":", "name", ",", "val", "=", "varBind", "(", "debug", ".", "logger", "&", "debug", ".", "FLAG_INS", "and", "debug", ".", "logger", "(", "'%s: _checkColumns(%s, %r)'", "%", "...
Check the consistency of all columns. Parameters ---------- varBind: :py:class:`~pysnmp.smi.rfc1902.ObjectType` object representing new :py:class:`RowStatus` Managed Object Instance value being set on table row Other Parameters ---------------- ...
[ "Check", "the", "consistency", "of", "all", "columns", "." ]
cde062dd42f67dfd2d7686286a322d40e9c3a4b7
https://github.com/etingof/pysnmp/blob/cde062dd42f67dfd2d7686286a322d40e9c3a4b7/pysnmp/smi/mibs/SNMPv2-SMI.py#L2881-L2949
train
etingof/pysnmp
pysnmp/smi/mibs/SNMPv2-SMI.py
MibTableRow.getIndicesFromInstId
def getIndicesFromInstId(self, instId): """Return index values for instance identification""" if instId in self._idToIdxCache: return self._idToIdxCache[instId] indices = [] for impliedFlag, modName, symName in self._indexNames: mibObj, = mibBuilder.importSymbols...
python
def getIndicesFromInstId(self, instId): """Return index values for instance identification""" if instId in self._idToIdxCache: return self._idToIdxCache[instId] indices = [] for impliedFlag, modName, symName in self._indexNames: mibObj, = mibBuilder.importSymbols...
[ "def", "getIndicesFromInstId", "(", "self", ",", "instId", ")", ":", "if", "instId", "in", "self", ".", "_idToIdxCache", ":", "return", "self", ".", "_idToIdxCache", "[", "instId", "]", "indices", "=", "[", "]", "for", "impliedFlag", ",", "modName", ",", ...
Return index values for instance identification
[ "Return", "index", "values", "for", "instance", "identification" ]
cde062dd42f67dfd2d7686286a322d40e9c3a4b7
https://github.com/etingof/pysnmp/blob/cde062dd42f67dfd2d7686286a322d40e9c3a4b7/pysnmp/smi/mibs/SNMPv2-SMI.py#L3278-L3306
train