<commit_before>__author__ = 'deathowl'

from twilio.rest import TwilioRestClient
import twilio

class TwilioSmsNotifier:

    def __init__(self, config):
        self.__config = config

    def notify(self, notification):
        max_length = 160
        message = (notification.message[:max_length-2] + '..') if len(notification.message) > max_length else notification.message
        client = TwilioRestClient(self.__config['SID'], self.__config['token'])
        try:
            client.sms.messages.create(body=message,
                to=notification.user_to_notify.profile.phone_number,
                from_=self.__config['sms_number'])
            print 'successfully sent the sms'
        except twilio.TwilioRestException as e:
            print 'failed to send sms, Error: %s' % e<commit_msg>import fix<commit_after>__author__ = 'deathowl'

from twilio.rest import TwilioRestClient
import twilio
import sys

class TwilioSmsNotifier:

    def __init__(self, config):
        self.__config = config

    def notify(self, notification):
        max_length = 160
        message = (notification.message[:max_length-2] + '..') if len(notification.message) > max_length else notification.message
        client = TwilioRestClient(self.__config['SID'], self.__config['token'])
        try:
            client.sms.messages.create(body=message,
                to=notification.user_to_notify.profile.phone_number,
                from_=self.__config['sms_number'])
            print 'successfully sent the sms'
        except twilio.TwilioRestException as e:
            print 'failed to send sms, Error: %s' % e
{'fraction_non_alphanumeric': 0.09913258983890955, 'fraction_numerical': 0.004956629491945477, 'mean_word_length': 2.9009661835748792, 'pattern_counts': {'":': 0, '<': 3, '<?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': '2214188', 'n_tokens_mistral': 469, 'n_tokens_neox': 448, 'n_words': 104}