def _configure_banned_handler(self):
        if self.settings.job.has('banned_handlers'):
            handlers = self.settings.job.banned_handlers
            self.banned_handlers = []
            try:
                for h in handlers:
                    if not h.has('action'):
                        return
                    
                    if h.action == 'relogin':
                        self.banned_handlers.append(self.clear_and_relogin)
                    elif h.action == 'proxy':
                        if not h.has('addr') or not hasattr(self.opener, 'add_proxy'):
                            continue
                        proxy_type = h.type if h.has('type') else 'all'
                        def proxy_handler():
                            self.handle_banned_by_proxy = True
                            self.opener.add_proxy(h.addr, 
                                                  proxy_type=proxy_type,
                                                  user=h.user if h.has('user') else None,
                                                  password=h.password if h.has('password') else None)
                        self.banned_handlers.append(proxy_handler)
                    elif h.action == 'clear_proxy':
                        if hasattr(self.opener, 'remove_proxy'):
                            self.banned_handlers.append(self.opener.remove_proxy)
                        
            except TypeError:
                return
dataset/ETHPy150Open chineking/cola/cola/job/executor.py/Executor._configure_banned_handler/original