code
stringlengths
114
1.05M
path
stringlengths
3
312
quality_prob
float64
0.5
0.99
learning_prob
float64
0.2
1
filename
stringlengths
3
168
kind
stringclasses
1 value
if Code.ensure_loaded?(:telemetry) do defmodule Tesla.Middleware.Telemetry do @moduledoc """ Emits events using the `:telemetry` library to expose instrumentation. ## Example usage ``` defmodule MyClient do use Tesla plug Tesla.Middleware.Telemetry end :telemetry.attach("m...
lib/tesla/middleware/telemetry.ex
0.882504
0.823577
telemetry.ex
starcoder
defmodule ExWire.Packet.Hello do @moduledoc """ This packet establishes capabilities and etc between two peer to peer clents. This is generally required to be the first signed packet communicated after the handshake is complete. ``` **Hello** `0x00` [`p2pVersion`: `P`, `clientId`: `B`, [[`cap1`: `B_3`, `ca...
apps/ex_wire/lib/ex_wire/packet/hello.ex
0.822474
0.856872
hello.ex
starcoder
defmodule Bolt.Cogs.Temprole do @moduledoc false @behaviour Nosedrum.Command alias Bolt.Converters alias Bolt.ErrorFormatters alias Bolt.Events.Handler alias Bolt.Helpers alias Bolt.Humanizer alias Bolt.ModLog alias Bolt.Parsers alias Bolt.Repo alias Bolt.Schema.Infraction alias Nosedrum.Predi...
lib/bolt/cogs/temprole.ex
0.809427
0.556279
temprole.ex
starcoder
defmodule RakNet.ReliabilityLayer.Reliability do @moduledoc "Taken from RakNet's PacketPriority.h" @names_and_vals %{ :unreliable => 0, :unreliable_sequenced => 1, :reliable => 2, :reliable_ordered => 3, :reliable_sequenced => 4, # These are the same as unreliable/reliable/reliable ordered...
lib/reliability_layer.ex
0.709422
0.649197
reliability_layer.ex
starcoder
defmodule Temple.Elements do @moduledoc """ This module contains the primitives used to generate the macros in the `Temple.Html` and `Temple.Svg` modules. """ @doc """ Defines an element. *Note*: Underscores are converted to dashes. ```elixir defmodule MyElements do import Temple.Elements d...
lib/temple/elements.ex
0.711732
0.821474
elements.ex
starcoder
defmodule Detector do alias GameSettings, as: GS @type game_state_result :: {Atom.t, Atom.t, Atom.t} @spec game_state(List.t, {Integer, Integer}, Atom.t) :: game_state_result def game_state(board, coord, colour) do detection_results = { (vertical_win? board, colour, coord), (horizontal_...
lib/detector.ex
0.783119
0.514949
detector.ex
starcoder
defmodule Plotex.Output.Svg do require Logger alias Plotex.Output.Options alias Plotex.Output.Formatter use Phoenix.HTML @doc """ Default example CSS Styling. """ def default_css() do """ .plx-labels { text-anchor: middle; dominant-baseline: central; } ....
lib/plotex/output/svg.ex
0.800848
0.458288
svg.ex
starcoder
defmodule JSON.LD.Decoder do @moduledoc """ """ use RDF.Serialization.Decoder import JSON.LD.{NodeIdentifierMap, Utils} alias JSON.LD.{NodeIdentifierMap, Options} alias RDF.{BlankNode, Dataset, Graph, IRI, Literal, NS, Statement, XSD} @impl RDF.Serialization.Decoder @spec decode(String.t(), keyword)...
lib/json/ld/decoder.ex
0.718298
0.460046
decoder.ex
starcoder
defmodule CanvasAPI.Markdown do @moduledoc """ A block-level Markdown parser for creating canvases from Markdown. """ @cl_item ~r/\A(?<indent>\s*)[*+\-] \[(?<check>[xX ])\] (?<content>.+)\z/ @code_fence ~r/\A```(?<lang>\S*)\z/ @heading ~r/\A(?<hashes>\#{1,6})\s+(?<content>.+)\z/ @horizontal_rule ~r/\A(?:...
lib/canvas_api/markdown.ex
0.61231
0.672668
markdown.ex
starcoder
defmodule Tempo do @moduledoc """ Documentation for `Tempo`. ### Terminology The following terms, defined by ISO 8601, are used throughout Tempo. For further information consult: * [ISO Online browsing platform](https://www.iso.org/obp) * [IEC Electropedia](http://www.electropedia.org/) #### Date ...
lib/tempo.ex
0.916278
0.955277
tempo.ex
starcoder
defmodule SteamEx.ISteamUser do @moduledoc """ Used to access information and interact with users. See [IPlayerService](https://partner.steamgames.com/doc/webapi/IPlayerService) for additional methods. For more info on how to use the Steamworks Web API please see the [Web API Overview](https://partner.steamga...
lib/interfaces/i_steam_user.ex
0.61832
0.412767
i_steam_user.ex
starcoder
defmodule AWS.Macie do @moduledoc """ Amazon Macie Classic Amazon Macie Classic is a security service that uses machine learning to automatically discover, classify, and protect sensitive data in AWS. Macie Classic recognizes sensitive data such as personally identifiable information (PII) or intellectua...
lib/aws/generated/macie.ex
0.73431
0.505127
macie.ex
starcoder
defmodule PatternMetonyms do @moduledoc """ Reusing the description from the paper: Pattern synonyms allow to abstract over patterns used in pattern matching, notably by allowing to use computation instead of being limited to concrete data. Pattern metonyms are an implementations of this, but because of the...
lib/pattern_metonyms.ex
0.925407
0.802903
pattern_metonyms.ex
starcoder
defmodule ProxerEx.Api.User do @moduledoc """ Contains helper methods to build requests for the user api. """ use ProxerEx.Api.Base, api_class: "user" api_func "about" do api_doc(""" Constructs a `ProxerEx.Request` that can be used to send a request to the ```User/Get About``` api. This method ...
lib/api_classes/user_api.ex
0.881309
0.737796
user_api.ex
starcoder
defmodule ShopifyPlug.Sigv do @moduledoc """ When Shopify receives an HTTP request for a proxied path, it will forward that request to the specified Proxy URL. Cookies are not supported for the application proxy, since the application is accessed through the shop's domain. Shopify will strip the Cookie he...
lib/sigv.ex
0.747708
0.7287
sigv.ex
starcoder
defmodule Artemis.Drivers.PagerDuty.ListOnCalls do require Logger alias Artemis.Drivers.PagerDuty defmodule Result do defstruct data: [], meta: %{} end @moduledoc """ Fetches on call from the PagerDuty API. ## Paginated Results The PagerDuty API sets a low limit for how many recor...
apps/artemis/lib/artemis/drivers/pager_duty/list_on_calls.ex
0.601945
0.400163
list_on_calls.ex
starcoder
defmodule Cldr.Calendar.Interval do @moduledoc """ Implements functions to return intervals and compare date intervals. In particular it provides functions which return an interval (as a `Date.Range.t`) for years, quarters, months, weeks and days. In general, the intervals created with the packaage [c...
lib/cldr/calendar/interval.ex
0.953998
0.839142
interval.ex
starcoder
defmodule AWS.CloudWatch.Events do @moduledoc """ Amazon CloudWatch Events helps you to respond to state changes in your AWS resources. When your resources change state, they automatically send events into an event stream. You can create rules that match selected events in the stream and route them to target...
lib/aws/cloudwatch_events.ex
0.895537
0.566978
cloudwatch_events.ex
starcoder
defmodule Scenic do @moduledoc """ Scenic is an application framework written directly on the Elixir/Erlang/OTP stack. With it you can build client-side applications that operate identically across all supported operating systems, including MacOS, Ubuntu, Nerves/Linux, and more. Scenic is primarily aimed at...
lib/scenic.ex
0.799325
0.605099
scenic.ex
starcoder
defmodule RDF.Serialization.Format do @moduledoc """ A behaviour for RDF serialization formats. A serialization format can be implemented like this defmodule SomeFormat do use RDF.Serialization.Format import RDF.Sigils @id ~I<http://example.com/some_format> @name ...
lib/rdf/serialization/format.ex
0.959386
0.608245
format.ex
starcoder
defmodule Mix.Tasks.Compile.Boundary do # credo:disable-for-this-file Credo.Check.Readability.Specs use Boundary, deps: [Boundary] use Mix.Task.Compiler alias Boundary.Xref @moduledoc """ Verifies cross-module function calls according to defined boundaries. This compiler reports all cross-boundary func...
lib/mix/tasks/compile/boundary.ex
0.856947
0.735713
boundary.ex
starcoder
defmodule Mix.Deps.Retriever do @moduledoc false @doc """ Returns all dependencies for the current Mix.Project as a `Mix.Dep` record. ## Exceptions This function raises an exception in case the developer provides a dependency in the wrong format. """ def all(post_config // []) do { deps, _ } = ...
lib/mix/lib/mix/deps/retriever.ex
0.735642
0.401043
retriever.ex
starcoder
defmodule DenseNN do import Nx.Defn defn init_random_params do # 3 layers # 1. Dense(64) with sigmoid # 2. Dense(32) with sigmoid # 3. Dense(10) with softmax w1 = Nx.random_normal({1024, 64}, 0.0, 0.1, names: [:input, :layer1]) b1 = Nx.random_normal({64}, 0.0, 0.1, names: [:layer1]) ...
lib/densenn.ex
0.675978
0.593491
densenn.ex
starcoder
defmodule ExRabbitMQ.Config.Session do @moduledoc """ A structure holding the necessary information about a queue that is to be consumed. #### Queue configuration example: ```elixir # :queue is this queue's configuration name config :exrabbitmq, :my_session_config, # name of the queue from which we w...
lib/ex_rabbit_m_q/config/session.ex
0.836388
0.753263
session.ex
starcoder
defmodule Zaryn.SharedSecrets.NodeRenewalScheduler do @moduledoc """ Schedule the renewal of node shared secrets At each `interval - trigger offset` , a new node shared secrets transaction is created with the new authorized nodes and is broadcasted to the validation nodes to include them as new authorized no...
lib/zaryn/shared_secrets/node_renewal_scheduler.ex
0.860105
0.551695
node_renewal_scheduler.ex
starcoder
defmodule AeppSDK.Channel.OffChain do @moduledoc """ Module for Aeternity Off-chain channel activities, see: [https://github.com/aeternity/protocol/blob/master/channels/OFF-CHAIN.md](https://github.com/aeternity/protocol/blob/master/channels/OFF-CHAIN.md) Contains Off-Chain channel-related functionality. """ ...
lib/core/channel/offchain.ex
0.839454
0.47658
offchain.ex
starcoder
defmodule Arrow.Disruption.DayOfWeek do @moduledoc """ The day of the week that a disruption takes place. """ use Ecto.Schema import Ecto.Changeset @type t :: %__MODULE__{ day_name: String.t() | nil, start_time: Time.t() | nil, end_time: Time.t() | nil, disruption_r...
lib/arrow/disruption/day_of_week.ex
0.806777
0.42316
day_of_week.ex
starcoder
defmodule Conform.Schema.Mapping do @moduledoc """ This module defines a struct which represents a mapping definition. ## Definitions - "path" - A string of dot-separated tokens which represent the path to a setting, a path can contain variables which represent wildcard values such that any value at that ...
lib/conform/schema/mapping.ex
0.722429
0.663594
mapping.ex
starcoder
defmodule Trash.Repo do @moduledoc """ Provides functions for discarding and keeping records and querying for them via `Ecto.Repo` functions. """ require Ecto.Query alias Ecto.Query alias Ecto.Queryable alias Ecto.Changeset alias Trash.Query, as: TrashQuery @doc """ Imports functions from `Trash...
lib/trash/repo.ex
0.911333
0.646321
repo.ex
starcoder
defmodule Exexif.Decode do @moduledoc """ Decode tags and (in some cases) their parameters """ def tag(:tiff, 0x0100, value), do: { :image_width, value } def tag(:tiff, 0x0101, value), do: { :image_height, value } def tag(:tiff, 0x010d, value), do: { :document_name, value } def tag(:tiff, 0x010e, valu...
lib/exexif/decode.ex
0.773259
0.695312
decode.ex
starcoder
defmodule Bolt.Sips.Internals.PackStream.EncoderV1 do @moduledoc false alias Bolt.Sips.Internals.PackStream.Encoder use Bolt.Sips.Internals.PackStream.Markers @int8 -127..-17 @int16_low -32_768..-129 @int16_high 128..32_767 @int32_low -2_147_483_648..-32_769 @int32_high 32_768..2_147_483_647 @int64_l...
lib/bolt_sips/internals/pack_stream/encoder_v1.ex
0.876191
0.492127
encoder_v1.ex
starcoder
defmodule AWS.QLDBSession do @moduledoc """ The transactional data APIs for Amazon QLDB Instead of interacting directly with this API, we recommend using the QLDB driver or the QLDB shell to execute data transactions on a ledger. If you are working with an AWS SDK, use the QLDB driver. The driver prov...
lib/aws/generated/qldb_session.ex
0.868144
0.499329
qldb_session.ex
starcoder
defprotocol Realm.Monoid do @moduledoc ~S""" Monoid extends the semigroup with the concept of an "empty" or "zero" element. ## Type Class An instance of `Realm.Monoid` must also implement `Realm.Semigroup`, and define `Realm.Monoid.empty/1`. Semigroup [append/2] ↓ Monoid [empty/1] ...
lib/realm/monoid.ex
0.839109
0.53048
monoid.ex
starcoder
defmodule Bonny.Server.Scheduler.Binding do @moduledoc """ Kubernetes [binding](#placeholder) interface. Currently [undocumented](https://github.com/kubernetes/kubernetes/issues/75749) in Kubernetes docs. ## Links * [Example using curl](https://gist.github.com/kelseyhightower/2349c9c645d32a3fcbe385082de7466...
lib/bonny/server/scheduler/binding.ex
0.830422
0.485844
binding.ex
starcoder
defmodule JsonSerde do @moduledoc """ A Json Serialization/Deserialization library that aims to create json documents from any nested data structures and deserialize json documents back to same datastructure. ```elixir iex(1)> map = %{"name" => "Joe", "age" => 21, "birthdate" => Date.new(1970, 1, 1) |> elem(...
lib/json_serde.ex
0.803637
0.67003
json_serde.ex
starcoder
defmodule RDF.Sigils do @moduledoc """ Sigils for the most common types of RDF nodes. """ @doc ~S""" Handles the sigil `~I` for IRIs. It returns an `RDF.IRI` from the given string without interpolations and without escape characters, except for the escaping of the closing sigil character itself. ##...
lib/rdf/sigils.ex
0.84106
0.611643
sigils.ex
starcoder
defmodule Bunch.Math do @moduledoc """ A bunch of math helper functions. """ @doc """ Applies `div/2` and `rem/2` to arguments and returns results as a tuple. ## Example iex> #{inspect(__MODULE__)}.div_rem(10, 4) {div(10, 4), rem(10, 4)} """ @spec div_rem(divident :: non_neg_integer, div...
lib/bunch/math.ex
0.90022
0.50061
math.ex
starcoder
defmodule Transmog.KeyPairs do @moduledoc """ `Transmog.KeyPairs` is a struct which holds the information about a list of `t:key_pair/0` and ensures that they are valid. A key pair is a list of mappings from one path to another. For example, `{[:a], [:b]}` indicates that we are transforming a map with keys `:...
lib/transmog/key_pairs.ex
0.884558
0.685568
key_pairs.ex
starcoder
defmodule Generator.Maze do @moduledoc """ Module for handling the overall maze. Mazes are being represented as a list Cells """ alias Generator.Cell @doc """ Makes a new maze of Cells with the width(x) and height (y) ## Examples m = Generator.Maze.make 1, 1 m [{%Cell{x: 0, y: ...
alex_story+elixir/maze_jam/apps/generator/lib/generator/maze.ex
0.852061
0.613468
maze.ex
starcoder
defmodule RlStudy.DP.Planner do alias RlStudy.MDP.Environment require Logger require Matrex @planner_data [env: nil, log: nil] @type t :: %RlStudy.DP.Planner{ env: RlStudy.MDP.Environment.t(), log: [] | [String.t()] } defstruct @planner_data def planner_data() do @planne...
lib/dp/planner.ex
0.691706
0.680826
planner.ex
starcoder
defmodule Calibex do @moduledoc """ Calibex allows you to handle ICal file format. In the same way as the `mailibex` library, Calibex allows bijective coding/decoding : making it possible to modify an ical and to keep all fields and struct of the initial ical. The ICal elixir term is exactly a representa...
lib/calibex.ex
0.822189
0.792544
calibex.ex
starcoder
defmodule ExDoc.Formatter.HTML.Autolink do import ExDoc.Formatter.HTML.Templates, only: [h: 1, enc_h: 1] @moduledoc """ Conveniences for autolinking locals, types and more. """ @elixir_docs "http://elixir-lang.org/docs/stable/" @erlang_docs "http://www.erlang.org/doc/man/" @doc """ Receives a list of ...
lib/ex_doc/formatter/html/autolink.ex
0.641535
0.446857
autolink.ex
starcoder
defmodule Microdata.Strategy.HTMLMicrodata do @moduledoc """ `Microdata.Strategy.HTMLMicrodata` defines a strategy to extract HTML microdata from a `Meeseeks.Document`, based on the W3C [HTML Microdata format](https://www.w3.org/TR/microdata/). ### Caveats - `itemref` lookups are not yet supported """ @be...
lib/microdata/strategy/html_microdata.ex
0.798619
0.435121
html_microdata.ex
starcoder
defmodule Bowling do @doc """ Creates a new game of bowling that can be used to store the results of the game """ @spec start() :: any def start, do: {1, [], []} @doc """ Records the number of pins knocked down on a single roll. Returns `any` unless there is something wrong with the given nu...
exercism/bowling/bowling.ex
0.842004
0.702913
bowling.ex
starcoder
defmodule Commanded.ExampleDomain.BankAccount do @moduledoc false @derive Jason.Encoder defstruct [:account_number, :state, balance: 0] alias Commanded.ExampleDomain.BankAccount defmodule Commands do defmodule OpenAccount do defstruct [:account_number, :initial_balance] end defmodule Dep...
test/example_domain/bank_account/bank_account.ex
0.737064
0.688567
bank_account.ex
starcoder
defmodule AWS.Health do @moduledoc """ AWS Health The AWS Health API provides programmatic access to the AWS Health information that appears in the [AWS Personal Health Dashboard](https://phd.aws.amazon.com/phd/home#/). You can use the API operations to get information about AWS Health events that affect...
lib/aws/generated/health.ex
0.905646
0.573619
health.ex
starcoder
defmodule TaxationDoubleAuction do use XeeThemeScript require Logger use Timex @modes ["wait", "description", "auction", "result"] @tax_type ["lump_sum", "proportional", "regressive", "progressive"] @tax_target ["buyer", "seller", "both"] # Callbacks def script_type do :message end def insta...
lib/xee_double_auction.ex
0.562777
0.434461
xee_double_auction.ex
starcoder
defmodule GrovePi.Sound.HysteresisTrigger do @behaviour GrovePi.Trigger @default_high_threshold 510 @default_low_threshold 490 @moduledoc """ This is the default triggering mechanism for Sound events. Events are either `loud` or `quiet` and include the trigger state. It contains to thresholds a `low_thr...
lib/grovepi/sound/hysteresis_trigger.ex
0.896475
0.740714
hysteresis_trigger.ex
starcoder
defmodule EDS.Fixtures.Guards do import Bitwise def addition(a, b, c) when a + b === c, do: true def addition(_, _, _), do: false def binary_and(a, b, c) when (a &&& b) === c, do: true def binary_and(_, _, _), do: false def binary_band(a, b, c) when band(a, b) === c, do: true def binary_band(_, _, _...
test/fixtures/guards.ex
0.672439
0.475179
guards.ex
starcoder
defmodule Finitomata.Transition do @moduledoc false alias Finitomata.Transition @type state :: atom() @type event :: atom() @typedoc """ The transition is represented by `from` and `to` states _and_ the `event`. """ @type t :: %{ __struct__: Transition, from: state(), to...
lib/finitomata/transition.ex
0.831793
0.52409
transition.ex
starcoder
defmodule Tanga do @moduledoc """ Tanga is a collection of string helpers similar to those that can be found in Ruby. """ @type t :: binary @digits hd('0')..hd('9') |> Enum.to_list @uppercase_characters hd('A')..hd('A') |> Enum.to_list @lowercase_characters hd('a')..hd('z') |> Enum.to_list @doc """ ...
lib/tanga.ex
0.83901
0.423398
tanga.ex
starcoder
defmodule OMG.State.Transaction.Payment do @moduledoc """ Internal representation of a payment transaction done on Plasma chain. This module holds the representation of a "raw" transaction, i.e. without signatures nor recovered input spenders """ alias OMG.Crypto alias OMG.State.Transaction alia...
apps/omg/lib/omg/state/transaction/payment.ex
0.859133
0.718928
payment.ex
starcoder
defmodule Day21Old do @start [[".", "#", "."], [".", ".", "#"], ["#", "#", "#"]] def solveA(filename), do: solve filename, 5 def solveB(filename), do: solve filename, 18 def solve(filename, niter) do book = parse filename grid = rec_solveA @start, niter, book grid |> List.fl...
2017/elixir/day21/lib/day21_old.ex
0.506103
0.622373
day21_old.ex
starcoder
defmodule ComplexNum.Cartesian do import Kernel, except: [div: 2] alias ComplexNum.{Cartesian} @moduledoc """ A simple Complex Number in the form of `a + b*i`. `a` and `b` are allowed to be any type that implements the `Numeric` behaviour. This means Integer and Float, as well as custom-built data types l...
lib/complex_num/cartesian.ex
0.925533
0.810554
cartesian.ex
starcoder
defmodule OMG.State.UtxoSet do @moduledoc """ Handles all the operations done on the UTXOs held in the ledger It will provide the requested UTXOs by a collection of inputs, trade in transaction effects (new utxos, utxos to delete). It also translates the modifications to it into DB updates, and is able to in...
apps/omg/lib/omg/state/utxo_set.ex
0.802903
0.4081
utxo_set.ex
starcoder
defmodule Binary.Dict do @moduledoc """ This module implements a dictionary that forces the keys to be converted to binaries on insertion. Currently it is implemented using a `List.Dict` underneath, but this may change in the future. Check the `Dict` module for examples and documentation. """ import K...
lib/binary/dict.ex
0.837952
0.65388
dict.ex
starcoder
defmodule Ecto.Adapters.SQL do @moduledoc """ Behaviour and implementation for SQL adapters. The implementation for SQL adapter provides a pooled based implementation of SQL and also expose a query function to developers. Developers that use `Ecto.Adapters.SQL` should implement a connection module with ...
deps/ecto/lib/ecto/adapters/sql.ex
0.866062
0.533762
sql.ex
starcoder
defmodule BattleCity.Display do @moduledoc false @spec columns(ComplexDisplay.t(), keyword()) :: keyword def columns(o, opts \\ []) do SimpleDisplay.columns(o) ++ ComplexDisplay.columns(o, Map.new(opts)) end end # defprotocol Grid do # @spec grid(t) :: BattleCity.Context.grid() # def grid(struct) # en...
lib/battle_city/protocols/display.ex
0.563258
0.460713
display.ex
starcoder
defmodule TypedEctoSchema.SyntaxSugar do @moduledoc false # Defines the syntax sugar we apply on top of Ecto's DSL # This works by transforming calls to Ecto's own macros to also call # Our Type Builder alias TypedEctoSchema.SyntaxSugar alias TypedEctoSchema.TypeBuilder @schema_function_names [ :fie...
lib/typed_ecto_schema/syntax_sugar.ex
0.591369
0.432003
syntax_sugar.ex
starcoder
defmodule ChallengeGov.Reports.DapReports do @moduledoc """ Context for creating a report """ import Ecto.Query alias ChallengeGov.Repo alias ChallengeGov.Reports.DapReport alias Stein.Storage @doc """ Get a dap report """ def get_dap_report(id) do case Repo.get(DapReport, id) do nil ...
lib/challenge_gov/dap_reports.ex
0.621656
0.408041
dap_reports.ex
starcoder
defmodule Grizzly.CommandClass.Powerlevel do @type power_level_report :: %{power_level: power_level_description, timeout: non_neg_integer} @type test_node_report :: %{ test_node_id: non_neg_integer, status_of_operation: status_of_operation_description, test_frame_acknowledged_count: no...
lib/grizzly/command_class/powerlevel.ex
0.81372
0.483344
powerlevel.ex
starcoder
defmodule Lettuce do @moduledoc """ Lettuce is a generic server process that checks the files within an elixir project that has lettuce as a dependency and then runs `iex -S mix`. It initialises the state of the generic server with the `.ex` files inside `lib` and their last modified time. By default `lib` i...
lib/lettuce.ex
0.83128
0.424144
lettuce.ex
starcoder
defmodule Argon2 do @moduledoc """ Elixir wrapper for the Argon2 password hashing function. Most applications will just need to use the `add_hash/2` and `check_pass/3` convenience functions in this module. For a lower-level API, see `Argon2.Base`. ## Configuration See the documentation for `Argon2.Sta...
lib/argon2.ex
0.865153
0.626995
argon2.ex
starcoder
defmodule FakeServer.ResponseFactory do @moduledoc """ Create reusable and customizable answers for your servers. With response factories it is possible to create a default format of a given response and identify it with a name so that it can be shared across several test cases. They are inspired by the [ExMa...
lib/fake_server/response_factory.ex
0.813757
0.738315
response_factory.ex
starcoder
defmodule Sanbase.Signal.OperationEvaluation do @moduledoc ~s""" Module providing a single function operation_triggered?/2 that by a given value and operation returns true or false """ def operation_triggered?(nil, _), do: false def operation_triggered?(value, %{some_of: operations}) when is_list(operation...
lib/sanbase/signals/operation/operation_evaluation.ex
0.761272
0.558026
operation_evaluation.ex
starcoder
defmodule Discovery.Data.Provider do defstruct [ :id, :name, :description ] use Accessible def provider(id, name, description) do %Discovery.Data.Provider{id: id, name: name, description: description} end def list() do data = [ provider("1", "Cloud Storage", "Cloud Blob Storage...
lib/discovery/data/provider.ex
0.57678
0.448728
provider.ex
starcoder
defmodule Guss.Canonical.Extensions do @moduledoc false @doc """ Converts resource extensions into canonical extension headers. For more information, see: https://cloud.google.com/storage/docs/access-control/signed-urls-v2 ## Examples iex> to_string(Guss.Canonical.Extensions.to_iodata(acl: :public...
lib/guss/canonical.extensions.ex
0.703855
0.426142
canonical.extensions.ex
starcoder
defmodule Vote do @moduledoc """ Provides Ranked (STV, AV), and Unranked (FPTP) ballot evaluation. * STV uses a quota to determine when a candidate is elected in rounds. Droop, Hare, Impirali, and Hagenbach Bischoff quotas are available. * IRV is a degenerate case of STV where only one seat is elected, a...
lib/vote.ex
0.847542
0.870046
vote.ex
starcoder
defmodule ExUnit do defrecord Test, [:name, :case, :failure, :time] do @moduledoc """ A record that keeps information about the test. It is received by formatters and also accessible in the metadata under the key `:test`. """ end defrecord TestCase, [:name, :failure] do @moduledoc """ ...
lib/ex_unit/lib/ex_unit.ex
0.834643
0.829837
ex_unit.ex
starcoder
defmodule Chronos.Timezones do @zones [ { "A", "Alpha Time Zone", "+1:00" }, { "ACDT", "Australian Central Daylight Time", "+10:30" }, { "ACST", "Australian Central Standard Time", "+9:30" }, { "ACT", "Australian Central Time", "+10:30" }, { "ACWST", "Australian Central Western Standard Time", "+...
lib/chronos/timezones.ex
0.553747
0.53127
timezones.ex
starcoder
defmodule Traverse.Walker do use Traverse.Types alias Traverse.Cut import Traverse.Enum, only: [reduce: 3] @moduledoc """ Implements traversal functions, structure is not maintained unless the traversal functions do so. """ @spec postwalk(any, any, t_simple_walker_fn) :: any def postwalk(coll, acc, ...
lib/traverse/walker.ex
0.783202
0.463626
walker.ex
starcoder
import ExType.Typespec, only: [deftypespec: 2] deftypespec Map do @type t(key, value) :: %{optional(key) => value} @spec delete(t(k, v), k) :: t(k, v) when k: any(), v: any() @spec drop(t(k, v), T.p(Enumerable, k)) :: t(k, v) when k: any(), v: any() @spec equal?(map(), map()) :: boolean() @spec fetch(t(k...
lib/ex_type/typespec/elixir/map.ex
0.808861
0.563858
map.ex
starcoder
defmodule ExchangeApiWeb.OrderBookLive do @moduledoc false use ExchangeApiWeb, :live_view alias ExchangeApiWeb.Ticker def mount(%{"ticker" => ticker}, _session, socket) do if connected?(socket), do: :timer.send_interval(1000, self(), :tick) {:ok, tick} = Ticker.get_ticker(ticker) {:ok, open_orders...
lib/exchange_api_web/live/order_book_live.ex
0.621311
0.527377
order_book_live.ex
starcoder
defmodule Xandra.Batch do @moduledoc """ Represents a batch of simple and/or prepared queries. This module provides a data structure that can be used to group queries and execute them as a Cassandra `BATCH` query. Batch queries can be executed through `Xandra.execute/3` and `Xandra.execute!/3`; see their res...
lib/xandra/batch.ex
0.907691
0.732065
batch.ex
starcoder
defmodule Monad.Maybe do @moduledoc """ A monad that represents something or nothing. The concept of having something vs. nothing is similar to having a value vs. `nil`. """ @typedoc """ The possible types of values that can occur (i.e. something and nothing). """ @type maybe_type :: :some | :none ...
lib/monad/maybe.ex
0.875061
0.499878
maybe.ex
starcoder
defmodule HexGrid.Hex do alias HexGrid.Hex, as: Hex @moduledoc """ Hex Tile module. See this excellent article for reference: http://www.redblobgames.com/grids/hexagons/implementation.html """ defstruct q: 0, r: 0, s: 0 @typedoc "Hex Tile" @opaque t :: %__MODULE__{q: number, r: number, s: number} ...
lib/hex.ex
0.944254
0.671772
hex.ex
starcoder
defmodule ExUnit.Callbacks do @moduledoc %B""" This module defines four callbacks: `setup_all`, `teardown_all`, `setup` and `teardown`. Those callbacks are defined via macros and receives a keyword list of metadata. The callback may optionally define extra data which will be available in the test cases. ...
lib/ex_unit/lib/ex_unit/callbacks.ex
0.841972
0.482124
callbacks.ex
starcoder
defmodule Ash.Changeset do @moduledoc """ Changesets are used to create and update data in Ash. Create a changeset with `new/1` or `new/2`, and alter the attributes and relationships using the functions provided in this module. Nothing in this module actually incurs changes in a data layer. To commit a chan...
lib/ash/changeset/changeset.ex
0.90165
0.774605
changeset.ex
starcoder
defmodule Mix.Tasks.Server do @moduledoc """ This Mix task is used to start an HTTP server from the current working directory. If the directory contains an `index.html` or `index.htm` file then that file will be served. Else a file explorer will be presented. The valid CLI arguments include: ``` --port ...
lib/mix/tasks/server.ex
0.726134
0.683301
server.ex
starcoder
defmodule DataBase.Schemas.AccountHistory do @moduledoc """ The bank account daily logbook. It's in charge to keep track of all `t:DataBase.Schemas.AccountMovement.t/0` `:direction` and `:amount` of a `t:DataBase.Schemas.Account.t/0` for each day. It acts as logbook. Expresses information over the `acco...
apps/database/lib/database/schemas/account_history.ex
0.845736
0.681038
account_history.ex
starcoder
defmodule SparkPost.Endpoint do @moduledoc """ Base client for the SparkPost API, able to make requests and interpret responses. This module underpins the SparkPost.* modules. """ @default_endpoint "https://api.sparkpost.com/api/v1/" @doc """ Make a request to the SparkPost API. ## Parameters - `...
lib/endpoint.ex
0.864454
0.427875
endpoint.ex
starcoder
defmodule ExRabbitMQ.Consumer do @moduledoc """ A behaviour module that abstracts away the handling of RabbitMQ connections and channels. It abstracts the handling of message delivery and acknowlegement. It also provides hooks to allow the programmer to wrap the consumption of a message without having to dire...
lib/ex_rabbit_m_q/consumer.ex
0.882187
0.875095
consumer.ex
starcoder
defmodule PhoenixIntegration.Form.Messages do @moduledoc false # The various messages - both warnings and errors - that can be given to the user. alias PhoenixIntegration.Form.Common @headlines %{ no_such_name_in_form: "You tried to set the value of a tag that isn't in the form.", arity_clash: "You...
lib/phoenix_integration/form/messages.ex
0.724091
0.470068
messages.ex
starcoder
defmodule Membrane.RTP.JitterBuffer.BufferStore do @moduledoc false # Store for RTP packets. Packets are stored in `Heap` ordered by packet index. Packet index is # defined in RFC 3711 (SRTP) as: 2^16 * rollover count + sequence number. use Bunch use Bunch.Access alias Membrane.{Buffer, RTP} alias Membr...
lib/membrane/rtp/jitter_buffer/buffer_store.ex
0.803251
0.54698
buffer_store.ex
starcoder
defmodule ESpec.Assertions.Accepted do @moduledoc """ Defines 'accepted' assertion. it do: expect(SomeModule).to accepted(:func) """ use ESpec.Assertions.Interface defp match(subject, [func, args, opts]) do pid = Keyword.get(opts, :pid) || :any opts_count = Keyword.get(opts, :count) || :any c...
lib/espec/assertions/accepted.ex
0.636692
0.467149
accepted.ex
starcoder
defmodule EVM.Refunds.Sstore do alias EVM.{ExecEnv, Gas} # Refund given (added into refund counter) when the storage value is set to zero from non-zero. @storage_refund 15_000 @spec refund({integer(), integer()}, ExecEnv.t()) :: {ExecEnv.t(), integer()} def refund({key, new_value}, exec_env) do if exec_...
apps/evm/lib/evm/refunds/sstore.ex
0.551332
0.418162
sstore.ex
starcoder
defmodule Coders.Repo do @moduledoc """ Maintain DB connection and implement functions which handle models. DB most functions have two forms, the normal form, and the band form ( with "!" suffix). Usually, the normal form will return `#{__MODULE__}.rethink_resp`, while the bang form will return the data dire...
lib/coders/repo.ex
0.601125
0.46794
repo.ex
starcoder
defmodule Cuda.Test.GraphHelpers do @moduledoc """ Represents helper functions for testing Cuda.Graph module """ # graphics: ┌┐└┘─│▶⎡⎣⎤⎦┴┤├┬ alias Cuda.Graph alias Cuda.Graph.Node alias Cuda.Graph.Pin defmodule Double do @moduledoc """ Implements node with two input and output pins and specif...
test/support/graph_helpers.ex
0.733738
0.603581
graph_helpers.ex
starcoder
defmodule Toby.App.Views.Load do @moduledoc """ Builds a view for displaying information about system load """ import Ratatouille.Constants, only: [color: 1] import Ratatouille.View alias Toby.Util.Selection @style_selected [ color: color(:black), background: color(:white) ] def render(%{ ...
lib/toby/app/views/load.ex
0.804675
0.469703
load.ex
starcoder
defmodule GrowthBook.Condition do @moduledoc """ Functionality for evaluating conditions. You should not (have to) use any of these functions in your own application. They are documented for library developers only. Breaking changes in this module will not be considered breaking changes in the library's publ...
lib/growth_book/condition.ex
0.930514
0.789234
condition.ex
starcoder
defmodule Rayray.Renderings.Scene do alias Rayray.Camera alias Rayray.Canvas alias Rayray.Lights alias Rayray.Material alias Rayray.Matrix alias Rayray.Sphere alias Rayray.Transformations alias Rayray.Tuple alias Rayray.World def do_it() do # floor floor = Sphere.new() material = Materi...
lib/rayray/renderings/scene.ex
0.830594
0.538134
scene.ex
starcoder
defmodule BitwiseIp.Blocks do @moduledoc """ Functions for handling lists of bitwise IP blocks. Because the `BitwiseIp.Block` representation relies on a binary prefix, it's not possible to express certain ranges with a single block. For instance, the range of addresses between `192.168.12.0` and `192.168.16....
lib/bitwise_ip/blocks.ex
0.949576
0.919643
blocks.ex
starcoder
defmodule Grizzly.ZWave.Commands.NodeInfoCachedGet do @moduledoc """ Get the node information that is cached on another device This is useful for getting the command classes and device classes When sending this command the Z-Wave network should send back a `NodeInfoCachedReport` command. Params: `:se...
lib/grizzly/zwave/commands/node_info_cached_get.ex
0.767211
0.676212
node_info_cached_get.ex
starcoder
defmodule Aoc2021.Day13 do @moduledoc """ See https://adventofcode.com/2021/day/13 """ @type instruction() :: {:fold_x, non_neg_integer()} | {:fold_y, non_neg_integer()} defmodule Reader do @moduledoc false @spec read_input(Path.t()) :: {MapSet.t(), [Aoc2021.Day13.instruction()]} def read_input...
lib/aoc2021/day13.ex
0.743168
0.439988
day13.ex
starcoder
defmodule Niex.Content do defstruct(content: nil, type: nil) @moduledoc """ Content that can be rendered within a cell in a Niex notebook when returned (or rendered via `Niex.render/1`) in a notebook cell. """ @doc """ Builds content for a cell containing an image at the provided `url`. """ def imag...
niex/lib/niex/content.ex
0.822759
0.560854
content.ex
starcoder
defmodule Underscore do @moduledoc """ Re-implementing (most of) the pure collection functions from Underscore.js in Elixir (as a code kata exercise). Requirements: neither the Enum module nor native erlang method implementations may be used and functions must support tail recursion. """ @doc """ ## Examples...
lib/underscore.ex
0.827584
0.484258
underscore.ex
starcoder
defmodule Ash.Resource.Identity do @moduledoc """ Represents a unique constraint on a resource Data layers should (and all built in ones do), discount `nil` or `null` (in the case of postgres) values when determining if a unique constraint matches. This often means that you should prefer to use identities wi...
lib/ash/resource/identity.ex
0.925735
0.617844
identity.ex
starcoder
defmodule Kxir.Logs do @moduledoc """ Provides convience operations over kubernetes logging facilities. Requires a 'pod_name' and optionally a namespace (defaults to "default"). Example: kx logs some-pod somenamespace """ @behaviour Kxir.CLI.Help alias Kxir.{Pod, Logs.Filter.Jaro} @doc """ Aggregat...
lib/kxir/log/log.ex
0.550607
0.402128
log.ex
starcoder
defmodule Statistics.Math do @e :math.exp(1) @pi :math.pi() @doc """ Get square root return sqrt from Erlang ## Examples iex> Statistics.Math.sqrt(9) 3.0 iex> Statistics.Math.sqrt(99) 9.9498743710662 """ @spec sqrt(number) :: number defdelegate sqrt(num), to: :math @doc...
lib/math/math.ex
0.882136
0.646056
math.ex
starcoder
defmodule AWS.TimestreamWrite do @moduledoc """ Amazon Timestream Write Amazon Timestream is a fast, scalable, fully managed time series database service that makes it easy to store and analyze trillions of time series data points per day. With Timestream, you can easily store and analyze IoT sensor data...
lib/aws/generated/timestream_write.ex
0.895191
0.603465
timestream_write.ex
starcoder