(num)
Convert a numeric socket type value to an IntEnum member.
    If it's not a known member, return the numeric value itself.
Convert a numeric socket type value to an IntEnum member.
    If it's not a known member, return the numeric value itself.
Convert a numeric socket type value to an IntEnum member . If it s not a known member return the numeric value itself .
def socktype_to_enum(num):
    """Convert a numeric socket type value to an IntEnum member.
    If it's not a known member, return the numeric value itself.
    """
    if enum is None:
        return num
    try:
        return socket.AddressType(num)
    except (ValueError, AttributeError):
        return num
def socktype_to_enum ( num ) : if enum is None : return num try : return socket . AddressType ( num ) except ( ValueError , AttributeError ) : return num