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 Tarams.Schema do @moduledoc """ This is only a specification to define a schema to use with `Tarams.Params.cast` and `Tarams.Contract.validate` Schema is just a map or keyword list that follow some simple conventions. Map's key is the field name and the value is a keyword list of field specifications. ...
lib/schema.ex
0.892027
0.967625
schema.ex
starcoder
require Record defmodule KidsChain.KChain do @moduledoc """ A set of functions for working with invite tree. ## Example iex> alias KidsChain.KChain iex> KChain.insert(1, 0) {:ok, 1} iex> KChain.insert(2, 1) {:ok, 2} iex> KChain.insert(3, 1) {:ok, 2} iex> KChain.i...
lib/kids_chain/kchain.ex
0.861844
0.475605
kchain.ex
starcoder
defmodule AWS.CloudTrail do @moduledoc """ AWS CloudTrail This is the CloudTrail API Reference. It provides descriptions of actions, data types, common parameters, and common errors for CloudTrail. CloudTrail is a web service that records AWS API calls for your AWS account and delivers log files to an Am...
lib/aws/cloud_trail.ex
0.888662
0.714267
cloud_trail.ex
starcoder
defmodule Ffaker.EnUs.PhoneNumber do @moduledoc""" Functions for US PhoneNumber data in English """ use Ffaker import Ffaker, only: [numerify: 1] @doc""" Returns US phone number https://en.wikipedia.org/wiki/List_of_North_American_Numbering_Plan_area_codes ## Examples iex> Ffaker.EnUs.PhoneN...
lib/ffaker/en_us/phone_number.ex
0.778186
0.415254
phone_number.ex
starcoder
defmodule Oath.Stepper do @moduledoc false import Oath.Utils, only: [proper_list?: 1, is_proper_list: 1] alias Oath.{ConformError, Spec} defstruct enum: [], index: 0 @type t :: %__MODULE__{ enum: Enumerable.t(), index: non_neg_integer } @spec new(Enumerable.t(), no...
lib/oath/stepper.ex
0.76895
0.460835
stepper.ex
starcoder
defmodule DiscoveryApi.Stats.Completeness do @moduledoc """ Calculate data completeness. This is done by reducing multiple data messages to an accumulater of non-nil columns recursively through the data hierarchy. """ @doc """ A reducing function which accumulates completeness statistics for a row in a datas...
apps/discovery_api/lib/discovery_api/stats/completeness.ex
0.756987
0.698933
completeness.ex
starcoder
defmodule Swiss.DateTime do @moduledoc """ Some extra functions for working with DateTimes that aren't in the native lib or on Timex. """ @doc """ Helper method for getting "now" with second precision. """ @spec second_utc_now() :: DateTime.t() def second_utc_now(), do: DateTime.utc_now() |> Date...
lib/swiss/date_time.ex
0.906814
0.447158
date_time.ex
starcoder
defmodule Conversor.ApiCurrency.Exchange do @moduledoc """ Module responsible for making exchange between currencies. The most used function is `exchange/3`, which actually performs the exchanges. """ use Tesla plug Tesla.Middleware.Headers, [{"content-type", "application/json"}] plug Tesla.Middleware.J...
lib/conversor/api_currency/exchange.ex
0.880283
0.410963
exchange.ex
starcoder
defmodule Hulaaki.Message do @moduledoc """ Provides the structs and constructors for different kinds of message packets in the MQTT protocol. """ defmodule Connect do @moduledoc """ Struct for Hulaaki Connect ## Fields * `client_id` : A string(binary) representing the client. *...
lib/hulaaki/message.ex
0.835114
0.540681
message.ex
starcoder
defmodule MvOpentelemetry.Absinthe do @moduledoc false use MvOpentelemetry.SpanTracer, name: :graphql, events: [ [:absinthe, :execute, :operation, :start], [:absinthe, :execute, :operation, :stop], [:absinthe, :execute, :operation, :exception], [:absinthe, :resolve, :field, :start],...
lib/mv_opentelemetry/absinthe.ex
0.67854
0.409988
absinthe.ex
starcoder
defmodule User do use Calculus require Record @moduledoc """ OOP-like `User` data type example. Internal representation of the `state` is record, but it's completely hidden inside this module. This data type have: - public mutable `name` field (`get_name/1`, `set_name/2` methods) - protected immut...
test/support/user.ex
0.898348
0.565029
user.ex
starcoder
defmodule ExStatic.Plug do @moduledoc """ A plug for serving static assets from in-memory BEAM bytecode It requires two options on initialization: * `:at` - the request path to reach for static assets. It must be a string. If a static asset cannot be found, `Plug.Static` simply forwards the conne...
lib/exstatic/plug.ex
0.781872
0.503357
plug.ex
starcoder
defmodule HyperEx do @moduledoc """ The root HyperEx module contains all publically exposed functions of this package. """ alias HyperEx.Abbreviation alias HyperEx.Renderer alias HyperEx.Util @doc """ Render an abbreviation. ## Examples iex> HyperEx.h("div") ~s{<div></div>} i...
lib/hyper_ex.ex
0.870831
0.451145
hyper_ex.ex
starcoder
defmodule TradeIndicators.RSI do use TypedStruct alias __MODULE__, as: RSI alias __MODULE__.Item alias TradeIndicators.MA alias TradeIndicators.Util, as: U alias Decimal, as: D alias Enum, as: E typedstruct do field :list, List.t(), default: [] field :period, pos_integer(), default: 14 end ...
lib/rsi.ex
0.64232
0.44565
rsi.ex
starcoder
defmodule Logger.Translator do @moduledoc """ Default translation for Erlang log messages. Logger allows developers to rewrite log messages provided by Erlang applications into a format more compatible to Elixir log messages by providing translator. A translator is simply a tuple containing a module and a...
lib/logger/lib/logger/translator.ex
0.761272
0.41561
translator.ex
starcoder
defmodule StathamLogger do @moduledoc ~S""" Elixir Logger backend with Datadog integration and extensible formatting. Code is mostly borrowed from built-in Elixir [:console Logger backend](https://github.com/elixir-lang/elixir/blob/master/lib/logger/lib/logger/backends/console.ex) ## Options * `:level` -...
lib/statham_logger.ex
0.836771
0.771176
statham_logger.ex
starcoder
defmodule GrowthBook do @external_resource "README.md" @moduledoc "README.md" |> File.read!() |> String.split("<!-- MDOC !-->") |> Enum.fetch!(1) alias GrowthBook.Condition alias GrowthBook.Context alias GrowthBook.Feature alias GrowthBook.Experiment alias GrowthBoo...
lib/growth_book.ex
0.869645
0.70912
growth_book.ex
starcoder
defmodule Blurhash.Encoder do import Blurhash.Utils alias Blurhash.Base83 use Bitwise defp validate_pixel_count(pixels, width, height) when byte_size(pixels) == width * height * 3 do :ok end defp validate_pixel_count(_, _, _) do {:error, :malformed_pixels} end defp validate_component_count(x...
lib/blurhash/encoder.ex
0.542136
0.584212
encoder.ex
starcoder
defmodule TimeZoneInfo.Updater.Impl do @moduledoc false # Handles the automatic update and the initial setup. @behaviour TimeZoneInfo.Updater alias TimeZoneInfo.{ DataConfig, DataPersistence, DataStore, Downloader, ExternalTermFormat, FileArchive, IanaParser, Listener, Tra...
lib/time_zone_info/updater/impl.ex
0.849862
0.5119
impl.ex
starcoder
defmodule ExDash.Injector do @moduledoc """ Injector sets Dash Anchors and makes style tweaks to passed ExDoc HTML files. Dash Anchors are used within Dash to build the Table of Contents per page. Currently supported: - Types - Functions - Macros - Callbacks Style tweaks include hiding the...
lib/injector.ex
0.68215
0.473536
injector.ex
starcoder
defmodule Exsm.Transition do @moduledoc """ Exsm module responsible for control transitions, guard functions and callbacks (before and after). This is meant to be for internal use only. """ @doc """ Function responsible for checking if the transition from a state to another was specifically declared. ...
lib/exsm/transition.ex
0.777596
0.421314
transition.ex
starcoder
defmodule ParkingTweets.Garage do @moduledoc """ Struct to represent information about a parking garage """ defstruct [:id, :name, :updated_at, :status, capacity: -1, utilization: 0, alternates: []] def id(%__MODULE__{id: id}), do: id def status?(%__MODULE__{status: status}) do is_binary(status) end...
lib/parking_tweets/garage.ex
0.793746
0.478894
garage.ex
starcoder
defmodule Arrow do @moduledoc """ Elixir bindings for [Apache Arrow](https://arrow.apache.org/). This is currently an experimental library to bring Arrow and its ecosystem to Elixir. It's very early work in progress. It uses the Rust implementation via [rustler](https://github.com/rusterlium/rustler/). N...
lib/arrow.ex
0.687105
0.666137
arrow.ex
starcoder
defmodule Tensorflow.ValuesDef.ExternalValuesEntry do @moduledoc false use Protobuf, map: true, syntax: :proto3 @type t :: %__MODULE__{ key: String.t(), value: String.t() } defstruct [:key, :value] field(:key, 1, type: :string) field(:value, 2, type: :string) end defmodule Ten...
lib/tensorflow/core/protobuf/control_flow.pb.ex
0.771672
0.59752
control_flow.pb.ex
starcoder
defmodule Textmatrix.Buffer do @moduledoc """ `Textmatrix.Buffer{}` encapsules the characters present in the matrix split up in lines an characters. """ # the default filling character is a space @default_empty_char 32 alias Textmatrix.{ Buffer, Line } @type t :: %Buffer{ lines: lis...
lib/textmatrix/buffer.ex
0.792865
0.529507
buffer.ex
starcoder
defmodule DryValidation.Types.Integer do @moduledoc """ Represents an integer type. Will try to cast strings into integer values. ``` DryValidation.schema do required :age, Types.Integer end ``` """ alias DryValidation.Types.Func @doc false def cast(value) when is_number(value), do: value ...
lib/types/integer.ex
0.885372
0.892093
integer.ex
starcoder
defmodule TeslaMate.Vehicles.Vehicle.Summary do import TeslaMate.Convert, only: [miles_to_km: 2, mph_to_kmh: 1] alias TeslaApi.Vehicle.State.{Drive, Charge, VehicleState} alias TeslaApi.Vehicle alias TeslaMate.Log.Car defstruct ~w( car display_name state since healthy latitude longitude heading battery_...
lib/teslamate/vehicles/vehicle/summary.ex
0.730001
0.463869
summary.ex
starcoder
defmodule Multiverses.Supervisor do @moduledoc """ This module is intended to be a drop-in replacement for `Supervisor`. It launches the supervisor and the supervisor *unconditionally* inherits the `:"$caller"` of whoever launched it. ## Usage This module should only be used when you are creating a cust...
lib/multiverses/supervisor.ex
0.825765
0.794026
supervisor.ex
starcoder
defmodule Stripe.Charges do @moduledoc """ Functions for working with charges at Stripe. Through this API you can: * create a charge, * update a charge, * get a charge, * list charges, * count charges, * refund a charge, * partially refund a charge. Stripe API reference: https://stri...
lib/stripe/charges.ex
0.884863
0.636861
charges.ex
starcoder
defmodule Kino.ETS do @moduledoc """ A widget for interactively viewing an ETS table. ## Examples tid = :ets.new(:users, [:set, :public]) Kino.ETS.new(tid) Kino.ETS.new(:elixir_config) """ @behaviour Kino.Table alias Kino.Utils @type t :: Kino.Table.t() @doc """ Starts a widge...
lib/kino/ets.ex
0.81772
0.485722
ets.ex
starcoder
defmodule Phoenix.Socket do @moduledoc ~S""" A socket implementation that multiplexes messages over channels. `Phoenix.Socket` is used as a module for establishing and maintaining the socket state via the `Phoenix.Socket` struct. Once connected to a socket, incoming and outgoing events are routed to chann...
lib/phoenix/socket.ex
0.928894
0.591959
socket.ex
starcoder
defmodule Spherical.R2.Rectangle do @moduledoc ~S""" Represents a closed axis-aligned rectangle in ℝ². Describes every point in two-dimensional space by means of two coordinates. """ alias __MODULE__ alias Spherical.R1.Interval alias Spherical.R2.Point defstruct x: %Interval{}, y: %Interval{} @ty...
lib/spherical/r2/rectangle.ex
0.927888
0.936401
rectangle.ex
starcoder
defmodule Readability do @moduledoc """ Readability library for extracting & curating articles. ## Example ```elixir @type html :: binary # Just pass url %Readability.Summary{title: title, authors: authors, article_html: article} = Readability.summarize(url) # Extract title Readability.title(html)...
lib/readability.ex
0.715026
0.654729
readability.ex
starcoder
defmodule NewRelic.Transaction do @moduledoc """ Transaction Reporting To enable Transaction reporting, you must instrument your Plug pipeline with a single line. The `NewRelic.Transaction` macro injects the required plugs to wire up automatic Transaction reporting. Be sure to `use` this as early in your ...
lib/new_relic/transaction.ex
0.817574
0.782912
transaction.ex
starcoder
defmodule DiffieHellman do @moduledoc """ Diffie-Hellman is a method of securely exchanging keys in a public-key cryptosystem. Two users, Alice and Bob, want to share a secret between themselves, while ensuring nobody else can read it. Step 0: Alice and Bob agree on two prime numbers, P and G. An attacker, E...
diffie-hellman/lib/diffie_hellman.ex
0.806358
0.693953
diffie_hellman.ex
starcoder
defmodule AWS.CloudHSMV2 do @moduledoc """ For more information about AWS CloudHSM, see [AWS CloudHSM](http://aws.amazon.com/cloudhsm/) and the [AWS CloudHSM User Guide](https://docs.aws.amazon.com/cloudhsm/latest/userguide/). """ alias AWS.Client alias AWS.Request def metadata do %AWS.ServiceMetadat...
lib/aws/generated/cloud_hsm_v2.ex
0.824709
0.472805
cloud_hsm_v2.ex
starcoder
defmodule Andy.Profiles.Rover.GMDefs.Being do @moduledoc "The GM definition for :being" alias Andy.GM.{GenerativeModelDef, Intention, Conjecture, Prediction} import Andy.GM.Utils def gm_def() do %GenerativeModelDef{ name: :being, conjectures: [ conjecture(:thriving) ], cont...
lib/andy/profiles/rover/gm_defs/being.ex
0.627837
0.401658
being.ex
starcoder
defmodule ExJSONPath do @moduledoc """ This module implements a JSONPath evaluator. """ alias ExJSONPath.ParsingError @opaque path_token :: String.t() | pos_integer() @opaque op :: :> | :>= | :< | :<= | :== | :!= @opaque compiled_path :: list( {:access, path_token()} ...
lib/ex_json_path.ex
0.728941
0.466603
ex_json_path.ex
starcoder
defmodule Vex.Validators.By do @moduledoc """ Ensure a value meets a custom criteria. Provide a function that will accept a value and return a true/false result. ## Options None, a function with arity 1 must be provided. * `:function`: The function to check. Should have an arity of 1 and return true/...
lib/vex/validators/by.ex
0.848109
0.53522
by.ex
starcoder
defmodule Scidata.CIFAR10 do @moduledoc """ Module for downloading the [CIFAR10 dataset](https://www.cs.toronto.edu/~kriz/cifar.html). """ require Scidata.Utils alias Scidata.Utils @base_url "https://www.cs.toronto.edu/~kriz/" @dataset_file "cifar-10-binary.tar.gz" @train_images_shape {50000, 3, 32, 3...
lib/scidata/cifar10.ex
0.796767
0.716268
cifar10.ex
starcoder
defmodule NewRelic do @moduledoc """ New Relic Agent - Public API """ @doc """ Set the name of the current transaction. The first segment will be treated as the Transaction namespace, and commonly contains the name of the framework. **Notes:** * At least 2 segments are required to light up the Tran...
lib/new_relic.ex
0.901707
0.847653
new_relic.ex
starcoder
defmodule ScenicStarter.Scene.Splash do @moduledoc """ Sample splash scene. This scene demonstrate a very simple animation and transition to another scene. It also shows how to load a static texture and paint it into a rectangle. """ use Scenic.Scene alias Scenic.Graph alias Scenic.ViewPort import ...
lib/scenes/splash.ex
0.856257
0.651594
splash.ex
starcoder
defmodule Coherence.LockableService do @moduledoc """ Lockable disables an account after too many failed login attempts. Enabled with the `--lockable` installation option, after 5 failed login attempts, the user is locked out of their account for 5 minutes. This option adds the following fields to the user ...
lib/coherence/services/lockable_service.ex
0.730674
0.41837
lockable_service.ex
starcoder
defmodule Infusionsoft.Schemas do @moduledoc false # Provides functions for transforming field names. # The "to" functions take lists of Common names and turn them into REST or XML names. # The "from" functions take lists of REST or XML names and turn them into Common names. alias Infusionsoft.Schemas.XML.C...
lib/infusionsoft/schemas.ex
0.852813
0.490114
schemas.ex
starcoder
defmodule Exile.Stream do @moduledoc """ Defines a `Exile.Stream` struct returned by `Exile.stream!/2`. """ alias Exile.Process alias Exile.Process.Error defmodule Sink do @moduledoc false defstruct [:process] defimpl Collectable do def into(%{process: process} = stream) do col...
lib/exile/stream.ex
0.677901
0.408424
stream.ex
starcoder
defmodule Day20 do use Aoc2018 @type direction :: :n | :e | :w | :s @type branch :: [direction] @type path :: [direction | branch] @type vertex :: {integer(), integer()} @spec part_one(binary()) :: integer() def part_one(input) do input |> String.trim() |> parse() |> longest_path() end...
lib/day20.ex
0.713631
0.583381
day20.ex
starcoder
defmodule Brodex do @moduledoc """ Brodex is a thin wrapper of [`:brod`](https://hex.pm/packages/brod). ## Configuration See [brod README](https://github.com/klarna/brod) for details. ```elixir config :brod, clients: [ my_client: [ endpoints: [{'127.0.0.1', 9092}], reconnect_coo...
lib/brodex.ex
0.808219
0.773131
brodex.ex
starcoder
defmodule Level10.Games do @moduledoc """ This module is the interface into game logic. All presenters within the web domain should interface only with this module for controlling games. Its children shouldn't be touched directly. Most of the functions in the module are client functions that give instructi...
lib/level10/games.ex
0.843493
0.40116
games.ex
starcoder
defmodule Panpipe.AST.Node do @moduledoc """ Behaviour implemented by all nodes of the Panpipe AST. The Panpipe AST is a Elixir representation of the [Pandoc data structure for a format-neutral representation of documents](http://hackage.haskell.org/package/pandoc-types-1.17.5.4/docs/Text-Pandoc-Definition.htm...
lib/panpipe/ast/node.ex
0.68637
0.732532
node.ex
starcoder
defmodule Countries do @doc """ Returns all countries. """ def all do countries() end @doc """ Returns one country by given alpha2 country code or name ## Examples iex> %Countries.Country{name: name} = Countries.get("PL") iex> name "Poland" iex> %Countries.Country{alpha2:...
lib/countries.ex
0.828176
0.452415
countries.ex
starcoder
defmodule Nats.Connection do @moduledoc ~S""" This module contains functions to connect to a NATS server. The defaults are oriented around getting new people to NATS up and running quickly. Please overwrite for your production environment. """ require Logger @tcp_attrs [:host, :port, :tcp] @poolboy...
lib/nats/connection.ex
0.728169
0.453685
connection.ex
starcoder
defmodule OMG.Eth do @moduledoc """ Library for common code of the adapter/port to contracts deployed on Ethereum. NOTE: The library code is not intended to be used outside of `OMG.Eth`: use `OMG.Eth.RootChain` and `OMG.Eth.Token` as main entrypoints to the contract-interaction functionality. NOTE: This wr...
apps/omg_eth/lib/eth.ex
0.908562
0.541348
eth.ex
starcoder
defmodule Iona do @moduledoc File.read!("#{__DIR__}/../README.md") @type template_opts :: [ {:path, Path.t()}, {:include, [Path.t()]}, {:helpers, [atom]} ] @type source_opts :: [ {:path, Path.t()}, {:include, [Path.t()]} ] @type supported_forma...
lib/iona.ex
0.802052
0.728784
iona.ex
starcoder
defmodule TeslaOAuth2ClientAuth.PrivateKeyJWT do @moduledoc """ Tesla middleware that implements the `"private_key_jwt"` authentication scheme for [https://openid.net/specs/openid-connect-core-1_0.html#ClientAuthentication](OpenID Connect clients) The client configuration must contain a `"jwks"` member whose v...
lib/tesla_oauth2_client_auth/private_key_jwt.ex
0.862786
0.472744
private_key_jwt.ex
starcoder
defmodule Jeeves.Anonymous do @moduledoc """ Implement an anonymous service. ### Usage To create the service: * Create a module that implements the API you want. This API will be expressed as a set of public functions. Each function will be defined to accept the current state as its first paramete...
lib/jeeves/anonymous.ex
0.772058
0.668454
anonymous.ex
starcoder
defmodule GitRekt do @moduledoc false alias GitRekt.Git defmodule GitCommit do @moduledoc """ Represents a Git commit. """ defstruct [:oid, :__ref__] @type t :: %__MODULE__{oid: Git.oid, __ref__: Git.commit} defimpl Inspect do def inspect(commit, _opts), do: "<GitCommit:#{Git.oid_...
apps/gitrekt/lib/gitrekt.ex
0.756897
0.471041
gitrekt.ex
starcoder
defmodule Galaxy.Gossip do @moduledoc """ This clustering strategy uses multicast UDP to gossip node names to other nodes on the network. These packets are listened for on each node as well, and a connection will be established between the two nodes if they are reachable on the network, and share the same m...
lib/galaxy/gossip.ex
0.713631
0.589894
gossip.ex
starcoder
defmodule Exshome.Tag.Mapping do @moduledoc """ Computes the tag mapping. """ @enforce_keys [:type, :key, :value] defstruct [:type, :key, :child_key, :value] @type t() :: %__MODULE__{ type: :simple | :nested_atom_map | :nested_binary_map, key: any(), child_key: String.t() | a...
lib/exshome/tag/mapping.ex
0.801004
0.556339
mapping.ex
starcoder
defprotocol Focusable do @doc "View the data that an optic focuses on." def view(optic, structure) @doc "Modify the data that an optic focuses on." def over(optic, structure, f) @doc "Set the data that an optic focuses on." def set(optic, structure, value) end defmodule Focus do alias Focus.Types @m...
lib/focus.ex
0.910962
0.503845
focus.ex
starcoder
defmodule Still.Compiler.ViewHelpers.ResponsiveImage do @moduledoc """ Generates a set of images to ensure they are responsive. See `Still.Preprocessor.Image` for details on these transformations. """ alias Still.Compiler.Incremental alias Still.Compiler.ViewHelpers.{ContentTag, UrlFor} import Still.Ut...
lib/still/compiler/view_helpers/responsive_image.ex
0.831349
0.425516
responsive_image.ex
starcoder
defmodule Turbo.Ecto.Utils do @moduledoc """ Utils functions. """ def done({:error, reason}), do: {:error, reason} def done(result), do: {:ok, result} @doc """ Converts all (string) map keys to atoms ## Examples iex> map = %{"a" => 1, "b" => %{"c" => 3, "d" => 4}} iex> Turbo.Ecto.Utils.s...
lib/turbo_ecto/utils.ex
0.833596
0.477432
utils.ex
starcoder
defmodule AnalysisPrep.Probability do @moduledoc """ Provide basic probability functions """ import Statistics.Math, only: [factorial: 1, floor: 1] import AnalysisPrep, only: [is_range: 1, sum_map: 1] @doc """ The probability of an event, given a sample space of equiprobable outcomes. The event can be...
lib/analysis_prep/probability.ex
0.830732
0.734643
probability.ex
starcoder
defmodule DG do @external_resource "README.md" @moduledoc File.read!("README.md") |> String.split("<!-- DOC -->") |> List.last() defstruct dg: nil, opts: [] def new(opts \\ []) do {digraph_opts, opts} = Keyword.pop(opts, :digraph_opts, []) %__MODULE__{dg: :digraph.new(digraph_opts), opts: opts} end ...
lib/dg.ex
0.767864
0.459864
dg.ex
starcoder
if Code.ensure_loaded?(Fiet) and Code.ensure_loaded?(Timex) do defmodule RssWatcher.Feed.Fiet do @moduledoc """ A Fiet + Timex based RSS parser. Used by default in subscriptions. Add the following to your dependancies: ``` {:fiet, "~> 0.2.1"}, {:timex, "~> 3.0"} ``` And add `...
lib/rss_watcher/feed/adapter/feit.ex
0.758511
0.797004
feit.ex
starcoder
defmodule PokerHandValue do @moduledoc """ A library to rate and compare poker hands. Any hand with 5 or more cards can be rated and is therefore suitable for texas hold em and other > 5 card poker types. ## Example ```elixir hand = "As Ad Ac Js Jd" PokerHandValue.rate_hand(hand) # => {:full_house, 7.1411}...
lib/poker_hand_value.ex
0.801664
0.870377
poker_hand_value.ex
starcoder
defmodule Aoc.Year2020.Day01 do @moduledoc """ Solution to Day 01 of 2020: Report Repair ## --- Day 1: Report Repair --- After saving Christmas five years in a row, you've decided to take a vacation at a nice resort on a tropical island. Surely, Christmas will go on without you. The tropical island has i...
lib/aoc/year_2020/day_01.ex
0.772874
0.698895
day_01.ex
starcoder
defmodule SocialParser do @moduledoc """ SocialParser is used to parse out common social message commponents such as hashtags, mentions and urls. """ @whitespace_chars [?\s, ?\t, ?\n] @breaking_chars [?#, ?@, ?+ | @whitespace_chars] @doc """ Returns a list of three element tuples (`{:type, "content", ...
lib/social_parser.ex
0.739328
0.515132
social_parser.ex
starcoder
defmodule Rolodex.Field do @moduledoc """ Shared logic for parsing parameter fields. `Rolodex.RequestBody`, `Rolodex.Response`, and `Rolodex.Schema` each use this module to parse parameter metadata. `new/1` transforms a bare map into a standardized parameter definition format. `get_refs/1` takes a parameter ...
lib/rolodex/field.ex
0.924849
0.647659
field.ex
starcoder
defmodule Asteroid.ObjectStore.DeviceCode.Riak do @moduledoc """ Riak implementation of the `Asteroid.ObjectStore.DeviceCode` behaviour ## Initializing a Riak bucket type ```console $ sudo riak-admin bucket-type create ephemeral_token '{"props":{"datatype":"map", "backend":"leveldb_mult"}}' ephemeral_toke...
lib/asteroid/object_store/device_code/riak.ex
0.869984
0.773794
riak.ex
starcoder
defmodule Comeonin do @moduledoc """ Defines a behaviour for higher-level password hashing functions. """ @type opts :: keyword @type password :: binary @type user_struct :: map | nil @doc """ Hashes a password and returns the password hash in a map, with the password set to nil. In the default i...
lib/comeonin.ex
0.890404
0.538741
comeonin.ex
starcoder
defmodule Harald.DataType.ManufacturerData do @moduledoc """ > The Manufacturer Specific data type is used for manufacturer specific data. Reference: Core Specification Supplement, Part A, section 1.4.1 Modules under the `Harald.ManufacturerData` scope should implement the `Harald.ManufacturerDataBehaviour`...
lib/harald/data_type/manufacturer_data.ex
0.7865
0.550849
manufacturer_data.ex
starcoder
defmodule StateChart.Document do use StateChart.Definition do enum Binding, :binding, 1, [ early: 0, late: 1 ] field(map(:var, __MODULE__.Data), :datamodel, 2) field(__MODULE__.Transition, :initial, 3) field(:string, :name, 4) repeated(__MODULE__.State, :states, 5) private(:__...
lib/state_chart/document.ex
0.717012
0.445288
document.ex
starcoder
defmodule Trike.CloudEvent do @moduledoc """ Represents a standard CloudEvent as well as a function for creating new CloudEvents from OCS messages. """ alias Trike.OcsRawMessage @type t() :: %__MODULE__{ specversion: String.t(), type: String.t(), source: String.t(), ...
lib/trike/cloud_event.ex
0.841305
0.446676
cloud_event.ex
starcoder
defmodule Terminus.Omni do @moduledoc """ Module for conveniently fetching data from both [Bitbus](https://bitbus.network) and [Bitsocket](https://bitbus.network) concurrently. `Terminus.Omni` replicates the functionality of legacy Planaria APIs by allowing you to query for both confirmed and unconfirmed tra...
lib/terminus/omni.ex
0.896419
0.675537
omni.ex
starcoder
defmodule KeyX.Shamir.Arithmetic do import Kernel, except: [+: 2, *: 2, /: 2] import Bitwise import Enum, only: [at: 2] alias KeyX.Shamir.Tables @type polynomial :: nonempty_list(non_neg_integer) @spec polynomial(non_neg_integer, non_neg_integer) :: polynomial def polynomial(intercept, degree) do [...
lib/shamir/shamir_math.ex
0.771972
0.567098
shamir_math.ex
starcoder
defmodule HardHat do @moduledoc """ A simple wrapper for the [Travis CI API](https://docs.travis-ci.com/api/). """ alias HardHat.Client alias HardHat.Response require Logger @request_headers [ {"Accept", "application/vnd.travis-ci.2+json"}, {"Content-Type", "application/json"}, {"User-Agent"...
apps/hard_hat/lib/hard_hat.ex
0.832441
0.41401
hard_hat.ex
starcoder
defmodule Catalog do @moduledoc """ A listing of all documents in our collection of buckets. The buckets are specified in the application configuration. Each document is associated with a person, and can be searched by that person's last name, first name, and/or date of birth. """ use GenServer require Logge...
lib/catalog.ex
0.811564
0.481941
catalog.ex
starcoder
defmodule GrapevineTelnet.Features do @moduledoc """ Struct and functions for tracking Telnet option statuses """ defstruct gmcp: false, packages: [], messages: [], message_cache: %{} @doc """ Enable GMCP on the telnet state """ def enable_gmcp(state) do features = Map.put(state.features, :gmcp, t...
apps/telnet/lib/telnet/features.ex
0.709221
0.445831
features.ex
starcoder
defmodule EctoHooks do @moduledoc """ When `use`-ed in a module that also `use`-es `Ecto.Repo`, augments the following `Ecto.Repo` callbacks to provide user definable hooks following successful execution. Hooks to `MyApp.EctoSchema.after_get/1`: - `all/2` - `get/3` - `get!/3` - `get_by/3` - `get_by...
lib/ecto_hooks.ex
0.841631
0.624694
ecto_hooks.ex
starcoder
defmodule Membrane.File.Sink.Multi do @moduledoc """ Element that writes buffers to a set of files. File is switched on event. Files are named according to `naming_fun` passed in options. This function receives sequential number of file and should return string. It defaults to `path/to/file0.ext`, `path/to/f...
lib/membrane_file/sink_multi.ex
0.774242
0.405714
sink_multi.ex
starcoder
defmodule NodePartitioner do @moduledoc """ The `NodePartitioner` module handles rotating the nodes in the cluster to give a fair node to schedule a process on. There are many nodes in the cluster, and each node is capable of different amounts of capacity. To fairly schedule this, `System.schedulers/0` is exec...
lib/node_partitioner.ex
0.788257
0.716243
node_partitioner.ex
starcoder
defmodule URI2.Query do @moduledoc """ Utilities for working with url query strings. Namespaced under `URI2` as it is a replacement for the native `URI` module. Calls the original module until the query API is finalised. All functions are pure, They return try tuples when there is a possibility of failure...
lib/uri2_query.ex
0.827236
0.538498
uri2_query.ex
starcoder
defmodule SimpleStatEx do @moduledoc """ SimpleStatEx is a lightweight library that supports logging simple statistics for any elixir project, including the Phoenix Framework. Stats are stored via ecto to your data store or in memory. They are rolled up by category and time window and can be queried convenie...
lib/simplestatex.ex
0.894005
0.660847
simplestatex.ex
starcoder
defmodule Framebuffer.Screeninfo.Fix do @moduledoc """ A representation of `fb_fix_screeninfo` as defined in `linux/fb.h`. This encapsulates device-independent info about the buffer device and its current format. These properties are immutable from userspace by direct calls, though they may change when the form...
lib/framebuffer/screeninfo/fix.ex
0.795658
0.515986
fix.ex
starcoder
defmodule Nerves.Dnssd.ServiceRegistration do @moduledoc """ Ensure a service name survives an application restart. The common interface is through [`Nerves.Dnssd.register()`](index.html) For example: I have 2 services on my network, both competing for a service name "Foo Service". The first service to be ...
lib/nerves_dnssd/service_registration.ex
0.854809
0.615203
service_registration.ex
starcoder
defmodule ExDebugger do @moduledoc """ Usage: `use ExDebugger` This effectively hijacks macros `def` and `defp` to auto-annotate the `AST` they receive compile time with strategically placed debugging expressions where they generate debugging events: 1. At the beginning of every `def`/`defp` 2. At the ...
lib/ex_debugger.ex
0.576542
0.801781
ex_debugger.ex
starcoder
defmodule AuthZ.AuthorizationPlugMixin do @moduledoc ~S""" Allows to create a plug enforcing authorization for protected routes. A user-defined module must `use` this module, making the user module a plug, and implement the `handle_authorization/3` and `handle_authentication_error/2` behaviours. The `handle_...
lib/authorization_plug_mixin.ex
0.810441
0.710842
authorization_plug_mixin.ex
starcoder
defmodule Contex.Axis do @moduledoc """ `Contex.Axis` represents the visual appearance of a `Contex.Scale` In general terms, an Axis is responsible for rendering a `Contex.Scale` where the scale is used to position a graphical element. As an end-user of the Contex you won't need to worry too much about Axes...
lib/chart/axis.ex
0.96192
0.850531
axis.ex
starcoder
defmodule Interactor do use Behaviour alias Interactor.TaskSupervisor @moduledoc """ A tool for modeling events that happen in your application. TODO: More on interactor concept Interactor provided a behaviour and functions to execute the behaviours. To use simply `use Interactor` in a module and impl...
lib/interactor.ex
0.69987
0.436142
interactor.ex
starcoder
defmodule JokenJwks do @moduledoc """ Fetches a signer from a public JWKS URL This hook is intended to be used when you are verifying a token is signed with a well known public key. This is, for example, part of the OpenID Connect spec. To use it, pass this hook to Joken either with the `add_hook/2` macro o...
lib/joken_jwks_hook.ex
0.835551
0.414277
joken_jwks_hook.ex
starcoder
defmodule Terp.ModuleSystem do @moduledoc """ Functionality supporting a basic module system, e.g. export functions from a module and import them in another. """ alias Terp.AST alias Terp.Error alias Terp.Parser alias Terp.TypeSystem alias RoseTree.Zipper @doc """ Imports the definitions that are...
lib/terp/module_system.ex
0.654564
0.563588
module_system.ex
starcoder
if Code.ensure_loaded?(Decorator.Define) do defmodule Spandex.Decorators do @moduledoc """ Provides a way of annotating functions to be traced. Span function decorators take an optional argument which is the attributes to update the span with. One of those attributes can be the `:tracer` in case you want...
lib/decorators.ex
0.658198
0.512693
decorators.ex
starcoder
defmodule Servy.ServicesSupervisor do use Supervisor @doc """ Restart Strategies and Other Supervisor Options In the video, we initialized both supervisors with the :one_for_one restart strategy, like so Supervisor.init(children, strategy: :one_for_one) Here's a quick summary of all the rest...
servy/lib/servy/services_supervisor.ex
0.620277
0.544196
services_supervisor.ex
starcoder
defmodule JSONPatch.Path do @moduledoc false @doc ~S""" Splits a JSON Pointer (RFC 6901) path into its components. Path keys are converted to integers if possible, otherwise remaining strings. Example: iex> JSONPatch.Path.split_path("/a/b/22/c") ["a", "b", 22, "c"] iex> JSONPatch.Path....
lib/json_patch/path.ex
0.87444
0.533884
path.ex
starcoder
defmodule ExAlsa do @moduledoc """ A NIF-backed library for interfacing with ALSA. """ @typedoc "Sample rates allowed" @type rates() :: 44100 | 48000 | 96000 | 192_000 @type options :: %{ channels: pos_integer(), rate: rates(), period_size: pos_integer(), buffer_size: pos_integer(), pe...
lib/ex_alsa.ex
0.804252
0.525064
ex_alsa.ex
starcoder
defmodule EarmarkParser.Enum.Ext do @moduledoc ~S""" Some extensions of Enum functions """ @doc ~S""" `reduce_with_end` is like `Enum.reduce` for lists, but the reducer function is called for each element of the list with the tuple `{:element, element}` and the accumulator and once more at the end with...
lib/earmark_parser/enum/ext.ex
0.698227
0.607139
ext.ex
starcoder
defmodule Owl.Spinner do @moduledoc ~S""" A spinner widget. Simply run any long-running task using `run/2`: Owl.Spinner.run( fn -> Process.sleep(5_000) end, labels: [ok: "Done", error: "Failed", processing: "Please wait..."] ) Multiple spinners can be run simultaneously: lo...
lib/owl/spinner.ex
0.840292
0.624837
spinner.ex
starcoder
defmodule Exop.ValidationChecks do @moduledoc """ Provides low-level validation functions: * check_type/3 * check_required/3 * check_numericality/3 * check_in/3 * check_not_in/3 * check_format/3 * check_length/3 * check_struct/3 * check_func/3 * check_equals/3 * check_ex...
lib/exop/validation_checks.ex
0.877896
0.55447
validation_checks.ex
starcoder
defmodule Geo.WKT.Decoder do @moduledoc false alias Geo.{ Point, PointZ, PointM, PointZM, LineString, LineStringZ, Polygon, PolygonZ, MultiPoint, MultiPointZ, MultiLineString, MultiPolygon, MultiPolygonZ, GeometryCollection } @doc """ Takes a WKT strin...
lib/geo/wkt/decoder.ex
0.847163
0.617369
decoder.ex
starcoder
defmodule Sigaws do @moduledoc """ A library to sign and verify HTTP requests using AWS Signature V4. [![Inline docs](http://inch-ci.org/github/handnot2/sigaws.svg)](http://inch-ci.org/github/handnot2/sigaws) `Sigaws` does not dictate how you compose and send HTTP requests. You can use `HTTPoison` or any ot...
lib/sigaws.ex
0.91682
0.528473
sigaws.ex
starcoder