# -*- coding: utf-8 -*-# pylint: disable=line-too-long,consider-using-f-string"""Seed-ID Types===================.. module:: pcapkit.const.ipv6.seed_idThis module contains the constant enumeration for **Seed-ID Types**,which is automatically generated from :class:`pcapkit.vendor.ipv6.seed_id.SeedID`."""fromaenumimportIntEnum,extend_enum__all__=['SeedID']
[docs]classSeedID(IntEnum):"""[SeedID] Seed-ID Types"""IPV6_SOURCE_ADDRESS=0b00SEEDID_16_BIT_UNSIGNED_INTEGER=0b01SEEDID_64_BIT_UNSIGNED_INTEGER=0b10SEEDID_128_BIT_UNSIGNED_INTEGER=0b11@staticmethoddefget(key:'int | str',default:'int'=-1)->'SeedID':"""Backport support for original codes. Args: key: Key to get enum item. default: Default value if not found. :meta private: """ifisinstance(key,int):returnSeedID(key)ifkeynotinSeedID._member_map_:# pylint: disable=no-memberreturnextend_enum(SeedID,key,default)returnSeedID[key]# type: ignore[misc]
[docs]@classmethoddef_missing_(cls,value:'int')->'SeedID':"""Lookup function used when value is not found. Args: value: Value to get enum item. """ifnot(isinstance(value,int)and0b00<=value<=0b11):raiseValueError('%r is not a valid %s'%(value,cls.__name__))returnextend_enum(cls,'Unassigned_0b%s'%bin(value)[2:].zfill(2),value)