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
0a90a915840a230b0535c2f2391c4852985a8f0c
1,695
[ 446021413 ]
[]
# 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 :react, ecto_repos: [React.Repo] # Configur...
0a913e0d213ddc6fd5d2fd3718f42edbc1d52a17
1,974
[ 193244709, 101434552, 198908023 ]
[ "typespec", "documented" ]
defmodule GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestUpdateSelectionChoicePropertiesRequest do @moduledoc """ Request to update a Choice properties. ## Attributes * `fieldId` (*type:* `String.t`, *default:* `nil`) - Required. The Selection Field to update. * `id` (*type...
0a91842c3bef99cc42787070022d7bbb696542cd
2,004
[ 606310479 ]
[ "phoenix", "ecto" ]
defmodule FarmWeb.CowController do use FarmWeb, :controller alias Farm.Animals alias Farm.Animals.Cow alias Farm.HR.Patron import Ecto.Query def index(conn, _params) do preloads = [:patron, ] cows = Animals.list_cows(preloads: preloads) render(conn, "index.html", cows: cows) end def new...
0a91a69da4c30372a1fb83292581f089fdd4c968
3,981
[ 498670178 ]
[]
defmodule Bot.LightPriceBot do @bot :bot @pidGetHoras :pidHoras @pidSubs :pidSubs #Subs.createSub(@pidGetHoras,@pidSubs) use ExGram.Bot, name: @bot, setup_commands: true command("start") command("help", description: "Prints LightPrice instructions") command("pricenow",description: "Return...
0a91bd337e21a6ef7e60d7fea176d8e5a93f5ff8
1,756
[ 250904436 ]
[ "typespec" ]
defmodule Kleened.Core.Volume do alias Kleened.Core.{ZFS, Config, Utils, Mount, MetaData} alias Kleened.API.Schemas require Config require Logger alias __MODULE__, as: Volume @type t() :: %Schemas.Volume{} @spec create(String.t()) :: Volume.t() def create(name) do case MetaData.get_volume(name) d...
0a923baaa56a502b396d31da51301932bab8e430
7,362
[ 251351468 ]
[ "documented", "ecto" ]
defmodule ApiApp.Images do @moduledoc """ The Images context. """ import Ecto.Query, warn: false alias ApiApp.Repo alias ApiApp.{Repo, ImageHandler} alias ApiApp.Images.{Tag, Category, Image} @doc """ Returns the list of tag. ## Examples iex> list_tag() [%Tag{}, ...] """ def li...
0a92a74641092854260d3ea441663b771a0c3883
6,085
[ 935778085 ]
[ "documented" ]
defmodule WandererNotifier.Shared.Logger.Logger do @moduledoc """ Simplified logging module for WandererNotifier. This replaces the complex logging infrastructure with simple delegations to Elixir's Logger. Provides minimal metadata handling and category helpers without macros or behaviors. """ require Lo...
0a930810bae20c60028929b6de7e01421a58fb17
10,164
[ 1000098230 ]
[ "liveview", "documented" ]
defmodule FrixelDesignSystem.Components.Company do use Phoenix.Component alias FrixelDesignSystem.Components.{Button, Header, Menu} @doc """ Component to render your company logo and name as a h1 title ## Example: <.branding brand_name="My Awesome Company" brand_img="path/to/my/awesome/company.jpg" ...
0a9323125e08ffe0bd6d6e72aa15d5e10ec2aff5
18,170
[ 744421640, 567369526 ]
[ "test", "ecto" ]
defmodule Indexer.Fetcher.ContractCodeTest do use EthereumJSONRPC.Case, async: false use Explorer.DataCase import EthereumJSONRPC, only: [integer_to_quantity: 1] import Mox alias Explorer.Chain.{Address, Transaction} alias Indexer.Fetcher.ContractCode @moduletag :capture_log # MUST use global mode ...
0a93a9d2caae1180187d874b7b60945afa2cae01
3,814
[ 554311940 ]
[]
%{ "connection": {:hex, :connection, "1.1.0", "ff2a49c4b75b6fb3e674bfc5536451607270aac754ffd1bdfe175abe4a6d7a68", [:mix], [], "hexpm", "722c1eb0a418fbe91ba7bd59a47e28008a189d47e37e0e7bb85585a016b2869c"}, "db_connection": {:hex, :db_connection, "2.4.2", "f92e79aff2375299a16bcb069a14ee8615c3414863a6fef93156aee8e86c2f...
0a93afbb13a4a5e5af752f447a9dc8735dd622ab
7,246
[ 82310689, 29477144 ]
[]
defmodule ElixirSense.Core.State do defstruct [ namespace: [:Elixir], scopes: [:Elixir], imports: [[]], requires: [[]], aliases: [[]], attributes: [[]], scope_attributes: [[]], behaviours: [[]], scope_behaviours: [[]], vars: [[]], scope_vars: [[]], m...
0a94794679431347bacc3a10d2c40775ffcb99a9
1,762
[ 101606715 ]
[ "documented", "ecto" ]
defmodule Convertex do @moduledoc """ Convertex keeps the contexts that define your domain and business logic. Contexts are also responsible for managing your data, regardless if it comes from the database, an external API or others. """ import Meeseeks.{CSS, XPath} import Ecto.Query, only: [from: 2] ...
0a948927dee026ec6365a9791965d056b14268b4
3,678
[ 942811655, 920024200 ]
[]
defmodule Support.Factories.Notification do def build(name, params \\ %{}) do Map.merge( %{ org_id: Ecto.UUID.generate(), name: name }, params ) end def api_model(name) do alias Semaphore.Notifications.V1alpha.Notification alias Notification.{Metadata, Spec} ...
0a94cb5732ae15e7197a01222604cd3b9a634286
5,581
[ 78172488, 416718986, 641017241 ]
[ "typespec", "macro", "documented" ]
defmodule Shopify.Resource do defmacro __using__(options) do import_functions = options[:import] || [] quote bind_quoted: [import_functions: import_functions] do alias Shopify.{Client, Request, Session} if :find in import_functions do @doc """ Requests a resource by id. ...
0a94f42d60f9fd63f06bde302c842758ba79d95d
1,513
[ 383340007 ]
[ "typespec", "documented" ]
defmodule GoogleApi.Compute.V1.Model.CustomerEncryptionKey do @moduledoc """ ## Attributes * `kmsKeyName` (*type:* `String.t`, *default:* `nil`) - The name of the encryption key that is stored in Google Cloud KMS. * `kmsKeyServiceAccount` (*type:* `String.t`, *default:* `nil`) - The service account being...
0a94fe6f611b77d38ae101b414967c2b7459d8ed
6,725
[ 927234821, 492752264, 327711808, 554455380 ]
[ "test" ]
defmodule Livebook.AppsTest do use ExUnit.Case, async: true import ExUnit.CaptureLog import Livebook.HubHelpers alias Livebook.Apps alias Livebook.Utils describe "build_app_specs_in_dir/1" do @tag :tmp_dir test "skips apps with incomplete config and warns", %{tmp_dir: tmp_dir} do app_path =...
0a95f88a9d4d3227295a4ae4c9c3eecb3648a256
1,657
[ 590129828 ]
[ "test" ]
defmodule EcommerceCourse.UsersTest do use EcommerceCourse.DataCase import EcommerceCourse.Factory alias EcommerceCourse.Users describe "list_users/0" do test "return empty list if doesn't have users" do assert Users.list_users() == [] end test "return one user in list" do user = inse...
0a95fe0066d8f58546e9d7207c0346217cc82c2a
2,871
[ 740251439 ]
[ "genserver", "liveview" ]
defmodule FinstaWeb.HomeLive do use FinstaWeb, :live_view alias Finsta.Posts alias Finsta.Posts.Post @impl true def render(%{loading: true} = assigns) do ~H""" Finsta is loading ... """ end def render(assigns) do ~H""" <h1 class="text-2xl">Finsta</h1> <.button type="button" ph...
0a96080a3295364b3f6c59406b106719e21a0777
1,545
[ 1014133905 ]
[]
[ # These functions work correctly in practice but Dialyzer can't analyze the complex call chains # involving Runtime.create_schema, Runtime.validate, and TypeAdapter calls ~r/lib\/exdantic\/enhanced_validator\.ex:118.*Function validate_wrapped.* has no local return/, ~r/lib\/exdantic\/enhanced_validator\.ex:12...
0a9633658e5a0437fb136ee12af929ee80b2351a
1,844
[ 445630374 ]
[ "liveview" ]
defmodule PentoWeb.WrongLive do use PentoWeb, :live_view def mount(_params, session, socket) do winning_number = generate_winning_number() {:ok, assign(socket, score: 0, message: "Guess a number", user: Pento.Accounts.get_user_by_session_token(session["user_token"]), sessi...
0a965acfb202318cced0168693f1d717f9657357
3,738
[ 388572540 ]
[ "typespec", "documented" ]
defmodule Tagger do alias Git @moduledoc """ Module that offers helper methods for tag. """ @spec create_tag(%Git.Repository{}, String.t()) :: IO.puts() def create_tag(tag_name, repo) do IO.puts("Creating tag #{tag_name}...\n") case Git.tag(repo, tag_name) do {:ok, _} -> tag_name {:er...
0a965c3469fa1edbd4478c9ad2b587a57d89e154
2,016
[ 103824045 ]
[ "test" ]
if !System.get_env("EXERCISM_TEST_EXAMPLES") do Code.load_file("change.exs", __DIR__) end ExUnit.start ExUnit.configure exclude: :pending, trace: true defmodule ChangeTest do use ExUnit.Case # @tag :pending test "single coin change" do coins = [1, 5, 10, 25, 100] expected = [25] assert Change.gen...
0a9683922962a6b198e8a1102a23679a8ac392fd
9,202
[ 571776611 ]
[ "test" ]
defmodule Pleroma.HTMLTest do alias Pleroma.HTML alias Pleroma.Object alias Pleroma.Web.CommonAPI use Pleroma.DataCase, async: true import Pleroma.Factory @html_sample """ <b>this is in bold</b> <p>this is a paragraph</p> this is a linebreak<br /> this is a link with allowed "r...
0a96afd7cb4afba3957464c6ccc63a79880b8a50
3,210
[ 558575089 ]
[ "typespec", "documented", "ecto" ]
defmodule ApiKeyMgmt.ApiKey do @moduledoc """ A schema struct describing an ApiKey. Please note how access_token is required for issue changeset, but the field itself is virtual. """ use Ecto.Schema @type(status() :: :active, :revoked) @type t() :: %__MODULE__{ __meta__: term(), acc...
0a97171099c2e59f799963ad0e9024ca3338114f
6,716
[ 193244709, 101434552, 198908023 ]
[ "typespec", "documented" ]
defmodule GoogleApi.Domains.V1beta1.Model.Registration do @moduledoc """ The `Registration` resource facilitates managing and configuring domain name registrations. There are several ways to create a new `Registration` resource: To create a new `Registration` resource, find a suitable domain name by calling the `Se...
0a974e1387ffc857ca3db55ce7b4f46caed40d0a
24,830
[ 1010122054 ]
[ "test" ]
defmodule Astrup.ParameterTest do use ExUnit.Case, async: true alias Astrup.Lab.Fimlab alias Astrup.Parameter describe "get_label/1" do test "returns correct label for pH" do assert Parameter.get_label(:ph) == "pH" end test "returns correct label for pco2" do assert Parameter.get_labe...
0a97501e84ab3e8220a9341fd45d88ac2efffe98
2,383
[ 51689848 ]
[ "test", "liveview" ]
defmodule WatcherTest do use ExUnit.Case doctest Watcher import Watcher @manager WatcherTest.Manager @handler WatcherTest.Handler defmodule Handler do use GenEvent # def handle_event(:stop, state) do # Process.exit(self, :normal) # end end test "init adds monitored handler" do ...
0a9822182e492418cfa0ac0d7d0a204ff9c358f1
4,465
[ 435986672 ]
[]
defmodule DiskUtils do require Integer def defragment(disk) do defragment(disk, 0, length(disk) - 1) end defp defragment(disk, left, right) when left >= right do disk end defp defragment(disk, left, right) do left_blob = Enum.at(disk, left) right_blob = Enum.at(disk, right) case {lef...
0a984371b713f822ac9a90ecf9fcc86c3b465b92
1,796
[ 607729034, 803809623 ]
[ "test" ]
defmodule Mix.Tasks.Operately.Gen.Operation.Task do use ExUnit.Case alias Mix.Tasks.Operately.Gen.Operation import Mock test "runs the generation without errors" do mocks = [ { Mix.Operately, [:passthrough], [ generate_file: fn _path, generator -> IO.puts(generator...
0a98a2f0e37fafdfed076c86e94fbe998812f6d3
2,415
[ 904399333 ]
[ "test", "documented" ]
# credo:disable-for-this-file Credo.Check.Readability.LargeNumbers # credo:disable-for-this-file Credo.Check.Readability.StringSigils defmodule JSV.Generated.Draft202012.DecimalValues.MultipleOfTest do alias JSV.Test.JsonSchemaSuite use ExUnit.Case, async: true @moduledoc """ Test generated from deps/json_sch...
0a98b054bc86cf4bbae7e23116b97edc28571be8
11,796
[ 352003593 ]
[ "typespec" ]
defmodule Kousa.Room do alias Kousa.Utils.RegUtils alias Kousa.Utils.VoiceServerUtils alias Beef.Users alias Beef.Follows alias Beef.Rooms # note the following 2 module aliases are on the chopping block! alias Beef.RoomPermissions alias Beef.RoomBlocks def set_auto_speaker(user_id, value) do room...
0a98c2feca19409c98a697ceb11238fd4029f814
6,359
[ 726417643 ]
[ "documented" ]
defmodule Console.Deployments.Git.Cache do @moduledoc """ Implements a simple filesystem generational cache on top of git. There are two main operations: * fetch(cache, ref, path) -> check out the given git ref and return a tarball at that path, within the cache dir * refresh(cache) -> wipe the directory of t...
0a98d657680005ca17deb5f98b6885585f2151fd
8,870
[ 56907842 ]
[ "test", "phoenix" ]
defmodule Phoenix.Router.ResourcesTest do use ExUnit.Case, async: true use RouterHelper defmodule UserController do use Phoenix.Controller def show(conn, _params), do: text(conn, "show users") def index(conn, _params), do: text(conn, "index users") def new(conn, _params), do: text(conn, "new user...
0a994403aa153b16819713ee881ba883c09d3c95
2,888
[ 726292293 ]
[ "documented" ]
defmodule AdventOfCode.Day3 do def example_data() do """ 467..114.. ...*...... ..35..633. ......#... 617*...... .....+.58. ..592..... ......755. ...$.*.... .664.598.. """ |> String.split("\n") |> Stream.map(&String.trim/1) |> Stream.reject(&(&1 == "")) end...
0a995510f8029e1e6d5336694be10eccf7941c7a
2,526
[ 474921216 ]
[ "test", "ecto" ]
defmodule IndistreetApi.Admin.AlbumTest do use IndistreetApi.DataCase alias IndistreetApi.Admin.Music describe "albums" do alias IndistreetApi.Model.Music.Album import IndistreetApi.AlbumFixture test "list_albums/1 returns all albums" do albums = multiple_album_fixtures() assert Music....
0a99ab9aef4b334ceee339a63b9fa2e2c98126b6
4,522
[ 419435907 ]
[ "liveview" ]
defmodule OliWeb.Components.Delivery.UserAccountMenu do use OliWeb, :html import OliWeb.Components.Delivery.Utils alias Oli.Accounts.{Author, SystemRole} alias OliWeb.Router.Helpers, as: Routes alias Oli.Delivery.Sections alias Oli.Delivery.Sections.Section alias OliWeb.Common.SessionContext alias Oli...
0a9a893e40d62be7859ccd7b019c58c70d74b645
2,497
[ 241726833 ]
[ "test" ]
defmodule HeapTest do use ExUnit.Case, async: true use ExUnitProperties doctest Heap test "test from_list_1" do lst = Enum.shuffle(for n <- 1..100, do: n) heap = Heap.from_list(lst) assert heap.size == length(lst) end property "test from_list_2" do check all list <- list_of(integer()), ...
0a9aefea57a7f40c42116e382bb7d5e4a57500b7
3,517
[ 137495436 ]
[ "test" ]
defmodule DropAlleyWeb.AddressControllerTest do use DropAlleyWeb.ConnCase alias DropAlley.UserInformation @create_attrs %{active: true, addr: "some addr", city: "some city", contact_no: "some contact_no", pincode: "some pincode", state: "some state", street: "some street"} @update_attrs %{active: false, addr:...
0a9b65fbc69cf1e5b87f5b4ba130f4a27e7aa64d
2,806
[ 97175599 ]
[ "test" ]
defmodule Tommychallenge.Web.SubmissionControllerTest do use Tommychallenge.Web.ConnCase alias Tommychallenge.Challenges alias Tommychallenge.Challenges.Submission @create_attrs %{artist: "some artist", downvotes: 42, link: "some link", title: "some title", upvotes: 42} @update_attrs %{artist: "some updated...
0a9bb3b8e02881ced1f3146b3abb47bd6a64a413
5,379
[ 20609272 ]
[ "phoenix" ]
defmodule ExMidilib.MidiPlayer do alias ExMidilib.Midifile alias ExMidilib.AuGenerator require Record Record.defrecordp :on, [:ticks, :controller, :note, :amplitude] Record.defrecordp :off, [:ticks, :controller, :note, :amplitude] Record.defrecordp :note, [:start, :length, :controller, :note, :amplitude] ...
0a9c1c1450f209ab7dc2f2c5d4f564f83631d64e
2,359
[ 813259763 ]
[]
defmodule Courses.MixProject do use Mix.Project def project do [ app: :courses, version: "0.1.0", elixir: "~> 1.14", elixirc_paths: elixirc_paths(Mix.env()), start_permanent: Mix.env() == :prod, aliases: aliases(), deps: deps() ] end # Configuration for the OT...
0a9c9c3f369ec187293aa34179f5796591999024
2,409
[ 143882854 ]
[ "documented", "ecto" ]
defmodule HolidayApp.Users.User do use Ecto.Schema import Ecto.Changeset schema "users" do field :email, :string field :password_hash, :string field :uid, :string field :provider, :string, default: "identity" field :name, :string field :photo_url, :string, size: 2048 field :hosted_...
0a9ca3faa49ea4b7d4043d6212225338736993fe
3,719
[ 570041058 ]
[ "documented" ]
defmodule Sicp.Ch1.S2.Ex20 do @moduledoc """ Task: The process that a procedure generates is of course dependent on the rules used by the interpreter. As an example, consider the iterative `gcd` procedure given above. Suppose we were to interpret this procedure using normal-order evaluation, as discussed i...
0a9cd588309bea73c44e9050c39d4931fd57eb94
3,815
[ 19828743 ]
[]
defmodule HaveAPI.Action.Output do import HaveAPI.Parameters, only: [as_map: 1, as_map_list: 1] def build(%HaveAPI.Request{} = req, data) do build( data, req.context.action.layout(:output), %HaveAPI.Response{context: req.context, conn: req.conn} ) end def build(:ok, nil, res) do ...
0a9d07883866fdd98c76f44ecd61aef7bcbc138b
16,937
[ 60716862, 66467062, 63931406, 63643631, 71519558, 68463570, 63304973, 63885140, 67626331, 61923005, 63335915 ]
[ "typespec", "documented" ]
defmodule Postgrex do @moduledoc """ PostgreSQL driver for Elixir. This module handles the connection to Postgres, providing support for queries, transactions, connection backoff, logging, pooling and more. Note that the notifications API (pub/sub) supported by Postgres is handled by `Postgrex.Notificat...
0a9d4201294d3841019c55f2c73df16c0c66f0d0
1,721
[ 337954430 ]
[]
defmodule Hierbautberlin.Importer.BerlinEconomy do alias Hierbautberlin.GeoData def import(http_connection \\ HTTPoison) do {:ok, source} = GeoData.upsert_source(%{ short_name: "BERLIN_ECONOMY", name: "Neubauprojekte in Berlin", url: "https://www.berlin.de/wirtschaft/bauprojekte/"...
0a9dc6bb4e51f3ec77ea96a4d638947212b6713c
2,395
[ 947834855 ]
[ "documented", "ecto" ]
defmodule MySuperApp.RowProcessor do alias MySuperApp.{Repo, Row} import Ecto.Query @moduledoc false def create_row(attrs \\ %{}) do %Row{} |> Row.changeset(attrs) |> Repo.insert() end def get_row!(id) do Repo.get(Row, id) end def get_list() do query = from(r in Row, order_by: [a...
0a9dccd6f147a3e53e445062dcad1470ee23c007
3,381
[ 322878234 ]
[ "macro", "documented" ]
defmodule Holobot.Telegram.Commands do @moduledoc """ Commands handler module. """ use Holobot.Telegram.Commander use Holobot.Telegram.Router alias Holobot.Telegram.Commands alias Holobot.Telegram.Commands.Inline require Logger command("start") do Logger.info("Command /start") send_message...
0a9dfedefcf6ceec945fb434fec7af1a73160da0
13,693
[ 85140385, 307413550 ]
[ "typespec", "documented" ]
defimpl Timex.Protocol, for: NaiveDateTime do @moduledoc """ This module implements Timex functionality for NaiveDateTime """ alias Timex.{Types, Duration} import Timex.Macros @epoch_seconds :calendar.datetime_to_gregorian_seconds({{1970,1,1},{0,0,0}}) @spec now() :: NaiveDateTime.t def now() do T...
0a9e1635666c40759e268ab921ae6464eb7c213c
15,488
[ 902394103 ]
[ "documented", "ecto" ]
defmodule Curatorian.Accounts do @moduledoc """ The Accounts context. """ import Ecto.Query, warn: false alias Curatorian.Repo alias Curatorian.Accounts.{Education, Follow, User, UserProfile, UserToken, UserNotifier} ## Database getters @doc """ Gets a user by email. ## Examples iex> get...
0a9e2fb9e4e0e33b3bb1fb4c170ce6fbaf4de69c
4,150
[ 305400964 ]
[ "test", "phoenix" ]
defmodule TimeManagerWeb.UserControllerTest do use TimeManagerWeb.ConnCase alias TimeManager.Account alias TimeManager.Account.User alias Plug.Test @create_attrs %{ email: "some email", is_active: true, password: "some password" } @update_attrs %{ email: "some updated email", is_activ...
0a9ec3f99d0a8ab360add765f31f2b6d14e860dc
3,405
[ 157420774 ]
[ "test", "phoenix" ]
defmodule BenjaminWeb.TransactionControllerTest do use BenjaminWeb.ConnCase alias Benjamin.Finanses.Factory @invalid_attrs %{amount: nil, date: nil, description: nil, type: "deposit"} setup %{user: user} do saving = Factory.insert!(:saving, account_id: user.account_id) budget = Factory.insert!(:budge...
0a9ee7239ab8f041c0bc571c6d75f45e9d478e70
1,521
[ 74290857 ]
[ "test" ]
defmodule OmegaClientTest do use ExUnit.Case import Mock alias Omega.Client defmodule Account do use Omega.Client @endpoint "account" @secret_key System.get_env("OMISE_SECRET_KEY") || "skey_xxx" def retrieve do get(@endpoint, @secret_key) end end test "make request without ke...
0a9eebb0ca193d59f258c6964f4621a5e59e4dc9
1,542
[ 981515687 ]
[]
defmodule Jiken.MixProject do use Mix.Project @source_url "https://github.com/NicolayD/jiken" @version "0.0.1" def project do [ app: :jiken, version: @version, elixir: "~> 1.18", start_permanent: Mix.env() == :dev, description: description(), deps: deps(), package...
0a9f0ae003333dd5db0de0791086dd0ed942c138
3,333
[ 297938161 ]
[ "ecto" ]
defmodule WebullClient.Assets do @ticker_base_url "https://quotes-gw.webullbroker.com/api/search/pc/tickers" @screener_url 'https://userapi.webullbroker.com/api/wlas/screener/ng/query' @headers [ {'accept', '*/*'}, {'pragma', 'no-cache'}, {'cache-control', 'no-cache'}, {'content-type', 'applicatio...
0a9f2ea5d492914ddd22676355ac4eb95f095839
2,356
[ 906632479 ]
[ "test" ]
defmodule StorageOperationTest do use ExUnit.Case import ExUnit.CaptureLog @test_file_path "#{System.tmp_dir()}/test_file.txt" @test_dir_path "#{System.tmp_dir()}/test_dir" setup do File.rm(@test_file_path) File.rm_rf(@test_dir_path) :ok end describe "write/2" do test "successfully writ...
0a9f6080c2ebb88b5832291b7254da20c56d3bee
6,306
[ 744281225, 116826798, 313251367 ]
[ "test" ]
defmodule EWalletAPI.V1.AuthControllerTest do use EWalletAPI.ConnCase, async: true alias Utils.Helpers.Crypto alias EWalletDB.{User, AuthToken} describe "/user.login" do setup do email = "<EMAIL>" password = "some_password" password_hash = Crypto.hash_password(password) user = inse...
0a9f8cabc0645f0c64083b1a46f33c30f1802eed
5,581
[ 697848022 ]
[ "phoenix" ]
defmodule AuditorActivityWeb.ProjectTypeController do use AuditorActivityWeb, :controller alias AuditorActivity.ProjectSettings alias AuditorActivity.Generic.ProjectType action_fallback AuditorActivityWeb.FallbackController # { # @api {get} /api/projecttypes Get Project Type List # @apiVersion 0.0....
0aa021a0fc7065fbc064069458f6cb1eb29dfdc4
1,986
[ 239822890, 419435907, 376959663, 459291087 ]
[ "ecto" ]
defmodule Oli.Repo.Migrations.GenerateSectionSlugs do use Ecto.Migration import Ecto.Query, warn: false alias Oli.Utils.Slug def change do # nothing to do end def up do # populate all section slugs that are null sections = Oli.Repo.all( from(s in "sections", where: is_...
0aa04afcc0501fb3c108dfdcf5f762038d5a6efd
2,084
[ 444331103 ]
[ "test", "ecto" ]
defmodule SlackMessenger.MessagesTest do use SlackMessenger.DataCase alias SlackMessenger.Messages setup do channel = insert!(:channel) message = insert!(:message, channel_id: channel.id) [channel: channel, message: message] end describe "messages" do alias SlackMessenger.Messages.Message ...
0aa0efbbcfc8734f1e52244116b285c378dac796
2,691
[ 274749830 ]
[]
defmodule Bonds.Details do use TypeStruct @currencies_map %{ "SUR" => "RUB", "USD" => "USD" } @bonds_types_map %{ "exchange_bond" => "Биржевая облигация", "corporate_bond" => "Корпоративная облигация", "municipal_bond" => "Муниципальная облигация", "subfederal_bond" => "Региональная об...
0aa0f2e535b7d59222ecb9d228fcdef6e8c9d7d5
8,187
[ 423405342 ]
[ "documented" ]
defmodule Comeonin.Password do @moduledoc """ Module to generate random passwords and check password strength. The `gen_password` function generates a random password with letters, digits and punctuation characters. The `strong_password?` function checks that the password is long enough, it contains at le...
0aa1027f8482c6843d88812e3e8d3cab29b93b90
4,766
[ 209394376 ]
[]
defmodule Project3.Modules do def hop(data,count,target) do me = self() if count == data["depth"] do {me,count} else j = elem( data["neighbour"], count ) pid = elem( target, count) next = Enum.reduce_while(0..15,me, fn i,_ -> ...
0aa2346fd976ba8e12cdb343b961df0a63f1fce0
3,058
[ 710724298 ]
[]
defmodule VmsCore.Vehicles.OVCS1.Composer.Dashboard.BatteryPage do alias VmsCore.Components.Evpt.Evpt23Charger alias VmsCore.Components.Orion.Bms2 def definition(order: order) do %{ name: "Battery", icon: "Battery50Icon", order: order, blocks: %{ "bms-status" => %{ o...
0aa2994c3386d984a119f706d1a0b5b34a78d736
6,034
[ 556161830, 585915775, 589089007, 589866492, 691980346, 215544723, 500260157, 691199358, 530308212 ]
[ "typespec", "ecto" ]
defmodule Pleroma.Filter do use Ecto.Schema import Ecto.Changeset import Ecto.Query alias Pleroma.Repo alias Pleroma.User @type t() :: %__MODULE__{} @type format() :: :postgres | :re schema "filters" do belongs_to(:user, User, type: FlakeId.Ecto.CompatType) field(:filter_id, :integer) fi...
0aa2b04f35349826e61cde97a79e14b06e641efa
1,619
[ 975204518 ]
[ "liveview", "documented" ]
defmodule Ralsei do use Nostrum.Consumer alias Nostrum.Api.Message alias Ralsei.Command.Coffee alias Ralsei.Command.Pokemon alias Ralsei.Command.Tmdb alias Ralsei.Command.Feriado alias Ralsei.Command.Yugioh alias Ralsei.Command.Breakingbad alias Ralsei.Command.Idade @moduledoc """ Documentation...
0aa36f4dcf212a931460835035556600d30db473
3,208
[ 489226142 ]
[ "typespec", "documented" ]
defmodule ExOtp.Base do @moduledoc """ Base file containing common functions for generating the One-time Password algorithms. """ alias ExOtp.Errors alias Base, as: ElixirBase use Bitwise @keys [ :secret, digits: 6, digest: :sha ] defstruct @keys @max_padding 8 @type t :: %__MODU...
0aa381926f8e61d86a2a9220afa5903a92d22c79
2,703
[ 370847109 ]
[ "typespec", "documented" ]
defmodule BMP3XX.BME680.Calibration do @moduledoc false defstruct [ :par_t1, :par_t2, :par_t3, :par_p1, :par_p2, :par_p3, :par_p4, :par_p5, :par_p6, :par_p7, :par_p8, :par_p9, :par_p10, :par_h1, :par_h2, :par_h3, :par_h4, :par_h5, :par_h6,...
0aa3884c6597a794059960e28cd27be5e3e1c2ca
1,504
[ 960882821 ]
[ "test" ]
defmodule AiManualops.PythonBridgeTest do use ExUnit.Case alias AiManualops.PythonBridge setup do # 테스트가 시작될 때 Python 브릿지가 실행 중인지 확인 :timer.sleep(100) # 브릿지 시작을 위한 짧은 대기 :ok end test "echo handler" do message = "Hello, Python!" assert {:ok, ^message} = PythonBridge.echo(message) end ...
0aa3a8563e5b236d0250b43e86274cd606ff9b99
2,095
[ 615171252 ]
[]
# 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 :test_fail, ecto_repos: [TestFail.Repo] # C...
0aa3dfbfc50f2fb3cf92cfa0437cc6c78014b8fa
1,900
[ 972274892 ]
[ "genserver", "liveview" ]
defmodule CooptourWeb.BranchLive.Show do use CooptourWeb, :live_view alias Cooptour.Corporate @impl true def render(assigns) do ~H""" <Layouts.app flash={@flash} current_scope={@current_scope}> <.header> Branch {@branch.id} <:subtitle>This is a branch record from your database.</...
0aa446793fc3e6601480692bf204cc2bae2cca2d
1,697
[ 158579207 ]
[ "phoenix" ]
defmodule Tucano.BancoController do use Tucano.Web, :controller plug Tucano.Plugs.RequireAuth alias Tucano.Banco def index(conn, _params) do bancos = Banco.get_all |> Enum.sort(&(&1.nome <= &2.nome)) render conn, "index.html", bancos: bancos end def new(conn, _params) do changes...
0aa45dc253832a8fd442b5d6bfde686d224a64c4
5,563
[ 471074805 ]
[ "test", "ecto" ]
defmodule Topshelf.InventoryTest do use Topshelf.DataCase import Topshelf.Factory alias Topshelf.Inventory describe "shelves" do alias Topshelf.Inventory.Shelf @invalid_attrs %{name: nil, description: nil} test "list_shelves/0 returns all shelves" do shelf = insert(:shelf) assert In...
0aa4c74001784fccad0a3662102d917939ef95a4
9,768
[ 641992573 ]
[ "documented" ]
defmodule Moneris.Transaction do @moduledoc """ Module for structuring transactions in Moneris. """ import SweetXml alias Moneris.{Card, Order, Response, TokenizedCard} def build_card(%Card{name: name, email: email, phone: phone, pan: pan, expdate: expdate} = card) do [ XmlBuilder.element(:cust...
0aa4d8f2dd3672264429464254566ad8ff8b2d0a
8,960
[ 133414028 ]
[ "genserver", "typespec", "documented" ]
defmodule SignsUi.Config.State do @moduledoc """ Keeps an internal state of all the signs """ use GenStage require Logger alias SignsUi.Config alias SignsUi.Config.ConfiguredHeadways alias SignsUi.Config.Sign alias SignsUi.Config.SignGroups alias SignsUi.Config.Utilities alias SignsUi.Signs ...
0aa516cd483aa82927e374ebbc8e6527c4e1265c
3,828
[ 277442283 ]
[ "test" ]
defmodule PatternMatching do use Koans @intro "PatternMatching" koan "One matches one" do assert match?(1, 1) end koan "Patterns can be used to pull things apart" do [head | tail] = [1, 2, 3, 4] assert head == 1 assert tail == [2, 3, 4] end koan "And then put them back together" do ...
0aa557080d01bb2d9615c4424b3b553fd25c441c
3,075
[ 606310479, 472065292 ]
[ "test", "phoenix" ]
defmodule FarmWeb.Arable_landControllerTest do use FarmWeb.ConnCase import Farm.LandFixtures @create_attrs %{description: "some description", number: 42, size: 120.5} @update_attrs %{description: "some updated description", number: 43, size: 456.7} @invalid_attrs %{description: nil, number: nil, size: nil} ...
0aa5fe692b5998d8f2c159ee71febe6f9aa42ef5
2,918
[ 643205087 ]
[ "liveview" ]
defmodule TideWeb.StationLive do use Phoenix.LiveView use TideWeb, :html require Logger def mount(_params = %{}, _session, socket) do peer_data = get_connect_info(socket, :peer_data) {:ok, geo_response} = peer_data.address |> :inet.ntoa() |> to_string |> GeoIP.lookup() [la...
0aa6f125c9fa8cf8d3489f240a4e56026b0c33bc
9,520
[ 623125521 ]
[]
defmodule ShopifyClient do require Logger @maxPerPage 250 def get_products(pageInfo) do params = get_list_params(pageInfo) IO.inspect params with {:ok, products} <- Shopify.Product.list(params) |> Shopify.request(get_session(), get_config()) do products else error -> ...
0aa6faf8134a0754812022e4432b22edbace20f1
6,083
[ 92755436 ]
[ "documented" ]
defmodule Flux.HTTP.Response do @moduledoc """ Documentation for Flux.HTTP.Response. """ # TODO this entire module is terrible and needs to be rewritten require Logger alias Flux.HTTP.Encoder version = Flux.Mixfile.project() |> Keyword.get(:version) @version version {os, _} = :os.type() @...
0aa90d1f80afff7e50ea1c1b9604bfefd08b6b75
1,514
[ 112710595 ]
[]
input = File.read("input23.txt") program = String.split(elem(input, 1), "\n") reg = {0, 0, 0, 0, 0, 0, 0, 0} defmodule Apa do defp charToIndex(s) do hd(to_charlist(s)) - ?a end defp getValue(s, reg) do if Integer.parse(String.trim(s)) == :error do elem(reg, charToIndex(s)) else elem(Int...
0aa9c88700174de9f94358191a43246abdd94338
3,284
[ 58556997, 160513020 ]
[ "typespec", "supervisor", "documented" ]
defmodule Kitto do @moduledoc """ This is the documentation for the Kitto project. You can find documentation about developing with Kitto and configuration options at the [wiki](https://github.com/kittoframework/kitto#support) By default, Kitto applications depend on the following packages: * [Plug](ht...
0aa9d7de11a11929176df8dab3c704faa995774e
1,588
[ 480152162, 796060990 ]
[ "typespec", "documented" ]
defmodule Image.Options.Trim do @moduledoc """ Options and option validation for `Image.trim/2`. """ alias Image.Color @typedoc """ Options applicable to Image.trim/2 """ @type trim_options :: [ {:background, Color.t() | :auto | :alpha} | {:threshold, non_neg_integer()} ] ...
0aaa4e24dd0200417fa6cfcf60f16536bcc9ba3b
2,817
[ 195741418, 388511880, 603610250, 329355024, 574323694, 511371868, 580235090, 399631385, 417119332, 424214145, 558629623 ]
[]
defmodule Pleroma.Frontend do alias Pleroma.Config require Logger def install(name, opts \\ []) do frontend_info = %{ "ref" => opts[:ref], "build_url" => opts[:build_url], "build_dir" => opts[:build_dir] } frontend_info = [:frontends, :available, name] |> Config.get(%{...
0aaa66e389adddcf165572b529633b3e8f1623bc
14,644
[ 631648512 ]
[ "genserver", "liveview" ]
defmodule Octopus.Apps.PixelFun do use Octopus.App, category: :interactive use Octopus.Params, prefix: :pixelfun require Logger alias Octopus.Canvas alias Octopus.Events.Event.Audio, as: AudioEvent alias Octopus.Events.Event.Input, as: InputEvent alias Octopus.Events.Event.Proximity, as: ProximityEvent ...
0aaa71a5e9725fd3807a0ba3073f45a783b88963
1,689
[ 347847093 ]
[ "typespec", "phoenix", "ecto" ]
defmodule FlixWeb.FavoriteController do use FlixWeb, :controller import FlixWeb.UserAuth, only: [require_authenticated_user: 2] plug(:require_authenticated_user when action in [:create, :delete]) plug(:put_movie) alias Flix.Catalogs @spec create(Plug.Conn.t(), map) :: Plug.Conn.t() def create(conn, %{...
0aaaa381097fe8f700a10a3e099e6f2f16b83645
4,112
[ 874035002 ]
[ "macro", "documented" ]
defmodule BinStruct.Macro.Parse.UnknownSizeVariantCheckpoints.VariantBySelectVariantCallbackCheckpoint do @moduledoc false alias BinStruct.Macro.Structs.Field alias BinStruct.Macro.Structs.RegisteredCallbacksMap alias BinStruct.Macro.RegisteredCallbackFunctionCall alias BinStruct.Macro.Dependencies.Bindings...
0aaaca36995655dbb7da97e093d6d888bec6e247
1,691
[ 211863779 ]
[ "macro", "documented", "phoenix" ]
defmodule DemoFixturesWeb 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 DemoFixturesWeb, :controller use DemoFixturesWeb, :view The definitions below will be executed for every view,...
0aab522da66231e85065b63ad39993d47979b00e
1,867
[ 123379647 ]
[]
defmodule LeagueManager.Mixfile do use Mix.Project def project do [app: :league_manager, version: "0.0.1", elixir: "~> 1.2", elixirc_paths: elixirc_paths(Mix.env), compilers: [:phoenix, :gettext] ++ Mix.compilers, build_embedded: Mix.env == :prod, start_permanent: Mix.env == :prod...
0aac4eabdbbc7e38198ae0a45c76f8b0056d7501
1,760
[ 465638532, 171057615 ]
[]
defmodule Espy.Watcher.Handler do require Logger alias Espy.Gateway.{App, Webhook, Subsciption} alias Espy.Watcher.{Cache, Logging} alias Espy.Adapter.{HTTPC} defp send_hook(webhooks , tx) do webhooks |> Enum.each( fn w -> {:ok, pid } = Task.Supervisor.start_child( Espy.Sup...
0aac82b8f5cb6e27a1de5910acbaf72c9796f43a
1,875
[ 435039541 ]
[]
defmodule Polymer do def solve(steps) do {template, rules, pair_frequencies} = parse() recur(template, rules, pair_frequencies, steps) end def recur(template, _rules, pair_frequencies, 0), do: result(template, pair_frequencies) def recur(template, rules, pair_frequencies, steps_remaining) do new_fr...
0aac87a73f370b3e5a8c4886b78b16276cf53066
3,178
[ 135215951, 80654092 ]
[ "test" ]
if !System.get_env("EXERCISM_TEST_EXAMPLES") do Code.load_file("tournament.exs", __DIR__) end ExUnit.start ExUnit.configure trace: true, exclude: :pending defmodule TournamentTest do use ExUnit.Case #@tag :pending test "typical input" do input = [ "Allegoric Alaskans;Blithering Badgers;win", ...
0aad02e1ef0dc76945e6eeae7eb5f5ee8341ffe8
3,530
[ 1008670264 ]
[ "documented" ]
defmodule EveDmv.Market.Strategies.EsiStrategy do @moduledoc """ Pricing strategy using EVE ESI market data. This strategy queries the EVE Online ESI API for market data, typically from major trade hubs like Jita. """ @behaviour EveDmv.Market.PricingStrategy alias EveDmv.Eve.EsiMarketClient require ...
0aad50b087091ece694189043727707657ad27ca
2,949
[ 847931014 ]
[ "ecto" ]
defmodule Supafana.Web.AuthUtils do require Logger import Ecto.Query, only: [from: 2] import Plug.Conn alias Supafana.{Data, Repo} def handle_auth(conn, code, redirect_uri, code_verifier) do {:ok, tokens} = Supafana.Supabase.OAuth.tokens(code, redirect_uri, code_verifier) Logger.debug("tokens: #{...
0aad6051cbb54a7ac59d903a17960a34a19b9c44
1,648
[ 477235480 ]
[ "ecto" ]
defmodule Rocketlivery.User do use Ecto.Schema alias Ecto.Changeset alias Rocketlivery.Order import Ecto.Changeset @primary_key {:id, :binary_id, autogenerate: true} @required_params [:age, :address, :name, :cpf, :email, :password, :cep] @update_params @required_params -- [:password] @derive {Jason...
0aae6f11b5c72dbdf8707b89fc83a04ef25d737c
1,970
[ 193244709, 101434552, 198908023 ]
[ "typespec", "documented" ]
defmodule GoogleApi.Dialogflow.V2.Model.GoogleCloudDialogflowCxV3TestCaseResult do @moduledoc """ Represents a result from running a test case in an agent environment. ## Attributes * `conversationTurns` (*type:* `list(GoogleApi.Dialogflow.V2.Model.GoogleCloudDialogflowCxV3ConversationTurn.t)`, *default:* `...
0aae7fe534ecb8be12c4a25c419d37497770ffd8
1,914
[ 218091504 ]
[ "documented" ]
defmodule Cards do @moduledoc """ Provides methodsr creating and handling a deck of cards """ @doc """ Returns a list of strings representing a deck of playing cards """ def create_deck do values = ["Ace", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Jack", "Queen", "...
0aaf7c96c7929994adcf6c3f0c8d196d0d91d837
4,121
[ 522105239 ]
[ "test" ]
Code.require_file("mix_helper.exs", __DIR__) defmodule RedeagleTest do use ExUnit.Case, async: false import MixHelper import ExUnit.CaptureIO @app_name "new_app" setup do # The shell asks to install deps. # We will politely say not. send(self(), {:mix_shell_input, :yes?, false}) :ok end ...
0aaf81936653d56168995e5368bd5601f49d079e
7,724
[ 717039945, 717831055 ]
[ "typespec", "documented", "ecto" ]
defmodule BillBored.Torch.Users do @moduledoc """ The Torch context. """ import Ecto.Query, warn: false import Torch.Helpers, only: [sort: 1, paginate: 4] import Filtrex.Type.Config alias BillBored.{User, User.Block} alias BillBored.Chat.Room.DropchatStream alias BillBored.Chat.Room.DropchatStream....
0aaf8a3f28599a472a1aa702ae19414fc234de99
1,931
[ 249473797 ]
[]
defmodule Virusmap.MixProject do use Mix.Project def project do [ app: :virusmap, 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(), ...