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 |
|---|---|---|---|---|
064158a9506cc6cb92e03bb7920a8304114cd08e | 2,963 | [
612233696
] | [
"liveview"
] | defmodule LitcoversWeb.TransactionLive.Index do
use LitcoversWeb, :live_view
alias Litcovers.Payments
alias Litcovers.Payments.Yookassa
def mount(%{"locale" => locale}, _session, socket) do
Gettext.put_locale(locale)
{:ok, assign(socket, locale: locale, pay_options: pay_options(locale))}
end
def u... |
0641c1bb8dce6989b7c58205e6d5d17afb886a3f | 4,805 | [
744437650
] | [
"documented"
] | defmodule Brc.Implementation.Alpha do
@moduledoc """
A proposed implementation for solving the 1 billion row challenge.
This implementation reads the file into memory and stores it in :persistent_term.
When workers read chunks of the file from :persistent_term, no copy is made of the
chunk, which provides an ... |
0641f29af1ab94ffd9657a55862310ae76cbbac6 | 2,427 | [
629051932
] | [
"test"
] | defmodule Grid.Admin.Kiosk.SlideControllerTest do
use Grid.ConnCase
alias Grid.Slide
@valid_attrs %{name: "Slide Name", action_link: "http://test.com/book-it", action_label: "Book", photo_url: "http://test.com/image.jpeg", title: "some content", title_label: "some content"}
@invalid_attrs %{action_label: nil}
... |
06420924fbb992d30e2b2981ee0ac5d1e661bdae | 12,049 | [
318945858
] | [
"test"
] | defmodule Pleroma.Web.TwitterAPI.TwitterAPITest do
use Pleroma.DataCase
import Pleroma.Factory
alias Pleroma.Repo
alias Pleroma.Tests.ObanHelpers
alias Pleroma.User
alias Pleroma.UserInviteToken
alias Pleroma.Web.TwitterAPI.TwitterAPI
setup_all do
Tesla.Mock.mock_global(fn env -> apply(HttpRequestM... |
064216e9f09c6452e9007d7e1fe2aff9ff67c5a0 | 23,144 | [
409629199
] | [
"test"
] | defmodule MdTest do
use ExUnit.Case
doctest Md
doctest Md.Guards
test "leading spaces" do
assert %Md.Parser.State{
mode: [:finished],
ast: [
{:p, nil,
[
"he*llo ",
"\n",
{:b, nil, ["foo ", {:stron... |
06421a4ae6383d2f01326d39416e4bc818f0ba0e | 2,740 | [
897494196
] | [] | defmodule Advent2024.Day4 do
def read_file(path) do
case File.open(path, [:read]) do
{:ok, device} -> read_puzzle(device, 0, %{})
err -> err
end
end
defp read_puzzle(device, row, puzzle_coords) do
case IO.read(device, :line) do
:eof ->
# Part 1
# puzzle_coords
... |
06422e5dcc0126aaabf656446bea50bbe7dee7cc | 3,909 | [
433851838
] | [] | defmodule AdventOfCode.Day11 do
@monkey_parse_regex ~r/Monkey \d+:\n\W*Starting items: (?<starting_items>.*)\n\W*Operation: new = old (?<operation>.) (?<modifier>\w+)\n\W*Test: divisible by (?<divider>\w*)\n\W*If true: throw to monkey (?<true_target>\w*)\n\W*If false: throw to monkey (?<false_target>\w*)/
def pars... |
064317699d472daae886373e919d32bf726d8bbd | 2,006 | [
234111075
] | [] | defmodule Fizzbuzzex.MixProject do
use Mix.Project
def project do
[
app: :fizzbuzzex,
version: "0.1.0",
elixir: "~> 1.5",
elixirc_paths: elixirc_paths(Mix.env()),
compilers: [:phoenix, :gettext] ++ Mix.compilers(),
start_permanent: Mix.env() == :prod,
aliases: aliases(... |
064381d43b8f206826dd34507c22358c573855c9 | 1,713 | [
73477945
] | [
"macro",
"documented",
"ecto",
"phoenix"
] | defmodule TeamVacationTool.Web do
@moduledoc """
A module that keeps using definitions for controllers,
views and so on.
This can be used in your application as:
use TeamVacationTool.Web, :controller
use TeamVacationTool.Web, :view
The definitions below will be executed for every view,
contro... |
0643af21f913a7c721ad18c73483a118fad365f5 | 4,953 | [
271156947
] | [
"documented"
] | defmodule NimbleTemplate.Templates.Phoenix.Template do
@moduledoc false
import NimbleTemplate.{AddonHelper, GithubHelper}
alias NimbleTemplate.{Addons, Generator}
alias NimbleTemplate.Addons.Phoenix, as: PhoenixAddons
alias NimbleTemplate.Addons.Phoenix.Web, as: WebAddons
alias NimbleTemplate.Projects.Pro... |
0644842b94f9a1cfe447b05492d5578002da051f | 1,534 | [
193244709,
101434552,
198908023
] | [
"typespec",
"documented"
] | defmodule GoogleApi.DataMigration.V1beta1.Model.ListConnectionProfilesResponse do
@moduledoc """
Response message for 'ListConnectionProfiles' request.
## Attributes
* `connectionProfiles` (*type:* `list(GoogleApi.DataMigration.V1beta1.Model.ConnectionProfile.t)`, *default:* `nil`) - The response list of co... |
0644b90be987b47f25e68ae1239fe04eee47f41b | 1,542 | [
98358981
] | [
"macro",
"test",
"documented"
] | defmodule CodebattleWeb.ConnCase do
@moduledoc """
This module defines the test case to be used by
tests that require setting up a connection.
Such tests rely on `Phoenix.ConnTest` and also
import other functionality to make it easier
to build and query models.
Finally, if the test case interacts with t... |
0644c2f037b8b0b167c267e670c07ec59213687e | 2,070 | [
193244709,
101434552,
198908023
] | [
"typespec",
"documented"
] | defmodule GoogleApi.CloudAsset.V1.Model.GoogleIdentityAccesscontextmanagerV1IngressSource do
@moduledoc """
The source that IngressPolicy authorizes access from.
## Attributes
* `accessLevel` (*type:* `String.t`, *default:* `nil`) - An AccessLevel resource name that allow resources within the ServicePerimet... |
06451d770dc9f0b44c32630b346e5dee85ce87d1 | 7,459 | [
182166437
] | [] | %{
"artificery": {:hex, :artificery, "0.4.2", "3ded6e29e13113af52811c72f414d1e88f711410cac1b619ab3a2666bbd7efd4", [:mix], [], "hexpm"},
"certifi": {:hex, :certifi, "2.5.1", "867ce347f7c7d78563450a18a6a28a8090331e77fa02380b4a21962a65d36ee5", [:rebar3], [{:parse_trans, "~>3.3", [hex: :parse_trans, repo: "hexpm", opti... |
0645637abb934df64bd4ab01d6227e5983f77bcb | 1,999 | [
621210169
] | [
"documented"
] | defmodule Cards do
# moddule Documentation
@moduledoc """
Provides methods for creating and handling a deck of cards
"""
#funtion documentation this deals with a specific function and what it does
@doc"""
Returns a list of strings representing a deckof playing cards
"""
def create_deck do
values= ["Ace"... |
0645c2dd4e1ae67e4560bff1beb4ba29c67e978d | 1,731 | [
115751654,
117305725,
120836354,
228308394,
116902741,
117114985,
117301263,
117414829,
121099893,
113956009,
121318872,
103569528,
117378187,
118397994,
117451365,
145635147,
115170667,
117610516,
121081121,
121188479,
114048299,
115417830,
121399547,
119208322,
1210... | [
"typespec",
"documented"
] | defmodule Gettext.PO.PluralTranslation do
@moduledoc """
A struct that holds information on a plural translation.
This struct describes a translation which has a plural form, such as the one
in the following snippet of `.po` file:
msgid "There was an error"
msgid_plural "There were %{count} errors... |
0645d18063931edbf4877f99c6e1a768ddeca2b0 | 1,951 | [
30474240
] | [] | defmodule FibSolver do
def fib(scheduler) do
send scheduler, { :ready, self }
receive do
{ :fib, n, client } ->
send client, { :answer, n, fib_calc(n), self }
fib(scheduler)
{ :shutdown } ->
exit(:normal)
end
end
# very inefficient, deliberately
defp fib_calc(0)... |
0645eb3002a0d3740f1613a87b46c152c417c96c | 4,588 | [
146636103
] | [
"typespec",
"documented"
] | defmodule Texting.Formatter do
alias Timex
@doc """
Convert user's phone number to correct format
ex) 12345678911
used in /dashboard/sms
return phonenumber as list to send sms
"""
@spec phone_number_to_list(String.t) :: list
def phone_number_to_list(phone_numbers) do
phone_numbers
|> String.s... |
0645fa02300d926a15e2f46194d2bf3022885fc1 | 1,793 | [
942811655,
920024200
] | [
"test"
] | defmodule Guard.Store.User.Test do
use Guard.RepoCase, async: true
alias Guard.Store, as: GS
alias Guard.Repo, as: GR
setup do
Support.Guard.Store.clear!()
:ok
end
describe "update" do
test "method should return user" do
{:ok, user} =
GS.User.update(
"ee2e6241-f30b-48... |
0646a99cefe2a01b6f46b4d8a99ffe773ca4750a | 3,353 | [
270842782
] | [
"ecto"
] | defmodule UserDocsWeb.StepLive.FormComponent.Helpers do
alias UserDocs.Automation
alias UserDocs.Web
alias UserDocs.Web.AnnotationForm
alias UserDocs.Automation.StepForm
def handle_enabled_fields(%Ecto.Changeset{} = changeset, state) do
changeset
|> maybe_update_enabled_step_fields(state)
|> mayb... |
064735ac25d2e9cbae5eca6e66b951be38e9be0c | 2,104 | [
121997216
] | [
"test"
] | defmodule Todo.List.Test do
use ExUnit.Case
setup do
{
:ok,
todo_list: Todo.List.new,
entries: [
%{ date: {2017, 09, 10}, title: "New Entry"},
%{ date: {2017, 09, 11}, title: "New Entry 2"},
%{ date: {2017, 09, 12}, title: "New Entry 3"}
]
}
end
test "ca... |
064737384386c880edeb9f69f6db10ee5fb66db2 | 2,396 | [
132670620
] | [
"typespec"
] | defmodule BlueJet.Balance.Card.Proxy do
use BlueJet, :proxy
alias BlueJet.Balance.StripeClient
alias BlueJet.Balance.Card
@spec sync_to_stripe_card(Card.t()) :: {:ok, map} | {:error, map}
def sync_to_stripe_card(card = %{stripe_card_id: nil, source: source})
when not is_nil(source) do
create_strip... |
06481bfe9bbe4ab10d4596ccf1bece345fe48e8a | 5,194 | [
103326971
] | [] | %{
"certifi": {:hex, :certifi, "2.8.0", "d4fb0a6bb20b7c9c3643e22507e42f356ac090a1dcea9ab99e27e0376d695eba", [:rebar3], [], "hexpm", "6ac7efc1c6f8600b08d625292d4bbf584e14847ce1b6b5c44d983d273e1097ea"},
"ex_gram": {:hex, :ex_gram, "0.24.1", "ca7c5e6a9b4e4574f31e7ee94eed42b5c6961e84855ff700db6f1cab945c3d4e", [:mix], [... |
06483503cc412ede56d054750b42b293d7c1bdb7 | 4,601 | [
35786176
] | [
"genserver",
"documented"
] | defmodule ExGoPiGo.Board do
use GenServer
use Bitwise
require Logger
@moduledoc """
Handles communicating with the GoPiGo board.
"""
# The device's address.
@gopigo_board_address 0x08
@read_enc_status_cmd 53 # Read encoder status TODO: unused
@timeout_status_cmd 82 # Read the timeout status TOD... |
06488aa13e86eca24cac4c23575ebc4d8c234334 | 7,194 | [
744281225,
116826798,
313251367
] | [
"typespec",
"documented",
"phoenix"
] | defmodule AdminAPI.V1.TransactionController do
@moduledoc """
The controller to serve transaction endpoints.
"""
use AdminAPI, :controller
import AdminAPI.V1.ErrorHandler
alias Ecto.{Changeset, Query}
alias EWallet.{
AccountPolicy,
TransactionPolicy,
TransactionGate,
ExportGate,
Adapt... |
0648c5233ab781a4d0a2e37126e2fd600dd29560 | 2,456 | [
77131803
] | [
"typespec",
"documented"
] | defmodule Jerboa.Format.Header.Type do
@moduledoc false
alias Jerboa.Format.UnknownMethodError
alias Jerboa.Params
alias Jerboa.Format.Meta
defmodule Class do
@moduledoc """
The STUN message classes
"""
@typedoc """
Either a request, indication, success or failure response
"""
@... |
0649097e1070d381917fd5134471576618a0b840 | 2,263 | [
459126913
] | [
"genserver",
"liveview"
] | defmodule NidmWeb.PauseLive do
use NidmWeb, :live_view
alias Nidm.{ Users, Networks }
alias Nidm.GenServers.Cache
require Logger
def mount(_params, session, socket) do
# get user_id from session
%{ "user_id" => user_id } = session
# get user and network
user = User... |
06490e9518b71b7c8b43c7b8e283eddb3d5ec35a | 2,984 | [
317569460
] | [
"test"
] | defmodule Aoc2020.Day7Test do
use ExUnit.Case
alias Aoc2020.Day7
@part1_example [
"light red bags contain 1 bright white bag, 2 muted yellow bags.",
"dark orange bags contain 3 bright white bags, 4 muted yellow bags.",
"bright white bags contain 1 shiny gold bag.",
"muted yellow bags contain 2 s... |
064925546d4f802c8930790127a4d0eb60b2325d | 3,103 | [
203007965
] | [
"typespec",
"documented"
] | defmodule Markdown do
@doc """
Parses a given string with Markdown syntax and returns the associated HTML for that string.
## Examples
iex> Markdown.parse("This is a paragraph")
"<p>This is a paragraph</p>"
iex> Markdown.parse("#text!\n* __Bold Item__\n* _Italic Item_")
"<h1>text!</h1><ul><... |
0649c7ad87bf95c563e8789a33397fde67e5b485 | 1,917 | [
206006397
] | [
"ecto"
] | defmodule ApigatewayWeb.FormSubmit.Sendmail2 do
use Bamboo.Phoenix, view: ApigatewayWeb.FormView
alias ApigatewayWeb.FormSubmit.Mailer
def send_emails(form_) do
new_email()
|> put_from(form_)
#|> from("<EMAIL>")
|> put_to(form_)
|> bcc("<EMAIL>")
|> put_subject(form_)
|> put_to(form_)... |
064a2da552f0a75bab8399969f64fff291f6d37c | 1,700 | [
572659054
] | [] | defmodule Meta.Saga.MixProject do
use Mix.Project
def project do
[
app: :saga_v2,
version: "0.1.0",
elixir: "~> 1.10",
start_permanent: Mix.env() == :prod,
aliases: aliases(),
deps: deps()
]
end
# Run "mix help compile.app" to learn about applications.
def applica... |
064a42112f573d70422377654473a993488f1bfb | 3,323 | [
83909386
] | [
"phoenix"
] | defmodule MinitwitterWeb.Auth do
import Plug.Conn
import Phoenix.Controller
alias Minitwitter.Accounts
alias MinitwitterWeb.Router.Helpers, as: Routes
@max_age 7 * 24 * 60 * 60
def init(opts), do: opts
def call(conn, _opts) do
user_id = get_session(conn, :user_id)
cond do
user = conn.as... |
064a6dfe1ca6aa7353863072670eee47f64ee90e | 1,765 | [
164156164
] | [] | defmodule Hackathon.Router do
use Plug.Router
import Jason
alias Hackathon.Blink
alias Hackathon.Savestate
alias Hackathon.LedManager
#Implement plug interface
plug(:match)
plug Plug.Parsers, parsers: [:json],
pass: ["application/json"],
json... |
064aa9e0f8dc262e84ff3d7b7fffb5dbc585d29a | 6,401 | [
664716838
] | [
"test",
"documented"
] | defmodule Unit.Store.KvSchemaTest do
alias LambdaEthereumConsensus.Store.Db
alias LambdaEthereumConsensus.Store.KvSchema
use ExUnit.Case
defmodule TupleSchema do
@moduledoc """
Schema with tuples as keys and lists as value, using erlang native encoding for both keys
and values.
The prefix begi... |
064acc64486d94709cf55861c9743c423bd4ef50 | 1,546 | [
120443725,
48701042,
565421534
] | [
"ecto"
] | defmodule Changelog.Repo.Migrations.RenameChannelsToTopics do
use Ecto.Migration
def change do
# channels -> topics
rename table(:channels), to: table(:topics)
# episode channels -> episode topics
drop index(:episode_channels, [:channel_id])
drop unique_index(:episode_channels, [:episode_id, :... |
064aeabbaec3be9e488e1665c223e43b8a941d4f | 1,709 | [
650700339
] | [
"typespec",
"documented",
"ecto"
] | defmodule Data.Schema.Package do
@moduledoc """
The schema for Subscription
"""
use Data.Schema
@derive Noizu.ERP
@derive Tanbits.Shim
@derive Noizu.EctoEntity.Protocol
@type t :: %__MODULE__{
id: binary,
name: String.t,
handle: String.t,
... |
064b1655d0e65844776dbc10a1671c98e5419240 | 1,892 | [
282569895,
90960584,
90126087
] | [
"test"
] | import :erlang, only: [list_to_binary: 1]
defmodule XmlTest do
use ExUnit.Case
use EQC.ExUnit
require Record
Record.defrecord :xmlel, Record.extract(:xmlel, from: "include/fxml.hrl")
property "Can serialize arbitrary XML packets" do
forall xml_chunk <- xml_el do
is_binary(:fxml.element_to_binar... |
064b54e8074189ef6655e7dac2f5efe80acc41d4 | 2,399 | [
571338984
] | [
"phoenix"
] | defmodule SpectrumWeb.Router do
use SpectrumWeb, :router
use AshAuthentication.Phoenix.Router
import SpectrumWeb.UserAuth
import SpectrumWeb.SpotifyAuth
pipeline :browser do
plug :accepts, ["html"]
plug :fetch_session
plug :fetch_live_flash
plug :put_root_layout, html: {SpectrumWeb.Layouts, :... |
064c54fb783916b4e67ddb1c7cfda8912f6e0d60 | 1,734 | [
331367724
] | [
"genserver",
"liveview"
] | defmodule TweeterWeb.PostLive.Index do
use TweeterWeb, :live_view
alias Tweeter.Timeline
alias Tweeter.Timeline.Post
@impl true
def mount(_params, _session, socket) do
if connected?(socket), do: Timeline.subscribe()
{:ok, assign(socket, :posts, list_posts()), temporary_assigns: [posts: []]}
end
... |
064c8bcddd2e2e2e06d42be1bcd507d4274f6587 | 2,767 | [
675599677
] | [
"test",
"phoenix"
] | defmodule CachingProxyDemoWeb.MarvelCharacterControllerTest do
use CachingProxyDemoWeb.ConnCase, async: true
import Mox
alias CachingProxyDemo.Utils.Urls
alias CachingProxyDemo.Marvel.Page, as: MarvelPage
alias CachingProxyDemo.MarvelMock
setup :verify_on_exit!
describe "index" do
test "renders th... |
064d2ac833d7e55db5098f92dc982b5799bccc6d | 2,159 | [
61313974
] | [
"test"
] | defmodule BlackjackCardTest do
use ExUnit.Case
doctest Blackjack.Card
alias Blackjack.Card
describe "Blackjack.Card.score/1" do
test "basic cards" do
cards = [%Card{rank: 4, suit: :hearts}, %Card{rank: 10, suit: :hearts}]
assert Card.score(cards) == {14, :hard}
end
test "count face ca... |
064d3cae1cbb89b5dccfdde7e827ad034f0727b3 | 1,575 | [
262525711
] | [
"genserver",
"liveview",
"phoenix"
] | defmodule RealtimeWeb.PageLive do
use RealtimeWeb, :live_view
alias Realtime.Store
alias RealtimeWeb.Presence
@impl true
def mount(_params, _session, socket) do
presence_topic = "page:home"
if connected?(socket) do
Store.subscribe()
Store.inc_value(:views)
end
data = Store.get()... |
064d6a227b5871720757dfda865b4ab9f24f1d87 | 10,695 | [
203534763
] | [
"test",
"documented"
] | defmodule Membrane.RTP.VP9.PayloadDescriptorTest do
use ExUnit.Case
alias Membrane.RTP.VP9.PayloadDescriptor
alias Membrane.RTP.VP9.PayloadDescriptor.{SSDimension, ScalabilityStructure, PGDescription}
describe "VP9 Payload Descriptor parser" do
test "payload too short" do
payload = <<184>>
asse... |
064dbbcf40b13e5bbee11968245d42fc8135917a | 1,906 | [
575220063
] | [
"typespec",
"documented"
] | defmodule CozyTelemetry.Reporter do
@moduledoc """
The application which reports metrics.
This module also defines a behaviour for declaring reporters.
"""
require Logger
alias CozyTelemetry.Spec
@type init_arg :: keyword()
@type child_spec() :: %{
id: term(),
start: term(),
... |
064dfcb6d6dd4cb891e67082516b02b76fc005d9 | 2,587 | [
716854204
] | [
"liveview",
"phoenix"
] | defmodule PentoWeb.GameLive.Component do
use Phoenix.Component
import PentoWeb.GameLive.Colors
alias Pento.Game
@width 10
attr :x, :integer, required: true
attr :y, :integer, required: true
attr :fill, :string
attr :name, :string
attr :"phx-click", :string
attr :"phx-value", :string
attr :"phx-... |
064e067bb7c4b7f29137e44565a060dd71faff12 | 1,998 | [
601751028
] | [
"documented"
] | defmodule Anagrammar do
@moduledoc """
Example code from this arcticle:
https://samuelmullen.com/articles/elixir-processes-send-and-receive
"""
# When missing, install with: sudo apt install wngerman wamerican
@dictionary_de "/usr/share/dict/ngerman"
@dictionary_en "/usr/share/dict/american-english"
... |
064ed6233c84c80fd2a31ec004ed43388d558724 | 2,044 | [
820039745
] | [
"test",
"ecto"
] | defmodule DeGymApp.ToolContextTest do
use DeGymApp.DataCase
alias DeGymApp.ToolContext
describe "tools" do
alias DeGymApp.ToolContext.Tool
import DeGymApp.ToolContextFixtures
@invalid_attrs %{amount: nil, brand: nil, name: nil}
test "list_tools/0 returns all tools" do
tool = tool_fixtur... |
064f0596e3484ecc212b3d64e4d4039acf0259f0 | 3,760 | [
498675807
] | [
"test"
] | defmodule Yardi.Gateway.GetRentRollCase do
use AppCount.Case
alias AppCount.Support.HTTPClient
@moduletag :yardi_gateway_rent_roll
@get_rent_roll File.read!(
Path.expand(
"../../resources/Yardi/rent_roll.xml",
__DIR__
)
... |
064f26e08be1bfb7412c7167dfe7436ddcf09f8a | 2,483 | [
286092482
] | [
"test"
] | defmodule UkCovid19Test do
use ExUnit.Case
alias UkCovid19.Request
alias UkCovid19.Client
describe "api_params" do
test "build_request integrity" do
request = request()
filters = request.filters |> Enum.join(";")
structure =
request.structure
|> Enum.map_intersperse(","... |
064f5fc12632780c24f74d2bd551fcdfa7ee3909 | 1,606 | [
729664552
] | [
"phoenix"
] | defmodule TodoProjectWeb.TodoApiController do
use TodoProjectWeb, :controller
alias TodoProject.TodoContext
alias TodoProject.TodoContext.Todo
alias TodoProject.StatusContext
alias TodoProject.StatusContext.Status
alias TodoProject.CategoryContext
alias TodoProject.CategoryContext.Category
alias TodoPr... |
064fb37de612d611ecf0605e3cce31f6734f3de4 | 11,743 | [
431619536
] | [] | %{
"certifi": {:hex, :certifi, "2.9.0", "6f2a475689dd47f19fb74334859d460a2dc4e3252a3324bd2111b8f0429e7e21", [:rebar3], [], "hexpm", "266da46bdb06d6c6d35fde799bcb28d36d985d424ad7c08b5bb48f5b5cdd4641"},
"connection": {:hex, :connection, "1.1.0", "ff2a49c4b75b6fb3e674bfc5536451607270aac754ffd1bdfe175abe4a6d7a68", [:mi... |
064fc1a73b0d031542660547603a6bde25e8b300 | 1,978 | [
342369232
] | [
"typespec",
"documented"
] | defmodule Score.Exporter do
@moduledoc """
This module is responsible for creating files that will be uploaded to the client
"""
alias Score.Statistics
@file_path "tmp"
@file_name "report"
@type csv_encoded :: String.t()
@type file_path :: String.t()
@type encoded_content :: String.t()
@type en... |
064fc68743bab36ae123a4081953a3e0c4155026 | 1,696 | [
120765292
] | [
"typespec"
] | defmodule Tres.SecureChannelState do
use Bitwise
defstruct(
handler_pid: nil,
handler_ref: nil,
ref: nil,
socket: nil,
transport: nil,
buffer: "",
ip_addr: nil,
port: "",
datapath_id: "",
aux_id: "",
timer_ref: nil,
xid: nil,
main_monitor_ref: nil,
ping_xid: ... |
06500223b25c992f7ddb4f18666b3b7c9918a8fb | 3,531 | [
918591164
] | [
"liveview"
] | defmodule TuneshgWeb.AlbumLive.FormComponent do
use TuneshgWeb, :live_component
@impl true
def render(assigns) do
~H"""
<div>
<.header>
{@title}
<:subtitle>Use this form to manage album records in your database.</:subtitle>
</.header>
<.simple_form
for={@form}
... |
06502d9ef73e7110c3d6a15cc287734709f9b115 | 1,786 | [
224722361
] | [] | defmodule GetRanges do
def run(sorted_list, target) do
with first when is_integer(first) <- binary_search(sorted_list, target, 0,
tuple_size(sorted_list) - 1, true),
last when is_integer(last) <- binary_search(sorted_list, target, 0,
tuple_size(sorted_l... |
06507c08f298fcef51db09bd19cf0a25cb695dd0 | 2,586 | [
102617237
] | [
"phoenix",
"ecto"
] | defmodule RumblWeb.VideoController do
use RumblWeb, :controller
alias Rumbl.Content
alias Rumbl.Content.Video
alias Rumbl.Category
alias Rumbl.Repo
require Logger
plug :scrub_params, "video" when action in [:create, :update]
plug :load_categories when action in [:new, :create, :edit, :update]
def ... |
0651153519a44196fd12fe76d2b77e8b12d25308 | 9,556 | [
143184715
] | [
"test"
] | defmodule CliAdminFuncTest do
use ExUnit.Case
doctest Snapex7
setup do
# checar como cambiar esto para que use :code.priv_dir
snap7_dir = :code.priv_dir(:snapex7) |> List.to_string()
System.put_env("LD_LIBRARY_PATH", snap7_dir)
System.put_env("DYLD_LIBRARY_PATH", snap7_dir)
executable = :code... |
06514b75603e36a6180f61a3ff3f18a3e4c6c2fd | 2,760 | [
136992346
] | [
"typespec",
"documented"
] | defmodule Tensorflow.DataType do
@moduledoc false
use Protobuf, enum: true, syntax: :proto3
@type t ::
integer
| :DT_INVALID
| :DT_FLOAT
| :DT_DOUBLE
| :DT_INT32
| :DT_UINT8
| :DT_INT16
| :DT_INT8
| :DT_STRING
| :... |
065157704ef7958b47b931c3fef81db6b548473b | 1,864 | [
39919111
] | [
"typespec",
"documented"
] | defmodule FinTex.Command.InitiateSEPACreditTransfer do
@moduledoc false
alias FinTex.Controller.InitiatePayment
alias FinTex.Controller.Synchronization
alias FinTex.Data.AccountHandler
alias FinTex.Helper.Command
alias FinTex.Model.Credentials
alias FinTex.Model.SEPACreditTransfer
alias FinTex.Segment.... |
06518618078066b7278bd8456c3515955fabd018 | 4,085 | [
518470225
] | [] | %{
"benchee": {:hex, :benchee, "1.1.0", "f3a43817209a92a1fade36ef36b86e1052627fd8934a8b937ac9ab3a76c43062", [:mix], [{:deep_merge, "~> 1.0", [hex: :deep_merge, repo: "hexpm", optional: false]}, {:statistex, "~> 1.0", [hex: :statistex, repo: "hexpm", optional: false]}], "hexpm", "7da57d545003165a012b587077f6ba90b89210... |
0651cf07e65890ce268c296d97e1bbcfdb5e673e | 1,774 | [
726156112
] | [] | %{
"elixir_uuid": {:hex, :elixir_uuid, "1.2.1", "dce506597acb7e6b0daeaff52ff6a9043f5919a4c3315abb4143f0b00378c097", [:mix], [], "hexpm", "f7eba2ea6c3555cea09706492716b0d87397b88946e6380898c2889d68585752"},
"jason": {:hex, :jason, "1.4.1", "af1504e35f629ddcdd6addb3513c3853991f694921b1b9368b0bd32beb9f1b63", [:mix], [... |
06540198db904776f8f604853a7ad952e818412b | 3,139 | [
296761924
] | [
"test",
"phoenix"
] | defmodule BeepbopskeetWeb.AnnouncementControllerTest do
use BeepbopskeetWeb.ConnCase
alias Beepbopskeet.Admin
@create_attrs %{body: "some body"}
@update_attrs %{body: "some updated body"}
@invalid_attrs %{body: nil}
def fixture(:announcement) do
{:ok, announcement} = Admin.create_announcement(@create... |
065410fc9383ba1a187ea83a1d975e263c06a5fe | 1,580 | [
968629600
] | [
"liveview"
] | defmodule DemoWeb.UpdatingContentLive do
use DemoWeb, :live_view
def mount(_params, _session, socket) do
socket = create_cards(socket)
{:ok, socket}
end
defp card(assigns) do
~H"""
<div
phx-click="toggle_card"
phx-value-id={@id}
class="w-full mx-2 p-2 rounded-lg bg-white bord... |
0654441302cee933ffd0a27fada23b057692ad2e | 1,852 | [
573898222
] | [
"phoenix",
"ecto"
] | defmodule ProjetophxWeb.ProdutoController do
use ProjetophxWeb, :controller
alias Projetophx.Mercado
alias Projetophx.Mercado.Produto
def index(conn, _params) do
produto = Mercado.list_produto()
render(conn, "index.html", produto: produto)
end
def new(conn, _params) do
changeset = Mercado.cha... |
06554054fa5bb64847ceeaf89e7fbe3226e72a1c | 14,428 | [
519690576
] | [
"typespec",
"documented"
] | defmodule Cordial.Parsers.GRPC do
@moduledoc ~S"""
Protocol buffer and gRPC parser.
"""
alias Cordial.Definition.Enum, as: GEnum
alias Cordial.Definition.{Message, Package, Parser, Service, Type}
alias Cordial.Definition.Parser.Context
import Cordial.Definition.Resource
defguard global(ctx) when ctx.cu... |
06554db01eea03072c06adbeb2f196ca0d0e9449 | 1,685 | [
239822890,
419435907,
376959663,
459291087
] | [
"documented"
] | defmodule Oli.Delivery.Gating.ConditionTypes.Started do
@moduledoc """
Started strategy provides a condition that requires a source resource to have at least
one attempt present.
"""
alias Oli.Delivery.Gating.GatingCondition
alias Oli.Delivery.Gating.GatingConditionData
alias Oli.Delivery.Gating.Conditio... |
065560d8545d64704ae104c075b27d3d68cc2c36 | 14,045 | [
367278931
] | [
"documented"
] | defmodule Google.Cloud.Aiplatform.V1.GenerateContentResponse.PromptFeedback.BlockedReason do
@moduledoc false
use Protobuf, enum: true, protoc_gen_elixir_version: "0.14.1", syntax: :proto3
field :BLOCKED_REASON_UNSPECIFIED, 0
field :SAFETY, 1
field :OTHER, 2
field :BLOCKLIST, 3
field :PROHIBITED_CONTENT... |
06558546477c891aef5043ede82f647522b90efe | 1,589 | [
433525038
] | [
"typespec"
] | defmodule Aoc2021.Day17 do
def try_run(v, x, t), do: if t < x, do: try_run(v-1,x, t+v), else: { v, t }
def yvrange(vx, x0, x1, _y0, y1, td) when td >= x0 and td <= x1 do
xsmin = vx - trunc(:math.sqrt((td-x0)*2))
for ys <- trunc(y1/xsmin + (xsmin-1)/2 - 1)..(-y1), into: [], do: {vx, ys}
end
def yvrange(v... |
0655867c2a13d41a92ce0c5b47d965c8e13ce2f4 | 1,814 | [
530964368
] | [
"macro",
"documented",
"phoenix"
] | defmodule EnergexWeb 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 EnergexWeb, :controller
use EnergexWeb, :view
The definitions below will be executed for every view,
controller, ... |
0655b1974d36a8254ec2ae31146ba2a86870ae12 | 2,393 | [
588226575,
980529497,
930000513
] | [
"genserver",
"documented"
] | defmodule Supavisor.MetricsCleaner do
@moduledoc false
use GenServer
require Logger
@interval :timer.minutes(30)
@name __MODULE__
def start_link(args),
do: GenServer.start_link(__MODULE__, args, name: @name)
def clean do
GenServer.cast(@name, :clean)
end
def init(_args) do
Logger.info... |
0656aa7ea907d62f1d0da9f727b475d74ebb337c | 2,776 | [
298304814
] | [] | defmodule YoutubeScraper.VideosSlow do
use Crawly.Spider
@impl Crawly.Spider
def base_url(), do: "https://www.youtube.com"
@impl Crawly.Spider
def init(),
do: [start_urls: ["https://www.youtube.com/channel/UCYogOW28QIQdfvfY5KyzDsw/videos?pbj=1"]]
@impl Crawly.Spider
def parse_item(response) do
... |
0656ab3fcf41d77ea71a599312a69525874d33a4 | 2,503 | [
213941143
] | [
"phoenix"
] | defmodule StepFlow.WorkflowDefinitionController do
use StepFlow, :controller
use BlueBird.Controller
import Plug.Conn
alias StepFlow.Controller.Helpers
alias StepFlow.WorkflowDefinitions
alias StepFlow.WorkflowDefinitions.WorkflowDefinition
require Logger
action_fallback(StepFlow.FallbackController)
... |
0656c2be0726ecdce42e78c9ebde3486b395656d | 8,187 | [
193244709,
101434552,
198908023
] | [
"typespec",
"documented"
] | defmodule GoogleApi.MerchantAPI.Reports_v1beta.Model.ProductView do
@moduledoc """
Fields available for query in `product_view` table. Products in the current inventory. Products in this table are the same as in Products sub-API but not all product attributes from Products sub-API are available for query in this ta... |
0656cd38b6ef772f4a156a87702a3f5a44dc9a8d | 1,805 | [
99339937
] | [] | defmodule SurveyTool.Mixfile do
use Mix.Project
def project do
[
app: :survey_tool,
deps: deps(),
docs: [
main: "SurveyTool",
extras: ["README.md"]
],
elixir: "~> 1.15",
escript: escript(),
name: "Survey Tool",
preferred_cli_env: [
coveral... |
0656e1bede1788dec8aadde36c133e339f60f1c3 | 4,353 | [
795278462
] | [
"documented",
"ecto"
] | defmodule Faucet.Storage.Source.Record do
@moduledoc false
# ----------------------------------------------------------------------------
# Module Uses
# ----------------------------------------------------------------------------
use Faucet.Types
use Ecto.Schema
# --------------------------------------... |
0656eab7117d65eaf6981631e1642fc3b57ac093 | 14,856 | [
295364482
] | [] | ExUnit.start()
defmodule Movies.Actor.Name, do: use(Neo.Event)
defmodule Movies.Actor.Born, do: use(Neo.Event)
defmodule Movies.Actor.Died, do: use(Neo.Event)
defmodule Movies.Movie.Title, do: use(Neo.Event)
defmodule Movies.Movie.Year, do: use(Neo.Event)
defmodule Movies.Movie.Director, do: use(Neo.Event)
defmodule M... |
0658adf5cee8bf14b81223239a547af4a856dd77 | 20,326 | [
455872535
] | [
"typespec",
"documented",
"ecto"
] | defmodule Explorer.Chain.Import.Runner.InternalTransactions do
@moduledoc """
Bulk imports `t:Explorer.Chain.InternalTransactions.t/0`.
"""
require Ecto.Query
require Logger
alias Ecto.Adapters.SQL
alias Ecto.{Changeset, Multi, Repo}
alias Explorer.Chain.{Block, Hash, Import, InternalTransaction, Pend... |
06590689cc9e882ec94288094669dae93fa60dae | 2,210 | [
427477354,
423903017
] | [
"test",
"phoenix"
] | defmodule TimeManagerWeb.TeamControllerTest do
use TimeManagerWeb.ConnCase
import TimeManager.ManagementFixtures
alias TimeManager.Management.Team
@create_attrs %{
}
@update_attrs %{
}
@invalid_attrs %{}
setup %{conn: conn} do
{:ok, conn: put_req_header(conn, "accept", "application/json")}
... |
065948bbf0bd0fa1575ea0995a92b469e3dfb92b | 2,242 | [
260359165
] | [] | defmodule FaithfulWord.MixProject do
use Mix.Project
def project do
[
app: :faithful_word,
version: "0.1.0",
build_path: "../../_build",
compilers: [:phoenix, :gettext] ++ Mix.compilers(),
config_path: "../../config/config.exs",
deps_path: "../../deps",
lockfile: "../.... |
065a7cf9c02db016b5cd47b705f7f2124b38415c | 1,593 | [
123647612,
736703649
] | [
"macro",
"documented",
"phoenix"
] | defmodule TodomvcWeb 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 TodomvcWeb, :controller
use TodomvcWeb, :view
The definitions below will be executed for every view,
controller, ... |
065ab5361f92f93cc97bc6a090f633f77b3a18a4 | 2,334 | [
166485069
] | [] | defmodule TodoServer do
def start do
spawn(fn -> loop(TodoList.new()) end)
end
def add_entry(todo_server, new_entry) do
send(todo_server, {:add_entry, new_entry})
end
def entries(todo_server, date) do
send(todo_server, {:entries, self(), date})
receive do
{:todo_entries, entries} -> e... |
065ac06b98ad9efa4e29855ebc4b2bcaddd07b70 | 12,214 | [
98930418,
331176930
] | [
"genserver",
"documented",
"ecto"
] | defmodule LtsePoc.Exchange.Trade.BrokerWorker do
@moduledoc """
This is the worker process for a given stock. This will be a singleton to avoid any race conditions or moving to a locking structure for transactions outside of the beam vm. Trying to do everything in memory.
We can probably do some optimization with... |
065b8b1435c4b999856611fe229ad5e8eea75b9b | 2,156 | [
200539858
] | [
"test",
"ecto"
] | defmodule PromoCode.Promo_codesTest do
use PromoCode.DataCase
alias PromoCode.Promo_codes
describe "promo_codes" do
alias PromoCode.Promo_codes.Promo_code
@valid_attrs %{"amount" => 42, "is_active" => true}
@update_attrs %{"amount" => 43, "is_active" => false}
@invalid_attrs %{"amount" => nil, ... |
065baf5f06c3ffaa8ba0e5dd30b89df62c587bf7 | 3,307 | [
186827713
] | [
"phoenix",
"ecto"
] | defmodule StatWatchWeb.ProfileController do
use StatWatchWeb, :controller
alias StatWatch.Core
alias StatWatch.Core.Profile
plug :logged_in_user when not action in [:new, :create, :show]
plug :correct_user when action in[:edit, :update, :delete]
def index(%{assigns: %{admin_user: true}} = ... |
065bce6a640f0c3237da631162a0831dacfce3b2 | 6,086 | [
571776611
] | [
"genserver",
"macro",
"documented"
] | defmodule Pleroma.Migrators.Support.BaseMigrator do
@moduledoc """
Base background migrator functionality.
"""
@callback perform() :: any()
@callback retry_failed() :: any()
@callback feature_config_path() :: list(atom())
@callback query() :: Ecto.Query.t()
@callback fault_rate_allowance() :: ... |
065c7913935757c191dd9c1399aedb6d6773a515 | 11,966 | [
125414041,
126745773,
131530086,
133927323,
135370449,
134501845,
136631125,
186736544,
117414829,
124564174,
128071537,
129443092,
117378187,
124607641,
130589196,
136527959,
125190595,
126547151,
129655759,
136191275,
123640456,
125464988,
128415216,
128720212,
1180... | [
"typespec",
"macro",
"phoenix",
"documented"
] | defmodule Phoenix.Socket do
@moduledoc ~S"""
Defines a socket and its state.
`Phoenix.Socket` is used as a module for establishing and maintaining
the socket state via the `Phoenix.Socket` struct.
Once connected to a socket, incoming and outgoing events are routed to
channels. The incoming client data is ... |
065d1280097129c0d550b4be90df3bea62c0a3b5 | 3,038 | [
726160220
] | [
"documented"
] | defmodule Day3 do
@moduledoc """
Documentation for `Day3`.
"""
def get_data do
File.read!("./source.txt")
|> String.split(~r/\R/)
|> Enum.with_index()
end
def is_valid_number?(data, %{line: line, char_index: char_index, length: length}, true) do
symbol_detector = ~r/[^\.\d]/
{prev_lin... |
065d868026129ca98482d7093db7083aadcf7b7b | 4,022 | [
105224445
] | [
"test",
"ecto"
] | defmodule Treelib.ContributionsTest do
use Treelib.DataCase
alias Treelib.Contributions
import Treelib.Factory
describe "contributors" do
alias Treelib.Contributions.Contributor
@valid_attrs %{
description: "some description",
first_name: "some first_name",
last_name: "some last_na... |
065d887f9baf4523200d83657e3d7990ececcfea | 6,241 | [
546864000
] | [
"macro",
"documented"
] | defmodule Pegasus.Ast do
@moduledoc false
import NimbleParsec
@enforce_keys [:name]
defstruct @enforce_keys ++ [:extract, start_pos?: false, parsec: empty()]
@dummy_context %{parsec: empty()}
def to_nimble_parsec({:ok, list, "", _, _, _}, opts) do
to_nimble_parsec(list, opts)
end
def to_nimble_... |
065ec23cc774de7fdf8ee855f31da9a1a3d4334e | 6,459 | [
1011804364
] | [
"documented"
] | defmodule ToyRobot.Simulation do
alias ToyRobot.{Robot, Table}
defstruct [:table, :robot]
alias __MODULE__, as: Simulation
@doc """
Simulates placing a robot on a table.
## Examples
### When the robot is placed in a valid position:
iex> alias ToyRobot.{Robot, Table, Simulation}
[ToyRobot.Robot, To... |
065eca0055c7b3ad46754fc6f0674d2b7581ce73 | 3,016 | [
350709271
] | [
"test",
"ecto"
] | defmodule Griffin.Accounts.CredentialTest do
use Griffin.DataCase
alias Griffin.Accounts.Credential
describe "credential_wechats" do
alias Griffin.Accounts.Credential.CredentialWechat
@valid_attrs %{meta: %{}, openid: "some openid", unionid: "some unionid"}
@update_attrs %{meta: %{}, openid: "some ... |
065f23a67230c3985fafd4fdf1c9694047556d9f | 9,439 | [
285782233
] | [
"typespec",
"documented"
] | # credo:disable-for-this-file
defmodule ExAliyunOts.TableStoreTunnel.Error do
@moduledoc false
defstruct code: nil, message: nil, tunnel_id: nil
(
(
@spec encode(struct) :: {:ok, iodata} | {:error, any}
def encode(msg) do
try do
{:ok, encode!(msg)}
rescue
e in ... |
065f44469d300775525e548ac3a397a38bd059f3 | 1,635 | [
422727631
] | [
"liveview",
"phoenix"
] | defmodule AssignmentWeb.Endpoint do
use Phoenix.Endpoint, otp_app: :assignment
# 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: "_ass... |
065f5a617e3097440f0fde4bbf57bf41310f1335 | 4,238 | [
390166925
] | [
"documented"
] | defmodule Game.Session.CreateAccount do
@moduledoc """
Creating an account workflow
Asks for basic information to create an account.
"""
alias Game.Account
alias Game.Class
alias Game.Config
alias Game.Race
alias Game.Session.Login
alias Game.Socket
alias Metrics.PlayerInstrumenter
alias Web.E... |
065f6e1acc032ea2fc2d9ebed34d243bd862cf81 | 3,506 | [
134963600
] | [
"genserver",
"typespec"
] | defmodule Procon.MessagesProducers.WalDispatcherProducer do
use GenServer
require Logger
@spec register_name(any, any, any) :: atom
def register_name(datastore, topic, partition),
do: :"wal_dispatcher_producer_#{datastore}_#{topic}_#{partition}"
def start_link(state) do
GenServer.start_link(__MODULE... |
065f9300e63aad5727be2858c8fc27cbc231889b | 1,903 | [
263635458
] | [
"macro",
"documented",
"phoenix"
] | defmodule PhoenixApiWeb 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 PhoenixApiWeb, :controller
use PhoenixApiWeb, :view
The definitions below will be executed for every view,
con... |
065fe04fdeb8cd877d4deb554a24f00afa92d9e1 | 1,712 | [
230958990
] | [
"typespec",
"documented"
] | defmodule Hexadecimal do
@invalid_hex 0
@hex_table %{
"0" => 0,
"1" => 1,
"2" => 2,
"3" => 3,
"4" => 4,
"5" => 5,
"6" => 6,
"7" => 7,
"8" => 8,
"9" => 9,
"A" => 10,
"B" => 11,
"C" => 12,
"D" => 13,
"E" => 14,
"F" => 15
}
@doc """
Accept a stri... |
065ff2acc07741fa15851645991f935be1039f40 | 3,115 | [
639664225
] | [
"supervisor",
"documented"
] | defmodule ArrgWeb.Telemetry do
@moduledoc """
Basic `:telementry` configuration for observability for the application.
"""
use Supervisor
import Telemetry.Metrics
@doc false
def start_link(arg) do
Supervisor.start_link(__MODULE__, arg, name: __MODULE__)
end
@doc false
@impl Supervisor
def ... |
066062d83727ebb32b4290cafbdf44f95029df10 | 3,740 | [
468342684
] | [
"phoenix",
"ecto"
] | defmodule DbserviceWeb.SessionScheduleController do
use DbserviceWeb, :controller
import Ecto.Query
alias Dbservice.Repo
alias Dbservice.SessionSchedules
alias Dbservice.Sessions.SessionSchedule
action_fallback(DbserviceWeb.FallbackController)
use PhoenixSwagger
alias DbserviceWeb.SwaggerSchema.Sess... |
0660f72bbd80a9f3eb12dd4a9fe8669ed5cac080 | 2,008 | [
151396743
] | [] | use Mix.Config
# For development, we disable any cache and enable
# debugging and code reloading.
#
# The watchers configuration can be used to run external
# watchers to your application. For example, we use it
# with brunch.io to recompile .js and .css sources.
config :phoenix_on_adminlte, PhoenixOnAdminlteWeb.Endpo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.