<commit_before>require 'active_resource'

module Automation

  class Automation < ::Automation::BaseActiveResource
    module Types
      CHEF = 'Chef'
      SCRIPT = 'Script'
    end

    self.collection_name = "automations"

    def form_attribute(name)
      unless self.respond_to? name.to_sym
        return "Unknow attribute ''#{name}''"
      end
      self.send(name.to_sym)
    end

    def form_to_attributes(attrs)
      attrs.keys.each do |key|
        if json_attr.include? key
          attrs[key] = string_to_json(attrs[key])<commit_msg>Fix typo<commit_after>require 'active_resource'

module Automation

  class Automation < ::Automation::BaseActiveResource
    module Types
      CHEF = 'Chef'
      SCRIPT = 'Script'
    end

    self.collection_name = "automations"

    def form_attribute(name)
      unless self.respond_to? name.to_sym
        return "Unknown attribute ''#{name}''"
      end
      self.send(name.to_sym)
    end

    def form_to_attributes(attrs)
      attrs.keys.each do |key|
        if json_attr.include? key
          attrs[key] = string_to_json(attrs[key])
{'fraction_non_alphanumeric': 0.09636363636363636, 'fraction_numerical': 0.0, 'mean_word_length': 2.8229166666666665, 'pattern_counts': {'":': 0, '<': 5, '<?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': '2648152', 'n_tokens_mistral': 358, 'n_tokens_neox': 345, 'n_words': 76}