<commit_before>module Gitlab
  module GithubImport
    class BaseFormatter
      attr_reader :formatter, :project, :raw_data

      def initialize(project, raw_data)
        @project = project
        @raw_data = raw_data
        @formatter = Gitlab::ImportFormatter.new
      end

      def create!
        project.send(project_association).find_or_create_by!(find_condition) do |record|
          record.attributes = attributes
        end
      end

      private

      def gitlab_user_id(github_id)
        User.joins(:identities).
          find_by("identities.extern_uid = ? AND identities.provider = 'github'", github_id.to_s).
          try(:id)
      end

      def gitlab_author_id
        return @gitlab_author_id if defined?(@gitlab_author_id)<commit_msg>Use public_send instead of send<commit_after>module Gitlab
  module GithubImport
    class BaseFormatter
      attr_reader :formatter, :project, :raw_data

      def initialize(project, raw_data)
        @project = project
        @raw_data = raw_data
        @formatter = Gitlab::ImportFormatter.new
      end

      def create!
        project.public_send(project_association).find_or_create_by!(find_condition) do |record|
          record.attributes = attributes
        end
      end

      private

      def gitlab_user_id(github_id)
        User.joins(:identities).
          find_by("identities.extern_uid = ? AND identities.provider = 'github'", github_id.to_s).
          try(:id)
      end

      def gitlab_author_id
        return @gitlab_author_id if defined?(@gitlab_author_id)
{'fraction_non_alphanumeric': 0.07815502882767457, 'fraction_numerical': 0.0, 'mean_word_length': 2.6241299303944317, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4658041', 'n_tokens_mistral': 469, 'n_tokens_neox': 449, 'n_words': 95}