<commit_before>defmodule Baumeister.Observer.Delay do

  alias Baumeister.Observer
  @moduledoc """
  An `Observer` Plugin that waits a given amount of time before
  letting the process to move forward.

  """
  @behaviour Baumeister.Observer

  @doc """
  Provide a number of milliseconds as delay.
  """
  @spec init(non_neg_integer) :: {:ok, any}
  def init(number) when is_integer(number) and number >= 0 do
    {:ok, number}
  end

  @doc """
  Sleeps for the given number of `n` milliseconds.
  """
  @spec observe(state :: non_neg_integer) :: Observer.observer_return_t
  def observe(n) do
    Process.sleep(n)
    {:ok, n}
  end

end<commit_msg>A DelayPlugin cannot checkout anything.<commit_after>defmodule Baumeister.Observer.Delay do

  alias Baumeister.Observer
  @moduledoc """
  An `Observer` Plugin that waits a given amount of time before
  letting the process to move forward.

  """
  @behaviour Baumeister.Observer

  @doc """
  Provide a number of milliseconds as delay.
  """
  @spec init(non_neg_integer) :: {:ok, any}
  def init(number) when is_integer(number) and number >= 0 do
    {:ok, number}
  end

  @doc """
  Sleeps for the given number of `n` milliseconds.
  """
  @spec observe(state :: non_neg_integer) :: Observer.observer_return_t
  def observe(n) do
    Process.sleep(n)
    {:ok, n}
  end

  @doc """
  A checkout cannot happen for the delay plugin. The call will fail.
  """
  def checkout(coord, build_dir) do
    msg = "no checkout possible for #{inspect __MODULE__}. Coordinate is #{inspect coord}"
    raise ArgumentError, message: msg
  end

end
{'fraction_non_alphanumeric': 0.10628930817610063, 'fraction_numerical': 0.0012578616352201257, 'mean_word_length': 3.625, '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': '1993582', 'n_tokens_mistral': 536, 'n_tokens_neox': 504, 'n_words': 176}