# Buggy code
def __init__(
    self,
    *,
    token: str,
    run_async: Optional[bool] = False,
    auto_reconnect: Optional[bool] = True,
    ssl: Optional[SSLContext] = None,
    proxy: Optional[str] = None,
    timeout: Optional[int] = 30,
    base_url: Optional[str] = WebClient.BASE_URL,
    connect_method: Optional[str] = None,
    ping_interval: Optional[int] = 30,
    loop: Optional[asyncio.AbstractEventLoop] = None,
    headers: Optional[dict] = {},
):
    self.token = token.strip()
    self.run_async = run_async
    self.auto_reconnect = auto_reconnect
    self.ssl = ssl
    self.proxy = proxy
    self.timeout = timeout
    self.base_url = base_url
    self.connect_method = connect_method
    self.ping_interval = ping_interval
    self.headers = headers
    self._event_loop = loop or asyncio.get_event_loop()
    self._web_client = None
    self._websocket = None
    self._session = None
    self._logger = logging.getLogger(__name__)
    self._last_message_id = 0
    self._connection_attempts = 0
    self._stopped = False
    self._web_client = WebClient(
        token=self.token,
        base_url=self.base_url,
        ssl=self.ssl,
        proxy=self.proxy,
        run_async=self.run_async,
        loop=self._event_loop,
        session=self._session,
        headers=self.headers,
    )


# Traceback (URLError)
`Traceback (most recent call last):`
` File "/Volumes/X5/survival_bot/Util/westland_bot/slack_bot.py", line 40, in rtm_client_run_on`
`   self.process_bots(web_client, sender, data['text'], channel, is_group_channel)`
` File "/Volumes/X5/survival_bot/Util/westland_bot/slack_bot.py", line 82, in process_bots`
`   web_client.files_upload(`
` File "/usr/local/lib/python3.8/site-packages/slack/web/client.py", line 1533, in files_upload`
`   return self.api_call("files.upload", files={"file": file}, data=kwargs)`
` File "/usr/local/lib/python3.8/site-packages/slack/web/base_client.py", line 150, in api_call`
`   return self._sync_send(api_url=api_url, req_args=req_args)`
` File "/usr/local/lib/python3.8/site-packages/slack/web/base_client.py", line 241, in _sync_send`
`   return self._urllib_api_call(`
` File "/usr/local/lib/python3.8/site-packages/slack/web/base_client.py", line 352, in _urllib_api_call`
`   response = self._perform_urllib_http_request(url=url, args=request_args)`
` File "/usr/local/lib/python3.8/site-packages/slack/web/base_client.py", line 495, in _perform_urllib_http_request`
`   raise err`
` File "/usr/local/lib/python3.8/site-packages/slack/web/base_client.py", line 475, in _perform_urllib_http_request`
`   resp = urlopen(  # skipcq: BAN-B310`
` File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 222, in urlopen`
`   return opener.open(url, data, timeout)`
` File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 525, in open`
`   response = self._open(req, data)`
` File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 542, in _open`
`   result = self._call_chain(self.handle_open, protocol, protocol +`
` File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 502, in _call_chain`
`   result = func(*args)`
` File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 1393, in https_open`
`   return self.do_open(http.client.HTTPSConnection, req,`
` File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 1353, in do_open`
`18:36`
`raise URLError(err)`
`urllib.error.URLError: <urlopen error The write operation timed out>`

# Fixed code
def __init__(
    self,
    *,
    token: str,
    run_async: Optional[bool] = False,
    auto_reconnect: Optional[bool] = True,
    ssl: Optional[SSLContext] = None,
    proxy: Optional[str] = None,
    timeout: Optional[int] = 30,
    base_url: Optional[str] = WebClient.BASE_URL,
    connect_method: Optional[str] = None,
    ping_interval: Optional[int] = 30,
    loop: Optional[asyncio.AbstractEventLoop] = None,
    headers: Optional[dict] = {},
):
    self.token = token.strip()
    self.run_async = run_async
    self.auto_reconnect = auto_reconnect
    self.ssl = ssl
    self.proxy = proxy
    self.timeout = timeout
    self.base_url = base_url
    self.connect_method = connect_method
    self.ping_interval = ping_interval
    self.headers = headers
    self._event_loop = loop or asyncio.get_event_loop()
    self._web_client = None
    self._websocket = None
    self._session = None
    self._logger = logging.getLogger(__name__)
    self._last_message_id = 0
    self._connection_attempts = 0
    self._stopped = False
    self._web_client = WebClient(
        token=self.token,
        base_url=self.base_url,
        timeout=self.timeout,
        ssl=self.ssl,
        proxy=self.proxy,
        run_async=self.run_async,
        loop=self._event_loop,
        session=self._session,
        headers=self.headers,
    )