def send_smses(service, current_state=None, twitter_tweet=None):
    # This is filthy. Don't judge me bro
    if service == "DASH":
        service = "DASHBOARD"

    sms_subscribers = models.SMSSubscriber.gql("WHERE services IN (:1)", service)

    if settings.DEBUG:
        LOGGER.info(
            "SENDING NOTIFICATION TO [" + str(sms_subscribers.count()) + "] SMS SUBSCRIBERS"
        )

    if service in settings.NOTIFY_SERVICES:
        txt = sms.SMS()
        for sms_subscriber in sms_subscribers:
            try:
                # Tweet
                if(twitter_tweet):
                    twitter_tweet = twitter_tweet.strip()

                    txt.send(
                        sms_subscriber.phone,
                        "@balancedstatus: {} - {}".format(
                            service, twitter_tweet))
                # UP/DOWN
                else:
                    txt.send(
                        sms_subscriber.phone,
                        "Balanced {} is {}. Reply with STOP to unsubscribe.".format(
                        service, current_state))
            except TwilioException, e:
                LOGGER.error("Failed to send SMS via Twilio - " + e.msg)
                pass
dataset/ETHPy150Open balanced/status.balancedpayments.com/situation/subscription.py/send_smses/original