<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def encode_int(cls, obj):
 """Verify the object is an int, and ASCII-encode it. :param int obj: An integer to be encoded. :raises: :class:`TypeError` if `obj` is not an integer. :return: A binary representation of the int `obj` suitable to pass as the `payload` to send_exit(). """

    if not isinstance(obj, int):
      raise TypeError("cannot encode non-integer object in encode_int(): object was {} (type '{}')."
                      .format(obj, type(obj)))
    return str(obj).encode('ascii')