<commit_before>module SmartAnswer
  class PlanAdoptionLeaveFlow < Flow
    def define
      content_id "b0e80c8b-d19f-4a50-82f4-71ab08f88207"
      name 'plan-adoption-leave'
      status :published
      satisfies_need "101018"

      date_question :child_match_date? do
        save_input_as :match_date

        next_node :child_arrival_date?
      end

      date_question :child_arrival_date? do
        calculate :arrival_date do |response|
          raise InvalidResponse if response <= match_date
          response
        end

        next_node :leave_start?
      end

      date_question :leave_start? do
        calculate :start_date do |response|
          dist = (arrival_date - response).to_i
          raise InvalidResponse unless (1..14).include? dist
          response
        end

        calculate :calculator do
          Calculators::PlanAdoptionLeave.new(
            match_date: match_date,
            arrival_date: arrival_date,<commit_msg>Now insert use_erb_templates_for_questions at top of flow<commit_after>module SmartAnswer
  class PlanAdoptionLeaveFlow < Flow
    def define
      content_id "b0e80c8b-d19f-4a50-82f4-71ab08f88207"
      name 'plan-adoption-leave'
      status :published
      satisfies_need "101018"

      use_erb_templates_for_questions

      date_question :child_match_date? do
        save_input_as :match_date

        next_node :child_arrival_date?
      end

      date_question :child_arrival_date? do
        calculate :arrival_date do |response|
          raise InvalidResponse if response <= match_date
          response
        end

        next_node :leave_start?
      end

      date_question :leave_start? do
        calculate :start_date do |response|
          dist = (arrival_date - response).to_i
          raise InvalidResponse unless (1..14).include? dist
          response
        end

        calculate :calculator do
          Calculators::PlanAdoptionLeave.new(
            match_date: match_date,
            arrival_date: arrival_date,
{'fraction_non_alphanumeric': 0.0554730064388311, 'fraction_numerical': 0.029717682020802376, 'mean_word_length': 2.3499170812603647, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, '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': '5891285', 'n_tokens_mistral': 635, 'n_tokens_neox': 591, 'n_words': 136}