<commit_before>module Graphdb
  module Model

    class AssetId < ActiveNodeBase
      property :asset_id, index: :exact, constraint: :unique

      validates :asset_id, :presence => true

      scope :with_asset_id, ->(asset_id){where(asset_id: asset_id)}

      def self.find_or_create(asset_id)
        a = with_asset_id(asset_id).first
        unless a
          a = new
          a.asset_id = asset_id
          a.save!
        end
        a
      end
    end<commit_msg>Add outputs relation to AssetId<commit_after>module Graphdb
  module Model

    class AssetId < ActiveNodeBase
      property :asset_id, index: :exact, constraint: :unique
      has_many :in, :outputs, origin: :asset_id, model_class: AssetId

      validates :asset_id, :presence => true

      scope :with_asset_id, ->(asset_id){where(asset_id: asset_id)}

      def self.find_or_create(asset_id)
        a = with_asset_id(asset_id).first
        unless a
          a = new
          a.asset_id = asset_id
          a.save!
        end
        a
      end
    end
{'fraction_non_alphanumeric': 0.08269230769230769, 'fraction_numerical': 0.0, 'mean_word_length': 2.253125, 'pattern_counts': {'":': 0, '<': 5, '<?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': '4224784', 'n_tokens_mistral': 342, 'n_tokens_neox': 327, 'n_words': 82}