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 |
|---|---|---|---|---|
02ad7abab7864466357e8713c4dea463a9873269 | 4,107 | [
835537002
] | [
"typespec",
"macro",
"documented"
] | defmodule Sutra.Data.MacroHelper.ObjectMacro do
@moduledoc """
Macro Helper for Object Macros
"""
alias __MODULE__, as: ObjectMacro
alias Sutra.Data.MacroHelper
alias Sutra.Data.Plutus.Constr
def __define_object__(opts, block) do
ast = __setup__object__(block, opts)
case opts[:name] do
... |
02ad861bbde2d3fce942c0bb2e70aa50360fb5a8 | 6,591 | [
1005405181
] | [] | %{
"cc_precompiler": {:hex, :cc_precompiler, "0.1.10", "47c9c08d8869cf09b41da36538f62bc1abd3e19e41701c2cea2675b53c704258", [:mix], [{:elixir_make, "~> 0.7", [hex: :elixir_make, repo: "hexpm", optional: false]}], "hexpm", "f6e046254e53cd6b41c6bacd70ae728011aa82b2742a80d6e2214855c6e06b22"},
"db_connection": {:hex, :d... |
02adac8f0f051f5d45aa1ca5b13bb8779c2b4513 | 3,808 | [
638829513
] | [
"liveview",
"test"
] | defmodule PentoWeb.ProductLiveTest do
use PentoWeb.ConnCase
import Phoenix.LiveViewTest
import Pento.CatalogFixtures
@create_attrs %{description: "some description", name: "some name", sku: 42, unit_price: 120.5}
@update_attrs %{description: "some updated description", name: "some updated name", sku: 43, un... |
02adb561bb74de99674adf14c14cf1023565ec1c | 2,033 | [
535451193
] | [
"documented",
"ecto"
] | defmodule Fawkes.Chat.Message do
@moduledoc """
The Chat.Message context.
"""
import Ecto.Query, warn: false
alias Fawkes.Repo
alias Fawkes.Chat.Message.Message
@limit 100
@doc """
Returns the list of messages.
## Examples
iex> list_messages()
[%Message{}, ...]
"""
def list_mes... |
02adc35b517255536fcd42d3b69313f6765bd260 | 2,300 | [
942811655,
920024200
] | [
"test"
] | defmodule Ppl.OrgEventsConsumer.Test do
use Ppl.IntegrationCase, async: false
alias InternalApi.Organization.OrganizationBlocked
alias Ppl.{Actions, OrgEventsConsumer}
alias Util.Proto
setup do
Test.Helpers.truncate_db()
purge_queue("blocked")
:ok
end
def purge_queue(queue) do
{:ok, ... |
02add9a2022d17ef524c22b86493b256907e747d | 2,479 | [
573087826
] | [] | defmodule Paths do
def points([{x1, y1}, {x2, y2}]) when x1 == x2 do
for y <- y1..y2 do
{x1, y}
end
end
def points([{x1, y1}, {x2, y2}]) when y1 == y2 do
for x <- x1..x2 do
{x, y1}
end
end
def get_points(input) do
input
|> Enum.map(
&(String.trim(&1)
|> Stri... |
02ae4b0fc7ea46015e42fe60d8b214456548b507 | 1,595 | [
125284074
] | [
"documented"
] | defmodule Matchmaking.Model.ActiveUser do
alias :mnesia, as: Mnesia
require Logger
@table Matchmaking.Model.ActiveUser
@attributes [
:id, # user UUID
:created_at # when the user was added
]
@doc """
Initializing the node in a cluster.
"""
def init_store() do
Mnesia.create_ta... |
02aec80e17de478903d9dd80c1335edf3ae8a898 | 1,738 | [
617490870
] | [] | defmodule ChatBots.Fixtures do
alias ChatBots.Repo
alias ChatBots.Bots.Bot
def api_success_fixture(response_text) do
{:ok,
%{
choices: [
%{
"finish_reason" => "stop",
"index" => 0,
"message" => %{
"content" => response_text,
"rol... |
02aed289eea687a414fdc231c78ed358d9b0ca3e | 2,113 | [
980258557
] | [] | # 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 :ecto_schema_prefixes,
ecto_repos: [EctoSche... |
02af305a9d175a276201591762009c6599dfd43e | 1,508 | [
168753881,
333694281
] | [
"phoenix"
] | defmodule CforumWeb.Admin.AdventCalendarView do
use CforumWeb, :view
alias Cforum.Helpers
alias CforumWeb.ErrorHelpers
alias CforumWeb.Views.ViewHelpers
def page_title(action, _) when action in [:index_years], do: gettext("administrate advent calendars")
def page_title(:index, %{year: year}), do: gettext... |
02af6643fa3a907cd79a2cf3ca549dc54ad499ee | 3,202 | [
489294370
] | [
"test"
] | defmodule RecipeTest do
use ExUnit.Case, async: true
doctest Relix
alias Relix.Recipe
@draft :draft
@approved :approved
test "create recipe" do
assert Recipe.new(1, "Recipe1", "RECIPE", %{}) |> elem(1) == %Recipe{
id: 1,
name: "Recipe1",
type: "RECIPE",
... |
02af800f22b933c456218f2f36a13cae75ef1711 | 3,138 | [
434336328
] | [] | Mix.install([
{:priority_queue, "1.0.0"}
])
defmodule Solution do
def part1(input) do
grid = parse_input(input)
{r, c} = shape(grid)
risk = Enum.map(grid, fn {k, _} -> {k, 99_999_999_999} end) |> Enum.into(%{})
risk = Map.put(risk, {0, 0}, 0)
open = PriorityQueue.new() |> PriorityQueue.put({0,... |
02b07a607c46a594ef87bc6acdba0310af4f0ea3 | 1,952 | [
113799071
] | [] | defmodule Dec7 do
@filename "dec_7_test.txt"
@bag "shiny gold"
def perform do
map = parse_file()
|> Enum.map(&parse_line/1)
|> create_map
find_count([@bag], map)
end
def find_count([parent], map) do
children = map[parent]
if(children == [:end]) do
0
else
children
... |
02b081f6d1108c0e58475e05f9e6bf11706dadb4 | 3,673 | [
138734570
] | [
"documented"
] | defmodule X509.SignatureAlgorithm do
@moduledoc false
import X509.ASN1
alias X509.Util
@edwards_curves [oid(:"id-Ed25519"), oid(:"id-Ed448")]
# Returns a signature algorithm record for the given public key type and hash
# algorithm; this is essentially the reverse of
# `:public_key.pkix_sign_types/1`
... |
02b0b6edf32ff2008f6f87560572571841681d52 | 4,923 | [
897037238
] | [] | defmodule Day15.Solution do
def solve_question_1 do
{map, moves} = get_data()
moves
|> Enum.reduce(map, &apply_move(&2, &1))
|> get_gps_coordinates_sum()
end
def solve_question_2 do
{map, moves} = get_data(expand: true)
moves
|> Enum.reduce(map, &apply_move(&2, &1, 2))
|> get_gp... |
02b0ef5451e04a9c23ae478bcecb040865919bb1 | 2,133 | [
969999971
] | [
"documented"
] | defmodule DeeperHub.Core.Data.Migrations.BxTasksVideosResized do
@moduledoc """
Migration para criar e remover a tabela bx_tasks_videos_resized.
"""
alias DeeperHub.Core.Data.Repo
alias DeeperHub.Core.Logger
require DeeperHub.Core.Logger
@doc """
Cria a tabela de bx_tasks_videos_resized.
"""
def u... |
02b10c9cc2fa0a4f325379b27a1b646036346e2b | 2,154 | [
312497516
] | [
"typespec",
"macro",
"documented"
] | defmodule Absinthe.ConnTest do
@moduledoc """
Conveniences for testing GraphQL APIs.
You'll probably want to import this module in your `ConnCase`.
"""
alias Absinthe.ConnTest.HTTP
alias Absinthe.ConnTest.Loader
alias Absinthe.ConnTest.Loader.Query
@type query :: String.t()
@type variables :: keywo... |
02b10f94c0f818f6561df70bfe5884cee028eb58 | 3,063 | [
76962302
] | [] | defmodule Advent10 do
@initial_state %{
outputs: %{},
bots: %{},
}
def assign_values(state, bot_n, low, high, low_target, high_target) do
with {:ok, state1} = assign_value(state, bot_n, low, low_target),
{:ok, state2} = assign_value(state1, bot_n, high, high_target),
do: {:ok, state2}
... |
02b1c7b269e0a5f3be140175096fec25c5c081e2 | 1,848 | [
336019332
] | [
"documented"
] | defmodule Mix.Tasks.Phx.Gen.Theme do
use Mix.Task
@start_apps [
:porcelain
]
@shortdoc "Import Tim's Creative's Material Dashboard Pro & Damien's phoenix_form.js"
@moduledoc """
"""
@doc false
def run(args) do
# Application.put_env(:phoenix, :serve_endpoints, true, persistent: true)
# M... |
02b1db2251e41205e808d413aef52c7f002fdc6e | 1,530 | [
213393984
] | [] | defmodule Metrecord.Events.Subscription do
import HTTPoison
import Poison
def get_invoice_for_subscription(sub_id) do
url = "https://api.stripe.com/v1/invoices/upcoming?subscription=#{sub_id}"
headers = %{
"Content-Type" => "application/x-www-form-urlencoded",
"Authorization" => "Bearer #{App... |
02b2005c3ffbb9d52990611f7f796589015029f5 | 1,692 | [
54864850
] | [
"macro",
"documented",
"ecto",
"phoenix"
] | defmodule Basedef.Web do
@moduledoc """
A module that keeps using definitions for controllers,
views and so on.
This can be used in your application as:
use Basedef.Web, :controller
use Basedef.Web, :view
The definitions below will be executed for every view,
controller, etc, so keep them sho... |
02b2462913f1a73eed450e0b9365ae78d0ae6e99 | 1,607 | [
331125897
] | [
"phoenix"
] | defmodule HomeAppliancesStoreWeb.Order_statusesController do
use HomeAppliancesStoreWeb, :controller
alias HomeAppliancesStore.Schema
alias HomeAppliancesStore.Schema.Order_statuses
action_fallback HomeAppliancesStoreWeb.FallbackController
def index(conn, _params) do
order_status = Schema.list_order_st... |
02b2463ef147322d7d958e4e7416734fe1ace9b2 | 1,581 | [
102964681
] | [
"macro",
"documented",
"ecto",
"phoenix"
] | defmodule News.Web do
@moduledoc """
A module that keeps using definitions for controllers,
views and so on.
This can be used in your application as:
use News.Web, :controller
use News.Web, :view
The definitions below will be executed for every view,
controller, etc, so keep them short and cl... |
02b25b32e9534b2d83d203f8066ff4ef54402510 | 2,427 | [
59521695
] | [
"test"
] | defmodule Babukay.LocationPairControllerTest do
use Babukay.ConnCase
alias Babukay.LocationPair
@valid_attrs %{lat: "some content", long: "some content"}
@invalid_attrs %{}
setup %{conn: conn} do
{:ok, conn: put_req_header(conn, "accept", "application/json")}
end
test "lists all entries on index", ... |
02b30f98bb7f21c8c6573e34627e64221339d5b9 | 1,666 | [
322744552
] | [
"ecto"
] | defmodule Cmcscraper.Schemas.Portfolio do
alias Cmcscraper.Schemas.Currency
use Ecto.Schema
import Ecto.Changeset
schema "portfolio" do
field :purchase_date, :utc_datetime
field :purchase_price, :decimal
field :percentage_change_requirement, :decimal
field :volume, :decimal
field :sell_pric... |
02b335c60b03a3084863cf0f9e14d116923d4bee | 2,711 | [
53761244
] | [
"genserver"
] | defmodule Bitpet.Simulation do
use GenServer
alias Bitpet.Pet, as: Pet
alias Bitpet.House, as: House
@tick_time_in_ms 30 * 1000 # Every 30 seconds.
# API
def start_link do
GenServer.start_link(__MODULE__, nil, name: :pet_simulation)
end
def get_house(id) do
GenServer.call(:pet_simulation, {:... |
02b345c077aa10624b4680f47bfcbed870da368c | 2,392 | [
845919738,
175504759,
59903606,
244739739,
742223712,
151525383
] | [
"documented"
] | defmodule Money do
@moduledoc ~S"""
`Money` represents some monetary value (stored in cents) in a given currency.
See `Money.Ecto` for a custom type implementation that can be used in schemas.
In order to use the `~M` sigil, import the module:
import Money
## Examples
iex> Money.new("10.0... |
02b365dad803276e0ce4ddedb6a838071b4f268b | 17,567 | [
216257519
] | [
"genserver"
] | defmodule TapestryNode do
use GenServer, restart: :temporary
@nodeLength 8
def start_link([x, num_created, numRequests]) do
[{_, nodeid}] = :ets.lookup(:hashList, Integer.to_string(x))
GenServer.start_link(__MODULE__, {nodeid, num_created, numRequests},
name: String.to_atom("n#{nodeid}")
)
... |
02b37b3d5c679fe436f032465cea9aab7a919153 | 16,313 | [
96920046
] | [
"liveview",
"phoenix",
"test"
] | defmodule PhoenixSeaBattleWeb.GameTest do
use PhoenixSeaBattleWeb.ConnCase, async: true
import Phoenix.LiveViewTest
alias PhoenixSeaBattle.Game.Supervisor, as: GameSupervisor
alias PhoenixSeaBattle.GameServer
alias PhoenixSeaBattleWeb.Game, as: GameLive
@ghost_cell "[\n\s\r]*<div phx-value=\"\\d{1,2}\" cla... |
02b4b3b9b637852e281499da8442da885360f3c5 | 5,812 | [
996163577
] | [
"liveview"
] | defmodule EcommerceFinalWeb.Public.ProductGalleryComponent do
alias EcommerceFinal.Catalog
use EcommerceFinalWeb, :live_component
@impl true
def render(assigns) do
~H"""
<div>
<div class="flex justify-between">
<div>
<form
class="self-end"
id="price_range_... |
02b4f047bd120d063064324c1e0deed95adc3801 | 2,476 | [
874035002
] | [
"typespec",
"macro",
"documented"
] | defmodule BinStructOptionsInterface do
@moduledoc """
```elixir
iex> defmodule SharedOptions do
...> use BinStructOptionsInterface
...>
...> @type runtime_context1 :: :context_a
...> @type runtime_context2 :: :context_b
...>
...> register_option :runtime_context1
...> register_option :run... |
02b4f8009581a84d12faf62fbea2e2096ab01d3c | 3,680 | [
468342684
] | [
"phoenix",
"ecto"
] | defmodule DbserviceWeb.SubjectController do
use DbserviceWeb, :controller
import Ecto.Query
alias Dbservice.Repo
alias Dbservice.Subjects
alias Dbservice.Subjects.Subject
action_fallback(DbserviceWeb.FallbackController)
use PhoenixSwagger
alias DbserviceWeb.SwaggerSchema.Subject, as: SwaggerSchemaSu... |
02b5163acd9bf9d9fa0fba88d25bb2d9ba1e635e | 7,495 | [
677106495
] | [
"phoenix"
] | defmodule WalkaroundWeb.AuthController do
require Logger
use WalkaroundWeb, :controller
alias Walkaround.Data
alias Walkaround.Data.User
alias WalkaroundWeb.AuthPlugs
def signup(conn, _params) do
changeset = User.changeset(%User{}, %{}, :owner)
render(conn, "signup.html", changeset: changeset, page... |
02b55c54b8224fb9da28b9dbd9ad0cc77cb10002 | 2,089 | [
997902970
] | [
"typespec"
] | defmodule Atex.IdentityResolver do
alias Atex.IdentityResolver.{Cache, DID, DIDDocument, Handle, Identity}
@handle_strategy Application.compile_env(:atex, :handle_resolver_strategy, :dns_first)
@type options() :: {:skip_cache, boolean()}
# TODO: simplify errors
@spec resolve(String.t(), list(options())) ::... |
02b5aca612bcc7f900dc038209dccd21717830a1 | 3,551 | [
95859922
] | [
"typespec",
"documented"
] | defmodule LanguageList do
@moduledoc """
## Instructions
In this exercise you need to implement some functions to manipulate a list of programming languages.
## 1. Define a function to return an empty language list
Define the `new/0` function that takes no arguments and returns an empty list.
... |
02b6291a58d2547ac58b0a2180446f56ec7158cc | 1,673 | [
260770749
] | [
"test"
] | defmodule PizzaPartyWeb.GraphQL.UpdatePizzaTest do
use PizzaPartyWeb.ConnCase
alias PizzaParty.Pizzas
describe "mutation updatePizza" do
test "can update a pizza in the database", %{conn: conn} do
query = """
mutation updatePizza($id: UUID!, $name: String!){
updatePizza(id: $id, name: $na... |
02b642bd04dfe5d0a72280c4518f1b6f1d548d93 | 2,176 | [
68899936
] | [
"genserver",
"documented"
] | defmodule DummyGpioRpi do
use GenServer
@moduledoc """
Stand in for GpioRpi in development mode
"""
defstruct pin: 0, direction: nil, pin_states: []
def start_link(pin, direction, supplied_opts \\ nil) do
opts = supplied_opts || [name: :"gpio_#{pin}"]
GenServer.start_link(__MODULE__, {pin, direct... |
02b64ea0fb576622ff90e16aaa6e3d99f5f54ebe | 3,740 | [
864703000
] | [
"typespec",
"documented"
] | defmodule Horizon.Project do
@moduledoc """
Project configuration for web based projects.
- `server_names` - List of recognized host names that can be received by nginx.
- `certificate` - The certificate to use for the project. Can be `nil`, `:self`, or `:letsencrypt`.
- `authenticator` - The authent... |
02b69b09c2a127719331fc33f34b467386a8fe4f | 7,869 | [
409417669
] | [
"ecto"
] | defmodule Mrgr.Schema.RepositorySettings do
use Mrgr.Schema
@primary_key false
embedded_schema do
field(:dismiss_stale_reviews, :boolean, default: true)
field(:required_approving_review_count, :integer, default: 0)
field(:merge_commit_allowed, :boolean, default: false)
field(:rebase_merge_allowe... |
02b6a4a4e73aab4d919cbf656b8545e272909a3d | 1,525 | [
441933812
] | [] | defmodule Servy.Plugins do
require Logger
alias Servy.Conv
def emojify(%Conv{status: 200} = conv) do
%{conv | resp_body: "🙂🙂🙂\n" <> conv.resp_body <> "\n🙂🙂🙂"}
end
def emojify(%Conv{} = conv), do: conv
def track(%Conv{status: 404, path: path} = conv) do
if Mix.env() != :test do
Logger... |
02b6bdd284dd7786b0e896c7d8b5cf8484c53a65 | 1,603 | [
74213191
] | [
"macro",
"documented",
"ecto",
"phoenix"
] | defmodule Hotels.Web do
@moduledoc """
A module that keeps using definitions for controllers,
views and so on.
This can be used in your application as:
use Hotels.Web, :controller
use Hotels.Web, :view
The definitions below will be executed for every view,
controller, etc, so keep them short ... |
02b7fc50991cb0404d08886204248b5d1cbbd625 | 6,567 | [
886281823
] | [
"liveview",
"test"
] | defmodule ValentineWeb.WorkspaceLive.Mitigation.IndexTest do
use ValentineWeb.ConnCase
alias Valentine.Composer
import Mock
import Valentine.ComposerFixtures
setup do
workspace = workspace_fixture()
mitigation = mitigation_fixture(%{workspace_id: workspace.id})
socket = %Phoenix.LiveView.Socket... |
02b81d77ad6a3d2fcd2de6b3e842181b34a360ff | 2,409 | [
93394528
] | [
"genserver",
"documented"
] | defmodule ZssClient.Mocks.Adapters.Socket do
@moduledoc false
@behaviour ZssClient.Sender
use GenServer
defmodule State do
@moduledoc false
defstruct [
state: :disabled,
handlers: %{}
]
end
def start do
GenServer.start_link(__MODULE__, [], name: __MODULE__)
end
def init(... |
02b83c41806491c3ebbba0deb15fef17ee10be8d | 4,275 | [
85140385,
73516692,
91157211,
78030894,
85692529,
94545160,
307413550
] | [
"typespec",
"documented"
] | defmodule Timex.Format.DateTime.Formatters.Strftime do
@moduledoc """
Date formatting language defined by the `strftime` function from the Standard
C Library.
This implementation in Elixir is mostly compatible with `strftime`. The
exception is the absence of locale-depended results. All directives that imply... |
02b909c60154a0a0c73cc916794a4156a52d34d8 | 3,678 | [
483910748
] | [
"test"
] | defmodule Midterm.BlocksProcessorHelpersTest do
use Midterm.DataCase, async: true
alias Midterm.DataFeed.BlockProcessorHelpers
import Midterm.AccountsFixtures
import Midterm.BlockFixtures
describe "send_notifications/2" do
test "returns true when preferences are satisfied" do
account = account_fix... |
02b94a43a2444b226b89175147c6ba10b950d4ad | 1,764 | [
735817642
] | [
"phoenix"
] | defmodule ExLiveReqCounterWeb.Router do
use ExLiveReqCounterWeb, :router
pipeline :browser do
plug :accepts, ["html"]
plug :fetch_session
plug :fetch_live_flash
plug :put_root_layout, html: {ExLiveReqCounterWeb.Layouts, :root}
plug :protect_from_forgery
plug :put_secure_browser_headers
en... |
02b94b2281379b7db711481eeae27cc505684895 | 2,863 | [
715333338
] | [
"documented",
"ecto"
] | defmodule ChallengeBackend.Accounts do
@moduledoc """
The Accounts context.
"""
import Ecto.Query, warn: false
alias ChallengeBackend.Repo
alias ChallengeBackend.Accounts.UserAccount
@doc """
Gets a single user_account.
## Examples
iex> get_user_account(123)
{:ok, %UserAccount{}}
... |
02b98f4f238bb4260343879523152bb4366b95d6 | 2,163 | [
402304399
] | [
"liveview",
"ecto"
] | defmodule IndiePaperWeb.BookProductLive.FormComponent do
use IndiePaperWeb, :live_component
alias IndiePaper.Products
alias IndiePaper.Books
@impl true
def update(%{product: product} = assigns, socket) do
changeset = Products.change_product(product)
{:ok,
socket
|> assign(assigns)
|>... |
02b9b620bd8c1cbe7a1cbdf32baf25e95000e09d | 2,131 | [
39919111
] | [
"documented"
] | defmodule FinTex.Model.Response do
@moduledoc false
defstruct [
:index_by_segment_names,
:index_by_reference
]
def new(segments) do
index_by_segment_names = segments
|> Enum.group_by(fn s -> s.segment |> Enum.at(0, []) |> Enum.at(0) end)
|> Map.new(fn {k, v} -> {k, v |> Enum.sort(&sort_seg... |
02ba04481ffbb1785f1d0e2ae1f4e7fbc51125fe | 10,990 | [
233979945
] | [] | %{
"absinthe": {:hex, :absinthe, "1.4.16", "0933e4d9f12652b12115d5709c0293a1bf78a22578032e9ad0dad4efee6b9eb1", [:mix], [{:dataloader, "~> 1.0.0", [hex: :dataloader, repo: "hexpm", optional: true]}, {:decimal, "~> 1.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm"},
"absinthe_ecto": {:hex, :absinthe_ect... |
02ba1732a6716dd43f6c961a4c0612d77be19cf4 | 1,987 | [
485787054
] | [
"macro",
"documented",
"ecto",
"phoenix"
] | defmodule Discovery.Web do
@moduledoc """
A module that keeps using definitions for controllers,
views and so on.
This can be used in your application as:
use Discovery.Web, :controller
use Discovery.Web, :view
The definitions below will be executed for every view,
controller, etc, so keep th... |
02ba245d10fd48e109273beca500d05fc69c68d2 | 1,723 | [
88852489
] | [
"typespec",
"documented"
] | defmodule ProteinTranslation do
@stop "STOP"
@doc """
Given an RNA string, return a list of proteins specified by codons, in order.
"""
@spec of_rna(String.t()) :: {atom, list(String.t())}
def of_rna(rna) do
proteins =
rna
|> String.to_charlist()
|> Enum.chunk_every(3)
|> Enum.m... |
02baf726af62eab9795462fc177b6f4797c0610b | 1,713 | [
76044582
] | [
"macro",
"documented",
"ecto",
"phoenix"
] | defmodule ArcVulnerability.Web do
@moduledoc """
A module that keeps using definitions for controllers,
views and so on.
This can be used in your application as:
use ArcVulnerability.Web, :controller
use ArcVulnerability.Web, :view
The definitions below will be executed for every view,
contro... |
02bb230a42fa0802bb7b18b1c69e02de3e04fefe | 10,923 | [
54100077
] | [] | %{"alchemic_avatar": {:hex, :alchemic_avatar, "0.1.2", "fb7a71f3c7d8fdd860e23e36017cb19015617a1e729c9c6245872a004248b98a", [:mix], []},
"alchemic_pinyin": {:hex, :alchemic_pinyin, "0.1.2", "cc7320f360063215c7db0afd98dfde3cb679f38644d4d12a70e849a76ae4abb6", [:mix], []},
"bbmustache": {:hex, :bbmustache, "1.0.4", "7b... |
02bb44351a3cf5e5ec5e1a83216ae6c6c05c21f2 | 2,094 | [
969999971
] | [
"documented"
] | defmodule DeeperHub.Core.Data.Migrations.BxPostsReactionsTrack do
@moduledoc """
Migration para criar e remover a tabela bx_posts_reactions_track.
"""
alias DeeperHub.Core.Data.Repo
alias DeeperHub.Core.Logger
require DeeperHub.Core.Logger
@doc """
Cria a tabela de bx_posts_reactions_track.
"""
de... |
02bb607dfefb6e507d9fc09488cfd140c885dcb1 | 3,167 | [
113489997
] | [
"test"
] | defmodule ResultTest do
use ExUnit.Case, async: true
describe "Lift" do
test "Puts a value into an Ok type" do
assert Result.lift(%Maybe.Ok{}, 10) == %Maybe.Ok{value: 10}
end
test "If it's already an Ok it doesn't nest it" do
assert Result.lift(%Maybe.Ok{}, %Maybe.Ok{value: 10}) == %Maybe.... |
02bb6a5265cbf6ad567d498bcf704e3de71e17ca | 5,482 | [
163277988
] | [
"typespec",
"supervisor",
"documented"
] | defmodule Horde.Supervisor do
@moduledoc """
A distributed supervisor.
Horde.Supervisor implements a distributed DynamicSupervisor backed by a add-wins last-write-wins δ-CRDT (provided by `DeltaCrdt.AWLWWMap`). This CRDT is used for both tracking membership of the cluster and tracking supervised processes.
Us... |
02bb864fbc0435823c2e8bfe45dbbd3b8e101963 | 2,154 | [
562030130
] | [] | defmodule ScrumPoker.MixProject do
use Mix.Project
def project do
[
app: :scrum_poker,
version: "0.1.0",
elixir: "~> 1.12",
elixirc_paths: elixirc_paths(Mix.env()),
start_permanent: Mix.env() == :prod,
aliases: aliases(),
deps: deps()
]
end
# Configuration for... |
02bbaa88b93f72521b701e28f81987cdae72ebca | 2,338 | [
448017568,
544019862
] | [
"liveview",
"ecto"
] | defmodule LiveViewStudioWeb.ServerFormComponent do
use LiveViewStudioWeb, :live_component
alias LiveViewStudio.Servers
alias LiveViewStudio.Servers.Server
def mount(socket) do
changeset = Servers.change_server(%Server{})
{:ok, assign(socket, changeset: changeset)}
end
def render(assigns) do
... |
02bc5b60474b94b38461a102fd19554a5e0d7062 | 3,970 | [
333182074
] | [] | %{
"certifi": {:hex, :certifi, "2.5.3", "70bdd7e7188c804f3a30ee0e7c99655bc35d8ac41c23e12325f36ab449b70651", [:rebar3], [{:parse_trans, "~>3.3", [hex: :parse_trans, repo: "hexpm", optional: false]}], "hexpm", "ed516acb3929b101208a9d700062d520f3953da3b6b918d866106ffa980e1c10"},
"ex_utils": {:hex, :ex_utils, "0.1.7", ... |
02bc62b7a99192a563afc97c3601380d7490b2b2 | 11,227 | [
162377738
] | [
"phoenix"
] | defmodule Innerpeace.PayorLink.Web.Main.FacilityGroupController do
use Innerpeace.PayorLink.Web, :controller
alias Innerpeace.PayorLink.Web.FacilityGroupView
alias Phoenix.View
alias Innerpeace.Db.Base.LocationGroupContext, as: LGC
alias Innerpeace.Db.{
Schemas.LocationGroup,
Datatables.LocationGroup... |
02bca68a6076c21c3f59cc6f5133c90f4055519c | 2,129 | [
968141480
] | [
"phoenix"
] | defmodule SurveyTwoWeb.Router do
use SurveyTwoWeb, :router
pipeline :browser do
plug :accepts, ["html"]
plug :fetch_session
plug :fetch_live_flash
end
pipeline :react do
plug :browser
plug :put_root_layout, {SurveyTwoWeb.Layouts, :user_root}
plug :protect_from_forgery
plug :put_sec... |
02bce581109faff5fd162e3010f8f4ba04666e7d | 8,972 | [
687974339
] | [] | %{
"certifi": {:hex, :certifi, "2.15.0", "0e6e882fcdaaa0a5a9f2b3db55b1394dba07e8d6d9bcad08318fb604c6839712", [:rebar3], [], "hexpm", "b147ed22ce71d72eafdad94f055165c1c182f61a2ff49df28bcc71d1d5b94a60"},
"combine": {:hex, :combine, "0.10.0", "eff8224eeb56498a2af13011d142c5e7997a80c8f5b97c499f84c841032e429f", [:mix], ... |
02bd922faaebe76c84fb6f1c7f4d9518ebd77b05 | 1,691 | [
166836332
] | [
"macro",
"documented",
"phoenix"
] | defmodule GroupCollectWeb 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 GroupCollectWeb, :controller
use GroupCollectWeb, :view
The definitions below will be executed for every view,... |
02bdb218f6609e716fa75c734fcef8732ccdd896 | 1,892 | [
406973280,
408501944,
270329071,
394476517,
375225210,
268051186,
414277128,
267013137,
379384247,
298445831,
342857505
] | [
"macro",
"documented",
"phoenix"
] | defmodule AuctionWeb 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 AuctionWeb, :controller
use AuctionWeb, :view
The definitions below will be executed for every view,
controller, ... |
02bdb5cae4f45122be6c76d66de66458986dff5a | 6,071 | [
757458855
] | [
"documented",
"ecto"
] | defmodule LoanSavingsSystem.WorkFlows do
@moduledoc """
The WorkFlows context.
"""
import Ecto.Query, warn: false
alias LoanSavingsSystem.Repo
alias LoanSavingsSystem.WorkFlows.WorkFlow
@doc """
Returns the list of tbl_workflows.
## Examples
iex> list_tbl_workflows()
[%WorkFlow{}, ...... |
02bddbf6eab1f43a153c0c3e356f27bd3c87f82c | 5,531 | [
517310017
] | [
"documented"
] | defmodule ExICE.Priv.ConnCheckHandler.Controlling do
@moduledoc false
@behaviour ExICE.Priv.ConnCheckHandler
require Logger
alias ExICE.Priv.{CandidatePair, Checklist, ICEAgent}
alias ExICE.Priv.Attribute.UseCandidate
@impl true
def handle_conn_check_request(ice_agent, pair, msg, %UseCandidate{}) do
... |
02be67331c28f6e0fe7633a26c2f123fc701a490 | 2,045 | [
673362406
] | [
"test"
] | defmodule Trading.Policies.SharedTest do
use ExUnit.Case
@subject Trading.Policies.Shared
describe "summarize_lots/1" do
test "aggregates ramaining lots by day" do
lots = [
{1, ~D[2021-01-01], 1_000_000, 50_000_000},
{1, ~D[2021-01-01], 1_000_000, 50_000_000},
{2, ~D[2021-01-02... |
02bea7be8e0ba71360c9049fb609bc3604764101 | 1,766 | [
216191974
] | [] | defmodule IntercomX.MixProject do
use Mix.Project
def project do
[
app: :intercomx,
version: "0.0.2",
elixir: "~> 1.9",
elixirc_paths: elixirc_paths(Mix.env()),
start_permanent: Mix.env() == :prod,
deps: deps(),
test_coverage: [tool: ExCoveralls],
preferred_cli_e... |
02beba56143039bc1b0a33f97bdbd3c968a1c2c5 | 1,739 | [
216195237
] | [
"documented",
"phoenix"
] | defmodule TaktaWeb.CollectionController do
@moduledoc false
use TaktaWeb, :controller
alias TaktaWeb.CollectionService
alias TaktaWeb.Base.StatusResponse
def create(
%Plug.Conn{assigns: %{user: user}} = conn,
%{"name" => name}
) do
response = CollectionService.create_for_user(user, name)
St... |
02bf2bf85f4d56479a59cba0cce1e8c8ebd169fd | 4,510 | [
248817168
] | [
"documented"
] | defmodule Membrane.RTCP.TransportFeedbackPacket.NACK do
@moduledoc """
Generic Negative Acknowledgment packet that informs about lost RTP packet(s)
Quoting [RFC4585](https://datatracker.ietf.org/doc/html/rfc4585#section-6.2.1):
The Generic NACK is used to indicate the loss of one or more RTP packets.
The los... |
02bfc7451532e4a56910a331dc125162267ee73a | 14,653 | [
989918778
] | [
"documented"
] | defmodule MCPChat.CostTracking.BudgetManager do
@moduledoc """
Budget management for LLM cost tracking.
Handles budget limits, alerts, and spending threshold monitoring
to help users control their AI-related expenses.
"""
require Logger
# Budget manager state
defstruct [
:daily_limit,
:weekly... |
02c031a1dce052430154da938a26c2b88be851a9 | 2,177 | [
433720256
] | [] | defmodule Year2021.Day3 do
def solve do
input =
Application.app_dir(:advent_of_code, "priv/input.2021.3")
|> File.read!
|> String.trim
|> parse
solve_1(input) |> IO.inspect(label: "Part 1")
solve_2(input) |> IO.inspect(label: "Part 2")
end
def parse(input) do
input
|... |
02c03e62d3c0584dad7526b879883ec7d6913764 | 7,387 | [
504330050
] | [
"phoenix",
"ecto"
] | defmodule WhatWhereWhenWeb.EventController do
use WhatWhereWhenWeb, :controller
alias WhatWhereWhen.Events
alias WhatWhereWhen.Events.Event
alias WhatWhereWhen.People.Person
alias WhatWhereWhen.ThemeCamps.Camp
import Ecto.Changeset
def index(conn, _) do
events = Events.list_events()
case get_f... |
02c05385b4d9d2c70b1e7bbb3b9e9ac6e74a67d1 | 2,406 | [
113377673
] | [] | defmodule Maze do
defstruct map: %{}, start: nil
@alphabet ?A..?Z |> Enum.map(&<<&1>>)
def parse(input) do
maze = input
|> String.split("\n", trim: true)
|> Enum.with_index()
|> Enum.reduce(%Maze{}, &parse_maze_line/2)
end
defp parse_maze_line({line, y}, %Maze{} = maze)... |
02c05ba8a6bdda713342e2aab4f85d31f0727df2 | 4,212 | [
48216982
] | [] | defmodule RecruitxBackend.Panel do
import Ecto.Query
alias RecruitxBackend.InterviewPanelist
alias RecruitxBackend.InterviewTypeRelativeEvaluator
alias RecruitxBackend.Repo
alias RecruitxBackend.Role
alias RecruitxBackend.SignUpEvaluator
alias RecruitxBackend.SlotPanelist
alias RecruitxBackend.TimexHel... |
02c0ff93162bfcb439eb57ac65f37f0795be5120 | 3,578 | [
434022091
] | [
"documented"
] | defmodule AdventOfCode2021.Fourteen do
@moduledoc """
Day 14: Extended Polymerization
https://adventofcode.com/2021/day/14
"""
def one(input_file) do
{template, rules} = parse_input(input_file)
Enum.reduce(1..10, template, fn _i, acc ->
process_template(rules, acc)
end)
|> AdventOfCode... |
02c11abb5545b5ca355aa0b91a64717595eddf00 | 2,257 | [
501654880
] | [
"liveview"
] | defmodule HajWeb.DashboardLive.Index do
use HajWeb, :live_view
alias Haj.Policy
alias Haj.Responsibilities
alias Haj.Spex
alias Haj.Merch
def mount(_params, _session, socket) do
current_show = Spex.current_spex()
user_id = socket.assigns.current_user.id
user_groups =
Spex.get_show_group... |
02c1e9cb0e3d2f948d7eb633c12ba8cdf662b699 | 3,132 | [
465638532,
171057615
] | [
"genserver"
] | defmodule Espy.Adapter.HTTPC do
require Logger
alias Espy.Watcher.{Logging}
alias Espy.Gateway.{Webhook}
@default_http_opts timeout: 10000, connect_timeout: 10000, autoredirect: false
@headers %{"Content-Type" => "application/json"}
@method :post
@delay 2000
defp to_charlist_headers(headers) do
... |
02c27a3c44bf337a36cfa7f61a281eeffd7c15b5 | 7,347 | [
318360303
] | [
"test"
] | defmodule MQTTServerTest do
use ExUnit.Case, async: false
import ExUnit.CaptureLog
require Logger
@ca_cert_file File.cwd!() |> Path.join("test/support/ssl_mock/ca.crt")
@server_cert_file File.cwd!() |> Path.join("test/support/ssl_mock/server.crt")
@server_key_file File.cwd!() |> Path.join("test/support/ss... |
02c31c89df1e43892c5e145afd25ffda796213e2 | 8,954 | [
157075021
] | [
"typespec",
"documented"
] | defmodule FE.Result do
@moduledoc """
`FE.Result` is a data type for representing output of a computation that either succeeded or failed.
"""
@type t(a, b) :: {:ok, a} | {:error, b}
@type t(a) :: t(a, any)
alias FE.{Maybe, Review}
defmodule Error do
defexception [:message]
end
@doc """
Creat... |
02c354418ecae21b3050f36a659f297de4b53b2e | 4,284 | [
221940752
] | [
"test"
] | defmodule ArrowWeb.DisruptionView.CalendarTest do
use ExUnit.Case, async: true
alias Arrow.{Adjustment, Disruption, DisruptionRevision}
alias Arrow.Disruption.{DayOfWeek, Exception}
alias ArrowWeb.DisruptionView.Calendar, as: DCalendar
describe "props/1" do
test "converts a list of Disruptions to Disrup... |
02c3c0f9ef3bf18deac7b61d3134015dd10a63dd | 6,332 | [
703453537
] | [
"test"
] | defmodule KafkaClient.Consumer.FlowTest do
use ExUnit.Case, async: true
import KafkaClient.Test.Helper
@moduletag :require_kafka
test "clean termination" do
group_id = unique("test_group")
consumer = start_consumer!(group_id: group_id, drain: :timer.seconds(1), max_batch_size: 1)
[topic] = consum... |
02c3cc404788d0210a1f4ed269cec637a89ee381 | 2,015 | [
138781666
] | [
"genserver",
"documented"
] | defmodule GenProgram do
@moduledoc """
GenProgram is a gen_server used to create and save programs for
use with the ArduinoComm application.
TODO: Add functions for converting and saving program steps.
Add functions for saving and loading programs
Add config parameters funs
Add type pa... |
02c3faffb5ec06fcbc6b5bea4b839e7cdbcb45e0 | 2,757 | [
620840103
] | [
"documented"
] | defmodule MixDependencySubmission.SCM.Mix.SCM.Git do
@moduledoc """
SCM implementation for Git-based Mix dependencies.
Handles conversion of Git dependencies declared in `mix.exs` or found in
`mix.lock` into package URLs (purl). Falls back to a generic purl format if
the repository URL does not represent a s... |
02c4384f65b1316ce5b5cd34833c92f7647ee700 | 1,589 | [
130147624
] | [
"macro",
"documented",
"phoenix"
] | defmodule ExtextWeb 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 ExtextWeb, :controller
use ExtextWeb, :view
The definitions below will be executed for every view,
controller, etc... |
02c4552f56aaad20267046d7d44ea770c4150703 | 1,722 | [
185321911
] | [] | defmodule Person do
defstruct name: "", valid: false
# instances the abstraction
def new, do: new("John Doe")
def new(name) when is_bitstring(name) do
%Person{name: name}
end
# modifier function
def validate(%Person{} = person) do
%{ person | valid: true }
end
# query function
def valid?(... |
02c49730d308eadb97fa218df9853375da232c4f | 12,759 | [
807904878
] | [
"typespec",
"documented"
] | defmodule Pleroma.Web.Streamer do
require Logger
require Pleroma.Constants
alias Pleroma.Activity
alias Pleroma.Chat.MessageReference
alias Pleroma.Config
alias Pleroma.Conversation.Participation
alias Pleroma.Notification
alias Pleroma.Object
alias Pleroma.User
alias Pleroma.Web.ActivityPub.Activi... |
02c4d3d9d4d8d1a3bc26f3add4c161d3a95e77c5 | 3,465 | [
822255248
] | [
"test"
] | defmodule MusicListings.Parsing.VenueParsers.CneParserTest do
use ExUnit.Case, async: true
alias MusicListings.Parsing.Performers
alias MusicListings.Parsing.Price
alias MusicListings.Parsing.VenueParsers.CneParser
setup do
index_file_path = Path.expand("#{File.cwd!()}/test/data/cne/index.json")
si... |
02c4dd027f88581c7fe1464548ce5768827848a6 | 1,509 | [
79590150
] | [] | defmodule Redbird.Mixfile do
use Mix.Project
def project do
[
app: :redbird,
build_embedded: Mix.env() == :prod,
deps: deps(),
docs: docs(),
elixir: "~> 1.9",
elixirc_paths: elixirc_paths(Mix.env()),
start_permanent: Mix.env() == :prod,
version: "0.7.2",
pa... |
02c563c2bc3342ec0b1f17c61dfeeec80e040c3e | 1,854 | [
193244709,
101434552,
198908023
] | [
"typespec",
"documented"
] | defmodule GoogleApi.DocumentAI.V1.Model.GoogleCloudDocumentaiV1DocumentSchemaMetadata do
@moduledoc """
Metadata for global schema behavior.
## Attributes
* `documentAllowMultipleLabels` (*type:* `boolean()`, *default:* `nil`) - If true, on a given page, there can be multiple `document` annotations covering... |
02c5842476dda739ea0462695e75b2b4865516b9 | 2,555 | [
562069802
] | [
"ecto"
] | defmodule Actions.Operation.Mutation.UploadEdges do
import Ecto.Changeset
import U7406
alias Actions.Graph.Mixin.EdgeFuncs.Create
alias Ecto.Multi
alias Schemas.Graph.EdgeType
alias Schemas.Graph.Edge
alias Schemas.Graph.Node
alias Schemas.Operation.EdgesUpload
alias U7406.Repo
@max_range 1_000_00... |
02c61d9606a80195793730836a58e5abd5e9a771 | 2,147 | [
85481474
] | [
"typespec",
"documented"
] | defmodule Estimator.Issue do
@moduledoc """
Retrieve selected issues, issues to estimate etc.
"""
import Ecto.Query
alias Estimator.Repo
alias Estimator.Issue.{
SelectedIssue,
IssueFromJira,
}
alias Estimator.Api.Jira
@type issue_key :: String.t
def list_selected(board_id) do
Selected... |
02c63df91dc6c05ac6f28e14bdf6ae6c39e7226d | 1,929 | [
747157111
] | [
"typespec",
"documented"
] | defmodule Kujira.Oracle do
@moduledoc """
Utility functions for querying the on-chain oracle
"""
alias Kujira.Oracle.Query.Stub
alias Kujira.Oracle.QueryExchangeRateRequest
alias Kujira.Oracle.QueryExchangeRateResponse
alias Kujira.Oracle.QueryExchangeRatesRequest
alias Kujira.Oracle.QueryExchangeRates... |
02c66cd0979ab5bd96225bbfc1c2f89e6961454e | 3,366 | [
264256961
] | [
"documented",
"ecto"
] | defmodule BooksList.Authors do
@moduledoc """
The Authors context.
"""
import Ecto.Query, warn: false
alias BooksList.Repo
alias BooksList.Authors.Author
@doc """
Gets a single author.
Raises `Ecto.NoResultsError` if the Author does not exist.
## Examples
iex> get_author!(123)
%Aut... |
02c77d6b56be0e1e4bb935650b6d67d72482360f | 6,126 | [
822449370
] | [
"liveview",
"test"
] | defmodule PicChatWeb.MessageLiveTest do
use PicChatWeb.ConnCase
import Phoenix.LiveViewTest
import PicChat.MessagesFixtures
import PicChat.AccountsFixtures
@create_attrs %{content: "some content"}
@update_attrs %{content: "some updated content"}
@invalid_attrs %{content: nil}
defp create_message(_) d... |
02c7a72de76be7169b9603213c0b7900d3e92521 | 1,663 | [
459523663
] | [] | defmodule Generator do
def generate_code(ast) do
code = post_order(ast)
IO.puts("\nCode Generator output:")
IO.puts(code)
code
end
def post_order(node) do
case node do
nil ->
nil
ast_node ->
code_snippet = post_order(ast_node.left_node)
post_order(ast_node... |
02c84898dcd9c8b6117549bb464d1ba2b305f8c5 | 2,108 | [
143549748
] | [
"phoenix"
] | defmodule BackendWeb.TopicController do
use BackendWeb, :controller
alias Backend.Discussions
plug BackendWeb.Plugs.IsAuth when not action in [:index]
plug :check_topic_owner when action in [:update, :delete]
def index(conn, params) do
current_user = conn.assigns.current_user
page = Discussions.list_topics... |
02c8d48d9b25d48f729f03a041dad1f40705de5a | 2,241 | [
888773130
] | [] | %{
"finch": {:hex, :finch, "0.19.0", "c644641491ea854fc5c1bbaef36bfc764e3f08e7185e1f084e35e0672241b76d", [:mix], [{:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:mint, "~> 1.6.2 or ~> 1.7", [hex: :mint, repo: "hexpm", optional: false]}, {:nimble_options, "~> 0.4 or ~> 1.0", [hex: :nimble_... |
02c986d2c028e6ca4becdd15b9cc391794e7b72f | 1,696 | [
113384510
] | [
"documented"
] | defmodule GoldfishWeb.Helpers.CheckboxHelper do
use Phoenix.HTML
# https://dev.to/ricardoruwer/many-to-many-associations-in-elixir-and-phoenix-21pm
@doc """
Renders multiple checkboxes.
## Example
iex> multiselect_checkboxes(
f,
:tags,
Enum.map(@tags, fn c -> {... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.