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 BSV.Contract.Helpers do @moduledoc """ Base helper module containing helper functions for use in `BSV.Contract` modules. Using `BSV.Contract.Helpers` will import itself and all related helper modules into your context. use BSV.Contract.Helpers Alternative, helper modules can be imported i...
lib/bsv/contract/helpers.ex
0.837753
0.483283
helpers.ex
starcoder
defmodule Timber.Exceptions.Translator do alias Timber.Events.ErrorEvent @moduledoc """ This module implements a Logger translator to take advantage of the richer metadata available from Logger in OTP 21 and Elixir 1.7+. Including the translator allows for crash reasons and stacktraces to be included as s...
lib/timber_exceptions/translator.ex
0.784773
0.72431
translator.ex
starcoder
defmodule ExlasticSearch.Model do @moduledoc """ Base macro for generating elasticsearch modules. Is intended to be used in conjunction with a Ecto model (although that is not strictly necessary). It includes three primary macros: * `indexes/2` * `settings/1` * `mapping/2` The usage is something lik...
lib/exlasticsearch/model.ex
0.855535
0.805594
model.ex
starcoder
defmodule Ecto.Adapters.MySQL do @moduledoc """ Adapter module for MySQL. It handles and pools the connections to the MySQL database using `mariaex` and a connection pool, such as `poolboy`. ## Options MySQL options split in different categories described below. All options should be given via the re...
deps/ecto/lib/ecto/adapters/mysql.ex
0.809728
0.621196
mysql.ex
starcoder
defmodule Phoenix.Token do @moduledoc """ Tokens provide a way to generate and verify bearer tokens for use in Channels or API authentication. The data stored in the token is signed to prevent tampering but not encrypted. This means it is safe to store identification information (such as user IDs) but shou...
lib/phoenix/token.ex
0.913266
0.625896
token.ex
starcoder
defmodule Membrane.AAC.Filler do @moduledoc """ Element that fills gaps in AAC stream with silent frames. """ use Membrane.Filter import Membrane.Caps.Matcher, only: [one_of: 1] alias Membrane.{Buffer, Time} # Silence frame per channel configuration @silent_frames %{ 1 => <<222, 2, 0, 76, 97, 118, ...
lib/membrane/aac/filler.ex
0.852506
0.457076
filler.ex
starcoder
defmodule Octopod do @moduledoc """ This module is the lower-level API for the library. To use the higher-level API, see pyctopod.ex. The way this library works is this: 1. Your elixir application starts a python instance that runs whatever python code 2. That python code will want to send files to other r...
legacy/artie/apps/octopod/lib/octopod.ex
0.858644
0.692915
octopod.ex
starcoder
defmodule Discord.SortedSet.Types do @moduledoc """ This module provides common types that can be used in any part of the SortedSet library. """ @typedoc """ SortedSets are stored in the NIF's memory space, constructing an operating on the SortedSet is done through a reference that uniquely identifies the ...
lib/sorted_set/types.ex
0.910739
0.687761
types.ex
starcoder
defmodule Tonic do @moduledoc """ A DSL for conveniently loading binary data/files. The DSL is designed to closely represent the structure of the actual binary data layout. So it aims to be easy to read, and easy to change. The DSL defines functionality to represent types, endianness, grou...
lib/tonic.ex
0.846498
0.683198
tonic.ex
starcoder
defmodule FrontMatter do @moduledoc """ Parse a file or string containing front matter and a document body. Front matter is a block of yaml wrapped between two lines containing `---`. In this example, the front matter contains `title: Hello` and `tags: x, y, z`, and the body is `Hello, world`: ```md --- ...
lib/front_matter.ex
0.854688
0.853242
front_matter.ex
starcoder
defmodule CsvDemo.Transformer do def in_state(input, output, state \\ "UT") do process(input, output, fn stream -> stream |> Stream.filter(&(&1.state == state)) end) end def registration(input, output) do process(input, output, fn stream -> stream |> Stream.filter( &(&...
csv_demo/lib/csv_demo/transformer.ex
0.592784
0.425665
transformer.ex
starcoder
defmodule AWS.Athena do @moduledoc """ Amazon Athena is an interactive query service that lets you use standard SQL to analyze data directly in Amazon S3. You can point Athena at your data in Amazon S3 and run ad-hoc queries and get results in seconds. Athena is serverless, so there is no infrastructure to s...
lib/aws/generated/athena.ex
0.900024
0.574723
athena.ex
starcoder
defmodule Appsignal.Instrumentation.Decorators do @moduledoc """ Instrumentation decorators This module contains various [function decorators](https://github.com/arjan/decorator) for instrumenting function calls. `@decorate transaction` - when a function decorated like this is called, a transaction is s...
lib/appsignal/instrumentation/decorators.ex
0.858422
0.629362
decorators.ex
starcoder
defmodule Google.Protobuf.DoubleValue do @moduledoc false alias Pbuf.Decoder import Bitwise, only: [bsr: 2, band: 2] @derive Jason.Encoder defstruct [ value: 0.0 ] @type t :: %__MODULE__{ value: number } @spec new(Enum.t) :: t def new(data) do struct(__MODULE__, data) end @spec enc...
lib/protoc/google/protobuf/wrappers.pb.ex
0.839175
0.612744
wrappers.pb.ex
starcoder
defmodule Aoc2017 do @moduledoc false def go(day) do do_day(day) end def do_day(:all, 0) do :done end def do_day(:all, num) do do_day(num) do_day(:all, num-1) end def do_day(:all) do do_day(:all, 25) end def do_day(1) do IO.inspect :day1.part_a, label: "Day 1 part A" I...
lib/aoc2017.ex
0.561455
0.677714
aoc2017.ex
starcoder
defmodule Cashtrail.Entities do @moduledoc """ The Entities context manages the data related to entities. An Entity keeps all financial data of something, that can be a company, financial finances, organization, church, event, etc. And they can have one owner or other members, as well. See `Cashtrail.Entit...
apps/cashtrail/lib/cashtrail/entities.ex
0.81372
0.480722
entities.ex
starcoder
defmodule Game.Map do @moduledoc """ Map out a zone """ alias Data.Exit @doc """ Find the coordinates for each room in a zone and the size of the zone 1,1 is top left """ @spec size_of_map(Zone.t(), integer) :: {{integer, integer}, {integer, integer}, [{{integer, integer}, Room.t()}]} d...
lib/game/map.ex
0.80969
0.654757
map.ex
starcoder
defmodule AsNestedSet.Modifiable do @type position :: :left | :right | :child | :parent import Ecto.Query import AsNestedSet.Helper @spec create(AsNestedSet.t, AsNestedSet.t, position) :: AsNestedSet.executable def create(new_model, target \\ nil, position) when is_atom(position) do fn repo -> ca...
lib/as_nested_set/modifiable.ex
0.67854
0.42913
modifiable.ex
starcoder
defmodule Date.Range do @moduledoc """ Returns an inclusive range between dates. Ranges must be created with the `Date.range/2` or `Date.range/3` function. The following fields are public: * `:first` - the initial date on the range * `:last` - the last date on the range * `:step` - (since v1.12.0...
lib/elixir/lib/calendar/date_range.ex
0.870735
0.688128
date_range.ex
starcoder
defmodule Chaperon.Scenario.Metrics do @moduledoc """ This module calculates histogram data for a session's metrics. It uses the `Histogrex` library to calculate the histograms. """ use Histogrex alias __MODULE__ alias Chaperon.Session template(:durations, min: 1, max: 10_000_000, precision: 3) @ty...
lib/chaperon/scenario/metrics.ex
0.900662
0.512449
metrics.ex
starcoder
defmodule Assoc.Schema do @moduledoc """ ## Usage ``` defmodule MyApp.User do use MyApp.Schema use Assoc.Schema, repo: MyApp.Repo schema "users" do field :email, :string field :name, :string has_many :user_roles, MyApp.UserRole, on_delete: :delete_all, on_replace: :delete t...
lib/assoc/schema.ex
0.812756
0.714616
schema.ex
starcoder
defmodule Freddy.Publisher do @moduledoc """ A behaviour module for implementing AMQP publisher processes. The `Freddy.Publisher` module provides a way to create processes that holds, monitors, and restarts a channel in case of failure, exports a function to publish messages to an exchange, and some callback...
lib/freddy/publisher.ex
0.925331
0.557544
publisher.ex
starcoder
defmodule Talib.SMMA do alias Talib.SMA @moduledoc ~S""" Defines a Smoothed Moving Average. ## History Version: 1.0 Source: http://www2.wealth-lab.com/WL5Wiki/SMMA.ashx Audited by: | Name | Title | | :----------- | :---------------- | | | | ...
lib/talib/smma.ex
0.907022
0.662935
smma.ex
starcoder
defmodule EdgeDB.RelativeDuration do @moduledoc """ An immutable value represeting an EdgeDB `cal::relative_duration` value. ```elixir iex(1)> {:ok, pid} = EdgeDB.start_link() iex(2)> EdgeDB.query_required_single!(pid, "SELECT <cal::relative_duration>'45.6 seconds'") #EdgeDB.RelativeDuration<"PT45.6S"> `...
lib/edgedb/types/relative_duration.ex
0.848015
0.665774
relative_duration.ex
starcoder
defmodule Oban.Plugins.Stager do @moduledoc """ Transition jobs to the `available` state when they reach their scheduled time. This module is necessary for the execution of scheduled and retryable jobs. ## Options * `:interval` - the number of milliseconds between database updates. This is directly tied to...
lib/oban/plugins/stager.ex
0.849066
0.560132
stager.ex
starcoder
defmodule Ok do @moduledoc """ Ok provides functions for handling and returning `{:ok, term}` tuples, especially within the context of a pipe chain. """ @type ok :: {:ok, term} @type error :: {:error, term} @type result :: ok | error @doc """ Takes a value and wraps it in an ok tuple. """ @spec ...
apps/ok/lib/ok.ex
0.881838
0.70092
ok.ex
starcoder
defmodule Parser do def parse(tokens) do {ast, _} = compound_stmt(tokens) ast end def compound_stmt(tokens, statements \\ []) do {statement, rest} = stmt(tokens) # NOTE that this is putting statements into the statement list in REVERSE order statements = Enum.reverse([statement | Enum.reverse...
lib/parser.ex
0.602529
0.650148
parser.ex
starcoder
defmodule ExRabbitMQ.Consumer do @moduledoc """ A behaviour module that abstracts away the handling of RabbitMQ connections and channels. It abstracts the handling of message delivery and acknowlegement. It also provides hooks to allow the programmer to wrap the consumption of a message without having to dire...
lib/ex_rabbit_m_q/consumer.ex
0.866951
0.851891
consumer.ex
starcoder
defmodule ISO8583.Utils do @moduledoc false def slice(payload, lower, upper) when byte_size(payload) > lower and upper < 0 do <<lower_part::binary-size(lower), upper_part::binary>> = payload {:ok, lower_part, upper_part} end def slice(payload, lower, upper) when byte_size(payload) >= upper do lowe...
lib/iso_8583/utils/utils.ex
0.666171
0.509581
utils.ex
starcoder
defmodule Ecto.Adapters.Worker do @moduledoc """ Defines a worker to be used by adapters. The worker is responsible for managing the connection to the database, automatically starting a new one if it crashes. The `ask/2` and `ask!/2` functions can be used any time to retrieve the connection and its module....
lib/ecto/adapters/worker.ex
0.848878
0.60711
worker.ex
starcoder
require Graph defmodule Utils do def to_ints(string), do: string |> to_strings |> Enum.map(&to_int/1) def to_int([single_string]), do: to_int(single_string) def to_int(string) do string |> Integer.parse() |> elem(0) end def to_strings([single_string]), do: to_strings(single_string) def to_st...
lib/utils.ex
0.522689
0.647603
utils.ex
starcoder
defmodule GGity.Geom.Line do @moduledoc false alias GGity.{Draw, Geom, Plot} @type t() :: %__MODULE__{} @type plot() :: %GGity.Plot{} @type record() :: map() @type mapping() :: map() @linetype_specs %{ solid: "", dashed: "4", dotted: "1", longdash: "6 2", dotdash: "1 2 3 2", two...
lib/ggity/geom/line.ex
0.826747
0.620679
line.ex
starcoder
defmodule Scidata.FashionMNIST do alias Scidata.Utils @default_data_path "tmp/fashionmnist" @base_url 'http://fashion-mnist.s3-website.eu-central-1.amazonaws.com/' @image_file 'train-images-idx3-ubyte.gz' @label_file 'train-labels-idx1-ubyte.gz' defp download_images(opts) do data_path = opts[:data_pat...
lib/fashionmnist.ex
0.59749
0.606528
fashionmnist.ex
starcoder
defmodule Unpoly do @moduledoc """ A Plug adapter and helpers for Unpoly, the unobtrusive JavaScript framework. ## Options * `:cookie_name` - the cookie name where the request method is echoed to. Defaults to `"_up_method"`. * `:cookie_opts` - additional options to pass to method cookie. See `Plu...
lib/unpoly.ex
0.870721
0.644225
unpoly.ex
starcoder
defmodule ExTweet.Parser.Tweet do defstruct [:id, :datetime, :username, :user_id, :text, :url, :links] @multiple_space_regex Regex.compile!(~S(\s{1,}), [:caseless, :unicode]) @type t :: %__MODULE__{ id: integer(), user_id: integer(), datetime: DateTime.t(), username: Stri...
lib/ex_tweet/parser/tweet.ex
0.6488
0.450359
tweet.ex
starcoder
alias Graphqexl.Query alias Graphqexl.Schema alias Graphqexl.Schema.{ Dsl, Interface, Mutation, Query, Subscription, TEnum, Type, Union, } alias Graphqexl.Tokens alias Treex.Tree defmodule Graphqexl.Schema do @moduledoc """ Structured representation of a GraphQL schema, either built dynamically or ...
lib/graphqexl/schema.ex
0.778481
0.515437
schema.ex
starcoder
defmodule SigilF do @moduledoc """ This module provides `sigil_f/2` macro that generates formatting function out of the format string passed as the argument, ex.: iex> import SigilF iex> func = ~f(~.3f) iex> func.(3.14159) "3.142" For supported format check out `:io.fwrite/2`. """ ...
lib/sigil_f.ex
0.643777
0.462959
sigil_f.ex
starcoder
defmodule ColorContrast do @moduledoc ColorContrast.MixProject.project()[:description] @brightness_threshold 130 @black_hex "#000000" @white_hex "#FFFFFF" @doc """ Calculates the contrast with a background color. ## Examples Accept a color value in different hex formats. iex> ColorContrast.ca...
lib/color_contrast.ex
0.916661
0.437583
color_contrast.ex
starcoder
defmodule Fastimage.Error do @moduledoc """ Representations of various errors potentially returned by Fastimage. Types of errors which may occur include: - Function execution for unsupported image types eg .tiff - Errors occurring during streaming - Errors emanating from the :hackney library, eg an atte...
lib/fastimage/errors.ex
0.838663
0.604516
errors.ex
starcoder
defmodule Type.Tuple do @moduledoc """ represents tuple types. The associated struct has one parameter: - `:elements` which may be a list of types, corresponding to the ordered list of tuple element types. May also be the atom `:any` which corresponds to the any tuple. ### Examples: - the any t...
lib/type/tuple.ex
0.880463
0.897201
tuple.ex
starcoder
defmodule Plymio.Funcio.Enum.ValueAt do @moduledoc ~S""" Functions for Specific Values in an Enum. See `Plymio.Funcio` for overview and other documentation terms. ## Documentation Terms In the documentation below these terms, usually in *italics*, are used to mean the same thing. ### *index*, *indices* ...
lib/funcio/enum/value_at/value_at.ex
0.857768
0.499207
value_at.ex
starcoder
defmodule BoggleEngine.Board do @moduledoc """ Functions to create and interact with Boggle board. """ alias BoggleEngine.Board alias BoggleEngine.Board.DiceSet alias BoggleEngine.Neighbor alias BoggleEngine.Utilities @boggle_set "../../resource/boggle.txt" |> Path.expand(__DIR__) |> DiceSet.from_file...
lib/boggle_engine/board.ex
0.890288
0.581125
board.ex
starcoder
defmodule Coxir.Storage.Default do @moduledoc """ Stores models in ETS. """ use Coxir.Storage use GenServer @server __MODULE__ @table __MODULE__ def start_link(state) do GenServer.start_link(__MODULE__, state, name: @server) end def init(state) do :ets.new(@table, [:named_table, :protecte...
lib/coxir/adapters/storage/default.ex
0.641198
0.414958
default.ex
starcoder
defmodule PartitionSupervisor do @moduledoc """ A supervisor that starts multiple partitions of the same child. Certain processes may become bottlenecks in large systems. If those processes can have their state trivially partitioned, in a way there is no dependency between them, then they can use the `Part...
lib/elixir/lib/partition_supervisor.ex
0.923575
0.778565
partition_supervisor.ex
starcoder
defmodule Numeracy.Precision do @moduledoc """ Algorithms for computing different measures of precision """ import Numeracy.BasicMath @scales [1.25, 2, 2.5, 4, 5, 7.5, 8, 10] @semi_integer_scales [2, 2.5, 4, 5, 7.5, 8, 10] @integer_scales [2, 4, 5, 8, 10] @doc """ Radix - the base that your compute...
lib/numeracy/precision.ex
0.832066
0.738363
precision.ex
starcoder
defmodule StateServer do @moduledoc """ The StateServer is a module you can use in your modules to implement a simple GenServer without the need of writting all that GenServer's boilerplate.any() ### Example defmodule MyModule do # make this module a GenServer and import some macros to define c...
lib/state_server.ex
0.734215
0.628194
state_server.ex
starcoder
defmodule Deck do @moduledoc """ Get, shuffle and deal a deck of playing cards of any size (from 4 to 52 cards). """ import Deck.Guards, only: [is_valid_number_of_cards: 1] # T = 10, J = Jack, Q = Queen, K = King, A = Ace @ranks ~w[2 3 4 5 6 7 8 9 T J Q K A] # Clubs, diamonds, hearts, spades @suits ~...
lib/deck.ex
0.879509
0.511717
deck.ex
starcoder
defmodule TrainLoc.Vehicles.Validator do @moduledoc """ Intended to validate the expected data ranges and expected values that a vehicle is allowed to have. """ alias TrainLoc.Vehicles.Vehicle @default_error {:error, :invalid_vehicle} @block_trip_min_length 3 @doc """ Validates a vehicles to ensure ...
apps/train_loc/lib/train_loc/vehicles/validator.ex
0.792825
0.922622
validator.ex
starcoder
defmodule Paasaa do @moduledoc """ Detects language by analyzing symbol patterns and trigram occurrence in a string. """ @script_expressions Paasaa.Data.fetch_script_expressions!() @trigrams Paasaa.Data.fetch_trigrams!() @languages Paasaa.Data.fetch_languages!() @max_difference 300 @type options ::...
lib/paasaa.ex
0.902473
0.605653
paasaa.ex
starcoder
defmodule ClusterYASD.Strategy do @moduledoc """ YASD Strategy for libcluster. Use this module as strategy in your libcluster topologies. ```elixir topologies = [ my_yasd: [ strategy: ClusterYASD.Strategy, config: [ base_url: "http://yaasd:4001", application_name: :my_app, ...
lib/cluster_yasd/strategy.ex
0.645902
0.657975
strategy.ex
starcoder
defmodule DSMR.Combinators do @moduledoc false import NimbleParsec @separator [?\r, ?\n] def separator do empty() |> utf8_char([Enum.at(@separator, 0)]) |> utf8_char([Enum.at(@separator, 1)]) |> label("separator") end @left_parens [?(] def left_paren do utf8_char(@left_parens) |...
lib/dsmr/combinators.ex
0.556641
0.422386
combinators.ex
starcoder
defmodule Riak.Object do @moduledoc """ The Data wrapper makes it convenient to work with Riak data in Elixir """ @doc """ Struct representing a Riak Object. Attributes: * `type`: String; Bucket Type with a unique name within the cluster namespace * `bucket`: String; Bucket with a unique name within the ...
lib/riak/object.ex
0.680242
0.445891
object.ex
starcoder
defmodule Phone do @digits Enum.map(?2..?9, &<<&1>>) defguard is_digits(country_code \\ "1", area_code, phone_number) when country_code == "1" and area_code in @digits and phone_number in @digits @doc """ Remove formatting from a phone number. Returns "0000000000" if phone number is not valid ...
elixir/phone-number/lib/phone.ex
0.59302
0.432723
phone.ex
starcoder
defmodule Cognixir.ComputerVision.AnalyzeOptions do @moduledoc """ Options for function analyze_image. See official api doc for supported options. ## Keys - visualFeatures: list of strings, comma separated - details: list of strings, comma separated - language: which language to return """ defstruct vi...
lib/computer_vision.ex
0.879639
0.533944
computer_vision.ex
starcoder
defmodule PhoenixIntegration.Form.TreeEdit do @moduledoc false # Once a tree of `Tag` structures has been created, the values contained # within it can be overridden by leaves of a different tree provided by # test. alias PhoenixIntegration.Form.{Change, Tag, Common} defstruct valid?: :true, tree: %{}, err...
lib/phoenix_integration/form/tree_edit.ex
0.755997
0.485295
tree_edit.ex
starcoder
defmodule ArtemisWeb.ViewHelper.Numbers do import Phoenix.HTML.Tag @doc """ Returns the sign of a given number. Returns: :positive :zero :negative """ def number_sign(value) when is_number(value) do cond do value > 0 -> :positive value < 0 -> :negative true -> :zero ...
apps/artemis_web/lib/artemis_web/view_helpers/numbers.ex
0.844361
0.650724
numbers.ex
starcoder
defmodule Mix.Tasks.Docs do use Mix.Task @shortdoc "Generate documentation for the project" @moduledoc ~S""" Uses ExDoc to generate a static web page from the project documentation. ## Command line options * `--canonical`, `-n` - Indicate the preferred URL with rel="canonical" link element, defa...
lib/mix/tasks/docs.ex
0.889373
0.715772
docs.ex
starcoder
defmodule Timex.Parse.DateTime.Helpers do @moduledoc false import Combine.Parsers.Base import Combine.Parsers.Text, except: [integer: 0, integer: 1] alias Combine.Parsers.Text use Timex.Constants def months, do: @month_names def to_month(month) when is_integer(month), do: [month: month] def to_month_...
lib/parse/datetime/helpers.ex
0.550124
0.503235
helpers.ex
starcoder
defmodule Dispenser.MonitoredBuffer do @moduledoc """ A `MonitoredBuffer` contains most of the logic required to implement a `GenServer` that wraps a `Buffer`. `MonitoredBuffer` combines a `Buffer` to track events and a `SubscriptionManager` to track subscribers. """ alias Dispenser.Buffer alias Dispenser....
lib/dispenser/monitored_buffer.ex
0.869216
0.583322
monitored_buffer.ex
starcoder
defmodule Ueberauth.Strategy.Quickbooks do @moduledoc """ Implements an ÜeberauthQuickbooks strategy for authentication with quickbooks.com. When configuring the strategy in the Üeberauth providers, you can specify some defaults. * `oauth2_module` - The OAuth2 module to use. Default Ueberauth.Strategy.Quickbo...
lib/ueberauth/strategy/quickbooks.ex
0.740268
0.483039
quickbooks.ex
starcoder
defmodule Surface.Components.Markdown do @moduledoc """ A simple macro component that converts **markdown** into **HTML** at compile-time. ## Global configuration (optional) A set of global options you can set in `config.exs`. Available options are: * `default_class` - The default CSS class for the wrapp...
lib/surface/components/markdown.ex
0.892868
0.767994
markdown.ex
starcoder
import Kernel, except: [round: 1] defmodule Float do @moduledoc """ Functions for working with floating point numbers. """ import Bitwise @power_of_2_to_52 4503599627370496 @doc """ Parses a binary into a float. If successful, returns a tuple in the form of `{float, remainder_of_binary}`; when th...
lib/elixir/lib/float.ex
0.927571
0.645825
float.ex
starcoder
defmodule Phoenix.Slack do @moduledoc """ The main feature provided by this module is the ability to set the HTML and/or text body of an message by rendering templates. It has been designed to integrate with Phoenix view, template and layout system. """ import Phoenix.Slack.ChannelMessage defmacro __u...
lib/phoenix_slack.ex
0.91442
0.439988
phoenix_slack.ex
starcoder
defmodule Livebook.Notebook.Explore do @moduledoc false defmodule NotFoundError do @moduledoc false defexception [:slug, plug_status: 404] def message(%{slug: slug}) do "could not find an example notebook matching #{inspect(slug)}" end end @type notebook_info :: %{ ref: atom(...
lib/livebook/notebook/explore.ex
0.798226
0.516535
explore.ex
starcoder
defmodule Port do @moduledoc ~S""" Functions for interacting with the external world through ports. Ports provide a mechanism to start operating system processes external to the Erlang VM and communicate with them via message passing. ## Example iex> port = Port.open({:spawn, "cat"}, [:binary]) ...
lib/elixir/lib/port.ex
0.902008
0.603494
port.ex
starcoder
defmodule Membrane.Core.Element.DemandHandler do @moduledoc false # Module handling demands requested on output pads. use Bunch alias Membrane.Core.InputBuffer alias Membrane.Core.Child.PadModel alias Membrane.Core.Element.{ BufferController, CapsController, DemandController, EventContro...
lib/membrane/core/element/demand_handler.ex
0.837753
0.522811
demand_handler.ex
starcoder
if Code.ensure_loaded?(Plug.Router) do defmodule PromEx.Plugins.PlugRouter do @moduledoc """ This plugin captures HTTP request metrics emitted by `Plug.Router` and `Plug.Telemetry`. This plugin is heavily inspired on plugin `Plug.Cowboy`, and exposes the following metric group: - `:plug_router_http_...
lib/prom_ex/plugins/plug_router.ex
0.908056
0.69601
plug_router.ex
starcoder
defmodule Nerves.Firmware.Fwup do use GenServer require Logger @moduledoc """ A Port interface to stream firmware to fwup Caller process will receive the following messages: * `{:fwup, :ok}`: firmware upgrade succesfully * `{:fwup, {:progress, integer()}}`: firmware upgrade progress (percentage) * `{:...
lib/firmware/fwup.ex
0.821653
0.585101
fwup.ex
starcoder
defmodule Elasticfusion.Search.Lexer do @moduledoc """ This module exposes functions for lexical scanning operations on a string. State tracking is explicit: functions receieve a state and return a tuple of {match, new_state}. Initial state is set up through `initialize/1`. All functions match the beginnin...
lib/elasticfusion/search/lexer.ex
0.802865
0.611498
lexer.ex
starcoder
defmodule Vnu do @moduledoc "General purpose validation functions for HTML, CSS, and SVG documents." alias Vnu.{Error, Result, Validator} @doc ~S""" Validates the given HTML document. Returns `{:ok, %Vnu.Result{}}` if the validation process finished successfully, and `{:error, %Vnu.Error{}}` otherwise. N...
lib/vnu.ex
0.89957
0.485722
vnu.ex
starcoder
defmodule Circuits.GPIO.Chip do @moduledoc """ Control GPIOs using the GPIO chip interface With the character device driver for GPIOs there three concepts to learn. First, the API is made up of chips and lines that are grouped together for that chip. A chip is more of a grouping identifier than anything phy...
lib/chip.ex
0.888686
0.923558
chip.ex
starcoder
defmodule Thrift.AST do @moduledoc """ Thrift Abstract Syntax Tree Parsed Thrift files are repesented as a tree of these structures, starting with a `Thrift.AST.Schema` node. """ import Thrift.Parser.Conversions alias Thrift.Parser.{Literals, Types} defmodule Namespace do @moduledoc false @ty...
lib/thrift/ast.ex
0.840062
0.424949
ast.ex
starcoder
defmodule Mix.Tasks.PhxUp.Gen.ControllerViewTemplate do @shortdoc "Generate a controller, view and template (for each action) and tests" @moduledoc """ Generate a controller, view, templates (for each action) and tests. mix phx_up.gen.controller_view_template Post create update index find or mix ...
lib/mix/tasks/phx_up.gen.controller_view_template.ex
0.716318
0.415907
phx_up.gen.controller_view_template.ex
starcoder
defmodule ThumborClient.UrlBuilder do @moduledoc """ Module to build url with params """ @doc """ Get full path image passing options. """ def full_path(options) do [] |> trim(options) |> crop(options) |> meta(options) |> fit_in(options) |> sizes(options) |> align(options, :ha...
lib/thumbor_client_url_builder.ex
0.888931
0.401189
thumbor_client_url_builder.ex
starcoder
defmodule NeuralNet.Constructor do @moduledoc "Contains the nuts and bolts for constructing the network in the process dictionary. These functions are use by the NeuralNet.Helpers module." defp key, do: :network_defs def put_neural_net(net), do: Process.put(key, net) def get_neural_net(), do: Process.get(key, ...
lib/neural_net/constructor.ex
0.721351
0.561906
constructor.ex
starcoder
defmodule GatewayService do @moduledoc """ The GatewayService is an OTP GenServer which gets intitialized with a Gateway-implementation and is responsible to keep the state of the Gateway across the application. """ use GenServer # Client API @doc """ Start a Gateway service #### Example: ...
lib/gateways/service.ex
0.807688
0.418786
service.ex
starcoder
defmodule CyberSourceSDK.Client do @moduledoc """ This Client module handle all HTTPS requests to the CyberSource server. It takes some parameters and convert to HTTPS requests. It support the following payments: * Android Pay * Apple Pay It supports the following requests: * Authorization * Capture...
lib/cybersource-sdk/client.ex
0.873377
0.725746
client.ex
starcoder
defmodule Janus.Graph do @moduledoc """ Reverse, Preorder, Directed Graph Traversal from a given starting point with an accumulating behaviour. *Reverse* because this traverses in the opposite direction the edges are pointing. *Preorder*, the depth-first tree traversal strategy. Primarily used in conjun...
lib/janus/graph.ex
0.669853
0.526586
graph.ex
starcoder
defmodule Janus.Transport.WS.Adapter do @moduledoc """ This module specifies the behaviour for adapter modules communicating `Janus.Transport.WS` module with lower level WebSocket client (e.g. `:websockex`). An adapter is responsible for sending and passing WebSocket frames and notifying about connection's sta...
lib/adapters/adapter.ex
0.876449
0.698458
adapter.ex
starcoder
defmodule Sublocator do @moduledoc """ An Elixir library for identifying the location(s) of a pattern in a given string. Using `Sublocator.locate/3`, the pattern can be a string, a list of strings, or a regular expression, and the result is a list of simple line and column data or an empty list. Multiline...
lib/sublocator.ex
0.916862
0.62157
sublocator.ex
starcoder
defmodule Nostrum.Struct.Embed do @moduledoc ~S""" Functions that work on Discord embeds. ## Building Embeds `Nostrum.Struct.Embed`s can be built using this module's builder functions or standard `Map` syntax: ```Elixir iex> import Nostrum.Struct.Embed ...> embed = ...> %Nostrum.Struct.Embed{} ...
lib/nostrum/struct/embed.ex
0.907349
0.773195
embed.ex
starcoder
defmodule CsvGenerator do @moduledoc File.read!("README.md") @types [:string, :integer, :float, :date, :datetime, :time] defmacro __using__(_options) do quote do Module.register_attribute(__MODULE__, :columns, accumulate: true, persist: false) Module.register_attribute(__MODULE__, :delimiter, ac...
lib/csv_generator.ex
0.837753
0.447158
csv_generator.ex
starcoder
defmodule Beeline.Appsignal do @moduledoc """ an Appsignal exporter for Beeline telemetry This exporter works by attaching a telemetry handler. This means that the code to set the gauge runs in the process of the HealthChecker. Attach this exporter by adding this task to a supervision tree, for example th...
lib/beeline/appsignal.ex
0.856107
0.746486
appsignal.ex
starcoder
defmodule Gullintanni.MergeRequest do @moduledoc """ Defines a merge request. """ alias __MODULE__, as: MergeRequest @typedoc "A merge request identifier" @type id :: pos_integer @typedoc "A 40 character SHA-1 hash" @type sha :: String.t @typedoc "Supported merge request states" @type state :: :...
apps/gullintanni/lib/gullintanni/merge_request.ex
0.819857
0.473231
merge_request.ex
starcoder
defmodule Geometry do @moduledoc """ A set of geometry types for WKT/WKB and GeoJson. """ alias Geometry.{ Feature, FeatureCollection, GeoJson, GeometryCollection, GeometryCollectionM, GeometryCollectionZ, GeometryCollectionZM, LineString, LineStringM, LineStringZ, L...
lib/geometry.ex
0.938597
0.64586
geometry.ex
starcoder
defmodule Elsa.Consumer.Worker do @moduledoc """ Defines the worker GenServer that is managed by the DynamicSupervisor. Workers are instantiated and assigned to a specific topic/partition and process messages according to the specified message handler module passed in from the manager before calling the ack f...
lib/elsa/consumer/worker.ex
0.682679
0.406126
worker.ex
starcoder
defmodule Bolt.Cogs.GateKeeper.OnJoin do @moduledoc false @behaviour Nosedrum.Command alias Bolt.Cogs.GateKeeper.Actions alias Bolt.Converters alias Bolt.Gatekeeper alias Bolt.Schema.JoinAction alias Bolt.{ErrorFormatters, ModLog, Repo} alias Nosedrum.Predicates alias Nostrum.Api alias Nostrum.Stru...
lib/bolt/cogs/gatekeeper/onjoin.ex
0.819605
0.656569
onjoin.ex
starcoder
defmodule GGity.Geom.Point do @moduledoc false alias GGity.{Draw, Geom, Plot} @type t() :: %__MODULE__{} @type plot() :: %Plot{} @type record() :: map() @type mapping() :: map() defstruct data: nil, mapping: nil, stat: :identity, position: :identity, key_...
lib/ggity/geom/point.ex
0.858392
0.617513
point.ex
starcoder
defmodule Ecto.Adapters.SQL.Connection do @moduledoc """ Specifies the behaviour to be implemented by SQL pooled connections. """ use Behaviour @doc """ Connects to the underlying database. Should return a process which is linked to the caller process or an error. """ defcallback connect(Keyword....
lib/ecto/adapters/sql/connection.ex
0.889879
0.550245
connection.ex
starcoder
defmodule DataLogger.Destination do @moduledoc """ A behaviour, representing a destination for data logging. The mandatory callback to implement is `DataLogger.Destination.send_data/3`. An implementation should handle errors and retries by using the optional callbacks `DataLogger.Destination.on_error/4` or/a...
lib/data_logger/destination.ex
0.866839
0.564068
destination.ex
starcoder
defmodule AWS.CodeGuruProfiler do @moduledoc """ This section provides documentation for the Amazon CodeGuru Profiler API operations. Amazon CodeGuru Profiler collects runtime performance data from your live applications, and provides recommendations that can help you fine-tune your application performanc...
lib/aws/generated/code_guru_profiler.ex
0.81772
0.417687
code_guru_profiler.ex
starcoder
defmodule AWS.ResourceGroups do @moduledoc """ AWS Resource Groups AWS Resource Groups lets you organize AWS resources such as Amazon EC2 instances, Amazon Relational Database Service databases, and Amazon S3 buckets into groups using criteria that you define as tags. A resource group is a collection of ...
lib/aws/generated/resource_groups.ex
0.874573
0.473414
resource_groups.ex
starcoder
defmodule Goth.Backoff do @moduledoc false alias Goth.Backoff @default_type :rand_exp @min 1_000 @max 30_000 defstruct [:type, :min, :max, :state] def new(opts) do case Keyword.get(opts, :backoff_type, @default_type) do :stop -> nil type -> {min, max} = min_max(opts) ...
lib/goth/backoff.ex
0.738669
0.476214
backoff.ex
starcoder
defmodule Commanded.Registration do @moduledoc """ Defines a behaviour for a process registry to be used by Commanded. By default, Commanded will use a local process registry, defined in `Commanded.Registration.LocalRegistry`, that uses Elixir's `Registry` module for local process registration. This limits C...
lib/commanded/registration/registration.ex
0.868367
0.454291
registration.ex
starcoder
defmodule Advent.Y2021.D20 do @moduledoc """ https://adventofcode.com/2021/day/20 """ use Bitwise @typep point :: {integer(), integer()} @typep pixel :: 0 | 1 @typep image :: %{point() => pixel()} @typep lookup :: 0..511 @typep algorithm_int :: non_neg_integer() @typep algorithm_map :: %{lookup() ...
lib/advent/y2021/d20.ex
0.708918
0.583352
d20.ex
starcoder
defmodule Conrex.CONREC do @moduledoc false # values is a 2d array of "heights"; contour_levels a list of height values to contour at def conrec(values, x_coords, y_coords, contour_levels) do Enum.reduce(contour_levels, %{}, fn contour_level, contours -> # iterate over each cell of 2x2 coordinates ...
lib/conrex/conrec.ex
0.757166
0.760028
conrec.ex
starcoder
defmodule StripJs do @moduledoc ~S""" StripJs is an Elixir module for stripping executable JavaScript from blocks of HTML and CSS, based on the <a target=_blank href="https://github.com/philss/floki">Floki</a> parsing library. It handles: * `<script>...</script>` and `<script src="..."></script>` tags *...
lib/strip_js.ex
0.802981
0.423518
strip_js.ex
starcoder
defmodule Akd do @moduledoc """ A framework that makes elixir deployments a breeze. It's highly configurable, yet easy to set up. Although Akd is mainly written for deploying elixir apps, it can be used for any server automation process or deploying non-elixir apps. Akd comes with DSL which make writing a...
lib/akd.ex
0.88639
0.579728
akd.ex
starcoder
defmodule HPAX.Table do @moduledoc false defstruct [ :max_table_size, entries: [], size: 0, length: 0 ] @type t() :: %__MODULE__{ max_table_size: non_neg_integer(), entries: [{binary(), binary()}], size: non_neg_integer(), length: non_neg_integer() ...
lib/hpax/table.ex
0.880912
0.622172
table.ex
starcoder
defmodule SSHKit do @moduledoc """ A toolkit for performing tasks on one or more servers. ``` hosts = ["1.eg.io", {"2.eg.io", port: 2222}] hosts = [%SSHKit.Host{name: "3.eg.io", options: [port: 2223]} | hosts] context = SSHKit.context(hosts) |> SSHKit.path("/var/www/phx") |> SSHKit.user("deplo...
lib/sshkit.ex
0.901407
0.795062
sshkit.ex
starcoder