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 |
|---|---|---|---|---|
094873b0eb576cef9b10b6a247c02e86d73ad8b1 | 3,300 | [
353295561
] | [] | defmodule Plausible.MixProject do
use Mix.Project
def project do
[
app: :plausible,
version: System.get_env("APP_VERSION", "0.0.1"),
elixir: "~> 1.10",
elixirc_paths: elixirc_paths(Mix.env()),
compilers: [:phoenix, :gettext] ++ Mix.compilers(),
start_permanent: Mix... |
0948a2d800d4ff7d0bb91fdfd3c7377ab728c006 | 7,180 | [
178653985
] | [
"test"
] | defmodule TicTacToeTest do
use ExUnit.Case
doctest TicTacToe
test "creates a new game where x goes first" do
game = TicTacToe.new_game()
assert TicTacToe.state(game) == :in_progress
assert TicTacToe.current_player(game) == :x
end
test "fails when player goes out of turn" do
game = TicTacToe.... |
0948a3daf504ed8ebc134294b5449eea0f0bb77c | 5,315 | [
229848659
] | [
"test"
] | defmodule TypedHeaderTest.DerivedTypesTest do
use ExUnit.Case, async: true
use TypedHeaders
# header and retval testing for derived simple types
# term, arity, byte, char, fun, timeout
def term_header(value :: term) do
value
end
def term_retval(value) :: term do
value
end
describe "for te... |
0948a957e901236a4bbecc1ee0c82fcfef1102a6 | 1,577 | [
408501944
] | [] | # This file is responsible for configuring your umbrella
# and **all applications** and their dependencies with the
# help of the Config module.
#
# Note that all applications in your umbrella share the
# same configuration and dependencies, which is why they
# all use the same configuration file. If you want different... |
0948b1b3a364e95401b4f0bcb410e0d86338798b | 2,282 | [
74148165
] | [
"phoenix"
] | defmodule Maze.API.V1.AuthController do
use Maze.Web, :controller
require Logger
alias Maze.User
alias Maze.Users
def sign_in(conn, %{"email" => email, "password" => password}) do
case Users.get(email) do
{:ok, user} ->
case Comeonin.Bcrypt.checkpw(password, user.password_hashed) do
... |
0949442f8d596c3ef7ec1fc3daaf70d4ac806e79 | 2,209 | [
716126299
] | [
"test",
"phoenix"
] | defmodule TrainingApiWeb.TeamControllerTest do
use TrainingApiWeb.ConnCase
import TrainingApi.TeamsFixtures
alias TrainingApi.Teams.Team
@create_attrs %{
name: "some name"
}
@update_attrs %{
name: "some updated name"
}
@invalid_attrs %{name: nil}
setup %{conn: conn} do
{:ok, conn: put_... |
09498cd714dacc5e3ce8e7c428790c7c5d79bbd8 | 1,668 | [
59310243
] | [
"test"
] | defmodule Exdns.QueryThrottleTest do
use ExUnit.Case, async: false
require Exdns.Records
require Logger
@ip {1, 2, 3, 4}
setup do
Exdns.QueryThrottle.clear()
end
test "throttle does not throttle TCP" do
assert Exdns.QueryThrottle.throttle(test_message(:dns_terms_const.dns_type_any), {:tcp, @ip}... |
0949d07fb49888d8e6803fd14f50842496fae71f | 18,044 | [
818588902
] | [
"typespec",
"documented"
] | defmodule Exa.File do
@moduledoc "File utilities."
require Logger
use Exa.Constants
import Exa.Types
alias Exa.Types, as: E
@doc "Test if filetype(s) indicate gzip compression."
@spec compressed?(E.filetype() | [E.filetype()]) :: bool()
def compressed?([]), do: false
def compressed?(type) when is_at... |
0949ff83f5c535484a40828a10fe3ce8e40a807a | 1,614 | [
104239381
] | [
"macro",
"documented",
"phoenix"
] | defmodule ElmIntroWeb 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 ElmIntroWeb, :controller
use ElmIntroWeb, :view
The definitions below will be executed for every view,
controlle... |
094a1cd930b06a4ae58d401dd8fa82754a453b32 | 2,799 | [
688626446
] | [
"test",
"ecto"
] | defmodule BikeShop.BikesTest do
use BikeShop.DataCase
alias BikeShop.Bikes
describe "bikes" do
alias BikeShop.Bikes.Bike
import BikeShop.BikeFixtures
@invalid_attrs %{
name: nil,
type: nil,
description: nil,
image_url: nil,
price: nil,
seats: nil
}
test... |
094a355e0c74b3fad6b30f566e6fe26e4449f124 | 1,914 | [
192128800
] | [
"phoenix",
"ecto"
] | defmodule ScentencedWeb.FragrantController do
use ScentencedWeb, :controller
alias Scentenced.Perfumes
alias Scentenced.Perfumes.Fragrant
def index(conn, _params) do
fragrants = Perfumes.list_fragrants()
render(conn, "index.html", fragrants: fragrants)
end
def new(conn, _params) do
changeset ... |
094a57c915be3cd3da575270422fc27bd62f53cc | 1,626 | [
598147632
] | [
"test"
] | defmodule MeilisearchTest.Casting.PaginatedTasks do
use ExUnit.Case, async: true
test "Cast Meilisearch.PaginatedTasks" do
{:ok, json} = File.read(__DIR__ <> "/paginated_tasks.json")
{:ok, json} = Jason.decode(json)
casted = Meilisearch.PaginatedTasks.cast(json)
assert %Meilisearch.PaginatedTasks{... |
094acca254d841c0bd2dfedbdcbd5c5401a7ef32 | 1,586 | [
960018471
] | [] | # 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 :task_api,
ecto_repos: [TaskApi.Repo],
gen... |
094aed0c703a8abd1220355619b95288882b44a3 | 2,333 | [
346868774
] | [
"genserver"
] | defmodule BookMock do
defstruct [:pid]
use GenServer
def create() do
{:ok, pid} = GenServer.start_link(__MODULE__, {0, %{}})
%BookMock{pid: pid}
end
@impl true
def init(state), do: {:ok, state}
@impl true
def handle_call({:add, %{isbn: isbn, title: title, description: description, publishedD... |
094b7be80a5dcb49c5df95fcd43f8525d04d26f8 | 4,203 | [
735050943
] | [
"test"
] | defmodule WebpexWeb.ImageControllerTest do
use WebpexWeb.ConnCase, async: true
describe "Image resize" do
setup do
conn =
build_conn()
|> put_req_header("accept", "image/jpg, image/png")
{:ok, %{conn: conn}}
end
test "GET raw jpg image from jpg", %{conn: conn} do
con... |
094cac353ba3d898818af9d781105aef672185ac | 3,133 | [
961813040
] | [
"test",
"ecto"
] | defmodule ElixirAndrew.ProgressTest do
use ElixirAndrew.DataCase
alias ElixirAndrew.Progress
describe "user_progress" do
alias ElixirAndrew.Progress.UserProgress
import ElixirAndrew.ProgressFixtures
@invalid_attrs %{unit: nil, level: nil, book: nil, reading_question_index: nil, game: nil, prev_tut... |
094cadf767e6e15e2c8a02a0896ec5a13f0d0c6e | 3,149 | [
317752022
] | [
"phoenix"
] | defmodule ProjWeb.ProjController do
use ProjWeb, :controller
import Ecto.Query, only: [from: 2]
def index(conn, _params) do
render(conn, "index.html")
end
def login(conn, %{"username" => username}) do
render(conn, "login.html", username: username)
end
def edit(conn, %{"username" => username, "m... |
094d00506ef493e3bff3e61f39b6347c7f090421 | 19,528 | [
949664843
] | [
"typespec",
"liveview",
"documented"
] | defmodule Raxol.UI.Components.Table do
# use Surface.Component
require Raxol.Core.Renderer.View
@moduledoc """
Table component for displaying and interacting with tabular data.
## Features
* Pagination
* Sorting
* Filtering
* Custom column formatting
* Row selection
* **Custom theming and stylin... |
094d401c418dd91d0cb8d8136db0f2534ede1721 | 1,665 | [
97610694
] | [] | # 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 :oauth2_login,
namespace: OAuth2Login,
... |
094e1c4f87f99bdb10b45767b62ef90dc945dc72 | 14,563 | [
259059225
] | [] | %{
"bamboo": {:hex, :bamboo, "1.4.0", "7b9201c49a843e4802061cf45692405b2c00efcf1cebf8b7b64f015ead072392", [:mix], [{:hackney, ">= 1.13.0", [hex: :hackney, repo: "hexpm", optional: false]}, {:jason, "~> 1.1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:plug, "~> 1.0", [hex: :plug, repo: "hexpm", optional: false... |
094f019e49b8c72e81ad75bfe2efec6b7da3fd6e | 8,247 | [
135061038
] | [
"typespec",
"documented"
] | # Storage is a reversed list; list.first() is the element with the highest ID / latest element
defmodule StorageHandler do
@moduledoc """
Stores and retrieves tomatoes, tasks, projects and combinations of them to/from flat file storage.
"""
use Timex
alias TomatoTracker.Types
# [%{Types.project(), task... |
094f83c919f1e88b8f3a3a184a76c8dd7fbed50d | 1,694 | [
193244709,
101434552,
198908023
] | [
"typespec",
"documented"
] | defmodule GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2PublishLabelRequest do
@moduledoc """
Request to publish a label.
## Attributes
* `languageCode` (*type:* `String.t`, *default:* `nil`) - The BCP-47 language code to use for evaluating localized field labels. When not specified, values in the d... |
094f8b56607e0313482ab6f63f7e36da8b4e2b8e | 3,263 | [
535807100
] | [] | defmodule NervesMetalDetector.Vendors.CoolComponentsUk do
alias NervesMetalDetector.Vendors.Vendor
@behaviour Vendor
@impl Vendor
def vendor_info() do
%Vendor{
id: "coolcomponentsuk",
name: "Cool Components",
country: :uk,
homepage: "https://coolcomponents.co.uk"
}
end
def... |
094faef6a0c0cbdddd2de88d5f611772f2fbe7a9 | 1,810 | [
377882024
] | [] | defmodule ParameterListNDFA do
def checkToken(stream, xml_carry, index, state \\ 0) do
tokenObj = Lexer.lexer(stream, index)
tokenType = tokenObj["type"]
token = tokenObj["token"]
nextIndex = tokenObj["index"]
# IO.inspect(tokenObj)
case state do
0 ->
IO.inspect("Checking to... |
094fe5b937fb6f88aa4bfdaf8281de388b13b5ea | 1,625 | [
111630239
] | [
"macro",
"documented",
"ecto",
"phoenix"
] | defmodule DotaLust.Web do
@moduledoc """
A module that keeps using definitions for controllers,
views and so on.
This can be used in your application as:
use DotaLust.Web, :controller
use DotaLust.Web, :view
The definitions below will be executed for every view,
controller, etc, so keep them ... |
094fe9c7521fe4c31f1d2a9f9e4595745586a0aa | 1,752 | [
192407200
] | [] | defmodule Transformers.Add do
@behaviour Transformation
alias Transformers.Validations.NotBlank
alias Transformers.Validations.ValidationStatus
alias Transformers.ParseUtils
alias Transformers.Conditions
@addends "addends"
@target_field "targetField"
@impl Transformation
def transform(payload, para... |
09500940f5a85d6c6d2023a7d4e8f1aa1cbf2142 | 20,797 | [
63650975
] | [
"typespec",
"supervisor",
"documented"
] | defmodule Task do
@moduledoc """
Conveniences for spawning and awaiting tasks.
Tasks are processes meant to execute one particular
action throughout their lifetime, often with little or no
communication with other processes. The most common use case
for tasks is to convert sequential code into concurrent c... |
095050050402d818c91e9aaa55a5ecc7f3ad35c8 | 4,734 | [
197663919
] | [
"documented"
] | defmodule Smoke.Metrics do
@moduledoc """
Creates Metrics from a list of events.
"""
def filter(events, {tag, value}) do
events
|> Stream.filter(fn
{_time, _measurement, metadata} ->
Enum.any?(metadata, fn
{^tag, ^value} -> true
_ -> false
end)
end)
end
... |
09514ccfb429ff0f6dd8266ada3c0635dd3c60f9 | 2,020 | [
855782553
] | [
"typespec"
] | defmodule Tutorials.Struct.SevenWonders do
defstruct name: "", country: ""
alias Tutorials.Struct.SevenWonders
@type t :: %SevenWonders{
name: String.t(),
country: String.t()
}
@spec all :: [t()]
def all() do
[
%SevenWonders{name: "Taj Mahal", country: "India"},
%SevenWonders{na... |
09521909adaaee5fb91b2baa2871862dd42b5133 | 6,192 | [
319448136
] | [
"typespec",
"macro",
"documented"
] | defmodule Mix.Generator do
@moduledoc """
Conveniences for working with paths and generating content.
"""
@doc ~S"""
Creates a file with the given contents.
If the file already exists and the contents are not the same,
it asks for user confirmation.
## Options
* `:force` - forces creation withou... |
0952295d5de46ab3e6827d60bfb6ddbb4cad5f00 | 2,028 | [
68232027
] | [
"phoenix"
] | defmodule Sitrep.Team.MemberController do
use Sitrep.Web, :controller
alias Sitrep.Member
plug :assign_team
def index(conn, _params) do
members = conn.assigns[:team]
|> assoc(:members)
|> Repo.all
render(conn, "index.json", members: members)
end
def create(conn, %{"member" => member_par... |
09522d648195878e3dc4dee9235cda04bc2cddb4 | 2,103 | [
125938964
] | [
"test",
"ecto"
] | defmodule AccentTest.SyncController do
use Accent.ConnCase
import Ecto.Query, only: [from: 2]
alias Accent.AccessToken
alias Accent.Collaborator
alias Accent.Document
alias Accent.Language
alias Accent.Operation
alias Accent.Project
alias Accent.Repo
alias Accent.Revision
alias Accent.User
de... |
0954324f80d41bb71cecb0aeba3aefb5fa62e47f | 5,376 | [
766000738
] | [
"test",
"documented"
] | defmodule ApiTest do
@moduledoc false
use ExUnit.Case
setup do
{:ok, _pid} = start_supervised({EcspanseTest, :test})
Ecspanse.System.debug()
end
describe "current_state" do
test "not found returns error" do
assert {:error, :not_found} = EcspanseStateMachine.current_state("1234")
end
... |
09548ae1de57e1faab97341c100724712d426c97 | 21,334 | [
47724382
] | [
"genserver",
"typespec",
"documented"
] | defmodule SIP.DialogImpl do
@moduledoc """
SIP module layer implementation. Do not use directy.
Use the API provided by SIP.Dialog module
"""
use GenServer
require Logger
require SIP.Uri
import SIP.Msg.Ops
defstruct [
msg: nil, # SIP message that created this dialog
allows: [],
routeset: [],
... |
0955517276a27aaa58affa76671222cfa13c4e7d | 2,173 | [
140020769
] | [] | defmodule Bisect do
def find(key, callback_module, start_args) do
state = callback_module.init(start_args)
case find(callback_module.first_index(state), callback_module.last_index(state), key, callback_module, state) do
{index , key_found} when key_found < key ->
next_index = callback_module.ne... |
09559d49f7cd0e95a58cf261f05813c8f5e4e50f | 2,628 | [
183965520
] | [
"typespec",
"documented"
] | defmodule Xit.IndexMeta do
@moduledoc """
`file_meta`
Map of file paths to file ids,
Example: %{"some/file" => "<sha>"}.
`dir_meta`
# Map of dir paths to sets containing the file and dir paths in given dirs.
# Example: %{"" => MapSet<["some"]>, "some" => MapSet<["some/file"]>}.
# Note that the content ... |
0955c261419be2470ab5aaf42969002e4e38d8de | 2,133 | [
649283001
] | [
"genserver",
"liveview"
] | defmodule ProbaseWeb.NotifyLiveView do
use Phoenix.LiveView
alias Probase.Notify
alias ProbaseWeb.Presence
defp live_view_topic(chat_id), do: "chat:#{chat_id}"
def render(assigns), do: ProbaseWeb.NotifyView.render("notify_messages.html", assigns)
def mount(
_params,
%{"user_notify_chat" =... |
0955dc113760eb9902d3dc6bb07b1de064f821e1 | 1,725 | [
539770430
] | [
"test",
"ecto"
] | defmodule TurboDemo.ThingTest do
use TurboDemo.DataCase
alias TurboDemo.Thing
describe "todos" do
alias TurboDemo.Thing.Todo
import TurboDemo.ThingFixtures
@invalid_attrs %{title: nil}
test "list_todos/0 returns all todos" do
todo = todo_fixture()
assert Thing.list_todos() == [tod... |
0955fa93ce78475fb80175e09e858a22edc03d06 | 11,232 | [
175173273
] | [
"test"
] | defmodule FaktoryWorker.Worker.HeartbeatServerTest do
use ExUnit.Case
import Mox
import FaktoryWorker.ConnectionHelpers
import FaktoryWorker.EventHandlerTestHelpers
alias FaktoryWorker.Random
alias FaktoryWorker.ConnectionManager
alias FaktoryWorker.Worker.HeartbeatServer
setup :set_mox_global
setu... |
0956a37a517ba78f922e57e4f594254256d3d1a5 | 1,689 | [
297121840
] | [
"typespec",
"documented"
] | defmodule DigitalOcean.FloatingIPAction do
alias DigitalOcean.{ Operation }
@doc """
Create an action for a floating IP.
## Example assigning a floating IP to a droplet
iex> DigitalOcean.FloatingIPAction.create(
...> "<IP_ADDRESS>",
...> type: "assign",
...> droplet_id: 8219222
... |
0956b60b52aebc2ad8114597767837c895ff2522 | 2,570 | [
59797724
] | [] | # 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
# Configures the endpoint
config :nexterizer, Nexterizer.Endpoint,
url: [host: "loc... |
09577ebf1b39feaf20895e83715b9c52dd091666 | 12,420 | [
967831208
] | [
"genserver",
"typespec",
"documented"
] | defmodule WebsockexNova.Transport.RateLimiting do
@moduledoc """
Provides rate limiting functionality for WebSocket requests.
This module serves as a centralized interface for rate limiting across the application,
delegating to the configured RateLimitHandler implementation. It includes:
* An Agent process ... |
09578670f37f23f82611b84b102b5df745c25810 | 5,455 | [
166600431
] | [] | defmodule Comparator do
def read(path) do
{:ok, text} = File.read path #"/Users/carlogilmar/Desktop/comparator.csv"
text
end
def get_rows_from_file( path ) do
lines = read(path) |> String.split("\r\n")
for line <- lines do
rows = String.split(line, ",")
diablito( Enum.at( rows, 15), row... |
095803fccea74b193bf668658b45f8b4aa424069 | 8,254 | [
444819524
] | [
"typespec",
"macro",
"documented",
"ecto"
] | defmodule RList.ActiveSupport do
@moduledoc """
Summarized all of List functions in Rails.ActiveSupport.
If a function with the same name already exists in Elixir, that is not implemented.
Defines all of here functions when `use RList.ActiveSupport`.
"""
@spec __using__(any) :: list
defmacro __using__(_op... |
09584ef01fc69f3bf3e623a4da7a4589c4794267 | 2,627 | [
81576473
] | [] | # 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 :sentinel_example,
ecto_repos: [Sentinel... |
095974a540711ed91f5a91fb92b126f97b1c4ad8 | 1,568 | [
193244709
] | [
"typespec",
"documented"
] | defmodule GoogleApi.Eventarc.V1.Model.GoogleChannelConfig do
@moduledoc """
A GoogleChannelConfig is a resource that stores the custom settings respected by Eventarc first-party triggers in the matching region. Once configured, first-party event data will be protected using the specified custom managed encryption k... |
09599aa60d2f645c30fd956e9c65defa182494e4 | 1,690 | [
218389303
] | [
"macro",
"documented",
"phoenix"
] | defmodule KuehlschrankWeb 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 KuehlschrankWeb, :controller
use KuehlschrankWeb, :view
The definitions below will be executed for every view,... |
0959b548fb4d9acc6084b9e836c643e17d7d3a62 | 1,713 | [
110971596
] | [
"documented",
"ecto"
] | defmodule GrabCikguApi.Tutors.Tutor do
use Ecto.Schema
import Ecto.Changeset
alias GrabCikguApi.Tutors.{Tutor, TutorProfile}
schema "tutors" do
field :name, :string, virtual: true
field :email, :string, unique: true
field :username, :string
field :password, :string, virtual: true
field :pa... |
095a855d2018982ec18c44a9b11a2c1eecd5be96 | 1,515 | [
394467538
] | [
"typespec",
"documented"
] | defmodule Stellar.TxBuild.Ledger.Data do
@moduledoc """
Ledger `Data` struct definition.
"""
alias StellarBase.XDR.{Data, String64}
alias Stellar.TxBuild.AccountID
@behaviour Stellar.TxBuild.XDR
@type account_id :: String.t()
@type data_name :: String.t()
@type validation :: {:ok, any()} | {:error, ... |
095a88adedffeb04583082a3922844fa01a5e825 | 2,784 | [
971550908
] | [
"phoenix"
] | defmodule TimeManagerAppWeb.Router do
use TimeManagerAppWeb, :router
pipeline :api do
plug(:accepts, ["json"])
end
pipeline :api_auth do
plug(:accepts, ["json"])
plug(TimeManagerAppWeb.Plugs.AuthPlug)
end
# Public routes
scope "/api", TimeManagerAppWeb do
pipe_through(:api)
# Defau... |
095a99f93293ff52c2be44966a049977bcbb3f6e | 2,501 | [
161566511
] | [
"supervisor"
] | defmodule ExDocRefined.Server do
use Supervisor
require Logger
def init(opts) do
{:ok, opts}
end
def start_link(opts) do
cowboy_version = Application.spec(:cowboy) |> cowboy_version()
dispatch = dispatch(cowboy_version, opts)
{:ok, pid} = start_cowboy(cowboy_version, dispatch, opts)
Logg... |
095ac3e19545b9c087ee4a67941b182cc0ebcc58 | 4,150 | [
956486953
] | [
"documented",
"ecto"
] | defmodule ChezaCards.Learning do
@moduledoc """
The Learning context.
"""
import Ecto.Query, warn: false
alias ChezaCards.Repo
alias ChezaCards.Learning.{Track, Module, Lesson, UserProgress}
alias ChezaCards.Accounts.User
@doc """
Returns the list of featured tracks.
"""
def list_featured_track... |
095ad6a4aa90517ce41b491a1b375bca11591758 | 11,926 | [
173557585
] | [
"typespec",
"documented",
"ecto"
] | defmodule Thysis.Sources do
@moduledoc """
The Sources context.
"""
import Ecto.Query, warn: false
alias Ecto.Multi
alias Thysis.Repo
alias Thysis.Sources.Source
alias Thysis.SourceAuthor
alias Thysis.Author
alias Thysis.SourceType
alias Thysis.SourceTypeApi
alias Thysis.SourceAuthorApi
@doc... |
095af17a0443ffdb297a11d5b0796a0d23ee909d | 2,117 | [
379427989
] | [] | defmodule PlateSlate.Mixfile do
use Mix.Project
def project do
[
app: :plate_slate,
version: "0.0.1",
elixir: "~> 1.13",
elixirc_paths: elixirc_paths(Mix.env()),
compilers: [:phoenix] ++ Mix.compilers(),
start_permanent: Mix.env() == :prod,
aliases: aliases(),
de... |
095b653a3ddb3aca0fa56cadc2f98c13b2d33eaf | 12,255 | [
668890079
] | [
"documented"
] | defmodule DomHelpers.Accessors do
@moduledoc """
Collection of methods to simplify the access to different parts of the DOM.
"""
@doc """
Retrieve the values of the given attribute in the given fragment.
## Examples
```
iex> find(~s(<ul><li class="odd">First</li><li class="even">Second</li><li class=... |
095b7029e783507599650464425e5c69c19a6872 | 2,921 | [
997717307
] | [
"test"
] | defmodule Gemini.TelemetryTest do
use ExUnit.Case
@moduletag :capture_log
setup do
# Install telemetry test handler
:telemetry_test.attach_event_handlers(self(), [
[:gemini, :request, :start],
[:gemini, :request, :stop],
[:gemini, :request, :exception],
[:gemini, :stream, :start]... |
095b75f35d2ee2d01ca5573054a8c38d9ab94f2d | 2,333 | [
159940780
] | [] | defmodule Advent2018.Day09.Game do
defstruct marbles: [0],
current_marble_index: 0,
current_player: 1,
player_count: nil,
last_marble_index: nil,
next_marble: 1,
scores: %{}
end
defmodule Advent2018.Day09 do
alias Advent2018.Day09.Game
def ... |
095c88e28d0913d0f13f3e2bb448a409f64bfbec | 2,040 | [
1015009442
] | [
"genserver",
"liveview"
] | defmodule EthExplorerWeb.BlockLive.Index do
use EthExplorerWeb, :live_view
alias EthExplorer.Blockchain
alias EthExplorer.Repo
alias EthExplorer.Blockchain.Block
@impl true
def mount(_params, _session, socket) do
if connected?(socket), do: Process.send_after(self(), :update_blocks, 500)
blocks = ... |
095ca7889b80e083ef8a291cb376627129ba4c24 | 4,963 | [
95676843
] | [
"genserver",
"typespec",
"documented",
"ecto"
] | defmodule Fairbanks.Importing.FeedBroker do
require Logger
use GenServer
alias FairbanksWeb.Forecast
# Default time we should begin checking during the day.
# Latest is UTC-0400 (EST); one hour earlier for EDT is OK.
@earliest_utc_update_hour 9
@doc """
Once started, will await an :import call
"""
... |
095dafb8888aac557a5e06e617f38c8557cba2cf | 3,480 | [
332365989
] | [
"typespec",
"documented",
"ecto"
] | defmodule Ms2ex.Context.HotBars do
@moduledoc """
Context module for hot bar-related operations.
This module provides functions for managing
character hot bars and quick slots.
"""
alias Ms2ex.{Repo, Schema, Types}
import Ecto.Query, except: [update: 2]
@doc """
Gets a hot bar by the given attribu... |
095e528226e0b88ec33ab662d6b3ecbc2e8ce5f8 | 2,661 | [
900492230
] | [
"typespec",
"documented"
] | defmodule ReqNOAA.Model.Gridpoint do
@moduledoc """
Raw forecast data for a 2.5km grid square. This is a list of all potential data layers that may appear. Some layers may not be present in all areas. * temperature * dewpoint * maxTemperature * minTemperature * relativeHumidity * apparentTemperature * heatIndex * w... |
095e76de217dae00f291f3d1d7631a98290a47e5 | 1,772 | [
972293262
] | [
"phoenix"
] | defmodule ArgyleWerewolfWeb.PageController do
use ArgyleWerewolfWeb, :controller
plug :put_current_section
plug :put_nav_items
def home(conn, _params) do
render(conn |> assign(:page_title, "Angela Quinton") |> assign(:back_link, nil), :home)
end
def code(conn, _params) do
render(conn |> assign(:pa... |
095e917c89dcf1805cfa38a56469e889274279a4 | 1,733 | [
148329190,
133667387
] | [
"typespec",
"documented",
"ecto"
] | defmodule AttestationApi.Validators.VeriffValidator do
@moduledoc """
Defines functions to validate data during Verriff verification proccess
"""
import Ecto.Changeset
alias AttestationApi.DigitalVerifications
@doc """
Validates timestamp not to be older than hour
"""
@spec validate_timestamp(Ecto.C... |
095ef96814eb3ef539ab23da46325f44f5f759da | 20,907 | [
603610250
] | [
"typespec",
"phoenix",
"documented"
] | defmodule Pleroma.Web.OAuth.OAuthController do
use Pleroma.Web, :controller
alias Pleroma.Helpers.AuthHelper
alias Pleroma.Helpers.UriHelper
alias Pleroma.Maps
alias Pleroma.MFA
alias Pleroma.Registration
alias Pleroma.Repo
alias Pleroma.User
alias Pleroma.Web.Auth.Authenticator
alias Pleroma.Web.O... |
095fd291ea0667c0cd2bb2e32fdfd520f599f8fe | 5,083 | [
585915775,
500260157
] | [
"test"
] | defmodule Pleroma.Activity.Ir.TopicsTest do
use Pleroma.DataCase, async: true
alias Pleroma.Activity
alias Pleroma.Activity.Ir.Topics
alias Pleroma.Object
require Pleroma.Constants
import Mock
describe "poll answer" do
test "produce no topics" do
activity = %Activity{object: %Object{data: %{... |
09607fb0fc69e51c00242b83aa71007d981f065d | 13,274 | [
196089700
] | [] | %{
"certifi": {:hex, :certifi, "2.5.1", "867ce347f7c7d78563450a18a6a28a8090331e77fa02380b4a21962a65d36ee5", [:rebar3], [{:parse_trans, "~>3.3", [hex: :parse_trans, repo: "hexpm", optional: false]}], "hexpm", "805abd97539caf89ec6d4732c91e62ba9da0cda51ac462380bbd28ee697a8c42"},
"combine": {:hex, :combine, "0.10.0", "... |
0960bb4d80d5f73a97f60b5c64fc59c8599cb18b | 1,834 | [
737922018
] | [
"test"
] | defmodule Server.Genserver.Acceptor.Test do
alias Manager.Pubsub
alias Server.Genserver.Acceptor
use ExUnit.Case
defmodule TestConnectionHandler do
def handle_message(message, _state) do
assert message == "test_message"
:ok
end
def handle_connection(state) do
assert state == %{c... |
09619435a2942dd22efa48cb70a6e83353265046 | 4,093 | [
257787813
] | [
"genserver",
"documented"
] | defmodule Domain.Jobs.Executors.Concurrent do
@moduledoc """
This module starts a GenServer that executes a callback function
on a given interval on each node that runs the jobs. This means
concurrency control should be implemented in the callback function
itself (eg. by using `SELECT ... FOR UPDATE SKIP LOCK... |
0961b7393843d0b1a6ba0476a81fa6d1d85796dd | 1,515 | [
242236658
] | [
"documented"
] | defmodule Mix.Tasks.PhxUp.Gen.WebModule do
@shortdoc "Generate a module in lib/your_app_web and its test"
@moduledoc """
Generate a module in lib/your_app_web and its test.
mix phx_up.gen.web_module Some.Web.Module
or
mix phx_up.gen.wm Some.Web.Module
The first argument is the web module name.... |
0961fb3a47fe4f8b17de6209d794bc8a1de0c07c | 4,170 | [
60898046
] | [
"typespec",
"documented"
] | defmodule Raxx.Request do
@moduledoc """
HTTP requests to a Raxx application are encapsulated in a `Raxx.Request` struct.
A request has all the properties of the url it was sent to.
In addition it has optional content, in the body.
As well as a variable number of headers that contain meta data.
Where appr... |
096210f56c2e116b563793a612a39d8c79d8bbb6 | 1,747 | [
40737110
] | [
"test"
] | defmodule ChatbotDSL.JSONASTConverterTest do
use ExUnit.Case
alias ChatbotDSL.JSONASTConverter
@json_ast """
{
"type": "if",
"arguments": [
{
"type": "contains",
"arguments": [
{"type": "var", "arguments": [
{"type": "atom", "arguments": ["input"]}
... |
09625b1a5e626210955a4638fd1c8811d12456fb | 1,756 | [
901727671
] | [
"documented"
] | defmodule NxAudio.Visualizations.Wave do
@moduledoc """
Provides a waveform visualization for Nx-based audio tensors.
"""
@moduledoc section: :visualizations
alias VegaLite, as: Vl
@doc """
Creates a waveform visualization from audio tensor data.
Expects a tensor with shape [channels, samples] where:... |
09625d658a73eb37af7639ae97539334b253b50c | 2,704 | [
264821449
] | [
"test"
] | defmodule BrickTest do
use ExUnit.Case
import Tetris.Brick
alias Tetris.Points
test "creates a new brick" do
assert new_brick().name == :i
end
test "creates a new random brick" do
actual = new_random()
assert actual.name in [:i, :l, :z, :o, :t]
assert actual.rotation in [0, 90, 180, 270]... |
0962bb61a2ad98d89d3add1671f9f4003e055640 | 15,643 | [
248292846,
423405342
] | [
"typespec",
"documented",
"phoenix"
] | defmodule Ueberauth do
@moduledoc """
Ueberauth is two-phase authentication framework that provides a clear API -
allowing for many strategies to be created and shared within the community. It
is heavily inspired by [Omniauth](https://github.com/intridea/omniauth). You
could call it a port but it is significa... |
0962c4b3640a647c7020cb19ff9229c992e4e1ab | 23,253 | [
77479079
] | [
"phoenix",
"ecto"
] | defmodule Registro.UsersController do
use Registro.Web, :controller
use Timex
alias __MODULE__
alias Registro.{
Authorization,
Country,
Pagination,
User,
Role,
Branch,
Datasheet,
UserAuditLogEntry,
VolunteerActivity,
AssociatePayment
}
import Ecto.Query
plug Auth... |
0962e4485c80b3870788f8a2dc33c023e5e62bfc | 1,567 | [
57905764
] | [
"genserver"
] | defmodule VoiceController.UDPServer do
use GenServer
require Logger
defmodule Message do
defstruct [:id, :type, :data, :ip, :port]
end
defmodule State do
defstruct [:ip, :udp]
end
@port Application.get_env(:voice_controller, :port)
@multicast Application.get_env(:voice... |
096389a17c5f3c59c33d9f43b2cbebe796e6d366 | 1,938 | [
542527957
] | [
"liveview",
"test"
] | defmodule FoodOrderWeb.Admin.ProductLiveTest do
use FoodOrderWeb.ConnCase
import Phoenix.LiveViewTest
import FoodOrder.Factory
describe "test default page product" do
setup :register_and_log_in_admin
test "load page", %{conn: conn} do
product = insert(:product)
{:ok, view, _html} = live(c... |
0963fa72175d3245a78e2c4917ac45aee429e2b5 | 2,136 | [
977324828
] | [
"documented"
] | defmodule Xombadill.Handlers.MilestoneHandler do
@moduledoc """
Handler that relays DCSS (Dungeon Crawl Stone Soup) deaths and other milestone notifications
from Libera IRC (#crawl-octolog, #pissss) to the configured channel based on tracked player patterns.
It highlights death announcements and also echoes me... |
09642bea0a4c051f12b5b29c0e6e0c9a520e10e2 | 2,671 | [
182314088
] | [
"test"
] | defmodule MagicHome.Sensing.SensorManagerTest do
use MagicHome.DataCase
setup do
MagicHome.TestTools.reset_magic_home_state()
MagicHome.TestTools.reset_bpm_state()
Application.put_env(:magic_home, :sensors_enabled, true)
end
test "start/1 starts the specified process" do
fake_sensor = insert(:... |
096438808134739c5cf27a76a630f91a7ca93e38 | 4,559 | [
814869922
] | [
"typespec",
"documented",
"ecto"
] | defmodule Fhir.GenomicStudyAnalysis do
@moduledoc """
A GenomicStudy is a set of analyses performed to analyze and generate genomic data.
"""
use Ecto.Schema
import Ecto.Changeset
@derive Jason.Encoder
@primary_key false
embedded_schema do
field(:date, :string)
field(:id, :string)
field(:in... |
0964ecfe17792787db403f19d786b522d86c1713 | 7,800 | [
129699403
] | [
"documented",
"ecto"
] | defmodule Tuist.Mautic.Workers.SyncCompaniesAndContactsWorker do
@moduledoc ~S"""
Worker that syncs Tuist accounts (organizations and users) with Mautic.
"""
use Oban.Worker
import Ecto.Query
alias Tuist.Accounts
alias Tuist.Accounts.Organization
alias Tuist.Accounts.User
alias Tuist.Billing.Subscri... |
0964fca0f41e5919d96d2a237be45fcb3af2f36e | 12,309 | [
193244709,
101434552,
198908023
] | [
"typespec",
"documented"
] | defmodule GoogleApi.CloudPrivateCatalog.V1beta1.Api.Organizations do
@moduledoc """
API calls for all endpoints tagged `Organizations`.
"""
alias GoogleApi.CloudPrivateCatalog.V1beta1.Connection
alias GoogleApi.Gax.{Request, Response}
@library_version Mix.Project.config() |> Keyword.get(:version, "")
@... |
0965534b8fc8ab73ca57ebc8d7417854a3a53b92 | 8,589 | [
103582507
] | [
"test"
] | defmodule AvroEx.Schema.EncoderTest do
use ExUnit.Case, async: true
describe "encode/2" do
test "primitive" do
input = "int"
assert schema = AvroEx.decode_schema!(input)
assert AvroEx.encode_schema(schema) == ~S({"type":"int"})
end
test "logical types" do
input = %{"type" => "... |
096568eead5768de66da1a6e22bfd021ae7986b1 | 4,601 | [
93086929
] | [
"test"
] | defmodule Hammer.Atomic.FixWindowTest do
use ExUnit.Case, async: true
alias Hammer.Atomic.FixWindow
setup do
table = :ets.new(:hammer_atomic_fix_window_test, FixWindow.ets_opts())
{:ok, table: table}
end
describe "hit" do
test "returns {:allow, 1} tuple on first access", %{table: table} do
... |
096636923c61cf79796cc6de281353fbe6ef57de | 3,919 | [
942811655,
920024200
] | [
"test",
"documented",
"ecto"
] | defmodule PreFlightChecks.OrganizationPFC.Model.OrganizationPFCTest do
@moduledoc false
use ExUnit.Case, async: true
alias PreFlightChecks.OrganizationPFC.Model.OrganizationPFC
describe "organization pre-flight checks changeset" do
test "without organization_id is invalid" do
params = %{
req... |
0966843173bb706fe5312b2043e9ec1d0432ad97 | 4,905 | [
989917799
] | [
"typespec",
"documented"
] | defmodule ExMCP.Internal.SecurityConfig do
@moduledoc """
Centralized security configuration management with validation.
This module provides secure defaults and configuration validation
for the ExMCP security system.
"""
require Logger
@default_config %{
# Token passthrough prevention
trusted_... |
096729729b172b73b305c20a0cfeab8935e9b92e | 2,037 | [
211001756
] | [
"typespec",
"documented"
] | defmodule FastXlsxExporter.SharedStrings do
@moduledoc false
require EEx
alias FastXlsxExporter.Utils
@type dictionary() :: %{binary() => integer()}
@type shared_strings_context() :: {:file.io_device(), integer(), dictionary()}
@path Path.join(["xl", "sharedStrings.xml"])
EEx.function_from_file(:defp... |
0967390bd616768e2171c3a869d66f4d7d686927 | 2,684 | [
95329315
] | [
"test",
"documented"
] | defmodule JSON.LD.W3C.CompactTest do
@moduledoc """
The official W3C JSON.LD 1.1 Test Suite for the _Compaction Algorithm_.
See <https://w3c.github.io/json-ld-api/tests/compact-manifest.html>.
"""
use ExUnit.Case, async: false
use RDF.Test.EarlFormatter, test_suite: :"json-ld-api"
import JSON.LD.TestSu... |
0967d0bfc1e60f6a5dccaa14d84366dde11288b8 | 1,517 | [
225529989
] | [] | defmodule Advent.Six do
def one do
one_to_one =
read_input()
|> Enum.reduce(%{}, &map_orbits/2)
Enum.reduce(one_to_one, %{}, fn {body, _}, acc ->
Map.put(acc, body, length(get_orbit_chain(one_to_one, body)))
end)
|> Enum.reduce(0, fn {_, orbits}, sum -> sum + orbits end)
end
de... |
0967e7f3773fc9ab654443a6282713cdd4fd7467 | 1,666 | [
139330443
] | [
"test"
] | defmodule Spat.Geometry.SphereTest do
use ExUnit.Case
doctest Spat.Geometry.Sphere
test "sphere intersection" do
assert true == Spat.Geometry.Sphere.intersect({ 0 }, 1, Spat.Bounds.new({ 1 }))
assert true == Spat.Geometry.Sphere.intersect({ 1 }, 1, Spat.Bounds.new({ 1 }))
assert tru... |
09680244714c1454ab24268ecdd9d64c2aa380f1 | 2,986 | [
909471257
] | [
"typespec",
"documented"
] | defmodule Aurora.Uix.Templates.Basic.Actions do
@moduledoc """
Provides helper functions to manage and modify action groups within Aurora UIX templates.
## Key Features
- Adds actions to a given action group in the assigns map.
- Modifies existing actions in the assigns map based on provided options.
... |
0968501381a4705d56dc4dda90384d3872afe899 | 2,980 | [
291309764
] | [
"liveview"
] | defmodule LiveViewStudioWeb.LightLive do
use LiveViewStudioWeb, :live_view
def mount(_params, _session, socket) do
IO.puts("MOUNT #{inspect(self())}")
socket = assign(socket, brightness: 10, temp: 3000)
{:ok, socket}
end
def render(assigns) do
IO.puts("RENDER #{inspect(self())}")
~H"""
... |
0968be4d99f19215a14cefc67581461a4a2722c9 | 2,342 | [
224211609
] | [] | defmodule Site.Game.Operations.Create do
require Site.ErrorCodes
alias Site.ErrorCodes, as: ErrCodes
use Monad.Operators
import Monad.Result
alias Site.{Game, Player, Repo}
alias Site.User.Operations.GetCurrentGame
def call(game_params, user_id) do
result = success(user_id)
~>> fn user_id... |
09691a967b49a6c0160f230685b304e6f1e416d7 | 1,660 | [
163844403
] | [
"test"
] | defmodule RecipesTest do
use ExUnit.Case, async: true
@recipes [
chili: %{name: "Chili", href: "http://example.com/chili"},
tomato_basil_soup: %{name: "Tomato Basil Soup", href: "http://example.com/tomato-basil-soup"},
enchiladas: %{name: "Enchiladas", href: "http://example.com/enchiladas"}
]
setu... |
09699663add9e8bb000cdd5f7c457a51bcb2daed | 2,127 | [
777303747
] | [
"liveview"
] | defmodule TodoWeb.BoardHTML do
use TodoWeb, :html
attr :id, :integer, required: true
attr :title, :string, required: true
attr :tasks_count, :integer, required: true
defp board_card(assigns) do
~H"""
<.link href={~p"/boards/#{@id}"}>
<div class="flex flex-col bg-gray-800 text-white border-2 bo... |
096a31532209050834d9609ab6f5f2f7b53e8aff | 1,592 | [
262875231
] | [
"phoenix"
] | defmodule BlogWeb.PageController do
use BlogWeb, :controller
alias Blog.RepoFunctions
alias Blog.Models.Posts
def index(conn, _params) do
posts = Blog.RepoFunctions.get_posts()
render(conn, "index.html", posts: posts)
end
def upvote(conn, %{"id" => id}) do
post = RepoFunctions.get_post(id)
ca... |
096a9623a584f13e316da3a6ca1b8c3b72d82d8c | 2,006 | [
596034048
] | [
"genserver"
] | defmodule WorkerEngagement do
use GenServer
require Logger
# Server API
def init(args) do
name = Keyword.fetch!(args, :id)
delay_time = Keyword.fetch!(args, :delay)
destination = Keyword.fetch!(args, :destination)
state = %{
id: name,
destination: destination,
... |
096aa2e1ec2cc88fc1c58c7461b1fc8e48d4bef0 | 2,789 | [
48720199
] | [
"ecto"
] | # See `Ecto.Repo` docs for full list of Repo read/write functions
# See `Ecto.Query` and `Ecto.Query.API` for full API of querying functions
# Note that any variable values must be pinned using `^`
# A simple query (macro syntax)
first_user = User
|> select([u], count(u.id))
|> where([u], ilike(u.username, ^"%sub... |
096aa64de2a948573ed873e92fccce458f33fb7e | 3,027 | [
184338071
] | [
"test",
"phoenix"
] | defmodule ZooWeb.PrescricaoControllerTest do
use ZooWeb.ConnCase
alias Zoo.Clinic
@create_attrs %{codconsulta: 42, codmedicamento: 42}
@update_attrs %{codconsulta: 43, codmedicamento: 43}
@invalid_attrs %{codconsulta: nil, codmedicamento: nil}
def fixture(:prescricao) do
{:ok, prescricao} = Clinic.cr... |
096aaa35080be0e5a8dbe078174a636dad529372 | 6,052 | [
346794822
] | [] | defmodule CommentGraphql.GraphQL.Schema do
use Absinthe.Schema
alias CommentGraphql.Client
object :result do
field :success, :boolean
end
object :get_comments do
field :commentid, :integer
field :comments, :string
field :isdeletedbyadmin, :boolean
field :likecount, :integer
fie... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.