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 BinFormat do
alias BinFormat.Defines, as: Defines
defmacro __using__(_opts) do
quote do
import BinFormat
end
end
@doc """
Defines the structure of the format.
The format is defined by calling field type macros in the order that the
fields appear in the packet. The standard field... | lib/bin_format.ex | 0.824179 | 0.919462 | bin_format.ex | starcoder |
defmodule GraphTh.Digraph do
@moduledoc """
GraphTh.Digraph is a directed graph.
"""
defstruct arcs: %{}
@doc """
Generate an empty directed graph.
## Examples
iex> GraphTh.Digraph.empty()
%GraphTh.Digraph{arcs: %{}}
"""
def empty() do
%GraphTh.Digraph{arcs: %{}}
end
@doc """
Re... | lib/graph_th/digraph.ex | 0.933058 | 0.711071 | digraph.ex | starcoder |
defmodule Brex do
@moduledoc """
*A [Specification Pattern](https://en.wikipedia.org/wiki/Specification_pattern)
implementation in Elixir.*
Using `brex` you can easily
- __define__
- __compose__ and
- __evaluate__
business rules to dynamically drive the flow of your application.
# Basics
The lo... | lib/brex.ex | 0.912214 | 0.609728 | brex.ex | starcoder |
defmodule MrRoboto.Parser do
@moduledoc """
This is the Parser Module. The functions here handle the transformation of a `robots.txt` file into `MrRoboto.Rules` structs.
"""
alias MrRoboto.Rules
@doc """
Starts parsing the `body`
Returns a list of `MrRobot.Rules` structs
## Examples
iex> body ... | lib/mr_roboto/parser.ex | 0.842475 | 0.489259 | parser.ex | starcoder |
defmodule DataMorph do
@moduledoc ~S"""
Create Elixir structs, maps with atom keys, and keyword lists from CSV/TSV
data.
Note, we should never convert user input to atoms. This is because atoms are
not garbage collected. Once an atom is created, it is never reclaimed.
Generating atoms from user input woul... | lib/data_morph.ex | 0.915536 | 0.557062 | data_morph.ex | starcoder |
defmodule Wobserver2.Web.ClientSocket do
@moduledoc ~S"""
Low level WebSocket handler
Connects to the Javascript websocket and parses all requests.
Example:
```elixir
defmodule Wobserver2.Web.Client do
use Wobserver2.Web.ClientSocket
alias Wobserver2.System
def client_init do
... | lib/wobserver2/web/client_socket.ex | 0.902927 | 0.513973 | client_socket.ex | starcoder |
defmodule Absinthe.Type.Scalar do
@moduledoc """
Represents a primitive value.
GraphQL responses take the form of a hierarchical tree; the leaves on these
trees are scalars.
Also see `Absinthe.Type.Object`.
## Built-In Scalars
The following built-in scalar types are defined:
* `:boolean` - Represen... | lib/absinthe/type/scalar.ex | 0.952772 | 0.951414 | scalar.ex | starcoder |
defmodule ExKeyCDN.Util do
@moduledoc """
General purpose utility functions.
"""
@doc """
Converts hyphenated values to underscore delimited strings.
## Examples
iex> ExKeyCDN.Util.underscorize("key-cdn")
"key_cdn"
iex> ExKeyCDN.Util.underscorize(:"key-cdn")
"key_cdn"
"""
@sp... | lib/util.ex | 0.847511 | 0.430327 | util.ex | starcoder |
defmodule Fuentes.Entry do
@moduledoc """
Entries are the recording of account debits and credits and can be considered
as consituting a traditional accounting Journal.
"""
@type t :: %__MODULE__{
description: String.t,
date: Ecto.Date.t
}
alias Fuentes.{ Amount, Entry }
use Ecto.Schema
imp... | lib/fuentes/entry.ex | 0.758108 | 0.480905 | entry.ex | starcoder |
defmodule GlobalSupervisor do
@moduledoc """
A supervisor that dynamically distributes children across the cluster.
A `GlobalSupervisor` is like a `DynamicSupervisor` that coordinates with other
GlobalSupervisors registered with the same name in the cluster to dynamically
distribute children across the clust... | lib/global_supervisor.ex | 0.871543 | 0.634628 | global_supervisor.ex | starcoder |
defmodule Axon.Updates do
@moduledoc ~S"""
Parameter update methods.
Update methods transform the input tensor in some way,
usually by scaling or shifting the input with respect
to some input state. Update methods are composed
to create more advanced optimization methods such as AdaGrad
or Adam. Each upd... | lib/axon/updates.ex | 0.939651 | 0.746693 | updates.ex | starcoder |
defmodule Genex do
alias Genex.Types.{Chromosome, Population}
@moduledoc """
Genex makes it easy to write Evolutionary Algorithms in Elixir.
The process of creating an algorithm in Genex can be thought of in three phases:
1. Problem Definition
2. Evolution Definition
3. Algorithm Execution
The `G... | lib/genex.ex | 0.949494 | 0.978915 | genex.ex | starcoder |
defmodule ElixirLS.LanguageServer.Providers.FoldingRange do
@moduledoc """
A textDocument/foldingRange provider implementation.
## Background
See specification here:
https://microsoft.github.io/language-server-protocol/specifications/specification-3-15/#textDocument_foldingRange
## Methodology
### Hi... | apps/language_server/lib/language_server/providers/folding_range.ex | 0.893817 | 0.626853 | folding_range.ex | starcoder |
defmodule Game.Experience do
@moduledoc """
Leveling up a character
"""
alias Data.ActionBar
alias Data.Save
alias Game.DamageTypes
alias Game.Format
alias Game.Player
alias Game.Skills
alias Game.Socket
@doc """
Apply experience points to the user's save
Will echo experience to the socket
... | lib/game/experience.ex | 0.790409 | 0.423279 | experience.ex | starcoder |
defmodule AWS.Transfer do
@moduledoc """
Amazon Web Services Transfer Family is a fully managed service that enables the
transfer of files over the File Transfer Protocol (FTP), File Transfer Protocol
over SSL (FTPS), or Secure Shell (SSH) File Transfer Protocol (SFTP) directly
into and out of Amazon Simple ... | lib/aws/generated/transfer.ex | 0.863866 | 0.520923 | transfer.ex | starcoder |
defmodule Sanbase.Billing.GraphqlSchema do
@moduledoc ~s"""
Contains functions that help examining the GraphQL schema.
It allows you to work easily with access logic of queries.
"""
alias Sanbase.Billing.Product
require SanbaseWeb.Graphql.Schema
# NOTE: In case of compile time error for reasons like wr... | lib/sanbase/billing/graphql_schema.ex | 0.80213 | 0.450118 | graphql_schema.ex | starcoder |
defmodule Ecto.Adapter do
@moduledoc """
This module specifies the adapter API that an adapter is required to
implement.
"""
use Behaviour
@type t :: module
@doc """
The callback invoked when the adapter is used.
"""
defmacrocallback __using__(opts :: Keyword.t) :: Macro.t
@doc """
Starts any... | lib/ecto/adapter.ex | 0.887984 | 0.487856 | adapter.ex | starcoder |
defmodule NarouEx.Models.Work do
defstruct(
novel_type: 0,
fav_novel_cnt: 0,
title: "",
monthly_point: 0,
biggenre: 0,
yearly_point: 0,
istensei: 0,
isgl: 0,
isbl: 0,
writer: "",
end: 0,
genre: 0,
novelupdated_at: DateTime.utc_now(),
impression_cnt: 0,
gener... | lib/models/work.ex | 0.673943 | 0.606644 | work.ex | starcoder |
defmodule Webdavex.Config do
@hackney_options_whitelist [:pool, :ssl_options, :connect_options, :proxy, :insecure, :connect_timeout, :recv_timeout]
@default_headers []
@default_hackney_options []
@moduledoc """
`Webdavex.Client` configuration.
## Options
### :base_url, required.
Schema, host, port an... | lib/webdavex/config.ex | 0.793226 | 0.610279 | config.ex | starcoder |
defmodule Sidecar.Process do
@moduledoc """
Supervises a single sidecar process
It is recommended one uses `Sidecar.Supervisor` to run sidecar processes,
rather than using this module manually.
"""
@doc false
use GenServer
require Logger
@typedoc """
A command that starts a sidecar process
If... | lib/sidecar/process.ex | 0.873195 | 0.787564 | process.ex | starcoder |
defmodule Assertions.Absinthe do
@moduledoc """
Helpful assertions for testing Absinthe applications.
This module contains some functions that make it much simpler and safer to test Absinthe
applications. Probably the most common issue that is seen in Absinthe applications is untested
resolver functions and ... | lib/assertions/absinthe.ex | 0.875674 | 0.7099 | absinthe.ex | starcoder |
defmodule Astarte.Export do
alias Astarte.Export.FetchData
alias Astarte.Export.XMLGenerate
require Logger
@moduledoc """
This module provide API functions to export realm device
data in a xml format. This data can be used by astarte_import
application utlity to import into a new realm.
"""
... | tools/astarte_export/lib/astarte/export.ex | 0.657758 | 0.416441 | export.ex | starcoder |
defmodule Litestream do
@moduledoc """
This GenServer module allows you to run [Litestream](https://litestream.io/) via a port in the background
so that you can easily backup your SQLite database to an object store.
"""
use GenServer,
restart: :transient,
shutdown: 15_000
require Logger
alias L... | lib/litestream.ex | 0.853852 | 0.458712 | litestream.ex | starcoder |
defmodule ElixirScript do
@moduledoc """
ElixirScript acts as a mix compiler. This means that when you execute `mix compile`,
ElixirScript's compiler will run as well. Make sure to add ElixirScript to your
list of compilers in mix.exs.
ElixirScript must be told which modules to use as the entry to your Elix... | lib/elixir_script.ex | 0.825132 | 0.661587 | elixir_script.ex | starcoder |
defmodule Astarte.Flow.Flows.Flow do
@moduledoc """
This module implements an embedded_schema representing a Flow and also
the GenServer responsible of starting and monitoring the Flow.
"""
use GenServer
use Ecto.Schema
import Ecto.Changeset
alias Astarte.Flow.Blocks.Container
alias Astarte.Flow.Flo... | lib/astarte_flow/flows/flow.ex | 0.794664 | 0.544378 | flow.ex | starcoder |
defmodule MailgunEx.Request do
@moduledoc """
A structure to capture the request parameters to send to HTTPoision,
this allows us to test the request without actually havig to
send it; for ease (and speed) of testing.
A `%Request{}` struct contains the following parts:
* `url` - Where are we sending... | lib/mailgun_ex/request.ex | 0.826991 | 0.418697 | request.ex | starcoder |
defmodule Geometry.MultiPointZM do
@moduledoc """
A set of points from type `Geometry.PointZM`.
`MultiPointZM` implements the protocols `Enumerable` and `Collectable`.
## Examples
iex> Enum.map(
...> MultiPointZM.new([
...> PointZM.new(1, 2, 3, 4),
...> PointZM.new(3, 4, 5, ... | lib/geometry/multi_point_zm.ex | 0.948346 | 0.871146 | multi_point_zm.ex | starcoder |
defmodule GRPCTelemetry do
@moduledoc """
An interceptor for instrumenting gRPC requests with `:telemetry` events.
GRPCTelemetry takes one option, the event prefix:
intercept(GRPCTelemetry, event_prefix: [:my, :endpoint])
It will emit two events:
* `[:my, :endpoint, :start]` is emitted the inter... | lib/grpc_telemetry.ex | 0.839668 | 0.416203 | grpc_telemetry.ex | starcoder |
defmodule SftpEx.Sftp.Transfer do
@moduledoc """
Provides data transfer related functions
"""
require SftpEx.Logger, as: Logger
alias SFTP.Connection, as: Conn
alias SftpEx.Types, as: T
@sftp Application.get_env(:sftp_ex, :sftp_service, SftpEx.Erl.Sftp)
@doc """
Similar to IO.each_binstream this r... | lib/sftp_ex/sftp/transfer.ex | 0.734691 | 0.483405 | transfer.ex | starcoder |
defmodule SvgBuilder.Path do
import XmlBuilder
alias SvgBuilder.{Element}
@moduledoc """
Create and modify path elements.
"""
@spec path() :: Element.t()
def path() do
element(:path, %{d: ""}, [])
end
@spec path(Element.t() | [Element.t()]) :: Element.t()
def path(children) when is_list(child... | lib/path.ex | 0.798265 | 0.431824 | path.ex | starcoder |
defmodule LayoutOMatic.Rectangle do
@default_stroke {1, :white}
# A rectangle is translated from the top left corner
@spec translate(%{
grid_xy: {number, number},
max_xy: {number, number},
primitive: %{data: {number, number}},
starting_xy: {number, number}
}) ::
... | lib/layouts/primitives/rectangle.ex | 0.834744 | 0.436802 | rectangle.ex | starcoder |
defmodule DifferEcto do
alias Differ.{Diffable, Patchable}
@moduledoc """
Helpers for `Differ` usage with `Ecto`
By calling `use` with this module, you get aliases to `Differ.Diffable`, `Differ.Patchable` and `DifferEcto.Diff`
"""
@doc """
Wrapper around `Differ.diff/2`, with optimiziation by default
... | lib/differ_ecto.ex | 0.874995 | 0.583292 | differ_ecto.ex | starcoder |
defmodule InteropProxy.Sanitize do
@moduledoc """
Translates the interop server responses to our own and vise-versa.
"""
# Aliasing the main messages.
alias InteropProxy.Message.Interop.{
Position, AerialPosition, InteropMission, Obstacles, InteropTelem, Odlc,
OdlcList, InteropMessage
}
# Aliasi... | services/interop-proxy/lib/interop_proxy/sanitize.ex | 0.75401 | 0.509459 | sanitize.ex | starcoder |
defmodule AstraeaVirgo.Validate.LanguageSettingOperation do
use Exop.Operation
@moduledoc """
Validate Param for Setting Language API
- `POST /api/languages`
- `PUT /api/languages/<language_id>`
Authorization: Bearer Token
Permission: admin
Request params: **application/json** Object
| fiel... | lib/virgo/validate/language_setting_operation.ex | 0.766512 | 0.439627 | language_setting_operation.ex | starcoder |
defmodule AWS.EBS do
@moduledoc """
You can use the Amazon Elastic Block Store (Amazon EBS) direct APIs to create
EBS snapshots, write data directly to your snapshots, read data on your
snapshots, and identify the differences or changes between two snapshots.
If you’re an independent software vendor (ISV) w... | lib/aws/generated/ebs.ex | 0.864768 | 0.588505 | ebs.ex | starcoder |
defmodule Bargad.Merkle do
use Bitwise
@spec new(Bargad.Types.tree_type, binary, Bargad.Types.hash_algorithm, Bargad.Types.backend) :: Bargad.Types.tree
def new(tree_type, tree_name, hash_function, backend) do
tree = Bargad.Utils.make_tree(tree_type, tree_name, hash_function, backend)
tree = Bargad.U... | lib/merkle/merkle.ex | 0.746509 | 0.5564 | merkle.ex | starcoder |
defmodule RethinkDB.Lambda do
@moduledoc """
Macro for using native elixir functions in queries
"""
alias RethinkDB.Query
@doc """
Macro for using native elixir functions in queries
Wrapping an anonymous function in `lambda` will cause it to be converted at compile time
into standard RethinkDB query s... | lib/rethinkdb/lambda.ex | 0.729712 | 0.474266 | lambda.ex | starcoder |
defmodule Alchemetrics.CustomBackend do
@type t :: module
@type metadata :: Keyword.t
@type measure :: Atom.t
@type value :: Integer.t
@type state :: Map.t | Keyword.t
@type init_opts :: Keyword.t | Map.t
@callback init(init_opts) :: {:ok, state} | {:ok, Keyword.t} | {:error, String.t} | {:error, Atom.t}... | lib/alchemetrics/backends/custom_backend.ex | 0.892656 | 0.731538 | custom_backend.ex | starcoder |
defmodule Contex do
@moduledoc """
Contex is a pure Elixir server-side data-plotting / charting system that generates SVG output.
Contex is designed to be simple to use and extensible, relying on common core components, such
as `Contex.Axis` and `Contex.Scale`, to create new plot types.
The typical usage pa... | lib/contex.ex | 0.915134 | 0.876423 | contex.ex | starcoder |
defmodule Calcinator.Alembic.Error do
@moduledoc """
`Alembic.Error.t` for errors added by `Calcinator` on top of `Alembic.Error`
"""
alias Alembic.{Document, Error, Source}
require Logger
@doc """
Retort returned a 500 JSONAPI error inside a 422 JSONRPC error.
"""
@spec bad_gateway() :: Error.t()
... | lib/calcinator/alembic/error.ex | 0.859325 | 0.514095 | error.ex | starcoder |
defmodule LexOffice.Model.LineItem do
@moduledoc """
Structure for describing invoice line item data.
"""
@derive [Poison.Encoder]
defstruct [
:id,
:type,
:name,
:description,
:quantity,
:unitName,
:unitPrice,
:discountPercentage,
:lineItemAmount
]
@type t :: %__MODUL... | lib/lexoffice/model/invoice.ex | 0.825027 | 0.470919 | invoice.ex | starcoder |
defmodule CadetWeb.AssessmentsHelpers do
@moduledoc """
Helper functions for Assessments and Grading
"""
import CadetWeb.ViewHelpers
@graded_assessment_types ~w(mission sidequest contest)a
defp build_library(%{library: library}) do
transform_map_for_view(library, %{
chapter: :chapter,
glo... | lib/cadet_web/views/assessments_helpers.ex | 0.617513 | 0.418964 | assessments_helpers.ex | starcoder |
defmodule BlockBox do
@moduledoc """
A tool used to generate slack UI blocks using elixir defined functions.
## Installation
```elixir
def deps do
[
{:blockbox, "~> 1.1.2"}
]
end
```
## Usage
use BlockBox to access all the generator functions defined in other modules.
```elixir
u... | lib/blockbox.ex | 0.81841 | 0.712032 | blockbox.ex | starcoder |
defmodule Verk.QueueStatsCounters do
@moduledoc """
This module is responsible for abstracting the logic of keeping counters for
each queue.
"""
@counters_table :queue_stats
@ets_options [:ordered_set, :named_table, read_concurrency: true, keypos: 1]
@doc """
Initializes the ets tables for the queue s... | lib/verk/queue_stats_counters.ex | 0.70069 | 0.55429 | queue_stats_counters.ex | starcoder |
defmodule Nx.Defn.Kernel do
@moduledoc """
All imported functionality available inside `defn` blocks.
"""
@special_forms [alias: 1, alias: 2, import: 1, import: 2, require: 1, require: 2, cond: 1]
@doc false
defmacro __using__(_opts) do
quote do
import Kernel, only: []
import Nx.Defn.Kerne... | lib/nx/defn/kernel.ex | 0.939028 | 0.663465 | kernel.ex | starcoder |
defmodule EVM.LogEntry do
@moduledoc """
This module contains functions to work with logs.
"""
alias EVM.{Address, Helpers}
defstruct address: nil, topics: [], data: nil
@type t :: %__MODULE__{
address: EVM.address(),
topics: [binary()],
data: binary()
}
@doc """
... | apps/evm/lib/evm/log_entry.ex | 0.687315 | 0.502258 | log_entry.ex | starcoder |
defmodule Delugex.StreamName do
@moduledoc """
StreamName is a module to manage the location where events are written.
Stream names could be intended as URLs for where events are located.
The StreamName protocol provides an easy way to access the data that
otherwise would be in a String.
Stream names are **... | lib/delugex/stream_name.ex | 0.841891 | 0.54583 | stream_name.ex | starcoder |
defmodule Mix.Tasks.Doctor.Explain do
@moduledoc """
Figuring out why a particular module failed Doctor validation can sometimes
be a bit difficult when the relevant information is embedded within a table with
other validation results.
The `mix doctor.explain` command has only a single required argument. Tha... | lib/mix/tasks/doctor.explain.ex | 0.842345 | 0.875095 | doctor.explain.ex | starcoder |
defmodule Tirexs.Search.Facets do
@moduledoc false
use Tirexs.DSL.Logic
alias Tirexs.Query, as: Query
def transpose(block) do
case block do
{:terms, _, [params]} -> terms(params)
{:range, _, [params]} -> range(params)
{:histogram, _, [params]} -> histogram(para... | lib/tirexs/search/facets.ex | 0.544801 | 0.448909 | facets.ex | starcoder |
defmodule TrueType.Utils do
@moduledoc """
Utility functions.
"""
use Bitwise, only: :operators
@doc """
Calculates TrueType checksum of given binary.
"""
@spec checksum(binary(), TrueType.uint32()) :: TrueType.uint32()
def checksum(this, adjustment \\ 0) when is_binary(this) do
pb = pad_4(this)... | lib/true_type/utils.ex | 0.763572 | 0.499573 | utils.ex | starcoder |
defmodule Contentful.CollectionStream do
@moduledoc """
A CollectionStream provides functions to make a Contentful.Collection streamable,
allowing the user to just iterate over the pages of resources in the Contentful API.
"""
alias Contentful.Space
@callback stream(
[limit: integer(), skip: ... | lib/contentful/collection_stream.ex | 0.773045 | 0.537952 | collection_stream.ex | starcoder |
defmodule AWS.Support do
@moduledoc """
AWS Support
The AWS Support API reference is intended for programmers who need detailed
information about the AWS Support operations and data types. This service
enables you to manage your AWS Support cases programmatically. It uses HTTP
methods that return results ... | lib/aws/support.ex | 0.820073 | 0.515193 | support.ex | starcoder |
defmodule Bounds.SlicedEnumerable do
defstruct [
enum: [],
initial_size: 0,
bounds: %Bounds{}
]
@doc false
def base(enum, size \\ nil) do
enum_initial_size = case {Enumerable.slice(enum), size} do
{{:ok, count_from_enum, _}, _} ->
count_from_enum
{{:error, _}, nil} ->
... | lib/bounds/sliced_enumerable.ex | 0.810516 | 0.641871 | sliced_enumerable.ex | starcoder |
defmodule RandPCG do
@moduledoc """
Generate random numbers based on the [PCG Algorithm](http://www.pcg-random.org)
"""
use Application
use RandPCG.Bitwise
@name RandPCG.Worker
def start(args \\ []), do: start(nil, args)
def start(type, nil), do: start(type, [])
def start(_type, args) do
import ... | lib/rand_pcg.ex | 0.80406 | 0.465934 | rand_pcg.ex | starcoder |
defmodule Resourceful.Collection.Sort do
@moduledoc """
Provides a common interface for sorting collections. See `call/2` for use and
examples.
This module is intended to dispatch arguments to the appropriate `Sort` module
for the underlying data source.
"""
alias Resourceful.Collection.Delegate
alias... | lib/resourceful/collection/sort.ex | 0.902392 | 0.479808 | sort.ex | starcoder |
defmodule Absinthe.Plug.DocumentProvider do
@moduledoc """
A document provider is a module that, given a GraphQL query, determines
what document should be executed and how the configured pipeline should be
applied to that document.
## Configuring
Configuration of your document providers occurs on initiali... | lib/absinthe/plug/document_provider.ex | 0.886199 | 0.465448 | document_provider.ex | starcoder |
defmodule Content.Audio.VehiclesToDestination do
@moduledoc """
Buses to Chelsea / S. Station arrive every [Number] to [Number] minutes
"""
require Logger
alias PaEss.Utilities
@enforce_keys [:language, :destination, :headway_range]
defstruct @enforce_keys ++ [:previous_departure_mins]
@type t :: %__... | lib/content/audio/vehicles_to_destination.ex | 0.749179 | 0.497009 | vehicles_to_destination.ex | starcoder |
defmodule Bintreeviz do
@moduledoc """
Bintreeviz is a binary tree visualizer for Elixir. Its main purpose is to convert a given tree structure into a string representation.
## Positioning
It supports pluggable algorithms for positioning of the individual nodes. Out-of-the-box it comeswith the Wetherell and Sh... | lib/bintreeviz.ex | 0.880097 | 0.743494 | bintreeviz.ex | starcoder |
defmodule MangoPay.Reporting do
@moduledoc """
Functions for MangoPay [reporting](https://docs.mangopay.com/endpoints/v2.01/reporting#e824_the-report-object).
"""
use MangoPay.Query.Base
set_path "reports"
@doc """
Get a reporting.
## Examples
{:ok, reporting} = MangoPay.Reporting.get(id)
"""... | lib/mango_pay/reporting.ex | 0.745584 | 0.444746 | reporting.ex | starcoder |
defmodule FalconPlusApi.Api.User do
alias Maxwell.Conn
alias FalconPlusApi.{Util, Sig, Api}
@doc """
* [Session](#/authentication) Required
### Request
```{
"new_password": "<PASSWORD>",
"old_password": "<PASSWORD>"
}```
### Response
```Status: 200```
```{"me... | lib/falcon_plus_api/api/user.ex | 0.635675 | 0.740526 | user.ex | starcoder |
defmodule KafkaEx.ConsumerGroup.PartitionAssignment do
@moduledoc """
Contains typespecs and reference algorithms for assigning partitions
`round_robin/2` is used by `KafkaEx.ConsumerGroup` by default and should
suffice in most cases.
For custom assignments, any function matching the
`t:callback/0` type s... | lib/kafka_ex/consumer_group/partition_assignment.ex | 0.917985 | 0.901314 | partition_assignment.ex | starcoder |
defmodule Crux.Structs.Role do
@moduledoc """
Represents a Discord [Role Object](https://discordapp.com/developers/docs/topics/permissions#role-object-role-structure).
"""
@behaviour Crux.Structs
alias Crux.Structs
alias Crux.Structs.{Role, Snowflake, Util}
require Util
Util.modulesince("0.1.0")
... | lib/structs/role.ex | 0.885303 | 0.724602 | role.ex | starcoder |
defmodule Buckets.TokenBucket do
@moduledoc """
A Token Bucket fills with tokens at a regular rate, up until a preset limit.
Another process may ask if the bucket is empty or not. Each empty request
drains a token from the bucket.
See [Token Bucket Algorithm](https://en.wikipedia.org/wiki/Token_bucket)
"""... | lib/buckets/token_bucket.ex | 0.860237 | 0.560042 | token_bucket.ex | starcoder |
defmodule Genex.Tools.Crossover do
alias Genex.Types.Chromosome
@moduledoc """
Implementation of several popular crossover methods.
Crossover is analagous to reproduction or biological crossover. Genex utilizes pairs of chromosomes to create offspring from the genetic material of parent chromosomes. Crossover... | lib/genex/tools/crossover.ex | 0.949189 | 0.803521 | crossover.ex | starcoder |
defmodule Solid.Expression do
@moduledoc """
Expression evaluation for the following binary operators:
== != > < >= <=
Also combine expressions with `and`, `or`
"""
alias Solid.Argument
@doc """
Evaluate a single expression
iex> Solid.Expression.eval({1, :==, 2})
false
iex> Solid.Expression.ev... | lib/solid/expression.ex | 0.725649 | 0.508483 | expression.ex | starcoder |
defmodule Gateway.Config do
@moduledoc """
Gateway module configuration that provides `settings/0`.
There are two ways to use this module
### Specify a list of expected keys
```
defmodule Gateway.MyExample do
use Gateway.Config, [:some_key, :other_key]
end
```
`Gateway.Config` expects a config... | lib/gateway/config.ex | 0.915209 | 0.796411 | config.ex | starcoder |
defmodule Ueberauth.Strategy.Auth0 do
@moduledoc """
Provides an Ueberauth strategy for authenticating with Auth0.
You can edit the behaviour of the Strategy by including some options when
you register your provider.
To set the `uid_field`
config :ueberauth, Ueberauth,
providers: [
a... | lib/ueberauth/strategy/auth0.ex | 0.847463 | 0.462291 | auth0.ex | starcoder |
defmodule AWS.Lambda do
@moduledoc """
AWS Lambda
## Overview
This is the *AWS Lambda API Reference*.
The AWS Lambda Developer Guide provides additional information. For the service
overview, see [What is AWS Lambda](https://docs.aws.amazon.com/lambda/latest/dg/welcome.html), and for
information about... | lib/aws/generated/lambda.ex | 0.910766 | 0.588948 | lambda.ex | starcoder |
defmodule Kino do
@moduledoc ~S'''
Client-driven interactive widgets for Livebook.
Kino is the library used by Livebook to render rich and interactive
outputs directly from your Elixir code.
## Built-in widgets
Kino renders any data structure that implements the `Kino.Render`
protocol, falling back to ... | lib/kino.ex | 0.897891 | 0.88813 | kino.ex | starcoder |
defmodule ExInsights do
@moduledoc """
Exposes methods for POST events & metrics to Azure Application Insights.
For more information on initialization and usage consult the [README.md](readme.html)
"""
alias ExInsights.{Envelope, Utils}
alias ExInsights.Telemetry.{
Types,
EventTelemetry,
T... | lib/ex_insights.ex | 0.920092 | 0.477311 | ex_insights.ex | starcoder |
defmodule ExUnit.Callbacks do
@moduledoc ~S"""
Defines ExUnit callbacks.
This module defines the `setup/1`, `setup/2`, `setup_all/1`, and
`setup_all/2` callbacks, as well as the `on_exit/2`, `start_supervised/2`
and `stop_supervised/1` functions.
The setup callbacks are defined via macros and each one can... | lib/ex_unit/lib/ex_unit/callbacks.ex | 0.847306 | 0.686206 | callbacks.ex | starcoder |
defmodule Rubbergloves.Annotations.ControllerAnnotations do
alias Rubbergloves.Validation
@moduledoc """
A base controller to simplify input mapping, validation and authorization handlers.
## Example
```
defmodule Example.AuthController do
@handler_defaults [
gloves: DefaultUserGloves,
pri... | lib/annotations/controller_annotations.ex | 0.823683 | 0.726329 | controller_annotations.ex | starcoder |
defmodule PaymentMessenger.Message do
@moduledoc """
The ISO-8583 message schema.
It implements the `PaymentMessenger.Message` behaviour and
module attributes like `request_fields`, `response_fields` and
`shared_fields`, which helps when developing functions that could
return the message fields.
"""
@... | lib/payment_messenger/message.ex | 0.8288 | 0.717185 | message.ex | starcoder |
defmodule Algae.State do
@moduledoc ~S"""
`Algae.State` describes a wrapped function that can be used to pass around some
"hidden" pure state.
This has numerous applications, but the primary advantage is purity. The state
gets passed around with the value, and the monadic DSL helps it feel more
natural tha... | lib/algae/state.ex | 0.870638 | 0.581541 | state.ex | starcoder |
defmodule AlphaVantage.EconomicIndicators do
@moduledoc """
A set of functions for key US economic indicators from [Alpha Vantage](www.alphavantage.co/documentation/#economic-indicators).
"""
alias AlphaVantage.Gateway
@doc """
Returns the annual and quarterly Real GDP of the United States.
Please ref... | lib/alpha_vantage/economic_indicators.ex | 0.895071 | 0.788359 | economic_indicators.ex | starcoder |
defmodule Statistics.Distributions.Poisson do
@moduledoc """
The Poisson distribution is a discrete probablility distribution.
It models the probability of a given number of events occurring
in a fixed interval if the events occur with a known average rate
and are independent of the previous event.
"""
... | lib/statistics/distributions/poisson.ex | 0.925078 | 0.842928 | poisson.ex | starcoder |
defmodule Artem do
@external_resource "./README.md"
@moduledoc """
#{File.read!(@external_resource) |> String.split("---", parts: 2) |> List.last()}
"""
alias Absinthe.Phase
alias Absinthe.Pipeline
defmacro __using__(opts) do
schema = Keyword.get(opts, :schema)
pipeline = Keyword.get(opts, :pipe... | lib/artem.ex | 0.793826 | 0.681382 | artem.ex | starcoder |
defmodule OffBroadway.Kafka.Acknowledger do
@moduledoc """
Implements the Broadway acknowledger behaviour, acking
messages back to Kafka once they have been successfully processed.
It stores message ack references in ETS as an ordered set, acknowledging
them in the order received rather than the order proces... | lib/off_broadway/kafka/acknowledger.ex | 0.837885 | 0.489686 | acknowledger.ex | starcoder |
defmodule Crux.Structs.User do
@moduledoc """
Represents a Discord [User Object](https://discordapp.com/developers/docs/resources/user#user-object-user-structure)
"""
@behaviour Crux.Structs
alias Crux.Structs
alias Crux.Structs.{Member, Message, Presence, Snowflake, User, Util, VoiceState}
require Ut... | lib/structs/user.ex | 0.749546 | 0.460228 | user.ex | starcoder |
require Utils
defmodule D8 do
@moduledoc """
--- Day 8: Space Image Format ---
The Elves' spirits are lifted when they realize you have an opportunity to reboot one of their Mars rovers, and so they are curious if you would spend a brief sojourn on Mars. You land your ship near the rover.
When you reach the r... | lib/days/08.ex | 0.717507 | 0.780035 | 08.ex | starcoder |
defmodule Screens.DupScreenData.Response do
@moduledoc false
@pill_to_specifier %{
red: "Red Line",
orange: "Orange Line",
green: "Green Line",
blue: "Blue Line",
mattapan: "Mattapan Line"
}
@headsign_overrides %{
"Boston College" => "Boston Coll",
"Cleveland Circle" => "Cleveland ... | lib/screens/dup_screen_data/response.ex | 0.654895 | 0.427307 | response.ex | starcoder |
defmodule Playwright.BrowserType do
@moduledoc """
The `Playwright.BrowserType` module exposes functions that either:
- launch a new browser instance via a `Port`
- connect to a running playwright websocket
## Examples
Open a new chromium via the CLI driver:
{connection, browser} = Playwright.Brow... | lib/playwright/browser_type.ex | 0.861392 | 0.410195 | browser_type.ex | starcoder |
defmodule Cassandrax.Schema do
@moduledoc """
Defines a schema.
This schema is used to map data fetched from a CassandraDB node into an Elixir struct.
`Cassandrax.Schema` mixin uses `Ecto.Schema` mixin.
"""
@type t :: struct()
@doc false
defmacro __using__(_opts) do
quote do
# First we impo... | lib/cassandrax/schema.ex | 0.904872 | 0.766206 | schema.ex | starcoder |
defmodule Cep.Client do
@moduledoc """
Provides a function `get_address/1` to query addreses of a given cep.
"""
@doc """
Gets the address related to a given CEP.
## Parameters
- cep: The CEP code
## Return value
It returns a Cep.Address when the CEP was found.
### Errors
It returns... | lib/cep/client.ex | 0.839208 | 0.456773 | client.ex | starcoder |
defmodule Ockam.Vault do
require Logger
alias __MODULE__.NIF
alias Ockam.Vault.KeyPair
alias Ockam.Vault.Secret
alias Ockam.Vault.SecretAttributes
defstruct [:context]
@opaque t :: %__MODULE__{}
@doc """
Create a new instance of a Vault
"""
@spec new() :: {:ok, t} | {:error, term}
def new() ... | implementations/elixir/lib/vault.ex | 0.898084 | 0.463505 | vault.ex | starcoder |
defmodule ExMatch do
@external_resource "README.md"
@moduledoc """
Assertions for data equivalence.
#{"README.md" |> File.read!() |> String.split("<!-- EXAMPLES -->") |> Enum.at(1)}
"""
@assertion_error (if Mix.env() in [:test] do
ExMatchTest.AssertionError
else
... | lib/exmatch.ex | 0.755817 | 0.590897 | exmatch.ex | starcoder |
defmodule Ecto.Associations do
@moduledoc """
Utilities on associations.
"""
alias Ecto.Query.Query
alias Ecto.Query.AssocJoinExpr
alias Ecto.Query.Util
alias Ecto.Reflections.HasOne
alias Ecto.Reflections.HasMany
alias Ecto.Reflections.BelongsTo
require Ecto.Query, as: Q
@doc """
Returns true... | lib/ecto/associations.ex | 0.733452 | 0.455925 | associations.ex | starcoder |
defmodule RTypes.Lambda do
def build({:type, _line, :any, _args}), do: fn _ -> true end
def build({:type, _line, :none, _args}) do
fn _ ->
raise "attempt to validate bottom type"
end
end
def build({:type, _line, :atom, _args}), do: &is_atom(&1)
def build({:type, _line, :integer, _args}), do: &... | lib/rtypes/lambda.ex | 0.5083 | 0.424949 | lambda.ex | starcoder |
defmodule Cryppo.EncryptedData do
@moduledoc """
A struct for encrypted data and encryption artefacts
An `Cryppo.EncryptedData` struct may be marked as belonging to a certain encryption strategy
using field `encryption_strategy_module` containing the module of the encryption strategy.
Can also contain encry... | lib/cryppo/encrypted_data.ex | 0.826817 | 0.478041 | encrypted_data.ex | starcoder |
defmodule Holidefs.DateCalculator do
@moduledoc """
Some functions to calculate dynamic holiday dates
"""
@doc """
Returns the date of Easter for the given `year`
## Examples
iex> Holidefs.DateCalculator.gregorian_easter(2016)
~D[2016-03-27]
iex> Holidefs.DateCalculator.gregorian_easte... | lib/holidefs/date_calculator.ex | 0.911303 | 0.541954 | date_calculator.ex | starcoder |
defmodule Timex.Macros do
@moduledoc false
@doc """
Wraps a function definition in a warning at runtime on :stderr that the wrapped function has been deprecated.
The message parameter should be used to communicate the action needed to move to supported behaviour.
"""
defmacro defdeprecated({name, _env, arg... | deps/timex/lib/timex/macros.ex | 0.800107 | 0.569194 | macros.ex | starcoder |
if Code.ensure_loaded?(Absinthe) do
defmodule Cqrs.Absinthe do
@moduledoc """
Macros to derive queries and mutations from [Queries](`Cqrs.Query`) and [Commands](`Cqrs.Command`), respectfully.
## Configuration
* `:context_metadata_keys` - A list of the keys in the `Absinthe.Resolution` `context` to p... | lib/cqrs/absinthe.ex | 0.799599 | 0.535827 | absinthe.ex | starcoder |
defmodule Geometry.GeoJson do
@moduledoc false
alias Geometry.{
Feature,
FeatureCollection,
GeometryCollection,
GeometryCollectionM,
GeometryCollectionZ,
GeometryCollectionZM,
LineString,
LineStringM,
LineStringZ,
LineStringZM,
MultiLineString,
MultiLineStringM,
... | lib/geometry/geo_json.ex | 0.843734 | 0.611788 | geo_json.ex | starcoder |
defmodule LayoutOMatic.Layouts.Components.Button do
# Buttons size based on :button_font_size with 20 being the default; width/height override
@default_font_size 20
@default_font :roboto
def translate(
%{
component: component,
starting_xy: starting_xy,
grid_xy: grid_xy,
... | lib/layouts/components/button.ex | 0.574634 | 0.420927 | button.ex | starcoder |
defmodule Confex.Resolver do
@moduledoc """
This module provides API to recursively resolve system tuples in a `Map` or `Keyword` structures.
"""
alias Confex.Adapter
alias Confex.Type
@known_types [:string, :integer, :float, :boolean, :atom, :module, :list]
@known_adapter_aliases [:system, :system_file]... | lib/confex/resolver.ex | 0.867331 | 0.409634 | resolver.ex | starcoder |
defmodule Telegraf do
use Supervisor
@external_resource "README.md"
@moduledoc "README.md"
|> File.read!()
|> String.split("<!-- MDOC !-->")
|> Enum.fetch!(1)
@typedoc "Name of the telegraf instance."
@type name :: atom()
@opts_definition [
name: [
type: :... | lib/telegraf.ex | 0.904515 | 0.470919 | telegraf.ex | starcoder |
defmodule Grizzly.CommandClass.ThermostatSetpoint.Set do
@moduledoc """
Command module to work with the ThermostatSetpoint command class SET command
Command Options:
* `:value` - What the value of the set-point should be
* `:type` - The set-point type being targeted: `:cooling`, `:heating`, or a byte
... | lib/grizzly/command_class/thermostat_setpoint/set.ex | 0.882927 | 0.455804 | set.ex | starcoder |
defmodule Timex.Timezone.Database do
@behaviour Calendar.TimeZoneDatabase
alias Timex.Timezone
alias Timex.TimezoneInfo
@impl true
@doc false
def time_zone_period_from_utc_iso_days(iso_days, time_zone) do
db = Tzdata.TimeZoneDatabase
case db.time_zone_period_from_utc_iso_days(iso_days, time_zone)... | lib/timezone/database.ex | 0.848125 | 0.523664 | database.ex | starcoder |
defmodule Canvas.Resources.Submissions do
@moduledoc """
Provides functions to interact with the
[enrollment term endpoints](https://canvas.instructure.com/doc/api/enrollment_terms).
"""
alias Canvas.{Client, Listing, Response}
alias Canvas.Resources.{Assignment, Course, Submission, User}
def submit_an_... | lib/canvas/resources/submissions.ex | 0.807612 | 0.507324 | submissions.ex | starcoder |
defmodule Ratio do
@vsn "1.2.0"
@moduledoc """
This module allows you to use Rational numbers in Elixir, to enable exact calculations with all numbers big and small.
It also defines the new <|> operator and (optionally) overrides the arithmetic +, -, * and / operators to work with ints, floats and Rational nu... | lib/ratio.ex | 0.918968 | 0.574454 | ratio.ex | starcoder |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.