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 |
|---|---|---|---|---|---|
%% rufus_tokenize inserts expression terminators into a stream of tokens
%% produced by rufus_raw_tokenize, based on the set of rules defined in the
%% _Semicolons_ section of the language spec:
%%
%% 1. When the input is broken into tokens, a semicolon is automatically
%% inserted into the token stream immediately ... | rf/src/rufus_tokenize.erl | 0.610802 | 0.799951 | rufus_tokenize.erl | starcoder |
-module(morpheus_instrument).
%% API exports
-export([instrument_and_load/6, whitelist_func/3]).
-include("morpheus_priv.hrl").
%%====================================================================
%% API functions
%%====================================================================
%% Instrument a module with o... | src/morpheus_instrument.erl | 0.570212 | 0.47025 | morpheus_instrument.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.693058 | 0.442456 | couch_task_status.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 Khepri API for transa... | src/khepri_tx.erl | 0.691706 | 0.415373 | khepri_tx.erl | starcoder |
-module(coello_basic_spec).
-include_lib("espec/include/espec.hrl").
-include_lib("hamcrest/include/hamcrest.hrl").
-include_lib("amqp_client/include/amqp_client.hrl").
spec() ->
before_all(fun() ->
meck:new([amqp_channel]),
meck:expect(amqp_channel, cast, 2, ok),
meck:expect(amqp_channel, ca... | test/spec/coello_basic_spec.erl | 0.668447 | 0.456349 | coello_basic_spec.erl | starcoder |
%% roman -- Roman Numerals in Erlang
%%
%% @doc Allows you to add and subtract Roman numerals in pure Erlang, with
%% Roman numeral "literals":
%%
%% ```
%% roman:add(ii, ii) =:= iv.
%% roman:subtract(v, iii) =:= ii.
%% '''
%%
%% Finally! A way to do calculations on movie copyright years!
%%
%% ```
%% roman:subtract(mm... | roman.erl | 0.603932 | 0.533215 | roman.erl | starcoder |
%% ==========================================================================================================
%% Ram - A distributed KV store for Erlang and Elixir.
%%
%% The MIT License (MIT)
%%
%% Copyright (c) 2021-2022 <NAME> <<EMAIL>>.
%%
%% Permission is hereby granted, free of charge, to any person obtaining a c... | src/ram.erl | 0.532911 | 0.42931 | ram.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... | src/clocksi_materializer.erl | 0.651133 | 0.403185 | clocksi_materializer.erl | starcoder |
%% @doc This is the main API for the library.
%%
%% You can think of this module as an abstraction layer
%% on the raw API which attempts to add some convenience
%% to plumbing the entire thing by hand-coding maps with
%% the appropriate AWS magic.
%%
%% The low level API calls are in `darcy_ddb_api.erl', but generally... | src/darcy.erl | 0.558568 | 0.444866 | darcy.erl | starcoder |
-module(interval_table).
-export([new/0, gap_size/1, span/2, assign/2, shrink/2, lookup/2]).
-export_type([table/0]).
-type key() :: any().
-record(table, {gaps = [] :: list(interval:interval()),
intervals = [] :: list({interval:interval(), key()})}).
-opaque table() :: #table{}.
-spec new() -> tabl... | src/interval_table.erl | 0.676834 | 0.488649 | interval_table.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 ... | vtree/src/vtree_util.erl | 0.818845 | 0.660638 | vtree_util.erl | starcoder |
%% -------- Overview ---------
%%
%% There are two primary types of exchange sorted
%% - a full exchange aimed at implementations with cached trees, where the
%% cached trees represent all the data in the location, and the comparion is
%% between two complete data sets
%% - a partial exchange where it is expected that ... | src/aae_exchange.erl | 0.650245 | 0.871311 | aae_exchange.erl | starcoder |
%%--------------------------------------------------------------------
%% Copyright (c) 2013-2018 EMQ Enterprise, Inc. (http://emqtt.io)
%%
%% 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/emqttd_hooks.erl | 0.587943 | 0.404507 | emqttd_hooks.erl | starcoder |
% @doc
% <a href="https://reference.digilentinc.com/reference/pmod/pmodgps/reference-manual">
% PmodGPS</a>
% module.
%
% The PmodGPS sends the GPS data over UART.
%
% Start the driver with
% ```
% 1> grisp:add_device(uart, pmod_gps).
% '''
% @end
-module(pmod_gps).
-behaviour(gen_server).
%--- Exports -------------... | src/pmod_gps.erl | 0.587943 | 0.481271 | pmod_gps.erl | starcoder |
%% @author <NAME> <<EMAIL>>
%% @copyright 2012 <NAME>
%% @doc Calculate a quadtile code from a lat/long location. (http://wiki.openstreetmap.org/wiki/QuadTiles)
%% Copyright 2012 <NAME>
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the Lice... | src/support/geomap_quadtile.erl | 0.753467 | 0.58516 | geomap_quadtile.erl | starcoder |
%%%-------------------------------------------------------------------
%%% @author yangcancai
%%% Copyright (c) 2021 by yangcancai(<EMAIL>), 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 obta... | src/bd_bench.erl | 0.554109 | 0.455078 | bd_bench.erl | starcoder |
%%%------------------------------------------------------------------------
%% Copyright 2018, 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_stat_measure.erl | 0.750461 | 0.496338 | oc_stat_measure.erl | starcoder |
%% =====================================================================
%% @doc Hugin is a framework to simplify the process of defining your
%% own web crawlers. It tries to do so while maintaining maximum
%% flexibility and efficiency.
%%
%% The name Hugin comes from one the two ravens owned by Odin in
%% Norse myth... | src/hugin.erl | 0.544075 | 0.570511 | hugin.erl | starcoder |
%% @author <NAME> <<EMAIL>>
%% @doc This is AOC2020 <em>day11</em> solution
%% @reference <a href="https://adventofcode.com/2020/day/11">AOC 2020 day 11</a> for
%% @since 2020-12-18
%% @version 0.5.0
-module(day11).
-export([solve_part1/1, solve_part2/1]).
% could be shielded with -ifdef(TEST) macro
-export([parse/1... | src/day11.erl | 0.685107 | 0.586641 | day11.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_stats/src/couch_stats.erl | 0.802981 | 0.491212 | couch_stats.erl | starcoder |
%%
%% %CopyrightBegin%
%%
%% Copyright Ericsson AB 2022. 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
%%
%% Un... | lib/compiler/src/beam_bounds.erl | 0.675444 | 0.433442 | beam_bounds.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 Condition support.
%%... | src/khepri_condition.erl | 0.770853 | 0.458288 | khepri_condition.erl | starcoder |
%% @doc Observing a metric involves periodically recording a snapshot of
%% a scalar metric in the form of a histogram. These snapshots are recorded
%% over a pre-configured interval. Each histogram will be registered
%% automatically with the `metrics_reader'.
%% Currently, only the folsom backend is supported but it... | src/metrics_observer.erl | 0.708011 | 0.558748 | metrics_observer.erl | starcoder |
-module(pvc_ring).
-include("pvc.hrl").
%% API
-export([grb_replica_info/3,
random_indexnode/1,
get_key_indexnode/3,
size/1]).
%% @doc Raw ring structure returned from antidote
%%
%% Nodes are in erlang format, i.e. node_name@ip_address
-type raw_ring() :: list({partition_id(), node(... | src/pvc_ring.erl | 0.507568 | 0.418994 | pvc_ring.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... | test/kai_hash_SUITE.erl | 0.62498 | 0.443118 | kai_hash_SUITE.erl | starcoder |
%% Copyright 2019 Octavo Labs AG Zurich Switzerland (http://octavolabs.com)
%%
%% 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
%%
%% Unle... | apps/vmq_generic_msg_store/src/engines/vmq_storage_engine_dets.erl | 0.546738 | 0.429011 | vmq_storage_engine_dets.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/state_orset_ext.erl | 0.541894 | 0.404272 | state_orset_ext.erl | starcoder |
%% @author <NAME> <<EMAIL>>
%% @copyright 2017 <NAME>
%% @doc Vector operation functions.
%%
%% Vector is a 1-dimensional array, which elements stored sequentially into Erlang binary object of
%% some IEEE758 floating point data type: single float, double float, single complex or double complex.
%%
%% V... | src/nvector.erl | 0.733643 | 0.517876 | nvector.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 ... | lib/hipe/opt/hipe_schedule.erl | 0.524882 | 0.503723 | hipe_schedule.erl | starcoder |
%% -------------------------------------------------------------------
%%
%% riak_core_coverage_plan: Create a plan to cover a minimal set of VNodes.
%%
%% Copyright (c) 2007-2015 Basho Technologies, Inc. All Rights Reserved.
%%
%% This file is provided to you under the Apache License,
%% Version 2.0 (the "License"); ... | src/riak_core_coverage_plan.erl | 0.708112 | 0.478224 | riak_core_coverage_plan.erl | starcoder |
-module(blockchain_assert_loc_v2_SUITE).
-include_lib("common_test/include/ct.hrl").
-include_lib("eunit/include/eunit.hrl").
-include("blockchain_vars.hrl").
-include("blockchain_utils.hrl").
-export([all/0, init_per_testcase/2, end_per_testcase/2]).
-export([
basic_test/1,
bad_owner_sig_test/1,
bad_pay... | test/blockchain_assert_loc_v2_SUITE.erl | 0.545286 | 0.601067 | blockchain_assert_loc_v2_SUITE.erl | starcoder |
%%-------------------------------------------------------------------
%%
%% Copyright (c) 2015, <NAME> <<EMAIL>>
%%
%% 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/backoff_supervisor.erl | 0.716219 | 0.441492 | backoff_supervisor.erl | starcoder |
%%%------------------------------------------------------------------------
%% Copyright 2019, OpenTelemetry 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.o... | src/ot_span.erl | 0.686055 | 0.450964 | ot_span.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_btree.erl | 0.551091 | 0.451447 | couch_btree.erl | starcoder |
%% -------------------------------------------------------------------
%%
%% riak_core: Core Riak Application
%%
%% Copyright (c) 2007-2015 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 c... | src/riak_core_claim.erl | 0.724578 | 0.469703 | riak_core_claim.erl | starcoder |
%%%-------------------------------------------------------------------
%%% @author <NAME>
%%% @copyright (C) 2018 ACK CYFRONET AGH
%%% This software is released under the MIT license cited in 'LICENSE.txt'.
%%% @end
%%%-------------------------------------------------------------------
%%% @doc
%%% This module contains... | src/modules/onepanel_dns.erl | 0.55254 | 0.436682 | onepanel_dns.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/inter_dc_manager.erl | 0.546496 | 0.401923 | inter_dc_manager.erl | starcoder |
-module(rstar_search).
-export([search_within/2, search_near/3]).
-ifdef(TEST).
-compile(export_all).
-endif.
-include("../include/rstar.hrl").
% Searches the tree for any geometries within or intersecting
% with the given geometry
search_within(Root, Geo) -> search_within(Root, Geo, []).
search_within(#geometry{va... | src/rstar_search.erl | 0.620047 | 0.659967 | rstar_search.erl | starcoder |
-module(poly_SUITE).
-include_lib("eunit/include/eunit.hrl").
-export([all/0, init_per_testcase/2, end_per_testcase/2]).
-export(
[
eval_test/1,
from_fr_test/1,
interpolate_with_fr_test/1,
zeroize_test/1,
self_subtract_test/1,
add_zero_test/1,
sub_zero_test... | test/poly_SUITE.erl | 0.712332 | 0.612628 | poly_SUITE.erl | starcoder |
%% @copyright 2011 <NAME>
%% @author <NAME> <<EMAIL>>
%% @version {@date} {@time}
%% @doc Function call timing analysis. Parts lifted from hipe_timer.erl (thanks OTP)
%% @end
-module(funalysis).
-export([advanced/2,
par_advanced/3]).
-export([par_proc_iterations/2,
analyse/2]).
t(F) ->
NullTime ... | funalysis.erl | 0.532425 | 0.44571 | funalysis.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/ejson/ejson.erl | 0.504639 | 0.44059 | ejson.erl | starcoder |
-module(nanometer).
-type piece() :: atom() | integer() | binary().
-type name() :: [piece()].
-type options() :: proplists:proplist().
-type values() :: [{piece(), number()}].
-type type() :: counter | meter | gauge | histogram | external.
-type error() :: {error, any()}.
-callback create(name(), options()) -> any()... | src/nanometer.erl | 0.551815 | 0.431884 | nanometer.erl | starcoder |
%% =============================================================================
%% bondy_consistent_hashing.erl -
%% Copyright (c) 2016-2021 Leapsight. 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.
%% ... | apps/bondy/src/bondy_consistent_hashing.erl | 0.555073 | 0.433442 | bondy_consistent_hashing.erl | starcoder |
%% Copyright 2016-2017 TensorHub, Inc.
%%
%% 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 t... | src/guild_collector_protocol.erl | 0.573201 | 0.413004 | guild_collector_protocol.erl | starcoder |
-module(gen_rate_limiter).
-behaviour(gen_server).
%% API
-export([start_link/2, run/2]).
%% Gen Server
-export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]).
%% This module defines a generic rate limiter (rl) intended to be used with APIs that
%% only allow a certain number of ... | src/gen_rate_limiter.erl | 0.583322 | 0.410993 | gen_rate_limiter.erl | starcoder |
%%==============================================================================
%% Copyright 2013-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.a... | src/lazy.erl | 0.591251 | 0.612252 | lazy.erl | starcoder |
%% @doc Module for converting ip formats and results
-module(ipmangle).
-export([ip_results_to_json/1, verify_address/1]).
-include("defs.hrl").
-spec check_blacklist(byte()) -> ok.
check_blacklist(A) ->
case A of
169 ->
erlang:error(blacklist_net);
_ ->
ok
end.
%% @doc Verifies input... | src/ipmangle.erl | 0.521227 | 0.447823 | ipmangle.erl | starcoder |
%% -------------------------------------------------------------------
%%
%% riak_ql_quanta.erl - a library for quantising time for Time Series
%%
%% @doc This module serves to generate time quanta on multi - (day, hour, minute,
%% second) boundaries. The quantum are based on an origin time of Jan 1, 1970
%% 00:00:00 ... | src/riak_ql_quanta.erl | 0.631253 | 0.726571 | riak_ql_quanta.erl | starcoder |
%% @doc This is the behaviour definition for a credential provider
%% module and it iterates over a list of providers. You may set the
%% `credential_providers` Erlang environment variable if you want to
%% restrict checking only a certain subset of the default list.
%%
%% Default order of checking for credentials is:
... | src/aws_credentials_provider.erl | 0.540439 | 0.438665 | aws_credentials_provider.erl | starcoder |
%% Puzzle:
%%
%% transparent paper folding
%% https://adventofcode.com/2021/day/17
%%
%% explanation:
%% https://blog.beerriot.com/2021/12/17/advent-of-code-day-17/
-module(puzzle17).
-export([
solveA/0,
solveB/0,
parse_input/1,
find_ys/2,
find_xs/2,
find_solutions... | src/puzzle17.erl | 0.562537 | 0.688724 | puzzle17.erl | starcoder |
%%--------------------------------------------------------------------
%% Copyright (c) 2020-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... | apps/emqx_limiter/src/emqx_limiter_schema.erl | 0.656548 | 0.432003 | emqx_limiter_schema.erl | starcoder |
%% Copyright (c) 2018 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
%%
%% Unless req... | src/emqx_gc.erl | 0.71721 | 0.440289 | emqx_gc.erl | starcoder |
%%--------------------------------------------------------------------
%% Copyright (c) 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 License a... | test/ekka_mnesia_error_injection_SUITE.erl | 0.523664 | 0.540863 | ekka_mnesia_error_injection_SUITE.erl | starcoder |
-module(borda).
%% API exports
-export([
rankings/2
]).
-include("include/common.hrl").
-include("include/elections.hrl").
%%====================================================================
%% Guard Macros
%%====================================================================
-define(IS_VALID_LABEL(Label), ... | src/borda.erl | 0.554953 | 0.520253 | borda.erl | starcoder |
%% @doc Model for fetching and updating the Git clone of Zotonic.
%% The Git checkout is located in "priv/data/zotonic-git".
%%
%% This file is a model. You will see functions like 'm_get' that
%% implement the model behaviour. Models are always located in the
%% directory 'models' and their filename always start with ... | src/models/m_zotonicwww2_git.erl | 0.574872 | 0.464841 | m_zotonicwww2_git.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).
%% @doc: Creates a new instance of the backen... | src/hyper_register.erl | 0.668556 | 0.622947 | hyper_register.erl | starcoder |
%%%------------------------------------------------------------------------
%% Copyright 2019, OpenTelemetry 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.o... | src/ot_metric_accumulator.erl | 0.574992 | 0.418875 | ot_metric_accumulator.erl | starcoder |
%%
%% Copyright (c) dushin.net
%% 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
%%
%% Unless required by applic... | src/rational.erl | 0.802981 | 0.57824 | rational.erl | starcoder |
%%% -*- mode: Erlang; fill-column: 80; comment-column: 75; -*-
%%% vi:ts=4 sw=4 et
%%% The MIT License
%%%
%%% Copyright (c) 2007 <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/ec_plists.erl | 0.503662 | 0.471892 | ec_plists.erl | starcoder |
%% @author <NAME>
%% @copyright Copyright (c) 2008-2009 <NAME>, Copyright (c) 2009 <NAME>
%%
%% @doc Conversion functions for all kinds of data types. Changes to
%% Rusty's version: added date conversion, undefined handling and more
%% to_bool cases.
%% Copyright 2009-2012 <NAME>
%%
%% Licensed under the Apache Licens... | src/z_convert.erl | 0.513425 | 0.468669 | z_convert.erl | starcoder |
%% Copyright 2016-2017 TensorHub, Inc.
%%
%% 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 t... | src/port_io.erl | 0.532911 | 0.449997 | port_io.erl | starcoder |
% @doc
% <a href="https://reference.digilentinc.com/reference/pmod/pmodgyro/reference-manual">
% PmodGYRO
% </a>
% module that gets the gyroscopes data via SPI.
%
% Start the driver with
% ```
% 1> grisp:add_device(spi1, pmod_gyro).
% '''
% @end
-module(pmod_gyro).
-behaviour(gen_server).
-include("grisp.hrl").
-i... | src/pmod_gyro.erl | 0.530723 | 0.705747 | pmod_gyro.erl | starcoder |
%%This file is licensed under the terms of the Modified BSD License.
%%This is a counter to keep track of simulated time. The timed
%%semantics work without it but having now() in ABS is useful. Global
%%time is also necessary to calculate the next deployment component
%%update barrier (distance_to_next_boundary/0).... | frontend/src/main/resources/erlang/absmodel/src/clock.erl | 0.556641 | 0.412589 | clock.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/coords.erl | 0.770896 | 0.553083 | coords.erl | starcoder |
-module(tql_either).
%% API exports
-export([ fold/2
, sequence/1
, traverse/2
, map/2
, is_ok/1
, is_error/1
, from_bool/3
, with_default/2
, and_/1
, oks/1
]).
-type either(Result, Reason) :: {ok, Result} | {error, Reason}.
-export_typ... | src/tql_either.erl | 0.677047 | 0.693337 | tql_either.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_btree_copy.erl | 0.537284 | 0.481515 | couch_btree_copy.erl | starcoder |
%% ------------------------------------------------------------------
%% @doc LoraWAN Adaptive DataRate engine.
%%
%% This module exposes a simple adaptive DataRate algorithm loosely
%% based on Semtech's recommended algorithm [1,2].
%%
%% === Usage ===
%%
%% This module has a minimal API and almost zero coupling to ex... | src/lora/lorawan_adr.erl | 0.631708 | 0.619327 | lorawan_adr.erl | starcoder |
%%==============================================================================
%% Copyright 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... | src/pb_tree.erl | 0.63443 | 0.433622 | pb_tree.erl | starcoder |
%%%-------------------------------------------------------------------
%%% @author <NAME>
%%% @copyright (C) 2021 ACK CYFRONET AGH
%%% This software is released under the MIT license
%%% cited in 'LICENSE.txt'.
%%% @end
%%%-------------------------------------------------------------------
%%% @doc
%%% Helper module to... | src/modules/datastore/time_series/persistence/ts_metric_data_node.erl | 0.621656 | 0.437523 | ts_metric_data_node.erl | starcoder |
% @copyright 2010-2014 Zuse Institute Berlin
% 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... | test/gossip_SUITE.erl | 0.506836 | 0.406626 | gossip_SUITE.erl | starcoder |
%%% @doc
%%% A utility to create small memory buffers for an application without needing to allocate
%%% one big memory buffer. For example, maybe you need to reference data by bytes at random
%%% locations but you don't know which locations use. Or, you're processing
%%% chunks that may live at different byte posi... | src/memory_pager.erl | 0.564939 | 0.732197 | memory_pager.erl | starcoder |
%%%-------------------------------------------------------------------
%%% @doc
%%% A set of optics specific to tuples.
%%% @end
%%%-------------------------------------------------------------------
-module(optic_tuples).
%% API
-export([all/0,
all/1,
element/1,
element/2,
field/3,... | src/optic_tuples.erl | 0.635336 | 0.533094 | optic_tuples.erl | starcoder |
%% Copyright (c) 2021 <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 Software without restriction, including without limitation
%% the rights to use, copy, modify, merge, publish, distr... | src/locus_shared_bitarray.erl | 0.552057 | 0.476641 | locus_shared_bitarray.erl | starcoder |
-module(gh3).
-export([to_polyfills/2, from_polyfill/1]).
%% @doc Transforms a pre-parsed GeoJSON map into a list of polyfills.
%%
%% Example:
%%
%% ```
%% %% First download a map from https://geojson-maps.ash.ms
%% {ok, JSONb} = file:read_file("custom.geo.json"),
%% JSON = jsx:decode(JSONb, []),
%% Poly = h3:to_poly... | src/gh3.erl | 0.687105 | 0.73307 | gh3.erl | starcoder |
%%---------------------------------------------------------------------------
%% |
%% Module : String
%% Copyright : (c) 2020-2021 EMQ Technologies Co., Ltd.
%% License : BSD-style (see the LICENSE file)
%%
%% Maintainer : <NAME>, <EMAIL>
%% <NAME>, <EMAIL>
%% Stability : experimental
... | lib/Data/String.erl | 0.511473 | 0.47591 | String.erl | starcoder |
%% Copyright 2011 <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 agreed to in writi... | src/qrcode_mask.erl | 0.513181 | 0.484685 | qrcode_mask.erl | starcoder |
%%%-------------------------------------------------------------------
%%% @author <NAME>
%%% @copyright (C) 2017: <NAME>
%%% This software is released under the MIT license cited in 'LICENSE.md'.
%%% @end
%%%-------------------------------------------------------------------
%%% @doc
%%% This module provides search fu... | src/bp_tree_leaf.erl | 0.624523 | 0.40251 | bp_tree_leaf.erl | starcoder |
%% @doc This is the behaviour definition for a credential provider module
%% and it iterates over a list of providers. You may set the `credential_providers`
%% Erlang environment variable if you want to restrict checking only a certain
%% subset of the default list.
%%
%% Default order of checking for credentials is:
... | src/aws_credentials_provider.erl | 0.543833 | 0.485539 | aws_credentials_provider.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/vtree_bulk.erl | 0.601594 | 0.516047 | vtree_bulk.erl | starcoder |
%% The contents of this file are subject to the Mozilla Public License
%% Version 1.1 (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.mozilla.org/MPL/
%%
%% Software distributed under the License is distributed on an "AS IS"
%% b... | apps/erlando/src/omega_m.erl | 0.696062 | 0.472927 | omega_m.erl | starcoder |
%%%-------------------------------------------------------------------
%%% Copyright: (c) 2007-2010 Gemini Mobile Technologies, Inc. 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 cop... | src/brick_hash.erl | 0.525125 | 0.462109 | brick_hash.erl | starcoder |
%%% @doc This module implements a simple registry to keep track of the number of FSMs.
%%%
%%% The `aesc_limits' server monitors each FSM, and inserts an entry into an ETS table.
%%% The size of the ETS table reflects the number of active FSMs in the node.
%%% We define two entry points in order to distinguish between ... | apps/aechannel/src/aesc_limits.erl | 0.528047 | 0.59796 | aesc_limits.erl | starcoder |
%%-----------------------------------------------------------------------------
%% @copyright (C) 2019, <NAME>
%% @author <NAME>
%% @doc Interface for the xor16 filter.
%%
%% Shorthand for the `exor_filter' module. For indepth documentation, see
%% that module.
%%
%% Example usage:
%% ```
%% Filter = xor16:new(["cat",... | src/xor16.erl | 0.636918 | 0.463626 | xor16.erl | starcoder |
%% @author Couchbase <<EMAIL>>
%% @copyright 2017-Present Couchbase, Inc.
%%
%% Use of this software is governed by the Business Source License included
%% in the file licenses/BSL-Couchbase.txt. As of the Change Date specified
%% in that file, in accordance with the Business Source License, use of this
%% software wi... | src/generic.erl | 0.633183 | 0.450843 | generic.erl | starcoder |
%%
%% %CopyrightBegin%
%%
%% Copyright Ericsson AB 1999-2018. 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
%%
... | lib/compiler/src/beam_flatten.erl | 0.586168 | 0.410993 | beam_flatten.erl | starcoder |
%% 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. If not, it can be retrieved via the world wide web
%% at h... | src/hanoidb_bloom.erl | 0.648911 | 0.489992 | hanoidb_bloom.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/ets_lru.erl | 0.690663 | 0.46132 | ets_lru.erl | starcoder |
%% @doc
%% Summary metric, to track the size of events and report quantiles
%% Based on prometheus_summary
%%
%% Example use cases for Summaries:
%% - Response latency;
%% - Request size;
%% - Response size.
%%
%% Example:
%% <pre lang="erlang">
%% -module(my_proxy_instrumenter).
%%
%% setup() ->
%% prometheus_... | src/metrics/prometheus_quantile_summary.erl | 0.7641 | 0.416975 | prometheus_quantile_summary.erl | starcoder |
%% vim: set ai et sw=4 sts=4:
%% See LICENSE for licensing information.
% This module has been derived from:
% https://github.com/marco-m/mock_io
% Copyright (c) 2015, <NAME>
-module(solarized_capture).
-export([ output/1
, output/3
, result_and_output/1
, result_and_output/3
])... | src/solarized_capture.erl | 0.62395 | 0.4917 | solarized_capture.erl | starcoder |
%% -------------------------------------------------------------------
%%
%% cuttlefish_validator: models a cuttlefish validator
%%
%% Copyright (c) 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 this file
... | deps/cuttlefish/src/cuttlefish_validator.erl | 0.664976 | 0.41947 | cuttlefish_validator.erl | starcoder |
%% @author <NAME> <<EMAIL>>
%% @copyright 2014 <NAME>
%% @version 0.2.0
%%
%% @doc
%%
%% The HDR histogram library is an Erlang native interface function wrapper of
%% Mike Barker's C port of Gil Tene's HDR Histogram utility.
%%
%%
%% A high dynamic range histogram is one that supports recording and analyzing
%% samp... | src/hdr_iter.erl | 0.57093 | 0.600042 | hdr_iter.erl | starcoder |
% @copyright 2007-2014 Zuse Institute Berlin
% 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 ... | src/mathlib.erl | 0.53437 | 0.469703 | mathlib.erl | starcoder |
%%% @doc A Flat Tree is a deterministic way of using a list as an index
%%% for nodes in a tree. Essentially a simpler way of representing the
%%% position of nodes.
%%%
%%% A Flat Tree is also refered to as 'bin numbers' described here
%%% in RFC 7574: https://datatracker.ietf.org/doc/html/rfc7574#section-4.2
%%%
%%% ... | src/flat_tree.erl | 0.791096 | 0.909265 | flat_tree.erl | starcoder |
%%
%% %CopyrightBegin%
%%
%% Copyright Ericsson AB 1996-2010. 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
%%
... | lib/gs/contribs/othello/othello_adt.erl | 0.521959 | 0.487063 | othello_adt.erl | starcoder |
-module(erlang_tc_poly).
-export([
%% polynomial API
from_coeffs/1,
eval/2,
eval_from_fr/2,
cmp/2,
interpolate/1,
interpolate_from_fr/1,
gen_monomial/1,
degree/1,
random/1,
zero/0,
zeroize/1,
is_zero/1,
constant/1,
mul/2,
add/2,
sub/2,
mul_scalar/... | src/erlang_tc_poly.erl | 0.709221 | 0.554591 | erlang_tc_poly.erl | starcoder |
%%==============================================================================
%% Copyright 2015 Erlang Solutions 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.a... | src/escalus_mongooseim.erl | 0.689619 | 0.422147 | escalus_mongooseim.erl | starcoder |
%% @doc Integer counter based on an ordered list of counter events.
%%
%% A counter is stored as an orddict of counter events. Each counter
%% event has a unique key based on the timestamp and some entropy, and it
%% stores the delta from the inc operation. The value of a counter is the
%% sum of all these deltas.
%%
%... | src/statebox_counter.erl | 0.657978 | 0.878523 | statebox_counter.erl | starcoder |
-module(ask_area).
-export([area/0]).
-spec(area() -> number()).
area() ->
Answer = io:get_line("R)ectangle, T)riangle, or E)llipse > "),
Shape = char_to_shape(hd(Answer)),
case Shape of
rectangle -> Numbers = get_dimensions("width", "height");
triangle -> Numbers = get_dimensions("base", "height");
... | src/ask_area.erl | 0.583915 | 0.734976 | ask_area.erl | starcoder |
-module('99-problems').
-compile(export_all).
% P01: Find the last element of a list.
last(L) ->
lists:last(L).
% P02: Find the last but one element of a list.
lastButOne(L) ->
hd(lists:nthtail(length(L) - 2, L)).
% P03: Find the k-th element of a list.
kthElement(K, L) ->
lists:nth(K, L).
% P04: Find the ... | assignments/solutions/99-problems/erlang/99-problems.erl | 0.673943 | 0.600159 | 99-problems.erl | starcoder |
%% -------------------------------------------------------------------
%%
%% Copyright (c) 2012 Basho Technologies, 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 Licen... | dist-tests/verify_build_cluster.erl | 0.61173 | 0.566498 | verify_build_cluster.erl | starcoder |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.