code: def initialize(self):
          
  
          try:
              conn = ldap.initialize('{0}://{1}:{2}'.format(
                  current_app.config['LDAP_SCHEMA'],
                  current_app.config['LDAP_HOST'],
                  current_app.config['LDAP_PORT']))
              conn.set_option(ldap.OPT_NETWORK_TIMEOUT,
                              current_app.config['LDAP_TIMEOUT'])
              conn = self._set_custom_options(conn)
              conn.protocol_version = ldap.VERSION3
              if current_app.config['LDAP_USE_TLS']:
                  conn.start_tls_s()
              return conn
          except ldap.LDAPError as e:
              raise LDAPException(self.error(e.args))
docs: Initialize a connection to the LDAP server.
  
          :return: LDAP connection object.