<commit_before>class CatwalksController < ApplicationController
 
 before_filter :authenticate 
  
  def new
    @catwalk=current_user.catwalks.new
    respond_to do |format|
      format.html # new.html.erb
      format.xml  { render :xml => @catwalk }
    end
  end
  

  def create
    @catwalk=current_user.catwalks.new(params[:catwalk])
    respond_to do |format|
      if @catwalk.save
      format.html {redirect_to (@catwalk)}# new.html.erb
      format.xml  { render :xml => @catwalk }
       else
      format.html {render :action => "new"}# new.html.erb
      format.xml  { render :xml => @catwalk.errors, :status => :unprocessable_entity }
      end
    end
  
  end

  def show
    @catwalk=Catwalk.find(params[:id])
    respond_to do |format|
      format.html # sho.html.erb
      format.xml  { render :xml => @catwalk }
    end
  end

  def destroy
  end

 def vote_up
         current_user.vote_for(@catwalk = Catwalk.find(params[:id]))
         respond_to do |format|
          
           format.js # new.html.erb
          
         end
         
    rescue ActiveRecord::RecordInvalid
         render :nothing => true, :status => 404
   
 end
 
 def index
 @catwalks=Catwalk.all 
 end
 
 def authenticate
    deny_access unless current_user
 end<commit_msg>voting with catwalk<commit_after>class CatwalksController < ApplicationController
 
 before_filter :authenticate 
  
  def new
    @catwalk=current_user.catwalks.new
    respond_to do |format|
      format.html # new.html.erb
      format.xml  { render :xml => @catwalk }
    end
  end
  

  def create
    @catwalk=current_user.catwalks.new(params[:catwalk])
    respond_to do |format|
      if @catwalk.save
      format.html {redirect_to (@catwalk)}# new.html.erb
      format.xml  { render :xml => @catwalk }
       else
      format.html {render :action => "new"}# new.html.erb
      format.xml  { render :xml => @catwalk.errors, :status => :unprocessable_entity }
      end
    end
  
  end

  def show
    @catwalk=Catwalk.find(params[:id])
    respond_to do |format|
      format.html # sho.html.erb
      format.xml  { render :xml => @catwalk }
    end
  end

  def destroy
  end

 def vote_up
   @catwalk= Catwalk.find(params[:id])
         current_user.vote_for(@catwalk)
         respond_to do |format|
          
           format.js # new.html.erb
          
         end
         
    # rescue ActiveRecord::RecordInvalid
    #    render :nothing => true, :status => 404
   
 end
 
 def index
 @catwalks=Catwalk.all 
 end
 
 def authenticate
    deny_access unless current_user
 end
{'fraction_non_alphanumeric': 0.09825242718446602, 'fraction_numerical': 0.002330097087378641, 'mean_word_length': 2.3025641025641024, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 16}, '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': '2873225', 'n_tokens_mistral': 862, 'n_tokens_neox': 818, 'n_words': 192}