<commit_before>class StreamsController < ApplicationController
  before_filter :authenticate_user!

  def new
    @stream = Stream.new
    @feeds = Feed.user(current_user)
    @twitter_accounts = TwitterAccount.user(current_user)
    @email_lists = EmailList.user(current_user)
  end

  def create
    @stream = Stream.new(params[:stream])
    ap @stream
    @stream.user_id = current_user.id
    ap @stream

    @stream.twitter_accounts = TwitterAccount.find(params[:twitter_account]) if params[:twitter_account]
    ap @stream
    @stream.email_lists = EmailList.find(params[:email_list]) if params[:email_list]
    ap @stream

    if @stream.save
      redirect_to(user_root_path, :notice => 'Your stream was successfully created.')
    else
      @feeds = Feed.user(current_user)
      @twitter_accounts = TwitterAccount.user(current_user)
      @email_lists = EmailList.user(current_user)
      render "new"
    end
  end

  def edit
    @stream = Stream.find(params[:id])
    @feeds = Feed.user(current_user)
    @twitter_accounts = TwitterAccount.user(current_user)
    @email_lists = EmailList.user(current_user)
  end<commit_msg>remove debug code<commit_after>class StreamsController < ApplicationController
  before_filter :authenticate_user!

  def new
    @stream = Stream.new
    @feeds = Feed.user(current_user)
    @twitter_accounts = TwitterAccount.user(current_user)
    @email_lists = EmailList.user(current_user)
  end

  def create
    @stream = Stream.new(params[:stream])
    @stream.user_id = current_user.id

    @stream.twitter_accounts = TwitterAccount.find(params[:twitter_account]) if params[:twitter_account]
    @stream.email_lists = EmailList.find(params[:email_list]) if params[:email_list]

    if @stream.save
      redirect_to(user_root_path, :notice => 'Your stream was successfully created.')
    else
      @feeds = Feed.user(current_user)
      @twitter_accounts = TwitterAccount.user(current_user)
      @email_lists = EmailList.user(current_user)
      render "new"
    end
  end

  def edit
    @stream = Stream.find(params[:id])
    @feeds = Feed.user(current_user)
    @twitter_accounts = TwitterAccount.user(current_user)
    @email_lists = EmailList.user(current_user)
  end
{'fraction_non_alphanumeric': 0.1018018018018018, 'fraction_numerical': 0.0, 'mean_word_length': 4.0592255125284735, 'pattern_counts': {'":': 0, '<': 5, '<?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': '4652992', 'n_tokens_mistral': 707, 'n_tokens_neox': 688, 'n_words': 131}