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
defmodule Bandit.HTTP2.Adapter do @moduledoc false @behaviour Plug.Conn.Adapter defstruct connection: nil, peer: nil, stream_id: nil, end_stream: false, uri: nil @typedoc "A struct for backing a Plug.Conn.Adapter" @type t :: %__MODULE__{ connection: Bandit.HTTP2.Connection.t(), peer: Pl...
lib/bandit/http2/adapter.ex
0.855565
0.400192
adapter.ex
starcoder
defmodule Accent.Scopes.Operation do import Ecto.Query, only: [from: 2] @doc """ ## Examples iex> Accent.Scopes.Operation.filter_from_user(Accent.Operation, nil) Accent.Operation iex> Accent.Scopes.Operation.filter_from_user(Accent.Operation, "test") #Ecto.Query<from o0 in Accent.Operation, wher...
lib/accent/scopes/operation.ex
0.735167
0.415462
operation.ex
starcoder
defmodule Finch.Telemetry do @moduledoc """ Telemetry integration. Unless specified, all time's are in `:native` units. Finch executes the following events: * `[:finch, :queue, :start]` - Executed before checking out a connection from the pool. #### Measurements * `:system_time` - The system ti...
lib/finch/telemetry.ex
0.867008
0.75401
telemetry.ex
starcoder
defmodule DatabaseAssertions do alias Cog.Repo import ExUnit.Assertions alias Cog.Models.Permission alias Cog.Models.Role @doc """ Asserts that each given permission is directly associated to the grantee in question. Does NOT test permissions associated by recursive group membership. Example: ...
test/support/database_assertions.ex
0.748812
0.451508
database_assertions.ex
starcoder
defmodule Verk.Node do @moduledoc """ Node data controller. """ @verk_nodes_key "verk_nodes" @spec deregister!(String.t(), GenServer.t()) :: :ok def deregister!(verk_node_id, redis) do Redix.pipeline!(redis, [ ["DEL", verk_node_key(verk_node_id)], ["DEL", verk_node_queues_key(verk_node_id)...
lib/verk/node.ex
0.784526
0.469581
node.ex
starcoder
defmodule Wonderland.Data.Maybe do use Calculus use Wonderland.TypeClass @moduledoc """ Classic sum type which represents optional value - Functor - Monad - Applicative """ @typep a :: term @type t(a) :: __MODULE__.t(a) defmacrop justp(x) do quote location: :keep do {:justp, unquote(...
lib/wonderland/data/maybe.ex
0.862207
0.894375
maybe.ex
starcoder
defmodule EctoEnum do @moduledoc """ Provides `defenum/2` macro for defining an Enum Ecto type. """ @doc """ Defines an enum custom `Ecto.Type`. It can be used like any other `Ecto.Type` by passing it to a field in your model's schema block. For example: import EctoEnum defenum StatusEnum, ...
lib/ecto_enum.ex
0.850794
0.42919
ecto_enum.ex
starcoder
defmodule Wild do @moduledoc """ A wildcard matching library that implements unix-style blob pattern matching functionality for Elixir binaries. It works on all binary input and defaults to working with codepoint representations of binaries. The `match?/3` and `valid_pattern?/1` functions support all of the...
lib/wild.ex
0.93126
0.848972
wild.ex
starcoder
defmodule Rex.Fun do # Converts a quoted Rex word into a quoted Elixir # function that handles the state @moduledoc false def to_fun({:@, _, [[expr]]}, env) do quoted_expr(expr, env) end def to_fun(expr, _env) do fun_expr(expr) end defp quoted_expr(quoted, env) do expr = {quoted, env} |>...
lib/rex/fun.ex
0.564219
0.644561
fun.ex
starcoder
defmodule MuonTrap.Daemon do use GenServer require Logger alias MuonTrap.Options @moduledoc """ Wrap an OS process in a GenServer so that it can be supervised. For example, in your children list add MuonTrap.Daemon like this: ```elixir children = [ {MuonTrap.Daemon, ["myserver", ["--options", "f...
lib/muontrap/daemon.ex
0.755096
0.668147
daemon.ex
starcoder
defmodule ExAliyunOts.Utils do @moduledoc """ Common tools. """ @geo_point_reg ~r/\-?\d+\.?\d*,\-?\d+\.?\d*/ defmodule Guards do @moduledoc false defguard is_valid_primary_key_type(type) when type in [:integer, :binary, :string] defguard is_valid_string(value) when value != nil and value != ""...
lib/ex_aliyun_ots/utils.ex
0.641085
0.471162
utils.ex
starcoder
defmodule Expublish.Semver do @moduledoc """ Functions for manipulating [%Version{}](https://hexdocs.pm/elixir/Version.html). """ @alpha "alpha" @beta "beta" @rc "rc" alias Expublish.Options require Logger @type level() :: :major | :minor | :patch | :rc | :beta | :alpha | :stable @spec increase!...
lib/expublish/semver.ex
0.802207
0.412264
semver.ex
starcoder
defmodule PlugRest.Router do @moduledoc ~S""" A DSL to supplement Plug Router with a resource-oriented routing algorithm. It provides a macro to generate routes that dispatch to specific resource handlers. For example: defmodule MyApp.Router do use PlugRest.Router plug :match pl...
lib/plug_rest/router.ex
0.876026
0.469581
router.ex
starcoder
defmodule MailgunEx do @moduledoc """ A client API to the MailGun Email RESTful API. You can sign up for a free account at: https://signup.mailgun.com/new/signup And the latest API documentation is available at: https://documentation.mailgun.com/en/latest/ To access direct calls to the servic...
lib/mailgun_ex.ex
0.825976
0.577108
mailgun_ex.ex
starcoder
defmodule Datix do @moduledoc """ A date-time parser using `Calendar.strftime` format strings. """ @type t :: %{ optional(:am_pm) => :am | :pm, optional(:day) => pos_integer(), optional(:day_of_week) => pos_integer(), optional(:day_of_year) => pos_integer(), op...
lib/datix.ex
0.910466
0.8321
datix.ex
starcoder
defmodule Category.Data.Maybe do use Calculus use Category.TypeClass @moduledoc """ Classic sum type `Maybe` Implements Monad, Functor and Applicative behaviours """ defmacrop justp(x) do quote location: :keep do {:justp, unquote(x)} end end defmacrop nothingp, do: :nothingp @get_e...
lib/category/data/maybe.ex
0.884551
0.880848
maybe.ex
starcoder
defmodule Wasmex.Module do @moduledoc """ A compiled WebAssembly module. A WebAssembly Module contains stateless WebAssembly code that has already been compiled and can be instantiated multiple times. # Read a WASM file and compile it into a WASM module {:ok, bytes } = File.read("wasmex_test.wasm") ...
lib/wasmex/module.ex
0.882085
0.478712
module.ex
starcoder
defmodule Chapters.Chapter do @moduledoc """ One chapter entry. """ @typedoc """ * `start` - milliseconds since start. e.g. "00:01:30.000" would be `90_000` (mandatory) * `title` - title of that chapter (mandatory) * `href` - link to jump to that chapter (optional) * `image` - url to a chapter image (o...
lib/chapters/chapter.ex
0.870294
0.585783
chapter.ex
starcoder
defmodule SPARQL.Algebra.FunctionCall.Builtin do defstruct name: nil, arguments: [] alias SPARQL.Algebra.FunctionCall alias SPARQL.Functions.Builtins alias RDF.XSD @xsd_true XSD.true @xsd_false XSD.false @doc """ Invokes a SPARQL builtin function. For most functions this is done by ...
lib/sparql/algebra/expression/function_call/builtin.ex
0.52902
0.579995
builtin.ex
starcoder
defmodule Rtmp.Protocol.RtmpTime do @moduledoc """ Provides utilities to work with timestamps in an RTMP context. RTMP timestamps are 32 bits (unsigned) integers and thus roll over every ~50 days. All adjacent timestamps are within 2^31 - 1 milliseconds of each other (e.g. 10000 comes after 4000000000, a...
apps/rtmp/lib/rtmp/protocol/rtmp_time.ex
0.593845
0.550607
rtmp_time.ex
starcoder
defmodule PState do defstruct p: {nil, nil, nil}, v: {nil, nil, nil}, a: {nil, nil, nil}, bosspid: nil, id: nil end defmodule Day20 do @moduledoc """ --- Day 20: Particle Swarm --- Suddenly, the GPU contacts you, asking for help. Someone has asked it to simulate too many particles, and it won't be able to f...
lib/day20.ex
0.792745
0.726037
day20.ex
starcoder
defmodule Clova.ValidatorPlug do import Plug.Conn @behaviour Plug @pubkey """ -----BEGIN PUBLIC KEY----- <KEY> -----END PUBLIC KEY----- """ @moduledoc """ Validates the HTTP request body against the `signaturecek` header and provided `app_id`. CEK requests are signed by the server. This module ve...
lib/clova/validator_plug.ex
0.872633
0.717458
validator_plug.ex
starcoder
defmodule Yggdrasil.Transformer do @moduledoc """ Transformer behaviour that defines how to decode and encode messages from a `Yggdrasil.Channel`. ## Small example Let's say we want to implement a transformer to send any Elixir term as a string to our subscribers. The transformer module would be implement...
lib/yggdrasil/transformer.ex
0.942202
0.925162
transformer.ex
starcoder
defmodule SanbaseWeb.Graphql.Resolvers.SocialDataResolver do import SanbaseWeb.Graphql.Helpers.Async, only: [async: 1] import Absinthe.Resolution.Helpers, except: [async: 1] alias SanbaseWeb.Graphql.Helpers.Utils alias Sanbase.{SocialData, TechIndicators} alias SanbaseWeb.Graphql.SanbaseDataloader @conte...
lib/sanbase_web/graphql/resolvers/social_data_resolver.ex
0.856362
0.403391
social_data_resolver.ex
starcoder
defmodule OpentelemetryFunction do @moduledoc """ Documentation for `OpentelemetryFunction`. This package provides functions to help propagating OpenTelemetry context across functions that are executed asynchronously. """ require OpenTelemetry.Tracer @doc """ Accepts a function and wraps it in a func...
lib/opentelemetry_function.ex
0.866274
0.403831
opentelemetry_function.ex
starcoder
defmodule Membrane.Scissors do @moduledoc """ Element for cutting the stream. """ use Membrane.Filter alias Membrane.Buffer alias Membrane.Time def_input_pad :input, caps: :any, demand_unit: :buffers def_output_pad :output, caps: :any def_options intervals: [ type: :list, ...
lib/membrane_scissors.ex
0.916549
0.516474
membrane_scissors.ex
starcoder
import TypeClass defclass Witchcraft.Arrow do @moduledoc """ Arrows abstract the idea of computations, potentially with a context. Arrows are in fact an abstraction above monads, and can be used both to express all other type classes in Witchcraft. They also enable some nice flow-based reasoning about compu...
lib/witchcraft/arrow.ex
0.857664
0.670979
arrow.ex
starcoder
defmodule Shared.Zeit do alias Shared.Zeitperiode @spec mit_deutscher_zeitzone(datum :: Date.t(), zeit :: Time.t()) :: DateTime.t() @doc """ Wandelt ein Datum und eine Zeit in ein DateTime Struct mit deutscher Zeitzone um. Es wird also angenommen, dass die übergebene Zeit in Deutschland statt fand. iex>...
lib/zeit.ex
0.746324
0.482856
zeit.ex
starcoder
defmodule Harness.Tree do @moduledoc """ Renders things as a tree See the original implementation in Mix [here](https://github.com/elixir-lang/elixir/blob/v1.10/lib/mix/lib/mix/utils.ex). The original implementation has an optimization for dependency trees which prevents showing the same dependency tree t...
lib/harness/tree.ex
0.836204
0.503296
tree.ex
starcoder
defmodule Grizzly.ZWave.Commands.CentralSceneSupportedReport do @moduledoc """ This command is used to report the maximum number of supported scenes and the Key Attributes supported for each scene. Versions 1 and 2 are obsolete. Version 3+ fields are required. Params: * `:supported_scenes` - This field...
lib/grizzly/zwave/commands/central_scene_supported_report.ex
0.874433
0.558508
central_scene_supported_report.ex
starcoder
defmodule Day11 do @grid_size 300 @type coords :: {number(), number()} @spec part_one(number()) :: coords() def part_one(serial_number) do {square_top_left_coords, _total_power_level} = serial_number |> compute_power_level_by_coords() |> compute_summed_area_table(@grid_size) |> get...
lib/day11.ex
0.823186
0.563498
day11.ex
starcoder
defmodule CCSP.Chapter2.Maze do alias CCSP.Chapter2.MazeLocation alias CCSP.Chapter2.Node alias __MODULE__, as: T @moduledoc """ Corresponds to CCSP in Python, Section 2.2 titled "Maze Solving" TODO: The constant use of `get_cell` causes heavy use of `List.slice` internally and does not scale well. """ ...
lib/ccsp/chapter2/maze.ex
0.61057
0.632077
maze.ex
starcoder
defmodule Line do defstruct start: Nil, end: Nil @type point :: {integer(), integer()} @type t :: %__MODULE__{ start: point, end: point, } @spec from_string(String.t())::Line.t() def from_string(string) do [s,e] = String.split(string, " -> ", trim: true) [ss, se] = s |> String....
lib/vents.ex
0.870005
0.500305
vents.ex
starcoder
defmodule Telnyx.MessagingProfiles do @moduledoc """ Context for managing messaging profiles """ alias Telnyx.Client @doc """ Lists all messaging profiles. ``` api_key = "YOUR_API_KEY" Telnyx.MessagingProfiles.list(api_key, page: %{size: 10}) ``` Example response: ``` {:ok, [ ...
lib/telnyx/messaging_profiles.ex
0.731634
0.57678
messaging_profiles.ex
starcoder
defmodule Elixium.Block do alias Elixium.Block alias Elixium.Utilities alias Elixium.Transaction alias Elixium.Store.Ledger alias Decimal, as: D @moduledoc """ Provides functions for creating blocks and mining new ones """ defstruct index: nil, hash: nil, version: 1, ...
lib/block.ex
0.818809
0.58673
block.ex
starcoder
defmodule Hitbtc.Http.Public do alias Hitbtc.Util.Api @moduledoc """ Public API's for HitBtc API v2 """ @doc """ Get list of avialable Symbols (Currency Pairs). You can read more info at http://www.investopedia.com/terms/c/currencypair.asp ## Example: ```elixir iex(1)> Hitbtc.Public.symbol_list ...
lib/hitbtc/http/public.ex
0.924262
0.735683
public.ex
starcoder
defmodule Day11 do def part1(input) do grid = parse_input(input) grid |> update_grid(&update_cell_part_1/1) |> Enum.count(fn {_, value} -> value == :occupied end) end def part2(input) do grid = parse_input(input) grid |> update_grid(&update_cell_part_2/1) |> Enum.count(fn {_, ce...
2020/day11/ex/day11.ex
0.528777
0.678889
day11.ex
starcoder
defmodule Microdata.Helpers do @moduledoc """ `Microdata.Helpers` is a module for generic parsing helpers (ie those not coupled to the parsing mechanism). For example, certain tags require their values to be absolute URLs. """ @doc """ Validates that URLs include scheme & host ## Examples ``` iex> ...
lib/helpers.ex
0.889852
0.780453
helpers.ex
starcoder
defmodule APDS9960.Gesture do @moduledoc "The gesture detection." alias APDS9960.{Comm, Gesture, Sensor} use TypedStruct @type gesture_direction :: :down | :left | :right | :up @typep dataset :: {byte, byte, byte, byte} typedstruct do @typedoc "The gesture data accumulator in the gesture processing...
lib/apds9960/gesture.ex
0.768603
0.497742
gesture.ex
starcoder
defmodule BitstylesPhoenix.Component.Badge do use BitstylesPhoenix.Component @moduledoc """ The Badge component. """ @doc ~s""" Render a badge to highlighted small texts, such as an item count or state indicator. ## Attributes - `variant` — Variant of the badge you want, from those available in the ...
lib/bitstyles_phoenix/component/badge.ex
0.812682
0.486697
badge.ex
starcoder
defmodule Utils.Crypto.RSA do @moduledoc """ Basic wrapper over the :public_key api. Please read up on how public key encryption works in general before using this lib """ # ---------------------------------------------------------------------------- # Module Types # ------------------------------------...
src/apps/utils/lib/utils/crypto/rsa.ex
0.829871
0.444083
rsa.ex
starcoder
defmodule PSet do require Piece defstruct [:pieces] def is_valid(set, pieces \\ nil, piece \\ nil, piece_pos \\ nil, expected \\ nil, valid_size \\ nil, type \\ nil, valid_pieces_variety \\ nil) # validate size def is_valid(set, pieces, piece, piece_pos, expected, nil, type, valid_pieces_variety) do is...
rmk/lib/pset.ex
0.616128
0.718002
pset.ex
starcoder
defmodule Estated.Property.Address do @moduledoc "Address details as provided by the assessor." @moduledoc since: "0.2.0" defstruct [ :street_number, :street_pre_direction, :street_name, :street_suffix, :street_post_direction, :unit_type, :unit_number, :formatted_street_address, ...
lib/estated/property/address.ex
0.925002
0.521898
address.ex
starcoder
defmodule Depot.Adapter.InMemory do @moduledoc """ Depot Adapter using an `Agent` for in memory storage. ## Direct usage iex> filesystem = Depot.Adapter.InMemory.configure(name: InMemoryFileSystem) iex> start_supervised(filesystem) iex> :ok = Depot.write(filesystem, "test.txt", "Hello World") ...
lib/depot/adapter/in_memory.ex
0.796055
0.412353
in_memory.ex
starcoder
defmodule Anagram do @dictionary "/usr/share/dict/web2" @moduledoc """ Useful functions to find anagrams of words and words that can be made with a set of letters (sort of a sub anagram) Our algorithm for anagrams is simply to canonicalise each word in the dictionary by forcing case, removing whitespace ...
lib/anagram.ex
0.663233
0.726814
anagram.ex
starcoder
if Code.ensure_loaded?(:gun) do defmodule Tesla.Adapter.Gun do @moduledoc """ Adapter for [gun] https://github.com/ninenines/gun Remember to add `{:gun, "~> 1.3"}` to dependencies Also, you need to recompile tesla after adding `:gun` dependency: ``` mix deps.clean tesla mix deps.compile t...
lib/tesla/adapter/gun.ex
0.844697
0.675136
gun.ex
starcoder
defmodule Membrane.Bin.RTP.Receiver do @moduledoc """ A bin consuming one or more RTP streams on each input and outputting a stream from one ssrc on each output Every stream is parsed and then (based on ssrc field) an appropriate rtp session is initiated. It notifies its parent about each new stream with a n...
lib/membrane_bin_rtp/receiver.ex
0.834188
0.437343
receiver.ex
starcoder
defmodule Flex.Rule do alias Flex.Rule @moduledoc """ An interface to create Linguistic Rules. """ defstruct statement: nil, antecedent: nil, consequent: nil @typedoc """ Linguistic Rule struct. - `:statement` - Rules behavior. - `:antecedent` - (list) Input variables. - `...
lib/rule.ex
0.850251
0.55254
rule.ex
starcoder
defmodule MapRewire do @moduledoc """ MapRewire makes it easier to rewire maps, such as might be done when translating from an external API result to an internal value or taking the output of one external API and transforming it the input shape of an entirely different external API. To rewire a map, build ...
lib/map_rewire.ex
0.840161
0.770141
map_rewire.ex
starcoder
defmodule Exenv.Adapters.Yaml do @moduledoc """ Loads env vars from `.yml` files. You can use this adapter by adding it to your `:exenv` application config. The options available can be seen in the `load/1` function. config :exenv, adapters: [ {Exenv.Adapters.Yaml, []} ] Bel...
lib/adapters/yaml.ex
0.824179
0.511656
yaml.ex
starcoder
defmodule Maverick.Path do @moduledoc """ Provides functionality for parsing paths to lists of path nodes, identifying path variables for pattern matching on incoming requests. """ @type path_node :: String.t() | {:variable, String.t()} @type path :: [path_node] @type raw_path :: String.t() import N...
lib/maverick/path.ex
0.888172
0.475362
path.ex
starcoder
if Code.ensure_loaded?(Phoenix) do defmodule Aegis.Controller do @moduledoc """ Wraps controllers with Aegis authorization functionality. """ @doc """ Authorizes a resource, for a user, for a given action, and marks the connection as having had aegis authorization perfomed via the assignment ...
lib/aegis/controller.ex
0.795181
0.637764
controller.ex
starcoder
defmodule BikeBrigade.Delivery do import Ecto.Query, warn: false alias BikeBrigade.Repo alias BikeBrigade.LocalizedDateTime import Geo.PostGIS, only: [st_distance: 2] alias BikeBrigade.Riders.Rider alias BikeBrigade.Messaging alias BikeBrigade.Delivery.{Task, CampaignRider} import BikeBrigade.Utils...
lib/bike_brigade/delivery.ex
0.62395
0.452596
delivery.ex
starcoder
defmodule MockeryExtras.Given do import Mockery alias MockeryExtras.MacroX alias MockeryExtras.Stubbery @moduledoc """ This module provides a pretty notation for a common case that's not gracefully handled by [Mockery](https://hexdocs.pm/mockery/readme.html). Here is how you instruct Mockery to return t...
lib/given.ex
0.87768
0.70163
given.ex
starcoder
defmodule PassiveSupport.Path.Sigil do @moduledoc """ Quickly and idiomatically build filesystem paths by using `~P` ### The path sigil `import PassiveSupport.Path.Sigil` will make `~P` activate various functions within the `Path` module, for quick and idiomatic usage of filesystem paths. As its default b...
lib/passive_support/base/path/sigil.ex
0.627723
0.434101
sigil.ex
starcoder
defmodule Exoself do alias Neuron alias Sensor alias Actuator alias Cortex def map(file_name) do {:ok, genotype} = :file.consult(file_name) # Mapping the genome can take some time task = Task.async(fn -> map(file_name, genotype) end) Task.await(task) end def map(file_name, genotype) do ...
lib/exoself.ex
0.535584
0.510619
exoself.ex
starcoder
defmodule Emeck.Helper do @moduledoc """ utility functions can be used in test. """ defmacro expect({{:., _, [m, f]}, _, []}, proxy) do quote do :meck.expect(unquote(m), unquote(f), unquote(proxy)) end end defmacro passthrough do quote do :meck.passthrough([]) end end defm...
lib/emeck/helper.ex
0.546859
0.551151
helper.ex
starcoder
defmodule Adventofcode.Day10MonitoringStation do use Adventofcode alias __MODULE__.{ Asteroids, BestLocation, MonitoringStation, Parser, Printer, VaporizationOrder } def part_1(input) do input |> best_location() |> elem(1) end def part_2(input) do {x, y} = input |>...
lib/day_10_monitoring_station.ex
0.67694
0.524699
day_10_monitoring_station.ex
starcoder
defmodule Dwolla.MassPayment do @moduledoc """ Functions for `mass-payments` endpoint. """ alias Dwolla.Utils defstruct id: nil, created: nil, status: nil, metadata: nil, funding_transfer_id: nil, source_funding_source_id: nil, correlat...
lib/dwolla/mass_payment.ex
0.785103
0.532668
mass_payment.ex
starcoder
defmodule Gherkin.ASTBuilder do alias Gherkin.{ASTNode, Builder, Location, TableCell, TableRow, Tag, Token} @behaviour Builder @type t :: %__MODULE__{comments: [comment], stack: [ASTNode.t(), ...]} @typep comment :: %{location: Location.t(), text: String.t(), type: :Comment} defstruct comments: [], stack:...
gherkin/elixir/lib/gherkin/ast_builder.ex
0.826537
0.490419
ast_builder.ex
starcoder
defexception ExUnit.AssertionError, message: "assertion failed" defexception ExUnit.ExpectationError, expected: nil, actual: nil, assertion: "", negation: false, prelude: "Expected", expr: nil do def message(exception) do if desc = exception.expr do "#{exception.prelude} #{desc} #{exception.full_asser...
lib/ex_unit/lib/ex_unit/assertions.ex
0.913121
0.758018
assertions.ex
starcoder
defmodule BSV.OpCode do @moduledoc """ Module for accessing Bitcoin Script Op Codes. Bitcoin Script provides a number of operations or commands, known as Op Codes. When the script is evaluated, the Op Codes manipulate the stack in some way. Within a script, an Op Code is single byte integer. Op Codes can al...
lib/bsv/op_code.ex
0.877306
0.416381
op_code.ex
starcoder
defmodule ExWire.P2P.Manager do @moduledoc """ P2P.Manager handles the logic of the TCP protocol in the P2P network. We track state with a `Connection` struct, deriving secrets during an auth phase and then handling incoming packets and deciding how to respond. """ require Logger alias ExWire.Framing.F...
apps/ex_wire/lib/ex_wire/p2p/manager.ex
0.728652
0.502747
manager.ex
starcoder
defmodule NewRelic.Config do @moduledoc """ New Relic Agent Configuration All configuration items can be set via Environment variables _or_ via `Application` config """ @doc """ **Required** Configure your application name. May contain up to 3 names seperated by `;` Application name can be configure...
lib/new_relic/config.ex
0.898902
0.591133
config.ex
starcoder
defmodule StepFlow.WorkflowController do use StepFlow, :controller use BlueBird.Controller require Logger alias StepFlow.Controller.Helpers alias StepFlow.Metrics.WorkflowInstrumenter alias StepFlow.Repo alias StepFlow.Step alias StepFlow.Workflows alias StepFlow.Workflows.Workflow action_fallbac...
lib/step_flow/controllers/workflow_controller.ex
0.613931
0.433202
workflow_controller.ex
starcoder
defmodule Commanded.Event.Handler do @moduledoc """ Defines the behaviour an event handler must implement and provides a convenience macro that implements the behaviour, allowing you to handle only the events you are interested in processing. You should start your event handlers using a [Supervisor](supervis...
lib/commanded/event/handler.ex
0.93441
0.563738
handler.ex
starcoder
defmodule Timex.Interval do @moduledoc """ This module is used for creating and manipulating DateTime intervals. """ alias Timex.Duration defmodule FormatError do @moduledoc """ Thrown when an error occurs with formatting an Interval """ defexception message: "Unable to format interval!" ...
elixir/codes-from-books/little-elixir/cap8/blitzy/deps/timex/lib/interval/interval.ex
0.931134
0.597461
interval.ex
starcoder
defmodule Operate.Adapter do @moduledoc """ Operate adapter specification. An adapter is responsible for loading tapes and ops from a datasource - potentially a web API, a database or even a Bitcoin node. Operate ships with two default adapters, although these can be swapped out with any other adpater by c...
lib/operate/adapter.ex
0.734501
0.565869
adapter.ex
starcoder
defmodule Timex do @moduledoc File.read!("README.md") use Application def start(_type, _args) do apps = Enum.map(Application.started_applications(), &elem(&1, 0)) cond do :tzdata in apps -> Supervisor.start_link([], strategy: :one_for_one, name: Timex.Supervisor) :else -> {...
lib/timex.ex
0.858881
0.540742
timex.ex
starcoder
defmodule EctoSchemaStruct do @moduledoc """ Struct is defined with a combination of [TypedEctoSchema](https://github.com/bamorim/typed_ecto_schema) and [Domo](https://github.com/IvanRublev/Domo). The `enforce: true` given to TypedEctoSchema excludes default values from the struct. Domo automatically vali...
example_typed_integrations/lib/ecto_schema_struct.ex
0.781414
0.65321
ecto_schema_struct.ex
starcoder
defmodule OMG.Watcher.Signature do @moduledoc """ Adapted from https://github.com/exthereum/blockchain. Defines helper functions for signing and getting the signature of a transaction, as defined in Appendix F of the Yellow Paper. For any of the following functions, if chain_id is specified, it's assumed ...
apps/omg_watcher/lib/omg_watcher/signature.ex
0.866528
0.408601
signature.ex
starcoder
defmodule Verk.QueueStats do @moduledoc """ This process will update an :ets table with the following information per queue * Current amount of running jobs * Amount of finished jobs * Amount of failed jobs It will persist to redis from time to time It also holds information about the current sta...
lib/verk/queue_stats.ex
0.700792
0.502625
queue_stats.ex
starcoder
defmodule Timex.Format.DateTime.Formatters.Relative do @moduledoc """ Relative time, based on Moment.js Uses localized strings. The format string should contain {relative}, which is where the phrase will be injected. | Range | Sample Output -------------------------------------------...
lib/format/datetime/formatters/relative.ex
0.877082
0.626181
relative.ex
starcoder
defmodule Stagger do @moduledoc ~S""" Point-to-point, durable message-queues as GenStage producers. Stagger enables the creation of GenStage processes that enqueue terms to simple, file-backed message-queues, allowing the producer and consumer to run independently of each other, possibly at different times. ...
lib/stagger.ex
0.821223
0.484746
stagger.ex
starcoder
defmodule Solid.Filter do import Kernel, except: [abs: 1, ceil: 1, round: 1, floor: 1] @moduledoc """ Standard filters """ @doc """ Apply `filter` if it exists. Otherwise return the first input. iex> Solid.Filter.apply("upcase", ["ac"]) "AC" iex> Solid.Filter.apply("no_filter_here", [1, 2, 3]) 1 ...
lib/solid/filter.ex
0.843895
0.55097
filter.ex
starcoder
defmodule OpentelemetryEcto do @moduledoc """ Telemetry handler for creating OpenTelemetry Spans from Ecto query events. """ require OpenTelemetry.Tracer @doc """ Attaches the OpentelemetryEcto handler to your repo events. This should be called from your application behaviour on startup. Example: ...
instrumentation/opentelemetry_ecto/lib/opentelemetry_ecto.ex
0.712832
0.435962
opentelemetry_ecto.ex
starcoder
defmodule Mint.TransportError do @moduledoc """ Represents an error with the transport used by an HTTP connection. A `Mint.TransportError` struct is an exception, so it can be raised as any other exception. ## Struct fields This exception represents an error with the transport (TCP or SSL) used by an H...
lib/mint/transport_error.ex
0.906169
0.439086
transport_error.ex
starcoder
defmodule Warpath.Filter.Predicate do @moduledoc false @operators [ :<, :>, :<=, :>=, :==, :!=, :===, :!==, :and, :or, :in ] @functions [ :is_atom, :is_binary, :is_boolean, :is_float, :is_integer, :is_list, :is_map, :is_nil, :is_n...
lib/warpath/filter/predicate.ex
0.561335
0.571199
predicate.ex
starcoder
defmodule RulEx do @moduledoc """ RulEx is a rules engine and simplified expressions language for evaluating a set of conditions against a set of facts, yielding true or false on whether the provided facts adhere to the set of conditions given. ## RulEx expressions The expressions used by RulEx are inspir...
lib/rulex.ex
0.902508
0.868158
rulex.ex
starcoder
defmodule ExAdmin.Show do @moduledoc """ Override the default show page for an ExAdmin resource. By default, ExAdmin renders the show page without any additional configuration. It renders each column in the model, except the id, inserted_at, and updated_at columns in an attributes table. To customize the ...
lib/ex_admin/show.ex
0.813646
0.451568
show.ex
starcoder
defmodule Spandex do @moduledoc """ The functions here call the corresponding functions on the configured adapter. """ require Logger alias Spandex.{ Span, SpanContext, Trace, Tracer } @type headers :: [{atom, binary}] | [{binary, binary}] | %{binary => binary} @typedoc "Used for Span...
lib/spandex.ex
0.790166
0.511717
spandex.ex
starcoder
defmodule Cldr.Unit.Math do @moduledoc """ Simple arithmetic functions for the `Unit.t` type """ alias Cldr.Unit alias Cldr.Unit.Conversion import Kernel, except: [div: 2, round: 1, trunc: 1] import Unit, only: [incompatible_units_error: 2] @doc """ Adds two compatible `%Unit{}` types ## Options ...
lib/cldr/unit/math.ex
0.921016
0.723187
math.ex
starcoder
defmodule KerbalMaps.WaypointsParser do @moduledoc false require Logger import NimbleParsec def parse({:ok, data, stream}), do: parse({:ok, data, "", stream}) def parse({:eof, data, "", _stream}), do: {:ok, List.flatten(data), ""} def parse({{:error, reason}, _, _, _}), do: {:error, reason} def parse(...
lib/kerbal_maps/parsers/waypoints_parser.ex
0.627723
0.476762
waypoints_parser.ex
starcoder
defmodule Aoc2019Day2 do @moduledoc """ https://adventofcode.com/2019/day/2 --- Day 2: 1202 Program Alarm --- On the way to your gravity assist around the Moon, your ship computer beeps angrily about a "1202 program alarm". On the radio, an Elf is already explaining how to handle the situation: "Don't wor...
lib/aoc2019Day2.ex
0.800848
0.793306
aoc2019Day2.ex
starcoder
defmodule VintageNet.Interface.Classification do @moduledoc """ Module for classifying and prioritizing network interfaces """ @typedoc """ Categorize interfaces based on their technology """ @type interface_type :: :ethernet | :wifi | :mobile | :local | :unknown @typedoc """ Interface connection st...
lib/vintage_net/interface/classification.ex
0.863464
0.465873
classification.ex
starcoder
defmodule Mix.Tasks.Scenic.Setup do @moduledoc """ Does much of the work to set up Scenic in an existing project, such as Nerves. The typical use of this task is to install Scenic into a Nerves project. This assumes that you have already installed Nerves. [You should read use the Nerves Installation Guide....
lib/mix/tasks/setup.ex
0.773601
0.818483
setup.ex
starcoder
defmodule PigLatin do @doc """ Given a `phrase`, translate it a word at a time to Pig Latin. Words beginning with consonants should have the consonant moved to the end of the word, followed by "ay". Words beginning with vowels (aeiou) should have "ay" added to the end of the word. Some groups of letter...
pig-latin/lib/pig_latin.ex
0.749637
0.48249
pig_latin.ex
starcoder
defmodule Legend.Event do @moduledoc """ All: id, [{Legend.full_name, non_neg_integer, {Node.t, DateTime.t}}, ...], Legend.full_name, event, context, Logger.metadata() Legend.Hook: [:completed, :hook, name], event, hook_result [:skipped, :hook, :name], event Legend.Stage.Sync: [:starting, :sync, :tr...
lib/legend/event.ex
0.751192
0.562056
event.ex
starcoder
defmodule MotionBetweenImpacts do @moduledoc """ Computes the time evolution of the system from one impact to the next """ @typedoc """ Tuple comprising an `:ImpactPoint`, a list which optionally contains `:StateOfMotion` instances for time steps from the previous impact and a function to evaluate a chatte...
apps/imposc/lib/dynamics/motion.ex
0.892744
0.898321
motion.ex
starcoder
defmodule Shapt do @moduledoc """ Use this to create your own feature toggle worker as in the example: ```elixir defmodule TestModule do use Shapt, adapter: {Shapt.Adapters.Env, []}, toggles: [ feature_x?: %{ key: "MYAPP_FEATURE_X", deadline: ~D[2019-12-31] ...
lib/shapt.ex
0.76432
0.812347
shapt.ex
starcoder
defmodule Estated.Property.Deed do @moduledoc "Sale and mortgage data which constitute a deed record." @moduledoc since: "0.2.0" import Estated.CastHelpers, only: [cast_date: 1] defstruct [ :document_type, :recording_date, :original_contract_date, :deed_book, :deed_page, :document_id, ...
lib/estated/property/deed.ex
0.729327
0.483648
deed.ex
starcoder
defmodule Phoenix.Component do @moduledoc ~S''' API for function components. A function component is any function that receives an assigns map as argument and returns a rendered struct built with [the `~H` sigil](`Phoenix.LiveView.Helpers.sigil_H/2`). Here is an example: defmodule MyComponent do ...
lib/phoenix_component.ex
0.849191
0.615955
phoenix_component.ex
starcoder
defmodule Protocol.Consolidation do @moduledoc """ Module responsible for consolidating protocols and helpers for extracting protocols and implementations from code paths for consolidation. """ @doc """ Extract all protocols from the given paths. The paths can be either a char list or a string. Intern...
lib/elixir/lib/protocol/consolidation.ex
0.871427
0.406921
consolidation.ex
starcoder
defmodule BaseX do @moduledoc """ coding for arbitrary alphabets and block sizes """ @doc """ prepare a coding module Returns the name of the module. The resulting module will appear in the BaseX namespace and have `encode` and `decode` functions available. Examples: ``` iex> BaseX.prepare_mo...
lib/basex.ex
0.86813
0.850407
basex.ex
starcoder
defmodule Mix.Tasks.Avrora.Reg.Schema do use Mix.Task @moduledoc """ Register either one schema or all schemas in the `Avrora.Config.schemas_path` directory (or your private client schemas path). mix avrora.reg.schema [--all] [--name NAME] [--as NEW_NAME] [--module MODULE] The search of the schemas w...
lib/mix/tasks/avrora.reg.schema.ex
0.77552
0.402744
avrora.reg.schema.ex
starcoder
defmodule Jsox.Parser do @moduledoc """ A JSON parser according to ECMA-404. Standard ECMA-404: The JSON Data Interchange Format https://www.ecma-international.org/publications/standards/Ecma-404.htm """ use Bitwise @type json :: map | list | String.t | integer | float | true | false | nil @digits '...
lib/jsox/parser.ex
0.555194
0.576721
parser.ex
starcoder
defmodule Feedistiller.Limits do @moduledoc """ Limits on the number of items to retrieve and the date range of items. - `from:` only items newer than this date are retrieved (default is `:oldest` for no limit) - `to:` only items older than this date are retrieved (default is `:latest` for not limit) - `max...
lib/feedistiller.ex
0.889804
0.566618
feedistiller.ex
starcoder
defmodule DateTimeParser.DateTime do @moduledoc false import NimbleParsec import DateTimeParser.Combinators.Date import DateTimeParser.Combinators.DateTime import DateTimeParser.Formatters, only: [format_token: 2, clean: 1] defparsec( :parse, vocal_day() |> optional() |> choice([ voc...
lib/date_time.ex
0.654453
0.433322
date_time.ex
starcoder
defmodule Coherence do @moduledoc """ Coherence is a full featured, configurable authentication and user management system for Phoenix, providing a number of optional features configured with a installation mix task: * Database Authenticatable: handles hashing and storing an encrypted password in the databas...
lib/coherence.ex
0.817793
0.730554
coherence.ex
starcoder
defmodule Alembic.Plugin.Behaviour do @moduledoc """ Defines the callback functions that the main callback module of each Alembic plugin is expected to implement and provides a `__using__/2` helper macro that plugin authors can use to define fallback implementations of several of these callbacks. """ use...
lib/plugin.ex
0.881021
0.478833
plugin.ex
starcoder