<commit_before>defmodule Lyn.Language do
  use Lyn.Web, :model

  schema "languages" do
    field :sort_order, :integer
    field :name, :string
    field :abbr, :string
    field :charset, :string

    timestamps
  end

  def admin_fields do
    [
      id: %{
        label: "id"
      },
      name: %{
        label: "name"
      },
      abbr: %{
        label: "abbr"
      },
      charset: %{
        label: "charset"
      },
      sort_order: %{
        label: "sort_order"
      },
      inserted_at: %{
        label: "inserted_at"
      },
      updated_at: %{
        label: "updated_at"
      }
    ]
  end

  @required_fields ~w(sort_order abbr charset)
  @optional_fields ~w()

  @doc """
  Creates a changeset based on the `model` and `params`.

  If no params are provided, an invalid changeset is returned
  with no validation performed.
  """
  def changeset(model, params \\ :empty) do
    model
    |> cast(params, @required_fields, @optional_fields)
  end
end<commit_msg>Add name to language required fields<commit_after>defmodule Lyn.Language do
  use Lyn.Web, :model

  schema "languages" do
    field :sort_order, :integer
    field :name, :string
    field :abbr, :string
    field :charset, :string

    timestamps
  end

  def admin_fields do
    [
      id: %{
        label: "id"
      },
      name: %{
        label: "name"
      },
      abbr: %{
        label: "abbr"
      },
      charset: %{
        label: "charset"
      },
      sort_order: %{
        label: "sort_order"
      },
      inserted_at: %{
        label: "inserted_at"
      },
      updated_at: %{
        label: "updated_at"
      }
    ]
  end

  @required_fields ~w(sort_order name abbr charset)
  @optional_fields ~w()

  @doc """
  Creates a changeset based on the `model` and `params`.

  If no params are provided, an invalid changeset is returned
  with no validation performed.
  """
  def changeset(model, params \\ :empty) do
    model
    |> cast(params, @required_fields, @optional_fields)
  end
end
{'fraction_non_alphanumeric': 0.11298315163528246, 'fraction_numerical': 0.0, 'mean_word_length': 2.0824427480916032, 'pattern_counts': {'":': 0, '<': 3, '<?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': '5751097', 'n_tokens_mistral': 681, 'n_tokens_neox': 648, 'n_words': 183}