def _get_connection(self):
if self._connection is None:<EOL><INDENT>uri = self.settings.SERVER_URI<EOL>if callable(uri):<EOL><INDENT>uri = uri()<EOL><DEDENT>self._connection = self.backend.ldap.initialize(uri)<EOL>for opt, value in self.settings.CONNECTION_OPTIONS.items():<EOL><INDENT>self._connection.set_option(opt, value)<EOL><DEDENT>if self.settings.START_TLS:<EOL><INDENT>logger.debug("<STR_LIT>")<EOL>self._connection.start_tls_s()<EOL><DEDENT><DEDENT>return self._connection<EOL>
Returns our cached LDAPObject, which may or may not be bound.