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 Membrane.VideoCutAndMerge do @moduledoc """ Membrane Bin that cuts and merges multiple raw videos into one. The bin expects each frame to be received in a separate buffer, so the parser (`Membrane.Element.RawVideo.Parser`) may be required in a pipeline before the merger bin (e.g. when input is read...
lib/video_cut_and_merge.ex
0.885223
0.600569
video_cut_and_merge.ex
starcoder
defmodule NaturalOrder do @moduledoc """ A utility to compare strings in [natural sort order](https://en.wikipedia.org/wiki/Natural_sort_order). Natural sort order is useful for humans. By default sorting Strings is a lot differently. ## Examples of comparing two strings iex> NaturalOrder.compare("Stri...
lib/natural_order.ex
0.840341
0.621842
natural_order.ex
starcoder
defmodule Plaid.Institutions do @moduledoc """ Functions for Plaid `institutions` endpoint. """ import Plaid, only: [make_request_with_cred: 4, validate_cred: 1, validate_public_key: 1] alias Plaid.Utils @derive Jason.Encoder defstruct institutions: [], request_id: nil, total: nil @type t :: %__MODU...
lib/plaid/institutions.ex
0.816004
0.60964
institutions.ex
starcoder
defmodule ReWeb.Types.Image do @moduledoc """ GraphQL types for images """ use Absinthe.Schema.Notation alias ReWeb.Resolvers object :image do field :id, :id field :filename, :string field :position, :integer field :is_active, :boolean field :description, :string field :category, :...
apps/re_web/lib/graphql/types/image.ex
0.622804
0.465387
image.ex
starcoder
defmodule Esquew.Subscription do use GenServer @moduledoc """ Genserver module for the state of a subscription """ @registry Esquew.Registry defmodule SubscriptionState do @moduledoc """ Struct representing Subscription state """ @enforce_keys [:topic, :subscription] defstruct topic:...
lib/esquew/subscription/subscription.ex
0.775265
0.401043
subscription.ex
starcoder
defmodule Tus.Storage.S3 do @moduledoc """ S3 (or compatible) storage backend for the [Tus server](https://hex.pm/packages/tus) ## Installation The package can be installed by adding `tus_cache_redis` to your list of dependencies in `mix.exs`: ```elixir def deps do [ {:tus, "~> 0.1.1"}, {...
lib/tus_storage_s3.ex
0.818519
0.8398
tus_storage_s3.ex
starcoder
defmodule Unicode.Set.Search do defstruct [:binary_tree, :string_ranges, :operation] def build_search_tree(%Unicode.Set{parsed: {operation, tuple_list}, state: :reduced}) do {ranges, string_ranges} = extract_and_expand_string_ranges(tuple_list) search_tree = build_search_tree(ranges) search_struct = [b...
lib/set/search.ex
0.61832
0.661913
search.ex
starcoder
defmodule Day13 do @moduledoc """ You need to cross a vast firewall. The firewall consists of several layers, each with a security scanner that moves back and forth across the layer. To succeed, you must not be detected by a scanner. By studying the firewall briefly, you are able to record (in your puzzle inpu...
lib/day13.ex
0.645343
0.703406
day13.ex
starcoder
defmodule AOC.Day6.OrbitChecksum do alias AOC.Day6.Node alias AOC.Day6.Stack @moduledoc false def part1(path) do read_puzzle_input(path) |> process_input() |> child_to_parent_map() |> checksum() end def part2(path) do read_puzzle_input(path) |> process_input() |> neighbor_map(...
aoc-2019/lib/aoc/day6/orbit_checksum.ex
0.746046
0.514339
orbit_checksum.ex
starcoder
defmodule StaffNotes.Support.Helpers do @moduledoc """ Function helpers for tests. There are a few common types of helper functions: * Functions that are intended to be used in assertions end in `?` * `fixture` functions that create records in the database and return the data object * `setup` functions th...
test/support/helpers.ex
0.888263
0.824533
helpers.ex
starcoder
defmodule SiteWeb.ScheduleView.TripList do @moduledoc """ View functions for handling lists of trips from schedules. """ alias Site.Components.Icons.SvgIcon import Phoenix.HTML, only: [raw: 1] import Phoenix.HTML.Tag, only: [content_tag: 2, content_tag: 3] import Phoenix.HTML.Link, only: [link: 2] al...
apps/site/lib/site_web/views/schedule/trip_list.ex
0.796965
0.438424
trip_list.ex
starcoder
defmodule Fluid.Field.NaiveDateTime do alias Fluid.Helper defstruct size: nil, time_unit: :millisecond, epoch: ~N[2015-01-01 00:00:00] def bit_size(%{size: size}), do: size defmacro def_field_functions(field_name, opts) do quote bind_quoted: [opts: opts, field_name: field_name] do Fluid.Field.Naive...
lib/fluid/field/naive_date_time.ex
0.794185
0.434941
naive_date_time.ex
starcoder
defmodule Ockam.Wire do @moduledoc """ Encodes and decodes messages that can be transported on the wire. """ alias Ockam.Message alias Ockam.Wire.DecodeError alias Ockam.Wire.EncodeError require DecodeError require EncodeError @doc """ Encodes a message into a binary. Returns `{:ok, iodata}`,...
implementations/elixir/ockam/ockam/lib/ockam/wire.ex
0.93011
0.418875
wire.ex
starcoder
defmodule Scenic.Cache.Term do @moduledoc """ Helpers for loading file based Erlang terms directly into the cache. Sometimes you want to pre-compile a big erlang term, such as a dictionary/map and distribute it to multiple applications. In this case you build your term, then use [`:erlang.term_to_binary/2`...
lib/scenic/cache/term.ex
0.882225
0.521167
term.ex
starcoder
defmodule Accent.Scopes.Translation do import Ecto.Query @doc """ ## Examples iex> Accent.Scopes.Translation.not_id(Accent.Translation, "test") #Ecto.Query<from t in Accent.Translation, where: t.id != ^"test"> """ @spec not_id(Ecto.Queryable.t(), String.t()) :: Ecto.Queryable.t() def not_id(query,...
lib/accent/scopes/translation.ex
0.720467
0.436562
translation.ex
starcoder
defmodule Wavex.Chunk.Format do @moduledoc """ A format chunk. """ alias Wavex.FourCC @enforce_keys [ :channels, :sample_rate, :byte_rate, :block_align, :bits_per_sample ] defstruct [ :channels, :sample_rate, :byte_rate, :block_align, :bits_per_sample ] @typ...
lib/wavex/chunk/format.ex
0.88029
0.697854
format.ex
starcoder
defmodule Record do @moduledoc """ Module to work, define and import records. Records are simply tuples where the first element is an atom: iex> Record.is_record {User, "john", 27} true This module provides conveniences for working with records at compilation time, where compile-time field name...
lib/elixir/lib/record.ex
0.844585
0.737064
record.ex
starcoder
defmodule Ecto.Adapters.Postgres do @moduledoc """ Adapter module for PostgreSQL. It uses `postgrex` for communicating to the database and manages a connection pool with `poolboy`. ## Features * Full query support (including joins, preloads and associations) * Support for transactions * Support...
lib/ecto/adapters/postgres.ex
0.766992
0.566139
postgres.ex
starcoder
defmodule Ash.Query.Operator.IsNil do @moduledoc """ left is_nil true/false This predicate matches if the left is nil when the right is `true` or if the left is not nil when the right is `false` """ use Ash.Query.Operator, operator: :is_nil, predicate?: true, types: [[:any, :boolean]] def ev...
lib/ash/query/operator/is_nil.ex
0.847653
0.522202
is_nil.ex
starcoder
defmodule ThinNotionApi.Blocks do @moduledoc """ This module contains functions to interact and modify Notion blocks. A block object represents content within Notion. Blocks can be text, lists, media, and more. """ import ThinNotionApi.Base alias ThinNotionApi.Types @spec retrieve_block(String.t()) :: ...
lib/thin_notion_api/blocks.ex
0.88823
0.469155
blocks.ex
starcoder
defmodule TelemetryRegistry do @moduledoc """ TelemetryRegistry provides tools for the discovery and documentation of [telemetry](https://github.com/beam-telemetry/telemetry) events within your applications. ## Telemetry Event Definitions and Declaration Users want to know what telemetry events are availabl...
lib/telemetry_registry.ex
0.888985
0.812793
telemetry_registry.ex
starcoder
defmodule Google.Rpc.RetryInfo do @moduledoc false use Protobuf, syntax: :proto3 @type t :: %__MODULE__{ retry_delay: Google.Protobuf.Duration.t() | nil } defstruct [:retry_delay] field :retry_delay, 1, type: Google.Protobuf.Duration end defmodule Google.Rpc.DebugInfo do @moduledoc fals...
lib/google/rpc/error_details.pb.ex
0.79158
0.426949
error_details.pb.ex
starcoder
defmodule GGity.Element.Text do @moduledoc """ Defines the data and functions used to style non-geom text elements. CSS presentation attributes: * `:family` - string: sets value of CSS `font-family` * `:face` - string or integer: sets value of CSS `font-weight` Valid values: * `"normal"` ...
lib/ggity/element/text.ex
0.860662
0.691211
text.ex
starcoder
defmodule WebPushEncryption.Encrypt do @moduledoc """ Module to encrypt notification payloads. See the following links for details about the encryption process. https://developers.google.com/web/updates/2016/03/web-push-encryption?hl=en """ alias WebPushEncryption.Crypto @max_payload_length 4078 @o...
lib/web_push_encryption/encrypt.ex
0.866585
0.605916
encrypt.ex
starcoder
defmodule Bitwise do @moduledoc """ This module provide macros and operators for bitwise operators. These macros can be used in guards. The easiest way to use is to simply import them into your module: use Bitwise bnot 1 #=> -2 1 &&& 1 #=> 1 You can select to include only or skip op...
lib/elixir/lib/bitwise.ex
0.746509
0.642173
bitwise.ex
starcoder
defmodule Code.Fragment do @moduledoc """ This module provides conveniences for analyzing fragments of textual code and extract available information whenever possible. Most of the functions in this module provide a best-effort and may not be accurate under all circumstances. Read each documentation for mo...
lib/elixir/lib/code/fragment.ex
0.828315
0.657153
fragment.ex
starcoder
defmodule VisaCheckout do @moduledoc """ Visa Checkout API reference: https://developer.visa.com/capabilities/visa_checkout/reference """ alias VisaCheckout.{Http, Util} @doc """ Get payment data Visa Checkout API reference: https://developer.visa.com/capabilities/visa_checkout/reference#visa_checkout_...
lib/visa_checkout.ex
0.724675
0.435661
visa_checkout.ex
starcoder
defmodule EpicenterWeb.Forms.DemographicForm do use Ecto.Schema import Ecto.Changeset alias Epicenter.Cases.Demographic alias Epicenter.Cases.Ethnicity alias Epicenter.Coerce alias Epicenter.MajorDetailed alias EpicenterWeb.Forms.DemographicForm @primary_key false embedded_schema do field :emp...
lib/epicenter_web/forms/demographic_form.ex
0.544075
0.401189
demographic_form.ex
starcoder
defmodule Mix.Tasks.Re.Tags.Create do @moduledoc """ Create all tags from our system. """ use Mix.Task require Logger @tags [ %{category: "concierge", name: "24 Horas", visibility: "public"}, %{category: "concierge", name: "Horario Comercial", visibility: "public"}, %{category: "concierge", na...
apps/re/lib/mix/tasks/tags/create.ex
0.761006
0.458773
create.ex
starcoder
defmodule MatrixOperation do @moduledoc """ *MatrixOperation* is a linear algebra library in Elixir language. Matrix indices of a row and column is an integer starting from 1 (not from 0). """ @doc """ Numbers of rows and columns of a matrix are got. #### Argument - matrix: Target matrix fo...
lib/matrix_operation.ex
0.914329
0.763484
matrix_operation.ex
starcoder
defmodule Quark.Curry do @moduledoc ~S""" [Currying](https://en.wikipedia.org/wiki/Currying) breaks up a function into a series of unary functions that apply their arguments to some inner n-ary function. This is a convenient way to achieve a general and flexible partial application on any curried function. ...
lib/quark/curry.ex
0.78968
0.634798
curry.ex
starcoder
defmodule Chunkr.Page do @moduledoc """ A single page of results. ## Fields * `raw_results` — rows in the form `{cursor_values, record}` where `cursor_values` is the list of values to be used for generating a cursor. Note that in cases where coalescing or other manipulation was performed for the...
lib/chunkr/page.ex
0.836321
0.608187
page.ex
starcoder
defmodule Fuentes.Account do @moduledoc """ The Account module represents accounts in the system which are of _asset_, _liability_, or _equity_ types, in accordance with the "accounting equation". Each account must be set to one of the following types: | TYPE | NORMAL BALANCE | DESCRIPTION ...
lib/fuentes/account.ex
0.907743
0.657332
account.ex
starcoder
defmodule Fuzzyurl.Match do @doc ~S""" Returns an integer representing how closely `mask` (which may have wildcards) resembles `url` (which may not), or `nil` in the case of a conflict. """ @spec match(%Fuzzyurl{}, %Fuzzyurl{}) :: non_neg_integer | nil def match(%Fuzzyurl{} = mask, %Fuzzyurl{} = url) do ...
lib/fuzzyurl/match.ex
0.854688
0.426322
match.ex
starcoder
defmodule Snitch.Domain.Order.Transitions do @moduledoc """ Helpers for the `Order` state machine. The `Snitch.Domain.Order.DefaultMachine` makes direct use of these helpers. By documenting these handy functions, we encourage the developer of a custom state machine to use, extend or compose them to build la...
apps/snitch_core/lib/core/domain/order/transitions.ex
0.889685
0.857052
transitions.ex
starcoder
defmodule Prolly.CountMinSketch do require Vector @moduledoc """ Use CountMinSketch when you want to count and query the approximate number of occurences of values in a stream using sublinear memory For example, "how many times has the string `foo` been in the stream so far?" is a reasonable question for ...
lib/prolly/count_min_sketch.ex
0.894873
0.700556
count_min_sketch.ex
starcoder
defmodule ArtemisWeb.ViewHelper.Tables do use Phoenix.HTML @default_delimiter "," @doc """ Generates empty table row if no records match """ def render_table_row_if_empty(records, options \\ []) def render_table_row_if_empty(%{entries: entries}, options), do: render_table_row_if_empty(entries, options)...
apps/artemis_web/lib/artemis_web/view_helpers/tables.ex
0.770637
0.508971
tables.ex
starcoder
defmodule Wordza.Game do @moduledoc """ This is our Wordza Game, a single game managing: - Config (dictionary, rules) - Tiles (tiles available) - Board (tiles tiles played) - Players (tiles in trays, current score) - Plays (history, game log) - Scores We are going to base it largely off of WordFued a...
lib/game/game.ex
0.638046
0.438004
game.ex
starcoder
defmodule BeamToExAst do alias BeamToExAst.Translate def convert(list, opts \\ []) do opts = Enum.into(opts, %{}) {mod_name, rest, _opts} = Enum.reduce(list, {"", [], opts}, &do_convert/2) case length(rest) do 1 -> {:defmodule, [line: 1], [{:__aliases__, [line: 1], [mod_name]}, [do: List...
lib/beam_to_ex_ast.ex
0.511473
0.48932
beam_to_ex_ast.ex
starcoder
defmodule ReIntegrations.Routific.Payload.Outbound do @moduledoc """ Builds routific payload. """ @derive Jason.Encoder alias Re.Calendars.Calendar alias ReIntegrations.Routific defstruct [:visits, :fleet, :options] def build(input, opts) do with {:ok, visits} <- build_visits(input), {:o...
apps/re_integrations/lib/routific/payload/outbound.ex
0.702326
0.426829
outbound.ex
starcoder
defmodule Freshcom.Identity do @moduledoc """ This API module provides functions that deal with identity and access management. It follows a combination of Stripe and AWS style IAM. Generally speaking, identity in Freshcom consist of three resources: - The app that is making the request on behalf of the user...
lib/freshcom/api/identity.ex
0.821259
0.844858
identity.ex
starcoder
defmodule Asteroid.ObjectStore.AuthenticationEvent.Riak do @moduledoc """ Riak implementation of the `Asteroid.ObjectStore.AuthenticationEvent` behaviour ## Initializing a Riak bucket type ```console $ sudo riak-admin bucket-type create ephemeral_token '{"props":{"datatype":"map", "backend":"leveldb_mult"}}...
lib/asteroid/object_store/authentication_event/riak.ex
0.86009
0.6955
riak.ex
starcoder
defmodule K8s.Conn do @moduledoc """ Handles authentication and connection configuration details for a Kubernetes cluster. `Conn`ections can be registered via Mix.Config or environment variables. Connections can also be dynaically built during application runtime. """ alias __MODULE__ alias K8s.Conn.{P...
lib/k8s/conn.ex
0.865863
0.546859
conn.ex
starcoder
defmodule PigLatin do @vowels ["a", "e", "i", "o", "u"] @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...
elixir/pig-latin/lib/pig_latin.ex
0.729905
0.444324
pig_latin.ex
starcoder
defmodule Scitree do @moduledoc """ Bindings to Yggdrasil Decision Forests (YDF), with a collection of decision forest model algorithms. """ alias Scitree.Native alias Scitree.Infer alias Scitree.Validations, as: Val alias Nx @train_validations [:label, :dataset_size, :learner, :task] @pred_valid...
lib/scitree.ex
0.893173
0.80871
scitree.ex
starcoder
defmodule Cloudinary.Transformation do @moduledoc """ Handles the cloudinary transformation options. A cloudinary transformation is represented by a `t:map/0` or a `t:keyword/0`, and a `t:list/0` of transformations represents chained transformations. See each type documentation to know available ranges and ...
lib/cloudinary/transformation.ex
0.936496
0.427875
transformation.ex
starcoder
defmodule Day13 do def run_part1() do AOCHelper.read_input() |> SolutionPart1.run() end def run_part2() do AOCHelper.read_input() |> SolutionPart2.run() end def debug_sample() do [ "939", "7,13,x,x,59,x,31,19" ] |> SolutionPart2.run() end end defmodule SolutionPart...
aoc-2020/day13/lib/day13.ex
0.585101
0.417331
day13.ex
starcoder
defmodule Util do @moduledoc """ A `@docp` bevezetese es error-monad, illetve mindenfele szir-szar. A tobbfele hasznalat kompatibilis! Egyreszt arra valo, hogy tudjak privat fuggvenyeknek `@docp` attributumot adni. Ekkor hasznalata: ```elixir defmodule Valamilyen.Modul do # Mindenfele kod. # Minde...
lib/util/x.ex
0.620966
0.745977
x.ex
starcoder
defmodule Want do @moduledoc """ Type conversion library for Elixir and Erlang. """ @doc """ Convert a value to a string. ## Options * `:max` - Maximum allowable string length. * `:min` - Minimum allowable string length. * ':decode' - Currently only supports :uri; runs URI.decode ...
lib/want.ex
0.909204
0.549278
want.ex
starcoder
defmodule Nebulex.Adapter.Stats do @moduledoc """ Specifies the stats API required from adapters. Each adapter is responsible for providing support for stats by implementing this behaviour. However, this module brings with a default implementation using [Erlang counters][https://erlang.org/doc/man/counters.h...
lib/nebulex/adapter/stats.ex
0.921446
0.675972
stats.ex
starcoder
defmodule Schocken.Game.Ranking do @moduledoc false alias Schocken.Game.Player # Hand ranks @schock_out 5 @schock 4 @general 3 @straight 2 @house_number 1 @doc """ Evaluates the current toss and returns {rank, high, tries} """ @spec evaluate(Player.current_toss()) :: Player.current_toss() d...
lib/schocken/game/ranking.ex
0.843251
0.452778
ranking.ex
starcoder
defmodule ExBankID.Sign.Payload do @moduledoc """ Provides the struct used when initiating a signing of data """ defstruct [:endUserIp, :personalNumber, :requirement, :userVisibleData, :userNonVisibleData] import ExBankID.PayloadHelpers @spec new( binary, binary, personal_num...
lib/ex_bank_id/sign/payload.ex
0.807726
0.427397
payload.ex
starcoder
defmodule CFEnv.Middleware do @moduledoc """ The adapter interface for pluggable service middleware. Your VCAP services might need to be parsed and transformed as part of startup, such as vault paths, or base64 decoding. Or maybe you want to derive services maps to structs. There are two callbacks - `ini...
lib/middleware/middleware.ex
0.94121
0.832509
middleware.ex
starcoder
defmodule Mockery.Assertions do @moduledoc """ This module contains a set of additional assertion functions. """ alias Mockery.Error alias Mockery.History alias Mockery.Utils @doc """ Asserts that function from given module with given name or name and arity was called at least once. **NOTE**: Moc...
lib/mockery/assertions.ex
0.863046
0.738663
assertions.ex
starcoder
defmodule Timex.Parsers.DateFormat.DefaultParser do @moduledoc """ This module is responsible for parsing date strings using the default timex formatting syntax. See `Timex.DateFormat.Formatters.DefaultFormatter` for more info. """ use Timex.Parsers.DateFormat.Parser alias Timex.Parsers.DateFormat.Direc...
lib/parsers/dateformat/default.ex
0.778944
0.416678
default.ex
starcoder
defmodule NeoscanMonitor.Utils do @moduledoc false alias NeoscanSync.Blockchain alias Neoscan.Transactions alias Neoscan.Addresses alias Neoscan.Stats alias Neoscan.ChainAssets alias NeoscanSync.Notifications # blockchain api nodes def seeds do Application.fetch_env!(:neoscan_monitor, :seeds) e...
apps/neoscan_monitor/lib/neoscan_monitor/monitor/utils.ex
0.586168
0.445288
utils.ex
starcoder
defmodule KV.GarbageCollector do @moduledoc """ Module which expires keys in buckets, built on top of lightweight `OTP` processes (`proc_lib`). """ # Client API. @doc """ Starts the garbage collection process with a given name that handles keys expiration. """ def start_link(name) do :proc_lib.sta...
apps/kv/lib/kv/garbage_collector.ex
0.690455
0.415996
garbage_collector.ex
starcoder
case Code.ensure_loaded(Ecto) do {:module, _} -> defmodule Surgex.DataPipe.TableSync do @moduledoc """ Extracts and transforms data from one PostgreSQL table into another. ## Usage Refer to `Surgex.DataPipe` for a complete data pipe example. """ import Ecto.Query alias...
lib/surgex/data_pipe/table_sync.ex
0.792022
0.428712
table_sync.ex
starcoder
defmodule Typo.PDF.Page do @moduledoc """ Page size definitions. """ @doc """ Given a page size 2-tuple returns the last two values possibly transposed so that the page width is the longest measurement. """ @spec landscape({number(), number()}) :: {number(), number()} def landscape({width, height}) ...
lib/typo/pdf/page.ex
0.888566
0.503357
page.ex
starcoder
defmodule StarkInfra.IssuingTransaction do alias __MODULE__, as: IssuingTransaction alias StarkInfra.Utils.Rest alias StarkInfra.Utils.Check alias StarkInfra.User.Project alias StarkInfra.User.Organization alias StarkInfra.Error @moduledoc """ # IssuingTransaction struct """ @doc """ The Issui...
lib/issuing_transaction/issuing_transaction.ex
0.904413
0.630628
issuing_transaction.ex
starcoder
defmodule DarknetToOnnx.ParseDarknet do @moduledoc """ The Darknet parser (from: https://github.com/jkjung-avt/tensorrt_demos/blob/master/yolo/yolo_to_onnx.py) """ use Agent, restart: :transient @doc """ Initializes a DarkNetParser object. Keyword argument: supported_layers -- a stri...
lib/darknet_to_onnx/parser.ex
0.851058
0.461199
parser.ex
starcoder
defmodule Astra.Rest do alias Astra.Rest.Http @moduledoc """ `Astra.Rest` provides functions to access the public methods of the REST interface for databases hosed on https://astra.datastax.com. Astra's REST interface is implemented using the stargate project, https://stargate.io. Swagger docs for this inter...
lib/rest/rest.ex
0.896477
0.881207
rest.ex
starcoder
defmodule Curvy.Key do @moduledoc """ Module used to create ECDSA keypairs and convert to private and public key binaries. """ alias Curvy.{Curve, Point} defstruct crv: :secp256k1, point: %Point{}, privkey: nil, compressed: true @typedoc """ ECDSA Keypair. Alway...
lib/curvy/key.ex
0.781831
0.553988
key.ex
starcoder
defprotocol Buildable do @moduledoc """ Documentation for `Buildable`. """ @type t :: term() @type element :: term() @type options :: keyword() @type position :: :first | :last @required_attributes [ :extract_position, :insert_position, :into_position, :reversible? ] @doc false K...
lib/buildable.ex
0.788827
0.558297
buildable.ex
starcoder
defmodule Sanbase.Signal.History.PricesHistory do @moduledoc """ Implementations of historical trigger points for price_percent_change and price_absolute_change triggers. Historical prices are bucketed at `1 hour` intervals and goes `90 days` back. """ import Sanbase.Signal.OperationEvaluation import San...
lib/sanbase/signals/history/prices_history.ex
0.848863
0.58519
prices_history.ex
starcoder
defmodule LiveProps.States do @moduledoc """ Functions for working with states. These will be imported whenever you `use` LiveProps.LiveComponent or LiveProps.LiveView """ @doc """ Define state of given name and type. Returns :ok. Types can be any atom and are just for documentation purposes. ### O...
lib/live_props/states.ex
0.895705
0.586908
states.ex
starcoder
defmodule Grizzly.ZWave.Commands.BasicReport do @moduledoc """ This module implements the BASIC_REPORT command of the COMMAND_CLASS_BASIC command class Params: * `:value` - the current value (:on or :off or :unknown) * `:target_value` - the target value (:on or :off or :unknown) - v2 * `:duration` -...
lib/grizzly/zwave/commands/basic_report.ex
0.895645
0.504333
basic_report.ex
starcoder
defmodule Explorer.Inspect do # **Private** helpers for inspecting Explorer data structures. @moduledoc false alias Inspect.Algebra, as: IA def to_string(i, _opts) when is_nil(i), do: "nil" def to_string(i, _opts) when is_binary(i), do: "\"#{i}\"" def to_string(i, opts) when is_list(i), do: IA....
lib/explorer/inspect.ex
0.570451
0.473657
inspect.ex
starcoder
defmodule Chunky.Sequence.OEIS.Constants do @moduledoc """ Sequences from the [Online Encyclopedia of Integer Sequences](https://oeis.org) dealing with numeric constants, digit expansions of constants, constant value sequences, or constant cycle sequences. ## Available Sequences ### Constant Value Sequences...
lib/sequence/oeis/constants.ex
0.899938
0.921781
constants.ex
starcoder
defmodule SudokuSolver.CPS do @moduledoc """ Implements SudokuSolver using continuation passing style """ @behaviour SudokuSolver @doc """ Solve a soduku """ @impl SudokuSolver @spec solve(SudokuBoard.t()) :: SudokuBoard.t() | nil def solve(%SudokuBoard{size: size} = board) do max_index = siz...
lib/sudoku_solver/cps.ex
0.685529
0.4881
cps.ex
starcoder
defmodule Month.Period do @moduledoc """ Represents a period of 1 month or more. iex> range = Month.Period.new(~M[2019-01], ~M[2019-03]) {:ok, #Month.Period<~M[2019-01], ~M[2019-03]>} iex> range.months [~M[2019-01], ~M[2019-02], ~M[2019-03]] The `months` field contains all months within ...
lib/month/period.ex
0.91114
0.695273
period.ex
starcoder
defmodule AdventOfCode.Day11 do def get_value(input, row, col) do case (x = Matrex.at(input, row, col)) < 0 do true -> 0 false -> floor(x) end end def neighborhood_value(input, row, col) do center_value = get_value(input, row, col) value = Enum.reduce([-1, 0, 1], 0, fn row_off,...
lib/day11.ex
0.568416
0.691777
day11.ex
starcoder
defmodule Lightbridge.EnergyMonitor do @moduledoc """ Polls the smart socket to get it's current energy usage. Publishes to configured MQTT endpoint. """ use GenServer import Lightbridge.Config, only: [fetch: 1] alias Lightbridge.Hs100 alias Lightbridge.EnergyMonitor.Stats # Set the polling frequ...
lib/lightbridge/energy_monitor.ex
0.643889
0.492676
energy_monitor.ex
starcoder
defmodule Scenic.Primitive.Text do @moduledoc """ Draw text on the screen. ## Data `text` The data for a Text primitive is a bitstring * `text` - the text to draw ## Styles This primitive recognizes the following styles * [`hidden`](Scenic.Primitive.Style.Hidden.html) - show or hide the primitiv...
lib/scenic/primitive/text.ex
0.898115
0.458167
text.ex
starcoder
defmodule WechatPay.Plug.Payment do @moduledoc """ Plug behaviour to handle **Payment** Notification from Wechat's Payment Gateway. Official document: https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=9_7 ## Example ### Define a handler See `WechatPay.Plug.Handler` for how to implement a handler....
lib/wechat_pay/plug/payment.ex
0.85753
0.609175
payment.ex
starcoder
defmodule PhStInvariant do @moduledoc """ The long term goal of this library is allow developers to create property style tests based on existing ExUnit assert statements. For example: assert URI.encode_query([{"foo z", :bar}]) == "foo+z=bar" This should be converted to the following code success_...
lib/phst_invariant.ex
0.863363
0.792585
phst_invariant.ex
starcoder
defmodule Memex.TidBit do @moduledoc """ modelled after the `tiddler` of TiddlyWiki. https://tiddlywiki.com/#TiddlerFields This module is really only supposed to contain the struct definition for TidBits. However, on the command-line, it it convenient/untuitive sometimes to think of things from a TidBit...
lib/structs/tidbit.ex
0.628407
0.472623
tidbit.ex
starcoder
defmodule StrawHat.Review.Reviews do @moduledoc """ Interactor module that defines all the functionality for Reviews management. """ use StrawHat.Review.Interactor alias StrawHat.Review.Review @doc """ Gets the list of reviews. """ @spec get_reviews(Scrivener.Config.t() | keyword()) :: Scrivener.Pag...
lib/straw_hat_review/reviews/reviews.ex
0.790328
0.469703
reviews.ex
starcoder
defmodule Nostrum.Consumer do @moduledoc """ Consumer process for gateway event handling. # Consuming Gateway Events To handle events, Nostrum uses a GenStage implementation. Nostrum defines the `producer` and `producer_consumer` in the GenStage design. To consume the events you must create at least one `...
lib/nostrum/consumer.ex
0.885384
0.760628
consumer.ex
starcoder
defmodule Ecto.Adapters.SQL do @moduledoc """ This application provides functionality for working with SQL databases in `Ecto`. ## Built-in adapters By default, we support the following adapters: * `Ecto.Adapters.Postgres` * `Ecto.Adapters.MySQL` ## Migrations Ecto supports database migration...
lib/ecto/adapters/sql.ex
0.879237
0.566198
sql.ex
starcoder
defmodule Data.Script.Line do @moduledoc """ Lines of the script the NPC converses with """ import Data.Type @enforce_keys [:key, :message] defstruct [:key, :message, :unknown, :trigger, listeners: []] @type t() :: map() @behaviour Ecto.Type @impl Ecto.Type def type, do: :map @impl Ecto.Type...
lib/data/script/line.ex
0.73029
0.412294
line.ex
starcoder
defmodule Phoenix.LiveView do @moduledoc ~S''' LiveView provides rich, real-time user experiences with server-rendered HTML. The LiveView programming model is declarative: instead of saying "once event X happens, change Y on the page", events in LiveView are regular messages which may cause changes to it...
lib/phoenix_live_view.ex
0.848408
0.666921
phoenix_live_view.ex
starcoder
defmodule Ink do @moduledoc """ A backend for the Elixir `Logger` that logs JSON and filters your secrets. ## Usage To use `Ink` for your logging, just configure it as a backend: config :logger, backends: [Ink] # optional additional configuration config :logger, Ink, name: "your ap...
lib/ink.ex
0.849488
0.585457
ink.ex
starcoder
defmodule GrapevineData.Authorizations.Authorization do @moduledoc """ Authorization schema """ use Ecto.Schema import Ecto.Changeset alias GrapevineData.Accounts.User alias GrapevineData.Authorizations.AccessToken alias GrapevineData.Games.Game @type t :: %__MODULE__{} @scopes ["profile", "ema...
apps/data/lib/grapevine_data/authorizations/authorization.ex
0.726717
0.431884
authorization.ex
starcoder
defmodule Hui.Query.FacetRange do @moduledoc """ Struct related to [range faceting](http://lucene.apache.org/solr/guide/faceting.html#range-faceting) query. ### Example iex> x = %Hui.Query.FacetRange{range: "year", gap: "+10YEARS", start: 1700, end: 1799} %Hui.Query.FacetRange{ end: 1799, ...
lib/hui/query/facet_range.ex
0.853562
0.415284
facet_range.ex
starcoder
defmodule AWS.MediaStore do @moduledoc """ An AWS Elemental MediaStore container is a namespace that holds folders and objects. You use a container endpoint to create, read, and delete objects. """ @doc """ Creates a storage container to hold objects. A container is similar to a bucket in the Amazon S3 ...
lib/aws/media_store.ex
0.911682
0.405684
media_store.ex
starcoder
defmodule Day4 do defmodule Game do defstruct [:draws, :boards, :found] end defmodule Board do defstruct [:contents, bingo: false, win: nil, won_at: -1] end defmodule Item do defstruct [:value, state: :unmarked] end def from_input(input) do input |> String.trim() |> String.split...
lib/day4.ex
0.52902
0.599866
day4.ex
starcoder
defmodule Gateway.RateLimit.Sweeper do @moduledoc """ Periodically cleans up the ETS table. By default, the remote IP is considered for rate-limiting, and, consequently, used within the ETS table key. This means that without cleanup, the table would grow quite large very fast. The Sweeper cleans the table...
lib/gateway/rate_limit/sweeper.ex
0.819857
0.441974
sweeper.ex
starcoder
defmodule DBConnection.Ownership do @moduledoc """ A `DBConnection.Pool` that requires explicit checkout and checking as a mechanism to coordinate between processes. ### Options * `:ownership_pool` - The actual pool to use to power the ownership mechanism. The pool is started when the ownership pool...
throwaway/hello/deps/db_connection/lib/db_connection/ownership.ex
0.845273
0.544922
ownership.ex
starcoder
defmodule NebulexRedisAdapter do @moduledoc ~S""" Nebulex adapter for Redis. This adapter is implemented using `Redix`, a Redis driver for Elixir. **NebulexRedisAdapter** provides three setup alternatives: * **Standalone** - The adapter establishes a pool of connections with a single Redis node. The...
lib/nebulex_redis_adapter.ex
0.903031
0.679511
nebulex_redis_adapter.ex
starcoder
defmodule Data.Skill do @moduledoc """ Skill schema """ use Data.Schema import Data.Effect, only: [validate_effects: 1] alias Data.ClassSkill alias Data.Effect schema "skills" do field(:api_id, Ecto.UUID, read_after_writes: true) field(:name, :string) field(:description, :string) fie...
lib/data/skill.ex
0.663887
0.421165
skill.ex
starcoder
defmodule Rayray.Canvas do alias Rayray.Tuple def canvas(w, h) do black = Tuple.color(0, 0, 0) Enum.reduce(0..(w - 1), %{}, fn x, acc -> Map.put( acc, x, Enum.reduce(0..(h - 1), acc, fn y, acc2 -> Map.put(acc2, y, black) end) ) end) end def wi...
lib/rayray/canvas.ex
0.594198
0.53959
canvas.ex
starcoder
defmodule Snek.SmallStaticCycle do @moduledoc false # This test is designed to be static/consistent for profiling/benchmarking. # It is designed to run a solo game for exactly 147 turns (no randomness) alias Snek.Board alias Snek.Board.{Point, Size, Snake} alias Snek.Ruleset.Solo @apple_spawn_chance 0....
test/support/small_static_cycle.ex
0.67854
0.566798
small_static_cycle.ex
starcoder
defmodule D14 do defstruct elem_freq: %{}, pair_freq: %{}, pair_rules: %{} def p1(input) do {template, pair_rules} = parse_input(input) polymer = develop_polymer_naive(template, pair_rules, 10) elem_freq = Enum.frequencies(polymer) Enum.max(Map.values(elem_freq)) - Enum.min(Map.values(elem_freq)) ...
d14/lib/d14.ex
0.527803
0.505981
d14.ex
starcoder
defmodule ErrorInfo do @moduledoc false # The ErrorInfo struct holds all the information about the exception. # It includes the error message, the stacktrace, context information # (information about the request, the current controller and action, # among other things) and custom data depending on the config...
lib/boom_notifier/error_info.ex
0.806052
0.416144
error_info.ex
starcoder
defmodule Nostrum.Struct.Channel do @moduledoc ~S""" Struct representing a Discord guild channel. A `Nostrum.Struct.Channel` represents all 5 types of channels. Each channel has a field `:type` with any of the following values: * `0` - GUILD_TEXT * `1` - DM * `2` - GUILD_VOICE * `3` - GROUP_DM...
lib/nostrum/struct/channel.ex
0.908275
0.74425
channel.ex
starcoder
defmodule Absinthe.Type.Directive do @moduledoc """ Used by the GraphQL runtime as a way of modifying execution behavior. Type system creators will usually not create these directly. """ alias Absinthe.Type use Absinthe.Introspection.Kind @typedoc """ A defined directive. * `:name` - The name o...
lib/absinthe/type/directive.ex
0.860765
0.546496
directive.ex
starcoder
defmodule AdventOfCode2021.Day2 do @moduledoc """ Advent of Code 2021 Day 2 """ @spec part1() :: integer def part1() do "./assets/day2.txt" |> read_commands() |> follow_planned_course() |> multiply_h_pos_by_depth() end @spec read_commands(String.t()) :: [{String.t(), pos_integer}] de...
lib/day2.ex
0.878327
0.49823
day2.ex
starcoder
defmodule Iyzico.Iyzipay do @moduledoc """ A module containing payment related functions. ## Making a payment In order to process a payment, one needs to create a `Iyzico.PaymentRequest` struct, which consists of a payment card, a buyer, two seperate addresses for shipping and billing and basket informa...
lib/endpoint/iyzipay.ex
0.87766
0.778818
iyzipay.ex
starcoder
defmodule EctoIPRange.Util.Range do @moduledoc false use Bitwise, skip_operators: true alias EctoIPRange.Util.Inet @doc """ Create a CIDR (if possible) or range notation for two IPv4 tuples. ## Examples iex> parse_ipv4({1, 2, 3, 4}, {1, 2, 3, 4}) "1.2.3.4/32" iex> parse_ipv4({127, 0,...
lib/ecto_ip_range/util/range.ex
0.727395
0.558628
range.ex
starcoder