def _refresh(self, password=None):
    """Refresh session ID.

    :param password: Password used to log into Azkaban. If not specified,
      will prompt for one.

    Also caches the session ID for future use.

    """
    self._logger.debug('Refreshing.')
    attempts = self.attempts
    password = password or self.password
    while True:
      password = password or getpass((self, ) % 'Azkaban password for %s: ')
      try:
        res = _extract_json(_azkaban_request(
          'POST',
          self.url,
          data={
            'action': 'login',
            'username': self.user,
            'password': password,
          },
          verify=self.verify,
        ))
      except AzkabanError as err:
        if not 'Incorrect Login.' in err.message:
          raise err
        self._logger.warning('Invalid login attempt.')
        attempts -= 1
        password = None
        if attempts <= 0:
          raise AzkabanError('Too many unsuccessful login attempts. Aborting.')
      else:
        break
    self.id = res['session.id']
    if self.config:
      if not self.config.parser.has_section('session_id'):
        self.config.parser.add_section('session_id')
      self.config.parser.set(
        'session_id',
        str(self).replace(':', '.'),
        self.id
      )
      self.config.save()
    self._logger.info('Refreshed.')
dataset/ETHPy150Open mtth/azkaban/azkaban/remote.py/Session._refresh/swapped operands of `%`