<commit_before>class Performance
  def self.build_from(options, title)
    new(
      :performance_id => options.attributes['performance_id'].value,
      :created_date => date_from(options.children.detect {|o| o.name == 'created_date'}.children.first.text),
      :modified_date => date_from(options.children.detect {|o| o.name == 'modified_date'}.children.first.text),
      :description => options.children.detect {|o| o.name == 'performance_description'}.children.first.text,
      :start_date => date_from(options.children.detect {|o| o.name == 'start_date'}.children.first.text),
      :end_date => date_from(options.children.detect {|o| o.name == 'end_date'}.children.first.text),
      :title => title

    )
  end

  def self.date_from(date)
    Date.strptime(date, '%d/%m/%Y')
  end

  def initialize(options)
    @options = options
  end

  def created_date
    attribute_for(:created_date)
  end

  def modified_date
    attribute_for(:modified_date)
  end

  def description
    attribute_for(:description)
  end

  def start_date
    attribute_for(:start_date)
  end

  def end_date
    attribute_for(:end_date)
  end

  def title
    attribute_for(:title)
  end

  private
  def attribute_for(attr)
    @options.fetch(attr, nil)
  end
end<commit_msg>Add performance_id to performance<commit_after>class Performance
  def self.build_from(options, title)
    new(
      :performance_id => options.attributes['performance_id'].value,
      :created_date => date_from(options.children.detect {|o| o.name == 'created_date'}.children.first.text),
      :modified_date => date_from(options.children.detect {|o| o.name == 'modified_date'}.children.first.text),
      :description => options.children.detect {|o| o.name == 'performance_description'}.children.first.text,
      :start_date => date_from(options.children.detect {|o| o.name == 'start_date'}.children.first.text),
      :end_date => date_from(options.children.detect {|o| o.name == 'end_date'}.children.first.text),
      :title => title

    )
  end

  def self.date_from(date)
    Date.strptime(date, '%d/%m/%Y')
  end

  def initialize(options)
    @options = options
  end

  def created_date
    attribute_for(:created_date)
  end

  def modified_date
    attribute_for(:modified_date)
  end

  def description
    attribute_for(:description)
  end

  def start_date
    attribute_for(:start_date)
  end

  def end_date
    attribute_for(:end_date)
  end

  def title
    attribute_for(:title)
  end

  def performance_id
    attribute_for(:performance_id)
  end

  private
  def attribute_for(attr)
    @options.fetch(attr, nil)
  end
end
{'fraction_non_alphanumeric': 0.12590891695369308, 'fraction_numerical': 0.0, 'mean_word_length': 3.761384335154827, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, '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': '7131720', 'n_tokens_mistral': 875, 'n_tokens_neox': 846, 'n_words': 160}