conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "human", "value": "Add test for re-initializing the config when doing a release upgrade\n\nIssue #71\n" }, { "from": "gpt", "value": "defmodule Appsignal.ReleaseUpgradeTest do\n use ExUnit.Case\n\n use Appsignal.Config\n\n test \"config_change/3\" do\n\n Appsignal.Config.initiali...
elixir
chosen
[ { "from": "human", "value": "Update migration with role field\n" }, { "from": "gpt", "value": "defmodule Repo.Migrations.CreateUsers do\n use Ecto.Migration\n\n def up do\n \"CREATE TABLE IF NOT EXISTS users(id serial primary key, first_name text, last_name text, email text, role text, encr...
elixir
chosen
[ { "from": "human", "value": "Add integration test for standard application\n" }, { "from": "gpt", "value": "defmodule IntegrationTest do\n use ExUnit.Case, async: false\n\n alias Mix.Releases.Utils\n\n @standard_app_path Path.join([__DIR__, \"fixtures\", \"standard_app\"])\n @standard_output...
elixir
chosen
[ { "from": "human", "value": "Add migration for votes table\n" }, { "from": "gpt", "value": "defmodule RemoteRetro.Repo.Migrations.CreateVotesTable do\n use Ecto.Migration\n\n def change do\n create table(:votes) do\n add :user_id, references(:users, [\n column: :id,\n on_...
elixir
chosen
[ { "from": "human", "value": "Add some tests for Kitto.Job\n" }, { "from": "gpt", "value": "defmodule Kitto.JobTest do\n use ExUnit.Case, async: true\n use Plug.Test\n\n test \"#start calls the given job after the given interval\" do\n pid = self\n job = fn (_) -> send pid, :ok end\n ...
elixir
chosen
[ { "from": "human", "value": "Remove unused indexes surfaced by phoenix_live_dashboard\n" }, { "from": "gpt", "value": "defmodule RemoteRetro.Repo.Migrations.RemoveUnusedIndexes do\n use Ecto.Migration\n\n def change do\n drop index(:ideas, [:group_id])\n drop index(:ideas, [:user_id])\n ...
elixir
chosen
[ { "from": "human", "value": "Move exrm/conform plugin to conform project\n" }, { "from": "gpt", "value": "if Code.ensure_loaded?(ReleaseManager.Plugin) do\n defmodule ReleaseManager.Plugin.Conform do\n @name \"conform\"\n @shortdoc \"Generates a .conf for your release\"\n @moduledoc \"...
elixir
chosen
[ { "from": "human", "value": "Create MemberPresenter and begin populating with MemberView functions\n" }, { "from": "gpt", "value": "defmodule WhoWeb.MemberPresenter do\n @typedoc \"\"\"\n This Presenter creates a data object containing all the\n important information regarding a Member.\n...
elixir
chosen
[ { "from": "human", "value": "Add not null constraint to retros.stage\n" }, { "from": "gpt", "value": "defmodule :\"Elixir.RemoteRetro.Repo.Migrations.Add-not-null-constraint-to-retros-stage\" do\n use Ecto.Migration\n\n def up do\n alter table(:retros) do\n modify :stage, :string, defa...
elixir
chosen
[ { "from": "human", "value": "Add basic test on Funnel.Percolator\n\nSigned-off-by: chatgris <f9469d12bf3d131e7aae80be27ccfe58aa9db1f1@af83.com>\n" }, { "from": "gpt", "value": "defmodule Funnel.PercolatorTest do\n use Funnel.TestCase, async: true\n\n test \"percolator is alive\" do\n { :ok,...
elixir
chosen
[ { "from": "system", "value": "Return tuples on error in the same format\n" }, { "from": "human", "value": "defmodule EvercamMedia.Snapshot.CamClient do\n @moduledoc \"\"\"\n Client to talk with the camera for various data. Currently this only fetches snapshots.\n In future, we could expand th...
elixir
chosen
[ { "from": "human", "value": "Add new ChangesetHelper module into example test support folder\n\nThis module contains functions related with models changesets for test purposes" }, { "from": "gpt", "value": "defmodule ChangesetHelper do\n\n # Company related changeset functions\n def new_compan...
elixir
chosen
[ { "from": "human", "value": "Add multi type test file\n" }, { "from": "gpt", "value": "defmodule Xema.MultiTypeTest do\n use ExUnit.Case, async: true\n\n import Xema, only: [validate: 2]\n\n test \"&new/1 called with a wrong type list raised an exception\" do\n assert_raise ArgumentError, ...
elixir
chosen
[ { "from": "human", "value": "Add a simple koan around basic message passing\n" }, { "from": "gpt", "value": "defmodule ConcurrencyTest do\n use ExUnit.Case, async: true\n \n defmodule Computator do\n def double do\n receive do\n {sender, msg} ->\n send sender, { :ok, 2...
elixir
chosen
[ { "from": "human", "value": "Add b-tree indexes to retros.facilitator_id and ideas.user_id\n" }, { "from": "gpt", "value": "defmodule :\"Elixir.RemoteRetro.Repo.Migrations.Add-foreign-key-indexes-to-retros-and-ideas\" do\n use Ecto.Migration\n\n def change do\n create index(:retros, [:facil...
elixir
chosen
[ { "from": "human", "value": "Add helpful mix task to change remote fbos env\n" }, { "from": "gpt", "value": "defmodule Mix.Tasks.Farmbot.Firmware.EnvChange do\n use Mix.Task\n\n def run([node_name]) do\n node_name = connect!(node_name)\n files = :rpc.call(node_name, Path, :wildcard, [\"/...
elixir
chosen
[ { "from": "human", "value": "Add alias file for easier IEx'ing\n" }, { "from": "gpt", "value": "alias Jumubase.Repo, warn: false\nalias Jumubase.Foundation.{Category, Contest, ContestCategory, Host}, warn: false\nalias Jumubase.Showtime.{Appearance, Participant, Performance, Piece}, warn: false\...
elixir
chosen
[ { "from": "human", "value": "Add migration to drop old_* columns on events\n" }, { "from": "gpt", "value": "defmodule Erlef.Repo.Migrations.AlterDropOldMemberIdColumns do\n use Ecto.Migration\n\n def change do\n alter table(:events) do \n modify :submitted_by, :uuid, null: false\n ...
elixir
chosen
[ { "from": "human", "value": "Add basic integration test to Presence Channel\n" }, { "from": "gpt", "value": "defmodule Poxa.Integration.PresenceChannelTest do\n use ExUnit.Case\n\n @moduletag :integration\n\n setup do\n {:ok, pid} = PusherClient.start_link(\"ws://localhost:8080\", \"app_ke...
elixir
chosen
[ { "from": "human", "value": "Add database migration that ports retros that are currently in the labeling-plus-voting stage to be either groups-labeling or groups-voting (depending on whether votes had been cast in the given retro)\n - add rollback query as well\n" }, { "from": "gpt", "value": "...
elixir
chosen
[ { "from": "human", "value": "Add elixir day 1 TicTacToe minimax\n" }, { "from": "gpt", "value": "# Given an incomplete tic-tac-toe board, compute the next player’s best move.\ndefmodule TicTacToe do\n def state([a, a, a,\n _, _, _,\n _, _, _]) when a != \"_\", do: a\n\n ...
elixir
chosen
[ { "from": "human", "value": "Test creating new user's session\n" }, { "from": "gpt", "value": "defmodule UserApp.SessionControllerTest do\n use UserApp.ConnCase\n\n @user_credentials %{username: \"john\", password: \"johndoe\"}\n\n setup %{conn: conn} do\n user = insert_user @user_credenti...
elixir
chosen
[ { "from": "human", "value": "Solve 2016 H in Elixir\n" }, { "from": "gpt", "value": "vowels? = fn c -> Enum.member?([\"a\", \"e\", \"i\", \"o\", \"u\"], c) end\npalindrome? = fn list ->\n reversed = list |> Enum.reverse\n list == reversed\nend\n\nlaugh = IO.read(:line) |> String.trim\n\nif lau...
elixir
chosen
[ { "from": "human", "value": "Add unit test for buckets\n" }, { "from": "gpt", "value": "defmodule MixEx.BucketTest do\n\tuse ExUnit.Case, async: true\n\n\ttest \"stores values by key\" do\n\t\t{:ok, bucket} = MixEx.Bucket.start_link\n\t\tassert MixEx.Bucket.get(bucket, \"milk\") == nil\n\n\t\tMi...
elixir
chosen
[ { "from": "human", "value": "Add DevTools.Atoms to list all VM atoms\n" }, { "from": "gpt", "value": "defmodule HELL.DevTools do\n # credo:disable-for-this-file\n\n defmodule Atoms do\n @moduledoc \"\"\"\n Lists all atoms defined on the VM at a given time.\n\n Use `search_exact` for e...
elixir
chosen
[ { "from": "human", "value": "Add b-tree index to ideas.assignee_id\n" }, { "from": "gpt", "value": "defmodule :\"Elixir.RemoteRetro.Repo.Migrations.Add-index-to-ideas-assigneeId\" do\n use Ecto.Migration\n\n def change do\n create index(:ideas, [:assignee_id])\n end\nend\n" } ]
elixir
chosen
[ { "from": "system", "value": "Fix version to 1.0.0 as no BC changes are planned" }, { "from": "human", "value": "defmodule WhiteBread.Mixfile do\n use Mix.Project\n\n def project do\n [app: :white_bread,\n name: \"WhiteBread\",\n description: \"\"\"\n Story BDD tool written in a...
elixir
chosen
[ { "from": "human", "value": "Add requires Postgres Error Handler module\n" }, { "from": "gpt", "value": "defmodule PostgresErrorHandler do\n @moduledoc \"\"\"\n Handles Postgres errors and provides friendly messages on known failures.\n \"\"\"\n require Logger\n\n @doc \"\"\"\n Handles err...
elixir
chosen
[ { "from": "human", "value": "Add a mix task to purge stale tokens\n" }, { "from": "gpt", "value": "defmodule Mix.Tasks.ExMoney.PurgeTokens do\n use Mix.Task\n\n @shortdoc \"Purges stale Guardian tokens from a database\"\n\n def run(_args) do\n {:ok, pid} = ExMoney.Repo.start_link\n\n Gu...
elixir
chosen
[ { "from": "human", "value": "Add required serializer for Guardian sessions" }, { "from": "gpt", "value": "defmodule Gatekeeper.GuardianSerializer do\n @behaviour Guardian.Serializer\n\n alias Gatekeeper.Repo\n alias Gatekeeper.Member\n\n def for_token(member = %Member{}), do: { :ok, \"Member...
elixir
chosen
[ { "from": "human", "value": "Add new QueryHelper module into example test support folder\n\nThis module contains functions related with models queries for test purposes" }, { "from": "gpt", "value": "defmodule QueryHelper do\n import Ecto.Query\n\n # Company related query functions\n def comp...
elixir
chosen
[ { "from": "human", "value": "Add controller tests for comments\n\nTest posting with valid attributes and verify redirect.\nTest posting with invalid attributes and verify error message.\n" }, { "from": "gpt", "value": "defmodule TheJuice.CommentControllerTest do\n use TheJuice.ConnCase\n\n imp...
elixir
chosen
[ { "from": "human", "value": "Implement BF2 benchmark in Elixir\n" }, { "from": "gpt", "value": "defmodule BF.Tape do\n alias BF.Tape, as: Tape\n\n defstruct data: :array.new(default: 0), pos: 0\n\n def current(tape) do\n :array.get(tape.pos, tape.data)\n end\n\n def inc(tape, x) when x =...
elixir
chosen
[ { "from": "human", "value": "Add migration that updates users.completed_retros_count based on participations\n" }, { "from": "gpt", "value": "defmodule :\"Elixir.RemoteRetro.Repo.Migrations.Update-completed-retros-count\" do\n use Ecto.Migration\n\n def up do\n execute \"\"\"\n UPDATE ...
elixir
chosen
[ { "from": "human", "value": "Add not null constraint to ideas.retro_id\n" }, { "from": "gpt", "value": "defmodule :\"Elixir.RemoteRetro.Repo.Migrations.Add-not-null-constraint-to-ideas-retroId\" do\n use Ecto.Migration\n\n def up do\n drop constraint(:ideas, \"ideas_retro_id_fkey\")\n\n ...
elixir
chosen
[ { "from": "human", "value": "Add not null constraints to participations.{user_id, retro_id}\n" }, { "from": "gpt", "value": "defmodule :\"Elixir.RemoteRetro.Repo.Migrations.Add-not-null-constraints-to-participations\" do\n use Ecto.Migration\n\n def up do\n drop_if_exists unique_index(:part...
elixir
chosen
[ { "from": "human", "value": "Add DB constraints (unique indexes)\n" }, { "from": "gpt", "value": "defmodule Aelita2.Repo.Migrations.Constraints do\n use Ecto.Migration\n\n def change do\n create index(:batches, [:commit],\n name: :batches_commit_index, unique: true)\n create index(:...
elixir
chosen
[ { "from": "human", "value": "Add end-to-end test for voting stage\n" }, { "from": "gpt", "value": "defmodule VotingTest do\n use RemoteRetro.IntegrationCase, async: false\n alias RemoteRetro.Idea\n\n import ShorterMaps\n\n describe \"voting for an idea\" do\n setup [:persist_idea_for_retr...
elixir
chosen