human
Complete this python program:
def CreateChannelDispatcher(channel_service_stub):
assistant
#Here is the Python program you requested.

    """Function to create channel dispatcher.
    Args:
    channel_service_stub: The service stub responsible for creating channels and
    sending messages. This stub stores messages destined for channels, so we
    query it when the client polls the _ah/channel/ dispatcher.
    Returns:
    New dispatcher capable of handling client polls for channel messages.
    """
    from google.appengine.tools import dev_appserver
    class ChannelDispatcher(dev_appserver.URLDispatcher, ):
        'Dispatcher    that    handles    channel    polls.'
        def __init__(self, channel_service_stub):
            'Constructor.\n\n                        Args:\n                                channel_service_stub:    The    channel    service    that    receives    channel    messages\n                                from    the    application.\n                        '
            self._channel_service_stub = channel_service_stub
        def Dispatch(self, request, outfile, base_env_dict=None):
            'Handle    post    dispatch.\n\n                        This    dispatcher    handles    requests    under    the    /_ah/channel/    path.    Currently\n                        it    handles    3    sub-paths:\n                                connect:    place-holder    for    parity    with    the    java    dev    channel.\n                                poll:                return    pending    messages    for    the    channel    identified    by    the\n                                                                    channel    parameter.\n                                jsapi:            return    the    javascript    library    to    retrieve    messages    for    the\n                                                                    channel.\n\n                        Args:\n                                request:    The    HTTP    request.\n                                outfile:    The    response    file.\n                                base_env_dict:    Dictionary    of    CGI    environment    parameters    if    available.\n                                        Defaults    to    None.\n                        '
            (unused_scheme, unused_netloc, path, query, unused_fragment) = urlparse.urlsplit(request.relative_url)
            param_dict = cgi.parse_qs(query, True)
            page = path.rsplit('/', 1)[(-1)]
            if (page == 'jsapi'):
      ...