def _login(self, shuffle=False):
        if self.job_desc.login_hook is not None:
            if 'login' not in self.settings.job or \
                    not isinstance(self.settings.job.login, list):
                raise ConfigurationError('If login_hook set, config files must contains `login`')
            
            kws = self.settings.job.login
            if shuffle:
                random.shuffle(kws)
            else:
                idx = self.id_ % len(kws)
                kws = kws[idx:] + kws[:idx]
            
            for kw in kws:
                login_result = self.job_desc.login_hook(self.opener, **kw)
                if isinstance(login_result, tuple) and len(login_result) == 2 and \
                    not login_result[0]:
                    if self.logger:
                        self.logger.error('instance %s, login fail, reason: %s' % \
                                          (self.id_, login_result[1]))
                    continue
                elif not login_result:
                    if self.logger:
                        self.logger.error('instance %s: login fail' % self.task_id)
                    continue
                return login_result
            return False
        
        return True
dataset/ETHPy150Open chineking/cola/cola/job/executor.py/Executor._login/original