content stringlengths 6 1.03M | input_ids listlengths 4 535k | ratio_char_token float64 0.68 8.61 | token_count int64 4 535k |
|---|---|---|---|
using Base.Test
reload("ForwardBackwardOptim")
m = ForwardBackwardOptim
tests = [
"optims"
]
for t in tests
tfile = string(t, ".jl")
println(" * $tfile ...")
include(tfile)
end
println("Finished testing.") | [
3500,
7308,
13,
14402,
198,
198,
260,
2220,
7203,
39746,
7282,
904,
27871,
320,
4943,
198,
76,
796,
19530,
7282,
904,
27871,
320,
198,
198,
41989,
796,
685,
198,
220,
220,
220,
366,
8738,
12078,
1,
198,
60,
198,
198,
1640,
256,
287,... | 2.511111 | 90 |
<gh_stars>0
#!/usr/bin/env julia
# https://github.com/JuliaEditorSupport/julia-emacs/blob/master/make-julia-latexsubs.jl
@assert VERSION >= v"1"
import REPL
"""
Create latex symbols formatted for elisp as either abbrev or hash table.
- ds : elisp output data structure - either "abbrev" or "hash"
- varname : nam... | [
27,
456,
62,
30783,
29,
15,
198,
2,
48443,
14629,
14,
8800,
14,
24330,
474,
43640,
198,
198,
2,
3740,
1378,
12567,
13,
785,
14,
16980,
544,
17171,
15514,
14,
73,
43640,
12,
368,
16436,
14,
2436,
672,
14,
9866,
14,
15883,
12,
73,
... | 1.961255 | 1,084 |
# Energy calculation
export
total_energy,
kinetic_energy,
temperature,
potential_energy
"""
total_energy(s, neighbors=nothing)
Calculate the total energy of the system.
If the interactions use neighbor lists, the neighbors should be computed
first and passed to the function.
"""
total_energy(s, n... | [
2,
6682,
17952,
198,
198,
39344,
198,
220,
220,
220,
2472,
62,
22554,
11,
198,
220,
220,
220,
37892,
62,
22554,
11,
198,
220,
220,
220,
5951,
11,
198,
220,
220,
220,
2785,
62,
22554,
198,
198,
37811,
198,
220,
220,
220,
2472,
62,
... | 2.190887 | 3,248 |
<gh_stars>1-10
#########
# setk! #
#########
function setk!(x, k_requested, v)
k = setk!_inner(x, k_requested, v)
if k > 0
error("Index ", k_requested, " is out of bounds.")
end
end
@generated function setk!_inner(x::T, k, v) where {T}
if T <: Array
if eltype(T) <: Real
quot... | [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
7804,
2,
198,
2,
900,
74,
0,
1303,
198,
7804,
2,
198,
198,
8818,
900,
74,
0,
7,
87,
11,
479,
62,
25927,
276,
11,
410,
8,
198,
220,
220,
220,
479,
796,
900,
74,
0,
62,
5083,
7,
87... | 1.763166 | 3,285 |
<filename>sample/write_gpx.jl<gh_stars>1-10
using GPX
using TimeZones
using LightXML: XMLDocument, save_file
author = GPXAuthor("<NAME>")
metadata = GPXMetadata(
name="07/11/2019 LFBI (09:32) LFBI (11:34)",
author=author,
time=ZonedDateTime("2019-01-01T00:00:0.000+00:00"), # ZonedDateTime("2019-01-01T00:... | [
27,
34345,
29,
39873,
14,
13564,
62,
70,
8416,
13,
20362,
27,
456,
62,
30783,
29,
16,
12,
940,
198,
3500,
14714,
55,
198,
3500,
3862,
57,
1952,
198,
3500,
4401,
55,
5805,
25,
23735,
24941,
11,
3613,
62,
7753,
628,
198,
9800,
796,
... | 2.333333 | 324 |
<filename>test/coboundary_fix.jl
using LinearAlgebraicRepresentation
Lar = LinearAlgebraicRepresentation
# Compute coboundary_1 in 2D via product FV * EV^t with fixing of redundancies
FV = [[1,2,3,4,5,17,16,12],
[1,2,3,4,6,7,8,9,10,11,12,13,14,15],
[4,5,9,11,12,13,14,15,16,17],
[2,3,6,7], [8,9,10,11]]
EV = [[1,2],[2... | [
27,
34345,
29,
9288,
14,
66,
672,
633,
560,
62,
13049,
13,
20362,
198,
3500,
44800,
2348,
29230,
291,
40171,
341,
198,
43,
283,
796,
44800,
2348,
29230,
291,
40171,
341,
198,
198,
2,
3082,
1133,
22843,
633,
560,
62,
16,
287,
362,
... | 2.015332 | 587 |
<reponame>mathijsvdv/ComputationalThinking
# This dictionary maps easy to remember names to Youtube video IDs
# after adding an ID here, you can use the {{youtube <shortname>}}
# syntax in your markdown files to embed the video into the page!
videos = Dict(
"course-intro" => "vxjRWtWoD_w",
"... | [
27,
7856,
261,
480,
29,
11018,
2926,
82,
20306,
85,
14,
5377,
1996,
864,
817,
8040,
198,
2,
770,
22155,
8739,
2562,
284,
3505,
3891,
284,
27431,
2008,
32373,
198,
2,
706,
4375,
281,
4522,
994,
11,
345,
460,
779,
262,
22935,
11604,
... | 1.560029 | 1,366 |
<reponame>AtsushiSakai/SciPy.jl
using SciPy
using Test
@testset "SciPy.jl" begin
# Print configulations before start testings.
print_configulations()
@testset "cluster" begin
features = [[ 1.9 2.3];
[ 1.5 2.5];
[ 0.8 0.6];
[ 0.4 1.8];
... | [
27,
7856,
261,
480,
29,
32,
912,
17731,
50,
461,
1872,
14,
50,
979,
20519,
13,
20362,
198,
3500,
10286,
20519,
198,
3500,
6208,
198,
198,
31,
9288,
2617,
366,
50,
979,
20519,
13,
20362,
1,
2221,
198,
220,
220,
220,
1303,
12578,
45... | 1.808418 | 689 |
Optional{T} = Union{Nothing,T}
mutable struct Address
street::String
house_nr::String
zip_code::String
town::String
iid::DbId
end
function Address()
return Address("","","","",DbId())
end
mutable struct Employee
name::String
contact_person_first::String
contact_person_second::Stri... | [
30719,
90,
51,
92,
796,
4479,
90,
18465,
11,
51,
92,
198,
198,
76,
18187,
2878,
17917,
198,
220,
220,
220,
4675,
3712,
10100,
198,
220,
220,
220,
2156,
62,
48624,
3712,
10100,
198,
220,
220,
220,
19974,
62,
8189,
3712,
10100,
198,
... | 2.652406 | 187 |
<reponame>noob-data-analaysis/LeetCode.jl
@testset "88.merge-sorted-array.jl" begin
nums1 = [1, 2, 3, 0, 0, 0]
m = 3
nums2 = [2, 5, 6]
n = 3
merge_sorted_array(nums1, m, nums2, n)
@test nums1 == [1, 2, 2, 3, 5, 6]
end
| [
27,
7856,
261,
480,
29,
3919,
672,
12,
7890,
12,
272,
282,
592,
271,
14,
3123,
316,
10669,
13,
20362,
198,
31,
9288,
2617,
366,
3459,
13,
647,
469,
12,
82,
9741,
12,
18747,
13,
20362,
1,
2221,
198,
220,
220,
220,
997,
82,
16,
... | 1.773723 | 137 |
using Surrogates
using LinearAlgebra
using Flux
using Flux: @epochs
using Zygote
using PolyChaos
using Test
#using Zygote: @nograd
#=
#FORWARD
###### 1D ######
lb = 0.0
ub = 10.0
n = 5
x = sample(n,lb,ub,SobolSample())
f = x -> x^2
y = f.(x)
#Radials
my_rad = RadialBasis(x,y,lb,ub,x->norm(x),2)
g = x -> ForwardDiff.de... | [
3500,
4198,
3828,
689,
198,
3500,
44800,
2348,
29230,
198,
3500,
1610,
2821,
198,
3500,
1610,
2821,
25,
2488,
538,
5374,
82,
198,
3500,
1168,
35641,
1258,
198,
3500,
12280,
1925,
7495,
198,
3500,
6208,
198,
2,
3500,
1168,
35641,
1258,
... | 1.915306 | 3,306 |
<gh_stars>0
function _count_by_state(
events::EventObservations{T, M},
state::DiseaseState,
time::Float64) where {
T <: DiseaseStateSequence,
M <: ILM}
n_ids = 0
if state == State_I && State_R ∈ T
# E/I at or before time and I/R after time or never
for i = 1:individuals(events)
n_ids += ev... | [
27,
456,
62,
30783,
29,
15,
198,
8818,
4808,
9127,
62,
1525,
62,
5219,
7,
198,
220,
2995,
3712,
9237,
31310,
712,
602,
90,
51,
11,
337,
5512,
198,
220,
1181,
3712,
35,
786,
589,
9012,
11,
198,
220,
640,
3712,
43879,
2414,
8,
810... | 2.457237 | 912 |
##### embarrassingly parallel computation is embarrassingly easy
# This computation is automatically distributed across
# all available compute nodes, and the result, reduced by summation (+),
# is returned at the calling node.
nheads = @parallel (+) for i=1:10000
rand(Bool)
end
#### multithreading
# at the comman... | [
4242,
2,
9614,
4420,
10730,
29964,
318,
9614,
4420,
2562,
198,
198,
2,
770,
29964,
318,
6338,
9387,
1973,
198,
2,
477,
1695,
24061,
13760,
11,
290,
262,
1255,
11,
5322,
416,
30114,
341,
11502,
828,
198,
2,
318,
4504,
379,
262,
4585,... | 2.654054 | 370 |
using Test, Random, FillArrays
import LuxurySparse: IMatrix, PermMatrix
Random.seed!(2)
p1 = IMatrix{4}()
sp = sprand(ComplexF64, 4,4, 0.5)
ds = rand(ComplexF64, 4,4)
pm = PermMatrix([2,3,4,1], randn(4))
v = [0.5, 0.3im, 0.2, 1.0]
dv = Diagonal(v)
@testset "basic" begin
@test p1==copy(p1)
@test eltype(p1) ==... | [
3500,
6208,
11,
14534,
11,
27845,
3163,
20477,
198,
11748,
17145,
1601,
50,
29572,
25,
8959,
265,
8609,
11,
2448,
76,
46912,
198,
198,
29531,
13,
28826,
0,
7,
17,
8,
198,
198,
79,
16,
796,
8959,
265,
8609,
90,
19,
92,
3419,
198,
... | 2.001294 | 773 |
<gh_stars>10-100
@testset "NoiseApproximation" begin
using DiffEqNoiseProcess, DiffEqBase, StochasticDiffEq
using Test
using DiffEqProblemLibrary.SDEProblemLibrary: importsdeproblems; importsdeproblems()
import DiffEqProblemLibrary.SDEProblemLibrary: prob_sde_linear, prob_sde_2Dlinear
prob = prob_sde_linear
integrat... | [
27,
456,
62,
30783,
29,
940,
12,
3064,
198,
31,
9288,
2617,
366,
2949,
786,
4677,
13907,
18991,
1,
2221,
198,
198,
3500,
10631,
36,
80,
2949,
786,
18709,
11,
10631,
36,
80,
14881,
11,
520,
5374,
3477,
28813,
36,
80,
198,
3500,
620... | 2.306792 | 427 |
<filename>src/SoftSquishyMatter.jl
module SoftSquishyMatter
"""
Flush output so that jobs can be monitored on cluster.
"""
@inline println(args...) = println(stdout, args...)
@inline function println(io::IO, args...)
Base.println(io, args...)
flush(io)
end
using Random
using Serialization
using D... | [
27,
34345,
29,
10677,
14,
18380,
22266,
49785,
44,
1436,
13,
20362,
198,
21412,
8297,
22266,
49785,
44,
1436,
201,
198,
201,
198,
37811,
201,
198,
7414,
1530,
5072,
523,
326,
3946,
460,
307,
20738,
319,
13946,
13,
201,
198,
37811,
201... | 3.227451 | 255 |
# TODO: Move SimpleLogger in here
| [
2,
16926,
46,
25,
10028,
17427,
11187,
1362,
287,
994,
198
] | 3.090909 | 11 |
<reponame>thazhemadam/Term.jl
module segment
import Term
import Term: remove_markup, remove_ansi
import ..style: apply_style, MarkupStyle
import ..measure: Measure
export Segment
# ---------------------------------------------------------------------------- #
# SEGMENT ... | [
27,
7856,
261,
480,
29,
400,
1031,
4411,
324,
321,
14,
40596,
13,
20362,
198,
21412,
10618,
198,
11748,
35118,
198,
11748,
35118,
25,
4781,
62,
4102,
929,
11,
4781,
62,
504,
72,
198,
11748,
11485,
7635,
25,
4174,
62,
7635,
11,
2940,... | 2.904062 | 1,157 |
### A Pluto.jl notebook ###
# v0.12.10
using Markdown
using InteractiveUtils
# This Pluto notebook uses @bind for interactivity. When running this notebook outside of Pluto, the following 'mock version' of @bind gives bound variables a default value (instead of an error).
macro bind(def, element)
quote
lo... | [
21017,
317,
32217,
13,
20362,
20922,
44386,
198,
2,
410,
15,
13,
1065,
13,
940,
198,
198,
3500,
2940,
2902,
198,
3500,
21365,
18274,
4487,
198,
198,
2,
770,
32217,
20922,
3544,
2488,
21653,
329,
9427,
3458,
13,
1649,
2491,
428,
20922,... | 1.808962 | 2,544 |
abstract type AbstractIterativeInversion end
struct ColumnarVortex{F,R,L,D,P}
ψ :: F
ϕ :: F
q :: F
x :: R
∂ :: R
b :: R
L :: L
domain :: D
params :: P
end
function ColumnarVortex(; domain, params)
ψ = new_field(domain)
ϕ = new_field(domain)
q = new_field(domain)
ρ =... | [
397,
8709,
2099,
27741,
29993,
876,
818,
9641,
886,
198,
198,
7249,
29201,
283,
53,
26158,
90,
37,
11,
49,
11,
43,
11,
35,
11,
47,
92,
198,
220,
220,
220,
18074,
230,
7904,
376,
198,
220,
220,
220,
18074,
243,
7904,
376,
198,
22... | 1.938194 | 4,320 |
<gh_stars>0
println("\n\n\nStarting runtests.jl $(join(ARGS, " ")) ...")
using Tests
using KShiftsClustering
getdata(n) = 10*rand(1, n) .+ 0.5
centers = kshifts(getdata(1_000_000), 10)
@test all(round.(Int, sort(vec(centers))) .== collect(1:10))
centers = kshifts(getdata(1000), 10)
for i = 1:100
kshifts!(cent... | [
27,
456,
62,
30783,
29,
15,
198,
35235,
7203,
59,
77,
59,
77,
59,
77,
22851,
1057,
41989,
13,
20362,
29568,
22179,
7,
1503,
14313,
11,
366,
366,
4008,
35713,
8,
198,
198,
3500,
30307,
198,
3500,
509,
2484,
19265,
2601,
436,
1586,
... | 2.27933 | 179 |
<reponame>j-hayes/chem-324-programming-tutorials
include("bike-attributes.jl")
mutable struct Bike
bike_attributes :: BikeAttributes
x_position :: Int
y_position :: Int
end | [
27,
7856,
261,
480,
29,
73,
12,
71,
323,
274,
14,
15245,
12,
33916,
12,
23065,
2229,
12,
83,
44917,
82,
198,
17256,
7203,
32256,
12,
1078,
7657,
13,
20362,
4943,
198,
198,
76,
18187,
2878,
26397,
220,
198,
220,
220,
220,
220,
198,... | 2.56 | 75 |
<reponame>odow/LPWriter.jl
@testset "correctname" begin
# not very complete. Need better way to test
@test LPWriter.correctname(repeat("x", 17)) == repeat("x", 16)
@test LPWriter.correctname(".x") == "x"
@test LPWriter.correctname("0x") == "x"
@test LPWriter.correctname("x^") == "x"
@test LPWrit... | [
27,
7856,
261,
480,
29,
375,
322,
14,
19930,
34379,
13,
20362,
198,
31,
9288,
2617,
366,
30283,
3672,
1,
2221,
198,
220,
220,
220,
1303,
407,
845,
1844,
13,
10664,
1365,
835,
284,
1332,
198,
220,
220,
220,
2488,
9288,
18470,
34379,
... | 1.97273 | 3,227 |
# Sample script for plotting fieldlines with handpicked seeds, multi-processing version.
#
# To run on a single node,
# julia -p $ncores demo_fieldline_mp_pyplot.jl
#
# <NAME>, <EMAIL>
using Distributed, ParallelDataTransfer, Glob
@everywhere using Vlasiator, PyPlot, PyCall, Printf, LaTeXStrings, FieldTracer
@everywhe... | [
2,
27565,
4226,
329,
29353,
2214,
6615,
351,
1021,
41891,
11904,
11,
5021,
12,
36948,
2196,
13,
198,
2,
198,
2,
1675,
1057,
319,
257,
2060,
10139,
11,
198,
2,
474,
43640,
532,
79,
720,
10782,
2850,
13605,
62,
3245,
1370,
62,
3149,
... | 2.394512 | 2,223 |
function molecule(::Molecule"H₂O")
return """
O 1.2091536548 1.7664118189 -0.0171613972
H 2.1984800075 1.7977100627 0.0121161719
H 0.9197881882 2.4580185570 0.6297938830
"""
end
molecule(m::Molecule"water") = molecule(alias(m))
alias(::Molecule"water") = Molecule"H₂O"()
| [
8818,
27756,
7,
3712,
44,
2305,
23172,
1,
39,
158,
224,
224,
46,
4943,
198,
220,
1441,
37227,
198,
220,
440,
352,
13,
22567,
1314,
24760,
2780,
352,
13,
4304,
2414,
16817,
23362,
532,
15,
13,
29326,
1433,
20219,
4761,
198,
220,
367,... | 2.143939 | 132 |
<gh_stars>0
using Test
@testset "App" begin
include("HealthHandler.jl")
end | [
27,
456,
62,
30783,
29,
15,
198,
3500,
6208,
198,
198,
31,
9288,
2617,
366,
4677,
1,
2221,
198,
220,
220,
220,
2291,
7203,
18081,
25060,
13,
20362,
4943,
198,
437
] | 2.580645 | 31 |
using Catlab.CategoricalAlgebra
using Catlab.Present
using Catlab.Theories
using Catlab.Graphs.BasicGraphs: TheoryGraph
using Catlab.Graphs
using DataStructures: OrderedDict
"""
Reference: CT for computing science:
https://www.math.mcgill.ca/triples/Barr-Wells-ctcs.pdf
We are concerned with "Regular" sketches, where ... | [
3500,
5181,
23912,
13,
34,
2397,
12409,
2348,
29230,
198,
3500,
5181,
23912,
13,
34695,
198,
3500,
5181,
23912,
13,
464,
1749,
198,
3500,
5181,
23912,
13,
37065,
82,
13,
26416,
37065,
82,
25,
17003,
37065,
198,
3500,
5181,
23912,
13,
... | 2.217151 | 5,982 |
<gh_stars>0
# Test specific data for one network:
println("- number/case9 check")
mpc = loadcase("case9")
gencost = [
2.0 1500.0 0.0 3.0 0.11 5.0 150.0
2.0 2000.0 0.0 3.0 0.085 1.2 600.0
2.0 3000.0 0.0 3.0 0.1225 1.0 335.0
]
@test mpc["gencost"] == gencost
# Ensure ... | [
27,
456,
62,
30783,
29,
15,
198,
2,
6208,
2176,
1366,
329,
530,
3127,
25,
198,
35235,
7203,
12,
1271,
14,
7442,
24,
2198,
4943,
198,
3149,
66,
796,
3440,
7442,
7203,
7442,
24,
4943,
198,
5235,
15805,
796,
685,
198,
220,
220,
220,
... | 2.368831 | 385 |
<reponame>JuliaDocsForks/GMT.jl
"""
grdvolume(cmd0::String="", arg1=[], kwargs...)
Reads one 2-D grid and returns xyz-triplets.
Full option list at [`grdvolume`](http://gmt.soest.hawaii.edu/doc/latest/grdvolume.html)
Parameters
----------
- **C** : **contour** : -- Str or List -- Flags = cval or low/high/delta o... | [
27,
7856,
261,
480,
29,
16980,
544,
23579,
82,
1890,
591,
14,
49424,
13,
20362,
198,
37811,
198,
197,
2164,
67,
29048,
7,
28758,
15,
3712,
10100,
2625,
1600,
1822,
16,
41888,
4357,
479,
86,
22046,
23029,
198,
198,
5569,
82,
530,
362... | 2.410118 | 929 |
<reponame>UnofficialJuliaMirrorSnapshots/LayerDicts.jl-6f188dcb-512c-564b-bc01-e0f76e72f166<filename>src/LayerDicts.jl
module LayerDicts
export LayerDict
struct LayerDict{K, V} <: AbstractDict{K, V}
dicts::Vector{<:AbstractDict}
end
function LayerDict(dicts::Tuple{Vararg{AbstractDict{K, V}}}) where {K, V}
re... | [
27,
7856,
261,
480,
29,
3118,
16841,
16980,
544,
27453,
1472,
43826,
20910,
14,
49925,
35,
14137,
13,
20362,
12,
21,
69,
20356,
17896,
65,
12,
25836,
66,
12,
20,
2414,
65,
12,
15630,
486,
12,
68,
15,
69,
4304,
68,
4761,
69,
23055,... | 2.188615 | 1,177 |
<gh_stars>10-100
@testset "1038.binary-search-tree-to-greater-sum-tree.jl" begin
@test bst_to_gst(
TreeNode{Int}([
4, 1, 6, 0, 2, 5, 7, nothing, nothing, nothing, 3, nothing, nothing, nothing, 8
]),
) == TreeNode{Int}([
30,
36,
21,
36,
35,
... | [
27,
456,
62,
30783,
29,
940,
12,
3064,
198,
31,
9288,
2617,
366,
940,
2548,
13,
39491,
12,
12947,
12,
21048,
12,
1462,
12,
18223,
263,
12,
16345,
12,
21048,
13,
20362,
1,
2221,
198,
220,
220,
220,
2488,
9288,
275,
301,
62,
1462,
... | 1.790588 | 425 |
<gh_stars>1-10
using Indexing
if VERSION < v"0.7-"
using Base.Test
else
using Test
end
@testset "getindices" begin
d = Dict(:a => "Alice", :b => "Bob", :c => "Charlie")
@test getindices(d, [:a, :c]) == ["Alice", "Charlie"]
@test getindices(d, (:a, :c)) == ("Alice", "Charlie")
@test getindices(d... | [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
3500,
12901,
278,
198,
361,
44156,
2849,
1279,
410,
1,
15,
13,
22,
21215,
198,
220,
220,
220,
1262,
7308,
13,
14402,
198,
17772,
198,
220,
220,
220,
1262,
6208,
198,
437,
198,
198,
31,
9... | 1.962797 | 2,231 |
<reponame>4aHxKzD/AbstractGPs.jl<filename>src/abstract_gp/abstract_gp.jl
# Define the AbstractGP type and its API.
"""
abstract type AbstractGP end
Supertype for various Gaussian process (GP) types. A common interface is provided for
interacting with each of these objects. See [1] for an overview of GPs.
[1] - <... | [
27,
7856,
261,
480,
29,
19,
64,
39,
87,
42,
89,
35,
14,
23839,
38,
12016,
13,
20362,
27,
34345,
29,
10677,
14,
397,
8709,
62,
31197,
14,
397,
8709,
62,
31197,
13,
20362,
198,
2,
2896,
500,
262,
27741,
16960,
2099,
290,
663,
7824... | 2.569607 | 941 |
module Fluxes
using Adapt
using DocStringExtensions
export AbstractFlux,
FluxLW, FluxSW, init_flux_sw, set_flux_to_zero!, add_to_flux!
abstract type AbstractFlux{FT<:AbstractFloat,FTA2D<:AbstractArray{FT,2}} end
"""
FluxLW{FT,FTA2D}
Upward, downward and net longwave fluxes at each level.
# Fields
$(DocSt... | [
21412,
1610,
2821,
274,
198,
198,
3500,
30019,
198,
3500,
14432,
10100,
11627,
5736,
198,
198,
39344,
27741,
37,
22564,
11,
198,
220,
220,
220,
1610,
2821,
43,
54,
11,
1610,
2821,
17887,
11,
2315,
62,
69,
22564,
62,
2032,
11,
900,
6... | 1.975338 | 1,703 |
<reponame>UnofficialJuliaMirror/IPPDSP.jl-62445c0a-8b1f-5a78-8e50-569da60f0d5b
for ( julia_fun, ippf_prefix ) in [ ( :"insert julia function name", "ippsFunctionBaseName" ) ]
for ( "TypeSignatures" ) in "AnArrayOfTuples"
julia_fun! = symbol(string(julia_fun, '!')) # i... | [
27,
7856,
261,
480,
29,
3118,
16841,
16980,
544,
27453,
1472,
14,
4061,
5760,
4303,
13,
20362,
12,
21,
1731,
2231,
66,
15,
64,
12,
23,
65,
16,
69,
12,
20,
64,
3695,
12,
23,
68,
1120,
12,
20,
3388,
6814,
1899,
69,
15,
67,
20,
... | 1.78392 | 597 |
# Simple Text File
immutable Simple <: FileFormat end
const _simpleparser_start = 2
const _simpleparser_first_final = 2
const _simpleparser_error = 0
const _simpleparser_en_main = 2
const __simpleparser_nfa_targs = Int8[ 0, 0 , ]
const __simpleparser_nfa_offsets = Int8[ 0, 0, 0, 0 , ]
const __simpleparser_nfa_... | [
2,
17427,
8255,
9220,
198,
198,
8608,
18187,
17427,
1279,
25,
9220,
26227,
886,
198,
197,
198,
9979,
4808,
36439,
48610,
62,
9688,
220,
796,
362,
198,
9979,
4808,
36439,
48610,
62,
11085,
62,
20311,
220,
796,
362,
198,
9979,
4808,
364... | 2.317047 | 921 |
const POSITIVES = 1:∞
struct Skip{Synthesizer}
synthesizer::Synthesizer
time::TIME
end
function make_series(skip::Skip, sample_rate)
make_series(skip.synthesizer, sample_rate)[
(round(Int, skip.time * sample_rate)+1):end
]
end
"""
Map(a_function, synthesizers...)
Map `a_function` over `s... | [
9979,
28069,
2043,
42472,
796,
352,
25,
24861,
252,
198,
198,
7249,
32214,
90,
13940,
429,
956,
7509,
92,
198,
220,
220,
220,
24983,
7509,
3712,
13940,
429,
956,
7509,
198,
220,
220,
220,
640,
3712,
34694,
198,
437,
198,
198,
8818,
... | 2.588944 | 1,411 |
using Bokeh; autoopen(true)
m = BCFL22C()
@time lzbar, lg = simulate_exog(m);
# κ = [0.05, 0.95, -0.1 0.5]
κ = [0.0, 1.0, 0.0]
κ0, κ1, κ2 = κ
ξ = 0.05
deg = 3
sim_data = X[1:capT-1, 2:end]
l♠, κ = main()
fstv = FullState(1.0, 2.0, 3.0, 5.0)
fst = FullState(κ, κ, κ, κ)
asarray(fst)
st = TimeTState([1,2], [3,4])
for ... | [
3500,
347,
2088,
71,
26,
8295,
9654,
7,
7942,
8,
198,
198,
76,
796,
11843,
3697,
1828,
34,
3419,
198,
31,
2435,
300,
89,
5657,
11,
300,
70,
796,
29308,
62,
1069,
519,
7,
76,
1776,
198,
2,
7377,
118,
796,
685,
15,
13,
2713,
11,... | 1.727891 | 1,323 |
using LightGraphs
using SimpleWeightedGraphs
using Test
testdir = dirname(@__FILE__)
testgraphs(g) = [g, SimpleWeightedGraph{UInt8,Float64}(g), SimpleWeightedGraph{Int16,Float32}(g)]
testdigraphs(g) = [g, SimpleWeightedDiGraph{UInt8,Float64}(g), SimpleWeightedDiGraph{Int16,Float32}(g)]
testsimplegraphs(g) = [g, Ligh... | [
3500,
4401,
37065,
82,
198,
3500,
17427,
25844,
276,
37065,
82,
198,
3500,
6208,
198,
198,
9288,
15908,
796,
26672,
3672,
7,
31,
834,
25664,
834,
8,
198,
198,
9288,
34960,
82,
7,
70,
8,
796,
685,
70,
11,
17427,
25844,
276,
37065,
... | 2.390323 | 310 |
module μodule
export @μ
macro μ(words::Symbol...)
token = :μ
for word in words
token = μagic(word, token)
end
return esc(token)
end
function μagic(word::Symbol, token)
glyphs = [Symbol(glyph) for glyph in string(word)]
while length(glyphs) > 0
glyph = eval(pop!(glyphs))
... | [
21412,
18919,
375,
2261,
198,
198,
39344,
2488,
34703,
198,
198,
20285,
305,
18919,
7,
10879,
3712,
13940,
23650,
23029,
198,
220,
220,
220,
11241,
796,
1058,
34703,
198,
220,
220,
220,
329,
1573,
287,
2456,
198,
220,
220,
220,
220,
2... | 2.113577 | 766 |
<filename>src/getAnalyticalMediums.jl
export getAnalyticalConstGrad2D,getAnalyticalConstGrad3D,getAnalyticalConstGradInv2D,getAnalyticalConstGradInv3D,getSmoothGaussianMedium,getSmoothFactoredModel,getSmoothFactoredModel3D
function getAnalyticalConstGrad2D(n::Array{Int64,1},h::Array{Float64,1})
src = [1,div(n[2],2)];
... | [
27,
34345,
29,
10677,
14,
1136,
37702,
22869,
31205,
82,
13,
20362,
198,
39344,
651,
37702,
22869,
34184,
42731,
17,
35,
11,
1136,
37702,
22869,
34184,
42731,
18,
35,
11,
1136,
37702,
22869,
34184,
42731,
19904,
17,
35,
11,
1136,
37702,... | 1.790356 | 3,401 |
<filename>src/Indiv_evolution.jl
# Implement experiments to measure the success of subgoal evolution as a function of:
# 1. Funcs
# 2. numinteriors
# 3. numinputs # 4. numoutputs
# 5. Length of goallist
# 5. max_steps
# Uses randomly generated goallist
# Keep track of number of "worse" and "same" updates of... | [
27,
34345,
29,
10677,
14,
5497,
452,
62,
1990,
2122,
13,
20362,
198,
2,
48282,
10256,
284,
3953,
262,
1943,
286,
850,
35231,
6954,
355,
257,
2163,
286,
25,
198,
2,
220,
352,
13,
220,
11138,
6359,
198,
2,
220,
362,
13,
220,
997,
... | 2.172365 | 2,808 |
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Description
# ==============================================================================
#
# Functions to manage the SPI.
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
export init_spi, spi_tr... | [
2,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
... | 2.334103 | 4,762 |
export rule
@rule Gamma(:out, Marginalisation) (m_α::PointMass, m_θ::PointMass) = Gamma(mean(m_α), mean(m_θ))
@rule Gamma(:out, Marginalisation) (q_α::PointMass, q_θ::PointMass) = Gamma(mean(q_α), mean(q_θ)) | [
39344,
3896,
198,
198,
31,
25135,
43595,
7,
25,
448,
11,
11899,
1292,
5612,
8,
357,
76,
62,
17394,
3712,
12727,
20273,
11,
285,
62,
138,
116,
3712,
12727,
20273,
8,
796,
43595,
7,
32604,
7,
76,
62,
17394,
828,
1612,
7,
76,
62,
1... | 2.271739 | 92 |
export richardson_lucy_iterative
"""
richardson_lucy_iterative(measured, psf; <keyword arguments>)
Classical iterative Richardson-Lucy iteration scheme for deconvolution.
`measured` is the measured array and `psf` the point spread function.
Converges slower than the optimization approach of `deconvolution`
# Key... | [
39344,
5527,
1371,
261,
62,
2290,
948,
62,
2676,
876,
198,
198,
37811,
198,
220,
220,
220,
5527,
1371,
261,
62,
2290,
948,
62,
2676,
876,
7,
1326,
34006,
11,
26692,
69,
26,
1279,
2539,
4775,
7159,
43734,
198,
198,
9487,
605,
11629,
... | 2.274914 | 873 |
<gh_stars>10-100
module InterfaceTests
using Contour, Test
function setup()
nx, ny = 10, 10
xs = sort!(rand(nx))
ys = sort!(rand(ny))
zs = rand(nx, ny)
xs, ys, zs
end
xs, ys, zs = setup()
cs = @inferred contours(xs, ys, zs)
for c in levels(cs)
for l in lines(c)
x, y = coordinates(l... | [
27,
456,
62,
30783,
29,
940,
12,
3064,
198,
21412,
26491,
51,
3558,
198,
198,
3500,
2345,
454,
11,
6208,
198,
198,
8818,
9058,
3419,
198,
220,
220,
220,
299,
87,
11,
299,
88,
796,
838,
11,
838,
628,
220,
220,
220,
2124,
82,
796,... | 2.039409 | 203 |
include("euler/euler.jl")
using .Calculus: fibonacci_index, fibonacci_numbers
using BenchmarkTools
BenchmarkTools.DEFAULT_PARAMETERS.samples = 100
function compute(n::Int)::Int
index = fibonacci_index(n)
fibonacci = fibonacci_numbers(index + 1, Int)
last_sum, new_sum = 0, 0
result = sum(fibonacci[1:4])... | [
17256,
7203,
68,
18173,
14,
68,
18173,
13,
20362,
4943,
198,
3500,
764,
9771,
17576,
25,
12900,
261,
44456,
62,
9630,
11,
12900,
261,
44456,
62,
77,
17024,
198,
3500,
25187,
4102,
33637,
198,
44199,
4102,
33637,
13,
7206,
38865,
62,
2... | 2.29249 | 253 |
@testset "Constructors and basic properties" begin
let F = FullBinner()
@test typeof(F) <: AbstractVector{Float64}
@test eltype(F) == Float64
@test ndims(F) == 1
@test length(F) == 0
@test size(F) == (0,)
@test lastindex(F) == 0
@test axes(F) == (Base.OneTo(0)... | [
31,
9288,
2617,
366,
42316,
669,
290,
4096,
6608,
1,
2221,
198,
220,
220,
220,
1309,
376,
796,
6462,
33,
5083,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
2099,
1659,
7,
37,
8,
1279,
25,
27741,
38469,
90,
43879,
2414... | 2.074949 | 1,948 |
<reponame>PallHaraldsson/FourierAnalysis.jl<filename>examples/example_crossspectra.jl
# Unit examples of the FourierAnalysis Package for julia language
# v 0.0.1 - last update 24th of September 2019
#
# MIT License
# Copyright (c) 2019, <NAME>, CNRS, Grenobe, France:
# https://sites.google.com/site/marcoconge... | [
27,
7856,
261,
480,
29,
47,
439,
13587,
1940,
16528,
14,
37,
280,
5277,
32750,
13,
20362,
27,
34345,
29,
1069,
12629,
14,
20688,
62,
19692,
4443,
430,
13,
20362,
198,
2,
220,
220,
11801,
6096,
286,
262,
34296,
5277,
32750,
15717,
32... | 2.216703 | 1,832 |
# Much of this code is lifted from LineSearches.jl
# I modified it to accept StaticArrays and not allocate
# Some of the optimization code is adapted from Optim.jl
@with_kw struct BackTracking{TF, TI}
c_1::TF = 1e-4
ρ_hi::TF = 0.5
ρ_lo::TF = 0.1
iterations::TI = 1_000
maxstep::TF = Inf
end
abstr... | [
2,
13111,
286,
428,
2438,
318,
13663,
422,
6910,
50,
451,
2052,
13,
20362,
198,
2,
314,
9518,
340,
284,
2453,
36125,
3163,
20477,
290,
407,
31935,
198,
198,
2,
2773,
286,
262,
23989,
2438,
318,
16573,
422,
30011,
13,
20362,
628,
198... | 2.007213 | 9,011 |
using LazySequences
# Cons
c = cons(1, [42])
# Test first(s::Cons)
@assert first(c) == 1
# Test rest(s::Cons)
@assert first(rest(c)) == 42
ct = cat([1], [42])
# Test first(s::Cat)
@assert first(ct) == 1
# Test rest(s::Cat)
# Test getindex implementation
fibs = cat([0, 1], @lazyseq map(+, rest(fibs), fibs))
@assert ... | [
3500,
406,
12582,
44015,
3007,
198,
198,
2,
3515,
198,
66,
796,
762,
7,
16,
11,
685,
3682,
12962,
198,
2,
6208,
717,
7,
82,
3712,
9444,
8,
198,
31,
30493,
717,
7,
66,
8,
6624,
352,
198,
2,
6208,
1334,
7,
82,
3712,
9444,
8,
1... | 2.329412 | 170 |
# 定義の仕方がpython (:) と違って => を つかう
fruits = Dict("apple"=> 1, "banana"=> 2, "orange"=>3)
println(fruits)
# アクセスはキー
println(fruits["apple"])
fruits["mango"] = 4
println(fruits)
# 削除
pop!(fruits,"banana")
println(fruits)
# 削除part2
delete!(fruits,"apple")
println(fruits)
# 順序という概念がないから数値インデックスでアクセスはできない
# println(frui... | [
2,
10263,
106,
248,
163,
122,
102,
5641,
20015,
243,
43095,
35585,
29412,
357,
25,
8,
23294,
101,
34402,
243,
33180,
28134,
5218,
5099,
222,
31758,
23294,
97,
27370,
29557,
198,
198,
69,
50187,
796,
360,
713,
7203,
18040,
1,
14804,
35... | 1.63615 | 426 |
abstract type AbstractStorageFormulation <: AbstractDeviceFormulation end
struct BookKeeping <: AbstractStorageFormulation end
struct BookKeepingwReservation <: AbstractStorageFormulation end
#################################################Storage Variables#################################
function AddVariableSpec(
... | [
397,
8709,
2099,
27741,
31425,
8479,
1741,
1279,
25,
27741,
24728,
8479,
1741,
886,
198,
7249,
4897,
44815,
1279,
25,
27741,
31425,
8479,
1741,
886,
198,
7249,
4897,
44815,
86,
4965,
13208,
1279,
25,
27741,
31425,
8479,
1741,
886,
198,
... | 2.432856 | 3,701 |
# This file is a part of Julia. License is MIT: https://julialang.org/license
# BEGIN 0.7 deprecations
# PR #22062
function set_remote_url(repo::LibGit2.GitRepo, url::AbstractString; remote::AbstractString="origin")
Base.depwarn(string(
"`LibGit2.set_remote_url(repo, url; remote=remote)` is deprecated, us... | [
2,
770,
2393,
318,
257,
636,
286,
22300,
13,
13789,
318,
17168,
25,
3740,
1378,
73,
377,
498,
648,
13,
2398,
14,
43085,
198,
198,
2,
347,
43312,
657,
13,
22,
1207,
8344,
602,
198,
198,
2,
4810,
1303,
17572,
5237,
198,
8818,
900,
... | 2.561722 | 1,045 |
using DrWatson
@quickactivate :TimeProbeSeismic
close("all")
ee = (0, .8*25, .206*25, 0)
n, d, m, m0 = h5read(datadir("models", "overthrust_model.h5"), "n", "d", "m", "m0")
m0[:, 20:end] = imfilter(m0[:, 20:end] ,Kernel.gaussian(5));
n = Tuple(n)
d = Tuple(d)
vp_t = m'.^(-.5);
vp_0 = m0'.^(-.5);
inds = Dict(j=>i for... | [
3500,
1583,
54,
13506,
198,
31,
24209,
39022,
1058,
7575,
2964,
1350,
4653,
1042,
291,
198,
198,
19836,
7203,
439,
4943,
198,
1453,
796,
357,
15,
11,
764,
23,
9,
1495,
11,
764,
22136,
9,
1495,
11,
657,
8,
198,
198,
77,
11,
288,
... | 1.946631 | 2,642 |
function standard_normal_gausshermite(n::Int)
ϵᵢ, wᵢ = gausshermite(n) # approximates exp(-x²)
ϵᵢ .*= sqrt(2.) # Normalize ϵᵢ and wᵢ nodes to approximate standard normal
wᵢ ./= sqrt(π)
return ϵᵢ, wᵢ
end
"""
```
gausshermite_expectation(f, μ, σ, n = 10)
gausshermite_expectation(f, μ, Σ, n = ... | [
8818,
3210,
62,
11265,
62,
4908,
1046,
372,
32937,
7,
77,
3712,
5317,
8,
198,
220,
220,
220,
18074,
113,
39611,
95,
11,
266,
39611,
95,
796,
31986,
1046,
372,
32937,
7,
77,
8,
1303,
5561,
26748,
1033,
32590,
87,
31185,
8,
198,
220... | 2.048098 | 3,680 |
using SpecialFunctions, RecursiveArrayTools, DifferentialEquations, Plots
using ConservationLawsParticles
# model
V1(t, x) = 1 + sin(x)/2
V2(t, x) = -1 - cos(x)/2
Wₐ′(t,x) = sign(x) / (abs(x) + 1) + x^3/20
Wᵣ(t, x) = 1 / (abs(x) + 1)
mob1(ρ, σ) = max(1 - ρ - σ/2, 0)
mob2(ρ, σ) = max(1 - ρ/2 - σ, 0)
attr = SampledInter... | [
3500,
6093,
24629,
2733,
11,
3311,
30753,
19182,
33637,
11,
20615,
498,
23588,
602,
11,
1345,
1747,
198,
3500,
23702,
43,
8356,
7841,
2983,
198,
198,
2,
2746,
198,
53,
16,
7,
83,
11,
2124,
8,
796,
352,
1343,
7813,
7,
87,
20679,
17... | 2.109131 | 898 |
<reponame>JuliaConstraints/ICNBenchmarks.jl
module ICNBenchmarks
# usings
using BenchmarkTools
using CompositionalNetworks
using ConstraintDomains
using Constraints
using CSV
using DataFrames
using DataVoyager
using Dictionaries
using Distributed
using DrWatson
using JSON
using Statistics
using StatsBase
using Tables
... | [
27,
7856,
261,
480,
29,
16980,
544,
3103,
2536,
6003,
14,
2149,
45,
44199,
14306,
13,
20362,
198,
21412,
12460,
45,
44199,
14306,
198,
198,
2,
514,
654,
198,
3500,
25187,
4102,
33637,
198,
3500,
29936,
1859,
7934,
5225,
198,
3500,
148... | 3.283333 | 240 |
## ExoplanetsSysSim/src/star.jl
## (c) 2015 <NAME>
#using Distributions
@compat abstract type StarAbstract end # Check does using StarAbstract cause a significant performance hit
immutable Star <: StarAbstract
radius::Float64
mass::Float64
flux::Float64 # rele... | [
2235,
1475,
46853,
1039,
44387,
8890,
14,
10677,
14,
7364,
13,
20362,
198,
2235,
357,
66,
8,
1853,
1279,
20608,
29,
198,
198,
2,
3500,
46567,
507,
198,
198,
31,
5589,
265,
12531,
2099,
2907,
23839,
886,
220,
220,
220,
220,
220,
220,... | 2.359345 | 1,038 |
<reponame>perrutquist/LinearMaps.jl
using Test, LinearMaps, LinearAlgebra
@testset "function maps" begin
N = 100
function myft(v::AbstractVector)
# not so fast fourier transform
N = length(v)
w = zeros(complex(eltype(v)), N)
for k = 1:N
kappa = (2*(k-1)/N)*pi
... | [
27,
7856,
261,
480,
29,
525,
81,
315,
30062,
14,
14993,
451,
47010,
13,
20362,
198,
3500,
6208,
11,
44800,
47010,
11,
44800,
2348,
29230,
198,
198,
31,
9288,
2617,
366,
8818,
8739,
1,
2221,
198,
220,
220,
220,
399,
796,
1802,
198,
... | 2.157368 | 1,398 |
<reponame>JuliaInv/FactoredEikonalFastMarching.jl
using jInv.Mesh;
using FactoredEikonalFastMarching;
using Printf
#using PyPlot
#close("all")
include("runAccuracyExperiment.jl");
include("getWorkUnit.jl");
"""
A function for running the experiments in the paper:
<NAME> and <NAME>, A fast marching algorithm for th... | [
27,
7856,
261,
480,
29,
16980,
544,
19904,
14,
29054,
1850,
36,
1134,
20996,
22968,
16192,
278,
13,
20362,
198,
198,
3500,
474,
19904,
13,
37031,
26,
198,
3500,
19020,
1850,
36,
1134,
20996,
22968,
16192,
278,
26,
198,
3500,
12578,
69... | 2.451647 | 1,882 |
module MaxHelpingHandHeatWaveNoColorGrade
using ..Ahorn, Maple
@mapdef Effect "MaxHelpingHand/HeatWaveNoColorGrade" HeatWaveNoColorGrade(only::String="*", exclude::String="", controlColorGradeWhenActive::Bool=false)
placements = HeatWaveNoColorGrade
function Ahorn.canFgBg(effect::HeatWaveNoColorGrade)
return t... | [
171,
119,
123,
21412,
5436,
12621,
13886,
12885,
39596,
39709,
2949,
10258,
42233,
198,
198,
3500,
11485,
10910,
1211,
11,
21249,
198,
198,
31,
8899,
4299,
7896,
366,
11518,
12621,
13886,
12885,
14,
39596,
39709,
2949,
10258,
42233,
1,
12... | 3.054054 | 111 |
<reponame>amyascwk/JuniorLab.jl
import LsqFit
# #############################################################################
#Moving average filtering
#Apply filter
function movavgfilt{T}(y::Array{T,1},N::Int64)
#Usage:
# ys = movavgfilt(y,N)
# y Signal to be smoothed
# N Si... | [
27,
7856,
261,
480,
29,
14814,
3372,
43021,
14,
22396,
1504,
17822,
13,
20362,
198,
11748,
406,
31166,
31805,
198,
198,
2,
1303,
29113,
29113,
7804,
4242,
198,
2,
33622,
2811,
25431,
198,
198,
2,
44836,
8106,
198,
8818,
1409,
615,
70,... | 1.868449 | 3,740 |
<reponame>JuliaPackageMirrors/QuDirac.jl
##############################
# Mapping functions on Dicts #
##############################
function mapvals!(f, d)
for (k,v) in d
d[k] = f(v)
end
return d
end
mapvals(f, d) = Dict(zip(collect(keys(d)), map(f, collect(values(d)))))
mapkeys(f, d) = Dict(zip(... | [
27,
7856,
261,
480,
29,
16980,
544,
27813,
27453,
5965,
14,
4507,
35277,
330,
13,
20362,
198,
14468,
7804,
4242,
2235,
198,
2,
337,
5912,
5499,
319,
360,
14137,
1303,
198,
14468,
7804,
4242,
2235,
198,
8818,
3975,
12786,
0,
7,
69,
1... | 2.400472 | 1,271 |
<reponame>KyleVaughn/MOCNeutronTransport<gh_stars>1-10
abstract type AngularQuadrature end
abstract type UnstructuredMesh_2D end
abstract type LinearUnstructuredMesh_2D <: UnstructuredMesh_2D end
abstract type QuadraticUnstructuredMesh_2D <: UnstructuredMesh_2D end
| [
27,
7856,
261,
480,
29,
42516,
53,
1567,
77,
14,
44,
4503,
8199,
315,
1313,
8291,
634,
27,
456,
62,
30783,
29,
16,
12,
940,
198,
397,
8709,
2099,
28147,
4507,
41909,
1300,
886,
198,
397,
8709,
2099,
791,
7249,
1522,
37031,
62,
17,... | 2.860215 | 93 |
<reponame>ooreilly/sbpjl<gh_stars>1-10
module Sparse
using SparseArrays
"""
Allocates a block sparse matrix that stores nnz non-zero entries.
The matrix contains only zeros after allocation.
Input:
rows: A vector describing the number of elements in each block row the
block matrix has.
columns: A ... | [
27,
7856,
261,
480,
29,
78,
382,
6548,
14,
36299,
79,
20362,
27,
456,
62,
30783,
29,
16,
12,
940,
198,
21412,
1338,
17208,
198,
3500,
1338,
17208,
3163,
20477,
628,
198,
37811,
198,
1439,
420,
689,
257,
2512,
29877,
17593,
326,
7000... | 1.92364 | 1,912 |
const CPC = Ptr{Cvoid}
const CPCType = Cstring
abstract type AbstractPC{T} end
mutable struct PC{T} <: AbstractPC{T}
ptr::Ptr{Cvoid}
end
scalartype(::AbstractPC{T}) where {T} = T
@for_libpetsc begin
function PC{$PetscScalar}(comm::MPI.Comm)
pc = PC{$PetscScalar}(C_NULL)
@chk ccall((:PCCrea... | [
198,
9979,
41190,
796,
350,
2213,
90,
34,
19382,
92,
198,
9979,
16932,
4177,
2981,
796,
327,
8841,
198,
198,
397,
8709,
2099,
27741,
5662,
90,
51,
92,
886,
198,
198,
76,
18187,
2878,
4217,
90,
51,
92,
1279,
25,
27741,
5662,
90,
51... | 2.035088 | 912 |
<gh_stars>0
using Test
using SafeTestsets
@safetestset "Reference shapes tests" begin include("referenceshapes_test.jl") end
@safetestset "Domain tests" begin include("domain_test.jl") end
| [
27,
456,
62,
30783,
29,
15,
198,
3500,
6208,
198,
3500,
19978,
51,
3558,
1039,
198,
198,
31,
49585,
316,
395,
2617,
366,
26687,
15268,
5254,
1,
2221,
2291,
7203,
5420,
4972,
71,
7916,
62,
9288,
13,
20362,
4943,
886,
198,
198,
31,
... | 3.080645 | 62 |
using Mimi
_default_years = 2000:2100
_default_regions = [:A, :B]
function run_getindex(; years = collect(_default_years), regions = _default_regions)
# Test with one scalar parameter, one 1-D timestep array, and one 2-D timestep array
types = [Mimi.ScalarModelParameter{Float64}, _get_timesteparray_type(years... | [
3500,
337,
25236,
198,
198,
62,
12286,
62,
19002,
796,
4751,
25,
2481,
405,
198,
62,
12286,
62,
2301,
507,
796,
685,
25,
32,
11,
1058,
33,
60,
198,
198,
8818,
1057,
62,
1136,
9630,
7,
26,
812,
796,
2824,
28264,
12286,
62,
19002,
... | 2.223634 | 787 |
using ASTInterface
using Test
@testset "ASTInterface.jl" begin
# Write your tests here.
end
| [
3500,
29273,
39317,
201,
198,
3500,
6208,
201,
198,
201,
198,
31,
9288,
2617,
366,
11262,
39317,
13,
20362,
1,
2221,
201,
198,
220,
220,
220,
1303,
19430,
534,
5254,
994,
13,
201,
198,
437,
201,
198
] | 2.783784 | 37 |
<filename>test/updatetest.jl
Random.seed!(43)
X = randn(100, 20)
Xup = rand(25, 20)
l = size(Xup, 1) + 1
Xprim = vcat(X, Xup)[l:end,:]
@testset "data updat" begin
@test dataupdat(X, Xup) ≈ Xprim
end
@testset "moment updates" begin
x = ones(6, 2)
y = 2*ones(2,2)
M3 = moment(x, 3)
M4 = moment(x, 4)
M3up = ... | [
27,
34345,
29,
9288,
14,
929,
19608,
316,
395,
13,
20362,
198,
29531,
13,
28826,
0,
7,
3559,
8,
198,
198,
55,
796,
43720,
77,
7,
3064,
11,
1160,
8,
198,
55,
929,
796,
43720,
7,
1495,
11,
1160,
8,
198,
75,
796,
2546,
7,
55,
9... | 1.953476 | 1,870 |
# Copyright (c) 2019 <NAME>
# Copyright (c) 2019 <NAME>
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""
TxOut
Each output spends a certain number of satoshis, placing them under control of
anyone who can satisfy the provi... | [
2,
15069,
357,
66,
8,
13130,
1279,
20608,
29,
198,
2,
15069,
357,
66,
8,
13130,
1279,
20608,
29,
198,
2,
4307,
6169,
739,
262,
17168,
3788,
5964,
11,
766,
262,
19249,
198,
2,
2393,
27975,
45761,
393,
2638,
1378,
2503,
13,
44813,
1... | 2.995918 | 490 |
∑ = sum
using StatsFuns:logistic
sigmoid = logistic
using CSV:File
using DataFrames
using Printf:@sprintf
# DataTypes
using LinearAlgebra:Transpose
Numeric = Union{Int64,Float64}
NumericV = Union{Array{Int64,1},Array{Float64,1}}
NumericM = Union{Array{Int64,2},Array{Float64,2},Transpose{Float64,Array{Float64,2}},Trans... | [
24861,
239,
796,
2160,
198,
3500,
20595,
37,
13271,
25,
6404,
2569,
198,
82,
17225,
1868,
796,
2604,
2569,
198,
3500,
44189,
25,
8979,
198,
3500,
6060,
35439,
198,
3500,
12578,
69,
25,
31,
82,
37435,
198,
198,
2,
6060,
31431,
198,
3... | 2.142043 | 2,281 |
xlocations(ex) = Expr(:call, :($YaoLocations.Locations), ex)
xctrl_locations(ex) = Expr(:call, :($YaoLocations.CtrlLocations), ex)
"""
@gate <locs> => <gate>
Syntax sugar for `apply(gate, locs)`, must be used inside `@device`.
See also [`@device`](@ref).
!!! tips
You don't have to write `@gate` in most cases... | [
87,
17946,
602,
7,
1069,
8,
796,
1475,
1050,
7,
25,
13345,
11,
1058,
16763,
56,
5488,
43,
20968,
13,
43,
20968,
828,
409,
8,
198,
87,
44755,
62,
17946,
602,
7,
1069,
8,
796,
1475,
1050,
7,
25,
13345,
11,
1058,
16763,
56,
5488,
... | 2.192574 | 6,787 |
<filename>src/EquivalentCircuits.jl<gh_stars>1-10
module EquivalentCircuits
export circuitevolution
export parameteroptimisation
export loadpopulation
export Circuit, EquivalentCircuit
using Random, Combinatorics, GeneralizedGenerated, DelimitedFiles, Distributions, Optim
import Base: isless, l... | [
27,
34345,
29,
10677,
14,
23588,
29540,
31560,
15379,
13,
20362,
27,
456,
62,
30783,
29,
16,
12,
940,
198,
21412,
7889,
29540,
31560,
15379,
628,
220,
220,
220,
10784,
2498,
84,
578,
85,
2122,
198,
220,
220,
220,
10784,
11507,
40085,
... | 2.9869 | 229 |
<filename>src/polar_stereographic.jl
# Ported to Julia by <NAME>, 2016, and re-released under an MIT license.
#/**
# * Copyright (c) <NAME> (2008-2015) <<EMAIL>> and licensed
# * under the MIT/X11 License. For more information, see
# * http://geographiclib.sourceforge.net/
# *******************************************... | [
27,
34345,
29,
10677,
14,
79,
6192,
62,
301,
567,
6826,
13,
20362,
198,
2,
4347,
276,
284,
22300,
416,
1279,
20608,
22330,
1584,
11,
290,
302,
12,
30147,
739,
281,
17168,
5964,
13,
198,
2,
35343,
198,
2,
1635,
15069,
357,
66,
8,
... | 2.335436 | 951 |
<filename>src/markerfile.jl
module MarkerFile
using ..LIKWID: LibLikwid
"""
Reads in the result file of an application run instrumented by the LIKWID Marker API.
*Note:* julia must have been started under `likwid-perfctr ... -m`.
"""
function read(fp::AbstractString)
ret = LibLikwid.perfmon_readMarkerFile(fp)
... | [
27,
34345,
29,
10677,
14,
4102,
263,
7753,
13,
20362,
198,
21412,
2940,
263,
8979,
198,
198,
3500,
11485,
43,
18694,
54,
2389,
25,
7980,
43,
1134,
28029,
198,
198,
37811,
198,
5569,
82,
287,
262,
1255,
2393,
286,
281,
3586,
1057,
88... | 2.904903 | 673 |
using Test
using MaxEntropyGraphs
include("./models.jl")
| [
3500,
6208,
198,
3500,
5436,
14539,
28338,
37065,
82,
198,
198,
17256,
7,
1911,
14,
27530,
13,
20362,
4943,
628
] | 2.95 | 20 |
using PrettyTables
function get_fermi()
rex = r"@@@ Average Fock Time:\s([0-9]*\.?[0-9]*)"
fpath = joinpath(@__DIR__, "fermi/output.dat")
timings = zeros(22)
i = 1
for l = eachline(fpath)
m = match(rex, l)
if m !== nothing
timings[i] = m.captures[1] |> String |> x->parse... | [
3500,
20090,
51,
2977,
198,
198,
8818,
651,
62,
2232,
11632,
3419,
198,
220,
220,
220,
302,
87,
796,
374,
1,
12404,
31,
13475,
376,
735,
3862,
7479,
82,
26933,
15,
12,
24,
60,
9,
17405,
30,
58,
15,
12,
24,
60,
9,
16725,
198,
2... | 1.739845 | 1,034 |
# Add dependencies
using Pkg
Pkg.add(Pkg.PackageSpec(;name="Git", version="1.2.1"))
Pkg.add(Pkg.PackageSpec(;name="TOML", version="1.0.0"))
using TOML
using Git
# Extract the version number to be updated
VERSION = ""
if length(ARGS) > 0
VERSION = ARGS[1]
end
GITHUB_REPOSITORY = ENV["GITHUB_REPOSITORY"]
TOKEN = ""... | [
2,
3060,
20086,
198,
3500,
350,
10025,
198,
47,
10025,
13,
2860,
7,
47,
10025,
13,
27813,
22882,
7,
26,
3672,
2625,
38,
270,
1600,
2196,
2625,
16,
13,
17,
13,
16,
48774,
198,
47,
10025,
13,
2860,
7,
47,
10025,
13,
27813,
22882,
... | 2.281447 | 636 |
module TestPreservingFuncs
using Base.Test
using DataArrays
using DataFrames
using Dates
using TimeData
println("Running type preserving function tests")
allTypes = (:Timedata, :Timenum, :Timematr)
################
## hcat tests ##
################
tm = Timematr(rand(2, 3))
hcat(tm[:, 1], tm[:, 2], tm[:, 3])
td ... | [
21412,
6208,
25460,
14344,
24629,
6359,
198,
198,
3500,
7308,
13,
14402,
198,
3500,
6060,
3163,
20477,
198,
3500,
6060,
35439,
198,
3500,
44712,
198,
198,
3500,
3862,
6601,
198,
198,
35235,
7203,
28768,
2099,
23934,
2163,
5254,
4943,
198,... | 2.050251 | 1,791 |
using Statistics
import Base.Meta: isexpr
"""
ret = @freshexec [setup_ex] ex
Runs `ex` in an external process and gets back the final result (, which is supposed to be
such a simple Julia object that we can restore it from its string representation).
Running in external process can be useful for testing JET an... | [
3500,
14370,
198,
11748,
7308,
13,
48526,
25,
318,
31937,
198,
198,
37811,
198,
220,
220,
220,
1005,
796,
2488,
69,
411,
33095,
721,
685,
40406,
62,
1069,
60,
409,
198,
198,
10987,
82,
4600,
1069,
63,
287,
281,
7097,
1429,
290,
3011... | 2.833742 | 1,630 |
@test_throws ArgumentError OrbitalIndex(-1, -2)
@test_throws ArgumentError OrbitalIndex(3, -1)
@test_throws ArgumentError OrbitalIndex(3, 5)
@testset ">> Operators" begin
@test OrbitalIndex(0, 0) == OrbitalIndex(0, 0)
@test OrbitalIndex(2, 1) == OrbitalIndex(2, 1)
@test OrbitalIndex(2, 1) != OrbitalIndex(2... | [
31,
9288,
62,
400,
8516,
45751,
12331,
45453,
15732,
32590,
16,
11,
532,
17,
8,
198,
31,
9288,
62,
400,
8516,
45751,
12331,
45453,
15732,
7,
18,
11,
532,
16,
8,
198,
31,
9288,
62,
400,
8516,
45751,
12331,
45453,
15732,
7,
18,
11,
... | 2.227273 | 924 |
module TestCompositeSimple
using Test
using Mimi
import Mimi:
ComponentId, ComponentPath, ComponentDef, AbstractComponentDef,
CompositeComponentDef, ModelDef, build, time_labels, compdef, find_comp,
import_params!
@defcomp Comp1 begin
par_1_1 = Parameter(index=[time]) # external input
var_1_... | [
21412,
6208,
5377,
1930,
578,
26437,
198,
198,
3500,
6208,
198,
3500,
337,
25236,
198,
198,
11748,
337,
25236,
25,
198,
220,
220,
220,
35100,
7390,
11,
35100,
15235,
11,
35100,
7469,
11,
27741,
21950,
7469,
11,
198,
220,
220,
220,
493... | 2.186317 | 687 |
<gh_stars>1-10
include("Tanh.jl")
include("jacobian.jl")
using Base.Test
X = map(Float32, randn(5, 3))
l = Tanh{Float32}()
# Test grad. wrt. input X
Dfwd = jacobian_fwd(l, X)
Dbwd = jacobian_bwd(l, X)
@test_approx_eq Dfwd Dbwd
| [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
17256,
7203,
45557,
71,
13,
20362,
4943,
198,
17256,
7203,
30482,
672,
666,
13,
20362,
4943,
198,
3500,
7308,
13,
14402,
198,
198,
55,
796,
3975,
7,
43879,
2624,
11,
43720,
77,
7,
20,
11,
... | 1.982759 | 116 |
import POMDPs.initialstate
const IVec8 = SVector{8, Int}
@with_kw struct AODiscreteVDPTagPOMDP <: POMDP{TagState, TagAction, IVec8}
cpomdp::VDPTagPOMDP = VDPTagPOMDP()
angles::Array{Float64, 1} = range(0, stop=2*pi, length=11)[1:end-1]
binsize::Float64 = 0.5
end
AODiscreteV... | [
11748,
350,
2662,
6322,
82,
13,
36733,
5219,
198,
9979,
8363,
721,
23,
796,
20546,
9250,
90,
23,
11,
2558,
92,
198,
198,
31,
4480,
62,
46265,
2878,
317,
3727,
2304,
8374,
53,
6322,
24835,
47,
2662,
6322,
1279,
25,
350,
2662,
6322,
... | 2.124188 | 1,385 |
module REPLMode
import Pkg3
using Pkg3.Types
using Pkg3.Display
using Pkg3.Operations
import Base: LineEdit, REPL, REPLCompletions
import Base.Random: UUID
using Base.Markdown
const cmds = Dict(
"help" => :help,
"?" => :help,
"status" => :status,
"st" => :status,
"." ... | [
21412,
45285,
19076,
198,
198,
11748,
350,
10025,
18,
198,
3500,
350,
10025,
18,
13,
31431,
198,
3500,
350,
10025,
18,
13,
23114,
198,
3500,
350,
10025,
18,
13,
18843,
602,
198,
198,
11748,
7308,
25,
6910,
18378,
11,
45285,
11,
45285,... | 2.186438 | 7,713 |
<gh_stars>0
using ThreeBodyDecay
using Parameters
using Test
@testset "Wigner angle permutations" begin
mp = 0.938; mK = 0.49367; mpi = 0.13957; mXic = 2.46867
tbs = ThreeBodySystem(mp,mK,mpi; m0=mXic)
σs = randomPoint(tbs.ms)
@unpack m1,m2,m3,m0 = tbs.ms
# (23) cosζ31_for1 = cosζ23_for1
@te... | [
27,
456,
62,
30783,
29,
15,
198,
3500,
7683,
25842,
10707,
323,
198,
3500,
40117,
198,
3500,
6208,
198,
198,
31,
9288,
2617,
366,
54,
570,
263,
9848,
9943,
32855,
1,
2221,
628,
220,
220,
220,
29034,
796,
657,
13,
24,
2548,
26,
285... | 1.395433 | 832 |
#TODO: Fill
"""
```WIP``
this 'File Container' has the main instrutions
"""
# include("src/includes.jl") reads the below correctly
include("includes.jl")
function main()
drAccount(dr::Enum,cr::Enum,drAccount ,crAccount,amount)
if (dr == 1 && cr == 1) #dr drAccount (+), cr crAccount (+) #inflow type
... | [
2,
51,
3727,
46,
25,
27845,
198,
198,
37811,
198,
15506,
63,
54,
4061,
15506,
198,
198,
5661,
705,
8979,
43101,
6,
468,
262,
1388,
6480,
3508,
198,
198,
37811,
198,
2,
2291,
7203,
10677,
14,
42813,
13,
20362,
4943,
9743,
262,
2174,
... | 2.101449 | 276 |
<reponame>TheCedarPrince/DataExplorers
using Luxor
using OffsetArrays
function make_drawing(width, height, img_path, bkg_color, origin_p)
d = Drawing(width, height, img_path)
background(bkg_color)
origin(origin_p)
return d
end
width = 500
height = 500
path = "voronoi.png"
color = "black"
my_draw = ma... | [
27,
7856,
261,
480,
29,
464,
34,
44226,
35784,
14,
6601,
18438,
28089,
198,
3500,
17145,
273,
198,
3500,
3242,
2617,
3163,
20477,
198,
198,
8818,
787,
62,
19334,
278,
7,
10394,
11,
6001,
11,
33705,
62,
6978,
11,
275,
10025,
62,
8043... | 1.885496 | 1,048 |
<reponame>aminnj/ThreadGantt.jl
using Test
using ThreadGantt
@testset "stuff" begin
@test 1 == 1
end
| [
27,
7856,
261,
480,
29,
321,
3732,
73,
14,
16818,
38,
415,
83,
13,
20362,
198,
3500,
6208,
198,
3500,
14122,
38,
415,
83,
198,
198,
31,
9288,
2617,
366,
41094,
1,
2221,
198,
220,
220,
220,
2488,
9288,
352,
6624,
352,
198,
437,
1... | 2.355556 | 45 |
function __new__(T, args...)
# @show T
# @show args
# note: we also add __new__() to the list of primitives so it's not overdubbed recursively
if T <: NamedTuple
return T(args)
else
return T(args...)
end
end
__tuple__(args...) = tuple(args...)
__getfield__(args...) = getfield(a... | [
8818,
11593,
3605,
834,
7,
51,
11,
26498,
23029,
198,
220,
220,
220,
1303,
2488,
12860,
309,
198,
220,
220,
220,
1303,
2488,
12860,
26498,
198,
220,
220,
220,
1303,
3465,
25,
356,
635,
751,
11593,
3605,
834,
3419,
284,
262,
1351,
28... | 2.361991 | 442 |
<gh_stars>0
using Crux
using POMDPModels
using Test
using CUDA
using Flux
using Random
## mdp_data
d1 = mdp_data(ContinuousSpace(3), ContinuousSpace(4), 100)
d2 = mdp_data(ContinuousSpace(3), ContinuousSpace(4), 100, [:weight, :t, :advantage, :return, :logprob])
# @test_throws ErrorException mdp_data(ContinuousSpace(... | [
27,
456,
62,
30783,
29,
15,
198,
3500,
6472,
87,
198,
3500,
350,
2662,
6322,
5841,
1424,
198,
3500,
6208,
198,
3500,
29369,
5631,
198,
3500,
1610,
2821,
198,
3500,
14534,
198,
198,
2235,
285,
26059,
62,
7890,
198,
67,
16,
796,
285,
... | 2.213722 | 4,052 |
# Unit testing of (bounded) univariate discrete distributions
#
# Here, bounded means the sample values are bounded.
#
# Distributions covered by this suite:
#
# - Bernoulli
# - Categorical
# - DiscreteUniform
#
using Distributions
using Base.Test
import StatsBase: entropy
distlist = [
Bernoulli(0.1),
... | [
2,
220,
11801,
4856,
286,
357,
65,
6302,
8,
555,
42524,
28810,
24570,
198,
2,
198,
2,
220,
3423,
11,
49948,
1724,
262,
6291,
3815,
389,
49948,
13,
220,
198,
2,
198,
2,
220,
46567,
507,
5017,
416,
428,
18389,
25,
198,
2,
198,
2,
... | 1.882145 | 1,977 |
<reponame>mschauer/SplitApplyCombine.jl
module SplitApplyCombine
using Base: @propagate_inbounds, @pure, promote_op
using Indexing
# Syntax
export @_
# collections -> scalar
export only
# collections -> collections
import Base: merge, merge!
export mapmany
# collections -> collections of collections
export group, ... | [
27,
7856,
261,
480,
29,
907,
354,
16261,
14,
41205,
44836,
20575,
500,
13,
20362,
198,
21412,
27758,
44836,
20575,
500,
198,
198,
3500,
7308,
25,
2488,
22930,
37861,
62,
259,
65,
3733,
11,
2488,
37424,
11,
7719,
62,
404,
198,
3500,
... | 2.889415 | 633 |
# This file is auto-generated by AWSMetadata.jl
using AWS
using AWS.AWSServices: iot_events_data
using AWS.Compat
using AWS.UUIDs
"""
batch_put_message(messages)
batch_put_message(messages, params::Dict{String,<:Any})
Sends a set of messages to the AWS IoT Events system. Each message payload is transformed
in... | [
2,
770,
2393,
318,
8295,
12,
27568,
416,
30865,
9171,
14706,
13,
20362,
198,
3500,
30865,
198,
3500,
30865,
13,
12298,
5432,
712,
1063,
25,
1312,
313,
62,
31534,
62,
7890,
198,
3500,
30865,
13,
40073,
198,
3500,
30865,
13,
52,
27586,
... | 3.133229 | 1,276 |
<reponame>Rahulub3r/MLJBase.jl
############################################
################ Structures ################
############################################
function glb(types...)
# If a lower bound is in the types then it is greatest
# else we just return Unknown for now
for type in types
... | [
27,
7856,
261,
480,
29,
47135,
377,
549,
18,
81,
14,
5805,
41,
14881,
13,
20362,
198,
29113,
7804,
4242,
198,
14468,
32112,
942,
1303,
7804,
4242,
21017,
198,
29113,
7804,
4242,
628,
198,
8818,
1278,
65,
7,
19199,
23029,
198,
220,
2... | 2.706213 | 6,760 |
<gh_stars>0
using .Abstract: returntype
using IRTools: Variable, returnvalue, blocks, isexpr
using IRTools.Inner: iscall
struct Trivial end
function infer(f, ::Trivial, tr = trace(typeof(f)))
r = returntype(tr)
r isa Abstract.Const && return Singleton(r.value)
any(((v, st),) -> iscall(st.expr, observe), tr) && ... | [
27,
456,
62,
30783,
29,
15,
198,
3500,
764,
23839,
25,
1005,
333,
429,
2981,
198,
3500,
314,
14181,
10141,
25,
35748,
11,
1441,
8367,
11,
7021,
11,
318,
31937,
198,
3500,
314,
14181,
10141,
13,
818,
1008,
25,
318,
13345,
198,
198,
... | 2.668478 | 184 |
<gh_stars>0
print("This host's word size is ", WORD_SIZE, ".")
if ENDIAN_BOM == 0x04030201
println("And it is a little-endian machine.")
elseif ENDIAN_BOM == 0x01020304
println("And it is a big-endian machine.")
else
println("ENDIAN_BOM = ", ENDIAN_BOM, ", which is confusing")
end
| [
27,
456,
62,
30783,
29,
15,
198,
4798,
7203,
1212,
2583,
338,
1573,
2546,
318,
33172,
370,
12532,
62,
33489,
11,
366,
19570,
198,
361,
23578,
16868,
62,
33,
2662,
6624,
657,
87,
36676,
1270,
1264,
198,
220,
220,
220,
44872,
7203,
18... | 2.648649 | 111 |
<reponame>BSnelling/PowerFlowData.jl
# This is a simple `@debug` macro that we can use in the code
# without it slowing the code down, unlike `Base.@debug`.
const DEBUG_LEVEL = Ref(0)
function setdebug!(level::Int)
DEBUG_LEVEL[] = level
return nothing
end
"""
withdebug(level::Int) do
func()
e... | [
27,
7856,
261,
480,
29,
4462,
77,
9417,
14,
13434,
37535,
6601,
13,
20362,
198,
2,
770,
318,
257,
2829,
4600,
31,
24442,
63,
15021,
326,
356,
460,
779,
287,
262,
2438,
198,
2,
1231,
340,
21605,
262,
2438,
866,
11,
5023,
4600,
1488... | 2.291667 | 312 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.