def sockfam_to_enum(num):
    """Convert a numeric socket family value to an IntEnum member.
    If it's not a known member, return the numeric value itself.
    """
    if enum is None:
        return num
    else:  # pragma: no cover
        try:
            return socket.AddressFamily(num)
        except (__HOLE__, AttributeError):
            return num
dataset/ETHPy150Open giampaolo/psutil/psutil/_common.py/sockfam_to_enum