Setter method for stats_group, mapped from YANG variable /mpls_state/ldp/ldp_session/session_ldp_stats/protocol_errors/stats_group (mpls-ldp-stats-error-group)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_stats_group is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_stats_group() directly.

    YANG Description: Describes if the stats are for a given session, global-all or global-since-last-clear

def _set_stats_group(self, v, load=False):
    """
    Setter method for stats_group, mapped from YANG variable /mpls_state/ldp/ldp_session/session_ldp_stats/protocol_errors/stats_group (mpls-ldp-stats-error-group)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_stats_group is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_stats_group() directly.

    YANG Description: Describes if the stats are for a given session, global-all or global-since-last-clear
    """
    parent = getattr(self, "_parent", None)
    if parent is not None and load is False:
      raise AttributeError("Cannot set keys directly when" +
                             " within an instantiated list")

    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=RestrictedClassType(base_type=unicode,                                     restriction_type="dict_key",                                     restriction_arg={u'global-stats-all': {'value': 1}, u'per-session-stats': {'value': 0}, u'global-stats-since-last-clear': {'value': 2}},), is_leaf=True, yang_name="stats-group", rest_name="stats-group", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:brocade.com:mgmt:brocade-mpls-operational', defining_module='brocade-mpls-operational', yang_type='mpls-ldp-stats-error-group', is_config=False)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """stats_group must be of a type compatible with mpls-ldp-stats-error-group""",
          'defined-type': "brocade-mpls-operational:mpls-ldp-stats-error-group",
          'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=unicode,                                     restriction_type="dict_key",                                     restriction_arg={u'global-stats-all': {'value': 1}, u'per-session-stats': {'value': 0}, u'global-stats-since-last-clear': {'value': 2}},), is_leaf=True, yang_name="stats-group", rest_name="stats-group", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:brocade.com:mgmt:brocade-mpls-operational', defining_module='brocade-mpls-operational', yang_type='mpls-ldp-stats-error-group', is_config=False)""",
        })

    self.__stats_group = t
    if hasattr(self, '_set'):
      self._set()