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 |
|---|---|---|---|---|
08923486d8a1f8560719c3fe5b76fa9072f4b95a | 1,574 | [
193244709,
101434552,
198908023
] | [
"typespec",
"documented"
] | defmodule GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Common_TargetSpend do
@moduledoc """
An automated bid strategy that sets your bids to help get as many clicks as possible within your budget.
## Attributes
* `cpcBidCeilingMicros` (*type:* `String.t`, *default:* `nil`) - Maximum bid limit that... |
0892512dba6207e96241f1844da83470e6002e3a | 1,788 | [
810412699
] | [] | defmodule Cemso.Utils.TopList do
# Comparator function must return true if the first argument should be
# before the second argument in the top.
defstruct max: 0, comp: nil, items: []
def new(max_items, comp)
when is_integer(max_items) and max_items > 0 and is_function(comp, 2) do
%__MODULE__{max: m... |
089331a9663793e7c0e03e94f74a78423f5dd054 | 3,399 | [
698039879
] | [
"test"
] | defmodule ToyRobot.CommandRunnerTests do
use ExUnit.Case, async: true
import ExUnit.CaptureIO
alias ToyRobot.{CommandRunner, Simulation}
test "handles a valid placement" do
%Simulation{robot: robot} = CommandRunner.run([{:place, %{east: 1, north: 2, facing: :north}}])
assert robot.east == 1
asse... |
0893365828368eab1c59a07c05753132b9617212 | 2,812 | [
110184694
] | [] | %{
"bunt": {:hex, :bunt, "0.2.0", "951c6e801e8b1d2cbe58ebbd3e616a869061ddadcc4863d0a2182541acae9a38", [:mix], [], "hexpm"},
"connection": {:hex, :connection, "1.0.4", "a1cae72211f0eef17705aaededacac3eb30e6625b04a6117c1b2db6ace7d5976", [:mix], [], "hexpm"},
"credo": {:hex, :credo, "0.8.10", "261862bb7363247762e106... |
08934542fe4ddee359e85b64613904dd4b237c27 | 5,396 | [
98059713
] | [] | %{
"artificery": {:hex, :artificery, "0.4.0", "e0b8d3eb9dfe8f42c08a620f90a2aa9cef5dba9fcdfcecad5c2be451df159a77", [:mix], [], "hexpm"},
"bunt": {:hex, :bunt, "0.2.0", "951c6e801e8b1d2cbe58ebbd3e616a869061ddadcc4863d0a2182541acae9a38", [:mix], [], "hexpm"},
"certifi": {:hex, :certifi, "1.0.0", "1c787a85b1855ba354f... |
0893b7e934a5dd0f878350f9977cfff193fe9c2f | 3,213 | [
191423461
] | [
"documented"
] | defmodule Meadow.Config.Secrets do
@moduledoc """
Functions for retrieving and loading configuration from AWS Secrets Manager and
the local runtime environment
"""
require Logger
@config_map %{
dcapi: "config/dcapi",
ezid: "infrastructure/ezid",
iiif: "infrastructure/iiif",
index: "infrast... |
0893ee770e7558b48afba3839ca3d7dc42f5614b | 3,045 | [
526775179
] | [
"test",
"phoenix"
] | defmodule TBlogWeb.ArticleControllerTest do
use TBlogWeb.ConnCase
import TBlog.BlogFixtures
@create_attrs %{
author: "some author",
content: "some content",
tags: ["movies", "books"],
title: "some title",
slug: "some-title"
}
@update_attrs %{
author: "some updated author",
conten... |
089437b98be722e56804a5ca219a5bffc4858d36 | 2,123 | [
54934888
] | [
"supervisor",
"phoenix"
] | defmodule Locorum.BackendSys do
alias Locorum.{ResultCollection, Repo, Backend}
use Phoenix.Channel, only: [broadcast!: 3]
def join(_, _, _), do: nil
defmodule Result do
defstruct biz: nil, address: nil, city: nil, state: nil, zip: nil,
rating: nil, url: nil, phone: nil
end
# TODO depre... |
0894a04c1544f2720eec4304ec58b338d20ab282 | 3,644 | [
209731160
] | [] | defmodule RateLimiting.Request do
alias RateLimiting.Registry
alias Timex.Duration
require IEx
@max_requests_count Application.get_env(:rate_limiting, :max_requests_count)
@interval_seconds Application.get_env(:rate_limiting, :interval_seconds)
# TODO: Investigate if I could add IP format parser.
def all... |
0894a37c4206553ed599166854e9a4c582d5a8c6 | 2,193 | [
376681454,
376660813
] | [
"test"
] | defmodule ReviewItWeb.PostCreatorsControllerTest do
use ReviewItWeb.ConnCase, async: false
import ReviewIt.Factory
alias ReviewItWeb.Auth.Guardian
describe "index/2" do
setup %{conn: conn} do
%{id: id} =
user =
insert(:user, %{id: "f9b153f9-7bd8-4957-820f-f1d6570ec24e", email: "<EMA... |
0894c5c9f61b8d7ce18d2c41db8d325ef03c97d0 | 3,339 | [
963360179
] | [
"documented"
] | defmodule Botd.Seeds.MovieCharacters do
@moduledoc """
Seed script to populate the database with famous deceased movie characters.
This script reads character data from expanded_characters.csv file
and imports them into the database.
"""
alias Botd.People
alias Botd.ActivityLogs
alias Botd.Repo
alia... |
0894ecc3811f7243cddc1c24bb908c0833f249a2 | 2,652 | [
90054433
] | [
"test"
] | defmodule BzaarWeb.UserAddressControllerTest do
use BzaarWeb.ConnCase
alias Bzaar.UserAddress
@valid_attrs %{cep: 42, city: "some content", complement: "some content", name: "some content", number: 42, street: "some content", uf: "some content"}
@invalid_attrs %{}
setup %{conn: conn} do
{:ok, conn: put_... |
0894f0b3e1c878427ca8c64f9f2a539e0994ce8c | 2,035 | [
426781486
] | [] | defmodule Nestru.MixProject do
use Mix.Project
@version "1.0.1"
@repo_url "https://github.com/IvanRublev/Nestru"
def project do
[
app: :nestru,
version: @version,
elixir: ">= 1.11.0",
elixirc_paths: elixirc_paths(Mix.env()),
start_permanent: Mix.env() == :prod,
deps: de... |
089532c417459f92ebada42adda6dc25da573007 | 3,008 | [
432458254
] | [
"test",
"phoenix"
] | defmodule DoofinderBooksWeb.AuthorControllerTest do
use DoofinderBooksWeb.ConnCase
import DoofinderBooks.DAuthorFixtures
@create_attrs %{birth: ~D[2021-11-28], death: ~D[2021-11-28], fullname: "some fullname", nationality: "some nationality", pseudonym: "some pseudonym"}
@update_attrs %{birth: ~D[2021-11-29],... |
089559f599fb8abcae18c80f3b67cf4040b60c39 | 2,319 | [
291309764
] | [
"documented",
"ecto"
] | defmodule LiveViewStudio.GitRepos do
@moduledoc """
The GitRepos context.
"""
import Ecto.Query, warn: false
alias LiveViewStudio.Repo
alias LiveViewStudio.GitRepos.GitRepo
def list_git_repos(criteria) when is_list(criteria) do
query = from(g in GitRepo)
Enum.reduce(criteria, query, fn
{... |
089569feb1c323c7bd2a8fecd4be7334c3bf308d | 4,520 | [
53512499
] | [
"test"
] | defmodule CogApi.HTTP.RolesTest do
use CogApi.HTTPCase
alias CogApi.HTTP.Client
alias CogApi.Resources.Permission
doctest CogApi.HTTP.Roles
describe "role_index" do
it "returns a list of roles" do
cassette "roles_index" do
endpoint = valid_endpoint
params = %{name: "role_index"}
... |
0895767f6b5d0fa9cc60e1840762713ce227c79a | 4,242 | [
104793233
] | [
"test",
"ecto"
] | defmodule Microblog.AccountTest do
use Microblog.DataCase
alias Microblog.Account
describe "users" do
alias Microblog.Account.User
@valid_attrs %{first_name: "some first_name", last_name: "some last_name", nickname: "some nickname", username: "some username"}
@update_attrs %{first_name: "some updat... |
0895f8fc0bb68b933d1d71ee6ca141388ae17c19 | 6,002 | [
307181886
] | [] | defmodule Rochambo.GameState do
alias Rochambo.Player
defstruct player_one: nil, player_two: nil, round_winners: [], state: :need_players
def get_player_names(%Rochambo.GameState{
player_one: %Player{name: name1},
player_two: %Player{name: name2}
}) do
[name1, name2]
end
def get_p... |
08962e3f22fae911c37736ab404a75a4998b9859 | 6,465 | [
463276814
] | [
"test"
] | defmodule ExMonApiWeb.Controllers.TrainersControllerTest do
use ExMonApiWeb.ConnCase
import ExMonApiWeb.Auth.Guardian
alias ExMonApi.Trainer
describe "create/2" do
test "when given valid params, returns the trainer", %{conn: conn} do
# Arrange
params = %{name: "Allan", password: "123456"}
... |
08965107331fbf3c303910aebc697585f5dd1502 | 1,924 | [
261996035
] | [] | defmodule Catcasts.Multimedia.YoutubeData do
alias Catcasts.Multimedia.Video
alias Catcasts.{Multimedia, Repo}
def has_valid_url?(video_params) do
Regex.run(
~r/(?:youtube\.com\/\S*(?:(?:\/e(?:mbed))?\/|watch\?(?:\S*?&?v\=))|youtu\.be\/)([a-zA-Z0-9_-]{6,11})/,
video_params["video_id"]
... |
089659d092b37b0bceeb25882aab98a53c4f3644 | 20,875 | [
239822890,
459291087
] | [
"genserver",
"liveview",
"phoenix"
] | defmodule OliWeb.Dialogue.WindowLive do
use Phoenix.LiveView, layout: {OliWeb.LayoutView, :live_no_flash}
use OliWeb, :verified_routes
use Phoenix.HTML
require Logger
import Ecto.Query, warn: false
import Phoenix.Component
import OliWeb.Components.Common
alias Oli.Delivery.Sections
alias OliWeb.Com... |
0896c43a562023de8740b785b8e812156622fb39 | 1,592 | [
106294977
] | [
"phoenix"
] | defmodule TicketingSystemWeb.Router do
use TicketingSystemWeb, :router
pipeline :browser do
plug :accepts, ["html"]
plug :fetch_session
plug :fetch_flash
plug :protect_from_forgery
plug :put_secure_browser_headers
end
pipeline :api do
plug :accepts, ["json"]
end
pipeline :require_... |
08972abe3a19fe3f8f4eb64990e22cba1e7cd8f8 | 1,541 | [
122544638
] | [
"documented"
] | defmodule Contextual.API do
@moduledoc false
def list(repo, queryable) do
repo.all(queryable)
end
def get(repo, queryable, id) do
repo.get(queryable, id)
end
def get!(repo, queryable, id) do
repo.get!(queryable, id)
end
def get_by(repo, queryable, clauses) do
repo.get_by(queryable, c... |
08973a6a2eab0f3cfa76f15b504e6d34a39c44ff | 4,933 | [
206297200
] | [
"typespec",
"documented"
] | defmodule Google.Ads.Googleads.V7.Services.GetCustomerRequest do
@moduledoc false
use Protobuf, syntax: :proto3
@type t :: %__MODULE__{
resource_name: String.t()
}
defstruct [:resource_name]
field :resource_name, 1, type: :string
end
defmodule Google.Ads.Googleads.V7.Services.MutateCustom... |
0897b24b96cc59d6e913755305bb27902a52746b | 12,660 | [
397989039
] | [
"test",
"documented"
] | defmodule AttachmentMultipartTest do
use CouchTestCase
@moduletag :attachments
@moduledoc """
Test CouchDB attachment multipart requests
This is a port of the attachments_multipart.js suite
"""
@tag :with_db
test "manages attachments multipart requests successfully", context do
db_name = context[... |
0898835dea04d71f03b1677897306e8232f5c86b | 1,745 | [
266840309,
266894454
] | [] | use Croma
alias Croma.Result, as: R
defmodule AntikytheraCore.Cluster do
require AntikytheraCore.Logger, as: L
alias AntikytheraEal.ClusterConfiguration
defun connect_to_other_nodes_on_start() :: R.t(boolean) do
ClusterConfiguration.running_hosts()
|> R.map(&connect_to_other_nodes/1)
end
defun conn... |
0899029151b41565192a982db68a5267c18423f8 | 1,835 | [
907358409
] | [] | defmodule Lanyard.Api.Router do
import Plug.Conn
alias Lanyard.Api.Routes.V1
alias Lanyard.Api.Routes.Discord
alias Lanyard.Api.Routes.Metrics
alias Lanyard.Api.Util
alias Lanyard.Api.Quicklinks
use Plug.Router
@supported_quicktypes ["png", "gif", "webp", "jpg", "jpeg"]
plug(Corsica,
origins: ... |
089925255138cb2a98178c2f2452224077e546ab | 1,943 | [
146830966
] | [
"phoenix"
] | defmodule Petsgo.PostController do
use Petsgo.Web, :controller
alias Petsgo.Post
plug Guardian.Plug.EnsureAuthenticated, handler: Petsgo.SessionController
def index(conn, _params) do
query =
from p in Post,
select: p,
order_by: [desc: p.updated_at]
posts = Repo.all(query)
render... |
0899387a4f1fa08d2df2ebb8c556755e9b41d84d | 14,376 | [
914529220
] | [
"documented",
"ecto"
] | defmodule Annotator.Lines do
@moduledoc """
The Lines context with simplified chunk handling.
"""
import Ecto.Query
alias Annotator.Repo
alias Annotator.Lines.{Line, Collection, Chunk}
require Logger
@doc """
Gets a collection with its associated lines and their associated
chunks preloaded.
Line... |
089948b7b97e4b5000af8c737c5ed5f9cb1a64e1 | 2,455 | [
757458855
] | [
"phoenix",
"ecto"
] | defmodule LoanSavingsSystemWeb.WorkFlowMemberController do
use LoanSavingsSystemWeb, :controller
alias LoanSavingsSystem.WorkFlows
alias LoanSavingsSystem.WorkFlows.WorkFlowMember
plug(
LoanSavingsSystemWeb.Plugs.EnforcePasswordPolicy
when action not in [:new_password, :change_password]
)
def... |
08997195966714823e6fef62fb4296a704b69271 | 2,013 | [
175193877
] | [
"phoenix"
] | defmodule GuessTheLanguageWeb.LanguageController do
use GuessTheLanguageWeb, :controller
alias GuessTheLanguage.Game.Language
alias GuessTheLanguage.Game
alias GuessTheLanguage.Repo
def preload_language(languages, assoc \\ []) do
Repo.preload(languages, assoc)
end
def send_error(co... |
0899c5ccb3217709a6ec21cc9b2ebf24d2becfc4 | 2,171 | [
225366221
] | [
"test"
] | defmodule AdventOfCode.Day12Test do
use ExUnit.Case
import AdventOfCode.Day12
test "part1 parse" do
input = """
<x=-1, y=0, z=2>
<x=2, y=-10, z=-7>
<x=4, y=-8, z=8>
<x=3, y=5, z=-1>
"""
assert parse(input) == [
{{-1, 0, 2}, {0, 0, 0}},
{{2, -10, -7}, {0, 0,... |
089a1d250008d0c41f44896bf6266e30ea0d440e | 1,577 | [
45287848
] | [
"typespec",
"documented"
] | defmodule Excaliper.Type.JPEG do
@moduledoc false
@behaviour Excaliper.Type
alias Excaliper.Measurement
alias Excaliper.Page
@size_offset 2
@binary_size 9
@jpeg_header << 255, 216, 255 >>
@sofs [ 0xc0, 0xc1, 0xc2, 0xc3, 0xc5, 0xc6, 0xc7,
0xc9, 0xca, 0xcb, 0xcd, 0xce, 0xcf]
@spec valid?(b... |
089a3c035733bc028428601b9a9897d285319c88 | 1,809 | [
514687923
] | [] | defmodule Paginator.Mixfile do
use Mix.Project
@source_url "https://github.com/duffelhq/paginator"
@version "1.1.0"
def project do
[
app: :paginator,
name: "Paginator",
version: @version,
elixir: "~> 1.5",
elixirc_options: [warnings_as_errors: System.get_env("CI") == "true"],... |
089a69ca190f9116accdb6d64cf34307a4301ccd | 1,961 | [
185845061,
297695895
] | [
"ecto"
] | defmodule CloudRecording do
use Evercam.Schema
@required_fields [:camera_id, :frequency, :storage_duration, :status, :schedule]
schema "cloud_recordings" do
belongs_to :camera, Camera, foreign_key: :camera_id
field :frequency, :integer
field :storage_duration, :integer
field :status, :string
... |
089a909cc7d1e28d7add5873d67f81e09b030f94 | 5,292 | [
187056378
] | [
"test",
"ecto"
] | defmodule KPortal.AccountsTest do
use KPortal.DataCase
alias KPortal.Accounts
describe "users" do
alias KPortal.Accounts.User
@valid_attrs %{}
@update_attrs %{}
@invalid_attrs %{}
def user_fixture(attrs \\ %{}) do
{:ok, user} =
attrs
|> Enum.into(@valid_attrs)
... |
089b4623db4596f7b3ab4ef7356f00e623b4f484 | 1,733 | [
243540951
] | [
"typespec"
] | defmodule Ivy.LVar do
alias Ivy.Package
defstruct [:id, :name, :unique, :oname, meta: %{}]
@type t :: %__MODULE__{
id: term,
name: String.t,
unique: boolean,
oname: term,
meta: map()
}
@type new() :: t
def new() do
id = :erlang.monotonic_time()
%__MODULE__{
id: id,
... |
089b9ff2d944ad1a62e996ba0e8e953510ac807e | 2,244 | [
455626824,
649820731,
650257858,
694424020,
766739011,
795524762,
814180615,
958841350,
649810122,
823107166,
830219117,
1012816287,
649549605,
665825853,
727123157,
629809289,
669649865,
673162172,
816227461,
821210817,
879061702,
482996781,
649809999,
659908257,
695... | [
"test",
"phoenix"
] | defmodule BlogWeb.TagControllerTest do
use BlogWeb.ConnCase
import Blog.TagsFixtures
@create_attrs %{name: "some name"}
@update_attrs %{name: "some updated name"}
@invalid_attrs %{name: nil}
describe "index" do
test "lists all tags", %{conn: conn} do
conn = get(conn, ~p"/tags")
assert htm... |
089bcbb9ae9e8bd2a235c7a709fcf5e25b8fd88c | 3,701 | [
367278931
] | [
"documented"
] | defmodule Google.Cloud.Datalabeling.V1beta1.EvaluationJob.State do
@moduledoc false
use Protobuf, enum: true, protoc_gen_elixir_version: "0.14.1", syntax: :proto3
field :STATE_UNSPECIFIED, 0
field :SCHEDULED, 1
field :RUNNING, 2
field :PAUSED, 3
field :STOPPED, 4
end
defmodule Google.Cloud.Datalabeling... |
089cd05cfffbbc14b78a5c2a983a6ec9e3fec6c5 | 1,571 | [
293637920
] | [
"test"
] | defmodule SettleIt.GameServer.EngineTest do
use ExUnit.Case, async: true
alias SettleIt.GameServer.Engine
alias SettleIt.GameServer.State
describe "init/1" do
test "initializes a game state with the given ID" do
game_id = "game_123"
state = Engine.init(game_id)
assert %State.Game{id: ^ga... |
089d2e7c906ac959282ee24f01d7e57b6aaa69ba | 1,630 | [
523525903
] | [
"phoenix",
"ecto"
] | defmodule FinancerWeb.ReceitasController do
use FinancerWeb, :controller
alias Financer.Receitas
import Ecto.Query
def get_all(conn, _) do
lista = Receitas.get_all()
resp(conn, :ok, JSON.encode!(lista))
end
def get_by_id(conn, %{"id" => id}) do
retorno = Receitas.get_by_id(id)
resp(conn, :... |
089dcfe6ea245ec71b59fe64229cac9ea0e488a8 | 2,488 | [
105913697
] | [
"ecto"
] | # ---------------------------
## This script generates a school with random data and X number of classes, uploading a syllabii randomly from path Y.
## Args: [number_of_classes, path_to_syllabii]
# ---------------------------
import Ecto.Query
days_selection = ["M","T","W","Th","F"]
classes_num = String.to_integer(E... |
089dd5f435d64e6ad058e06eef38225b30e0ddcb | 3,204 | [
517816140,
704227222
] | [] | defmodule Sequence.Auth.Guardian do
use Guardian, otp_app: :sequence
use Guardian.Token.Verify
alias Sequence.{Users, Teams}
# generate guest token (used when guest user signing in with invite)
def guest_token(invite) do
encode_and_sign(nil, %{ guest: true, invite_id: invite.id, team_id: invite.team_id... |
089e3c1e8ca6215eb9bdafca42d296bb3c03f3de | 2,259 | [
606918732
] | [
"phoenix",
"ecto"
] | defmodule AceGraderWeb.SubmissionController do
use AceGraderWeb, :controller
alias AceGrader.Submissions
# alias AceGrader.Submissions.Submission
alias AceGrader.Exercises
# def index(conn, _params) do
# submissions = Submissions.list_submissions()
# render(conn, :index, submissions: submissions)
... |
089e4df421dcbf23144d38a35e478f40ac9d8e83 | 1,743 | [
75945600
] | [
"typespec"
] | defmodule Exreleasy.Release do
alias Exreleasy.Sys
alias Exreleasy.ReleaseDir
@spec path() :: String.t
def path do
Path.join(File.cwd!, dir())
end
@spec dir() :: String.t
def dir do
"release"
end
@spec archive_path() :: String.t
def archive_path do
Path.join(path(), "archive")
end
... |
089f3a4cb668046971e5ffe1cf20625acbe3e1f1 | 2,603 | [
528431347
] | [
"typespec",
"liveview"
] | defmodule ShuttertopWeb.AdminLive.Users do
use ShuttertopWeb, :live_component
require Logger
alias Shuttertop.Accounts
@spec render(any) :: Phoenix.LiveView.Rendered.t()
def render(assigns) do
ShuttertopWeb.AdminView.render("users.html", assigns)
end
def mount(socket) do
{:ok, socket}
end
... |
089f6388f16fbd96a8312ff9a7cdd692911d88ad | 3,128 | [
138734570
] | [
"documented"
] | defmodule Mix.Tasks.X509.TestServer do
@shortdoc "Runs a server for manual TLS client testing"
@moduledoc """
Runs a server for manual TLS client testing
mix x509.test_server
mix x509.test_server test.local
Please refer to the documentation for `X509.Test.Suite` for information about
the scenar... |
08a02c862b7cda926096b5d0bac8821953df028e | 3,301 | [
368023710
] | [
"documented",
"ecto"
] | defmodule Pantry.Orgs do
@moduledoc """
The Orgs context.
"""
import Ecto.Query, warn: false
alias Pantry.Repo
alias Pantry.Orgs.Hub
@doc """
Returns the list of hubs.
## Examples
iex> list_hubs()
[%Hub{}, ...]
"""
def list_hubs do
Repo.all(Hub)
end
@doc """
Gets a sin... |
08a04367ee7855048701381081b244ce45eb0327 | 2,455 | [
407245506
] | [
"liveview"
] | defmodule DepotDemoWeb.FileLive.Index do
use DepotDemoWeb, :live_view
alias DepotDemo.Files
alias DepotDemo.Files.File
@impl true
def mount(_params, _session, socket) do
{:ok, socket}
end
@impl true
def handle_params(params, _url, socket) do
{:noreply, apply_action(socket, socket.assigns.live... |
08a09454c9ba07248df5b337e67d7475f2555e42 | 1,514 | [
341394508
] | [] | defmodule Rocketpay.Accounts.Operation do
alias Ecto.Multi
alias Rocketpay.Account
def call(%{"id" => id, "value" => value}, operation) do
operation_name = accont_operation_name(operation)
Multi.new()
|> Multi.run(operation_name, fn repo, _changes -> get_account(repo, id) end)
|> Multi.run... |
08a0b6845ae33fca058792a0fc1a6494f16dee02 | 2,377 | [
787275701
] | [
"test",
"ecto"
] | defmodule V8betApi.BetStatusesTest do
use V8betApi.DataCase
alias V8betApi.BetStatuses
describe "bet_statuses" do
alias V8betApi.BetStatuses.BetStatus
import V8betApi.BetStatusesFixtures
@invalid_attrs %{deleted_at: nil, name: nil}
test "list_bet_statuses/0 returns all bet_statuses" do
... |
08a152c4e380418600f8a20866ef4e99925067b7 | 1,502 | [
58216426
] | [] | import Config
case config_env() do
:prod ->
# Configures Redis connection
# For a full list of configuration options, please see:
# https://hexdocs.pm/redix/Redix.html#start_link/1-connection-options
config :beebee,
:storage_backend,
{BeeBee.Storage.Redis,
[
... |
08a1d0171e5337efb06bc1787a00aeb25941329c | 2,556 | [
118212478
] | [
"documented"
] | defmodule Cadet.Autograder.Utilities do
@moduledoc """
This module defines functions that support the autograder functionality.
"""
use Cadet, :context
require Logger
import Ecto.Query
alias Cadet.Accounts.{CourseRegistration, TeamMember}
alias Cadet.Assessments
alias Cadet.Assessments.{Answer, As... |
08a1f51abb70273382dd4441cecebe5fe85b73d7 | 2,073 | [
832671725
] | [
"documented",
"ecto"
] | defmodule Backend.WorkingTimes do
@moduledoc """
The WorkingTimes context.
"""
import Ecto.Query, warn: false
alias Backend.Repo
alias Backend.WorkingTimes.WorkingTime
@doc """
Returns the list of working_times.
## Examples
iex> list_working_times()
[%WorkingTime{}, ...]
"""
def ... |
08a221a3dd8b3b480517015123d5930cf85a9403 | 2,143 | [
359098618
] | [
"documented"
] | defmodule TodoList.MixProject do
@moduledoc false
use Mix.Project
def project do
[
app: :todo_list,
dialyzer: dialyzer(),
version: "0.2.0",
elixir: ">= 1.11.0",
elixirc_paths: elixirc_paths(Mix.env()),
compilers: [:phoenix, :gettext] ++ Mix.compilers(),
start_permane... |
08a27806bc3a19c28d56267e75776f3ad031a63d | 5,652 | [
605242810
] | [
"macro",
"test",
"documented"
] | defmodule Lexical.Ast.EnvTest do
use ExUnit.Case, async: true
alias Lexical.Ast
import Lexical.Ast.Env
import Lexical.Test.CursorSupport
import Lexical.Test.Fixtures
def new_env(text, opts \\ []) do
opts = Keyword.merge([as: :document], opts)
project = project()
{position, document} = pop_cur... |
08a2d814c26c41bbf49690832218ce170bbbae7d | 1,820 | [
629567034
] | [
"test"
] | defmodule Intellex.AgentTest do
use ExUnit.Case
alias Intellex.{Agent, Chain, Message, Option, Toolkit, Tool}
setup do
Application.put_env(:openai, :api_url, "http://localhost:8082")
tools = [
%Tool{
name: "multiply",
description: "Multiplies two numbers",
options: [
... |
08a3a748c459b48766654f0433178d38b545403b | 2,345 | [
94012855
] | [
"test"
] | defmodule Teacher.Web.PostControllerTest do
use Teacher.Web.ConnCase
alias Teacher.Blog
@create_attrs %{body: "some body", title: "some title"}
@update_attrs %{body: "some updated body", title: "some updated title"}
@invalid_attrs %{body: nil, title: nil}
def fixture(:post) do
{:ok, post} = Blog.crea... |
08a3d075f404810062b8d2adfe0de6094e390a14 | 1,909 | [
317346892
] | [] | defmodule Day19 do
def expand_rule(rule, rules) do
case rule do
"a" -> "a"
"b" -> "b"
n when is_integer(n) -> expand_rule(Map.get(rules, n), rules)
l when is_list(l) -> Enum.map(l, &(expand_rule(&1, rules)))
end
end
def list_to_regex(list) do
Enum.map(li... |
08a4c37ee78259721412f5e40ca8893a3418a666 | 2,363 | [
950908301
] | [] | defmodule ElixirPack.Utils do
def otp_version do
major = :erlang.system_info(:otp_release) |> List.to_string()
vsn_file = Path.join([:code.root_dir(), "releases", major, "OTP_VERSION"])
try do
{:ok, contents} = File.read(vsn_file)
String.split(contents, "\n", trim: true)
else
[full]... |
08a4d01b87557448acc9e683ddd4b9a37cf95136 | 2,670 | [
189251630
] | [
"typespec",
"documented"
] | defmodule DotcomWeb.ScheduleController.Defaults do
@moduledoc """
Responsible for assigning:
headsigns: %{0 => [String.t], 1 => [String.t]
direction_id: 0 | 1
show_date_select?: boolean
"""
use Plug.Builder
alias Plug.Conn
alias Routes.Route
plug(:assign_direction_id)
plug(:as... |
08a523bbe4d26a8db55dc1cb3b0aca9a49d1954b | 2,187 | [
650700339
] | [
"phoenix"
] | defmodule ApiWeb.Api.V1_0.UserFavoriteView do
use ApiWeb, :view
alias ApiWeb.Api.V1_0.{UserView, UserFavoriteView}
def render("user_favorites.json", %{user_favorites: user_favorites}) do
data = render_many(user_favorites.entries, UserFavoriteView, "user_favorite.json", as: :user_favorite)
page_da... |
08a53f0202307a8859db0943ba6b79f4ffeceab0 | 7,985 | [
567950322
] | [
"typespec",
"documented"
] | defmodule Docker.Volume do
@moduledoc """
A representation of a Docker daemon volume and a bunch of functions for
dealing with volumes.
TODO: More information
## Raw Representation
Not all fields returned by the Docker daemon are provided on the
`Docker.Volume` data structure. Only a subset of fields ... |
08a5521919593ad899074ce70bcdc3ffeb16a60a | 11,031 | [
10878602
] | [
"typespec",
"documented"
] | defmodule Process do
@moduledoc """
This module provides convenience functions around processes and
the process dictionary. In Erlang, most of these functions are
auto-imported, but in Elixir they are grouped in a module for
convenience. Notice that these functions, different from Erlang's,
always return ni... |
08a5e779c8296c366aa440821a48c85de0c8c792 | 4,201 | [
737827999
] | [
"genserver",
"documented",
"phoenix"
] | alias AppAnimal.{Network,Cluster}
defmodule Network.CircularSubnet do
@moduledoc """
The portion of a `Network` that changes state as circular clusters
are started and stop.
This keeps track of the strength of throbbing clusters. It also sends messages
to them. This hides knowledge of strength inside this m... |
08a5f6b4ba62c8f9c1f15cae2d0af6e29e86c5da | 2,161 | [
916276031
] | [] | # 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 :live_svelte_pheonix,
ecto_repos: [LiveSvelt... |
08a61aa002a3cfc95e4c893af35b2912ddc36f43 | 2,120 | [
687507014
] | [] | # 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 :quest_trackr,
ecto_repos: [QuestTrackr.Repo... |
08a6552fe09e1b6c5d4a9d3259be1a3bd71eca5d | 2,296 | [
250869577
] | [
"test"
] | defmodule Riptide.Test.Interceptor do
defmodule Example do
use Riptide.Interceptor
def mutation_before(["creatures", key], %{merge: %{"key" => _}}, _mut, _state) do
{:combine,
Riptide.Mutation.put_merge(["creatures", key, "created"], :os.system_time(:millisecond))}
end
def mutation_afte... |
08a6c235a59e5787659d868902d837f8298db47d | 2,286 | [
114198035
] | [] | defmodule ConnectFour.Winner do
alias ConnectFour.{Board, Winner}
@down {-1, 0}
@right {0, +1}
@down_right {-1, +1}
@rise_right {+1, +1}
defstruct moves: [],
color: :empty
require Logger
def winner(%Board{last: nil}), do: nil
def winner(%Board{last: last} = board), do: winner(board, la... |
08a6c6f69c2b9d64e340ab6f507f1580e224cc41 | 1,741 | [
67804760
] | [
"test"
] | defmodule PhoenixSocial.UserSpec do
use ESpec.Phoenix, model: User, async: true
alias PhoenixSocial.User
describe "#full_name" do
it "shows both first & last name" do
user = %User{first_name: "John", last_name: "Doe"}
assert User.full_name(user) == "John Doe"
end
it "shows only the firs... |
08a73130d991a655bf474feeebd4d504d9c8c530 | 2,100 | [
50193794
] | [
"genserver",
"documented"
] | defmodule Stranger.Lobby do
@moduledoc ~S"""
Holds the IDs and Channel PIDs of all strangers in the lobby channel.
Monitors the Channel PID so that if the stranger leaves the channel
they're removed here.
"""
use GenServer
def start_link do
GenServer.start_link(__MODULE__, {%{}, %{}}, name: __MODUL... |
08a74cc7c85d7af37012e18af46b02c239a4314b | 17,899 | [
896128729
] | [
"typespec",
"liveview"
] | defmodule SECoPComponents do
use Phoenix.Component
alias Phoenix.LiveView.JS
alias Jason
alias SecopService.Util
import SecopServiceWeb.CoreComponents
attr :equipment_id, :string, required: true
attr :pubsub_topic, :string, required: true
attr :uuid, :string, required: true
attr :current, :boolean, ... |
08a79e8b5d7798a7bf0f266a590e08c063661948 | 1,785 | [
117610516,
56011329,
78030894
] | [
"documented"
] | defmodule ExTwitter.API.FriendsAndFollowers do
@moduledoc """
Provides friends and followers API interfaces.
"""
import ExTwitter.API.Base
def followers(options) when is_list(options) do
params = ExTwitter.Parser.parse_request_params(options)
request(:get, "1.1/followers/list.json", params)
|> E... |
08a80acb726094132db0f9adc354b94165131d06 | 1,646 | [
642300366
] | [] | %{
"amqp": {:hex, :amqp, "3.2.0", "51e85e06e4d283d98f21dce95906e42cb181fc7ceeb967b33b3be73d6ea41aa5", [:mix], [{:amqp_client, "~> 3.9.1", [hex: :amqp_client, repo: "hexpm", optional: false]}], "hexpm", "1439570336df6e79000239938fb055a0944dc9a768b4dec0af1375404508a014"},
"amqp_client": {:hex, :amqp_client, "3.9.29",... |
08a815a81a9351e4671825fe4e02f9a4dea107a4 | 1,790 | [
235695421,
360693141
] | [
"documented"
] | defmodule ExStoneOpenbank.Authenticator.AuthHTTPMiddleware do
@moduledoc """
A Tesla Middleware that ensures we always have a valid access_token.
This middleware implementation has a retryable approach. It tries the call with the current token
available. It might get a 401 at first and so, it calls for a refre... |
08a858bd675a2df8c5bc1635997d811d0c910913 | 9,574 | [
955558096
] | [
"liveview",
"documented",
"ecto"
] | defmodule SurveyEngine.Permissions do
@moduledoc """
The Permissions context.
"""
import Ecto.Query, warn: false
alias Ecto.Multi
alias SurveyEngine.Accounts
alias SurveyEngine.Repo
alias SurveyEngine.Permissions.PermissionAction
@doc """
Returns the list of permissions_actions.
## Examples
... |
08a89f8e1a11d04d6fad1e68dd642521120de2ff | 9,863 | [
367278931
] | [
"documented"
] | defmodule Google.Cloud.Discoveryengine.V1alpha.Answer.State do
@moduledoc false
use Protobuf, enum: true, protoc_gen_elixir_version: "0.14.1", syntax: :proto3
field :STATE_UNSPECIFIED, 0
field :IN_PROGRESS, 1
field :FAILED, 2
field :SUCCEEDED, 3
end
defmodule Google.Cloud.Discoveryengine.V1alpha.Answer.A... |
08a8b2261424263e9615e6c9e9bc6cae1dd63738 | 2,040 | [
132129868
] | [] | defmodule KekkaiGateway.Endpoint.Apps do
use Plug.Router
use Plug.ErrorHandler
require Logger
plug Plug.Parsers,
parsers: [:urlencoded, :json],
pass: ["text/*"],
json_decoder: Jason
plug :match
plug :dispatch
defmodule Parser do
defmodule ChildOpts do
import Simp... |
08a91bf458b9a1bf98415a8e5e6a2906b402c6b9 | 2,083 | [
422065563
] | [
"test",
"ecto"
] | defmodule Todoapp.TodosTest do
use Todoapp.DataCase
alias Todoapp.Todos
describe "todos" do
alias Todoapp.Todos.Todo
import Todoapp.TodosFixtures
@invalid_attrs %{completion_status: nil, description: nil, title: nil}
test "list_todos/0 returns all todos" do
todo = todo_fixture()
a... |
08a9450007e77a20923f2f1592078342cbc0479b | 2,942 | [
556731474
] | [
"test",
"phoenix"
] | defmodule TimeManagerWeb.WorkingTimeControllerTest do
use TimeManagerWeb.ConnCase
import TimeManager.WorkingTimesFixtures
alias TimeManager.WorkingTimes.WorkingTime
@create_attrs %{
end: ~U[2022-10-24 14:24:00.000000Z],
start: ~U[2022-10-24 14:24:00.000000Z]
}
@update_attrs %{
end: ~U[2022-10... |
08a9b2b7a469f6e4419213bbab75ae0793b02210 | 13,576 | [
80109208
] | [
"macro",
"test"
] | defmodule Membrane.Integration.AutoDemandsTest do
use ExUnit.Case, async: true
import Membrane.ChildrenSpec
import Membrane.Testing.Assertions
alias Membrane.Buffer
alias Membrane.Testing.{Pipeline, Sink, Source}
require Membrane.Pad, as: Pad
defmodule ExponentialAutoFilter do
use Membrane.Filter
... |
08aa253dea4201cd46540f87331ffe1a617414fe | 1,543 | [
427991680
] | [
"liveview",
"phoenix"
] | defmodule IlustratorWeb.Endpoint do
use Phoenix.Endpoint, otp_app: :ilustrator
# The session will be stored in the cookie and signed,
# this means its contents can be read but not tampered with.
# Set :encryption_salt if you would also like to encrypt it.
@session_options [
store: :cookie,
key: "_ilu... |
08aa60cb88951ccfea523170abebe06e501df2a3 | 4,017 | [
164356495
] | [
"test"
] | defmodule KojinTest do
use ExUnit.Case
import ExUnit.CaptureIO
doctest Kojin
doctest Kojin.Pod.EnumValue
doctest Kojin.Pod.PodEnum
doctest Kojin.Pod.PodArray
doctest Kojin.Pod.PodMap
doctest Kojin.Pod.PodField
doctest Kojin.Pod.PodType
doctest Kojin.Pod.PodTypeRef
doctest Kojin.Pod.PodTypes
doc... |
08aabe5cd4fd1d3c46e575dd19c9693092954bd2 | 2,409 | [
886833071
] | [
"liveview",
"phoenix"
] | defmodule PortfolioLandingWeb.Components.Sections.HeroComponent do
use Phoenix.Component
use PortfolioLandingWeb, :verified_routes
def hero(assigns) do
~H"""
<section class="flex items-center justify-center relative bg-black p-20">
<div class="container mx-auto px-6">
<div class="flex flex-... |
08aae0428bb50a26e2b839d5bdec6dc209a5a178 | 1,731 | [
236791899
] | [] | defmodule Prestige.MixProject do
use Mix.Project
def project do
[
app: :prestige,
version: "1.0.2",
elixir: "~> 1.8",
start_permanent: Mix.env() == :prod,
deps: deps(),
package: package(),
docs: docs(),
description: description(),
source_url: "https://githu... |
08ab130f94205f8c28fd876009ea84ee37c94966 | 9,524 | [
238263887
] | [] | %{
"bcrypt_elixir": {:hex, :bcrypt_elixir, "1.1.1", "6b5560e47a02196ce5f0ab3f1d8265db79a23868c137e973b27afef928ed8006", [:make, :mix], [{:elixir_make, "~> 0.4", [hex: :elixir_make, repo: "hexpm", optional: false]}], "hexpm"},
"certifi": {:hex, :certifi, "2.5.1", "867ce347f7c7d78563450a18a6a28a8090331e77fa02380b4a21... |
08abc63a3314a5688910c7ebb21e318781204131 | 1,753 | [
884802350
] | [
"test",
"ecto"
] | defmodule Practice.AuthTest do
use Practice.DataCase
alias Practice.Auth
describe "auth_users" do
alias Practice.Auth.User
import Practice.AuthFixtures
@invalid_attrs %{nickname: nil}
test "list_auth_users/0 returns all auth_users" do
user = user_fixture()
assert Auth.list_auth_us... |
08ac6a28661be2a3d30d52eac3308ce1f927df03 | 2,480 | [
858840679
] | [
"liveview",
"ecto"
] | defmodule OrdoWeb.App.ListLive.FormComponent do
use OrdoWeb, :live_component
alias Ordo.Tasks
@impl true
def render(assigns) do
~H"""
<div>
<.header>
<%= @title %>
<:subtitle>Use this form to manage list records in your database.</:subtitle>
</.header>
<.simple_form
... |
08aceb47ba90b0e6640f4aba5b7ee034082fee0d | 8,046 | [
603610250,
417119332,
558629623
] | [
"typespec",
"documented"
] | defmodule Pleroma.Web.ActivityPub.Publisher do
alias Pleroma.Activity
alias Pleroma.Config
alias Pleroma.Delivery
alias Pleroma.HTTP
alias Pleroma.Instances
alias Pleroma.Object
alias Pleroma.Repo
alias Pleroma.User
alias Pleroma.Web.ActivityPub.Relay
alias Pleroma.Web.ActivityPub.Transmogrifier
... |
08acf170b2fbbea2a56707bdaf7594b02fa989e8 | 3,556 | [
185615042
] | [
"test",
"ecto"
] | defmodule Elmore.LogManagerTest do
use Elmore.DataCase
alias Elmore.LogManager
describe "logs" do
alias Elmore.LogManager.Log
@valid_attrs %{activity: "some activity", application: "some application", event: "some event", event_value: "some event_value", extras: "some extras", parameters: "some paramet... |
08ad16e5a3f52e310063adf4c1db87dc3a3bde15 | 6,596 | [
193244709
] | [
"typespec",
"documented"
] | defmodule GoogleApi.Dialogflow.V3.Model.GoogleCloudDialogflowCxV3beta1Page do
@moduledoc """
A Dialogflow CX conversation (session) can be described and visualized as a state machine. The states of a CX session are represented by pages. For each flow, you define many pages, where your combined pages can handle a co... |
08ad2792964f3755d1c47958b967d8cdebfcfba1 | 6,834 | [
792241208,
319448136,
48907849,
603438628,
796226129,
279715065,
944124414,
780334795,
493863264
] | [
"test"
] | Code.require_file("../test_helper.exs", __DIR__)
Code.require_file("holocene.exs", __DIR__)
defmodule Date.RangeTest do
use ExUnit.Case, async: true
@asc_range Date.range(~D[2000-01-01], ~D[2001-01-01])
@asc_range_2 Date.range(~D[2000-01-01], ~D[2001-01-01], 2)
@desc_range Date.range(~D[2001-01-01], ~D[2000-0... |
08ad2eaab80fc7699309accca52c27ed426db1e1 | 12,124 | [
591405806
] | [
"typespec"
] | defmodule Cubes.Colors do
@spec as_map(%Cubes{size: String.t(), pieces: [%Cubes.Piece{}]}) :: map()
def as_map(%Cubes{size: size, pieces: pieces}) do
colors = Enum.reduce(pieces, %{}, &Map.put(&2, &1.position, &1.colors))
case size do
"2x2" ->
[
[h, s, x],
[e, r, a],
... |
08ad376f4809ba2b94d120392e482f71f633bd45 | 1,888 | [
225929449
] | [
"typespec",
"documented"
] | defmodule OAuthXYZ.Model.TransactionResponse do
@moduledoc """
Response Handling Module.
"""
alias OAuthXYZ.Model.Transaction
@type t :: %__MODULE__{}
defstruct [
# Next Step: Redirect
#! :string
:interaction_url,
#! :string
:server_nonce,
# Next Step: Device
#! :map
:u... |
08ad898bc60a6f3b8528fc42d80e4c5435fd7072 | 16,733 | [
823587427,
965126893
] | [
"documented"
] | defmodule Mix.Tasks.Mishka.Ui.Add do
use Igniter.Mix.Task
use GuardedStruct
alias GuardedStruct.Derive.ValidationDerive
@community_url "https://api.github.com/repos/mishka-group/mishka_chelekom_community/contents/"
@github_domains [
github: "github.com",
gist: "gist.github.com",
gist_content: "g... |
08adaa82528aa276fc931a3d6fb6bf22579b8e6b | 12,598 | [
689539389,
719407286,
477647394,
15848380
] | [
"typespec",
"documented"
] | defmodule FarmbotOS.Celery.SysCallGlue do
@moduledoc """
Behaviour for abstracting CeleryScript functionality.
"""
alias FarmbotOS.Celery.{AST, RuntimeError}
@sys_calls Application.compile_env(:farmbot, __MODULE__)[:sys_calls]
@sys_calls ||
Mix.raise("""
config :farmbot, FarmbotOS.Celery.SysCallGlu... |
08ae18ba4e722873ff375a1d82b2d52435269669 | 1,757 | [
820577848,
498766488
] | [
"test"
] | defmodule Electric.Replication.ChangesTest do
use ExUnit.Case, async: true
alias Electric.Replication.Changes.NewRecord
alias Electric.Replication.Changes.UpdatedRecord
alias Electric.Replication.Changes.DeletedRecord
doctest Electric.Replication.Changes, import: true
describe "UpdatedRecord.changed_colu... |
08ae2a8bb9a9e5b3069aaec7ce9b209e9903b04d | 5,536 | [
94881643
] | [
"documented",
"ecto"
] | defmodule Healthlocker.User do
use Healthlocker.Web, :model
alias Ecto.Multi
alias Comeonin.Bcrypt
schema "users" do
field :email, :string
field :password, :string, virtual: true
field :password_hash, :string
field :first_name, :string
field :last_name, :string
field :phone_number, :st... |
08ae56682d7651b082adc26f4aeb7a04baafe479 | 1,982 | [
263288400
] | [] | defmodule AdjustedTabular.HttpRouter do
use Plug.Router
require Logger
alias AdjustedTabular.Storage.Query
alias AdjustedTabular.Storage.Database, as: DB
plug(:match)
plug(:dispatch)
def child_spec(opts) do
%{
id: __MODULE__,
start: {__MODULE__, :start_link, [opts]},
type: :worker... |
08ae9931686d341269b1e595ff7b060bf228c920 | 1,907 | [
919884823
] | [
"phoenix"
] | defmodule EcommerceWeb.ProductController do
use EcommerceWeb, :controller
alias Ecommerce.Catalog
alias Ecommerce.Catalog.Product
alias Decimal
action_fallback EcommerceWeb.FallbackController
def index(conn, _params) do
products = Catalog.list_products()
render(conn, :index, products: products)
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.