<commit_before>class SMSController < ApplicationController
  skip_before_action :require_login
  skip_before_action :verify_authenticity_token

  def receive
    @mobile_phone = MobilePhone.where(number: params['From']).first
    if @mobile_phone
      sms_response = decipher_command @mobile_phone, params['Body']
      render xml: sms_response
    else
      head :unprocessable_entity
    end
  end

  private

  def decipher_command mobile_phone, message
    case message.downcase
    when 'start'
      mobile_phone.enable!
      return formulate_response 'OK. Your mobile phone has been enabled.'
    when 'stop'
      mobile_phone.disable!
      formulate_response 'OK. Your mobile phone has been disabled.'
    when 'help'
      help_message = 'Send start to resume questions. ' +
                     'Send stop to take a break from the questions. ' +
                     "Visit #{help_url} to learn more."
      formulate_response help_message
    else
      # I don't know how to do that
      formulate_response 'Unrecognized command. Send help for help or visit SOMEURL/help'
    end
  end

  def formulate_response message
    twiml = Twilio::TwiML::Response.new do |response|
      response.Message message
    end
    twiml.text
  end
end<commit_msg>update help message<commit_after>class SMSController < ApplicationController
  skip_before_action :require_login
  skip_before_action :verify_authenticity_token

  def receive
    @mobile_phone = MobilePhone.where(number: params['From']).first
    if @mobile_phone
      sms_response = decipher_command @mobile_phone, params['Body']
      render xml: sms_response
    else
      head :unprocessable_entity
    end
  end

  private

  def decipher_command mobile_phone, message
    case message.downcase
    when 'start'
      mobile_phone.enable!
      return formulate_response 'OK. Your mobile phone has been enabled.'
    when 'stop'
      mobile_phone.disable!
      formulate_response 'OK. Your mobile phone has been disabled.'
    when 'help'
      help_message = 'Send START to resume questioning. ' +
                     'Send STOP to stop questioning. ' +
                     "Visit #{help_url} to learn more. Messaging & Data rates may apply."
      formulate_response help_message
    else
      # I don't know how to do that
      formulate_response 'Unrecognized command. Send help for help or visit SOMEURL/help'
    end
  end

  def formulate_response message
    twiml = Twilio::TwiML::Response.new do |response|
      response.Message message
    end
    twiml.text
  end
end
{'fraction_non_alphanumeric': 0.06169465052713784, 'fraction_numerical': 0.0, 'mean_word_length': 2.881818181818182, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '2742308', 'n_tokens_mistral': 731, 'n_tokens_neox': 701, 'n_words': 228}