def _close(self, connection):
        try:
            connection.quit()
        except (ssl.SSLError, smtplib.SMTPServerDisconnected):
            # This happens when calling quit() on a TLS connection
            # sometimes, or when the connection was already disconnected
            # by the server.
            connection.close()
        except smtplib.SMTPException:
            self.app.logger.exception(
                'Error while closing connection to SMTP server',
                extra={'mail': True})
creates a bitly link for a given long url
dataset/ETHPy150Open quantmind/lux/lux/extensions/smtp/backend.py/EmailBackend._close--crossover with--dataset/ETHPy150Open bitly/bitly-api-python/bitly_api/bitly_api.py/Connection.shorten