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 Getaways.Vacation do @moduledoc """ The Vacation context: public interface for finding, booking, and reviewing vacation places. """ import Ecto.Query, warn: false alias Getaways.Repo alias Getaways.Vacation.{Place, Booking, Review} alias Getaways.Accounts.User @doc """ Returns the place...
backend/lib/getaways/vacation.ex
0.834576
0.502808
vacation.ex
starcoder
defmodule Asteroid.Subject do use AttributeRepository.Resource, otp_app: :asteroid @moduledoc """ `AttributeRepository.Resource` for subjects Subject resource are real-world physical persons, such as the reader of this documentation. It refers to the OAuth2 definition of a subject. ## Field naming The ...
lib/asteroid/subject.ex
0.813498
0.664003
subject.ex
starcoder
defmodule CatalogApi.Address.Iso3166 do @moduledoc false @doc false @spec validate(any()) :: :ok | :error def validate("AB"), do: :ok def validate("AD"), do: :ok def validate("AE"), do: :ok def validate("AF"), do: :ok def validate("AG"), do: :ok def validate("AI"), do: :ok def validate("AL"), do: :...
lib/catalog_api/address/iso_3166.ex
0.533884
0.779825
iso_3166.ex
starcoder
defmodule Plenario.QueryUtils do import Ecto.Query @doc """ Genreically applies ordering. This should be delegated to from the query modules. """ @spec order(Ecto.Queryable.t(), {:asc | :desc, atom()}) :: Ecto.Queryable.t() def order(query, {dir, fname}) do case Enum.empty?(query.order_bys) do tr...
lib/plenario/queries/query_utils.ex
0.803444
0.502319
query_utils.ex
starcoder
defmodule Nebulex.Object do @moduledoc """ Defines a Cache Object. This is the struct used by the caches to store and retrieve data. """ defstruct [:key, :value, :version, :expire_at] @type t :: %__MODULE__{ key: any, value: any, version: any, expire_at: integer | ...
lib/nebulex/object.ex
0.882073
0.526099
object.ex
starcoder
defmodule CoursePlanner.Terms do @moduledoc """ Handle all interactions with Terms, create, list, fetch, edit, and delete """ import Ecto.Query alias CoursePlanner.{Repo, Courses.OfferedCourses, Notifications.Notifier, Accounts.Coordinators, Notifications} alias CoursePlanner.Terms...
lib/course_planner/terms/terms.ex
0.562177
0.46478
terms.ex
starcoder
defmodule PhoenixMTM.Mappers do @moduledoc ~S""" A collection of commonly used mappers for the `collection_checkboxes` helper. To use, pass a capture of the mapping function you wish to use to the `collection_checkboxes` helper. ## Example <%= PhoenixMTM.Helpers.collection_checkboxes f, :tags, ...
lib/phoenix_mtm/mappers.ex
0.908745
0.736448
mappers.ex
starcoder
defmodule Parser do use Platform.Parsing.Behaviour ## test payloads # 0208c900038009812b8014810880027fe8800880040bf5 # 0208c900020bf5 def fields do [ %{field: "wind_speed", display: "Wind speed", unit: "m⋅s⁻¹"}, %{field: "wind_direction", display: "Wind direction", unit: "°"}, %{f...
DL-ATM22/DL-ATM22.ELEMENT-IoT.ex
0.506347
0.431105
DL-ATM22.ELEMENT-IoT.ex
starcoder
defmodule NPRx.StationFinder do @moduledoc """ Find stations and station information. This can be stations close to your current geographic location or any number of other criteria. For more detailed information see [the NPR docs](https://dev.npr.org/api/#!/stationfinder/searchStations) """ import NPRx.HTTP ...
lib/nprx/station_finder.ex
0.826991
0.646718
station_finder.ex
starcoder
defmodule Pathex.Lenses.Some do @moduledoc """ Private module for `some()` lens > see `Pathex.Lenses.some/0` documentation """ def some do fn :view, {%{} = map, func} -> Enum.find_value(map, :error, fn {_k, v} -> with :error <- func.(v) do false end e...
lib/pathex/lenses/some.ex
0.603815
0.413536
some.ex
starcoder
defmodule Ash.Dsl do @using_schema [ single_extension_kinds: [ type: {:list, :atom}, default: [], doc: "The extension kinds that are allowed to have a single value. For example: `[:data_layer]`" ], many_extension_kinds: [ type: {:list, :atom}, default: [], doc: ...
lib/ash/dsl/dsl.ex
0.787523
0.49231
dsl.ex
starcoder
defmodule Teiserver.Telemetry.Tasks.PersistServerMonthTask do use Oban.Worker, queue: :teiserver alias Teiserver.Telemetry alias Central.NestedMaps import Ecto.Query, warn: false # [] List means 1 day segments # %{} Dict means total for the month of that key # 0 Integer means sum or average @empty_log ...
lib/teiserver/telemetry/tasks/persist_server_month_task.ex
0.634883
0.418133
persist_server_month_task.ex
starcoder
defmodule PhoenixBricks do @moduledoc ~S""" An opinable set of proposed patters that helps to write reusable and no repetitive code for `Contexts`. ## Motivation After several years in [Ruby on Rails](https://rubyonrails.org) developing I've got used to structure code folllowing the Single Responsibility P...
lib/phoenix_bricks.ex
0.856453
0.956634
phoenix_bricks.ex
starcoder
defmodule SipHash do @moduledoc """ This module provides a simple but performant interface for hashing values using the SipHash hash family. The `SipHash.hash/3` function allows for flags specifying things such as the number of rounds of compression, allowing use of SipHash-C-D, where `C` and `D` ar...
lib/siphash.ex
0.883538
0.557845
siphash.ex
starcoder
defmodule Day8 do @moduledoc """ Documentation for `Day8`. """ def run() do get_input() |> process(:first) |> present() get_input() |> process(:second) |> present() end def present({c2, c3, c4, c7} = _answer) do IO.puts("#{c2} occurrences of 1") IO.puts("#{c3} occurrences ...
apps/day8/lib/day8.ex
0.621196
0.408513
day8.ex
starcoder
# Mnesia will keep its schema in memory, and it will vanish if and when Mnesia stops. #:mnesia.start() #:mnesia.stop() :mnesia.create_schema([node()]) # Creating Tables defmodule Drop do require Planemo def drop do setup handle_drops end def handle_drops do receive do {from, planemo, dista...
other/storing-structured-data/starting-up-mnesia.ex
0.538741
0.537041
starting-up-mnesia.ex
starcoder
defmodule BioMonitor.ReadingView do use BioMonitor.Web, :view def render("index.json", %{readings: readings}) do %{data: render_many(readings, BioMonitor.ReadingView, "reading.json")} end def render("calculations.json", %{values: values}) do %{ data: %{ biomass_performance: render_many(v...
web/views/reading_view.ex
0.55254
0.428443
reading_view.ex
starcoder
defmodule VintageNetWiFi.AccessPoint do alias VintageNetWiFi.Utils @moduledoc """ Information about a WiFi access point * `:bssid` - a unique address for the access point * `:flags` - a list of flags describing properties on the access point * `:frequency` - the access point's frequency in MHz * `:signa...
lib/vintage_net_wifi/access_point.ex
0.844489
0.537952
access_point.ex
starcoder
defmodule RestorationOfErathia do @moduledoc """ Documentation for `RestorationOfErathia`. The module is designed to assist with restoration of deleted files from hdd. It is assumed that a tool similar to photorec is used to restore the deleted files. The documentation for using photorec can be found here: h...
lib/restoration_of_erathia.ex
0.59561
0.421492
restoration_of_erathia.ex
starcoder
defmodule Freddy.Core.Exchange do @moduledoc """ Exchange configuration. # Fields * `:name` - Exchange name. If left empty, default exchange will be used. * `:type` - Exchange type. Can be `:direct`, `:topic`, `:fanout` or an arbitrary string, such as `"x-delayed-message"`. Default is `:direct`. ...
lib/freddy/core/exchange.ex
0.916554
0.517388
exchange.ex
starcoder
defmodule Insights.Server do @moduledoc """ Defines a adapter. A adapter maps to an underlying data store, controlled by the adapter. For example, Insights ships with a Keen adapter that stores data into a PostgreSQL database. When used, the adapter expects the `:otp_app` as option. The `:otp_app` should ...
lib/insights/server.ex
0.910149
0.491822
server.ex
starcoder
defmodule Day24.Part2 do @doc """ iex> Day24.Part2.part2("day24-sample.txt") 2208 """ def part2(filename) do parse_input(filename) |> Enum.reduce(%{}, fn directions, map -> coords = find_coordinates(directions) if Map.get(map, coords) == :black do Map.delete(map, coords) ...
lib/day24/part2.ex
0.568176
0.588328
part2.ex
starcoder
defmodule Payjp.Charges do @moduledoc """ Functions for working with charges at Payjp. Through this API you can: * create a charge, * update a charge, * get a charge, * list charges, * refund a charge, * partially refund a charge. Payjp API reference: https://pay.jp/docs/api/#charge-支払い ...
lib/payjp/charges.ex
0.875255
0.573858
charges.ex
starcoder
defmodule Extractly.Toc do alias Extractly.Toc.Options import Extractly.Toc.Renderer @moduledoc ~S""" Extract Table Of Contents from a list of lines representing a Markdown document """ @placeholder_pfx "<!---- Extractly Self TOC " def placeholder_pfx, do: @placeholder_pfx @placeholder_sfx " ---->" ...
lib/extractly/toc.ex
0.632616
0.555676
toc.ex
starcoder
defmodule EctoCursor.Expr do @moduledoc false defstruct [:term, :dir, :type, :params] @type ast :: {atom | ast, [any], [ast]} @type dir :: :desc | :desc_nulls_last | :desc_nulls_first | :asc | :asc_nulls_last | :asc_nulls_first @type t :: %__MODULE__{ term: ast, dir: dir, type: any, params:...
lib/ecto_cursor/expr.ex
0.552781
0.580293
expr.ex
starcoder
defmodule Env do @moduledoc """ Env is an improved application configuration reader for Elixir. Env allows you to access easily the configuration of your application similar to what `Application.get_env/3` does, but understands the `{:system, "NAME"}` convention of using system environment variables in app...
lib/env.ex
0.925171
0.537163
env.ex
starcoder
defmodule CloudStackLang.Operator.Add do @moduledoc """ This module contains all routine to perform add operation. ## Examples iex> CloudStackLang.Operator.Add.reduce({:int, 1}, {:int, 1}) {:int, 2} iex> CloudStackLang.Operator.Add.reduce({:float, 1.0}, {:int, 1}) {:float, 2.0} iex> CloudS...
lib/api/opetaror/add.ex
0.802942
0.423398
add.ex
starcoder
defmodule Snitch.Data.Schema.TaxConfig do @moduledoc """ Models the general configuration for Tax. ## Note At present single row modelling is being used to handle storing general configuration for tax. A detailed reason for picking up the type of modelling can be seen [here](https://www.pivotaltracker.co...
apps/snitch_core/lib/core/data/schema/tax/tax_config.ex
0.85928
0.659269
tax_config.ex
starcoder
defmodule Mix.Tasks.Serum.New do @moduledoc """ Creates a new Serum project. mix serum.new [--force] PATH A new Serum project will be created at the given `PATH`. `PATH` cannot be omitted and it must start with a lowercase ASCII letter, followed by zero or more lowercase ASCII letters, digits, or unde...
serum_new/lib/mix/tasks/serum/new.ex
0.82994
0.441312
new.ex
starcoder
defmodule Remedy.ImageData do @max_size 256_000 @max_width 128 @max_height 128 @moduledoc """ Ecto.Type implementation of Image Data. This allows a URL or path to be provided and the image data will be constructed from the linked image. This is only used with certain API endpoints and should not be use...
lib/remedy/types/image_data.ex
0.735831
0.583619
image_data.ex
starcoder
defmodule Adventofcode.Day06ChronalCoordinates do use Adventofcode def largest_area_size(input) do input |> parse_coordinates |> build_grid |> finite_area_sizes(grid_locations(-99..599), grid_locations(-100..600)) |> hd() |> elem(0) end def safe_area_size(input, distance) do input ...
lib/day_06_chronal_coordinates.ex
0.780328
0.624279
day_06_chronal_coordinates.ex
starcoder
defmodule ExActor.Operations do @moduledoc """ Macros that can be used for simpler definition of `GenServer` operations such as casts or calls. For example: defcall request(x, y), state: state do set_and_reply(state + x + y, :ok) end will generate two functions: def request(serve...
deps/exactor/lib/exactor/operations.ex
0.874533
0.707528
operations.ex
starcoder
defmodule Harald.AssignedNumbers.GenericAccessProfile do @moduledoc """ > Assigned numbers are used in GAP for inquiry response, EIR data type values, > manufacturer-specific data, advertising data, low energy UUIDs and appearance characteristics, > and class of device. Reference: https://www.bluetooth.com/s...
lib/harald/assigned_numbers/generic_access_profile.ex
0.600305
0.456591
generic_access_profile.ex
starcoder
defmodule CodeRunner.Worker do @moduledoc """ Worker module responsible for actually running code. Each worker process spawns a Docker container in an external process, executes the code, returns the result or timeout message. ## Attributes A few attributes can be configured in `config.exs` to change Docker i...
lib/code_runner/worker.ex
0.707809
0.422415
worker.ex
starcoder
defmodule Mix.Tasks.Bench.Cmp do use Mix.Task @shortdoc "Compare benchmark snapshots" @moduledoc """ ## Usage mix bench.cmp [options] <snapshot>... A snapshot is the output of a single run of `mix bench`. If no arguments are given, bench.cmp will try to read one or two latest snapshots from the...
lib/mix/tasks/bench_cmp.ex
0.786459
0.457561
bench_cmp.ex
starcoder
defmodule Astro do @moduledoc """ Functions for basic astronomical observations such as sunrise, sunset, solstice, equinox, moonrise, moonset and moon phase. """ alias Astro.{Solar, Utils} @type longitude :: float() @type latitude :: float() @type degrees :: float() @type location :: {longitude, ...
lib/astro.ex
0.949412
0.811415
astro.ex
starcoder
defmodule ExAws.Rekognition do @moduledoc """ Operations on ExAws Rekognition """ use ExAws.Utils, format_type: :json, non_standard_keys: %{} alias ExAws.Rekognition.S3Object alias ExAws.Rekognition.NotificationChannelObject # https://docs.aws.amazon.com/rekognition/latest/dg/API_Operations.html...
lib/ex_aws/rekognition.ex
0.881545
0.423875
rekognition.ex
starcoder
defmodule BeamInspect do @moduledoc """ Inspect how your elixir module looks like in erlang / core erlang. """ @doc """ Returns erlang code. Abstract erlang code is fetched from .beam file. It requires `:debug_info` or `:abstract_code` to be available in compiled module. ## Example iex > Foo |...
lib/beam_inspect.ex
0.814643
0.417212
beam_inspect.ex
starcoder
defmodule StepFlow.Amqp.ErrorConsumer do @moduledoc """ Consumer of all job with error status. """ require Logger alias StepFlow.Amqp.ErrorConsumer alias StepFlow.Jobs alias StepFlow.Jobs.Status alias StepFlow.Metrics.{JobInstrumenter, WorkflowInstrumenter} alias StepFlow.Workflows use StepFlow.A...
lib/step_flow/amqp/error_consumer.ex
0.622918
0.414129
error_consumer.ex
starcoder
defmodule TrainLoc.Encoder.VehiclePositionsEnhanced do @moduledoc """ Encodes a list of vehicle structs into GTFS-realtime enhanced JSON format. """ import TrainLoc.Utilities.Time alias TrainLoc.Vehicles.Vehicle @spec encode([Vehicle.t()]) :: String.t() def encode(list) when is_list(list) do messag...
apps/train_loc/lib/train_loc/encoder/vehicle_positions_enhanced.ex
0.7874
0.497864
vehicle_positions_enhanced.ex
starcoder
defmodule Kitsune.Aws.Canonical do @moduledoc """ This module defines functions that are used to build the canonical request The canonical request is a string used to generate a signature of the request. It contains the following data, each one in its own line: 1. The request method 2. The request path ...
apps/kitsune_aws_core/lib/kitsune/aws/canonical.ex
0.93913
0.548915
canonical.ex
starcoder
defmodule Indicado.Bollinger do @moduledoc """ This is the Bollinger module used for calculating Bollinger Bands. """ @doc """ Calculates BB for the list. Returns list of map `[{lower: x, mean: y, upper: z}]` or `{:error, reason}` - `lower` represents low band of bollinger band - `mean` represents mea...
lib/indicado/bollinger.ex
0.947781
0.86431
bollinger.ex
starcoder
defmodule Membrane.VideoMerger do @moduledoc """ Membrane element that merges multiple raw videos into one. The element expects each frame to be received in a separate buffer, so the parser (`Membrane.Element.RawVideo.Parser`) may be required in a pipeline before the merger (e.g. when input is read from `Mem...
lib/video_merger.ex
0.871871
0.517571
video_merger.ex
starcoder
defmodule Absinthe.Validation.PreventCircularFragments do alias Absinthe.{Language, Traversal} @moduledoc false def validate(doc, {_, errors}) do doc.definitions |> Enum.filter(fn %Language.Fragment{} -> true _ -> false end) |> check(errors) end # The overall approach here is to...
lib/absinthe/validation/prevent_circular_fragments.ex
0.849238
0.456773
prevent_circular_fragments.ex
starcoder
defmodule Volley.PersistentSubscription do @moduledoc """ A GenStage/Broadway producer for persistent subscriptions Persistent subscriptions are a feature of EventStoreDB which offload the responsibilities of tracking processed events, back-pressure, and subscriber dispatch to the EventStoreDB server. This a...
lib/volley/persistent_subscription.ex
0.897767
0.857231
persistent_subscription.ex
starcoder
defmodule AWS.RDS do @moduledoc """ Amazon Relational Database Service Amazon Relational Database Service (Amazon RDS) is a web service that makes it easier to set up, operate, and scale a relational database in the cloud. It provides cost-efficient, resizeable capacity for an industry-standard relational...
lib/aws/generated/rds.ex
0.854217
0.602266
rds.ex
starcoder
defmodule Matrix.Agents do @moduledoc """ Holds state about posible agent types and currently running agents in cluster. This module is meant to be used when new agent centers are registered / unregistered to / from cluster. When new agent center is registered to cluster, it's available agent types are se...
lib/matrix/agents.ex
0.888233
0.711152
agents.ex
starcoder
defmodule QRCode do @default_ecc :M @doc """ ## about `version` Todo. ## about `ecc` - 'L': recovers 7% of data - 'M': recovers 15% of data (default) - 'Q': recovers 25% of data - 'H': recovers 30% of data ## about `dimension` Todo. ## about `data` Todo. """ defstruct version: nil, ec...
lib/ex_qrcode.ex
0.718989
0.566378
ex_qrcode.ex
starcoder
defmodule Rubber.Search do @moduledoc """ The search APIs are used to query indices. [Elastic documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/search.html) """ import Rubber.HTTP, only: [prepare_url: 2] alias Rubber.{HTTP, JSON} @doc """ Makes a request to the `_search` o...
lib/rubber/search.ex
0.895101
0.543166
search.ex
starcoder
defmodule Delivery.Content.Readers.Pressbooks do alias Delivery.Content.Readers.Reader alias Delivery.Content.Document alias Delivery.Content.Block alias Delivery.Content.Text alias Delivery.Content.Inline alias Delivery.Content.Mark alias Delivery.Content.Module alias Delivery.Content.Reference alia...
lib/delivery/content/readers/pressbooks.ex
0.566738
0.4231
pressbooks.ex
starcoder
defmodule Payjp.Cards do @moduledoc """ Functions for working with cards at Payjp. Through this API you can: * create a card, * update a card, * get a card, * delete a card, * delete all cards, * list cards, * list all cards, All requests require `owner_type` and `owner_id` parameter...
lib/payjp/cards.ex
0.904661
0.513668
cards.ex
starcoder
defmodule Chunky.Sequence.OEIS.Primes do @moduledoc """ OEIS Sequences dealing with Primes, Pseudo-primes, and primality. For related sequences, see `Chunky.Sequences.OEIS.Factors` ## Available Sequences ### Pseudoprimes Fermat pseudoprimes to specific bases: - `create_sequence_a001567/1` - A001567 - F...
lib/sequence/oeis/primes.ex
0.824285
0.599954
primes.ex
starcoder
defmodule Grizzly.SmartStart.MetaExtension.AdvancedJoining do @moduledoc """ This extension is used to advertise the Security keys to grant during S2 bootstrapping to a SmartStart node in the provisioning list For more information about S2 security see the `Grizzly.Security` module """ @behaviour Grizzly.S...
lib/grizzly/smart_start/meta_extension/advanced_joining.ex
0.886525
0.4436
advanced_joining.ex
starcoder
defmodule Bolt.Cogs.LastJoins do @moduledoc false @behaviour Nosedrum.Command alias Bolt.{Constants, Helpers, Paginator, Parsers} alias Nosedrum.MessageCache.Agent, as: MessageCache alias Nosedrum.Predicates alias Nostrum.Api alias Nostrum.Cache.GuildCache alias Nostrum.Struct.Embed alias Nostrum.St...
lib/bolt/cogs/lastjoins.ex
0.867303
0.572544
lastjoins.ex
starcoder
defmodule Combine.Parsers.Base do @moduledoc """ This module defines common abstract parsers, i.e. ignore, repeat, many, etc. To use them, just add `import Combine.Parsers.Base` to your module, or reference them directly. """ alias Combine.ParserState use Combine.Helpers @type predicate :: (term -> bo...
lib/combine/parsers/base.ex
0.799364
0.514766
base.ex
starcoder
defmodule Monetized.Money do import Monetized.Money.Utils alias Monetized.Currency @moduledoc """ Defines the money struct and functions to handle it. Also defines `Money` Ecto.Type. Although we're able to override any configuration when calling functions that create/handle money, it is possible to ...
lib/money.ex
0.885724
0.642573
money.ex
starcoder
defmodule EVM.Functions do @moduledoc """ Set of functions defined in the Yellow Paper that do not logically fit in other modules. """ alias EVM.{ExecEnv, Gas, MachineCode, MachineState, Operation, Stack} alias EVM.Operation.Metadata @max_stack 1024 def max_stack_depth, do: @max_stack @doc """ R...
apps/evm/lib/evm/functions.ex
0.771456
0.504272
functions.ex
starcoder
defmodule DockerCompose do @moduledoc """ Docker Compose CLI Uses `docker-compose` executable, it must be installed and working. """ @type exit_code :: non_neg_integer @type output :: Collectable.t() @doc """ docker-compose up The command is executed in detached mode, result is returned after the ...
lib/docker_compose.ex
0.84228
0.450964
docker_compose.ex
starcoder
defmodule Acquire.Query.ST do @moduledoc """ Collection of functions that generate `Acquire.Query.Where.Function` objects representing PrestoDB [ST_*](https://prestosql.io/docs/current/functions/geospatial.html#ST_Intersects) functions. """ alias Acquire.Query.Where.Function alias Acquire.Queryable impo...
apps/service_acquire/lib/acquire/query/st.ex
0.813942
0.652684
st.ex
starcoder
defmodule TortoiseWebsocket.Client do @moduledoc ~S""" A Websocket client with a API similar to `:gen_tcp`. Example of usage where a client is started and connected, then it is used to send and receive data: iex> {:ok, socket} = TortoiseWebsocket.Client.connect('example.com', 80, []) iex> :ok = Tor...
lib/tortoise_websocket/client.ex
0.834238
0.500977
client.ex
starcoder
defmodule Distributed.Replicator.GenServer do @moduledoc """ The functions in `Distributed.Replicator.GenServer` module helps to replicate an event by processing it on the all nodes in the network. In `Distributed.Replicator.GenServer`, functions execute processes in parallel. **Note**: Since this module is only a...
lib/distributed/replicator/gen_server.ex
0.70912
0.472927
gen_server.ex
starcoder
defmodule Representer do @moduledoc """ Implementation of the Representer pattern for the API """ @extensions [ "json", ] defguard known_extension?(extension) when extension in @extensions defmodule Collection do @moduledoc """ Struct for a collection of `Representer.Item`s Contains th...
lib/web/representer.ex
0.842798
0.558207
representer.ex
starcoder
defmodule Changelog.Post do use Changelog.Schema, default_sort: :published_at alias Changelog.{Files, NewsItem, Person, PostTopic, Regexp} schema "posts" do field :title, :string field :subtitle, :string field :slug, :string field :guid, :string field :canonical_url, :string field :ima...
lib/changelog/schema/post/post.ex
0.568655
0.424114
post.ex
starcoder
defmodule Maxwell.Multipart do @moduledoc """ Process mutipart for adapter """ @type param_t :: {String.t(), String.t()} @type params_t :: [param_t] @type header_t :: {String.t(), String.t()} | {String.t(), String.t(), params_t} @type headers_t :: Keyword.t() @type disposition_t :: {String.t(), params_t...
lib/maxwell/multipart.ex
0.801858
0.422505
multipart.ex
starcoder
defmodule OsCmd do @moduledoc """ Managed execution of external commands. This module provides similar functionality to `System.cmd/3`, with the difference that the execution of commands is managed, which provides the following benefits: 1. The external OS process is logically linked to the parent BEAM proc...
lib/os_cmd.ex
0.827445
0.610541
os_cmd.ex
starcoder
defmodule AWS.GameLift do @moduledoc """ Amazon GameLift Service Amazon GameLift is a managed service for developers who need a scalable, dedicated server solution for their multiplayer games. Amazon GameLift provides tools to acquire computing resources and deploy game servers, scale game server capacity...
lib/aws/gamelift.ex
0.844024
0.686377
gamelift.ex
starcoder
defmodule RDF.Query.Builder do @moduledoc false alias RDF.Query.BGP alias RDF.{IRI, BlankNode, Literal, Namespace, PropertyMap} import RDF.Utils.Guards import RDF.Utils def bgp(query, opts \\ []) do property_map = if context = Keyword.get(opts, :context), do: PropertyMap.new(context) with {:ok, t...
lib/rdf/query/builder.ex
0.722135
0.438184
builder.ex
starcoder
defmodule RobotSimulator do @doc """ Create a Robot Simulator given an initial direction and position. Valid directions are: `:north`, `:east`, `:south`, `:west` """ defmodule Robot do defstruct direction: :north, position: {0, 0} @type t :: %Robot{direction: atom, position: {integer, integer}} en...
elixir/robot-simulator/lib/robot_simulator.ex
0.905929
0.90813
robot_simulator.ex
starcoder
defmodule Rational do @moduledoc """ Implements exact rational numbers. In its simplest form, Rational.new(3,4) will produce an exact rational number representation for 3/4. The fraction will be stored in the lowest terms (i.e., a reduced fraction) by dividing numerator and denominator through by their gre...
lib/rational.ex
0.861553
0.714659
rational.ex
starcoder
defmodule GenGossip.Server do @moduledoc false use GenServer alias GenGossip.ClusterState @default_limit {45, 10_000} # at most 45 gossip messages every 10 seconds defstruct [:mod, :mod_state, :tokens, :max_tokens, :interval, :cluster_state] def rejoin(node, mod, state) do GenServer.cast({mod, node}...
lib/gen_gossip/server.ex
0.609757
0.443239
server.ex
starcoder
defmodule EctoMnesia.Adapter do @moduledoc """ Ecto 2.X adapter for Mnesia Erlang term database. ## Run-Time Storage Options * `:host` - Node hostname. * `:dir` - Path where Mnesia should store DB data. * `:storage_type` - Type of Mnesia storage. ### Mnesia Storage Types * `:disc_copies` - s...
lib/ecto_mnesia/adapter.ex
0.773473
0.599251
adapter.ex
starcoder
defmodule Abit.Bitmask do @moduledoc """ Functions for working with bits & integer bitmasks. """ import Bitwise @doc """ Returns the count of bits set to 1 in the given integer `int`. ## Examples iex> Abit.Bitmask.set_bits_count(3) 2 iex> Abit.Bitmask.set_bits_count(0) 0 ...
lib/abit/bitmask.ex
0.879568
0.502563
bitmask.ex
starcoder
defmodule ExDataHoover.Nozzle do @moduledoc """ Nozzle exposes a public API around the concept of event sourcing. The `Nozzle` provides a basic server implementation that allows to absorb an event. You have the possibility to use your own `Bag` to implements what happened after the absortion. ## Example ...
lib/ex_data_hoover/nozzle.ex
0.884202
0.607197
nozzle.ex
starcoder
defmodule Cldr.Calendar.Behaviour do defmacro __using__(opts \\ []) do epoch = Keyword.fetch!(opts, :epoch) {date, []} = Code.eval_quoted(epoch) epoch = Cldr.Calendar.date_to_iso_days(date) epoch_day_of_week = Date.day_of_week(date) days_in_week = Keyword.get(opts, :days_in_week, 7) first_d...
lib/cldr/calendar/behaviour.ex
0.864182
0.511107
behaviour.ex
starcoder
defmodule Monzo.Transaction do @moduledoc """ [Monzo API reference](https://monzo.com/docs/#transactions) """ @endpoint "transactions" defstruct account_balance: nil, amount: nil, attachments: nil, category: nil, created: nil, currency: nil, decline_reason: nil, description: nil, id:...
lib/monzo/transaction.ex
0.811713
0.461017
transaction.ex
starcoder
defmodule Litmus.Type.String do @moduledoc """ This type validates and converts values to strings It converts boolean and number values to strings. ## Options * `:default` - Setting `:default` will populate a field with the provided value, assuming that it is not present already. If a field already ...
lib/litmus/type/string.ex
0.9255
0.664037
string.ex
starcoder
defmodule ExCommons.Map do @moduledoc """ Helpers for Maps and Structs. """ @exceptions [NaiveDateTime, DateTime] @doc """ Strips selected keys from maps, that can be in a list, or and embedded within. Will not strip keys from NaiveDateTime, and DateTime, unless given directly. ## Examples iex> Ex...
lib/ex_commons/map.ex
0.872734
0.497376
map.ex
starcoder
defmodule Cqrs.DomainEvent do @moduledoc """ Defines a new domain event struct ## Options * `:from` _optional_ - a struct to derive fields from. * `:with` _optional_ - a list of `atom` field names to add. * `:drop` _optional_ - a list of `atom` field names to remove from any field derived from the struct ...
lib/cqrs/domain_event.ex
0.845017
0.555978
domain_event.ex
starcoder
defmodule Faker.Cat.PtBr do import Faker, only: [sampler: 2] @moduledoc """ Functions for Cat names and breeds in Brazilian Portuguese """ @doc """ Returns a Cat famele name string ## Examples iex> Faker.Cat.PtBr.female_name() "Samy" iex> Faker.Cat.PtBr.female_name() "Linda" ...
lib/faker/cat/pt_br.ex
0.602763
0.435721
pt_br.ex
starcoder
defmodule Solana.Key do @moduledoc """ Functions for creating and validating Solana [keys](https://docs.solana.com/terminology#public-key-pubkey) and [keypairs](https://docs.solana.com/terminology#keypair). """ @typedoc "Solana public or private key" @type t :: Ed25519.key() @typedoc "a public/private...
lib/solana/key.ex
0.840701
0.590573
key.ex
starcoder
defmodule Scenic.Component do @moduledoc """ A Component is simply a Scene that is optimized to be referenced by another scene. All you need to do to create a Component is call use Scenic.Component instead of use Scenic.Scene At the top of your module definition. ## Standard Components ...
lib/scenic/component.ex
0.882671
0.64461
component.ex
starcoder
defmodule Tensorex.Operator do @moduledoc """ Functions for basic arithmetic operations with tensors. """ @doc """ Adds two tensors. iex> Tensorex.Operator.add( ...> Tensorex.from_list([[0, 1 , 2 ], ...> [3, -4 , -5.5]]), ...> Tensorex.from_list([[3, -2 ...
lib/tensorex/operator.ex
0.727782
0.661445
operator.ex
starcoder
defmodule Scenic.Scrollable.Components do alias Scenic.Graph alias Scenic.Scrollable alias Scenic.Scrollable.ScrollBars alias Scenic.Scrollable.ScrollBar alias Scenic.Primitive alias Scenic.Primitive.SceneRef @moduledoc """ This module contains helper functions for adding scrollable components to, or m...
lib/components.ex
0.940199
0.829388
components.ex
starcoder
defmodule Wit.Actions do @moduledoc """ Wit.Actions is used to implement the default behaviour for the Wit which involves functions like `say, merge, error`. The macro `defaction` is also provided to define your own custom actions. When using `defaction` the name of the function is matched with the action retur...
lib/wit_actions.ex
0.808899
0.461623
wit_actions.ex
starcoder
defmodule ExFuzzywuzzy.Algorithms.LongestCommonSubstring do @moduledoc """ Helper module for the calculus of the longest common substring algorithm between two strings """ defstruct [:substring, :left_starting_index, :right_starting_index, :length] @typedoc """ The data collected applying partial matching...
lib/ex_fuzzywuzzy/algorithms/longest_common_substring.ex
0.846609
0.631765
longest_common_substring.ex
starcoder
defmodule Error do @moduledoc """ Model domain and infrastructure errors as regular data. """ alias FE.Maybe defmodule DomainError do @moduledoc false defstruct [:reason, :details, :caused_by] end defmodule InfraError do @moduledoc false defstruct [:reason, :details, :caused_by] end ...
lib/error.ex
0.854612
0.527256
error.ex
starcoder
defmodule EVM.Gas do @moduledoc """ Functions for interacting wth gas and costs of opscodes. """ alias EVM.MachineState alias EVM.MachineCode alias EVM.Operation alias EVM.Address alias EVM.ExecEnv @type t :: EVM.val() @type gas_price :: EVM.Wei.t() # Nothing paid for operations of the set Wzer...
apps/evm/lib/evm/gas.ex
0.752922
0.507324
gas.ex
starcoder
defmodule Day15 do @moduledoc """ --- Day 15: Dueling Generators --- Here, you encounter a pair of dueling generators. The generators, called generator A and generator B, are trying to agree on a sequence of numbers. However, one of them is malfunctioning, and so the sequences don't always match. As they do...
lib/day15.ex
0.676299
0.795698
day15.ex
starcoder
defmodule Backpack.Moment.Calculator.Shared do def ago(term, seconds) do Backpack.Moment.Calculator.shift(term, seconds: -seconds) end def from_now(term, seconds) do Backpack.Moment.Calculator.shift(term, seconds: seconds) end def minutes_ago(term, minutes) do Backpack.Moment.Calculator.shift(te...
lib/backpack/moment/calculator/shared.ex
0.55941
0.453625
shared.ex
starcoder
defmodule Mix.Tasks.Cotton.Lint do @moduledoc """ Lint by Credo & check types by Dialyzer. Run following checks. ``` mix format --check-formatted mix credo --strict mix dialyzer mix inch --pedantic ``` Option: * `--fix`: Auto correct errors if available. """ use Mix.Task @shortdoc "Lint b...
lib/mix/tasks/cotton.lint.ex
0.683947
0.408778
cotton.lint.ex
starcoder
defmodule Thunk do @moduledoc """ This module provides Thunks. A thunk holds a value thats not yet been computed. This values can have functions applied to them without forcing the value and two thunks can be combined into a tuple again without forcing either of them. The documentation for the functions has H...
lib/thunk.ex
0.702734
0.6852
thunk.ex
starcoder
defmodule MapBot do @moduledoc """ `#{__MODULE__}` builds Elixir Maps/Structs based on factory definitions and attributes. Let's see how to use this library by examples: ## Examples setup: ```elixir #{:map_bot |> :code.priv_dir() |> Path.join("support/my_app.ex") |> File.read!()} ``` ## Examples ...
lib/map_bot.ex
0.907677
0.674104
map_bot.ex
starcoder
defmodule MonHandler do use GenServer @moduledoc """ A minimal GenServer that monitors a given GenEvent handler. This server will handle exits of the Handler and attempt to re-add it to the manager when unexpected exits occur. Exits for :normal, :shutdown or :swapped reasons will not attempt a re-add to ...
lib/mon_handler.ex
0.786664
0.644666
mon_handler.ex
starcoder
defmodule Bisect do @moduledoc File.read!("README.md") import Bitwise, only: [ >>>: 2 ] defp extract_key(:lhs, opts) do key = opts[:key] opts[:lhs_key] || key end defp extract_key(:rhs, opts) do key = opts[:key] opts[:rhs_key] || key end defp access_value(term, key) ...
lib/bisect.ex
0.873404
0.565179
bisect.ex
starcoder
defmodule Scrivener.Headers do @moduledoc """ Helpers for paginating API responses with [Scrivener](https://github.com/drewolson/scrivener) and HTTP headers. Implements [RFC-5988](https://mnot.github.io/I-D/rfc5988bis/), the proposed standard for Web linking. Use `paginate/2` to set the pagination headers: ...
lib/scrivener/headers.ex
0.788013
0.447762
headers.ex
starcoder
defmodule Sanbase.Signal.FileHandler do @moduledoc false defmodule Helper do import Sanbase.DateTimeUtils, only: [interval_to_str: 1] alias Sanbase.TemplateEngine require Sanbase.Break, as: Break # The selected field is required by default # A missing required field will result in a compile ...
lib/sanbase/signal/file_handler.ex
0.639398
0.41567
file_handler.ex
starcoder
defmodule MyEnum do # require MyMacros @doc """ MyEnum.all?(list, pred) returns true if pred is true for all element in list, false otherwise ## Examples iex> MyEnum.all? [1, 2, 3, 4, 5], &(&1 > 0) true iex> MyEnum.all? [1, 2, 3], &(&1 < 3) false iex> MyEnum.all?(["Abracadabra", "Tumetai...
my_enum/lib/my_enum.ex
0.539711
0.412294
my_enum.ex
starcoder
defmodule Edeliver.Relup.RunnableInstruction do @moduledoc """ This module can be used to provide custom instructions executed during the upgrade. They can be used in implementations of the `Edeliver.Relup.Modification` behaviours. A runnable instruction must implement a `c:Edeliver.Relup.RunnableInstru...
lib/edeliver/relup/runnable_instruction.ex
0.848863
0.461927
runnable_instruction.ex
starcoder
defmodule Cldr.Number.Backend.Rbnf do @moduledoc false def define_number_modules(config) do backend = config.backend root_locale = Cldr.Config.root_locale_name() quote location: :keep do defmodule Rbnf.NumberSystem do @moduledoc false if Cldr.Config.include_module_docs?(unquote(c...
lib/cldr/number/backend/rbnf.ex
0.7181
0.436682
rbnf.ex
starcoder
defmodule Spandex.Plug.StartTrace do @moduledoc """ Starts a trace, skipping ignored routes or methods. Store info in Conn assigns if we actually trace the request. """ @behaviour Plug alias Spandex.Plug.Utils alias Spandex.SpanContext @init_opts Optimal.schema( opts: [ ...
lib/plug/start_trace.ex
0.761982
0.418786
start_trace.ex
starcoder