<commit_before>class Event
  SOURCE = 01

  attr_reader :id, :name, :description, :location, :start_time, :end_time,
              :timezone, :privacy, :venue_name, :owner_name, :owner_url,
              :ticket_url

  class << self
    def search_by(fb_graph:, params:)
      return [] if params[:q].blank?
      results = fb_graph.search(params[:q], type: 'event')
      results = filter_raw_results(results: results)
      results.map { |x| new(params: x) }
    end

    def find(fb_graph:, params:)
      new(fb_graph: fb_graph, params: params)
    end

    private

    def filter_raw_results(results:)
      results.select! do |x|
        !x['start_time'].blank? && x['start_time'] > Time.now
      end
      results.sort! { |a, b| a['start_time'] <=> b['start_time'] }
    end
  end

  def initialize(fb_graph: nil, params:)
    @raw_object =
      fb_graph.blank? ? params : src_object(fb_graph: fb_graph, id: params['id'])
  end

  def source_id
    SOURCE
  end

  def id
    object_param(param: :id)
  end

  def name
    object_param(param: :name)<commit_msg>Fix rubocop offence<commit_after>class Event
  SOURCE = 01

  attr_reader :id, :name, :description, :location, :start_time, :end_time,
              :timezone, :privacy, :venue_name, :owner_name, :owner_url,
              :ticket_url

  class << self
    def search_by(fb_graph:, params:)
      return [] if params[:q].blank?
      results = fb_graph.search(params[:q], type: 'event')
      results = filter_raw_results(results: results)
      results.map { |x| new(params: x) }
    end

    def find(fb_graph:, params:)
      new(fb_graph: fb_graph, params: params)
    end

    private

    def filter_raw_results(results:)
      results.select! do |x|
        !x['start_time'].blank? && x['start_time'] > Time.now
      end
      results.sort! { |a, b| a['start_time'] <=> b['start_time'] }
    end
  end

  def initialize(fb_graph: nil, params:)
    @raw_object =
      fb_graph.blank? ? params :
      src_object(fb_graph: fb_graph, id: params['id'])
  end

  def source_id
    SOURCE
  end

  def id
    object_param(param: :id)
  end

  def name
    object_param(param: :name)
{'fraction_non_alphanumeric': 0.13184772516248838, 'fraction_numerical': 0.0018570102135561746, 'mean_word_length': 2.8689407540394973, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, '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': '307934', 'n_tokens_mistral': 782, 'n_tokens_neox': 735, 'n_words': 175}