<commit_before>defmodule SinetrisBlog.Helper.Application do
  defmacro __using__(_options) do
    quote do
      import unquote(__MODULE__)
    end
  end

  def current_user(conn) do
    conn
    |> Plug.Conn.fetch_session
    |> Plug.Conn.get_session(:username)
    |> SinetrisBlog.User.get
  end

  def authorize(conn) do
    if current_user(conn) do
      conn
    else
      Phoenix.Controller.text conn, 403, "403 Unauthotized"
    end
  end

  def not_found(conn) do
    Phoenix.Controller.text conn, 404, "404 Not Found"
  end
end<commit_msg>Use atoms instead of int for status code<commit_after>defmodule SinetrisBlog.Helper.Application do
  defmacro __using__(_options) do
    quote do
      import unquote(__MODULE__)
    end
  end

  def current_user(conn) do
    conn
    |> Plug.Conn.fetch_session
    |> Plug.Conn.get_session(:username)
    |> SinetrisBlog.User.get
  end

  def authorize(conn) do
    if current_user(conn) do
      conn
    else
      Phoenix.Controller.text conn, :unauthorized, "403 Unauthorized"
    end
  end

  def not_found(conn) do
    Phoenix.Controller.text conn, :not_found, "404 Not Found"
  end
end
{'fraction_non_alphanumeric': 0.07880910683012259, 'fraction_numerical': 0.01576182136602452, 'mean_word_length': 3.0531914893617023, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '5094973', 'n_tokens_mistral': 403, 'n_tokens_neox': 372, 'n_words': 98}