repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
brocade/pynos | pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py | brocade_vswitch.get_vnetwork_dvs_output_vnetwork_dvs_interface_name | def get_vnetwork_dvs_output_vnetwork_dvs_interface_name(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vnetwork_dvs = ET.Element("get_vnetwork_dvs")
config = get_vnetwork_dvs
output = ET.SubElement(get_vnetwork_dvs, "output")
vnetwork_dvs = ET.SubElement(output, "vnetwork-dvs")
interface_name = ET.SubElement(vnetwork_dvs, "interface-name")
interface_name.text = kwargs.pop('interface_name')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def get_vnetwork_dvs_output_vnetwork_dvs_interface_name(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vnetwork_dvs = ET.Element("get_vnetwork_dvs")
config = get_vnetwork_dvs
output = ET.SubElement(get_vnetwork_dvs, "output")
vnetwork_dvs = ET.SubElement(output, "vnetwork-dvs")
interface_name = ET.SubElement(vnetwork_dvs, "interface-name")
interface_name.text = kwargs.pop('interface_name')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"get_vnetwork_dvs_output_vnetwork_dvs_interface_name",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"get_vnetwork_dvs",
"=",
"ET",
".",
"Element",
"(",
"\"get_vnetwork_dvs\"",
")",
"config",
... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py#L592-L604 |
brocade/pynos | pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py | brocade_vswitch.get_vnetwork_dvs_output_has_more | def get_vnetwork_dvs_output_has_more(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vnetwork_dvs = ET.Element("get_vnetwork_dvs")
config = get_vnetwork_dvs
output = ET.SubElement(get_vnetwork_dvs, "output")
has_more = ET.SubElement(output, "has-more")
has_more.text = kwargs.pop('has_more')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def get_vnetwork_dvs_output_has_more(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vnetwork_dvs = ET.Element("get_vnetwork_dvs")
config = get_vnetwork_dvs
output = ET.SubElement(get_vnetwork_dvs, "output")
has_more = ET.SubElement(output, "has-more")
has_more.text = kwargs.pop('has_more')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"get_vnetwork_dvs_output_has_more",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"get_vnetwork_dvs",
"=",
"ET",
".",
"Element",
"(",
"\"get_vnetwork_dvs\"",
")",
"config",
"=",
"get_vnetwor... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py#L606-L617 |
brocade/pynos | pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py | brocade_vswitch.get_vnetwork_dvs_output_instance_id | def get_vnetwork_dvs_output_instance_id(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vnetwork_dvs = ET.Element("get_vnetwork_dvs")
config = get_vnetwork_dvs
output = ET.SubElement(get_vnetwork_dvs, "output")
instance_id = ET.SubElement(output, "instance-id")
instance_id.text = kwargs.pop('instance_id')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def get_vnetwork_dvs_output_instance_id(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vnetwork_dvs = ET.Element("get_vnetwork_dvs")
config = get_vnetwork_dvs
output = ET.SubElement(get_vnetwork_dvs, "output")
instance_id = ET.SubElement(output, "instance-id")
instance_id.text = kwargs.pop('instance_id')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"get_vnetwork_dvs_output_instance_id",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"get_vnetwork_dvs",
"=",
"ET",
".",
"Element",
"(",
"\"get_vnetwork_dvs\"",
")",
"config",
"=",
"get_vnet... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py#L619-L630 |
brocade/pynos | pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py | brocade_vswitch.get_vnetwork_vswitches_input_name | def get_vnetwork_vswitches_input_name(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vnetwork_vswitches = ET.Element("get_vnetwork_vswitches")
config = get_vnetwork_vswitches
input = ET.SubElement(get_vnetwork_vswitches, "input")
name = ET.SubElement(input, "name")
name.text = kwargs.pop('name')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def get_vnetwork_vswitches_input_name(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vnetwork_vswitches = ET.Element("get_vnetwork_vswitches")
config = get_vnetwork_vswitches
input = ET.SubElement(get_vnetwork_vswitches, "input")
name = ET.SubElement(input, "name")
name.text = kwargs.pop('name')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"get_vnetwork_vswitches_input_name",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"get_vnetwork_vswitches",
"=",
"ET",
".",
"Element",
"(",
"\"get_vnetwork_vswitches\"",
")",
"config",
"=",
... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py#L632-L643 |
brocade/pynos | pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py | brocade_vswitch.get_vnetwork_vswitches_input_vcenter | def get_vnetwork_vswitches_input_vcenter(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vnetwork_vswitches = ET.Element("get_vnetwork_vswitches")
config = get_vnetwork_vswitches
input = ET.SubElement(get_vnetwork_vswitches, "input")
vcenter = ET.SubElement(input, "vcenter")
vcenter.text = kwargs.pop('vcenter')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def get_vnetwork_vswitches_input_vcenter(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vnetwork_vswitches = ET.Element("get_vnetwork_vswitches")
config = get_vnetwork_vswitches
input = ET.SubElement(get_vnetwork_vswitches, "input")
vcenter = ET.SubElement(input, "vcenter")
vcenter.text = kwargs.pop('vcenter')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"get_vnetwork_vswitches_input_vcenter",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"get_vnetwork_vswitches",
"=",
"ET",
".",
"Element",
"(",
"\"get_vnetwork_vswitches\"",
")",
"config",
"="... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py#L645-L656 |
brocade/pynos | pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py | brocade_vswitch.get_vnetwork_vswitches_input_datacenter | def get_vnetwork_vswitches_input_datacenter(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vnetwork_vswitches = ET.Element("get_vnetwork_vswitches")
config = get_vnetwork_vswitches
input = ET.SubElement(get_vnetwork_vswitches, "input")
datacenter = ET.SubElement(input, "datacenter")
datacenter.text = kwargs.pop('datacenter')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def get_vnetwork_vswitches_input_datacenter(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vnetwork_vswitches = ET.Element("get_vnetwork_vswitches")
config = get_vnetwork_vswitches
input = ET.SubElement(get_vnetwork_vswitches, "input")
datacenter = ET.SubElement(input, "datacenter")
datacenter.text = kwargs.pop('datacenter')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"get_vnetwork_vswitches_input_datacenter",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"get_vnetwork_vswitches",
"=",
"ET",
".",
"Element",
"(",
"\"get_vnetwork_vswitches\"",
")",
"config",
... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py#L658-L669 |
brocade/pynos | pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py | brocade_vswitch.get_vnetwork_vswitches_input_last_rcvd_instance | def get_vnetwork_vswitches_input_last_rcvd_instance(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vnetwork_vswitches = ET.Element("get_vnetwork_vswitches")
config = get_vnetwork_vswitches
input = ET.SubElement(get_vnetwork_vswitches, "input")
last_rcvd_instance = ET.SubElement(input, "last-rcvd-instance")
last_rcvd_instance.text = kwargs.pop('last_rcvd_instance')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def get_vnetwork_vswitches_input_last_rcvd_instance(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vnetwork_vswitches = ET.Element("get_vnetwork_vswitches")
config = get_vnetwork_vswitches
input = ET.SubElement(get_vnetwork_vswitches, "input")
last_rcvd_instance = ET.SubElement(input, "last-rcvd-instance")
last_rcvd_instance.text = kwargs.pop('last_rcvd_instance')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"get_vnetwork_vswitches_input_last_rcvd_instance",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"get_vnetwork_vswitches",
"=",
"ET",
".",
"Element",
"(",
"\"get_vnetwork_vswitches\"",
")",
"con... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py#L671-L682 |
brocade/pynos | pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py | brocade_vswitch.get_vnetwork_vswitches_output_vnetwork_vswitches_name | def get_vnetwork_vswitches_output_vnetwork_vswitches_name(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vnetwork_vswitches = ET.Element("get_vnetwork_vswitches")
config = get_vnetwork_vswitches
output = ET.SubElement(get_vnetwork_vswitches, "output")
vnetwork_vswitches = ET.SubElement(output, "vnetwork-vswitches")
name = ET.SubElement(vnetwork_vswitches, "name")
name.text = kwargs.pop('name')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def get_vnetwork_vswitches_output_vnetwork_vswitches_name(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vnetwork_vswitches = ET.Element("get_vnetwork_vswitches")
config = get_vnetwork_vswitches
output = ET.SubElement(get_vnetwork_vswitches, "output")
vnetwork_vswitches = ET.SubElement(output, "vnetwork-vswitches")
name = ET.SubElement(vnetwork_vswitches, "name")
name.text = kwargs.pop('name')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"get_vnetwork_vswitches_output_vnetwork_vswitches_name",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"get_vnetwork_vswitches",
"=",
"ET",
".",
"Element",
"(",
"\"get_vnetwork_vswitches\"",
")",
... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py#L684-L696 |
brocade/pynos | pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py | brocade_vswitch.get_vnetwork_vswitches_output_vnetwork_vswitches_host | def get_vnetwork_vswitches_output_vnetwork_vswitches_host(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vnetwork_vswitches = ET.Element("get_vnetwork_vswitches")
config = get_vnetwork_vswitches
output = ET.SubElement(get_vnetwork_vswitches, "output")
vnetwork_vswitches = ET.SubElement(output, "vnetwork-vswitches")
host = ET.SubElement(vnetwork_vswitches, "host")
host.text = kwargs.pop('host')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def get_vnetwork_vswitches_output_vnetwork_vswitches_host(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vnetwork_vswitches = ET.Element("get_vnetwork_vswitches")
config = get_vnetwork_vswitches
output = ET.SubElement(get_vnetwork_vswitches, "output")
vnetwork_vswitches = ET.SubElement(output, "vnetwork-vswitches")
host = ET.SubElement(vnetwork_vswitches, "host")
host.text = kwargs.pop('host')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"get_vnetwork_vswitches_output_vnetwork_vswitches_host",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"get_vnetwork_vswitches",
"=",
"ET",
".",
"Element",
"(",
"\"get_vnetwork_vswitches\"",
")",
... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py#L698-L710 |
brocade/pynos | pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py | brocade_vswitch.get_vnetwork_vswitches_output_vnetwork_vswitches_datacenter | def get_vnetwork_vswitches_output_vnetwork_vswitches_datacenter(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vnetwork_vswitches = ET.Element("get_vnetwork_vswitches")
config = get_vnetwork_vswitches
output = ET.SubElement(get_vnetwork_vswitches, "output")
vnetwork_vswitches = ET.SubElement(output, "vnetwork-vswitches")
datacenter = ET.SubElement(vnetwork_vswitches, "datacenter")
datacenter.text = kwargs.pop('datacenter')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def get_vnetwork_vswitches_output_vnetwork_vswitches_datacenter(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vnetwork_vswitches = ET.Element("get_vnetwork_vswitches")
config = get_vnetwork_vswitches
output = ET.SubElement(get_vnetwork_vswitches, "output")
vnetwork_vswitches = ET.SubElement(output, "vnetwork-vswitches")
datacenter = ET.SubElement(vnetwork_vswitches, "datacenter")
datacenter.text = kwargs.pop('datacenter')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"get_vnetwork_vswitches_output_vnetwork_vswitches_datacenter",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"get_vnetwork_vswitches",
"=",
"ET",
".",
"Element",
"(",
"\"get_vnetwork_vswitches\"",
... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py#L712-L724 |
brocade/pynos | pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py | brocade_vswitch.get_vnetwork_vswitches_output_vnetwork_vswitches_pnic | def get_vnetwork_vswitches_output_vnetwork_vswitches_pnic(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vnetwork_vswitches = ET.Element("get_vnetwork_vswitches")
config = get_vnetwork_vswitches
output = ET.SubElement(get_vnetwork_vswitches, "output")
vnetwork_vswitches = ET.SubElement(output, "vnetwork-vswitches")
pnic = ET.SubElement(vnetwork_vswitches, "pnic")
pnic.text = kwargs.pop('pnic')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def get_vnetwork_vswitches_output_vnetwork_vswitches_pnic(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vnetwork_vswitches = ET.Element("get_vnetwork_vswitches")
config = get_vnetwork_vswitches
output = ET.SubElement(get_vnetwork_vswitches, "output")
vnetwork_vswitches = ET.SubElement(output, "vnetwork-vswitches")
pnic = ET.SubElement(vnetwork_vswitches, "pnic")
pnic.text = kwargs.pop('pnic')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"get_vnetwork_vswitches_output_vnetwork_vswitches_pnic",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"get_vnetwork_vswitches",
"=",
"ET",
".",
"Element",
"(",
"\"get_vnetwork_vswitches\"",
")",
... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py#L726-L738 |
brocade/pynos | pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py | brocade_vswitch.get_vnetwork_vswitches_output_vnetwork_vswitches_interface_type | def get_vnetwork_vswitches_output_vnetwork_vswitches_interface_type(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vnetwork_vswitches = ET.Element("get_vnetwork_vswitches")
config = get_vnetwork_vswitches
output = ET.SubElement(get_vnetwork_vswitches, "output")
vnetwork_vswitches = ET.SubElement(output, "vnetwork-vswitches")
interface_type = ET.SubElement(vnetwork_vswitches, "interface-type")
interface_type.text = kwargs.pop('interface_type')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def get_vnetwork_vswitches_output_vnetwork_vswitches_interface_type(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vnetwork_vswitches = ET.Element("get_vnetwork_vswitches")
config = get_vnetwork_vswitches
output = ET.SubElement(get_vnetwork_vswitches, "output")
vnetwork_vswitches = ET.SubElement(output, "vnetwork-vswitches")
interface_type = ET.SubElement(vnetwork_vswitches, "interface-type")
interface_type.text = kwargs.pop('interface_type')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"get_vnetwork_vswitches_output_vnetwork_vswitches_interface_type",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"get_vnetwork_vswitches",
"=",
"ET",
".",
"Element",
"(",
"\"get_vnetwork_vswitches\"... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py#L740-L752 |
brocade/pynos | pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py | brocade_vswitch.get_vnetwork_vswitches_output_vnetwork_vswitches_interface_name | def get_vnetwork_vswitches_output_vnetwork_vswitches_interface_name(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vnetwork_vswitches = ET.Element("get_vnetwork_vswitches")
config = get_vnetwork_vswitches
output = ET.SubElement(get_vnetwork_vswitches, "output")
vnetwork_vswitches = ET.SubElement(output, "vnetwork-vswitches")
interface_name = ET.SubElement(vnetwork_vswitches, "interface-name")
interface_name.text = kwargs.pop('interface_name')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def get_vnetwork_vswitches_output_vnetwork_vswitches_interface_name(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vnetwork_vswitches = ET.Element("get_vnetwork_vswitches")
config = get_vnetwork_vswitches
output = ET.SubElement(get_vnetwork_vswitches, "output")
vnetwork_vswitches = ET.SubElement(output, "vnetwork-vswitches")
interface_name = ET.SubElement(vnetwork_vswitches, "interface-name")
interface_name.text = kwargs.pop('interface_name')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"get_vnetwork_vswitches_output_vnetwork_vswitches_interface_name",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"get_vnetwork_vswitches",
"=",
"ET",
".",
"Element",
"(",
"\"get_vnetwork_vswitches\"... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py#L754-L766 |
brocade/pynos | pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py | brocade_vswitch.get_vnetwork_vswitches_output_has_more | def get_vnetwork_vswitches_output_has_more(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vnetwork_vswitches = ET.Element("get_vnetwork_vswitches")
config = get_vnetwork_vswitches
output = ET.SubElement(get_vnetwork_vswitches, "output")
has_more = ET.SubElement(output, "has-more")
has_more.text = kwargs.pop('has_more')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def get_vnetwork_vswitches_output_has_more(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vnetwork_vswitches = ET.Element("get_vnetwork_vswitches")
config = get_vnetwork_vswitches
output = ET.SubElement(get_vnetwork_vswitches, "output")
has_more = ET.SubElement(output, "has-more")
has_more.text = kwargs.pop('has_more')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"get_vnetwork_vswitches_output_has_more",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"get_vnetwork_vswitches",
"=",
"ET",
".",
"Element",
"(",
"\"get_vnetwork_vswitches\"",
")",
"config",
"... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py#L768-L779 |
brocade/pynos | pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py | brocade_vswitch.get_vnetwork_vswitches_output_instance_id | def get_vnetwork_vswitches_output_instance_id(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vnetwork_vswitches = ET.Element("get_vnetwork_vswitches")
config = get_vnetwork_vswitches
output = ET.SubElement(get_vnetwork_vswitches, "output")
instance_id = ET.SubElement(output, "instance-id")
instance_id.text = kwargs.pop('instance_id')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def get_vnetwork_vswitches_output_instance_id(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vnetwork_vswitches = ET.Element("get_vnetwork_vswitches")
config = get_vnetwork_vswitches
output = ET.SubElement(get_vnetwork_vswitches, "output")
instance_id = ET.SubElement(output, "instance-id")
instance_id.text = kwargs.pop('instance_id')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"get_vnetwork_vswitches_output_instance_id",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"get_vnetwork_vswitches",
"=",
"ET",
".",
"Element",
"(",
"\"get_vnetwork_vswitches\"",
")",
"config",
... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py#L781-L792 |
brocade/pynos | pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py | brocade_vswitch.get_vnetwork_portgroups_input_name | def get_vnetwork_portgroups_input_name(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vnetwork_portgroups = ET.Element("get_vnetwork_portgroups")
config = get_vnetwork_portgroups
input = ET.SubElement(get_vnetwork_portgroups, "input")
name = ET.SubElement(input, "name")
name.text = kwargs.pop('name')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def get_vnetwork_portgroups_input_name(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vnetwork_portgroups = ET.Element("get_vnetwork_portgroups")
config = get_vnetwork_portgroups
input = ET.SubElement(get_vnetwork_portgroups, "input")
name = ET.SubElement(input, "name")
name.text = kwargs.pop('name')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"get_vnetwork_portgroups_input_name",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"get_vnetwork_portgroups",
"=",
"ET",
".",
"Element",
"(",
"\"get_vnetwork_portgroups\"",
")",
"config",
"="... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py#L794-L805 |
brocade/pynos | pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py | brocade_vswitch.get_vnetwork_portgroups_input_vcenter | def get_vnetwork_portgroups_input_vcenter(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vnetwork_portgroups = ET.Element("get_vnetwork_portgroups")
config = get_vnetwork_portgroups
input = ET.SubElement(get_vnetwork_portgroups, "input")
vcenter = ET.SubElement(input, "vcenter")
vcenter.text = kwargs.pop('vcenter')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def get_vnetwork_portgroups_input_vcenter(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vnetwork_portgroups = ET.Element("get_vnetwork_portgroups")
config = get_vnetwork_portgroups
input = ET.SubElement(get_vnetwork_portgroups, "input")
vcenter = ET.SubElement(input, "vcenter")
vcenter.text = kwargs.pop('vcenter')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"get_vnetwork_portgroups_input_vcenter",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"get_vnetwork_portgroups",
"=",
"ET",
".",
"Element",
"(",
"\"get_vnetwork_portgroups\"",
")",
"config",
... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py#L807-L818 |
brocade/pynos | pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py | brocade_vswitch.get_vnetwork_portgroups_input_datacenter | def get_vnetwork_portgroups_input_datacenter(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vnetwork_portgroups = ET.Element("get_vnetwork_portgroups")
config = get_vnetwork_portgroups
input = ET.SubElement(get_vnetwork_portgroups, "input")
datacenter = ET.SubElement(input, "datacenter")
datacenter.text = kwargs.pop('datacenter')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def get_vnetwork_portgroups_input_datacenter(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vnetwork_portgroups = ET.Element("get_vnetwork_portgroups")
config = get_vnetwork_portgroups
input = ET.SubElement(get_vnetwork_portgroups, "input")
datacenter = ET.SubElement(input, "datacenter")
datacenter.text = kwargs.pop('datacenter')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"get_vnetwork_portgroups_input_datacenter",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"get_vnetwork_portgroups",
"=",
"ET",
".",
"Element",
"(",
"\"get_vnetwork_portgroups\"",
")",
"config",... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py#L820-L831 |
brocade/pynos | pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py | brocade_vswitch.get_vnetwork_portgroups_input_last_rcvd_instance | def get_vnetwork_portgroups_input_last_rcvd_instance(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vnetwork_portgroups = ET.Element("get_vnetwork_portgroups")
config = get_vnetwork_portgroups
input = ET.SubElement(get_vnetwork_portgroups, "input")
last_rcvd_instance = ET.SubElement(input, "last-rcvd-instance")
last_rcvd_instance.text = kwargs.pop('last_rcvd_instance')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def get_vnetwork_portgroups_input_last_rcvd_instance(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vnetwork_portgroups = ET.Element("get_vnetwork_portgroups")
config = get_vnetwork_portgroups
input = ET.SubElement(get_vnetwork_portgroups, "input")
last_rcvd_instance = ET.SubElement(input, "last-rcvd-instance")
last_rcvd_instance.text = kwargs.pop('last_rcvd_instance')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"get_vnetwork_portgroups_input_last_rcvd_instance",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"get_vnetwork_portgroups",
"=",
"ET",
".",
"Element",
"(",
"\"get_vnetwork_portgroups\"",
")",
"... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py#L833-L844 |
brocade/pynos | pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py | brocade_vswitch.get_vnetwork_portgroups_output_vnetwork_pgs_name | def get_vnetwork_portgroups_output_vnetwork_pgs_name(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vnetwork_portgroups = ET.Element("get_vnetwork_portgroups")
config = get_vnetwork_portgroups
output = ET.SubElement(get_vnetwork_portgroups, "output")
vnetwork_pgs = ET.SubElement(output, "vnetwork-pgs")
name = ET.SubElement(vnetwork_pgs, "name")
name.text = kwargs.pop('name')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def get_vnetwork_portgroups_output_vnetwork_pgs_name(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vnetwork_portgroups = ET.Element("get_vnetwork_portgroups")
config = get_vnetwork_portgroups
output = ET.SubElement(get_vnetwork_portgroups, "output")
vnetwork_pgs = ET.SubElement(output, "vnetwork-pgs")
name = ET.SubElement(vnetwork_pgs, "name")
name.text = kwargs.pop('name')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"get_vnetwork_portgroups_output_vnetwork_pgs_name",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"get_vnetwork_portgroups",
"=",
"ET",
".",
"Element",
"(",
"\"get_vnetwork_portgroups\"",
")",
"... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py#L846-L858 |
brocade/pynos | pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py | brocade_vswitch.get_vnetwork_portgroups_output_vnetwork_pgs_datacenter | def get_vnetwork_portgroups_output_vnetwork_pgs_datacenter(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vnetwork_portgroups = ET.Element("get_vnetwork_portgroups")
config = get_vnetwork_portgroups
output = ET.SubElement(get_vnetwork_portgroups, "output")
vnetwork_pgs = ET.SubElement(output, "vnetwork-pgs")
datacenter = ET.SubElement(vnetwork_pgs, "datacenter")
datacenter.text = kwargs.pop('datacenter')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def get_vnetwork_portgroups_output_vnetwork_pgs_datacenter(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vnetwork_portgroups = ET.Element("get_vnetwork_portgroups")
config = get_vnetwork_portgroups
output = ET.SubElement(get_vnetwork_portgroups, "output")
vnetwork_pgs = ET.SubElement(output, "vnetwork-pgs")
datacenter = ET.SubElement(vnetwork_pgs, "datacenter")
datacenter.text = kwargs.pop('datacenter')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"get_vnetwork_portgroups_output_vnetwork_pgs_datacenter",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"get_vnetwork_portgroups",
"=",
"ET",
".",
"Element",
"(",
"\"get_vnetwork_portgroups\"",
")... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py#L860-L872 |
brocade/pynos | pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py | brocade_vswitch.get_vnetwork_portgroups_output_vnetwork_pgs_vs_nn | def get_vnetwork_portgroups_output_vnetwork_pgs_vs_nn(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vnetwork_portgroups = ET.Element("get_vnetwork_portgroups")
config = get_vnetwork_portgroups
output = ET.SubElement(get_vnetwork_portgroups, "output")
vnetwork_pgs = ET.SubElement(output, "vnetwork-pgs")
vs_nn = ET.SubElement(vnetwork_pgs, "vs-nn")
vs_nn.text = kwargs.pop('vs_nn')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def get_vnetwork_portgroups_output_vnetwork_pgs_vs_nn(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vnetwork_portgroups = ET.Element("get_vnetwork_portgroups")
config = get_vnetwork_portgroups
output = ET.SubElement(get_vnetwork_portgroups, "output")
vnetwork_pgs = ET.SubElement(output, "vnetwork-pgs")
vs_nn = ET.SubElement(vnetwork_pgs, "vs-nn")
vs_nn.text = kwargs.pop('vs_nn')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"get_vnetwork_portgroups_output_vnetwork_pgs_vs_nn",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"get_vnetwork_portgroups",
"=",
"ET",
".",
"Element",
"(",
"\"get_vnetwork_portgroups\"",
")",
... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py#L874-L886 |
brocade/pynos | pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py | brocade_vswitch.get_vnetwork_portgroups_output_vnetwork_pgs_vlan | def get_vnetwork_portgroups_output_vnetwork_pgs_vlan(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vnetwork_portgroups = ET.Element("get_vnetwork_portgroups")
config = get_vnetwork_portgroups
output = ET.SubElement(get_vnetwork_portgroups, "output")
vnetwork_pgs = ET.SubElement(output, "vnetwork-pgs")
vlan = ET.SubElement(vnetwork_pgs, "vlan")
vlan.text = kwargs.pop('vlan')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def get_vnetwork_portgroups_output_vnetwork_pgs_vlan(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vnetwork_portgroups = ET.Element("get_vnetwork_portgroups")
config = get_vnetwork_portgroups
output = ET.SubElement(get_vnetwork_portgroups, "output")
vnetwork_pgs = ET.SubElement(output, "vnetwork-pgs")
vlan = ET.SubElement(vnetwork_pgs, "vlan")
vlan.text = kwargs.pop('vlan')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"get_vnetwork_portgroups_output_vnetwork_pgs_vlan",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"get_vnetwork_portgroups",
"=",
"ET",
".",
"Element",
"(",
"\"get_vnetwork_portgroups\"",
")",
"... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py#L888-L900 |
brocade/pynos | pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py | brocade_vswitch.get_vnetwork_portgroups_output_vnetwork_pgs_host_nn | def get_vnetwork_portgroups_output_vnetwork_pgs_host_nn(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vnetwork_portgroups = ET.Element("get_vnetwork_portgroups")
config = get_vnetwork_portgroups
output = ET.SubElement(get_vnetwork_portgroups, "output")
vnetwork_pgs = ET.SubElement(output, "vnetwork-pgs")
host_nn = ET.SubElement(vnetwork_pgs, "host-nn")
host_nn.text = kwargs.pop('host_nn')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def get_vnetwork_portgroups_output_vnetwork_pgs_host_nn(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vnetwork_portgroups = ET.Element("get_vnetwork_portgroups")
config = get_vnetwork_portgroups
output = ET.SubElement(get_vnetwork_portgroups, "output")
vnetwork_pgs = ET.SubElement(output, "vnetwork-pgs")
host_nn = ET.SubElement(vnetwork_pgs, "host-nn")
host_nn.text = kwargs.pop('host_nn')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"get_vnetwork_portgroups_output_vnetwork_pgs_host_nn",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"get_vnetwork_portgroups",
"=",
"ET",
".",
"Element",
"(",
"\"get_vnetwork_portgroups\"",
")",
... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py#L902-L914 |
brocade/pynos | pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py | brocade_vswitch.get_vnetwork_portgroups_output_has_more | def get_vnetwork_portgroups_output_has_more(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vnetwork_portgroups = ET.Element("get_vnetwork_portgroups")
config = get_vnetwork_portgroups
output = ET.SubElement(get_vnetwork_portgroups, "output")
has_more = ET.SubElement(output, "has-more")
has_more.text = kwargs.pop('has_more')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def get_vnetwork_portgroups_output_has_more(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vnetwork_portgroups = ET.Element("get_vnetwork_portgroups")
config = get_vnetwork_portgroups
output = ET.SubElement(get_vnetwork_portgroups, "output")
has_more = ET.SubElement(output, "has-more")
has_more.text = kwargs.pop('has_more')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"get_vnetwork_portgroups_output_has_more",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"get_vnetwork_portgroups",
"=",
"ET",
".",
"Element",
"(",
"\"get_vnetwork_portgroups\"",
")",
"config",
... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py#L916-L927 |
brocade/pynos | pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py | brocade_vswitch.get_vnetwork_portgroups_output_instance_id | def get_vnetwork_portgroups_output_instance_id(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vnetwork_portgroups = ET.Element("get_vnetwork_portgroups")
config = get_vnetwork_portgroups
output = ET.SubElement(get_vnetwork_portgroups, "output")
instance_id = ET.SubElement(output, "instance-id")
instance_id.text = kwargs.pop('instance_id')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def get_vnetwork_portgroups_output_instance_id(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vnetwork_portgroups = ET.Element("get_vnetwork_portgroups")
config = get_vnetwork_portgroups
output = ET.SubElement(get_vnetwork_portgroups, "output")
instance_id = ET.SubElement(output, "instance-id")
instance_id.text = kwargs.pop('instance_id')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"get_vnetwork_portgroups_output_instance_id",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"get_vnetwork_portgroups",
"=",
"ET",
".",
"Element",
"(",
"\"get_vnetwork_portgroups\"",
")",
"config... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py#L929-L940 |
brocade/pynos | pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py | brocade_vswitch.get_vmpolicy_macaddr_input_mac | def get_vmpolicy_macaddr_input_mac(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vmpolicy_macaddr = ET.Element("get_vmpolicy_macaddr")
config = get_vmpolicy_macaddr
input = ET.SubElement(get_vmpolicy_macaddr, "input")
mac = ET.SubElement(input, "mac")
mac.text = kwargs.pop('mac')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def get_vmpolicy_macaddr_input_mac(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vmpolicy_macaddr = ET.Element("get_vmpolicy_macaddr")
config = get_vmpolicy_macaddr
input = ET.SubElement(get_vmpolicy_macaddr, "input")
mac = ET.SubElement(input, "mac")
mac.text = kwargs.pop('mac')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"get_vmpolicy_macaddr_input_mac",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"get_vmpolicy_macaddr",
"=",
"ET",
".",
"Element",
"(",
"\"get_vmpolicy_macaddr\"",
")",
"config",
"=",
"get_v... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py#L942-L953 |
brocade/pynos | pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py | brocade_vswitch.get_vmpolicy_macaddr_input_vcenter | def get_vmpolicy_macaddr_input_vcenter(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vmpolicy_macaddr = ET.Element("get_vmpolicy_macaddr")
config = get_vmpolicy_macaddr
input = ET.SubElement(get_vmpolicy_macaddr, "input")
vcenter = ET.SubElement(input, "vcenter")
vcenter.text = kwargs.pop('vcenter')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def get_vmpolicy_macaddr_input_vcenter(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vmpolicy_macaddr = ET.Element("get_vmpolicy_macaddr")
config = get_vmpolicy_macaddr
input = ET.SubElement(get_vmpolicy_macaddr, "input")
vcenter = ET.SubElement(input, "vcenter")
vcenter.text = kwargs.pop('vcenter')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"get_vmpolicy_macaddr_input_vcenter",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"get_vmpolicy_macaddr",
"=",
"ET",
".",
"Element",
"(",
"\"get_vmpolicy_macaddr\"",
")",
"config",
"=",
"g... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py#L955-L966 |
brocade/pynos | pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py | brocade_vswitch.get_vmpolicy_macaddr_input_datacenter | def get_vmpolicy_macaddr_input_datacenter(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vmpolicy_macaddr = ET.Element("get_vmpolicy_macaddr")
config = get_vmpolicy_macaddr
input = ET.SubElement(get_vmpolicy_macaddr, "input")
datacenter = ET.SubElement(input, "datacenter")
datacenter.text = kwargs.pop('datacenter')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def get_vmpolicy_macaddr_input_datacenter(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vmpolicy_macaddr = ET.Element("get_vmpolicy_macaddr")
config = get_vmpolicy_macaddr
input = ET.SubElement(get_vmpolicy_macaddr, "input")
datacenter = ET.SubElement(input, "datacenter")
datacenter.text = kwargs.pop('datacenter')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"get_vmpolicy_macaddr_input_datacenter",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"get_vmpolicy_macaddr",
"=",
"ET",
".",
"Element",
"(",
"\"get_vmpolicy_macaddr\"",
")",
"config",
"=",
... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py#L968-L979 |
brocade/pynos | pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py | brocade_vswitch.get_vmpolicy_macaddr_input_last_rcvd_instance | def get_vmpolicy_macaddr_input_last_rcvd_instance(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vmpolicy_macaddr = ET.Element("get_vmpolicy_macaddr")
config = get_vmpolicy_macaddr
input = ET.SubElement(get_vmpolicy_macaddr, "input")
last_rcvd_instance = ET.SubElement(input, "last-rcvd-instance")
last_rcvd_instance.text = kwargs.pop('last_rcvd_instance')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def get_vmpolicy_macaddr_input_last_rcvd_instance(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vmpolicy_macaddr = ET.Element("get_vmpolicy_macaddr")
config = get_vmpolicy_macaddr
input = ET.SubElement(get_vmpolicy_macaddr, "input")
last_rcvd_instance = ET.SubElement(input, "last-rcvd-instance")
last_rcvd_instance.text = kwargs.pop('last_rcvd_instance')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"get_vmpolicy_macaddr_input_last_rcvd_instance",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"get_vmpolicy_macaddr",
"=",
"ET",
".",
"Element",
"(",
"\"get_vmpolicy_macaddr\"",
")",
"config",
... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py#L981-L992 |
brocade/pynos | pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py | brocade_vswitch.get_vmpolicy_macaddr_output_vmpolicy_macaddr_mac | def get_vmpolicy_macaddr_output_vmpolicy_macaddr_mac(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vmpolicy_macaddr = ET.Element("get_vmpolicy_macaddr")
config = get_vmpolicy_macaddr
output = ET.SubElement(get_vmpolicy_macaddr, "output")
vmpolicy_macaddr = ET.SubElement(output, "vmpolicy-macaddr")
mac = ET.SubElement(vmpolicy_macaddr, "mac")
mac.text = kwargs.pop('mac')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def get_vmpolicy_macaddr_output_vmpolicy_macaddr_mac(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vmpolicy_macaddr = ET.Element("get_vmpolicy_macaddr")
config = get_vmpolicy_macaddr
output = ET.SubElement(get_vmpolicy_macaddr, "output")
vmpolicy_macaddr = ET.SubElement(output, "vmpolicy-macaddr")
mac = ET.SubElement(vmpolicy_macaddr, "mac")
mac.text = kwargs.pop('mac')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"get_vmpolicy_macaddr_output_vmpolicy_macaddr_mac",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"get_vmpolicy_macaddr",
"=",
"ET",
".",
"Element",
"(",
"\"get_vmpolicy_macaddr\"",
")",
"config... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py#L994-L1006 |
brocade/pynos | pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py | brocade_vswitch.get_vmpolicy_macaddr_output_vmpolicy_macaddr_name | def get_vmpolicy_macaddr_output_vmpolicy_macaddr_name(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vmpolicy_macaddr = ET.Element("get_vmpolicy_macaddr")
config = get_vmpolicy_macaddr
output = ET.SubElement(get_vmpolicy_macaddr, "output")
vmpolicy_macaddr = ET.SubElement(output, "vmpolicy-macaddr")
name = ET.SubElement(vmpolicy_macaddr, "name")
name.text = kwargs.pop('name')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def get_vmpolicy_macaddr_output_vmpolicy_macaddr_name(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vmpolicy_macaddr = ET.Element("get_vmpolicy_macaddr")
config = get_vmpolicy_macaddr
output = ET.SubElement(get_vmpolicy_macaddr, "output")
vmpolicy_macaddr = ET.SubElement(output, "vmpolicy-macaddr")
name = ET.SubElement(vmpolicy_macaddr, "name")
name.text = kwargs.pop('name')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"get_vmpolicy_macaddr_output_vmpolicy_macaddr_name",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"get_vmpolicy_macaddr",
"=",
"ET",
".",
"Element",
"(",
"\"get_vmpolicy_macaddr\"",
")",
"confi... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py#L1008-L1020 |
brocade/pynos | pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py | brocade_vswitch.get_vmpolicy_macaddr_output_vmpolicy_macaddr_datacenter | def get_vmpolicy_macaddr_output_vmpolicy_macaddr_datacenter(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vmpolicy_macaddr = ET.Element("get_vmpolicy_macaddr")
config = get_vmpolicy_macaddr
output = ET.SubElement(get_vmpolicy_macaddr, "output")
vmpolicy_macaddr = ET.SubElement(output, "vmpolicy-macaddr")
datacenter = ET.SubElement(vmpolicy_macaddr, "datacenter")
datacenter.text = kwargs.pop('datacenter')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def get_vmpolicy_macaddr_output_vmpolicy_macaddr_datacenter(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vmpolicy_macaddr = ET.Element("get_vmpolicy_macaddr")
config = get_vmpolicy_macaddr
output = ET.SubElement(get_vmpolicy_macaddr, "output")
vmpolicy_macaddr = ET.SubElement(output, "vmpolicy-macaddr")
datacenter = ET.SubElement(vmpolicy_macaddr, "datacenter")
datacenter.text = kwargs.pop('datacenter')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"get_vmpolicy_macaddr_output_vmpolicy_macaddr_datacenter",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"get_vmpolicy_macaddr",
"=",
"ET",
".",
"Element",
"(",
"\"get_vmpolicy_macaddr\"",
")",
... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py#L1022-L1034 |
brocade/pynos | pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py | brocade_vswitch.get_vmpolicy_macaddr_output_vmpolicy_macaddr_dvpg_nn | def get_vmpolicy_macaddr_output_vmpolicy_macaddr_dvpg_nn(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vmpolicy_macaddr = ET.Element("get_vmpolicy_macaddr")
config = get_vmpolicy_macaddr
output = ET.SubElement(get_vmpolicy_macaddr, "output")
vmpolicy_macaddr = ET.SubElement(output, "vmpolicy-macaddr")
dvpg_nn = ET.SubElement(vmpolicy_macaddr, "dvpg-nn")
dvpg_nn.text = kwargs.pop('dvpg_nn')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def get_vmpolicy_macaddr_output_vmpolicy_macaddr_dvpg_nn(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vmpolicy_macaddr = ET.Element("get_vmpolicy_macaddr")
config = get_vmpolicy_macaddr
output = ET.SubElement(get_vmpolicy_macaddr, "output")
vmpolicy_macaddr = ET.SubElement(output, "vmpolicy-macaddr")
dvpg_nn = ET.SubElement(vmpolicy_macaddr, "dvpg-nn")
dvpg_nn.text = kwargs.pop('dvpg_nn')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"get_vmpolicy_macaddr_output_vmpolicy_macaddr_dvpg_nn",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"get_vmpolicy_macaddr",
"=",
"ET",
".",
"Element",
"(",
"\"get_vmpolicy_macaddr\"",
")",
"co... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py#L1036-L1048 |
brocade/pynos | pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py | brocade_vswitch.get_vmpolicy_macaddr_output_vmpolicy_macaddr_port_nn | def get_vmpolicy_macaddr_output_vmpolicy_macaddr_port_nn(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vmpolicy_macaddr = ET.Element("get_vmpolicy_macaddr")
config = get_vmpolicy_macaddr
output = ET.SubElement(get_vmpolicy_macaddr, "output")
vmpolicy_macaddr = ET.SubElement(output, "vmpolicy-macaddr")
port_nn = ET.SubElement(vmpolicy_macaddr, "port-nn")
port_nn.text = kwargs.pop('port_nn')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def get_vmpolicy_macaddr_output_vmpolicy_macaddr_port_nn(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vmpolicy_macaddr = ET.Element("get_vmpolicy_macaddr")
config = get_vmpolicy_macaddr
output = ET.SubElement(get_vmpolicy_macaddr, "output")
vmpolicy_macaddr = ET.SubElement(output, "vmpolicy-macaddr")
port_nn = ET.SubElement(vmpolicy_macaddr, "port-nn")
port_nn.text = kwargs.pop('port_nn')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"get_vmpolicy_macaddr_output_vmpolicy_macaddr_port_nn",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"get_vmpolicy_macaddr",
"=",
"ET",
".",
"Element",
"(",
"\"get_vmpolicy_macaddr\"",
")",
"co... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py#L1050-L1062 |
brocade/pynos | pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py | brocade_vswitch.get_vmpolicy_macaddr_output_vmpolicy_macaddr_port_prof | def get_vmpolicy_macaddr_output_vmpolicy_macaddr_port_prof(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vmpolicy_macaddr = ET.Element("get_vmpolicy_macaddr")
config = get_vmpolicy_macaddr
output = ET.SubElement(get_vmpolicy_macaddr, "output")
vmpolicy_macaddr = ET.SubElement(output, "vmpolicy-macaddr")
port_prof = ET.SubElement(vmpolicy_macaddr, "port-prof")
port_prof.text = kwargs.pop('port_prof')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def get_vmpolicy_macaddr_output_vmpolicy_macaddr_port_prof(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vmpolicy_macaddr = ET.Element("get_vmpolicy_macaddr")
config = get_vmpolicy_macaddr
output = ET.SubElement(get_vmpolicy_macaddr, "output")
vmpolicy_macaddr = ET.SubElement(output, "vmpolicy-macaddr")
port_prof = ET.SubElement(vmpolicy_macaddr, "port-prof")
port_prof.text = kwargs.pop('port_prof')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"get_vmpolicy_macaddr_output_vmpolicy_macaddr_port_prof",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"get_vmpolicy_macaddr",
"=",
"ET",
".",
"Element",
"(",
"\"get_vmpolicy_macaddr\"",
")",
"... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py#L1064-L1076 |
brocade/pynos | pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py | brocade_vswitch.get_vmpolicy_macaddr_output_has_more | def get_vmpolicy_macaddr_output_has_more(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vmpolicy_macaddr = ET.Element("get_vmpolicy_macaddr")
config = get_vmpolicy_macaddr
output = ET.SubElement(get_vmpolicy_macaddr, "output")
has_more = ET.SubElement(output, "has-more")
has_more.text = kwargs.pop('has_more')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def get_vmpolicy_macaddr_output_has_more(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vmpolicy_macaddr = ET.Element("get_vmpolicy_macaddr")
config = get_vmpolicy_macaddr
output = ET.SubElement(get_vmpolicy_macaddr, "output")
has_more = ET.SubElement(output, "has-more")
has_more.text = kwargs.pop('has_more')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"get_vmpolicy_macaddr_output_has_more",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"get_vmpolicy_macaddr",
"=",
"ET",
".",
"Element",
"(",
"\"get_vmpolicy_macaddr\"",
")",
"config",
"=",
... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py#L1078-L1089 |
brocade/pynos | pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py | brocade_vswitch.get_vmpolicy_macaddr_output_instance_id | def get_vmpolicy_macaddr_output_instance_id(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vmpolicy_macaddr = ET.Element("get_vmpolicy_macaddr")
config = get_vmpolicy_macaddr
output = ET.SubElement(get_vmpolicy_macaddr, "output")
instance_id = ET.SubElement(output, "instance-id")
instance_id.text = kwargs.pop('instance_id')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def get_vmpolicy_macaddr_output_instance_id(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_vmpolicy_macaddr = ET.Element("get_vmpolicy_macaddr")
config = get_vmpolicy_macaddr
output = ET.SubElement(get_vmpolicy_macaddr, "output")
instance_id = ET.SubElement(output, "instance-id")
instance_id.text = kwargs.pop('instance_id')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"get_vmpolicy_macaddr_output_instance_id",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"get_vmpolicy_macaddr",
"=",
"ET",
".",
"Element",
"(",
"\"get_vmpolicy_macaddr\"",
")",
"config",
"=",... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py#L1091-L1102 |
brocade/pynos | pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py | brocade_vswitch.vcenter_id | def vcenter_id(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
vcenter = ET.SubElement(config, "vcenter", xmlns="urn:brocade.com:mgmt:brocade-vswitch")
id = ET.SubElement(vcenter, "id")
id.text = kwargs.pop('id')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def vcenter_id(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
vcenter = ET.SubElement(config, "vcenter", xmlns="urn:brocade.com:mgmt:brocade-vswitch")
id = ET.SubElement(vcenter, "id")
id.text = kwargs.pop('id')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"vcenter_id",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"vcenter",
"=",
"ET",
".",
"SubElement",
"(",
"config",
",",
"\"vcenter\"",
",",
"xmlns",
"=",
"\"urn:brocade.com:mgmt:brocade... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py#L1104-L1113 |
brocade/pynos | pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py | brocade_vswitch.vcenter_credentials_url | def vcenter_credentials_url(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
vcenter = ET.SubElement(config, "vcenter", xmlns="urn:brocade.com:mgmt:brocade-vswitch")
id_key = ET.SubElement(vcenter, "id")
id_key.text = kwargs.pop('id')
credentials = ET.SubElement(vcenter, "credentials")
url = ET.SubElement(credentials, "url")
url.text = kwargs.pop('url')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def vcenter_credentials_url(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
vcenter = ET.SubElement(config, "vcenter", xmlns="urn:brocade.com:mgmt:brocade-vswitch")
id_key = ET.SubElement(vcenter, "id")
id_key.text = kwargs.pop('id')
credentials = ET.SubElement(vcenter, "credentials")
url = ET.SubElement(credentials, "url")
url.text = kwargs.pop('url')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"vcenter_credentials_url",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"vcenter",
"=",
"ET",
".",
"SubElement",
"(",
"config",
",",
"\"vcenter\"",
",",
"xmlns",
"=",
"\"urn:brocade.com... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py#L1115-L1127 |
brocade/pynos | pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py | brocade_vswitch.vcenter_credentials_username | def vcenter_credentials_username(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
vcenter = ET.SubElement(config, "vcenter", xmlns="urn:brocade.com:mgmt:brocade-vswitch")
id_key = ET.SubElement(vcenter, "id")
id_key.text = kwargs.pop('id')
credentials = ET.SubElement(vcenter, "credentials")
username = ET.SubElement(credentials, "username")
username.text = kwargs.pop('username')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def vcenter_credentials_username(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
vcenter = ET.SubElement(config, "vcenter", xmlns="urn:brocade.com:mgmt:brocade-vswitch")
id_key = ET.SubElement(vcenter, "id")
id_key.text = kwargs.pop('id')
credentials = ET.SubElement(vcenter, "credentials")
username = ET.SubElement(credentials, "username")
username.text = kwargs.pop('username')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"vcenter_credentials_username",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"vcenter",
"=",
"ET",
".",
"SubElement",
"(",
"config",
",",
"\"vcenter\"",
",",
"xmlns",
"=",
"\"urn:brocad... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py#L1129-L1141 |
brocade/pynos | pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py | brocade_vswitch.vcenter_credentials_password | def vcenter_credentials_password(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
vcenter = ET.SubElement(config, "vcenter", xmlns="urn:brocade.com:mgmt:brocade-vswitch")
id_key = ET.SubElement(vcenter, "id")
id_key.text = kwargs.pop('id')
credentials = ET.SubElement(vcenter, "credentials")
password = ET.SubElement(credentials, "password")
password.text = kwargs.pop('password')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def vcenter_credentials_password(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
vcenter = ET.SubElement(config, "vcenter", xmlns="urn:brocade.com:mgmt:brocade-vswitch")
id_key = ET.SubElement(vcenter, "id")
id_key.text = kwargs.pop('id')
credentials = ET.SubElement(vcenter, "credentials")
password = ET.SubElement(credentials, "password")
password.text = kwargs.pop('password')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"vcenter_credentials_password",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"vcenter",
"=",
"ET",
".",
"SubElement",
"(",
"config",
",",
"\"vcenter\"",
",",
"xmlns",
"=",
"\"urn:brocad... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py#L1143-L1155 |
brocade/pynos | pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py | brocade_vswitch.vcenter_credentials_vrf_name | def vcenter_credentials_vrf_name(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
vcenter = ET.SubElement(config, "vcenter", xmlns="urn:brocade.com:mgmt:brocade-vswitch")
id_key = ET.SubElement(vcenter, "id")
id_key.text = kwargs.pop('id')
credentials = ET.SubElement(vcenter, "credentials")
vrf_name = ET.SubElement(credentials, "vrf-name")
vrf_name.text = kwargs.pop('vrf_name')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def vcenter_credentials_vrf_name(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
vcenter = ET.SubElement(config, "vcenter", xmlns="urn:brocade.com:mgmt:brocade-vswitch")
id_key = ET.SubElement(vcenter, "id")
id_key.text = kwargs.pop('id')
credentials = ET.SubElement(vcenter, "credentials")
vrf_name = ET.SubElement(credentials, "vrf-name")
vrf_name.text = kwargs.pop('vrf_name')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"vcenter_credentials_vrf_name",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"vcenter",
"=",
"ET",
".",
"SubElement",
"(",
"config",
",",
"\"vcenter\"",
",",
"xmlns",
"=",
"\"urn:brocad... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py#L1157-L1169 |
brocade/pynos | pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py | brocade_vswitch.vcenter_activate | def vcenter_activate(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
vcenter = ET.SubElement(config, "vcenter", xmlns="urn:brocade.com:mgmt:brocade-vswitch")
id_key = ET.SubElement(vcenter, "id")
id_key.text = kwargs.pop('id')
activate = ET.SubElement(vcenter, "activate")
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def vcenter_activate(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
vcenter = ET.SubElement(config, "vcenter", xmlns="urn:brocade.com:mgmt:brocade-vswitch")
id_key = ET.SubElement(vcenter, "id")
id_key.text = kwargs.pop('id')
activate = ET.SubElement(vcenter, "activate")
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"vcenter_activate",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"vcenter",
"=",
"ET",
".",
"SubElement",
"(",
"config",
",",
"\"vcenter\"",
",",
"xmlns",
"=",
"\"urn:brocade.com:mgmt:b... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py#L1171-L1181 |
brocade/pynos | pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py | brocade_vswitch.vcenter_interval | def vcenter_interval(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
vcenter = ET.SubElement(config, "vcenter", xmlns="urn:brocade.com:mgmt:brocade-vswitch")
id_key = ET.SubElement(vcenter, "id")
id_key.text = kwargs.pop('id')
interval = ET.SubElement(vcenter, "interval")
interval.text = kwargs.pop('interval')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def vcenter_interval(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
vcenter = ET.SubElement(config, "vcenter", xmlns="urn:brocade.com:mgmt:brocade-vswitch")
id_key = ET.SubElement(vcenter, "id")
id_key.text = kwargs.pop('id')
interval = ET.SubElement(vcenter, "interval")
interval.text = kwargs.pop('interval')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"vcenter_interval",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"vcenter",
"=",
"ET",
".",
"SubElement",
"(",
"config",
",",
"\"vcenter\"",
",",
"xmlns",
"=",
"\"urn:brocade.com:mgmt:b... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py#L1183-L1194 |
brocade/pynos | pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py | brocade_vswitch.vcenter_discovery_ignore_delete_all_response_ignore_value | def vcenter_discovery_ignore_delete_all_response_ignore_value(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
vcenter = ET.SubElement(config, "vcenter", xmlns="urn:brocade.com:mgmt:brocade-vswitch")
id_key = ET.SubElement(vcenter, "id")
id_key.text = kwargs.pop('id')
discovery = ET.SubElement(vcenter, "discovery")
ignore_delete_all_response = ET.SubElement(discovery, "ignore-delete-all-response")
ignore_value = ET.SubElement(ignore_delete_all_response, "ignore-value")
ignore_value.text = kwargs.pop('ignore_value')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def vcenter_discovery_ignore_delete_all_response_ignore_value(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
vcenter = ET.SubElement(config, "vcenter", xmlns="urn:brocade.com:mgmt:brocade-vswitch")
id_key = ET.SubElement(vcenter, "id")
id_key.text = kwargs.pop('id')
discovery = ET.SubElement(vcenter, "discovery")
ignore_delete_all_response = ET.SubElement(discovery, "ignore-delete-all-response")
ignore_value = ET.SubElement(ignore_delete_all_response, "ignore-value")
ignore_value.text = kwargs.pop('ignore_value')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"vcenter_discovery_ignore_delete_all_response_ignore_value",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"vcenter",
"=",
"ET",
".",
"SubElement",
"(",
"config",
",",
"\"vcenter\"",
",",
"x... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py#L1196-L1209 |
brocade/pynos | pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py | brocade_vswitch.vcenter_discovery_ignore_delete_all_response_always | def vcenter_discovery_ignore_delete_all_response_always(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
vcenter = ET.SubElement(config, "vcenter", xmlns="urn:brocade.com:mgmt:brocade-vswitch")
id_key = ET.SubElement(vcenter, "id")
id_key.text = kwargs.pop('id')
discovery = ET.SubElement(vcenter, "discovery")
ignore_delete_all_response = ET.SubElement(discovery, "ignore-delete-all-response")
always = ET.SubElement(ignore_delete_all_response, "always")
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def vcenter_discovery_ignore_delete_all_response_always(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
vcenter = ET.SubElement(config, "vcenter", xmlns="urn:brocade.com:mgmt:brocade-vswitch")
id_key = ET.SubElement(vcenter, "id")
id_key.text = kwargs.pop('id')
discovery = ET.SubElement(vcenter, "discovery")
ignore_delete_all_response = ET.SubElement(discovery, "ignore-delete-all-response")
always = ET.SubElement(ignore_delete_all_response, "always")
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"vcenter_discovery_ignore_delete_all_response_always",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"vcenter",
"=",
"ET",
".",
"SubElement",
"(",
"config",
",",
"\"vcenter\"",
",",
"xmlns",... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_7/ver_7_1_0/yang/brocade_vswitch.py#L1211-L1223 |
brocade/pynos | pynos/versions/base/yang/brocade_fcoe.py | brocade_fcoe.fcoe_fcoe_map_fcoe_map_fabric_map_fcoe_map_fabric_map_name | def fcoe_fcoe_map_fcoe_map_fabric_map_fcoe_map_fabric_map_name(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
fcoe = ET.SubElement(config, "fcoe", xmlns="urn:brocade.com:mgmt:brocade-fcoe")
fcoe_map = ET.SubElement(fcoe, "fcoe-map")
fcoe_map_name_key = ET.SubElement(fcoe_map, "fcoe-map-name")
fcoe_map_name_key.text = kwargs.pop('fcoe_map_name')
fcoe_map_fabric_map = ET.SubElement(fcoe_map, "fcoe-map-fabric-map")
fcoe_map_fabric_map_name = ET.SubElement(fcoe_map_fabric_map, "fcoe-map-fabric-map-name")
fcoe_map_fabric_map_name.text = kwargs.pop('fcoe_map_fabric_map_name')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def fcoe_fcoe_map_fcoe_map_fabric_map_fcoe_map_fabric_map_name(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
fcoe = ET.SubElement(config, "fcoe", xmlns="urn:brocade.com:mgmt:brocade-fcoe")
fcoe_map = ET.SubElement(fcoe, "fcoe-map")
fcoe_map_name_key = ET.SubElement(fcoe_map, "fcoe-map-name")
fcoe_map_name_key.text = kwargs.pop('fcoe_map_name')
fcoe_map_fabric_map = ET.SubElement(fcoe_map, "fcoe-map-fabric-map")
fcoe_map_fabric_map_name = ET.SubElement(fcoe_map_fabric_map, "fcoe-map-fabric-map-name")
fcoe_map_fabric_map_name.text = kwargs.pop('fcoe_map_fabric_map_name')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"fcoe_fcoe_map_fcoe_map_fabric_map_fcoe_map_fabric_map_name",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"fcoe",
"=",
"ET",
".",
"SubElement",
"(",
"config",
",",
"\"fcoe\"",
",",
"xmlns"... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/base/yang/brocade_fcoe.py#L131-L144 |
brocade/pynos | pynos/versions/base/yang/brocade_fcoe.py | brocade_fcoe.fcoe_fcoe_fcf_map_fcf_map_name | def fcoe_fcoe_fcf_map_fcf_map_name(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
fcoe = ET.SubElement(config, "fcoe", xmlns="urn:brocade.com:mgmt:brocade-fcoe")
fcoe_fcf_map = ET.SubElement(fcoe, "fcoe-fcf-map")
fcf_map_name = ET.SubElement(fcoe_fcf_map, "fcf-map-name")
fcf_map_name.text = kwargs.pop('fcf_map_name')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def fcoe_fcoe_fcf_map_fcf_map_name(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
fcoe = ET.SubElement(config, "fcoe", xmlns="urn:brocade.com:mgmt:brocade-fcoe")
fcoe_fcf_map = ET.SubElement(fcoe, "fcoe-fcf-map")
fcf_map_name = ET.SubElement(fcoe_fcf_map, "fcf-map-name")
fcf_map_name.text = kwargs.pop('fcf_map_name')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"fcoe_fcoe_fcf_map_fcf_map_name",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"fcoe",
"=",
"ET",
".",
"SubElement",
"(",
"config",
",",
"\"fcoe\"",
",",
"xmlns",
"=",
"\"urn:brocade.co... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/base/yang/brocade_fcoe.py#L161-L171 |
brocade/pynos | pynos/versions/base/yang/brocade_fcoe.py | brocade_fcoe.fcoe_fcoe_fcf_map_fcf_map_fcoe_map_fcf_map_fcoe_map_leaf | def fcoe_fcoe_fcf_map_fcf_map_fcoe_map_fcf_map_fcoe_map_leaf(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
fcoe = ET.SubElement(config, "fcoe", xmlns="urn:brocade.com:mgmt:brocade-fcoe")
fcoe_fcf_map = ET.SubElement(fcoe, "fcoe-fcf-map")
fcf_map_name_key = ET.SubElement(fcoe_fcf_map, "fcf-map-name")
fcf_map_name_key.text = kwargs.pop('fcf_map_name')
fcf_map_fcoe_map = ET.SubElement(fcoe_fcf_map, "fcf-map-fcoe-map")
fcf_map_fcoe_map_leaf = ET.SubElement(fcf_map_fcoe_map, "fcf-map-fcoe-map-leaf")
fcf_map_fcoe_map_leaf.text = kwargs.pop('fcf_map_fcoe_map_leaf')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def fcoe_fcoe_fcf_map_fcf_map_fcoe_map_fcf_map_fcoe_map_leaf(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
fcoe = ET.SubElement(config, "fcoe", xmlns="urn:brocade.com:mgmt:brocade-fcoe")
fcoe_fcf_map = ET.SubElement(fcoe, "fcoe-fcf-map")
fcf_map_name_key = ET.SubElement(fcoe_fcf_map, "fcf-map-name")
fcf_map_name_key.text = kwargs.pop('fcf_map_name')
fcf_map_fcoe_map = ET.SubElement(fcoe_fcf_map, "fcf-map-fcoe-map")
fcf_map_fcoe_map_leaf = ET.SubElement(fcf_map_fcoe_map, "fcf-map-fcoe-map-leaf")
fcf_map_fcoe_map_leaf.text = kwargs.pop('fcf_map_fcoe_map_leaf')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"fcoe_fcoe_fcf_map_fcf_map_fcoe_map_fcf_map_fcoe_map_leaf",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"fcoe",
"=",
"ET",
".",
"SubElement",
"(",
"config",
",",
"\"fcoe\"",
",",
"xmlns",
... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/base/yang/brocade_fcoe.py#L173-L186 |
brocade/pynos | pynos/versions/base/yang/brocade_fcoe.py | brocade_fcoe.fcoe_fcoe_fcf_map_fcf_map_ag_rbid | def fcoe_fcoe_fcf_map_fcf_map_ag_rbid(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
fcoe = ET.SubElement(config, "fcoe", xmlns="urn:brocade.com:mgmt:brocade-fcoe")
fcoe_fcf_map = ET.SubElement(fcoe, "fcoe-fcf-map")
fcf_map_name_key = ET.SubElement(fcoe_fcf_map, "fcf-map-name")
fcf_map_name_key.text = kwargs.pop('fcf_map_name')
fcf_map_ag_rbid = ET.SubElement(fcoe_fcf_map, "fcf-map-ag-rbid")
fcf_map_ag_rbid.text = kwargs.pop('fcf_map_ag_rbid')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def fcoe_fcoe_fcf_map_fcf_map_ag_rbid(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
fcoe = ET.SubElement(config, "fcoe", xmlns="urn:brocade.com:mgmt:brocade-fcoe")
fcoe_fcf_map = ET.SubElement(fcoe, "fcoe-fcf-map")
fcf_map_name_key = ET.SubElement(fcoe_fcf_map, "fcf-map-name")
fcf_map_name_key.text = kwargs.pop('fcf_map_name')
fcf_map_ag_rbid = ET.SubElement(fcoe_fcf_map, "fcf-map-ag-rbid")
fcf_map_ag_rbid.text = kwargs.pop('fcf_map_ag_rbid')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"fcoe_fcoe_fcf_map_fcf_map_ag_rbid",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"fcoe",
"=",
"ET",
".",
"SubElement",
"(",
"config",
",",
"\"fcoe\"",
",",
"xmlns",
"=",
"\"urn:brocade... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/base/yang/brocade_fcoe.py#L188-L200 |
stewart/gfm | gfm.py | gfm | def gfm(text):
"""Processes Markdown according to GitHub Flavored Markdown spec."""
extractions = {}
def extract_pre_block(matchobj):
match = matchobj.group(0)
hashed_match = hashlib.md5(match.encode('utf-8')).hexdigest()
extractions[hashed_match] = match
result = "{gfm-extraction-%s}" % hashed_match
return result
def escape_underscore(matchobj):
match = matchobj.group(0)
if match.count('_') > 1:
return re.sub('_', '\_', match)
else:
return match
def newlines_to_brs(matchobj):
match = matchobj.group(0)
if re.search("\n{2}", match):
return match
else:
match = match.strip()
return match + " \n"
def insert_pre_block(matchobj):
string = "\n\n" + extractions[matchobj.group(1)]
return string
text = re.sub("(?s)<pre>.*?<\/pre>", extract_pre_block, text)
text = re.sub("(^(?! {4}|\t)\w+_\w+_\w[\w_]*)", escape_underscore, text)
text = re.sub("(?m)^[\w\<][^\n]*\n+", newlines_to_brs, text)
text = re.sub("\{gfm-extraction-([0-9a-f]{32})\}", insert_pre_block, text)
return text | python | def gfm(text):
"""Processes Markdown according to GitHub Flavored Markdown spec."""
extractions = {}
def extract_pre_block(matchobj):
match = matchobj.group(0)
hashed_match = hashlib.md5(match.encode('utf-8')).hexdigest()
extractions[hashed_match] = match
result = "{gfm-extraction-%s}" % hashed_match
return result
def escape_underscore(matchobj):
match = matchobj.group(0)
if match.count('_') > 1:
return re.sub('_', '\_', match)
else:
return match
def newlines_to_brs(matchobj):
match = matchobj.group(0)
if re.search("\n{2}", match):
return match
else:
match = match.strip()
return match + " \n"
def insert_pre_block(matchobj):
string = "\n\n" + extractions[matchobj.group(1)]
return string
text = re.sub("(?s)<pre>.*?<\/pre>", extract_pre_block, text)
text = re.sub("(^(?! {4}|\t)\w+_\w+_\w[\w_]*)", escape_underscore, text)
text = re.sub("(?m)^[\w\<][^\n]*\n+", newlines_to_brs, text)
text = re.sub("\{gfm-extraction-([0-9a-f]{32})\}", insert_pre_block, text)
return text | [
"def",
"gfm",
"(",
"text",
")",
":",
"extractions",
"=",
"{",
"}",
"def",
"extract_pre_block",
"(",
"matchobj",
")",
":",
"match",
"=",
"matchobj",
".",
"group",
"(",
"0",
")",
"hashed_match",
"=",
"hashlib",
".",
"md5",
"(",
"match",
".",
"encode",
... | Processes Markdown according to GitHub Flavored Markdown spec. | [
"Processes",
"Markdown",
"according",
"to",
"GitHub",
"Flavored",
"Markdown",
"spec",
"."
] | train | https://github.com/stewart/gfm/blob/e14b082c62da03dcb57a15856282c4c6f93bb4d4/gfm.py#L4-L40 |
stewart/gfm | gfm.py | markdown | def markdown(text):
"""Processes GFM then converts it to HTML."""
text = gfm(text)
text = markdown_lib.markdown(text)
return text | python | def markdown(text):
"""Processes GFM then converts it to HTML."""
text = gfm(text)
text = markdown_lib.markdown(text)
return text | [
"def",
"markdown",
"(",
"text",
")",
":",
"text",
"=",
"gfm",
"(",
"text",
")",
"text",
"=",
"markdown_lib",
".",
"markdown",
"(",
"text",
")",
"return",
"text"
] | Processes GFM then converts it to HTML. | [
"Processes",
"GFM",
"then",
"converts",
"it",
"to",
"HTML",
"."
] | train | https://github.com/stewart/gfm/blob/e14b082c62da03dcb57a15856282c4c6f93bb4d4/gfm.py#L42-L46 |
brocade/pynos | pynos/versions/base/yang/brocade_lag.py | brocade_lag.get_port_channel_detail_input_last_aggregator_id | def get_port_channel_detail_input_last_aggregator_id(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_port_channel_detail = ET.Element("get_port_channel_detail")
config = get_port_channel_detail
input = ET.SubElement(get_port_channel_detail, "input")
last_aggregator_id = ET.SubElement(input, "last-aggregator-id")
last_aggregator_id.text = kwargs.pop('last_aggregator_id')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def get_port_channel_detail_input_last_aggregator_id(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_port_channel_detail = ET.Element("get_port_channel_detail")
config = get_port_channel_detail
input = ET.SubElement(get_port_channel_detail, "input")
last_aggregator_id = ET.SubElement(input, "last-aggregator-id")
last_aggregator_id.text = kwargs.pop('last_aggregator_id')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"get_port_channel_detail_input_last_aggregator_id",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"get_port_channel_detail",
"=",
"ET",
".",
"Element",
"(",
"\"get_port_channel_detail\"",
")",
"... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/base/yang/brocade_lag.py#L12-L23 |
brocade/pynos | pynos/versions/ver_7/ver_7_1_0/yang/brocade_mac_address_table.py | brocade_mac_address_table.get_mac_address_table_input_request_type_get_interface_based_request_forwarding_interface_interface_type | def get_mac_address_table_input_request_type_get_interface_based_request_forwarding_interface_interface_type(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_mac_address_table = ET.Element("get_mac_address_table")
config = get_mac_address_table
input = ET.SubElement(get_mac_address_table, "input")
request_type = ET.SubElement(input, "request-type")
get_interface_based_request = ET.SubElement(request_type, "get-interface-based-request")
forwarding_interface = ET.SubElement(get_interface_based_request, "forwarding-interface")
interface_type = ET.SubElement(forwarding_interface, "interface-type")
interface_type.text = kwargs.pop('interface_type')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def get_mac_address_table_input_request_type_get_interface_based_request_forwarding_interface_interface_type(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_mac_address_table = ET.Element("get_mac_address_table")
config = get_mac_address_table
input = ET.SubElement(get_mac_address_table, "input")
request_type = ET.SubElement(input, "request-type")
get_interface_based_request = ET.SubElement(request_type, "get-interface-based-request")
forwarding_interface = ET.SubElement(get_interface_based_request, "forwarding-interface")
interface_type = ET.SubElement(forwarding_interface, "interface-type")
interface_type.text = kwargs.pop('interface_type')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"get_mac_address_table_input_request_type_get_interface_based_request_forwarding_interface_interface_type",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"get_mac_address_table",
"=",
"ET",
".",
"Elemen... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_7/ver_7_1_0/yang/brocade_mac_address_table.py#L265-L279 |
brocade/pynos | pynos/versions/ver_7/ver_7_1_0/yang/brocade_mac_address_table.py | brocade_mac_address_table.get_mac_address_table_input_request_type_get_interface_based_request_forwarding_interface_interface_name | def get_mac_address_table_input_request_type_get_interface_based_request_forwarding_interface_interface_name(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_mac_address_table = ET.Element("get_mac_address_table")
config = get_mac_address_table
input = ET.SubElement(get_mac_address_table, "input")
request_type = ET.SubElement(input, "request-type")
get_interface_based_request = ET.SubElement(request_type, "get-interface-based-request")
forwarding_interface = ET.SubElement(get_interface_based_request, "forwarding-interface")
interface_name = ET.SubElement(forwarding_interface, "interface-name")
interface_name.text = kwargs.pop('interface_name')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def get_mac_address_table_input_request_type_get_interface_based_request_forwarding_interface_interface_name(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_mac_address_table = ET.Element("get_mac_address_table")
config = get_mac_address_table
input = ET.SubElement(get_mac_address_table, "input")
request_type = ET.SubElement(input, "request-type")
get_interface_based_request = ET.SubElement(request_type, "get-interface-based-request")
forwarding_interface = ET.SubElement(get_interface_based_request, "forwarding-interface")
interface_name = ET.SubElement(forwarding_interface, "interface-name")
interface_name.text = kwargs.pop('interface_name')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"get_mac_address_table_input_request_type_get_interface_based_request_forwarding_interface_interface_name",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"get_mac_address_table",
"=",
"ET",
".",
"Elemen... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_7/ver_7_1_0/yang/brocade_mac_address_table.py#L281-L295 |
brocade/pynos | pynos/versions/ver_7/ver_7_1_0/yang/brocade_mac_address_table.py | brocade_mac_address_table.get_mac_address_table_input_request_type_get_interface_based_request_mac_type | def get_mac_address_table_input_request_type_get_interface_based_request_mac_type(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_mac_address_table = ET.Element("get_mac_address_table")
config = get_mac_address_table
input = ET.SubElement(get_mac_address_table, "input")
request_type = ET.SubElement(input, "request-type")
get_interface_based_request = ET.SubElement(request_type, "get-interface-based-request")
mac_type = ET.SubElement(get_interface_based_request, "mac-type")
mac_type.text = kwargs.pop('mac_type')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def get_mac_address_table_input_request_type_get_interface_based_request_mac_type(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_mac_address_table = ET.Element("get_mac_address_table")
config = get_mac_address_table
input = ET.SubElement(get_mac_address_table, "input")
request_type = ET.SubElement(input, "request-type")
get_interface_based_request = ET.SubElement(request_type, "get-interface-based-request")
mac_type = ET.SubElement(get_interface_based_request, "mac-type")
mac_type.text = kwargs.pop('mac_type')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"get_mac_address_table_input_request_type_get_interface_based_request_mac_type",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"get_mac_address_table",
"=",
"ET",
".",
"Element",
"(",
"\"get_mac_add... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_7/ver_7_1_0/yang/brocade_mac_address_table.py#L297-L310 |
brocade/pynos | pynos/versions/ver_7/ver_7_1_0/yang/brocade_mac_address_table.py | brocade_mac_address_table.get_mac_address_table_input_request_type_get_next_request_forwarding_interface_type | def get_mac_address_table_input_request_type_get_next_request_forwarding_interface_type(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_mac_address_table = ET.Element("get_mac_address_table")
config = get_mac_address_table
input = ET.SubElement(get_mac_address_table, "input")
request_type = ET.SubElement(input, "request-type")
get_next_request = ET.SubElement(request_type, "get-next-request")
forwarding_interface_type = ET.SubElement(get_next_request, "forwarding-interface-type")
forwarding_interface_type.text = kwargs.pop('forwarding_interface_type')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def get_mac_address_table_input_request_type_get_next_request_forwarding_interface_type(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_mac_address_table = ET.Element("get_mac_address_table")
config = get_mac_address_table
input = ET.SubElement(get_mac_address_table, "input")
request_type = ET.SubElement(input, "request-type")
get_next_request = ET.SubElement(request_type, "get-next-request")
forwarding_interface_type = ET.SubElement(get_next_request, "forwarding-interface-type")
forwarding_interface_type.text = kwargs.pop('forwarding_interface_type')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"get_mac_address_table_input_request_type_get_next_request_forwarding_interface_type",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"get_mac_address_table",
"=",
"ET",
".",
"Element",
"(",
"\"get_m... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_7/ver_7_1_0/yang/brocade_mac_address_table.py#L360-L373 |
brocade/pynos | pynos/versions/ver_7/ver_7_1_0/yang/brocade_mac_address_table.py | brocade_mac_address_table.get_mac_address_table_input_request_type_get_next_request_forwarding_interface_name | def get_mac_address_table_input_request_type_get_next_request_forwarding_interface_name(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_mac_address_table = ET.Element("get_mac_address_table")
config = get_mac_address_table
input = ET.SubElement(get_mac_address_table, "input")
request_type = ET.SubElement(input, "request-type")
get_next_request = ET.SubElement(request_type, "get-next-request")
forwarding_interface_name = ET.SubElement(get_next_request, "forwarding-interface-name")
forwarding_interface_name.text = kwargs.pop('forwarding_interface_name')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def get_mac_address_table_input_request_type_get_next_request_forwarding_interface_name(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_mac_address_table = ET.Element("get_mac_address_table")
config = get_mac_address_table
input = ET.SubElement(get_mac_address_table, "input")
request_type = ET.SubElement(input, "request-type")
get_next_request = ET.SubElement(request_type, "get-next-request")
forwarding_interface_name = ET.SubElement(get_next_request, "forwarding-interface-name")
forwarding_interface_name.text = kwargs.pop('forwarding_interface_name')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"get_mac_address_table_input_request_type_get_next_request_forwarding_interface_name",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"get_mac_address_table",
"=",
"ET",
".",
"Element",
"(",
"\"get_m... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_7/ver_7_1_0/yang/brocade_mac_address_table.py#L375-L388 |
brocade/pynos | pynos/versions/ver_7/ver_7_1_0/yang/brocade_mac_address_table.py | brocade_mac_address_table.get_mac_address_table_input_request_type_get_next_request_mac_address_type | def get_mac_address_table_input_request_type_get_next_request_mac_address_type(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_mac_address_table = ET.Element("get_mac_address_table")
config = get_mac_address_table
input = ET.SubElement(get_mac_address_table, "input")
request_type = ET.SubElement(input, "request-type")
get_next_request = ET.SubElement(request_type, "get-next-request")
mac_address_type = ET.SubElement(get_next_request, "mac-address-type")
mac_address_type.text = kwargs.pop('mac_address_type')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def get_mac_address_table_input_request_type_get_next_request_mac_address_type(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_mac_address_table = ET.Element("get_mac_address_table")
config = get_mac_address_table
input = ET.SubElement(get_mac_address_table, "input")
request_type = ET.SubElement(input, "request-type")
get_next_request = ET.SubElement(request_type, "get-next-request")
mac_address_type = ET.SubElement(get_next_request, "mac-address-type")
mac_address_type.text = kwargs.pop('mac_address_type')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"get_mac_address_table_input_request_type_get_next_request_mac_address_type",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"get_mac_address_table",
"=",
"ET",
".",
"Element",
"(",
"\"get_mac_addres... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_7/ver_7_1_0/yang/brocade_mac_address_table.py#L390-L403 |
brocade/pynos | pynos/versions/ver_6/ver_6_0_1/yang/brocade_mac_access_list.py | brocade_mac_access_list.mac_access_list_standard_name | def mac_access_list_standard_name(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
mac = ET.SubElement(config, "mac", xmlns="urn:brocade.com:mgmt:brocade-mac-access-list")
access_list = ET.SubElement(mac, "access-list")
standard = ET.SubElement(access_list, "standard")
name = ET.SubElement(standard, "name")
name.text = kwargs.pop('name')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def mac_access_list_standard_name(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
mac = ET.SubElement(config, "mac", xmlns="urn:brocade.com:mgmt:brocade-mac-access-list")
access_list = ET.SubElement(mac, "access-list")
standard = ET.SubElement(access_list, "standard")
name = ET.SubElement(standard, "name")
name.text = kwargs.pop('name')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"mac_access_list_standard_name",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"mac",
"=",
"ET",
".",
"SubElement",
"(",
"config",
",",
"\"mac\"",
",",
"xmlns",
"=",
"\"urn:brocade.com:m... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_6/ver_6_0_1/yang/brocade_mac_access_list.py#L12-L23 |
brocade/pynos | pynos/versions/ver_6/ver_6_0_1/yang/brocade_mac_access_list.py | brocade_mac_access_list.mac_access_list_standard_hide_mac_acl_std_seq_seq_id | def mac_access_list_standard_hide_mac_acl_std_seq_seq_id(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
mac = ET.SubElement(config, "mac", xmlns="urn:brocade.com:mgmt:brocade-mac-access-list")
access_list = ET.SubElement(mac, "access-list")
standard = ET.SubElement(access_list, "standard")
name_key = ET.SubElement(standard, "name")
name_key.text = kwargs.pop('name')
hide_mac_acl_std = ET.SubElement(standard, "hide-mac-acl-std")
seq = ET.SubElement(hide_mac_acl_std, "seq")
seq_id = ET.SubElement(seq, "seq-id")
seq_id.text = kwargs.pop('seq_id')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def mac_access_list_standard_hide_mac_acl_std_seq_seq_id(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
mac = ET.SubElement(config, "mac", xmlns="urn:brocade.com:mgmt:brocade-mac-access-list")
access_list = ET.SubElement(mac, "access-list")
standard = ET.SubElement(access_list, "standard")
name_key = ET.SubElement(standard, "name")
name_key.text = kwargs.pop('name')
hide_mac_acl_std = ET.SubElement(standard, "hide-mac-acl-std")
seq = ET.SubElement(hide_mac_acl_std, "seq")
seq_id = ET.SubElement(seq, "seq-id")
seq_id.text = kwargs.pop('seq_id')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"mac_access_list_standard_hide_mac_acl_std_seq_seq_id",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"mac",
"=",
"ET",
".",
"SubElement",
"(",
"config",
",",
"\"mac\"",
",",
"xmlns",
"=",... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_6/ver_6_0_1/yang/brocade_mac_access_list.py#L25-L40 |
brocade/pynos | pynos/versions/ver_6/ver_6_0_1/yang/brocade_mac_access_list.py | brocade_mac_access_list.mac_access_list_standard_hide_mac_acl_std_seq_action | def mac_access_list_standard_hide_mac_acl_std_seq_action(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
mac = ET.SubElement(config, "mac", xmlns="urn:brocade.com:mgmt:brocade-mac-access-list")
access_list = ET.SubElement(mac, "access-list")
standard = ET.SubElement(access_list, "standard")
name_key = ET.SubElement(standard, "name")
name_key.text = kwargs.pop('name')
hide_mac_acl_std = ET.SubElement(standard, "hide-mac-acl-std")
seq = ET.SubElement(hide_mac_acl_std, "seq")
seq_id_key = ET.SubElement(seq, "seq-id")
seq_id_key.text = kwargs.pop('seq_id')
action = ET.SubElement(seq, "action")
action.text = kwargs.pop('action')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def mac_access_list_standard_hide_mac_acl_std_seq_action(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
mac = ET.SubElement(config, "mac", xmlns="urn:brocade.com:mgmt:brocade-mac-access-list")
access_list = ET.SubElement(mac, "access-list")
standard = ET.SubElement(access_list, "standard")
name_key = ET.SubElement(standard, "name")
name_key.text = kwargs.pop('name')
hide_mac_acl_std = ET.SubElement(standard, "hide-mac-acl-std")
seq = ET.SubElement(hide_mac_acl_std, "seq")
seq_id_key = ET.SubElement(seq, "seq-id")
seq_id_key.text = kwargs.pop('seq_id')
action = ET.SubElement(seq, "action")
action.text = kwargs.pop('action')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"mac_access_list_standard_hide_mac_acl_std_seq_action",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"mac",
"=",
"ET",
".",
"SubElement",
"(",
"config",
",",
"\"mac\"",
",",
"xmlns",
"=",... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_6/ver_6_0_1/yang/brocade_mac_access_list.py#L42-L59 |
brocade/pynos | pynos/versions/ver_6/ver_6_0_1/yang/brocade_mac_access_list.py | brocade_mac_access_list.mac_access_list_extended_name | def mac_access_list_extended_name(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
mac = ET.SubElement(config, "mac", xmlns="urn:brocade.com:mgmt:brocade-mac-access-list")
access_list = ET.SubElement(mac, "access-list")
extended = ET.SubElement(access_list, "extended")
name = ET.SubElement(extended, "name")
name.text = kwargs.pop('name')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def mac_access_list_extended_name(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
mac = ET.SubElement(config, "mac", xmlns="urn:brocade.com:mgmt:brocade-mac-access-list")
access_list = ET.SubElement(mac, "access-list")
extended = ET.SubElement(access_list, "extended")
name = ET.SubElement(extended, "name")
name.text = kwargs.pop('name')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"mac_access_list_extended_name",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"mac",
"=",
"ET",
".",
"SubElement",
"(",
"config",
",",
"\"mac\"",
",",
"xmlns",
"=",
"\"urn:brocade.com:m... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_6/ver_6_0_1/yang/brocade_mac_access_list.py#L154-L165 |
brocade/pynos | pynos/versions/ver_6/ver_6_0_1/yang/brocade_mac_access_list.py | brocade_mac_access_list.mac_access_list_extended_hide_mac_acl_ext_seq_seq_id | def mac_access_list_extended_hide_mac_acl_ext_seq_seq_id(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
mac = ET.SubElement(config, "mac", xmlns="urn:brocade.com:mgmt:brocade-mac-access-list")
access_list = ET.SubElement(mac, "access-list")
extended = ET.SubElement(access_list, "extended")
name_key = ET.SubElement(extended, "name")
name_key.text = kwargs.pop('name')
hide_mac_acl_ext = ET.SubElement(extended, "hide-mac-acl-ext")
seq = ET.SubElement(hide_mac_acl_ext, "seq")
seq_id = ET.SubElement(seq, "seq-id")
seq_id.text = kwargs.pop('seq_id')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def mac_access_list_extended_hide_mac_acl_ext_seq_seq_id(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
mac = ET.SubElement(config, "mac", xmlns="urn:brocade.com:mgmt:brocade-mac-access-list")
access_list = ET.SubElement(mac, "access-list")
extended = ET.SubElement(access_list, "extended")
name_key = ET.SubElement(extended, "name")
name_key.text = kwargs.pop('name')
hide_mac_acl_ext = ET.SubElement(extended, "hide-mac-acl-ext")
seq = ET.SubElement(hide_mac_acl_ext, "seq")
seq_id = ET.SubElement(seq, "seq-id")
seq_id.text = kwargs.pop('seq_id')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"mac_access_list_extended_hide_mac_acl_ext_seq_seq_id",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"mac",
"=",
"ET",
".",
"SubElement",
"(",
"config",
",",
"\"mac\"",
",",
"xmlns",
"=",... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_6/ver_6_0_1/yang/brocade_mac_access_list.py#L167-L182 |
brocade/pynos | pynos/versions/ver_6/ver_6_0_1/yang/brocade_mac_access_list.py | brocade_mac_access_list.mac_access_list_extended_hide_mac_acl_ext_seq_action | def mac_access_list_extended_hide_mac_acl_ext_seq_action(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
mac = ET.SubElement(config, "mac", xmlns="urn:brocade.com:mgmt:brocade-mac-access-list")
access_list = ET.SubElement(mac, "access-list")
extended = ET.SubElement(access_list, "extended")
name_key = ET.SubElement(extended, "name")
name_key.text = kwargs.pop('name')
hide_mac_acl_ext = ET.SubElement(extended, "hide-mac-acl-ext")
seq = ET.SubElement(hide_mac_acl_ext, "seq")
seq_id_key = ET.SubElement(seq, "seq-id")
seq_id_key.text = kwargs.pop('seq_id')
action = ET.SubElement(seq, "action")
action.text = kwargs.pop('action')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def mac_access_list_extended_hide_mac_acl_ext_seq_action(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
mac = ET.SubElement(config, "mac", xmlns="urn:brocade.com:mgmt:brocade-mac-access-list")
access_list = ET.SubElement(mac, "access-list")
extended = ET.SubElement(access_list, "extended")
name_key = ET.SubElement(extended, "name")
name_key.text = kwargs.pop('name')
hide_mac_acl_ext = ET.SubElement(extended, "hide-mac-acl-ext")
seq = ET.SubElement(hide_mac_acl_ext, "seq")
seq_id_key = ET.SubElement(seq, "seq-id")
seq_id_key.text = kwargs.pop('seq_id')
action = ET.SubElement(seq, "action")
action.text = kwargs.pop('action')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"mac_access_list_extended_hide_mac_acl_ext_seq_action",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"mac",
"=",
"ET",
".",
"SubElement",
"(",
"config",
",",
"\"mac\"",
",",
"xmlns",
"=",... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_6/ver_6_0_1/yang/brocade_mac_access_list.py#L184-L201 |
brocade/pynos | pynos/versions/ver_6/ver_6_0_1/yang/brocade_mac_access_list.py | brocade_mac_access_list.get_mac_acl_for_intf_input_interface_type | def get_mac_acl_for_intf_input_interface_type(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_mac_acl_for_intf = ET.Element("get_mac_acl_for_intf")
config = get_mac_acl_for_intf
input = ET.SubElement(get_mac_acl_for_intf, "input")
interface_type = ET.SubElement(input, "interface-type")
interface_type.text = kwargs.pop('interface_type')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def get_mac_acl_for_intf_input_interface_type(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_mac_acl_for_intf = ET.Element("get_mac_acl_for_intf")
config = get_mac_acl_for_intf
input = ET.SubElement(get_mac_acl_for_intf, "input")
interface_type = ET.SubElement(input, "interface-type")
interface_type.text = kwargs.pop('interface_type')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"get_mac_acl_for_intf_input_interface_type",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"get_mac_acl_for_intf",
"=",
"ET",
".",
"Element",
"(",
"\"get_mac_acl_for_intf\"",
")",
"config",
"=... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_6/ver_6_0_1/yang/brocade_mac_access_list.py#L391-L402 |
brocade/pynos | pynos/versions/ver_6/ver_6_0_1/yang/brocade_mac_access_list.py | brocade_mac_access_list.get_mac_acl_for_intf_input_interface_name | def get_mac_acl_for_intf_input_interface_name(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_mac_acl_for_intf = ET.Element("get_mac_acl_for_intf")
config = get_mac_acl_for_intf
input = ET.SubElement(get_mac_acl_for_intf, "input")
interface_name = ET.SubElement(input, "interface-name")
interface_name.text = kwargs.pop('interface_name')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def get_mac_acl_for_intf_input_interface_name(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_mac_acl_for_intf = ET.Element("get_mac_acl_for_intf")
config = get_mac_acl_for_intf
input = ET.SubElement(get_mac_acl_for_intf, "input")
interface_name = ET.SubElement(input, "interface-name")
interface_name.text = kwargs.pop('interface_name')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"get_mac_acl_for_intf_input_interface_name",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"get_mac_acl_for_intf",
"=",
"ET",
".",
"Element",
"(",
"\"get_mac_acl_for_intf\"",
")",
"config",
"=... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_6/ver_6_0_1/yang/brocade_mac_access_list.py#L404-L415 |
brocade/pynos | pynos/versions/ver_6/ver_6_0_1/yang/brocade_mac_access_list.py | brocade_mac_access_list.get_mac_acl_for_intf_input_direction | def get_mac_acl_for_intf_input_direction(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_mac_acl_for_intf = ET.Element("get_mac_acl_for_intf")
config = get_mac_acl_for_intf
input = ET.SubElement(get_mac_acl_for_intf, "input")
direction = ET.SubElement(input, "direction")
direction.text = kwargs.pop('direction')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def get_mac_acl_for_intf_input_direction(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_mac_acl_for_intf = ET.Element("get_mac_acl_for_intf")
config = get_mac_acl_for_intf
input = ET.SubElement(get_mac_acl_for_intf, "input")
direction = ET.SubElement(input, "direction")
direction.text = kwargs.pop('direction')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"get_mac_acl_for_intf_input_direction",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"get_mac_acl_for_intf",
"=",
"ET",
".",
"Element",
"(",
"\"get_mac_acl_for_intf\"",
")",
"config",
"=",
... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_6/ver_6_0_1/yang/brocade_mac_access_list.py#L417-L428 |
brocade/pynos | pynos/versions/ver_6/ver_6_0_1/yang/brocade_mac_access_list.py | brocade_mac_access_list.get_mac_acl_for_intf_output_interface_interface_type | def get_mac_acl_for_intf_output_interface_interface_type(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_mac_acl_for_intf = ET.Element("get_mac_acl_for_intf")
config = get_mac_acl_for_intf
output = ET.SubElement(get_mac_acl_for_intf, "output")
interface = ET.SubElement(output, "interface")
interface_name_key = ET.SubElement(interface, "interface-name")
interface_name_key.text = kwargs.pop('interface_name')
interface_type = ET.SubElement(interface, "interface-type")
interface_type.text = kwargs.pop('interface_type')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def get_mac_acl_for_intf_output_interface_interface_type(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_mac_acl_for_intf = ET.Element("get_mac_acl_for_intf")
config = get_mac_acl_for_intf
output = ET.SubElement(get_mac_acl_for_intf, "output")
interface = ET.SubElement(output, "interface")
interface_name_key = ET.SubElement(interface, "interface-name")
interface_name_key.text = kwargs.pop('interface_name')
interface_type = ET.SubElement(interface, "interface-type")
interface_type.text = kwargs.pop('interface_type')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"get_mac_acl_for_intf_output_interface_interface_type",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"get_mac_acl_for_intf",
"=",
"ET",
".",
"Element",
"(",
"\"get_mac_acl_for_intf\"",
")",
"co... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_6/ver_6_0_1/yang/brocade_mac_access_list.py#L430-L444 |
brocade/pynos | pynos/versions/ver_6/ver_6_0_1/yang/brocade_mac_access_list.py | brocade_mac_access_list.get_mac_acl_for_intf_output_interface_interface_name | def get_mac_acl_for_intf_output_interface_interface_name(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_mac_acl_for_intf = ET.Element("get_mac_acl_for_intf")
config = get_mac_acl_for_intf
output = ET.SubElement(get_mac_acl_for_intf, "output")
interface = ET.SubElement(output, "interface")
interface_type_key = ET.SubElement(interface, "interface-type")
interface_type_key.text = kwargs.pop('interface_type')
interface_name = ET.SubElement(interface, "interface-name")
interface_name.text = kwargs.pop('interface_name')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def get_mac_acl_for_intf_output_interface_interface_name(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_mac_acl_for_intf = ET.Element("get_mac_acl_for_intf")
config = get_mac_acl_for_intf
output = ET.SubElement(get_mac_acl_for_intf, "output")
interface = ET.SubElement(output, "interface")
interface_type_key = ET.SubElement(interface, "interface-type")
interface_type_key.text = kwargs.pop('interface_type')
interface_name = ET.SubElement(interface, "interface-name")
interface_name.text = kwargs.pop('interface_name')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"get_mac_acl_for_intf_output_interface_interface_name",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"get_mac_acl_for_intf",
"=",
"ET",
".",
"Element",
"(",
"\"get_mac_acl_for_intf\"",
")",
"co... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_6/ver_6_0_1/yang/brocade_mac_access_list.py#L446-L460 |
brocade/pynos | pynos/versions/ver_6/ver_6_0_1/yang/brocade_mac_access_list.py | brocade_mac_access_list.get_mac_acl_for_intf_output_interface_ingress_policy_policy_name | def get_mac_acl_for_intf_output_interface_ingress_policy_policy_name(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_mac_acl_for_intf = ET.Element("get_mac_acl_for_intf")
config = get_mac_acl_for_intf
output = ET.SubElement(get_mac_acl_for_intf, "output")
interface = ET.SubElement(output, "interface")
interface_type_key = ET.SubElement(interface, "interface-type")
interface_type_key.text = kwargs.pop('interface_type')
interface_name_key = ET.SubElement(interface, "interface-name")
interface_name_key.text = kwargs.pop('interface_name')
ingress_policy = ET.SubElement(interface, "ingress-policy")
policy_name = ET.SubElement(ingress_policy, "policy-name")
policy_name.text = kwargs.pop('policy_name')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def get_mac_acl_for_intf_output_interface_ingress_policy_policy_name(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_mac_acl_for_intf = ET.Element("get_mac_acl_for_intf")
config = get_mac_acl_for_intf
output = ET.SubElement(get_mac_acl_for_intf, "output")
interface = ET.SubElement(output, "interface")
interface_type_key = ET.SubElement(interface, "interface-type")
interface_type_key.text = kwargs.pop('interface_type')
interface_name_key = ET.SubElement(interface, "interface-name")
interface_name_key.text = kwargs.pop('interface_name')
ingress_policy = ET.SubElement(interface, "ingress-policy")
policy_name = ET.SubElement(ingress_policy, "policy-name")
policy_name.text = kwargs.pop('policy_name')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"get_mac_acl_for_intf_output_interface_ingress_policy_policy_name",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"get_mac_acl_for_intf",
"=",
"ET",
".",
"Element",
"(",
"\"get_mac_acl_for_intf\"",
... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_6/ver_6_0_1/yang/brocade_mac_access_list.py#L462-L479 |
lepture/terminal | terminal/builtin.py | Command.add_log_options | def add_log_options(self, verbose_func=None, quiet_func=None):
"""
A helper for setting up log options
"""
if not verbose_func:
def verbose_func():
return log.config(verbose=True)
if not quiet_func:
def quiet_func():
return log.config(quiet=True)
self.option('-v, --verbose', 'show more logs', verbose_func)
self.option('-q, --quiet', 'show less logs', quiet_func)
return self | python | def add_log_options(self, verbose_func=None, quiet_func=None):
"""
A helper for setting up log options
"""
if not verbose_func:
def verbose_func():
return log.config(verbose=True)
if not quiet_func:
def quiet_func():
return log.config(quiet=True)
self.option('-v, --verbose', 'show more logs', verbose_func)
self.option('-q, --quiet', 'show less logs', quiet_func)
return self | [
"def",
"add_log_options",
"(",
"self",
",",
"verbose_func",
"=",
"None",
",",
"quiet_func",
"=",
"None",
")",
":",
"if",
"not",
"verbose_func",
":",
"def",
"verbose_func",
"(",
")",
":",
"return",
"log",
".",
"config",
"(",
"verbose",
"=",
"True",
")",
... | A helper for setting up log options | [
"A",
"helper",
"for",
"setting",
"up",
"log",
"options"
] | train | https://github.com/lepture/terminal/blob/5226d1cac53077f12624aa51f64de7b5b05d9cb8/terminal/builtin.py#L44-L59 |
brocade/pynos | pynos/versions/ver_6/ver_6_0_1/bgp.py | BGP.local_asn | def local_asn(self, **kwargs):
"""Set BGP local ASN.
Args:
local_as (str): Local ASN of NOS deice.
rbridge_id (str): The rbridge ID of the device on which BGP will be
configured in a VCS fabric.
get (bool): Get config instead of editing config. (True, False)
callback (function): A function executed upon completion of the
method. The only parameter passed to `callback` will be the
``ElementTree`` `config`.
Returns:
Return value of `callback`.
Raises:
KeyError: if `local_as` is not specified.
Examples:
>>> import pynos.device
>>> conn = ('10.24.39.203', '22')
>>> auth = ('admin', 'password')
>>> with pynos.device.Device(conn=conn, auth=auth) as dev:
... output = dev.bgp.local_asn(local_as='65535',
... rbridge_id='225')
... dev.bgp.local_asn() # doctest: +IGNORE_EXCEPTION_DETAIL
Traceback (most recent call last):
KeyError
"""
is_get_config = kwargs.pop('get', False)
if not is_get_config:
local_as = kwargs.pop('local_as')
else:
local_as = ''
rbridge_id = kwargs.pop('rbridge_id', '1')
callback = kwargs.pop('callback', self._callback)
local_as_args = dict(local_as=local_as,
rbridge_id=rbridge_id)
enable_bgp = getattr(self._rbridge,
'rbridge_id_router_router_bgp_router_bgp_'
'attributes_local_as')(**local_as_args)
bgp = enable_bgp.find('.//*.//*.//*')
bgp.remove(bgp.find('.//*'))
if not is_get_config:
callback(enable_bgp)
local_as = getattr(self._rbridge,
'rbridge_id_router_router_bgp_router_bgp_attri'
'butes_local_as')
config = local_as(**local_as_args)
if is_get_config:
return callback(config, handler='get_config')
return callback(config) | python | def local_asn(self, **kwargs):
"""Set BGP local ASN.
Args:
local_as (str): Local ASN of NOS deice.
rbridge_id (str): The rbridge ID of the device on which BGP will be
configured in a VCS fabric.
get (bool): Get config instead of editing config. (True, False)
callback (function): A function executed upon completion of the
method. The only parameter passed to `callback` will be the
``ElementTree`` `config`.
Returns:
Return value of `callback`.
Raises:
KeyError: if `local_as` is not specified.
Examples:
>>> import pynos.device
>>> conn = ('10.24.39.203', '22')
>>> auth = ('admin', 'password')
>>> with pynos.device.Device(conn=conn, auth=auth) as dev:
... output = dev.bgp.local_asn(local_as='65535',
... rbridge_id='225')
... dev.bgp.local_asn() # doctest: +IGNORE_EXCEPTION_DETAIL
Traceback (most recent call last):
KeyError
"""
is_get_config = kwargs.pop('get', False)
if not is_get_config:
local_as = kwargs.pop('local_as')
else:
local_as = ''
rbridge_id = kwargs.pop('rbridge_id', '1')
callback = kwargs.pop('callback', self._callback)
local_as_args = dict(local_as=local_as,
rbridge_id=rbridge_id)
enable_bgp = getattr(self._rbridge,
'rbridge_id_router_router_bgp_router_bgp_'
'attributes_local_as')(**local_as_args)
bgp = enable_bgp.find('.//*.//*.//*')
bgp.remove(bgp.find('.//*'))
if not is_get_config:
callback(enable_bgp)
local_as = getattr(self._rbridge,
'rbridge_id_router_router_bgp_router_bgp_attri'
'butes_local_as')
config = local_as(**local_as_args)
if is_get_config:
return callback(config, handler='get_config')
return callback(config) | [
"def",
"local_asn",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"is_get_config",
"=",
"kwargs",
".",
"pop",
"(",
"'get'",
",",
"False",
")",
"if",
"not",
"is_get_config",
":",
"local_as",
"=",
"kwargs",
".",
"pop",
"(",
"'local_as'",
")",
"else",
... | Set BGP local ASN.
Args:
local_as (str): Local ASN of NOS deice.
rbridge_id (str): The rbridge ID of the device on which BGP will be
configured in a VCS fabric.
get (bool): Get config instead of editing config. (True, False)
callback (function): A function executed upon completion of the
method. The only parameter passed to `callback` will be the
``ElementTree`` `config`.
Returns:
Return value of `callback`.
Raises:
KeyError: if `local_as` is not specified.
Examples:
>>> import pynos.device
>>> conn = ('10.24.39.203', '22')
>>> auth = ('admin', 'password')
>>> with pynos.device.Device(conn=conn, auth=auth) as dev:
... output = dev.bgp.local_asn(local_as='65535',
... rbridge_id='225')
... dev.bgp.local_asn() # doctest: +IGNORE_EXCEPTION_DETAIL
Traceback (most recent call last):
KeyError | [
"Set",
"BGP",
"local",
"ASN",
"."
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_6/ver_6_0_1/bgp.py#L48-L99 |
brocade/pynos | pynos/versions/ver_6/ver_6_0_1/bgp.py | BGP.as4_capability | def as4_capability(self, **kwargs):
"""Set Spanning Tree state.
Args:
enabled (bool): Is AS4 Capability enabled? (True, False)
callback (function): A function executed upon completion of the
method. The only parameter passed to `callback` will be the
``ElementTree`` `config`.
Returns:
Return value of `callback`.
Raises:
ValueError: if `enabled` are invalid.
Examples:
>>> import pynos.device
>>> switches = ['10.24.39.211', '10.24.39.203']
>>> auth = ('admin', 'password')
>>> for switch in switches:
... conn = (switch, '22')
... with pynos.device.Device(conn=conn, auth=auth) as dev:
... output = dev.bgp.local_asn(local_as='65535',
... rbridge_id='225')
... output = dev.bgp.as4_capability(
... rbridge_id='225', enabled=True)
... output = dev.bgp.as4_capability(
... rbridge_id='225', enabled=False)
"""
enabled = kwargs.pop('enabled', True)
callback = kwargs.pop('callback', self._callback)
if not isinstance(enabled, bool):
raise ValueError('%s must be `True` or `False`.' % repr(enabled))
as4_capability_args = dict(vrf_name=kwargs.pop('vrf', 'default'),
rbridge_id=kwargs.pop('rbridge_id', '1'))
as4_capability = getattr(self._rbridge,
'rbridge_id_router_router_bgp_router_bgp'
'_attributes_capability_as4_enable')
config = as4_capability(**as4_capability_args)
if not enabled:
capability = config.find('.//*capability')
capability.set('operation', 'delete')
# shutdown = capability.find('.//*as4-enable')
# shutdown.set('operation', 'delete')
return callback(config) | python | def as4_capability(self, **kwargs):
"""Set Spanning Tree state.
Args:
enabled (bool): Is AS4 Capability enabled? (True, False)
callback (function): A function executed upon completion of the
method. The only parameter passed to `callback` will be the
``ElementTree`` `config`.
Returns:
Return value of `callback`.
Raises:
ValueError: if `enabled` are invalid.
Examples:
>>> import pynos.device
>>> switches = ['10.24.39.211', '10.24.39.203']
>>> auth = ('admin', 'password')
>>> for switch in switches:
... conn = (switch, '22')
... with pynos.device.Device(conn=conn, auth=auth) as dev:
... output = dev.bgp.local_asn(local_as='65535',
... rbridge_id='225')
... output = dev.bgp.as4_capability(
... rbridge_id='225', enabled=True)
... output = dev.bgp.as4_capability(
... rbridge_id='225', enabled=False)
"""
enabled = kwargs.pop('enabled', True)
callback = kwargs.pop('callback', self._callback)
if not isinstance(enabled, bool):
raise ValueError('%s must be `True` or `False`.' % repr(enabled))
as4_capability_args = dict(vrf_name=kwargs.pop('vrf', 'default'),
rbridge_id=kwargs.pop('rbridge_id', '1'))
as4_capability = getattr(self._rbridge,
'rbridge_id_router_router_bgp_router_bgp'
'_attributes_capability_as4_enable')
config = as4_capability(**as4_capability_args)
if not enabled:
capability = config.find('.//*capability')
capability.set('operation', 'delete')
# shutdown = capability.find('.//*as4-enable')
# shutdown.set('operation', 'delete')
return callback(config) | [
"def",
"as4_capability",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"enabled",
"=",
"kwargs",
".",
"pop",
"(",
"'enabled'",
",",
"True",
")",
"callback",
"=",
"kwargs",
".",
"pop",
"(",
"'callback'",
",",
"self",
".",
"_callback",
")",
"if",
"no... | Set Spanning Tree state.
Args:
enabled (bool): Is AS4 Capability enabled? (True, False)
callback (function): A function executed upon completion of the
method. The only parameter passed to `callback` will be the
``ElementTree`` `config`.
Returns:
Return value of `callback`.
Raises:
ValueError: if `enabled` are invalid.
Examples:
>>> import pynos.device
>>> switches = ['10.24.39.211', '10.24.39.203']
>>> auth = ('admin', 'password')
>>> for switch in switches:
... conn = (switch, '22')
... with pynos.device.Device(conn=conn, auth=auth) as dev:
... output = dev.bgp.local_asn(local_as='65535',
... rbridge_id='225')
... output = dev.bgp.as4_capability(
... rbridge_id='225', enabled=True)
... output = dev.bgp.as4_capability(
... rbridge_id='225', enabled=False) | [
"Set",
"Spanning",
"Tree",
"state",
"."
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_6/ver_6_0_1/bgp.py#L101-L152 |
brocade/pynos | pynos/versions/ver_6/ver_6_0_1/bgp.py | BGP.remove_bgp | def remove_bgp(self, **kwargs):
"""Remove BGP process completely.
Args:
vrf (str): The VRF for this BGP process.
rbridge_id (str): The rbridge ID of the device on which BGP will be
configured in a VCS fabric.
callback (function): A function executed upon completion of the
method. The only parameter passed to `callback` will be the
``ElementTree`` `config`.
Returns:
Return value of `callback`.
Raises:
None
Examples:
>>> import pynos.device
>>> conn = ('10.24.39.203', '22')
>>> auth = ('admin', 'password')
>>> with pynos.device.Device(conn=conn, auth=auth) as dev:
... output = dev.bgp.local_asn(local_as='65535',
... rbridge_id='225')
... output = dev.bgp.remove_bgp(rbridge_id='225')
"""
rbridge_id = kwargs.pop('rbridge_id', '1')
callback = kwargs.pop('callback', self._callback)
disable_args = dict(rbridge_id=rbridge_id, local_as='65000')
config = getattr(self._rbridge,
'rbridge_id_router_router_bgp_router_bgp_'
'attributes_local_as')(**disable_args)
bgp = config.find('.//*.//*.//*')
bgp.remove(bgp.find('.//*'))
bgp.set('operation', 'delete')
return callback(config) | python | def remove_bgp(self, **kwargs):
"""Remove BGP process completely.
Args:
vrf (str): The VRF for this BGP process.
rbridge_id (str): The rbridge ID of the device on which BGP will be
configured in a VCS fabric.
callback (function): A function executed upon completion of the
method. The only parameter passed to `callback` will be the
``ElementTree`` `config`.
Returns:
Return value of `callback`.
Raises:
None
Examples:
>>> import pynos.device
>>> conn = ('10.24.39.203', '22')
>>> auth = ('admin', 'password')
>>> with pynos.device.Device(conn=conn, auth=auth) as dev:
... output = dev.bgp.local_asn(local_as='65535',
... rbridge_id='225')
... output = dev.bgp.remove_bgp(rbridge_id='225')
"""
rbridge_id = kwargs.pop('rbridge_id', '1')
callback = kwargs.pop('callback', self._callback)
disable_args = dict(rbridge_id=rbridge_id, local_as='65000')
config = getattr(self._rbridge,
'rbridge_id_router_router_bgp_router_bgp_'
'attributes_local_as')(**disable_args)
bgp = config.find('.//*.//*.//*')
bgp.remove(bgp.find('.//*'))
bgp.set('operation', 'delete')
return callback(config) | [
"def",
"remove_bgp",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"rbridge_id",
"=",
"kwargs",
".",
"pop",
"(",
"'rbridge_id'",
",",
"'1'",
")",
"callback",
"=",
"kwargs",
".",
"pop",
"(",
"'callback'",
",",
"self",
".",
"_callback",
")",
"disable_a... | Remove BGP process completely.
Args:
vrf (str): The VRF for this BGP process.
rbridge_id (str): The rbridge ID of the device on which BGP will be
configured in a VCS fabric.
callback (function): A function executed upon completion of the
method. The only parameter passed to `callback` will be the
``ElementTree`` `config`.
Returns:
Return value of `callback`.
Raises:
None
Examples:
>>> import pynos.device
>>> conn = ('10.24.39.203', '22')
>>> auth = ('admin', 'password')
>>> with pynos.device.Device(conn=conn, auth=auth) as dev:
... output = dev.bgp.local_asn(local_as='65535',
... rbridge_id='225')
... output = dev.bgp.remove_bgp(rbridge_id='225') | [
"Remove",
"BGP",
"process",
"completely",
"."
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_6/ver_6_0_1/bgp.py#L154-L190 |
brocade/pynos | pynos/versions/ver_6/ver_6_0_1/bgp.py | BGP.neighbor | def neighbor(self, **kwargs):
"""Add BGP neighbor.
Args:
ip_addr (str): IP Address of BGP neighbor.
remote_as (str): Remote ASN of BGP neighbor.
rbridge_id (str): The rbridge ID of the device on which BGP will be
configured in a VCS fabric.
delete (bool): Deletes the neighbor if `delete` is ``True``.
get (bool): Get config instead of editing config. (True, False)
callback (function): A function executed upon completion of the
method. The only parameter passed to `callback` will be the
``ElementTree`` `config`.
# Returns:
Return value of `callback`.
Raises:
KeyError: if `remote_as` or `ip_addr` is not specified.
Examples:
>>> import pynos.device
>>> conn = ('10.24.39.203', '22')
>>> auth = ('admin', 'password')
>>> with pynos.device.Device(conn=conn, auth=auth) as dev:
... output = dev.bgp.local_asn(local_as='65535',
... rbridge_id='225')
... output = dev.bgp.neighbor(ip_addr='10.10.10.10',
... remote_as='65535', rbridge_id='225')
... output = dev.bgp.neighbor(remote_as='65535',
... rbridge_id='225',
... ip_addr='2001:4818:f000:1ab:cafe:beef:1000:1')
... output = dev.bgp.neighbor(ip_addr='10.10.10.10',
... delete=True, rbridge_id='225')
... output = dev.bgp.neighbor(remote_as='65535',
... rbridge_id='225',
... ip_addr='2001:4818:f000:1ab:cafe:beef:1000:1',
... delete=True)
... dev.bgp.neighbor() # doctest: +IGNORE_EXCEPTION_DETAIL
Traceback (most recent call last):
KeyError
"""
ip_addr = kwargs.pop('ip_addr')
remote_as = kwargs.pop('remote_as', None)
rbridge_id = kwargs.pop('rbridge_id', '1')
delete = kwargs.pop('delete', False)
callback = kwargs.pop('callback', self._callback)
ip_addr = ip_interface(unicode(ip_addr))
if not delete and remote_as is None:
raise ValueError('When configuring a neighbor, you must specify '
'its remote-as.')
neighbor_args = dict(router_bgp_neighbor_address=str(ip_addr.ip),
remote_as=remote_as,
rbridge_id=rbridge_id)
if ip_addr.version == 6:
neighbor_args['router_bgp_neighbor_ipv6_address'] = str(ip_addr.ip)
if ip_addr.version == 4:
neighbor = getattr(self._rbridge,
'rbridge_id_router_router_bgp_'
'router_bgp_attributes_neighbor_neighbor_ips_'
'neighbor_addr_remote_as')
ip_addr_path = './/*remote-as'
else:
neighbor = getattr(self._rbridge,
'rbridge_id_router_router_bgp_'
'router_bgp_attributes_neighbor_'
'neighbor_ipv6s_neighbor_ipv6_addr_remote_as')
ip_addr_path = './/*remote-as'
config = neighbor(**neighbor_args)
if delete and config.find(ip_addr_path) is not None:
if ip_addr.version == 4:
config.find(ip_addr_path).set('operation', 'delete')
config.find('.//*router-bgp-neighbor-address').set('operation',
'delete')
elif ip_addr.version == 6:
config.find(ip_addr_path).set('operation', 'delete')
config.find('.//*router-bgp-neighbor-ipv6-address').set(
'operation', 'delete')
else:
if ip_addr.version == 6:
callback(config)
activate_args = dict(rbridge_id=rbridge_id,
af_ipv6_neighbor_address=str(ip_addr.ip))
activate_neighbor = getattr(self._rbridge,
'rbridge_id_router_router_bgp_'
'address_family_ipv6_ipv6_unicast_'
'default_vrf_neighbor_af_ipv6_'
'neighbor_address_holder_af_ipv6_'
'neighbor_address_activate')
config = activate_neighbor(**activate_args)
if kwargs.pop('get', False):
return callback(config, handler='get_config')
return callback(config) | python | def neighbor(self, **kwargs):
"""Add BGP neighbor.
Args:
ip_addr (str): IP Address of BGP neighbor.
remote_as (str): Remote ASN of BGP neighbor.
rbridge_id (str): The rbridge ID of the device on which BGP will be
configured in a VCS fabric.
delete (bool): Deletes the neighbor if `delete` is ``True``.
get (bool): Get config instead of editing config. (True, False)
callback (function): A function executed upon completion of the
method. The only parameter passed to `callback` will be the
``ElementTree`` `config`.
# Returns:
Return value of `callback`.
Raises:
KeyError: if `remote_as` or `ip_addr` is not specified.
Examples:
>>> import pynos.device
>>> conn = ('10.24.39.203', '22')
>>> auth = ('admin', 'password')
>>> with pynos.device.Device(conn=conn, auth=auth) as dev:
... output = dev.bgp.local_asn(local_as='65535',
... rbridge_id='225')
... output = dev.bgp.neighbor(ip_addr='10.10.10.10',
... remote_as='65535', rbridge_id='225')
... output = dev.bgp.neighbor(remote_as='65535',
... rbridge_id='225',
... ip_addr='2001:4818:f000:1ab:cafe:beef:1000:1')
... output = dev.bgp.neighbor(ip_addr='10.10.10.10',
... delete=True, rbridge_id='225')
... output = dev.bgp.neighbor(remote_as='65535',
... rbridge_id='225',
... ip_addr='2001:4818:f000:1ab:cafe:beef:1000:1',
... delete=True)
... dev.bgp.neighbor() # doctest: +IGNORE_EXCEPTION_DETAIL
Traceback (most recent call last):
KeyError
"""
ip_addr = kwargs.pop('ip_addr')
remote_as = kwargs.pop('remote_as', None)
rbridge_id = kwargs.pop('rbridge_id', '1')
delete = kwargs.pop('delete', False)
callback = kwargs.pop('callback', self._callback)
ip_addr = ip_interface(unicode(ip_addr))
if not delete and remote_as is None:
raise ValueError('When configuring a neighbor, you must specify '
'its remote-as.')
neighbor_args = dict(router_bgp_neighbor_address=str(ip_addr.ip),
remote_as=remote_as,
rbridge_id=rbridge_id)
if ip_addr.version == 6:
neighbor_args['router_bgp_neighbor_ipv6_address'] = str(ip_addr.ip)
if ip_addr.version == 4:
neighbor = getattr(self._rbridge,
'rbridge_id_router_router_bgp_'
'router_bgp_attributes_neighbor_neighbor_ips_'
'neighbor_addr_remote_as')
ip_addr_path = './/*remote-as'
else:
neighbor = getattr(self._rbridge,
'rbridge_id_router_router_bgp_'
'router_bgp_attributes_neighbor_'
'neighbor_ipv6s_neighbor_ipv6_addr_remote_as')
ip_addr_path = './/*remote-as'
config = neighbor(**neighbor_args)
if delete and config.find(ip_addr_path) is not None:
if ip_addr.version == 4:
config.find(ip_addr_path).set('operation', 'delete')
config.find('.//*router-bgp-neighbor-address').set('operation',
'delete')
elif ip_addr.version == 6:
config.find(ip_addr_path).set('operation', 'delete')
config.find('.//*router-bgp-neighbor-ipv6-address').set(
'operation', 'delete')
else:
if ip_addr.version == 6:
callback(config)
activate_args = dict(rbridge_id=rbridge_id,
af_ipv6_neighbor_address=str(ip_addr.ip))
activate_neighbor = getattr(self._rbridge,
'rbridge_id_router_router_bgp_'
'address_family_ipv6_ipv6_unicast_'
'default_vrf_neighbor_af_ipv6_'
'neighbor_address_holder_af_ipv6_'
'neighbor_address_activate')
config = activate_neighbor(**activate_args)
if kwargs.pop('get', False):
return callback(config, handler='get_config')
return callback(config) | [
"def",
"neighbor",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"ip_addr",
"=",
"kwargs",
".",
"pop",
"(",
"'ip_addr'",
")",
"remote_as",
"=",
"kwargs",
".",
"pop",
"(",
"'remote_as'",
",",
"None",
")",
"rbridge_id",
"=",
"kwargs",
".",
"pop",
"("... | Add BGP neighbor.
Args:
ip_addr (str): IP Address of BGP neighbor.
remote_as (str): Remote ASN of BGP neighbor.
rbridge_id (str): The rbridge ID of the device on which BGP will be
configured in a VCS fabric.
delete (bool): Deletes the neighbor if `delete` is ``True``.
get (bool): Get config instead of editing config. (True, False)
callback (function): A function executed upon completion of the
method. The only parameter passed to `callback` will be the
``ElementTree`` `config`.
# Returns:
Return value of `callback`.
Raises:
KeyError: if `remote_as` or `ip_addr` is not specified.
Examples:
>>> import pynos.device
>>> conn = ('10.24.39.203', '22')
>>> auth = ('admin', 'password')
>>> with pynos.device.Device(conn=conn, auth=auth) as dev:
... output = dev.bgp.local_asn(local_as='65535',
... rbridge_id='225')
... output = dev.bgp.neighbor(ip_addr='10.10.10.10',
... remote_as='65535', rbridge_id='225')
... output = dev.bgp.neighbor(remote_as='65535',
... rbridge_id='225',
... ip_addr='2001:4818:f000:1ab:cafe:beef:1000:1')
... output = dev.bgp.neighbor(ip_addr='10.10.10.10',
... delete=True, rbridge_id='225')
... output = dev.bgp.neighbor(remote_as='65535',
... rbridge_id='225',
... ip_addr='2001:4818:f000:1ab:cafe:beef:1000:1',
... delete=True)
... dev.bgp.neighbor() # doctest: +IGNORE_EXCEPTION_DETAIL
Traceback (most recent call last):
KeyError | [
"Add",
"BGP",
"neighbor",
"."
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_6/ver_6_0_1/bgp.py#L192-L289 |
brocade/pynos | pynos/versions/ver_6/ver_6_0_1/bgp.py | BGP.redistribute | def redistribute(self, **kwargs):
"""Set BGP redistribute properties.
Args:
vrf (str): The VRF for this BGP process.
rbridge_id (str): The rbridge ID of the device on which BGP will be
configured in a VCS fabric.
source (str): Source for redistributing. (connected)
afi (str): Address family to configure. (ipv4, ipv6)
get (bool): Get config instead of editing config. (True, False)
callback (function): A function executed upon completion of the
method. The only parameter passed to `callback` will be the
``ElementTree`` `config`.
Returns:
Return value of `callback`.
Raises:
KeyError: if `source` is not specified.
Examples:
>>> import pynos.device
>>> conn = ('10.24.39.203', '22')
>>> auth = ('admin', 'password')
>>> with pynos.device.Device(conn=conn, auth=auth) as dev:
... output = dev.bgp.redistribute(source='connected',
... rbridge_id='225')
... output = dev.bgp.redistribute(source='connected',
... rbridge_id='225', get=True)
... output = dev.bgp.redistribute(source='connected',
... rbridge_id='225', delete=True)
... dev.bgp.redistribute() # doctest: +IGNORE_EXCEPTION_DETAIL
Traceback (most recent call last):
KeyError
... dev.bgp.redistribute(source='connected', rbridge_id='225',
... afi='hodor') # doctest: +IGNORE_EXCEPTION_DETAIL
Traceback (most recent call last):
AttributeError
... dev.bgp.redistribute(source='hodor', rbridge_id='225',
... afi='ipv4') # doctest: +IGNORE_EXCEPTION_DETAIL
Traceback (most recent call last):
AttributeError
"""
# This method is the same as the base method except for one place.
# The class doesn't inherit from the base class, though, so we have
# to duplicate.
source = kwargs.pop('source')
afi = kwargs.pop('afi', 'ipv4')
callback = kwargs.pop('callback', self._callback)
if afi not in ['ipv4', 'ipv6']:
raise AttributeError('Invalid AFI.')
args = dict(rbridge_id=kwargs.pop('rbridge_id', '1'),
afi=afi, source=source)
redistribute = self._redistribute_builder(afi=afi, source=source)
config = redistribute(**args)
if kwargs.pop('get', False):
return callback(config, handler='get_config')
if kwargs.pop('delete', False):
tag = 'redistribute-%s' % source
config.find('.//*%s' % tag).set('operation', 'delete')
return callback(config) | python | def redistribute(self, **kwargs):
"""Set BGP redistribute properties.
Args:
vrf (str): The VRF for this BGP process.
rbridge_id (str): The rbridge ID of the device on which BGP will be
configured in a VCS fabric.
source (str): Source for redistributing. (connected)
afi (str): Address family to configure. (ipv4, ipv6)
get (bool): Get config instead of editing config. (True, False)
callback (function): A function executed upon completion of the
method. The only parameter passed to `callback` will be the
``ElementTree`` `config`.
Returns:
Return value of `callback`.
Raises:
KeyError: if `source` is not specified.
Examples:
>>> import pynos.device
>>> conn = ('10.24.39.203', '22')
>>> auth = ('admin', 'password')
>>> with pynos.device.Device(conn=conn, auth=auth) as dev:
... output = dev.bgp.redistribute(source='connected',
... rbridge_id='225')
... output = dev.bgp.redistribute(source='connected',
... rbridge_id='225', get=True)
... output = dev.bgp.redistribute(source='connected',
... rbridge_id='225', delete=True)
... dev.bgp.redistribute() # doctest: +IGNORE_EXCEPTION_DETAIL
Traceback (most recent call last):
KeyError
... dev.bgp.redistribute(source='connected', rbridge_id='225',
... afi='hodor') # doctest: +IGNORE_EXCEPTION_DETAIL
Traceback (most recent call last):
AttributeError
... dev.bgp.redistribute(source='hodor', rbridge_id='225',
... afi='ipv4') # doctest: +IGNORE_EXCEPTION_DETAIL
Traceback (most recent call last):
AttributeError
"""
# This method is the same as the base method except for one place.
# The class doesn't inherit from the base class, though, so we have
# to duplicate.
source = kwargs.pop('source')
afi = kwargs.pop('afi', 'ipv4')
callback = kwargs.pop('callback', self._callback)
if afi not in ['ipv4', 'ipv6']:
raise AttributeError('Invalid AFI.')
args = dict(rbridge_id=kwargs.pop('rbridge_id', '1'),
afi=afi, source=source)
redistribute = self._redistribute_builder(afi=afi, source=source)
config = redistribute(**args)
if kwargs.pop('get', False):
return callback(config, handler='get_config')
if kwargs.pop('delete', False):
tag = 'redistribute-%s' % source
config.find('.//*%s' % tag).set('operation', 'delete')
return callback(config) | [
"def",
"redistribute",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"# This method is the same as the base method except for one place.",
"# The class doesn't inherit from the base class, though, so we have",
"# to duplicate.",
"source",
"=",
"kwargs",
".",
"pop",
"(",
"'sou... | Set BGP redistribute properties.
Args:
vrf (str): The VRF for this BGP process.
rbridge_id (str): The rbridge ID of the device on which BGP will be
configured in a VCS fabric.
source (str): Source for redistributing. (connected)
afi (str): Address family to configure. (ipv4, ipv6)
get (bool): Get config instead of editing config. (True, False)
callback (function): A function executed upon completion of the
method. The only parameter passed to `callback` will be the
``ElementTree`` `config`.
Returns:
Return value of `callback`.
Raises:
KeyError: if `source` is not specified.
Examples:
>>> import pynos.device
>>> conn = ('10.24.39.203', '22')
>>> auth = ('admin', 'password')
>>> with pynos.device.Device(conn=conn, auth=auth) as dev:
... output = dev.bgp.redistribute(source='connected',
... rbridge_id='225')
... output = dev.bgp.redistribute(source='connected',
... rbridge_id='225', get=True)
... output = dev.bgp.redistribute(source='connected',
... rbridge_id='225', delete=True)
... dev.bgp.redistribute() # doctest: +IGNORE_EXCEPTION_DETAIL
Traceback (most recent call last):
KeyError
... dev.bgp.redistribute(source='connected', rbridge_id='225',
... afi='hodor') # doctest: +IGNORE_EXCEPTION_DETAIL
Traceback (most recent call last):
AttributeError
... dev.bgp.redistribute(source='hodor', rbridge_id='225',
... afi='ipv4') # doctest: +IGNORE_EXCEPTION_DETAIL
Traceback (most recent call last):
AttributeError | [
"Set",
"BGP",
"redistribute",
"properties",
"."
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_6/ver_6_0_1/bgp.py#L477-L537 |
brocade/pynos | pynos/versions/ver_6/ver_6_0_1/bgp.py | BGP._redistribute_builder | def _redistribute_builder(self, afi='ipv4', source=None):
"""Build BGP redistribute method.
Do not use this method directly. You probably want ``redistribute``.
Args:
source (str): Source for redistributing. (connected)
afi (str): Address family to configure. (ipv4, ipv6)
Returns:
Method to redistribute desired source.
Raises:
KeyError: if `source` is not specified.
Examples:
>>> import pynos.device
>>> conn = ('10.24.39.203', '22')
>>> auth = ('admin', 'password')
>>> with pynos.device.Device(conn=conn, auth=auth) as dev:
... output = dev.bgp._redistribute_builder(source='connected',
... afi='ipv4')
... dev.bgp._redistribute_builder(source='hodor',
... afi='ipv4') # doctest: +IGNORE_EXCEPTION_DETAIL
Traceback (most recent call last):
AttributeError
"""
if source == 'connected':
return getattr(self._rbridge,
'rbridge_id_router_router_bgp_address_family_{0}_'
'{0}_unicast_default_vrf_af_{0}_uc_and_vrf_cmds_'
'call_point_holder_redistribute_connected_'
'redistribute_connected'.format(afi))
# TODO: Add support for 'static' and 'ospf'
else:
raise AttributeError('Invalid source.') | python | def _redistribute_builder(self, afi='ipv4', source=None):
"""Build BGP redistribute method.
Do not use this method directly. You probably want ``redistribute``.
Args:
source (str): Source for redistributing. (connected)
afi (str): Address family to configure. (ipv4, ipv6)
Returns:
Method to redistribute desired source.
Raises:
KeyError: if `source` is not specified.
Examples:
>>> import pynos.device
>>> conn = ('10.24.39.203', '22')
>>> auth = ('admin', 'password')
>>> with pynos.device.Device(conn=conn, auth=auth) as dev:
... output = dev.bgp._redistribute_builder(source='connected',
... afi='ipv4')
... dev.bgp._redistribute_builder(source='hodor',
... afi='ipv4') # doctest: +IGNORE_EXCEPTION_DETAIL
Traceback (most recent call last):
AttributeError
"""
if source == 'connected':
return getattr(self._rbridge,
'rbridge_id_router_router_bgp_address_family_{0}_'
'{0}_unicast_default_vrf_af_{0}_uc_and_vrf_cmds_'
'call_point_holder_redistribute_connected_'
'redistribute_connected'.format(afi))
# TODO: Add support for 'static' and 'ospf'
else:
raise AttributeError('Invalid source.') | [
"def",
"_redistribute_builder",
"(",
"self",
",",
"afi",
"=",
"'ipv4'",
",",
"source",
"=",
"None",
")",
":",
"if",
"source",
"==",
"'connected'",
":",
"return",
"getattr",
"(",
"self",
".",
"_rbridge",
",",
"'rbridge_id_router_router_bgp_address_family_{0}_'",
... | Build BGP redistribute method.
Do not use this method directly. You probably want ``redistribute``.
Args:
source (str): Source for redistributing. (connected)
afi (str): Address family to configure. (ipv4, ipv6)
Returns:
Method to redistribute desired source.
Raises:
KeyError: if `source` is not specified.
Examples:
>>> import pynos.device
>>> conn = ('10.24.39.203', '22')
>>> auth = ('admin', 'password')
>>> with pynos.device.Device(conn=conn, auth=auth) as dev:
... output = dev.bgp._redistribute_builder(source='connected',
... afi='ipv4')
... dev.bgp._redistribute_builder(source='hodor',
... afi='ipv4') # doctest: +IGNORE_EXCEPTION_DETAIL
Traceback (most recent call last):
AttributeError | [
"Build",
"BGP",
"redistribute",
"method",
"."
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_6/ver_6_0_1/bgp.py#L539-L574 |
brocade/pynos | pynos/versions/ver_6/ver_6_0_1/bgp.py | BGP.max_paths | def max_paths(self, **kwargs):
"""Set BGP max paths property.
Args:
vrf (str): The VRF for this BGP process.
rbridge_id (str): The rbridge ID of the device on which BGP will be
configured in a VCS fabric.
paths (str): Number of paths for BGP ECMP (default: 8).
afi (str): Address family to configure. (ipv4, ipv6)
get (bool): Get config instead of editing config. (True, False)
callback (function): A function executed upon completion of the
method. The only parameter passed to `callback` will be the
``ElementTree`` `config`.
Returns:
Return value of `callback`.
Raises:
``AttributeError``: When `afi` is not one of ['ipv4', 'ipv6']
Examples:
>>> import pynos.device
>>> conn = ('10.24.39.203', '22')
>>> auth = ('admin', 'password')
>>> with pynos.device.Device(conn=conn, auth=auth) as dev:
... output = dev.bgp.max_paths(paths='8',
... rbridge_id='225')
... output = dev.bgp.max_paths(paths='8',
... rbridge_id='225', get=True)
... output = dev.bgp.max_paths(paths='8',
... rbridge_id='225', delete=True)
... output = dev.bgp.max_paths(paths='8', afi='ipv6',
... rbridge_id='225')
... output = dev.bgp.max_paths(paths='8', afi='ipv6',
... rbridge_id='225', get=True)
... output = dev.bgp.max_paths(paths='8', afi='ipv6',
... rbridge_id='225', delete=True)
... output = dev.bgp.max_paths(paths='8', afi='ipv5',
... rbridge_id='225') # doctest: +IGNORE_EXCEPTION_DETAIL
Traceback (most recent call last):
AttributeError
"""
afi = kwargs.pop('afi', 'ipv4')
callback = kwargs.pop('callback', self._callback)
if afi not in ['ipv4', 'ipv6']:
raise AttributeError('Invalid AFI.')
args = dict(rbridge_id=kwargs.pop('rbridge_id', '1'),
load_sharing_value=kwargs.pop('paths', '8'))
max_paths = getattr(self._rbridge,
'rbridge_id_router_router_bgp_address_family_{0}_'
'{0}_unicast_default_vrf_af_common_cmds_holder_'
'maximum_paths_load_sharing_value'.format(afi))
config = max_paths(**args)
if kwargs.pop('get', False):
return callback(config, handler='get_config')
if kwargs.pop('delete', False):
tag = 'maximum-paths'
config.find('.//*%s' % tag).set('operation', 'delete')
return callback(config) | python | def max_paths(self, **kwargs):
"""Set BGP max paths property.
Args:
vrf (str): The VRF for this BGP process.
rbridge_id (str): The rbridge ID of the device on which BGP will be
configured in a VCS fabric.
paths (str): Number of paths for BGP ECMP (default: 8).
afi (str): Address family to configure. (ipv4, ipv6)
get (bool): Get config instead of editing config. (True, False)
callback (function): A function executed upon completion of the
method. The only parameter passed to `callback` will be the
``ElementTree`` `config`.
Returns:
Return value of `callback`.
Raises:
``AttributeError``: When `afi` is not one of ['ipv4', 'ipv6']
Examples:
>>> import pynos.device
>>> conn = ('10.24.39.203', '22')
>>> auth = ('admin', 'password')
>>> with pynos.device.Device(conn=conn, auth=auth) as dev:
... output = dev.bgp.max_paths(paths='8',
... rbridge_id='225')
... output = dev.bgp.max_paths(paths='8',
... rbridge_id='225', get=True)
... output = dev.bgp.max_paths(paths='8',
... rbridge_id='225', delete=True)
... output = dev.bgp.max_paths(paths='8', afi='ipv6',
... rbridge_id='225')
... output = dev.bgp.max_paths(paths='8', afi='ipv6',
... rbridge_id='225', get=True)
... output = dev.bgp.max_paths(paths='8', afi='ipv6',
... rbridge_id='225', delete=True)
... output = dev.bgp.max_paths(paths='8', afi='ipv5',
... rbridge_id='225') # doctest: +IGNORE_EXCEPTION_DETAIL
Traceback (most recent call last):
AttributeError
"""
afi = kwargs.pop('afi', 'ipv4')
callback = kwargs.pop('callback', self._callback)
if afi not in ['ipv4', 'ipv6']:
raise AttributeError('Invalid AFI.')
args = dict(rbridge_id=kwargs.pop('rbridge_id', '1'),
load_sharing_value=kwargs.pop('paths', '8'))
max_paths = getattr(self._rbridge,
'rbridge_id_router_router_bgp_address_family_{0}_'
'{0}_unicast_default_vrf_af_common_cmds_holder_'
'maximum_paths_load_sharing_value'.format(afi))
config = max_paths(**args)
if kwargs.pop('get', False):
return callback(config, handler='get_config')
if kwargs.pop('delete', False):
tag = 'maximum-paths'
config.find('.//*%s' % tag).set('operation', 'delete')
return callback(config) | [
"def",
"max_paths",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"afi",
"=",
"kwargs",
".",
"pop",
"(",
"'afi'",
",",
"'ipv4'",
")",
"callback",
"=",
"kwargs",
".",
"pop",
"(",
"'callback'",
",",
"self",
".",
"_callback",
")",
"if",
"afi",
"not"... | Set BGP max paths property.
Args:
vrf (str): The VRF for this BGP process.
rbridge_id (str): The rbridge ID of the device on which BGP will be
configured in a VCS fabric.
paths (str): Number of paths for BGP ECMP (default: 8).
afi (str): Address family to configure. (ipv4, ipv6)
get (bool): Get config instead of editing config. (True, False)
callback (function): A function executed upon completion of the
method. The only parameter passed to `callback` will be the
``ElementTree`` `config`.
Returns:
Return value of `callback`.
Raises:
``AttributeError``: When `afi` is not one of ['ipv4', 'ipv6']
Examples:
>>> import pynos.device
>>> conn = ('10.24.39.203', '22')
>>> auth = ('admin', 'password')
>>> with pynos.device.Device(conn=conn, auth=auth) as dev:
... output = dev.bgp.max_paths(paths='8',
... rbridge_id='225')
... output = dev.bgp.max_paths(paths='8',
... rbridge_id='225', get=True)
... output = dev.bgp.max_paths(paths='8',
... rbridge_id='225', delete=True)
... output = dev.bgp.max_paths(paths='8', afi='ipv6',
... rbridge_id='225')
... output = dev.bgp.max_paths(paths='8', afi='ipv6',
... rbridge_id='225', get=True)
... output = dev.bgp.max_paths(paths='8', afi='ipv6',
... rbridge_id='225', delete=True)
... output = dev.bgp.max_paths(paths='8', afi='ipv5',
... rbridge_id='225') # doctest: +IGNORE_EXCEPTION_DETAIL
Traceback (most recent call last):
AttributeError | [
"Set",
"BGP",
"max",
"paths",
"property",
"."
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_6/ver_6_0_1/bgp.py#L576-L634 |
brocade/pynos | pynos/versions/ver_6/ver_6_0_1/bgp.py | BGP._multihop_xml | def _multihop_xml(self, **kwargs):
"""Build BGP multihop XML.
Do not use this method directly. You probably want ``multihop``.
Args:
rbridge_id (str): The rbridge ID of the device on which BGP will be
configured in a VCS fabric.
neighbor (ipaddress.ip_interface): `ip_interface` object containing
peer IP address (IPv4 or IPv6).
count (str): Number of hops to allow. (1-255)
Returns:
``ElementTree``: XML for configuring BGP multihop.
Raises:
KeyError: if any arg is not specified.
Examples:
>>> import pynos.device
>>> from ipaddress import ip_interface
>>> conn = ('10.24.39.230', '22')
>>> auth = ('admin', 'password')
>>> with pynos.device.Device(conn=conn, auth=auth) as dev:
... dev.bgp._multihop_xml(neighbor=ip_interface(unicode(
... '10.10.10.10')), count='5', vrf='default', rbridge_id='1')
... dev.bgp._multihop_xml(
... ip='10.10.10.10') # doctest: +IGNORE_EXCEPTION_DETAIL
Traceback (most recent call last):
KeyError
"""
ip_addr = kwargs.pop('neighbor')
ip = str(ip_addr.ip)
rbr_ns = 'urn:brocade.com:mgmt:brocade-rbridge'
bgp_ns = 'urn:brocade.com:mgmt:brocade-bgp'
config = ET.Element('config')
ele = ET.SubElement(config, 'rbridge-id', xmlns=rbr_ns)
ET.SubElement(ele, 'rbridge-id').text = kwargs.pop('rbridge_id')
ele = ET.SubElement(ele, 'router')
ele = ET.SubElement(ele, 'router-bgp', xmlns=bgp_ns)
ele = ET.SubElement(ele, 'router-bgp-attributes')
ele = ET.SubElement(ele, 'neighbor')
if ip_addr.version == 4:
ele = ET.SubElement(ele, 'neighbor-ips')
ele = ET.SubElement(ele, 'neighbor-addr')
ET.SubElement(ele, 'router-bgp-neighbor-address').text = ip
else:
ele = ET.SubElement(ele, 'neighbor-ipv6s')
ele = ET.SubElement(ele, 'neighbor-ipv6-addr')
ET.SubElement(ele, 'router-bgp-neighbor-ipv6-address').text = ip
ele = ET.SubElement(ele, 'ebgp-multihop')
ET.SubElement(ele, 'ebgp-multihop-count').text = kwargs.pop('count')
return config | python | def _multihop_xml(self, **kwargs):
"""Build BGP multihop XML.
Do not use this method directly. You probably want ``multihop``.
Args:
rbridge_id (str): The rbridge ID of the device on which BGP will be
configured in a VCS fabric.
neighbor (ipaddress.ip_interface): `ip_interface` object containing
peer IP address (IPv4 or IPv6).
count (str): Number of hops to allow. (1-255)
Returns:
``ElementTree``: XML for configuring BGP multihop.
Raises:
KeyError: if any arg is not specified.
Examples:
>>> import pynos.device
>>> from ipaddress import ip_interface
>>> conn = ('10.24.39.230', '22')
>>> auth = ('admin', 'password')
>>> with pynos.device.Device(conn=conn, auth=auth) as dev:
... dev.bgp._multihop_xml(neighbor=ip_interface(unicode(
... '10.10.10.10')), count='5', vrf='default', rbridge_id='1')
... dev.bgp._multihop_xml(
... ip='10.10.10.10') # doctest: +IGNORE_EXCEPTION_DETAIL
Traceback (most recent call last):
KeyError
"""
ip_addr = kwargs.pop('neighbor')
ip = str(ip_addr.ip)
rbr_ns = 'urn:brocade.com:mgmt:brocade-rbridge'
bgp_ns = 'urn:brocade.com:mgmt:brocade-bgp'
config = ET.Element('config')
ele = ET.SubElement(config, 'rbridge-id', xmlns=rbr_ns)
ET.SubElement(ele, 'rbridge-id').text = kwargs.pop('rbridge_id')
ele = ET.SubElement(ele, 'router')
ele = ET.SubElement(ele, 'router-bgp', xmlns=bgp_ns)
ele = ET.SubElement(ele, 'router-bgp-attributes')
ele = ET.SubElement(ele, 'neighbor')
if ip_addr.version == 4:
ele = ET.SubElement(ele, 'neighbor-ips')
ele = ET.SubElement(ele, 'neighbor-addr')
ET.SubElement(ele, 'router-bgp-neighbor-address').text = ip
else:
ele = ET.SubElement(ele, 'neighbor-ipv6s')
ele = ET.SubElement(ele, 'neighbor-ipv6-addr')
ET.SubElement(ele, 'router-bgp-neighbor-ipv6-address').text = ip
ele = ET.SubElement(ele, 'ebgp-multihop')
ET.SubElement(ele, 'ebgp-multihop-count').text = kwargs.pop('count')
return config | [
"def",
"_multihop_xml",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"ip_addr",
"=",
"kwargs",
".",
"pop",
"(",
"'neighbor'",
")",
"ip",
"=",
"str",
"(",
"ip_addr",
".",
"ip",
")",
"rbr_ns",
"=",
"'urn:brocade.com:mgmt:brocade-rbridge'",
"bgp_ns",
"=",
... | Build BGP multihop XML.
Do not use this method directly. You probably want ``multihop``.
Args:
rbridge_id (str): The rbridge ID of the device on which BGP will be
configured in a VCS fabric.
neighbor (ipaddress.ip_interface): `ip_interface` object containing
peer IP address (IPv4 or IPv6).
count (str): Number of hops to allow. (1-255)
Returns:
``ElementTree``: XML for configuring BGP multihop.
Raises:
KeyError: if any arg is not specified.
Examples:
>>> import pynos.device
>>> from ipaddress import ip_interface
>>> conn = ('10.24.39.230', '22')
>>> auth = ('admin', 'password')
>>> with pynos.device.Device(conn=conn, auth=auth) as dev:
... dev.bgp._multihop_xml(neighbor=ip_interface(unicode(
... '10.10.10.10')), count='5', vrf='default', rbridge_id='1')
... dev.bgp._multihop_xml(
... ip='10.10.10.10') # doctest: +IGNORE_EXCEPTION_DETAIL
Traceback (most recent call last):
KeyError | [
"Build",
"BGP",
"multihop",
"XML",
"."
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_6/ver_6_0_1/bgp.py#L749-L801 |
brocade/pynos | pynos/utilities.py | return_xml | def return_xml(element_tree):
"""Return an XML Element.
Args:
element_tree (Element): XML Element to be returned. If sent as a
``str``, this function will attempt to convert it to an
``Element``.
Returns:
Element: An XML Element.
Raises:
TypeError: if `element_tree` is not of type ``Element`` and it
cannot be converted from a ``str``.
Examples:
>>> import pynos.utilities
>>> import xml.etree.ElementTree as ET
>>> ele = pynos.utilities.return_xml(ET.Element('config'))
>>> assert isinstance(ele, ET.Element)
>>> ele = pynos.utilities.return_xml('<config />')
>>> assert isinstance(ele, ET.Element)
>>> ele = pynos.utilities.return_xml(
... ['hodor']) # doctest: +IGNORE_EXCEPTION_DETAIL
Traceback (most recent call last):
TypeError
"""
if isinstance(element_tree, ET.Element):
return element_tree
try:
return ET.fromstring(element_tree)
except TypeError:
raise TypeError('{} takes either {} or {} type.'
.format(repr(return_xml.__name__),
repr(str.__name__),
repr(ET.Element.__name__))) | python | def return_xml(element_tree):
"""Return an XML Element.
Args:
element_tree (Element): XML Element to be returned. If sent as a
``str``, this function will attempt to convert it to an
``Element``.
Returns:
Element: An XML Element.
Raises:
TypeError: if `element_tree` is not of type ``Element`` and it
cannot be converted from a ``str``.
Examples:
>>> import pynos.utilities
>>> import xml.etree.ElementTree as ET
>>> ele = pynos.utilities.return_xml(ET.Element('config'))
>>> assert isinstance(ele, ET.Element)
>>> ele = pynos.utilities.return_xml('<config />')
>>> assert isinstance(ele, ET.Element)
>>> ele = pynos.utilities.return_xml(
... ['hodor']) # doctest: +IGNORE_EXCEPTION_DETAIL
Traceback (most recent call last):
TypeError
"""
if isinstance(element_tree, ET.Element):
return element_tree
try:
return ET.fromstring(element_tree)
except TypeError:
raise TypeError('{} takes either {} or {} type.'
.format(repr(return_xml.__name__),
repr(str.__name__),
repr(ET.Element.__name__))) | [
"def",
"return_xml",
"(",
"element_tree",
")",
":",
"if",
"isinstance",
"(",
"element_tree",
",",
"ET",
".",
"Element",
")",
":",
"return",
"element_tree",
"try",
":",
"return",
"ET",
".",
"fromstring",
"(",
"element_tree",
")",
"except",
"TypeError",
":",
... | Return an XML Element.
Args:
element_tree (Element): XML Element to be returned. If sent as a
``str``, this function will attempt to convert it to an
``Element``.
Returns:
Element: An XML Element.
Raises:
TypeError: if `element_tree` is not of type ``Element`` and it
cannot be converted from a ``str``.
Examples:
>>> import pynos.utilities
>>> import xml.etree.ElementTree as ET
>>> ele = pynos.utilities.return_xml(ET.Element('config'))
>>> assert isinstance(ele, ET.Element)
>>> ele = pynos.utilities.return_xml('<config />')
>>> assert isinstance(ele, ET.Element)
>>> ele = pynos.utilities.return_xml(
... ['hodor']) # doctest: +IGNORE_EXCEPTION_DETAIL
Traceback (most recent call last):
TypeError | [
"Return",
"an",
"XML",
"Element",
"."
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/utilities.py#L23-L58 |
brocade/pynos | pynos/utilities.py | valid_vlan_id | def valid_vlan_id(vlan_id, extended=True):
"""Validates a VLAN ID.
Args:
vlan_id (integer): VLAN ID to validate. If passed as ``str``, it will
be cast to ``int``.
extended (bool): If the VLAN ID range should be considered extended
for Virtual Fabrics.
Returns:
bool: ``True`` if it is a valid VLAN ID. ``False`` if not.
Raises:
None
Examples:
>>> import pynos.utilities
>>> vlan = '565'
>>> pynos.utilities.valid_vlan_id(vlan)
True
>>> extended = False
>>> vlan = '6789'
>>> pynos.utilities.valid_vlan_id(vlan, extended=extended)
False
>>> pynos.utilities.valid_vlan_id(vlan)
True
"""
minimum_vlan_id = 1
maximum_vlan_id = 4095
if extended:
maximum_vlan_id = 8191
return minimum_vlan_id <= int(vlan_id) <= maximum_vlan_id | python | def valid_vlan_id(vlan_id, extended=True):
"""Validates a VLAN ID.
Args:
vlan_id (integer): VLAN ID to validate. If passed as ``str``, it will
be cast to ``int``.
extended (bool): If the VLAN ID range should be considered extended
for Virtual Fabrics.
Returns:
bool: ``True`` if it is a valid VLAN ID. ``False`` if not.
Raises:
None
Examples:
>>> import pynos.utilities
>>> vlan = '565'
>>> pynos.utilities.valid_vlan_id(vlan)
True
>>> extended = False
>>> vlan = '6789'
>>> pynos.utilities.valid_vlan_id(vlan, extended=extended)
False
>>> pynos.utilities.valid_vlan_id(vlan)
True
"""
minimum_vlan_id = 1
maximum_vlan_id = 4095
if extended:
maximum_vlan_id = 8191
return minimum_vlan_id <= int(vlan_id) <= maximum_vlan_id | [
"def",
"valid_vlan_id",
"(",
"vlan_id",
",",
"extended",
"=",
"True",
")",
":",
"minimum_vlan_id",
"=",
"1",
"maximum_vlan_id",
"=",
"4095",
"if",
"extended",
":",
"maximum_vlan_id",
"=",
"8191",
"return",
"minimum_vlan_id",
"<=",
"int",
"(",
"vlan_id",
")",
... | Validates a VLAN ID.
Args:
vlan_id (integer): VLAN ID to validate. If passed as ``str``, it will
be cast to ``int``.
extended (bool): If the VLAN ID range should be considered extended
for Virtual Fabrics.
Returns:
bool: ``True`` if it is a valid VLAN ID. ``False`` if not.
Raises:
None
Examples:
>>> import pynos.utilities
>>> vlan = '565'
>>> pynos.utilities.valid_vlan_id(vlan)
True
>>> extended = False
>>> vlan = '6789'
>>> pynos.utilities.valid_vlan_id(vlan, extended=extended)
False
>>> pynos.utilities.valid_vlan_id(vlan)
True | [
"Validates",
"a",
"VLAN",
"ID",
"."
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/utilities.py#L88-L119 |
brocade/pynos | pynos/utilities.py | merge_xml | def merge_xml(first_doc, second_doc):
"""Merges two XML documents.
Args:
first_doc (str): First XML document. `second_doc` is merged into this
document.
second_doc (str): Second XML document. It is merged into the first.
Returns:
XML Document: The merged document.
Raises:
None
Example:
>>> import pynos.utilities
>>> import lxml
>>> import xml
>>> x = xml.etree.ElementTree.fromstring('<config />')
>>> y = lxml.etree.fromstring('<config><hello /></config>')
>>> x = pynos.utilities.merge_xml(x, y)
"""
# Adapted from:
# http://stackoverflow.com/questions/27258013/merge-two-xml-files-python
# Maps each elements tag to the element from the first document
if isinstance(first_doc, lxml.etree._Element):
first_doc = ET.fromstring(lxml.etree.tostring(first_doc))
if isinstance(second_doc, lxml.etree._Element):
second_doc = ET.fromstring(lxml.etree.tostring(second_doc))
mapping = {element.tag: element for element in first_doc}
for element in second_doc:
if not len(element):
# Recursed fully. This element has no children.
try:
# Update the first document's element's text
mapping[element.tag].text = element.text
except KeyError:
# The element doesn't exist
# add it to the mapping and the root document
mapping[element.tag] = element
first_doc.append(element)
else:
# This element has children. Recurse.
try:
merge_xml(mapping[element.tag], element)
except KeyError:
# The element doesn't exist
# add it to the mapping and the root document
mapping[element.tag] = element
first_doc.append(element)
return lxml.etree.fromstring(ET.tostring(first_doc)) | python | def merge_xml(first_doc, second_doc):
"""Merges two XML documents.
Args:
first_doc (str): First XML document. `second_doc` is merged into this
document.
second_doc (str): Second XML document. It is merged into the first.
Returns:
XML Document: The merged document.
Raises:
None
Example:
>>> import pynos.utilities
>>> import lxml
>>> import xml
>>> x = xml.etree.ElementTree.fromstring('<config />')
>>> y = lxml.etree.fromstring('<config><hello /></config>')
>>> x = pynos.utilities.merge_xml(x, y)
"""
# Adapted from:
# http://stackoverflow.com/questions/27258013/merge-two-xml-files-python
# Maps each elements tag to the element from the first document
if isinstance(first_doc, lxml.etree._Element):
first_doc = ET.fromstring(lxml.etree.tostring(first_doc))
if isinstance(second_doc, lxml.etree._Element):
second_doc = ET.fromstring(lxml.etree.tostring(second_doc))
mapping = {element.tag: element for element in first_doc}
for element in second_doc:
if not len(element):
# Recursed fully. This element has no children.
try:
# Update the first document's element's text
mapping[element.tag].text = element.text
except KeyError:
# The element doesn't exist
# add it to the mapping and the root document
mapping[element.tag] = element
first_doc.append(element)
else:
# This element has children. Recurse.
try:
merge_xml(mapping[element.tag], element)
except KeyError:
# The element doesn't exist
# add it to the mapping and the root document
mapping[element.tag] = element
first_doc.append(element)
return lxml.etree.fromstring(ET.tostring(first_doc)) | [
"def",
"merge_xml",
"(",
"first_doc",
",",
"second_doc",
")",
":",
"# Adapted from:",
"# http://stackoverflow.com/questions/27258013/merge-two-xml-files-python",
"# Maps each elements tag to the element from the first document",
"if",
"isinstance",
"(",
"first_doc",
",",
"lxml",
".... | Merges two XML documents.
Args:
first_doc (str): First XML document. `second_doc` is merged into this
document.
second_doc (str): Second XML document. It is merged into the first.
Returns:
XML Document: The merged document.
Raises:
None
Example:
>>> import pynos.utilities
>>> import lxml
>>> import xml
>>> x = xml.etree.ElementTree.fromstring('<config />')
>>> y = lxml.etree.fromstring('<config><hello /></config>')
>>> x = pynos.utilities.merge_xml(x, y) | [
"Merges",
"two",
"XML",
"documents",
"."
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/utilities.py#L196-L246 |
brocade/pynos | pynos/versions/ver_6/ver_6_0_1/yang/brocade_terminal.py | brocade_terminal.terminal_cfg_line_sessionid | def terminal_cfg_line_sessionid(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
terminal_cfg = ET.SubElement(config, "terminal-cfg", xmlns="urn:brocade.com:mgmt:brocade-terminal")
line = ET.SubElement(terminal_cfg, "line")
sessionid = ET.SubElement(line, "sessionid")
sessionid.text = kwargs.pop('sessionid')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def terminal_cfg_line_sessionid(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
terminal_cfg = ET.SubElement(config, "terminal-cfg", xmlns="urn:brocade.com:mgmt:brocade-terminal")
line = ET.SubElement(terminal_cfg, "line")
sessionid = ET.SubElement(line, "sessionid")
sessionid.text = kwargs.pop('sessionid')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"terminal_cfg_line_sessionid",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"terminal_cfg",
"=",
"ET",
".",
"SubElement",
"(",
"config",
",",
"\"terminal-cfg\"",
",",
"xmlns",
"=",
"\"u... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_6/ver_6_0_1/yang/brocade_terminal.py#L12-L22 |
brocade/pynos | pynos/versions/ver_6/ver_6_0_1/yang/brocade_terminal.py | brocade_terminal.terminal_cfg_line_exec_timeout | def terminal_cfg_line_exec_timeout(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
terminal_cfg = ET.SubElement(config, "terminal-cfg", xmlns="urn:brocade.com:mgmt:brocade-terminal")
line = ET.SubElement(terminal_cfg, "line")
sessionid_key = ET.SubElement(line, "sessionid")
sessionid_key.text = kwargs.pop('sessionid')
exec_timeout = ET.SubElement(line, "exec-timeout")
exec_timeout.text = kwargs.pop('exec_timeout')
callback = kwargs.pop('callback', self._callback)
return callback(config) | python | def terminal_cfg_line_exec_timeout(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
terminal_cfg = ET.SubElement(config, "terminal-cfg", xmlns="urn:brocade.com:mgmt:brocade-terminal")
line = ET.SubElement(terminal_cfg, "line")
sessionid_key = ET.SubElement(line, "sessionid")
sessionid_key.text = kwargs.pop('sessionid')
exec_timeout = ET.SubElement(line, "exec-timeout")
exec_timeout.text = kwargs.pop('exec_timeout')
callback = kwargs.pop('callback', self._callback)
return callback(config) | [
"def",
"terminal_cfg_line_exec_timeout",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"config",
"=",
"ET",
".",
"Element",
"(",
"\"config\"",
")",
"terminal_cfg",
"=",
"ET",
".",
"SubElement",
"(",
"config",
",",
"\"terminal-cfg\"",
",",
"xmlns",
"=",
"... | Auto Generated Code | [
"Auto",
"Generated",
"Code"
] | train | https://github.com/brocade/pynos/blob/bd8a34e98f322de3fc06750827d8bbc3a0c00380/pynos/versions/ver_6/ver_6_0_1/yang/brocade_terminal.py#L24-L36 |
rsenk330/pylibsass | pylibsass/events.py | FileSystemEvents.get_scss_files | def get_scss_files(self, skip_partials=True, with_source_path=False):
"""Gets all SCSS files in the source directory.
:param bool skip_partials: If True, partials will be ignored. Otherwise,
all SCSS files, including ones that begin
with '_' will be returned.
:param boom with_source_path: If true, the `source_path` will be added
to all of the paths. Otherwise, it will
be stripped.
:returns: A list of the SCSS files in the source directory
"""
scss_files = []
for root, dirs, files in os.walk(self._source_path):
for filename in fnmatch.filter(files, "*.scss"):
if filename.startswith("_") and skip_partials:
continue
full_path = os.path.join(root, filename)
if not with_source_path:
full_path = full_path.split(self._source_path)[1]
if full_path.startswith("/"):
full_path = full_path[1:]
scss_files.append(full_path)
return scss_files | python | def get_scss_files(self, skip_partials=True, with_source_path=False):
"""Gets all SCSS files in the source directory.
:param bool skip_partials: If True, partials will be ignored. Otherwise,
all SCSS files, including ones that begin
with '_' will be returned.
:param boom with_source_path: If true, the `source_path` will be added
to all of the paths. Otherwise, it will
be stripped.
:returns: A list of the SCSS files in the source directory
"""
scss_files = []
for root, dirs, files in os.walk(self._source_path):
for filename in fnmatch.filter(files, "*.scss"):
if filename.startswith("_") and skip_partials:
continue
full_path = os.path.join(root, filename)
if not with_source_path:
full_path = full_path.split(self._source_path)[1]
if full_path.startswith("/"):
full_path = full_path[1:]
scss_files.append(full_path)
return scss_files | [
"def",
"get_scss_files",
"(",
"self",
",",
"skip_partials",
"=",
"True",
",",
"with_source_path",
"=",
"False",
")",
":",
"scss_files",
"=",
"[",
"]",
"for",
"root",
",",
"dirs",
",",
"files",
"in",
"os",
".",
"walk",
"(",
"self",
".",
"_source_path",
... | Gets all SCSS files in the source directory.
:param bool skip_partials: If True, partials will be ignored. Otherwise,
all SCSS files, including ones that begin
with '_' will be returned.
:param boom with_source_path: If true, the `source_path` will be added
to all of the paths. Otherwise, it will
be stripped.
:returns: A list of the SCSS files in the source directory | [
"Gets",
"all",
"SCSS",
"files",
"in",
"the",
"source",
"directory",
"."
] | train | https://github.com/rsenk330/pylibsass/blob/f029490db8e4c2178c9564efeeace95bbf8cceff/pylibsass/events.py#L17-L45 |
CivicSpleen/ambry | ambry/library/search_backends/postgres_backend.py | PostgreSQLSearchBackend._or_join | def _or_join(self, terms):
""" Joins terms using OR operator.
Args:
terms (list): terms to join
Examples:
self._or_join(['term1', 'term2']) -> 'term1 | term2'
Returns:
str
"""
from six import text_type
if isinstance(terms, (tuple, list)):
if len(terms) > 1:
return ' | '.join(text_type(t) for t in terms)
else:
return terms[0]
else:
return terms | python | def _or_join(self, terms):
""" Joins terms using OR operator.
Args:
terms (list): terms to join
Examples:
self._or_join(['term1', 'term2']) -> 'term1 | term2'
Returns:
str
"""
from six import text_type
if isinstance(terms, (tuple, list)):
if len(terms) > 1:
return ' | '.join(text_type(t) for t in terms)
else:
return terms[0]
else:
return terms | [
"def",
"_or_join",
"(",
"self",
",",
"terms",
")",
":",
"from",
"six",
"import",
"text_type",
"if",
"isinstance",
"(",
"terms",
",",
"(",
"tuple",
",",
"list",
")",
")",
":",
"if",
"len",
"(",
"terms",
")",
">",
"1",
":",
"return",
"' | '",
".",
... | Joins terms using OR operator.
Args:
terms (list): terms to join
Examples:
self._or_join(['term1', 'term2']) -> 'term1 | term2'
Returns:
str | [
"Joins",
"terms",
"using",
"OR",
"operator",
"."
] | train | https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/library/search_backends/postgres_backend.py#L54-L74 |
CivicSpleen/ambry | ambry/library/search_backends/postgres_backend.py | DatasetPostgreSQLIndex.search | def search(self, search_phrase, limit=None):
""" Finds datasets by search phrase.
Args:
search_phrase (str or unicode):
limit (int, optional): how many results to return. None means without limit.
Returns:
list of DatasetSearchResult instances.
"""
query, query_params = self._make_query_from_terms(search_phrase, limit=limit)
self._parsed_query = (str(query), query_params)
assert isinstance(query, TextClause)
datasets = {}
def make_result(vid=None, b_score=0, p_score=0):
res = DatasetSearchResult()
res.b_score = b_score
res.p_score = p_score
res.partitions = set()
res.vid = vid
return res
if query_params:
results = self.execute(query, **query_params)
for result in results:
vid, dataset_score = result
datasets[vid] = make_result(vid, b_score=dataset_score)
logger.debug('Extending datasets with partitions.')
for partition in self.backend.partition_index.search(search_phrase):
if partition.dataset_vid not in datasets:
datasets[partition.dataset_vid] = make_result(partition.dataset_vid)
datasets[partition.dataset_vid].p_score += partition.score
datasets[partition.dataset_vid].partitions.add(partition)
return list(datasets.values()) | python | def search(self, search_phrase, limit=None):
""" Finds datasets by search phrase.
Args:
search_phrase (str or unicode):
limit (int, optional): how many results to return. None means without limit.
Returns:
list of DatasetSearchResult instances.
"""
query, query_params = self._make_query_from_terms(search_phrase, limit=limit)
self._parsed_query = (str(query), query_params)
assert isinstance(query, TextClause)
datasets = {}
def make_result(vid=None, b_score=0, p_score=0):
res = DatasetSearchResult()
res.b_score = b_score
res.p_score = p_score
res.partitions = set()
res.vid = vid
return res
if query_params:
results = self.execute(query, **query_params)
for result in results:
vid, dataset_score = result
datasets[vid] = make_result(vid, b_score=dataset_score)
logger.debug('Extending datasets with partitions.')
for partition in self.backend.partition_index.search(search_phrase):
if partition.dataset_vid not in datasets:
datasets[partition.dataset_vid] = make_result(partition.dataset_vid)
datasets[partition.dataset_vid].p_score += partition.score
datasets[partition.dataset_vid].partitions.add(partition)
return list(datasets.values()) | [
"def",
"search",
"(",
"self",
",",
"search_phrase",
",",
"limit",
"=",
"None",
")",
":",
"query",
",",
"query_params",
"=",
"self",
".",
"_make_query_from_terms",
"(",
"search_phrase",
",",
"limit",
"=",
"limit",
")",
"self",
".",
"_parsed_query",
"=",
"("... | Finds datasets by search phrase.
Args:
search_phrase (str or unicode):
limit (int, optional): how many results to return. None means without limit.
Returns:
list of DatasetSearchResult instances. | [
"Finds",
"datasets",
"by",
"search",
"phrase",
"."
] | train | https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/library/search_backends/postgres_backend.py#L106-L153 |
CivicSpleen/ambry | ambry/library/search_backends/postgres_backend.py | DatasetPostgreSQLIndex.all | def all(self):
""" Returns list with all indexed datasets. """
datasets = []
query = text("""
SELECT vid
FROM dataset_index;""")
for result in self.execute(query):
res = DatasetSearchResult()
res.vid = result[0]
res.b_score = 1
datasets.append(res)
return datasets | python | def all(self):
""" Returns list with all indexed datasets. """
datasets = []
query = text("""
SELECT vid
FROM dataset_index;""")
for result in self.execute(query):
res = DatasetSearchResult()
res.vid = result[0]
res.b_score = 1
datasets.append(res)
return datasets | [
"def",
"all",
"(",
"self",
")",
":",
"datasets",
"=",
"[",
"]",
"query",
"=",
"text",
"(",
"\"\"\"\n SELECT vid\n FROM dataset_index;\"\"\"",
")",
"for",
"result",
"in",
"self",
".",
"execute",
"(",
"query",
")",
":",
"res",
"=",
"Dataset... | Returns list with all indexed datasets. | [
"Returns",
"list",
"with",
"all",
"indexed",
"datasets",
"."
] | train | https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/library/search_backends/postgres_backend.py#L218-L231 |
CivicSpleen/ambry | ambry/library/search_backends/postgres_backend.py | DatasetPostgreSQLIndex._index_document | def _index_document(self, document, force=False):
""" Adds dataset document to the index. """
query = text("""
INSERT INTO dataset_index(vid, title, keywords, doc)
VALUES(:vid, :title, string_to_array(:keywords, ' '), to_tsvector('english', :doc));
""")
self.execute(query, **document) | python | def _index_document(self, document, force=False):
""" Adds dataset document to the index. """
query = text("""
INSERT INTO dataset_index(vid, title, keywords, doc)
VALUES(:vid, :title, string_to_array(:keywords, ' '), to_tsvector('english', :doc));
""")
self.execute(query, **document) | [
"def",
"_index_document",
"(",
"self",
",",
"document",
",",
"force",
"=",
"False",
")",
":",
"query",
"=",
"text",
"(",
"\"\"\"\n INSERT INTO dataset_index(vid, title, keywords, doc)\n VALUES(:vid, :title, string_to_array(:keywords, ' '), to_tsvector('english',... | Adds dataset document to the index. | [
"Adds",
"dataset",
"document",
"to",
"the",
"index",
"."
] | train | https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/library/search_backends/postgres_backend.py#L233-L239 |
CivicSpleen/ambry | ambry/library/search_backends/postgres_backend.py | DatasetPostgreSQLIndex._make_query_from_terms | def _make_query_from_terms(self, terms, limit=None):
""" Creates a query for dataset from decomposed search terms.
Args:
terms (dict or unicode or string):
Returns:
tuple of (TextClause, dict): First element is FTS query, second is parameters
of the query. Element of the execution of the query is pair: (vid, score).
"""
expanded_terms = self._expand_terms(terms)
if expanded_terms['doc']:
# create query with real score.
query_parts = ["SELECT vid, ts_rank_cd(setweight(doc,'C'), to_tsquery(:doc)) as score"]
if expanded_terms['doc'] and expanded_terms['keywords']:
query_parts = ["SELECT vid, ts_rank_cd(setweight(doc,'C'), to_tsquery(:doc)) "
" + ts_rank_cd(setweight(to_tsvector(coalesce(keywords::text,'')),'B'), to_tsquery(:keywords))"
' as score']
else:
# create query with score = 1 because query will not touch doc field.
query_parts = ['SELECT vid, 1 as score']
query_parts.append('FROM dataset_index')
query_params = {}
where_counter = 0
if expanded_terms['doc']:
where_counter += 1
query_parts.append('WHERE doc @@ to_tsquery(:doc)')
query_params['doc'] = self.backend._and_join(expanded_terms['doc'])
if expanded_terms['keywords']:
query_params['keywords'] = self.backend._and_join(expanded_terms['keywords'])
kw_q = "to_tsvector(coalesce(keywords::text,'')) @@ to_tsquery(:keywords)"
query_parts.append( ("AND " if where_counter else "WHERE ") + kw_q )
query_parts.append('ORDER BY score DESC')
if limit:
query_parts.append('LIMIT :limit')
query_params['limit'] = limit
query_parts.append(';')
deb_msg = 'Dataset terms conversion: `{}` terms converted to `{}` with `{}` params query.'\
.format(terms, query_parts, query_params)
logger.debug(deb_msg)
q = text('\n'.join(query_parts)), query_params
logger.debug('Dataset search query: {}'.format(q))
return q | python | def _make_query_from_terms(self, terms, limit=None):
""" Creates a query for dataset from decomposed search terms.
Args:
terms (dict or unicode or string):
Returns:
tuple of (TextClause, dict): First element is FTS query, second is parameters
of the query. Element of the execution of the query is pair: (vid, score).
"""
expanded_terms = self._expand_terms(terms)
if expanded_terms['doc']:
# create query with real score.
query_parts = ["SELECT vid, ts_rank_cd(setweight(doc,'C'), to_tsquery(:doc)) as score"]
if expanded_terms['doc'] and expanded_terms['keywords']:
query_parts = ["SELECT vid, ts_rank_cd(setweight(doc,'C'), to_tsquery(:doc)) "
" + ts_rank_cd(setweight(to_tsvector(coalesce(keywords::text,'')),'B'), to_tsquery(:keywords))"
' as score']
else:
# create query with score = 1 because query will not touch doc field.
query_parts = ['SELECT vid, 1 as score']
query_parts.append('FROM dataset_index')
query_params = {}
where_counter = 0
if expanded_terms['doc']:
where_counter += 1
query_parts.append('WHERE doc @@ to_tsquery(:doc)')
query_params['doc'] = self.backend._and_join(expanded_terms['doc'])
if expanded_terms['keywords']:
query_params['keywords'] = self.backend._and_join(expanded_terms['keywords'])
kw_q = "to_tsvector(coalesce(keywords::text,'')) @@ to_tsquery(:keywords)"
query_parts.append( ("AND " if where_counter else "WHERE ") + kw_q )
query_parts.append('ORDER BY score DESC')
if limit:
query_parts.append('LIMIT :limit')
query_params['limit'] = limit
query_parts.append(';')
deb_msg = 'Dataset terms conversion: `{}` terms converted to `{}` with `{}` params query.'\
.format(terms, query_parts, query_params)
logger.debug(deb_msg)
q = text('\n'.join(query_parts)), query_params
logger.debug('Dataset search query: {}'.format(q))
return q | [
"def",
"_make_query_from_terms",
"(",
"self",
",",
"terms",
",",
"limit",
"=",
"None",
")",
":",
"expanded_terms",
"=",
"self",
".",
"_expand_terms",
"(",
"terms",
")",
"if",
"expanded_terms",
"[",
"'doc'",
"]",
":",
"# create query with real score.",
"query_par... | Creates a query for dataset from decomposed search terms.
Args:
terms (dict or unicode or string):
Returns:
tuple of (TextClause, dict): First element is FTS query, second is parameters
of the query. Element of the execution of the query is pair: (vid, score). | [
"Creates",
"a",
"query",
"for",
"dataset",
"from",
"decomposed",
"search",
"terms",
"."
] | train | https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/library/search_backends/postgres_backend.py#L241-L297 |
CivicSpleen/ambry | ambry/library/search_backends/postgres_backend.py | DatasetPostgreSQLIndex._delete | def _delete(self, vid=None):
""" Deletes given dataset from index.
Args:
vid (str): dataset vid.
"""
assert vid is not None
query = text("""
DELETE FROM dataset_index
WHERE vid = :vid;
""")
self.execute(query, vid=vid) | python | def _delete(self, vid=None):
""" Deletes given dataset from index.
Args:
vid (str): dataset vid.
"""
assert vid is not None
query = text("""
DELETE FROM dataset_index
WHERE vid = :vid;
""")
self.execute(query, vid=vid) | [
"def",
"_delete",
"(",
"self",
",",
"vid",
"=",
"None",
")",
":",
"assert",
"vid",
"is",
"not",
"None",
"query",
"=",
"text",
"(",
"\"\"\"\n DELETE FROM dataset_index\n WHERE vid = :vid;\n \"\"\"",
")",
"self",
".",
"execute",
"(",
"quer... | Deletes given dataset from index.
Args:
vid (str): dataset vid. | [
"Deletes",
"given",
"dataset",
"from",
"index",
"."
] | train | https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/library/search_backends/postgres_backend.py#L299-L311 |
CivicSpleen/ambry | ambry/library/search_backends/postgres_backend.py | PartitionPostgreSQLIndex._make_query_from_terms | def _make_query_from_terms(self, terms, limit=None):
""" Creates a query for partition from decomposed search terms.
Args:
terms (dict or unicode or string):
Returns:
tuple of (TextClause, dict): First element is FTS query, second is
parameters of the query. Element of the execution of the query is
tuple of three elements: (vid, dataset_vid, score).
"""
expanded_terms = self._expand_terms(terms)
terms_used = 0
if expanded_terms['doc']:
# create query with real score.
query_parts = ["SELECT vid, dataset_vid, ts_rank_cd(setweight(doc,'C'), to_tsquery(:doc)) as score"]
if expanded_terms['doc'] and expanded_terms['keywords']:
query_parts = ["SELECT vid, dataset_vid, ts_rank_cd(setweight(doc,'C'), to_tsquery(:doc)) "
" + ts_rank_cd(setweight(to_tsvector(coalesce(keywords::text,'')),'B'), to_tsquery(:keywords))"
' as score']
else:
# create query with score = 1 because query will not touch doc field.
query_parts = ['SELECT vid, dataset_vid, 1 as score']
query_parts.append('FROM partition_index')
query_params = {}
where_count = 0
if expanded_terms['doc']:
query_parts.append('WHERE doc @@ to_tsquery(:doc)')
query_params['doc'] = self.backend._and_join(expanded_terms['doc'])
where_count += 1
terms_used += 1
if expanded_terms['keywords']:
query_params['keywords'] = self.backend._and_join(expanded_terms['keywords'])
kw_q = "to_tsvector(coalesce(keywords::text,'')) @@ to_tsquery(:keywords)"
query_parts.append(("AND " if where_count else "WHERE ") + kw_q)
where_count += 1
terms_used += 1
if expanded_terms['from']:
query_parts.append(("AND " if where_count else "WHERE ") + ' from_year >= :from_year')
query_params['from_year'] = expanded_terms['from']
where_count += 1
terms_used += 1
if expanded_terms['to']:
query_parts.append(("AND " if where_count else "WHERE ") + ' to_year <= :to_year')
query_params['to_year'] = expanded_terms['to']
where_count += 1
terms_used += 1
query_parts.append('ORDER BY score DESC')
if limit:
query_parts.append('LIMIT :limit')
query_params['limit'] = limit
if not terms_used:
logger.debug('No terms used; not creating query')
return None, None
query_parts.append(';')
deb_msg = 'Dataset terms conversion: `{}` terms converted to `{}` with `{}` params query.'\
.format(terms, query_parts, query_params)
logger.debug(deb_msg)
return text('\n'.join(query_parts)), query_params | python | def _make_query_from_terms(self, terms, limit=None):
""" Creates a query for partition from decomposed search terms.
Args:
terms (dict or unicode or string):
Returns:
tuple of (TextClause, dict): First element is FTS query, second is
parameters of the query. Element of the execution of the query is
tuple of three elements: (vid, dataset_vid, score).
"""
expanded_terms = self._expand_terms(terms)
terms_used = 0
if expanded_terms['doc']:
# create query with real score.
query_parts = ["SELECT vid, dataset_vid, ts_rank_cd(setweight(doc,'C'), to_tsquery(:doc)) as score"]
if expanded_terms['doc'] and expanded_terms['keywords']:
query_parts = ["SELECT vid, dataset_vid, ts_rank_cd(setweight(doc,'C'), to_tsquery(:doc)) "
" + ts_rank_cd(setweight(to_tsvector(coalesce(keywords::text,'')),'B'), to_tsquery(:keywords))"
' as score']
else:
# create query with score = 1 because query will not touch doc field.
query_parts = ['SELECT vid, dataset_vid, 1 as score']
query_parts.append('FROM partition_index')
query_params = {}
where_count = 0
if expanded_terms['doc']:
query_parts.append('WHERE doc @@ to_tsquery(:doc)')
query_params['doc'] = self.backend._and_join(expanded_terms['doc'])
where_count += 1
terms_used += 1
if expanded_terms['keywords']:
query_params['keywords'] = self.backend._and_join(expanded_terms['keywords'])
kw_q = "to_tsvector(coalesce(keywords::text,'')) @@ to_tsquery(:keywords)"
query_parts.append(("AND " if where_count else "WHERE ") + kw_q)
where_count += 1
terms_used += 1
if expanded_terms['from']:
query_parts.append(("AND " if where_count else "WHERE ") + ' from_year >= :from_year')
query_params['from_year'] = expanded_terms['from']
where_count += 1
terms_used += 1
if expanded_terms['to']:
query_parts.append(("AND " if where_count else "WHERE ") + ' to_year <= :to_year')
query_params['to_year'] = expanded_terms['to']
where_count += 1
terms_used += 1
query_parts.append('ORDER BY score DESC')
if limit:
query_parts.append('LIMIT :limit')
query_params['limit'] = limit
if not terms_used:
logger.debug('No terms used; not creating query')
return None, None
query_parts.append(';')
deb_msg = 'Dataset terms conversion: `{}` terms converted to `{}` with `{}` params query.'\
.format(terms, query_parts, query_params)
logger.debug(deb_msg)
return text('\n'.join(query_parts)), query_params | [
"def",
"_make_query_from_terms",
"(",
"self",
",",
"terms",
",",
"limit",
"=",
"None",
")",
":",
"expanded_terms",
"=",
"self",
".",
"_expand_terms",
"(",
"terms",
")",
"terms_used",
"=",
"0",
"if",
"expanded_terms",
"[",
"'doc'",
"]",
":",
"# create query w... | Creates a query for partition from decomposed search terms.
Args:
terms (dict or unicode or string):
Returns:
tuple of (TextClause, dict): First element is FTS query, second is
parameters of the query. Element of the execution of the query is
tuple of three elements: (vid, dataset_vid, score). | [
"Creates",
"a",
"query",
"for",
"partition",
"from",
"decomposed",
"search",
"terms",
"."
] | train | https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/library/search_backends/postgres_backend.py#L321-L398 |
CivicSpleen/ambry | ambry/library/search_backends/postgres_backend.py | PartitionPostgreSQLIndex.search | def search(self, search_phrase, limit=None):
""" Finds partitions by search phrase.
Args:
search_phrase (str or unicode):
limit (int, optional): how many results to generate. None means without limit.
Generates:
PartitionSearchResult instances.
"""
query, query_params = self._make_query_from_terms(search_phrase, limit=limit)
self._parsed_query = (str(query), query_params)
if query is not None:
self.backend.library.database.set_connection_search_path()
results = self.execute(query, **query_params)
for result in results:
vid, dataset_vid, score = result
yield PartitionSearchResult(
vid=vid, dataset_vid=dataset_vid, score=score) | python | def search(self, search_phrase, limit=None):
""" Finds partitions by search phrase.
Args:
search_phrase (str or unicode):
limit (int, optional): how many results to generate. None means without limit.
Generates:
PartitionSearchResult instances.
"""
query, query_params = self._make_query_from_terms(search_phrase, limit=limit)
self._parsed_query = (str(query), query_params)
if query is not None:
self.backend.library.database.set_connection_search_path()
results = self.execute(query, **query_params)
for result in results:
vid, dataset_vid, score = result
yield PartitionSearchResult(
vid=vid, dataset_vid=dataset_vid, score=score) | [
"def",
"search",
"(",
"self",
",",
"search_phrase",
",",
"limit",
"=",
"None",
")",
":",
"query",
",",
"query_params",
"=",
"self",
".",
"_make_query_from_terms",
"(",
"search_phrase",
",",
"limit",
"=",
"limit",
")",
"self",
".",
"_parsed_query",
"=",
"("... | Finds partitions by search phrase.
Args:
search_phrase (str or unicode):
limit (int, optional): how many results to generate. None means without limit.
Generates:
PartitionSearchResult instances. | [
"Finds",
"partitions",
"by",
"search",
"phrase",
"."
] | train | https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/library/search_backends/postgres_backend.py#L400-L423 |
CivicSpleen/ambry | ambry/library/search_backends/postgres_backend.py | PartitionPostgreSQLIndex._as_document | def _as_document(self, partition):
""" Converts partition to document indexed by to FTS index.
Args:
partition (orm.Partition): partition to convert.
Returns:
dict with structure matches to BasePartitionIndex._schema.
"""
doc = super(self.__class__, self)._as_document(partition)
# pass time_coverage to the _index_document.
doc['time_coverage'] = partition.time_coverage
return doc | python | def _as_document(self, partition):
""" Converts partition to document indexed by to FTS index.
Args:
partition (orm.Partition): partition to convert.
Returns:
dict with structure matches to BasePartitionIndex._schema.
"""
doc = super(self.__class__, self)._as_document(partition)
# pass time_coverage to the _index_document.
doc['time_coverage'] = partition.time_coverage
return doc | [
"def",
"_as_document",
"(",
"self",
",",
"partition",
")",
":",
"doc",
"=",
"super",
"(",
"self",
".",
"__class__",
",",
"self",
")",
".",
"_as_document",
"(",
"partition",
")",
"# pass time_coverage to the _index_document.",
"doc",
"[",
"'time_coverage'",
"]",
... | Converts partition to document indexed by to FTS index.
Args:
partition (orm.Partition): partition to convert.
Returns:
dict with structure matches to BasePartitionIndex._schema. | [
"Converts",
"partition",
"to",
"document",
"indexed",
"by",
"to",
"FTS",
"index",
"."
] | train | https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/library/search_backends/postgres_backend.py#L425-L439 |
CivicSpleen/ambry | ambry/library/search_backends/postgres_backend.py | PartitionPostgreSQLIndex._index_document | def _index_document(self, document, force=False):
""" Adds parition document to the index. """
time_coverage = document.pop('time_coverage', [])
from_year = None
to_year = None
if time_coverage:
from_year = int(time_coverage[0]) if time_coverage and time_coverage[0] else None
to_year = int(time_coverage[-1]) if time_coverage and time_coverage[-1] else None
query = text("""
INSERT INTO partition_index(vid, dataset_vid, title, keywords, doc, from_year, to_year)
VALUES(
:vid, :dataset_vid, :title,
string_to_array(:keywords, ' '),
to_tsvector('english', :doc),
:from_year, :to_year); """)
self.execute(query, from_year=from_year, to_year=to_year, **document) | python | def _index_document(self, document, force=False):
""" Adds parition document to the index. """
time_coverage = document.pop('time_coverage', [])
from_year = None
to_year = None
if time_coverage:
from_year = int(time_coverage[0]) if time_coverage and time_coverage[0] else None
to_year = int(time_coverage[-1]) if time_coverage and time_coverage[-1] else None
query = text("""
INSERT INTO partition_index(vid, dataset_vid, title, keywords, doc, from_year, to_year)
VALUES(
:vid, :dataset_vid, :title,
string_to_array(:keywords, ' '),
to_tsvector('english', :doc),
:from_year, :to_year); """)
self.execute(query, from_year=from_year, to_year=to_year, **document) | [
"def",
"_index_document",
"(",
"self",
",",
"document",
",",
"force",
"=",
"False",
")",
":",
"time_coverage",
"=",
"document",
".",
"pop",
"(",
"'time_coverage'",
",",
"[",
"]",
")",
"from_year",
"=",
"None",
"to_year",
"=",
"None",
"if",
"time_coverage",... | Adds parition document to the index. | [
"Adds",
"parition",
"document",
"to",
"the",
"index",
"."
] | train | https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/library/search_backends/postgres_backend.py#L441-L459 |
CivicSpleen/ambry | ambry/library/search_backends/postgres_backend.py | PartitionPostgreSQLIndex.is_indexed | def is_indexed(self, partition):
""" Returns True if partition is already indexed. Otherwise returns False. """
query = text("""
SELECT vid
FROM partition_index
WHERE vid = :vid;
""")
result = self.execute(query, vid=partition.vid)
return bool(result.fetchall()) | python | def is_indexed(self, partition):
""" Returns True if partition is already indexed. Otherwise returns False. """
query = text("""
SELECT vid
FROM partition_index
WHERE vid = :vid;
""")
result = self.execute(query, vid=partition.vid)
return bool(result.fetchall()) | [
"def",
"is_indexed",
"(",
"self",
",",
"partition",
")",
":",
"query",
"=",
"text",
"(",
"\"\"\"\n SELECT vid\n FROM partition_index\n WHERE vid = :vid;\n \"\"\"",
")",
"result",
"=",
"self",
".",
"execute",
"(",
"query",
",",
"vid"... | Returns True if partition is already indexed. Otherwise returns False. | [
"Returns",
"True",
"if",
"partition",
"is",
"already",
"indexed",
".",
"Otherwise",
"returns",
"False",
"."
] | train | https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/library/search_backends/postgres_backend.py#L515-L523 |
CivicSpleen/ambry | ambry/library/search_backends/postgres_backend.py | PartitionPostgreSQLIndex.all | def all(self):
""" Returns list with vids of all indexed partitions. """
partitions = []
query = text("""
SELECT dataset_vid, vid
FROM partition_index;""")
for result in self.execute(query):
dataset_vid, vid = result
partitions.append(PartitionSearchResult(dataset_vid=dataset_vid, vid=vid, score=1))
return partitions | python | def all(self):
""" Returns list with vids of all indexed partitions. """
partitions = []
query = text("""
SELECT dataset_vid, vid
FROM partition_index;""")
for result in self.execute(query):
dataset_vid, vid = result
partitions.append(PartitionSearchResult(dataset_vid=dataset_vid, vid=vid, score=1))
return partitions | [
"def",
"all",
"(",
"self",
")",
":",
"partitions",
"=",
"[",
"]",
"query",
"=",
"text",
"(",
"\"\"\"\n SELECT dataset_vid, vid\n FROM partition_index;\"\"\"",
")",
"for",
"result",
"in",
"self",
".",
"execute",
"(",
"query",
")",
":",
"datase... | Returns list with vids of all indexed partitions. | [
"Returns",
"list",
"with",
"vids",
"of",
"all",
"indexed",
"partitions",
"."
] | train | https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/library/search_backends/postgres_backend.py#L525-L536 |
CivicSpleen/ambry | ambry/library/search_backends/postgres_backend.py | IdentifierPostgreSQLIndex.search | def search(self, search_phrase, limit=None):
""" Finds identifiers by search phrase.
Args:
search_phrase (str or unicode):
limit (int, optional): how many results to return. None means without limit.
Returns:
list of IdentifierSearchResult instances.
"""
query_parts = [
'SELECT identifier, type, name, similarity(name, :word) AS sml',
'FROM identifier_index',
'WHERE name % :word',
'ORDER BY sml DESC, name']
query_params = {
'word': search_phrase}
if limit:
query_parts.append('LIMIT :limit')
query_params['limit'] = limit
query_parts.append(';')
query = text('\n'.join(query_parts))
self.backend.library.database.set_connection_search_path()
results = self.execute(query, **query_params).fetchall()
for result in results:
vid, type, name, score = result
yield IdentifierSearchResult(
score=score, vid=vid,
type=type, name=name) | python | def search(self, search_phrase, limit=None):
""" Finds identifiers by search phrase.
Args:
search_phrase (str or unicode):
limit (int, optional): how many results to return. None means without limit.
Returns:
list of IdentifierSearchResult instances.
"""
query_parts = [
'SELECT identifier, type, name, similarity(name, :word) AS sml',
'FROM identifier_index',
'WHERE name % :word',
'ORDER BY sml DESC, name']
query_params = {
'word': search_phrase}
if limit:
query_parts.append('LIMIT :limit')
query_params['limit'] = limit
query_parts.append(';')
query = text('\n'.join(query_parts))
self.backend.library.database.set_connection_search_path()
results = self.execute(query, **query_params).fetchall()
for result in results:
vid, type, name, score = result
yield IdentifierSearchResult(
score=score, vid=vid,
type=type, name=name) | [
"def",
"search",
"(",
"self",
",",
"search_phrase",
",",
"limit",
"=",
"None",
")",
":",
"query_parts",
"=",
"[",
"'SELECT identifier, type, name, similarity(name, :word) AS sml'",
",",
"'FROM identifier_index'",
",",
"'WHERE name % :word'",
",",
"'ORDER BY sml DESC, name'"... | Finds identifiers by search phrase.
Args:
search_phrase (str or unicode):
limit (int, optional): how many results to return. None means without limit.
Returns:
list of IdentifierSearchResult instances. | [
"Finds",
"identifiers",
"by",
"search",
"phrase",
"."
] | train | https://github.com/CivicSpleen/ambry/blob/d7f2be4bf1f7ffd086f3fadd4fcae60c32473e42/ambry/library/search_backends/postgres_backend.py#L547-L584 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.