def make_string_buffer(string):
    if isinstance(string, six.text_type):
        buf = StringIO()
    else:
        buf = io.BytesIO()
    buf.write(string)
    buf.seek(0)
    return buf
Returns a readable/writeable file-like object, containing string.
dataset/ETHPy150Open ipfs/py-ipfs-api/ipfsApi/utils.py/make_string_buffer