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 |
|---|---|---|---|---|
06c7c34199f70c659a7a1fb6b4bbf26752499ac3 | 3,012 | [
144210392
] | [] | %{
"certifi": {:hex, :certifi, "2.3.1", "d0f424232390bf47d82da8478022301c561cf6445b5b5fb6a84d49a9e76d2639", [:rebar3], [{:parse_trans, "3.2.0", [hex: :parse_trans, repo: "hexpm", optional: false]}], "hexpm"},
"earmark": {:hex, :earmark, "1.2.5", "4d21980d5d2862a2e13ec3c49ad9ad783ffc7ca5769cf6ff891a4553fbaae761", [:... |
06c7e0d6db0d8a10e81158b63de65d77c2317c93 | 4,085 | [
856957966
] | [
"liveview",
"test"
] | defmodule TimeTrackerWeb.CalendarSystemLiveTest do
use TimeTrackerWeb.ConnCase
import Phoenix.LiveViewTest
import TimeTracker.CalendarFixtures
@create_attrs %{name: "some name", week_length: 42, day_one: "2024-09-07"}
@update_attrs %{name: "some updated name", week_length: 43, day_one: "2024-09-08"}
@inva... |
06c828dc4c2cf9100e0a182da72bd4b5542b2078 | 1,760 | [
636601411
] | [
"test"
] | defmodule Kraken.ProjectStartTest do
use ExUnit.Case
alias Kraken.ProjectStart
alias Kraken.{Pipelines, Routes, Services}
@config [
kraken_folder: "test/project_start",
define_services: true,
start_services: true,
define_pipelines: true,
start_pipelines: true,
define_routes: true
]
... |
06c8586930deda2b6c9d2fca99bc1c13aa30ce6c | 4,283 | [
518625976,
640656590,
599193220,
564964111,
148905093,
576295356,
637945987,
258138756,
545071883,
600362606,
603266979,
604478896,
232195183,
580858551,
669079833,
575449429,
997019831,
790205522,
61451301,
276963326,
575507361,
592311457,
534653779,
594893960,
59795... | [
"test"
] | defmodule FileSnifferTest do
use ExUnit.Case
@bmp_file File.read!(Path.join("assets", "bmp.bmp"))
@gif_file File.read!(Path.join("assets", "gif.gif"))
@jpg_file File.read!(Path.join("assets", "jpeg.jpg"))
@png_file File.read!(Path.join("assets", "png-transparent.png"))
@exe_file File.read!(Path.join("asset... |
06c8727e812c3c7004713a518f091c72db1d95ba | 4,316 | [
923021198
] | [
"liveview",
"test"
] | defmodule ValentineWeb.WorkspaceLive.IndexTest do
use ValentineWeb.ConnCase
import Valentine.ComposerFixtures
alias Valentine.Composer
import Mock
setup do
workspace = workspace_fixture()
socket =
%Phoenix.LiveView.Socket{
assigns: %{
__changed__: %{},
current_user:... |
06c87585a20c5fdecef71fce5005da1800b23a29 | 2,627 | [
75657500
] | [] | defmodule Day11 do
def part1(input) do
input
|> parse()
|> play(20, fn worry -> floor(worry / 3) end)
end
def part2(input) do
starting_monkeys = parse(input)
mod = starting_monkeys |> Map.values() |> Enum.map(&elem(&1, 2)) |> Enum.product()
play(starting_monkeys, 10000, fn worry -> rem(wo... |
06c8b35df72f56c704e257acd48e07d7bab2f2ee | 3,310 | [
758589700
] | [] | defmodule Summoners.SummonerTracking do
use Agent
alias Summoners.SummonerTracking.TrackedSummoner
alias Summoners.RequestClients.Client
alias Task.Supervisor
alias Summoners.TaskSupervisor
require Logger
@time_to_track %{amount: 1, units: :hour}
def start_link(_) do
Agent.start_link(fn -> [] en... |
06c910bef2bf673bfb7ec5ab744029b6ed4048eb | 2,895 | [
791099453
] | [
"test"
] | defmodule Fastrepl.GithubTest do
use Fastrepl.DataCase
import Fastrepl.UsersFixtures
import Fastrepl.AccountsFixtures
alias Fastrepl.Github
describe "github" do
test "add_app/2" do
account = user_fixture() |> account_fixture(%{name: "personal"})
{:ok, app} = Github.add_app(%{installation_id... |
06c9caba8e159106196a4300ef1da29d941c8841 | 1,906 | [
103290780
] | [
"test"
] | defmodule Digger.LowerCaserTest do
use ExUnit.Case
test "can lower case first letter of nested map atom keys" do
stringified_map = %{
:FooBar => 2,
:Snake_Case => 3,
%{:Ab_ba => 4, :area51 => 5} => 6,
:C_bbda => 2
}
assert Digger.lowercase_first(stringified_map) ==
... |
06cae1934d6c3eb794b723fabc5ddcbdcf76c33c | 5,268 | [
154049773
] | [] | {:__block__, [],
[
{:=, [],
[
{:tmp_1_2_dynamic, [], Vampyre.HTML.Engine.Compiler.PreparedSegment},
{:case, [generated: true],
[
{:__block__, [],
[
{:=, [],
[
{:msgid, [counter: -576_460_752_303_421_660], Gettext.Compiler},
... |
06cb5943c4e255263567fce596a44f958b9e0587 | 3,118 | [
865310961
] | [
"liveview",
"test"
] | defmodule GdCollabManagerWeb.CollabTools.CollabPartsLiveTest do
use GdCollabManagerWeb.ConnCase
import Phoenix.LiveViewTest
import GdCollabManageCollabTools.PartsFixtures
@create_attrs %{
label: "some label",
status: "some status",
comments: "some comments",
start_time: 42,
end_time: 42,
... |
06cc8d67a3752e0427fe384a76e5ca6440598ffd | 6,134 | [
559744925,
789802355,
872091867,
913995146,
915448704,
934044764,
962529983,
1017248001,
744142491,
828087786,
670103538,
713860590,
734242561,
1002277727,
1017741371,
1019465249,
882758430,
884344453,
939645202,
1010134902,
687446493,
771989527,
773846987,
924963573,
... | [
"typespec",
"documented",
"phoenix"
] | defmodule WebSock do
@external_resource Path.join([__DIR__, "../README.md"])
@moduledoc @external_resource
|> File.read!()
|> String.split("<!-- MDOC -->")
|> Enum.fetch!(1)
@typedoc "The type of an implementing module"
@type impl :: module()
@typedoc "The type of sta... |
06cc9596856ec02b9d76b2e999accc579f968f1c | 1,728 | [
714822976
] | [
"typespec",
"documented"
] | defmodule Seschedule.I18n.Cldr do
@moduledoc """
Define a backend module that will host our
Cldr configuration and public API.
Most function calls in Cldr will be calls
to functions on this module.
"""
use Cldr,
locales: ["pt", "en"],
default_locale: "pt",
providers: [Cldr.Number, Cldr.Calen... |
06cc9c4900fbe9aa55d507992c65b7c9d343429a | 3,153 | [
152801749
] | [
"test"
] | defmodule MemorexPlaylists.YouTubeTest do
use ExUnit.Case
alias MemorexPlaylists.YouTube
setup do
on_exit fn ->
MemorexPlaylists.YouTube.Cache.clear()
end
:ok
end
describe ".fetch with an invalid ID" do
test "returns an error" do
assert {:error, :not_found} == YouTube.fetch("inva... |
06cccb1fc7d99f1246e501e19791021518c419a9 | 2,226 | [
133413125
] | [
"documented"
] | defmodule LinkedInFromAuth do
@moduledoc """
Retrieve the linkedin information from an auth request
"""
require Logger
require Poison
alias Ueberauth.Auth
def find_or_create(%Auth{provider: :identity} = auth) do
case validate_pass(auth.credentials) do
:ok ->
{:ok, basic_info(auth)}
... |
06cd3b07b35d83112769d3084fbd4b7ecdad41f2 | 5,798 | [
405188034
] | [
"typespec"
] | defmodule DynamicLayout.Builder do
# Building layout (recursive with DOM-tree inheritance)
alias DynamicLayout.{Node, Node.Dom, Node.Data}
# box -> %DynamicLayout.Node
defdelegate init_property(src, variant, keypath, opts), to: Dom
defdelegate add_attribute(src, k, v), to: Dom
defdelegate add_attribute(src, ... |
06cd9da498d5835c8ad21a0fb91defb2af1ce41e | 1,864 | [
688641955
] | [] | # 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.
import Config
import BugsChannel.Utils.ConfigBuilder
alias BugsChannel.Repo
config :logger, :consol... |
06cdc582e0090571970b463e1b94116fd65fbd6e | 2,497 | [
263756885
] | [
"documented"
] | defmodule ExOauth2Provider.Authorization do
@moduledoc """
Handler for dealing with generating access grants.
"""
alias ExOauth2Provider.Utils.Error
alias ExOauth2Provider.Authorization.Utils
alias ExOauth2Provider.Authorization.Utils.Response
@doc """
Check ExOauth2Provider.Authorization.Code for usag... |
06cdc96737b921545a183ed02768a37576798584 | 1,736 | [
589275253
] | [
"typespec",
"documented"
] | defmodule Yaflake.ID do
@moduledoc false
import Bitwise
@type t :: non_neg_integer()
# 2022/04/01 21:41
@epoch 1_672_868_454_297
@yaflake_id_size 64
@timestamp_bits 42
@sequence_bits 12
@machine_id_bits @yaflake_id_size - @timestamp_bits - @sequence_bits
@max_seq_number (1 <<< @sequence_bits) - 1... |
06cf3fcd51fcffa99fb00aaa6e42a9cfe173d5b5 | 4,539 | [
427836986
] | [
"typespec",
"documented"
] | defmodule GenReport do
@moduledoc """
Generates a report, grouped by all_hours, hours_per_month and hours_per_year a given employee had worked.
The report will be generated following this model:
%{
"all_hours" => %{
"Amy" => 13_797,
"Jake" => 13_264
},
"hours_per_month" => %... |
06cf5729ae2034524ba7e0187ee9e0a4da8cbff3 | 1,614 | [
861964936
] | [
"documented"
] | defmodule Cards do
@moduledoc """
Provides methods for creating and handling a deck of cards.
"""
@doc """
Creates a deck of cards.
"""
def create_deck do
values = ["Ace", "Two", "Three", "Four", "Five"]
suits = ["Spades", "Clubs", "Hearts", "Diamonds"]
for suit <- suits, value <- values... |
06cf794e8f77fa7fa5be84e27ed9a6824a76e328 | 6,948 | [
764046132
] | [
"liveview",
"phoenix",
"documented"
] | defmodule CalenDazeWeb.BusinessAuth do
use CalenDazeWeb, :verified_routes
import Plug.Conn
import Phoenix.Controller
alias CalenDaze.BusinessAccounts
# Make the remember me cookie valid for 60 days.
# If you want bump or reduce this value, also change
# the token expiry itself in BusinessToken.
@max_... |
06cf965e462e7bccc064b8d935a5e13819896528 | 1,886 | [
190789950,
442465291
] | [
"phoenix",
"ecto"
] | defmodule CritWeb.Setup.ProcedureController do
use CritWeb, :controller
use CritWeb.Controller.Path, :setup_procedure_path
import CritWeb.Plugs.Authorize
alias Crit.Servers.Institution
alias CritBiz.ViewModels.Setup, as: VM
alias Ecto.ChangesetX
IO.puts "Need a new permission"
plug :must_be_able_to, :m... |
06cfa5fbfad65454b6fad9de57e247f37cc14b90 | 2,814 | [
153027520
] | [
"test",
"ecto"
] | defmodule TaskTracker.TaskitemsTest do
use TaskTracker.DataCase
alias TaskTracker.Taskitems
describe "taskitems" do
alias TaskTracker.Taskitems.Taskitem
@valid_attrs %{assignedto: "some assignedto", complete: true, description: "some description", timespent: 42, title: "some title"}
@update_attrs %... |
06cfcce82edbb5e8fc864ed558489d2b1c7280a6 | 1,724 | [
317493744
] | [
"documented"
] | defmodule Advent2021.Day02 do
@moduledoc """
--- Day 2: Dive! ---
https://adventofcode.com/2021/day/2
"""
@doc """
Calculate the horizontal position and depth you would have after following the
planned course, and return their product.
## Example
iex> course = [
...> "forward 5",
... |
06cfd80c24218a44f0a080f9752db3c6845a5ecb | 2,100 | [
1015805152
] | [
"test",
"ecto"
] | defmodule BackendFight.Clients.PaymentProcessors.PaymentParamsTest do
use ExUnit.Case, async: true
import Ecto.Changeset, only: [get_field: 2]
alias BackendFight.Clients.PaymentProcessors.PaymentParams
alias Ecto.UUID
describe "changeset/1" do
test "returns valid changeset with correct params" do
... |
06d01eb9a615dfa24e01cc766d31db2d1d72a8ba | 8,566 | [
919065026
] | [
"typespec",
"documented",
"ecto"
] | defmodule Durandal.Blog do
@moduledoc """
Main point of usage for the blog system
"""
@spec colours :: atom
def colours(), do: :primary
@spec icon :: String.t()
def icon(), do: "fa-blog"
alias Durandal.Blog.{Tag, TagLib}
@spec list_tags() :: [Tag]
defdelegate list_tags(), to: TagLib
@spec lis... |
06d07e70b570af08ca3f20435981537ce71130a5 | 1,626 | [
726105609
] | [] | defmodule Aoc2023.Day02 do
@input_file_path "input/day02.txt"
def part_one(input_file \\ @input_file_path) do
input_file
|> stream_and_trim_input()
|> Stream.map(&parse_line/1)
|> Enum.reduce(0, &count_cubes/2)
end
def part_two(input_file \\ @input_file_path) do
input_file
|> stream_an... |
06d0ad6513ad31aacf68e47e8011f3b9957071bf | 2,242 | [
42731956
] | [
"phoenix"
] | defmodule Hospital.HealthCheckController do
use Hospital.Web, :controller
import Ecto.Query
alias Hospital.HealthCheck
alias Hospital.SessionController
alias Hospital.User
plug Guardian.Plug.EnsureAuthenticated, %{ on_failure: { SessionController, :unauthenticated_api } }
plug :retrieve_health_checks
... |
06d120c670f1ca75ae00532a313371cd855bc717 | 3,172 | [
498720844
] | [
"test",
"phoenix"
] | defmodule Project1Web.TransporterVehicleControllerTest do
use Project1Web.ConnCase
import Project1.TransporterVehiclesFixtures
alias Project1.TransporterVehicles.TransporterVehicle
@create_attrs %{
transporter_id: "some transporter_id",
vehicle_id: 42
}
@update_attrs %{
transporter_id: "some ... |
06d160140003aaf260cebdb1c5fe9363395202c8 | 5,615 | [
874035002
] | [
"macro"
] | #This example is particular useful for any protocol developer using this lib!
#Our goal in this example is to setup packet generation for our protocol.
#We will do this once and will be generating it for every structure we need in few lines later
#It will generate for us required fields (like length, crc and so on) an... |
06d177377837d5b6190436bc795f4aec2ffc92f6 | 3,505 | [
827985656
] | [
"test"
] | defmodule BitGraphTest.Algorithms.SCC do
use ExUnit.Case
alias BitGraph.Algorithms.SCC
alias BitGraph.Common
test "Strongly connected graph" do
graph = strongly_connected_graph_example()
assert SCC.Tarjan.strongly_connected?(graph)
assert SCC.Kozaraju.strongly_connected?(graph)
end
test "DAG ... |
06d1a6c1d7f525744bca1dcb55b819d1cb50d88f | 8,634 | [
108380676
] | [
"typespec",
"documented",
"ecto"
] | defmodule Flambe.Traces do
@moduledoc """
The Traces context.
"""
import Ecto.Query, warn: false
alias Flambe.Repo
alias Flambe.Traces.{Trace, Activity, Thread, Event}
alias Flambe.Accounts.User
@doc """
Returns the list of traces.
## Examples
iex> list_traces()
[%Trace{}, ...]
"... |
06d205b47d9692a34497a6eaccfd6514b1e531b9 | 2,047 | [
958381808
] | [
"documented",
"ecto"
] | defmodule Policia.Articles.Category do
use Ecto.Schema
import Ecto.Changeset
schema "categories" do
field :name, :string
field :slug, :string
# Cambiado de :text a :string
field :description, :string
# Simplemente declara la relación sin importar el módulo Article
has_many :articles, Pol... |
06d276762ae8aea6fee3ae5a6a1a5eaeb74bf247 | 1,691 | [
75993081
] | [
"macro",
"documented",
"ecto",
"phoenix"
] | defmodule TwitterMonitor.Web do
@moduledoc """
A module that keeps using definitions for controllers,
views and so on.
This can be used in your application as:
use TwitterMonitor.Web, :controller
use TwitterMonitor.Web, :view
The definitions below will be executed for every view,
controller, ... |
06d28d89b2fbb601e900c7a2675e012dbdd83b28 | 11,534 | [
77094418
] | [
"test"
] | defmodule Rtmp.Protocol.ChunkIoTest do
use ExUnit.Case, async: true
alias Rtmp.Protocol.RawMessage, as: RawMessage
alias Rtmp.Protocol.ChunkIo, as: ChunkIo
@previous_chunk_0_binary <<0::2, 50::6, 100::size(3)-unit(8), 100::size(3)-unit(8), 3::8, 55::size(4)-unit(8)-little, 152::size(100)-unit(8)>>
@previous_... |
06d2e69e6f4c05348ae91c093279657837de02b5 | 4,807 | [
240615651
] | [
"typespec",
"macro",
"documented"
] | defmodule EctoTemp.Macros do
@doc """
Creates a temporary table that will be rolled back at the end of the
current test transaction. If the table name is given as `:things`, then
the actual temporary table will be created as `things`. As this may
overlap with existing tables, it is recommended to use a `temp`... |
06d3ff027c5fabc855fcb8c3967599220c4caf6d | 1,672 | [
650701811
] | [
"typespec",
"documented",
"ecto"
] | defmodule Data.Schema.HolidayHour do
@moduledoc """
The schema for a location's holiday hours
TODO:
* Change holiday_date field to date, not UTC date time
"""
use Data.Schema
@type t :: %__MODULE__{
id: binary(),
location_id: binary(),
holiday_name: String.t() | nil,
... |
06d417a15a60723bd8aec3f5e6e59c73dbbc6fbe | 3,472 | [
835025316,
822402561
] | [
"genserver",
"liveview"
] | defmodule ChatAppWeb.RoomLive.Show do
use ChatAppWeb, :live_view
alias ChatApp.Rooms
alias ChatApp.Rooms.Message
alias ChatApp.Accounts
#socket keep filetanni indexnonakadake
#"/xounter"mountがさうしょに呼び出される
#mount handle_params, render or templateがレンダリングされてクライアントに渡される、というライフサイクル
@impl true
def mount(_params,... |
06d4523c51f7ed5fc13f58357e6cda5a85ab28c9 | 3,695 | [
486877072
] | [
"documented",
"ecto"
] | defmodule Pento.Support do
@moduledoc """
The Support context.
"""
import Ecto.Query, warn: false
alias Pento.Repo
alias Pento.Support.Faq
@doc """
Returns the list of faqs.
## Examples
iex> list_faqs()
[%Faq{}, ...]
"""
def list_faqs do
Repo.all(Faq)
end
@doc """
Gets... |
06d4981b5a96cc3141a27d5d9f81093c4c9bc548 | 4,735 | [
479018405
] | [
"genserver",
"liveview"
] | defmodule Sn22Web.Ts do
alias Sn22Web.Presence
use Sn22Web, :live_view
@cursorview "cursorview"
def mount(_params, _, socket) do
n = Faker.Pokemon.name
s = M6.get
# cells = M7state.get.cells;
cells = M7.parse;
Sn22Web.Endpoint.subscribe(@cursorview)
Presence.track(self(), @cu... |
06d4cbda1eee6167b185aadae66841a6bf2ad6b2 | 3,032 | [
395410328
] | [
"documented"
] | defmodule Aoc2017.Day14 do
@moduledoc false
@day "14"
@input_file "../inputs/day#{@day}.txt"
@grid_size 128
@knot_size 256
@chunk_size 16
@salt [17, 31, 73, 47, 23]
import Bitwise
def parser(input) do
to_append = String.to_charlist(input <> "-")
0..(@grid_size - 1)
|> Enum.map(&(Enum.... |
06d50fe2a4cb6a886a5b822f6993cd513deecdf8 | 4,076 | [
43247111
] | [
"test"
] | defmodule Credo.Check.Warning.ForbiddenModuleTest do
use Credo.Test.Case
@described_check Credo.Check.Warning.ForbiddenModule
#
# cases NOT raising issues
#
test "it should NOT report with default params" do
"""
defmodule CredoReplicateIssue do
alias __MODULE__.Module
def hello do
... |
06d5e9a2ff83651d1b31aaa8307d9a1206c03b8d | 3,077 | [
782233410
] | [
"genserver",
"typespec",
"documented"
] | defmodule Blitzgg.Riot.LoL.SummonerPoller do
@moduledoc """
This gen server will monitor activity for a given summoner and region
once every minute for one hour.
"""
use GenServer, restart: :transient
alias Blitzgg.Riot.LoL.Summoner
alias FE.Result
require Logger
@type watcher_init_args :: %{
... |
06d6666b9ddb04fb7bef3c89db3979f472b37a6f | 1,718 | [
446136471
] | [
"documented",
"ecto"
] | defmodule ExampleServer.Stock do
@moduledoc """
The Stock context.
"""
import Ecto.Query, warn: false
alias ExampleServer.Repo
alias ExampleServer.Stock.Product.Unit
@doc """
Returns the list of product_units.
## Examples
iex> list_product_units()
[%Unit{}, ...]
"""
def list_prod... |
06d67d3c1c59317776cd1e0158fcc8f870f745b0 | 8,412 | [
923021198
] | [
"liveview"
] | defmodule ValentineWeb.WorkspaceLive.Components.ThreatComponent do
use ValentineWeb, :live_component
use PrimerLive
alias Valentine.Composer
@impl true
def mount(socket) do
{:ok,
socket
|> assign(:summary_state, nil)}
end
@impl true
def render(assigns) do
if assigns.threat == nil do... |
06d68f6d24797b25d428747e7857d2eb178519ea | 1,920 | [
934401774
] | [] | # 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 :glitchtv,
ecto_repos: [Glitchtv.Repo],
ge... |
06d6e16495a5ef96194f2270a6a187470e3149b6 | 2,010 | [
738916616
] | [
"test",
"ecto"
] | defmodule Demoo.AccountsTest do
use Demoo.DataCase
alias Demoo.Accounts
describe "user" do
alias Demoo.Accounts.User
import Demoo.AccountsFixtures
@invalid_attrs %{password_digest: nil, username: nil}
test "list_user/0 returns all user" do
user = user_fixture()
assert Accounts.lis... |
06d703a7707ba97f05a46749d1f1834e4108e676 | 3,746 | [
149295087
] | [
"typespec",
"macro",
"documented"
] | defmodule Helios.Aggregate do
@moduledoc """
Aggregate behaviour.
Once implemented add command mapping to router `Helios.Router`.
"""
alias Helios.Context
@typedoc """
The unique aggregate id.
"""
@type aggregate_id :: String.t()
@type aggregate :: struct()
@type from :: {pid(), tag :: term()... |
06d77cdfeb6c5b34ec8a221bee7aab7d889e4605 | 2,697 | [
193244709,
101434552,
198908023
] | [
"typespec",
"documented"
] | defmodule GoogleApi.Content.V21.Model.Datafeed do
@moduledoc """
Datafeed configuration data.
## Attributes
* `attributeLanguage` (*type:* `String.t`, *default:* `nil`) - The two-letter ISO 639-1 language in which the attributes are defined in the data feed.
* `contentType` (*type:* `String.t`, *default... |
06d7d5b592e27f6524315454d443ff481ce4f94a | 4,632 | [
984438943
] | [] | defmodule People.Infrastructure.Repository.PeopleWriteRepo do
alias People.Domain.PersonAggregate
alias People.Domain.Events.PersonCreated
alias People.Domain.Events.PersonAddressChanged
alias People.Infrastructure.Db.Repo
alias People.Infrastructure.Db.Schema.PersonWriteModel
alias People.Infrastructure.D... |
06d82a37ccb09d23fe282839f28faea165460cfd | 3,224 | [
209428310
] | [
"test",
"phoenix"
] | defmodule MyexpensesPhxV2Web.CreditCardControllerTest do
use MyexpensesPhxV2Web.ConnCase
alias MyexpensesPhxV2.Data
@create_attrs %{name: "some name"}
@update_attrs %{name: "some updated name"}
@invalid_attrs %{name: nil}
def fixture(:credit_card) do
{:ok, credit_card} = Data.create_credit_card(@crea... |
06d8b68b0a92211f798898c57bb61bad0b82010a | 1,758 | [
540101312
] | [
"test",
"ecto"
] | defmodule ApiKeysEx.KeysTest do
use ApiKeysEx.DataCase
alias ApiKeysEx.Keys
describe "keys" do
alias ApiKeysEx.Keys.Key
import ApiKeysEx.KeysFixtures
@invalid_attrs %{counter: nil, value: nil}
test "list_keys/0 returns all keys" do
key = key_fixture()
assert Keys.list_keys() == [k... |
06d8f32f2f447c63ad3bc3ea008517108bebf84a | 3,798 | [
820588120
] | [
"documented"
] | defmodule ExEtlFramework.Validator do
@moduledoc """
Provides functions for validating data structures.
This module offers a flexible way to define validation rules and apply them
to your data. It's particularly useful for ensuring data integrity at various
stages of your ETL pipeline.
## Example
s... |
06d8fe0b741926d414f7079163d251a04fce65dd | 1,562 | [
579125854
] | [
"liveview"
] | defmodule TalismanWeb.CookbookLive do
use TalismanWeb, :live_view
alias Talisman.Cookbooks
on_mount TalismanWeb.UserLiveAuth
def mount(params, _session, socket) do
cookbook_id = Map.get(params, "cookbook_id")
cookbook = Cookbooks.get_cookbook(cookbook_id)
{:ok, assign(socket, cookbook: cookbook)... |
06d95a4028a79d6783497e87f4f45860ff95447f | 1,847 | [
480587768
] | [
"phoenix"
] | defmodule TecsolfacilWeb.Router do
use TecsolfacilWeb, :router
pipeline :api do
plug :accepts, ["json"]
end
pipeline :authentication do
plug Guardian.Plug.Pipeline,
module: Tecsolfacil.Guardian,
error_handler: TecsolfacilWeb.FallbackController
plug Guardian.Plug.VerifyHeader, claims: ... |
06d964f442450863465e6d3380e0e74bf2276d51 | 4,344 | [
890838838
] | [
"documented",
"ecto"
] | defmodule Todoplace.Intents do
@moduledoc "context module for tracking client payment intents."
import Ecto.Query, only: [from: 2]
alias Todoplace.Repo
defmodule Intent do
@moduledoc "represents a stripe payment intent. one per order."
use Ecto.Schema
import Ecto.Changeset
alias Todoplace.Cart.... |
06d96f0f9976bafbfa0b24392488e9c872625c15 | 4,840 | [
623198023
] | [] | defmodule Serialize do
import Integer, only: [mod: 2]
@base58_alphabet Enum.zip(
(0..58),
String.graphemes("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz" )
) |> Map.new
#############################################################################
# SEC -... |
06d99a3b5b65443a94366687724655b613cbad78 | 4,103 | [
314127513
] | [
"liveview",
"test"
] | defmodule MomogogoWeb.PreferencesLiveTest do
use MomogogoWeb.ConnCase
import Phoenix.LiveViewTest
alias Momogogo.Timeline
@create_attrs %{step_scale: "some step_scale", user_id: 42}
@update_attrs %{step_scale: "some updated step_scale", user_id: 43}
@invalid_attrs %{step_scale: nil, user_id: nil}
defp... |
06da5fd870d2bf09947d567f78277f3959f7d9f8 | 2,048 | [
666173803
] | [
"documented"
] | defmodule Ship.Systems.ClientEventHandler do
@moduledoc """
Documentation for ClientEventHandler system.
"""
@behaviour ECSx.System
alias Ship.Components.ArmorRating
alias Ship.Components.AttackDamage
alias Ship.Components.AttackRange
alias Ship.Components.AttackSpeed
alias Ship.Components.HullPoints... |
06da698e3f42669a5917360b39ddcd6f3affea4a | 1,576 | [
430795513
] | [
"liveview",
"ecto"
] | defmodule TriviumWeb.InternetImageLive.New do
use TriviumWeb, :live_view
alias Trivium.Accounts
alias Trivium.Multimedia
alias Trivium.Multimedia.InternetImage
@impl true
def mount(params, session, socket) do
concept_id = params["concept_id"]
content_id = params["content_id"]
if user = sessio... |
06daa7909c7874474ae6bba0f04cdbb0ea91ca2d | 2,948 | [
171283872
] | [
"test",
"phoenix"
] | defmodule GitesWeb.AvailabilityControllerTest do
use GitesWeb.ConnCase
alias Gites.BookingSystem
alias Gites.BookingSystem.Availability
@create_attrs %{
availability: "some availability",
date: 42
}
@update_attrs %{
availability: "some updated availability",
date: 43
}
@invalid_attrs %... |
06dad8212676bd06b099aa6684a255b492eab28a | 2,805 | [
131112555
] | [
"documented"
] | use Croma
defmodule AntikytheraAws.Auth do
@moduledoc """
Provides a method to get AWS Access Key (access key ID, secret access key, and security token).
"""
alias AntikytheraAws.Imds
defmodule SourceType do
use Croma.SubtypeOfAtom, values: [:instance], default: :instance
end
defmodule Credentials... |
06db2f1ea052f40fa8c6be2bae9551266efb5cd4 | 14,636 | [
931361946
] | [
"genserver",
"documented"
] | defmodule Commands.Music do
@moduledoc """
ignore this mf for now i wanna delete this module but i am not confident enough if i can even rewrite this piece of shit ong
"""
use GenServer
alias Nostrum.Api
require Logger
@default_volume 100
@forward_seconds 10
@backward_seconds 10
def start_link(_o... |
06db2fe420851db19c41b54de54aeddd81418d3c | 4,092 | [
281977300
] | [] | defmodule HologramFeatureTests.GuardsPage do
use Hologram.Page
import Hologram.Commons.KernelUtils, only: [inspect: 1]
import Hologram.Commons.TestUtils, only: [wrap_term: 1]
import Kernel, except: [inspect: 1]
@dialyzer :no_match
route "/guards"
layout HologramFeatureTests.Components.DefaultLayout
... |
06dc1c33fec85ce0d07670588cb02f3915aa5027 | 2,893 | [
383340007
] | [
"typespec",
"documented"
] | defmodule GoogleApi.Compute.V1.Model.Region do
@moduledoc """
Represents a Region resource.
A region is a geographical area where a resource is located. For more information, read Regions and Zones. (== resource_for {$api_version}.regions ==)
## Attributes
* `creationTimestamp` (*type:* `String.t`, *defa... |
06dc2623e96f21cb86ae359e08606e38177b7d9c | 1,817 | [
193244709,
101434552,
198908023
] | [
"typespec",
"documented"
] | defmodule GoogleApi.AnalyticsData.V1beta.Model.DimensionExpression do
@moduledoc """
Used to express a dimension which is the result of a formula of multiple dimensions. Example usages: 1) lower_case(dimension) 2) concatenate(dimension1, symbol, dimension2).
## Attributes
* `concatenate` (*type:* `GoogleApi... |
06dc50c98055d193d8d05fe24a3fd1c2ee1d8421 | 1,539 | [
68793324
] | [
"test"
] | defmodule ExSieve.HTMLTest do
use ExSieve.HTML.ConnCase
import Phoenix.HTML.Form, only: [text_input: 2]
describe "ExSieve.HTML.search_form/3" do
test "return form for search", %{conn: conn} do
form = ~s(<form accept-charset="UTF-8" action="/" method="get"><input name="_utf8" type="hidden" value="✓"><in... |
06dc6a56d2593571b229e9728a3d1c635a37d407 | 5,396 | [
123773364
] | [
"documented"
] | defmodule StringGa do
@moduledoc """
Documentation for StringGa.
"""
import Randomizer
@doc """
Hello world.
"""
defmodule Settings do
defstruct mutation: 5, crossover: 50, population_size: 30, new_random_gene: 10, target: nil
end
defmodule Genome do
defstruct genes: [], fitness: nil
e... |
06dc860dfa1690094f51714092c6150144e50e9b | 3,460 | [
153704625
] | [
"phoenix",
"ecto"
] | defmodule TasktrackerWeb.TaskController do
use TasktrackerWeb, :controller
alias Tasktracker.Tasks
alias Tasktracker.Tasks.Task
def index(conn, _params) do
tasks = Tasks.list_tasks()
render(conn, "index.html", tasks: tasks)
end
def new(conn, _params) do
changeset = Tasks.change_task(%Task{})
... |
06dd1589df04c03b8da52d3e67ab1d71780bf7c4 | 1,964 | [
193244709,
101434552,
198908023
] | [
"typespec",
"documented"
] | defmodule GoogleApi.Vision.V1.Model.GoogleCloudVisionV1p4beta1Page do
@moduledoc """
Detected page from OCR.
## Attributes
* `blocks` (*type:* `list(GoogleApi.Vision.V1.Model.GoogleCloudVisionV1p4beta1Block.t)`, *default:* `nil`) - List of blocks of text, images etc on this page.
* `confidence` (*type:*... |
06dd9c52069e690548ad34f512ef15ad578d4e8e | 12,182 | [
259686325
] | [] | %{
"argon2_elixir": {:hex, :argon2_elixir, "2.3.0", "e251bdafd69308e8c1263e111600e6d68bd44f23d2cccbe43fcb1a417a76bc8e", [:make, :mix], [{:comeonin, "~> 5.3", [hex: :comeonin, repo: "hexpm", optional: false]}, {:elixir_make, "~> 0.6", [hex: :elixir_make, repo: "hexpm", optional: false]}], "hexpm", "28ccb63bff213aecec1... |
06de9e82415e668d4e941dbff644c171baf44bad | 7,729 | [
535490053
] | [
"test"
] | defmodule CimWeb.StoreControllerTest do
require Logger
use ExUnit.Case, async: true
use Plug.Test
alias CimWeb.Router
alias Cim.StoreServer
@opts Router.init([])
setup :db_with_one_entry
describe "PUT /{database}/{key}" do
test "inserts a value under a new key in an existing database", ctx do
... |
06df4c8c5128886a1162ecfc4abe64bd0baa4d1e | 1,516 | [
637939342
] | [
"documented",
"ecto"
] | defmodule Discussit.Users.UserNotifier do
import Swoosh.Email
alias Discussit.Mailer
# Delivers the email using the application mailer.
defp deliver(recipient, subject, template, assigns) do
email =
new()
|> to(recipient)
|> from({"Discussit", "<EMAIL>"})
|> subject(subject)
|... |
06e0169af3b8ededb01b98df83f68b920d606feb | 7,611 | [
469378882
] | [] | defmodule Decode do
use Bitwise
@packet1 "D2FE28"
@packet2 "38006F45291200"
@packet3 "EE00D40C823060"
@packet4 "8A004A801A8002F478"
@packet5 "620080001611562C8802118E34"
@packet6 "C0015000016115A2E0802F182340"
@packet7 "A0016C880162017C3686B18A3D4780"
@input "A20D74AFC6C80CEA7002D4009202C7C00A683002... |
06e06f3dc93a117f015da63b61d1e293e2b1afac | 4,332 | [
364104642
] | [
"test",
"phoenix"
] | defmodule BloodbathWeb.EventControllerTest do
use BloodbathWeb.ConnCase
alias Bloodbath.Factory.{
PersonFactory,
EventFactory
}
alias Bloodbath.CustomerEventsManagement.{
Event
}
setup %{conn: conn} do
myself = PersonFactory.insert(:person, is_owner: true)
authorized_conn = conn
... |
06e08e8e17d85ed0b6e9f8be4ed070ea2ceb9cb9 | 2,176 | [
995944955
] | [] | # 创建测试用的Excel文件
alias ShopUxPhoenixWeb.ExcelHelper
# 确保目录存在
File.mkdir_p!("test/fixtures/bulk_import")
# 创建valid_users.xlsx
headers = ["姓名", "邮箱", "电话", "部门"]
data = [
["张三", "<EMAIL>", "13800138000", "技术部"],
["李四", "<EMAIL>", "13900139000", "销售部"],
["王五", "<EMAIL>", "13700137000", "市场部"]
]
ExcelHelper.create_... |
06e1517f932f3ca74f339ae1b22f85672c4ae10d | 1,598 | [
187256293
] | [
"genserver"
] | defmodule Petfinder.Auth do
use GenServer
alias Petfinder.Helpers
defstruct(
token_type: nil,
expires_in: nil,
access_token: nil
)
### API functions ###
def start_link(_opts) do
GenServer.start_link(__MODULE__, :ok, name: __MODULE__)
end
def get_token(server) do
GenServer.call(s... |
06e15eabab82ce1d3350d039a7c2339b16fb250c | 2,039 | [
605242810
] | [
"test"
] | defmodule Lexical.Protocol.Convertibles.TextEditTest do
use Lexical.Test.Protocol.ConvertibleSupport
describe "to_lsp/2)" do
setup [:with_an_open_file]
test "leaves text edits alone", %{uri: uri} do
native_text_edit = Types.TextEdit.new(new_text: "hi", range: valid_range(:lsp))
assert {:ok, ^n... |
06e2051245e78be74c51c09cc58edd68dece0e3f | 3,274 | [
837319868,
360168098,
733038279,
651155880,
689993351,
806822991
] | [
"documented"
] | defmodule MyXQL.Protocol.Flags do
@moduledoc false
import Bitwise
# https://dev.mysql.com/doc/internals/en/capability-flags.html
@capability_flags [
client_long_password: 0x00000001,
client_found_rows: 0x00000002,
client_long_flag: 0x00000004,
client_connect_with_db: 0x00000008,
client_no_... |
06e278671fad0ca887f4de39d49a6c6c2addd624 | 2,137 | [
977515586
] | [] | defmodule TaskManagerApi.Controllers.TagController do
use Plug.Router
alias TaskManagerApi.Repo
alias TaskManagerApi.Models.Tag
alias TaskManagerApi.Response.Wrapper
import Ecto.Query
plug :action
def index(conn, _params) do
tags = Repo.all(Tag)
Wrapper.send_response(conn, 200, tags)
end
de... |
06e283aa2c951dceece60949ee0217374b68fac9 | 2,111 | [
1001985371
] | [
"test"
] | defmodule MediaCodecs.MPEGG4.ADTSTest do
use ExUnit.Case, async: true
alias MediaCodecs.MPEG4.ADTS
describe "ADTS serialize/1" do
test "serialize one frame" do
adts = %ADTS{
audio_object_type: 2,
channels: 2,
sampling_frequency: 44100,
frames: <<1, 2, 3, 4, 5>>
}
... |
06e2b2aba745f11437cab2574b22c64fe3798429 | 4,200 | [
619186364
] | [
"genserver",
"liveview"
] | defmodule WhisperWeb.PageLive do
use WhisperWeb, :live_view
@impl true
def mount(_, _, socket) do
socket =
socket
|> assign(audio: nil, recording: false, task: nil)
|> allow_upload(:audio, accept: :any, progress: &handle_progress/3, auto_upload: true)
|> stream(:segments, [], dom_id: ... |
06e2b46aa0ea703d1f7aac7e4bbca21d2e329050 | 2,744 | [
71876809
] | [
"phoenix",
"ecto"
] | defmodule Extoon.EntryController do
use Extoon.Web, :controller
alias Extoon.{Repo, Entry, Category}
import Ecto.Query, only: [from: 1, from: 2]
plug Extoon.Ctrl.Plug.AssignPath
plug Extoon.Ctrl.Plug.AssignEntry
plug Extoon.Ctrl.Plug.AssignCategory
plug Extoon.Ctrl.Plug.AssignRanking
plug Extoon.Ctrl... |
06e3a2eea32b06fc205cd559bf7ba939ff5e2be0 | 3,552 | [
189766620
] | [
"genserver",
"liveview"
] | defmodule LiveQchatexWeb.LiveChat.Home do
use LiveQchatexWeb, :live_view
@view_name "home"
def mount(%{sid: sid}, socket) do
setup_logger(socket, @view_name)
try do
socket = socket |> fetch_user(sid)
if connected?(socket), do: Chats.track(socket.assigns.user)
{:ok, socket |> fetch()}
... |
06e3c0414eaa68398da63636f2fedb8fdcb4c5d8 | 2,561 | [
803052140
] | [
"genserver",
"test"
] | defmodule FuelCalculatorV2Test do
use ExUnit.Case
doctest FuelCalculatorV2
setup do
{:ok, pid} = GenServer.start_link(FuelCalculatorV2, {})
{:ok, pid: pid}
end
test "Test fuel calculation", context do
tests = [
{51898,
{28801, [{:launch, "earth"}, {:land, "moon"}, {:launch, "moon"},... |
06e58d82b29d2aee3d25d311c6561879b3bbb292 | 2,063 | [
739170447
] | [
"test",
"phoenix"
] | defmodule AmboseliWeb.UserSessionControllerTest do
use AmboseliWeb.ConnCase, async: true
import Amboseli.UsersFixtures
alias Amboseli.Repo
setup do
%{user: user_fixture()}
end
defp create_login_token(user) do
{email_token, token} = Amboseli.Users.UserToken.build_email_token(user, "magic_link")
... |
06e5e3a6a973b56dab53f94e6e70a7c8569be771 | 1,674 | [
476903851
] | [] | # 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 :jolt,
ecto_repos: [Jolt.Repo]
# Configures... |
06e5fef88e007ab3782ffc9e28f1cd3e06164715 | 3,620 | [
244072528
] | [
"test"
] | defmodule BargeTest.Figure2.State.FollowersTest do
use ExUnit.Case, async: true
alias BargeTest.ListLog
alias Barge.RPC.AppendEntries
alias Barge.RPC.RequestVote
describe "respond to RPCs" do
test "from candidates" do
# set up a barge log.
{:ok, log} = ListLog.start_link([])
# start a... |
06e6d3a448e39ffc2f1c0b69b1784ece1664b287 | 5,726 | [
367278931
] | [
"documented"
] | defmodule Google.Cloud.Aiplatform.V1.BatchPredictionJob.InputConfig do
@moduledoc false
use Protobuf, protoc_gen_elixir_version: "0.14.1", syntax: :proto3
oneof :source, 0
field :gcs_source, 2,
type: Google.Cloud.Aiplatform.V1.GcsSource,
json_name: "gcsSource",
oneof: 0
field :bigquery_source,... |
06e715e802d258650351688dd484ff238bd55911 | 1,832 | [
38581754,
73883048
] | [
"genserver"
] | defmodule ChatLog do
use GenServer
def start_link(opts \\ []) do
{:ok, _pid} = GenServer.start_link(ChatLog, [
{:ets_table_name, :chat_log_table},
{:log_limit, 100}
], opts)
end
def get_logs(room) do
GenServer.call(:chat_log, {room})
end
def stop(server) do
GenServer.call(serv... |
06e733b18b086e6659d1f22ae87ea7c02b2822b3 | 2,944 | [
232156355
] | [] | # defmodule IMU do
# @port 0x69
# @ub0_who_am_i 0x00
# # Common to all user banks
# @reg_bank_sel 0x7F
# @reg_bank_sel_user_bank_0 0x00
# @reg_bank_sel_user_bank_1 0x10
# @reg_bank_sel_user_bank_2 0x20
# @reg_bank_sel_user_bank_3 0x30
# @ub0_pwr_mgmnt_1 0x06
# @ub0_pwr_mgmnt_1_clock_sel_auto 0x0... |
06e734e9be1a3984122d87554b7555fa60f0a64e | 4,470 | [
503156516
] | [] | %{
"aten": {:hex, :aten, "0.5.8", "b5c97f48517c4f37f26a519aa57a00a31ff1b8ea4324ec1cae27f818ed5c0db2", [:rebar3], [], "hexpm", "64d40a8cf0ddfea4e13af00b7327f0925147f83612d0627d9506cbffe90c13ef"},
"cowboy": {:hex, :cowboy, "2.9.0", "865dd8b6607e14cf03282e10e934023a1bd8be6f6bacf921a7e2a96d800cd452", [:make, :rebar3], ... |
06e749205588b56d4467b4c45b7407f733075dbc | 2,361 | [
160067742
] | [
"typespec"
] | defmodule AnsiHelper do
alias IO.ANSI
@spec color?(maybe_color :: any) :: boolean
def color?(maybe_color) do
maybe_color in colors()
end
@spec reverse(s :: binary, nil | any) :: s :: binary
def reverse(string, nil), do: string
def reverse(string, _) do
do_ansi(:reverse) <> string
end
@spec... |
06e74da8e3e5cb1ef06de8b8524d758491dad9ac | 3,182 | [
262421041
] | [
"typespec"
] | defmodule Mogs.Board.Command.Result do
use TODO
@todo "Convert to a tuple if we do not need to stop a board from a command"
defstruct ok?: true,
stop: false,
# no defaults:
reply: nil,
board: nil,
reason: nil
@type t :: %__MODULE__{
ok?: bo... |
06e7c1208bc6599444bed9fc59fce12f1451f7e4 | 2,841 | [
257743317
] | [
"typespec",
"macro",
"documented"
] | defmodule Patch.Mock.History.Tagged do
alias Patch.Mock.History
@type tag :: boolean()
@type entry :: {tag(), History.entry()}
@type t :: [entry()]
@doc """
Determine if any of the entries have been tagged in the affirmative
"""
@spec any?(tagged :: t()) :: boolean()
def any?(tagged) do
Enum.any... |
06e7ebc84759b4c3a3ff0074849215f2cf039c71 | 2,305 | [
669595979
] | [] | # 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 :elixir_otel,
ecto_repos: [ElixirOtel.Repo]
... |
06e920ea504b8505e0478844a5dd911e570fe369 | 1,614 | [
987487831
] | [
"liveview"
] | defmodule PhxAstroNftWeb.HomeLive.Home do
use PhxAstroNftWeb, :live_view
def render(assigns) do
~H"""
<.live_component module={PhxAstroNftWeb.Components.Header.Header} id={:header_section}>
</.live_component>
<!-- ==== Hero Section Start ==== -->
<.live_component module={PhxAstroNftWeb.Compo... |
06e99d0e1716343bb5610aaf8c2dc5b9dd849789 | 2,382 | [
486833998,
486734268
] | [
"test",
"ecto"
] | defmodule JsonApi.EmployeesTest do
use JsonApi.DataCase
alias JsonApi.Employees
describe "employees" do
alias JsonApi.Employees.Employee
import JsonApi.EmployeesFixtures
@invalid_attrs %{employee_number: nil, first_name: nil, last_name: nil}
test "list_employees/0 returns all employees" do
... |
06e9a6e6a61519ee0c4d6925d2944c90bc52c100 | 2,338 | [
995954919
] | [
"documented",
"ecto"
] | defmodule MyBlog.Posts do
@moduledoc """
The Posts context.
"""
import Ecto.Query, warn: false
alias MyBlog.Repo
alias MyBlog.Posts.Post
@doc """
Returns the list of posts.
## Examples
iex> list_posts()
[%Post{}, ...]
"""
def list_posts do
Repo.all(Post, order_by: [desc: :ins... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.