# Buggy code
def start_polling(
    self,
    poll_interval=0.0,
    timeout=10,
    clean=False,
    bootstrap_retries=-1,
    read_latency=2.0,
    allowed_updates=None,
):
    """Starts polling updates from Telegram.

    Args:
        poll_interval (:obj:`float`, optional): Time to wait between polling updates from
            Telegram in seconds. Default is 0.0.
        timeout (:obj:`float`, optional): Passed to :attr:`telegram.Bot.get_updates`.
        clean (:obj:`bool`, optional): Whether to clean any pending updates on Telegram servers
            before actually starting to poll. Default is :obj:`False`.
        bootstrap_retries (:obj:`int`, optional): Whether the bootstrapping phase of the
            `Updater` will retry on failures on the Telegram server.

            * < 0 - retry indefinitely (default)
            *   0 - no retries
            * > 0 - retry up to X times

        allowed_updates (List[:obj:`str`], optional): Passed to
            :attr:`telegram.Bot.get_updates`.
        read_latency (:obj:`float` | :obj:`int`, optional): Grace time in seconds for receiving
            the reply from server. Will be added to the `timeout` value and used as the read
            timeout from server (Default: 2).

    Returns:
        :obj:`Queue`: The update queue that can be filled from the main thread.

    """
    with self.__lock:
        if not self.running:
            self.running = True

            # Create & start threads
            self.job_queue.start()
            dispatcher_ready = Event()
            self._init_thread(
                self.dispatcher.start, "dispatcher", ready=dispatcher_ready
            )
            self._init_thread(
                self._start_polling,
                "updater",
                poll_interval,
                timeout,
                read_latency,
                bootstrap_retries,
                clean,
                allowed_updates,
            )

            dispatcher_ready.wait()

            # Return the update queue so the main thread can insert updates
            return self.update_queue


# Traceback (NotImplementedError)
Exception in thread Bot:377489430:updater:
Traceback (most recent call last):
File "C:\Program Files\Python38\lib\threading.py", line 932, in _bootstrap_inner
self.run()
File "C:\Program Files\Python38\lib\threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\User\.virtualenvs\sandbox38\lib\site-packages\telegram\ext\updater.py", line 216, in _thread_wrapper
target(*args, **kwargs)
File "C:\Users\User\.virtualenvs\sandbox38\lib\site-packages\telegram\ext\updater.py", line 452, in _start_webhook
self.httpd.serve_forever()
File "C:\Users\User\.virtualenvs\sandbox38\lib\site-packages\telegram\utils\webhookhandler.py", line 52, in serve_forever
self.http_server.listen(self.port, address=self.listen)
File "C:\Users\User\.virtualenvs\sandbox38\lib\site-packages\tornado\tcpserver.py", line 152, in listen
self.add_sockets(sockets)
File "C:\Users\User\.virtualenvs\sandbox38\lib\site-packages\tornado\tcpserver.py", line 165, in add_sockets
self._handlers[sock.fileno()] = add_accept_handler(
File "C:\Users\User\.virtualenvs\sandbox38\lib\site-packages\tornado\netutil.py", line 279, in add_accept_handler
io_loop.add_handler(sock, accept_handler, IOLoop.READ)
File "C:\Users\User\.virtualenvs\sandbox38\lib\site-packages\tornado\platform\asyncio.py", line 100, in add_handler
self.asyncio_loop.add_reader(fd, self._handle_events, fd, IOLoop.READ)
File "C:\Program Files\Python38\lib\asyncio\events.py", line 501, in add_reader
raise NotImplementedError
NotImplementedError

# Fixed code
def start_polling(
    self,
    poll_interval=0.0,
    timeout=10,
    clean=False,
    bootstrap_retries=-1,
    read_latency=2.0,
    allowed_updates=None,
):
    """Starts polling updates from Telegram.

    Args:
        poll_interval (:obj:`float`, optional): Time to wait between polling updates from
            Telegram in seconds. Default is 0.0.
        timeout (:obj:`float`, optional): Passed to :attr:`telegram.Bot.get_updates`.
        clean (:obj:`bool`, optional): Whether to clean any pending updates on Telegram servers
            before actually starting to poll. Default is :obj:`False`.
        bootstrap_retries (:obj:`int`, optional): Whether the bootstrapping phase of the
            `Updater` will retry on failures on the Telegram server.

            * < 0 - retry indefinitely (default)
            *   0 - no retries
            * > 0 - retry up to X times

        allowed_updates (List[:obj:`str`], optional): Passed to
            :attr:`telegram.Bot.get_updates`.
        read_latency (:obj:`float` | :obj:`int`, optional): Grace time in seconds for receiving
            the reply from server. Will be added to the `timeout` value and used as the read
            timeout from server (Default: 2).

    Returns:
        :obj:`Queue`: The update queue that can be filled from the main thread.

    """
    with self.__lock:
        if not self.running:
            self.running = True

            # Create & start threads
            self.job_queue.start()
            dispatcher_ready = Event()
            polling_ready = Event()
            self._init_thread(
                self.dispatcher.start, "dispatcher", ready=dispatcher_ready
            )
            self._init_thread(
                self._start_polling,
                "updater",
                poll_interval,
                timeout,
                read_latency,
                bootstrap_retries,
                clean,
                allowed_updates,
                ready=polling_ready,
            )

            self.logger.debug("Waiting for Dispatcher and polling to start")
            dispatcher_ready.wait()
            polling_ready.wait()

            # Return the update queue so the main thread can insert updates
            return self.update_queue