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
0388bc79feb0113a42d2e1de38d8dd0c0eee20d3
2,842
[ 585955106 ]
[ "test", "ecto" ]
defmodule Rumbl.MultimediaTest do use Rumbl.DataCase, async: true alias Rumbl.Multimedia alias Rumbl.Multimedia.Category describe "categories" do test "list_alphabetical_categories/0" do for name <- ~w(Drama Action Comedy) do Multimedia.create_category!(name) end alpha_names = ...
0388cbf1eadac1b338d2cc91544f7aeab90258cd
3,960
[ 231469377 ]
[ "test" ]
defmodule CaffeWeb.Schema.OrderingTypesTest do use CaffeWeb.ConnCase use Caffe.EventStoreCase alias Caffe.Ordering @query """ mutation ($items: [OrderItemInput], $notes: String) { placeOrder(items: $items, notes: $notes) { notes customer_id } } """ describe "place_order mutation" d...
0388dfc529f13925d19656b24e5a561440497f23
2,483
[ 485178046 ]
[ "liveview", "macro", "documented", "phoenix" ]
defmodule MessageCaveWeb 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 MessageCaveWeb, :controller use MessageCaveWeb, :view The definitions below will be executed for every view, ...
03897fe7ad14f73179a479038f7509e1ebdff8e8
1,669
[ 666510597 ]
[ "liveview", "phoenix" ]
defmodule WeatherStationWeb.Endpoint do use Phoenix.Endpoint, otp_app: :weather_station # 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, #...
038999c57e334551ebbb3ae722dc70d3fa3cce7b
1,879
[ 905543975 ]
[ "typespec", "documented", "ecto" ]
defmodule PromoMarket.Sales.Promo do @moduledoc """ Promo is a struct for data related to discounts applied to products. """ use Ecto.Schema import Ecto.{Changeset, Query} alias PromoMarket.Sales.{DiscountStrategy, Promo} @promo_fields [ :name, :active, :discount_strategy, :expiration_da...
0389e39c568f3bf0b7c366e46d021efa246e3c82
2,319
[ 746362673 ]
[ "test", "ecto" ]
defmodule TashkentAqNotifier.NotificationTest do use TashkentAqNotifier.DataCase alias TashkentAqNotifier.Notification describe "messages" do alias TashkentAqNotifier.Notification.Message import TashkentAqNotifier.NotificationFixtures @invalid_attrs %{text: nil, recepient_count: nil, received_coun...
038a8da2be8206d3e882b2817a8746609091e89f
3,875
[ 949664843 ]
[ "typespec", "documented" ]
defmodule Raxol.Terminal.ANSI.Benchmark do @moduledoc """ Provides benchmarking capabilities for the ANSI handling system. Measures performance of parsing and processing ANSI sequences. """ alias Raxol.Terminal.ANSI.Parser @doc """ Runs a benchmark suite on the ANSI handling system. Returns a map of b...
038ac6d25a3de8aab26ef43ef3528ad1a7771015
6,225
[ 63109849 ]
[]
%{"bunt": {:hex, :bunt, "0.1.6", "5d95a6882f73f3b9969fdfd1953798046664e6f77ec4e486e6fafc7caad97c6f", [:mix], []}, "certifi": {:hex, :certifi, "0.4.0", "a7966efb868b179023618d29a407548f70c52466bf1849b9e8ebd0e34b7ea11f", [:rebar3], []}, "connection": {:hex, :connection, "1.0.3", "3145f7416be3df248a4935f24e3221dc467c1...
038b009f5eb4a05f19051f48d263cdd4fc8e67e3
1,978
[ 75415851 ]
[ "test" ]
defmodule AOCArgFetcherTest do use ExUnit.Case alias AOC.{ArgFetcher, Parser} test "add sample works" do program = Parser.parse("1,0,0,0,99") state = %{ instruction_pointer: 0, program: program } result = ArgFetcher.fetch(state) assert {:add, { 1, 1, 0 } } = result end test ...
038b444137837fb2b82ee6aaad6fc5a1a7dbae61
2,119
[ 194607303 ]
[]
%{ "certifi": {:hex, :certifi, "1.0.0", "1c787a85b1855ba354f0b8920392c19aa1d06b0ee1362f9141279620a5be2039", [:rebar3], [], "hexpm"}, "combine": {:hex, :combine, "0.10.0", "eff8224eeb56498a2af13011d142c5e7997a80c8f5b97c499f84c841032e429f", [:mix], [], "hexpm"}, "gettext": {:hex, :gettext, "0.17.0", "abe21542c83188...
038ba1b5303d4e009608bc5dba36562eb8ebfdfb
1,638
[ 573505877 ]
[ "genserver", "documented" ]
defmodule Crane do @moduledoc """ The ElfCrane9000 genserver """ use GenServer @impl GenServer def init(stacks) do {:ok, stacks} end @impl GenServer def handle_call({:move, origin, dest}, _, stacks) do # 0-indexed offset origin = origin - 1 dest = dest - 1 {crate, origin_mod} =...
038be4ce49bdc4f0628c17cdf6e2521f04ffa789
1,779
[ 90719132 ]
[ "phoenix", "ecto" ]
defmodule FirestormWeb.Web.UserController do use FirestormWeb.Web, :controller alias FirestormWeb.Forums def index(conn, _params) do users = Forums.list_users() render(conn, "index.html", users: users) end def new(conn, _params) do changeset = Forums.change_user(%FirestormWeb.Forums.User{}) ...
038be91f07cffdd2e6680eb6b0878476d0de6700
2,852
[ 593089416 ]
[ "documented" ]
defmodule Mindchat.GeckoApi do @moduledoc """ Documentation for `CoinGeckoApi`. This interface is based on version 3 of the api. Base URL is "https://api.coingecko.com/api/v3/" Also check out CoinGecko api for more information at https://www.coingecko.com/en/api. """ @cg_base_url "https://api.coingecko.c...
038bef6dada3a12ab365b65758b8e62039116e3c
2,723
[ 175019631 ]
[ "phoenix" ]
defmodule Tasks2Web.TimeBlockController do use Tasks2Web, :controller alias Tasks2.TimeBlocks alias Tasks2.TimeBlocks.TimeBlock action_fallback Tasks2Web.FallbackController def index(conn, %{"task_id" => task_id}) do time_block = TimeBlocks.get_blocks_by_task_id(task_id) render(conn, "index.json", ...
038c795faade8b8d3e70843de6a856d640ba563d
1,758
[ 132611629, 113243729 ]
[ "typespec", "documented" ]
defmodule Sippet.Transports.Queue do @moduledoc """ The transport queue receives datagrams or messages from network transport protocols, validates and routes them to the transaction module. The queue contains a worker pool to improve processing performance. """ alias Sippet.Message, as: Message alias Si...
038c8194cbf6e1485b905598be4ad5cd58ad6ed4
2,546
[ 313369452, 172514736 ]
[ "typespec", "documented" ]
defmodule Connect do @doc """ Calculates the winner (if any) of a board using "O" as the white player and "X" as the black player """ @spec result_for([String.t()]) :: :none | :black | :white def result_for(board) do map_board = board |> Stream.with_index() |> Stream.flat_map(fn {row...
038d22fe53f298be45c454f74040eed8d7a52534
1,918
[ 963230380 ]
[ "documented" ]
defmodule GenAI.Tool do @moduledoc """ Represents a function that can be called by the model. """ @vsn 1.0 require GenAI.Records.Directive import GenAI.Records.Directive use GenAI.Graph.NodeBehaviour @derive GenAI.Graph.NodeProtocol # @derive GenAI.Thread.SessionProtocol defnodestruct(parameters: ...
038d30bb99859807a6e496d3e15227aec8aafe4c
2,790
[ 63931406 ]
[]
%{"connection": {:hex, :connection, "1.0.3", "3145f7416be3df248a4935f24e3221dc467c1e3a158d62015b35bd54da365786", [:mix], []}, "cowboy": {:hex, :cowboy, "1.0.4", "a324a8df9f2316c833a470d918aaf73ae894278b8aa6226ce7a9bf699388f878", [:rebar, :make], [{:cowlib, "~> 1.0.0", [hex: :cowlib, optional: false]}, {:ranch, "~> 1....
038d72cc26565ffd68bbe668a33ac702801228e4
1,652
[ 80109208 ]
[ "typespec", "documented" ]
defmodule Membrane.Bin.PadData do @moduledoc """ Struct describing current pad state. The public fields are: - `:availability` - see `t:Membrane.Pad.availability/0` - `:direction` - see `t:Membrane.Pad.direction/0` - `:name` - see `t:Membrane.Pad.name/0`. Do not mistake with `:ref` - `:options` -...
038d8b228d95c9b2e1dfbf76e4529bf3055b953c
2,733
[ 18721319 ]
[ "documented" ]
defmodule Bencode do @moduledoc "Elixir solution for implementing the encoding and decoding of the Bencode format." @doc """ encodes strings into the bencode format iex> Bencode.encode "fox molder" "10:fox molder" """ def encode(obj) when is_bitstring(obj) do "#{String.length(obj)}:#{obj}" ...
038da3bf91f80c80e1d1a4360609c63529ced0a4
5,086
[ 816126800 ]
[ "genserver", "liveview", "phoenix", "ecto" ]
defmodule PhoenixVaultWeb.SnapshotLive.Index do require Logger use PhoenixVaultWeb, :live_view alias PhoenixVault.Archive alias PhoenixVault.Schemas.Snapshot @per_page Archive.snapshot_table_per_page() @overfetch_factor Archive.snapshot_table_overfetch_factor() @impl true def mount(_params, _session,...
038e050d58eb1f7f59060e8344ce15f1080f43c7
1,611
[ 313369452, 203007965, 105783894, 172514736, 237782855 ]
[ "test" ]
defmodule SaddlePointsTest do use ExUnit.Case # @tag :pending test "extract rows" do rows = SaddlePoints.rows("1 2\n10 20") assert rows == [[1, 2], [10, 20]] end # @tag :pending test "extract a row" do rows = SaddlePoints.rows("9 7\n8 6") assert Enum.at(rows, 0) == [9, 7] end # @tag :...
038e2a76422592f6b201016e6abd069df75b78c0
2,441
[ 232959397 ]
[ "typespec", "documented" ]
defmodule ITKCommon.Interactions do @moduledoc """ Handles interaction tracking. """ alias ITKCommon.Thread alias ITKCommon.UserSessions @types ~w(event experiment) @from_session [ "session_id", "app_version", "device_type", "mobile_app_version", "last_mobile_app", "os_version", ...
038e3c1d6eb3f9a8c2d9d13c8e712240022ef3e0
7,982
[ 666867082, 667407434 ]
[]
defmodule CA.AES do def e(x,y), do: :erlang.element(x,y) def privat(name), do: e(3,:public_key.pem_entry_decode(readPEM("priv/certs/",name))) def public(name), do: e(3,e(8, e(2, :public_key.pem_entry_decode(readPEM("priv/certs/",name))))) def readPEM(folder, name), do: hd(:public_key.pem_deco...
038e68f24de84dadb59ead60e1951cd35eacd20a
1,624
[ 570002201 ]
[ "liveview", "phoenix" ]
defmodule SimpleAuthApiWeb.Endpoint do use Phoenix.Endpoint, otp_app: :simple_auth_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 [ store: :cookie, ke...
038f1c226d7b6bbd56a86fe5464be7c32fd2bfb8
2,173
[ 596650430 ]
[ "typespec", "liveview", "documented" ]
defmodule ElixirWordleWeb.Keyboard do use ElixirWordleWeb, :live_component @moduledoc """ Screen Keyboard (linked to external keyboard) """ def mount(socket) do keyboard = [ {["Q", "W", "E", "R", "T", "Y", "U", "I", "O", "P"], 0}, {["A", "S", "D", "F", "G", "H", "J", "K", "L"], 0}, {...
03902f096a850b21da4aee3e8dabd70cac26bd44
1,877
[ 80465043 ]
[ "test" ]
defmodule Choobio.ChoobioTest do use Choobio.DataCase alias Choobio.{Line, Station} alias Choobio.Station.Platform alias Choobio.Station.Platform.Arrivals @station_id "940GZZLUTBC" @station_name "Tooting Bec" @line_id "northern" @process_name :"940GZZLUTBC_northern" @station_attrs %{name: "Tooting B...
0390dc4936111604c2bd9dc4078aa4890006b3ef
2,241
[ 657175362 ]
[]
defmodule Attrs do def get(attrs, key, default \\ nil) def get(%{} = attrs, key, default) when is_atom(key) do Map.get(attrs, key, Map.get(attrs, to_string(key), default)) end def get(%{}, key, _default) when is_binary(key) do raise ArgumentError, message: "key passed to Attrs.get/3 must be an atom" ...
0390e14985fe31aafcce1117b8ff71bb1801ea44
2,996
[ 757252091 ]
[ "genserver", "liveview" ]
defmodule LivepromptWeb.ViewLive do alias LivepromptWeb.ViewControl.Components use LivepromptWeb, :live_view @impl true def render(%{loading: true} = assigns) do ~H""" Liveprompt is loading... """ end @impl true def render(%{loading: false} = assigns) do ~H""" <div phx-hook="LightOut...
0390e58b1344f699733b3a2d417c7695a465f049
1,525
[ 498675807 ]
[ "test" ]
defmodule AppCount.Properties.LetterTemplatesTest do use AppCount.DataCase import AppCount.LeaseHelper alias AppCount.Properties @moduletag :properties_letter_templates setup do property = insert(:property) lease = insert_lease(%{property: property}) template_body = """ <p>Dear <a href="APPR...
03918778772d0beaf8f79b3dfcee74fcaf15a20b
3,277
[ 116519551 ]
[ "typespec", "macro" ]
defmodule Exchema.Notation.Typespec do def set_typespec(mod) do unless type_t_defined(mod) do define_type_t(mod) end end defp type_t_defined(mod) do if Version.match?(System.version(), ">= 1.7.0") do Module.defines_type?(mod, {:t, 0}) else mod |> Module.get_attribute(:type...
0391c77632730e11fd07416ca648a9e7d8e78cca
9,683
[ 216478828 ]
[]
defmodule Chess.Bishop do alias Chess.BoardStatus @pieces %{ wKing: 0, wQueen: 1, wBishop: 2, wKnight: 3, wRook: 4, wPawn: 5, bKing: 6, bQueen: 7, bBishop: 8, bKnight: 9, bRook: 10, bPawn: 11, empty: 12 } def playmove(game,position) do IO.inspect("Play move"...
0391f999eb63777146f8e61fe38ef09e6268565a
5,881
[ 443660384 ]
[]
defmodule YNAB.Client do use HTTPoison.Base alias YNAB.ParseResponse @ynab_api_version "v1" @base_url "https://api.youneedabudget.com" def get_budgets([include_accounts: include_accounts] \\ [include_accounts: false]) do get("/budgets", [], params: [include_accounts: include_accounts]) |> handle_re...
0392910c59737d04652e5a55c0cdddb88936ea98
3,159
[ 605097307 ]
[ "genserver" ]
defmodule Test.Bot do use GenServer require Logger defmodule Config do defstruct server: nil, port: nil, pass: nil, nick: nil, user: nil, name: nil, channel: nil, client: nil def from_params(params) when is...
039333c3ba5e5e3cfb7584cce0b76c8123514b20
1,968
[ 324169628 ]
[ "test" ]
defmodule Quadquizaminos.BottomTest do use ExUnit.Case import Quadquizaminos.Bottom test "various collisions" do bottom = %{{1, 1} => {1, 1, :blue}} assert collides?(bottom, {1, 1}) refute collides?(bottom, {1, 2}) assert collides?(bottom, {1, 1, :blue}) assert collides?(bottom, {1, 1, :red}...
0393354c79ce074c6894cbddaa4454dfccee8956
4,068
[ 258037424 ]
[ "typespec", "macro", "documented", "ecto" ]
defmodule Herald.Message do @moduledoc """ Defines the behaviour to Message Schemas. Message Schemas are the structs which represents data exchanged using a Broker queue. Any message which you expect receive or send in your application must be represented by a module, and this module must `use/2` `Heral...
03938556e0c690b6403a75409193069083b60e5a
1,671
[ 110639735 ]
[ "phoenix", "ecto" ]
defmodule BlogWeb.PostController do use BlogWeb, :controller alias Blog.Blogs alias Blog.Blogs.Post def index(conn, _params) do posts = Blogs.list_posts() render(conn, "index.html", posts: posts) end def new(conn, _params) do changeset = Blogs.change_post(%Post{}) render(conn, "new.html",...
03943495d73dfa3b7afd0937aa405352fd7f9bdd
2,092
[ 970901932 ]
[ "typespec", "documented" ]
defmodule ExSolana.RPC.Request.SimulateTransaction do @moduledoc """ Functions for creating a simulateTransaction request. """ import ExSolana.RPC.Request.Helpers alias ExSolana.RPC.Request @simulate_transaction_options commitment_option() ++ [ ...
039437cd93259fa7f7a817058013a95d02c37238
2,444
[ 942307159 ]
[ "liveview", "test" ]
defmodule WeatherAppWeb.WeatherLiveTest do use WeatherAppWeb.ConnCase, async: true import Phoenix.LiveViewTest @moduletag :capture_log test "renders the search page", %{conn: conn} do {:ok, _view, html} = live(conn, "/weather") assert html =~ "Consulta de Clima" end test "search event shows resul...
03945fc6bfbdc32ef47009a9e5bab1834aaf025d
4,736
[ 225152154 ]
[ "documented" ]
defmodule Advent2019.Five do def main(input_filename) do File.read!(input_filename) |> String.trim() |> String.split(",") |> Enum.map(&String.to_integer/1) |> run_program end @doc """ Run Intcode programs ## Examples iex> Advent2019.Five.run_program([1,0,0,0,99]) [2,0,0,0,99] ...
03948cf3da7dbce478b9f416085f7d6f9bf506d9
1,772
[ 212379681, 542604765 ]
[ "genserver", "supervisor" ]
defmodule Employee do use GenServer @initial_work 50 @work_interval 50 @enforce_keys [ :name ] defstruct [ :name, colleagues: [], work: @initial_work ] def start_link({name, colleagues}) do GenServer.start_link(__MODULE__, %__MODULE__{ name: name, colleagues: colleagues }, name: name) end def in...
0394f4f5d5ede6a14250e91b565f075d38afc97c
8,326
[ 572959269 ]
[]
defmodule Day14 do ## First task easy, second task ..... :-0 ## ## In the first task I simply represented the board as a list of ## lists. The rows are transposed into columns and one could then ## treat each column separately, tilt it and counts the weights. ## ## There are other, meybe more efficient,...
03951a7dcbb3fa3e115ab03900fc9d08431321a6
3,065
[ 104968072 ]
[ "phoenix" ]
require IEx; defmodule CncfDashboardApi.PipelinesController do use CncfDashboardApi.Web, :controller alias CncfDashboardApi.Pipelines def index(conn, _params) do # pipelines = Repo.all(Pipelines) pipelines = CncfDashboardApi.Repo.all(from pl in CncfDashboardApi.Pipelines, ...
03957cc9267ded0c0a58c886d5212a28a63742ec
1,697
[ 642974477 ]
[ "phoenix" ]
defmodule PhysioWeb.DoctorConfirmationController do use PhysioWeb, :controller alias Physio.Accounts def new(conn, _params) do render(conn, "new.html") end def create(conn, %{"doctor" => %{"email" => email}}) do if doctor = Accounts.get_doctor_by_email(email) do Accounts.deliver_doctor_confir...
0395929e8aaa87206ed4671f33d59bedf68c30ee
1,625
[ 57370004 ]
[ "macro", "documented", "ecto", "phoenix" ]
defmodule PhxReact.Web do @moduledoc """ A module that keeps using definitions for controllers, views and so on. This can be used in your application as: use PhxReact.Web, :controller use PhxReact.Web, :view The definitions below will be executed for every view, controller, etc, so keep them ...
039629512fb411a7c590ab187688c002b9a35df7
2,997
[ 547180786 ]
[ "test" ]
defmodule Membrane.HLS.SourceTest do use ExUnit.Case alias Membrane.HLS.Source alias HLS.Playlist.Master import Membrane.Testing.Assertions @master_playlist_uri URI.new!("file://test/fixtures/mpeg-ts/stream.m3u8") defmodule Pipeline do use Membrane.Pipeline @impl true def handle_init(_ctx, ...
03965e03730cbaddbcd43473b99e2e9fe8c2cfb1
1,962
[ 480680432 ]
[ "test", "ecto" ]
defmodule Todo.TasksText do use Todo.DataCase alias Todo.Tasks describe "tasks" do alias Todo.Tasks.Task import Todo.TasksFixtures @invalid_attrs %{completed: nil, text: nil} test "list_tasks/0 returns all tasks" do tasks = tasks_fixture() assert Tasks.list_tasks() == tasks en...
039673562a1d5717917adc18486898000dcf099c
7,217
[ 186850779 ]
[]
defmodule ReportServer.Reports.Athena.ResourceData do require Logger alias ReportServer.Accounts.User alias ReportServer.{ReportService, AthenaDB, Clue} # NOTE: no struct definition but the shape of the reports data is a map whose keys are the same generated UUIDs # used as keys in the learner data and the...
0396e661d03fde6d87ec3bd364e23cb3b00fceee
21,976
[ 559744925, 789802355, 744142491, 823294387, 771989527, 773846987, 747581658, 805634608, 731178722, 806822991, 933474027, 748403186, 734711585, 774615024, 776597093, 825443197, 777793907 ]
[ "test", "ecto" ]
defmodule Ecto.Integration.JoinsTest do use Ecto.Integration.Case, async: Application.compile_env(:ecto, :async_integration_tests, true) alias Ecto.Integration.TestRepo import Ecto.Query alias Ecto.Integration.Post alias Ecto.Integration.Comment alias Ecto.Integration.Permalink alias Ecto.Integration.Us...
039773a994fd5440e8f26d494c5c5600de874423
8,820
[ 119773249 ]
[ "documented", "phoenix" ]
defmodule Phoenix.Transports.LongPoll do @moduledoc """ Socket transport for long poll clients. ## Configuration The long poll is configurable in your socket: transport :longpoll, Phoenix.Transports.LongPoll, window_ms: 10_000, pubsub_timeout_ms: 2_000, transport_log: false, ...
0397cc715ee68ac86d440b39e25ca69686b82ffb
1,697
[ 275564953, 92079314 ]
[]
# 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 :nexpo, ecto_repos: [Nexpo.Repo] # Conf...
0398313af294ae4a4fd921bc49ab1444add94dc6
1,565
[ 106193191 ]
[]
# 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 :cookery, ecto_repos: [Cookery.Repo], ...
03986eba6be60f14168c956406ad96dddb515004
8,301
[ 92773474 ]
[ "typespec", "ecto" ]
defmodule Gt.DataSource do use Gt.Web, :model use Arc.Ecto.Schema schema "data_sources" do field :name, :string field :active, :boolean, default: false field :completed, :boolean, default: false field :processed, :integer, default: 0 field :total, :integer, default: 0 field :type, :string...
03987c8a3e1ef7f4a2c99a46234ea5ddf6414e60
8,808
[ 406836005 ]
[ "test", "ecto" ]
defmodule Ams.PayrollTest do use Ams.DataCase alias Ams.Payroll describe "departments" do alias Ams.Payroll.Department @valid_attrs %{name: "some name"} @update_attrs %{name: "some updated name"} @invalid_attrs %{name: nil} def department_fixture(attrs \\ %{}) do {:ok, department} = ...
03987fa2d5fdce7dae9117b90e4473c0e65ef7e1
1,529
[ 261397353 ]
[ "phoenix", "ecto" ]
defmodule ServproapiWeb.FallbackController do use ServproapiWeb, :controller # 404 errors def call(conn, {:error, :not_found}) do conn |> put_status(404) |> put_view(ServproapiWeb.ErrorView) |> render("404.json", %{message: "Not found"}) end # Changeset errors d...
0398a34bfb67532fe0e9f8f2421b3445c8581574
4,162
[ 436553571 ]
[ "typespec", "test" ]
defmodule Realtime.WebhookConnectorTest do use ExUnit.Case import Mock alias Realtime.Adapters.Changes.Transaction alias Realtime.Configuration.{Webhook, WebhookEndpoint} alias Realtime.Adapters.Postgres.Decoder.Messages.Relation.Column alias Realtime.WebhookConnector @test_endpoint "https://webhooktes...
0398f6a218a23095d6fa34aa958d46d2a46e5e23
1,722
[ 814281648 ]
[ "liveview", "phoenix" ]
defmodule GameAppWeb.Endpoint do use Phoenix.Endpoint, otp_app: :game_app # 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: "_game_app...
03991bfd8c6d694425caf3f34a98c46fbab6017e
2,253
[ 89083037 ]
[ "test" ]
defmodule MelodicaInventoryWeb.EventControllerTest do use MelodicaInventoryWeb.ConnCase, async: false import MelodicaInventory.Factory import Plug.Test describe "when not authorized" do test "index redirects to login", %{conn: conn} do response = conn |> get(event_path(conn, :index)) as...
039953d45a67c332aa170966cd0d66d875824c54
2,818
[ 672567738 ]
[ "typespec", "documented" ]
defmodule BookCollect.Core.BookFile do alias ReadNever.BookShelf.{Book, BooksDirectory} @spec create_book_attrs(Path.t(), %BooksDirectory{}) :: {:ok, {Book.atom_attrs(), %BooksDirectory{}}} | {:error, term()} def create_book_attrs(filepath, %BooksDirectory{} = books_directory) when is_bitstring(f...
039979cd858ef15a4d143da08308251df9ef1e88
3,856
[ 592762227 ]
[]
defmodule SEV.DOWN do require N2O import Record @prefix "priv/sev/download/" defrecordp(:state, id: [], login: [], pass: [], pid: []) defp spec(l, p, i, pid), do: N2O.pi(module: __MODULE__, table: :sev, sup: SEV.Listener, restart: :temporary, timeout: :brutal_kill, state: state(id: i, login:...
0399cb933ec4a2280ed62e66eab0c4ea81ff95b6
4,607
[ 975705248 ]
[ "test" ]
defmodule Tuesday.Workspace.OrganizationMemberTest do use Tuesday.DataCase alias Tuesday.Workspace.OrganizationMember describe "invite_org_member" do test "valid input creates a new organization member and user" do organization_id = generate(organization()).id assert {:ok, org_member} = ...
0399d45fdd5ba68c3e9c46a13c92fd0c41f4e8af
3,414
[ 928304975 ]
[]
%{ "first_names" => [ "Adinda", "Aisyah", "Amara", "Bela", "Bintang", "Bunga", "Cahaya", "Cempaka", "Citra", "Desi", "Dewi", "Dian", "Eka", "Elok", "Erina", "Fadila", "Fauziah", "Fitri", "Galuh", "Gita", "Gresia", "Hana", "Has...
0399d7a66e046c204d5a738827952072eb9a49e0
1,962
[ 626437339 ]
[ "genserver", "macro" ]
defmodule Bot.BotMacro do alias Bot.Channel alias Bot.BotMacro defmacro onMessage(do: block) do m_message = Macro.var(:message, nil) m_name = Macro.var(:name, nil) m_state = Macro.var(:state, nil) m_msg = Macro.var(:msg, nil) quote do def on_message( message: unquote(m_mess...
0399fc30e742eea0aaf2550d5aa0fb23c3bb1cb7
2,893
[ 79683814 ]
[]
%{"bbmustache": {:hex, :bbmustache, "1.0.4", "7ba94f971c5afd7b6617918a4bb74705e36cab36eb84b19b6a1b7ee06427aa38", [:rebar], []}, "cf": {:hex, :cf, "0.2.2", "7f2913fff90abcabd0f489896cfeb0b0674f6c8df6c10b17a83175448029896c", [:rebar3], []}, "cowboy": {:hex, :cowboy, "1.1.2", "61ac29ea970389a88eca5a65601460162d370a700...
039a1c2311e896ab6c17e93f53b3965d6d55090e
3,779
[ 820530264 ]
[ "liveview", "test" ]
defmodule PentoWeb.QuestionLiveTest do use PentoWeb.ConnCase import Phoenix.LiveViewTest import Pento.FaqFixtures @create_attrs %{name: "some name", answer: "some answer", vote_count: 42} @update_attrs %{name: "some updated name", answer: "some updated answer", vote_count: 43} @invalid_attrs %{name: nil, ...
039a380cb4b205928e07f565227466db908d6622
1,578
[ 193244709, 101434552, 198908023 ]
[ "typespec", "documented" ]
defmodule GoogleApi.BigtableAdmin.V2.Model.MultiClusterRoutingUseAny do @moduledoc """ Read/write requests are routed to the nearest cluster in the instance, and will fail over to the nearest cluster that is available in the event of transient errors or delays. Clusters in a region are considered equidistant. Choos...
039ac3bb1b278dfaac0b9ae1a43fd17517f7da22
2,697
[ 1002663420 ]
[ "test", "ecto" ]
defmodule FinanceApi.FinanceTest do use FinanceApi.DataCase alias FinanceApi.Finance describe "transactions" do alias FinanceApi.Finance.Transaction import FinanceApi.FinanceFixtures @invalid_attrs %{tipo: nil, value: nil, date: nil, description: nil} test "list_transactions/0 returns all tra...
039b8953f894e89631917aa8bda8a6265202376d
2,432
[ 569243827 ]
[ "liveview", "test" ]
defmodule CoreWeb.AccountConfirmationLiveTest do use CoreWeb.ConnCase import Phoenix.LiveViewTest import Core.UsersFixtures alias Core.Users alias Core.Repo setup do %{account: account_fixture()} end describe "Confirm account" do test "renders confirmation page", %{conn: conn} do {:ok,...
039bb025802b40c7c4fc48fea8369fb025f93ad0
1,605
[ 193244709 ]
[ "typespec", "documented" ]
defmodule GoogleApi.Dialogflow.V2.Model.GoogleCloudDialogflowCxV3WebhookGenericWebServiceOAuthConfig do @moduledoc """ Represents configuration of OAuth client credential flow for 3rd party API authentication. ## Attributes * `clientId` (*type:* `String.t`, *default:* `nil`) - Required. The client ID provid...
039bb1bfe7c9ba985b743d4632375c11aa6c65cd
1,534
[ 35579843 ]
[ "documented" ]
defmodule ExDisque do @moduledoc """ ExDisque wrapper """ @doc """ Connects to the Disque server: * `start_link` * `start_link("127.0.0.1", 7711)` Returns the `pid` of the connected client. """ def start_link( host \\ "127.0.0.1", port \\ 7711, database \\ 0, passw...
039c22fd279a6bb241ce6da9e9277fb33fe30d1d
3,016
[ 241902819 ]
[]
defmodule DistributedPerformanceAnalyzer.MixProject do use Mix.Project def project do [ app: :distributed_performance_analyzer, version: "0.1.0", elixir: "~> 1.15", start_permanent: Mix.env() == :prod, test_coverage: [ tool: ExCoveralls, summary: [threshold: 90] ...
039c3bf86612be81d376bf1647f846b164684cab
3,066
[ 749568700 ]
[ "test" ]
defmodule DongEngine.GameObjects.PaddleTest do use ExUnit.Case, async: true doctest DongEngine.GameObjects.Paddle alias DongEngine.GameObjects.Board alias DongEngine.GameObjects.Paddle alias DongEngine.Physics.Vector describe "new/4" do setup do %{ board: %Board{height: 100, width: 100},...
039d047314d2e323cfac482787d6d59291f2ecb5
4,220
[ 434661144 ]
[]
#! /usr/bin/env elixir defmodule Parallel do def map(collection, function) do collection |> Enum.map(&Task.async(fn -> function.(&1) end)) |> Enum.map(&Task.await(&1)) end end defmodule Day19 do defp parse_probes(probes) do for line <- probes, into: MapSet.new, do: line |> String.split(",") ...
039d6bafd883ac5b134d07a5697692d07b978299
1,674
[ 91890774 ]
[ "test" ]
defmodule Glayu.Validations.URIValidatorTest do use ExUnit.Case test "uri validator handles valid expresions" do {status, details} = Saul.validate("http://glayu.com/", Glayu.Validations.URIValidator.validator()) assert status == :ok assert details == "http://glayu.com/" {status, details} = Saul....
039d8e6398e55a27a5d58db2c433d7dd8ab88f05
1,959
[ 345002670 ]
[ "phoenix", "ecto" ]
defmodule EventsWeb.CommentController do use EventsWeb, :controller alias Events.Comments alias Events.Comments.Comment alias Events.Posts def index(conn, _params) do comments = Comments.list_comments() render(conn, "index.html", comments: comments) end def new(conn, _params) do changeset =...
039dc8d3369f0643c0d0f2ca339f0284cf5c6d36
1,782
[ 225266930 ]
[ "documented" ]
defmodule AoC2021.ALU do @moduledoc """ ALU Program """ @doc """ Runs ALU instructions on a program """ def run(program, input \\ []) do program = Map.put(program, :input, input) program |> Map.get(:instructions, []) |> Enum.reduce(program, &execute/2) end defp execute({"inp", [a]}, %{input:...
039de34b9a4da0d635b3a2c0ac4be9bcaddd4eff
3,344
[ 318080976 ]
[]
defmodule Aoc2020.Day12 do def parse("N" <> number), do: {:north, String.to_integer(number)} def parse("S" <> number), do: {:south, String.to_integer(number)} def parse("E" <> number), do: {:east, String.to_integer(number)} def parse("W" <> number), do: {:west, String.to_integer(number)} def parse("L" <> numb...
039e754703dbc4ee63fc2f056b2200b30ae39a72
2,128
[ 761929336 ]
[]
defmodule RssAutoGenerator.FeedAnalyzer.LlmAnalyzer do alias RssAutoGenerator.FeedAnalyzer.HtmlSelectors def get_html_selectors(html) do max_length = 65_536 if String.length(html) > max_length do {:error, "HTML content is too large to be analyzed"} else try do Instructor.chat_compl...
039f20093fedd61b2becb4b9713ca628ee5197f6
5,240
[ 429142740, 888628980, 336673860, 314109232, 299711271, 429363580, 575166467, 851844573, 336679900, 297389399, 264829031, 766605102 ]
[ "documented" ]
defmodule Credo.Check.Readability.LargeNumbers do use Credo.Check, base_priority: :high, tags: [:formatter], param_defaults: [ only_greater_than: 9_999 ], explanations: [ check: """ Numbers can contain underscores for readability purposes. These do not affect the value of t...
039f4024a706891a8cb68995eb3a7ca75a5a3058
1,894
[ 817033014 ]
[]
defmodule LightViewStudio.Stores do def search_by_zip(zip) do :timer.sleep(2000) list_stores() |> Enum.filter(&(&1.zip == zip)) end def search_by_city(city) do :timer.sleep(2000) list_stores() |> Enum.filter(&(&1.city == city)) end def list_stores do [ %{ name:...
039f431f8156951cfaf3e10c08c85f4701380d61
3,062
[ 183007064 ]
[ "documented" ]
defmodule Edns.Zone.Parser do @moduledoc false # %{ # name: "withzonecut.com", # records: [ # %{ # data: %{ # expire: 604800, # minimum: 86400, # mname: "ns1.example.com", # refresh: 28800, # retry: 7200, # rname: "ahu.example.com", ...
039f467d67e729b57667445f63e553c2a477f6d7
1,966
[ 319207521, 95277047 ]
[]
defmodule MangoWeb.BotChannel do use MangoWeb, :channel alias Mango.Sales def join("pos", _payload, socket) do welcome_text = "Hello! Welcome to Mango Point of Sale" {:ok, %{message: welcome_text}, socket} end def handle_in("status", payload, socket) do reply = case Sales.get_order(payload["mess...
039fba45fe53ea52ee99620a1d5b999e11d79a0d
5,326
[ 163002453 ]
[ "phoenix" ]
defmodule AcariServerWeb.Api.BogatkaController do use AcariServerWeb, :controller alias AcariServer.UserManager.Guardian alias AcariServer.AuditManager def sign_in(conn, %{"username" => username, "password" => password}) do case AcariServer.UserManager.authenticate_user(username, password) do {:ok, u...
039fd4c1315589a7ee00d6441c22308b018958e4
3,280
[ 918753408 ]
[ "phoenix" ]
defmodule NastyWeb.Router do use NastyWeb, :router import NastyWeb.UserAuth pipeline :browser do plug :accepts, ["html"] plug :fetch_session plug :fetch_live_flash plug :put_root_layout, html: {NastyWeb.Layouts, :root} plug :protect_from_forgery plug :put_secure_browser_headers plug ...
03a070b178b0d3e626ff9b214e7306b18b35bf80
6,293
[ 949664843 ]
[ "documented" ]
defmodule Raxol.UI.Layout.Table do @moduledoc """ Handles measurement and positioning logic for Table elements within the LayoutEngine. """ import Raxol.Guards require Raxol.Core.Runtime.Log @doc """ Measures the required space for a table and returns a single positioned table element. """ def meas...
03a07955a3e4b2861b0ae2af453619cddf7c750c
11,771
[ 188160966 ]
[ "documented" ]
defmodule Rides.Manifest.Schema do @moduledoc """ Provides Schema definition and validating operations around Manifest Ensures a given Manifest is well formed. Uses a pipe-line flow for validation. Flips field mappings from initial format for easier response processing Strives to be extendable """ re...
03a0af04dbc95bd0b54afd058966614a19cd2338
5,424
[ 375028329 ]
[ "genserver" ]
defmodule Vehicle do use GenServer use Vex.Struct require Logger alias Engine.ES alias Engine.Adapters.{RMQ, RMQRPCWorker} @derive Jason.Encoder @rmq Application.get_env(:engine, Adapters.RMQ) defstruct [ :id, :activities, :booking_ids, :start_address, :end_address, :earliest_st...
03a10026fc3bde3faf457615c546adda2d5105fa
3,157
[ 74090198 ]
[ "genserver" ]
defmodule EENETGS do use GenServer @bootstrap :"a@wolv-MacBookAir" # CLIENT def setup(username) do start(username) connect(@bootstrap) Process.sleep 300 members = request_usernames Process.sleep 300 set_members(members) Process.sleep 300 announce(username) IO.puts "Setup c...
03a13ceb8b30dbf4fae0d05b9ada3cc4c1913547
6,307
[ 183218490 ]
[ "genserver", "macro", "phoenix" ]
defmodule AeChannelInterfaceWeb.SocketConnectorChannel do use AeChannelInterfaceWeb, :channel require Logger defmacro keypair_initiator, do: Application.get_env(:ae_socket_connector, :accounts)[:initiator] defmacro keypair_responder, do: Application.get_env(:ae_socket_connector, :accounts)[:responder] def s...
03a17c5e06e30028fd043c0696c8f08ca1489bdc
1,732
[ 765943890 ]
[ "liveview", "phoenix" ]
defmodule GitsWeb.Endpoint do alias GitsWeb.CacheBodyReader # use Sentry.PlugCapture use Phoenix.Endpoint, otp_app: :gits # 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. @sess...
03a1f5bc9e79926af8985ea113db209790ac90ec
1,601
[ 136072028, 155522895 ]
[ "macro", "documented", "phoenix" ]
defmodule ProjectWeb 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 ProjectWeb, :controller use ProjectWeb, :view The definitions below will be executed for every view, controller, ...
03a203975e6be53fe5c6dac0dc13cd773557f9c1
12,929
[ 543302849 ]
[ "ecto" ]
defmodule Mnemo.Access.Schemas.Block do use Mnemo.Access.Schemas.Schema alias Ecto.Multi alias Mnemo.Access.Schemas.{Subject, Section, Enrollment} @derive {Jason.Encoder, only: [ :id, :section_id, :type, :testable, :order_in_section, ...
03a2835091a0c7ce17008650dd21cb7eeca43951
1,544
[ 873203197 ]
[ "phoenix" ]
defmodule AtlasWeb.Router do use AtlasWeb, :router pipeline :browser do plug :accepts, ["html"] plug :fetch_session plug :fetch_live_flash plug :put_root_layout, html: {AtlasWeb.Layouts, :root} plug :protect_from_forgery plug :put_secure_browser_headers end pipeline :api do plug :a...
03a2fb38b671241afca1234a86fdd73b5a27ecbc
3,211
[ 530275350 ]
[ "test", "documented" ]
defmodule DayEightTest do use ExUnit.Case import DayEight import TestHelpers @docp """ TDD todo list [ ] [x] parse line [x] decode line [x] figure out top [x] figure out bottom [x] find zero [x] find one [x] find two [x] find three [x] find four [x] find five [x] find six [x] find ...
03a2fee26dc6e16e8c8f2e3cf9c76f88e2402b6d
1,651
[ 341887117 ]
[]
defmodule MRnaProcessor1 do @stop_codons ["UAA", "UAG", "UGA"] def get_genes(rna_input) do sequence = clean_sequence(rna_input) with :ok <- validate_length(sequence), :ok <- validate_chars(sequence) do do_get_genes(sequence) end end defp clean_sequence(rna_input) do rna_input |...
03a30e6b6caa0fd64dd756aeafe752c24e25c381
2,398
[ 381584288 ]
[]
%{ "dialyxir": {:hex, :dialyxir, "1.4.3", "edd0124f358f0b9e95bfe53a9fcf806d615d8f838e2202a9f430d59566b6b53b", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "bf2cfb75cd5c5006bec30141b131663299c661a864ec7fbbc72dfa557487a986"}, "elixir_make": {:hex, :elixir_make, "0.8.4", "496...
03a353f07d5155f66689a8f9ba92c5a4eb0b419c
2,269
[ 741208583 ]
[ "documented" ]
defmodule MdTools.SearchFts.Db do @moduledoc "Sqlite full-text-search operations." alias Exqlite.Sqlite3 alias MdTools.Util alias MdTools.Doc.Section def open do open(":memory:") end def open(":memory:") do {:ok, conn} = Sqlite3.open(":memory:") migrate(conn) end def open(dbfile) do ...
03a3a330e7277abe6e7c4267589bfc374ea48524
3,714
[ 151586701 ]
[ "typespec", "documented" ]
defmodule MLLP.Envelope do @moduledoc """ Helper functions encoding and decoding MLLP-framed messages. Below is an example of an MLLP-framed HL7 payload. Note the <SB>, <CR>, and <EB> characters. <SB> MSH|^~\\\\&|MegaReg|XYZHospC|SuperOE|XYZImgCtr|20060529090131-0500||ADT^A01^ADT_A01|01052901|P|...
03a3a658da0c8c6e8ce7da034a68f11a6c1bcac5
2,658
[ 623745058 ]
[ "liveview", "test" ]
defmodule SlippiChatWeb.MagicLoginLiveTest do use SlippiChatWeb.ConnCase, async: false import Phoenix.LiveViewTest import SlippiChat.AuthFixtures alias SlippiChat.Auth describe "GET /magic_log_in" do setup do user = user_fixture(%{connect_code: "ABC#123"}) %{user: user} end test "r...
03a3bdce3a3b00f36babe0e2f2a7579c551888ce
1,948
[ 153521158 ]
[ "test", "ecto" ]
defmodule TaskTracker.TasksTest do use TaskTracker.DataCase alias TaskTracker.Tasks describe "tasks" do alias TaskTracker.Tasks.Task @valid_attrs %{done: true, name: "some name"} @update_attrs %{done: false, name: "some updated name"} @invalid_attrs %{done: nil, name: nil} def task_fixture...