docs: def stream(input_type='lines', output_type=None, worker_type='simple',
             max_workers=1, workers_window=100):
      """wrapper for processing data from input stream into output into output
      stream while passing each data piece into the function.
      function should take at least one argument (an input stream piece) and
      return an `str` to be written into the output stream.
  
      Example Usage:
  
          >>> import cbox
          >>>
          >>> @cbox.stream()
          >>> def firstchar(line):
          >>>    '''extracts the first char out of each line'''
          >>>    return line[0] if line else ''
  
  
      :param str input_type: defines how the input stream is split. one of
        `lines`, `chars` or `raw`.
      :param str output_type: defines how to write into output stream
        (similarly to input stream). if `None`, split the output stream in the
        same way of `input_type`. one of `None`, `lines`, `chars` or `raw`.
      :param str worker_type: one of `simple`, `thread` or `asyncio`.
      :param int max_workers: how many max workers (i.e. threads) to run in
        parallel. only affect if `worker_type=thread`.
      :param int workers_window: how many tasks to execute in parallel before
        waiting for them to be completed. only affect if `worker_type`
        is not simple.
      """
      def inner(f):
  
          @wraps(f)
          def wrapper(input_stream, output_stream, error_stream, **kwargs):
              in_parser = streams.get_input_parser(input_type)
              out_parser = streams.get_output_parser(output_type, input_type)
              runner = concurrency.get_runner(
                  worker_type=worker_type,
                  max_workers=max_workers,
                  workers_window=workers_window,
              )
              items = in_parser(input_stream)
              output = runner(f, items, kwargs)
              return out_parser(output_stream, error_stream, output)
  
          setattr(wrapper, executors.EXECUTOR_ATTR, executors.STREAM)
          return wrapper
      return inner