<commit_before># encoding: utf-8

class PublicAssetsController < ApplicationController

  def show
    if asset = find_valid_asset
      redirect_to asset.asset_url(params)
    else
      head 401
    end
  end

  def show_head
    if asset = find_valid_asset
      redirect_to asset.asset_url params.merge(head: true)
    else
      head 401
    end
  end

  def show_options
    headers['Access-Control-Allow-Methods'] = 'GET, OPTIONS'
    head :no_content
  end

  private

  def find_valid_asset
    asset = params[:class].camelize.constantize.find(params[:id])
    if asset.public_url_valid?(params)
      asset
    else
      nil
    end
  end

end<commit_msg>More more hound<commit_after># encoding: utf-8

class PublicAssetsController < ApplicationController

  def show
    if asset = find_valid_asset
      redirect_to asset.asset_url(params)
    else
      head 401
    end
  end

  def show_head
    if asset = find_valid_asset
      redirect_to asset.asset_url params.merge(head: true)
    else
      head 401
    end
  end

  def show_options
    headers['Access-Control-Allow-Methods'] = 'GET, OPTIONS'
    head :no_content
  end

  private

  def find_valid_asset
    asset = params[:class].camelize.constantize.find(params[:id])
    asset if asset.public_url_valid?(params)
  end

end
{'fraction_non_alphanumeric': 0.06917755572636433, 'fraction_numerical': 0.010760953112990008, 'mean_word_length': 2.8982035928143715, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5001118', 'n_tokens_mistral': 435, 'n_tokens_neox': 412, 'n_words': 104}