<commit_before>require 'rubygems'
require 'twilio-ruby'  

module Agents
    class TwilioAgent < Agent

        default_schedule "every_10m"

        description <<-MD
            The TwilioAgent collects any events sent to it and send them via text message. 
            Add more info
        MD

        def default_options
            {
                :account_sid   => "<KEY>",
                :auth_token    => "<KEY>",
                :senderscell   => "xxxxxxxxxx",
                :receiverscell => "xxxxxxxxxx",
                :expected_receive_period_in_days => "x"
            }
        end

        def validate_options
            errors.add(:base, "account_sid,auth_token,senderscell,receiverscell are all required") unless options[:account_sid].present? && options[:auth_token].present? && options[:senderscell].present? && options[:receiverscell].present? && options[:expected_receive_period_in_days].present?
        end

        def receive(incoming_events)
            incoming_events.each do |event|
                self.memory[:queue] ||= [] # If memory[:queue] is not true, assign [] to it, a || a = b
                self.memory[:queue] << event.payload # Append<commit_msg>TwilioAgent Description<commit_after>require 'rubygems'
require 'twilio-ruby'  

module Agents
    class TwilioAgent < Agent

        default_schedule "every_10m"

        description <<-MD
            The TwilioAgent receives and collects events and send them via text message to cellphone when scheduled. Right now, it is assumed that events have `:message` key, the value of which is sent as the content of the text message.
            Set `:receiverscell` to the number on which you would like to receive text messages.
            `:expected_receive_period_in_days` is maximum days that you would expect to pass between events being received by this agent. 
        MD

        def default_options
            {
                :account_sid   => "<KEY>",
                :auth_token    => "<KEY>",
                :senderscell   => "xxxxxxxxxx",
                :receiverscell => "xxxxxxxxxx",
                :expected_receive_period_in_days => "x"
            }
        end

        def validate_options
            errors.add(:base, "account_sid,auth_token,senderscell,receiverscell,expected_receive_period_in_days are all required") unless options[:account_sid].present? && options[:auth_token].present? && options[:senderscell].present? && options[:receiverscell].present? && options[:expected_receive_period_in_days].present?
        end

        def receive(incoming_events)
            incoming_events.each do |event|
                self.memory[:queue] ||= [] # If memory[:queue] is not true, assign [] to it, a || a = b
                self.memory[:queue] << event.payload # Append
{'fraction_non_alphanumeric': 0.09549356223175966, 'fraction_numerical': 0.001430615164520744, 'mean_word_length': 2.3861985472154963, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 4, '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': '2210241', 'n_tokens_mistral': 771, 'n_tokens_neox': 721, 'n_words': 209}