<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _ldap_connection_factory(self, config):
 """ Use the input configuration to instantiate and return a ldap3 Connection object. """

        ldap_url = config['ldap_url']
        bind_dn = config['bind_dn']
        bind_password = config['bind_password']

        if not ldap_url:
            raise LdapAttributeStoreError("ldap_url is not configured")
        if not bind_dn:
            raise LdapAttributeStoreError("bind_dn is not configured")
        if not bind_password:
            raise LdapAttributeStoreError("bind_password is not configured")

        pool_size = config['pool_size']
        pool_keepalive = config['pool_keepalive']

        server = ldap3.Server(config['ldap_url'])

        satosa_logging(logger, logging.DEBUG, "Creating a new LDAP connection", None)
        satosa_logging(logger, logging.DEBUG, "Using LDAP URL {}".format(ldap_url), None)
        satosa_logging(logger, logging.DEBUG, "Using bind DN {}".format(bind_dn), None)
        satosa_logging(logger, logging.DEBUG, "Using pool size {}".format(pool_size), None)
        satosa_logging(logger, logging.DEBUG, "Using pool keep alive {}".format(pool_keepalive), None)

        try:
            connection = ldap3.Connection(
                            server,
                            bind_dn,
                            bind_password,
                            auto_bind=True,
                            client_strategy=ldap3.REUSABLE,
                            pool_size=pool_size,
                            pool_keepalive=pool_keepalive
                            )

        except LDAPException as e:
            msg = "Caught exception when connecting to LDAP server: {}".format(e)
            satosa_logging(logger, logging.ERROR, msg, None)
            raise LdapAttributeStoreError(msg)

        satosa_logging(logger, logging.DEBUG, "Successfully connected to LDAP server", None)

        return connection