<commit_before>class EventsController < ApplicationController
  before_filter :require_admin, except: [:index, :show]
  before_action :set_event, only: [:show, :edit, :update, :destroy]
    
  # GET /events
  # GET /events.json
  def index
    @events = Event.all
  end

  # GET /events/1
  # GET /events/1.json
  def show
    @videos = @event.statements
    @attendee = Attendee.new
    @attendee.user = @current_user
    @attendee.event_day = @event.event_days.first
  end

  # GET /events/new
  def new
    @event = Event.new
  end

  # GET /events/1/edit
  def edit
  end

  # POST /events
  # POST /events.json
  def create
    @event = Event.new(event_params)

    respond_to do |format|
      if @event.save
        format.html { redirect_to @event, notice: 'Event was successfully created.' }
        format.json { render :show, status: :created, location: @event }
      else
        format.html { render :new }
        format.json { render json: @event.errors, status: :unprocessable_entity }
      end
    end
  end

  # PATCH/PUT /events/1
  # PATCH/PUT /events/1.json
  def update
    respond_to do |format|
      if params[:commit] == '+'
        process_method_and_redirect(format,
                                    :candidates, 
                                    :add_candidate, 
                                    event_params[:candidates],
                                    'added') if !event_params[:candidates].blank?
        process_method_and_redirect(format,
                                    :speaker, 
                                    :add_person, 
                                    event_params[:people],
                                    'added') if !event_params[:people].blank?
      elsif params[:commit] == 'x'<commit_msg>implements the easiest bug fix of all time #wwkd<commit_after>class EventsController < ApplicationController
  before_filter :require_admin, except: [:index, :show]
  before_action :set_event, only: [:show, :edit, :update, :destroy]
    
  # GET /events
  # GET /events.json
  def index
    @events = Event.all
  end

  # GET /events/1
  # GET /events/1.json
  def show
    @videos = @event.statements
    @attendee = Attendee.new
    @attendee.user = @current_user
    @attendee.event_day = @event.event_days.first
  end

  # GET /events/new
  def new
    @event = Event.new
  end

  # GET /events/1/edit
  def edit
  end

  # POST /events
  # POST /events.json
  def create
    @event = Event.new(event_params)

    respond_to do |format|
      if @event.save
        format.html { redirect_to @event, notice: 'Event was successfully created.' }
        format.json { render :show, status: :created, location: @event }
      else
        format.html { render :new }
        format.json { render json: @event.errors, status: :unprocessable_entity }
      end
    end
  end

  # PATCH/PUT /events/1
  # PATCH/PUT /events/1.json
  def update
    respond_to do |format|
      if params[:commit] == '+'
        process_method_and_redirect(format,
                                    :candidates, 
                                    :add_candidate, 
                                    event_params[:candidates],
                                    'added') if !event_params[:candidates].blank?
        process_method_and_redirect(format,
                                    :speaker, 
                                    :add_person, 
                                    event_params[:people],
                                    'added') if !event_params[:people].blank?
      elsif params[:commit] == 'X'
{'fraction_non_alphanumeric': 0.09879652952700811, 'fraction_numerical': 0.00279876854184159, 'mean_word_length': 1.7055261165783497, 'pattern_counts': {'":': 0, '<': 5, '<?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': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4023762', 'n_tokens_mistral': 1077, 'n_tokens_neox': 1026, 'n_words': 247}