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
06a171e4acf4bda7e32b172bdf4d2cac1718735e
2,550
[ 110382716 ]
[ "documented", "ecto" ]
defmodule Ptr.Lots.Part do use Ecto.Schema import Ecto.Changeset alias Ptr.Lots.{Lot, Part} alias Ptr.Accounts.Account alias Ptr.Cellars.Vessel schema "parts" do field(:amount, :decimal) field(:lock_version, :integer, default: 1) belongs_to(:lot, Lot) belongs_to(:vessel, Vessel) tim...
06a1f4108fbd83b5c7463381f30cbcdf2eee8898
3,924
[ 107165494 ]
[]
defmodule Torrent.Extension do @ut_metadata_id 3 @metadata_piece_length 16384 def pipe_message(socket, len, info_structs) do id = Torrent.Stream.recv_byte!(socket, 1) |> :binary.bin_to_list |> Enum.at(0) case id do 0 -> # 0 is the handshake message binary_handshake = Torrent.Stream.recv_b...
06a232edd7a81a2f4c801748c3b289e5db95ff8d
1,834
[ 35520826 ]
[ "test" ]
defmodule Mailchimp.ConfigTest do use ExUnit.Case alias Mailchimp.Config describe "api_key!/0" do test "should update api_key" do Application.put_env(:mailchimp, :api_key, "your apikey-us12") assert Config.api_key!() == "your apikey-us12" Application.delete_env(:mailchimp, :api_key) en...
06a286d2a93722f6d2e541978ec553afa129c7ed
2,081
[ 48741861 ]
[ "test", "ecto" ]
defmodule EctoOracleAdapter.Integration.ConstraintTest do use ExUnit.Case, async: true alias EctoOracleAdapter.Integration.TestRepo import Ecto.Migrator, only: [up: 4, down: 4] defmodule ExcludeConstraintMigration do use Ecto.Migration @table table(:exclude_constraint_migration) def up do ...
06a2f680680b8da74790ee35d8f4f8a36b5e8e21
1,890
[ 193244709, 101434552, 198908023 ]
[ "typespec", "documented" ]
defmodule GoogleApi.OnDemandScanning.V1.Model.ImageOccurrence do @moduledoc """ Details of the derived image portion of the DockerImage relationship. This image would be produced from a Dockerfile with FROM . ## Attributes * `baseResourceUrl` (*type:* `String.t`, *default:* `nil`) - Output only. This contai...
06a2ff9c35384600b63511b57f60064ff9b56d3f
8,397
[ 938349679, 54749959 ]
[ "test" ]
defmodule Commanded.ProcessManagers.ProcessManagerInstanceTest do use ExUnit.Case import Mox alias Commanded.Application.Config alias Commanded.Application.Mock, as: MockApplication alias Commanded.EventStore.Adapters.Mock, as: MockEventStore alias Commanded.EventStore.{RecordedEvent, SnapshotData} alia...
06a34cc16e7f5fef0429ee0a7f886fb6bb175eb3
2,113
[ 343371571 ]
[ "documented" ]
defmodule Unleash.Config do @moduledoc false @defaults [ url: "", appname: "", instance_id: "", metrics_period: 10 * 60 * 1000, features_period: 15 * 1000, strategies: Unleash.Strategies, backup_file: nil, custom_http_headers: [], disable_client: false, disable_metrics: fals...
06a37c078decb8683c1f7bde7a210ed5981dc5c6
4,175
[ 169300658 ]
[]
defmodule ExTmdbApi.V3.Movies do # https://developers.themoviedb.org/3/movies/get-movie-details def get_movie_details(params \\ [], options \\ []) do "3/movie/{movie_id}" |> ExTmdbApi.expand_and_make_request(params, options) end # https://developers.themoviedb.org/3/movies/get-movie-alternative-titles ...
06a42a2aa1cb3e3279b897d0837132740ce40c44
2,290
[ 205520435 ]
[ "phoenix", "ecto" ]
defmodule StudyAppWeb.Admin.OperationController do use StudyAppWeb, :controller alias StudyApp.Admin alias StudyApp.Operation plug(:put_layout, {StudyAppWeb.LayoutView, "torch.html"}) @fields ~w{} def index(conn, params) do case Admin.paginate_operations(params) do {:ok, assigns} -> as...
06a45a7791a551e8cab4b88b2caaf12430e550a1
5,429
[ 206417, 576680349, 524421812, 397989039, 39005786, 585631074, 118678239, 564330558, 804192353 ]
[ "test", "documented" ]
defmodule PartitionAllDocsTest do use CouchTestCase import PartitionHelpers @moduledoc """ Test Partition functionality for for all_docs """ setup_all do db_name = random_db_name() {:ok, _} = create_db(db_name, query: %{partitioned: true, q: 1}) on_exit(fn -> delete_db(db_name) end) creat...
06a59d08c4a1c0c2f3029b7328748dab8e1360fd
2,808
[ 239822890, 459291087 ]
[ "liveview" ]
defmodule OliWeb.Projects.ActiveSectionsTableModel do use Phoenix.Component alias OliWeb.Common.SessionContext alias OliWeb.Common.Table.{ColumnSpec, SortableTableModel} alias OliWeb.Common.Utils def new(%SessionContext{} = ctx, sections, project) do column_specs = [ %ColumnSpec{ name: :ti...
06a5b01c9745b669dd7a9e77d1580c877e2be47c
1,801
[ 185558207, 213229236, 1000104078, 982054619, 882572863, 217320195, 174991383, 540729553, 771023416 ]
[ "documented" ]
defmodule Pleroma.Web.ActivityPub.MRF.UserAllowListPolicy do alias Pleroma.Config @moduledoc "Accept-list of users from specified instances" @behaviour Pleroma.Web.ActivityPub.MRF.Policy defp filter_by_list(activity, []), do: {:ok, activity} defp filter_by_list(%{"actor" => actor} = activity, allow_list) d...
06a5bcbddb9e9cbc2522c176994a2f867e0e3c4c
5,678
[ 277828624 ]
[ "macro", "documented" ]
defmodule Common.Fixtures do @moduledoc """ テストで使用するfixtureをまとめたモジュール """ alias Milk.{ Accounts, Brackets, Discord, Platforms, Tournaments } import Common.Sperm defmacro __using__(_opts) do # credo:disable-for-next-line quote do def fixture_tournament(opts \\ []) do ...
06a61c305c81668076679690b3ba7a931d2b3d45
2,407
[ 61028914 ]
[ "documented" ]
defmodule YProcess.Backend.PhoenixPubSub do @moduledoc """ Simple implementation of channels using Phoenix PubSub. """ use YProcess.Backend alias Phoenix.PubSub @name YProcess.PubSub @doc """ Creates a `channel` in `Phoenix.PubSub`. The channels don't need to be created in `Phoenix.PubSub` so this i...
06a63bfb76c754745a7ddbed11caeaab1a23c259
1,760
[ 85510250 ]
[ "phoenix" ]
defmodule Volition.AreaController do use Volition.Web, :controller alias Volition.Area def index(conn, _params) do areas = Repo.all(Area) render(conn, "index.html", areas: areas) end def new(conn, _params) do changeset = Area.changeset(%Area{}) render(conn, "new.html", changeset: changeset)...
06a6b7a1ae2c8206bca5889cc0d358a8a332f6b1
2,223
[ 177878493 ]
[ "phoenix" ]
defmodule StockprojectWeb.StockController do use StockprojectWeb, :controller alias Stockproject.Stocks alias Stockproject.Stocks.Stock alias StockUtil action_fallback StockprojectWeb.FallbackController def init(args) do args end def index(conn, _params) do stocks = Stocks.list_stocks() ...
06a6b86ef1128372a682c90e38ea7c5a0646dcf2
7,227
[ 988370212 ]
[ "test" ]
defmodule UmyaSpreadsheet.ComprehensiveIntegrationTest do use ExUnit.Case, async: true @input_path "test/test_files/aaa.xlsx" @output_path "test/result_files/comprehensive_output.xlsx" @password_output_path "test/result_files/comprehensive_output_password.xlsx" @lazy_output_path "test/result_files/comprehens...
06a6b8ffdd231a1423694da1eba08b65192e7cd0
3,727
[ 342355995 ]
[ "typespec", "documented" ]
defmodule Fob.Cursor do @moduledoc """ A cursor data structure that can be used to fetch the next pages The cursor data structure is somewhat similar to a `Stream` except that it cannot wrap a stateful process and does not require any life-cycle hooks. The next pages of data can be fetched by calling `next/1...
06a716ccc42b5fa459b0f35697478d3603470a03
2,295
[ 703990939 ]
[ "liveview", "ecto" ]
defmodule BlogWeb.TagLive.FormComponent do use BlogWeb, :live_component alias Blog.Tags @impl true def render(assigns) do ~H""" <div> <.header> <%= @title %> <:subtitle>Use this form to manage tag records in your database.</:subtitle> </.header> <.simple_form ...
06a7413e70741ea6b3ec7aef1cb20d0cf8242528
2,227
[ 638863870 ]
[ "genserver", "liveview", "documented" ]
defmodule BrightWeb.Share.GraphLive.Graphs do @moduledoc """ 成長パネルのシェア画面 """ use BrightWeb, :live_view alias BrightWeb.SkillPanelLive.SkillPanelHelper alias BrightWeb.Share.Helper, as: ShareHelper alias BrightWeb.LayoutComponents alias BrightWeb.ProfileComponents alias Bright.SkillPanels alias Bri...
06a8154d99813bc88f65cbe325e1585f1e416af4
3,030
[ 140343325 ]
[]
defmodule Notificacion.Router do use Plug.Router use Plug.Debugger require Logger plug(Plug.Logger, log: :debug) plug(:match) plug(:dispatch) #RECIBE UN Modelo.Subasta post "/notificacion/ganador/:id_usuario" do # {:ok, body, conn} = read_body(conn) # body = Poison.decode!(body, as: %Modelo.Sub...
06a823aa6bd7ca75d7a3b7c261478adbc98ff727
1,540
[ 236388621 ]
[ "macro", "documented", "phoenix" ]
defmodule ReportWeb 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 ReportWeb, :controller use ReportWeb, :view The definitions below will be executed for every view, controller, etc...
06a825def41e8c2a7043ce03f60a42582a4fd3cc
2,885
[ 240013275 ]
[]
defmodule VanillaWeb.AuthPlugs do require Logger import Plug.Conn, only: [ assign: 3, get_session: 2, put_session: 3, configure_session: 2 ] alias Vanilla.Repo alias Vanilla.Data alias Vanilla.Data.User # # Plugs # # Assign current_user to the conn, if a user is logge...
06a9e99113b2a742961c4796d5687830560a79ef
1,624
[ 897051414 ]
[ "liveview", "phoenix" ]
defmodule Advent2024exWeb.Endpoint do use Phoenix.Endpoint, otp_app: :advent2024ex # 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: "...
06a9ea9e40c3f0830f1120f32c70204e9b43b4c4
1,863
[ 531042643 ]
[ "typespec", "macro" ]
defmodule ConcreteBehaviour do defmacro __using__(_opts) do quote do import Kernel, except: [@: 1] require ConcreteBehaviour import ConcreteBehaviour Module.put_attribute(__MODULE__, :specs, %{funs: []}) @behaviour __MODULE__.Behaviour @before_compile ConcreteBehaviour en...
06a9f385069745f5c80ddd90aafcc08d9e1fef69
2,123
[ 193244709, 101434552, 198908023, 383340007 ]
[ "typespec", "documented" ]
defmodule GoogleApi.Compute.V1.Model.RegionAutoscalerList do @moduledoc """ Contains a list of autoscalers. ## Attributes * `id` (*type:* `String.t`, *default:* `nil`) - [Output Only] Unique identifier for the resource; defined by the server. * `items` (*type:* `list(GoogleApi.Compute.V1.Model.Autoscale...
06aa0d84af924c50e1ad0b0c53c438959d1c9e28
2,876
[ 193244709, 101434552, 198908023 ]
[ "typespec", "documented" ]
defmodule GoogleApi.Gmail.V1.Model.Message do @moduledoc """ An email message. ## Attributes * `historyId` (*type:* `String.t`, *default:* `nil`) - The ID of the last history record that modified this message. * `id` (*type:* `String.t`, *default:* `nil`) - The immutable ID of the message. * `intern...
06aa4a763bc63c879f3da3ec0381e591319fdb13
2,002
[ 435577308 ]
[ "test" ]
defmodule Day16Test do use ExUnit.Case doctest Day16 alias Day16 test "Part 1 - decode 1" do code = Day16.Decoder.decode("D2FE28") |> Day16.Decoder.flatten() assert code == [{6, 4, 2021}] end test "Part 1 - decode 2" do [{version, type, _}, {_, _, val1}, {_, _, val2}] = Day16.Decoder.de...
06aa53c23c541443c2478e5a40b82ec01841464f
1,514
[ 877242231 ]
[ "ecto" ]
defmodule Insurance.Factory do alias Postgres.Repo defp provider_default_params do %{ name: "provider_name", logo_url: "provider_logo_url" } end defp patient_default_params do %{ phone_number: random_string() } end defp account_default_params do %{ member_id: r...
06aa8561fb78ab39b33f038d0dbfceac48b255b5
4,654
[ 403140046 ]
[ "test", "phoenix" ]
defmodule AdaptableCostsEvaluatorWeb.FormulaControllerTest do use AdaptableCostsEvaluatorWeb.ConnCase use AdaptableCostsEvaluator.Fixtures.{ UserFixture, ComputationFixture, FormulaFixture, EvaluatorFixture, FieldSchemaFixture, OutputFixture, InputFixture } alias AdaptableCostsEval...
06ab60d7c625c9d29db3dd58251ec33787bc3c18
2,793
[ 253532984 ]
[ "macro", "documented" ]
defmodule Vela.Access do @moduledoc false defmacro __using__(opts) do quote bind_quoted: [opts: opts] do @history_limit Application.compile_env(:vela, :history_limit, 5) @error_limit Application.compile_env(:vela, :error_limit, 5) @behaviour Elixir.Access Enum.each(Keyword.keys(opts),...
06abd8d937712fc6450e26c8f6209593c68071dd
15,162
[ 950513696 ]
[ "genserver", "liveview" ]
defmodule BeamWeb.Tasks.SearchingForAnAnswerLive do use BeamWeb, :live_view alias Beam.Exercices.Tasks.SearchingForAnAnswer alias Beam.Repo alias Beam.Exercices.Result @intro_duration 3000 def mount(_params, session, socket) do current_user = Map.get(session, "current_user", nil) task_id = Map.get...
06ac8be7143d6dcb7cc49eb9c5a9f2c9002244ea
3,534
[ 755380094 ]
[ "ecto" ]
defmodule PayCosern.Controllers.CosernAccountController do import Plug.Conn require Logger alias PayCosern.Utils alias PayCosern.Repo.CosernAccounts alias Ecto.Changeset alias PayCosern.Repo alias PayCosern.Repo.Users, as: User def create(conn, %{"login" => login, "password" => password, "handle" => h...
06acbd2c2e11892a0bb3bcf6fddc644d2a8d3c85
6,150
[ 458715412 ]
[ "documented", "ecto" ]
defmodule Mix.Tasks.Swagger.Gen.Json do @shortdoc "Generates controller, views, and context for a JSON resource" @moduledoc """ Generates controller, views, and context for a JSON resource. mix swagger.gen.json Accounts User users name:string age:integer The first argument is the context module followe...
06acc633a29dfaa13a4fbc6a6bf8deb1bc01494f
7,027
[ 420548873 ]
[ "test" ]
defmodule LiveElementTest.DOMTest do use ExUnit.Case, async: true alias LiveElementTest.DOM describe "find_live_views" do # >= 4432 characters @too_big_session Enum.map(1..4432, fn _ -> "t" end) |> Enum.join() test "finds views given html" do assert DOM.find_live_views( DOM.par...
06adbc298655de89e336c52719df4b5d6c9cf103
6,871
[ 475196096 ]
[ "typespec", "documented" ]
defmodule Exogiri.Xml.Node do @moduledoc """ Encapsulates an XML element node. """ defstruct [:ref] @typedoc "The Node type." @type t :: %__MODULE__{ref: reference()} @typedoc """ You've either managed to bork the XPath parser (rare), OR my C code is bad (put your money here). """ @type unknown_x...
06add97f52f80958d89eb49fa7977f9c949ad2b5
7,177
[ 299593379 ]
[ "typespec", "macro", "documented" ]
defmodule LinkBlox.DataTypes do @moduledoc """ LinkBlox data types """ defmacro __using__(_) do quote do @typedoc "Block attribute values. Stored in an ETS table" @type attributes() :: :erlang.tid() @typedoc "Each attribute value is a tuple of name, class, value, and a map of metadata ...
06ae736d64dd4df5e39c007e9c118c9792a0dadc
2,828
[ 981067434 ]
[ "test", "documented" ]
defmodule AshCommanded.Commanded.Transformers.ProjectionGeneratorTest do use ExUnit.Case, async: true alias AshCommanded.Commanded.Projection alias AshCommanded.Commanded.Transformers.GenerateProjectionModules describe "projection module generation helpers" do test "builds correct module names" do ...
06ae7b20f2a819e9f7e2860e62ce8e5f2da64637
2,255
[ 773872827 ]
[]
defmodule BigDataDocumentation.MixProject do use Mix.Project def project do [ app: :"3BigData_documentation", version: "1.0.0", elixir: "1.16.2", start_permanent: Mix.env() == :prod, deps: deps(), # Docs name: "Documentation", homepage_url: "https://3BigDatalinu...
06ae83afa0d046fc4f8b321f4a7dec9b626e7cb1
3,732
[ 435601216 ]
[ "test" ]
defmodule Exmeal.UsersControllerTest do use ExmealWeb.ConnCase, async: true import Exmeal.Factory alias Exmeal.User describe "create/2" do test "when all params are valid, creates a user", %{conn: conn} do params = build(:users_params) response = conn |> post(Routes.users_pat...
06af7e0e7bd2e84e31ea600773d5f7b580b9644b
1,890
[ 64221830 ]
[]
use Mix.Config # For development, we disable any cache and enable # debugging and code reloading. # # The watchers configuration can be used to run external # watchers to your application. For example, we use it # with brunch.io to recompile .js and .css sources. config :flexcility, Flexcility.Endpoint, http: [port:...
06b0919dd12db0411d1791d3df19cae7b024a875
15,180
[ 386502083 ]
[]
books = %{ "1" =>"https://leeyongkyu.s3-us-west-1.amazonaws.com/1.prepare_the_way_of_the_lord.pdf", "2" => "https://leeyongkyu.s3-us-west-1.amazonaws.com/2.exposition_on_song_of_songs.pdf", "3" => "https://leeyongkyu.s3-us-west-1.amazonaws.com/3.work_out_your_salvation.pdf", "4" => "https://leeyongkyu.s3-us-wes...
06b0c7f2da1601c114ecd928bfa284f0539c0c7c
3,022
[ 263905918 ]
[ "test" ]
defmodule Paredown.LineParserTest do use ExUnit.Case, async: true alias Paredown.LineParser, as: Subject doctest Paredown.LineParser use Phoenix.HTML describe "to_html/2" do test "plain text" do assert Subject.to_html("plain text") == raw("plain text") end test "italics with _" do a...
06b13882d25d36354d1fe10d3a196ec1637f7958
1,880
[ 766907556 ]
[ "documented", "ecto" ]
defmodule TutorialApi.Course do @moduledoc """ The Course context. """ import Ecto.Query, warn: false alias TutorialApi.Repo alias TutorialApi.Course.Tutorial @doc """ Returns the list of exercise. ## Examples iex> list_exercise() [%Tutorial{}, ...] """ def list_exercise do R...
06b13e50dbf538fc39169d31337dd6cdffdb8459
1,562
[ 63497734 ]
[ "test" ]
defmodule CodeCorpsWeb.ConversationViewTest do use CodeCorpsWeb.ViewCase alias CodeCorps.Repo test "renders all attributes and relationships properly" do conversation = insert(:conversation) conversation_part = insert(:conversation_part, conversation: conversation) rendered_json = CodeCorpsWe...
06b14e7ad280090f9ce676487aef25984125a276
6,067
[ 101639674 ]
[ "test" ]
defmodule ExInsightsTest do use ExUnit.Case, async: true doctest ExInsights alias ExInsights.{Envelope, TestHelper} alias ExInsights.Telemetry.{ EventTelemetry, TraceTelemetry, ExceptionTelemetry, MetricTelemetry, DependencyTelemetry, RequestTelemetry } import TestHelper, only: [t...
06b1554459a013e3a8e5f7e218e0a315a43e6717
1,819
[ 199759156 ]
[ "documented", "ecto" ]
defmodule Tractabus.Articles do @moduledoc """ The Articles context. """ import Ecto.Query, warn: false alias Tractabus.Repo alias Tractabus.Articles.Article @doc """ Returns the list of articles. ## Examples iex> list_articles() [%Article{}, ...] """ def list_articles do Rep...
06b175c3a7654df1b83cb5ae68e8c71625c0532d
1,596
[ 740225478 ]
[]
defmodule GlobalEnum.MixProject do use Mix.Project @version "0.0.1" @github_url "https://github.com/Helge801/global_enum" @description """ Elixir Library for creating enums """ def project do [ aliases: aliases(), app: :global_enum, deps: deps(), description: @description, ...
06b17757f69c50489846441b14079b8ed525d3c6
1,647
[ 434336328 ]
[]
Mix.install([ {:memoize, "~> 1.4"} ]) defmodule Solution do use Memoize @rolls [{3, 1}, {4, 3}, {5, 6}, {6, 7}, {7, 6}, {8, 3}, {9, 1}] def part1(_) do plat_turn1(1, {0, 2}, {0, 8}) end def part2(_) do {a, b} = play_turn2({0, 2}, {0, 8}) max(a, b) end def plat_turn1(turn, {score1, pos1}...
06b1f6dd671a823c4ea1a63904f31566ff32e888
2,165
[ 599758064 ]
[ "documented", "ecto" ]
defmodule Sahraeczane.Districts do @moduledoc """ The Districts context. """ import Ecto.Query, warn: false alias Sahraeczane.Repo alias Sahraeczane.Districts.District @doc """ Returns the list of districts. ## Examples iex> list_districts() [%District{}, ...] """ def list_distri...
06b2aea5af5241c5f37d957cbb41ae0ed2ebe4ef
4,217
[ 965286383, 281977300 ]
[ "documented" ]
# credo:disable-for-this-file Credo.Check.Readability.Specs defmodule Hologram.Benchmarks.Fixtures.Page18 do @moduledoc false use Hologram.Page import Hologram.Commons.KernelUtils, only: [inspect: 1] import Kernel, except: [inspect: 1] route "/page-18" layout Hologram.Benchmarks.Fixtures.Components.Defa...
06b2c29f529b6a2fac1f1c937cef146f8bc464c7
3,084
[ 134395952 ]
[]
%{ "certifi": {:hex, :certifi, "2.3.1", "d0f424232390bf47d82da8478022301c561cf6445b5b5fb6a84d49a9e76d2639", [:rebar3], [{:parse_trans, "3.2.0", [hex: :parse_trans, repo: "hexpm", optional: false]}], "hexpm"}, "earmark": {:hex, :earmark, "1.2.5", "4d21980d5d2862a2e13ec3c49ad9ad783ffc7ca5769cf6ff891a4553fbaae761", [:...
06b2d278c5a8bb1089c697c43ebede7d19271519
4,047
[ 267661056 ]
[ "documented" ]
defmodule BeamFile.DebugInfo do @moduledoc false alias BeamFile.Normalizer @default_lang "en" def ast(%{module: module} = debug_info, target \\ :ast) do ast = debug_info |> definitions(:desc) |> Enum.map(fn {_name, _arity, ast} -> ast end) Normalizer.normalize( {:defmodule, [context: Elixir, i...
06b3a81ad6210328c36b305e9b6503f931914b56
1,805
[ 161652870 ]
[ "typespec", "documented" ]
defmodule ATECC508A.Certificate.NervesKeyTemplate do @moduledoc """ Certificate template for the ATECC508A from Microchip Detailed information on the certificate compression process can be found here: http://ww1.microchip.com/downloads/en/Appnotes/20006367A.pdf """ alias X509.Certificate.Extension defst...
06b3cd7ad298b9909f69ebc80cc4b61cfdbabbcf
2,579
[ 455547148 ]
[]
import Config # For production, don't forget to configure the url host # to something meaningful, Phoenix uses this information # when generating URLs. # # Note we also include the path to a cache manifest # containing the digested version of static files. This # manifest is generated by the `mix phx.digest` task, # w...
06b4309ced1178558ea6ced41c661b2785c18825
4,572
[ 497327543 ]
[ "documented" ]
defmodule FzCommon.FzNet do @moduledoc """ Network utility functions. """ # credo:disable-for-next-line Credo.Check.Readability.MaxLineLength @ip_regex ~r/((^\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\s*$)|(^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa...
06b431f54f7e2143f6c5013d1bb25f0270b8ac58
4,524
[ 80922299 ]
[]
defmodule MoexHelper.Reports.Ownerships do import Ecto import Ecto.Query import MoexHelper.I18n, only: [t: 1] alias Decimal, as: D alias MoexHelper.{Repo, User, Ownership} alias Reporter.Report alias Reporter.Report.{Column, Row} @title "MOEX - Securities" @columns [ %Column{id: :account, name...
06b4322eac7a32b65bf620ee16dd4bda95060330
1,626
[ 304367934 ]
[]
defmodule ToxiproxyEx.MixProject do use Mix.Project @source_url "https://github.com/Jcambass/toxiproxy_ex" def project do [ app: :toxiproxy_ex, version: "1.1.1", elixir: "~> 1.10", elixirc_paths: elixirc_paths(Mix.env()), start_permanent: Mix.env() == :prod, deps: deps(),...
06b4af465788003b1b68c6ba66c4d4e5abf53086
4,134
[ 367278931 ]
[ "documented" ]
defmodule Google.Ads.Googleads.V18.Resources.AccessibleBiddingStrategy.MaximizeConversionValue do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.14.1", syntax: :proto3 field :target_roas, 1, type: :double, json_name: "targetRoas", deprecated: false end defmodule Google.Ads.Googleads.V18.Resources...
06b6737108597f296b57dbf962b484584a708b1e
7,864
[ 802291394 ]
[ "test", "ecto" ]
defmodule BakeryInventory.InventoryTest do use BakeryInventory.DataCase alias BakeryInventory.Inventory alias BakeryInventory.Inventory.Item alias BakeryInventory.Inventory.Alert import BakeryInventory.InventoryFixtures describe "items" do @invalid_attrs %{name: nil, description: nil, quantity: nil, ...
06b7bc9e97b0af927b1575c76fec9630dcd4edc6
2,624
[ 131361622 ]
[ "typespec", "phoenix" ]
defmodule DiscussWeb.TopicController do use DiscussWeb, :controller alias Discuss.Accounts.User alias Discuss.Postings alias Discuss.Postings.Topic alias DiscussWeb.Controllers.Plugs.RequireAuth alias DiscussWeb.TopicFallbackController alias Plug.Conn action_fallback TopicFallbackController plug Re...
06b846b7a2034214d557951c43c62ec3e563f903
1,848
[ 403709557 ]
[ "documented", "ecto" ]
defmodule Authentication.Products do @moduledoc """ The Products context. """ import Ecto.Query, warn: false alias Authentication.Repo alias Authentication.Products.Product @doc """ Returns the list of products. ## Examples iex> list_products() [%Product{}, ...] """ def list_prod...
06b84ff139decf2df4a42e0c889928144b33b6a1
3,402
[ 822255248 ]
[ "test" ]
defmodule MusicListings.Parsing.VenueParsers.RoyThomsonHallParserTest do use ExUnit.Case, async: true alias MusicListings.Parsing.Performers alias MusicListings.Parsing.Price alias MusicListings.Parsing.VenueParsers.RoyThomsonHallParser setup do index_file_path = Path.expand("#{File.cwd!()}/test/data/ro...
06b9430bdadc283cea402c0eb706abf084fb68c4
1,867
[ 367278931 ]
[ "documented" ]
defmodule Google.Actions.Sdk.V2.Interactionmodel.Prompt.TableColumn.HorizontalAlignment do @moduledoc false use Protobuf, enum: true, protoc_gen_elixir_version: "0.14.1", syntax: :proto3 field :UNSPECIFIED, 0 field :LEADING, 1 field :CENTER, 2 field :TRAILING, 3 end defmodule Google.Actions.Sdk.V2.Intera...
06b96605b7cefc94c760cb616f21c4900bac8ed1
2,754
[ 929711688 ]
[]
import Config # Do not include metadata nor timestamps in development logs config :logger, :console, format: "[$level] $message\n" # Initialize plugs at runtime for faster development compilation config :phoenix, :plug_init_mode, :runtime # Set a higher stacktrace during development. Avoid configuring such # in prod...
06b9b52e64e74f4b3115f24a1fc4bb9a8f2cb3e4
8,784
[ 243796657 ]
[]
%{ "certifi": {:hex, :certifi, "2.5.1", "867ce347f7c7d78563450a18a6a28a8090331e77fa02380b4a21962a65d36ee5", [:rebar3], [{:parse_trans, "~>3.3", [hex: :parse_trans, repo: "hexpm", optional: false]}], "hexpm", "805abd97539caf89ec6d4732c91e62ba9da0cda51ac462380bbd28ee697a8c42"}, "cors_plug": {:hex, :cors_plug, "1.5.2"...
06ba4510cbdc20c0d94f7e793393ea3868d8e1e8
2,637
[ 15456143 ]
[ "documented" ]
defmodule Memcachedx.Packet.Request.Header do @moduledoc """ Builds up the header of a packet to be sent to talk with the memcached server. """ def magic(value) do case value do :request -> 0x80 :response -> 0x81 end end def opcode(opcode) do case opcode do :get -> 0x00 ...
06ba59b4dc274f1a2baece9bc27cb454bac47ed5
4,614
[ 852052024 ]
[ "documented" ]
defmodule Matplotex.Figure.Areal.LinePlot do @moduledoc false alias Matplotex.Figure.Areal.PlotOptions alias Matplotex.Utils.Algebra alias Matplotex.Figure.Areal.Region alias Matplotex.Figure.Areal.Ticker alias Matplotex.Figure.Marker alias Matplotex.Figure.Dataset alias Matplotex.Figure.Areal alias M...
06ba6bd0d4ce6557d0dd6591f4e44da962463b1f
4,647
[ 677875369 ]
[ "liveview", "ecto" ]
defmodule RadioappWeb.SegmentLive.FormComponent do use RadioappWeb, :live_component alias Radioapp.Station alias Radioapp.Station.Segment alias RadioappWeb.LiveHelpers alias Radioapp.Admin @impl true def render(assigns) do ~H""" <div> <.header> <%= @title %> <:subtitle>Add ...
06ba84d6529ee9096b24a611faa82e826b230e1b
4,554
[ 155316657 ]
[ "genserver", "typespec", "documented" ]
defmodule Services.Help do @moduledoc """ Provides help-text on demand in a discord chat channel. """ use GenServer alias DiscordBot.Broker alias DiscordBot.Broker.Event alias DiscordBot.Entity.Messages defmodule Info do @moduledoc """ A struct which represents an entry of help text """ ...
06bc48230224e5a91d2efd341d93dc47e6caf9a6
1,978
[ 89431034 ]
[ "genserver" ]
defmodule RNDL.OBDII do use GenServer @serial_port "/dev/cu.LGPhone-OBD_Listener" @pids ["0C", "0D"] @handlers [ { ~r/41 0C ([0-9A-F]{2} [0-9A-F]{2})/, &RNDL.OBDII.pid_rpm/1 }, { ~r/41 0D ([0-9A-F]{2})/, &RNDL.OBDII.pid_speed/1 } ] def start_link do GenServer.start_link(__MODULE__, :ok, name: R...
06bc8669832fb0ac3ac4d060f8db50963e913eab
2,185
[ 317571418 ]
[]
defmodule Advent2020.Day4 do use Advent2020.Utils def main(input) do passports = input |> String.split("\n\n", trim: true) |> Enum.map(&Advent2020.Day4.Passport.new/1) part1 = passports |> Enum.count(&Advent2020.Day4.Passport.valid?/1) part2 = passports |> Enum.count(fn p -> Advent2020.Day4.Passport.va...
06bd63420bb943a9fc51f0622afce41814767cb5
1,901
[ 193244709, 101434552, 198908023 ]
[ "typespec", "documented" ]
defmodule GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1SchemaTrainingjobDefinitionHyperparameterTuningTask do @moduledoc """ A TrainingJob that tunes Hypererparameters of a custom code Model. ## Attributes * `inputs` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1SchemaTrainingjobDef...
06be60c59b11808fb971d4ec489b1353a546ceda
4,571
[ 60812586 ]
[ "genserver", "typespec", "documented" ]
defmodule Weather.Server do use GenServer require Logger @name __MODULE__ @url "http://w1.weather.gov/xml/current_obs/" @user_agent [ {"User-agent", "Elixir client"} ] @keep 10 # keep at most 10 items in the state defmodule State, do: defstruct list: [], stash_pid: nil #...
06bf1fc8b74251e07071e4af4e24e1b8e09ec57e
2,660
[ 225625631 ]
[ "test", "phoenix" ]
defmodule ShoppingListWeb.IngredientControllerTest do use ShoppingListWeb.ConnCase import ShoppingList.Factory @create_attrs %{name: "flour", metric: "grams"} @invalid_attrs %{name: "flour", metric: 5} describe "index" do test "lists all ingredients", %{conn: conn} do conn = get(conn, Routes.ingr...
06bf50ce5b5f94c2c23d606980edd8408f144cb8
2,125
[ 913941730 ]
[ "genserver" ]
defmodule LiveFlipDemo.LibWatcher do use GenServer require Logger @name __MODULE__ def watch(_profile, _args) do GenServer.start(__MODULE__, %{}, name: @name) end def init(state) do Process.flag(:trap_exit, true) Process.send_after(@name, :poll_and_reload, 10_000) {:ok, state} end def...
06bf9bdac7f8337632b8697c3095a000f11fc7b9
2,764
[ 102855609 ]
[ "genserver", "documented" ]
defmodule Warp.Worker.BuildWorker do use GenServer alias Warp.Stages alias Warp.Worker.GroupWorker alias Warp.Worker.PipelineQueue alias Warp.Builds alias Phoenix.PubSub require Logger def start(build, project_id) do state = %{ build: build, current_stage_index: -1, project_id: ...
06bfcae46d6fdecf4a72ecaeca207b8aff66493b
1,668
[ 433851838 ]
[]
defmodule AdventOfCode.Day10 do alias AdventOfCode.Helpers def part1(args) do map = parse_map(args) start_locations = get_positions_by_height(map, 0) targets = get_positions_by_height(map, 9) graph = map_to_graph(map) for th <- start_locations, reduce: 0 do acc -> for tar <- targ...
06c00820831f4250750a3c2959c76bedd915031f
3,272
[ 217209876 ]
[]
defmodule Tapestry.Starter do def start(numNode, numRequest) do genProcesses(numNode, numRequest) end def genProcesses(numNode, numRequest) do eightyPercentNodes = round(numNode*0.8) twentyPercentNodes = round(numNode*0.2) uniqIdlst = Enum.map(1..eightyPercentNodes, fn _x ...
06c18a2ae7aff7b6e40d2f973b21d40440f48143
3,044
[ 193513571 ]
[ "test", "phoenix" ]
defmodule MagicMirrorWeb.TextBoxControllerTest do use MagicMirrorWeb.ConnCase alias MagicMirror.Widgets @create_attrs %{content: "some content", name: "some name", x_pos: 42, y_pos: 42} @update_attrs %{content: "some updated content", name: "some updated name", x_pos: 43, y_pos: 43} @invalid_attrs %{content...
06c1d7a607d3d39f655b7407d369e3c41256c5e6
5,709
[ 700370638 ]
[ "typespec", "documented" ]
defmodule Superls.Store do alias Superls.{Prompt, Tag, MergedIndex, Password} use Superls @moduledoc "Store access facilities." @sep_path "-" @doc "Create a `merged_index` from `media_dir`, `store` and `passwd`." @spec archive(media_dir :: MergedIndex.volume(), store :: store(), passwd :: String.t()) :: ...
06c20e7e90cf842243512a40009ccda2821a1f86
2,419
[ 958366002 ]
[]
defmodule GameKnight.Accounts.User do use Ash.Resource, otp_app: :game_knight, domain: GameKnight.Accounts, authorizers: [Ash.Policy.Authorizer], extensions: [AshAuthentication], data_layer: AshPostgres.DataLayer authentication do add_ons do log_out_everywhere do apply_on_pass...
06c2f01ee4e329d7b76a88cb868191343ffa9045
1,641
[ 85844148 ]
[]
defmodule Hourly.Mixfile do use Mix.Project def project do [app: :hourly, version: "0.0.1", elixir: "~> 1.4", elixirc_paths: elixirc_paths(Mix.env), compilers: [:phoenix, :gettext] ++ Mix.compilers, start_permanent: Mix.env == :prod, aliases: aliases(), deps: deps(), tes...
06c312d9fa385089c38d3082ccb27e91ad1b05ea
2,314
[ 943632074 ]
[]
defmodule GrapexirWeb.MixProject do use Mix.Project def project do [ app: :grapexir_web, version: "0.1.0", build_path: "../../_build", config_path: "../../config/config.exs", deps_path: "../../deps", lockfile: "../../mix.lock", elixir: "~> 1.14", elixirc_paths: e...
06c33f842c3483149f7bd0880888ac3c8cebb615
1,519
[ 89855394 ]
[ "test" ]
defmodule TicTacToe.PlayerFactory_Test do use ExUnit.Case alias TicTacToe.{Player,PlayerFactory} test 'human vs human' do assert_build([{"X", :human},{"O", :human}], [ %Player{ sign: "X", strategy: Player.Strategy.Human }, %Player{ sign: "O", strategy: Player.Strategy.Human }, ]) end tes...
06c37923d8bac9da0210ab9f46b816044eab899f
2,549
[ 897022743 ]
[ "documented" ]
defmodule Day02 do @moduledoc """ Documentation for `Day01`. """ def read_file(filename) do File.read(filename) end def task1() do {:ok, input} = read_file("input_day02.txt") input |> parse_input |> count_safe end @doc ~S""" Parses the input converting it into new list of lists...
06c38c8b8415cbc7c33b10d6b701412e7664cee0
3,597
[ 724586214 ]
[]
defmodule AdventOfCode.Day11 do import Enum, except: [split: 2, reverse: 1] import String, except: [at: 2, reverse: 1, length: 1] import List, except: [to_integer: 1] def part1(args) do args |> trim() |> split("\n") |> map(&codepoints/1) |> reduce([], fn line, acc -> if all?(line, fn ...
06c434cf92574ba04f42baeb4c65678befccca82
4,537
[ 79101685 ]
[ "test" ]
defmodule MiaServer.InvitationTest do use ExUnit.Case, async: false require Logger setup do Application.start(:mia_server) on_exit fn -> Application.stop(:mia_server) Logger.flush() end end @timeout Application.get_env(:mia_server, :timeout) + 50 defp open_udp_socket(ip) do op...
06c446a1c907a8ea1c964346d125175d7250a98e
2,604
[ 75336349 ]
[ "documented" ]
defmodule Alfred.Bots.Jenkins do @moduledoc """ TODO: Bot still under development """ use Slack @behaviour Alfred.Bot require Logger def parse_message(%{result: %{parameters: %{clients: client}}}, message, slack) do if client != "" do res = api_post(client) send_message("MESSAGE", m...
06c49a0ddf207d8347a86f8ac48270aae31dbf22
5,683
[ 323051019 ]
[ "macro" ]
# An html DSL made using macros in elixir, No runtime penalty as complete macro is replaced by its corresponding html string at compile time. # Here we traverse the AST using Macro.postwalk/2 and pattern match out different parts of the macros AST # while creating its corresponding html string in a buffer maintained as...
06c4f130d1d8e7d61d0c6145baf80c7092bfa463
2,922
[ 143945078 ]
[ "test" ]
defmodule U2FExTest.SignResponseTest do use ExUnit.Case alias U2FEx.SignResponse alias U2FEx.Utils alias U2FEx.Utils.Crypto @testdata1 %{ clientData: "eyJ0eXAiOiJuYXZpZ2F0b3IuaWQuZ2V0QXNzZXJ0aW9uIiwiY2hhbGxlbmdlIjoiMzJXZDNIZnZHam1MbUtEWm0xMUlaem1xWVZnTm9jdFl1dnNXY0x4Q05EayIsIm9yaWdpbiI6Imh0dHBzOi8...
06c55d2e4bb192bf7f093b47b6ed54616f379789
4,964
[ 155533764 ]
[ "genserver", "typespec", "documented", "phoenix" ]
defmodule Drab.Channel do @moduledoc false use Phoenix.Channel, Drab.Config.get(:phoenix_channel_options) @spec join(String.t(), any, Phoenix.Socket.t()) :: {:ok, Phoenix.Socket.t()} def join("__drab:" <> _broadcast_topic, _, socket) do # socket already contains controller and action {:ok, pid} = Drab...
06c584e5e16f4c514005b209942e1f5c231113c3
8,460
[ 990290479 ]
[ "genserver" ]
# Este modulo se encarga de coordinar las salas de chat, los usuarios conectados # y mensajes dentro del chat. defmodule ChatApp.ChatManager do import Ecto.Query # import Ecto.Query es para hacer consultas a la base de datos use GenServer # GenServer es para manejar procesos concurrentes en Elixir ...
06c5cc6a4663cb8464b428ae4a6c194f6c42e0f8
10,418
[ 1005234452 ]
[ "test" ]
defmodule DuckdbEx.AppenderTest do use ExUnit.Case alias DuckdbEx.Appender setup do {:ok, db} = DuckdbEx.open(":memory:") {:ok, conn} = DuckdbEx.connect(db) %{conn: conn, db: db} end describe "basic appender operations" do test "create and destroy appender", %{conn: conn} do # Create t...
06c73706ddbedf78439cd2068fbbb3585a4c651b
2,423
[ 91799891 ]
[ "typespec", "documented" ]
defmodule BrettProjekt.GameManager do alias BrettProjekt.Game, as: Game @team_count 3 @hashids_salt "myfancysalt" @type game :: pid @type game_id :: String.t @moduledoc """ Provides state and functions for handling Game instances. The GameManager is implemented as an Agent holding different Game inst...
06c7478f142bd555061d62f28f4efb49d96c36bc
1,590
[ 55202432 ]
[ "macro" ]
defmodule ReadRepos do defmacro __using__(opts) do primary = __CALLER__.module read_repo = Module.split(__CALLER__.module) |> List.first |> Module.concat(ReadRepo) quote location: :keep do @primary unquote(primary) @otp_app unquote(opts)[:otp_app] || Module.get_attribute(@primary, :otp_app) ...
06c757723bc110d3d3882bed1e0169ed39d14a78
6,745
[ 596151761 ]
[ "documented", "ecto" ]
defmodule Chatter.MessageFilter do @moduledoc """ Describe messages filtering functionality """ import Ecto.Query, warn: false alias Mongo.Ecto.Helpers alias Chatter.{Messages.Message, Repo, Search} def filter_by_params({search, nil = _filter_option, :id = _mode}), do: Enum.map(get_search_messages(s...
06c77d3333501eef0e07ac187fe80edf586b1791
17,758
[ 121880823 ]
[ "test", "documented" ]
defmodule Peers.Test.Handshaking do use ExUnit.Case alias Peers.Server, as: Server alias Peers.Handshaker, as: Handshaker alias Peers.PWP, as: PWP alias Peers.Test.Handshaking.IncomingPeer, as: IncomingPeer alias Peers.Test.Handshaking.ReceivingPeer, as: ReceivingPeer alias Peers.Mock.MockPeerCoordinato...
06c77db3c8e95fa0ca76d7fc358c2bda8e4f7dd9
2,511
[ 913941730 ]
[]
import Config # For development, we disable any cache and enable # debugging and code reloading. # # The watchers configuration can be used to run external # watchers to your application. For example, we can use it # to bundle .js and .css sources. config :live_flip_demo, LiveFlipDemoWeb.Endpoint, # Binding to loopb...
06c7922ad11b3c1bd23e143f4e705609d73ab0de
2,955
[ 559744925, 789802355, 872091867, 610034669, 744142491, 828087786, 599689212, 670103538, 681629586, 713860590, 734242561, 1002277727, 1017741371, 882758430, 884344453, 687446493, 771989527, 773846987, 947818330, 688332642, 694781452, 709785915, 718072585, 747581658, 80...
[ "documented" ]
defprotocol Phoenix.HTML.Safe do @moduledoc """ Defines the HTML safe protocol. In order to promote HTML safety, Phoenix templates do not use `Kernel.to_string/1` to convert data types to strings in templates. Instead, Phoenix uses this protocol which must be implemented by data structures and guarantee ...