def _ConnectToAd(self):

    # To enable verbose debug logging, uncomment the following line.
    # ldap.set_option(ldap.OPT_DEBUG_LEVEL, 255)

    ldap.set_option(ldap.OPT_REFERRALS, 0)
    ldap.set_option(ldap.OPT_X_TLS_ALLOW, 1)

    ldap.set_option(ldap.OPT_X_TLS_REQUIRE_CERT, ldap.OPT_X_TLS_DEMAND)
    logging.debug('Connecting to Active Directory: %s', self.ldap_url)

    failures = 0
    while True:
      try:
        self.conn = ldap.initialize(self.ldap_url)
        self.conn.protocol_version = ldap.VERSION3
        self.conn.simple_bind_s(self.auth_user, self.auth_password)
        break
      except ldap.LDAPError, e:
        failures += 1
        if failures == MAX_CONNECTION_FAILURES:
          raise
        logging.exception('LDAPError in ConnectToAd().')
        if e.args and e.args[0].get('desc') == 'Can\'t contact LDAP server':
          time.sleep(5 * failures)
          continue
        raise
Check whether or not a line has changed in
dataset/ETHPy150Open google/cauliflowervest/src/cauliflowervest/client/win/bitlocker_ad_sync.py/BitLockerAdSync._ConnectToAd--crossover with--dataset/ETHPy150Open markstory/lint-review/lintreview/diff.py/DiffCollection.has_line_changed