docs: def make_chunk_iter(stream, separator, limit=None, buffer_size=10 * 1024):
      """Works like :func:`make_line_iter` but accepts a separator
      which divides chunks.  If you want newline based processing
      you should use :func:`make_line_iter` instead as it
      supports arbitrary newline markers.
  
      .. versionadded:: 0.8
  
      .. versionadded:: 0.9
         added support for iterators as input stream.
  
      :param stream: the stream or iterate to iterate over.
      :param separator: the separator that divides chunks.
      :param limit: the limit in bytes for the stream.  (Usually
                    content length.  Not necessary if the `stream`
                    is otherwise already limited).
      :param buffer_size: The optional buffer size.
      """
      _iter = _make_chunk_iter(stream, limit, buffer_size)
  
      first_item = next(_iter, '')
      if not first_item:
          return
  
      _iter = chain((first_item,), _iter)
      if isinstance(first_item, text_type):
          separator = to_unicode(separator)
          _split = re.compile(r'(%s)' % re.escape(separator)).split
          _join = u''.join
      else:
          separator = to_bytes(separator)
          _split = re.compile(b'(' + re.escape(separator) + b')').split
          _join = b''.join
  
      buffer = []
      while 1:
          new_data = next(_iter, '')
          if not new_data:
              break
          chunks = _split(new_data)
          new_buf = []
          for item in chain(buffer, chunks):
              if item == separator:
                  yield _join(new_buf)
                  new_buf = []
              else:
                  new_buf.append(item)
          buffer = new_buf
      if buffer:
          yield _join(buffer)