<commit_before>module ActiveRecord #:nodoc:
  module Serialization
    def self.included(base)
      base.cattr_accessor :include_root_in_json, :instance_writer => false
      base.extend ClassMethods
    end

    # Returns a JSON string representing the model. Some configuration is
    # available through +options+.
    #
    # Without any +options+, the returned JSON string will include all
    # the model's attributes. For example:
    #
    #   konata = User.find(1)
    #   konata.to_json
    #   # => {"id": 1, "name": "<NAME>", "age": 16,<commit_msg>describe action of include_root_in_json in to_json docs<commit_after>module ActiveRecord #:nodoc:
  module Serialization
    def self.included(base)
      base.cattr_accessor :include_root_in_json, :instance_writer => false
      base.extend ClassMethods
    end

    # Returns a JSON string representing the model. Some configuration is
    # available through +options+.
    #
    # The option <tt>ActiveRecord::Base.include_root_in_json</tt> controls the
    # top-level behavior of to_json. In a new Rails application, it is set to 
    # <tt>true</tt> in initializers/new_rails_defaults.rb. When it is <tt>true</tt>,
    # to_json will emit a single root node named after the object's type. For example:
    #
    #   konata = User.find(1)
    #   ActiveRecord::Base.include_root_in_json = true
    #   konata.to_json
    #   # => { "user": {"id": 1, "name": "<NAME>", "age": 16,
    #                   "created_at": "2006/08/01", "awesome": true} }
    #
    #   ActiveRecord::Base.include_root_in_json = false
    #   konata.to_json
    #   # => {"id": 1, "name": "<NAME>", "age": 16,
    #         "created_at": "2006/08/01", "awesome": true}
    #
    # The remainder of the examples in this section assume include_root_in_json is set to
    # <tt>false</tt>.
    #
    # Without any +options+, the returned JSON string will include all
    # the model's attributes. For example:
    #
    #   konata = User.find(1)
    #   konata.to_json
    #   # => {"id": 1, "name": "<NAME>", "age": 16,
{'fraction_non_alphanumeric': 0.12421154779233382, 'fraction_numerical': 0.015041242115477924, 'mean_word_length': 2.9127134724857684, 'pattern_counts': {'":': 17, '<': 15, '<?xml version=': 0, '>': 21, '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': '530505', 'n_tokens_mistral': 687, 'n_tokens_neox': 647, 'n_words': 189}