<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _init_io_container(self, init_value):
 """Initialize container to hold lob data. Here either a cStringIO or a io.StringIO class is used depending on the Python version. For CLobs ensure that an initial unicode value only contains valid ascii chars. """

        if isinstance(init_value, CLOB_STRING_IO_CLASSES):
            # already a valid StringIO instance, just use it as it is
            v = init_value
        else:
            # works for strings and unicodes. However unicodes must only contain valid ascii chars!
            if PY3:
                # a io.StringIO also accepts any unicode characters, but we must be sure that only
                # ascii chars are contained. In PY2 we use a cStringIO class which complains by itself
                # if it catches this case, so in PY2 no extra check needs to be performed here.
                init_value.encode('ascii')  # this is just a check, result not needed!
            v = CLOB_STRING_IO(init_value)
        return v