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
07f1225d003c7f15ec4538370c1dc5b0ff864bd5
2,406
[ 185558207, 213229236, 1000104078, 589089007, 982054619, 589866492, 691980346, 882572863, 217320195, 174991383, 807904878, 215544723, 540729553, 887377354 ]
[ "test" ]
defmodule Pleroma.Web.ActivityPub.MRF.NormalizeMarkupTest do use Pleroma.DataCase, async: true alias Pleroma.Web.ActivityPub.MRF alias Pleroma.Web.ActivityPub.MRF.NormalizeMarkup @html_sample """ <b>this is in bold</b> <p>this is a paragraph</p> this is a linebreak<br /> this is a link with allowed "re...
07f169132b79604db14b481df3d291af8a241d12
7,036
[ 837204560 ]
[ "liveview", "test" ]
defmodule SimpleChatWeb.UserSettingsLiveTest do use SimpleChatWeb.ConnCase, async: true alias SimpleChat.Accounts import Phoenix.LiveViewTest import SimpleChat.AccountsFixtures describe "Settings page" do test "renders settings page", %{conn: conn} do {:ok, _lv, html} = conn |> log...
07f184513c582e0ecd5247977dc2475324e0739c
2,186
[ 176956466 ]
[ "ecto" ]
defmodule Bidtaites.Repo.Bids do use Ecto.Schema require Logger alias Bidtaites.Repo.Auctions @derive {Jason.Encoder, except: [:__meta__]} schema "bids" do field :auction_id, :string field :order_id, :string field :value, :integer field :paid, :integer field :email, :string field :s...
07f1d3ef29d06cb2107ca66c029d9748a0cafdda
1,903
[ 250904436, 670103538, 821769193, 875742128, 496761343, 538824568, 566770189, 642675403, 718072585, 416259673, 461084124, 499205750, 561314275, 718071371, 415908578, 677687005, 50263476, 739964336, 717420537, 858597638, 774405652, 496716021, 857708817 ]
[ "documented" ]
defmodule EarmarkParser.Ast.Renderer.AstWalker do @moduledoc false def walk(anything, fun, ignore_map_keys \\ false), do: _walk(anything, fun, ignore_map_keys, false) def walk_ast(ast, fun), do: _walk_ast(ast, fun, []) defp _walk(ast, fun, ignore_map_keys, child_of_map) defp _walk([], _fun, _ignore_map...
07f1d83dc4a7d40f0736e245c386a9bcc39e9488
3,000
[ 1009816364 ]
[ "test", "phoenix" ]
defmodule TelemedWeb.MedicalRecordControllerTest do use TelemedWeb.ConnCase import Telemed.MedicalRecordsFixtures @create_attrs %{description: "some description", nom: "some nom", age: 42} @update_attrs %{description: "some updated description", nom: "some updated nom", age: 43} @invalid_attrs %{description...
07f20765b6c47026fd3702ff2ce1c55d4e17c920
2,910
[ 441600743 ]
[ "genserver", "documented" ]
defmodule VidlyWeb.VideoChannel do use VidlyWeb, :channel alias Vidly.{Accounts, Multimedia} alias VidlyWeb.AnnotaionView # def join("videos:" <> video_id, _params, socket) do # {:ok, assign(socket, :video_id, String.to_integer(video_id))} ## :timer.send_interval(5_000, :ping) ## {:ok, socket} # end...
07f29d7635a24c1b83240c8a18293823ef534d0f
2,536
[ 438092711 ]
[ "typespec" ]
defmodule Patreon.API.V2.Resource.Campaign do @type t :: %__MODULE__{ created_at: DateTime.t, creation_name: String.t | nil, discord_server_id: String.t | nil, google_analytics_id: String.t | nil, has_rss: boolean, has_sent_rss_notify: boolean, image_small_url: String.t, image_url: St...
07f2b6a4e17502e7ece839f1aafa61adcf040929
2,759
[ 448948658, 459182862, 823294387, 642675403, 473697525, 529748378, 529761913, 584672709, 521332927, 514687923 ]
[ "documented" ]
defmodule Credo.Code.Name do @moduledoc """ This module provides helper functions to process names of functions, module attributes and modules. """ def last(name) when is_atom(name) do name |> to_string |> String.split(".") |> List.last() end def last(name) when is_binary(name) do na...
07f2c1b14e9500a81322815bff7981dc8e20cf0d
2,331
[ 367278931 ]
[ "documented" ]
defmodule Google.Cloud.Aiplatform.V1.Schema.Trainingjob.Definition.AutoMlImageClassificationInputs.ModelType do @moduledoc false use Protobuf, enum: true, protoc_gen_elixir_version: "0.14.1", syntax: :proto3 field :MODEL_TYPE_UNSPECIFIED, 0 field :CLOUD, 1 field :MOBILE_TF_LOW_LATENCY_1, 2 field :MOBILE_T...
07f2e9ae5c099b39cab915a20c92ffcfb5145787
1,667
[ 593391984 ]
[]
defmodule Poll20.Session do use Ash.Resource, data_layer: AshPostgres.DataLayer, extensions: [AshJsonApi.Resource], authorizers: [ Ash.Policy.Authorizer ] json_api do type "session" includes [ attendees: [ member: [] ], game: [] ] routes do bas...
07f393de4af03be9b0e7c70ff0f0851fda028ed3
5,973
[ 191423461 ]
[ "documented" ]
defmodule Meadow.AwsError, do: defexception([:message]) defmodule Meadow.Utils.AWS do @moduledoc """ Utility functions for AWS requests and object management """ alias Meadow.Config alias Meadow.Config.Secrets alias Meadow.Utils.AWS.MultipartCopy alias Meadow.Utils.Pairtree use Retry require Logger...
07f3c4c228a160171447529e5177d6e9f59e9d8b
2,125
[ 917407853 ]
[]
defmodule BeeminderWithingsSync.Withings.WithingsHTTPClient do @behaviour BeeminderWithingsSync.Withings.WithingsClient def oauth2_request_token(refresh_token, grant_type = "refresh_token") when is_binary(refresh_token) do body = %{ action: "requesttoken", client_id: Application.fet...
07f3dc8ec0a2744df98e6478e959f82ac8d48bc7
4,140
[ 256901890 ]
[]
defmodule DotSquare.State do alias DotSquare.Vertex defstruct vertices: [], players: %{A: nil, B: nil}, current_turn: :A, size: 5, points: %{A: 0, B: 0}, game_done: false, boxes: %{A: [], B: []} def new(size) do %__MODULE__{size: size} ...
07f4839f3975566b5ec524613fbf7e6d94609e2e
2,829
[ 217268444 ]
[ "test", "ecto" ]
defmodule PdscServer.SeguimientoTest do use PdscServer.DataCase alias PdscServer.Seguimiento describe "precioproducto" do alias PdscServer.Seguimiento.PrecioProducto @valid_attrs %{fecha: "some fecha", idproducto: 42, precio: 42} @update_attrs %{fecha: "some updated fecha", idproducto: 43, precio: ...
07f4ad4fb0f1228913ff77f6965dfaac83f316b8
2,342
[ 148493373 ]
[ "documented", "ecto" ]
defmodule JumubaseWeb.ErrorHelpers do @moduledoc """ Conveniences for translating and building error messages. """ use Phoenix.HTML import JumubaseWeb.IconHelpers alias Ecto.Changeset @doc """ Generates tag for inlined form input errors. The feedback_field value can be used to override which form el...
07f57b0d35eaae336ed6406b7542825066831abf
1,666
[ 929310139 ]
[ "documented" ]
defmodule Mix.Tasks.Designex.Setup do @moduledoc """ Invokes designex with the given args. Usage: $ mix designex TASK_OPTIONS PROFILE TAILWIND_ARGS Example: $ mix designex default --config=designex.config.js \ --input=css/app.css \ --output=../priv/static/assets/app.css \ ...
07f5e9114efa49e5988bfb8272534e7275ffe258
4,897
[ 786846015 ]
[ "phoenix", "documented" ]
defmodule ViolacorpWeb.Departments.DepartmentController do use ViolacorpWeb, :controller import Ecto.Query alias Violacorp.Repo alias Violacorp.Schemas.Departments alias Violacorp.Schemas.Employee alias ViolacorpWeb.Departments.DepartmentView @doc "inserts a department to Departments table" def insert...
07f6b07e0c6fb8700ff11c6ab0c5602b2e98e2a4
2,706
[ 897355290 ]
[ "test", "phoenix" ]
defmodule ProjectDeltaWeb.DespesaControllerTest do use ProjectDeltaWeb.ConnCase import ProjectDelta.FinanceFixtures @create_attrs %{data: ~D[2024-11-18], descricao: "some descricao", valor: "120.5", categoria: "some categoria"} @update_attrs %{data: ~D[2024-11-19], descricao: "some updated descricao", valor: ...
07f6eb02acfe409d041e4aff43d00f32db7fe9d3
23,069
[ 41227823, 41243642 ]
[ "macro", "documented", "ecto" ]
defmodule Ecto.Query do @moduledoc ~S""" Provides the Query DSL. Queries are used to retrieve and manipulate data in a repository (see `Ecto.Repo`). Although this module provides a complete API, supporting expressions like `where/3`, `select/3` and so forth, most of the times developers need to import only...
07f6f1d2751f9c37c123dcc1ea61307363e97995
3,059
[ 791868228 ]
[ "liveview" ]
defmodule Tracing.LiveviewTelemetry do require OpenTelemetry.Tracer alias __MODULE__ alias OpenTelemetry.Span @tracer_id LiveviewTelemetry @event_names [ [:phoenix, :live_view, :mount, :start], [:phoenix, :live_view, :mount, :stop], [:phoenix, :live_view, :mount, :exception], [:phoenix, :liv...
07f737ca9130f46906ba04a172ac3082b22c067c
12,869
[ 985822435 ]
[ "liveview" ]
defmodule FlashcardsWeb.PlayComponent do use Phoenix.LiveComponent require Ash.Query import Ash.Filter import Ash.Expr alias Flashcards.Flashcards.FlashcardGroup alias Flashcards.Flashcards.Flashcard @impl true def mount(socket) do socket = socket |> assign_new(:groups, fn -> [] end) ...
07f75955cf0ac76bdee195516d8fe017d4e1e206
2,555
[ 71784134 ]
[ "test" ]
defmodule Metrex.MeterTest do use ExUnit.Case, async: false import ExUnit.CaptureLog alias Metrex.Meter @metric "meter_test" @test_hooks Metrex.TestHooks @hooks Metrex.Hook.Default @ttl Application.get_env(:metrex, :ttl) setup do Application.put_env(:metrex, :hooks, @hooks) case Meter.start_li...
07f75ccc52d669775758b88f9b0bbf1ef7ef0c4b
4,519
[ 116413032 ]
[ "documented" ]
defmodule Mutation do def mutate(state=%Membrane{children: cs}) do case Enum.random(1..100) do x when x > 95 -> endocytosis(state) x when x > 90 -> exocytosis(state) x when x > 85 -> merge_children(state) x when x > 80 -> divide_self(state) x when x > 1 -> mutate_reaction(state) ...
07f809c04d80abb9ddbee892e85f2f55bc6ad098
2,652
[ 322345781 ]
[]
defmodule VideoTutorialsServices.EmailerComponent.Handlers.Commands do use Verity.Messaging.Handler alias VideoTutorialsServices.EmailerComponent.Messages.Commands.Send alias VideoTutorialsServices.EmailerComponent.Messages.Events.Failed alias VideoTutorialsServices.EmailerComponent.Messages.Events.Sent alia...
07f8fdf92058e9e06ac025483491c4819f40a27e
4,940
[ 506805193 ]
[]
# **************************************************************************************************** # Resolve instructions between the session database and GraphQL # **************************************************************************************************** defmodule LabbookingsWeb.SessionResolver do alia...
07f90013e8de1b0b0c9255dd235e3ea2a6de6604
3,564
[ 366630792 ]
[ "test", "phoenix" ]
defmodule TransactionsMonoWeb.TransactionsControllerTest do use TransactionsMonoWeb.ConnCase setup :register_and_log_in_user @create_attrs %{ amount: 120.5, date_transaction: ~N[2010-04-17 14:00:00], description: "some description", user_from_id: 42, user_to_id: 43 } @update_attrs %{ ...
07f9791e3871cd7ee1f6fb896722d09300a46d08
3,351
[ 519690576 ]
[ "typespec", "documented" ]
defmodule Cordial do @moduledoc """ Documentation for `Cordial`. """ @path Path.join(Mix.Project.build_path(), "cordial") @module_types ~S""" The following types are available: - `:service`, a service definition. Useable as behaviour. - `:message`, a message definition. Useable as struct. - `:...
07f9ba20ece8604c08de34f3e865f1cad2fd96fc
3,743
[ 239296084 ]
[ "genserver", "typespec", "supervisor", "documented" ]
defmodule NightGame.Game do @moduledoc """ The game state. """ use GenServer alias NightGame.{ Hero, World } @typedoc "Direction to move on the map" @type direction :: :left | :right | :up | :down @new_game %{heroes: %{}} @spec start_link(list) :: :ignore | {:error, any} | {:ok, pid} ...
07fa486c5e8ae77ba56f405aca30657584dcee7a
2,431
[ 235887957 ]
[ "documented" ]
defmodule Mix.Tasks.Entrance.Gen.PhxModules do @shortdoc "Creates phoenix modules for authentication with entrance (session_controller, user_controller, views and plugs/require_login" @moduledoc """ Creates phoenix modules for authentication with entrance (session_controller, user_controller and plugs/require_lo...
07fa909262e4367016c2d982bdf6da65cca92b16
2,257
[ 775705031 ]
[ "phoenix" ]
defmodule MangaDexWeb.UserAuth.UserSettingsController do use MangaDexWeb, :controller alias MangaDex.Accounts alias MangaDexWeb.UserAuth.UserAuth plug :assign_email_and_password_changesets def edit(conn, _params) do render(conn, :edit) end def update(conn, %{"action" => "update_email"} = params) d...
07fa9c22b71b0b5f3e3d5b15481a430b3283b25a
14,965
[ 478940992 ]
[]
%{ "castore": {:hex, :castore, "0.1.15", "dbb300827d5a3ec48f396ca0b77ad47058578927e9ebe792abd99fcbc3324326", [:mix], [], "hexpm", "c69379b907673c7e6eb229f09a0a09b60bb27cfb9625bcb82ea4c04ba82a8442"}, "certifi": {:hex, :certifi, "2.9.0", "6f2a475689dd47f19fb74334859d460a2dc4e3252a3324bd2111b8f0429e7e21", [:rebar3], [...
07fa9f8de181aaf3c39851346413cbff39aec021
8,057
[ 613459518 ]
[ "typespec", "test", "documented" ]
defmodule Livebook.Runtime.Evaluator.Doctests do @moduledoc false @test_timeout 5_000 @line_width 80 @pad_size 3 @doc """ Runs doctests in the given modules. """ @spec run(list(module())) :: :ok def run(modules) def run([]), do: :ok def run(modules) do case define_test_module(modules) do ...
07faad10cc587ea6ae129c9a9bbd08bb6a18847a
1,670
[ 637228529 ]
[]
defmodule ExMonWeb.TrainerPokemonsJSON do alias ExMon.Trainer.Pokemon def render("create.json", %{ pokemon: %Pokemon{ id: id, name: name, nickname: nickname, weight: weight, types: types, trainer_id: trainer_id, inserted_at: inserted_at ...
07fad8c8a2fdfe4ae52d85efc75b6a1c77e7012e
4,983
[ 106350174 ]
[ "test" ]
defmodule HandlerTest do use ExUnit.Case doctest Servy.Handler import Servy.Handler, only: [handle: 1] test "GET /wildthings" do request = """ GET /wildthings HTTP/1.1\r Host: example.com\r User-Agent: ExampleBrowser/1.0\r Accept: */*\r \r """ response = handle(request) a...
07fb72a58d9f618a349d651767dd1808900fed42
2,140
[ 526980859 ]
[ "test" ]
defmodule RockeliveryWeb.UserControllerTest do use RockeliveryWeb.ConnCase, async: true import Rockelivery.Factory import Mox alias Rockelivery.ViaCep.ClientMock alias RockeliveryWeb.Auth.Guardian describe "create/2" do test "When all parameters are correct, then create the user", %{conn: conn} do ...
07fba5823872e1042d4b19384f5103c74fcb9bf3
2,641
[ 193626854 ]
[ "test", "ecto" ]
defmodule Appp.AccountsTest do use Appp.DataCase alias Appp.Accounts describe "users" do alias Appp.Accounts.User @valid_attrs %{age: 42, email: "some email", password_hash_one: "some password_hash_one", password_hash_two: "some password_hash_two", username: "some username"} @update_attrs %{age: 43...
07fbabb3728eb20292c3fc2d8516e0a9a79fb0f0
1,880
[ 120574484 ]
[ "documented" ]
defmodule ElasticFlow.Distribution.Servers do @moduledoc false @doc """ Returns the process name that is given by default to supervised senders. If called with no argument, gives the name of the current server's sender. ## Examples iex> DistributionServers.get_sender_name_for_server("yam1@computer-n...
07fc023e71c67aa31a4b11c9013db584973920db
1,537
[ 76958397 ]
[ "test" ]
defmodule Microscope.OptionsTest do use ExUnit.Case, async: true import Microscope.Options setup do uniq = Base.url_encode64(:crypto.strong_rand_bytes(6)) tmp_dir = Path.expand("microscope_test_" <> uniq, System.tmp_dir!()) File.mkdir_p!(tmp_dir) on_exit(fn -> File.rm_rf!(tmp_dir) end) {:ok...
07fc034d787d1d4695cc4feae80dabcec926195c
17,410
[ 725950855 ]
[ "documented", "ecto" ]
defmodule Signbank.Dictionary.Phonology do @moduledoc """ The phonology of a sign, actually stored as JSON in the database """ use Ecto.Schema use Gettext, backend: Signbank.Gettext import Ecto.Changeset # TODO: check when I swapped keys and values here, it broke edit inputs @palm_orientations [ to...
07fc0e2ff66841422c0c6956bedaa2a8a753e060
1,761
[ 252759679 ]
[ "documented", "ecto" ]
defmodule FinancialOperationsElixir.Payers do @moduledoc """ The Payers context. """ import Ecto.Query, warn: false alias FinancialOperationsElixir.Repo alias FinancialOperationsElixir.Payers.Payer @doc """ Returns the list of payers. ## Examples iex> list_payers() [%Payer{}, ...] ...
07fc3f758d0a801323d19558c74fd0e3f5c8db7d
13,963
[ 60931338 ]
[ "test" ]
defmodule ExpugCompilerTest do use ExUnit.Case import Expug.Tokenizer, only: [tokenize: 1] import Expug.Compiler, only: [compile: 1] doctest Expug.Compiler test "doctype only" do tokens = tokenize("doctype html5") ast = compile(tokens) assert %{ doctype: %{ type: :doctype, ...
07fcb051a0584539eeeeaa17ce692c3c905a38e6
1,777
[ 285648344 ]
[ "phoenix" ]
defmodule BirdcageWeb.Router do use BirdcageWeb, :router pipeline :browser do plug :accepts, ["html"] plug :fetch_session plug :fetch_live_flash plug :put_root_layout, {BirdcageWeb.LayoutView, :root} plug :protect_from_forgery plug :put_secure_browser_headers end pipeline :api do p...
07fce2d4a60c2f2c86e16f1be27b0498bbac2792
1,911
[ 221886131 ]
[ "test" ]
defmodule ReverseXpathTest do use ExUnit.Case doctest ReverseXpath describe "Reverse xpath tests" do test "Maps without internal lists" do merge = ReverseXpath.xpath_list_to_map([ %{ value: "Description 1", xpath: "//values/description/description_long/data/text()" ...
07fceb0ae2900685591ad2583601d5a54f5bd7eb
4,375
[ 123179065 ]
[ "test" ]
defmodule GeneratorTest do use ExUnit.Case @period_time 1000 setup do Code.require_file("test/sequence_generator/generator_logic.ex") end test "exmachina_generator" do transitions = [Transition.new() |> Map.put(:current_state, :s1) |...
07fcfdde89384f2a98e5be1f310a0307fd8425b5
5,645
[ 421556700 ]
[]
%{ "benchee": {:hex, :benchee, "1.3.1", "c786e6a76321121a44229dde3988fc772bca73ea75170a73fd5f4ddf1af95ccf", [:mix], [{:deep_merge, "~> 1.0", [hex: :deep_merge, repo: "hexpm", optional: false]}, {:statistex, "~> 1.0", [hex: :statistex, repo: "hexpm", optional: false]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm",...
07fd42affe4589fb58a8d65e35112a6fe6ffb61e
6,913
[ 615399078 ]
[]
defmodule RedPetri do defstruct preset: [nil], valor: nil, postset: [nil] def transiciones, do: [:A, :B, :C, :D, :E] #Definición de la red de petri Ejercicio 1 def ord1 do [ [:P0, :A], [:A, :P1], [:A, :P2], [:P1, :B], [:P1, :D], [:P2, :C], [:P2, :D], [:B, :P...
07fd522509f852703101e4f8ff80c705333fa5e5
2,866
[ 1012246704 ]
[]
import Config # Configure your database config :school_registration, SchoolRegistration.Repo, username: "postgres", password: "120080", hostname: "localhost", database: "school_registration_dev", stacktrace: true, show_sensitive_data_on_connection_error: true, pool_size: 10 # For development, we disable...
07fe8e21f1008a31ce01cadb77b6feefab7571ae
1,667
[ 249526628 ]
[ "macro", "documented", "phoenix" ]
defmodule OctoEventsWeb 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 OctoEventsWeb, :controller use OctoEventsWeb, :view The definitions below will be executed for every view, con...
07fe93ccf9a50dc8e46038512531d1d6602f974e
2,841
[ 193244709, 101434552, 198908023 ]
[ "typespec", "documented" ]
defmodule GoogleApi.NetworkConnectivity.V1.Model.Group do @moduledoc """ A group represents a subset of spokes attached to a hub. ## Attributes * `autoAccept` (*type:* `GoogleApi.NetworkConnectivity.V1.Model.AutoAccept.t`, *default:* `nil`) - Optional. The auto-accept setting for this group. * `createTi...
07fe95725e9bf2f6d90fe6d6ce1176d012a4186c
6,102
[ 785112910 ]
[ "phoenix" ]
defmodule PointPulseWeb.UserWeekPoint.InsertPlanPointController do use PointPulseWeb, :controller alias PointPulse.UserWeekPoints alias PointPulse.Projects alias PointPulse.UserWeekPoints.UserWeekPoint alias PointPulse.ProjectUsers alias PointPulse.Utils.CalculateDate action_fallback(PointPulseWeb.Fallba...
07feb9754bb0caf4679dc95dd3aabc136e4912e2
1,978
[ 186965552 ]
[ "test" ]
defmodule StackoverflowCloneE.Controller.Book.UpdateTest do use StackoverflowCloneE.CommonCase alias Sazabi.G2gClient alias StackoverflowCloneE.TestData.BookData @api_prefix "/v1/book/book_id" @header %{} @body %{"title" => "new title"} test "update/1 " <> "should update book" do :meck...
07ff2bfa42767253d7cf4250c388ce52ff668c84
5,815
[ 877242231 ]
[ "test", "phoenix" ]
defmodule Web.Api.Specialists.InsuranceProvidersControllerTest do use Web.ConnCase, async: true alias Proto.SpecialistProfileV2.GetInsuranceProvidersV2 alias Proto.SpecialistProfileV2.InsuranceProvidersEntryV2 alias Proto.SpecialistProfileV2.MatchingInsuranceProviderV2 describe "GET show" do setup [:aut...
07ff32735d6a98f6501b21b58f62f0e3ee787100
8,207
[ 316213521, 125919835, 316206423 ]
[ "test" ]
defmodule SPARQL.Algebra.GroupGraphPatternTest do use SPARQL.Test.Case import SPARQL.Language.Decoder, only: [decode: 1] test "a filter splitting a bgp into a group" do query = """ SELECT ?s WHERE { ?s ?p ?o FILTER(?o = 1) ?s2 ?p2 ?o2 } """ n1 = XSD.intege...
07ff6d7aa3b22b38def78728fe9918c05ee1cc49
1,927
[ 49213412 ]
[ "phoenix" ]
defmodule MyApp.ArtistController do use MyApp.Web, :controller alias MyApp.Artist plug :scrub_params, "artist" when action in [:create, :update] def index_html(conn, _params) do render conn, "index.html" end def index(conn, params) do paginator = Artist |> Artist.filtered(params["name"]) ...
08001fc66a958cfedc85d3fedad08efd093178e3
1,639
[ 128827147, 127691377 ]
[ "macro", "documented", "phoenix" ]
defmodule PubSubDemoWeb 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 PubSubDemoWeb, :controller use PubSubDemoWeb, :view The definitions below will be executed for every view, con...
08003ecdd3b8b7c3a6c39f25a7a156b4eb441aae
1,844
[ 15050539 ]
[ "macro", "documented" ]
defmodule Pipe do @moduledoc """ def inc(x), do: x + 1 def double(x), do: x * 2 1 |> inc |> double """ defmacro __using__(_) do quote do import Pipe end end # pipe_matching { :ok, _ }, x, # ensure_protocol(protocol) # |> change_debug_info(types) # |> compile ...
0800423cb407cd2a815f0f8d345c4353dade5d5c
6,189
[ 87683657, 297237670, 70405590, 72784914, 73516692, 242077992, 95606261, 72776924, 68513550, 68666668, 67624953 ]
[ "typespec" ]
defmodule Postgrex.Stream do defstruct [:conn, :options, :params, :portal, :query, :ref, state: :bind, num_rows: 0, max_rows: 500] @type t :: %Postgrex.Stream{} end defmodule Postgrex.CopyData do defstruct [:query, :params, :ref] end defimpl Enumerable, for: Postgrex.Stream do def reduce(stream, acc, fun) do ...
0800469699f45b3b65395ad0f5cd6b702fc176eb
11,534
[ 993445037 ]
[ "test" ]
defmodule SNMPSimEx.ErrorInjectorTest do use ExUnit.Case, async: false alias SNMPSimEx.{ErrorInjector} alias SNMPSimEx.Device alias SNMPSimEx.MIB.SharedProfiles alias SNMPSimEx.{LazyDevicePool} alias SNMPSimEx.TestHelpers.PortHelper setup do # Start shared profiles for testing only if not alread...
0800c660787f2de2f313ace8b5768bef90d27f2e
1,603
[ 902639102 ]
[ "phoenix" ]
defmodule ElixsteoAppWeb.Router do use ElixsteoAppWeb, :router pipeline :browser do plug :accepts, ["html"] plug :fetch_session plug :fetch_live_flash plug :put_root_layout, html: {ElixsteoAppWeb.Layouts, :root} plug :protect_from_forgery plug :put_secure_browser_headers end pipeline :...
080117c5286a2fe15e0a103d167e3c8628516eac
2,292
[ 942811655, 920024200 ]
[ "documented" ]
# credo:disable-for-this-file defmodule Rbac.Okta.Scim.Provisioner.UpdateUser do @moduledoc """ Procedure for updating a Semaphore user based on the received okta user payload. The assumed state of the system: - We have an okta_user record in the database - The okta_user.state is :pending - The okta_user...
08019b90ac5437426212f83d5b546194c077b060
6,436
[ 495137583 ]
[ "typespec", "documented" ]
# credo:disable-for-this-file defmodule Speechly.Slu.V1.RoundTripMeasurementRequest do @moduledoc false defstruct id: 0, __uf__: [] ( ( @spec encode(struct) :: {:ok, iodata} | {:error, any} def encode(msg) do try do {:ok, encode!(msg)} rescue e in [Protox.Encod...
0802bd0cb1aacc4e0592c514d00c5ca281cea60b
9,229
[ 163761205 ]
[ "test" ]
defmodule Dolphin.Update.TwitterTest do use ExUnit.Case, async: true doctest Dolphin.Update.Twitter alias Dolphin.{Update, Update.Twitter} import TestUtils @credentials Application.get_env(:dolphin, :twitter_credentials) @username @credentials[:username] setup do FakeTwitter.start_link() :ok e...
0802d128ffec39f3c0d9d53d36efb0294c95d683
3,564
[ 932819653 ]
[]
defmodule Trays.MixProject do use Mix.Project def project do [ app: :trays, version: "0.1.0", elixir: "~> 1.18", elixirc_paths: elixirc_paths(Mix.env()), start_permanent: Mix.env() == :prod, aliases: aliases(), deps: deps(), test_coverage: test_coverage() ] ...
080398a9da156760dc9451fce357ce4de194a367
5,192
[ 883125186 ]
[ "liveview" ]
defmodule SlaxWeb.ChatRoomLive.Index do use SlaxWeb, :live_view alias Slax.Chat def render(assigns) do ~H""" <main class="flex-1 p-6 max-w-4xl mx-auto"> <div class="flex justify-between mb-4 items-center"> <h1 class="text-xl font-semibold"><%= @page_title %></h1> <button ...
0803d80cfef4274b0537716446124045e9fac3e7
2,409
[ 464246497 ]
[ "genserver" ]
defmodule Circuit2b.Trumpet do use GenServer require Logger alias Circuits.GPIO @default_volume 500_000 # 50% def start_link(_) do GenServer.start_link(__MODULE__, %{}) end # --- Callbacks --- @impl true def init(_) do # Initialize GPIOs gpios = Enum.map(buttons(), fn {gpio, _colour} ...
0804186940d50a7aaf0b4aa23f56bbcf769ebfc4
1,606
[ 266969642 ]
[ "typespec", "test" ]
defmodule Domo.InteractiveTypeRegistrationTest do use Domo.FileCase, async: false use Placebo alias Domo.CodeEvaluation alias Domo.TypeEnsurerFactory @moduletag in_mix_compile?: false setup tags do allow CodeEvaluation.in_mix_compile?(), meck_options: [:passthrough], return: tags.in_mix_compile? ...
0804460308be79507afb487e8036b0a5a623b588
1,901
[ 596232726 ]
[ "test", "documented" ]
defmodule FoodTruckFinder.FoodTrucksTest do @moduledoc """ Tests specifically for FoodTruckFinder.FoodTrucks functions. ``` mix test test/food_truck_finder/food_trucks/food_trucks.exs --listen-on-stdin ``` At a minimum, a single test to cover all existing functions in the module. """ use FoodTruckFin...
08045e8ab17cc36e370d34c9fa6acb11b0d3678c
1,575
[ 64661630 ]
[ "test" ]
defmodule StreetPlanTest do use ExUnit.Case doctest StreetPlan test "Input street is invalid if empty" do refute StreetPlan.is_valid?("") end test "Input street is invalid if contains letters" do refute StreetPlan.is_valid?("1 2 4 6 7a 8") end test "Input street is invalid if contains duplicate...
080464020473e4daeaf73f7572f6aac65cee7ebd
1,867
[ 193244709, 101434552, 198908023 ]
[ "typespec", "documented" ]
defmodule GoogleApi.Integrations.V1alpha.Model.EnterpriseCrmFrontendsEventbusProtoParameterEntry do @moduledoc """ Key-value pair of EventBus parameters. ## Attributes * `dataType` (*type:* `String.t`, *default:* `nil`) - Explicitly getting the type of the parameter. * `key` (*type:* `String.t`, *defaul...
08051fe36b4f83ceba6fa07caba7ada1cab148e9
3,985
[ 236377304 ]
[ "test", "documented", "ecto" ]
defmodule Widgets.OrdersTest do @moduledoc """ Testing the Orders context """ use Widgets.DataCase alias Widgets.Orders describe "widgets" do alias Widgets.Orders.Widget @valid_attrs %{ color: "RED", date: ~D[2021-12-25], quantity: 4, type: "WIDGET", status: "PENDING...
080557f45bab8628cc90d6bce469928bc7948ec0
12,175
[ 797509324 ]
[]
%{ "bunt": {:hex, :bunt, "1.0.0", "081c2c665f086849e6d57900292b3a161727ab40431219529f13c4ddcf3e7a44", [:mix], [], "hexpm", "dc5f86aa08a5f6fa6b8096f0735c4e76d54ae5c9fa2c143e5a1fc7c1cd9bb6b5"}, "bypass": {:hex, :bypass, "2.1.0", "909782781bf8e20ee86a9cabde36b259d44af8b9f38756173e8f5e2e1fabb9b1", [:mix], [{:plug, "~> ...
080594cf87e851a7146748aee40581baafc585d4
2,271
[ 757221151 ]
[ "typespec", "documented" ]
defmodule Lamina.Server.ConfigModule do alias Lamina.Error.{InvalidValueError, NotALaminaModuleError} @moduledoc "Wrapper around access to a Lamina configuration module" @doc """ Ensure that the module in question actually implements the Lamina behaviour. """ @spec assert_lamina_module(module) :: {:ok, mod...
0805b09ac0d4b9ac024d085691c5f8303b6c78d0
6,323
[ 102690596 ]
[ "documented" ]
defmodule Mcp.Mixfile do @license """ Master Control Program Copyright (C) 2017 Tim Hughey (thughey) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either versi...
0805b1597336fcc8f1c988b072971f8c49345884
3,510
[ 391196627 ]
[ "typespec" ]
defmodule Day8 do @x_range 0..49 @max_x 50 @y_range 0..5 @max_y 6 @type state :: map @spec main() :: :ok def main do with input <- parse_input(), final_state <- Enum.reduce(input, make_state(), &run_command/2) do IO.puts([ "**********************\nADVENT OF CODE - DAY 8\n*****...
0806d1532a4fa68d053d5658ccc8374d9f2fc8ea
5,272
[ 130748338 ]
[ "typespec", "documented" ]
defmodule Pleroma.Web.Push.Impl do @moduledoc "The module represents implementation push web notification" alias Pleroma.Activity alias Pleroma.Notification alias Pleroma.Object alias Pleroma.Repo alias Pleroma.User alias Pleroma.Web.Metadata.Utils alias Pleroma.Web.Push.Subscription require Logger ...
080712377189f0b45f396e46052e73a5a8a3b69d
4,904
[ 287626345 ]
[ "test" ]
defmodule Mobius.Actions.ChannelTest do use ExUnit.Case import Mobius.Fixtures import Mobius.Generators import Mobius.TestUtils import Tesla.Mock, only: [mock: 1] alias Mobius.Actions.Channel alias Mobius.Models alias Mobius.Rest.Client setup :reset_services setup :create_rest_client setup :stu...
080764c0ea58a8ace7357289cfc7fcd92baf7ba5
1,963
[ 716270591 ]
[ "typespec" ]
defmodule Tutorials.Structs.Expense do alias Tutorials.Structs.Expense defstruct( name: "", date: nil, amount: 0, store: "" ) @type t :: %Expense{ name: String.t(), date: Date.t() | nil, amount: number(), store: String.t() } @spec sample() :: ...
0807841332ec0a21a60e22d1a6404baecea6997a
3,043
[ 19828743 ]
[]
defmodule HaveAPI.Client.Request do alias HaveAPI.Client @enforce_keys [:conn] defstruct [:conn, :path, :headers, :query_params, :body] @path_param_rx ~r{:[^/]+} def new(conn) do %__MODULE__{ conn: conn, path: conn.action_desc["url"], headers: [], query_params: [], body: %...
08087eb7f9734d198719b526f65d004886e1a437
1,732
[ 104344431 ]
[ "macro", "documented", "ecto", "phoenix" ]
defmodule TryPhoenix.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 TryPhoenix.Web, :controller use TryPhoenix.Web, :view The definitions below will be executed for every view, ...
080914bf4d79fbf00a7726fa765e216db4edcb43
2,071
[ 48284691 ]
[ "macro", "supervisor", "documented" ]
defmodule Eeb do def version, do: unquote(Mix.Project.config[:version]) def elixir_version, do: unquote(System.version) @moduledoc """ the application module, main. """ use Application def start( _type, _args ) do import Supervisor.Spec, warn: false children = [ worker(__MODULE__, [], ...
08095fa99c331c93616116f2ac2480df6649970d
3,477
[ 47486383 ]
[ "documented" ]
defmodule Mix.Shell do @moduledoc """ Defines `Mix.Shell` contract. """ @doc """ Informs the given message. """ @callback info(message :: IO.ANSI.ansidata) :: any @doc """ Warns about the given error message. """ @callback error(message :: IO.ANSI.ansidata) :: any @doc """ Prompts the user ...
080976d9e8183c295bdd405e1c31d752ba8823e9
8,213
[ 898604430, 707779948, 609782894, 806822991 ]
[ "typespec", "documented" ]
defmodule CSV.Decoding.Decoder do use CSV.Defaults @moduledoc ~S""" The Decoder CSV module sends lines of delimited values from a stream to the parser and converts rows coming from the CSV parser module to a consumable stream. """ alias CSV.Decoding.Parser alias CSV.RowLengthError @doc """ Decode ...
08098cfb9d1717cb8bf2ebd5e2f8d5f0edaf7dd8
4,412
[ 406355159 ]
[ "typespec" ]
defmodule ExComponentSchema.Schema.Draft6 do @schema %{ "$schema" => "http://json-schema.org/draft-06/schema#", "$id" => "http://json-schema.org/draft-06/schema#", "title" => "Core schema meta-schema", "definitions" => %{ "schemaArray" => %{ "type" => "array", "minItems" => 1, ...
0809a27678c9077f9c165689aca0bcb97e74e5ec
2,600
[ 543639919 ]
[]
defmodule GameClient do def play(initial_stones_num \\ 30) do GameServer.start(initial_stones_num) start_game!() end defp start_game! do send :game_server, {:info, self()} recieve do {player, current_stones} -> IO.puts "Strating the game! It's player #{player} turn. There ar...
0809d2a5a15aadeaee7bdbee1b695117e4236a8a
2,498
[ 36379262 ]
[]
#This process is the process that handles each individual gameserver connection, 1 for 1. # It does everything as far as handling packets sent to and from the gameservers, as well as responding to # and handling malformed/invalid packets before they bother the venus process. Its pretty cool. # I am tired of writing com...
080a4381165f8f1db24fffd77fc3a0975e593af7
1,596
[ 825642096 ]
[]
# list = Enum.to_list(1..10_000) # map_fun = fn i -> [i, i * i] end res_720p = "tanzania_1280x720.jpg" res_2MP = "tanzania_1920x1080.jpg" res_4MP = "tanzania_2560x1440.jpg" res_8MP = "tanzania_3840x2160.jpg" alias Helper.EvisionTool alias Helper.ImageTool alias Evision.InterpolationFlags alias Evision.Constant alias ...
080af36ec239468ef22815242f96ea747d0b1b77
5,039
[ 950348626 ]
[ "documented" ]
defmodule Mix.Tasks.Code.Audit.Init do @moduledoc """ A Mix task to generate a sample configuration file for ExCodeAudit. ## Usage # Generate YAML configuration mix code.audit.init # Generate JSON configuration mix code.audit.init --format=json # Specify output location mix...
080b16d1bf1f0e363b1f76fdb943b0057a3a3df3
1,849
[ 45832304 ]
[ "test" ]
defmodule MlDHT.Test do use ExUnit.Case test "if node_id() returns a String that has a length of 20 characters" do node_id = MlDHT.node_id() assert byte_size(node_id) == 20 end test "if node_id_enc() returns a String that has a length of 40 characters" do node_id_enc = MlDHT.node_id_enc() asse...
080b79c1b901df7950df7cd8d7256529ff42811d
1,698
[ 416997847 ]
[ "phoenix" ]
defmodule ConduitElixirWeb.ArticleView do use ConduitElixirWeb, :view alias ConduitElixirWeb.ArticleView alias ConduitElixirWeb.TagView def render("index.json", %{paged_articles: paged_articles, current_user: current_user}) do %{ articles: render_many(paged_articles.entries, ArticleView, "ar...
080cfe436e1e92ebb53569edc71e9b0140184419
1,582
[ 315031679, 803939826 ]
[ "liveview", "phoenix" ]
defmodule DeliveryCenterParsingApiWeb.Endpoint do use Phoenix.Endpoint, otp_app: :delivery_center_parsing_api # 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 [ ...
080d2ab45bbfbf74fbc6c1959c908bf666d78230
22,167
[ 637939342 ]
[]
defmodule Discussit.Tokens.Stopwords do def list(_), do: [ 15, 78, 657, 82, 513, 64, 65, 67, 718, 257, 16, 17, 18, 19, 450, 1498, 546, 2029, 16552, 936, 10213, 1864, 16062, ...
080d4beb4ccdd8ff31ddf6fbbc896a4da75d7535
1,780
[ 345313270 ]
[ "phoenix" ]
defmodule ContaiWeb.Router do use ContaiWeb, :router pipeline :api do plug :accepts, ["json"] end scope "/operations", ContaiWeb do pipe_through :api get "/", OperationController, :index post "/sum", OperationController, :sum post "/sub", OperationController, :sub post "/div", Operatio...
080d754550509676dd912862aadd3393eace9793
2,081
[ 81526457 ]
[]
# This file is responsible for configuring your application # and its dependencies with the aid of the Mix.Config module. # # This configuration file is loaded before any dependency and # is restricted to this project. use Mix.Config # General application configuration config :social_app_api, ecto_repos: [SocialAppA...
080da057df3590e272b9d9656e2aa8a12f926017
1,516
[ 487428771 ]
[]
# distributed algorithms, n.dulay, 8 feb 2022 # coursework, raft consensus, v2 defmodule Server do # s = server process state (c.f. self/this) # _________________________________________________________ Server.start() def start(config, server_num) do config = config |> Configuration.node_info("Server", server_...
080dac89242f3b18c520d579a10bc5f83b23dbcf
1,647
[ 96213012 ]
[ "macro", "documented", "ecto", "phoenix" ]
defmodule SwaggerPoc.Web do @moduledoc """ A module that keeps using definitions for controllers, views and so on. This can be used in your application as: use SwaggerPoc.Web, :controller use SwaggerPoc.Web, :view The definitions below will be executed for every view, controller, etc, so keep...
080dc215470df926ac5692eecadd59e1e867264d
14,310
[ 754400547 ]
[ "typespec", "macro", "documented" ]
defmodule PluginCrashInfo do @moduledoc false @compile [:bin_opt_info, :recv_opt_info] use TypeCheck use TypeCheck.Defstruct defstruct!( plugin: _ :: module(), type: _ :: :throw | :error, error: _ :: Exception.t(), stacktrace: _ :: Exception.stacktrace() ) defmacro new(kwlist) do quo...
080e0e608713bde962823a21f819af2e876d57c9
1,785
[ 200904576 ]
[]
defmodule TelemetryInfluxDB.MixProject do use Mix.Project @version "0.2.0" def project do [ app: :telemetry_influxdb, version: "0.2.0", elixir: "~> 1.7", start_permanent: Mix.env() == :prod, elixirc_paths: elixirc_paths(Mix.env()), preferred_cli_env: preferred_cli_env(), ...
080e5bb6c2b15c10a2f0b58a76ddfa023e258cff
3,079
[ 436677069 ]
[]
defmodule Day5 do @sample """ seeds: 79 14 55 13 seed-to-soil map: 50 98 2 52 50 48 soil-to-fertilizer map: 0 15 37 37 52 2 39 0 15 fertilizer-to-water map: 49 53 8 0 11 42 42 0 7 57 7 4 water-to-light map: 88 18 7 18 25 70 light-to-temperature map: 45 77 23 81 45 19 68 64...
080eaae9bc38597981bb08fd258bc09ba5855a0c
2,513
[ 89196087 ]
[ "test" ]
defmodule ConsoleMenuTest do use ExUnit.Case doctest ConsoleMenu test "push_menu" do menu_name = "Game Settings" menu_description = "Select the number of the settings item you wish to adjust" menu_state = %MetaMenu{} |> ConsoleMenu.push_menu(menu_name, menu_description) assert {:ok, ^menu_nam...
080ef3262c785bbb541bc5c6cb3cace38fefe689
1,503
[ 52797857 ]
[ "documented" ]
defmodule Mix.Tasks.DialyzeRetry do use Mix.Task @shortdoc "Runs dialyzer on the project with retry logic" @moduledoc """ Mix task for running dialyzer with retry logic. Dialyze mix task caches PLT in the _build folder. This is usually good as it speeds up dialyzing process significantly. Unfortunately the...