<commit_before># Methods added to this helper will be available to all templates in the application.
module ApplicationHelper

	def clean(input)
		# XXX change this to a more fine-grained cleanup of the input and then untaint the string
		return h(input)
	end

	def default_content_for(name, &block)
    # used to define source content for view inheritance
    name = name.kind_of?(Symbol) ? ":#{name}" : name
    out = eval("yield #{name}", block.binding)
    concat(out || capture(&block), block.binding)
  end

  def inheriting_view(options = {}, &block)
    # We accept a shorthand syntax -- if options is a string, render as a file.
    return inheriting_view({:file => options}, &block) if options.is_a?(String)

    bind = options[:binding]

    # Get our differences and additions to the view we're inheriting.
    if block_given?
      bind ||= block.binding
      instance_variable_set(:@content_for_layout, capture(&block))
    end

    raise "Important: inheriting_view() requires a block. " +
      "An empty block (eg, using {}) is suitable." unless bind

    # If we're inheriting a partial, lend our local context to that partial.
    options[:locals] = eval("local_assigns", bind) if options[:partial]

    # Render our parent view.
    concat(render(options), bind)
  end

  def user_link(user)
    link_to user.login, user_path(user.login)
  end
end<commit_msg>Untaint string<commit_after># Methods added to this helper will be available to all templates in the application.
module ApplicationHelper

	def clean(input)
		# XXX change this to a more fine-grained cleanup of the input and then untaint the string
		return h(input)
	end

	def default_content_for(name, &block)
    # used to define source content for view inheritance
    name = name.kind_of?(Symbol) ? ":#{name}" : name
    out = eval("yield #{name}", block.binding)
    concat(out || capture(&block), block.binding)
  end

  def inheriting_view(options = {}, &block)
    # We accept a shorthand syntax -- if options is a string, render as a file.
    return inheriting_view({:file => options}, &block) if options.is_a?(String)

    bind = options[:binding]

    # Get our differences and additions to the view we're inheriting.
    if block_given?
      bind ||= block.binding
      instance_variable_set(:@content_for_layout, capture(&block))
    end

    raise "Important: inheriting_view() requires a block. " +
      "An empty block (eg, using {}) is suitable." unless bind

    # If we're inheriting a partial, lend our local context to that partial.
    options[:locals] = eval("local_assigns", bind) if options[:partial]

    # Render our parent view.
    concat(render(options), bind)
  end

  def user_link(user)
    link_to h(user.login), h(user_path(user.login))
  end
end
{'fraction_non_alphanumeric': 0.10119262739428984, 'fraction_numerical': 0.0, 'mean_word_length': 3.6915254237288138, 'pattern_counts': {'":': 2, '<': 3, '<?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': '951369', 'n_tokens_mistral': 834, 'n_tokens_neox': 799, 'n_words': 298}