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 |
|---|---|---|---|---|
0b857ff18aa1a450ac480569d0c02954e624141e | 1,875 | [
100841486
] | [
"documented",
"ecto"
] | defmodule LleCymraeg.Locations do
@moduledoc """
The Locations context.
"""
import Ecto.Query, warn: false
alias LleCymraeg.Repo
alias LleCymraeg.Locations.Location
@doc """
Returns the list of locations.
## Examples
iex> list_locations()
[%Location{}, ...]
"""
def list_locations... |
0b860ace5e31dd7b77dda5b49029fd5638c6376c | 2,217 | [
459182862
] | [
"test"
] | defmodule GreenBankApiWeb.TransactionControllerTest do
use GreenBankApiWeb.ConnCase
use ExUnit.Case, async: true
alias GreenBankApi.Internal.Account, as: AccountInternal
@account_params %{
"document" => 12_151_194_884,
"account_holder" => "<EMAIL>",
"password" => "1234567"
}
@login_params %{
... |
0b86815bff87327ccf703446d1ad68344c130fdf | 2,447 | [
837977558
] | [
"test",
"phoenix"
] | defmodule TodosAppWeb.TodoControllerTest do
use TodosAppWeb.ConnCase
import TodosApp.TodosFixtures
@create_attrs %{name: "some name", status: true, description: "some description"}
@update_attrs %{name: "some updated name", status: false, description: "some updated description"}
@invalid_attrs %{name: nil, ... |
0b8683599e9944f6783f68c340ef47503c737892 | 1,547 | [
51327986
] | [] | defmodule Meetup.Mixfile do
use Mix.Project
def project do
[app: :meetup,
version: "0.0.1",
elixir: "~> 1.0",
elixirc_paths: elixirc_paths(Mix.env),
compilers: [:phoenix, :gettext] ++ Mix.compilers,
build_embedded: Mix.env == :prod,
start_permanent: Mix.env == :prod,
aliases:... |
0b868a909eb45ef39243d012b452d758964ff7e4 | 1,616 | [
70399278
] | [
"test"
] | defmodule DeliciousElixir.SettingProfileControllerTest do
use DeliciousElixir.ConnCase
alias DeliciousElixir.{TestHelpers, Repo, User}
setup do
user = %{
username: "example",
email: "<EMAIL>",
first_name: "M",
last_name: "S",
password: "password",
} |> TestHelpers.create_us... |
0b86f601da32e5bf2a14e176409dd265e1f22a64 | 3,780 | [
273059198
] | [] | %{
"basho_stats": {:git, "git://github.com/basho/basho_stats.git", "c5b7ecb92af7b050bc62d08c6fbf1aafd6bdeff0", [branch: "develop-3.0"]},
"bear": {:hex, :bear, "0.8.7", "16264309ae5d005d03718a5c82641fcc259c9e8f09adeb6fd79ca4271168656f", [:rebar3], [], "hexpm"},
"clique": {:git, "git://github.com/basho/clique.git",... |
0b8735e1e2787e6ea131aed9d249c2440f989bbb | 13,766 | [
795425858
] | [] | %{
"abacus": {:hex, :abacus, "2.1.0", "b6db5c989ba3d9dd8c36d1cb269e2f0058f34768d47c67eb8ce06697ecb36dd4", [:mix], [], "hexpm", "255de08b02884e8383f1eed8aa31df884ce0fb5eb394db81ff888089f2a1bbff"},
"bunt": {:hex, :bunt, "1.0.0", "081c2c665f086849e6d57900292b3a161727ab40431219529f13c4ddcf3e7a44", [:mix], [], "hexpm", ... |
0b874043c3badbf917b4d638a0e84cd0fcf1980e | 4,758 | [
57012814
] | [
"typespec",
"documented"
] | defmodule Topo.Intersects do
@moduledoc false
alias Topo.PointLine
alias Topo.PointRing
alias Topo.LineLine
alias Topo.LineRing
alias Topo.RingRing
@type geo_struct ::
%Geo.Point{}
| %Geo.MultiPoint{}
| %Geo.LineString{}
| %Geo.MultiLineString{}
| %Geo.P... |
0b8769033d9f967d85beefd5b7e872dcbdbcb55b | 2,705 | [
537915449
] | [] | import Config
config :pleroma, Pleroma.Web.Endpoint,
url: [host: System.get_env("DOMAIN", "localhost"), scheme: "https", port: 443],
http: [ip: {0, 0, 0, 0}, port: 4000]
config :pleroma, :instance,
name: System.get_env("INSTANCE_NAME", "Pleroma"),
email: System.get_env("ADMIN_EMAIL"),
notify_email: System.g... |
0b8782e3714c45d8f41cd6c1a46a3f79b94cd7cc | 2,152 | [
208457561
] | [] | import Config
# ----- PLE_DEMO_BASE
config :ple_demo_base, PleDemoBaseWeb.Endpoint,
http: [port: 4040],
debug_errors: true,
code_reloader: true,
check_origin: false,
watchers: [
esbuild: {Esbuild, :install_and_run, [:ple_demo_base, ~w(--sourcemap=inline --watch)]},
tailwind: {Tailwind, :install_and_... |
0b886ebf04d04d76f7c9a2c020845ea3ea8159b5 | 2,642 | [
146806133
] | [] | defmodule Looniebox.MixProject do
use Mix.Project
@app :looniebox
@version "0.1.0"
@looniebox_targets [:"jonas-looniebox", :"luisa-looniebox"]
@all_targets [:rpi, :rpi0, :rpi2, :rpi3, :rpi3a, :rpi4, :bbb, :x86_64] ++ @looniebox_targets
def project do
[
app: @app,
version: @version,
e... |
0b887cd451cbaed93fc8eca08613fcf802b568f0 | 2,895 | [
814869922
] | [
"typespec",
"documented",
"ecto"
] | defmodule Fhir.ConceptMapTarget do
@moduledoc """
A statement of relationships from one set of concepts to one or more other concepts - either concepts in code systems, or data element/data element concepts, or classes in class models.
"""
use Ecto.Schema
import Ecto.Changeset
@derive Jason.Encoder
@prim... |
0b88c93b778a88fc729be8c7b4981c1723348af5 | 13,223 | [
87435320
] | [
"test"
] | defmodule CoursePlannerWeb.EventControllerTest do
use CoursePlannerWeb.ConnCase
import CoursePlanner.Factory
@create_attrs %{date: ~D[2010-04-17], description: "some description", finishing_time: ~T[15:00:00.000000], location: "some location", name: "some name", starting_time: ~T[14:00:00.000000]}
@update_att... |
0b8aa63fe98b2e27550ad0df232ad1fa00a97808 | 1,548 | [
193244709,
101434552,
198908023
] | [
"typespec",
"documented"
] | defmodule GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1betaSearchRequestContentSearchSpecChunkSpec do
@moduledoc """
Specifies the chunk spec to be returned from the search response. Only available if the SearchRequest.ContentSearchSpec.search_result_mode is set to CHUNKS
## Attributes
* `... |
0b8ad8eff2151b76c7cd3b93621a8578e5c273b8 | 1,944 | [
599238988
] | [] | defmodule Boom.MixProject do
use Mix.Project
def project do
[
app: :boomgrid,
version: "0.1.0",
elixir: "~> 1.12",
elixirc_paths: elixirc_paths(Mix.env()),
compilers: Mix.compilers(),
start_permanent: Mix.env() == :prod,
aliases: aliases(),
deps: deps()
]
e... |
0b8adc88129e05b04b78be90b3b2499dff8fbad3 | 2,103 | [
315042237,
83251357
] | [
"typespec",
"documented"
] | defmodule Absinthe.Language do
@moduledoc false
alias Absinthe.Language
alias __MODULE__
@type t :: Language.Argument.t
| Language.BooleanValue.t
| Language.Directive.t | Language.Document.t | Language.EnumTypeDefinition.t | Language.EnumValue.t | Language.Field.t | Language.FieldDefinition.t | Language.... |
0b8b0299507658dec6b63b1c91717be149be29db | 1,824 | [
1009799947
] | [] | #Специальные настройки для разработчиков
import Config
# подключение к db
config :locallink_api, LocallinkApi.Repo,
username: "postgres",
password: "postgres",
hostname: "db",
database: "locallink_api_dev",
stacktrace: true,
show_sensitive_data_on_connection_error: true,
pool_size: 10,
types: Locallin... |
0b8b03d73e19d2812c728108f196879227fab556 | 4,287 | [
47230395
] | [
"test"
] | defmodule Cypher.LexerTest do
use ExUnit.Case
alias Cyphex.Lexer
test "tokenizes labels" do
{:ok, tokens, _} = Lexer.string(":lorem_ipsum")
assert tokens == [{:label, 1, 'lorem_ipsum'}]
end
test "tokenizes create node statements" do
create_node = ~S"""
CREATE (:`Session`:`User` {`email`:"<EM... |
0b8b6441b75d583ef21e2f2d8e04a16853943463 | 2,698 | [
68028467
] | [
"test",
"documented"
] | defmodule Annon.ManagementAPI.ConfigReloaderPlugTest do
@moduledoc false
use Annon.ConnCase, async: false
import ExUnit.CaptureLog
alias Annon.Factories.Configuration, as: ConfigurationFactory
setup %{conn: conn} do
conn =
conn
|> put_req_header("accept", "application/json")
|> put_req_... |
0b8b975a5bc141cb1809d1d05af6d6e49a002898 | 4,805 | [
944210219
] | [
"test"
] | defmodule BotflowTest do
import Mock
use ExUnit.Case
use GovRepublish.RepoCase
def rss_data() do
"""
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
<channel>
<atom:link href="https://nitter.privacydev.net/JCParking/rss" rel="self" type... |
0b8ba216486bc35be382f693026b507c5451fea2 | 3,463 | [
236984830
] | [
"test",
"phoenix"
] | defmodule UplogWeb.BorrowRequestControllerTest do
use UplogWeb.ConnCase
alias Uplog.Borrowables
@create_attrs %{approved_at: ~N[2010-04-17 14:00:00], claimed_at: ~N[2010-04-17 14:00:00], received_back_at: ~N[2010-04-17 14:00:00]}
@update_attrs %{approved_at: ~N[2011-05-18 15:01:01], claimed_at: ~N[2011-05-18 ... |
0b8bbc49ae62537ca3343f5addb47f9ed9ee64ad | 1,842 | [
148337908
] | [
"documented"
] | defmodule HaCore.Task do
@moduledoc """
Release tasks
"""
@start_apps [
:crypto,
:ssl,
:postgrex,
# :ecto_sql,
:ecto
]
@repos Application.get_env(:ha_core, :ecto_repos, [])
@doc """
Migrate database
"""
def migrate(_argv \\ []) do
start_services()
run_migrations()
s... |
0b8bcf28b953a34fcf13861b4d9391778baaa3c2 | 1,970 | [
803809623
] | [] | defmodule OperatelyWeb.Api.Mutations.SubscribeToNotifications do
use TurboConnect.Mutation
use OperatelyWeb.Api.Helpers
alias Operately.{Goals, Projects, Notifications, Groups, ResourceHubs}
alias Operately.Operations.NotificationsSubscribing
inputs do
field :id, :string
field :type, :string
end
... |
0b8bf65300f002cc72c1ba2df4f76c1ea56355a1 | 6,449 | [
115481305
] | [] | %{"bunt": {:hex, :bunt, "0.2.0", "951c6e801e8b1d2cbe58ebbd3e616a869061ddadcc4863d0a2182541acae9a38", [], [], "hexpm"},
"certifi": {:hex, :certifi, "1.2.1", "c3904f192bd5284e5b13f20db3ceac9626e14eeacfbb492e19583cf0e37b22be", [], [], "hexpm"},
"connection": {:hex, :connection, "1.0.4", "a1cae72211f0eef17705aaededacac... |
0b8c36f872fb7111024da73c1421edaf02d5f3a5 | 4,320 | [
887006338
] | [
"test"
] | defmodule NervesUpdateManagerTest do
use ExUnit.Case, async: false
doctest NervesUpdateManager
setup do
data_directory = Application.get_env(:nerves_update_manager, :data_directory)
Application.stop(:nerves_update_manager)
dir =
Path.join([data_directory, "NervesUpdateManager"])
on_exit(... |
0b8cd50424324b45aba35fccd17c033a75166acb | 3,970 | [
726417643,
295290852
] | [
"macro",
"ecto"
] | defmodule Console.GraphQl.Schema.Base do
use Absinthe.Schema.Notation
import Console.GraphQl.Helpers
require Logger
enum :delta do
value :create
value :update
value :delete
end
enum :direction do
value :before
value :after
end
object :metric_result do
field :timestamp, :long, ... |
0b8d532cda1c045d10599f1366d606aa5c30208d | 1,556 | [
370813738,
450993182
] | [
"typespec",
"documented"
] | defmodule StellarBase.XDR.TrustLine do
@moduledoc """
Representation of Stellar `TrustLine` type.
"""
alias StellarBase.XDR.{AccountID, TrustLineAsset}
@behaviour XDR.Declaration
@struct_spec XDR.Struct.new(account_id: AccountID, asset: TrustLineAsset)
@type t :: %__MODULE__{account_id: AccountID.t(), ... |
0b8d87dc5b96d5baf2482eafbe8958af4958be08 | 1,838 | [
540608507
] | [
"macro",
"documented",
"phoenix"
] | defmodule DappWatchWeb 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 DappWatchWeb, :controller
use DappWatchWeb, :view
The definitions below will be executed for every view,
contro... |
0b8d8c9ff0e82be053698283d1ea6941703189a7 | 2,898 | [
311125833,
306900276
] | [] | defmodule ExApp.PageMenuItemFileHandler do
alias ExApp.SanitizerUtil
alias ExApp.AuthorizerUtil
alias ExApp.MapUtil
alias ExApp.MessagesUtil
alias ExApp.FileService
alias ExApp.PageMenuItemService
alias ExApp.PageMenuItemFileService
alias ExApp.GenericValidator
alias ExApp.FileValidator
alias ExApp... |
0b8dbe4ebb6a9a4a82d07c2b8ae1e79e46ac01a3 | 8,252 | [
62920508
] | [
"test",
"phoenix"
] | defmodule Ex338Web.WaiverAdminControllerTest do
use Ex338Web.ConnCase
alias Ex338.FantasyTeams.FantasyTeam
alias Ex338.RosterPositions.RosterPosition
alias Ex338.Waivers.Waiver
describe "edit/2" do
setup :register_and_log_in_admin
test "renders a form for admin to process a waiver", %{conn: conn} d... |
0b8e026d8a1370634bbc11d5564d54078401dc4b | 1,622 | [
67368302
] | [
"test"
] | defmodule LeanCoffee.UserTest do
use LeanCoffee.ModelCase, async: true
alias LeanCoffee.User
@valid_attrs %{name: "user name", password: "password", username: "<EMAIL>"}
@invalid_attrs %{}
test "changeset with valid attributes" do
changeset = User.registration_changeset(%User{}, @valid_attrs)
asse... |
0b8e222580a4f657fa61b4a21f6ce07dc2e03f80 | 2,041 | [
163002453
] | [
"phoenix"
] | defmodule AcariServerWeb.SessionController do
use AcariServerWeb, :controller
require Logger
alias AcariServer.{UserManager, UserManager.User, UserManager.Guardian}
alias AcariServer.AuditManager
def new(conn, _params) do
changeset = UserManager.change_user(%User{})
maybe_user = Guardian.Plug.curren... |
0b8e4892e7983cd2ec6dfe4aa12682e060919ea0 | 3,757 | [
23169556
] | [] | defmodule Sentry do
# use Application
require Logger
import SentryUtil
# TODO: figure out how to get this in a supervision tree
# TODO: test to make sure Mix.Project works when this is used
# as a dependency
# def start(_type, _args) do
# pid = case init do
# {:ok, pid} ->
# IO.puts("S... |
0b8f3953e5ea5b82b0f1f8cb4723f66b3e0e3f56 | 1,882 | [
60614461
] | [
"phoenix"
] | defmodule PrioritizeApi.VoteController do
use PrioritizeApi.Web, :controller
alias PrioritizeApi.Vote
def index(conn, _params) do
votes = Repo.all(Vote)
|> Repo.preload(:user)
|> Repo.preload(:topic)
render(conn, "index.html", votes: votes)
end
def new(conn, _params) do
changeset = Vot... |
0b8f5cfcd868265ad52e6e05032a48144133761f | 1,887 | [
82872915
] | [] | defmodule System.POSIX.Errno do
@cache_table :posix_errno
defstruct [:code, :name, :description]
alias System.POSIX.Impl
def errno(name) when is_atom(name) or is_binary(name) do
ensure_cache_populated()
case Exts.read(@cache_table, {:by_name, canonicalize(name)}) do
[{{_, name}, code, desc}] -> ... |
0b8fcdb54c4bfce7128d04e1285f7d74c9e77bff | 3,769 | [
839783347
] | [
"test"
] | defmodule Ontogen.SpeechAct.FormatterTest do
use Ontogen.BogCase
doctest Ontogen.SpeechAct.Formatter
alias Ontogen.SpeechAct.Formatter
describe "full format" do
test "with all metadata" do
assert Formatter.format(speech_act(), :full) ==
"""
\e[33mspeech_act a280800d4d2... |
0b905f9034b42d178adcb43a968d14bf6405234d | 2,323 | [
62716664
] | [] | defmodule Uelli.Mixfile do
use Mix.Project
def project do
[
app: :uelli,
version: ("VERSION" |> File.read! |> String.trim),
elixir: "~> 1.3",
build_embedded: Mix.env == :prod,
start_permanent: Mix.env == :prod,
deps: deps(),
# excoveralls
test_coverage: [too... |
0b907d226e8c5ffdcf8a973c964d2f5bc20430cc | 4,591 | [
579114085
] | [
"ecto"
] | defmodule NotificationService.Email.SupplierEmails do
use Bamboo.Phoenix, view: FastRadiusWeb.EmailView
def build_email(%{user: user, cc: cc, bcc: bcc}, rfq_type, _attrs) when rfq_type in [:consulting, :ready_to_order] do
subject =
case rfq_type do
:consulting -> "We sent you a new RFQ"
:... |
0b909c30d412458fde95a0a19a951860934e2943 | 1,965 | [
352003593
] | [
"typespec"
] | defmodule Kousa.Follow do
alias Beef.Users
alias Beef.Follows
alias Beef.UserBlocks
alias Beef.Schemas.Follow
alias Beef.Schemas.Room
def get_follow_list(user_id, user_id_to_get_list_for, get_following_list, cursor) do
if get_following_list do
Follows.get_following(user_id, user_id_to_get_list_fo... |
0b90ab9d6d8acafbec49e363df8c24b7503de8ac | 3,384 | [
246897219
] | [] | defmodule Scrub.CIP.Type do
import Scrub.BinaryUtils
alias Scrub.CIP.Symbol
def decode(<<0xA0, 0x02, _crc::uint, data::binary>>, %{members: members}) do
Enum.reduce(members, [], fn
%{name: <<"ZZZZZZZZZ", _tail::binary>>}, acc ->
acc
%{type: :bool, offset: offset, bit_location: location}... |
0b91dcf61b13d7646ba95e822a07e1ebafd3d8b7 | 8,040 | [
407621205
] | [
"test"
] | defmodule GraphqlMarkdown.SchemaTest do
use ExUnit.Case, async: true
alias GraphqlMarkdown.Schema
doctest GraphqlMarkdown
@generate_login_code_response %{
"fields" => [
%{
"args" => [],
"deprecationReason" => nil,
"description" => nil,
"isDeprecated" => false,
... |
0b920ec8573c65cde57e8207dc1ededa038ff163 | 8,208 | [
334696761,
389101999
] | [
"typespec",
"test",
"documented"
] | defmodule ExDoc.Formatter.HTML.Templates do
@moduledoc false
require EEx
# TODO: It should not depend on the parent module
# TODO: Add tests that assert on the returned structured, not on JSON
alias ExDoc.Utils.SimpleJSON
alias ExDoc.Formatter.HTML
@doc """
Generate content from the module template fo... |
0b9267c141256e7b521b2fce6510db675e19a657 | 1,676 | [
193244709,
101434552,
198908023
] | [
"typespec",
"documented"
] | defmodule GoogleApi.Metastore.V1.Model.StartMigrationRequest do
@moduledoc """
Request message for DataprocMetastore.StartMigration.
## Attributes
* `migrationExecution` (*type:* `GoogleApi.Metastore.V1.Model.MigrationExecution.t`, *default:* `nil`) - Required. The configuration details for the migration.
... |
0b932f3681a001f00e37ddd4586ac0ad24dbdf72 | 4,103 | [
804725435
] | [
"phoenix"
] | defmodule EroticloneWeb.Router do
use EroticloneWeb, :router
import EroticloneWeb.UserAuth
pipeline :browser do
plug :accepts, ["html"]
plug :fetch_session
plug :fetch_live_flash
plug :put_root_layout, html: {EroticloneWeb.Layouts, :root}
plug :protect_from_forgery
plug :put_secure_brows... |
0b9345976219ee81f132f66e3d89e703edd3d660 | 6,850 | [
119773249
] | [
"test"
] | Code.require_file "../../../installer/test/mix_helper.exs", __DIR__
defmodule Phoenix.DupContext do
end
defmodule Mix.Tasks.Phx.Gen.ContextTest do
use ExUnit.Case
import MixHelper
alias Mix.Tasks.Phx.Gen
alias Mix.Phoenix.{Context, Schema}
setup do
Mix.Task.clear()
:ok
end
test "new context", ... |
0b93da2c6eb47a796b7622c73f26a03c05631e8a | 2,635 | [
119928321
] | [
"ecto"
] | # Script for populating the database. You can run it as:
#
# mix run priv/repo/seeds.exs
#
# Inside the script, you can read and write to any of your
# repositories directly:
#
# Ac.Repo.insert!(%Ac.SomeSchema{})
#
# We recommend using the bang functions (`insert!`, `update!`
# and so on) as they will fail if s... |
0b94733f3d3c81a0214497a5d648b4fef82a8872 | 4,187 | [
796665658
] | [
"documented"
] | defmodule Neurotick.Base.NeuronStorage do
@moduledoc false
alias Krug.EtsUtil
alias Neurotick.Base.NeuronMetadata
@tablename_metadata :neurotick_ets_metadata
@tablename_sensors :neurotick_ets_sensors
@tablename_neurons :neurotick_ets_neurons
@tablename_sensors_data :neurotick_ets_sensors_data
@tabl... |
0b94c1ac7a4d68e04d25ac9333b7c210b03c9fe7 | 1,798 | [
736177858
] | [
"documented",
"ecto"
] | defmodule RecipeOrganizer.Recipes do
@moduledoc """
The Recipes context.
"""
import Ecto.Query, warn: false
alias RecipeOrganizer.Repo
alias RecipeOrganizer.Recipes.Recipe
@doc """
Returns the list of recipes.
## Examples
iex> list_recipes()
[%Recipe{}, ...]
"""
def list_recipes ... |
0b94eac94ca8ba7fc98fcb3b98e72fe5c367f5db | 4,405 | [
749440751
] | [] | %{
"castore": {:hex, :castore, "1.0.5", "9eeebb394cc9a0f3ae56b813459f990abb0a3dedee1be6b27fdb50301930502f", [:mix], [], "hexpm", "8d7c597c3e4a64c395980882d4bca3cebb8d74197c590dc272cfd3b6a6310578"},
"earmark_parser": {:hex, :earmark_parser, "1.4.42", "f23d856f41919f17cd06a493923a722d87a2d684f143a1e663c04a2b93100682"... |
0b94fb0a69a222a5836d049b509007d6e2ca10d1 | 1,811 | [
206851892
] | [] | defmodule TcpEchoServer do
def start_server(port) do
IO.puts("starting server")
IO.inspect(self())
# start off with socket in passive mode, requires explicit recv to retrieve packets
case :gen_tcp.listen(port, [:binary, {:active, false}]) do
{:ok, listen_socket} ->
spawn_link(fn -> ac... |
0b954ea1cb7c341a3a61da8c9d49c829cc55b603 | 2,387 | [
619972170
] | [
"test",
"ecto"
] | defmodule PlantAid.PathologiesTest do
use PlantAid.DataCase
alias PlantAid.Pathologies
describe "pathologies" do
alias PlantAid.Pathologies.Pathology
import PlantAid.PathologiesFixtures
@invalid_attrs %{common_name: nil, scientific_name: nil}
test "list_pathologies/0 returns all pathologies" ... |
0b957e0bf574bd340f92235d5946174e7a58f8a9 | 2,476 | [
198521884
] | [
"typespec",
"documented"
] | defmodule Exnoops.Interviewbot do
@moduledoc """
Module to interact with Github's Noop: Interviewbot
See the [official `noop` documentation](https://noopschallenge.com/challenges/interviewbot) for API information including the accepted parameters.
"""
require Logger
import Exnoops.API
@doc """
Query ... |
0b95f94f25a81b54e601ec744f37e030cb92dbd1 | 3,157 | [
537132224
] | [
"test"
] | defmodule Cypher.CreateTest do
use ExUnit.Case
alias Cypher.{Create, Entity, MatchPattern, Node, Pattern, Query, Relation}
import Create
require Create
describe "create/2" do
test "compiles underliying pattern" do
assert create(%{a} - %{b}) == %Query{
clauses: [
%Create{
... |
0b9607d62fbb686da55532af4b700d4a4d567504 | 2,070 | [
534976905
] | [
"liveview",
"phoenix",
"test"
] | defmodule LiveviewChatWeb.MessageLiveTest do
use LiveviewChatWeb.ConnCase
import Phoenix.LiveViewTest
import Plug.HTML, only: [html_escape: 1]
alias LiveviewChat.Message
test "disconnected and connected mount", %{conn: conn} do
conn = get(conn, "/")
assert html_response(conn, 200) =~ "LiveView Chat"
... |
0b971a4b6ed5262b08115b5c5ba161c9f22d0332 | 3,237 | [
897051414
] | [
"ecto"
] | defmodule Advent2024ex.Day12 do
@day 12
alias Advent2024ex.Grid
def field_around(g, p, crop, found) do
cond do
# We've already been here
MapSet.member?(found, p) ->
found
# This is in the same field! Check the neighbours.
crop == Grid.at11(g, p) ->
Grid.linear_neighb... |
0b9761407b091c72185e3f93fa453cb725ca1c02 | 2,385 | [
262831656
] | [] | defmodule Solver do
def count_ones_and_threes(values, acc) when values == [], do: acc
def count_ones_and_threes([first | rest], {ones, threes, last}) do
diff = first - last
cond do
diff == 3 -> count_ones_and_threes(rest, {ones, threes + 1, first})
diff == 1 -> count_ones_and_threes(rest, {one... |
0b9777130f9263461db854ff1df17d3987a635a6 | 4,726 | [
220387708
] | [
"typespec",
"documented"
] | defmodule ExEffectiveBootstrap.Tags do
@moduledoc "Renders the html tags for each component"
alias ExEffectiveBootstrap.Options
alias Phoenix.HTML.Form
import Phoenix.HTML.Tag, only: [content_tag: 3]
defstruct label: nil,
input: nil,
valid: nil,
invalid: nil,
h... |
0b979e41afa70b1d670b3291a753b5494fc059a1 | 2,712 | [
106712767
] | [
"test"
] | defmodule Sanbase.Alert.RawSignalTriggerSettingsTest do
use Sanbase.DataCase, async: false
import Sanbase.Factory
import Sanbase.TestHelpers
alias Sanbase.Alert.UserTrigger
alias Sanbase.Alert.Evaluator
alias Sanbase.Alert.Trigger.RawSignalTriggerSettings
setup_all_with_mocks([
{
Sanbase.Time... |
0b979e6d2e9ae5b4d9fdaad16623aba9ef70b56a | 2,581 | [
95934500
] | [
"genserver"
] | defmodule ChatexClient.Connector do
use GenServer
require Logger
@server_controller_name Application.get_env(
:chatex_client, :server_controller_name, :chatex_server_controller)
def start_link(name) do
GenServer.start_link(__MODULE__, :ok, name: name)
end
def register(connector, username, key_ph... |
0b97b1235e9be2db1624fa6a5704cccfce118edd | 2,860 | [
696350997
] | [
"test"
] | defmodule DerbyLive.AccountTest do
use DerbyLive.DataCase, async: true
alias DerbyLive.Account.User
defp fifteen_minutes_in_the_future?(datetime) do
nowish =
DateTime.utc_now()
|> DateTime.to_naive()
|> NaiveDateTime.truncate(:second)
nowish < datetime && datetime < NaiveDateTime.add(... |
0b97d044ead4d5308de7fd83484ff38a29c1352e | 21,019 | [
586997694,
590156495,
790608551,
428103901,
834909069
] | [
"typespec",
"documented"
] | defmodule Solana.SPL.Token do
@moduledoc """
Functions for interacting with Solana's [Token
Program](https://spl.solana.com/token).
"""
alias Solana.{Instruction, Account, SystemProgram}
import Solana.Helpers
@typedoc "Token account metadata."
@type t :: %__MODULE__{
mint: Solana.key(),
... |
0b97f26251fe0d177737cf6823476d4b6105447e | 3,211 | [
84335867
] | [
"documented"
] | defmodule KnetikPlatformAPIDocumentationLatest.Api.Rule_Engine_Globals do
@moduledoc """
Documentation for KnetikPlatformAPIDocumentationLatest.Api.Rule_Engine_Globals.
"""
use Tesla
plug Tesla.Middleware.BaseUrl, "https://jsapi-integration.us-east-1.elasticbeanstalk.com"
plug Tesla.Middleware.JSON
@do... |
0b9839d3941f806558b6cdd12d2f0469b8a94dac | 3,534 | [
51496351
] | [] | defmodule Tasks do
def main(args) do
args |> parse_args |> setup
|> process_requests |> print_results
end
def run_benchmark(args) do
args |> setup
|> process_requests
end
defp parse_args(args) do
{options, _, _} = OptionParser.parse(args, [
switches: [url: :string, mul: :integer, ... |
0b983e4976fab53b38094d075597a265c41e0db9 | 6,094 | [
419820423
] | [
"documented",
"ecto"
] | defmodule Velocity.Contexts.Pto.Ledgers do
@moduledoc """
Ledgers represent all debits and credits to an employee's PTO.
Ledger entries should be immutable and PTO totals should be able to be calculated at any time by "restreaming" the entries.
"""
require Logger
alias Velocity.Repo
alias Velocity.Schem... |
0b98443be4c21b7cf17a4b4cc0f3d38c3bd855d3 | 1,575 | [
905418967
] | [
"liveview",
"phoenix"
] | defmodule SaberWeb.Endpoint do
use Phoenix.Endpoint, otp_app: :saber
# 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: "_saber_key",
... |
0b9848362ff9afad9f7144500fa1d781b9dd621c | 1,625 | [
221325080
] | [] | defmodule DayTwo do
def halt(prog, _) do
elem(prog, 0)
end
def add(prog, pos) do
op1 = elem(prog, elem(prog, pos+1))
op2 = elem(prog, elem(prog, pos+2))
dest = elem(prog, pos+3)
prog2 = put_elem(prog, dest, op1+op2)
{prog2, pos+4}
end
def mul(prog, pos) do
op1 = elem(prog, elem(pro... |
0b9864f5a3f06bdc0cb22eaa53fce05aec34aa03 | 4,630 | [
61494195
] | [
"test",
"ecto"
] | defmodule PersonTest do
use ExUnit.Case
import Ecto.Query
doctest Person
setup_all do
Repo.delete_all(Person)
Repo.delete_all(Company)
Repo.delete_all(PaperTrail.Version)
%Company{}
|> Company.changeset(%{name: "Acme LLC", website: "http://www.acme.com"})
|> Repo.insert()
%Compan... |
0b998db6f3d26fbd553301f0e078172812882cb2 | 1,745 | [
575256469
] | [] | defmodule DayTenPartOne do
@initial_value 1
@ending_addx_cycle 2
@starting_addx_cycle 1
@starting_cycle 1
@store []
@desired_cycles [20, 60, 100, 140, 180, 220]
def run do
get_input()
|> recur(@initial_value, @starting_addx_cycle, @starting_cycle, @store)
|> Enum.sum()
end
defp recur([],... |
0b9a12f27ee8afe185f376c670f3de1058f38292 | 2,986 | [
320129980
] | [] | defmodule Aoc2021.Day14 do
use Aoc2021
def handle_input(input) do
[template, instructions] = String.split(input, "\n\n", trim: true)
%{
pairs: parse_pairs(String.graphemes(template)),
letter_counts: parse_letter_counts(template),
instructions: parse_instructions(instructions)
}
end... |
0b9ab44bae3fb606683cd60c5df1bf27490e8c9d | 1,897 | [
52919623
] | [
"phoenix"
] | defmodule ScheduleApp.AppController do
use ScheduleApp.Web, :controller
##
## @brief Schedule action
##
## @param conn The connection
## @param params The parameters
##
def schedule(conn, params) do
module = "schedule"
token = params["token"]
u... |
0b9abab79fe1128b80a70d4d43114598cbf5fdb4 | 1,793 | [
937765580
] | [
"ecto"
] | defmodule MiniLand.Auth do
use Joken.Config
alias MiniLand.Auth.User
alias MiniLand.Users
def sign_in(%{username: username, password: password}) do
user = Users.get_user_by_username(username)
validate_user(user, password)
end
def sign_up(attrs) do
attrs = Map.put(attrs, :password, Bcrypt.hash... |
0b9b1b0b3d43cdbd23205cde94d88876ba3340b9 | 1,649 | [
398273707
] | [
"liveview",
"phoenix"
] | defmodule PhoenixReactWeb.Endpoint do
use Phoenix.Endpoint, otp_app: :phoenix_react
# 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: ... |
0b9b1ed6d760a5ef836c9a4b31624e255a476b05 | 12,910 | [
999222696
] | [
"documented"
] | defmodule ExLLM.Adapters.Mistral do
@moduledoc """
Mistral AI API adapter for ExLLM.
Mistral AI provides state-of-the-art language models including:
- Mistral Large: Most capable model for complex reasoning
- Mistral Medium: Balanced model for most use cases
- Mistral Small: Fast and cost-effective model... |
0b9be5b91c631355694ced86774f5114f7905dfe | 2,729 | [
241655267
] | [
"typespec",
"ecto"
] | defmodule Shop.Accounts.User do
use Ecto.Schema
import Ecto.Changeset
alias Shop.Sessions.Session
alias Shop.Orders.Order
@type t :: %__MODULE__{
id: integer,
name: String.t(),
email: String.t(),
phone: String.t(),
role: String.t(),
password_hash:... |
0b9bfd400640efa1e25d74ccfbc18de505a80ad4 | 3,866 | [
66892894
] | [
"documented"
] | defmodule XAdmin.Paginate do
@moduledoc false
use Xain
import XAdmin.Theme.Helpers
import XAdmin.Gettext
def paginate(_, nil, _, _, _, _, _), do: []
def paginate(link, page_number, page_size, total_pages, record_count, name) do
markup do
theme_module(Paginate).wrap_pagination1 fn ->
if to... |
0b9c17cefebfd12b3ec23b59a55953e8a60bdf34 | 4,702 | [
730068397
] | [] | #!/usr/bin/env elixir
defmodule P1 do
def remap(hand, j \\ ?B) do
for c <- String.to_charlist(hand) do
case c do
?A -> ?E
?K -> ?D
?Q -> ?C
?J -> j
?T -> ?A
_ -> c
end
end
end
def is_five_of_a_kind([c0, c1, c2, c3, c4]) do
c0 == c1 && c1 ==... |
0b9c469eaae2706dbca9e30d4b5598467a0e742d | 2,739 | [
726050716
] | [] | defmodule Day2 do
def solve(path, validator) do
{:ok, input} = File.read(path)
res = input
|> String.split("\n")
|> collect_input()
|> Enum.filter(&Day2.Game.is_valid(&1, validator))
|> Enum.reduce(0, fn i, acc -> i.idx + acc end)
IO.puts(res)
end
def solve2(path) do
{:ok,... |
0b9c8236fdabc069d553e996d375189f0d462d89 | 2,295 | [
950082227
] | [
"phoenix"
] | defmodule ETitleWeb.AccountSettingsController do
use ETitleWeb, :controller
alias ETitle.Accounts
alias ETitleWeb.AccountAuth
plug :assign_email_and_password_changesets
def edit(conn, _params) do
render(conn, :edit)
end
def update(conn, %{"action" => "update_email"} = params) do
%{"current_pas... |
0b9d73e6e02ba054b9b2746611e19f6ec818c96a | 4,713 | [
256574281,
727933089
] | [
"genserver"
] | defmodule Assignment.HistoryKeeperWorker do
use GenServer
defstruct [pair: nil, history: [],
frames: [{Application.get_env(:assignment, :from),
Application.get_env(:assignment, :until)}] ]
def start_link(args) do
pair = args[:pair] ||
raise "Created a CoindataRetriever worker without pa... |
0b9dafbd198ba38b02cc7d8170725b9a0a66893c | 1,868 | [
44490645
] | [
"supervisor",
"documented"
] | defmodule Detectino.Application do
@moduledoc false
use Application
alias DtWeb.Endpoint
alias DtWeb.ReloadRegistry
require Logger
# See http://elixir-lang.org/docs/stable/elixir/Application.html
# for more information on OTP Applications
def start(_type, _args) do
import Supervisor.Spec, warn: f... |
0b9dbd43c2172e3e9950d142661918aed675b563 | 1,710 | [
134136100
] | [
"documented",
"ecto"
] | defmodule Yamato.Stories do
@moduledoc """
The Stories context.
"""
import Ecto.Query, warn: false
alias Yamato.Repo
alias Yamato.Stories.Story
@doc """
Returns the list of stories.
## Examples
iex> list_stories()
[%Story{}, ...]
"""
def list_stories do
Repo.all(Story)
end
... |
0b9f1d3b341e1f3ab427512c3c62145b324f32d5 | 3,924 | [
132611629,
113243729
] | [
"test"
] | defmodule Sippet.Transports.Worker.Test do
use ExUnit.Case, async: false
alias Sippet.Transports.Worker, as: Worker
import Mock
test "incoming datagram, empty body" do
with_mocks [
{Sippet.Transports.Pool,
[],
[check_in: fn _ -> :ok end]
},
{Sippet.Transactions,
... |
0b9f26a67b04a6006abf546bc2a1403f5f65e013 | 1,915 | [
573386007
] | [
"test",
"ecto"
] | defmodule Upload17.PeopleTest do
use Upload17.DataCase
alias Upload17.People
describe "people" do
alias Upload17.People.User
import Upload17.PeopleFixtures
@invalid_attrs %{name: nil, photo_url: nil}
test "list_people/0 returns all people" do
user = user_fixture()
assert People.li... |
0b9f513817f3cec10dba3089501a3c20625845f4 | 2,823 | [
64593313
] | [
"typespec",
"documented"
] | defmodule Serum.Page do
@moduledoc """
Defines a struct describing a normal page.
## Fields
* `file`: Source path
* `type`: Type of source file
* `title`: Page title
* `label`: Page label
* `group`: A group the page belongs to
* `order`: Order of the page within its group
* `url`: Absolute URL of t... |
0b9f6ec8622e528523bad287f2d27e0db803feef | 11,789 | [
942811655,
920024200
] | [
"test"
] | defmodule Secrethub.OpenIDConnect.JWTFilterTest do
use ExUnit.Case
use Secrethub.DataCase
alias Secrethub.OpenIDConnect.{JWTConfiguration, JWTFilter}
import Mock
alias Ecto.UUID
alias Support.FakeServices
describe "filter_claims/3 with map input" do
test "returns unmodified claims when filter is dis... |
0b9fb732cabeda39bd21a3c7f6dfbd499fc8e963 | 1,942 | [
290290704
] | [
"macro",
"documented",
"phoenix"
] | defmodule DidIStutterWeb 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 DidIStutterWeb, :controller
use DidIStutterWeb, :view
The definitions below will be executed for every view,
... |
0b9ffd03858df3d770ea36403a682a1745c6323f | 5,527 | [
121171214
] | [
"documented"
] | defmodule MangoPay.Reporting do
@moduledoc """
Functions for MangoPay [reporting](https://docs.mangopay.com/endpoints/v2.01/reporting#e824_the-report-object).
"""
use MangoPay.Query.Base
set_path "reports"
@doc """
Get a reporting.
## Examples
{:ok, reporting} = MangoPay.Reporting.get(id)
"""... |
0ba00bcb0092be16106a9bd378c2bdc3cf7defa8 | 10,160 | [
194607129
] | [
"typespec"
] | defmodule BattleshipsArmada.Core.GameState do
@ship_type %{
destroyer: 2,
cruiser: 3,
submarine: 4,
battleship: 5,
carrier: 6
}
@cell_type %{
unknown: 0,
water: 1,
hit: 2,
sunk: 3
}
@grid_width 10
@grid_height 10
@horizontal 0
@vertical 1
@grid_state %{
0 =>... |
0ba0110d52f6705bbc10173a688b1436756d1b98 | 2,783 | [
148727245
] | [
"test"
] | defmodule PhxBlogWeb.ArticleControllerTest do
use PhxBlogWeb.ConnCase
alias PhxBlog.Articles
@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(:article) do
{:ok, article} ... |
0ba036d18318d0250cd3f5aad9562a01bf92bfdf | 8,351 | [
431226851
] | [
"typespec",
"documented"
] | defmodule Day07 do
@moduledoc """
Day 7 of Advent of Code 2022.
"""
defmodule State do
@moduledoc """
Represents the current path and accumulated directory structure.
"""
defstruct path: [], structure: %{}
end
defmodule Directory do
@moduledoc """
Represents a given directory.
... |
0ba060d4c4c118ff2bb7167a3fba9fba361e1773 | 1,894 | [
232817143
] | [] | defmodule Solution do
def check_prefix(_list, _check_string, false), do: false
def check_prefix([], _check_string, is_valid) do
is_valid
end
def check_prefix([head | tail], check_string, is_valid) do
check_string = cond do
head == "R" ->
%{check_string |... |
0ba072182009b0da334656a81ef7bfec55895fe4 | 3,416 | [
141916940
] | [
"phoenix"
] | defmodule TennisWeb.Authorize do
import Plug.Conn
import Phoenix.Controller
import TennisWeb.Router.Helpers
# This function can be used to customize the `action` function in
# the controller so that only authenticated users can access each route.
# See the [Authorization wiki page](https://github.com/river... |
0ba0c86b20d0113005f351979667be95c2b913d1 | 2,272 | [
266804057
] | [
"genserver",
"typespec"
] | defmodule TakeANumberDeluxe do
use GenServer
alias TakeANumberDeluxe.State
@spec start_link(keyword()) :: {:ok, pid()} | {:error, atom()}
def start_link(args) do
GenServer.start_link(TakeANumberDeluxe, args)
end
@impl GenServer
def init(args) do
case State.new(
Keyword.get(args, :min_... |
0ba0cc5d42a6c186efcf2e29c12614257143842a | 2,917 | [
394497338
] | [
"liveview"
] | defmodule ParpartyWeb.Event.Players.ScorecardLive do
use ParpartyWeb, :live_view
alias Parparty.Event
alias Phoenix.PubSub
@impl true
def mount(params, _session, socket) do
event = Event.get_event_by_guid!(params["guid"], [:course, players: [:event]])
players = get_scorecard_players(event.players, ... |
0ba18584e75151f065094f46a9b8f94179a1e3d2 | 8,013 | [
969141422
] | [
"test"
] | defmodule Vincent.AI.ChainTest do
use ExUnit.Case, async: true
alias Vincent.AI.Chain
alias LangChain.Message
alias LangChain.Function
require Logger
# Mock MCPRouter behavior
defmodule MockMCPRouter do
def list_tools do
{:ok,
%Hermes.MCP.Response{
result: %{
"tools" ... |
0ba1d0403d6afeb7b6f39a51a5858c0e995e1f6b | 6,271 | [
28659137,
130437554,
606377857
] | [
"test"
] | defmodule Maru.Builder.ParamsTest do
use ExUnit.Case, async: true
alias Maru.Builder.Parameter, as: P
alias P.Information, as: PI
alias P.Dependent, as: D
alias P.Dependent.Information, as: DI
alias P.Validator, as: V
alias P.Validator.Information, as: VI
test "optional requires group" do
defmodul... |
0ba1dd44b9ab6888cf779a762eb98efb3a6cb7aa | 3,016 | [
981784524
] | [] | defmodule NebulexRedisAdapter.MixProject do
use Mix.Project
@source_url "https://github.com/cabol/nebulex_redis_adapter"
@version "2.4.2"
@nbx_tag "2.6.4"
@nbx_vsn "2.6"
def project do
[
app: :nebulex_redis_adapter,
version: @version,
elixir: "~> 1.12",
elixirc_paths: elixirc_p... |
0ba3116b8982fba7d466600d9d410d7dc23df0f8 | 1,530 | [
175689866
] | [] | defmodule Mix.Tasks.Matcher do
use Mix.Task
## http://blog.plataformatec.com.br/2015/10/mocks-and-explicit-contracts/
@shortdoc "runs the handle match function many different ways."
def matcher( input ) do
PatternMatcher.handle_match(input)
|> IO.inspect()
end
def recursive_function_matcher(f) do
... |
0ba322f299827440b2f0cc00f09cabf98a947775 | 1,535 | [
358957365
] | [
"test",
"ecto"
] | defmodule ExMon.TrainerTest do
use ExMon.DataCase
alias ExMon.Trainer
describe "changeset/1" do
test "when all params are valid, returns a valid changeset" do
params = %{name: "Cesar", password: "123456"}
response = Trainer.changeset(params)
assert %Ecto.Changeset{
changes... |
0ba359fa3f68ee2cc0e90ea02ae9151cbd143a2f | 1,790 | [
148329190
] | [
"typespec",
"documented"
] | defmodule AttestationApi.Factories do
@moduledoc false
use ExMachina.Ecto, repo: AttestationApi.Repo
alias AttestationApi.DigitalVerifications.DigitalVerification
alias AttestationApi.DigitalVerifications.DigitalVerificationDocument
alias Ecto.UUID
### Factories
@spec digital_verification_factory :: %... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.