# Buggy code
def start_polling(
    self,
    poll_interval=0.0,
    timeout=10,
    network_delay=2,
    clean=False,
    bootstrap_retries=0,
):
    """
    Starts polling updates from Telegram.

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

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

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

    """
    with self.__lock:
        if not self.running:
            self.running = True
            if clean:
                self._clean_updates()

            # Create & start threads
            self._init_thread(self.dispatcher.start, "dispatcher")
            self._init_thread(
                self._start_polling,
                "updater",
                poll_interval,
                timeout,
                network_delay,
                bootstrap_retries,
            )

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


# Traceback (telegram.error.NetworkError)
Traceback (most recent call last):
File "main.py", line 43, in <module>
main()
File "main.py", line 34, in main
updates = bot.getUpdates()
File "/usr/local/lib/python3.5/site-packages/telegram/bot.py", line 114, in decorator
result = func(self, *args, **kwargs)
File "/usr/local/lib/python3.5/site-packages/telegram/bot.py", line 1315, in getUpdates
result = request.post(url, data, timeout=urlopen_timeout)
File "/usr/local/lib/python3.5/site-packages/telegram/utils/request.py", line 83, in decorator
raise NetworkError('URLError: {0}'.format(error.reason))
telegram.error.NetworkError: URLError: _ssl.c:629: The handshake operation timed out

# Fixed code
def start_polling(
    self,
    poll_interval=0.0,
    timeout=10,
    network_delay=2,
    clean=False,
    bootstrap_retries=0,
):
    """
    Starts polling updates from Telegram.

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

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

    Returns:
        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._init_thread(self.dispatcher.start, "dispatcher")
            self._init_thread(
                self._start_polling,
                "updater",
                poll_interval,
                timeout,
                network_delay,
                bootstrap_retries,
                clean,
            )

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