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 |
|---|---|---|---|---|
034b39f344b09f34e9ddfccfe739dd23a33a63f9 | 1,908 | [
844733583
] | [
"typespec",
"documented"
] | defmodule LagoClient.WalletCreateInputWalletRecurringTransactionRules do
@moduledoc """
Provides struct and type for a WalletCreateInputWalletRecurringTransactionRules
"""
use LagoClient.Encoder
@type t :: %__MODULE__{
__info__: map,
expiration_at: DateTime.t() | nil,
granted_cr... |
034b5924e5449d29424f664616a0434e393956fd | 2,771 | [
314918786
] | [
"liveview",
"ecto"
] | defmodule LiveviewPlaygroundWeb.PostLive.FormComponent do
use LiveviewPlaygroundWeb, :live_component
alias LiveviewPlayground.Timeline
alias LiveviewPlayground.Timeline.Post
@impl true
def mount(socket) do
{:ok,
socket
|> assign(:uploaded_files, [])
|> allow_upload(:photo,
accept: ~w(.... |
034b7a1f723fe0b5d6872f6841cd0a23f852e84d | 2,329 | [
323320595
] | [
"documented"
] | defmodule Grax.Schema.LinkProperty.Union do
@moduledoc false
defstruct [:types]
alias Grax.Schema.Inheritance
alias Grax.InvalidResourceTypeError
alias RDF.Description
def new(class_mapping) do
{:ok, %__MODULE__{types: normalize_class_mapping(class_mapping)}}
end
defp normalize_class_mapping(cla... |
034b7fee8ee00c97638b491950a335f87456548f | 2,395 | [
122170032
] | [
"typespec",
"documented"
] | defmodule MatchEngine do
@external_resource "README.md"
@moduledoc "README.md"
|> File.read!()
|> String.split("<!-- MDOC !-->")
|> Enum.fetch!(1)
alias MatchEngine.{Query, Score, Scoring}
@type query() :: [operator_pair] | map()
@type operator_pair() :: {operator(), ... |
034b9f8b3fc4f029bbd3585ccbee684712920355 | 9,671 | [
997913144
] | [
"documented"
] | defmodule Track.Exchanges.BitmexState do
defstruct [:balance, :positions, :margin_info, :open_orders]
alias Track.Accounts.Scope
alias Track.BitmexClient
alias Track.CurrencyConverter
alias Decimal
def new() do
%__MODULE__{
balance: %{
usd: 0,
sats: 0,
btc: 0
},
... |
034bad8e109993082be8f2333529ade623fb38d0 | 5,182 | [
290934484,
48860943
] | [
"macro",
"documented"
] | defmodule Absinthe.Relay.Mutation.Notation.Modern do
@moduledoc """
Convenience macros for Relay Modern mutations.
(If you want `clientMutationId` handling, see `Absinthe.Relay.Mutation.Notation.Classic`!)
The `payload` macro can be used by schema designers to support mutation
fields that receive either:
... |
034bfabb4d8ba93fac0aef5292fe0499d02f96b6 | 2,420 | [
613712731
] | [
"genserver"
] | defmodule Week3.LoadBalancer do
use GenServer
require Logger
@nr_of_workers 3
@max_requests_per_node 100
@min_requests_per_node 50
@min_workers 3
def start_link() do
GenServer.start_link(__MODULE__, {0, %{}}, name: __MODULE__)
end
def init(state) do
Logger.info("LoadBalancer is running...")... |
034c67fc189cfe0c09a26524b568884e8e404a88 | 2,265 | [
512946406
] | [] | %{
"earmark_parser": {:hex, :earmark_parser, "1.4.26", "f4291134583f373c7d8755566122908eb9662df4c4b63caa66a0eabe06569b0a", [:mix], [], "hexpm", "48d460899f8a0c52c5470676611c01f64f3337bad0b26ddab43648428d94aabc"},
"ex_doc": {:hex, :ex_doc, "0.28.4", "001a0ea6beac2f810f1abc3dbf4b123e9593eaa5f00dd13ded024eae7c523298",... |
034c69f05bf98aeab38e77796f50373864b26ea3 | 10,035 | [
763575502
] | [] | import Config
import Dotenvy
############################
### Static configuration ###
############################
config :ssl, protocol_version: [:"tlsv1.3", :"tlsv1.2"]
config :logger,
handle_otp_reports: true,
handle_sasl_reports: false
config :logger, :console,
format: "$time $metadata[$level] $message\n... |
034cbe418122260446aaf5b4df29709a650ebcd8 | 3,688 | [
211706625
] | [
"typespec",
"documented"
] | defmodule B2Destillator.Operations.B2UploadFile do
require Logger
####################################
## PUBLIC API
####################################
@typedoc """
The "upload_error" contains one of the following errors:
- :bad_request
- :unauthorized
- :cap_exceeded
- :you_pleb
- :request_time... |
034cd2168633fedd7f185af18d5bfc07f87b9295 | 1,777 | [
271156947
] | [
"documented"
] | defmodule NimbleTemplate.Templates.Mix.Template do
@moduledoc false
import NimbleTemplate.{AddonHelper, GithubHelper}
alias NimbleTemplate.Addons
alias NimbleTemplate.Projects.Project
def pre_apply(%Project{} = project), do: install_addon_prompt(project, Addons.Mimic)
def apply!(%Project{} = project) do... |
034cd54c48595dffa7847a997b460e67e53492e7 | 2,024 | [
193244709,
101434552,
198908023
] | [
"typespec",
"documented"
] | defmodule GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Fact do
@moduledoc """
The fact used in grounding.
## Attributes
* `query` (*type:* `String.t`, *default:* `nil`) - Query that is used to retrieve this fact.
* `score` (*type:* `float()`, *default:* `nil`) - If present, according to the unde... |
034cfe4cc07c80bd5d49c5012f91dc658252e3bd | 3,053 | [
425210182
] | [
"liveview",
"ecto"
] | defmodule LurraWeb.Components.DownloadDataForm do
use Surface.LiveComponent
alias Surface.Components.Form
alias Surface.Components.Form.{Label, Field, DateTimeLocalInput, NumberInput, Checkbox}
alias Surface.Components.Link
alias LurraWeb.Components.EcoObserver
alias LurraWeb.Router.Helpers, as: Routes
... |
034d72d8d77407edc610036ff379344f11770919 | 2,525 | [
389482453
] | [
"test"
] | defmodule TextBasedFPS.Game.RoomPlayerTest do
alias TextBasedFPS.Game.RoomPlayer
use ExUnit.Case, async: true
test "dead?/1" do
room_player = RoomPlayer.new("foo")
assert RoomPlayer.dead?(put_in(room_player.health, 0)) == true
assert RoomPlayer.dead?(put_in(room_player.health, 1)) == false
end
... |
034da28701167fc87cdd087332601c0bf5d4dfe1 | 2,146 | [
307980195
] | [] | defmodule Bund.MixProject do
use Mix.Project
def project do
[
app: :bund,
version: "0.1.0",
preferred_cli_env: ["white_bread.run": :test],
elixir: "~> 1.5",
elixirc_paths: elixirc_paths(Mix.env()),
compilers: [:phoenix, :gettext] ++ Mix.compilers(),
start_permanent: Mi... |
034e27ed494429da24f3baf7554856cb8a8d4c25 | 2,139 | [
141326215
] | [
"genserver",
"documented"
] | defmodule Marvin.RiverGaugeMonitor do
@doc """
Get the last 2 hours of data for [USGS Instantaneous Values API](https://waterservices.usgs.gov/rest/IV-Service.html)
for river gauging stations local to ValleyCamp, North Bend WA on a 5-minute interval.
https://waterservices.usgs.gov/nwis/iv/?sites=12144500,121420... |
034e4ea430ad115b0ace5e72466e1e9167175d44 | 1,813 | [
297293200
] | [
"liveview",
"ecto"
] | defmodule LocallyWeb.ProductCategoryLive.FormComponent do
use LocallyWeb, :live_component
alias Locally.Market
@impl true
def update(%{product_category: product_category} = assigns, socket) do
changeset = Market.change_product_category(product_category)
{:ok,
socket
|> assign(assigns)
... |
034e9b779b796c8ffe877587ec1df07d89158990 | 2,460 | [
771848544
] | [
"liveview"
] | defmodule EcoServiceWeb.EcoServiceLive.EditCommunityComponent do
use EcoServiceWeb, :live_component
alias EcoService.EcoServiceContext
def render(assigns) do
~H"""
<div>
<h1 class="text-center font-bold text-2xl"> <%= @title %> </h1>
<.simple_form :let={form} for={%{}} phx-target={@myself} ... |
034f3027d77265621c7c4c9f3a7072df4d168ca2 | 1,636 | [
357138874
] | [] | # In this file, we load production configuration and secrets
# from environment variables. You can also hardcode secrets,
# although such is generally not recommended and you have to
# remember to add this file to your .gitignore.
import Config
database_url =
System.get_env("DATABASE_URL") ||
raise """
envir... |
034f8fb96c06f1214917a974f2c54f3a8f6d78bc | 1,814 | [
98185781
] | [
"typespec",
"documented"
] | defmodule Codebattle.Tournament.Clans do
@moduledoc false
alias Codebattle.Tournament
alias Codebattle.Tournament.Storage.Clans
@spec add_players_clan(tournament :: Tournament.t(), player :: Tournament.Player.t()) :: :ok
def add_players_clan(tournament, %{clan_id: nil}) do
Clans.put_clans(tournament, [%{... |
034f9add4fc80176bb32ef93c1272a56adb983ac | 2,980 | [
925518254
] | [
"test"
] | defmodule BasicElixirTest do
use ExUnit.Case
doctest BasicElixir
test "greets the world" do
assert BasicElixir.hello() == :world
end
test "basic data type" do
number = 100
string = "hello"
boolean = true
float = 2.5
atom = :this_is_an_atom
assert number == 100
assert string ... |
034f9d9b8ed37d3163b6f008edc604c3177c7dca | 1,946 | [
745022208
] | [
"typespec",
"supervisor",
"documented"
] | defmodule Broadcaster.Application do
# See https://hexdocs.pm/elixir/Application.html
# for more information on OTP Applications
@moduledoc false
use Application
@version Mix.Project.config()[:version]
@spec version() :: String.t()
def version(), do: @version
@impl true
def start(_type, _args) do
... |
034fbf8c42946568c44bc992b8d37b1d00116357 | 5,677 | [
177639712
] | [
"test"
] | defmodule StatusTest do
use ExUnit.Case
doctest Status
describe "when board is empty" do
setup do
%{
initial_board: %{
{0, 0} => 1,
{0, 1} => 2,
{0, 2} => 3,
{1, 0} => 4,
{1, 1} => 5,
{1, 2} => 6,
{2, 0} => 7,
{2, 1... |
0350019453a7f764a4c5feeaff200ed83b060de1 | 1,937 | [
163780407
] | [
"documented",
"ecto"
] | defmodule Mockatron.Core.Agent do
use Ecto.Schema
import Ecto.Changeset
@regex_path_params_exists ~r"<[^/]+>"
@regex_path_params ~r/<([[:alnum:]_]+?(?=>))>|<([[:alnum:]_]+):(.+?(?=>))>/
schema "agents" do
field :content_type, :string
field :host, :string
field :method, :string
field :operati... |
035020b778a9fbccc824939e310d8f254d95bc12 | 2,701 | [
118831655
] | [
"test"
] | defmodule Procore.Resources.ObservationItemsTest do
use ExUnit.Case
alias Procore.ResponseResult
alias Procore.Resources.ObservationItems
test "list/1 with default API version" do
client = Procore.client()
params = %{"project_id" => 1}
assert %ResponseResult{reply: :ok, status_code: 200, parsed_bo... |
03503208eb34588c20f0832b2f3606d84dbcb8c1 | 1,933 | [
335160944
] | [
"supervisor"
] | defmodule TelluridePipeline.TelemetryBroadwayManager do
use DynamicSupervisor
alias Broadway.Message
alias TelluridePipeline.{TelemetryBroadwayWorker, TelemetryMetrics}
################################################################################
# Client interface
#####################################... |
0350418a3c1ce2be3cb4d2832d44b74d42575918 | 2,486 | [
925303255
] | [
"test"
] | defmodule FDBC.Tuple.ExtensionTest do
use ExUnit.Case, async: true
alias FDBC.Tuple
alias FDBC.Tuple.Extension
defmodule Datetime do
use Extension
alias FDBC.Tuple
@datetime_typecode 0x40
def decode(<<@datetime_typecode, length::integer-size(8)>> <> encoded) do
{value, encoded} =
... |
0350c7f5a50e1659fff961660de827a12d342803 | 2,347 | [
294012314
] | [
"liveview",
"macro",
"documented",
"phoenix"
] | defmodule LivestudyWeb 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 LivestudyWeb, :controller
use LivestudyWeb, :view
The definitions below will be executed for every view,
contro... |
0350fcaca095f0ba960a1a4c1aca721ac6cdc02e | 3,225 | [
205245370
] | [] | defmodule Day8 do
def run_part1() do
AOCHelper.read_input()
|> Executor.supervised_execution()
end
def run_part2() do
AOCHelper.read_input()
|> Executor.mutating_execution()
end
def debug_sample() do
[
"nop +0",
"acc +1",
"jmp +4",
"acc +3",
"jmp -3",
... |
035166477ce5e91c31647d10dc2a01f785e323c2 | 2,543 | [
83909386
] | [
"phoenix",
"ecto"
] | defmodule MinitwitterWeb.UserController do
use MinitwitterWeb, :controller
alias Minitwitter.Accounts
alias Minitwitter.Accounts.User
alias Minitwitter.Microposts.Post
alias MinitwitterWeb.Email
alias Minitwitter.Mailer
alias Minitwitter.Microposts
plug :authenticate_user when action in [:index, :edit... |
03519ba28f321bca105357195268a0a12dad3497 | 2,144 | [
596355424
] | [] | # 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 :repository,
ecto_repos: [Repository.Repo]
... |
035206fc0db1cd916424b3020f5e8d033d2871f1 | 4,458 | [
203504477
] | [
"documented"
] | defmodule DataStructureEx.Tree do
defstruct val: 0, left: nil, right: nil
@doc """
Check whether or not the val exists
## Examples
iex> tree = %DataStructureEx.Tree{val: 10}
iex> DataStructureEx.Tree.member?(tree, 5)
false
iex> tree = %DataStructureEx.Tree{val: 10, left: %DataStructureEx.Tre... |
03521a19e8654433d106f5f2a3821cd690c6eae7 | 2,470 | [
756929967
] | [] | %{
"earmark": {:hex, :earmark, "1.4.4", "4821b8d05cda507189d51f2caeef370cf1e18ca5d7dfb7d31e9cafe6688106a4", [:mix], [], "hexpm", "1f93aba7340574847c0f609da787f0d79efcab51b044bb6e242cae5aca9d264d"},
"earmark_parser": {:hex, :earmark_parser, "1.4.37", "2ad73550e27c8946648b06905a57e4d454e4d7229c2dafa72a0348c99d8be5f7"... |
0352e66b7582e99e72c4adefd8f937e4666d2549 | 5,545 | [
942811655,
920024200
] | [] | defmodule Front.Superjerry do
defmodule Behaviour do
@callback list_flaky_tests(
org_id :: String.t(),
project_id :: String.t(),
page :: Integer.t(),
page_size :: Integer.t(),
sort_field :: String.t(),
sort_dir :: Stri... |
0352f8e99b30bd564964035c24179a229d5f5ce3 | 2,006 | [
283740357
] | [
"documented"
] | defmodule Still.Compiler.TemplateHelpers.ContentTag do
@moduledoc """
Implements an arbitrary content tag with the given content.
"""
@doc """
Renders an arbitrary HTML tag with the given content.
If `content` is `nil`, the rendered tag is self-closing.
`opts` should contain the relevant HTML attribute... |
0353313a608ae903b17e5666703183c0df7eb1de | 1,575 | [
1016921944
] | [
"liveview",
"phoenix"
] | defmodule WazuhWeb.Endpoint do
use Phoenix.Endpoint, otp_app: :wazuh
# 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: "_wazuh_key",
... |
03535ed7398af1709950a871c389bf17b15ba563 | 2,438 | [
394817300
] | [
"documented",
"ecto"
] | defmodule Milk.Bottles do
@moduledoc """
The Bottles context.
"""
import Ecto.Query, warn: false
alias Milk.Repo
alias Milk.Bottles.Bottle
def is_empty(%Bottle{filled_at: time}), do: is_nil(time)
def is_expired(%Bottle{filled_at: time}) do
# Bottle expires three days from its filling
expiry_... |
0353bb60eb61a313c9e81e163d82d35b1dd91a82 | 4,414 | [
165115442
] | [
"test"
] | defmodule Logflare.Backends.Adaptor.IncidentioAdaptorTest do
use Logflare.DataCase, async: false
alias Logflare.Backends.Adaptor
alias Logflare.Backends
alias Logflare.Backends.AdaptorSupervisor
alias Logflare.SystemMetrics.AllLogsLogged
alias Logflare.Alerting
@subject Logflare.Backends.Adaptor.Inciden... |
0353e2a2e6317bfc4b6278722844781396fbd279 | 1,627 | [
997941789
] | [
"documented"
] | defmodule Issues.CLI do
@default_count 4
@moduledoc """
Handle the command line parsing and the dispatch to
the various functions that end up generating a
table of the last _n_ issues in a github project
"""
def main(argv) do
argv
|> parse_args()
|> process()
end
def parse_args(argv) do... |
0353e84d9bc08df4ce5f8604ed17b44cc48b5313 | 1,685 | [
382477914
] | [
"typespec",
"documented"
] | defmodule Mobius.Exports.CSV do
@moduledoc false
@type export_opt() ::
{:metric_name, binary()}
| {:tags, [atom()]}
| {:type, Mobius.metric_type()}
| Mobius.Exports.csv_export_opt()
@doc """
Export metrics to a CSV
"""
@spec export_metrics([Mobius.metric()], [export... |
0353f1150161105c80c4922ce60a0e0d2e7a5d57 | 3,400 | [
403183500
] | [
"genserver",
"typespec",
"documented"
] | defmodule Deutexrium.Server.Voice do
@moduledoc """
Communicates with the Node Voice Server:
- gets recognized sentences from it
- asks it to say things
"""
use GenServer
require Logger
alias Deutexrium.Server.{RqRouter, Channel}
@triggers [
"slash say",
"slash generate",
"бот скажи"... |
03540587a9e58d070a17b2545e21c6c381fe4229 | 7,345 | [
643456947
] | [
"liveview"
] | defmodule ElixirCtfWeb.LevelPlayLive do
use Phoenix.LiveView
use Phoenix.HTML
alias MSP430.CPU
alias MSP430.Memory
alias MSP430.IntelHex
alias ElixirCtf.Levels.Level
require Logger
use ElixirCtfWeb, :html
@max_ins_cnt_msg "Exceed maximum number of instructions, reset to continue"
defp update_assi... |
0355523270b5c568159e2a8fb9b4c3eed95822df | 7,252 | [
211052724,
345517080,
469686749,
257968550,
238381945,
396022775
] | [
"documented"
] | defmodule Floki.HTMLTree do
@moduledoc false
# Builds a `Map` representing a HTML tree based on tuples or list of tuples.
#
# It is useful because keeps references for each node, and the possibility to
# update the tree.
defstruct nodes: %{}, root_nodes_ids: [], node_ids: []
alias Floki.HTMLTree
alia... |
03558df0dc8c5adcafe58987a01ed2e8a8b86df9 | 3,014 | [
65862668
] | [
"test"
] | defmodule AspectTest do
use ExUnit.Case, async: true
alias ECS.Aspect, as: Aspect
alias ECS.Entity, as: Entity
alias TestModules.Components.C1, as: C1
alias TestModules.Components.C2, as: C2
alias TestModules.Components.C3, as: C3
doctest Aspect
test "`new` creates an aspect with the proper `all`, `... |
035596c1357a3b64ac16db95964e9f26924e4a1e | 2,331 | [
251569467
] | [
"typespec",
"macro",
"documented"
] | defmodule Cadastre.Country do
@moduledoc """
Country implementation.
"""
alias Cadastre.Language
@external_resource Application.app_dir(:cadastre, "priv/data/countries.etf")
@enforce_keys [:id]
defstruct [:id]
@type id :: <<_::16>>
@type t :: %__MODULE__{id: id}
external_data = @external_resourc... |
0355b6e797696c30e454a4596177542e528cfb90 | 9,599 | [
48216982
] | [] | defmodule RecruitxBackend.ExperienceMatrixSpec do
use ESpec.Phoenix, model: RecruitxBackend.ExperienceMatrix
alias RecruitxBackend.ExperienceMatrix
alias Decimal
let :valid_attrs, do: params_with_assocs(:experience_matrix)
let :invalid_attrs, do: %{}
context "valid changeset" do
subject do: Experienc... |
0355cdd203a20fc25a44f69ff6567663abefbe59 | 3,603 | [
627526023
] | [
"genserver",
"liveview"
] | defmodule FooWeb.DrawStyledDivsLive do
use FooWeb, :live_view
def mount(_params, _session, socket) do
width = 10 * 8
height = 8
max_value = 7
values = 0..max_value |> Enum.to_list()
grid_height = 100 / (width / height)
style = "grid-template-columns: repeat(#{width}, 1fr); height: #{grid_he... |
0355eb89e09c90240e41c32a7d060c05b848ad5a | 4,318 | [
140345236
] | [] | %{
"amnesia": {:hex, :amnesia, "0.2.7", "ffc2221bf72da4cfafbbb497adf9cf7e52138f1333cec5836187a53f94ae0665", [:mix], [{:exquisite, "~> 0.1.7", [hex: :exquisite, repo: "hexpm", optional: false]}], "hexpm"},
"certifi": {:hex, :certifi, "2.3.1", "d0f424232390bf47d82da8478022301c561cf6445b5b5fb6a84d49a9e76d2639", [:reba... |
03560fcc0e4b0357e43003bc8e39038f9b14151d | 1,791 | [
89526939
] | [] | defmodule ResuelveAuth.Mixfile do
use Mix.Project
@version "0.1.0"
@description """
Resuelve library to ensure authentication
"""
def project do
[
app: :resuelve_auth,
version: @version,
elixir: "~> 1.4",
description: @description,
package: package(),
build_embedded... |
03562c95408c0bf140e358d573db60fb447b2ab1 | 1,560 | [
20510839
] | [
"documented"
] | defmodule Stats do
@moduledoc """
Basic stat functions
iex(2)> data = [4, 1, 7, -17, 8, 2, 5]
[4,1,7,-17,8,2,5]
iex(3)> Stats.minimum(data)
-17
iex(4)> Stats.minimum([52, 46])
46
iex(5)> Stats.maximum(data)
8
iex(6)> Stats.range(data)
[-17,8]
"""
def minimum(list)... |
03565e071126ce3e34f1108ec3e16d2941e75291 | 1,813 | [
695278657
] | [
"test"
] | defmodule Macfly.ActionTest do
use ExUnit.Case
alias Macfly.Action
test "numbers line up correctly" do
assert 1 == Action.read() |> Action.to_wire()
assert 2 == Action.write() |> Action.to_wire()
assert 4 == Action.create() |> Action.to_wire()
assert 8 == Action.delete() |> Action.to_wire()
... |
03568a50ba4d5c8826c508443478f05a7311b2a9 | 2,112 | [
769657771
] | [
"test",
"ecto"
] | defmodule Api.AccountsTest do
use Api.DataCase
alias Api.Accounts
describe "accounts" do
alias Api.Accounts.Account
import Api.AccountsFixtures
@invalid_attrs %{password: nil, username: nil}
test "list_accounts/0 returns all accounts" do
account = account_fixture()
assert Accounts... |
035723ea35bb834016f5cf638d433c7718868d0b | 1,692 | [
47216964
] | [] | defmodule RingTicker do
@interval 2_000
@name :ring_ticker
def interval, do: @interval
def generator(client) do
receive do
{:link, new_client} ->
IO.puts "Linked #{inspect client} with #{inspect self()}"
link_tail(client, new_client, current_client())
generator(new_client)
... |
0357d4465bb75d3985336faec7909a91794ae1a1 | 16,373 | [
52797857
] | [
"typespec",
"macro",
"documented",
"ecto"
] | defmodule Air.Service.AuditLog do
@moduledoc "Services for using the audit log."
alias Air.{Repo, Schemas.AuditLog, Schemas.DataSource, Schemas.User}
import Ecto.Query, only: [limit: 2, from: 2, subquery: 1, offset: 2, preload: 2]
require Logger
@type login :: String.t()
@type event_name :: String.t()
@... |
0357e238749ecb1960a2a2563212f810d13754bf | 2,449 | [
115469363
] | [] | bench_options = [
time: 5,
memory_time: 2,
inputs: %{
"simple document" => :simple,
"deeply nested elements " => :nested,
"long content element" => :long_content
}
]
defmodule Bench.Saxy.Builder do
import Saxy.XML, only: [element: 3]
def build(:simple) do
element("root", [], [
elemen... |
035818f4b15dd33e213d5247ecbafb2c3969cb5f | 1,503 | [
911680544
] | [
"typespec",
"documented"
] | if not Code.ensure_loaded?(Rayex) do
defmodule Rayex.Structs.Vector2 do
@moduledoc "Vector2"
@enforce_keys ~w[x y]a
defstruct ~w[x y]a
@type t :: %__MODULE__{x: float(), y: float()}
end
defmodule Rayex.Structs.Vector3 do
@moduledoc "Vector3"
@enforce_keys ~w[x y z]a
defstruct ~w[x y ... |
0358725d2b3497028388d978fb1b68f3facefbbb | 16,908 | [
238230407
] | [
"test"
] | defmodule Automaton.Types.Metacognition.ReflectionFrameworkTest do
use ExUnit.Case, async: true
alias Automata.Reasoning.Cognitive.Metacognition.ReflectionFramework
alias Automata.Reasoning.Cognitive.Metacognition.ReflectionFramework.{
Introspection,
StrategySelection,
TraceAnalysis
}
describe... |
0358b2af960aad7eeb58925aea4e08aa8275a9d5 | 3,827 | [
75985206
] | [] | %{
"earmark_parser": {:hex, :earmark_parser, "1.4.39", "424642f8335b05bb9eb611aa1564c148a8ee35c9c8a8bba6e129d51a3e3c6769", [:mix], [], "hexpm", "06553a88d1f1846da9ef066b87b57c6f605552cfbe40d20bd8d59cc6bde41944"},
"elixir_uuid": {:hex, :elixir_uuid, "1.2.1", "dce506597acb7e6b0daeaff52ff6a9043f5919a4c3315abb4143f0b00... |
0358bec05774d9d3324d0391d69a40c514b66e45 | 2,589 | [
688641955
] | [
"test"
] | defmodule Mix.Tasks.DatabaseCleanupTest do
use ExUnit.Case
import Mock
describe "run/1" do
test "when the mongo database is successfully deleted" do
with_mock(Mongo, [],
start_link: fn _ -> {:ok, :pid} end,
drop_database: fn :mongo_admin, "bugs-channel-test" -> :ok end
) do
... |
03591f0f134a21c22595eb54cedabe84ad369118 | 5,395 | [
335777481
] | [
"typespec"
] | defmodule Santorini.Board do
@derive Jason.Encoder
defstruct [:players, :spaces, :turn]
@type t :: %__MODULE__{players: [[[0..4]]], spaces: [[1..4]], turn: integer}
def new() do
%Santorini.Board{players: [], spaces: List.duplicate(List.duplicate(0, 5), 5), turn: 0}
end
@spec update_players(board :: Bo... |
035988d2d8fce3d19429d186d7c73617bc43d8bb | 2,180 | [
193244709,
101434552,
198908023
] | [
"typespec",
"documented"
] | defmodule GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1Replay do
@moduledoc """
A resource describing a `Replay`, or simulation.
## Attributes
* `config` (*type:* `GoogleApi.PolicySimulator.V1.Model.GoogleCloudPolicysimulatorV1ReplayConfig.t`, *default:* `nil`) - Required. The configuratio... |
035a0757c3f83e86281f64acbff84f9cf77dbdaf | 2,125 | [
315410731
] | [
"test"
] | defmodule ChatApiWeb.WidgetSettingsControllerTest do
use ChatApiWeb.ConnCase
alias ChatApi.WidgetSettings
alias ChatApi.Accounts
def create_attr(account_id) do
%{
color: "some color",
subtitle: "some subtitle",
title: "some title",
account_id: account_id
}
end
def update_a... |
035a5731c39d67952b44742b1827333690f313ed | 3,178 | [
375228479
] | [
"documented",
"ecto"
] | defmodule ContactTraceServer.Trace do
@moduledoc """
The Trace context.
"""
require Logger
import Ecto.Query, warn: false
alias ContactTraceServer.Repo
alias ContactTraceServer.Trace.Contact
alias ContactTraceServer.Infections
@doc """
Returns an `%Ecto.Changeset{}` for tracking contact changes.... |
035a68e9349e938c663dceb9556495691e9ea953 | 2,542 | [
974892307
] | [] | import Config
# Configure your database
#
# The MIX_TEST_PARTITION environment variable can be used
# to provide built-in test partitioning in CI environment.
# Run `mix help test` for more information.
config :practicalpd, Practicalpd.Repo,
username: "postgres",
password: "postgres",
hostname: "localhost",
da... |
035ae5d9996ba51a39d2fef9096d9b30d898dee6 | 1,659 | [
193244709,
101434552,
198908023
] | [
"typespec",
"documented"
] | defmodule GoogleApi.FirebaseAppDistribution.V1.Model.GoogleFirebaseAppdistroV1AabInfo do
@moduledoc """
Android App Bundle (AAB) information for a Firebase app.
## Attributes
* `integrationState` (*type:* `String.t`, *default:* `nil`) - App bundle integration state. Only valid for android apps.
* `name`... |
035afb9a0879c6b68b94073e2bcaf64c6f07fc2e | 2,218 | [
353387002
] | [
"test"
] | defmodule ConduitWeb.CommentControllerTest do
use ConduitWeb.ConnCase, async: true
setup %{conn: conn} do
{:ok, conn: put_req_header(conn, "accept", "application/json")}
end
describe "add" do
test "succeeds when user is authenticated", %{conn: conn} do
{:ok, jack} = user_fixture(%{username: "jac... |
035b932cc4054393a49a4cdb393d47914fe5ac82 | 2,063 | [
196738500
] | [] | defmodule HtmlPlayback.Snapshots do
alias HtmlPlayback.Schemas.Session
alias HtmlPlayback.Schemas.SnapshotGroup
alias HtmlPlayback.Sessions
@snapshots_bucket "snapshots"
def list(%Session{} = session) do
session
|> Sessions.list_snapshot_group_keys()
|> Enum.flat_map(&fetch_group(&1).snapshots)
... |
035c74e1bcfef8c1e2171c1956905b242f57e5b7 | 14,354 | [
989918778
] | [
"genserver",
"liveview"
] | defmodule MCPChatWeb.SessionLive do
use MCPChatWeb, :live_view
@impl true
def mount(_params, _session, socket) do
if connected?(socket) do
# Subscribe to session events
Phoenix.PubSub.subscribe(MCPChat.PubSub, "system:sessions")
end
{:ok,
socket
|> assign(:page_title, "Session ... |
035d177e722df1f932ebd185c8111c09ddb69b8d | 2,895 | [
389721503,
401198286,
204083954,
693348681,
922960360,
190239178,
28735275
] | [
"typespec",
"supervisor",
"documented"
] | defmodule KafkaEx.ConsumerGroup.PartitionAssignment do
@moduledoc """
Contains typespecs and reference algorithms for assigning partitions
`round_robin/2` is used by `KafkaEx.ConsumerGroup` by default and should
suffice in most cases.
For custom assignments, any function matching the
`t:callback/0` type s... |
035d487c2b55889b27ae13b89a2025e275c4f071 | 1,522 | [
702191771
] | [] | defmodule SundaysOnFirstGFR do
defp is_leap_year(year) when rem(year, 400) == 0, do: true
defp is_leap_year(year) when rem(year, 100) == 0, do: false
defp is_leap_year(year) when rem(year, 4) == 0, do: true
defp is_leap_year(_), do: false
defp days_in_month(2, year) do
if is_leap_year(year), do: 29, else... |
035d7cd7a09b32ac6d7518063e10c4690d940166 | 2,033 | [
897355290
] | [
"phoenix",
"ecto"
] | defmodule ProjectDeltaWeb.ReceitaController do
use ProjectDeltaWeb, :controller
alias ProjectDelta.Finance
alias ProjectDelta.Finance.Receita
def index(conn, params) do
if conn.assigns[:current_user] do
# Passa os parâmetros para aplicar os filtros
receitas = Finance.list_receitas_with_filte... |
035dcff6f75bd5283ec1cd4ca018709c3d45874f | 1,598 | [
220459553
] | [
"typespec",
"documented",
"ecto"
] | defmodule Jobseeker9000.Jobs.Flag do
alias Jobseeker9000.Repo
import Ecto.Query, except: [update: 2]
alias Jobseeker9000.Jobs.Offer
@moduledoc """
Flags represent parts of offers that users looks for.
Presence of a given Flag for given Offer means that
this offer can be classified as being part od some... |
035e05ae0a833fbba20e74cbd0f8c6e953dd2048 | 4,263 | [
622645084
] | [
"documented"
] | defmodule Rfread do
@moduledoc """
Documentation for `Rfread`.
"""
require Record
Record.defrecord(
:diameter_header,
Record.extract(:diameter_header, from_lib: "diameter/include/diameter.hrl")
)
Record.defrecord(
:diameter_packet,
Record.extract(:diameter_packet, from_lib: "diameter/in... |
035e156c40bee4a7e8e2e506fd688f41a22f53fc | 1,568 | [
368404734
] | [
"test"
] | defmodule ElixirGoogleScraper.Scraper.Schemas.SearchResultTest do
use ElixirGoogleScraper.DataCase, async: true
alias ElixirGoogleScraper.Repo
alias ElixirGoogleScraper.Scraper.Schemas.SearchResult
describe "changeset/2" do
test "returns valid changeset if given valid attributes" do
attrs = %{
... |
035f2dac4e7b8670f907a9bddae927e1462b3a14 | 2,093 | [
92554717
] | [
"genserver",
"liveview"
] | defmodule SlackRtm do
use Slack
def handle_connect(slack, state) do
IO.puts "Connected as #{slack.me.name}"
{:ok, StateMachine.init(state, self)}
end
# Explicitly ignore a bunch of messages - but not a direct or "ambient" channel message
def handle_event(%{type: "message", subtype: "channel_join"}, ... |
0360161fb245ae14b100bf95f82115b2a47341f1 | 3,791 | [
363419449
] | [
"test",
"documented"
] | defmodule OMG.Watcher.Integration.InFlightExit4Test do
@moduledoc """
This needs to go away real soon.
"""
use ExUnitFixtures
use ExUnit.Case, async: false
use OMG.Fixtures
use Plug.Test
use OMG.Watcher.Integration.Fixtures
alias OMG.State.Transaction
alias OMG.Utxo
alias OMG.Watcher.Integration.... |
036018743f205660bcbdefb872ede5ca3fca76df | 2,665 | [
63304973
] | [
"documented"
] | defmodule Mongo.Ecto.Conversions do
@moduledoc false
import Mongo.Ecto.Utils
def to_ecto_pk(%{__struct__: _} = value, _pk),
do: value
def to_ecto_pk(map, pk) when is_map(map) do
Enum.into(map, %{}, fn
{"_id", value} -> {Atom.to_string(pk), to_ecto_pk(value, pk)}
{key, value} -> {key, to_... |
03601ca1532c59362aa8b6173fb5fe0741ab2443 | 7,324 | [
477647394,
15848380
] | [
"documented"
] | defmodule FarmbotOS.Lua do
@moduledoc """
Embedded scripting language for "formulas" in the MOVE block,
assertion, and general scripting via LUA block.
"""
require FarmbotOS.Logger
require Logger
alias FarmbotOS.Lua.{
DataManipulation,
Firmware,
Info,
Wait,
PinWatcher
}
# this fu... |
03602fa522cc8981172ce7861d59740cbf826c7c | 3,144 | [
507212703
] | [
"documented"
] | defmodule ActiveMemory.Adapters.Ets do
@moduledoc false
alias ActiveMemory.Adapters.Adapter
alias ActiveMemory.Adapters.Ets.Helpers
alias ActiveMemory.Query.{MatchGuards, MatchSpec}
@behaviour Adapter
def all(table) do
:ets.tab2list(table)
|> Task.async_stream(fn record -> to_struct(record, table... |
03605179e09e4b6d7c5d714fd9ca4acca2e56a9c | 2,321 | [
193244709,
101434552,
198908023
] | [
"typespec",
"documented"
] | defmodule GoogleApi.Connectors.V1.Model.Field do
@moduledoc """
Metadata of an entity field.
## Attributes
* `additionalDetails` (*type:* `map()`, *default:* `nil`) - The following map contains fields that are not explicitly mentioned above,this give connectors the flexibility to add new metadata fields.
... |
036115a0b7af3b424975362ec9e68ef5ff4223ca | 5,961 | [
960969573,
977683393,
949431805,
951028820,
978697806,
932340894,
956155713
] | [
"documented"
] | defmodule Tunez.Generator do
@moduledoc "Data generation for tests"
use Ash.Generator
@doc """
Generates album changesets using the `:create` action.
## Extra Options
- `:actor` - Specify the actor creating the album OR
- `:actor_role` - Specify the role to give to the generated actor.
Defaults to... |
0361a0014f48f60d84ac0bf81011a51f19917e76 | 2,048 | [
916074662
] | [] | defmodule Opsmo.CRPM.Dataset.Base do
import Nx.Defn
def train(opts \\ []) do
examples = Keyword.get(opts, :examples, 500)
granularity = Keyword.get(opts, :granularity, 100)
seed = Keyword.get(opts, :seed, 121_345)
factor = div(examples, granularity)
requested_seed = seed
used_seed = seed *... |
0361b44e7e556e371b67fe0549a675877ca1cc2e | 3,004 | [
425772228
] | [
"test",
"phoenix"
] | # defmodule TodolistWeb.WorkintimesControllerTest do
# use TodolistWeb.ConnCase
# import Todolist.SchemaFixtures
# alias Todolist.Schema.Workingtimes
# @create_attrs %{
# end: ~U[2021-10-25 12:48:00Z],
# start: ~U[2021-10-25 12:48:00Z]
# }
# @update_attrs %{
# end: ~U[2021-10-26 12:48:00Z],
#... |
0361dab9a9848c4d7219d63915eb7ee8e940a05b | 2,227 | [
704049289
] | [
"documented"
] | defmodule ISO6391 do
@moduledoc """
A toolkit for working with ISO 639-1 language codes.
ISO6391 offers functionality to:
- Convert a language name into its respective ISO 639-1 code.
- Fetch the language name(s) corresponding to a particular ISO 639-1 code.
ISO 639-1 codes serve as standardized two-lette... |
0361eb5c8c23cc5caf2b27ffcfe66e5313495132 | 2,650 | [
528746346
] | [
"test",
"phoenix"
] | defmodule ThebacklogWeb.StoryControllerTest do
use ThebacklogWeb.ConnCase
import Thebacklog.BacklogFixtures
@create_attrs %{body: "some body"}
@update_attrs %{body: "some updated body"}
@invalid_attrs %{body: nil}
describe "index" do
test "lists all stories", %{conn: conn} do
conn = get(conn, R... |
0361fe359a69b0b14bf15851f5ac5386c4fc8892 | 1,708 | [
207502326
] | [
"phoenix"
] | defmodule ApiWeb.Router do
use ApiWeb, :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 CORSPlug, origin: "http://localhost:8080"
plug :accepts, ["json"]
... |
0362adc6cca180038dc669e492bcffcf43949d57 | 2,011 | [
855025817
] | [] | defmodule DemoWeb.Plugs.Locale do
@locales Gettext.known_locales(DemoWeb.Gettext)
import Plug.Conn
def init(_opts), do: nil
def call(conn, _opts) do
case locale_from_params(conn) || locale_from_cookies(conn) || locale_from_header(conn) do
nil ->
conn
locale ->
Gettext.put_loca... |
0362d35b92991aabb4bd405910e30612daf8dae3 | 2,500 | [
867066442,
778950241
] | [
"liveview",
"macro",
"documented",
"phoenix"
] | defmodule EuVouWeb do
@moduledoc """
The entrypoint for defining your web interface, such
as controllers, components, channels, and so on.
This can be used in your application as:
use EuVouWeb, :controller
use EuVouWeb, :html
The definitions below will be executed for every controller,
compon... |
03637ad0b5e85f06c68ae5c70ab5660b36a23ea7 | 3,447 | [
217214351
] | [
"liveview"
] | defmodule LiveViewWeb.Project.Form do
require Logger
use Phoenix.LiveView
use Phoenix.HTML
alias LiveViewWeb.ErrorHelpers
alias LiveViewWeb.InputHelpers
alias LiveViewWeb.Helpers
def render(assigns, project_changeset) do
Logger.debug("Rendering Project Form")
f = form_for( project_changeset, "#... |
0363bd3dfe808777e785378751aa4ea0f10360d5 | 13,813 | [
498675807
] | [
"macro",
"ecto"
] | defmodule AppCount.Vendors.Utils.Orders do
import Ecto.Query
alias AppCount.Repo
alias AppCount.Vendors.Order
alias AppCount.Vendors.Note
alias AppCount.Vendors.Vendor
alias AppCount.Vendors
alias AppCount.Vendors.Utils.Notes
alias AppCount.Maintenance.CardItem
alias AppCount.Tenants.Tenant
alias Ap... |
0363c842707b0942bf64696a3342fa1eb7dd3004 | 24,667 | [
125843928
] | [
"macro",
"typespec",
"test",
"documented"
] | defmodule ExUnit.AssertionError do
@moduledoc """
Raised to signal an assertion error.
"""
@no_value :ex_unit_no_meaningful_value
defexception left: @no_value,
right: @no_value,
message: @no_value,
expr: @no_value,
args: @no_value
@doc """
Ind... |
03643428b646ff5ec5a36e33258aecaf18de7ef8 | 4,336 | [
94950232
] | [
"macro",
"documented"
] | defmodule Elasticfusion.Search.Lexer do
@moduledoc """
This module exposes functions for lexical scanning operations on a string.
State tracking is explicit: functions receieve a state
and return a tuple of {match, new_state}. Initial state is set up
through `initialize/1`.
All functions match the beginnin... |
0364b34ccebdec92188436489c3a0236c6a2d874 | 1,549 | [
1009187833
] | [
"phoenix"
] | defmodule TasksAppWeb.TaskController do
use TasksAppWeb, :controller
alias TasksApp.Tasks
alias TasksApp.Tasks.Task
def index(conn, _params) do
tasks = Tasks.list_tasks()
render(conn, :index, tasks: tasks)
end
def new(conn, _params) do
changeset = Tasks.change_task(%Task{})
render(conn, :n... |
0364ccb4b906e26afbed2e7c1f47088fe29f9499 | 2,606 | [
74381093
] | [
"genserver",
"ecto"
] | defmodule SeoHero.Server do
use GenServer
import Ecto.Query, only: [from: 2]
alias SeoHero.{Fido, ResultCollection, Result, Repo, Validate}
# 2 hours
# @default_time 2 * 60 * 60 * 1_000
# 38 minutes
@default_time 38 * 60 * 1_000
@default_url "https://www.google.com/search?q=seo+hero&near=new+york,new... |
0364f65df06826cee46e322995edbd08265f0c69 | 2,031 | [
293936832
] | [
"genserver",
"supervisor",
"documented"
] | defmodule Esquew.Hub do
use GenServer
@moduledoc """
Esquew Hub where topics and subscriptions can be created
"""
## boiler
@name __MODULE__
def start_link(%{}) do
GenServer.start_link(@name, %{}, name: @name)
end
## api
def list do
Enum.map(:ets.match_object(@name, :_), fn {topic, sub... |
0365247023b5bab21aac30ecc41f300f1b167073 | 2,092 | [
177651502
] | [
"test",
"ecto"
] | defmodule AshServer.AccountsTest do
use AshServer.DataCase
import AshServer.Factory
alias AshServer.Accounts
describe "users" do
alias AshServer.Accounts.User
@invalid_attrs %{email: nil, username: nil}
test "create_user/1 with valid data creates a user" do
user_params =
params_for... |
03653557993f74594bf08cf0fe30eabd642c360d | 11,274 | [
486617176
] | [
"genserver",
"liveview"
] | defmodule LiveBooruWeb.ImageLive do
use LiveBooruWeb, :live_view
alias LiveBooruWeb.Endpoint
alias LiveBooru.{Repo, Comment, Image, ImageVote}
def render(assigns) do
LiveBooruWeb.PageView.render("image.html", assigns)
end
def mount(%{"id" => id}, _session, socket) do
Repo.get(Image, id)
|> Re... |
03655924118e92b3799f0ae00da23ec8454b6742 | 2,539 | [
1013321258
] | [
"documented"
] | defmodule RubberDuck.CoT.Chains.FastResponseChain do
@moduledoc """
Optimized Chain-of-Thought reasoning chain for fast responses.
This chain is designed for questions that need some reasoning but
not the full 7-8 step process. It focuses on:
- Quick context understanding
- Direct response generation
- M... |
03655dc01a5e40130b5f15bcbff85b57e1e01410 | 2,174 | [
52257103
] | [
"genserver"
] | defmodule TrumpfyGame.Room.Server do
use GenServer
alias TrumpfyGame.{Game, Room, Player}
# Supervisor API
def start_link(room, opts \\ []) do
GenServer.start_link(__MODULE__, room, opts)
end
# GenServer API
def init(room) do
Room.Listing.set(room.id, self)
{:ok, room}
end
def handle... |
03655e59f638339d3e933e304c7d4ffc9aeb11bc | 2,379 | [
193244709,
101434552,
198908023
] | [
"typespec",
"documented"
] | defmodule GoogleApi.Chat.V1.Model.User do
@moduledoc """
A user in Google Chat. When returned as an output from a request, if your Chat app [authenticates as a user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), the output for a `User` resource only populates the user's `name` and ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.