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.FSx do @moduledoc """ Amazon FSx is a fully managed service that makes it easy for storage and application administrators to launch and use shared file storage. """ @doc """ Cancels an existing Amazon FSx for Lustre data repository task if that task is in either the `PENDING` or `EXECUTING...
lib/aws/fsx.ex
0.847211
0.588357
fsx.ex
starcoder
defmodule Pbkdf2 do @moduledoc """ Elixir wrapper for the Pbkdf2 password hashing function. Most applications will just need to use the `add_hash/2` and `check_pass/3` convenience functions in this module. For a lower-level API, see Pbkdf2.Base. ## Configuration The following parameter can be set in t...
lib/pbkdf2.ex
0.891289
0.549761
pbkdf2.ex
starcoder
defmodule Shapeshifter.BOB do @moduledoc """ Module for converting to and from [`BOB`](`t:Shapeshifter.bob/0`) structured maps. Usually used internally, although can be used directly for specific use cases such as converting single inputs and outputs to and from [`BOB`](`t:Shapeshifter.bob/0`) formatted ma...
lib/shapeshifter/bob.ex
0.775732
0.706273
bob.ex
starcoder
defmodule EctoList.ListItem do @moduledoc """ Implements conveniences to change the items order of a list. """ @doc """ Insert an list item id in the given index of an order_list iex> EctoList.ListItem.insert_at([1, 2, 3, 4], 9, 2) [1, 9, 2, 3, 4] iex> EctoList.ListItem.insert_at([1, 2, 3...
lib/ecto_list/list_item.ex
0.617282
0.452294
list_item.ex
starcoder
defmodule Bolt.Sips.Success do @moduledoc """ Bolt returns success or Error, in response to our requests. """ alias __MODULE__ alias Bolt.Sips.Error defstruct fields: nil, type: nil, records: nil, stats: nil, notifications: nil, plan: nil, ...
lib/bolt_sips/success.ex
0.721056
0.450662
success.ex
starcoder
defmodule Zigler.Parser.Error do @moduledoc """ parses errors emitted by the zig compiler """ import NimbleParsec require Logger @numbers [?0..?9] whitespace = ascii_string([?\s, ?\n], min: 1) errormsg = ignore(repeat(ascii_char([?\s]))) |> ascii_string([not: ?:], min: 1) |> ignore(strin...
lib/zigler/parser/error.ex
0.699152
0.431405
error.ex
starcoder
defmodule Pundit.DefaultPolicy do @moduledoc """ Default access policies for a given type. All of the functions here are named for actions in a [Phoenix controller](https://hexdocs.pm/phoenix/controllers.html#actions). If you `use` this module, then default implementations will be added in your module that al...
lib/pundit/default_policy.ex
0.875361
0.444806
default_policy.ex
starcoder
defmodule Exdis.Int64 do ## ------------------------------------------------------------------ ## Constant Definitions ## ------------------------------------------------------------------ @min -0x8000000000000000 @max +0x7FFFFFFFFFFFFFFF @max_decimal_string_length 20 ## --------------------------------...
lib/exdis/int64.ex
0.569613
0.435511
int64.ex
starcoder
defmodule AppOptex do alias AppOptex.{Worker, Client} @moduledoc """ Client library for sending and reading AppOptics API measurements. To auth AppOptics make sure to set the `APPOPTICS_TOKEN` environment variable. This can also be overridden in the Application config. """ @doc """ Send one measurement wi...
lib/app_optex.ex
0.909972
0.459804
app_optex.ex
starcoder
defmodule K8s.Client do @moduledoc """ An experimental k8s client. Functions return `K8s.Client.Operation`s that represent kubernetes operations. To run operations pass them to: `run/2`, `run/3`, or `run/4`. When specifying kinds the format should either be in the literal kubernetes kind name (eg `"Service...
lib/k8s/client.ex
0.912806
0.629091
client.ex
starcoder
defmodule Scenic.Primitive.Group do @moduledoc """ A container to hold other primitives. Any styles placed on a group will be inherited by the primitives in the group. Any transforms placed on a group will be multiplied into the transforms in the primitives in the group. ## Data `uids` The data fo...
lib/scenic/primitive/group.ex
0.901796
0.828037
group.ex
starcoder
defmodule ExSieve.Node.Grouping do @moduledoc false defstruct conditions: nil, combinator: nil, groupings: [] @type t :: %__MODULE__{} alias ExSieve.Node.{Grouping, Condition} alias ExSieve.{Config, Utils} @combinators ~w(or and) @spec extract(%{binary => term}, atom, Config.t) :: t | {:error, :predi...
lib/ex_sieve/node/grouping.ex
0.733547
0.403714
grouping.ex
starcoder
defmodule ExHal.Document do @moduledoc """ A document is the representaion of a single resource in HAL. """ @opaque t :: %__MODULE__{} alias ExHal.{Link, NsReg, Client} defstruct properties: %{}, links: %{}, client: @doc(""" Returns a new `%ExHal.Docu...
lib/exhal/document.ex
0.880226
0.521532
document.ex
starcoder
defmodule Q do @moduledoc """ Documentation for Q ( Elixir Quantum module ). """ require Math @doc """ |0> qubit ... ( 1, 0 ) ## Examples iex> Q.q0() %Array{array: [1, 0], shape: {2, nil}} iex> Q.q0().array [ 1, 0 ] """ def q0(), do: Numexy.new( [ 1, 0 ] ) @doc """ |1> qubit ... ( 0, 1 ) ## Exa...
lib/q.ex
0.627038
0.637891
q.ex
starcoder
defmodule Aino do @moduledoc """ Aino, an experimental HTTP framework To load Aino, add to your supervision tree. `callback` and `port` are both required options. ```elixir children = [ {Aino, [callback: Aino.Handler, port: 3000]} ] ``` The `callback` should be an `Aino.Handler`, which has ...
lib/aino.ex
0.795301
0.686521
aino.ex
starcoder
defmodule Collision.Polygon.Edge do @moduledoc """ An edge; the connection between two vertices. Represented as a point, the next point that its connected to, and the length between them. """ defstruct point: nil, next: nil, length: nil alias Collision.Polygon.Edge alias Collision.Polygon.Vertex ali...
lib/collision/polygon/edge.ex
0.938801
0.969032
edge.ex
starcoder
defmodule Dmage.Range.Calculator do @faces 6 @defence 3 def probable_damage_in_open([attacks, skill, damage_normal, damage_crit, save]) do hits = attacks(attacks, skill) saves = saves(@defence, save, 0) resolve(hits, saves, {damage_normal, damage_crit}) |> Tuple.sum() end def probable_damage...
lib/dmage/range.ex
0.538012
0.472136
range.ex
starcoder
defmodule SimpleMqtt do alias SimpleMqtt.Subscriptions use GenServer require Logger @type package_identifier() :: 0x0001..0xFFFF | nil @type topic() :: String.t() @type topic_filter() :: String.t() @type payload() :: binary() | nil @moduledoc """ The SimpleMqtt is a basic, single node pub-sub implem...
lib/simple_mqtt.ex
0.876667
0.844088
simple_mqtt.ex
starcoder
defmodule AmqpDirector do @moduledoc """ Documentation for AmqpDirector. This module provides wrapping for the Erlang code and is intended to be used with Elixir applications. """ require AmqpDirector.Queues defmodule Definitions do require Record Record.defrecord( :basic_deliver, :"b...
lib/amqp_director.ex
0.83612
0.634204
amqp_director.ex
starcoder
defmodule AWS.GuardDuty do @moduledoc """ Amazon GuardDuty is a continuous security monitoring service that analyzes and processes the following data sources: VPC Flow Logs, AWS CloudTrail event logs, and DNS logs. It uses threat intelligence feeds (such as lists of malicious IPs and domains) and machine lea...
lib/aws/guard_duty.ex
0.82748
0.513851
guard_duty.ex
starcoder
use Croma defmodule Antikythera.Websocket do @moduledoc """ Behaviour module for websocket handlers. Note the naming convention of the websocket-related modules; we use `Websocket`, `WebSocket` is not allowed. Websocket module of gears must `use` this module as in the example below. `use Antikythera.Webso...
lib/web/websocket.ex
0.855066
0.444083
websocket.ex
starcoder
defmodule Frankt do @moduledoc """ Run client-side actions from the backend. Frankt provides a thin layer over Phoenix channels which allows running client-side actions from the backend. Since the logic of those actions lives in the backend, they can leverage all the [`Elixir`][1] and `Phoenix` capabilities....
lib/frankt.ex
0.845544
0.731826
frankt.ex
starcoder
defmodule Record.Extractor do @moduledoc false # Retrieve a record definition from an Erlang file using # the same lookup as the *include* attribute from Erlang modules. def retrieve(name, from: file) when is_binary(file) do file = String.to_char_list!(file) realfile = case :code.where_is_file(f...
lib/elixir/lib/record/extractor.ex
0.714927
0.595875
extractor.ex
starcoder
defmodule Kantele.Brain do @moduledoc """ Load and parse brain data into behavior tree structs """ @brains_path "data/brains" @doc """ Load brain data from the path Defaults to `#{@brains_path}` """ def load_all(path \\ @brains_path) do File.ls!(path) |> Enum.filter(fn file -> String....
example/lib/kantele/brain.ex
0.721939
0.498352
brain.ex
starcoder
defmodule ExUnit.CaptureLog do @moduledoc ~S""" Functionality to capture logs for testing. ## Examples defmodule AssertionTest do use ExUnit.Case import ExUnit.CaptureLog require Logger test "example" do assert capture_log(fn -> Logger.error("...
lib/ex_unit/lib/ex_unit/capture_log.ex
0.834086
0.643238
capture_log.ex
starcoder
defmodule Timex.DateTime.Helpers do @moduledoc false alias Timex.{Types, Timezone, TimezoneInfo, AmbiguousDateTime, AmbiguousTimezoneInfo} @type precision :: -1 | 0..6 @doc """ Constructs an empty DateTime, for internal use only """ def empty() do %DateTime{ year: 0, month: 1, day...
lib/datetime/helpers.ex
0.843428
0.413773
helpers.ex
starcoder
defmodule EventStore.Storage do @moduledoc false alias EventStore.Snapshots.SnapshotData alias EventStore.Storage alias EventStore.Storage.{ Appender, CreateStream, QueryStreamInfo, Reader, Snapshot, Subscription } @doc """ Initialise the PostgreSQL database by creating the tabl...
lib/event_store/storage.ex
0.81309
0.416352
storage.ex
starcoder
defmodule Ecto.Reflections.HasOne do @moduledoc """ The reflection record for a `has_one` association. Its fields are: * `field` - The name of the association field on the model; * `owner` - The model where the association was defined; * `associated` - The model that is associated; * `key` - The key on the...
lib/ecto/associations/has_one.ex
0.847005
0.542803
has_one.ex
starcoder
defmodule RDF.NTriples.Encoder do @moduledoc """ An encoder for N-Triples serializations of RDF.ex data structures. As for all encoders of `RDF.Serialization.Format`s, you normally won't use these functions directly, but via one of the `write_` functions on the `RDF.NTriples` format module or the generic `RD...
lib/rdf/serializations/ntriples_encoder.ex
0.81409
0.480966
ntriples_encoder.ex
starcoder
defmodule Oban.Worker do @moduledoc """ Defines a behavior and macro to guide the creation of worker modules. Worker modules do the work of processing a job. At a minimum they must define a `perform/2` function, which will be called with an `args` map and the job struct. ## Defining Workers Define a work...
lib/oban/worker.ex
0.919782
0.908252
worker.ex
starcoder
defmodule AWS.Route53Resolver do @moduledoc """ When you create a VPC using Amazon VPC, you automatically get DNS resolution within the VPC from Route 53 Resolver. By default, Resolver answers DNS queries for VPC domain names such as domain names for EC2 instances or Elastic Load Balancing load balancers. R...
lib/aws/generated/route53_resolver.ex
0.914362
0.428771
route53_resolver.ex
starcoder
defmodule K8s.Client do @moduledoc """ Kubernetes API Client. Functions return `K8s.Operation`s that represent kubernetes operations. To run operations pass them to: `run/2`, or `run/3` When specifying kinds the format should either be in the literal kubernetes kind name (eg `"ServiceAccount"`) or the do...
lib/k8s/client.ex
0.919728
0.653155
client.ex
starcoder
defmodule AWS.Sdb do @moduledoc """ Amazon SimpleDB is a web service providing the core database functions of data indexing and querying in the cloud. By offloading the time and effort associated with building and operating a web-scale database, SimpleDB provides developers the freedom to focus on applica...
lib/aws/generated/sdb.ex
0.916458
0.71677
sdb.ex
starcoder
defmodule GSS.Client do @moduledoc """ Model of Client abstraction This process is a Producer for this GenStage pipeline. """ use GenStage require Logger defmodule RequestParams do @type t :: %__MODULE__{ method: atom(), url: binary(), body: HTTP...
lib/elixir_google_spreadsheets/client.ex
0.928417
0.422713
client.ex
starcoder
defmodule ElixirRigidPhysics.Geometry.Plane do @moduledoc """ Functions for creating and inteacting with [planes](https://en.wikipedia.org/wiki/Plane_(geometry)). Planes are all points `{x,y,z}` that fulfill the equation `ax + by + cz + d = 0`. We represent planes in the form: `{a,b,c,d}`, where `{a,b,c}` is ...
lib/geometry/plane.ex
0.937918
0.854095
plane.ex
starcoder
defmodule Day4 do def from_file(path) do File.stream!(path) |> Enum.sort |> Enum.map(&parse_row/1) end def parse_row(row) do [date, hour, minute, action] = Regex.run(~r{\[(\d\d\d\d-\d\d-\d\d) (\d\d):(\d\d)\] (.*)}, row, capture: :all_but_first) {date, hour, String.to_integer(minute), parse_ac...
lib/day4.ex
0.513181
0.490663
day4.ex
starcoder
defmodule Cocktail.Builder.String do @moduledoc """ Build human readable strings from schedules. This module exposes functions for building human readable string representations of schedules. It currently only represents the recurrence rules of a schedule, and doesn't indicate the start time, duration, nor a...
lib/cocktail/builder/string.ex
0.87892
0.589805
string.ex
starcoder
defmodule Tensorflow.AttrValue.ListValue do @moduledoc false use Protobuf, syntax: :proto3 @type t :: %__MODULE__{ s: [binary], i: [integer], f: [float | :infinity | :negative_infinity | :nan], b: [boolean], type: [[Tensorflow.DataType.t()]], shape: [Te...
lib/tensorflow/core/framework/attr_value.pb.ex
0.827131
0.767864
attr_value.pb.ex
starcoder
defmodule Juvet.Superintendent do @moduledoc """ Process that acts as the brains around processes within Juvet. It starts the `Juvet.BotFactory` process only if the configuration is valid. It delegates calls around the bot processes to the bot factory supervisor. """ use GenServer defmodule State do...
lib/juvet/superintendent.ex
0.828315
0.733428
superintendent.ex
starcoder
defmodule Instream.Series do @moduledoc """ ## Series Definition Series definitions can be used to have a fixed structured usable for reading and writing data to an InfluxDB server: defmodule MySeries.CPULoad do use Instream.Series series do measurement "cpu_load" t...
lib/instream/series.ex
0.90225
0.803097
series.ex
starcoder
defmodule ExPixBRCode.Payments.DynamicPixLoader do @moduledoc """ Load either a :dynamic_payment_immediate or a :dynamic_payment_with_due_date from a url. Dynamic payments have a URL inside their text representation which we should use to validate the certificate chain and signature and fill a Pix payment mode...
lib/ex_pix_brcode/payments/dynamic_pix_loader.ex
0.784773
0.460471
dynamic_pix_loader.ex
starcoder
defmodule SpadesGame.GameUI do @moduledoc """ One level on top of Game. """ alias SpadesGame.{Card, Game, GameOptions, GameUI, GameUISeat} @derive Jason.Encoder defstruct [:game, :game_name, :options, :created_at, :status, :seats, :when_seats_full] use Accessible @type t :: %GameUI{ game: ...
backend/lib/spades_game/ui/game_ui.ex
0.768125
0.44553
game_ui.ex
starcoder
defmodule Services.Search.TokenManager do @moduledoc """ Manages and refreshes access tokens which have a defined expiry period. """ require Logger defmodule TokenDefinition do @moduledoc """ Represents a token with an expiry period, along with a method of re-acquiring the token once it expires ...
apps/services/lib/services/search/token_manager.ex
0.874661
0.627181
token_manager.ex
starcoder
defmodule Day12 do def part1(input) do ship = {0, 0} direction = 1 parse(input) |> Enum.reduce({ship, direction}, &execute_part1/2) |> distance end def part2(input) do ship = {0, 0} waypoint = {10, 1} parse(input) |> Enum.reduce({ship, waypoint}, &execute_part2/2) |> dista...
day12/lib/day12.ex
0.708414
0.617686
day12.ex
starcoder
defmodule FlowAssertions.Define.BodyParts do import ExUnit.Assertions alias ExUnit.AssertionError import FlowAssertions.Define.Defchain alias FlowAssertions.Messages @moduledoc """ Functions helpful in the construction of a new assertion. Mostly, they give you more control over what's shown in a faili...
lib/define/body_parts.ex
0.845002
0.942929
body_parts.ex
starcoder
defmodule Ecto.Adapters.Mnesia.Query do @moduledoc false import Ecto.Adapters.Mnesia.Table, only: [ record_field_index: 2 ] alias Ecto.Adapters.Mnesia alias Ecto.Query.QueryExpr require Qlc defstruct type: nil, codepath: nil, sources: nil, query: nil, ...
lib/ecto/adapters/mnesia/query.ex
0.648689
0.522811
query.ex
starcoder
defmodule Matrex do @moduledoc """ Performs fast operations on matrices using native C code and CBLAS library. ## Access behaviour Access behaviour is partly implemented for Matrex, so you can do: ```elixir iex> m = Matrex.magic(3) #Matrex[3×3] ┌ ┐ │ 8.0...
lib/matrex.ex
0.916352
0.883789
matrex.ex
starcoder
defmodule Vnu.Message do @moduledoc """ A message is a unit of information returned by the Checker. See [its documentation](https://github.com/validator/validator/wiki/Output-%C2%BB-JSON#media-type) for detailed up to date information about its output format. ## Fields - `:type` - One of `:error`, `:info`, ...
lib/vnu/message.ex
0.793546
0.595346
message.ex
starcoder
defmodule Hui.URL do @moduledoc """ Struct and utilities for working with Solr URLs and parameters. Use the module `t:Hui.URL.t/0` struct to specify Solr core or collection URLs with request handlers. ### Hui URL endpoints ``` # binary url = "http://localhost:8983/solr/collection" Hui.search(...
lib/hui/url.ex
0.846086
0.70524
url.ex
starcoder
defmodule Calcinator.Alembic.Document do @moduledoc """ `Alembic.Document.t` for errors added by `Calcinator` on top of `Alembic.Error` """ alias Alembic.Document alias Calcinator.Alembic.Error @doc """ Retort returned a 500 JSONAPI error inside a 422 JSONRPC error. """ @spec bad_gateway() :: Docume...
lib/calcinator/alembic/document.ex
0.848628
0.554169
document.ex
starcoder
defmodule SchedEx.Runner do @moduledoc false use GenServer @doc """ Main point of entry into this module. Starts and returns a process which will run the given function per the specified delay definition (can be an integer unit as derived from a TimeScale, or a CronExpression) """ def run(func, delay_...
lib/sched_ex/runner.ex
0.784938
0.466359
runner.ex
starcoder
defmodule DelveExamples do @moduledoc false use Boundary, check: [in: true, out: false] alias Delve.{Planner, Resolver} # {:ok, {g, a}} = DelveExamples.test_ast_alt() def test_ast_alt do extra_resolvers = [ resolver({Complex, :r40}, [], [{Complex, :c}], &lookup/3), resolver({Complex, :r41}, [...
test/support/delve_examples.ex
0.709724
0.4881
delve_examples.ex
starcoder
defmodule Oli.Delivery.Paywall.Payment do use Ecto.Schema import Ecto.Changeset @moduledoc """ Modeling of a payment. Payments can be one of two types: direct or deferred. A direct payment is a payment made by a student through a system supported payment provider (e.g. Stripe or Cashnet). A deferred pa...
lib/oli/delivery/paywall/payment.ex
0.636466
0.431824
payment.ex
starcoder
defmodule RobotSimulator do @directions [:north, :east, :south, :west] defguard is_position(x, y) when is_integer(x) and is_integer(y) defguard is_direction(direction) when direction in @directions @doc """ Create a Robot Simulator given an initial direction and position. Valid directions are: `:north`, `...
elixir/robot-simulator/lib/robot_simulator.ex
0.88715
0.830216
robot_simulator.ex
starcoder
defmodule Grax.RDF.Access do @moduledoc !""" This encapsulates the access functions to the RDF data. It is intended to become an adapter to different types of data sources. """ alias RDF.{Description, Graph, Query} alias Grax.Schema.LinkProperty alias Grax.InvalidResourc...
lib/grax/rdf/access.ex
0.781831
0.533458
access.ex
starcoder
defmodule BencheeDsl.Benchmark do @moduledoc """ Helpers for defining a benchmark with the DSL. This module must be used to define and configure a benchmark. """ alias BencheeDsl.Server @keys [ :config, :description, :dir, :module, :title ] @type keys :: :config ...
lib/benchee_dsl/benchmark.ex
0.804675
0.568506
benchmark.ex
starcoder
defmodule EntropyString.Error do @moduledoc """ Errors raised when defining a EntropyString module with invalid options """ defexception message: "EntropyString error" end defmodule EntropyString do alias EntropyString.CharSet @moduledoc """ Efficiently generate cryptographically strong random strings ...
lib/entropy_string.ex
0.926976
0.580649
entropy_string.ex
starcoder
defmodule Mongo.OrderedBulk do @moduledoc """ An **ordered** bulk is filled in the memory with the bulk operations. If the ordered bulk is written to the database, the order is preserved. Only same types of operation are grouped and only if they have been inserted one after the other. ## Example ``` alia...
lib/mongo/ordered_bulk.ex
0.941061
0.916783
ordered_bulk.ex
starcoder
defmodule Site.TripPlan.Query do alias TripPlan.{Itinerary, NamedPosition} defstruct [ :from, :to, :itineraries, errors: MapSet.new(), time: :unknown, wheelchair_accessible?: false ] @type position_error :: TripPlan.Geocode.error() | :same_address @type position :: NamedPosition.t() ...
apps/site/lib/site/trip_plan/query.ex
0.834339
0.460046
query.ex
starcoder
defmodule Certbot.Provider.Acme do @moduledoc """ Certificate provider for the Acme protocol When a request is made for a hostname, the provider will look into the certificate store (`Certbot.CertificateStore`) to see whether it has a certificate for that hostname. If so, it will return the certificate. ...
lib/certbot/provider/acme.ex
0.882713
0.773559
acme.ex
starcoder
defmodule Ecto.ULID do @moduledoc """ An Ecto type for ULID strings. """ @default_params %{variant: :b32} # replace with `use Ecto.ParameterizedType` after Ecto 3.2.0 is required @behaviour Ecto.ParameterizedType # and remove both of these functions def embed_as(_, _params), do: :self def equal?(ter...
lib/ecto/ulid.ex
0.745306
0.400105
ulid.ex
starcoder
defmodule Rmc.RaceState do @moduledoc """ This agent holds state about the race. The state is a map. The :racers key holds all the data about racers: (TODO) - motion - setup - status - lap - participant - telemetry """ alias Rmc.FOne2018.{Lap, Laps} use Agent @name __MODULE__ def start_...
lib/rmc/race_state.ex
0.5144
0.535524
race_state.ex
starcoder
defmodule Augur.Twilio do @moduledoc """ Twilio service for Augur Sends texts via Twilio messaging API Configuration required: - `account_sid`: Find this on the Twilio Dashboard - `auth_token`: Find this on the Twilio Dashboard ``` config = %Augur.Twilio{account_sid: "account_sid", auth_token: "<PASS...
lib/augur/twilio.ex
0.783326
0.676904
twilio.ex
starcoder
defmodule Serum.Plugins.RssGenerator do @moduledoc """ A Serum plugin that creates an RSS feed ## Using the Plugin # serum.exs: %{ server_root: "https://example.io", plugins: [ {Serum.Plugins.RssGenerator, only: :prod} ] } """ @behaviour Serum.Plugin s...
lib/serum/plugins/rss_generator.ex
0.68941
0.416025
rss_generator.ex
starcoder
defmodule KafkaEx.ConsumerGroup do @moduledoc """ A process that manages membership in a Kafka consumer group. Consumers in a consumer group coordinate with each other through a Kafka broker to distribute the work of consuming one or several topics without any overlap. This is facilitated by the [Kafka cli...
lib/kafka_ex/consumer_group.ex
0.938379
0.845751
consumer_group.ex
starcoder
defmodule ElixirRPG.World do use GenServer alias ElixirRPG.World alias ElixirRPG.Entity alias ElixirRPG.Entity.EntityStore require Logger @initial_state %World.Data{target_tick_rate: 15, last_tick: nil} def start_link(name, live_view_frontend \\ nil) when is_atom(name) do GenServer.start_link(__MO...
lib/world/world.ex
0.627723
0.409398
world.ex
starcoder
defmodule TinyColor.HSL do @moduledoc """ Represents a color in the for of red, green, blue, and optional alpha """ defstruct hue: 0.0, saturation: 0.0, lightness: 0.0, alpha: 1.0 import TinyColor.Normalize @doc ~S""" Returns a string representation of this color. hex is only supported if alpha == 1.0 ...
lib/tiny_color/spaces/hsl.ex
0.893244
0.643567
hsl.ex
starcoder
defmodule FloUI.Tabs do alias Scenic.Graph alias Scenic.Primitive @moduledoc ~S""" ## Usage in SnapFramework The following example uses FloUI.Tabs and Grid to lay the tabs out. Iterates over the @tabs assign to render each tab. @module.get_tab_width runs FontMetrics on the label to get the width. ``` e...
lib/tabs/tabs.ex
0.801081
0.70724
tabs.ex
starcoder
defmodule Rummage.Ecto.CustomHook.KeysetPaginate do @moduledoc """ `Rummage.Ecto.CustomHook.KeysetPaginate` is an example of a Custom Hook that comes with `Rummage.Ecto`. This module uses `keyset` pagination to add a pagination query expression on top a given `Ecto.Queryable`. For more information on Keys...
lib/rummage_ecto/custom_hooks/keyset_paginate.ex
0.819063
0.879302
keyset_paginate.ex
starcoder
defmodule Alfred.Result do @moduledoc """ Represents a result to be displayed in an Alfred search list. Every result is required to have a title and a subtitle. Beyond this, there are many optional attributes that are helpful in various scenarios: * `:arg` *(recommended)* &mdash; Text that is passed to conn...
lib/alfred/result.ex
0.901707
0.890913
result.ex
starcoder
defmodule Baud do @moduledoc """ Serial port module. ```elixir tty = case :os.type() do {:unix, :darwin} -> "cu.usbserial-FTYHQD9MA" {:unix, :linux} -> "ttyUSB0" {:win32, :nt} -> "COM5" end #Try this with a loopback {:ok, pid} = Baud.start_link([device: tty]) Baud.writ...
lib/Baud.ex
0.768733
0.571348
Baud.ex
starcoder
defmodule EctoFixtures.Conditioners.Associations do import EctoFixtures.Conditioners.PrimaryKey, only: [generate_key_value: 3] def process(data, path) do table_path = path |> Enum.take(2) model = get_in(data, table_path ++ [:model]) Enum.reduce model.__schema__(:associations), data, fn(association_nam...
lib/ecto/fixtures/conditioners/associations.ex
0.618089
0.512205
associations.ex
starcoder
defmodule Day11 do @spec part1(integer(), any(), any(), integer(), any()) :: any() def part2(w \\ 300, h \\ 300, serial \\ 9810) do grid = gen_grid(w, h, serial) # Brute forced it with inspect... figured 13x13 or 13th pass # gives the most optimal power level for x1 <- 1..14, do: {x1, get_m...
lib/day11.ex
0.544922
0.608187
day11.ex
starcoder
defmodule ZenMonitor.Metrics do @moduledoc """ Metrics helper for monitoring the ZenMonitor system. """ alias Instruments.Probe @doc """ Registers various probes for the ZenMonitor System. - ERTS message_queue_len for the `ZenMonitor.Local` and `ZenMonitor.Proxy` processes. - Internal Batch Queue ...
lib/zen_monitor/metrics.ex
0.743913
0.425277
metrics.ex
starcoder
defmodule Nerves.UART do @moduledoc """ Fake out Nerves.UART, mostly for unit testing. """ use GenServer @enforce_keys [:port, :client] defstruct port: nil, client: nil, reactions: [], written: [] @opaque t :: %__MODULE__{port: String.t, client: pid, ...
lib/nerves/uart.ex
0.777469
0.41742
uart.ex
starcoder
defmodule Bundesbank do @moduledoc ~S""" A collection of German Bank Data including BIC, Bankcodes, PAN and more useful information based on the [Bundesbank Data Set](https://www.bundesbank.de/de/aufgaben/unbarer-zahlungsverkehr/serviceangebot/bankleitzahlen/download-bankleitzahlen-602592) **Current Data Set is ...
lib/bundesbank.ex
0.838548
0.880592
bundesbank.ex
starcoder
defmodule Expline.Spline do alias Expline.Matrix alias Expline.Vector @closeness_threshold 1.0e-15 @moduledoc """ `Expline.Spline` is the module defining the struct and functions for constructing cubic splines and interpolating values along them. It is the core module and data structure for the library....
lib/expline/spline.ex
0.945109
0.982641
spline.ex
starcoder
defmodule Cartel.HTTP do @moduledoc false alias Cartel.HTTP.{Request, Response} @type t :: %__MODULE__{conn: Mint.HTTP.t() | nil} @type scheme :: :http | :https @type status :: integer() @type host :: String.t() @type method :: String.t() @type url :: String.t() @type body :: iodata() | nil @type ...
lib/cartel/http.ex
0.886623
0.600891
http.ex
starcoder
defmodule Grapex.Model.Operations do require Axon @doc """ Analyzes provided parameters and depending on the analysis results runs model testing either using test subset of a corpus either validation subset """ @spec test_or_validate({Grapex.Init, Axon, Map}) :: tuple # , list) :: tuple def test_or_valida...
lib/grapex/models/operations.ex
0.693058
0.484441
operations.ex
starcoder
defmodule PolicrMiniBot.Disposable do @moduledoc """ 一次性处理的保证服务。 此模块可以为并发环境下只允许调用一次的任务强制保证一次性状态。当给同一个的 key 二次添加保证时将返回处理中或完成处理两个状态,这样便可在任务执行前就知道任务是否执行过。状态在完成处理或超时后自动清理。 """ use GenServer @type unix_datetime :: integer @type status_type :: :processing | :done @type status_value :: {:processing, unix_...
lib/policr_mini_bot/disposable.ex
0.551574
0.511412
disposable.ex
starcoder
defmodule V3Api.Cache do @moduledoc """ Cache HTTP responses from the V3 API. Static data such as schedules and stops do not change frequently. However, we do want to check in with the API periodically to make sure we have the most recent data. This module stores the previous HTTP responses, and can return...
apps/v3_api/lib/cache.ex
0.779867
0.402099
cache.ex
starcoder
defmodule ExMatchers.Include do @moduledoc false import ExUnit.Assertions import ExMatchers.Custom defprotocol IncludeMatcher do def to_match(value, key) def to_match(value, key, expected_value) def to_not_match(value, key) def to_not_match(value, key, expected_value) end defimpl IncludeM...
lib/ex_matchers/include.ex
0.775392
0.810254
include.ex
starcoder
defmodule Exmorph.Time do @doc """ Takes a string representing time and returns the integer value for that time in nanoseconds. ## Examples iex> Exmorph.Time.from_string("100000ms") 1.0e11 iex> Exmorph.Time.from_string("10s") 10000000000 iex> Exmorph.Time.from_string("3min"...
lib/time.ex
0.837952
0.449332
time.ex
starcoder
defmodule LocationService do @moduledoc """ Interacts with a service to perform geocoding, reverse geocoding and place lookups. """ use RepoCache, ttl: :timer.hours(24) require Logger @type result :: {:ok, nonempty_list(LocationService.Address.t())} | {:error, :zero_results | :internal...
apps/location_service/lib/location_service.ex
0.856962
0.637412
location_service.ex
starcoder
defmodule Medium do @moduledoc """ Medium is an Elixir library that provides an interface to interact with the Medium API. ## Installation 1. Add Medium to your list of dependencies in `mix.exs`: def deps do [{:medium_client, "~> #{Medium.Mixfile.project[:version]}"}] end 2....
lib/medium.ex
0.79909
0.47457
medium.ex
starcoder
defmodule Farmbot.Repo.Snapshot do @moduledoc false alias Farmbot.Repo.Snapshot defmodule Diff do @moduledoc false defstruct [ additions: [], deletions: [], updates: [], ] end defstruct [data: [], hash: nil] def diff(%Snapshot{} = old, %Snapshot{} = new) do struct(Diff, ...
lib/farmbot/repo/snapshot.ex
0.521471
0.448487
snapshot.ex
starcoder
defmodule Pulsar do @moduledoc """ This is the client API for Pulsar. Pulsar manages a simple text-mode dashboard of jobs. Jobs can be updated at any time; updates appear *in place*. When a job is updated, it will briefly be repainted in bold and/or bright text, then be redrawn in standard text. This i...
lib/pulsar.ex
0.846101
0.637581
pulsar.ex
starcoder
defmodule Ecto.ERD.Document do @moduledoc false alias Ecto.ERD.{Node, Field, Edge} defstruct [:edges, :nodes, :clusters] def map_nodes(%__MODULE__{nodes: nodes, edges: edges, clusters: []}, map_node_callback) when is_function(map_node_callback, 1) do {nodes, removed_nodes} = Enum.flat_map_reduc...
lib/ecto/erd/document.ex
0.766119
0.424949
document.ex
starcoder
defprotocol Calendar.ContainsNaiveDateTime do @doc """ Returns a Calendar.NaiveDateTime struct for the provided data """ def ndt_struct(data) end defmodule Calendar.NaiveDateTime do require Calendar.DateTime.Format @moduledoc """ NaiveDateTime can represents a "naive time". That is a point in time witho...
lib/calendar/naive_date_time.ex
0.896601
0.480601
naive_date_time.ex
starcoder
defmodule Matrax do @moduledoc """ A matrix library in pure Elixir based on `atomics`. [Erlang atomics documentation](http://erlang.org/doc/man/atomics.html) Key features: - **concurrent accessibility**: atomics are mutable and can be accessed from multiple processes - **access path only transofrmatio...
lib/matrax.ex
0.937797
0.758958
matrax.ex
starcoder
defmodule AWS.FSx do @moduledoc """ Amazon FSx is a fully managed service that makes it easy for storage and application administrators to launch and use shared file storage. """ @doc """ Cancels an existing Amazon FSx for Lustre data repository task if that task is in either the `PENDING` or `EXECUTING...
lib/aws/generated/fsx.ex
0.890384
0.620593
fsx.ex
starcoder
defmodule EarmarkParser do @type ast_meta :: map() @type ast_tag :: binary() @type ast_attribute_name :: binary() @type ast_attribute_value :: binary() @type ast_attribute :: {ast_attribute_name(), ast_attribute_value()} @type ast_attributes :: list(ast_attribute()) @type ast_tuple :: {ast_tag(), ast_a...
lib/earmark_parser.ex
0.751192
0.60711
earmark_parser.ex
starcoder
defmodule BioMonitor.SensorManager do @moduledoc """ Wrapper module around all serial communication with all sensors using a SerialMonitor instance. """ alias BioMonitor.SerialMonitor # Name used for the arduino board. @arduino_gs ArduinoGenServer @doc """ Helper to expose arduino's serial mon...
lib/bio_monitor/sensor_manager.ex
0.590425
0.410993
sensor_manager.ex
starcoder
defmodule Swarm.Distribution.Strategy do @moduledoc """ This module implements the interface for custom distribution strategies. The default strategy used by Swarm is a consistent hash ring implemented via the `libring` library. Custom strategies are expected to return a datastructure or pid which will be ...
lib/swarm/distribution/strategy.ex
0.849301
0.559922
strategy.ex
starcoder
defmodule Ecto.Type do @moduledoc """ Defines functions and the `Ecto.Type` behaviour for implementing custom types. A custom type expects 4 functions to be implemented, all documented and described below. We also provide two examples of how custom types can be used in Ecto to augment existing types or pro...
data/web/deps/ecto/lib/ecto/type.ex
0.904427
0.641493
type.ex
starcoder
defmodule Crutches.Format.List do alias Crutches.Option @moduledoc ~S""" Formatting helper functions for lists. This module contains various helper functions that should be of use to you when writing user interfaces or other parts of your application that have to deal with lists formatting. simply call...
lib/crutches/format/list.ex
0.816662
0.519217
list.ex
starcoder
defmodule LivebookCLI.Server do @moduledoc false @behaviour LivebookCLI.Task @external_resource "README.md" [_, environment_variables, _] = "README.md" |> File.read!() |> String.split("<!-- Environment variables -->") @environment_variables String.trim(environment_variables) @impl true de...
lib/livebook_cli/server.ex
0.757615
0.402216
server.ex
starcoder
defmodule Harnais.Runner.Cridar do @moduledoc ~S""" The *cridar* manages a test call. Each test call specification is used to create a *cridar*. See `Harnais.Runner` for the overview. ## Cridar State A *cridar* has the following fields: | Key | Aliases | | :---------------- | -------------------: |...
lib/harnais/runner/cridar/cridar.ex
0.797596
0.472927
cridar.ex
starcoder
defmodule Machinery.Transitions do @moduledoc """ This is a GenServer that controls the transitions for a struct using a set of helper functions from Machinery.Transition It's meant to be run by a supervisor. """ use GenServer alias Machinery.Transition @not_declated_error "Transition to this state is...
lib/machinery/transitions.ex
0.753285
0.475362
transitions.ex
starcoder
defmodule D8 do @moduledoc """ --- Day 8: Handheld Halting --- Your flight to the major airline hub reaches cruising altitude without incident. While you consider checking the in-flight menu for one of those drinks that come with a little umbrella, you are interrupted by the kid sitting next to you. Their hand...
lib/days/08.ex
0.801081
0.837354
08.ex
starcoder