<commit_before>require File.expand_path(UTILS_DIR+'/internal/model/field_set', File.dirname(__FILE__))
require File.expand_path(UTILS_DIR+'/internal/model/input_into_model', File.dirname(__FILE__))
require File.expand_path(UTILS_DIR+'/internal/model/clone', File.dirname(__FILE__))
require File.expand_path(UTILS_DIR+'/internal/model/get_items', File.dirname(__FILE__))

#TODO: lose all of these, lose notion of schema and data
require File.expand_path(UTILS_DIR+'/internal/model/schema', File.dirname(__FILE__))
require File.expand_path(UTILS_DIR+'/internal/model/data', File.dirname(__FILE__))

module XYZ
  class Model < HashObject 
    include R8Tpl::Utility::I18n
    extend R8Tpl::Utility::I18n
    class << self
      attr_reader :db
      #TODO: get benchmark from config file
      expose_methods_from_internal_object :db, %w{update_from_select update_from_hash_assignments update_instance get_instance_or_factory get_instance_scalar_values get_objects_just_dataset get_object_ids_wrt_parent get_parent_object exists? create_from_select ret_id_handles_from_create_returning_ids create_from_hash create_simple_instance? delete_instance delete_instances_wrt_parent process_raw_db_row!} #, :benchmark => %w{create_from_hash} # :all
    end

    def self.model_name()
      Aux::underscore(Aux::demodulize(self.to_s)).to_sym
    end
    def model_name()
      self.class.model_name() 
    end

    def self.model_class(model_name)
      XYZ.const_get Aux.camelize model_name
    end

    module Delim
      Char = "_"
      Common = "#{Char}#{Char}"
      NumericIndex = Char
      DisplayName = Common
      RegexpCommon = Regexp.new(Common)
      NumericIndexRegexp = Regexp.new("#{Common}#{NumericIndex}([0-9]+)")
    end

    include FieldSetInstanceMixin
    extend CloneClassMixins
    include CloneInstanceMixins
    extend InputIntoModelClassMixins
    include GetItemsInstanceMixins<commit_msg>fixed bug with model_name and subclass like ssembly<commit_after>#TODO: model_name and relation_type redundant
require File.expand_path(UTILS_DIR+'/internal/model/field_set', File.dirname(__FILE__))
require File.expand_path(UTILS_DIR+'/internal/model/input_into_model', File.dirname(__FILE__))
require File.expand_path(UTILS_DIR+'/internal/model/clone', File.dirname(__FILE__))
require File.expand_path(UTILS_DIR+'/internal/model/get_items', File.dirname(__FILE__))

#TODO: lose all of these, lose notion of schema and data
require File.expand_path(UTILS_DIR+'/internal/model/schema', File.dirname(__FILE__))
require File.expand_path(UTILS_DIR+'/internal/model/data', File.dirname(__FILE__))

module XYZ
  class Model < HashObject 
    include R8Tpl::Utility::I18n
    extend R8Tpl::Utility::I18n
    class << self
      attr_reader :db
      #TODO: get benchmark from config file
      expose_methods_from_internal_object :db, %w{update_from_select update_from_hash_assignments update_instance get_instance_or_factory get_instance_scalar_values get_objects_just_dataset get_object_ids_wrt_parent get_parent_object exists? create_from_select ret_id_handles_from_create_returning_ids create_from_hash create_simple_instance? delete_instance delete_instances_wrt_parent process_raw_db_row!} #, :benchmark => %w{create_from_hash} # :all
    end

    def self.model_name()
      model_name_x = Aux::underscore(Aux::demodulize(self.to_s)).to_sym
      SubClassRelations[model_name_x]|| model_name_x
    end
    def model_name()
      @relation_type || self.class.model_name() 
    end

    def self.model_class(model_name)
      XYZ.const_get Aux.camelize model_name
    end

    module Delim
      Char = "_"
      Common = "#{Char}#{Char}"
      NumericIndex = Char
      DisplayName = Common
      RegexpCommon = Regexp.new(Common)
      NumericIndexRegexp = Regexp.new("#{Common}#{NumericIndex}([0-9]+)")
    end

    include FieldSetInstanceMixin
    extend CloneClassMixins
    include CloneInstanceMixins
    extend InputIntoModelClassMixins
    include GetItemsInstanceMixins
{'fraction_non_alphanumeric': 0.09081786251881585, 'fraction_numerical': 0.004014049172102358, 'mean_word_length': 5.181395348837209, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 5, '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': '4075572', 'n_tokens_mistral': 1317, 'n_tokens_neox': 1294, 'n_words': 231}