<commit_before>class Presidents::President #gives Presidents module access to the President class
 attr_accessor :name, :url, :documents, :salary, :vp, :notable_events, :points_of_interest
#defines getter,setter methods for every attribute of each President instance
 @@all = [] #sets class variable (@@all) to an empty array

  def self.new_from_index_page(r) #class method that accepts an argument
    self.new(#calls initialize method with two attributes as arguments (name, url)
      r.css("a").text, #retrieves node containing the president's name and converts it to text using .text
      "http://www.ipl.org/div/potus/#{r.css("a").attribute("href").text}" #interpolates link text at the end of the URL
      )
  end
#instantiates new instance with name, url arguments (default value is nil for both)
  def initialize(name=nil, url=nil)
    @name = name  #sets name argument to an instance variable
    @url = url    #sets url argument to an instance variable
    @@all << self   #shovel operator adds the instance to the @@all array
  end

  def self.all  #returns all instances of the President class
    @@all  #returns an array of President instances
  end

  def self.find(id) #accepts an argument and finds the instance with index = argument - 1
    self.all[id - 1]
  end


  #||= assigns AND returns the value of the instance variable
  #.xpath accepts a selector as an argument and retrieves all matching elements; .text converts them to text
  #SELECTORS: td = table data cell, dl = description list, dt = description term, p = paragraph
  def documents
    @documents ||= doc.xpath("//td/dl[4]/dt").text
  end

  def salary
    @salary ||= doc.xpath("//td/p[5]").text
  end

  def vp
    @vp ||= doc.xpath("//td/p[6]").text
  end

  def notable_events
    @notable_events ||= doc.xpath("//td/u[2]").text
  end

  def points_of_interest
    @points_of_interest ||= doc.xpath("//td/u[3]").text
  end

  def doc
    @doc ||= Nokogiri::HTML(open(self.url))
  end
end<commit_msg>Editedselectors inotable_events and points_of_interest instance methods<commit_after>class Presidents::President #gives Presidents module access to the President class
 attr_accessor :name, :url, :documents, :salary, :vp, :notable_events, :points_of_interest
#defines getter,setter methods for every attribute of each President instance
 @@all = [] #sets class variable (@@all) to an empty array

  def self.new_from_index_page(r) #class method that accepts an argument
    self.new(#calls initialize method with two attributes as arguments (name, url)
      r.css("a").text, #retrieves node containing the president's name and converts it to text using .text
      "http://www.ipl.org/div/potus/#{r.css("a").attribute("href").text}" #interpolates link text at the end of the URL
      )
  end
#instantiates new instance with name, url arguments (default value is nil for both)
  def initialize(name=nil, url=nil)
    @name = name  #sets name argument to an instance variable
    @url = url    #sets url argument to an instance variable
    @@all << self   #shovel operator adds the instance to the @@all array
  end

  def self.all  #returns all instances of the President class
    @@all  #returns an array of President instances
  end

  def self.find(id) #accepts an argument and finds the instance with index = argument - 1
    self.all[id - 1]
  end


  #||= assigns AND returns the value of the instance variable
  #.xpath accepts a selector as an argument and retrieves all matching elements; .text converts them to text
  #SELECTORS: td = table data cell, dl = description list, dt = description term, p = paragraph
  def documents
    @documents ||= doc.xpath("//td/dl[4]/dt").text
  end

  def salary
    @salary ||= doc.xpath("//td/p[5]").text
  end

  def vp
    @vp ||= doc.xpath("//td/p[6]").text
  end

  def notable_events
    @notable_events ||= doc.xpath("//td/ul[2]").text
  end

  def points_of_interest
    @points_of_interest ||= doc.xpath("//td/ul[3]").text
  end

  def doc
    @doc ||= Nokogiri::HTML(open(self.url))
  end
end
{'fraction_non_alphanumeric': 0.10781404549950543, 'fraction_numerical': 0.0034619188921859545, 'mean_word_length': 3.681712962962963, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '5295490', 'n_tokens_mistral': 1273, 'n_tokens_neox': 1220, 'n_words': 462}