<commit_before>module Device
  class Base
    attr_accessor :adapter, :configuration, :adapter_uuid
    include ::Identifiable
    include ::Persistable::Member

    def initialize(params = {})
      @adapter = params.fetch(:adapter, default_adapter)
      @configuration = params.fetch(:configuration, default_configuration)
    end

    # Eventually need to be wrapped up to handle problems with talking
    #  to the real world (ie, begin resuce).  Don't want to assume that
    #  they are always going to work
    def apply_state
      adapter.apply_device_state(self)
    end

    def get_updated_state
      adapter.update_device_state(self)
    end

    def persistance_key
      uuid
    end

    def to_hash
      {
        uuid: uuid,
        adapter_uuid: adapter.uuid
      }
    end

    def after_load
      #@adapter = persistance_store.load(adapter_uuid)
    end

    def adapter
      @adapter || default_adapter
    end

    def abilities
      ability_modules.collect { |m| ability_module_to_s(m) }
    end
    
    private

    def ability_modules
      self.class.included_modules.select { |m| ability_module?(m) }
    end

    def ability_module?(m)<commit_msg>Remove whitespace<commit_after>module Device
  class Base
    attr_accessor :adapter, :configuration, :adapter_uuid
    include ::Identifiable
    include ::Persistable::Member

    def initialize(params = {})
      @adapter = params.fetch(:adapter, default_adapter)
      @configuration = params.fetch(:configuration, default_configuration)
    end

    # Eventually need to be wrapped up to handle problems with talking
    #  to the real world (ie, begin resuce).  Don't want to assume that
    #  they are always going to work
    def apply_state
      adapter.apply_device_state(self)
    end

    def get_updated_state
      adapter.update_device_state(self)
    end

    def persistance_key
      uuid
    end

    def to_hash
      {
        uuid: uuid,
        adapter_uuid: adapter.uuid
      }
    end

    def after_load
      #@adapter = persistance_store.load(adapter_uuid)
    end

    def adapter
      @adapter || default_adapter
    end

    def abilities
      ability_modules.collect { |m| ability_module_to_s(m) }
    end

    private

    def ability_modules
      self.class.included_modules.select { |m| ability_module?(m) }
    end

    def ability_module?(m)
{'fraction_non_alphanumeric': 0.06925675675675676, 'fraction_numerical': 0.0, 'mean_word_length': 2.6558641975308643, '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': '6242132', 'n_tokens_mistral': 694, 'n_tokens_neox': 675, 'n_words': 188}