<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def write_short_ascii(s):
 """ Encode a Kafka short string which represents text. :param str s: Text string (`str` on Python 3, `str` or `unicode` on Python 2) or ``None``. The string will be ASCII-encoded. :returns: length-prefixed `bytes` :raises: `struct.error` for strings longer than 32767 characters """

    if s is None:
        return _NULL_SHORT_STRING
    if not isinstance(s, string_types):
        raise TypeError('{!r} is not text'.format(s))
    return write_short_bytes(s.encode('ascii'))