docs: def prep_stream_data(data):
      """Take an input and prepare it for use as a stream.
  
      :param data: Input data
      :returns: Prepared stream
      :rtype: InsistentReaderBytesIO
      """
      if isinstance(data, (six.string_types, six.binary_type)):
          stream = io.BytesIO(to_bytes(data))
      else:
          stream = data
  
      return InsistentReaderBytesIO(stream)