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 AWS.Batch do
@moduledoc """
AWS Batch enables you to run batch computing workloads on the AWS Cloud.
Batch computing is a common way for developers, scientists, and engineers
to access large amounts of compute resources, and AWS Batch removes the
undifferentiated heavy lifting of configuring and ma... | lib/aws/batch.ex | 0.878926 | 0.640875 | batch.ex | starcoder |
defmodule Apoc do
@moduledoc """
Comprehensive docs coming soon!
"""
alias Apoc.Hazmat
@typedoc """
Hex (lowercase) encoded string
See `Apoc.hex/1`
"""
@type hexstring :: binary()
@typedoc """
An encoded string that represents a string encoded in Apoc's encoding scheme
(URL safe Base 64).
... | lib/apoc.ex | 0.856752 | 0.870322 | apoc.ex | starcoder |
defmodule CargueroTaskBunny.Queue do
@moduledoc """
Convenience functions for accessing CargueroTaskBunny queues.
It's a semi private module normally wrapped by other modules.
## Sub Queues
When CargueroTaskBunny creates(declares) a queue on RabbitMQ, it also creates the following sub queues.
- [queue-n... | lib/carguero_task_bunny/queue.ex | 0.803058 | 0.469642 | queue.ex | starcoder |
defmodule Exrabbit.Channel do
@moduledoc """
This module exposes some channel-level AMQP methods.
Mostly the functions that don't belong in neither `Exrabbit.Producer` nor
`Exrabbit.Consumer` are kept here.
"""
use Exrabbit.Records
@type conn :: pid
@type chan :: pid
@type await_confirms_result :: ... | lib/exrabbit/channel.ex | 0.914348 | 0.475544 | channel.ex | starcoder |
alias GraphQL.Lang.AST.Visitor
alias GraphQL.Lang.AST.InitialisingVisitor
alias GraphQL.Lang.AST.PostprocessingVisitor
defmodule GraphQL.Lang.AST.CompositeVisitor do
@moduledoc """
A CompositeVisitor composes two Visitor implementations into a single Visitor.
This provides the ability to chain an arbitrary numb... | lib/graphql/lang/ast/composite_visitor.ex | 0.895418 | 0.496765 | composite_visitor.ex | starcoder |
defmodule RayTracer.Tasks.Chapter11 do
@moduledoc """
This module tests reflections and refractions from Chapter 11
"""
alias RayTracer.RTuple
alias RayTracer.Shape
alias RayTracer.Sphere
alias RayTracer.Plane
alias RayTracer.Canvas
alias RayTracer.Material
alias RayTracer.Color
alias RayTracer.L... | lib/tasks/chapter11.ex | 0.883044 | 0.543106 | chapter11.ex | starcoder |
defmodule Stops.Stop do
@moduledoc """
Domain model for a Stop.
"""
alias Stops.{Api, Stop}
@derive {Jason.Encoder, except: [:bike_storage, :fare_facilities]}
defstruct id: nil,
parent_id: nil,
child_ids: [],
name: nil,
note: nil,
accessibility: ... | apps/stops/lib/stop.ex | 0.882269 | 0.410166 | stop.ex | starcoder |
defmodule Day20 do
@moduledoc """
AoC 2019, Day 20 - Donut Maze
"""
@doc """
Steps to get from AA to ZZ
"""
def part1 do
Util.priv_file(:day20, "day20_input.txt")
|> File.read!()
|> path("AA", "ZZ")
end
@doc """
Recursive maze steps from AA to ZZ
"""
def part2 do
Util.priv_file... | apps/day20/lib/day20.ex | 0.658966 | 0.449876 | day20.ex | starcoder |
defmodule UpsilonBattle.Engine do
defstruct map_id: UUID.uuid4()
@doc """
Initialise le moteur.
"""
def init(_context) do
end
@doc """
Enregistre un nouvel utilisateur ...
Peux echouer si y a deja 4 joueurs ...
retour: {:ok, context, [positions_depart_dispo]... | lib/battle/engine.ex | 0.576065 | 0.425038 | engine.ex | starcoder |
defmodule Nosedrum do
@moduledoc """
`nosedrum` is a command framework for use with the excellent
[`nostrum`](https://github.com/Kraigie/nostrum) library.
It contains behaviour specifications for easily implementing command handling
in your bot along with other conveniences to ease creating an interactive bo... | lib/nosedrum.ex | 0.861057 | 0.681462 | nosedrum.ex | starcoder |
defmodule ExViva.Decoders.Sample do
defmacrop v!(key) do
quote do
Map.fetch!(var!(sample), unquote(key))
end
end
def simple_decode(sample) do
unit = v!("Unit")
type = parse_type(v!("Type"), unit)
%ExViva.Sample{
heading: v!("Heading"),
unit: v!("Unit"),
trend: v!("Tre... | lib/ex_viva/decoders/sample.ex | 0.582729 | 0.535463 | sample.ex | starcoder |
defmodule XDR.Type.Array do
@moduledoc """
A fixed-length array of some other type
"""
defstruct type_name: "Array", length: nil, data_type: nil, values: []
@type t() :: %__MODULE__{
type_name: String.t(),
length: XDR.Size.t(),
data_type: XDR.Type.t(),
values: list(XD... | lib/xdr/types/array.ex | 0.791378 | 0.476214 | array.ex | starcoder |
defmodule ETag.Plug do
@moduledoc """
A drop in plug to add support for shallow [ETags](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag).
Shallow means that it uses the whole response to generate the ETag and does
not care about the specific content of each response. It is not context
sensitiv... | lib/etag/plug.ex | 0.786828 | 0.461684 | plug.ex | starcoder |
defmodule SMPPEX.Session do
@moduledoc """
Module for implementing custom SMPP Session entities.
To implement an Session entitiy, one should implement several callbacks (`SMPPEX.Session` behaviour).
The most proper way to do it is to `use` `SMPPEX.Session`:
```
defmodule MySession do
use SMPPEX.Sessio... | lib/smppex/session.ex | 0.843638 | 0.810779 | session.ex | starcoder |
defmodule Re.Listing do
@moduledoc """
Model for listings, that is, each apartment or real estate piece on sale.
"""
use Ecto.Schema
import Ecto.Changeset
alias Re.Listings.Liquidity
schema "listings" do
field :uuid, Ecto.UUID
field :type, :string
field :complement, :string
field :descr... | apps/re/lib/listings/schemas/listing.ex | 0.672547 | 0.550305 | listing.ex | starcoder |
defmodule Nx.Backend do
@moduledoc """
The behaviour for tensor backends.
Each backend is module that defines a struct and implements the callbacks
defined in this module. The callbacks are mostly implementations of the
functions in the `Nx` module with the tensor output shape given as first
argument.
`... | lib/nx/backend.ex | 0.857604 | 0.567997 | backend.ex | starcoder |
defmodule Nebulex.Entry do
@moduledoc """
Defines a Cache Entry.
This is the structure used by the caches for representing cache entries.
"""
# Cache entry definition
defstruct key: nil,
value: nil,
touched: nil,
ttl: :infinity,
time_unit: :millisecond
@t... | lib/nebulex/entry.ex | 0.901043 | 0.44077 | entry.ex | starcoder |
defmodule ExProtobuf.Parser do
defmodule ParserError do
defexception [:message]
end
def parse_files!(files, options \\ []) do
Enum.reduce(files, [], fn(path, defs) ->
schema = File.read!(path)
new_defs = parse!(schema, options)
defs ++ new_defs
end) |> finalize!(options)
end
d... | lib/exprotobuf/parser.ex | 0.518059 | 0.565659 | parser.ex | starcoder |
defmodule EQL.AST.Join do
@moduledoc false
@behaviour EQL.Expression
alias EQL.Expression
alias EQL.AST.{Ident, Mutation, Params, Prop, Query, Union}
defstruct key: nil,
query: nil
@type t(p, q) :: %__MODULE__{
key: p,
query: q
}
@type t ::
t(
... | lib/eql/ast/join.ex | 0.766512 | 0.448487 | join.ex | starcoder |
defmodule UltraDark.Transaction do
alias UltraDark.Transaction
alias UltraDark.Utilities
alias Decimal, as: D
@moduledoc """
Contains all the functions that pertain to creating valid transactions
"""
defstruct id: nil,
inputs: [],
outputs: [],
fee: 0,
de... | lib/transaction.ex | 0.836955 | 0.555496 | transaction.ex | starcoder |
defmodule Nerves.Grove.OneNumberLeds do
@moduledoc """
String.to_integer("FC", 16)|>Integer.digits(2)
c ("lib/nerves_grove/one_number_led.ex")
Ring#Logger.attach
alias Nerves.Grove.OneNumberLeds
OneNumberLeds.set_one_segment_pins(17, 18, 27, 23, 22, 24, 25, 6)
"""
require Logger
alias Pigp... | lib/nerves_grove/one_number_led.ex | 0.574992 | 0.52829 | one_number_led.ex | starcoder |
defmodule Aecore.Channel.ChannelOffChainTx do
@moduledoc """
Structure of an Offchain Channel Transaction. Implements a cryptographically signed container for channel updates associated with an offchain chainstate.
"""
@behaviour Aecore.Channel.ChannelTransaction
alias Aecore.Channel.ChannelOffChainTx
ali... | apps/aecore/lib/aecore/channel/channel_off_chain_tx.ex | 0.875734 | 0.405625 | channel_off_chain_tx.ex | starcoder |
defmodule Graphmath.Mat33 do
@moduledoc """
This is the 3D mathematics library for graphmath.
This submodule handles 3x3 matrices using tuples of floats.
"""
@type mat33 :: {float, float, float, float, float, float, float, float, float}
@type vec3 :: {float, float, float}
@type vec2 :: {float, float}
... | lib/graphmath/Mat33.ex | 0.948799 | 0.927888 | Mat33.ex | starcoder |
defmodule Codenamex.Game do
@moduledoc """
This module manages the game logic.
All the functions besides setup/0 expect a game state.
A state is a variation of what was created by the setup/0 function.
"""
alias Codenamex.Game.Board
alias Codenamex.Game.Player
alias Codenamex.Game.Team
defstruct [
... | lib/codenamex/game.ex | 0.708414 | 0.545467 | game.ex | starcoder |
defmodule Seely.Router do
@moduledoc """
Functions to find routes in a user-defined router. (See `Seely.DefaultRouter`).
"""
@doc ~s"""
Create a new router (which is nothing than a simple `Keyword` list)
with initially one key only, the `:module` where the actual router is defined.
Keys: `routes` and `p... | lib/seely/controllers/router.ex | 0.778691 | 0.543893 | router.ex | starcoder |
defmodule Re.Listings.Filters do
@moduledoc """
Module for grouping filter queries
"""
use Ecto.Schema
import Ecto.{
Query,
Changeset
}
alias Re.Listings.Filters.Relax
schema "listings_filter" do
field :max_price, :integer
field :min_price, :integer
field :max_rooms, :integer
... | apps/re/lib/listings/filters/filters.ex | 0.727201 | 0.498047 | filters.ex | starcoder |
defmodule Pipe.List do
@moduledoc """
Pipes which act in a list-like (or stream-like) manner.
"""
require Pipe, as: P
## Sources
@doc """
Yield all elements of the list.
"""
def source_list(list)
def source_list([]) do
P.source do
P.return nil
end
end
def source_list([h|t]) do
... | lib/pipe/list.ex | 0.687315 | 0.452596 | list.ex | starcoder |
defmodule AWS.CloudDirectory do
@moduledoc """
Amazon Cloud Directory
Amazon Cloud Directory is a component of the AWS Directory Service that
simplifies the development and management of cloud-scale web, mobile, and IoT
applications.
This guide describes the Cloud Directory operations that you can call
... | lib/aws/generated/cloud_directory.ex | 0.901271 | 0.417271 | cloud_directory.ex | starcoder |
defmodule AWS.CodeDeploy do
@moduledoc """
AWS CodeDeploy
AWS CodeDeploy is a deployment service that automates application
deployments to Amazon EC2 instances, on-premises instances running in your
own facility, or serverless AWS Lambda functions.
You can deploy a nearly unlimited variety of application... | lib/aws/code_deploy.ex | 0.791418 | 0.470128 | code_deploy.ex | starcoder |
defmodule Elibuf.Primitives.Enum do
defstruct name: nil, values: [], allow_alias: false
defmodule Value do
defstruct name: nil, order: nil, type: :enum
def new_value(name, order) when is_bitstring(name) and is_integer(order) and order >= 0 do
%__MODULE__{name: name, order: order}
... | lib/primitives/enum.ex | 0.664105 | 0.511656 | enum.ex | starcoder |
defmodule Day6 do
@type orbits() :: %{String.t() => String.t()}
@spec add_orbit([String.t()], orbits()) :: orbits()
defp add_orbit([center, body], orbit_map) do
Map.put(orbit_map, body, center)
end
@spec count_orbits(orbits(), String.t()) :: integer
defp count_orbits(map, center) do
case center do... | lib/day6.ex | 0.837354 | 0.563918 | day6.ex | starcoder |
defmodule Cafex.Protocol.OffsetCommit do
@moduledoc """
This api saves out the consumer's position in the stream for one or more partitions.
The offset commit request support version 0, 1 and 2.
To read more details, visit the [A Guide to The Kafka Protocol](https://cwiki.apache.org/confluence/display/KAFKA/A+... | lib/cafex/protocol/offset_commit.ex | 0.730097 | 0.409103 | offset_commit.ex | starcoder |
defmodule VolleyFire do
@moduledoc ~S"""
This module provides a self-scheduling task runner.
There are two main functions:
* roll
The idea is to start all the tasks on the list in
a wrapper that waits to receive a :start message.
The controller sends out count :start messages and
when any of those ta... | lib/volley_fire.ex | 0.64579 | 0.684547 | volley_fire.ex | starcoder |
defmodule Collision.Vector.Vector3 do
@moduledoc """
Three dimensional vectors.
"""
defstruct x: 0.0, y: 0.0, z: 0.0
alias Collision.Vector.Vector3
@type t :: Vector3.t
@doc """
Convert a tuple to a vector.
## Examples
iex> Collision.Vector.Vector3.from_tuple({1.0, 1.5, 2.0})
%Collisio... | lib/collision/vector/vector3.ex | 0.931983 | 0.991364 | vector3.ex | starcoder |
defmodule Gi do
@moduledoc """
Manipulating Graphics Interfacing
"""
import Gi.Command
import Gi.Image
alias Gi.{Image, Command}
@doc """
Opens image source, raises a `File.Error` exception in case of failure.
## Parameters
- path: path to file image.
## Example
iex> Gi.open("test/exa... | lib/gi.ex | 0.812682 | 0.479747 | gi.ex | starcoder |
defmodule Exexec do
@moduledoc """
Execute and control OS processes from Elixir.
An idiomatic Elixir wrapper for <NAME>'s excellent
[erlexec](https://github.com/saleyn/erlexec), Exexec provides an Elixir
interface as well as some nice Elixir-y goodies on top.
"""
import Exexec.ToErl
@type command :: ... | lib/exexec.ex | 0.745769 | 0.42668 | exexec.ex | starcoder |
defmodule Tox do
@moduledoc """
Some structs and functions to work with dates, times, durations, periods, and
intervals.
"""
@typedoc """
Units related to dates and times.
"""
@type unit ::
:year
| :month
| :week
| :day
| :hour
| :minute
... | lib/tox.ex | 0.914415 | 0.791741 | tox.ex | starcoder |
defmodule FaultTree do
@moduledoc """
Main module for creating and interacting with fault trees.
"""
use TypedStruct
require Logger
alias FaultTree.Node
typedstruct do
field :next_id, integer(), default: 0
field :nodes, list(Node.t()), default: []
end
@type error_type :: {:error, String.t()... | lib/fault_tree.ex | 0.895139 | 0.666755 | fault_tree.ex | starcoder |
defmodule Aecore.Channel.Tx.ChannelSlashTx do
@moduledoc """
Module defining the ChannelSlash transaction
"""
@behaviour Aecore.Tx.Transaction
alias Aecore.Channel.Tx.ChannelSlashTx
alias Aecore.Tx.{SignedTx, DataTx}
alias Aecore.Account.AccountStateTree
alias Aecore.Chain.{Chainstate, Identifier}
a... | apps/aecore/lib/aecore/channel/tx/channel_slash_tx.ex | 0.878269 | 0.418786 | channel_slash_tx.ex | starcoder |
defmodule Scidata.KuzushijiMNIST do
@moduledoc """
Module for downloading the [Kuzushiji-MNIST dataset](https://github.com/rois-codh/kmnist).
"""
alias Scidata.Utils
@base_url "http://codh.rois.ac.jp/kmnist/dataset/kmnist/"
@train_image_file "train-images-idx3-ubyte.gz"
@train_label_file "train-labels-i... | lib/scidata/kuzushiji_mnist.ex | 0.858941 | 0.609495 | kuzushiji_mnist.ex | starcoder |
defmodule Rajska.ObjectAuthorization do
@moduledoc """
Absinthe middleware to ensure object permissions.
Authorizes all Absinthe's [objects](https://hexdocs.pm/absinthe/Absinthe.Schema.Notation.html#object/3) requested in a query by checking the permission defined in each object meta `authorize`.
## Usage
... | lib/middlewares/object_authorization.ex | 0.869035 | 0.895477 | object_authorization.ex | starcoder |
defmodule Bamboo.PostmarkHelper do
@moduledoc """
Functions for using features specific to Postmark e.g. templates
"""
alias Bamboo.Email
@doc """
Set a single tag for an email that allows you to categorize outgoing emails
and get detailed statistics.
A convenience function for `put_private(email, :t... | lib/bamboo/postmark_helper.ex | 0.814643 | 0.413063 | postmark_helper.ex | starcoder |
defmodule Performance.Kafka do
@moduledoc """
Utilities for working with kafka in performance tests
"""
use Retry
import SmartCity.TestHelper, only: [eventually: 3]
alias Performance.SetupConfig
require Logger
def tune_consumer_parameters(otp_app, %SetupConfig{} = params) do
{_messages, kafka_par... | apps/performance/lib/performance/kafka.ex | 0.649245 | 0.425874 | kafka.ex | starcoder |
defmodule Geocalc do
@moduledoc """
Calculate distance, bearing and more between Latitude/Longitude points.
"""
alias Geocalc.Calculator
alias Geocalc.Calculator.Polygon
alias Geocalc.Point
@doc """
Calculates distance between 2 points.
Return distance in meters.
## Example
iex> berlin = [5... | lib/geocalc.ex | 0.92669 | 0.690709 | geocalc.ex | starcoder |
defmodule Cocktail.ScheduleState do
@moduledoc false
alias Cocktail.{RuleState, Schedule, Span}
@type t :: %__MODULE__{
recurrence_rules: [RuleState.t()],
recurrence_times: [Cocktail.time()],
exception_times: [Cocktail.time()],
start_time: Cocktail.time(),
curre... | lib/cocktail/schedule_state.ex | 0.763307 | 0.419232 | schedule_state.ex | starcoder |
defmodule Manticoresearch.Api.Search do
@moduledoc """
API calls for all endpoints tagged `Search`.
"""
alias Manticoresearch.Connection
import Manticoresearch.RequestBuilder
@doc """
Perform reverse search on a percolate index
Performs a percolate search. This method must be used only on percolate... | out/manticoresearch-elixir/lib/manticoresearch/api/search.ex | 0.844537 | 0.721768 | search.ex | starcoder |
defmodule Ash.Changeset do
@moduledoc """
Changesets are used to create and update data in Ash.
Create a changeset with `create/2` or `update/2`, and alter the attributes
and relationships using the functions provided in this module. Nothing in this module
actually incurs changes in a data layer. To commit ... | lib/ash/changeset/changeset.ex | 0.888202 | 0.761095 | changeset.ex | starcoder |
defmodule List do
@moduledoc """
Implements functions that only make sense for lists
and cannot be part of the Enum protocol. In general,
favor using the Enum API instead of List.
Some functions in this module expect an index. Index
access for list is linear. Negative indexes are also
supported but they ... | lib/elixir/lib/list.ex | 0.903633 | 0.682244 | list.ex | starcoder |
defmodule Forth do
defp exec(word, st) when is_integer(word), do: [word | st]
defp exec("+", [a, b | st]), do: [a + b | st]
defp exec("+", _), do: raise(Forth.StackUnderflow)
defp exec("-", [a, b | st]), do: [b - a | st]
defp exec("-", _), do: raise(Forth.StackUnderflow)
defp exec("*", [a, b | st]), do: [a ... | exercises/practice/forth/.meta/example.ex | 0.672869 | 0.482124 | example.ex | starcoder |
defmodule Kronos do
@moduledoc """
Kronos is a tool to facilitate the manipulation of dates (via Timestamps).
This library use the seconds as a reference.
iex> import Kronos
...> use Kronos.Infix
...> {:ok, t} = new({2010, 12, 20}, {0, 0, 0})
...> r = t + ~t(2)day + ~t(3)hour + ~t(10... | lib/kronos.ex | 0.898261 | 0.655749 | kronos.ex | starcoder |
defmodule RGBMatrix.Engine do
@moduledoc """
Renders [`Animation`](`RGBMatrix.Animation`)s and outputs colors to be
displayed by anything that registers itself with `register_paintable/2`.
"""
use GenServer
alias KeyboardLayout.LED
alias RGBMatrix.Animation
@type frame :: %{LED.id() => RGBMatrix.any_... | lib/rgb_matrix/engine.ex | 0.919081 | 0.519521 | engine.ex | starcoder |
defmodule Snitch.Data.Schema.Adjustment do
@moduledoc """
Models a generic `adjustment` to keep a track of adjustments
made against any entity.
Adjustments can be made against entities such as an `order` or
`lineitem` due to various reasons such as adding a promotion, or adding
taxes etc.
The adjustments... | apps/snitch_core/lib/core/data/schema/adjustment/adjustment.ex | 0.918663 | 0.764672 | adjustment.ex | starcoder |
defmodule Nebulex.Adapters.Dist do
@moduledoc """
Adapter module for distributed or partitioned cache.
A distributed, or partitioned, cache is a clustered, fault-tolerant cache
that has linear scalability. Data is partitioned among all the machines
of the cluster. For fault-tolerance, partitioned caches can ... | lib/nebulex/adapters/dist.ex | 0.869105 | 0.68856 | dist.ex | starcoder |
defmodule TrainLoc.Vehicles.Vehicles do
@moduledoc """
Functions for working with collections of vehicles.
"""
alias TrainLoc.Conflicts.Conflict
alias TrainLoc.Utilities.Time
alias TrainLoc.Vehicles.Vehicle
use Timex
require Logger
@spec new() :: %{}
@spec new([Vehicle.t()]) :: map
def new do
... | apps/train_loc/lib/train_loc/vehicles/vehicles.ex | 0.767036 | 0.545165 | vehicles.ex | starcoder |
defmodule Terrasol.Document do
@nul32 <<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0>>
@moduledoc """
Handling of the Earthstar document format and the resulting
`Terrasol.Document.t` structures
"""
@enforce_keys [
:author,
:content,
:... | lib/terrasol/document.ex | 0.688259 | 0.612744 | document.ex | starcoder |
defmodule Cldr.LanguageTag do
@moduledoc """
Represents a language tag as defined in [rfc5646](https://tools.ietf.org/html/rfc5646)
with extensions "u" and "t" as defined in [BCP 47](https://tools.ietf.org/html/bcp47).
Language tags are used to help identify languages, whether spoken,
written, signed, or oth... | lib/cldr/language_tag.ex | 0.856573 | 0.629832 | language_tag.ex | starcoder |
defmodule Game.Character do
@moduledoc """
Character GenServer client
A character is a player (session genserver) or an NPC (genserver). They should
handle the following casts:
- `{:targeted, player}`
- `{:apply_effects, effects, player}`
"""
alias Game.Character.Simple
alias Game.Character.Via
... | lib/game/character.ex | 0.860266 | 0.567907 | character.ex | starcoder |
defmodule Stopsel.Invoker do
@moduledoc """
Routes a message through a router.
This module relies on `Stopsel.Router` for matching the routes,
which ensures that only active routes will be tried to match against.
"""
alias Stopsel.{Command, Message, Router, Utils}
require Logger
@type reason :: Route... | lib/stopsel/invoker.ex | 0.884208 | 0.687787 | invoker.ex | starcoder |
defmodule Still.Compiler.ViewHelpers.ContentTag do
@moduledoc """
Implements an arbitrary content tag with the given content.
"""
@doc """
Renders an arbitrary HTML tag with the given content.
If `content` is `nil`, the rendered tag is self-closing.
`opts` should contain the relevant HTML attributes (e... | lib/still/compiler/view_helpers/content_tag.ex | 0.824356 | 0.497925 | content_tag.ex | starcoder |
defmodule AWS.Keyspaces do
@moduledoc """
Amazon Keyspaces (for Apache Cassandra) is a scalable, highly available, and
managed Apache Cassandra-compatible database service.
Amazon Keyspaces makes it easy to migrate, run, and scale Cassandra workloads in
the Amazon Web Services Cloud. With just a few clicks ... | lib/aws/generated/keyspaces.ex | 0.896407 | 0.480662 | keyspaces.ex | starcoder |
defmodule Job.Pipeline do
@moduledoc """
High-level interface for running `Job`-powered pipeline of actions.
A pipeline is a collection of actions which can be executed in sequence or parallel, and which
all have to succeed for the job to succeed.
## Example
Job.run(
Pipeline.sequence([
... | lib/job/pipeline.ex | 0.92329 | 0.943191 | pipeline.ex | starcoder |
defmodule Reactivity.DSL.EventStream do
@moduledoc """
The DSL for distributed reactive programming,
specifically, operations applicable to Event Streams.
"""
alias Reactivity.DSL.SignalObs, as: Sobs
alias Reactivity.DSL.Signal, as: Signal
alias ReactiveMiddleware.Registry
alias Observables.Obs
requi... | lib/reactivity/dsl/event_stream.ex | 0.900991 | 0.533094 | event_stream.ex | starcoder |
defmodule ShortMaps do
@default_modifier ?s
@doc ~S"""
Returns a map with the given keys bound to variables with the same name.
This macro sigil is used to reduce boilerplate when writing pattern matches on
maps that bind variables with the same name as the map keys. For example,
given a map that looks li... | lib/short_maps.ex | 0.82176 | 0.519948 | short_maps.ex | starcoder |
alias Graphqexl.Schema
alias Treex.Tree
defmodule Graphqexl.Query.ResultSet do
@moduledoc """
Result of a GraphQL `t:Graphqexl.Query.t/0` operation, including any errors
"""
@moduledoc since: "0.1.0"
defstruct data: %{}, errors: %{}
@type t :: %Graphqexl.Query.ResultSet{data: Map.t, errors: Map.t}
@doc... | lib/graphqexl/query/result_set.ex | 0.660282 | 0.570092 | result_set.ex | starcoder |
defmodule Evision.Nx do
@moduledoc """
OpenCV mat to Nx tensor.
`:nx` is an optional dependency, so if you want to use
functions in `OpenCV.Nx`, you need to add it to the dependency
list.
"""
import Evision.Errorize
unless Code.ensure_loaded?(Nx) do
@compile {:no_warn_undefined, Nx}
end
@do... | lib/opencv_nx.ex | 0.893386 | 0.89996 | opencv_nx.ex | starcoder |
defmodule AWS.KinesisVideo do
@moduledoc """
"""
@doc """
Creates a signaling channel.
`CreateSignalingChannel` is an asynchronous operation.
"""
def create_signaling_channel(client, input, options \\ []) do
path_ = "/createSignalingChannel"
headers = []
query_ = []
request(client, :po... | lib/aws/generated/kinesis_video.ex | 0.907501 | 0.536374 | kinesis_video.ex | starcoder |
defmodule Wow.AuctionBid do
@moduledoc """
Represent an item sold on the auction house. It doesn't contain when the item was added to the
auction house. This information is present in auction_timestamp.
"""
alias Wow.Repo
use Ecto.Schema
import Ecto.Query, only: [from: 2]
import Ecto.Changeset
@type... | lib/wow/auction_bid.ex | 0.595728 | 0.407982 | auction_bid.ex | starcoder |
defmodule EctoTrail do
@moduledoc """
EctoTrail allows to store changeset changes into a separate `audit_log` table.
## Usage
1. Add `ecto_trail` to your list of dependencies in `mix.exs`:
def deps do
[{:ecto_trail, "~> 0.1.0"}]
end
2. Ensure `ecto_trail` is started before your applica... | lib/ecto_trail/ecto_trail.ex | 0.807271 | 0.417865 | ecto_trail.ex | starcoder |
defmodule Defecto do
import ExUnit.Assertions
@moduledoc """
Convenient chainable assertions for Ecto changesets.
"""
defmacro __using__(options) do
quote do
import Defecto
@repo unquote(options[:repo])
end
end
@doc """
Assert a change is val... | lib/defecto.ex | 0.834542 | 0.624079 | defecto.ex | starcoder |
defmodule Resty.Resource do
@moduledoc """
This module provides a few functions to work with resource structs. Resource
structs are created thanks to the `Resty.Resource.Base` module.
"""
@typedoc """
A resource struct (also called a resource).
"""
@type t() :: struct()
@typedoc """
A resource mod... | lib/resty/resource.ex | 0.815453 | 0.59305 | resource.ex | starcoder |
defmodule PlugSigaws do
@moduledoc """
Plug to authenticate HTTP requests that have been signed using AWS Signature V4.
(Refer to this [Blog post](https://handnot2.github.io/blog/elixir/aws-signature-sigaws))
[](http://inch-ci.org/github/handno... | lib/plug_sigaws.ex | 0.898144 | 0.834002 | plug_sigaws.ex | starcoder |
defmodule Game do
@moduledoc """
Provides the functions from a hangman
"""
@doc """
Made a list of "-" whit the same size of a Word
## Parametres
- Letter_list: List of all letters of a Word
## Exemple
iex> Game.turn_ocult("Marcelo")
["-", "-", "-", "-", "-", "-... | hanged-alchemist.ex | 0.712532 | 0.671545 | hanged-alchemist.ex | starcoder |
defmodule BitstylesPhoenix.Component.Error do
use BitstylesPhoenix.Component
alias Phoenix.HTML.Form, as: PhxForm
@moduledoc """
Component for showing UI errors.
"""
@doc """
Render errors from a Phoenix.HTML.Form.
## Attributes
- `form` *(required)* - The form to render the input form.
- `field... | lib/bitstyles_phoenix/component/error.ex | 0.845002 | 0.443962 | error.ex | starcoder |
defmodule Exnoops.Directbot do
@moduledoc """
Module to interact with Github's Noop: Directbot
See the [official `noop` documentation](https://noopschallenge.com/challenges/directbot) for API information including the accepted parameters
"""
require Logger
import Exnoops.API
@noop "directbot"
@doc "... | lib/exnoops/directbot.ex | 0.765155 | 0.663973 | directbot.ex | starcoder |
defmodule Pandex do
@moduledoc ~S"""
Pandex is a lightweight ELixir wrapper for [Pandoc](http://pandoc.org). Pandex has no dependencies other than pandoc itself. Pandex enables you to convert Markdown, CommonMark, HTML, Latex, json, html to HTML, HTML5, opendocument, rtf, texttile, asciidoc, markdown, json and oth... | lib/pandex.ex | 0.746878 | 0.493714 | pandex.ex | starcoder |
defmodule Grizzly.ZWave.Commands.NodeInfoCacheReport do
@moduledoc """
Report the cached node information
This command is normally used to respond to the `NodeInfoCacheGet` command
Params:
- `:seq_number` - the sequence number of the network command, normally from
from the `NodeInfoCacheGet` command (r... | lib/grizzly/zwave/commands/node_info_cached_report.ex | 0.805632 | 0.488283 | node_info_cached_report.ex | starcoder |
defmodule LocalLedger.CachedBalance do
@moduledoc """
This module is an interface to the LocalLedgerDB Balance schema. It is responsible for caching
balances and serves as an interface to retrieve the current balances (which will either be
loaded from a cached balance or computed - or both).
"""
alias Local... | apps/local_ledger/lib/local_ledger/cached_balance.ex | 0.835383 | 0.538983 | cached_balance.ex | starcoder |
defmodule Shiftplaner.Event do
@moduledoc false
use Ecto.Schema
alias Shiftplaner.{Event, Repo, Weekend}
import Ecto.{Query, Changeset}, warn: false
require Logger
@primary_key {:id, :binary_id, autogenerate: true}
@foreign_key_type Ecto.UUID
@preloads :weekends
@type id :: String.t
@type t ::... | lib/shiftplaner/event.ex | 0.900102 | 0.623291 | event.ex | starcoder |
require Logger
defmodule ExoSQL.Parser do
@moduledoc """
Parsed an SQL statement into a ExoSQL.Query.
The Query then needs to be planned and executed.
It also resolves partial column and table names using data from the context
and its schema functions.
Uses leex and yecc to perform a first phase parsing... | lib/parser.ex | 0.647352 | 0.546194 | parser.ex | starcoder |
defmodule Zippy.ZForest do
@moduledoc """
Zipper forests are a zipper structure where each node is a list of
subtrees.You can iterate over this structure, and thus represent a minimum spanning tree, a DOM, an undo tree, etc.
Adding, replacing and deleting operations are constant time.
This module is a po... | lib/zippy/ZForest.ex | 0.816955 | 0.67684 | ZForest.ex | starcoder |
defmodule Toml do
@moduledoc File.read!(Path.join([__DIR__, "..", "README.md"]))
@type key :: binary | atom | term
@type opt ::
{:keys, :atoms | :atoms! | :string | (key -> term)}
| {:filename, String.t()}
| {:transforms, [Toml.Transform.t()]}
@type opts :: [opt]
@type reason :... | lib/toml.ex | 0.929176 | 0.646139 | toml.ex | starcoder |
defmodule Toby.Data.Applications do
@moduledoc """
Utilities for gathering application data such as the process tree.
"""
alias Toby.Data.Node
alias Toby.Util.Tree
def applications(node) do
{:ok, applications_in_tree(node)}
end
def application(node, app) do
with {:ok, data} <- Node.applicatio... | lib/toby/data/applications.ex | 0.651798 | 0.408129 | applications.ex | starcoder |
defmodule Mix.Tasks.Licenses do
@moduledoc """
Lists all dependencies along with a summary of their licenses.
This task checks each entry in dependency package's `:licenses` list against the SPDX License List.
To see details about licenses that are not found in the SPDX list, use `mix licenses.explain`.
#... | lib/mix/tasks/licenses.ex | 0.820829 | 0.435421 | licenses.ex | starcoder |
defmodule Veritaserum do
@moduledoc """
Sentiment analysis based on AFINN-165, emojis and some enhancements.
Also supports:
- emojis (❤️, 😱...)
- boosters (*very*, *really*...)
- negators (*don't*, *not*...).
"""
alias Veritaserum.Evaluator
@supported_languages ["pt", "es", "en"]
@doc """
Ret... | lib/veritaserum.ex | 0.684686 | 0.433142 | veritaserum.ex | starcoder |
defmodule HideInPng do
@moduledoc """
## Description
HideInPng is an Elixir module for hiding files within
PNG images.
## Examples
iex(2)> c "hideinpng.ex"
[HideInPng]
iex(3)> HideInPng.encode("imgs/dice.png", "imgs/mushroom.png")
:ok
iex(4)> HideInPng.decode("imgs/dice.png", "im... | hideinpng.ex | 0.617628 | 0.442817 | hideinpng.ex | starcoder |
defmodule HtmlBuilder do
@moduledoc """
The module holds the logic for building the HTML tree.
Instead of creating and injecting functions for each tag
into the caller's module, it post walks the AST and changes
nodes that represent a HTML tag. The nodes will be changed to
call the `tag` macro with the app... | lib/html_builder.ex | 0.592077 | 0.422803 | html_builder.ex | starcoder |
defmodule FlowAssertions.AssertionA do
@moduledoc """
Assertions used to test other assertions.
These assertions do not work on the textual output of an assertion
error. Instead, they inspect the internals of the
`ExUnit.AssertionError` structure. Here is an example:
```elixir
assertion_fails(
... | lib/assertion_a.ex | 0.930482 | 0.97372 | assertion_a.ex | starcoder |
defmodule Commodity.ChannelCase do
@moduledoc """
This module defines the test case to be used by
channel tests.
Such tests rely on `Phoenix.ChannelTest` and also
import other functionality to make it easier
to build common datastructures and query the data layer.
Finally, if the test case interacts wit... | test/support/channel_case.ex | 0.702938 | 0.438485 | channel_case.ex | starcoder |
defmodule Transmission do
use ExActor.GenServer
alias Transmission.Api
alias Transmission.TorrentAdd
alias Transmission.TorrentGet
alias Transmission.TorrentReannounce
alias Transmission.TorrentRemove
alias Transmission.TorrentStart
alias Transmission.TorrentStartNow
alias Transmission.TorrentStop
... | lib/transmission.ex | 0.550607 | 0.428981 | transmission.ex | starcoder |
defmodule RTQueue do
@moduledoc """
An elixir realtime queue implement.
"""
@typedoc """
The state type in the RTQueue module stands for the reverse state of the queue.
"""
@type state :: :Empty
| {:Reverse, non_neg_integer, list, list, list, list}
| {:Concat, non_neg... | lib/exqueue.ex | 0.776114 | 0.497681 | exqueue.ex | starcoder |
defmodule Day21 do
@weapons [%{cost: 8, damage: 4},
%{cost: 10, damage: 5},
%{cost: 25, damage: 6},
%{cost: 40, damage: 7},
%{cost: 74, damage: 8}]
@armor [%{cost: 13, armor: 1},
%{cost: 31, armor: 2},
%{cost: 53, armor: 3},
%{cost: ... | day21/lib/day21.ex | 0.576304 | 0.628906 | day21.ex | starcoder |
defmodule Framebuffer do
@moduledoc """
Abstraction over Linux framebuffer devices.
## Linux headers
- [linux/fb.h](https://github.com/torvalds/linux/blob/master/include/linux/fb.h)
- [uapi/linux/fb.h](https://github.com/torvalds/linux/blob/master/include/uapi/linux/fb.h)
## Linux documentation
- [fb ... | lib/framebuffer.ex | 0.872266 | 0.554048 | framebuffer.ex | starcoder |
defmodule Nostrum.Struct.Permission do
@moduledoc """
Functions that work on permissions.
Some functions return a list of permissions. You can use enumerable functions
to work with permissions:
```Elixir
alias Nostrum.Cache.GuildCache
alias Nostrum.Struct.Guild.Member
guild = GuildCache.get!(27909338... | lib/nostrum/struct/permission.ex | 0.892834 | 0.771026 | permission.ex | starcoder |
defmodule PlugCacheControl.Header do
@moduledoc false
@typep maybe(t) :: t | nil
@type t :: %__MODULE__{
must_revalidate: maybe(boolean()),
no_cache: maybe(boolean()),
no_store: maybe(boolean()),
no_transform: maybe(boolean()),
proxy_revalidate: maybe(boolean()),... | lib/plug_cache_control/header.ex | 0.787278 | 0.431345 | header.ex | starcoder |
defmodule ExVault.KV2 do
@moduledoc """
A wrapper over the basic operations for working with KV v2 data.
Construct a *backend*--a client paired with the mount path for the `kv`
version 2 secrets engine it interacts with--using the `ExVault.KV2.new/2`
function.
Each of the operations in this module have a ... | lib/exvault/kv2.ex | 0.666822 | 0.745097 | kv2.ex | starcoder |
defmodule AWS.Textract do
@moduledoc """
Amazon Textract detects and analyzes text in documents and converts it into
machine-readable text.
This is the API reference documentation for Amazon Textract.
"""
alias AWS.Client
alias AWS.Request
def metadata do
%AWS.ServiceMetadata{
abbreviation... | lib/aws/generated/textract.ex | 0.914796 | 0.644756 | textract.ex | starcoder |
defmodule ReconLib do
require :recon_lib
@moduledoc """
Regroups useful functionality used by recon when dealing with data
from the node. The functions in this module allow quick runtime
access to fancier behaviour than what would be done using recon
module itself.
"""
@type diff :: [Recon.proc_attrs(... | lib/recon_lib.ex | 0.876178 | 0.505066 | recon_lib.ex | starcoder |
defmodule Map.Element do
@type single() :: Map.Node.t() | Map.Way.t() | Map.Relation.t()
@type collection() :: [single()]
@type indexed_collection() :: %{binary() => single()}
@typep flexible_collection() :: collection() | indexed_collection()
@spec filter_by_tag(flexible_collection(), atom(), binary() | [bi... | lib/map/element.ex | 0.79653 | 0.416559 | element.ex | starcoder |
defmodule AWS.Datapipeline do
@moduledoc """
AWS Data Pipeline configures and manages a data-driven workflow called a
pipeline. AWS Data Pipeline handles the details of scheduling and ensuring
that data dependencies are met so that your application can focus on
processing the data.
AWS Data Pipeline provi... | lib/aws/generated/datapipeline.ex | 0.904368 | 0.823506 | datapipeline.ex | starcoder |
defmodule SimpleBudget.Calculations.Daily do
@moduledoc false
import Ecto.Query
alias SimpleBudget.Repo
def all do
remaining = remaining()
remaining_per_day = remaining_per_day(remaining)
%{
remaining: remaining,
remaining_per_day: remaining_per_day
}
end
defp remaining do
... | lib/simple_budget/calculations/daily.ex | 0.613352 | 0.401013 | daily.ex | starcoder |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.