<commit_before>module API
  module V1
    class <%= model_name.camelize.pluralize %> < Grape::API

      resource :<%= model_name.pluralize.underscore %> do
        # Get a list of <%= model_name.pluralize.underscore %>
        #
        # Example Request:
        #   GET /v1/<%= model_name.pluralize.underscore %>
        get do
          <%= model_name.camelize.singularize %>.all
        end

        # Get a single <%= model_name.underscore.singularize %>
        #
        # Parameters:
        #   id (required) - The ID of a <%= model_name.underscore.singularize %>
        # Example Request:
        #   GET /v1/<%= model_name.pluralize.underscore %>/:id
        params do
          requires :id
        end
        get ':id' do
          <%= model_name.camelize.singularize %>.find(params[:id])
        end

        # Create a new <%= model_name.underscore.singularize %>
        #
        # Example Request:
        #   POST /v1/<%= model_name.pluralize.underscore %>
        post do
          <%= model_name.underscore.singularize %> = <%= model_name.camelize.singularize %>.new(params)
          if <%= model_name.underscore.singularize %>.save
            <%= model_name.underscore.singularize %>
          else
            <%= model_name.underscore.singularize %>.errors
          end
        end

        # Delete a <%= model_name.underscore.singularize %>
        #
        # Example Request:
        #   DELETE /v1/<%= model_name.pluralize.underscore %>/:id
        params do
          requires :id
        end
        delete ':id' do
          <%= model_name.camelize.singularize %>.destroy(params[:id])
        end

        # Edit a <%= model_name.underscore.singularize %>
        #
        # Example Request:
        #   PUT /v1/<%= model_name.pluralize.underscore %>/:id
        params do
          requires :id
        end
        put ':id' do
          <%= model_name.underscore.singularize %> = <%= model_name.camelize.singularize %>.find(params[:id])
          if <%= model_name.underscore.singularize %>.update(params)
            <%= model_name.underscore.singularize %>
          else
            <%= model_name.underscore.singularize %>.errors
          end
        end
      end
    end
  end
end<commit_msg>[Template] Reorder actions.<commit_after>module API
  module V1
    class <%= model_name.camelize.pluralize %> < Grape::API

      resource :<%= model_name.pluralize.underscore %> do
        # Get a list of <%= model_name.pluralize.underscore %>
        #
        # Example Request:
        #   GET /v1/<%= model_name.pluralize.underscore %>
        get do
          <%= model_name.camelize.singularize %>.all
        end

        # Get a single <%= model_name.underscore.singularize %>
        #
        # Parameters:
        #   id (required) - The ID of a <%= model_name.underscore.singularize %>
        # Example Request:
        #   GET /v1/<%= model_name.pluralize.underscore %>/:id
        params do
          requires :id
        end
        get ':id' do
          <%= model_name.camelize.singularize %>.find(params[:id])
        end

        # Create a new <%= model_name.underscore.singularize %>
        #
        # Example Request:
        #   POST /v1/<%= model_name.pluralize.underscore %>
        post do
          <%= model_name.underscore.singularize %> = <%= model_name.camelize.singularize %>.new(params)
          if <%= model_name.underscore.singularize %>.save
            <%= model_name.underscore.singularize %>
          else
            <%= model_name.underscore.singularize %>.errors
          end
        end

        # Edit a <%= model_name.underscore.singularize %>
        #
        # Example Request:
        #   PUT /v1/<%= model_name.pluralize.underscore %>/:id
        params do
          requires :id
        end
        put ':id' do
          <%= model_name.underscore.singularize %> = <%= model_name.camelize.singularize %>.find(params[:id])
          if <%= model_name.underscore.singularize %>.update(params)
            <%= model_name.underscore.singularize %>
          else
            <%= model_name.underscore.singularize %>.errors
          end
        end

        # Delete a <%= model_name.underscore.singularize %>
        #
        # Example Request:
        #   DELETE /v1/<%= model_name.pluralize.underscore %>/:id
        params do
          requires :id
        end
        delete ':id' do
          <%= model_name.camelize.singularize %>.destroy(params[:id])
        end
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.12438807298620383, 'fraction_numerical': 0.0026702269692923898, 'mean_word_length': 1.809375, 'pattern_counts': {'":': 0, '<': 57, '<?xml version=': 0, '>': 55, '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': '6609987', 'n_tokens_mistral': 1522, 'n_tokens_neox': 1318, 'n_words': 261}