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 |
|---|---|---|---|---|
09c701c1036822669cef80fe6863324d80dac102 | 1,691 | [
791611009
] | [
"liveview"
] | defmodule MeowWeb.MeerkatLive.PaginationComponent do
use MeowWeb, :live_component
alias MeowWeb.Forms.PaginationForm
def render(assigns) do
~H"""
<div class="pagination">
<div class="page-stepper">
<%= for {page_number, current_page?} <- pages(@pagination) do %>
<div phx-click="s... |
09c72979e2fb323247ad09a7157436d3b7ed9a79 | 2,286 | [
363419449,
123528600
] | [
"test",
"documented"
] | defmodule Support.Conformance.MerkleProofs do
@moduledoc """
Utility functions used when testing Elixir vs Solidity implementation conformance
"""
import ExUnit.Assertions, only: [assert: 1]
alias OMG.Eth.Encoding
@doc """
Checks if the provided proof data returns true (valid proof) in the contract
"... |
09c78c25a3699eb489a6a306426405aab7d07b86 | 4,387 | [
475343077,
495424310,
823294387,
531890950,
481076687,
499293057,
459699346,
472971204,
566619089,
466165564,
472228416,
563320374,
566770189,
577740810,
478529267,
481028861,
473048325,
475645758,
521625231,
469313568,
473697525,
497762642,
511272240,
529748378,
5744... | [
"documented"
] | defmodule Mix.Tasks.Gettext.Extract do
use Mix.Task
@recursive true
@shortdoc "Extracts translations from source code"
@moduledoc """
Extracts translations by recompiling the Elixir source code.
mix gettext.extract [OPTIONS]
Translations are extracted into POT (Portable Object Template) files (wit... |
09c841a9ae143863efee6d30ddf2c98941ce588f | 5,950 | [
193244709,
101434552,
198908023
] | [
"typespec",
"documented"
] | defmodule GoogleApi.DFAReporting.V33.Model.Conversion do
@moduledoc """
A Conversion represents when a user successfully performs a desired action after seeing an ad.
## Attributes
* `childDirectedTreatment` (*type:* `boolean()`, *default:* `nil`) - Whether this particular request may come from a user under... |
09c87816cf62734ffcd1f3b4e5daf9fadf167fa3 | 9,112 | [
942468823
] | [
"test"
] | defmodule GameBot.Replay.EventStoreAccessTest do
use GameBot.DataCase, async: false
alias GameBot.Replay.EventStoreAccess
alias GameBot.Test.Mocks.EventStore, as: EventStoreMock
alias GameBot.Test.Mocks.EventStoreCore
alias GameBot.Infrastructure.Persistence.Repo
alias GameBot.Infrastructure.Persistence.Ev... |
09c908c35111fe704505b78ff51c90f3b1dcfd66 | 3,108 | [
206984033
] | [
"typespec",
"documented"
] | defmodule GoogleApi.CloudTasks.V2beta2.Model.CreateTaskRequest do
@moduledoc """
Request message for CreateTask.
## Attributes
* `responseView` (*type:* `String.t`, *default:* `nil`) - The response_view specifies which subset of the Task will be
returned.
By default response_view is BASIC; not ... |
09c967606465fcb94016a47937ed730c3f716825 | 7,997 | [
206029662
] | [
"documented"
] | defmodule BexLib.Txmaker do
# alias BexLib.Base58Check
alias BexLib.Types.VarInteger
alias BexLib.Types.VarString
alias BexLib.Key
alias BexLib.Crypto
alias Bex.Wallet.Utxo
alias Bex.Repo
require Logger
@sat_per_byte Decimal.cast(0.25)
@doc """
hex raw tx -> txid(hex string)
"""
def get_txid... |
09c99644882ee1c4465209ecd7618995e636e2d1 | 1,618 | [
896767143
] | [] | defmodule ResultCache do
def launch() do
run(%{})
end
def run(cache) do
receive do
{:check, sender, pattern} ->
send(sender, {:check_resp, Map.get(cache, pattern)})
run(cache)
{:add, pattern, result} ->
run(Map.put(cache, pattern, result))
end
end
end
defmodule Solution do
def count_ways(... |
09c9afd2dba97f431263fda3c56451f586ad0eb6 | 1,699 | [
158100912
] | [
"typespec"
] | defmodule Solution do
# 1498ms - 2637ms
@spec convert(s :: String.t, num_rows :: integer) :: String.t
def convert(s, 1) do
s
end
def convert(s, num_rows) do
rows = for _i <- 0..num_rows-1 do
[]
end
zigzag(String.split(s, "", trim: true), rows, num_rows)
end
@spec zigzag(s :: [], ro... |
09c9bb8ece0250cbf595a5dfaefc07a4634d987d | 4,159 | [
193244709,
101434552,
198908023
] | [
"typespec",
"documented"
] | defmodule GoogleApi.OSConfig.V1.Model.PatchJobInstanceDetailsSummary do
@moduledoc """
A summary of the current patch state across all instances that this patch job affects. Contains counts of instances in different states. These states map to `InstancePatchState`. List patch job instance details to see the specifi... |
09ca0d40db95c9adf1ec0700a1908bac1401cc92 | 1,568 | [
356736273
] | [
"test",
"ecto"
] | defmodule ApiExmon.TrainerTest do
use ApiExmon.DataCase
alias ApiExmon.Trainer
describe "changeset/1" do
test "when all params are valid, returns a valid changeset" do
params = %{name: "Name 1", password: "123456"}
response = Trainer.changeset(params)
assert %Ecto.Changeset{
... |
09ca793937e45443d082cb0ab1588168f95dfbab | 5,382 | [
869481674
] | [
"liveview",
"documented"
] | defmodule PetInnWeb.AdminLayout do
@moduledoc false
use PetInnWeb, :live_view
alias PetInnWeb.Shared.Header.ChangeLanguageComponent
alias PetInnWeb.Shared.Header.ThemeSelectorComponent
alias Phoenix.LiveView.JS
def render(assigns) do
~H"""
<main class="w-full h-screen bg-slate-50 dark:bg-gray-800"... |
09ccbf450b34994a19585ac3cb00bfabf64a0d0e | 2,902 | [
589828278
] | [
"liveview",
"ecto"
] | defmodule PentoP2Web.ProductLive.FormComponent do
use PentoP2Web, :live_component
alias PentoP2.Catalog
@impl true
def update(%{product: product} = assigns, socket) do
changeset = Catalog.change_product(product)
{:ok,
socket
|> assign(assigns)
|> assign(:changeset, changeset)
|> a... |
09cd54b2bfb2f11c2aed05e186898350aafb9e51 | 3,816 | [
240012222,
282263329
] | [
"test"
] | defmodule Stripe.SubscriptionScheduleTest do
use Stripe.StripeCase, async: true
@invalid_params %{
customer: "cus_123",
end_behavior: "release",
phases: [
%{
coupon: nil,
default_tax_rates: [],
end_date: 1_557_566_037,
start_date: 1_554_974_037,
tax_percent... |
09cdc87a8ab6e1222c6e0fc53c1d0726f2a24464 | 3,093 | [
87812072
] | [
"test"
] | defmodule MockingbirdTest do
use ExUnit.Case
import Mock
defmodule MockHttpClient do
import Mockingbird.Client
def call(_verb, _url) do
respond(:ok, 200, "ok")
end
end
defmodule SandboxHttpClient do
import Mockingbird.Client
def call(_verb, _url) do
respond(:ok, 200, "sand... |
09ce595cce7d2b56f7c81c75002b53c9044bf62c | 1,694 | [
706326495,
263865286,
801083281
] | [] | defmodule Creek.Runtime.Meta.Default do
use Creek.MetaBehaviour
# Init
fragment init_op as filter(&match?({_, :init_opr}, &1))
~> base()
~> effects()
fragment init_src as map(fn x ->
IO.inspect(nil, label: "Init source before filter")
... |
09ce6617f9604dbeaaf2ff6271fabcee8be28aa6 | 1,795 | [
539667795
] | [
"test",
"ecto"
] | defmodule Ticketed.UsersTest do
use Ticketed.DataCase
alias Ticketed.Users
describe "users" do
alias Ticketed.Users.User
import Ticketed.UsersFixtures
@invalid_attrs %{email: nil, name: nil}
test "list_users/0 returns all users" do
user = user_fixture()
assert Users.list_users() =... |
09ced83ce291ff3b0be0f30b01b73388e7b2c811 | 2,007 | [
696588180
] | [] |
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, [decimals: precision])
end
def float_frac(number) d... |
09cede0ea2fb0fa95d12c62d3c208992f55dd94b | 2,018 | [
40070634
] | [] | %{"timex_ecto": {:hex, :timex_ecto, "0.5.0"},
"httpoison": {:hex, :httpoison, "0.7.3"},
"combine": {:hex, :combine, "0.5.2"},
"phoenix": {:hex, :phoenix, "1.0.2"},
"sqlitex": {:hex, :sqlitex, "0.8.1"},
"getopt": {:hex, :getopt, "0.8.2"},
"neotoma": {:hex, :neotoma, "1.7.3"},
"exrm": {:hex, :exrm, "0.19.9"... |
09cef726a6992c585cc6e57ba384449535756b9e | 4,124 | [
631803667
] | [
"documented",
"ecto"
] | defmodule NanoPlanner.Schedule.PlanItem do
@moduledoc """
Schema module
"""
use Ecto.Schema
import Ecto.Changeset
alias NanoPlanner.Accounts.User
schema "plan_item" do
belongs_to :owner, User
field :name, :string
field :description, :string, default: ""
field :all_day, :boolean, default... |
09cf675d1c487871fabc667a53c1e645ee935d7d | 1,541 | [
137464738
] | [
"phoenix"
] | defmodule Mix.Tasks.Procon.Controller do
use Mix.Task
import Mix.Generator
@shortdoc "Create a consumer controller file"
def run(args) do
schema = OptionParser.parse(args) |> elem(0) |> Keyword.get(:schema)
app_name = Mix.Project.config[:app] |> to_string
app_module = app_name |> Macro.camelize
... |
09cf965194e02a87878af37ef577e5e1c5bd6ff6 | 3,726 | [
228963826,
231998266
] | [] | defmodule Mainmodule do
def main(args) do
if List.first(args)=="" do
IO.puts("Pease enter valid arguments")
else
table = :ets.new(:table, [:named_table, :public])
noOfNodes=args |> Enum.at(0) |> String.to_integer
noOfReq=args |> Enum.at(1) |> String.to_integer
{:ok, _} = Registry.start_li... |
09cf9a765a4333449c6c81a536da694eed0f40b3 | 10,249 | [
188498517
] | [
"test"
] | defmodule ProductsParserTest do
use ExUnit.Case
doctest ProductsParser
test "creates a map of brands" do
products = [
%{
"brand_name" => "Andar Wallets",
"brand_url" => "https://andarwallets.com/",
"currency" => "USD",
"image" =>
"https://cdn.shopify.com/s/file... |
09cfc897721de54a010d7009a8803b148f8aea48 | 1,560 | [
246472813
] | [] | defmodule WorkflowMetal.MixProject do
use Mix.Project
def project do
[
app: :workflow_metal,
version: "0.3.0",
elixir: "~> 1.14",
start_permanent: Mix.env() == :prod,
description: description(),
package: package(),
deps: deps(),
build_per_environment: is_nil(Syst... |
09cfc95c73d466bc98e517b85f6910d5c29f25d6 | 2,657 | [
211224459
] | [
"typespec",
"documented"
] | defmodule StreamStats do
@moduledoc """
Enables concurrent calculation of count, mean and standard deviation.
New values can be aggregated into an existing stat tuple and two stat
tuples can be merged into one.
Inspired by the following article by John D. Cook:
https://www.johndcook.com/blog/skewness_kurto... |
09cfca79f7857a51ee15f870a1b4b6e9aed4a42d | 8,724 | [
225685438
] | [
"genserver",
"typespec",
"macro",
"documented"
] | defmodule RMQ.RPC do
@moduledoc """
RPC via RabbitMQ.
In short, it's a `GenServer` which implements a publisher and a consumer at once.
You can read more about how this works in the
[tutorial](https://www.rabbitmq.com/tutorials/tutorial-six-python.html).
## Configuration
* `:connection` - the connec... |
09cfe042dba7dc49d927a694f357f732919d03b8 | 1,555 | [
692022522
] | [
"supervisor",
"documented"
] | defmodule TreeMap.RootServer do
@moduledoc """
A server to maintain a list of root nodes as a DynamicSupervisor.
Don't call this module directly. Use the `TreeMap` module instead.
### Examples
iex> TreeMap.list_roots()
[%Node{}, ...]
iex> TreeMap.find("key")
%Node{}
iex> Tree... |
09d0272c13b7c3c27675b7c8e47f8694ff9ef175 | 2,467 | [
136959981
] | [] | use Mix.Config
# For development, we disable any cache and enable
# debugging and code reloading.
#
# The watchers configuration can be used to run external
# watchers to your application. For example, we use it
# with brunch.io to recompile .js and .css sources.
config :sales_loft_code_exercise, SalesLoftCodeExercise... |
09d031cd1929442cb2e222d53bf316d33ae1c9d5 | 4,504 | [
364071873
] | [
"liveview"
] | defmodule LivebookWeb.SessionLive.ShortcutsComponent do
use LivebookWeb, :live_component
@shortcuts %{
insert_mode: [
%{seq: ["esc"], desc: "Switch back to navigation mode"},
%{seq: ["ctrl", "↵"], desc: "Evaluate cell and stay in insert mode"},
%{seq: ["tab"], desc: "Autocomplete expression w... |
09d0e5098009aef424b13ed8030b78fc58ea8182 | 10,900 | [
292029041
] | [
"test"
] | defmodule CaptainHook.Test.AssertionsTest do
use CaptainHook.DataCase, async: true
import CaptainHook.Test.Assertions
@notification_pattern_wildcard Application.compile_env(
:captain_hook,
:notification_pattern_wildcard
... |
09d0f547862493a0a0d7521fdc21e607e8971b33 | 6,467 | [
950464954
] | [
"test"
] | defmodule Kylix.Server.TransactionQueueTest do
use ExUnit.Case
alias Kylix.Server.TransactionQueue
# Test initialization following the pattern from successful integration tests
setup do
# Stop any running application first
Application.stop(:kylix)
# Start the application
{:ok, _} = Application... |
09d15f38d9195def720664c31f080662ef48c904 | 7,336 | [
99035682
] | [
"typespec",
"macro",
"documented"
] | defmodule BoardingStatus do
@moduledoc """
Structure to represent the status of a single train
"""
require Logger
import ConfigHelpers
defstruct scheduled_time: :unknown,
predicted_time: :unknown,
route_id: :unknown,
trip_id: :unknown,
direction_id: :unknown,... |
09d165333db0b6c145cf3ab1e8cf6488958a2626 | 2,020 | [
214575661
] | [] | %{
"connection": {:hex, :connection, "1.0.4", "a1cae72211f0eef17705aaededacac3eb30e6625b04a6117c1b2db6ace7d5976", [:mix], [], "hexpm"},
"db_connection": {:hex, :db_connection, "2.1.1", "a51e8a2ee54ef2ae6ec41a668c85787ed40cb8944928c191280fe34c15b76ae5", [:mix], [{:connection, "~> 1.0.2", [hex: :connection, repo: "he... |
09d16cfc485b39403680be4ab8562a9f7e6b6ea0 | 4,620 | [
193244709,
101434552,
198908023
] | [
"typespec",
"documented"
] | defmodule GoogleApi.Compute.V1.Model.MachineType do
@moduledoc """
Represents a Machine Type resource. You can use specific machine types for your VM instances based on performance and pricing requirements. For more information, read Machine Types.
## Attributes
* `accelerators` (*type:* `list(GoogleApi.Com... |
09d1cfb3b23daf498461b5451f99e8e95ba47007 | 2,111 | [
933617168
] | [] | defmodule Vettore.MixProject do
use Mix.Project
@version "0.2.3"
def project do
[
app: :vettore,
name: "Vettore",
version: @version,
elixir: "~> 1.18",
elixirc_paths: elixirc_paths(Mix.env()),
build_embedded: Mix.env() == :prod,
start_permanent: Mix.env() == :prod,
... |
09d25b92b197ad6a04c8ee9c7bd4207d4a429297 | 1,582 | [
258325429
] | [
"documented"
] | defmodule Cddb.RequestParser do
@moduledoc """
Parse CDDB requests into structures easier to deal with
"""
@doc """
Parse a given command into a two-element tuple with data structure
iex> Cddb.RequestParser.parse_cmd("cddb read data 940aac0d")
{:read, %{genre: "data", disc_id: "940aac0d"}}
""... |
09d2922d3797bee52477e1fc2f575d2c55c1b22c | 8,523 | [
689539389,
719407286,
477647394,
15848380
] | [
"genserver",
"documented"
] | defmodule FarmbotOS.Firmware.UARTCore do
@moduledoc """
UARTCore is the central logic and processing module for all
inbound and outbound UART data (GCode).
Guiding Principles:
* No cached state - Delay data fetching. Never duplicate.
* No timeouts - Push data, don't pull.
* No polling - Push ... |
09d2cc8016c00f5d88332bac6732a608c86e00d6 | 7,158 | [
372499099
] | [
"genserver",
"documented"
] | defmodule Kino.SmartCell.Server do
@moduledoc false
@behaviour GenServer
require Logger
import Kino.Utils, only: [has_function?: 3]
@chunk_joiner "\n\n"
@chunk_joiner_size byte_size(@chunk_joiner)
def start_link(module, ref, attrs, target_pid) do
case :proc_lib.start_link(__MODULE__, :init, [{mod... |
09d35cf65fd6ce0bbd8df6b769d0f4cf07839579 | 4,384 | [
917123261
] | [
"test"
] | defmodule LevelWeb.GraphQL.ReplyReactionsTest do
use LevelWeb.ConnCase, async: true
import LevelWeb.GraphQL.TestHelpers
alias Level.Posts
setup %{conn: conn} do
{:ok, %{user: user, space: space, space_user: space_user}} = create_user_and_space()
conn = authenticate_with_jwt(conn, user)
{:ok, %{con... |
09d39048f53384be38c379b2ddd8ffef13d890d4 | 2,828 | [
104610394
] | [
"test"
] | defmodule WorldCupDb.Web.CountryParticipationControllerTest do
use WorldCupDb.Web.ConnCase
alias WorldCupDb.Entities
alias WorldCupDb.Entities.CountryParticipation
@create_attrs %{cid: 42, result: 42, year: 42}
@update_attrs %{cid: 43, result: 43, year: 43}
@invalid_attrs %{cid: nil, result: nil, year: ni... |
09d3d64a83b05d7d50efdc8d23134f2166c879d3 | 2,031 | [
989168206
] | [
"genserver"
] | defmodule BestEffortBroadcast do
use GenServer
# to start an instance of a broadcast,
# a link layer process and a respond to process have to be supplied to the broadcast process
#
# message repond_to === application layer, expects a {:deliver, msg} tuple as messages from the broadcasts
# |... |
09d3efd6b4cbd556b2714a843018e3ca3ee099fd | 6,417 | [
326738007
] | [
"test"
] | defmodule KaldaWeb.Api.V1.CommentReactionControllerTest do
use KaldaWeb.ConnCase
@valid_comment_reaction_content %{
relate: true
}
@valid_comment_reaction_love_content %{
send_love: true
}
@invalid_comment_reaction_content %{
relate: nil
}
@valid_comment_reaction_update %{
relate: false... |
09d4078a9d6a7e868f6f644b34539a2a055de54f | 1,921 | [
657802772
] | [] | defmodule Skogsra.Mixfile do
use Mix.Project
@version "2.0.2"
@root "https://github.com/gmtprime/skogsra"
def project do
[
app: :skogsra,
version: @version,
elixir: "~> 1.8",
build_embedded: Mix.env() == :prod,
start_permanent: Mix.env() == :prod,
name: "Skogsrå",
... |
09d42a4d2ea1138b7a5f4e23cf0f29a5360c0268 | 1,716 | [
208212083
] | [
"macro",
"documented",
"phoenix"
] | defmodule PhoenixTestAppWeb 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 PhoenixTestAppWeb, :controller
use PhoenixTestAppWeb, :view
The definitions below will be executed for every... |
09d44cdbaa2f212825ace1b1821454ca741d320b | 6,718 | [
533537020,
180672647,
294427908,
121001913
] | [] | defmodule Snitch.Demo.Product do
alias NimbleCSV.RFC4180, as: CSV
alias Snitch.Core.Tools.MultiTenancy.Repo
alias Snitch.Data.Schema.{
Image,
OptionType,
Product,
ProductOptionValue,
ShippingCategory,
Taxon,
Variant,
Variation,
VariationTheme
}
alias Snitch.Domain.Taxonom... |
09d48cf89824b0a551aa117bf2b2ca38a1f00d18 | 3,688 | [
958381808
] | [
"ecto"
] | alias Policia.Repo
alias Policia.Accounts.User
alias Policia.Articles.Category
alias Policia.Articles.Article
# Eliminar datos existentes
Repo.delete_all(Article)
Repo.delete_all(Category)
Repo.delete_all(User)
# Crear usuarios con diferentes roles
# Asignamos explícitamente el rol "admin" al primer usuario
{:ok, adm... |
09d491ba8c90ea9b38a6d19172794a030b5632ae | 2,558 | [
168867133
] | [] | defmodule FollowThrough.MixProject do
use Mix.Project
def project do
[
app: :follow_through,
version: "0.1.0",
elixir: "~> 1.5",
elixirc_paths: elixirc_paths(Mix.env()),
compilers: [:phoenix, :gettext] ++ Mix.compilers(),
start_permanent: Mix.env() == :prod,
aliases: a... |
09d53bec9eedc259becd40764093a43171bac842 | 3,391 | [
305554003
] | [] | %{
"dialyxir": {:hex, :dialyxir, "1.4.3", "edd0124f358f0b9e95bfe53a9fcf806d615d8f838e2202a9f430d59566b6b53b", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "bf2cfb75cd5c5006bec30141b131663299c661a864ec7fbbc72dfa557487a986"},
"earmark_parser": {:hex, :earmark_parser, "1.4.41... |
09d53f706ea1caf1ad242d9257467e561ebbe507 | 2,269 | [
280488876
] | [
"test",
"phoenix"
] | defmodule TestApiWeb.NoteControllerTest do
use TestApiWeb.ConnCase
alias TestApi.Content
alias TestApi.Content.Note
@create_attrs %{
}
@update_attrs %{
}
@invalid_attrs %{}
def fixture(:note) do
{:ok, note} = Content.create_note(@create_attrs)
note
end
setup %{conn: conn} do
{:ok... |
09d566ac69c432a7e8bce4a276810cdd39aa5143 | 6,698 | [
217930962
] | [
"documented"
] | defmodule CSV.Decoding.Decoder do
@moduledoc ~S"""
The Decoder CSV module sends lines of delimited values from a stream to the
parser and converts rows coming from the CSV parser module to a consumable
stream. In setup, it parallelises lexing and parsing, as well as different
lexer/parser pairs as workers. Th... |
09d58a955837bcbbffae1ce1f47896d683ece71f | 1,915 | [
792989159,
810491793
] | [] | %{
"benchee": {:hex, :benchee, "1.3.0", "f64e3b64ad3563fa9838146ddefb2d2f94cf5b473bdfd63f5ca4d0657bf96694", [:mix], [{:deep_merge, "~> 1.0", [hex: :deep_merge, repo: "hexpm", optional: false]}, {:statistex, "~> 1.0", [hex: :statistex, repo: "hexpm", optional: false]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm",... |
09d5cb5d420468153d2d94bca8b40f9120600e53 | 7,547 | [
666095064
] | [
"typespec"
] | defmodule Surface.Compiler.Helpers do
alias Surface.AST
alias Surface.Compiler.CompileMeta
alias Surface.IOHelper
@builtin_common_assigns [
:__context__,
:__surface__
]
@builtin_component_assigns [:inner_block] ++ @builtin_common_assigns
@builtin_live_component_assigns [:id, :socket, :myself] +... |
09d5d5d411594f36415539aacb06db1ffb5f43dc | 3,616 | [
533537020,
180672647,
440426437,
294427908,
121001913
] | [
"test",
"ecto"
] | defmodule Snitch.Data.Schema.CardTest do
use ExUnit.Case, async: true
use Snitch.DataCase
import Snitch.Factory
import Ecto.Changeset, only: [apply_changes: 1]
alias Snitch.Data.Schema.Card
@card %{
month: 12,
year: 2099,
name_on_card: "Tony Stark",
brand: "VISA",
number: "41111111111... |
09d5ee6d630b4b754af96fd90817d6a52c3d0181 | 5,180 | [
192407200
] | [
"test"
] | defmodule Raptor.Services.DatasetAccessGroupRelationStoreTest do
use RaptorWeb.ConnCase
use Placebo
alias Raptor.Services.DatasetAccessGroupRelationStore
alias Raptor.Schemas.DatasetAccessGroupRelation
@namespace "raptor:dataset_access_group_relation:"
@redix Raptor.Application.redis_client()
describe "... |
09d604086d73728f759c6cb62fbfddd7fcac871f | 2,468 | [
215697991
] | [
"liveview",
"macro",
"documented",
"phoenix"
] | defmodule FiarReloadedWeb 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 FiarReloadedWeb, :controller
use FiarReloadedWeb, :view
The definitions below will be executed for every view,... |
09d639fabc7b2ad6dc80dd83fa6cdf8417911e47 | 2,857 | [
112248634
] | [
"documented"
] | defmodule Raxx.Static do
@moduledoc """
Serve the contents of a directory as static content.
@static_setup Raxx.Static.setup(source: "path/to/assets")
stack =
Raxx.Stack.new(
[
{Middleware.Static, @static_state}
],
{MyApp, config}
)
Use `set... |
09d6c048cbc39b5a94cfebcc47f855c8266e921c | 4,478 | [
1019049265
] | [
"test",
"ecto"
] | defmodule ChimeraCms.PortfolioTest do
use ChimeraCms.DataCase
alias ChimeraCms.Portfolio
describe "projects" do
alias ChimeraCms.Portfolio.Project
import ChimeraCms.PortfolioFixtures
@invalid_attrs %{description: nil, title: nil, image: nil, role: nil, client: nil, repo_url: nil, overview: nil, pr... |
09d6f40a1a8868ad4f127f9192c9222f7cd672eb | 5,963 | [
467107546
] | [
"genserver",
"documented",
"ecto"
] | defmodule FarmbotOS.DirtyWorker do
@moduledoc "Handles uploading/downloading of data from the APIFetcher."
alias FarmbotOS.Asset.{Private, Repo}
alias FarmbotOS.{
API,
DirtyWorker,
APIFetcher
}
import API.View, only: [render: 2]
require Logger
require FarmbotOS.Logger
use GenServer
@tim... |
09d7ec69feb3fb3f5213c2554873cb67ef3342fc | 1,865 | [
193244709,
101434552,
198908023
] | [
"typespec",
"documented"
] | defmodule GoogleApi.VMMigration.V1.Model.CycleStep do
@moduledoc """
CycleStep holds information about a step progress.
## Attributes
* `endTime` (*type:* `DateTime.t`, *default:* `nil`) - The time the cycle step has ended.
* `initializingReplication` (*type:* `GoogleApi.VMMigration.V1.Model.Initializin... |
09d7f4564f20a993d3fe2fb1f0ceea0d9f600073 | 2,243 | [
565421534
] | [] | defmodule Changelog.Album do
defstruct [
:name,
:slug,
:volume,
:tagline,
:description,
:apple_id,
:spotify_id,
:amazon_id,
:youtube_id,
:bandcamp_url
]
def all do
[theme_songs(), next_level(), dance_party()]
end
def get_by_slug(slug) do
Enum.find(all(), fn al... |
09da3466a023801e67b1d3248ff97ff3ecc06248 | 6,947 | [
564359760
] | [
"documented"
] | defmodule HydepwnsLiveviewWeb.TestSetupHelper do
@moduledoc """
Helper functions for setting up test data and ensuring test isolation.
This module provides utilities for:
- Creating test resources with consistent data
- Cleaning up test data between tests
- Setting up complex test scenarios
- Ensuring pr... |
09da9528b70c20a98b4033e892b0ea8ed45e02ec | 4,860 | [
123528600
] | [
"test",
"documented"
] | defmodule OMG.Watcher.Integration.InFlightExit2Test do
@moduledoc """
This needs to go away real soon.
"""
use ExUnitFixtures
use ExUnit.Case, async: false
use OMG.Watcher.Fixtures
use Plug.Test
use OMG.Watcher.Integration.Fixtures
alias OMG.Watcher.EthereumEventAggregator
alias OMG.Watcher.Integra... |
09da9c286acb0ea808bb8ee3cdb1d8a2208c5859 | 1,934 | [
184431703
] | [
"ecto"
] | defmodule Koala.Wallet.Data.Blocks do
use Ecto.Schema
import Ecto.Changeset
import Ecto.Query
alias Koala.Wallet.Data.{Addresses, Repo, Wallets, Blocks}
@primary_key {:id, :binary_id, autogenerate: true}
schema "blocks" do
field :type, :string
field :work, :string
field :balance, :decimal, pre... |
09db2f48a0710560a7325701a14ff447a484c7cb | 2,857 | [
46218294
] | [
"documented",
"ecto"
] | defmodule Mealprep.Nutrition do
@moduledoc """
The Nutrition context.
"""
import Ecto.Query, warn: false
alias Mealprep.Repo
alias Mealprep.Nutrition.{
FoodUnit,
FoodUnitTr
}
# True if translation is for a language with an ietf tag of lang.
defp has_lang(translation, lang) do
translatio... |
09db60b4ff3d4fa2f2c9e946fe2485d0c8ef00d4 | 1,563 | [
193992072
] | [
"typespec",
"documented",
"ecto"
] | defmodule Health.Email.Contact do
@moduledoc """
Contact form email to be sent to admin
"""
import Bamboo.Email
alias Health.Email.Content
import Ecto.Changeset
@spec compose(Health.Email.Content.t()) :: Bamboo.Email.t()
def compose(%Content{from_email: from_email, name: name} = content) do
new_ema... |
09dbdd52b95c4cf8a4f2309e32b304e6d9e96819 | 3,367 | [
908221211
] | [
"documented",
"ecto"
] | defmodule EctoTest.Retail do
@moduledoc """
The Retail context.
"""
import Ecto.Query, warn: false
alias EctoTest.Repo
alias EctoTest.Retail.Address
@doc """
Returns the list of addresses.
## Examples
iex> list_addresses()
[%Address{}, ...]
"""
def list_addresses do
Repo.all(... |
09dc510a68bfc935328d8204d13b210e63f303f5 | 2,280 | [
93765520
] | [
"typespec",
"documented"
] | defmodule Mix.Tasks.Compile.Yecc do
use Mix.Task
alias Mix.Compilers.Erlang
@recursive true
@manifest ".compile.yecc"
# These options can't be controlled with :yecc_options.
@forced_opts [report: true,
return_errors: false,
return_warnings: false]
@moduledoc """
Compil... |
09dc5d5cd4b2e0bc58fbcefc75243d2e087326f8 | 3,937 | [
1019126840
] | [] | # DSPy Mock Demo - Shows that DSPex wrappers are working
# Run with: mix run examples/dspy/00_dspy_mock_demo.exs
# Configure Snakepit for pooling
Application.put_env(:snakepit, :pooling_enabled, true)
Application.put_env(:snakepit, :adapter_module, Snakepit.Adapters.EnhancedPython)
Application.put_env(:snakepit, :wire... |
09dc6c2d05fd038c09142d93245a7db66889f209 | 11,160 | [
162384511
] | [
"phoenix",
"ecto"
] | defmodule ProviderLinkWeb.UserController do
use ProviderLinkWeb, :controller
import Comeonin.Bcrypt, only: [checkpw: 2]
alias Data.Contexts.{
UserContext,
AgentContext
}
alias Data.Schemas.User
alias Ecto.Changeset
alias Data.Utilities.SMS
alias ProviderLink.{
EmailSmtp,
Mailer
}
d... |
09dc6fe35c6d4e14a8b69770c556ae13c413da34 | 1,716 | [
193244709,
101434552,
198908023
] | [
"typespec",
"documented"
] | defmodule GoogleApi.AndroidPublisher.V3.Model.DeviceTier do
@moduledoc """
A single device tier. Devices matching any of the device groups in device_group_names are considered to match the tier.
## Attributes
* `deviceGroupNames` (*type:* `list(String.t)`, *default:* `nil`) - Groups of devices included in t... |
09dc845f9d7eec0b53a247a295f2f08d5b4f9f31 | 8,966 | [
762904184
] | [
"typespec",
"macro",
"documented"
] | defmodule Adjutant.Command.Slash do
@moduledoc """
Describes what public functions each slash command module must define.
All slash commands must implement the callbacks defined here, and may optionally `use`
this module to define a `call` function that will be called when the command is executed.
```elixir... |
09dc9629049c7df7c5cde7ca71e76264df922cf6 | 4,837 | [
620084220
] | [
"typespec",
"documented",
"ecto"
] | defmodule Monex.Users do
@moduledoc """
Module to operate entity Users
"""
alias Monex.Repo
alias Monex.Users.Email
alias Monex.Users.User
alias MonexWeb.AuthToken
require Logger
@doc """
create_user(params)
# Example of the usage:
iex> params = %{
"first_name" => "Samuel",
... |
09dcc9b90160433ab225031a5e918d82fca92f21 | 1,878 | [
835935352
] | [
"liveview"
] | defmodule ChatWeb.ChatBoxLive do
alias Chat.Rooms
alias Chat.ChatMessage
use ChatWeb, :live_component
def mount(socket) do
form = ChatMessage.changeset(%ChatMessage{}, %{})
socket =
socket
|> stream(:messages, [])
|> assign(:form, to_form(form))
{:ok, socket}
end
def han... |
09dd1ce364a919b0ddc51a7c0ed2dc33c836078a | 7,237 | [
978422174
] | [
"typespec",
"documented",
"ecto"
] | defmodule RecipeForge.Recipes do
@moduledoc """
The Recipes context.
"""
import Ecto.Query, warn: false
alias RecipeForge.Categories
alias RecipeForge.Ingredients
alias RecipeForge.Repo
alias RecipeForge.Recipes.Recipe
@duplicate_ingredients_error "cannot contain duplicate ingredients"
@default_... |
09de439d01735ddec2fad4da3372cd034133df69 | 1,971 | [
188053862
] | [] | defmodule Mtg.MixProject do
use Mix.Project
def project() do
[
app: :mtg_sdk_elixir,
version: "0.1.4",
elixir: "~> 1.8",
name: "MTG SDK Elixir",
description: description(),
package: package(),
deps: deps(),
source_url: "https://github.com/MagicTheGathering/mtg-sd... |
09de725825a5b41785c06cc3caee3dc3b84797e9 | 3,209 | [
165251512
] | [
"liveview",
"documented"
] | defmodule Membrane.RTP.H264.Depayloader do
@moduledoc """
Depayloads H264 RTP payloads into H264 NAL Units.
Based on [RFC 6184](https://tools.ietf.org/html/rfc6184).
Supported types: Single NALU, FU-A, STAP-A.
"""
use Membrane.Filter
require Membrane.Logger
alias Membrane.Buffer
alias Membrane.Eve... |
09df13dffd630d92d0c5dc3986b46b7a63470b34 | 2,152 | [
63316544
] | [] | %{"certifi": {:hex, :certifi, "1.1.0", "c9b71a547016c2528a590ccfc28de786c7edb74aafa17446b84f54e04efc00ee", [:rebar3], [], "hexpm"},
"earmark": {:hex, :earmark, "1.0.1", "2c2cd903bfdc3de3f189bd9a8d4569a075b88a8981ded9a0d95672f6e2b63141", [:mix], [], "hexpm"},
"ex_doc": {:hex, :ex_doc, "0.13.0", "aa2f8fe4c6136a2f7cfc... |
09df7d682ea69578175942fee046f68a46ba3796 | 1,581 | [
125414041
] | [
"phoenix"
] | defmodule SedpoolWeb.Router do
use SedpoolWeb, :router
pipeline :browser do
plug :accepts, ["html"]
plug :fetch_session
plug :fetch_flash
plug :protect_from_forgery
plug :put_secure_browser_headers
end
pipeline :browser_session do
plug Sedpool.SedpoolAccessPipeline
plug Sedpool.Plu... |
09dfc00dfc9bcbb07bf25784586ebd4be2155067 | 4,442 | [
276023881
] | [
"test"
] | defmodule Pleroma.Web.PleromaAPI.ConversationControllerTest do
use Pleroma.Web.ConnCase
alias Pleroma.Conversation.Participation
alias Pleroma.Repo
alias Pleroma.User
alias Pleroma.Web.CommonAPI
import Pleroma.Factory
test "/api/v1/pleroma/conversations/:id" do
user = insert(:user)
%{user: othe... |
09e03b83b9b04344c2ae4d95ed7d7b930c13fb1c | 8,501 | [
144901017
] | [
"documented"
] | defmodule NewRelic.DistributedTrace do
@nr_header "newrelic"
@w3c_traceparent "traceparent"
@w3c_tracestate "tracestate"
@moduledoc false
alias NewRelic.DistributedTrace.Context
alias NewRelic.Harvest.Collector.AgentRun
alias NewRelic.Transaction
def start(type, headers \\ %{})
def start(:http, he... |
09e066db2184c1d3662aa67042558ff159d98e1e | 2,517 | [
667039141
] | [
"documented"
] | defprotocol Wongi.Engine.Beta do
@moduledoc false
def ref(beta)
def parent_refs(beta)
def seed(beta, listener, rete)
def equivalent?(beta, other, rete)
def alpha_activate(listener, wme, rete)
def alpha_deactivate(listener, wme, rete)
def beta_activate(listener, token, rete)
def beta_deactivate(list... |
09e0822d3ff2b6367fbc283f224ac50ccc389d22 | 1,647 | [
739856437
] | [
"phoenix"
] | defmodule AssembledWeb.Router do
use AssembledWeb, :router
import Surface.Catalogue.Router
pipeline :browser do
plug :accepts, ["html"]
plug :fetch_session
plug :fetch_live_flash
plug :put_root_layout, html: {AssembledWeb.Layouts, :root}
plug :protect_from_forgery
plug :put_secure_browser... |
09e0e89bff8779be87bc68ee9132eb2709d32327 | 2,521 | [
35819807
] | [] | defmodule Part1 do
import NimbleParsec
defparsec :parse_step,
ignore(string("Step "))
|> ascii_string([?A..?Z], 1)
|> ignore(string(" must be finished before step "))
|> ascii_string([?A..?Z], 1)
|> ignore(string(" can begin."))
def part1(input) do
{requirements, graph} = input
|> St... |
09e149696e8cb94e8e5032725d43233855624cb6 | 14,579 | [
76085208
] | [
"macro",
"documented"
] | defmodule Noizu.SimplePool.V2.RouterBehaviour do
@callback options() :: any
@callback option(any, any) :: any
@callback extended_call(any, any, any, any, any, any) :: any
@callback self_call(any, any, any) :: any
@callback self_cast(any, any, any) :: any
@callback internal_system_call(any, any... |
09e1a1c7ddc5c57db00f80bc0bc0fcab94cce583 | 1,617 | [
36134727,
999002987,
1018310553
] | [] | defmodule ExJsonSchema.Mixfile do
use Mix.Project
@source_url "https://github.com/jonasschmidt/ex_json_schema"
@version "0.11.1"
def project do
[
app: :ex_json_schema,
version: @version,
elixir: "~> 1.6",
description: """
A JSON Schema validator with full support for the dr... |
09e1b3b665e89d907b157608cd33c37e1ff269d7 | 13,542 | [
248292846
] | [
"macro",
"phoenix",
"documented"
] | defmodule Phoenix.Router.Helpers do
# Module that generates the routing helpers.
@moduledoc false
alias Phoenix.Router.Route
alias Plug.Conn
@anno (if :erlang.system_info(:otp_release) >= '19' do
[generated: true, unquote: false]
else
[line: -1, unquote: false]
end)
@doc """
Callback invoke... |
09e1b7189b76e1719a97770252538890494b3197 | 4,575 | [
521263294
] | [] | import Config
# config/runtime.exs is executed for all environments, including
# during releases. It is executed after compilation and before the
# system starts, so it is typically used to load production configuration
# and secrets from environment variables or elsewhere. Do not define
# any compile-time configurati... |
09e1ca2091e65ea7edf0b9be0d5cad629eaef10b | 2,071 | [
829467128
] | [
"typespec",
"macro",
"documented"
] | defmodule Cen.Utils.GettextEnums do
@moduledoc false
@type enums_list :: [atom(), ...]
@type translations_list :: [{String.t(), String.t()}, ...]
defmacro __using__(_options) do
quote do
use Gettext, backend: CenWeb.Gettext
import unquote(__MODULE__)
require unquote(__MODULE__)
... |
09e223f8d4554cba0d379d93bdfbd8690b8b2cac | 2,079 | [
193244709,
101434552,
198908023
] | [
"typespec",
"documented"
] | defmodule GoogleApi.Apigee.V1.Model.GoogleCloudApigeeV1ScoreComponent do
@moduledoc """
Component is an individual security element that is scored.
## Attributes
* `calculateTime` (*type:* `DateTime.t`, *default:* `nil`) - Time when score was calculated.
* `dataCaptureTime` (*type:* `DateTime.t`, *defau... |
09e229037d62c9a8ed4e33f4cea6164739ba7fa2 | 2,622 | [
885100556
] | [
"macro",
"documented"
] | defmodule SeedHelper do
@doc """
Set a handle to a value for reference by other seeds.
"""
def set_handle(handle, value) do
SeedHelper.Handles.set_handle(handle, value)
end
@doc """
Get a handle to a value for use in seeds (like default_organization_id)
"""
def handle(handle, default \\ nil) do
... |
09e22b718d21510644b0343568c242aa8181998a | 5,762 | [
216897124
] | [
"genserver",
"documented"
] | defmodule IslandsEngine.Game do
use GenServer, restart: :transient
alias IslandsEngine.{Board, Coordinate, Guesses, Island, Rules}
@players [:player1, :player2]
@timeout 60 * 60 * 24 * 1000
def via_tuple(name),
do: {:via, Registry, {Registry.Game, name}}
def start_link(name) when is_binary(name),
... |
09e2325969d80c45a891f4945cf3f3ec722e219d | 2,038 | [
729559715
] | [] | defmodule RangeExpander do
def expand_ranges(tuple) do
tuple
|> Enum.flat_map(fn {number, y, x_start, x_end} ->
for x <- x_start..x_end, do: {number, y, x}
end)
end
end
defmodule Day3Pt22 do
def process_file(file_path) do
nums = File.stream!(file_path)
|> Enum.with_index()
|> Enum.map(fn ... |
09e2d898121f1ba0b5a2d77133f3394ffa520bda | 3,692 | [
585301575
] | [
"phoenix"
] | defmodule IgrejotecaWeb.ClubController do
use IgrejotecaWeb, :controller
alias Igrejoteca.BookClub.Clubs.Repository
alias Igrejoteca.BookClub.Club
alias Igrejoteca.Books.BookRepository
alias Igrejoteca.Accounts.Repository, as: UserRepository
alias Igrejoteca.BookClub.Member.Repository, as: MemberRep... |
09e301dd5792a8f41d1956258cdf5588b9dfc6f3 | 5,563 | [
190376642
] | [
"test"
] | defmodule SendleWeb.ApiTest do
use Sendle.ConnCase
use ExVCR.Mock, adapter: ExVCR.Adapter.Hackney
alias Sendle.Repo
# Creating the Picking List.
setup do
payload = File.read!("test/support/fixture/incoming_requests/sendle-request-payload.json")
url = Application.get_env(:sendle, :url)
ExVCR.Co... |
09e390f069ff87862d841fa86498382f6a75ad97 | 1,523 | [
96926887
] | [] | defmodule BearcatPhoenix.Mixfile do
use Mix.Project
def project do
[app: :bearcat_phoenix,
version: "0.1.1",
elixir: "~> 1.4",
build_embedded: Mix.env == :prod,
start_permanent: Mix.env == :prod,
description: description(),
package: package(),
deps: deps(),
name: "Bearca... |
09e3e8080f81eb6893dab6c258f6642ee86f946b | 1,958 | [
193244709,
101434552,
198908023
] | [
"typespec",
"documented"
] | defmodule GoogleApi.AnalyticsAdmin.V1alpha.Model.GoogleAnalyticsAdminV1alphaAudienceDimensionOrMetricFilterBetweenFilter do
@moduledoc """
A filter for numeric or date values between certain values on a dimension or metric.
## Attributes
* `fromValue` (*type:* `GoogleApi.AnalyticsAdmin.V1alpha.Model.GoogleA... |
09e3ea1ad884ae5fd30714f155d6a48d29def609 | 6,696 | [
1009968181
] | [
"liveview",
"test"
] | defmodule PersonalFinanceWeb.UserLive.SettingsTest do
use PersonalFinanceWeb.ConnCase
alias PersonalFinance.Accounts
import Phoenix.LiveViewTest
import PersonalFinance.AccountsFixtures
describe "Settings page" do
test "renders settings page", %{conn: conn} do
{:ok, _lv, html} =
conn
... |
09e431624e297c0de81e57b42ad17505afdbf163 | 4,130 | [
555825268
] | [
"test"
] | defmodule OctopusAgentTest do
use ExUnit.Case, async: true
alias OctopusAgent.Test.Definitions
defmodule Client do
def start(args, _configs, service_module) do
if args["fail"] do
raise args["fail"]
end
case Agent.start_link(fn -> %{} end, name: service_module) do
{:ok, pid}... |
09e481e8eddbc251755348694c0e95ac21048ac7 | 14,478 | [
191612022
] | [
"test",
"documented"
] | defmodule GraphQL.MergeRequestResolverTest do
@moduledoc false
use GraphQL.ConnCase, async: true
import Core.Expectations.Mithril, only: [nhs: 1, search_user_roles: 1]
import Core.Factories
import Mox
alias Ecto.{Changeset, UUID}
alias Absinthe.Relay.Node
@person_fields """
lastName
birthDat... |
09e48403d856864a1dfc6dbb5e2ff69d8f0f89cb | 13,924 | [
1013321258
] | [
"test"
] | defmodule RubberDuck.Tool.SandboxTest do
use ExUnit.Case, async: true
alias RubberDuck.Tool.Sandbox
defmodule SafeTool do
use RubberDuck.Tool
tool do
name :safe_tool
description "A safe tool for testing"
category(:testing)
parameter :input do
type :string
requir... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.