<commit_before>module Interactors
  module Groups
    class Create
      include Pavlov::Interactor
      include Util::CanCan

      attribute :groupname
      attribute :members
      attribute :pavlov_options, Hash

      def authorized?
        can?(:create, Group)
      end

      private

      def execute
        Backend::Groups.create(
            groupname: groupname,
            usernames: members
        )
      end

      def validate
        validate_nonempty_string :groupname, groupname
        p members, members.is_a?(Array), members.is_a?(Array) && members.all?{|o| o.is_a?(String)}

        unless members.is_a?(Array) && members.all?{|o| o.is_a?(String)}
          errors.add :members, 'should be an array of strings'
        end
      end
    end
  end
end<commit_msg>Fix indents<commit_after>module Interactors
  module Groups
    class Create
      include Pavlov::Interactor
      include Util::CanCan

      attribute :groupname
      attribute :members
      attribute :pavlov_options, Hash

      def authorized?
        can?(:create, Group)
      end

      private

      def execute
        Backend::Groups.create(groupname: groupname, usernames: members)
      end

      def validate
        validate_nonempty_string :groupname, groupname
        p members, members.is_a?(Array), members.is_a?(Array) && members.all?{|o| o.is_a?(String)}

        unless members.is_a?(Array) && members.all?{|o| o.is_a?(String)}
          errors.add :members, 'should be an array of strings'
        end
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.09032258064516129, 'fraction_numerical': 0.0, 'mean_word_length': 2.3141025641025643, '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': '5757645', 'n_tokens_mistral': 459, 'n_tokens_neox': 450, 'n_words': 117}