<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def raw_writer(indent=None):
 """Returns a raw text writer co-routine. Yields: DataEvent: serialization events to write out Receives :class:`amazon.ion.core.IonEvent` or ``None`` when the co-routine yields ``HAS_PENDING`` :class:`WriteEventType` events. """


    is_whitespace_str = isinstance(indent, str) and re.search(r'\A\s*\Z', indent, re.M) is not None
    if not (indent is None or is_whitespace_str):
        raise ValueError('The indent parameter must either be None or a string containing only whitespace')

    indent_bytes = six.b(indent) if isinstance(indent, str) else indent

    return writer_trampoline(_raw_writer_coroutine(indent=indent_bytes))