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 |
|---|---|---|---|---|
00fda71ecb35a30c5a05e85e8d0de38e92dc9db5 | 2,527 | [
45798215
] | [] | use Mix.Config
# For production, we configure the host to read the PORT
# from the system environment. Therefore, you will need
# to set PORT=80 before running your server.
#
# You should also configure the url host to something
# meaningful, we use this information when generating URLs.
#
# Finally, we also include t... |
00fded1e926d8bce375c332e0e1161efbb262a34 | 1,705 | [
488232232,
887743893
] | [
"test"
] | defmodule Bumblebee.Vision.ClipVisionTest do
use ExUnit.Case, async: true
import Bumblebee.TestHelpers
@moduletag model_test_tags()
test ":base" do
assert {:ok, %{model: model, params: params, spec: spec}} =
Bumblebee.load_model({:hf, "bumblebee-testing/tiny-random-CLIPModel"},
... |
00fdf23722d3345c7d69a27af39de238f05dced4 | 3,627 | [
135832997
] | [
"liveview"
] | defmodule Data.Article.Blog.Stresemannallee do
use Article.Default
def name(), do: "#{created_at()}-3-stresemannallee"
def created_at(), do: ~D[2018-10-13]
def title(), do: "Stresemannallee (Radroute 3)"
def start(), do: ~d[2019-08-05]
def stop(), do: ~d[2020-12-20]
def type(), do: :finished
def ta... |
00feed7b685212118d83e30d6720833099dd1385 | 15,783 | [
838907457,
763575502
] | [] | defmodule Electric.Postgres.SQLGenerator.Table do
use Electric.Postgres.SQLGenerator
alias Electric.Postgres.Schema
import Electric.Postgres.SQLGenerator.Column
defstruct [:name, columns: [], constraints: [], indexes: []]
def map_table(%Proto.Table{} = table) do
%__MODULE__{
name: map_table_name... |
0100a8e22a0d0a3c842186612c567050cdff2450 | 3,040 | [
1015822392
] | [
"documented"
] | defmodule Spellbook.Stacks do
@moduledoc """
The module for working the the Stacks in spell.
The stacks are repositories of spell defintions.
"""
@stacks Spellbook.Environment.the_stacks()
@default_spellbook_repo Spellbook.Environment.default_spellbook_repo()
@default_spellbook Spellbook.Environment.defa... |
0100bb3584330f3992d8f2c214316a01e3444eb3 | 2,123 | [
717414746
] | [
"documented",
"ecto"
] | defmodule FeedbackForm.Records do
@moduledoc """
The Records context.
"""
import Ecto.Query, warn: false
alias FeedbackForm.Repo
alias FeedbackForm.Records.UserFeedback
@doc """
Returns the list of user_feedbacks.
## Examples
iex> list_user_feedbacks()
[%UserFeedback{}, ...]
"""
... |
01016e8b4b37bb9090b8c4df68894b1dce330c5b | 16,129 | [
996920193
] | [
"test"
] | defmodule MABEAM.EconomicsTest do
use ExUnit.Case, async: true
alias MABEAM.Economics
setup do
case Economics.start_link(test_mode: true) do
{:ok, pid} -> %{economics_pid: pid}
{:error, {:already_started, pid}} -> %{economics_pid: pid}
end
end
describe "auction management" do
test "... |
0101e5e5e34343e5a51c6e87e41a230a74dd5553 | 3,673 | [
163317529
] | [
"phoenix"
] | defmodule ElixirSecurityAdvisoryApiV1.PackageController do
use ElixirSecurityAdvisoryApiV1, :controller
plug :default_pagination, %{"first" => 10} when action in [:index]
use Absinthe.Phoenix.Controller, schema: ElixirSecurityAdvisoryApiV1.Schema
swagger_path :index do
summary("List packages")
produc... |
01022f4c17b4d9f4288245dda58b907fabeac7d1 | 1,867 | [
10641158
] | [
"macro",
"documented"
] | defmodule Ecto.Model do
@moduledoc """
Used to define a model. See `Ecto.Model.Queryable`, that is imported when
`Ecto.Model` is used, for how to define a queryable model.
"""
defmacro __using__(_opts) do
quote do
import Ecto.Model.Queryable
end
end
end
defmodule Ecto.Model.Queryable do
@m... |
0102477c5be30f887f30038e08cac081125b4487 | 1,816 | [
241018361
] | [
"genserver",
"liveview",
"documented",
"phoenix"
] | defmodule DinoWeb.Live.Example do
@moduledoc """
Example for live view demo
Remove me it is just an example
https://github.com/chrismccord/phoenix_live_view_example/blob/4a38c77a1f8b4ccc3b4b75aa581b28d51d70530c/lib/demo_web/live/top_live.ex
"""
# instead of use, `use Phoenix.LiveView` this template provide... |
0103262e66c66c1cdd66d9843c58946e3c1cb83b | 1,620 | [
103085099
] | [
"documented"
] | defmodule ExSlack.WebApi.Users do
use ExSlack.WebApi.Common
@method_info "users.info"
@method_list "users.list"
@doc """
Gets information about a user.
Receives the slack `token` and the slack `user id`.
Slack documentation here: https://api.slack.com/methods/users.info
## Optionals
List of opti... |
01041196e955b6ce79765840fd97246e4af328f9 | 3,255 | [
141498313
] | [] | %{
"certifi": {:hex, :certifi, "1.2.1", "c3904f192bd5284e5b13f20db3ceac9626e14eeacfbb492e19583cf0e37b22be", [:rebar3], [], "hexpm"},
"cowboy": {:hex, :cowboy, "1.0.4", "a324a8df9f2316c833a470d918aaf73ae894278b8aa6226ce7a9bf699388f878", [:make, :rebar], [{:cowlib, "~> 1.0.0", [hex: :cowlib, repo: "hexpm", optional: ... |
0104119f048269889fbc8e9d93455a0642a25660 | 3,210 | [
550012069
] | [
"liveview",
"ecto"
] | defmodule PentoWeb.ProductLive.FormComponent do
use PentoWeb, :live_component
alias Pento.Catalog
@impl true
def update(%{product: product} = assigns, socket) do
changeset = Catalog.change_product(product)
{:ok,
socket
|> assign(assigns)
|> assign(:changeset, changeset)
|> allow_u... |
01048d3e05a2089b96d1be39f3769279ab3ff942 | 13,340 | [
146924140
] | [
"ecto"
] | defmodule Reuse.Analyzer do
import Ecto.Query, warn: false
alias Reuse.Repo
alias Reuse.Repository
alias Reuse.File
alias Reuse.Todo
def get_results(study) do
number_of_repositories =
from(t in Todo, where: t.study == ^study)
|> Repo.all()
|> Enum.count()
number_of_machines =
... |
0104cff30cbf613800744a317e605d571c7660c3 | 4,052 | [
653376466
] | [
"test",
"phoenix"
] | defmodule SimpleSubscriptionManagerWeb.AccountResetPasswordControllerTest do
use SimpleSubscriptionManagerWeb.ConnCase, async: true
alias SimpleSubscriptionManager.Accounts
alias SimpleSubscriptionManager.Repo
import SimpleSubscriptionManager.AccountsFixtures
setup do
%{account: account_fixture()}
end... |
01050e4e9b7467a52040da93bac0ab0e70554b2b | 1,668 | [
392314162
] | [] | defmodule Main do
def lines() do
File.read!( "./input.txt" )
#File.read!( "./input.test.txt" )
|> String.trim() # Removes the last line
|> String.split( "\n" ) # List of lines
|> Enum.map( &String.to_integer/1 )
end
def makeup( vals, val ) do
case vals do
[ first | others ] ->... |
01055da42fb0b72959477e6964d7f22b275a6a38 | 2,110 | [
138403305
] | [] | defmodule SimpleSoap.Wsdl.Schema.Element do
import SweetXml
alias SimpleSoap.Xml
alias SimpleSoap.Wsdl
alias SimpleSoap.Wsdl.Schema
alias SimpleSoap.Wsdl.Schema.Type
require Logger
def nodes(%Wsdl{doc: doc, xml_schema: xml_schema}) do
xpath(
doc,
~x"/wsdl:definitions/wsdl:types/xsd:schem... |
010592bf0c6f52de8ecb54267ea947ed16e8447e | 7,861 | [
104223581
] | [] | defmodule IcdCode.ICDCode.Codes_F17 do
alias IcdCode.ICDCode
def _F17200 do
%ICDCode{full_code: "F17200",
category_code: "F17",
short_code: "200",
full_name: "Nicotine dependence, unspecified, uncomplicated",
short_name: "Nicotine dependence, unspecified, uncomplicated",
... |
0106102683bd9b5006038e8cae93885e8f28db3c | 2,245 | [
760152031
] | [
"macro"
] | defmodule Meta.Translator do
defmacro __using__(_args) do
quote do
Module.register_attribute(__MODULE__, :locales, accumulate: true)
import unquote(__MODULE__), only: [locale: 2]
@before_compile unquote(__MODULE__)
end
end
defmacro locale(locale, mappings) do
quote do
@locales... |
01065abd0ac262c363b77155113285a4217e9a9e | 4,705 | [
542438843
] | [
"test"
] | defmodule ListOpsTest do
alias ListOps, as: L
use ExUnit.Case
defp odd?(n), do: rem(n, 2) == 1
describe "count" do
# # @tag :pending
test "empty list" do
assert L.count([]) == 0
end
# @tag :pending
test "normal list" do
assert L.count([1, 2, 3, 4]) == 4
end
# @tag :p... |
0106851024dea3cdcc8e338a29e65d53a7d1c101 | 6,397 | [
113465061
] | [
"test"
] | defmodule ChattrWeb.Chat.TopicControllerTest do
use ChattrWeb.ConnCase
alias Chattr.Accounts
alias Chattr.Chat
@create_attrs %{description: "some description", title: "some title"}
@update_attrs %{description: "updated description", title: "updated title"}
@invalid_attrs %{description: nil, title: nil}
... |
010694b83c8af062fae8bb8165faeafc0cc61abb | 4,089 | [
650716379
] | [] | defmodule Dian.WebPush do
use Tesla
defp config, do: Application.fetch_env!(:dian, __MODULE__)
def vapid_public_key, do: config() |> Keyword.fetch!(:vapid_public_key)
def vapid_private_key, do: config() |> Keyword.fetch!(:vapid_private_key)
def vapid_subject, do: config() |> Keyword.fetch!(:vapid_subject)
... |
0106a3fefded47895a1cfef3b9d19303e578896f | 9,471 | [
191061985
] | [
"typespec",
"liveview",
"documented"
] | defmodule Mine.Game.Worker do
@moduledoc """
Defines the interaction between the game and the player. It's intended
that this module let us play as a stand-alone user.
"""
use GenStateMachine, callback_mode: :handle_event_function, restart: :transient
require Logger
alias Mine.Game
alias Mine.Game.Boar... |
0106ad3a78e510e73795cd0da08a4b6fbb19ff46 | 6,050 | [
363419449
] | [
"typespec",
"documented"
] | defmodule OMG.Watcher.ExitProcessor.ExitInfo do
@moduledoc """
Represents the bulk of information about a tracked exit.
Internal stuff of `OMG.Watcher.ExitProcessor`
"""
alias OMG.Crypto
alias OMG.State.Transaction
alias OMG.Utxo
alias OMG.Watcher.Event
require Utxo
@enforce_keys [
:amount,
... |
0106dc23527848f4ff4209778e41b2666f244053 | 4,623 | [
459261107
] | [] | %{
"certifi": {:hex, :certifi, "2.9.0", "6f2a475689dd47f19fb74334859d460a2dc4e3252a3324bd2111b8f0429e7e21", [:rebar3], [], "hexpm", "266da46bdb06d6c6d35fde799bcb28d36d985d424ad7c08b5bb48f5b5cdd4641"},
"earmark_parser": {:hex, :earmark_parser, "1.4.19", "de0d033d5ff9fc396a24eadc2fcf2afa3d120841eb3f1004d138cbf9273210... |
010711108098acd330129fa53ed7562beb8670c3 | 4,421 | [
337696198
] | [
"phoenix",
"documented"
] | defmodule SystemsRegisterWeb.UserAuth do
import Plug.Conn
import Phoenix.Controller
alias SystemsRegister.Accounts
alias SystemsRegisterWeb.Router.Helpers, as: Routes
# Make the remember me cookie valid for 60 days.
# If you want bump or reduce this value, also change
# the token expiry itself in UserTo... |
0107a2a1b9551ee29964d1c351dbc6aa168e2f95 | 6,610 | [
52262460
] | [] | defmodule Mmtp do
@api_key System.get_env("google_api_key")
def main do
{:ok, p} = Mariaex.Connection.start_link(username: "sushruth456", password: "sushruth456", database: "mmtp")
{:ok,result} = Mariaex.Connection.query(p, "SELECT * FROM StationInfo WHERE address IS NULL OR address LIKE \"%error%\"")
... |
0107c90919dc0a49464918c3a50d5861edb53127 | 2,420 | [
600990834
] | [
"liveview"
] | defmodule HabitsheetWeb.Live.HabitList do
use HabitsheetWeb, :live_view
alias Habitsheet.Habits
@impl true
def mount(_params, _session, socket) do
{:ok,
socket
|> assign_habits()}
end
@impl true
def handle_event("archive", %{"id" => habit_id}, socket) do
habit = get_habit_from_socket(... |
0108398b2831caa2518aa554123e4c9303888390 | 3,455 | [
64634277
] | [
"documented"
] | defmodule Pollution.Generator.String do
@moduledoc false
alias Pollution.{State, Util}
alias Pollution.Generator, as: G
alias Pollution.Shrinker.Params, as: SP
@defaults %State{
type: __MODULE__,
must_have: [ "", " " ],
min: 0, # string length
max: 300,
extra: %{
... |
0108398decfac39541834c744bce162159405ea0 | 2,106 | [
181014990
] | [
"documented"
] | defmodule JsonapiPaginator do
@moduledoc """
Simple pagination links renderer for the JSON API
"""
@doc """
Render links based on the data, given in params map
```
%{
base_url: base_url,
page_number: page_number,
page_size: page_size,
total_pages: total_page... |
01097d52a113ede490a3a5f661dd16c88061d3db | 2,373 | [
418871405
] | [
"liveview",
"ecto"
] | defmodule FrontendWeb.UserRegistrationLive do
use FrontendWeb, :live_view
alias Frontend.Accounts
alias Frontend.Accounts.User
def render(assigns) do
~H"""
<div class="mx-auto max-w-sm">
<.header class="text-center">
Register for an account
<:subtitle>
Already registere... |
01098ec0eba883fe13c6bc68b9d85adab0ec5351 | 2,584 | [
784953040
] | [
"test",
"ecto"
] | defmodule PapaSys.ClientTest do
use PapaSys.DataCase
alias PapaSys.Client
describe "users" do
alias PapaSys.Client.User
import PapaSys.ClientFixtures
@invalid_attrs %{
role: nil,
first_name: nil,
last_name: nil,
email_address: nil,
account_minutes: nil
}
test... |
0109cdfee4c1a6c574ec1272bb60d325be894035 | 1,885 | [
883373218
] | [
"liveview",
"test"
] | defmodule GymboWeb.UserForgotPasswordLiveTest do
use GymboWeb.ConnCase, async: true
import Phoenix.LiveViewTest
import Gymbo.AccountsFixtures
alias Gymbo.Accounts
alias Gymbo.Repo
describe "Forgot password page" do
test "renders email page", %{conn: conn} do
{:ok, lv, html} = live(conn, ~p"/use... |
0109df5a503a950c1eb54bb7321e8eb6d9f9209c | 16,654 | [
408506867
] | [] | %{
"bcrypt_elixir": {:hex, :bcrypt_elixir, "2.3.0", "6cb662d5c1b0a8858801cf20997bd006e7016aa8c52959c9ef80e0f34fb60b7a", [:make, :mix], [{:comeonin, "~> 5.3", [hex: :comeonin, repo: "hexpm", optional: false]}, {:elixir_make, "~> 0.6", [hex: :elixir_make, repo: "hexpm", optional: false]}], "hexpm", "2c81d61d4f6ed0e5cf7... |
0109f779c75903d57bf9364fd295f69f795f7577 | 2,638 | [
144300953
] | [
"genserver",
"documented"
] | defmodule OAAS.Queue do
@moduledoc "Manages the job queue."
alias OAAS.Job
alias OAAS.Worker
import OAAS.Utils
use GenServer
@interval_ms 60_000
def start_link(_args) do
GenServer.start_link(__MODULE__, %{}, name: __MODULE__)
end
@impl true
def init(state) do
schedule(@interval_ms)
{... |
010a220709af6dc5f78552b6d866fecee709cec0 | 2,804 | [
75701883
] | [
"genserver",
"typespec",
"documented"
] | defmodule Exhtml.Storage do
@moduledoc """
Storage provides a `fetch` method used to fetch content from outside
source.
## Examples:
iex> {:ok, pid} = Exhtml.Storage.start_link []
...> Exhtml.Storage.fetch(pid, :foo)
nil
iex> # fetcher can be replaced at runtime
...> Exhtml.Stora... |
010a6f34be6c8836cc002a679e48453b17fb8cc8 | 19,959 | [
419435907
] | [
"documented",
"ecto"
] | defmodule Oli.Groups do
@moduledoc """
The Groups context.
"""
import Ecto.Query, warn: false
alias Ecto.Multi
alias Oli.{Accounts, Institutions, Publishing, Repo, Utils}
alias Oli.Accounts.{Author, User}
alias Oli.Authoring.Course.Project
alias Oli.Delivery.Sections.Section
alias Oli.Groups.{Comm... |
010aa8c204d3d5d6c1b5125c70429c180ae59325 | 1,877 | [
206665393,
161814744
] | [
"test",
"ecto"
] | defmodule Tom.RandTest do
use Tom.DataCase
alias Tom.Rand
describe "halls" do
alias Tom.Rand.Hall
@valid_attrs %{transactions: 42, users: 42}
@update_attrs %{transactions: 43, users: 43}
@invalid_attrs %{transactions: nil, users: nil}
def hall_fixture(attrs \\ %{}) do
{:ok, hall} =
... |
010ab8562f6ea5c32814219f66ceb8a208431651 | 1,525 | [
107414912
] | [
"documented"
] | defmodule Parseus.JoinProcessor do
@moduledoc false
alias Parseus.Set
def call(set = %Set{output: output, mapping: mapping}, old_keys, new_key, opts) do
new_mapping = update_mapping(mapping, old_keys, new_key)
new_output = update_output(output, old_keys, new_key, opts)
%{set | mapping: new_mapping,... |
010ac465c025f2468ad1bb4b17af4dfbc5fe8f7c | 9,022 | [
576059101
] | [
"test",
"phoenix"
] | defmodule ConduitWeb.ArticleControllerTest do
use ConduitWeb.ConnCase, async: true
alias Conduit.Blog
alias Conduit.Profile
import Conduit.AccountsFixtures
import Conduit.BlogFixtures
describe "GET /articles" do
test "should list all the articles", %{conn: conn} do
user1 = user_fixture(%{userna... |
010ad540c1e9d88c16a6d283f4bd4668c9631526 | 4,274 | [
413478349
] | [
"genserver",
"typespec",
"documented"
] | defmodule Sphynx.Clash do
use GenServer
alias Sphynx.Error
import Sphynx, only: [end_game: 2]
defstruct parent: nil,
identity: nil,
current_riddle: nil
@type t() :: %__MODULE__{
parent: atom(),
identity: atom(),
current_riddle: any()... |
010addee2c18de4eca41e324f21adb2564c31a6d | 1,913 | [
268159476
] | [
"test",
"ecto"
] | defmodule Covid.BatteriesTest do
use Covid.DataCase
alias Covid.Batteries
describe "batteries" do
alias Covid.Batteries.Battery
@valid_attrs %{}
@update_attrs %{}
@invalid_attrs %{}
def battery_fixture(attrs \\ %{}) do
{:ok, battery} =
attrs
|> Enum.into(@valid_attrs)... |
010b87bdd04184152d7ee9bfd41f59ac4fb912b5 | 6,082 | [
63981899
] | [
"test"
] | defmodule Artisan.ProjectsTest do
use Artisan.ModelCase
alias Artisan.Projects
alias Artisan.Project
@valid_project_params %{
name: "Name",
}
@invalid_project_params %{
name: nil
}
setup do
{:ok, %{current_user: Helpers.create_user()}}
end
test "creates a project with valid params", ... |
010c3b7e25f7b0f852d25258dc1effbc8794005b | 2,637 | [
81895279
] | [] | %{"certifi": {:hex, :certifi, "2.0.0", "a0c0e475107135f76b8c1d5bc7efb33cd3815cb3cf3dea7aefdd174dabead064", [], [], "hexpm"},
"ex_aws": {:hex, :ex_aws, "2.0.2", "8df2f96f58624a399abe5a0ce26db648ee848aca6393b9c65c939ece9ac07bfa", [], [{:configparser_ex, "~> 2.0", [hex: :configparser_ex, repo: "hexpm", optional: true]},... |
010c87fb9d438316de02e0ad8db89a2970b27431 | 1,956 | [
885069632
] | [] | # 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 :efe,
namespace: EFE,
ecto_repos: [EFE.Rep... |
010ca55e00b5d3452e90072d63a4df7408ef87c3 | 4,017 | [
135851868
] | [
"typespec",
"documented"
] | defmodule Curie.Colors do
@moduledoc """
Color roles as guild currency purchasable reward.
"""
use Curie.Commands
alias Curie.{Currency, Storage}
alias Nostrum.Api
alias Nostrum.Cache.GuildCache
alias Nostrum.Struct.Guild.Role
alias Nostrum.Struct.{Guild, Message, User}
@check_typo ~w/color color... |
010cb2db355c8774ccff9ca7fc51a30906a613a6 | 1,601 | [
501212508
] | [
"phoenix"
] | defmodule BebemayotteWeb.PageController do
use BebemayotteWeb, :controller
alias Bebemayotte.CatRequette
alias Bebemayotte.ProdRequette
alias Bebemayotte.SouscatRequette
# GET ACCUEIL
def index(conn, _params) do
categories = CatRequette.get_all_categorie()
render(conn, "index.html", categories: ca... |
010d88c6016180b798bee16b2d1125fa68386ea6 | 2,162 | [
596183444
] | [
"test",
"ecto"
] | defmodule ChatService.AccountTest do
use ChatService.DataCase
alias ChatService.Account
describe "activities" do
alias ChatService.Account.Activity
import ChatService.AccountFixtures
@invalid_attrs %{is_online: nil, lastseen: nil}
test "list_activities/0 returns all activities" do
activ... |
010dc449a5f5fe4fca1f78c65e8a876773dcf7aa | 2,298 | [
284468312
] | [
"documented",
"ecto"
] | defmodule Chatter.Accounts do
@moduledoc """
The Accounts context.
"""
import Ecto.Query, warn: false
alias Chatter.Repo
alias Chatter.Accounts.User
@doc """
Returns the list of users.
## Examples
iex> list_users()
[%User{}, ...]
"""
def list_users do
Repo.all(User)
end
... |
010dc9db920555363afc1eebbaa9cb3155ebb449 | 3,018 | [
100794672
] | [
"documented"
] | defmodule TodoApp2.TodoListCommander do
use Drab.Commander
alias TodoApp2.TodoList
alias TodoApp2.TodoItem
alias TodoApp2.Repo
@doc "New task button adds new empty task"
def new_task_action(socket, sender) do
{:ok, new_changeset, new_task_no} = new_task(sender.params)
# update screen
poke... |
010e06efdd810e90dcc1515fdfd9abe347b8fb70 | 1,646 | [
64277912
] | [] | %{"certifi": {:hex, :certifi, "0.4.0", "a7966efb868b179023618d29a407548f70c52466bf1849b9e8ebd0e34b7ea11f", [:rebar3], []},
"floki": {:hex, :floki, "0.9.0", "e952ca71a453f7827ab5405106ac8d9ac5c9602d18aa5d2d893e5b9944e2499e", [:mix], [{:mochiweb_html, "~> 2.15", [hex: :mochiweb_html, optional: false]}]},
"hackney": {... |
010ea5e96ee598306ae73f2c555bfc24608b4b70 | 5,246 | [
515548365
] | [
"genserver",
"typespec",
"documented"
] | defmodule ExBanking.User do
@moduledoc """
GenServer storing user information with their Accounts info
"""
use GenServer
alias ExBanking.Account
alias ExBanking.Formatter
alias ExBanking.User.Actions.{Action, Deposit, GetBalance, Send, Withdraw}
alias ExBanking.User.RequestThrottler
@type t :: %{name:... |
010f00663a9202dd3a9ea1b391aac80e6e59b7ce | 21,741 | [
243129821,
273085190,
425222664,
239182752,
231666876,
238344742,
248292846,
286403536,
229153691,
234219270,
290969763,
244384132,
273096993,
256354544,
264116374,
122517060,
272192752,
229675082,
257246799,
280469788,
333225527,
342416435,
230283143,
267936422,
2179... | [
"typespec",
"test",
"documented",
"ecto"
] | defmodule Ecto.Multi do
@moduledoc """
`Ecto.Multi` is a data structure for grouping multiple Repo operations.
`Ecto.Multi` makes it possible to pack operations that should be
performed in a single database transaction and gives a way to introspect
the queued operations without actually performing them. Each... |
010f06c6108538baf47b6da8562a4026b6ddbcfb | 2,243 | [
865039439
] | [
"documented"
] | defmodule ExCompilationCache.Behaviours.CacheBackend do
@moduledoc """
Behaviour that a specific cache backend (e.g. S3) should implement
to be used as a compilation cache.
"""
alias ExCompilationCache.BuildCache
@doc """
Function that will be called before trying to upload or download a compilation art... |
0110b33fc2f769a777ee6365591ccba367da9119 | 2,686 | [
90961044
] | [
"test"
] | defmodule Flexcility.Web.UserControllerTest do
use Flexcility.Web.ConnCase
alias Flexcility.Web.Accounts
alias Flexcility.Web.Accounts.User
@create_attrs %{email: "some email", name: "some name", password: "some password", password_confirmation: "some password_confirmation"}
@update_attrs %{email: "some upd... |
0110fe08c93701c55bd3ac289f585e3731d5be64 | 3,316 | [
156128502
] | [
"documented",
"ecto"
] | defmodule Slang.Chat do
@moduledoc """
The Chat context.
"""
import Ecto.Query, warn: false
alias Slang.Repo
alias Slang.Chat.Room
@doc """
Returns the list of rooms.
## Examples
iex> list_rooms()
[%Room{}, ...]
"""
def list_rooms do
Repo.all(Room)
end
@doc """
Gets a ... |
01110729d13ada6eaf373951dde8c843457fd0e7 | 6,987 | [
687851302
] | [
"liveview",
"phoenix",
"documented"
] | defmodule AngelTradingWeb.UserAuth do
use AngelTradingWeb, :verified_routes
import Plug.Conn
import Phoenix.Controller
alias AngelTrading.{Account, API, Utils}
require Logger
@remember_me_cookie "_angel_remember_me"
@remember_me_options [sign: true, same_site: "Lax"]
@session_valid_days 3
@doc """
... |
0111245e3e4714ccbfe2d576ee5fb890442e24a9 | 2,242 | [
666675840
] | [
"phoenix",
"ecto"
] | defmodule ProjectWeb.TaskController do
use ProjectWeb, :controller
alias Project.Repo
alias Project.Tasks
alias Project.Tasks.Task
def index(conn, _params) do
tasks = Tasks.list_tasks()
changeset = Tasks.change_task(%Task{})
IO.inspect(conn.params)
render(conn, "index.html", tasks: tasks, c... |
01114ae3bad8782b16310e74885f8f0279d28b56 | 2,765 | [
84704074
] | [
"test"
] | defmodule Catrina.FrameMaterialsControllerTest do
use Catrina.ConnCase
alias Catrina.FrameMaterials
@valid_attrs %{}
@invalid_attrs %{}
test "lists all entries on index", %{conn: conn} do
conn = get conn, frame_materials_path(conn, :index)
assert html_response(conn, 200) =~ "Listing frame materials"... |
0111f9925e82ddec0f1234699d949a34ece20de9 | 10,082 | [
563730500
] | [
"documented",
"phoenix"
] | defmodule BlockScoutWeb.WebRouter do
@moduledoc """
Router for web app
"""
use BlockScoutWeb, :router
pipeline :browser do
plug(:accepts, ["html"])
plug(:fetch_session)
plug(:fetch_flash)
plug(:protect_from_forgery)
plug(BlockScoutWeb.CSPHeader)
plug(BlockScoutWeb.ChecksumAddress)
e... |
01125fdf47cf65f4565bd396849e018a4b38eeaf | 1,684 | [
333239824
] | [
"documented"
] | defmodule MscmpSystAuthn.Impl.Hash do
@moduledoc false
# Note that this module exists mostly to wrap library APIs which provide
# proper cryptographic functions. We wrap things here so that we can have
# some flexibility in which libraries to expose to the rest of the
# application. For example, the current... |
0112d41210ff205137ef3f0e3d34be12da0a904e | 6,996 | [
78070611
] | [] | %{"apprentice": {:git, "https://github.com/chloeandisabel/apprentice.git", "365ab2403d05e28c6455b938925c629be65623e3", []},
"calendar": {:hex, :calendar, "0.17.2", "d6b7bccc29c72203b076d4e488d967780bf2d123a96fafdbf45746fdc2fa342c", [:mix], [{:tzdata, "~> 0.5.8 or ~> 0.1.201603", [hex: :tzdata, optional: false]}]},
... |
0112f1231240ee9c7d41ca34e820a3c392893cb8 | 4,556 | [
492431252
] | [
"documented",
"ecto"
] | defmodule BulmaAuth.Accounts.User do
use Ecto.Schema
import Ecto.Changeset
schema "users" do
field :email, :string
field :password, :string, virtual: true, redact: true
field :hashed_password, :string, redact: true
field :confirmed_at, :naive_datetime
timestamps()
end
@doc """
A user ... |
01131f95c892339908cc12b33148dba62aec565b | 2,311 | [
208282758
] | [
"test",
"phoenix"
] | defmodule WorktimeWeb.UsersControllerTest do
use WorktimeWeb.ConnCase
alias Worktime.Auth
alias Worktime.Auth.Users
@create_attrs %{
}
@update_attrs %{
}
@invalid_attrs %{}
def fixture(:users) do
{:ok, users} = Auth.create_users(@create_attrs)
users
end
setup %{conn: conn} do
{:o... |
01137ec5f4744ff3a6d54db25eddf06010a1b977 | 2,168 | [
415368961
] | [
"documented"
] | defmodule Identicon do
@moduledoc """
Documentation for `Identicon`.
"""
@doc """
Hello world.
## Examples
iex> Identicon.hello()
:world
"""
def main(input) do
input
|> hash_input
|> pick_color
|> build_grid
|> filter_odd_squares
|> build_pixel_map
|> draw_im... |
0113818f6eff9e0c078dfbe8ae800e660c412a89 | 3,867 | [
819518083
] | [
"typespec",
"documented"
] | defmodule ExAxos.Schema.NumberTab do
@moduledoc """
Provides struct and type for a Schema.NumberTab
"""
@type t :: %__MODULE__{
anchorIgnoreIfNotPresent: String.t() | nil,
anchorString: String.t() | nil,
anchorUnits: String.t() | nil,
anchorXOffset: String.t() | nil,
... |
011421fdf5120678e7a07bba9454464231c0006a | 3,217 | [
447675521
] | [
"genserver"
] | defmodule Bomb.GameWorker do
use GenServer
alias Bomb.Game
def start_link(opts) do
GenServer.start_link(__MODULE__, opts, name: __MODULE__)
end
def key_press(key), do: GenServer.cast(__MODULE__, {:key_pressed, key})
def bomb_exploded, do: GenServer.cast(__MODULE__, :bomb_exploded)
def init(_opts) d... |
011487f2a7599745559cb4d52baae53d77714ebe | 2,568 | [
115825166
] | [
"test"
] | defmodule Day1Test do
use ExUnit.Case
import Day1
doctest Day1
test "day 1 part 1" do
assert part_1(input()) == 1216
end
test "day 1 part 2" do
assert part_2(input()) == 1072
end
def input do
string = """
52288333363558485499154593667379825983129
595838174556215459767847924894681... |
0114aded744c08f9bfa843ab8082d888fb8e7175 | 3,111 | [
214390420
] | [
"typespec",
"liveview"
] | defmodule LiveViewTodoWeb.TodoAppLive do
use Phoenix.LiveView
alias LiveViewTodo.Todo
def render(assigns) do
Phoenix.View.render(LiveViewTodoWeb.MainView, "index.html", assigns)
end
@spec mount(map, Phoenix.LiveView.Socket.t()) :: {:ok, Phoenix.LiveView.Socket.t()}
def mount(_params, socket) do
{... |
011503d4c09ea1db9a1e281487bb2383fa5366f2 | 2,075 | [
87441415
] | [
"typespec",
"documented"
] | defmodule Dashboard.Nodes.Utils.Strings.Serializer do
@moduledoc """
Converts a string value into a type or a list of types.
Available types
---------------
integer
decimal
phone_number
email
"""
@spec serialize_value(String.t, String.t, Boolean.t) :: String.t | {:error, String.t}
def serialize... |
011595e430018772b9f1b94854860e90765332bf | 2,069 | [
135832997
] | [
"liveview"
] | defmodule Data.Article.Blog.Steindamm do
use Article.Default
def name(), do: "#{created_at()}-7-steindamm"
def created_at(), do: ~D[2018-08-30]
def title(), do: "Steindamm (Veloroute 7)"
def start(), do: ~d[2019-10-14]
def stop(), do: ~d[2021-04-16]
def type(), do: :finished
def construction_site_id... |
011652cca7422c3c185793e793152f593e297dd3 | 9,751 | [
149640181
] | [
"test"
] | defmodule Explorer.SmartContract.ReaderTest do
use EthereumJSONRPC.Case
use Explorer.DataCase
doctest Explorer.SmartContract.Reader
alias Explorer.SmartContract.Reader
alias Explorer.Chain.Hash
import Mox
setup :verify_on_exit!
describe "query_contract/4" do
test "correctly returns the results ... |
011690cb5fa60c51a89d8092a7b0511f82a76c68 | 5,827 | [
155897023
] | [
"test"
] | defmodule Edict.Redis.ProtocolTest do
use ExUnit.Case, async: true
alias Edict.Redis.Protocol
doctest Protocol
describe "parse" do
test "empty input" do
assert Protocol.parse("") == :readline
end
test "simple strings" do
assert Protocol.parse("+OK\r\n") == {:ok, "OK", ""}
end
... |
0118478fafdd4897e0d03bd3d5eb40e83b848574 | 2,051 | [
94326698
] | [
"test"
] | defmodule Croppy.ImageControllerTest do
use Croppy.ConnCase
alias Croppy.Image
@valid_attrs %{url: "some content"}
@invalid_attrs %{}
setup %{conn: conn} do
{:ok, conn: put_req_header(conn, "accept", "application/json")}
end
test "lists all entries on index", %{conn: conn} do
conn = get conn, i... |
011866b1adf5b65260081bf66dea2e15e79571ee | 1,698 | [
100641329
] | [
"macro",
"documented",
"phoenix"
] | defmodule PhoenixCircleciWeb 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 PhoenixCircleciWeb, :controller
use PhoenixCircleciWeb, :view
The definitions below will be executed for ev... |
0118746e1d286d1b80135f087ffb1af63e3bdea0 | 1,932 | [
281447701
] | [] | defmodule Fsm.MixProject do
use Mix.Project
def project do
[
app: :fsm,
version: "0.3.0",
elixir: "~> 1.10",
elixirc_paths: elixirc_paths(Mix.env()),
compilers: [:phoenix, :gettext] ++ Mix.compilers(),
start_permanent: Mix.env() == :prod,
aliases: aliases(),
deps... |
01190424e04e79c6ef4cd0b451d21046a695e88a | 4,533 | [
124496138
] | [
"test",
"documented",
"liveview"
] | # credo:disable-for-this-file Credo.Check.Readability.Specs
defmodule DawdleTest do
use ExUnit.Case, async: false
import Dawdle.TestHelper
import Eventually
alias Dawdle.Delay.Handler, as: DelayHandler
doctest Dawdle
defmodule TestEvent do
defstruct [:pid]
end
defmodule TestEvent2 do
defstr... |
01192b9763dbc33ecf179259d81900b73f5380e9 | 1,818 | [
193244709,
101434552,
198908023
] | [
"typespec",
"documented"
] | defmodule GoogleApi.CloudAsset.V1.Model.EffectiveIamPolicy do
@moduledoc """
The effective IAM policies on one resource.
## Attributes
* `fullResourceName` (*type:* `String.t`, *default:* `nil`) - The [full_resource_name] (https://cloud.google.com/asset-inventory/docs/resource-name-format) for which the pol... |
011935c613ea76f218f036b70b4cdbe9d4a8a88d | 1,625 | [
86394326
] | [
"macro",
"documented",
"ecto",
"phoenix"
] | defmodule Arrivals.Web do
@moduledoc """
A module that keeps using definitions for controllers,
views and so on.
This can be used in your application as:
use Arrivals.Web, :controller
use Arrivals.Web, :view
The definitions below will be executed for every view,
controller, etc, so keep them ... |
0119bfaf76900fc8b706d0a95e08a1de264a9116 | 1,788 | [
480539219
] | [
"test",
"phoenix"
] | defmodule BandOfTheWeekWeb.UserRegistrationControllerTest do
use BandOfTheWeekWeb.ConnCase, async: true
import BandOfTheWeek.AccountsFixtures
describe "GET /users/register" do
test "renders registration page", %{conn: conn} do
conn = get(conn, Routes.user_registration_path(conn, :new))
response ... |
011a4f93d4a8a36eafe1f84050ea5425f3143ff8 | 3,126 | [
556153412
] | [
"documented",
"ecto"
] | defmodule ElixirSdkDev do
@moduledoc """
A module for help developing Elixir SDK.
"""
use Dagger.Mod.Object, name: "ElixirSdkDev"
@base_image "hexpm/elixir:1.17.3-erlang-27.2-alpine-3.20.3@sha256:557156f12d23b0d2aa12d8955668cc3b9a981563690bb9ecabd7a5a951702afe"
@doc """
Test the SDK.
"""
defn test(... |
011a78b8865efb519042f266936c46025a49c8d8 | 2,774 | [
193244709,
101434552,
198908023
] | [
"typespec",
"documented"
] | defmodule GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ExplanationMetadataInputMetadataVisualization do
@moduledoc """
Visualization configurations for image explanation.
## Attributes
* `clipPercentLowerbound` (*type:* `number()`, *default:* `nil`) - Excludes attributions below the specified percen... |
011a83e7f43c223ef21efa3c6f55263e85083c49 | 4,687 | [
370846911
] | [
"genserver",
"typespec",
"documented"
] | defmodule SGP40.VocIndex do
@moduledoc """
Process the raw output of the SGP40 sensor into the VOC Index.
"""
use GenServer
alias SGP40.VocIndex.AlgorithmStates
alias SGP40.VocIndex.AlgorithmTuningParams
require Logger
@doc """
Initialize the VOC algorithm
"""
@spec start_link(keyword()) :: Gen... |
011ac262ff18b8e75f2985ec21c9e7f580ad010c | 2,264 | [
455859391
] | [
"phoenix"
] | defmodule ComparatorWeb.UserSettingsController do
use ComparatorWeb, :controller
alias Comparator.Auth
alias ComparatorWeb.UserAuth
plug :assign_email_and_password_changesets
def edit(conn, _params) do
render(conn, "edit.html")
end
def update(conn, %{"action" => "update_email"} = params) do
%{... |
011b21dc6790391bf4c21a28021d437234c640fa | 1,680 | [
640772204
] | [
"phoenix",
"ecto"
] | defmodule AinComBookingWeb.Controllers.BookingController do
use Phoenix.Controller
import AinComBookingWeb.Errors
import Ecto.Query
alias AinComBookingApi.Bookings.Booking
alias AinComBookingApi.Bookings.Slot
alias AinComBookingApi.Repo
def create(conn, %{"slot_id" => slot_id, "customer_name" => name, ... |
011ba25a6c5853699c375cdb3093a2b0bca457a5 | 1,972 | [
113831063
] | [] | defmodule Day08 do
@input File.read!("input/day_08.txt")
def run do
{regs, max} =
@input
|> parse
|> execute(regs: Map.new, max: 0)
|> IO.inspect
IO.puts "max final: #{find_largest_value(regs)}"
IO.puts "max ever: #{max}"
end
def parse(input) do
input
|> String.sp... |
011bf550e7da42fca4ddf206650ae1ebf0511ada | 3,730 | [
485352057
] | [] | defmodule Factori.Mapping.Faker do
@behaviour Factori.Mapping
@ranges %{
smallint: -32_768..32_767,
integer: -2_147_483_648..2_147_483_647,
serial: 1..2_147_483_647,
bigserial: 1..9_223_372_036_854_775_807
}
@timestamps ~w(inserted_at updated_at)a
alias Faker.Lorem
def match(%{type: "uuid... |
011c781375792fad29157f0b862c776511b82a68 | 1,828 | [
30144573
] | [] | defmodule Problem5 do
def isCandidate(candidate) do
result = Enum.reduce(1..20, 0, fn x, acc ->
acc + rem(candidate, x)
end)
if result == 0 do
:true
end
end
def isCandidate2(candidate, current, max) do
remainder = rem(candidate, current)
cond do
(remainder ... |
011c87a958562ce92328dc70cdc77ac320d65e7d | 1,686 | [
97888442
] | [
"typespec",
"documented",
"ecto"
] | defmodule CodeCorps.GitHub.Event do
@moduledoc ~S"""
In charge of marking `GithubEvent` records as "processing", "processed" or
"errored", based on the outcome of processing a webhook event payload.
"""
alias CodeCorps.{GithubEvent, Repo}
alias Ecto.Changeset
@type error :: atom | Changeset.t
@doc ~S... |
011d30807b5262afa846e3ea32bc5ff91babf05e | 10,448 | [
119320929
] | [
"genserver"
] | defmodule Project3.Worker do
use GenServer
def start_link(args) do
GenServer.start_link(__MODULE__,{:ok,args},name: args)
#GenServer.start_link(module, args, options \\ [])
end
def attachment(global,list) do
#Project3.Worker.attachment(global, list)
fu=fn(x... |
011dbeffbcf09024794b18fe7a0eabc0b8a23087 | 3,727 | [
58792958
] | [
"test"
] | defmodule DataMorphTest do
use ExUnit.Case, async: false
doctest DataMorph.Csv
doctest DataMorph.Module
doctest DataMorph.Stream
setup do
stream =
("name\tISO code\n" <> "New Zealand\tnz\n" <> "United Kingdom\tgb")
|> String.split("\n")
|> Stream.map(& &1)
{:ok, [tsv: stream]}
en... |
011e1be435b15dbeb39649846288fc193d405dd7 | 7,734 | [
746354157
] | [] | %{
"bandit": {:hex, :bandit, "1.5.0", "3bc864a0da7f013ad3713a7f550c6a6ec0e19b8d8715ec678256a0dc197d5539", [:mix], [{:hpax, "~> 0.1.1", [hex: :hpax, repo: "hexpm", optional: false]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", opti... |
011e93795eb0ac42d2e2f3d87b0086257da7554c | 1,820 | [
166688658
] | [
"typespec",
"documented"
] | defmodule ZcmsWeb.Schema.Types.Custom.JSON do
@moduledoc """
The Json scalar type allows arbitrary JSON values to be passed in and out.
Requires `{ :jason, "~> 1.1" }` package: https://github.com/michalmuskala/jason
"""
use Absinthe.Schema.Notation
scalar :json, name: "Json" do
description("""
The ... |
011e9c9ddc8ecd2b548da2fbd87be931b309ad39 | 4,754 | [
176176547,
161703639,
173431331,
182819427,
176896466,
164176994,
159884345,
175115326
] | [
"typespec",
"documented"
] | defmodule HTTPoison.Request do
@moduledoc """
`Request` properties:
* `:method` - HTTP method as an atom (`:get`, `:head`, `:post`, `:put`,
`:delete`, etc.)
* `:url` - target url as a binary string or char list
* `:body` - request body. See more below
* `:headers` - HTTP headers as an orddict ... |
011eb885303ff86c2a6f184a2f11e6fe184505f0 | 5,660 | [
373953355
] | [
"genserver"
] | defmodule Absinthe.GraphqlWS.Client do
use GenServer
alias Absinthe.GraphqlWS.Uuid
require Logger
defstruct [
:gun,
:gun_process_monitor,
:gun_stream_ref,
:monitor,
:transport,
listeners: %{},
queries: %{}
]
def start(endpoint, init_payload \\ %{}) do
{:ok, client} = GenSer... |
011f2118f9c0c30412918742fff00d3dc1fc9aaa | 1,938 | [
291510770
] | [
"typespec",
"documented"
] | defmodule DarkMatter.Decimals.Comparison do
@moduledoc """
Decimal comparison functions
"""
@moduledoc since: "1.0.8"
import DarkMatter.Guards, only: [is_numeric: 1]
alias DarkMatter.Decimals.Conversion
alias DarkMatter.Deps
@type comparison() :: :eq | :gt | :lt
@doc """
Determines if two `t:Dar... |
011f41ba179fe24e162b6c9e035945d5727ed6ba | 2,903 | [
65163932
] | [
"phoenix"
] | defmodule CouchjitsuTrack.ActivityFeedController do
use CouchjitsuTrack.Web, :controller
alias CouchjitsuTrack.Record
alias CouchjitsuTrack.Activity
def index(conn, _params) do
user = conn.assigns[:current_user]
history = CouchjitsuTrack.ActivityHistory.get_history_for_user(user.id)
dates ... |
011f9e7e585bcebc24317d9c0e25c1adbca574a1 | 8,510 | [
274362840
] | [
"documented",
"ecto"
] | defmodule Scrupulous.UserContent do
@moduledoc """
The UserContent context.
"""
import Ecto.Query, warn: false
alias Scrupulous.Repo
alias Scrupulous.UserContent.Note
@doc """
Returns the list of notes.
## Examples
iex> list_notes()
[%Note{}, ...]
"""
def list_notes do
Repo.a... |
01200fa7f77f480f8a6ebd06ecb00c5e62e92e58 | 5,177 | [
106712767
] | [
"typespec",
"documented",
"ecto"
] | defmodule Sanbase.Billing do
@moduledoc ~s"""
Context module for all billing functionality
"""
import Ecto.Query
import Sanbase.Billing.EventEmitter, only: [emit_event: 3]
alias Sanbase.Repo
alias Sanbase.Billing.{Product, Plan, Subscription}
alias Sanbase.Billing.Subscription.LiquiditySubscription
... |
01204a7f2e4f390fb35f03b16e49adf84d8fef8b | 17,899 | [
212487543
] | [
"typespec",
"macro",
"documented"
] | defmodule Ash.Helpers do
@moduledoc false
require Logger
@dialyzer {:nowarn_function, {:unwrap_or_raise!, 2}}
@spec try_compile(term) :: :ok
def try_compile(module) when is_atom(module) do
try do
# This is to get the compiler to ensure that the resource is compiled
# For some very strange r... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.