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
05f2076d30ef5444bc41fa9da1f3bb3634a07763
2,550
[ 90682276 ]
[ "documented" ]
defmodule Mix.Tasks.NetworksFile.Feed do use Mix.Task @usage """ Usage: mix networks_file.feed --file networks.def Arguments: --file, -f Specifies the file where to read the networks from """ @moduledoc """ Utility task to stream and feed really long network files into the REST API #{...
05f22f978d32de64247ff7931e10f04e13d9ebe5
2,619
[ 353759678 ]
[ "typespec", "documented" ]
defmodule SpiderMan.Pipeline do @moduledoc false require Logger @type event :: any @type arg :: any @type call_return :: {:ok, event} | {:error, error :: any} | :skiped | event @type t :: module | {module, function_name :: atom()} | mfa | (term -> call_return) @callback call(event, arg) :: call_return ...
05f26affa7ea55f71b55d907bd8677ef70c64ba3
3,312
[ 708402454 ]
[]
defmodule NervesContainersX8664Uefi.MixProject do use Mix.Project @github_organization "nerves-containers" @app :nerves_containers_x86_64_uefi @source_url "https://github.com/#{@github_organization}/#{@app}" @version Path.join(__DIR__, "VERSION") |> File.read!() |> String.trim() def ...
05f39614eb0bca578e5f8e05d92ad0a761ebcdb2
1,719
[ 833227405 ]
[ "documented" ]
defmodule WandererApp.Esi do @moduledoc group: :esi defdelegate get_server_status, to: WandererApp.Esi.ApiClient defdelegate get_alliance_info(eve_id, opts \\ []), to: WandererApp.Esi.ApiClient defdelegate get_corporation_info(eve_id, opts \\ []), to: WandererApp.Esi.ApiClient defdelegate get_character_info(...
05f3a655358c7f644fca172b441cf4310c5add70
1,882
[ 419435907 ]
[ "typespec", "phoenix" ]
defmodule Oli.Plugs.ForceRequiredSurvey do import Plug.Conn import Phoenix.Controller alias Oli.Delivery.Sections alias OliWeb.Router.Helpers, as: Routes @completed_surveys_key "completed_section_surveys" @spec init(any) :: any def init(opts), do: opts def call(conn, _opts) do if has_required_su...
05f3c318fd19d643d0ffad7ec4bececb963d1a44
1,510
[ 848462553 ]
[ "phoenix" ]
defmodule PicChatWeb.Router do use PicChatWeb, :router pipeline :browser do plug :accepts, ["html"] plug :fetch_session plug :fetch_live_flash plug :put_root_layout, html: {PicChatWeb.Layouts, :root} plug :protect_from_forgery plug :put_secure_browser_headers end pipeline :api do p...
05f3c73b731ac5dd8ddfdfbfa0a343af56501eb8
6,133
[ 204620266 ]
[ "test", "ecto" ]
defmodule ProjectManagementApi.ManagementTest do use ProjectManagementApi.DataCase alias ProjectManagementApi.Management describe "projects" do alias ProjectManagementApi.Management.Project @valid_attrs %{description: "some description", title: "some title"} @update_attrs %{description: "some updat...
05f3d5c033ed906b10506309bce6b150148b7f21
3,288
[ 680294344 ]
[ "liveview", "ecto" ]
defmodule FlashtonesWebE.Mail do use Phoenix.LiveView import Swoosh.Email def render(assigns) do ~H""" <div> <form phx-submit="send_email" class="odsazeni" id="email_form"> <label for="client_name">Celé jméno</label> <br /> <input type="text" id="client_name" name="client...
05f41f670f9861537fbce6c59ad97168d27a1319
3,699
[ 758043962 ]
[ "test" ]
defmodule Todo.WebTest do use ExUnit.Case use Plug.Test @opts Todo.Web.init([]) describe "get status" do test "renders ok message" do conn = conn(:get, "/status") |> Todo.Web.call(@opts) assert conn.state == :sent assert conn.status == 200 assert conn.resp_body == "ok" end e...
05f44cb869eceb5c39231008bebe31744321e63f
1,574
[ 723429662 ]
[ "test", "liveview" ]
defmodule Paleta.Components.InitalAvatarTest do use ExUnit.Case, async: true import Paleta.Components.Avatars.InitialAvatar import Phoenix.Component, only: [sigil_H: 2] import Phoenix.LiveViewTest, only: [rendered_to_string: 1] setup(do: [assigns: %{}]) describe "initial avatar/1" do @describetag :in...
05f450afb5b6d8d67613cceac94aaaa4e75b8ce8
3,070
[ 454085991 ]
[ "phoenix" ]
defmodule CoopChainWeb.Router do use CoopChainWeb, :router import CoopChainWeb.UserAuth pipeline :browser do plug :accepts, ["html"] plug :fetch_session plug :fetch_live_flash plug :put_root_layout, {CoopChainWeb.LayoutView, :root} plug :put_root_layout, {CoopChainWeb.LayoutView, :root} ...
05f45d8718cbcd62e8fdaf6788b118d4a48c37d9
4,537
[ 454233979 ]
[ "phoenix", "documented" ]
defmodule PodsecWeb.UsuarioAuth do import Plug.Conn import Phoenix.Controller alias Podsec.Authentication alias PodsecWeb.Router.Helpers, as: Routes # Make the remember me cookie valid for 60 days. # If you want bump or reduce this value, also change # the token expiry itself in UsuarioToken. @max_age...
05f495c3d99517135951c34aa80fbd5bb05dff41
1,786
[ 942811655, 920024200 ]
[ "documented" ]
defmodule Ppl.Ppls.Beholder do @moduledoc """ Periodically scans 'pipelines' table searching for pipelines stuck in scheduling. If pipeline is in scheduling state more than '@threshold_sec' Beholder will: - move it out of cheduling - increment ppl's recovery counter If recovery counter is higher than ...
05f4bc6bb3bdf73ce8c6233fd95be6815e5fbc72
4,828
[ 945276765 ]
[ "typespec", "liveview" ]
defmodule LiveviewWeb.VolunteersLive do use LiveviewWeb, :live_view alias Liveview.Volunteers alias Liveview.Volunteers.Volunteer def mount(_params, _session, socket) do volunteers = Volunteers.list_volunteers() {:ok, socket |> assign_form() |> stream(:volunteers, volunteers)} end ...
05f4c9ec800715015b72ecbcb7ff36de9455492d
1,848
[ 150984219 ]
[ "typespec", "documented" ]
defmodule Acmex.Resource.Challenge do @moduledoc """ This structure represents a challenge to prove control of an identifier. """ alias JOSE.JWK @enforce_keys ~w(status token type url)a defstruct @enforce_keys @type dns_response :: %{ key_authorization: String.t(), record_name: Str...
05f4d3f5fa1b1c95ee10512527424990b6cae3dd
3,130
[ 824109793 ]
[ "test", "phoenix" ]
defmodule EpisodicalWeb.DocumentControllerTest do use EpisodicalWeb.ConnCase import Episodical.ModelFixtures @create_attrs %{ title: "some title", author: "some author", released_at: ~U[2025-02-07 22:58:00Z], is_read: true, last_checked_at: ~U[2025-02-07 22:58:00.000000Z], should_auto_ch...
05f4f732d13adb983d5abb1cd5fcce2f78fab7ec
3,321
[ 158607526 ]
[]
%{"certifi": {:hex, :certifi, "0.4.0", "a7966efb868b179023618d29a407548f70c52466bf1849b9e8ebd0e34b7ea11f", [:rebar3], []}, "earmark": {:hex, :earmark, "1.0.1", "2c2cd903bfdc3de3f189bd9a8d4569a075b88a8981ded9a0d95672f6e2b63141", [:mix], []}, "ex_doc": {:hex, :ex_doc, "0.13.0", "aa2f8fe4c6136a2f7cfc0a7e06805f82530e91...
05f57d3c8e66ad91937d3df31065ee8fbc899028
2,274
[ 66029339 ]
[]
%{"amnesia": {:git, "https://github.com/meh/amnesia.git", "211d98275c085a9e3049ccb8db8d29f76b3ffbfc", [tag: :master]}, "certifi": {:hex, :certifi, "0.4.0", "a7966efb868b179023618d29a407548f70c52466bf1849b9e8ebd0e34b7ea11f", [:rebar3], []}, "combine": {:hex, :combine, "0.9.2", "cd3c8721f378ebe032487d8a4fa2ced3181a45...
05f57f292ed76a2f97d6cc0a0a6dc8c260feaa7f
2,221
[ 12017779, 45302070, 41526240, 42598624 ]
[ "test" ]
if System.get_env("EXERCISM_TEST_EXAMPLES") do Code.load_file("example.exs") else Code.load_file("largest_series_product.exs") end ExUnit.start defmodule LargestSeriesProductTest do use ExUnit.Case, async: false test "digits" do assert Series.digits("0123456789") == [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] end ...
05f5861ced3b1d0fcc0bd0d873ba12c7168e44c4
4,540
[ 153105031 ]
[ "test", "ecto" ]
defmodule Server.CurrencyTest do use Server.DataCase alias Server.Currency describe "currencies" do alias Server.Currency.Currencies @valid_attrs %{code_name: "some code_name", name: "some name"} @update_attrs %{code_name: "some updated code_name", name: "some updated name"} @invalid_attrs %{co...
05f5cda015d8c00ca6394bb4de932b32794da8d0
2,910
[ 383019165 ]
[ "phoenix" ]
defmodule ShortUrlWeb.UrlController do use ShortUrlWeb, :controller require Logger alias ShortUrl.Schema.ShortUrl, as: ShortUrlRecord alias ShortUrl.ShortUrlProcessor alias ShortUrl.ShortUrlQueries # GET /api/url/:hash def get_url(conn, %{"hash" => hash} = params) do Logger.info(~s|get_url params=#{...
05f604b1fb11897cc7cbfc7a7196bfdcad757721
7,326
[ 285843966, 305285148 ]
[ "test" ]
defmodule ExAws.ACMTest do use ExUnit.Case, async: true test "add_tags_to_certificate/2" do expected = Map.new() expected = Map.put(expected, "CertificateArn", "xxx") expected = Map.put(expected, "Tags", [%{ "Key" => "yyy", "Value" => "zzz" }]) result = ExAws.ACM.add_tags_to_certificate("xxx", [%{...
05f615e8eeeb8a8a891d3eeaccbb125d64704413
4,208
[ 53937721 ]
[ "genserver", "liveview" ]
defmodule LoggerJSONFileBackend do @behaviour :gen_event @macro_env_fields [:pid] ++ Map.keys(%Macro.Env{}) @formatter if Version.compare(System.version(), "1.6.0") == :lt, do: Logger.Utils, else: Logger.Formatter @impl :gen_event def init({__MODULE__, name}) do {:ok, configure(name, [])} end @impl...
05f6579e27d98ba4c0371cdbb60181f2a6010f9d
2,341
[ 440399416, 438916754, 436935685, 501535419 ]
[ "typespec", "documented" ]
defmodule TaiShangWorldGenerator.MapTranslator do alias Utils.TypeTranslator alias TaiShangWorldGenerator.BlockchainFetcher @rule_class "Rule" def get_map_by_block_num_and_rule_name(block_num, rule_name) do {:ok, %{hash: block_hash}} = BlockchainFetcher.abstract_block_by_block_number(block_num) t...
05f6ecd2fb20fb120e8652a90cdbecd11400e7f9
2,914
[ 171345325 ]
[ "documented" ]
defmodule AppEnv do @moduledoc """ Copy environment variables to Application config. Intended to be used at runtime to override config values using environment variables. """ @doc """ Copies the value of the environment variable `env_var_name` to config `config_key` in in application `app_name`. It passes ...
05f6f0f727b8db60e0f432638c025c3e9b03bb9e
1,648
[ 937937115 ]
[ "documented" ]
defmodule Saki.Core.HttpServer do @moduledoc """ Handles HTTP endpoints and executes tasks through web requests. """ use Plug.Router require Logger alias Saki.Core.{Dispatcher, Concept.TaskContext, Concept.Self, TaskRegistry} plug :match plug Plug.Logger plug Plug.Parsers, parsers: [:json], ...
05f7427392d30cbf4da7d964166baeda935d5017
1,844
[ 74981056 ]
[ "typespec", "documented" ]
defmodule Logi.BuiltIn.Layout.Fun do @moduledoc """ A built-in layout which formats log messages by an arbitrary user defined function. Behaviours: `Logi.Layout`. This layout formats log messages by `t:format_fun/0` which was specified by the argument of `new/1`. ## Note This module is provided for debu...
05f7a5bb5339769cabe38ed9125d5e09af874569
3,001
[ 127125324 ]
[ "typespec", "documented" ]
defmodule CastParams.Type do @moduledoc """ Define casting types """ @primitive_types [:boolean, :integer, :string, :float, :decimal] @typedoc "A type, primitive or custom." @type t :: primitive | custom @typedoc "Primitive types." @type primitive :: base | composite @typedoc "Custom types are rep...
05f7d865d5e09f46b287844455c231d8a6a3160d
1,981
[ 423863622 ]
[]
#https://www.beecrowd.com.br/judge/pt/problems/view/1176 defmodule BcParse do def str_to_float(str) do str |> Float.parse() |> elem(0) end def str_to_integer(str) do str |> Integer.parse() |> elem(0) end def float_to_str(number, precision \\ 2) do :erlang.float_to_binary(number,...
05f7dc926f68204e1e2e5794740da3bb9c9e5f9d
2,731
[ 104568115 ]
[ "documented", "ecto" ]
defmodule MehrSchulferien.Calendar.Period do use Ecto.Schema import Ecto.Changeset alias MehrSchulferien.Calendar.Period schema "periods" do field :category, :string field :ends_on, :date field :name, :string field :slug, :string field :source, :string field :starts_on, :date belon...
05f7e76c30d18d2ffb33b6ba90da7165d0971df7
3,624
[ 625554355 ]
[ "phoenix", "ecto", "documented" ]
defmodule TrashyWeb.EventController do use TrashyWeb, :controller alias Trashy.Events alias Trashy.Events.Event require Logger def index(conn, _params) do events = Events.list_events() render(conn, :index, events: events) end def new(conn, _params) do changeset = Events.change_event(%Event{...
05f8cf86ca4e024e27e4833cd2154d50e34ed4dc
2,543
[ 731710980 ]
[ "test", "phoenix" ]
defmodule NeedforvelocityWeb.RacerControllerTest do use NeedforvelocityWeb.ConnCase import Needforvelocity.AccountsFixtures @create_attrs %{speed: 42, racer_id: "some racer_id", boost: 42, risk: 120.5, points: 42} @update_attrs %{speed: 43, racer_id: "some updated racer_id", boost: 43, risk: 456.7, points: 43...
05f9281cc5220b4197a422330b91f0f8edbb60d8
1,502
[ 229644297 ]
[ "liveview", "phoenix" ]
defmodule PostofficeWeb.Endpoint do use Sentry.PlugCapture use Phoenix.Endpoint, otp_app: :postoffice @session_options [ store: :cookie, key: "_my_app_key", signing_salt: "To8iCTxd" ] socket "/live", Phoenix.LiveView.Socket, websocket: [connect_info: [session: @session_options]] # Serve at "/"...
05f948f759d3ba5fdd0e6a41b299c36ae09edd51
1,622
[ 289347770 ]
[ "typespec", "ecto" ]
defmodule PartyTime.Accounts do import Ecto.Query, only: [from: 2] alias PartyTime.Repo alias PartyTime.Users.User @type user :: %User{} @spec create_admin(map()) :: {:ok, user()} | {:error, Ecto.Changeset.t()} def create_admin(params) do %User{} |> User.changeset(params) |> User.changeset_ro...
05f94bce00047598b23c8f0da3d6499b3d6bbed8
2,705
[ 819518083 ]
[ "typespec", "documented", "phoenix" ]
defmodule ExAxos.ElectronicSignatureEnvelopeSearch do @moduledoc """ Provides API endpoints related to electronic signature envelope search """ @default_client ExAxos.Client @doc """ View Envelope Retrieve detailed information about a Docusign envelope that have been sent/created by the authenticated A...
05f9da41bcf485c7a88db1e60c4d463d021509f9
4,980
[ 567920199 ]
[ "liveview" ]
defmodule WobbleWeb.UserSettingsLive do use WobbleWeb, :live_view alias Wobble.Accounts def render(assigns) do ~H""" <.header>Change Email</.header> <.simple_form :let={f} id="email_form" for={@email_changeset} phx-submit="update_email" phx-change="validate_email" ...
05f9def3a8f99c9fd7c7de4abc0594e2d88ec39a
1,780
[ 243199007 ]
[]
defmodule EdgeBuilder.Mixfile do use Mix.Project def project do [ app: :edge_builder, version: "2.2.0", elixir: "~> 1.8", elixirc_paths: elixirc_paths(Mix.env()), compilers: [:phoenix] ++ Mix.compilers(), build_embedded: Mix.env() == :prod, start_permanent: Mix.env() =...
05fa79d4023ed25fa21a76036ecab79d61e359a0
4,686
[ 115007482 ]
[ "documented" ]
defmodule Zaxxon do @moduledoc """ Documentation for Zaxxon. ASSUMPTIONS: - Universal decay rate - Decay only on message receipt - Uniform distribution of charge in dentrites """ @decay 0.05 @doc """ Neuron loop ## Examples iex> a = spawn Zaxxon.neuron(%{ c: 0, t: 1, next: [self()]...
05fab77d5a909f3c6e4716ea705952da06f3eb75
2,454
[ 413973130 ]
[ "typespec" ]
defmodule Fade.Diagnostic.Probes.AvailableCpuCoresProbe do alias Fade.Diagnostic.Config.Types.DiagnosticsConfig alias Fade.Diagnostic.DiagnosticProbe alias Fade.Diagnostic.Types.{ DiagnosticProbeMetadata, ProbeData, ProbeResult } alias Fade.Diagnostic.Types.KnowledgeBaseArticle alias Fade.Diag...
05fb1a3ac29a3a22d7d2939276299ed62cf18d45
2,160
[ 43259887 ]
[ "test" ]
defmodule Qgen.PowerControllerTest do use Qgen.ConnCase alias Qgen.Power @valid_attrs %{description: "some content", name: "some content"} @invalid_attrs %{} setup do conn = conn() |> put_req_header("accept", "application/json") {:ok, conn: conn} end test "lists all entries on index", %{conn: c...
05fb4742cec75bbdd4280cf1b93e75c24cfcdaad
1,734
[ 232021227 ]
[ "phoenix" ]
defmodule ApiBank.ReportController do use ApiBank.Web, :controller use PhoenixSwagger alias ApiBank.ReportService swagger_path :transaction_month do get("/api/v1/report/month/{month}/{year}") summary("Report transaction by month") produces("application/json") parameter("Authorization", :header...
05fbd0c9c80f47af3e69b5aa0d9d82bb2fd793af
11,804
[ 687104912 ]
[ "test", "ecto" ]
defmodule SeekerTest do use Seeker.DataCase import Ecto.Query, warn: false alias Seeker.Integration.SeekerApp alias Seeker.Schemas.{Category, Post} describe "all/2" do test "ignores value when it is empty" do {:ok, category1} = Repo.insert(%Category{name: "Foo"}) {:ok, category2} = Repo.ins...
05fc064f87f7ca87900ea65cb7920b5310fb95d6
5,972
[ 408882059, 477166933, 404455917, 412330837, 403699128, 404094605, 409217693, 411449391, 405231597, 411446412, 404514887, 405240124, 405966990, 410855985, 402260567, 404841068, 406644289, 407149610, 410695540, 448101722 ]
[ "test" ]
defmodule Fly.Client.TemplateOptionsTest do use Fly.DataCase doctest Fly.Client.TemplateOptions alias Fly.Client.TemplateOptions describe "parse_vm_sizes/1" do test "converts to expected format" do data = [ %{"memoryIncrementsMb" => [256, 1024, 2048], "name" => "shared-cpu-1x"}, %{"...
05fc0bb7c02e0727bb635c655f6ebb3e5b4216ae
2,824
[ 283600763 ]
[ "phoenix" ]
defmodule PlantarWeb.Router do use PlantarWeb, :router import PlantarWeb.UserAuth pipeline :browser do plug :accepts, ["html"] plug :fetch_session plug :fetch_live_flash plug :put_root_layout, {PlantarWeb.LayoutView, :root} plug :protect_from_forgery plug :put_secure_browser_headers ...
05fcee35e8c75f76b940b877c6f4990ef4ddbf8c
1,885
[ 675896603 ]
[ "phoenix" ]
defmodule SpotifyInterfaceWeb.Router do use SpotifyInterfaceWeb, :router import SpotifyInterfaceWeb.UserAuth pipeline :browser do plug :accepts, ["html"] plug :fetch_session plug :fetch_live_flash plug :put_root_layout, html: {SpotifyInterfaceWeb.Layouts, :root} plug :protect_from_forgery ...
05fd3be788c0ef7958ff2795c3c44d4fe53da28f
6,148
[ 812603976 ]
[ "liveview" ]
defmodule IpdthWeb.DashboardLive do use IpdthWeb, :live_view @impl true def mount(_params, _session, socket) do {:ok, assign(socket, :active_page, "dashboard")} end @impl true def render(assigns) do ~H""" <%= if @current_user do %> <div class="p-5 grid grid-cols-4 gap-4"> <.badge...
05fd80cb65ee201c35497419c8999fd944c6d2be
1,749
[ 194126579 ]
[]
defmodule PlateSlateWeb.Schema do use Absinthe.Schema alias PlateSlateWeb.Schema.Middleware.{ ChangesetErrors, FormatDate } alias PlateSlateWeb.Schema.{ Category, Menu, Ordering, Search } import_types Absinthe.Type.Custom import_types Category import_types Menu import_types ...
05fd8eb180d71a5fbbdc6f3bb8e30259c291886a
3,354
[ 737997809 ]
[ "liveview", "test" ]
defmodule ExInstagramWeb.UserLiveTest do use ExInstagramWeb.ConnCase import Phoenix.LiveViewTest import ExInstagram.AccountsFixtures @create_attrs %{name: "some name", language: "some language", vibe: "some vibe"} @update_attrs %{ name: "some updated name", language: "some updated language", vib...
05fda07b9a4bb98aa651fab22c23e7389fd4b9a8
2,519
[ 58490942 ]
[ "test" ]
defmodule Hypex.ArrayTest do use ExUnit.Case, async: false alias Hypex.Array test "updating a Hypex with a value" do hypex = Hypex.new(4, Hypex.Array) hypex = Hypex.update(hypex, "Hypex") assert(hypex == { Array, 4, { :array, 16, 0, 0, { { 0, 0, 0, 0, 0, 3, 0, 0, 0, 0 }, 10, 10, 10, 10, 10, 10, 10,...
05fe5b690ab9fef47b56fe5bfe3f6873ef0de51d
3,405
[ 828084018 ]
[ "documented" ]
defmodule Azimutt.Admin.Dataset do @moduledoc false use TypedStruct alias Azimutt.Admin.Dataset alias Azimutt.Admin.Dataset.Data alias Azimutt.Utils.Enumx alias Azimutt.Utils.Result typedstruct enforce: true do @derive Jason.Encoder field :name, String.t() field :data, list(Data.t()) end ...
05ffad2ee93c2b88c71f19f9582966a27119ccd5
2,838
[ 305961260 ]
[ "documented" ]
defmodule AcqdatCore.Seed.Widgets.StockSingleLine do @moduledoc """ Holds seeds for Line widgets. """ alias AcqdatCore.Repo alias AcqdatCore.Seed.Helpers.WidgetHelpers alias AcqdatCore.Widgets.Schema.Widget, as: WidgetSchema alias AcqdatCore.Widgets.Schema.Vendors.HighCharts @highchart_key_widget_setti...
05ffba08b39b6365e111b31c03828ef7acd95d87
2,738
[ 77974809 ]
[ "documented" ]
defmodule Ueberauth.Strategy.Wechat.OAuth do @moduledoc """ An implementation of OAuth2 for Wechat. To add your `client_id` and `client_secret` include these values in your configuration. config :ueberauth, Ueberauth.Strategy.Wechat.OAuth, client_id: System.get_env("WECHAT_CLIENT_ID"), cli...
05ffbafc5f64a613b5c4215c614d5097a5e273a1
4,632
[ 839023495 ]
[ "typespec", "liveview" ]
defmodule RenewCollabWeb.HierarchyStyleField do use Phoenix.LiveComponent @impl true def render(assigns) do ~H""" <div style="display: flex; align-items: stretch; gap: 0.5ex"> <%= case options(@element, @attr, @type) do %> <% :symbols -> %> <%= with %Phoenix.LiveView.AsyncResult{o...
06001ffbf7444b8b57525de4eab2296b91cd90a4
2,034
[ 218801995, 333962160 ]
[ "typespec", "documented" ]
defmodule GoogleApi.Storage.V1.Model.RewriteResponse do @moduledoc """ A rewrite response. ## Attributes * `done` (*type:* `boolean()`, *default:* `nil`) - true if the copy is finished; otherwise, false if the copy is in progress. This property is always present in the response. * `kind` (*type:* `Strin...
060058f36e83147c354c56925571fe2a7d44606c
12,580
[ 189450801 ]
[ "typespec", "documented" ]
defmodule Grizzly.ZWave.Commands.DoorLockOperationReport do @moduledoc """ OperationReport is used to advertise the status of a door lock This is response to the `Grizzly.ZWave.Commands.OperationGet` command. Params: * `:mode` - the door operating lock mode (required) * `:outside_handles_mode` - a ...
0600d009a6065c9d1b8712ec8c77761201e3725f
1,567
[ 509252504 ]
[ "liveview" ]
defmodule SmeInterviewsWeb.InterviewUserLive.Index do use SmeInterviewsWeb, :live_view on_mount SmeInterviewsWeb.UserLiveAuth alias SmeInterviews.InterviewUsers alias SmeInterviews.InterviewUsers.InterviewUser @impl true def mount(_params, _session, socket) do {:ok, socket |> assign(:interv...
0600e6b100e98845d70dbcc3058a730084d3aca0
1,753
[ 303286820 ]
[]
# 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. # General application configuration use Mix.Config config :lifty, ecto_repos: [Lifty.Repo], gen...
0600fc37ff5a3b4720698673224fcef455ded6ff
2,162
[ 97388394 ]
[ "test" ]
defmodule ClientWeb.StorageFeatureTests do use ClientWeb.FeatureCase, async: true import Wallaby.Query, only: [button: 1, css: 2, link: 1] test "can create a context", %{session: session} do user = insert(:user) [team1, team2] = insert_list(2, :team, users: [user]) name = rand_string() session ...
0601037a64868a3b8358f2df3024f6477aa81141
2,141
[ 435236874 ]
[]
defmodule Helpers do defp get_input(file_path), do: File.read!(file_path) |> String.split("\n", trim: true) defp get_number_pool(input), do: Enum.at(input, 0) |> String.split(",") defp get_game_boards(input), do: Enum.slice(input, 1..length(input)) |> Enum.map(&String.split(&1, " ", trim: true)) |> Enum.chunk_eve...
0601876e15a185c85285464d7e210586b13b57e9
16,930
[ 351487303 ]
[ "documented" ]
defmodule Herb do @moduledoc """ An implementation of the HERB (homomorphic encryption random beacon) protocol. """ import Emulation, only: [send: 2, whoami: 0] import Kernel, except: [spawn: 3, spawn: 1, spawn_link: 1, spawn_link: 3, send: 2] require Fuzzers require Logger defstruct( # Threshold ...
06019087fedaee58b386cf114f11b2dd4bee0f55
3,340
[ 81470422 ]
[ "documented" ]
defmodule Profiler.CLI do @moduledoc """ World's hackiest CLI script! This is for profiling. """ @defaults [ reps: 10, calls: 100_000, concurrency: 100, module: PageCache, ] def main(args) do args |> parse_args |> print_help |> set_defaults |> IO.inspect |> print_qu...
0601b8c02f4a7a3f6a1c60179882f57cbf18bfce
3,401
[ 573557429 ]
[ "documented" ]
defmodule TodolistApi.ForgetPasswords do @moduledoc """ The Forget Password context. """ alias TodolistApi.Repo alias TodolistApi.Users alias TodolistApi.Users.User alias TodolistApi.ForgetPasswords.ForgetPassword alias TodolistApi.Tokens def forget_password(email, silent \\ false) do with %User{...
06022367bbc13f7496a86682122ff8c4931487d9
4,351
[ 204037842 ]
[ "genserver", "typespec", "documented" ]
defmodule Triceratops.Project.Manager do @moduledoc "Module for managing running projects." use GenServer require Logger alias Poison.Parser alias Triceratops.Project.Runner @name :project_manager def start_link do GenServer.start_link(__MODULE__, :ok, name: @name) end def list do GenServ...
06030d9d1d239f41f760d741663a96c8c191eb08
2,705
[ 249263591 ]
[ "test", "phoenix" ]
defmodule MyheroacademyapiWeb.QuirkControllerTest do use MyheroacademyapiWeb.ConnCase alias Myheroacademyapi.Quirks alias Myheroacademyapi.Quirks.Quirk @create_attrs %{ description: "some description", name: "some name" } @update_attrs %{ description: "some updated description", name: "som...
060326f57d68504b9fd6879fdaeff7b7d868a119
3,001
[ 457790033 ]
[ "test" ]
defmodule ImplGameTest do use ExUnit.Case alias Hangman.Impl.Game test "new game returns structure" do game = Game.new_game() assert game.turns_left == 7 assert game.game_state == :initializing assert length(game.letters) > 0 end test "new game returns correct word" do game = Game.new_g...
06032e63cae5898015b56827f3db6069684ead5b
1,511
[ 428738550 ]
[ "genserver" ]
defmodule MinesweeperWeb.LiveMonitor do use GenServer require Logger def start_link(_) do GenServer.start_link(__MODULE__, [], name: __MODULE__) end def init(_) do {:ok, %{views: %{}}} end def monitor(pid, module, data) do GenServer.call(__MODULE__, {:monitor, pid, module, data}) end ...
06036c11b6f3727c7329905e29d496235e7dd3b0
1,932
[ 989789392 ]
[]
# 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 :chatx, generators: [timestamp_type: :utc_da...
060394943c92914a3ac687d314a809229bf21ce9
4,328
[ 29387790 ]
[ "typespec", "macro", "documented", "ecto" ]
defmodule Brando.Utils.Schema do @moduledoc """ Common schema utility functions """ import Ecto.Query alias Brando.SoftDelete alias Ecto.Changeset @type changeset :: Changeset.t() @field_val_collision_attemps 30 @doc """ Updates a field on `schema`. `coll` should be [field_name: value] ## E...
0604b46ecef8fc2d70029778eda1960de3fd1358
2,203
[ 361260526 ]
[ "documented", "ecto" ]
defmodule LiveViewEmbeddedExample.Dining do @moduledoc """ The Dining context. """ import Ecto.Query, warn: false alias LiveViewEmbeddedExample.Repo alias LiveViewEmbeddedExample.Dining.Restaurant alias LiveViewEmbeddedExample.Dining.Restaurant.MenuItem @doc """ Returns the list of restaurants. ...
0604cffb3b8f4bf8507ac711ed9fef572e04bd95
3,241
[ 89981913 ]
[ "documented" ]
import Kernel, except: [inspect: 1] defmodule SecureLogFormatter do @moduledoc """ Documentation for SecureLogFormatter. """ alias Logger.Formatter @default_fields [~r/\w*_token/, "credit_card", "password"] @default_pattern "\n$time $metadata[$level] $levelpad$message\n" def default_fields, do: @defau...
06050bbffbd4530e2097543b886878c0388d6676
5,304
[ 394290937 ]
[ "typespec", "documented" ]
defmodule Blockfrost.Cardano.Blocks do @moduledoc "Functions for to the /blocks namespace in the Blockfrost API" alias Blockfrost.HTTP alias Blockfrost.Response alias Blockfrost.Utils alias Blockfrost.Response.{ LatestBlockResponse, LatestBlockTransactionsResponse, SpecificBlockResponse, Spe...
060623def758375156c704531c2c78394e21309d
3,230
[ 584465714 ]
[ "documented", "ecto" ]
defmodule Conduit.Accounts do @moduledoc """ The boundary for the Accounts system. """ alias Conduit.Accounts.{ Commands.RegisterUser, Projections.User } alias Conduit.Accounts.Queries.{ UserByUsername, UserByEmail } alias Conduit.{App, Repo} @doc """ Get an existing user by thei...
06062847e6ecb32aed32a795f963119a14cb0534
3,833
[ 619473874 ]
[ "macro" ]
defmodule Helper.MnesiaHelper do defmacro __using__(opts) do quote bind_quoted: [opts: opts] do @table_name opts[:table_name] @table_struct opts[:table_struct] @table_type opts[:type] || :disc_copies if is_nil(@table_name) do throw({:error, __MODULE__, "table_name is not specified...
0606402b4fb9ddd7cdabc1ccc048ce616e60200a
4,773
[ 659028868 ]
[ "test", "ecto" ]
defmodule Api.AccountsTest do use Api.DataCase, async: true import Api.Factories.UserFactory alias Api.Accounts alias Api.Accounts.User alias Argon2 alias Ecto.Changeset setup do :user |> params_for() |> then(&{:ok, attrs: &1}) end describe "list_users/0" do test "without users ret...
06064cef2be535a14a343a10432935cce7775f52
1,598
[ 1020315855 ]
[]
defmodule Day do require Logger def lynch(state) do if Kernel.map_size(state.votes) == Kernel.map_size(state.players) do votes = state.votes |> remove_dead_voters(state.players) |> Enum.filter(fn({_, target}) -> target != "" end) |> Map.new kill_player(top_vote(votes), %{sta...
0606b543914d431669e6a067e177a30f77bed109
1,612
[ 165719769 ]
[ "macro", "documented", "phoenix" ]
defmodule RemedyWeb 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 RemedyWeb, :controller use RemedyWeb, :view The definitions below will be executed for every view, controller, etc...
0606dc38643d91c04a51c9299964c47932d4f571
1,792
[ 651762068 ]
[ "liveview", "documented" ]
defmodule WordleCloneWeb.LiveHelpers do import Phoenix.Component import Phoenix.LiveView.Helpers alias Phoenix.LiveView.JS @doc """ Renders a live component inside a modal. The rendered modal receives a `:return_to` option to properly update the URL when the modal is closed. ## Examples <.mod...
0607206770cceac1d3a34d675f4ffa8c8c8e68ba
2,129
[ 320817971 ]
[ "genserver", "typespec", "documented" ]
defmodule AppStore.Token do @moduledoc false require Logger use GenServer alias JOSE.{JWK, JWS, JWT} def start_link(opts) do GenServer.start_link(__MODULE__, opts, name: __MODULE__) end @spec current_env_and_token() :: {atom(), String.t()} def current_env_and_token() do lookup_env_and_token(...
060734002533a464830991d2378819183d9661e9
1,739
[ 183112447 ]
[ "liveview", "macro", "documented", "phoenix" ]
defmodule NoguWeb 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 NoguWeb, :controller use NoguWeb, :view The definitions below will be executed for every view, controller, etc, so k...
0607a67d28fd240405436223017502473dbed15b
6,401
[ 870834019 ]
[]
%{ "bandit": {:hex, :bandit, "1.5.7", "6856b1e1df4f2b0cb3df1377eab7891bec2da6a7fd69dc78594ad3e152363a50", [:mix], [{:hpax, "~> 1.0.0", [hex: :hpax, repo: "hexpm", optional: false]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", opti...
0607d80e3f4fff07d17cdc9ea24a0a06b50468ba
12,978
[ 108524356 ]
[]
%{"arc": {:hex, :arc, "0.8.0", "bb7cf8ea50f30f9c2bb357270c074def42a7ec6a3b4605be731cc5faf8fde6fd", [:mix], [{:ex_aws, "~> 1.1", [hex: :ex_aws, repo: "hexpm", optional: true]}, {:httpoison, "~> 0.11", [hex: :httpoison, repo: "hexpm", optional: false]}, {:poison, "~> 2.2 or ~> 3.1", [hex: :poison, repo: "hexpm", optional...
0607f24fd019cf400ff3a4667311fc8bb27c48fe
6,913
[ 677845133 ]
[ "liveview", "ecto" ]
defmodule YouCongressWeb.VotingLive.NewFormComponent do use YouCongressWeb, :live_component require Logger alias YouCongress.Votings alias YouCongress.Votings.TitleRewording alias YouCongress.Track alias YouCongress.Workers.PublicFiguresWorker @impl true def render(assigns) do ~H""" <div clas...
0608674d33df7d5e7d69483dccd0e85069107292
3,304
[ 72891953 ]
[ "phoenix" ]
defmodule Contact.Router do use Contact.Web, :router pipeline :browser do plug :accepts, ["html"] plug :fetch_session plug :fetch_flash plug :protect_from_forgery plug :put_secure_browser_headers end # This plug will look for a Guardian token in the session in the default location # Then...
0608ab562f170d8bf2fe4481590fa9c563111c82
2,489
[ 600809916 ]
[]
defmodule Vega.MixProject do use Mix.Project def project do [ app: :vega, version: "0.1.0", elixir: "~> 1.14", elixirc_paths: elixirc_paths(Mix.env()), compilers: Mix.compilers(), start_permanent: Mix.env() == :prod, aliases: aliases(), deps: deps(), xref: ...
0608cbb8e1e2d0b3a09b471abc6d3050ba7f3d5d
13,893
[ 586611554 ]
[ "liveview" ]
defmodule PokeToolsWeb.MakeUpAMonLive.Index do use Phoenix.LiveView, layout: {PokeToolsWeb.LayoutView, "live.html"} alias PokeToolsWeb.Router.Helpers, as: Routes alias PokeTools.MakeUpAMon.RandomMon @impl Phoenix.LiveView def mount(params, session, socket) do IO.inspect(socket.assigns) case connect...
0608cd2bb47e942cd7ce1520b93cf1abaaf2fae3
3,510
[ 201769104, 672380245 ]
[ "test" ]
defmodule BSV.PubKeyTest do use ExUnit.Case, async: true alias BSV.PubKey alias BSV.PrivKey @pubkey_bin_comp <<3, 248, 31, 140, 139, 144, 245, 236, 6, 238, 66, 69, 234, 177, 102, 232, 175, 144, 63, 199, 58, 109, 215, 54, 54, 104, 126, 240, 39, 135, 10, 190, 57>> @pubkey_bin <<4, 248, 31, 140, 139, 14...
060972ae6a668c88ddcafbd5a344c88cf4157b3c
1,544
[ 283399941 ]
[]
%{ "b64fast": {:hex, :b64fast, "0.2.2", "394a548c7c236aec3681b55d3e32239ee007229b4c12ae3d262b9597fe623859", [:rebar3], [], "hexpm", "3b1c5af2432de41e3592afb4f8f3c474e53bf61af8c2a8131c031caf0c9b463a"}, "earmark_parser": {:hex, :earmark_parser, "1.4.10", "6603d7a603b9c18d3d20db69921527f82ef09990885ed7525003c7fe7dc86c...
06097edf799e63e886e91c2a206f1d3bbe5e2ab7
5,820
[ 230233136 ]
[ "phoenix", "ecto" ]
defmodule TravelWeb.HomeController do use TravelWeb , :controller alias TravelWeb.Images alias Travel.Repo alias TravelWeb.Book import Ecto.Query, only: [from: 2] # plug TravelWeb.Plugs.RequireAuth when action in [:book] def index(conn , _params) do # changeset = Images.changeset...
0609c5a59b9917fe738f50176d87af9601f22e49
2,250
[ 901580863 ]
[]
defmodule Day7 do def main do File.read!("lib/day7/input") |> prepare_data() |> Enum.filter(fn l -> l != [] end) |> Enum.map(fn [h | t] -> calculate_combinations(h, h, t) end) |> Enum.sum() end def main2 do File.read!("lib/day7/input") |> prepare_data() |> Enum.filter(fn...
0609f8194a48a06fa47b11e9c3a1f2d53e82b4e6
1,593
[ 924818405 ]
[ "test" ]
# test/amqp_sidecar/config_test.exs defmodule AmqpSidecar.ConfigTest do use ExUnit.Case, async: true describe "load_config/0" do test "loads and validates the configuration" do config_content = """ { "rules": [ { "exchange": "test_exchange", "queue": "test_...
060a53f3576f6fc919e99a37fd8d780e13f3fdc9
2,359
[ 333239824 ]
[]
defmodule MssubBms.MixProject do use Mix.Project @name :mssub_bms @version "0.1.0" @deps [ # Third Party Dependencies {:credo, "~> 1.0", only: [:dev, :test], runtime: false}, {:dialyxir, "~> 1.0", only: [:dev, :test], runtime: false}, {:ex_doc, "~> 0.20", only: :dev, runtime: false}, # Mu...
060a65559eff1560163ec7d092257b7c5cdde924
5,074
[ 897576304 ]
[ "documented" ]
defmodule AdventOfCode2024.Day4 do def part_one(input) do horizontal_lines = input |> String.split("\n", trim: true) matrix = horizontal_lines |> Enum.map(&String.graphemes/1) total_horizontal = horizontal_lines |> parse_list() vertical_lines = matrix |> transpose() |>...
060afd9e65d077ce6e5bad0261d4468857483cb4
1,816
[ 270220179 ]
[ "genserver" ]
defmodule Todo.Database do use GenServer @pool_size 3 def start_link(db_folder) do IO.puts "Starting database server" GenServer.start_link(__MODULE__, db_folder, name: :database_server) end def store(key, data) do key |> choose_worker |> Todo.DatabaseWorker.store(key, data) end def...
060b25a0cf7aec3db4c4fccfc7dfbfea907842aa
4,417
[ 517147083 ]
[ "liveview", "test" ]
defmodule Mch2022Web.ThermostatLiveTest do use Mch2022Web.ConnCase import Phoenix.LiveViewTest import Mch2022.MeasurementsFixtures @create_attrs %{name: "some name", temperature: 42} @update_attrs %{name: "some updated name", temperature: 43} @invalid_attrs %{name: nil, temperature: nil} defp create_th...
060b31a16e793fb512526d76998332d470794559
5,537
[ 526248973 ]
[ "test" ]
defmodule WalletTest do use ExUnit.Case use InMemoryEventStoreCase import Commanded.Assertions.EventAssertions alias Commanded.Aggregates.Aggregate doctest Wallet ### Create Wallet ### test "CreateWallet results in WalletCreated" do wallet_id = "5" :ok = Wallet.Application.dispatch(%Wallet.Com...
060b4bfd4b2c9cb00fd41b7cf77415d93e9005cb
1,654
[ 69908689 ]
[ "test" ]
defmodule MementoServerProtoModelBridgeTest do use ExUnit.Case, async: true alias MementoServer.Proto alias MementoServer.Model import MementoServer.TestHelper, only: [a_uuid: 0, a_string: 1] alias MementoServer.ProtoModelBridge, as: Bridge test "note_to_proto" do uuid= a_uuid body= a_string(512) ...
060ba85138d4c9a945d69494bd92c0bc6fb91a43
1,654
[ 609674228 ]
[ "liveview", "phoenix" ]
defmodule DigistabStoreWeb.Endpoint do use Phoenix.Endpoint, otp_app: :digistab_store # 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...
060be95798ade4132ee1da00763316fc39618e0d
3,409
[ 193244709 ]
[ "typespec", "documented" ]
defmodule GoogleApi.Dialogflow.V2.Model.GoogleCloudDialogflowV2beta1Message do @moduledoc """ Represents a message posted into a conversation. ## Attributes * `content` (*type:* `String.t`, *default:* `nil`) - Required. The message content. * `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Outpu...
060c513b96e011e9a3966b5fa89e3e7b255f3ba3
6,317
[ 941717903 ]
[ "documented", "ecto" ]
defmodule PortfolioHub.Workspace do @moduledoc """ The Workspace context. """ import Ecto.Query, warn: false alias PortfolioHub.Repo alias PortfolioHub.Workspace.Portfolio alias PortfolioHub.Portfolios.Phase alias PortfolioHub.Portfolios.{List, Field, ListItem} @doc """ Returns the list of portfo...
060cc6201a3c500129a9a484b6aea6cc915c61b9
1,749
[ 76886581 ]
[ "documented", "ecto" ]
defmodule HomeBudget.User do use HomeBudget.Web, :model schema "users" do field :name, :string field :email, :string field :encrypted_password, :string field :reset_password_token, :string field :password, :string, virtual: true field :password_confirmation, :string, virtual: true ...