<commit_before>import logging
import socket
from email.mime.text import MIMEText
from smtplib import SMTP, SMTPAuthenticationError
from torrt.base_notifier import BaseNotifier
from torrt.utils import NotifierClassesRegistry

LOGGER = logging.getLogger(__name__)


class EmailNotifier(BaseNotifier):

    alias = 'email'

    def __init__(self, email, host='localhost', port=25, user=None, password=<PASSWORD>, use_tls=False, sender=None):

        self.email = email
        self.sender = sender

        self.host = host
        self.port = int(port)
        self.user = user
        self.password = password
        self.use_tls = str(use_tls) == 'True'

        self.connection = self.get_connection()

    def get_connection(self):
        try:
            connection = SMTP(self.host, self.port, timeout=1)
            connection.ehlo()
        except socket.error as e:
            LOGGER.error('Could not connect to SMTP server: %s' % e)
            return
        if self.use_tls:
            try:<commit_msg>SMTP timeout was changed to default value<commit_after>import logging
import socket
from email.mime.text import MIMEText
from smtplib import SMTP, SMTPAuthenticationError
from torrt.base_notifier import BaseNotifier
from torrt.utils import NotifierClassesRegistry

LOGGER = logging.getLogger(__name__)


class EmailNotifier(BaseNotifier):

    alias = 'email'

    def __init__(self, email, host='localhost', port=25, user=None, password=<PASSWORD>, use_tls=False, sender=None):

        self.email = email
        self.sender = sender

        self.host = host
        self.port = int(port)
        self.user = user
        self.password = password
        self.use_tls = str(use_tls) == 'True'

        self.connection = self.get_connection()

    def get_connection(self):
        try:
            connection = SMTP(self.host, self.port)
            connection.ehlo()
        except socket.error as e:
            LOGGER.error('Could not connect to SMTP server: %s' % e)
            return
        if self.use_tls:
            try:
{'fraction_non_alphanumeric': 0.08971233544612384, 'fraction_numerical': 0.0024378352023403218, 'mean_word_length': 2.6512455516014235, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '480339', 'n_tokens_mistral': 600, 'n_tokens_neox': 593, 'n_words': 158}