# -*- coding: utf-8 -*-# pylint: disable=line-too-long,consider-using-f-string"""ToS (DS Field) Reliability================================.. module:: pcapkit.const.ipv4.tos_relThis module contains the constant enumeration for **ToS (DS Field) Reliability**,which is automatically generated from :class:`pcapkit.vendor.ipv4.tos_rel.ToSReliability`."""fromaenumimportIntEnum,extend_enum__all__=['ToSReliability']
[docs]classToSReliability(IntEnum):"""[ToSReliability] ToS (DS Field) Reliability"""NORMAL=0HIGH=1@staticmethoddefget(key:'int | str',default:'int'=-1)->'ToSReliability':"""Backport support for original codes. Args: key: Key to get enum item. default: Default value if not found. :meta private: """ifisinstance(key,int):returnToSReliability(key)ifkeynotinToSReliability._member_map_:# pylint: disable=no-memberreturnextend_enum(ToSReliability,key,default)returnToSReliability[key]# type: ignore[misc]
[docs]@classmethoddef_missing_(cls,value:'int')->'ToSReliability':"""Lookup function used when value is not found. Args: value: Value to get enum item. """ifnot(isinstance(value,int)and0<=value<=1):raiseValueError('%r is not a valid %s'%(value,cls.__name__))returnextend_enum(cls,'Unassigned_%d'%value,value)