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 |
|---|---|---|---|---|---|
%% ===================================================================
%% @author <NAME> <<EMAIL>>
%% @copyright 2011-2016 <NAME>
%%
%% @doc e2 option validation utility.
%%
%% For example in how this facility can be used to validate options
%% lists, see [https://github.com/gar1t/e2/blob/master/test/e2_opt_tests.erl
%... | src/e2_opt.erl | 0.532911 | 0.519765 | e2_opt.erl | starcoder |
%% @author <NAME> <<EMAIL>> [http://ferd.ca/]
%% @doc Erlpass is a simple wrapper library trying to abstract away common
%% password operations using safe algorithms, in this case, bcrypt.
-module(erlpass).
-export([hash/1, hash/2, match/2, change/3, change/4]).
-define(DEFAULT_WORK_FACTOR, 12).
%% @type password() = ... | src/erlpass.erl | 0.764364 | 0.612223 | erlpass.erl | starcoder |
-module(tagged_gen).
-export([term/1]).
-include_lib("eunit/include/eunit.hrl").
-include("test/macros.hrl").
term({tagged, Ctx, Path, Val} = Term) -> tagged(Path, Ctx, term(symbol:name(Term), Val));
term(Term) -> term(symbol:name(Term), Term).
term(_, {link, _, _} = Term) -> Term;
term(_Tag, {keyword, _, _, _} = Te... | src/codegen/tagged_gen.erl | 0.563618 | 0.421909 | tagged_gen.erl | starcoder |
%%%-------------------------------------------------------------------
%%% @author aaron
%%% @copyright (C) 2019, <COMPANY>
%%% @doc
%%%
%%% @end
%%% Created : 27. Jul 2019 06:34
%%%-------------------------------------------------------------------
-module(query).
-author("aaron").
%% API
-export([test/0, available/3... | src/old_storagier/query.erl | 0.52074 | 0.503235 | query.erl | starcoder |
%% Puzzle:
%%
%% Crab alignment
%% https://adventofcode.com/2021/day/7
%%
%% explanation:
%% https://blog.beerriot.com/2021/12/17/advent-of-code-day-7/
-module(puzzle07).
-export([
solveA/0,
solveB/0,
find_best_positionA/1,
find_best_positionB/1,
median/1,
mean/1,... | src/puzzle07.erl | 0.540924 | 0.648077 | puzzle07.erl | starcoder |
%% coding: latin1
%--------------------------------------------------------------------
%
% Copyright (c) 2015 <NAME>
%
% This software is released under the MIT license
% http://www.opensource.org/licenses/mit-license.php
%
%--------------------------------------------------------------------
-module( catalan ).
-ex... | catalan.erl | 0.68458 | 0.476214 | catalan.erl | starcoder |
-module(web_profiler).
-export([run/2, ping/2, receive_response/2, do_f/4]).
-define(LIST_OF_WEBSITES, [
"http://stratus3d.com/",
"http://lobste.rs/",
"http://news.ycombinator.com/",
"http://stackoverflow.com/"
]).
% Since there is so much state that must be passed around fo... | chapter_26/exercise_6/web_profiler.erl | 0.509764 | 0.525551 | web_profiler.erl | starcoder |
% @doc Core OTPCL commands. These commands are technically optional, but
% leaving them out (i.e. in a custom interpreter state) can create some rather
% peculiar results, in particular since this is where basic commands like
% `return' and `|' live (yes, the OTPCL standard pipe is internally an ordinary
% command, so... | src/otpcl_core.erl | 0.730963 | 0.55923 | otpcl_core.erl | starcoder |
%% -------------------------------------------------------------------
%%
%% riak_dt_map: OR-Set schema based multi CRDT container
%%
%% Copyright (c) 2007-2013 Basho Technologies, Inc. All Rights Reserved.
%%
%% This file is provided to you under the Apache License,
%% Version 2.0 (the "License"); you may not use thi... | src/riak_dt_map.erl | 0.809803 | 0.65426 | riak_dt_map.erl | starcoder |
% Licensed under the Apache License, Version 2.0 (the "License"); you may not
% use this file except in compliance with the License. You may obtain a copy of
% the License at
%
% http://www.apache.org/licenses/LICENSE-2.0
%
% Unless required by applicable law or agreed to in writing, software
% distributed under the ... | src/couch/src/couch_ejson_size.erl | 0.650911 | 0.525247 | couch_ejson_size.erl | starcoder |
%% @doc
%% Measuring time intervals with Prometheus.erl.
%% Measuring time intervals is trivial - you just have to be sure you are using
%% monotonic time source. Basically interval is a difference between
%% start time and end time.
%% Erlang has standard `erlang:monotonic_time' function that returns
%% so called nati... | src/prometheus_time.erl | 0.82566 | 0.622875 | prometheus_time.erl | starcoder |
%%%-------------------------------------------------------------------
%%% @author <NAME> <<EMAIL>>
%%% @copyright (C) 2014, <NAME>
%%% @doc
%%% Interface to the extraction tools.
%%% <p>This module collects the most important functions that
%%% can be used to extract information from eqc models using
%%% symbolic exec... | src/symbolic-execution/see.erl | 0.500732 | 0.42173 | see.erl | starcoder |
%% This module transforms a CPL xml script into a graph
%% representation (during script parsing), that can be used to test
%% various graph properties like; is the graph acyclical, does
%% it contain unreachable states ...
%%
%% The graph can either be interpreted directly as a FSM (finite
%% state machine) when proce... | src/cpl/xml_parse.erl | 0.564339 | 0.694018 | xml_parse.erl | starcoder |
%% This file is a copy of http_uri.erl from the R13B-1 Erlang/OTP
%% distribution with several modifications.
%% All modifications are Copyright (c) 2009-2020 VMware, Inc. or its affiliates.
%% ``The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this ... | erlang_server/_build/default/lib/amqp_client/src/uri_parser.erl | 0.596198 | 0.436502 | uri_parser.erl | starcoder |
%% -------------------------------------------------------------------
%%
%% Copyright (c) 2012 Basho Technologies, Inc. All Rights Reserved.
%%
%% This file is provided to you under the Apache License,
%% Version 2.0 (the "License"); you may not use this file
%% except in compliance with the License. You may obtain
... | deps/yokozuna/src/yz_extractor.erl | 0.67694 | 0.453201 | yz_extractor.erl | starcoder |
-module(rebar3_bsp_uri).
-export([ file/1
, dir/1
, profile/1, profile/2
, sanitize/1
, compose/1
, extract/3
, normalize/1
, normalize/2
, parse/1
]).
-type uri_string() :: uri_string:uri_string().
-type uri_map() :: uri_string:uri_map().
-d... | src/rebar3_bsp_uri.erl | 0.52074 | 0.404684 | rebar3_bsp_uri.erl | starcoder |
-module(solver).
-export([solve/1]).
-include_lib("eunit/include/eunit.hrl").
% Solve the puzzle by placing tiles onto a grid in appropriate places.
solve(Tiles) ->
Adjs = build_adjacencies(Tiles),
Size = trunc(math:sqrt(map_size(Tiles))),
{ok, Grid} = solve(Tiles, Adjs, 1, 1, Size, grid:new(Size)),
Grid.
% ... | day20/solver.erl | 0.605799 | 0.733273 | solver.erl | starcoder |
%% -------------------------------------------------------------------
%%
%% cuttlefish_flag: datatype for simple boolean settings with
%% customizable names and values
%%
%% Copyright (c) 2013 Basho Technologies, Inc. All Rights Reserved.
%%
%% This file is provided to you under the Apache License,
%% Version 2.0 (... | src/cuttlefish_flag.erl | 0.612194 | 0.514217 | cuttlefish_flag.erl | starcoder |
-module(multihash).
-export([digest/2, hash/1, code/1]).
-include("multihash.hrl").
-type code() :: non_neg_integer().
-type hash() ::
identity |
sha1 |
sha2_256 |
sha2_512 |
sha3_224 |
sha3_256 |
sha3_384 |
sha3_512 |
keccak224 |
keccak256 |
keccak384 |
keccak512 |
... | src/multihash.erl | 0.528047 | 0.505798 | multihash.erl | starcoder |
%%%
%%% Asynchronous Game of Life
%%% http://en.wikipedia.org/wiki/Conway's_Game_of_Life
%%% http://en.wikipedia.org/wiki/Asynchronous_cellular_automaton
%%%
%%% This implementation can be run step by step, controlled from
%%% the shell, in which case it preserves the classic game behaviour.
%%% Or it can be run comple... | src/life_async_grid.erl | 0.608827 | 0.530784 | life_async_grid.erl | starcoder |
% Licensed under the Apache License, Version 2.0 (the "License"); you may not
% use this file except in compliance with the License. You may obtain a copy of
% the License at
%
% http://www.apache.org/licenses/LICENSE-2.0
%
% Unless required by applicable law or agreed to in writing, software
% distributed under the... | src/couchdb/couch_task_status.erl | 0.641535 | 0.426023 | couch_task_status.erl | starcoder |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Copyright 2018 Pentland Edge Ltd.
%%
%% Licensed under the Apache License, Version 2.0 (the "License"); you may not
%% use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% http://www.apach... | src/haversine.erl | 0.749454 | 0.552962 | haversine.erl | starcoder |
%% Copyright (c) 2012-2015 <NAME> <<EMAIL>>
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% http://www.apache.org/licenses/LICENSE-2.0
%%
%% Unless required by applicable law or agr... | src/lighthouse_node.erl | 0.681303 | 0.47457 | lighthouse_node.erl | starcoder |
%% -------------------------------------------------------------------
%%
%% Copyright (c) 2007-2010 Basho Technologies, Inc. All Rights Reserved.
%%
%% -------------------------------------------------------------------
-module(riak_search_op_proximity).
-export([
extract_scoring_props/1,
preplan/2... | src/riak_search_op_proximity.erl | 0.572723 | 0.548432 | riak_search_op_proximity.erl | starcoder |
% -*- indent-tabs-mode:nil; -*-
%%%-------------------------------------------------------------------
%%% @author <NAME> <<EMAIL>>
%%% @copyright (C) 2019, <NAME>
%%% @doc
%%%
%%% This module handles the functions for the Discrete Fourier
%%% Transforms (DFT).
%%%
%%% All the computation here is based on a freely avai... | src/tsefft_dft.erl | 0.620047 | 0.599192 | tsefft_dft.erl | starcoder |
%% @doc Basic GIF encoder
%%
%% [https://www.w3.org/Graphics/GIF/spec-gif89a.txt]
%% Originally based on [https://github.com/huacnlee/rucaptcha/tree/master/ext/rucaptcha]
-module(ecaptcha_gif).
-export([encode/4]).
%% For tests
-export([min_bits_to_fit/1]).
-spec encode(
binary(),
pos_integer(),
pos_inte... | src/ecaptcha_gif.erl | 0.522202 | 0.582966 | ecaptcha_gif.erl | starcoder |
-module(mapz).
% API
-export([deep_find/2]).
-export([deep_get/2]).
-export([deep_get/3]).
-export([deep_put/3]).
-export([deep_update/3]).
-export([deep_update_with/3]).
-export([deep_update_with/4]).
-export([deep_remove/2]).
-export([deep_merge/1]).
-export([deep_merge/2]).
-export([deep_merge/3]).
-export([deep_me... | src/mapz.erl | 0.752831 | 0.541409 | mapz.erl | starcoder |
-module(rstar_insert).
-export([insert/3]).
-ifdef(TEST).
-compile(export_all).
-endif.
-include("../include/rstar.hrl").
% ChooseSubtree:
% CS1: Set N to be the root
% CS2: If N is leaf, return N
% CS2b: If N points to leaves, select on
% 1) Minimal Overlap
% 2) Minimal Area Change
% 3) Smallest Area
% CS2c: ... | src/rstar_insert.erl | 0.644225 | 0.677813 | rstar_insert.erl | starcoder |
%% @author <NAME> (<EMAIL>)
%% @copyright <NAME> 2007
%% @doc This module implements the Mnesia driver for ErlyDB.
%%
%% This is an internal ErlyDB module that you normally shouldn't have to
%% use directly. For most situations, all you have to know
%% about this module is the options you can pass to {@link start/1}, w... | src/erlydb/erlydb_mnesia.erl | 0.644449 | 0.52342 | erlydb_mnesia.erl | starcoder |
%% Copyright ProcessOne 2006-2009. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software.... | contrib/xmpp/deps/exmpp-0.9.1-r863/src/core/exmpp_utils.erl | 0.718002 | 0.659282 | exmpp_utils.erl | starcoder |
-module(day2).
-include_lib("eunit/include/eunit.hrl").
-export([run/1]).
-behaviour(aoc).
-type direction() :: forward | down | up.
-type increment() :: pos_integer().
-type command() :: {direction(), increment()}.
-type position1() :: #{
horizontal := non_neg_integer(),
depth := non_neg_integer()
}.
-type... | src/day2.erl | 0.617397 | 0.552902 | day2.erl | starcoder |
-module(bo_missing_operations).
-behaviour(bo_task).
-export([description/0, spec/0, score/0, timeout/0, tests/0]).
%%==============================================================================
%% API
%%==============================================================================
-spec description() -> binary().... | src/tasks/bo_missing_operations.erl | 0.588061 | 0.755344 | bo_missing_operations.erl | starcoder |
%%--------------------------------------------------------------------
%% Copyright (c) 2019 EMQ Technologies Co., Ltd. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License a... | src/emqx_misc.erl | 0.590661 | 0.479991 | emqx_misc.erl | starcoder |
-module(common_eunit).
-export([test/1,
test/2,
test/3,
test_generator/2]).
%% This is called Config in Common Test. It is the return type of the
%% init_per_* functions.
-type fixtures() :: [proplists:property()].
%% A representation of a test set that EUnit understands.
-type eu_test_rep... | src/common_eunit.erl | 0.641535 | 0.633439 | common_eunit.erl | starcoder |
%%%------------------------------------------------------------------------
%% Copyright 2017, OpenCensus Authors
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% http://www.apache.org/... | src/oc_transform.erl | 0.595963 | 0.467028 | oc_transform.erl | starcoder |
%% @doc This module contains code for the Pi to which the sensor is connected
%% (the sender) and the base station.
%% The idea is to start execution on the base station, which will spawn the
%% sender process on the Pi before getting ready to receive its messages.
%%
%% @type measurement() = {Time::integer(), {Tempera... | pi/weather.erl | 0.619817 | 0.666982 | weather.erl | starcoder |
%%%-------------------------------------------------------------------
%%% File: principe_table.erl
%%% @author <NAME> <<EMAIL>>
%%% @copyright Copyright (c) 2009, <NAME>. All Rights Reserved.
%%%
%%% @doc
%%% An extension to the principe module that handles tables. See the
%%% principe module docs for a note... | SRC/medici/principe_table.erl | 0.504883 | 0.461866 | principe_table.erl | starcoder |
-module(cowboy_compiled_router_parser).
-export([parse/1]).
%% graciously stolen from https://github.com/ninenines/cowboy/blob/999dc5b7c1665fb620c14f6303610793313efe58/src/cowboy_router.erl#L51
parse(Routes) ->
compile(Routes, []).
compile([], Acc) ->
lists:reverse(Acc);
compile([{Host, Paths}|Tail], Acc) ->
c... | src/cowboy_compiled_router_parser.erl | 0.520253 | 0.497559 | cowboy_compiled_router_parser.erl | starcoder |
%% @doc MQTT packet encoder
%% Copyright 2018 <NAME>
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% http://www.apache.org/licenses/LICENSE-2.0
%%
%% Unless required by applica... | src/mqtt_packet_map_topic.erl | 0.567337 | 0.443661 | mqtt_packet_map_topic.erl | starcoder |
%% Copyright (c) Facebook, Inc. and its affiliates.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% http://www.apache.org/licenses/LICENSE-2.0
%%
%% Unless required by applicabl... | test/assert_diagnostic_SUITE.erl | 0.735357 | 0.485051 | assert_diagnostic_SUITE.erl | starcoder |
%%
%% @doc Another implementations of
%% [https://groups.google.com/g/erlang-programming/c/ZUHZpH0wsOA
%% coinductive data types].
%%
%% @see lazy
%%
-module(lazy2).
-author("<NAME> <<EMAIL>>").
-export([gen/2, filter/2, foldl/3, map/2, take/2]).
-export([natural_numbers/0]).
-dialyzer(no_improper_lists).
-type lazy... | lib/ndpar/src/lazy2.erl | 0.616705 | 0.704967 | lazy2.erl | starcoder |
%%%=============================================================================
%%% @copyright 2017, <NAME>
%%% @doc Stochastic pool.
%%%
%%% Opaque data structure that handle a collection of peers.
%%% Implements the design described in:
%%% [https://github.com/aeternity/protocol/blob/master/GOSSIP.md]
%%%
%%% Usag... | apps/aecore/src/aec_peers_pool.erl | 0.674587 | 0.507934 | aec_peers_pool.erl | starcoder |
%% -------------------------------------------------------------------
%%
%% Copyright (c) 2016 <NAME>. All Rights Reserved.
%%
%% This file is provided to you under the Apache License,
%% Version 2.0 (the "License"); you may not use this file
%% except in compliance with the License. You may obtain
%% a copy of the L... | src/conver_consistency.erl | 0.610453 | 0.506774 | conver_consistency.erl | starcoder |
%% -----------------------------------------------------------------------------
%%
%% The MIT License (MIT)
%%
%% Copyright (c) 2015 <NAME>
%%
%% Permission is hereby granted, free of charge, to any person obtaining a copy
%% of this software and associated documentation files (the "Software"), to deal
%% in the Softw... | src/otp_digraph.erl | 0.605799 | 0.433382 | otp_digraph.erl | starcoder |
-module(aesim_scenario_gossip_time).
%% @doc Default simulation scenario.
%%
%% - Starts a cluster of configurable size.
%% - Wait for all nodes to know a configurable percentage of the other nodes.
%% - Start a single node and measure the time for it to get to know a
%% configurable percentage of the other nodes.
%... | src/scenarios/aesim_scenario_gossip_time.erl | 0.522689 | 0.636523 | aesim_scenario_gossip_time.erl | starcoder |
% @doc GRiSP SPI API.
%
% <a href="https://en.wikipedia.org/wiki/Serial_Peripheral_Interface">Serial
% Peripheral Interface (SPI)</a> is a synchronous serial communication
% protocol, where a single controller device can control many responder
% devices. With this API, the GRiSP board acts as a controller and any conne... | src/grisp_spi.erl | 0.835181 | 0.6522 | grisp_spi.erl | starcoder |
%% Taken from erlang stdlib implementation.
%% Adapted by <EMAIL> to encode and decode base64url. This is
%% a url and filename friendly version of base64. See also RFC4648.
%%
%% %CopyrightBegin%
%%
%% Copyright Ericsson AB 2007-2009. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Publ... | src/base64url/base64url.erl | 0.560373 | 0.42919 | base64url.erl | starcoder |
%%%-----------------------------------------------------------------------------
%%% Copyright (c) 2013-2018 Klarna AB
%%%
%%% This file is provided to you under the Apache License,
%%% Version 2.0 (the "License"); you may not use this file
%%% except in compliance with the License. You may obtain
%%% a copy of the Li... | src/avro_array.erl | 0.534612 | 0.442215 | avro_array.erl | starcoder |
%% -------------------------------------------------------------------
%%
%% Riak: A lightweight, decentralized key-value store.
%%
%% Copyright (c) 2007-2011 Basho Technologies, Inc. All Rights Reserved.
%%
%% This file is provided to you under the Apache License,
%% Version 2.0 (the "License"); you may not use this ... | src/riak_core_status.erl | 0.598664 | 0.430028 | riak_core_status.erl | starcoder |
%% -------------------------------------------------------------------
%%
%% Copyright (c) 2011 Bash<NAME>, Inc.
%%
%% This file is provided to you under the Apache License,
%% Version 2.0 (the "License"); you may not use this file
%% except in compliance with the License. You may obtain
%% a copy of the License at
%%... | src/riak_pipe_w_rec_countdown.erl | 0.698741 | 0.757122 | riak_pipe_w_rec_countdown.erl | starcoder |
%%%========================================================================
%%% File: ring.erl
%%%
%%% This module implements a simple ring benchmark in Erlang.
%%%
%%%
%%% The ring benchmark is about sending a message over a ring of processes.
%%% The following are the parameters of the benchmark that can be
%%% confi... | src/ring.erl | 0.553988 | 0.494263 | ring.erl | starcoder |
%%
%% Copyright (c) 2015-2016 <NAME>. All Rights Reserved.
%%
%% This file is provided to you under the Apache License,
%% Version 2.0 (the "License"); you may not use this file
%% except in compliance with the License. You may obtain
%% a copy of the License at
%%
%% http://www.apache.org/licenses/LICENSE-2.0
%%
%... | src/dot_set.erl | 0.705278 | 0.442456 | dot_set.erl | starcoder |
%%% ==========================================================================
%%% Copyright 2015 Silent Circle
%%%
%%% Licensed under the Apache License, Version 2.0 (the "License");
%%% you may not use this file except in compliance with the License.
%%% You may obtain a copy of the License at
%%%
%%% http://www.... | test/sc_util_app_SUITE.erl | 0.548432 | 0.47098 | sc_util_app_SUITE.erl | starcoder |
%% @doc
%% Counter is a Metric that represents a single numerical value that only ever
%% goes up. That implies that it cannot be used to count items whose number can
%% also go down, e.g. the number of currently running processes. Those
%% "counters" are represented by {@link prometheus_gauge}.
%%
%% A Counter is typi... | src/metrics/prometheus_counter.erl | 0.79956 | 0.620248 | prometheus_counter.erl | starcoder |
%% -------------------------------------------------------------------
%%
%% Copyright (c) 2007-2012 Basho Technologies, Inc. All Rights Reserved.
%%
%% This file is provided to you under the Apache License,
%% Version 2.0 (the "License"); you may not use this file
%% except in compliance with the License. You may ob... | src/riak_core_stat_q.erl | 0.625438 | 0.486149 | riak_core_stat_q.erl | starcoder |
%@doc A BSON document is a JSON-like object with a standard binary encoding defined at bsonspec.org. This implements version 1.0 of that spec.
-module (bson).
-export_type ([maybe/1]).
-export_type ([document/0, label/0, value/0]).
-export_type ([arr/0]).
-export_type ([bin/0, bfunction/0, uuid/0, md5/0, userdefined/0... | src/bson.erl | 0.525612 | 0.446072 | bson.erl | starcoder |
% Licensed under the Apache License, Version 2.0 (the "License"); you may not
% use this file except in compliance with the License. You may obtain a copy of
% the License at
%
% http://www.apache.org/licenses/LICENSE-2.0
%
% Unless required by applicable law or agreed to in writing, software
% distributed under the... | src/kai_sup.erl | 0.653901 | 0.403273 | kai_sup.erl | starcoder |
%%----------------------------------------------------------------------------------------------------------------
%% @author <NAME> <<EMAIL>>
%% @copyright 2010 <NAME>
%% @doc 'datediff' filter, produce the difference between two dates selecting which date part is interesting.
%%---------------------------------------... | apps/zotonic_mod_base/src/filters/filter_datediff.erl | 0.557364 | 0.438244 | filter_datediff.erl | starcoder |
-module(aoc2018_day02).
-behavior(aoc_puzzle).
-export([parse/1, solve1/1, solve2/1, info/0]).
-include("aoc_puzzle.hrl").
-spec info() -> aoc_puzzle().
info() ->
#aoc_puzzle{module = ?MODULE,
year = 2018,
day = 2,
name = "Inventory Management System",
... | src/2018/aoc2018_day02.erl | 0.54359 | 0.650155 | aoc2018_day02.erl | starcoder |
%% -*- mode: erlang;erlang-indent-level: 4;indent-tabs-mode: nil -*-
%% @author <NAME> <<EMAIL>>
%% @doc
%% An Erlang interface to Amazon's DynamoDB.
%%
%% [http://aws.amazon.com/archives/Amazon-DynamoDB/8498019230173117]
%%
%% erlcloUd_ddb implements the entire 20111205 API. erlcloud_ddb2
%% implements a newer versio... | src/erlcloud_ddb.erl | 0.599368 | 0.417806 | erlcloud_ddb.erl | starcoder |
%% -------------------------------------------------------------------
%%
%% Copyright (c) 2014 SyncFree Consortium. All Rights Reserved.
%%
% This file is provided to you under the Apache License,
%% Version 2.0 (the "License"); you may not use this file
%% except in compliance with the License. You may obtain
%% a ... | test/commit_hooks_SUITE.erl | 0.530236 | 0.461441 | commit_hooks_SUITE.erl | starcoder |
% This file is licensed to you under the Apache License,
% Version 2.0 (the "License"); you may not use this file
% except in compliance with the License. You may obtain
% a copy of the License at
%
% http://www.apache.org/licenses/LICENSE-2.0
%
% Unless required by applicable law or agreed to in writing,
% software d... | test/fiar_core_SUITE.erl | 0.553988 | 0.488832 | fiar_core_SUITE.erl | starcoder |
%% @doc Node data structure for A* search.
%% @author <NAME> <<EMAIL>>
%% @copyright <NAME> 2010, released under the MIT license.
%% @version 0.0.1
-module(astar_node).
-export([new_node/0, new_node/1, extract_attribute/2, set_attribute/3, add_cost_estimates/2, add_cost_estimate/2]).
%% Copyright (c) 2010 <NAME>
%% ... | astar_node.erl | 0.719975 | 0.493592 | astar_node.erl | starcoder |
%%%-----------------------------------------------------------------------------
%%% @doc blockchain_poc_path_v3 implementation.
%%%
%%% The way paths are built depends solely on witnessing data we have accumulated
%%% in the blockchain ledger.
%%%
%%% Consider X having [A, B, C, D] as its geographic neighbors but only... | src/poc/blockchain_poc_path_v3.erl | 0.541166 | 0.723767 | blockchain_poc_path_v3.erl | starcoder |
%% -------------------------------------------------------------------
%%
%% Copyright (c) 2014 SyncFree Consortium. All Rights Reserved.
%%
%% This file is provided to you under the Apache License,
%% Version 2.0 (the "License"); you may not use this file
%% except in compliance with the License. You may obtain
%% a... | test/bcountermgr_SUITE.erl | 0.561215 | 0.470433 | bcountermgr_SUITE.erl | starcoder |
%%% Concurrent Programming In Erlang -- The University of Kent / FutureLearn
%%% Exercise : https://www.futurelearn.com/courses/concurrent-programming-erlang/3/steps/488342
%%% - Version 2 : Less permissive frequency server. Renamed to frequency.erl.
%%%
%%% Last Modified Time-stamp: <2020-07-08 13:12:20, updated ... | exercises/e3/v2/frequency.erl | 0.609989 | 0.599661 | frequency.erl | starcoder |
%
% This file is part of AtomVM.
%
% Copyright 2020-2021 <NAME> <<EMAIL>>
%
% Licensed under the Apache License, Version 2.0 (the "License");
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% http://www.apache.org/licenses/LICENSE-2.0
%
% Unless required... | libs/alisp/src/sexp_lexer.erl | 0.619471 | 0.758309 | sexp_lexer.erl | starcoder |
% Licensed under the Apache License, Version 2.0 (the "License"); you may not
% use this file except in compliance with the License. You may obtain a copy of
% the License at
%
% http://www.apache.org/licenses/LICENSE-2.0
%
% Unless required by applicable law or agreed to in writing, software
% distributed under the ... | src/knit_beam_lib.erl | 0.699562 | 0.409693 | knit_beam_lib.erl | starcoder |
% Percent sign starts a one-line comment.
%% Two percent characters shall be used to comment functions.
%%% Three percent characters shall be used to comment modules.
% We use three types of punctuation in Erlang.
% Commas (`,`) separate arguments in function calls, data constructors, and
% patterns.
% Periods (`.`)... | samples/elixir/erlang/learnerlang.erl | 0.657868 | 0.890103 | learnerlang.erl | starcoder |
%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% http://www.apache.org/licenses/LICENSE-2.0
%%
%% Unles... | src/emqx_trie.erl | 0.533154 | 0.4953 | emqx_trie.erl | starcoder |
%%
%% Copyright (c) 2018 <NAME>. All Rights Reserved.
%%
%% This file is provided to you under the Apache License,
%% Version 2.0 (the "License"); you may not use this file
%% except in compliance with the License. You may obtain
%% a copy of the License at
%%
%% http://www.apache.org/licenses/LICENSE-2.0
%%
%% Unl... | src/ldb_forward.erl | 0.602763 | 0.438304 | ldb_forward.erl | starcoder |
-module(astar).
-compile(inline).
-export([search/4]).
-export([is_unvisited/2]).
-export_type([grid/0, valid_fun/0, visited_grids/0]).
-type grid() :: {integer(), integer()}.
-type result() :: {max, Path :: [grid()]} | none| max_limited.
-type max_limit() :: {max_limit, non_neg_integer()}.
-type option() :: {asta... | src/astar.erl | 0.619471 | 0.468791 | astar.erl | starcoder |
%%
%% @doc Saddleback search.
%%
%% Design a function `invert' that takes two arguments:
%% a function `f: N × N ⟶ N', and
%% a number `z ∈ N'.
%% The value `invert(f, z)' is a list of all pairs `(x,y)'
%% satisfying `f(x,y) = z'.
%% `f' is strictly increasing in each argument.
%%
%% The solution should make as few eva... | lib/ndpar/src/saddleback.erl | 0.741206 | 0.859664 | saddleback.erl | starcoder |
%%--------------------------------------------------------------------
%% Copyright (c) 2019-2021 EMQ Technologies Co., Ltd. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the Lice... | test/mria_autoheal_SUITE.erl | 0.52683 | 0.437163 | mria_autoheal_SUITE.erl | starcoder |
%%%-----------------------------------------------------------------------------
%%% Copyright (C) 2013-2014, <NAME> <<EMAIL>>
%%%
%%% Licensed under the Apache License, Version 2.0 (the "License");
%%% you may not use this file except in compliance with the License.
%%% You may obtain a copy of the License at
%%%
%%% ... | src/ejson_util.erl | 0.507812 | 0.435541 | ejson_util.erl | starcoder |
%% This Source Code Form is subject to the terms of the Mozilla Public
%% License, v. 2.0. If a copy of the MPL was not distributed with this
%% file, You can obtain one at https://mozilla.org/MPL/2.0/.
%%
%% Copyright (c) 2021-2022 VMware, Inc. or its affiliates. All rights reserved.
%%
%% @doc Anonymous function ex... | src/khepri_fun.erl | 0.66236 | 0.470372 | khepri_fun.erl | starcoder |
%%% @doc Bootstrap a sample by resampling in the data structure
%%% @end
-module(eministat_resample).
-include("eministat.hrl").
-export([resample/3, bootstrap_bca/3]).
-compile(export_all).
%% @doc resample/3 is the main resampler of eministat
%% @end
resample(Estimators, Resamples, #dataset { n = N, points = Ps })... | src/eministat_resample.erl | 0.536313 | 0.602529 | eministat_resample.erl | starcoder |
%% @doc Format dates in erlang
%%
%% Licensed under the DWTFYW License
%%
%% This module formats erlang dates in the form
%% {{Year, Month, Day}, {Hour, Minute, Second}}
%% to printable strings, using (almost) equivalent
%% formatting rules as http://uk.php.net/date
%%
%% erlang has no concept of timezone so the follow... | _build/default/lib/dh_date/src/dh_date.erl | 0.540439 | 0.485783 | dh_date.erl | starcoder |
%% Copyright (c) 2012-2016 <NAME> <<EMAIL>>
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% http://www.apache.org/licenses/LICENSE-2.0
%%
%% Unless required by applicable law or agr... | src/mdns_advertise.erl | 0.59408 | 0.413477 | mdns_advertise.erl | starcoder |
% The Computer Language Benchmarks Game
% https://salsa.debian.org/benchmarksgame-team/benchmarksgame/
%
% contributed by <NAME>
% minor optimizations by <NAME> (2007-06-17)
%% erlc nbody.erl
%% erl -smp enable -noshell -run nbody main 50000000
-module(nbody).
-export([main/1]).
-define(pi, 3.14159265358979323).
-d... | bench/nbody.erl | 0.536556 | 0.465873 | nbody.erl | starcoder |
%%%-------------------------------------------------------------------
%%% @author <NAME>
%%% @copyright (C) 2017,
%%% @doc Erlang module to convert Romans numbers to integers
%%% @end
%%% Created : 10. dez 2017 17:55
%%%-------------------------------------------------------------------
-module(romans).
-compile([{n... | src/romans.erl | 0.555676 | 0.440349 | romans.erl | starcoder |
%% -*- erlang-indent-level: 4;indent-tabs-mode: nil; fill-column: 92 -*-
%% ex: ts=4 sw=4 et
%%
%% Copyright 2014 CHEF Software, Inc. All Rights Reserved.
%%
%% This file is provided to you under the Apache License,
%% Version 2.0 (the "License"); you may not use this file
%% except in compliance with the License. You... | src/sqerl_rec.erl | 0.580114 | 0.420778 | sqerl_rec.erl | starcoder |
%%
%% %CopyrightBegin%
%%
%% Copyright Ericsson AB 1996-2011-2012. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Public L... | src/couch_log/src/couch_log_trunc_io_fmt.erl | 0.503174 | 0.415136 | couch_log_trunc_io_fmt.erl | starcoder |
%%% Pure erlang port of https://github.com/Cobenian/inet_cidr
%%% Erlang Port by <NAME>, 2022
%%%
%%% Original code Copyright (c) 2015 <NAME>
%%%
%%% Licensed under the Apache License, Version 2.0 (the "License");
%%% you may not use this file except in compliance with the License.
%%% You may obtain a copy of the Lice... | src/inet_cidr.erl | 0.703346 | 0.494019 | inet_cidr.erl | starcoder |
%%==============================================================================
%% Copyright 2012 <NAME>
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% http://www.apache.org/licen... | src/leader_cron_task.erl | 0.699562 | 0.438545 | leader_cron_task.erl | starcoder |
%% @doc Interface with hex.pm
-module(dep_hex).
-behaviour(hex_http).
-export([request/5]).
-export([get_latest_vsn/1]).
%% @doc Returns the latest version of a package in hex.pm
-spec get_latest_vsn(atom()) -> binary() | undefined.
get_latest_vsn(Name) ->
case hex_repo:get_package(config(), atom_to_binary(Name,... | src/dep_hex.erl | 0.525369 | 0.405184 | dep_hex.erl | starcoder |
%% @author <NAME> <<EMAIL>>
%% @copyright 2018 <NAME>
%% @doc Javascript minifier. Based on jsmin.c
%% Copyright 2018 <NAME>
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% htt... | src/z_jsmin.erl | 0.596081 | 0.45423 | z_jsmin.erl | starcoder |
%%%------------------------------------------------------------------------
%%% @author <NAME> <<EMAIL>>
%%% @author <NAME> <<EMAIL>>
%%% @copyright (C) 2015, <NAME>, <NAME>
%%% @doc
%%% Implements a cluster of nodes. The clusters save information about
%%% which parent-child relationships between its nodes. Clusters a... | src/behaviour_extraction/cluster.erl | 0.505859 | 0.560162 | cluster.erl | starcoder |
-module(rope_tree).
-include("rope_tree.hrl").
-export([ to_iolist/1
, to_string/1
, nth/2
, length/1
, concatenate/2
, split/2
, insert_string/3
, insert_character/3
, delete_seq/3
, delete_character/2
, rotate_left/1
, rotate_ri... | src/rope_tree.erl | 0.514644 | 0.433742 | rope_tree.erl | starcoder |
%%% Functions for working with continuous genomes
-module(continuous).
-export([gaussian_mutate/2, gaussian_mutate/3, gaussian_mutate/4]).
-export([random_genome/1]).
-type continuous_genome() :: list(float()).
-type range() :: {number(), number()}.
-type bounds() :: list(range()).
-spec gaussi... | src/continuous.erl | 0.603348 | 0.712739 | continuous.erl | starcoder |
%% -------------------------------------------------------------------
%%
%% Copyright <2013-2018> <
%% Technische Universität Kaiserslautern, Germany
%% Université Pierre et Marie Curie / Sorbonne-Université, France
%% Universidade NOVA de Lisboa, Portugal
%% Université catholique de Louvain (UCL), Belgique
%% IN... | apps/antidote/src/meta_data_sender.erl | 0.519521 | 0.459561 | meta_data_sender.erl | starcoder |
% @doc GRiSP General Purpose Input/Output (GPIO) API.
%
% General Purpose Input / Output (GPIO) is used to control digital signals on a
% pin. The digital values `0' and `1' correspond to a low or high voltage
% respectively. On GRiSP the voltage for GPIO pins is 3.3V.
%
% A pin can be controlled either as an output pi... | src/grisp_gpio.erl | 0.594787 | 0.650883 | grisp_gpio.erl | starcoder |
%% -------------------------------------------------------------------
%%
%% riak_buckets_fsm: listing of buckets
%%
%% Copyright (c) 2007-2011 Basho Technologies, Inc. All Rights Reserved.
%%
%% This file is provided to you under the Apache License,
%% Version 2.0 (the "License"); you may not use this file
%% except ... | deps/riak_kv/src/riak_kv_buckets_fsm.erl | 0.531939 | 0.406744 | riak_kv_buckets_fsm.erl | starcoder |
%
% reia_eval: Evaluate a given set of Reia expressions
% Copyright (C)2009 <NAME>
%
% Redistribution is permitted under the MIT license. See LICENSE for details.
%
-module(reia_eval).
-export([new_binding/0, string/1, string/2, exprs/1, exprs/2]).
-include("../compiler/reia_nodes.hrl").
-include("../compiler/reia_bi... | src/core/reia_eval.erl | 0.688992 | 0.585457 | reia_eval.erl | starcoder |
%%--------------------------------------------------------------------
%% Copyright (c) 2019 EMQ Technologies Co., Ltd. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License a... | test/emqx_mod_rewrite_SUITE.erl | 0.510008 | 0.406626 | emqx_mod_rewrite_SUITE.erl | starcoder |
-module(phi_failure_detector).
-export([new/2]).
-export([new/3]).
-export([phi/1]).
-export([phi/2]).
-export([phi/3]).
-export([heartbeat/2]).
-export([heartbeat/3]).
-export([monitor/3]).
%% @doc Creates a new Phi Failure Detector
%%
%% {@link new/3}
%% @end
-spec new(Label, ID) -> {ok, Pid}
... | src/phi_failure_detector.erl | 0.762866 | 0.646321 | phi_failure_detector.erl | starcoder |
%% @doc: If you wish to implement your own backend for storing
%% registers, your module needs to implement these interfaces. The
%% backend modules have quite a lot of responsibility (detailed below)
%% to allow for backend-specific optimizations.
-module(hyper_register).
-type t() :: module().
-export_type([t/0]).
... | src/hyper_register.erl | 0.672439 | 0.764979 | hyper_register.erl | starcoder |
-module(color).
% API
-export([p/2]).
-export([black/1]).
-export([black/2]).
-export([red/1]).
-export([red/2]).
-export([green/1]).
-export([green/2]).
-export([yellow/1]).
-export([yellow/2]).
-export([blue/1]).
-export([blue/2]).
-export([purple/1]).
-export([purple/2]).
-export([cyan/1]).
-export([cyan/2])... | src/color.erl | 0.558809 | 0.51818 | color.erl | starcoder |
%% -------------------------------------------------------------------
%%
%% Copyright (c) 2016 <NAME>. All Rights Reserved.
%%
%% This file is provided to you under the Apache License,
%% Version 2.0 (the "License"); you may not use this file
%% except in compliance with the License. You may obtain
%% a copy of the ... | src/nklib_headers.erl | 0.670824 | 0.401923 | nklib_headers.erl | starcoder |
-module(bingo_game).
-include("bingo_game.hrl").
-ifdef(TEST).
-include_lib("eunit/include/eunit.hrl").
-endif.
-export([new/1, new/2, mark_phrase/3]).
-type buzzwords() :: [bingo_buzzwords:buzzword()].
%%-------------------------------------------------------------------------
%% Function: new(Size) -> BingoGame
... | src/bingo_game.erl | 0.588298 | 0.516961 | bingo_game.erl | starcoder |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.