docs: def make_input_stream():
      """Creates a :py:class:`Queue` object and a co-routine yielding from that
      queue. The queue should be populated with 2-tuples of the form `(command,
      message)`, where `command` is one of [`msg`, `end`].
  
      When the `end` command is recieved, the co-routine returns, ending the
      stream.
  
      When a `msg` command is received, the accompanying message is encoded and
      yielded as a ``bytes`` object.
  
      :return: tuple of (queue, stream)"""
      input_queue = Queue()
  
      def input_stream():
          while True:
              cmd, msg = input_queue.get()
              if cmd == 'end':
                  input_queue.task_done()
                  return
              elif cmd == 'msg':
                  yield msg.encode()
                  input_queue.task_done()
  
      return input_queue, input_stream