def set_proxy(self, proxy, update=True):
update_web_driver = False<EOL>if self.current_proxy != proxy:<EOL><INDENT>update_web_driver = True<EOL><DEDENT>self.current_proxy = proxy<EOL>if proxy is None:<EOL><INDENT>self.driver_args['<STR_LIT>'] = self.default_service_args<EOL><DEDENT>else:<EOL><INDENT>proxy_parts = cutil.get_proxy_parts(proxy)<EOL>self.driver_args['<STR_LIT>'].extend(['<STR_LIT>'.format(**proxy_parts),<EOL>'<STR_LIT>'.format(**proxy_parts),<EOL>])<EOL>if proxy_parts.get('<STR_LIT:user>') is not None:<EOL><INDENT>self.driver_args['<STR_LIT>'].append('<STR_LIT>'.format(**proxy_parts))<EOL><DEDENT><DEDENT>if update is True and update_web_driver is True:<EOL><INDENT>self._update()<EOL><DEDENT>
Set proxy for requests session