<commit_before>class SearchController < ApplicationController

  respond_to :json

  def index
    q = params[:q]
    search_results = {q: q}
    search_results[:remote_images] = Docker::Image.search(query={ term: q })
    search_results[:local_images] = images_for_repo_like(q)
    respond_with search_results
  end

  private
  def images_for_repo_like(repo)
    images = Docker::Image.all.map do |image|
               repo_tags = image.info['RepoTags'] || []
               image if repo_tags.any? { |tag| tag =~ /#{repo}/ }<commit_msg>fixing accidental local variable assignment<commit_after>class SearchController < ApplicationController

  respond_to :json

  def index
    q = params[:q]
    search_results = {q: q}
    search_results[:remote_images] = Docker::Image.search(term: q)
    search_results[:local_images] = images_for_repo_like(q)
    respond_with search_results
  end

  private
  def images_for_repo_like(repo)
    images = Docker::Image.all.map do |image|
               repo_tags = image.info['RepoTags'] || []
               image if repo_tags.any? { |tag| tag =~ /#{repo}/ }
{'fraction_non_alphanumeric': 0.11363636363636363, 'fraction_numerical': 0.0, 'mean_word_length': 3.45748987854251, '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': '1992074', 'n_tokens_mistral': 349, 'n_tokens_neox': 341, 'n_words': 75}