content_id
large_stringlengths
40
40
size_bytes
int64
1.5k
25k
repo_ids
large listlengths
1
410
tags
large listlengths
0
7
content
large_stringlengths
681
25k
07bb1f846a54e2e30921927f1d6b1c5cf136cb29
4,160
[ 564106783 ]
[]
defmodule AdventOfCode.Y2022.Day23 do defdelegate parse(input), to: __MODULE__.Input @directions ~w(N S W E)a def part1(input \\ nil) do input |> parse() |> move_elves(@directions, 1, 10) |> count_empty_tiles() end def part2(input \\ nil) do input |> parse() |> move_elves(@direc...
07bb488b7d8cc93bd5f39525d6f3acb3d9a771ec
3,391
[ 308172757 ]
[]
%{ "castore": {:hex, :castore, "1.0.12", "053f0e32700cbec356280c0e835df425a3be4bc1e0627b714330ad9d0f05497f", [:mix], [], "hexpm", "3dca286b2186055ba0c9449b4e95b97bf1b57b47c1f2644555879e659960c224"}, "complex": {:hex, :complex, "0.6.0", "b0130086a7a8c33574d293b2e0e250f4685580418eac52a5658a4bd148f3ccf1", [:mix], [], ...
07bb56777b9c45cc5c0b24216f85f777ced54abe
6,865
[ 244870223 ]
[ "test" ]
defmodule AeMdw.Db.WriteFieldsMuationTest do use ExUnit.Case, async: false alias AeMdw.Db.Model alias AeMdw.Db.Name alias AeMdw.Db.Store alias AeMdw.Db.State alias AeMdw.Db.MemStore alias AeMdw.Db.NullStore alias AeMdw.Db.WriteFieldsMutation alias AeMdw.Fields alias AeMdw.Validate import Mock ...
07bbc7e2b269dbaae1703ba71196f305f0f8d801
2,047
[ 640342807 ]
[ "documented" ]
defmodule Membrane.H265.Parser.NALuParser.Schemes.VPS do @moduledoc false @behaviour Membrane.H265.Parser.NALuParser.Scheme alias Membrane.H265.Parser.NALuParser.Schemes.Common @impl true def defaults(), do: [] @impl true def scheme(), do: [ field: {:video_parameter_set_id, :u4}, ...
07bc3809c77dccd4c356273fa4fac9347fe0267a
12,143
[ 176436777 ]
[]
%{ "base64url": {:hex, :base64url, "0.0.1", "36a90125f5948e3afd7be97662a1504b934dd5dac78451ca6e9abf85a10286be", [:rebar], [], "hexpm"}, "bcrypt_elixir": {:hex, :bcrypt_elixir, "1.1.1", "6b5560e47a02196ce5f0ab3f1d8265db79a23868c137e973b27afef928ed8006", [:make, :mix], [{:elixir_make, "~> 0.4", [hex: :elixir_make, re...
07bc59155a32277e6879a9316c26d4dae1d3d72d
2,252
[ 292015906 ]
[ "liveview", "macro", "documented", "phoenix" ]
defmodule Web do @moduledoc """ The entrypoint for defining your web interface, such as controllers, views, channels and so on. This can be used in your application as: use Web, :controller use Web, :view The definitions below will be executed for every view, controller, etc, so keep them sho...
07bc8f3636297f5045f6fb577afdfc83fbbc2b66
8,773
[ 934452177 ]
[ "liveview" ]
defmodule HedgehogWeb.CryptoWallet do use HedgehogWeb, :live_view alias Hedgehog.Streamer.Binance.Worker alias HedgehogWeb.CryptoEnum require Logger def render(assigns) do ~H""" <div class="flex w-full flex-col border-opacity-50 px-4 sm:px-6 lg:px-8 pb-4"> <.header class="text-center"> ...
07bc9241c1ff5fafa0ab2d49db52db131a03e0ab
2,158
[ 390166925 ]
[ "documented" ]
defmodule Web.Admin.ZoneController do @moduledoc """ Admin controller for managing game zones. Allows viewing, creating, and editing zones. """ use Web.AdminController alias Web.Router.Helpers, as: Routes alias Web.Zone plug(Web.Plug.FetchPage when action in [:index]) @doc """ Lists all zones wi...
07bd2939ef6a9bede478ff3968666a32409dbb80
2,246
[ 173108626 ]
[ "documented" ]
defmodule Cards do @moduledoc """ Provides methods for creating and handling a deck of playing cards """ @doc """ Returns a list of strings representing a deck of playing cards """ def create_deck do values = ["Ace", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Valet...
07bd62beec1a3ca2c7779296be90a16b6fa5939f
5,124
[ 498675807 ]
[ "macro" ]
defmodule AppCount.PropertiesFactory do use ExMachina.Ecto, repo: AppCount.Repo alias AppCount.Properties defmacro __using__(_opts) do quote do def property_factory do %Properties.Property{ name: "Test Property", code: sequence(:code, &"test-#{&1}"), address: %{ ...
07bd9e4f9a65e805cb224be7cd1757c616199954
2,276
[ 260986688 ]
[ "documented", "ecto" ]
defmodule LiveViewStudio.Vehicles do @moduledoc """ The Vehicles context. """ import Ecto.Query, warn: false alias LiveViewStudio.Repo alias LiveViewStudio.Vehicles.Vehicle @doc """ Returns the list of vehicles. ## Examples iex> list_vehicles() [%Vehicle{}, ...] """ def list_vehi...
07bdc4c17568fd3b711be7fc08666a8a5cd26057
2,780
[ 620840103 ]
[]
# credo:disable-for-this-file Credo.Check.Readability.Specs defmodule MixDependencySubmission.MixProject do use Mix.Project @version "1.2.1" @source_url "https://github.com/erlef/mix-dependency-submission" @description "Calculates dependencies for Mix and submits the list to the GitHub Dependency Submission AP...
07bdc4fefc8bfda9d2f734762bf850cb6f7e1a5a
5,171
[ 502263060 ]
[ "genserver", "liveview", "documented", "ecto" ]
defmodule GameOfLifeWeb.GameOfLifeLive do @moduledoc """ """ use Phoenix.LiveView alias Conway.Grid alias GameOfLifeWeb.PageView @topic "GOL" def mount(_params, _session, socket) do GameOfLifeWeb.Endpoint.subscribe(@topic) { :ok, assign( socket, display: "Board size...
07bdd8194d8945bbd03f7230c9f43489793cdd54
3,240
[ 74451514 ]
[ "typespec" ]
defmodule Matrex.Identifier do alias __MODULE__, as: This @valid_chars "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" |> String.codepoints() @id_length 18 @type user :: %This{ type: :user, localpart: String.t(), hostname: String.t() } @...
07bde530f92854f6d9819f26eebd65a11358b733
2,183
[ 80315814 ]
[ "genserver", "supervisor" ]
require IEx; defmodule ElixirLinter.Server do use GenServer def start_link(store_pid, "verbose") do repo_name = ElixirLinter.Store.get_repo(store_pid) {:ok, task_supervisor_pid} = Task.Supervisor.start_link() Agent.start_link(fn -> %{repo_name: repo_name, task_supervisor: task_supervisor_pid} end, name...
07be6410b1456db621faa59dd35b351631a30ca4
2,108
[ 264449938 ]
[ "phoenix" ]
defmodule LucumaWeb.Waitlists.AnalyticsController do use LucumaWeb, :controller plug :put_layout, :waitlist alias Lucuma.Repo alias Lucuma.Waitlists alias Lucuma.Waitlists.Analytics alias Lucuma.Waitlists.StandBy def index(conn, params) do %{"waitlist_id" => waitlist_id} = params waitlist = Wai...
07bedbb29aa4c85892bb639947e7d622384c039b
1,734
[ 193244709, 101434552, 198908023 ]
[ "typespec", "documented" ]
defmodule GoogleApi.DFAReporting.V33.Model.DeepLink do @moduledoc """ Contains information about a landing page deep link. ## Attributes * `appUrl` (*type:* `String.t`, *default:* `nil`) - The URL of the mobile app being linked to. * `fallbackUrl` (*type:* `String.t`, *default:* `nil`) - The fallback UR...
07bf2053ca1f15bf0e46dff7d54ebc4d57c53128
2,086
[ 638863870 ]
[ "test" ]
defmodule Bright.HistoricalSkillUnitsTest do use Bright.DataCase alias Bright.HistoricalSkillUnits # @current_tl ~D[2023-10-01] @back_tl_1 ~D[2023-07-01] describe "historical_skill_units" do test "list_historical_skill_units/0 returns all historical_skill_units" do historical_skill_unit = insert(...
07bf5f3dbeb1ff8cf2bf708311fc2f6f1f78c92f
3,762
[ 877242231 ]
[ "test", "documented", "ecto" ]
defmodule EMR.Medications.MedicationOrdersTest do use Postgres.DataCase alias EMR.Medications.MedicationOrders describe "medication_orders" do alias EMR.Medications.MedicationOrder import EMR.Medications.MedicationOrdersFixtures @invalid_attrs %{delivery_address: nil, delivery_status: nil, payment...
07bf6f19e63a4fd4ba5545f0325241ec00080366
2,463
[ 296295613 ]
[ "documented" ]
defmodule Moon.Design.Chip do @moduledoc false use Moon.StatelessComponent alias Moon.Design.Chip.Utils @doc "Id attribute for DOM element" prop(id, :string) @doc "Data-testid attribute for DOM element" prop(testid, :string) @doc "Active state" prop(is_active, :boolean, default: false) @doc "Show...
07bf9be00df833cd9c705b6f051094d5fab3e3e4
1,914
[ 270536048 ]
[]
# Import all plugins from `rel/plugins` # They can then be used by adding `plugin MyPlugin` to # either an environment, or release definition, where # `MyPlugin` is the name of the plugin module. ~w(rel plugins *.exs) |> Path.join() |> Path.wildcard() |> Enum.map(&Code.eval_file(&1)) use Distillery.Releases.Config, ...
07c0765f36dea828bd27358cbac15355f21096c3
1,862
[ 395080951 ]
[ "ecto" ]
defmodule GenioTest.Quote.Quote do alias GenioTest.Quote.Customer alias GenioTest.Quote.Customer.Direction alias GenioTest.Quote.Vehicle alias GenioTest.Quote.Customer.Vehicle, as: CustomerVehicle use Ecto.Schema import Ecto.Changeset schema "quote" do field :token, :string embeds_one :customer,...
07c07848b262622f7541dccd49dd130bb8ed8ae9
2,251
[ 742237046 ]
[ "liveview" ]
defmodule MyPersonalSpaceWeb.SqlDashboard do use Phoenix.LiveDashboard.PageBuilder alias Ecto.Adapters.SQL alias MyPersonalSpace.Repo require Logger @impl true def mount(_params, _session, socket) do {:ok, assign(socket, error: nil, result: nil, query: "")} end @impl true def menu_link(_sessio...
07c08fb03599afb9805da2460711dd941a5c311d
3,515
[ 944519630 ]
[ "liveview" ]
defmodule HelpdeskWeb.TicketLive.FormComponent do use HelpdeskWeb, :live_component @impl true def render(assigns) do ~H""" <div> <.header> {@title} <:subtitle>Use this form to manage ticket records in your database.</:subtitle> </.header> <.simple_form for={@for...
07c16b531a705ffb0be316e8cd661f84f159d103
1,856
[ 102109759 ]
[ "phoenix" ]
defmodule FantasyBbWeb.LeagueView do use FantasyBbWeb, :view alias FantasyBb.Core.Season import FantasyBb.Core.Utils.Map, only: [map: 2] def render("league.json", %{league: league}) do render("league.json", league) end def render("league.json", league) do get_team = fn team -> %{ i...
07c195a5de59b44be8d54ffe77002f86a2b1d132
2,162
[ 188709839 ]
[ "documented" ]
defmodule Xirsys.XTurn.Membrane.Source do @moduledoc """ """ use Membrane.Element.Base.Source require Logger @vsn "0" @stun_marker 0 alias XMediaLib.Stun alias Membrane.{Buffer, Event} alias Membrane.Element.File.CommonFile import Mockery.Macro ##################################################...
07c1c5955e91bb8fb2715ffead13a8601e8607f7
2,049
[ 81270515 ]
[]
defmodule Bench.ExSpirit.Parser do use ExSpirit.Parser, text: true # Throwing on error might indeed slow this down slightly, it is the proper # thing to do so it should be done. def parse_int_10(input) do %{error: nil} = parse(input, uint(10)) end def parse_datetime(input) do %{error: nil} = par...
07c1cf33e4c1ac512cbc35c1ef2cdb962a2a1d72
1,790
[ 346353219, 534288869 ]
[ "macro", "documented", "phoenix" ]
defmodule ExapiWeb do @moduledoc """ The entrypoint for defining your web interface, such as controllers, views, channels and so on. This can be used in your application as: use ExapiWeb, :controller use ExapiWeb, :view The definitions below will be executed for every view, controller, etc, s...
07c1fc745399bfee9c05638866c0777d9e1390a5
1,940
[ 319933787 ]
[ "genserver", "supervisor" ]
defmodule RoomRegistry do use GenServer def init(serverName) do refs = %{} rooms = :ets.new(serverName, [:named_table, {:read_concurrency , true}]) {:ok, {rooms, refs}} end def lookup(server, roomName) do case :ets.lookup(server, roomName) do [{^roomName, room}] -> {:ok , room} [] ...
07c218dc0187a2fea6a6abf96263732e9e7872b3
14,811
[ 104223581 ]
[]
defmodule IcdCode.ICDCode.Codes_V44 do alias IcdCode.ICDCode def _V440XXA do %ICDCode{full_code: "V440XXA", category_code: "V44", short_code: "0XXA", full_name: "Car driver injured in collision with heavy transport vehicle or bus in nontraffic accident, initial encounter", ...
07c23514f387867d344a1ebf8ec96bb91fdbe47f
6,507
[ 150423844 ]
[ "documented" ]
defmodule TestMatch.LPG do @moduledoc """ Module for reading and writing a library of LPG graphs and Cypher queries. The `read_graph/1` and `write_graph/2` functions allow for reading and writing RDF graphs to the project data repository. (Default file names are provided with the `read_graph/0` and `write_gr...
07c272a3aae4af66900f71fd26e7dbefb8cb89ef
3,016
[ 188946990 ]
[]
%{ "certifi": {:hex, :certifi, "2.5.1", "867ce347f7c7d78563450a18a6a28a8090331e77fa02380b4a21962a65d36ee5", [:rebar3], [{:parse_trans, "~>3.3", [hex: :parse_trans, repo: "hexpm", optional: false]}], "hexpm"}, "dialyxir": {:hex, :dialyxir, "1.0.0-rc.6", "78e97d9c0ff1b5521dd68041193891aebebce52fc3b93463c0a6806874557d...
07c292f61ed9fed1fbb22bc660dfb41030396b60
1,560
[ 832082385 ]
[]
defmodule OctoconDiscord.Components.HelpHandler.Pages.Faq.WhoCanSee do use OctoconDiscord.Components.HelpHandler.Pages def embeds do [ %Embed{ title: "#{Emojis.faq()} Who can see my alters/tags?", color: Utils.hex_to_int("#0FBEAA"), description: """ Unlike many alternative...
07c2981b336bca6476abe10b4005bfdea857fc2f
2,602
[ 681252658 ]
[ "liveview", "documented" ]
defmodule NappyWeb.Components.Admin.ThumbnailPickerComponent do use NappyWeb, :live_component alias Nappy.Catalog @moduledoc false @doc """ Thumbnail picker component, but admin can only use this. ## Examples <.live_component module={ThumbnailPickerComponent} id="thumbnail-picker" ...
07c2ebd52833c47576da9b0c8090e97a2e8337ad
1,920
[ 195703382 ]
[ "documented", "ecto" ]
if Code.ensure_loaded?(Ecto) do defmodule Mix.Tasks.Money.Gen.Postgres.SumFunction do use Mix.Task import Mix.Generator import Mix.Ecto, except: [migrations_path: 1] import Macro, only: [camelize: 1, underscore: 1] import Money.Migration @shortdoc "Generates a migration to create a sum funct...
07c3893096175628c36719c7629ce53a3779a22e
1,526
[ 26207230, 154566132, 330417237, 479375958, 640382415, 562988939, 304415363, 297242784, 133956900, 155882498, 130383276, 460772140, 591891388, 131081662, 178933140 ]
[ "test" ]
defmodule PlateSlateWeb.Schema.Subscription.NewOrderTest do use PlateSlateWeb.SubscriptionCase @subscription """ subscription { newOrder { customerNumber } } """ @mutation """ mutation ($input: PlaceOrderInput!) { placeOrder(input: $input) { order { id } } } """ @login """ mutat...
07c396c10d013e2f562d7553632517a12e409d43
12,619
[ 726026590 ]
[ "test" ]
defmodule Day2.CubeConundrumTest do use ExUnit.Case alias Day2.CubeConundrum describe "CubeConundrum" do test "initial test to part one and two" do expect_result_part_one = 8 expect_result_part_two = 2286 input = """ Game 1: 3 blue, 4 red; 1 red, 2 green, 6 blue; 2 green Game 2...
07c3dffa587f699f499f4b933f1c9773175c40e6
3,504
[ 10509114 ]
[]
defmodule Data.Set.Standard do alias Data.Protocol, as: P alias __MODULE__, as: T defstruct [:set] def new do %T{set: :sets.new} end def new(enum_or_set) do if :sets.is_set(enum_or_set) do %T{set: enum_or_set} else %T{set: Data.list(enum_or_set) |> :sets.from_list} end end ...
07c46c79097bf4553303795feeab1cfe7512ee0e
2,445
[ 927915678 ]
[]
defmodule Aoc2020.Problem09 do # ================== Start Part 1 ================== def combine(l) do for a <- l, b <- l, a != b, do: [a, b] |> Enum.sort() |> List.to_tuple() end def valid?(window, value) do window |> combine() |> Enum.any?(fn {a, b} -> a + b == value end) end defp first_i...
07c4b409213a80a1edf7e8f090df626209ae0451
1,718
[ 306009262 ]
[ "typespec", "documented" ]
defmodule GoogleApi.Dialogflow.V2.Model.GoogleCloudDialogflowV2BatchUpdateEntitiesRequest do @moduledoc """ The request message for EntityTypes.BatchUpdateEntities. ## Attributes * `entities` (*type:* `list(GoogleApi.Dialogflow.V2.Model.GoogleCloudDialogflowV2EntityTypeEntity.t)`, *default:* `nil`) - Requir...
07c4b4dc5506c47bbdb40a7dbb61f64b56d65193
2,938
[ 983589908 ]
[ "test" ]
defmodule Test.Stepvo.CommentTest do use Stepvo.DataCase, async: true # Alias your Ash API and resources for convenience alias Stepvo.Conversation alias Stepvo.Conversation.Comment # <-- Uncommented alias Stepvo.Conversation.User # <-- Uncommented alias Ash.Changeset # <-- Add alias for Changeset helper...
07c512c5bf211bc9fa329b8cee8948e72a7b81a2
5,545
[ 624096649 ]
[ "liveview", "documented" ]
defmodule Turnstile do @behaviour Turnstile.Behaviour @moduledoc """ Use Cloudflare Turnstile in Phoenix. Check out the [README](readme.html) to get started. """ import Phoenix.Component alias Phoenix.LiveView @script_url "https://challenges.cloudflare.com/turnstile/v0/api.js" @verify_url "https://ch...
07c553f71df11f088ce355b2bcabfd175d50748c
5,928
[ 163943690 ]
[ "test" ]
defmodule PbtGenerators do use ExUnit.Case use PropCheck property "find all keys in a map even when dupes are used", [:verbose] do forall kv <- list({key(), val()}) do m = Map.new(kv) for {k,_v} <- kv, do: Map.fetch!(m, k) uniques = kv |> List.keysort(0) |> Enum....
07c5635ff9429011765fe661675ab2873cdb5530
2,221
[ 742607520 ]
[ "test", "documented" ]
defmodule JobProcessing.JobsExecutionTest do @moduledoc false use ExUnit.Case, async: true alias JobProcessing.Jobs.Job alias JobProcessing.JobsExecution describe "new/1" do @valid_job %Job{ tasks: [ %Job.Task{name: "task-1", command: "touch /tmp/file1", requires: []}, %Job.Task{na...
07c566c767d45af5a429bbcc7ca3d5c17d52fa82
2,936
[ 618365198 ]
[]
defmodule AIPlayground.KinoUI do def text_to_text(title, text, model_runner) do build_ui_with_form_frame_separator(title, text, fn frame, %{text: text} -> Kino.Frame.render(frame, Kino.Markdown.new(model_runner.(text))) end) end def text_to_scored_list(title, text, model_runner) do build_ui_wit...
07c56833b20f926737d63eb497d19f0cc8995dab
3,947
[ 297086245 ]
[ "liveview", "test" ]
defmodule AgentoWeb.CountryLiveTest do use AgentoWeb.ConnCase import Phoenix.LiveViewTest alias Agento.Basedata.CountryContext @create_attrs %{alpha2: "some alpha2", alpha3: "some alpha3", name: "some name", numeric3: "some numeric3"} @update_attrs %{alpha2: "some updated alpha2", alpha3: "some updated alp...
07c573bbb16d62e8a75c3e740a6cd96b8a94557f
4,874
[ 639798101 ]
[ "test" ]
defmodule HikeMayFailTest do alias Hike.MayFail, as: MayFail use ExUnit.Case test "create an MayFail in success state" do r_eth = MayFail.success(4) assert r_eth == %Hike.MayFail{failure: nil, success: 4, is_success?: true} end test "create an MayFail in failure state" do l_eth = MayFail.failure...
07c61d9d9351e7b8e1b31793c0ca123a7f086b7a
1,738
[ 195744734 ]
[ "phoenix" ]
defmodule VocialWeb.PollController do use VocialWeb, :controller alias Vocial.Votes plug(VocialWeb.VerifyUserSession when action in [:new, :create]) require IEx def index(conn, _params) do polls = Votes.list_polls() render(conn, "index.html", polls: polls) end def new(conn, _params) do pol...
07c628e48e9a36d0ae98fbd2332a9eed3fc63b69
5,325
[ 814869922 ]
[ "typespec", "documented", "ecto" ]
defmodule Fhir.DetectedIssue do @moduledoc """ Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for a patient; e.g. Drug-drug interaction, Ineffective treatment frequency, Procedure-condition conflict, gaps in care, etc. """ use Ecto.Schema import...
07c6557393629aebab6b40853a83ff365bd8f616
8,769
[ 381533220 ]
[ "typespec", "documented" ]
# credo:disable-for-this-file defmodule Onnx.TensorShapeProto.Dimension do @moduledoc false defstruct value: nil, denotation: "" ( ( @spec encode(struct) :: {:ok, iodata} | {:error, any} def encode(msg) do try do {:ok, encode!(msg)} rescue e in [Protox.Encoding...
07c6912180716072e304f56b067e919cf771d243
2,257
[ 318945858 ]
[]
defmodule Pleroma.Web.ApiSpec.Admin.ChatOperation do alias OpenApiSpex.Operation alias Pleroma.Web.ApiSpec.Schemas.Chat alias Pleroma.Web.ApiSpec.Schemas.ChatMessage import Pleroma.Web.ApiSpec.Helpers def open_api_operation(action) do operation = String.to_existing_atom("#{action}_operation") apply(...
07c761dbdfea4b29c70170e94055cb633c7c9ddd
13,419
[ 645931572, 616640391 ]
[]
%{ "argon2_elixir": {:hex, :argon2_elixir, "2.4.1", "edb27bdd326bc738f3e4614eddc2f73507be6fedc9533c6bcc6f15bbac9c85cc", [:make, :mix], [{:comeonin, "~> 5.3", [hex: :comeonin, repo: "hexpm", optional: false]}, {:elixir_make, "~> 0.6", [hex: :elixir_make, repo: "hexpm", optional: false]}], "hexpm", "0e21f52a373739d00bd...
07c78cacc69ff3b8c475825492a978e0b4de14e9
11,182
[ 741301231 ]
[ "test", "ecto" ]
defmodule SkeemaTest.TestParentSchema do use Ecto.Schema schema "test_parent_schema" do has_many(:has_many, SkeemaTest.TestSchema) end end defmodule SkeemaTest.TestSchema do use Ecto.Schema schema "test_schema" do field(:plain, :string) field(:virtual, :string, virtual: true) embeds_many(:e...
07c7f8b55e10d2704f59c6b2c9718c549ccd77b6
2,182
[ 608305323 ]
[ "typespec" ]
defmodule Evaluate do @type literal() :: {:num, number()} | {:var, atom()} | {:q, number(), number()} @type expr() :: literal() | {:add, expr(), expr()} | {:sub, expr(), expr()} | {:mul, expr(), expr()} | {:div, expr(), expr()} # We use Elixirs own Map # Create new Map %{} # Add ke...
07c864fe7ec3d9a013a1e40ab3d9806b7264de80
2,372
[ 101862771 ]
[ "macro", "documented" ]
defmodule MockEbay do @defmodule """ For mocking eBay requests. using MockEbay mock_ok do HTTPoison.get("http://sandbox.api...") end """ alias HTTPoison.Response defmacro __using__(_) do quote do require Mock end end @doc """ Mock eBay successful requests ""...
07c874d078dc7fe8e7ae369048f3194614d79fc0
5,919
[ 728826451 ]
[ "documented" ]
defmodule Solver do @moduledoc """ https://adventofcode.com/2024/day/1 """ def count_valid([["X", "X", "X", "X"], ["M", "M", "M", "M"], ["A", "A", "A", "A"], ["S", "S", "S", "S"]]), do: 6 def count_valid([["S", "S", "S", "S"], ["A",...
07c8772f57d7cef26c5750de8282e985f2a70223
1,618
[ 186156059, 222462838 ]
[ "macro", "documented", "phoenix" ]
defmodule BloggyWeb do @moduledoc """ The entrypoint for defining your web interface, such as controllers, views, channels and so on. This can be used in your application as: use BloggyWeb, :controller use BloggyWeb, :view The definitions below will be executed for every view, controller, etc...
07c8bcec1a4e245c1b522cd62853130e4ff9c3a1
4,879
[ 428101112 ]
[ "macro", "typespec", "liveview" ]
if !Code.ensure_loaded?(Kino.SmartCell) do defmodule Evision.SmartCell.ML.TrainData do end else defmodule Evision.SmartCell.ML.TrainData do use Kino.JS, assets_path: "lib/assets" use Kino.JS.Live use Kino.SmartCell, name: "Evision: Train Data" alias Evision.SmartCell.Helper, as: ESCH @smartc...
07c8fcda3c4f70d6fe4d165dcd98c360647686f7
4,033
[ 286116474 ]
[ "test", "phoenix" ]
defmodule YicWeb.Html.Iam.AccountResetPasswordControllerTest do use YicWeb.ConnCase, async: true alias Yic.Iam alias Yic.Repo import Yic.IamFixtures setup do %{account: account_fixture()} end describe "GET /html/iam/accounts/reset_password" do test "renders the reset password page", %{conn: con...
07c8fe8b876bf765eada852037609915cc0b8d57
15,475
[ 73203940 ]
[ "phoenix" ]
defmodule UaArchaeology.FindController do use UaArchaeology.Web, :controller alias UaArchaeology.Find alias UaArchaeology.Condition alias UaArchaeology.ResearchLevel alias UaArchaeology.FindCondition alias UaArchaeology.FindResearchLevel alias UaArchaeology.ObjectType alias UaArchaeology.FindObjectType...
07ca417661724eb92b1859292320403d7554782d
3,603
[ 680569930 ]
[]
defmodule Parser do defmodule Node do defstruct name: nil, left: nil, right: nil def new(name, left, right) do %Node{name: name, left: left, right: right} end end defmodule NodeState do defstruct state: nil, operator: nil, left: nil, right: nil def new(state, operator, left, right) do...
07ca7733da3dfa5d034728430198aab9317c810b
2,882
[ 785177129 ]
[ "documented" ]
defmodule Mix.Tasks.UpdateCustomerIo do use Mix.Task require Logger import Ecto.Query, warn: false alias ChatApi.Repo @shortdoc "Updates user data in customer.io" @moduledoc """ This task syncs latest user data with customer.io """ def run(_args) do Application.ensure_all_started(:chat_api) ...
07cad070fac1e40e4b98059226eb52678ea31de1
5,116
[ 961658705 ]
[ "typespec", "documented" ]
defmodule Heaters.Videos.Operations.SceneDetection.StateManager do @moduledoc """ State management for the scene detection workflow. This module handles state transitions specific to the scene detection process. Scene detection creates virtual clips from preprocessed videos using the proxy file. ## State Fl...
07cbcc4268547edd586b8e961f43b6a4b7629d88
3,678
[ 206991481 ]
[]
%{ "amqp": {:hex, :amqp, "1.2.0", "d086308524fc296e09d12bdeb5e7a63f92fc51b7a3a40c08042efa6121fb483b", [:mix], [{:amqp_client, "~> 3.7.11", [hex: :amqp_client, repo: "hexpm", optional: false]}, {:goldrush, "~> 0.1.0", [hex: :goldrush, repo: "hexpm", optional: false]}, {:jsx, "~> 2.9", [hex: :jsx, repo: "hexpm", option...
07cc7249e62a6c9b58e3f470413e903f7776e7d1
1,578
[ 308992749 ]
[ "test", "phoenix" ]
defmodule DeconfinementWeb.BetControllerTest do use DeconfinementWeb.ConnCase test "GET /api/bets empty", %{conn: conn} do conn = get(conn, "/api/bets") assert json_response(conn, 200) == [] end test "GET /api/bets with one bet", %{conn: conn} do conn = post(conn, "/api/bets", %{"date" => "2020-12...
07cc81feca5e3ef4f53b870f448581eccb5d9f48
3,205
[ 606464826 ]
[]
%{ "castore": {:hex, :castore, "0.1.22", "4127549e411bedd012ca3a308dede574f43819fe9394254ca55ab4895abfa1a2", [:mix], [], "hexpm", "c17576df47eb5aa1ee40cc4134316a99f5cad3e215d5c77b8dd3cfef12a22cac"}, "finch": {:git, "https://github.com/namngh/finch.git", "300f4ba33a79cbf42f2e4f016651fdf3a1462b25", []}, "hpax": {:h...
07cc8a562ab0bf02e46b7b6e02f1aad7845e34a9
1,722
[ 373565719 ]
[ "macro" ]
defmodule QuizBuilders do defmacro __using__(_options) do quote do alias Mastery.Core.{Template, Response, Quiz} import QuizBuilders, only: :functions end end alias Mastery.Core.{Template, Quiz, Question} def template_fields(overrides \\ []) do Keyword.merge( [ name: :sin...
07cce02cb6a43ef59ee20e81d5f139f7ae7ac950
2,718
[ 937787549 ]
[ "liveview", "ecto" ]
defmodule GamificationWeb.PlayerAchievementLive.FormComponent do use GamificationWeb, :live_component alias Gamification.PlayersAchievements @impl true def render(assigns) do ~H""" <div> <.header> {@title} <:subtitle>Use this form to manage player_achievement records in your data...
07cd0428413a1a707c3170e0b32cbcc22cacc07e
6,185
[ 757989683 ]
[ "test" ]
defmodule Tabula.Mardown.ParserTest do use ExUnit.Case, async: true alias Tabula.Markdown.Parser @checked_checkbox { "input", [{"checked", ""}, {"disabled", ""}, {"type", "checkbox"}], [] } @unchecked_checkbox { "input", [{"disabled", ""}, {"type", "checkbox"}], [] } describe "...
07cd0f5bbc9b1750ed70d8251b16367f8df39a36
2,378
[ 449346660 ]
[ "typespec", "documented" ]
defmodule ComplexNumbers do @typedoc """ In this module, complex numbers are represented as a tuple-pair containing the real and imaginary parts. For example, the real number `1` is `{1, 0}`, the imaginary number `i` is `{0, 1}` and the complex number `4+3i` is `{4, 3}'. """ @type complex :: {float, float...
07cd2a3827009a2ae29cdb1ea2a1e470b14509ff
3,371
[ 163669711 ]
[ "test" ]
defmodule AC.Dec22Test do use ExUnit.Case alias AC.Dec22.Coord, as: Coord alias AC.Dec22.State, as: State # problem 1 test "example 1" do assert AC.Dec22.count_infecting_bursts("data/dec22_test_input.txt", 7) == 5 end test "example 2" do assert AC.Dec22.count_infecting_bursts("data/dec22_test_in...
07cd59e85e626218d2a749f0b0f281fa94344a4c
4,636
[ 71177105 ]
[ "documented" ]
defmodule ExSlackBot.Router do @moduledoc ~s""" `ExSlackBot.Router` is responsible for routing messages received from the Slack Real-Time Messaging API and routing them to a `GenServer` registered under a name that corresponds to the first segement of the command text--which is the text of the message, split on whi...
07cd6235586ec2feaa901ae109a29586e7d97d23
2,458
[ 250830492 ]
[ "documented" ]
defmodule Cards do @moduledoc """ provides methods for creating and handling a deck of cards. """ @doc """ returns a list of strings representing a deck of playing cards ## Example iex> deck = Cards.create_deck """ def create_deck do values = ["Ace", "Two", "Three", "...
07cd9a5ebe6ec87a6b4e7cfa20bda4c1026f125d
1,832
[ 130589196, 116997670 ]
[ "documented" ]
defmodule Guardian.Mixfile do @moduledoc false use Mix.Project @version "1.0.1" @url "https://github.com/ueberauth/guardian" @maintainers [ "Daniel Neighman", "Sonny Scroggin", "Sean Callan", ] def project do [ name: "Guardian", app: :guardian, version: @version, ...
07cdddb59374550910465d8151ce4f23cfa12ab4
5,069
[ 434418628 ]
[ "documented" ]
defmodule Aoc2021.Day1 do @moduledoc """ --- Day 1: Sonar Sweep --- You're minding your own business on a ship at sea when the overboard alarm goes off! You rush to see if you can help. Apparently, one of the Elves tripped and accidentally sent the sleigh keys flying into the ocean! Before you know i...
07ce06ad2f286cc7fb27a181874300f7265568fe
2,535
[ 488232232, 887743893 ]
[ "test" ]
defmodule Bumblebee.Diffusion.StableDiffusionTest do use ExUnit.Case, async: false import Bumblebee.TestHelpers @moduletag serving_test_tags() describe "text_to_image/6" do test "generates image for a text prompt" do # Since we don't assert on the result in this case, we use # a tiny random c...
07cef020663865fcee5d164c0b2a6e63dfd68ccb
2,760
[ 264018873 ]
[]
defmodule FastpassWeb.Schema.Tickets.TicketTypes do use Absinthe.Schema.Notation alias FastpassWeb.Resolvers enum :ticket_booking_from_enum do value :web value :app value :host end object :ticket do field :id, :id field :user, :user field :is_fastpass, :boole...
07cef70f89affbed1c1a36ebf63791901a354c55
2,170
[ 989957139 ]
[]
# This file is responsible for configuring your application # and its dependencies with the aid of the Config module. # # This configuration file is loaded before any dependency and # is restricted to this project. # General application configuration import Config config :geo_platonic, generators: [timestamp_type: ...
07cf705308af15327809ba91358ef78cb371561d
4,245
[ 783059668 ]
[]
defmodule Test1Web.Graphql.Schema do use Absinthe.Schema import_types(Absinthe.Type.Custom) import Test1Web.Graphql.Subscriptions.User.UserSubscription object :user do field :id, non_null(:id) field :name, non_null(:string) field :last_name, :string field :inserted_at, non_null(:naive_datetime)...
07cfaa54c3588b63ecdb4077d4b35bc1a208b2d5
5,009
[ 70364374 ]
[ "typespec", "documented" ]
defmodule Gateway.Web.Login do require Logger import Plug.Conn alias Plug.Conn alias Directory.User alias Gateway.Proxy.Handler require IEx def new_login(conn, options \\ []) do IO.puts "new_login, options: #{inspect options}" # IEx.pry case options[:error] do :no_user -> opt...
07cff3c4b518fe1c2e929341e2e7b877cfd5bb55
2,607
[ 451175745 ]
[ "test", "phoenix" ]
defmodule PoolWeb.TeamControllerTest do use PoolWeb.ConnCase import Pool.GamesFixtures @create_attrs %{logo: "some logo", name: "some name"} @update_attrs %{logo: "some updated logo", name: "some updated name"} @invalid_attrs %{logo: nil, name: nil} describe "index" do test "lists all teams", %{conn:...
07d059b6e0b3b37a808ffe8b5234596d11275b3d
3,469
[ 37175029, 41246370, 36728941 ]
[ "typespec", "documented" ]
defmodule Phoenix.Naming do @moduledoc """ Conveniences for inflecting and working with names in Phoenix. """ @doc """ Extracts the resource name from an alias. ## Examples iex> Phoenix.Naming.resource_name(MyApp.User) "user" iex> Phoenix.Naming.resource_name(MyApp.UserView, "View") ...
07d0664cabe868c1bebbb9fb633d17121d580988
1,546
[ 335932392 ]
[ "liveview", "ecto" ]
defmodule VisionWeb.MemberLive.FormComponent do use VisionWeb, :live_component alias Vision.Members @impl true def update(%{member: member} = assigns, socket) do changeset = Members.change_member(member) {:ok, socket |> assign(assigns) |> assign(:changeset, changeset)} end @impl t...
07d0dcc9e1b474417cfce5980614cf933fb3a1a6
1,713
[ 100741003 ]
[ "documented", "ecto" ]
defmodule Roster.Rostering do @moduledoc """ The Rostering context. """ import Ecto.Query, warn: false alias Roster.Repo alias Roster.Rostering.Shift @doc """ Returns the list of shifts. ## Examples iex> list_shifts() [%Shift{}, ...] """ def list_shifts do Repo.all(Shift) e...
07d113d81515975d09a2b954b2ceb0805114d3a9
3,860
[ 952201480 ]
[]
defmodule SciEx.Gen.RustFloatModule do defstruct prefix: nil, bits: nil, type: nil, name: nil, n_dims: 6, extra_imports: [], functions: [] alias SciEx.Gen.{RustParser, FloatVectorizer, Injector} require EEx @external_resourc...
07d127714356289ac737467f7ecc33c8ef60d82c
3,952
[ 1001447407 ]
[ "documented" ]
defmodule Presto.Factories do @moduledoc """ Test data factories for payroll and compliance rules engine testing. """ @doc """ Builds a time entry fact for payroll testing. """ def build_time_entry(id, start_datetime, finish_datetime, employee_id) do {:time_entry, id, %{ start_datetime: s...
07d1761281697dff5b2cdd40612b3f18fe1719d8
3,322
[ 500739519 ]
[ "genserver", "liveview" ]
defmodule InvermoreWeb.GameLiveView do use Phoenix.LiveView alias Invermore.Game def render(%{page: "error"} = assigns) do ~L"<div>Oops, something went wrong and we're unable to start the game.</div>" end def render(assigns) do Phoenix.View.render(InvermoreWeb.GameView, "show.html", assigns) end ...
07d1c0887a0c07dbb0e5b29103de460fa2ebd7ea
6,494
[ 48289193 ]
[]
%{ "certifi": {:hex, :certifi, "2.8.0", "d4fb0a6bb20b7c9c3643e22507e42f356ac090a1dcea9ab99e27e0376d695eba", [:rebar3], [], "hexpm", "6ac7efc1c6f8600b08d625292d4bbf584e14847ce1b6b5c44d983d273e1097ea"}, "earmark_parser": {:hex, :earmark_parser, "1.4.17", "6f3c7e94170377ba45241d394389e800fb15adc5de51d0a3cd52ae766aafd6...
07d202878e819c68e820e479eeb4d5397f72a655
2,994
[ 473697525, 677687005 ]
[ "typespec", "documented" ]
defmodule Tentacat.Milestones do import Tentacat alias Tentacat.Client @doc """ List milestones ## Example Tentacat.Milestones.list "elixir-lang", "elixir" Tentacat.Milestones.list "elixir-lang", "elixir", client More info at: https://developer.github.com/v3/issues/milestones/#list-milestone...
07d28e68cb0a7cef4664a77a47b9a7b424c0f0a0
1,596
[ 1018324668 ]
[ "liveview", "phoenix" ]
defmodule ExerciseWeb.Endpoint do use Phoenix.Endpoint, otp_app: :exercise # The session will be stored in the cookie and signed, # this means its contents can be read but not tampered with. # Set :encryption_salt if you would also like to encrypt it. @session_options [ store: :cookie, key: "_exercis...
07d2a52b8ee21f44e4ce6d357e01d66362ef4cd5
2,779
[ 153922468 ]
[ "documented" ]
defmodule VirtualJudge.WorkRouter do @doc """ Pattern matches the `source` url and finds the respective workers Returns the worker modules associated with it """ def route("https://www.codechef.com/" <> _path), do: do_valid_url(CodechefWorker) def route("http://codeforces.com/problemset/" <> _path)...
07d2ba95028d609040b111b3d4a968d137873ae2
8,100
[ 840004582 ]
[ "genserver", "documented" ]
defmodule Sync.Replication do use Postgrex.ReplicationConnection require Logger # TODO: Allow the publications to be passed as parameters def start_link(opts) do name = Keyword.get(opts, :name) if not is_atom(name) or name == nil do raise ArgumentError, "an atom :name is required when starting ...
07d3a9e7348f49c32c5d340f3b3ac6d0f09be3e4
9,121
[ 99838173 ]
[ "test", "ecto" ]
defmodule Ptr.AccountsTest do use Ptr.DataCase alias Ptr.Accounts describe "accounts" do alias Ptr.Accounts.Account @valid_attrs %{db_prefix: "db_prefix", name: "some name"} @update_attrs %{db_prefix: "updated_db_prefix", name: "some updated name"} @invalid_attrs %{db_prefix: "db prefix", na...
07d3c708d7073f7a953e67712d70c50c4c105130
1,892
[ 103934241, 108602536, 108919887, 355237992, 104196349, 111199290, 106092060 ]
[ "genserver" ]
defmodule Runner do use GenServer def koan?(koan) do Keyword.has_key?(koan.__info__(:exports), :all_koans) end def modules do {:ok, modules} = :application.get_key(:elixir_koans, :modules) modules |> Stream.map(&(&1.module_info |> get_in([:compile, :source]))) |> Stream.map(&to_string/1) ...
07d41099dc71103c22c3e021c50069ceed7aace1
4,172
[ 285339854 ]
[]
defmodule Advent.Day do def parse_input() do File.read!('./input1.txt') |> String.split(~r{\n\n}, trim: true) end def parse_board(board) do rows = board |> String.split("\n", trim: true) mboards = rows |> Enum.map(&(String.split(&1, " ", trim: true))) cols = mboards |> hd() ...
07d43f07eedd82be928dc1d74734951209dac9b4
2,163
[ 53879266, 53790650 ]
[ "genserver" ]
# Basically an always-up-to-date service registry of processes defmodule KV.Registry do use GenServer ## Client API # Starts a GenServer process linked to the current process. # http://elixir-lang.org/docs/stable/elixir/GenServer.html#start_link/3 def start_link(name) do GenServer.start_link(__MODULE__, ...
07d448ecaeb8aa21d519131f8a7c79480413df46
5,230
[ 277747871 ]
[ "typespec", "documented" ]
defmodule WeChat.Comment do @moduledoc """ 图文消息留言管理 [官方文档](https://developers.weixin.qq.com/doc/offiaccount/Comments_management/Image_Comments_Management_Interface.html){:target="_blank"} """ import Jason.Helpers @doc_link "https://developers.weixin.qq.com/doc/offiaccount/Comments_management/Image_Comment...
07d4742574bec4b3c8f449e48fd291af54ea6a9e
3,619
[ 304054970 ]
[ "documented" ]
defmodule Infin.Importer do @moduledoc """ The Importer context. """ import Ecto.Query, warn: false alias Infin.Companies.Company alias Infin.Invoices alias Infin.Repo require Logger def import_invoices_pt(nif, password, start_date, end_date, company_id) do sd = Date.from_iso8601!(start_date) ...
07d567550d403582a0f088dc15618bd26efc4ce8
1,644
[ 307213782 ]
[]
defmodule Perpetual.MixProject do use Mix.Project def project do [ app: :perpetual, version: "0.0.1", description: "A simple abstraction around repeatedly iterating state in Elixir.", package: package(), elixir: "~> 1.10", start_permanent: Mix.env() == :prod, deps: dep...
07d5690867510f207eed3337bc52b962034999ff
17,281
[ 907469638, 907480439, 907503107, 907677180, 907085814, 907658158, 907491439, 907671552, 907043965, 907665188 ]
[ "typespec", "documented" ]
defmodule Nock.Jets do @moduledoc """ Jets for the Nock interpreter, taking a gate core. Not fully general. """ import Noun import Bitwise alias Anoma.Crypto.Sign alias Anoma.TransparentResource.{Delta, Action} @spec calculate_mug_of_core(non_neg_integer(), non_neg_integer()) :: non_neg_inte...