<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def int_enum(cls, val):
 """Get int enum value. Parameters cls : `type` Int enum class. val : `int` or `str` Name or value. Returns ------- `IntEnum` Raises ------ ValueError """

    if isinstance(val, str):
        val = val.upper()
        try:
            return getattr(cls, val)
        except AttributeError:
            raise ValueError('{0}.{1}'.format(cls, val))
    return cls(val)