text:
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListType
from pyangbind.lib.yangtypes import YANGDynClass
from pyangbind.lib.yangtypes import ReferenceType
from pyangbind.lib.base import PybindBase
from collections import OrderedDict
from decimal import Decimal
from bitarray import bitarray
import six

# PY3 support of some PY2 keywords (needs improved)
if six.PY3:
    import builtins as __builtin__

    long = int
elif six.PY2:
    import __builtin__

class state(PybindBase):
    """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module openconfig-network-instance - based on the path /network-instances/network-instance/protocols/protocol/bgp/peer-groups/peer-group/state. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: State information relating to the BGP peer-group
  """
    __slots__ = (
        "_path_helper",
        "_extmethods",
        "__peer_group_name",
        "__peer_as",
        "__local_as",
        "__peer_type",
        "__auth_password",
        "__remove_private_as",
        "__route_flap_damping",
        "__send_community",
        "__description",
        "__total_paths",
        "__total_prefixes",
    )

    _yang_name = "state"

    _pybind_generated_by = "container"

    def __init__(self, *args, **kwargs):

        self._path_helper = False

        self._extmethods = False
        self.__peer_group_name = YANGDynClass(
            base=six.text_type,
            is_leaf=True,
            yang_name="peer-group-name",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="string",
            is_config=False,
        )
        self.__peer_as = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="peer-as",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="oc-inet:as-number",
            is_config=False,
        )
        self.__local_as = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="local-as",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="oc-inet:as-number",
            is_config=False,
        )
        self.__peer_type = YANGDynClass(
            base=RestrictedClassType(
                base_type=six.text_type,
                restriction_type="dict_key",
                restriction_arg={"INTERNAL": {}, "EXTERNAL": {}},
            ),
            is_leaf=True,
            yang_name="peer-type",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="oc-bgp-types:peer-type",
            is_config=False,
        )
        self.__auth_password = YANGDynClass(
            base=six.text_type,
            is_leaf=True,
            yang_name="auth-password",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="oc-types:routing-password",
            is_config=False,
        )
        self.__remove_private_as = YANGDynClass(
            base=RestrictedClassType(
                base_type=six.text_type,
                restriction_type="dict_key",
                restriction_arg={
                    "PRIVATE_AS_REMOVE_ALL": {
                        "@module": "openconfig-bgp-types",
                        "@namespace": "http://openconfig.net/yang/bgp-types",
                    },
                    "oc-bgp-types:PRIVATE_AS_REMOVE_ALL": {
                        "@module": "openconfig-bgp-types",
                        "@namespace": "http://openconfig.net/yang/bgp-types",
                    },
                    "PRIVATE_AS_REPLACE_ALL": {
                        "@module": "openconfig-bgp-types",
                        "@namespace": "http://openconfig.net/yang/bgp-types",
                    },
                    "oc-bgp-types:PRIVATE_AS_REPLACE_ALL": {
                        "@module": "openconfig-bgp-types",
                        "@namespace": "http://openconfig.net/yang/bgp-types",
                    },
                },
            ),
            is_leaf=True,
            yang_name="remove-private-as",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="oc-bgp-types:remove-private-as-option",
            is_config=False,
        )
        self.__route_flap_damping = YANGDynClass(
            base=YANGBool,
            default=YANGBool("false"),
            is_leaf=True,
            yang_name="route-flap-damping",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="boolean",
            is_config=False,
        )
        self.__send_community = YANGDynClass(
            base=RestrictedClassType(
                base_type=six.text_type,
                restriction_type="dict_key",
                restriction_arg={
                    "STANDARD": {}, "EXTENDED": {}, "BOTH": {}, "NONE": {}
                },
            ),
            default=six.text_type("NONE"),
            is_leaf=True,
            yang_name="send-community",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="oc-bgp-types:community-type",
            is_config=False,
        )
        self.__description = YANGDynClass(
            base=six.text_type,
            is_leaf=True,
            yang_name="description",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="string",
            is_config=False,
        )
        self.__total_paths = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="total-paths",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="uint32",
            is_config=False,
        )
        self.__total_prefixes = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="total-prefixes",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="uint32",
            is_config=False,
        )

        load = kwargs.pop("load", None)
        if args:
            if len(args) > 1:
                raise TypeError("cannot create a YANG container with >1 argument")
            all_attr = True
            for e in self._pyangbind_elements:
                if not hasattr(args[0], e):
                    all_attr = False
                    break
            if not all_attr:
                raise ValueError("Supplied object did not have the correct attributes")
            for e in self._pyangbind_elements:
                nobj = getattr(args[0], e)
                if nobj._changed() is False:
                    continue
                setmethod = getattr(self, "_set_%s" % e)
                if load is None:
                    setmethod(getattr(args[0], e))
                else:
                    setmethod(getattr(args[0], e), load=load)

    def _path(self):
        if hasattr(self, "_parent"):
            return self._parent._path() + [self._yang_name]
        else:
            return [
                "network-instances",
                "network-instance",
                "protocols",
                "protocol",
                "bgp",
                "peer-groups",
                "peer-group",
                "state",
            ]

    def _get_peer_group_name(self):
        """
    Getter method for peer_group_name, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/state/peer_group_name (string)

    YANG Description: Name of the BGP peer-group
    """
        return self.__peer_group_name

    def _set_peer_group_name(self, v, load=False):
        """
    Setter method for peer_group_name, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/state/peer_group_name (string)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_peer_group_name is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_peer_group_name() directly.

    YANG Description: Name of the BGP peer-group
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=six.text_type,
                is_leaf=True,
                yang_name="peer-group-name",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="string",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """peer_group_name must be of a type compatible with string""",
                    "defined-type": "string",
                    "generated-type": """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="peer-group-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='string', is_config=False)""",
                }
            )

        self.__peer_group_name = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_peer_group_name(self):
        self.__peer_group_name = YANGDynClass(
            base=six.text_type,
            is_leaf=True,
            yang_name="peer-group-name",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="string",
            is_config=False,
        )

    def _get_peer_as(self):
        """
    Getter method for peer_as, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/state/peer_as (oc-inet:as-number)

    YANG Description: AS number of the peer.
    """
        return self.__peer_as

    def _set_peer_as(self, v, load=False):
        """
    Setter method for peer_as, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/state/peer_as (oc-inet:as-number)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_peer_as is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_peer_as() directly.

    YANG Description: AS number of the peer.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=long,
                    restriction_dict={"range": ["0..4294967295"]},
                    int_size=32,
                ),
                is_leaf=True,
                yang_name="peer-as",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="oc-inet:as-number",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """peer_as must be of a type compatible with oc-inet:as-number""",
                    "defined-type": "oc-inet:as-number",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="peer-as", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='oc-inet:as-number', is_config=False)""",
                }
            )

        self.__peer_as = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_peer_as(self):
        self.__peer_as = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="peer-as",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="oc-inet:as-number",
            is_config=False,
        )

    def _get_local_as(self):
        """
    Getter method for local_as, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/state/local_as (oc-inet:as-number)

    YANG Description: The local autonomous system number that is to be used
when establishing sessions with the remote peer or peer
group, if this differs from the global BGP router
autonomous system number.
    """
        return self.__local_as

    def _set_local_as(self, v, load=False):
        """
    Setter method for local_as, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/state/local_as (oc-inet:as-number)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_local_as is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_local_as() directly.

    YANG Description: The local autonomous system number that is to be used
when establishing sessions with the remote peer or peer
group, if this differs from the global BGP router
autonomous system number.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=long,
                    restriction_dict={"range": ["0..4294967295"]},
                    int_size=32,
                ),
                is_leaf=True,
                yang_name="local-as",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="oc-inet:as-number",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """local_as must be of a type compatible with oc-inet:as-number""",
                    "defined-type": "oc-inet:as-number",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="local-as", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='oc-inet:as-number', is_config=False)""",
                }
            )

        self.__local_as = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_local_as(self):
        self.__local_as = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="local-as",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="oc-inet:as-number",
            is_config=False,
        )

    def _get_peer_type(self):
        """
    Getter method for peer_type, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/state/peer_type (oc-bgp-types:peer-type)

    YANG Description: Explicitly designate the peer or peer group as internal
(iBGP) or external (eBGP).
    """
        return self.__peer_type

    def _set_peer_type(self, v, load=False):
        """
    Setter method for peer_type, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/state/peer_type (oc-bgp-types:peer-type)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_peer_type is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_peer_type() directly.

    YANG Description: Explicitly designate the peer or peer group as internal
(iBGP) or external (eBGP).
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=six.text_type,
                    restriction_type="dict_key",
                    restriction_arg={"INTERNAL": {}, "EXTERNAL": {}},
                ),
                is_leaf=True,
                yang_name="peer-type",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="oc-bgp-types:peer-type",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """peer_type must be of a type compatible with oc-bgp-types:peer-type""",
                    "defined-type": "oc-bgp-types:peer-type",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=six.text_type,                                     restriction_type="dict_key",                                     restriction_arg={'INTERNAL': {}, 'EXTERNAL': {}},), is_leaf=True, yang_name="peer-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='oc-bgp-types:peer-type', is_config=False)""",
                }
            )

        self.__peer_type = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_peer_type(self):
        self.__peer_type = YANGDynClass(
            base=RestrictedClassType(
                base_type=six.text_type,
                restriction_type="dict_key",
                restriction_arg={"INTERNAL": {}, "EXTERNAL": {}},
            ),
            is_leaf=True,
            yang_name="peer-type",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="oc-bgp-types:peer-type",
            is_config=False,
        )

    def _get_auth_password(self):
        """
    Getter method for auth_password, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/state/auth_password (oc-types:routing-password)

    YANG Description: Configures an MD5 authentication password for use with
neighboring devices.
    """
        return self.__auth_password

    def _set_auth_password(self, v, load=False):
        """
    Setter method for auth_password, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/state/auth_password (oc-types:routing-password)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_auth_password is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_auth_password() directly.

    YANG Description: Configures an MD5 authentication password for use with
neighboring devices.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=six.text_type,
                is_leaf=True,
                yang_name="auth-password",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="oc-types:routing-password",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """auth_password must be of a type compatible with oc-types:routing-password""",
                    "defined-type": "oc-types:routing-password",
                    "generated-type": """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="auth-password", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='oc-types:routing-password', is_config=False)""",
                }
            )

        self.__auth_password = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_auth_password(self):
        self.__auth_password = YANGDynClass(
            base=six.text_type,
            is_leaf=True,
            yang_name="auth-password",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="oc-types:routing-password",
            is_config=False,
        )

    def _get_remove_private_as(self):
        """
    Getter method for remove_private_as, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/state/remove_private_as (oc-bgp-types:remove-private-as-option)

    YANG Description: Remove private AS numbers from updates sent to peers - when
this leaf is not specified, the AS_PATH attribute should be
sent to the peer unchanged
    """
        return self.__remove_private_as

    def _set_remove_private_as(self, v, load=False):
        """
    Setter method for remove_private_as, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/state/remove_private_as (oc-bgp-types:remove-private-as-option)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_remove_private_as is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_remove_private_as() directly.

    YANG Description: Remove private AS numbers from updates sent to peers - when
this leaf is not specified, the AS_PATH attribute should be
sent to the peer unchanged
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=six.text_type,
                    restriction_type="dict_key",
                    restriction_arg={
                        "PRIVATE_AS_REMOVE_ALL": {
                            "@module": "openconfig-bgp-types",
                            "@namespace": "http://openconfig.net/yang/bgp-types",
                        },
                        "oc-bgp-types:PRIVATE_AS_REMOVE_ALL": {
                            "@module": "openconfig-bgp-types",
                            "@namespace": "http://openconfig.net/yang/bgp-types",
                        },
                        "PRIVATE_AS_REPLACE_ALL": {
                            "@module": "openconfig-bgp-types",
                            "@namespace": "http://openconfig.net/yang/bgp-types",
                        },
                        "oc-bgp-types:PRIVATE_AS_REPLACE_ALL": {
                            "@module": "openconfig-bgp-types",
                            "@namespace": "http://openconfig.net/yang/bgp-types",
                        },
                    },
                ),
                is_leaf=True,
                yang_name="remove-private-as",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="oc-bgp-types:remove-private-as-option",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """remove_private_as must be of a type compatible with oc-bgp-types:remove-private-as-option""",
                    "defined-type": "oc-bgp-types:remove-private-as-option",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'PRIVATE_AS_REMOVE_ALL': {'@module': 'openconfig-bgp-types', '@namespace': 'http://openconfig.net/yang/bgp-types'}, 'oc-bgp-types:PRIVATE_AS_REMOVE_ALL': {'@module': 'openconfig-bgp-types', '@namespace': 'http://openconfig.net/yang/bgp-types'}, 'PRIVATE_AS_REPLACE_ALL': {'@module': 'openconfig-bgp-types', '@namespace': 'http://openconfig.net/yang/bgp-types'}, 'oc-bgp-types:PRIVATE_AS_REPLACE_ALL': {'@module': 'openconfig-bgp-types', '@namespace': 'http://openconfig.net/yang/bgp-types'}},), is_leaf=True, yang_name="remove-private-as", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='oc-bgp-types:remove-private-as-option', is_config=False)""",
                }
            )

        self.__remove_private_as = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_remove_private_as(self):
        self.__remove_private_as = YANGDynClass(
            base=RestrictedClassType(
                base_type=six.text_type,
                restriction_type="dict_key",
                restriction_arg={
                    "PRIVATE_AS_REMOVE_ALL": {
                        "@module": "openconfig-bgp-types",
                        "@namespace": "http://openconfig.net/yang/bgp-types",
                    },
                    "oc-bgp-types:PRIVATE_AS_REMOVE_ALL": {
                        "@module": "openconfig-bgp-types",
                        "@namespace": "http://openconfig.net/yang/bgp-types",
                    },
                    "PRIVATE_AS_REPLACE_ALL": {
                        "@module": "openconfig-bgp-types",
                        "@namespace": "http://openconfig.net/yang/bgp-types",
                    },
                    "oc-bgp-types:PRIVATE_AS_REPLACE_ALL": {
                        "@module": "openconfig-bgp-types",
                        "@namespace": "http://openconfig.net/yang/bgp-types",
                    },
                },
            ),
            is_leaf=True,
            yang_name="remove-private-as",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="oc-bgp-types:remove-private-as-option",
            is_config=False,
        )

    def _get_route_flap_damping(self):
        """
    Getter method for route_flap_damping, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/state/route_flap_damping (boolean)

    YANG Description: Enable route flap damping.
    """
        return self.__route_flap_damping

    def _set_route_flap_damping(self, v, load=False):
        """
    Setter method for route_flap_damping, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/state/route_flap_damping (boolean)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_route_flap_damping is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_route_flap_damping() directly.

    YANG Description: Enable route flap damping.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=YANGBool,
                default=YANGBool("false"),
                is_leaf=True,
                yang_name="route-flap-damping",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="boolean",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """route_flap_damping must be of a type compatible with boolean""",
                    "defined-type": "boolean",
                    "generated-type": """YANGDynClass(base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="route-flap-damping", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)""",
                }
            )

        self.__route_flap_damping = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_route_flap_damping(self):
        self.__route_flap_damping = YANGDynClass(
            base=YANGBool,
            default=YANGBool("false"),
            is_leaf=True,
            yang_name="route-flap-damping",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="boolean",
            is_config=False,
        )

    def _get_send_community(self):
        """
    Getter method for send_community, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/state/send_community (oc-bgp-types:community-type)

    YANG Description: Specify which types of community should be sent to the
neighbor or group. The default is to not send the
community attribute
    """
        return self.__send_community

    def _set_send_community(self, v, load=False):
        """
    Setter method for send_community, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/state/send_community (oc-bgp-types:community-type)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_send_community is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_send_community() directly.

    YANG Description: Specify which types of community should be sent to the
neighbor or group. The default is to not send the
community attribute
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=six.text_type,
                    restriction_type="dict_key",
                    restriction_arg={
                        "STANDARD": {}, "EXTENDED": {}, "BOTH": {}, "NONE": {}
                    },
                ),
                default=six.text_type("NONE"),
                is_leaf=True,
                yang_name="send-community",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="oc-bgp-types:community-type",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """send_community must be of a type compatible with oc-bgp-types:community-type""",
                    "defined-type": "oc-bgp-types:community-type",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=six.text_type,                                     restriction_type="dict_key",                                     restriction_arg={'STANDARD': {}, 'EXTENDED': {}, 'BOTH': {}, 'NONE': {}},), default=six.text_type("NONE"), is_leaf=True, yang_name="send-community", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='oc-bgp-types:community-type', is_config=False)""",
                }
            )

        self.__send_community = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_send_community(self):
        self.__send_community = YANGDynClass(
            base=RestrictedClassType(
                base_type=six.text_type,
                restriction_type="dict_key",
                restriction_arg={
                    "STANDARD": {}, "EXTENDED": {}, "BOTH": {}, "NONE": {}
                },
            ),
            default=six.text_type("NONE"),
            is_leaf=True,
            yang_name="send-community",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="oc-bgp-types:community-type",
            is_config=False,
        )

    def _get_description(self):
        """
    Getter method for description, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/state/description (string)

    YANG Description: An optional textual description (intended primarily for use
with a peer or group
    """
        return self.__description

    def _set_description(self, v, load=False):
        """
    Setter method for description, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/state/description (string)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_description is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_description() directly.

    YANG Description: An optional textual description (intended primarily for use
with a peer or group
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=six.text_type,
                is_leaf=True,
                yang_name="description",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="string",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """description must be of a type compatible with string""",
                    "defined-type": "string",
                    "generated-type": """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='string', is_config=False)""",
                }
            )

        self.__description = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_description(self):
        self.__description = YANGDynClass(
            base=six.text_type,
            is_leaf=True,
            yang_name="description",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="string",
            is_config=False,
        )

    def _get_total_paths(self):
        """
    Getter method for total_paths, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/state/total_paths (uint32)

    YANG Description: Total number of BGP paths within the context
    """
        return self.__total_paths

    def _set_total_paths(self, v, load=False):
        """
    Setter method for total_paths, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/state/total_paths (uint32)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_total_paths is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_total_paths() directly.

    YANG Description: Total number of BGP paths within the context
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=long,
                    restriction_dict={"range": ["0..4294967295"]},
                    int_size=32,
                ),
                is_leaf=True,
                yang_name="total-paths",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="uint32",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """total_paths must be of a type compatible with uint32""",
                    "defined-type": "uint32",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="total-paths", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='uint32', is_config=False)""",
                }
            )

        self.__total_paths = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_total_paths(self):
        self.__total_paths = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="total-paths",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="uint32",
            is_config=False,
        )

    def _get_total_prefixes(self):
        """
    Getter method for total_prefixes, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/state/total_prefixes (uint32)

    YANG Description: Total number of BGP prefixes received within the context
    """
        return self.__total_prefixes

    def _set_total_prefixes(self, v, load=False):
        """
    Setter method for total_prefixes, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/state/total_prefixes (uint32)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_total_prefixes is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_total_prefixes() directly.

    YANG Description: Total number of BGP prefixes received within the context
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=long,
                    restriction_dict={"range": ["0..4294967295"]},
                    int_size=32,
                ),
                is_leaf=True,
                yang_name="total-prefixes",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="uint32",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """total_prefixes must be of a type compatible with uint32""",
                    "defined-type": "uint32",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="total-prefixes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='uint32', is_config=False)""",
                }
            )

        self.__total_prefixes = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_total_prefixes(self):
        self.__total_prefixes = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="total-prefixes",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="uint32",
            is_config=False,
        )

    peer_group_name = __builtin__.property(_get_peer_group_name)
    peer_as = __builtin__.property(_get_peer_as)
    local_as = __builtin__.property(_get_local_as)
    peer_type = __builtin__.property(_get_peer_type)
    auth_password = __builtin__.property(_get_auth_password)
    remove_private_as = __builtin__.property(_get_remove_private_as)
    route_flap_damping = __builtin__.property(_get_route_flap_damping)
    send_community = __builtin__.property(_get_send_community)
    description = __builtin__.property(_get_description)
    total_paths = __builtin__.property(_get_total_paths)
    total_prefixes = __builtin__.property(_get_total_prefixes)

    _pyangbind_elements = OrderedDict(
        [
            ("peer_group_name", peer_group_name),
            ("peer_as", peer_as),
            ("local_as", local_as),
            ("peer_type", peer_type),
            ("auth_password", auth_password),
            ("remove_private_as", remove_private_as),
            ("route_flap_damping", route_flap_damping),
            ("send_community", send_community),
            ("description", description),
            ("total_paths", total_paths),
            ("total_prefixes", total_prefixes),
        ]
    )

class state(PybindBase):
    """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module openconfig-network-instance-l2 - based on the path /network-instances/network-instance/protocols/protocol/bgp/peer-groups/peer-group/state. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: State information relating to the BGP peer-group
  """
    __slots__ = (
        "_path_helper",
        "_extmethods",
        "__peer_group_name",
        "__peer_as",
        "__local_as",
        "__peer_type",
        "__auth_password",
        "__remove_private_as",
        "__route_flap_damping",
        "__send_community",
        "__description",
        "__total_paths",
        "__total_prefixes",
    )

    _yang_name = "state"

    _pybind_generated_by = "container"

    def __init__(self, *args, **kwargs):

        self._path_helper = False

        self._extmethods = False
        self.__peer_group_name = YANGDynClass(
            base=six.text_type,
            is_leaf=True,
            yang_name="peer-group-name",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="string",
            is_config=False,
        )
        self.__peer_as = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="peer-as",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="oc-inet:as-number",
            is_config=False,
        )
        self.__local_as = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="local-as",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="oc-inet:as-number",
            is_config=False,
        )
        self.__peer_type = YANGDynClass(
            base=RestrictedClassType(
                base_type=six.text_type,
                restriction_type="dict_key",
                restriction_arg={"INTERNAL": {}, "EXTERNAL": {}},
            ),
            is_leaf=True,
            yang_name="peer-type",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="oc-bgp-types:peer-type",
            is_config=False,
        )
        self.__auth_password = YANGDynClass(
            base=six.text_type,
            is_leaf=True,
            yang_name="auth-password",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="oc-types:routing-password",
            is_config=False,
        )
        self.__remove_private_as = YANGDynClass(
            base=RestrictedClassType(
                base_type=six.text_type,
                restriction_type="dict_key",
                restriction_arg={
                    "PRIVATE_AS_REMOVE_ALL": {
                        "@module": "openconfig-bgp-types",
                        "@namespace": "http://openconfig.net/yang/bgp-types",
                    },
                    "oc-bgp-types:PRIVATE_AS_REMOVE_ALL": {
                        "@module": "openconfig-bgp-types",
                        "@namespace": "http://openconfig.net/yang/bgp-types",
                    },
                    "PRIVATE_AS_REPLACE_ALL": {
                        "@module": "openconfig-bgp-types",
                        "@namespace": "http://openconfig.net/yang/bgp-types",
                    },
                    "oc-bgp-types:PRIVATE_AS_REPLACE_ALL": {
                        "@module": "openconfig-bgp-types",
                        "@namespace": "http://openconfig.net/yang/bgp-types",
                    },
                },
            ),
            is_leaf=True,
            yang_name="remove-private-as",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="oc-bgp-types:remove-private-as-option",
            is_config=False,
        )
        self.__route_flap_damping = YANGDynClass(
            base=YANGBool,
            default=YANGBool("false"),
            is_leaf=True,
            yang_name="route-flap-damping",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="boolean",
            is_config=False,
        )
        self.__send_community = YANGDynClass(
            base=RestrictedClassType(
                base_type=six.text_type,
                restriction_type="dict_key",
                restriction_arg={
                    "STANDARD": {}, "EXTENDED": {}, "BOTH": {}, "NONE": {}
                },
            ),
            default=six.text_type("NONE"),
            is_leaf=True,
            yang_name="send-community",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="oc-bgp-types:community-type",
            is_config=False,
        )
        self.__description = YANGDynClass(
            base=six.text_type,
            is_leaf=True,
            yang_name="description",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="string",
            is_config=False,
        )
        self.__total_paths = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="total-paths",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="uint32",
            is_config=False,
        )
        self.__total_prefixes = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="total-prefixes",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="uint32",
            is_config=False,
        )

        load = kwargs.pop("load", None)
        if args:
            if len(args) > 1:
                raise TypeError("cannot create a YANG container with >1 argument")
            all_attr = True
            for e in self._pyangbind_elements:
                if not hasattr(args[0], e):
                    all_attr = False
                    break
            if not all_attr:
                raise ValueError("Supplied object did not have the correct attributes")
            for e in self._pyangbind_elements:
                nobj = getattr(args[0], e)
                if nobj._changed() is False:
                    continue
                setmethod = getattr(self, "_set_%s" % e)
                if load is None:
                    setmethod(getattr(args[0], e))
                else:
                    setmethod(getattr(args[0], e), load=load)

    def _path(self):
        if hasattr(self, "_parent"):
            return self._parent._path() + [self._yang_name]
        else:
            return [
                "network-instances",
                "network-instance",
                "protocols",
                "protocol",
                "bgp",
                "peer-groups",
                "peer-group",
                "state",
            ]

    def _get_peer_group_name(self):
        """
    Getter method for peer_group_name, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/state/peer_group_name (string)

    YANG Description: Name of the BGP peer-group
    """
        return self.__peer_group_name

    def _set_peer_group_name(self, v, load=False):
        """
    Setter method for peer_group_name, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/state/peer_group_name (string)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_peer_group_name is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_peer_group_name() directly.

    YANG Description: Name of the BGP peer-group
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=six.text_type,
                is_leaf=True,
                yang_name="peer-group-name",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="string",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """peer_group_name must be of a type compatible with string""",
                    "defined-type": "string",
                    "generated-type": """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="peer-group-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='string', is_config=False)""",
                }
            )

        self.__peer_group_name = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_peer_group_name(self):
        self.__peer_group_name = YANGDynClass(
            base=six.text_type,
            is_leaf=True,
            yang_name="peer-group-name",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="string",
            is_config=False,
        )

    def _get_peer_as(self):
        """
    Getter method for peer_as, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/state/peer_as (oc-inet:as-number)

    YANG Description: AS number of the peer.
    """
        return self.__peer_as

    def _set_peer_as(self, v, load=False):
        """
    Setter method for peer_as, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/state/peer_as (oc-inet:as-number)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_peer_as is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_peer_as() directly.

    YANG Description: AS number of the peer.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=long,
                    restriction_dict={"range": ["0..4294967295"]},
                    int_size=32,
                ),
                is_leaf=True,
                yang_name="peer-as",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="oc-inet:as-number",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """peer_as must be of a type compatible with oc-inet:as-number""",
                    "defined-type": "oc-inet:as-number",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="peer-as", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='oc-inet:as-number', is_config=False)""",
                }
            )

        self.__peer_as = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_peer_as(self):
        self.__peer_as = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="peer-as",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="oc-inet:as-number",
            is_config=False,
        )

    def _get_local_as(self):
        """
    Getter method for local_as, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/state/local_as (oc-inet:as-number)

    YANG Description: The local autonomous system number that is to be used
when establishing sessions with the remote peer or peer
group, if this differs from the global BGP router
autonomous system number.
    """
        return self.__local_as

    def _set_local_as(self, v, load=False):
        """
    Setter method for local_as, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/state/local_as (oc-inet:as-number)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_local_as is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_local_as() directly.

    YANG Description: The local autonomous system number that is to be used
when establishing sessions with the remote peer or peer
group, if this differs from the global BGP router
autonomous system number.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=long,
                    restriction_dict={"range": ["0..4294967295"]},
                    int_size=32,
                ),
                is_leaf=True,
                yang_name="local-as",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="oc-inet:as-number",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """local_as must be of a type compatible with oc-inet:as-number""",
                    "defined-type": "oc-inet:as-number",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="local-as", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='oc-inet:as-number', is_config=False)""",
                }
            )

        self.__local_as = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_local_as(self):
        self.__local_as = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="local-as",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="oc-inet:as-number",
            is_config=False,
        )

    def _get_peer_type(self):
        """
    Getter method for peer_type, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/state/peer_type (oc-bgp-types:peer-type)

    YANG Description: Explicitly designate the peer or peer group as internal
(iBGP) or external (eBGP).
    """
        return self.__peer_type

    def _set_peer_type(self, v, load=False):
        """
    Setter method for peer_type, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/state/peer_type (oc-bgp-types:peer-type)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_peer_type is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_peer_type() directly.

    YANG Description: Explicitly designate the peer or peer group as internal
(iBGP) or external (eBGP).
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=six.text_type,
                    restriction_type="dict_key",
                    restriction_arg={"INTERNAL": {}, "EXTERNAL": {}},
                ),
                is_leaf=True,
                yang_name="peer-type",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="oc-bgp-types:peer-type",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """peer_type must be of a type compatible with oc-bgp-types:peer-type""",
                    "defined-type": "oc-bgp-types:peer-type",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=six.text_type,                                     restriction_type="dict_key",                                     restriction_arg={'INTERNAL': {}, 'EXTERNAL': {}},), is_leaf=True, yang_name="peer-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='oc-bgp-types:peer-type', is_config=False)""",
                }
            )

        self.__peer_type = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_peer_type(self):
        self.__peer_type = YANGDynClass(
            base=RestrictedClassType(
                base_type=six.text_type,
                restriction_type="dict_key",
                restriction_arg={"INTERNAL": {}, "EXTERNAL": {}},
            ),
            is_leaf=True,
            yang_name="peer-type",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="oc-bgp-types:peer-type",
            is_config=False,
        )

    def _get_auth_password(self):
        """
    Getter method for auth_password, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/state/auth_password (oc-types:routing-password)

    YANG Description: Configures an MD5 authentication password for use with
neighboring devices.
    """
        return self.__auth_password

    def _set_auth_password(self, v, load=False):
        """
    Setter method for auth_password, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/state/auth_password (oc-types:routing-password)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_auth_password is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_auth_password() directly.

    YANG Description: Configures an MD5 authentication password for use with
neighboring devices.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=six.text_type,
                is_leaf=True,
                yang_name="auth-password",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="oc-types:routing-password",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """auth_password must be of a type compatible with oc-types:routing-password""",
                    "defined-type": "oc-types:routing-password",
                    "generated-type": """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="auth-password", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='oc-types:routing-password', is_config=False)""",
                }
            )

        self.__auth_password = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_auth_password(self):
        self.__auth_password = YANGDynClass(
            base=six.text_type,
            is_leaf=True,
            yang_name="auth-password",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="oc-types:routing-password",
            is_config=False,
        )

    def _get_remove_private_as(self):
        """
    Getter method for remove_private_as, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/state/remove_private_as (oc-bgp-types:remove-private-as-option)

    YANG Description: Remove private AS numbers from updates sent to peers - when
this leaf is not specified, the AS_PATH attribute should be
sent to the peer unchanged
    """
        return self.__remove_private_as

    def _set_remove_private_as(self, v, load=False):
        """
    Setter method for remove_private_as, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/state/remove_private_as (oc-bgp-types:remove-private-as-option)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_remove_private_as is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_remove_private_as() directly.

    YANG Description: Remove private AS numbers from updates sent to peers - when
this leaf is not specified, the AS_PATH attribute should be
sent to the peer unchanged
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=six.text_type,
                    restriction_type="dict_key",
                    restriction_arg={
                        "PRIVATE_AS_REMOVE_ALL": {
                            "@module": "openconfig-bgp-types",
                            "@namespace": "http://openconfig.net/yang/bgp-types",
                        },
                        "oc-bgp-types:PRIVATE_AS_REMOVE_ALL": {
                            "@module": "openconfig-bgp-types",
                            "@namespace": "http://openconfig.net/yang/bgp-types",
                        },
                        "PRIVATE_AS_REPLACE_ALL": {
                            "@module": "openconfig-bgp-types",
                            "@namespace": "http://openconfig.net/yang/bgp-types",
                        },
                        "oc-bgp-types:PRIVATE_AS_REPLACE_ALL": {
                            "@module": "openconfig-bgp-types",
                            "@namespace": "http://openconfig.net/yang/bgp-types",
                        },
                    },
                ),
                is_leaf=True,
                yang_name="remove-private-as",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="oc-bgp-types:remove-private-as-option",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """remove_private_as must be of a type compatible with oc-bgp-types:remove-private-as-option""",
                    "defined-type": "oc-bgp-types:remove-private-as-option",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'PRIVATE_AS_REMOVE_ALL': {'@module': 'openconfig-bgp-types', '@namespace': 'http://openconfig.net/yang/bgp-types'}, 'oc-bgp-types:PRIVATE_AS_REMOVE_ALL': {'@module': 'openconfig-bgp-types', '@namespace': 'http://openconfig.net/yang/bgp-types'}, 'PRIVATE_AS_REPLACE_ALL': {'@module': 'openconfig-bgp-types', '@namespace': 'http://openconfig.net/yang/bgp-types'}, 'oc-bgp-types:PRIVATE_AS_REPLACE_ALL': {'@module': 'openconfig-bgp-types', '@namespace': 'http://openconfig.net/yang/bgp-types'}},), is_leaf=True, yang_name="remove-private-as", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='oc-bgp-types:remove-private-as-option', is_config=False)""",
                }
            )

        self.__remove_private_as = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_remove_private_as(self):
        self.__remove_private_as = YANGDynClass(
            base=RestrictedClassType(
                base_type=six.text_type,
                restriction_type="dict_key",
                restriction_arg={
                    "PRIVATE_AS_REMOVE_ALL": {
                        "@module": "openconfig-bgp-types",
                        "@namespace": "http://openconfig.net/yang/bgp-types",
                    },
                    "oc-bgp-types:PRIVATE_AS_REMOVE_ALL": {
                        "@module": "openconfig-bgp-types",
                        "@namespace": "http://openconfig.net/yang/bgp-types",
                    },
                    "PRIVATE_AS_REPLACE_ALL": {
                        "@module": "openconfig-bgp-types",
                        "@namespace": "http://openconfig.net/yang/bgp-types",
                    },
                    "oc-bgp-types:PRIVATE_AS_REPLACE_ALL": {
                        "@module": "openconfig-bgp-types",
                        "@namespace": "http://openconfig.net/yang/bgp-types",
                    },
                },
            ),
            is_leaf=True,
            yang_name="remove-private-as",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="oc-bgp-types:remove-private-as-option",
            is_config=False,
        )

    def _get_route_flap_damping(self):
        """
    Getter method for route_flap_damping, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/state/route_flap_damping (boolean)

    YANG Description: Enable route flap damping.
    """
        return self.__route_flap_damping

    def _set_route_flap_damping(self, v, load=False):
        """
    Setter method for route_flap_damping, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/state/route_flap_damping (boolean)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_route_flap_damping is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_route_flap_damping() directly.

    YANG Description: Enable route flap damping.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=YANGBool,
                default=YANGBool("false"),
                is_leaf=True,
                yang_name="route-flap-damping",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="boolean",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """route_flap_damping must be of a type compatible with boolean""",
                    "defined-type": "boolean",
                    "generated-type": """YANGDynClass(base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="route-flap-damping", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)""",
                }
            )

        self.__route_flap_damping = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_route_flap_damping(self):
        self.__route_flap_damping = YANGDynClass(
            base=YANGBool,
            default=YANGBool("false"),
            is_leaf=True,
            yang_name="route-flap-damping",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="boolean",
            is_config=False,
        )

    def _get_send_community(self):
        """
    Getter method for send_community, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/state/send_community (oc-bgp-types:community-type)

    YANG Description: Specify which types of community should be sent to the
neighbor or group. The default is to not send the
community attribute
    """
        return self.__send_community

    def _set_send_community(self, v, load=False):
        """
    Setter method for send_community, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/state/send_community (oc-bgp-types:community-type)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_send_community is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_send_community() directly.

    YANG Description: Specify which types of community should be sent to the
neighbor or group. The default is to not send the
community attribute
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=six.text_type,
                    restriction_type="dict_key",
                    restriction_arg={
                        "STANDARD": {}, "EXTENDED": {}, "BOTH": {}, "NONE": {}
                    },
                ),
                default=six.text_type("NONE"),
                is_leaf=True,
                yang_name="send-community",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="oc-bgp-types:community-type",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """send_community must be of a type compatible with oc-bgp-types:community-type""",
                    "defined-type": "oc-bgp-types:community-type",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=six.text_type,                                     restriction_type="dict_key",                                     restriction_arg={'STANDARD': {}, 'EXTENDED': {}, 'BOTH': {}, 'NONE': {}},), default=six.text_type("NONE"), is_leaf=True, yang_name="send-community", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='oc-bgp-types:community-type', is_config=False)""",
                }
            )

        self.__send_community = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_send_community(self):
        self.__send_community = YANGDynClass(
            base=RestrictedClassType(
                base_type=six.text_type,
                restriction_type="dict_key",
                restriction_arg={
                    "STANDARD": {}, "EXTENDED": {}, "BOTH": {}, "NONE": {}
                },
            ),
            default=six.text_type("NONE"),
            is_leaf=True,
            yang_name="send-community",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="oc-bgp-types:community-type",
            is_config=False,
        )

    def _get_description(self):
        """
    Getter method for description, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/state/description (string)

    YANG Description: An optional textual description (intended primarily for use
with a peer or group
    """
        return self.__description

    def _set_description(self, v, load=False):
        """
    Setter method for description, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/state/description (string)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_description is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_description() directly.

    YANG Description: An optional textual description (intended primarily for use
with a peer or group
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=six.text_type,
                is_leaf=True,
                yang_name="description",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="string",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """description must be of a type compatible with string""",
                    "defined-type": "string",
                    "generated-type": """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='string', is_config=False)""",
                }
            )

        self.__description = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_description(self):
        self.__description = YANGDynClass(
            base=six.text_type,
            is_leaf=True,
            yang_name="description",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="string",
            is_config=False,
        )

    def _get_total_paths(self):
        """
    Getter method for total_paths, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/state/total_paths (uint32)

    YANG Description: Total number of BGP paths within the context
    """
        return self.__total_paths

    def _set_total_paths(self, v, load=False):
        """
    Setter method for total_paths, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/state/total_paths (uint32)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_total_paths is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_total_paths() directly.

    YANG Description: Total number of BGP paths within the context
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=long,
                    restriction_dict={"range": ["0..4294967295"]},
                    int_size=32,
                ),
                is_leaf=True,
                yang_name="total-paths",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="uint32",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """total_paths must be of a type compatible with uint32""",
                    "defined-type": "uint32",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="total-paths", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='uint32', is_config=False)""",
                }
            )

        self.__total_paths = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_total_paths(self):
        self.__total_paths = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="total-paths",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="uint32",
            is_config=False,
        )

    def _get_total_prefixes(self):
        """
    Getter method for total_prefixes, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/state/total_prefixes (uint32)

    YANG Description: Total number of BGP prefixes received within the context
    """
        return self.__total_prefixes

    def _set_total_prefixes(self, v, load=False):
        """
    Setter method for total_prefixes, mapped from YANG variable /network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/state/total_prefixes (uint32)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_total_prefixes is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_total_prefixes() directly.

    YANG Description: Total number of BGP prefixes received within the context
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=long,
                    restriction_dict={"range": ["0..4294967295"]},
                    int_size=32,
                ),
                is_leaf=True,
                yang_name="total-prefixes",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="uint32",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """total_prefixes must be of a type compatible with uint32""",
                    "defined-type": "uint32",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="total-prefixes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='uint32', is_config=False)""",
                }
            )

        self.__total_prefixes = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_total_prefixes(self):
        self.__total_prefixes = YANGDynClass(
            base=RestrictedClassType(
                base_type=long,
                restriction_dict={"range": ["0..4294967295"]},
                int_size=32,
            ),
            is_leaf=True,
            yang_name="total-prefixes",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="uint32",
            is_config=False,
        )

    peer_group_name = __builtin__.property(_get_peer_group_name)
    peer_as = __builtin__.property(_get_peer_as)
    local_as = __builtin__.property(_get_local_as)
    peer_type = __builtin__.property(_get_peer_type)
    auth_password = __builtin__.property(_get_auth_password)
    remove_private_as = __builtin__.property(_get_remove_private_as)
    route_flap_damping = __builtin__.property(_get_route_flap_damping)
    send_community = __builtin__.property(_get_send_community)
    description = __builtin__.property(_get_description)
    total_paths = __builtin__.property(_get_total_paths)
    total_prefixes = __builtin__.property(_get_total_prefixes)

    _pyangbind_elements = OrderedDict(
        [
            ("peer_group_name", peer_group_name),
            ("peer_as", peer_as),
            ("local_as", local_as),
            ("peer_type", peer_type),
            ("auth_password", auth_password),
            ("remove_private_as", remove_private_as),
            ("route_flap_damping", route_flap_damping),
            ("send_community", send_community),
            ("description", description),
            ("total_paths", total_paths),
            ("total_prefixes", total_prefixes),
        ]
    )


text:
<!doctype html>

  <meta charset=utf-8>
  <title>CSS-contain test: size containment and fragmentation</title>
  <link rel="author" title="Florian Rivoal" href="https://florian.rivoal.net">
  <meta name=flags content="ahem">
  <meta name=assert content="size containment makes element monolithic">
  <link rel="match" href="reference/contain-size-breaks-001-ref.html">
  <link rel=help href="https://drafts.csswg.org/css-contain-1/#containment-size">
  <link rel=help href="https://drafts.csswg.org/css-break-3/#monolithic">

<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />

This test passes if there is an orange rectangle below. If the shape is not a rectangle, the test fails.

A B C D E

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.Xml.Serialization;

namespace EZOper.NetSiteUtilities.AopApi
{
    /// <summary>
    /// ValidationRule Data Structure.
    /// </summary>
    [Serializable]
    public class ValidationRule : AopObject
    {
        /// <summary>
        /// 规则校验对应的错误提示 如:户号必须为10位数字
        /// </summary>
        [XmlElement("error_msg")]
        public string ErrorMsg { get; set; }

        /// <summary>
        /// 正则表达式规则 如十位数字的正则表达式为:^\d{10}$
        /// </summary>
        [XmlElement("rule_text")]
        public string RuleText { get; set; }
    }
}


text:
Note that these image resources are not copied into a project when a project
is created with the CLI. Although there are default image resources in a
newly-created project, those come from the platform-specific project template,
which can generally be found in the platform's `template` directory. Until
icon and splashscreen support is added to the CLI, these image resources
aren't used directly.

See https://issues.apache.org/jira/browse/CB-5145


text:
var Animal = (function () {
    function Animal(name) {
        this.name = name;
    }
    Animal.prototype.sayHi = function () {
        return "My name is " + this.name;
    };
    return Animal;
}());
var a = new Animal('Jack');
console.log(a.sayHi());