content stringlengths 6 1.03M | input_ids listlengths 4 535k | ratio_char_token float64 0.68 8.61 | token_count int64 4 535k |
|---|---|---|---|
# Test memory management
using MathOptInterface
@testset "create and manual free" begin
o = SCIP.Optimizer()
@test o.inner.scip[] != C_NULL
SCIP.free_scip(o)
@test o.inner.scip[] == C_NULL
end
@testset "create, add var and cons, and manual free" begin
o = SCIP.Optimizer()
@test o.inner.scip[]... | [
2,
6208,
4088,
4542,
198,
198,
3500,
16320,
27871,
39317,
198,
198,
31,
9288,
2617,
366,
17953,
290,
10107,
1479,
1,
2221,
198,
220,
220,
220,
267,
796,
6374,
4061,
13,
27871,
320,
7509,
3419,
198,
220,
220,
220,
2488,
9288,
267,
13... | 1.939805 | 2,359 |
using ArgParse, LinearMaps, HDF5, JLD
function parse_commandline()
s = ArgParseSettings()
@add_arg_table s begin
"--hfield"
help = "Magnetic field parameter."
arg_type = Real
default = 2.0
"--Jcoupling", "-J"
help = "Coupling constant."
arg_type = Real
... | [
198,
198,
3500,
20559,
10044,
325,
11,
44800,
47010,
11,
5572,
37,
20,
11,
449,
11163,
628,
198,
8818,
21136,
62,
21812,
1370,
3419,
198,
220,
220,
220,
264,
796,
20559,
10044,
325,
26232,
3419,
198,
220,
220,
220,
2488,
2860,
62,
8... | 2.342051 | 2,906 |
<gh_stars>10-100
"""
ck45()
Returns coefficients rka,rkb,rkc for the 4th order 5-stage low storage Carpenter/Kennedy
Runge Kutta method. Coefficients evolve the residual, solution, and local time, e.g.,
# Example
```julia
res = rk4a[i]*res + dt*rhs # i = RK stage
@. u += rk4b[i]*res
```
"""
function ck45()
rk... | [
27,
456,
62,
30783,
29,
940,
12,
3064,
198,
37811,
198,
220,
220,
220,
269,
74,
2231,
3419,
198,
198,
35561,
44036,
374,
4914,
11,
81,
32812,
11,
81,
74,
66,
329,
262,
604,
400,
1502,
642,
12,
14247,
1877,
6143,
32659,
14,
39324,
... | 1.934426 | 488 |
module FileSystem
immutable PakFile
pak::String
off::Uint32
len::Uint32
end
search_paths = String[string(ENV["HOME"], "/q2")]
pak_files = Dict{String,PakFile}()
function scan()
for path = search_paths
paks = map(x->path*"/"*x, union(
filter(r"pak[0-9]+\.pak$", readdir(path)),
filter(r"\.pak$", readdir(pa... | [
21412,
9220,
11964,
198,
198,
8608,
18187,
6162,
8979,
198,
197,
41091,
3712,
10100,
198,
197,
2364,
3712,
52,
600,
2624,
198,
197,
11925,
3712,
52,
600,
2624,
198,
437,
198,
198,
12947,
62,
6978,
82,
796,
10903,
58,
8841,
7,
1677,
... | 2.246824 | 551 |
<gh_stars>0
# Determine the measure
"""
azdual_dict(ap::ApproximationProblem; options...)
The dual that is used to create a AZ `Z` matrix.
"""
azdual_dict(samplingstyle::DiscreteStyle, ap::ApproximationProblem; options...) =
azdual_dict(samplingstyle, ap, discretemeasure(samplingstyle, ap; options...); option... | [
27,
456,
62,
30783,
29,
15,
198,
198,
2,
45559,
3810,
262,
3953,
198,
37811,
198,
220,
220,
220,
35560,
646,
282,
62,
11600,
7,
499,
3712,
4677,
13907,
18991,
40781,
26,
3689,
23029,
198,
198,
464,
10668,
326,
318,
973,
284,
2251,
... | 3.099071 | 323 |
<reponame>UnofficialJuliaMirror/SpinMonteCarlo.jl-71c4a2d3-ecf8-5cd9-ab6a-09a504837b4f
function simple_estimator(model::Potts, T::Real, Js::AbstractArray, _=nothing)
nsites = numsites(model)
nbonds = numbonds(model)
invQ = 1.0/model.Q
M = 0.0
@inbounds for s in 1:nsites
M += ifelse(model.sp... | [
27,
7856,
261,
480,
29,
3118,
16841,
16980,
544,
27453,
1472,
14,
4561,
259,
9069,
660,
9914,
5439,
13,
20362,
12,
4869,
66,
19,
64,
17,
67,
18,
12,
721,
69,
23,
12,
20,
10210,
24,
12,
397,
21,
64,
12,
2931,
64,
1120,
2780,
27... | 1.958221 | 1,484 |
<reponame>serenity4/OpenType.jl<filename>src/parsing/metrics.jl
struct HorizontalHeader
ascender::Int16
descender::Int16
line_gap::Int16
advance_width_max::UInt16
min_left_side_bearing::Int16
min_right_side_bearing::Int16
x_max_extent::Int16
caret_slope_rise::Int16
caret_slope_run::I... | [
27,
7856,
261,
480,
29,
325,
918,
414,
19,
14,
11505,
6030,
13,
20362,
27,
34345,
29,
10677,
14,
79,
945,
278,
14,
4164,
10466,
13,
20362,
198,
7249,
6075,
38342,
39681,
198,
220,
220,
220,
10570,
2194,
3712,
5317,
1433,
198,
220,
... | 2.39011 | 1,092 |
<gh_stars>0
using SnoopCompile
SnoopCompile.@snoop "glp_compiles.csv" begin
using GLPlot;GLPlot.init()
using Colors, GeometryTypes
glplot(rand(Float32, 32,32))
glplot(rand(Float32, 32,32), :surface)
glplot(rand(Point3f0,32))
glplot(rand(Point3f0,32), :lines)
glplot(rand(Point2f0,32), :lines... | [
27,
456,
62,
30783,
29,
15,
198,
3500,
42578,
404,
7293,
576,
198,
198,
50,
3919,
404,
7293,
576,
13,
31,
82,
3919,
404,
366,
4743,
79,
62,
5589,
2915,
13,
40664,
1,
2221,
198,
220,
220,
220,
1262,
10188,
43328,
26,
8763,
43328,
... | 2.234756 | 328 |
<gh_stars>0
###################
## Packages ########
###################
using CSV
using DataFrames
using JuMP
using Gurobi
using ProgressMeter
using ElectronDisplay
using Dates
# Loading the project module, containing essential functions and structs
include("model/src/Sesam.jl")
using .Sesam
###################
# S... | [
27,
456,
62,
30783,
29,
15,
198,
14468,
21017,
198,
2235,
6400,
1095,
46424,
21017,
198,
14468,
21017,
198,
198,
3500,
44189,
198,
3500,
6060,
35439,
198,
3500,
12585,
7378,
198,
3500,
402,
1434,
8482,
198,
3500,
18387,
44,
2357,
198,
... | 2.231511 | 1,555 |
<reponame>PallHaraldsson/SpikeNetOpt.jl<filename>examples/mlp2.jl
using PyCall
py"""import validate_candidate"""
iter = [t.iteration for t in trace]
data = [ trace[i+1,1,1].metadata["pop"] for i in iter ]
evo_loss
model = Chain(Dense(d, 15, relu), Dense(15, nclasses))
@info "MLP" loss=loss(data, evomodel) accuracy = ac... | [
27,
7856,
261,
480,
29,
47,
439,
13587,
1940,
16528,
14,
4561,
522,
7934,
27871,
13,
20362,
27,
34345,
29,
1069,
12629,
14,
4029,
79,
17,
13,
20362,
198,
3500,
9485,
14134,
198,
9078,
37811,
11748,
26571,
62,
46188,
20540,
37811,
198,... | 2.12801 | 789 |
struct Preconditioner{ML<:MultiLevel}
ml::ML
init::Symbol
end
Preconditioner(ml) = Preconditioner(ml, :zero)
aspreconditioner(ml::MultiLevel) = Preconditioner(ml)
import LinearAlgebra: \, *, ldiv!, mul!
ldiv!(p::Preconditioner, b) = copyto!(b, p \ b)
function ldiv!(x, p::Preconditioner, b)
if p.init == :z... | [
7249,
3771,
31448,
263,
90,
5805,
27,
25,
29800,
4971,
92,
198,
220,
220,
220,
25962,
3712,
5805,
198,
220,
220,
220,
2315,
3712,
13940,
23650,
198,
437,
198,
6719,
31448,
263,
7,
4029,
8,
796,
3771,
31448,
263,
7,
4029,
11,
1058,
... | 2.173759 | 282 |
<reponame>farr/AutoDiff.jl
module AutoDiff
include("StatsFunctions.jl")
include("Backward.jl")
end # module
| [
27,
7856,
261,
480,
29,
69,
3258,
14,
27722,
28813,
13,
20362,
198,
21412,
11160,
28813,
198,
198,
17256,
7203,
29668,
24629,
2733,
13,
20362,
4943,
198,
17256,
7203,
7282,
904,
13,
20362,
4943,
198,
198,
437,
1303,
8265,
198
] | 2.75 | 40 |
module RoadRunner
__precompile__(false)
#export my_f(x,y), another function to export
using Libdl
current_dir = @__DIR__
rr_api = joinpath(current_dir, "roadrunner_c_api.dll")
antimony_api = joinpath(current_dir, "libantimony.dll")
rr_api_linux = joinpath(current_dir, "libroadrunner_c_api.so")
antimony_api_linux = j... | [
21412,
5567,
49493,
198,
834,
3866,
5589,
576,
834,
7,
9562,
8,
198,
2,
39344,
616,
62,
69,
7,
87,
11,
88,
828,
1194,
2163,
284,
10784,
198,
198,
3500,
7980,
25404,
628,
198,
14421,
62,
15908,
796,
2488,
834,
34720,
834,
198,
2106... | 2.825585 | 40,461 |
module ArcadeLearningEnvironment
using ArcadeLearningEnvironment_jll
using Pkg.Artifacts
include("aleinterface.jl")
ROM_PATH = artifact"atari_roms"
export ALEInterface,
ALEPtr,
# Functions
ALE_new,
ALE_del,
getInt,
getBool,
getFloat,
setString,
setInt,
setBool,
setFloat,
... | [
21412,
23190,
41730,
31441,
198,
3500,
23190,
41730,
31441,
62,
73,
297,
198,
3500,
350,
10025,
13,
8001,
37199,
198,
198,
17256,
7203,
1000,
39994,
13,
20362,
4943,
198,
198,
33676,
62,
34219,
796,
24127,
1,
35554,
62,
398,
82,
1,
19... | 2.384 | 375 |
#**************************************************************************************
# Input_Interface.jl
# =============== part of the GeoEfficiency.jl package.
#
# all the input either from the console or from the csv files to the package is handled by some function here.
#
#***************************************... | [
2,
17174,
17174,
8412,
2466,
1174,
198,
2,
23412,
62,
39317,
13,
20362,
198,
2,
796,
25609,
855,
636,
286,
262,
32960,
36,
35590,
13,
20362,
5301,
13,
198,
2,
198,
2,
477,
262,
5128,
2035,
422,
262,
8624,
393,
422,
262,
269,
21370... | 2.72893 | 4,663 |
import TimeZones
const TIME_ZONE = TimeZones.TimeZone("America/New_York")
| [
11748,
3862,
57,
1952,
198,
9979,
20460,
62,
57,
11651,
796,
3862,
57,
1952,
13,
7575,
26961,
7203,
18165,
14,
3791,
62,
49278,
4943,
628
] | 3 | 25 |
@testset "sampling_functions" begin
@testset "sampling input $Tx" for Tx in [Matrix, ColVecs, RowVecs]
@testset "bayesian_linear_regression" begin
rng, N, D = MersenneTwister(123456), 11, 5
X, f, Σy = generate_toy_problem(rng, N, D, Tx)
g = rand(rng, f)
@test... | [
31,
9288,
2617,
366,
37687,
11347,
62,
12543,
2733,
1,
2221,
198,
220,
220,
220,
2488,
9288,
2617,
366,
37687,
11347,
5128,
720,
46047,
1,
329,
309,
87,
287,
685,
46912,
11,
1623,
53,
721,
82,
11,
11314,
53,
721,
82,
60,
198,
220,... | 1.651833 | 2,809 |
<filename>Julia/SimpleBlockadePlot.jl
#Script for plotting blockade shift results
#26/07/2017
using Plots, JLD, LaTeXStrings
pyplot()
include("functions.jl")
PyPlot.close("all")
atom = "87Rb"
nn = 50
ll = 1
jj = 0.5
mj = 0.5
RRSI, θ, blockadeshiftmeshGHz, C_6val = BlockadeShift(atom,nn,ll,jj,mj)
PyPlot.figure()
hea... | [
27,
34345,
29,
16980,
544,
14,
26437,
12235,
671,
43328,
13,
20362,
198,
2,
7391,
329,
29353,
30974,
6482,
2482,
198,
2,
2075,
14,
2998,
14,
5539,
198,
198,
3500,
1345,
1747,
11,
449,
11163,
11,
4689,
49568,
13290,
654,
198,
9078,
2... | 2.198052 | 308 |
<filename>src/figures.jl
function draw_hg(s::Sampling)
xs = Float64[]
ys = Float64[]
yerrs = Float64[]
for (n, hg) in s.hg
N = n^2
x = log2(N)
hg = (hg * x) / sqrt(n)
y = Statistics.mean(hg)
yerr = Statistics.std(hg)
push!(xs, x)
push!(ys, y)
... | [
27,
34345,
29,
10677,
14,
5647,
942,
13,
20362,
198,
8818,
3197,
62,
71,
70,
7,
82,
3712,
16305,
11347,
8,
198,
220,
220,
220,
2124,
82,
796,
48436,
2414,
21737,
198,
220,
220,
220,
331,
82,
796,
48436,
2414,
21737,
198,
220,
220,... | 1.847174 | 1,734 |
module DistancePlan
using StaticArrays
function norm(v)
return sqrt(sum(v .^ 2))
end
function distance(center, obstacle::AbstractVector{T}) where {T <: AbstractFloat}
return norm(center .- obstacle)
end
abstract type Volume end
struct Box <: Volume
lows
highs
end
export Box
function distance(center, obst... | [
21412,
34600,
20854,
198,
198,
3500,
36125,
3163,
20477,
198,
198,
8818,
2593,
7,
85,
8,
198,
220,
1441,
19862,
17034,
7,
16345,
7,
85,
764,
61,
362,
4008,
198,
437,
198,
198,
8818,
5253,
7,
16159,
11,
22007,
3712,
23839,
38469,
90,... | 2.605499 | 1,673 |
##
# Generic base overloads
Base.extrema(primitive::GeometryPrimitive) = (minimum(primitive), maximum(primitive))
function widths(x::AbstractRange)
mini, maxi = Float32.(extrema(x))
return maxi - mini
end
##
# conversion & decompose
convert_simplex(::Type{T}, x::T) where T = (x,)
function convert_simplex(NFT:... | [
2235,
198,
2,
42044,
2779,
31754,
82,
198,
14881,
13,
2302,
260,
2611,
7,
19795,
1800,
3712,
10082,
15748,
23828,
1800,
8,
796,
357,
39504,
7,
19795,
1800,
828,
5415,
7,
19795,
1800,
4008,
198,
8818,
9647,
82,
7,
87,
3712,
23839,
17... | 2.178564 | 4,693 |
abstract type AvgFidelityMetric
end
convert(t::Type{T},x::AvgFidelityMetric) where {T<:Real} = x.val
promote_rule(t::Type{T},r::Type{R}) where {T<:AvgFidelityMetric,R<:Real} = promote_rule(Float64,R)
"""
AvgFidelity(f;dim=2)
"""
struct AvgFidelity <: AvgFidelityMetric
dim::Int64
val::Float64
AvgFidelity(f;dim... | [
397,
8709,
2099,
33455,
37,
23091,
9171,
1173,
220,
198,
198,
437,
198,
198,
1102,
1851,
7,
83,
3712,
6030,
90,
51,
5512,
87,
3712,
48997,
37,
23091,
9171,
1173,
8,
810,
1391,
51,
27,
25,
15633,
92,
796,
2124,
13,
2100,
198,
16963... | 2.232987 | 867 |
<gh_stars>0
@testset "Misc/NumberField" begin
@testset "is_subfield" begin
Qx, x = FlintQQ["x"]
K, a = NumberField(x^2 + 1, "a")
L, b = NumberField(x^4 + 1, "b")
c, KtoL = is_subfield(K, L)
@test c == true
@test parent(KtoL(a)) == L
c, KtoL = Hecke.is_subfield_normal(K, L)
@test c ==... | [
27,
456,
62,
30783,
29,
15,
198,
31,
9288,
2617,
366,
44,
2304,
14,
15057,
15878,
1,
2221,
198,
220,
2488,
9288,
2617,
366,
271,
62,
7266,
3245,
1,
2221,
198,
220,
220,
220,
1195,
87,
11,
2124,
796,
21660,
48,
48,
14692,
87,
897... | 1.941392 | 546 |
############################################################
# Devuelve el índice de tantos cromosomas a buscar
############################################################
"""
IndiceCromosomasProbabilidad(tamaño, porcentaje_seleccion, valores)
Devuelve lista con los índices a mutar
Tamaño es el tamaño de los c... | [
29113,
14468,
7804,
4242,
198,
2,
220,
6245,
2731,
303,
1288,
6184,
255,
358,
501,
390,
24246,
418,
269,
398,
418,
16911,
257,
1323,
7718,
220,
198,
29113,
14468,
7804,
4242,
198,
37811,
198,
220,
220,
220,
1423,
501,
34,
398,
418,
... | 2.802419 | 248 |
"""
A quick and dirty module for retrieving private leaderboard data from AoC.
"""
module Leaderboard
using Dates
using Downloads
using JSON
using DataFrames
function __init__()
get_data()
end
function get_data()
url = "https://adventofcode.com/2020/leaderboard/private/view/213962.json"
file = Downloads.... | [
37811,
198,
32,
2068,
290,
11841,
8265,
329,
50122,
2839,
3554,
3526,
1366,
422,
27378,
34,
13,
198,
37811,
198,
21412,
10540,
3526,
198,
198,
3500,
44712,
198,
3500,
50093,
198,
3500,
19449,
198,
3500,
6060,
35439,
198,
198,
8818,
1159... | 2.536261 | 979 |
<reponame>santiagobadia/GridapGeosciences<filename>test/mpi/LaplaceBeltramiCubedSphereTests.jl
module LaplaceBeltramiCubedSphereTestsMPI
using PartitionedArrays
using Test
using FillArrays
using Gridap
using GridapPETSc
using GridapGeosciences
include("../ConvergenceAnalysisTools.jl")
include("../Lapla... | [
27,
7856,
261,
480,
29,
82,
17096,
363,
672,
29523,
14,
41339,
499,
10082,
418,
979,
3007,
27,
34345,
29,
9288,
14,
3149,
72,
14,
14772,
5372,
33,
2120,
859,
72,
43632,
276,
38882,
51,
3558,
13,
20362,
198,
21412,
4689,
5372,
33,
... | 1.953488 | 860 |
struct S a; b end
struct S c; d end
| [
198,
7249,
311,
257,
26,
275,
886,
198,
7249,
311,
269,
26,
288,
886,
198
] | 2.466667 | 15 |
using Test
using BenchmarkTools
include("../src/Parsers.jl")
# Generates data for the Lorenz system.
ds = LorenzSystem()
data = datagen(ds)
# Generates data for a lotka volterra model
ds = LotkaVolterra()
data = datagen(ds)
# Generates data for a first order linear ODE
ds = ODE1()
data = datagen(ds)
# Generates da... | [
3500,
6208,
198,
3500,
25187,
4102,
33637,
198,
198,
17256,
7203,
40720,
10677,
14,
47,
945,
364,
13,
20362,
4943,
198,
198,
2,
2980,
689,
1366,
329,
262,
15639,
27305,
1080,
13,
198,
9310,
796,
15639,
27305,
11964,
3419,
198,
7890,
7... | 2.848837 | 172 |
# fbp/z-test.jl
using Test: @test
@test cuboid_im(:test)
@test disk_phantom_params(:test)
@test ellipse_im(:test)
@test ellipsoid_im(:test)
@test ellipse_sino(:test)
@test image_geom(:test)
@test rect_im(:test)
@test rect_sino(:test)
@test rotate2d(:test)
@test sino_geom_test()
| [
2,
277,
46583,
14,
89,
12,
9288,
13,
20362,
198,
198,
3500,
6208,
25,
2488,
9288,
198,
198,
31,
9288,
13617,
1868,
62,
320,
7,
25,
9288,
8,
198,
31,
9288,
11898,
62,
746,
11456,
62,
37266,
7,
25,
9288,
8,
198,
31,
9288,
30004,
... | 2.112782 | 133 |
"""
solve(H::AbstractHomotopy{T}, startvalue::Vector{T}, [algorithm,] endgame_start=0.1, kwargs...)
Track the path ``x(t)`` implicitly defined by ``H(x(t),t)`` from `t=1` to `t=0` where
`x(1)=startvalue`. Returns a [`Result`](@ref) instance.
It uses the defined `algorihm` for the prediction and correction step.
I... | [
37811,
198,
220,
220,
220,
8494,
7,
39,
3712,
23839,
28718,
313,
11081,
90,
51,
5512,
923,
8367,
3712,
38469,
90,
51,
5512,
685,
282,
42289,
11,
60,
886,
6057,
62,
9688,
28,
15,
13,
16,
11,
479,
86,
22046,
23029,
198,
198,
24802,
... | 2.471791 | 2,446 |
using BenchmarkTools
using PkgBenchmark
using TextStylometry
# Define a parent BenchmarkGroup to contain our suite
const SUITE = BenchmarkGroup()
SUITE["SimpleDocument"] = BenchmarkGroup(["english", "japanese"])
SUITE["ComplexityDocument"] = BenchmarkGroup(["english", "japanese"])
test_file = "test_corpus.txt"
SUIT... | [
3500,
25187,
4102,
33637,
198,
3500,
350,
10025,
44199,
4102,
198,
198,
3500,
8255,
18716,
75,
15748,
198,
198,
2,
2896,
500,
257,
2560,
25187,
4102,
13247,
284,
3994,
674,
18389,
198,
9979,
13558,
12709,
796,
25187,
4102,
13247,
3419,
... | 3.165563 | 151 |
# ---
# title: 565. Array Nesting
# id: problem565
# author: Indigo
# date: 2021-06-26
# difficulty: Medium
# categories: Array
# link: <https://leetcode.com/problems/array-nesting/description/>
# hidden: true
# ---
#
# A zero-indexed array A of length N contains all integers from 0 to N-1. Find
# and return the longe... | [
2,
11420,
198,
2,
3670,
25,
642,
2996,
13,
15690,
21420,
278,
198,
2,
4686,
25,
1917,
47372,
198,
2,
1772,
25,
40673,
198,
2,
3128,
25,
33448,
12,
3312,
12,
2075,
198,
2,
8722,
25,
13398,
198,
2,
9376,
25,
15690,
198,
2,
2792,
... | 2.169399 | 732 |
##################################################
# Use this file to compute the diffusion coefficients
# Use the cluster model given in the "sources" folder
# Use the following command to get truncated quantities up to lmax = 10
# julia Compute.jl --lmax 10
##################################################
include... | [
29113,
14468,
2235,
198,
2,
5765,
428,
2393,
284,
24061,
262,
44258,
44036,
198,
2,
5765,
262,
13946,
2746,
1813,
287,
262,
366,
82,
2203,
1,
9483,
198,
198,
2,
5765,
262,
1708,
3141,
284,
651,
40122,
515,
17794,
510,
284,
300,
9806... | 3.484 | 250 |
# ============================================================
# Mirroring Functions
# ============================================================
function bc_mirror!(
ctr::AbstractMatrix{T},
ng = 1::Integer;
dirc,
) where {T<:AbstractControlVolume2D}
if Symbol(dirc) in (:xl, :xL)
for j in ax... | [
2,
46111,
4770,
2559,
18604,
198,
2,
17918,
278,
40480,
198,
2,
46111,
4770,
2559,
18604,
198,
198,
8818,
47125,
62,
10793,
1472,
0,
7,
198,
220,
220,
220,
269,
2213,
3712,
23839,
46912,
90,
51,
5512,
198,
220,
220,
220,
23370,
796,... | 1.662083 | 1,527 |
<reponame>Planheat/Planheat-Tool
module individual_heating_and_cooling
using JuMP
using Cbc
using Clp
using CSV
using DelimitedFiles
csv_sep = ','
function individual_H_and_C(input_folder, output_folder, tech_infos, building_id, print_function = print)
# example_file = readdlm(string(... | [
27,
7856,
261,
480,
29,
20854,
25080,
14,
20854,
25080,
12,
25391,
198,
21412,
1981,
62,
258,
803,
62,
392,
62,
24494,
278,
628,
220,
220,
220,
1262,
12585,
7378,
198,
220,
220,
220,
1262,
327,
15630,
198,
220,
220,
220,
1262,
1012,... | 1.981918 | 14,877 |
zerolike(x::Number) = zero(x)
zerolike(x::Tuple) = zerolike.(x)
@generated function zerolike(x::T) where T
length(fieldnames(T)) == 0 ? nothing :
:(NamedTuple{$(fieldnames(T))}(($(map(f -> :(zerolike(x.$f)), fieldnames(T))...),)))
end
# TODO figure out why this made a test fail
zerolike(x::Union{Module,Type}) = n... | [
9107,
349,
522,
7,
87,
3712,
15057,
8,
796,
6632,
7,
87,
8,
198,
9107,
349,
522,
7,
87,
3712,
51,
29291,
8,
796,
1976,
263,
349,
522,
12195,
87,
8,
198,
198,
31,
27568,
2163,
1976,
263,
349,
522,
7,
87,
3712,
51,
8,
810,
309... | 2.296241 | 1,330 |
<reponame>JuliaTagBot/AuditoryBistabilityLE
using Parameters
using Unitful: s, ms, ustrip
# question: should we somehow limit the unit response???
# e.g. with:
sig(x) = 1/(1+exp(-10(x-0.5)))
@with_kw struct AdaptMI{S,I}
c_x::Float64 = 1.0
τ_x::typeof(1.0s) = 300ms
shape_y::S = identity
c_a::Float64 = 5
τ_... | [
27,
7856,
261,
480,
29,
16980,
544,
24835,
20630,
14,
16353,
37765,
33,
396,
1799,
2538,
198,
3500,
40117,
198,
3500,
11801,
913,
25,
264,
11,
13845,
11,
334,
36311,
198,
198,
2,
1808,
25,
815,
356,
7599,
4179,
262,
4326,
2882,
2835... | 2.162715 | 1,223 |
<reponame>openwonk/echo
function +(a::String, b::String)
a * b
end
function Echo(port)
# port = 8080
server = listen(port)
println("listen @ " + string(port))
while true
conn = accept(server)
@async begin
try
while true
incoming = readline(conn)
print("> ", incoming)
write(conn, incomin... | [
27,
7856,
261,
480,
29,
9654,
26502,
74,
14,
30328,
198,
8818,
1343,
7,
64,
3712,
10100,
11,
275,
3712,
10100,
8,
198,
197,
64,
1635,
275,
198,
437,
198,
198,
8818,
21455,
7,
634,
8,
198,
197,
2,
2493,
796,
4019,
1795,
198,
197,... | 2.263636 | 220 |
# Julia translation of http://nbviewer.jupyter.org/github/barbagroup/AeroPython/blob/master/lessons/01_Lesson01_sourceSink.ipynb
# Lession 2 Source and Sink in a Freestream
using PyPlot
using Distributions
close("all")
meshgrid(x,y) = (repmat(x',length(y),1),repmat(y,1,length(x)))
N = 200 ... | [
2,
22300,
11059,
286,
2638,
1378,
46803,
1177,
263,
13,
73,
929,
88,
353,
13,
2398,
14,
12567,
14,
5657,
21454,
3233,
14,
32,
3529,
37906,
14,
2436,
672,
14,
9866,
14,
1203,
684,
14,
486,
62,
22058,
261,
486,
62,
10459,
50,
676,
... | 2.359756 | 1,968 |
<reponame>aaronpeikert/Semi.jl
@testset "Nodes" begin
@test typeof(Node(:a)) <: Node
end
@testset "Edges" begin
@test Edge(Node(:a), Node(:b)) == Edge(Node(:a), Node(:b)) == DirectedEdge(SimpleNode(:a), SimpleNode(:b))
end
# define modifier
struct Weight <: EdgeModifier end
@testset "ModifedNode" begin
@... | [
27,
7856,
261,
480,
29,
64,
8045,
431,
1134,
861,
14,
13900,
72,
13,
20362,
198,
31,
9288,
2617,
366,
45,
4147,
1,
2221,
198,
220,
220,
220,
2488,
9288,
2099,
1659,
7,
19667,
7,
25,
64,
4008,
1279,
25,
19081,
198,
437,
198,
198,... | 2.548701 | 308 |
<reponame>JeremyRueffer/ClimateDataIO.jl
# str_load.jl
#
# <NAME>
# Thünen Institut
# Institut für Agrarklimaschutz
# Junior Research Group NITROSPHERE
# Julia 1.6.0
# 16.12.2016
# Last Edit: 07.07.2021
"""# str_load
Load data from Aerodye STR files generated by TDLWintel
---
### Examples
`time,D = str_load(\"K:\\... | [
27,
7856,
261,
480,
29,
35623,
49,
518,
36761,
14,
37649,
6601,
9399,
13,
20362,
198,
2,
965,
62,
2220,
13,
20362,
198,
2,
198,
2,
1279,
20608,
29,
198,
2,
536,
9116,
38572,
37931,
315,
198,
2,
37931,
315,
277,
25151,
317,
2164,
... | 2.398734 | 3,002 |
<reponame>oralb/Cropbox.jl<gh_stars>1-10
using DataStructures: OrderedDict
import DataFrames
using StatsBase: StatsBase, mean
import Random
import BlackBoxOptim
metricfunc(metric::Symbol) = begin
if metric == :rmse
(E, O) -> √mean((E .- O).^2)
elseif metric == :nrmse
(E, O) -> √mean((E .- O).^2... | [
27,
7856,
261,
480,
29,
6864,
65,
14,
34,
1773,
3524,
13,
20362,
27,
456,
62,
30783,
29,
16,
12,
940,
198,
3500,
6060,
44909,
942,
25,
14230,
1068,
35,
713,
198,
11748,
6060,
35439,
198,
3500,
20595,
14881,
25,
20595,
14881,
11,
1... | 2.455922 | 2,575 |
<reponame>UnofficialJuliaMirror/Merlin.jl-80f3d04f-b880-5e6d-8e06-6a7e799169ac<gh_stars>100-1000
export elu
doc"""
elu(x::Var)
Exponential Linear Unit.
# References
* Clevert et al., ["Fast and Accurate Deep Network Learning by Exponential Linear Units (ELUs)"](https://arxiv.org/abs/1511.07289), arXiv 2015.
```... | [
27,
7856,
261,
480,
29,
3118,
16841,
16980,
544,
27453,
1472,
14,
13102,
2815,
13,
20362,
12,
1795,
69,
18,
67,
3023,
69,
12,
65,
41655,
12,
20,
68,
21,
67,
12,
23,
68,
3312,
12,
21,
64,
22,
68,
45455,
22172,
330,
27,
456,
62,... | 2.027972 | 429 |
module test_suite
using DomainSets, BasisFunctions, FrameFun, StaticArrays, FastTransforms
using Test, Printf, LinearAlgebra, Random
FE = FrameFun
BA = BasisFunctions
## Settings
# Test fourier extensions for all parameters
Extensive = false
# Show matrix vector product timings
const show_mv_times = false
const ve... | [
21412,
1332,
62,
2385,
578,
198,
198,
3500,
20021,
50,
1039,
11,
6455,
271,
24629,
2733,
11,
25184,
24629,
11,
36125,
3163,
20477,
11,
12549,
8291,
23914,
198,
3500,
6208,
11,
12578,
69,
11,
44800,
2348,
29230,
11,
14534,
198,
198,
15... | 1.903048 | 4,528 |
<gh_stars>0
# This file was generated by the Julia Swagger Code Generator
# Do not modify this file directly. Modify the swagger specification instead.
mutable struct UsageName <: SwaggerModel
value::Any # spec type: Union{ Nothing, String } # spec name: value
localizedValue::Any # spec type: Union{ Nothing,... | [
27,
456,
62,
30783,
29,
15,
198,
2,
770,
2393,
373,
7560,
416,
262,
22300,
2451,
7928,
6127,
35986,
198,
2,
2141,
407,
13096,
428,
2393,
3264,
13,
3401,
1958,
262,
1509,
7928,
20855,
2427,
13,
628,
198,
198,
76,
18187,
2878,
29566,
... | 3.087146 | 459 |
abstract type GraphvizPoperties end
mutable struct Property{T}
key::String
value::T
end
const Properties = Vector{Property}
# return val of attribute:
function val(attributes::Properties, attribute::String)
if !isempty(attributes)
for a in attributes
if a.key == attribute
... | [
198,
198,
397,
8709,
2099,
29681,
85,
528,
16979,
861,
444,
886,
198,
198,
76,
18187,
2878,
14161,
90,
51,
92,
198,
220,
220,
220,
1994,
3712,
10100,
198,
220,
220,
220,
1988,
3712,
51,
198,
437,
628,
198,
9979,
24946,
796,
20650,
... | 2.533929 | 560 |
"""
canonicaldomain([ctype::CanonicalType, ]d::Domain)
Return an associated canonical domain, if any, of the given domain.
For example, the canonical domain of an Interval `[a,b]` is the interval `[-1,1]`.
Optionally, a canonical type argument may specify an alternative canonical domain.
Canonical domains help ... | [
198,
37811,
198,
220,
220,
220,
40091,
27830,
26933,
310,
2981,
3712,
6090,
261,
605,
6030,
11,
2361,
67,
3712,
43961,
8,
198,
198,
13615,
281,
3917,
40091,
7386,
11,
611,
597,
11,
286,
262,
1813,
7386,
13,
198,
198,
1890,
1672,
11,... | 2.864785 | 1,701 |
<filename>julia/client.jl
#!/usr/bin/env julia
using Gtk
using Requests
import Requests: post
const server = "http://localhost"
bld = @GtkBuilder(filename="../global/ui.glade")
win = GAccessor.object(bld, "appWindow")
btn = GAccessor.object(bld, "sendButton")
ibuff = GAccessor.object(bld, "inputBuffer")
obuff = GAcc... | [
27,
34345,
29,
73,
43640,
14,
16366,
13,
20362,
198,
2,
48443,
14629,
14,
8800,
14,
24330,
474,
43640,
198,
198,
3500,
402,
30488,
198,
3500,
9394,
3558,
198,
11748,
9394,
3558,
25,
1281,
198,
198,
9979,
4382,
796,
366,
4023,
1378,
... | 2.454839 | 310 |
Pkg.add("Cairo")
Pkg.add("Luxor")
Pkg.add("ProgressMeter")
Pkg.add("ForwardDiff")
Pkg.add("FFTW")
Pkg.add("Zygote")
Pkg.add("DataStructures")
Pkg.add("StatsBase")
Pkg.add(Pkg.PackageSpec(name="CuArrays", version="1.7.3"))
Pkg.add("CuArrays")
Pkg.add("Flux")
Pkg.add(["CUDAdrv", "CUDAnative", "CuArrays"])
Pkg.test(["CUDA... | [
47,
10025,
13,
2860,
7203,
34,
18131,
4943,
198,
47,
10025,
13,
2860,
7203,
43,
2821,
273,
4943,
198,
47,
10025,
13,
2860,
7203,
32577,
44,
2357,
4943,
198,
47,
10025,
13,
2860,
7203,
39746,
28813,
4943,
198,
47,
10025,
13,
2860,
72... | 2.262931 | 464 |
module ReactiveMPModelsGMMTest
using Test, InteractiveUtils
using Rocket, ReactiveMP, GraphPPL, Distributions
using BenchmarkTools, Random, Plots, Dates, LinearAlgebra
using StableRNGs
## Model definition
## -------------------------------------------- ##
@model [ default_factorisation = MeanField() ] function univar... | [
21412,
797,
5275,
7378,
5841,
1424,
38,
12038,
14402,
198,
198,
3500,
6208,
11,
21365,
18274,
4487,
198,
3500,
16920,
11,
797,
5275,
7378,
11,
29681,
47,
6489,
11,
46567,
507,
198,
3500,
25187,
4102,
33637,
11,
14534,
11,
1345,
1747,
... | 2.165782 | 5,465 |
const SIDE_COEF_SQUARE = 1 / 2
const SIDE_COEF_CIRCLE = 1 / sqrt(pi)
const SIDE_COEF_DIAMOND = sqrt(2) / 2
const SIDE_COEF_TRIANGLE = sqrt(2 / (3 * sqrt(3 / 2)))
const SIDE_COEF_PENTAGON = sqrt(2 / (5 * sin(1.2566)))
const SIDE_COEF_HEXAGON = sqrt(2 / (6 * sin(1.0472)))
const SIDE_COEF_OCTAGON = sqrt(2 / (8 * sin(0.785... | [
9979,
311,
14114,
62,
8220,
25425,
62,
50,
10917,
12203,
796,
352,
1220,
362,
198,
9979,
311,
14114,
62,
8220,
25425,
62,
34,
4663,
29931,
796,
352,
1220,
19862,
17034,
7,
14415,
8,
198,
9979,
311,
14114,
62,
8220,
25425,
62,
17931,
... | 2.103704 | 1,485 |
<filename>analog_transmisson/am_fft.jl<gh_stars>0
using Plots,FFTW
using JLD2
for (ind, arg) in enumerate(ARGS)
t = typeof(arg)
msg = "$(ind) -> $arg :$t"
println(msg)
end
function sqaure_windowing_signal(signal::Array{Float64})
windowed_signal = signal
window_correction_factor = 1
return (win... | [
27,
34345,
29,
272,
11794,
62,
7645,
3927,
261,
14,
321,
62,
487,
83,
13,
20362,
27,
456,
62,
30783,
29,
15,
198,
3500,
1345,
1747,
11,
5777,
34551,
198,
3500,
449,
11163,
17,
198,
198,
1640,
357,
521,
11,
1822,
8,
287,
27056,
3... | 2.270544 | 791 |
<filename>src/types.jl
abstract type AbstractCoarsening end
abstract type AbstractAlgebraicCoarsening <: AbstractCoarsening end
abstract type AbstractStrength end
| [
27,
34345,
29,
10677,
14,
19199,
13,
20362,
198,
198,
397,
8709,
2099,
27741,
7222,
945,
3101,
886,
198,
198,
397,
8709,
2099,
27741,
2348,
29230,
291,
7222,
945,
3101,
1279,
25,
27741,
7222,
945,
3101,
886,
198,
198,
397,
8709,
2099,... | 3.608696 | 46 |
<filename>src/services/rds_data.jl
# This file is auto-generated by AWSMetadata.jl
using AWS
using AWS.AWSServices: rds_data
using AWS.Compat
using AWS.UUIDs
"""
BatchExecuteStatement()
Runs a batch SQL statement over an array of data. You can run bulk update and insert operations for multiple records using a DML... | [
27,
34345,
29,
10677,
14,
30416,
14,
4372,
82,
62,
7890,
13,
20362,
198,
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,
374,
9310,
62,
7890... | 3.421033 | 2,710 |
using Documenter
using TensorPolynomialBases
makedocs(
sitename = "TensorPolynomialBases.jl",
format = Documenter.HTML(),
modules = [TensorPolynomialBases],
pages = ["Home" => "index.md","API"=>"pages/api.md"]
)
# Documenter can also automatically deploy documentation to gh-pages.
# See "Hosting Docum... | [
3500,
16854,
263,
198,
3500,
309,
22854,
34220,
26601,
498,
33,
1386,
198,
198,
76,
4335,
420,
82,
7,
198,
220,
220,
220,
1650,
12453,
796,
366,
51,
22854,
34220,
26601,
498,
33,
1386,
13,
20362,
1600,
198,
220,
220,
220,
5794,
796,... | 2.854749 | 179 |
using Documenter, MOONS
# https://github.com/jheinen/GR.jl/issues/278#issuecomment-587090846
ENV["GKSwstype"] = "nul"
mathengine = MathJax(Dict(
:TeX => Dict(
:equationNumbers => Dict(:autoNumber => "AMS"),
:Macros => Dict(),
),
))
format = Documenter.HTML(
prettyurls = get(ENV, "CI", "") ... | [
3500,
16854,
263,
11,
13070,
19213,
198,
2,
3740,
1378,
12567,
13,
785,
14,
73,
258,
42326,
14,
10761,
13,
20362,
14,
37165,
14,
25870,
2,
21949,
23893,
12,
3365,
31495,
2919,
3510,
198,
1677,
53,
14692,
38,
42,
10462,
301,
2981,
89... | 2.056723 | 476 |
function action_matrix(a::Vector{Int}, num_actions::Int)
n = length(a)
A = zeros(num_actions, n)
for i in 1:n
A[a[i], i] = 1.0
end
return A
end
"""
NeuralEncoder(d_int::Int64, d_out::Int64, layer_sizes::Vector{Int64})
Construct a callable object that returns the final layer activations... | [
8818,
2223,
62,
6759,
8609,
7,
64,
3712,
38469,
90,
5317,
5512,
997,
62,
4658,
3712,
5317,
8,
198,
220,
220,
220,
299,
796,
4129,
7,
64,
8,
198,
220,
220,
220,
317,
796,
1976,
27498,
7,
22510,
62,
4658,
11,
299,
8,
198,
220,
2... | 2.039569 | 3,159 |
export
orthocomp,
pdet_maker,
bin2
function orthocomp(m)
U, S, V = PolyLib.smith_normal_form(m)
return lll(PolyLib.inverse(V)[:, size(m)[1]+1:end])[1]
end
nonneg(v) = all(v.>=0) ? true : false
function unequal_sample_maker(p)
perm = sortperm(p, rev=true)
p0 = p[perm]
for i=1:length(p0... | [
39344,
198,
220,
220,
220,
29617,
420,
3361,
11,
198,
220,
220,
220,
279,
15255,
62,
10297,
11,
198,
220,
220,
220,
9874,
17,
198,
198,
8818,
29617,
420,
3361,
7,
76,
8,
198,
220,
220,
220,
471,
11,
311,
11,
569,
796,
12280,
258... | 1.778252 | 469 |
# To ensure that tests can run on travis we have to do a little
# hackadoodle here. The tests require a license file. We include
# a license file that is only valid for one day (the day when
# change is submitted).
# If there is no valid license file, we default to that file.
using Test
using MathOptInterface
const M... | [
2,
1675,
4155,
326,
5254,
460,
1057,
319,
1291,
4703,
356,
423,
284,
466,
257,
1310,
198,
2,
8156,
324,
27106,
994,
13,
383,
5254,
2421,
257,
5964,
2393,
13,
775,
2291,
198,
2,
257,
5964,
2393,
326,
318,
691,
4938,
329,
530,
1110,... | 2.237995 | 4,748 |
### A Pluto.jl notebook ###
# v0.14.7
using Markdown
using InteractiveUtils
# ╔═╡ e7af1703-0873-4b3f-8b8f-a8a2c874bcb1
begin
using PlutoUI, LinearAlgebra, Distributions, SparseArrays
import Random
end
# ╔═╡ cf46a0fe-43a4-4b6a-b4f8-a0c5fb4e9f03
# For binder, uncomment this cell ...
#=
begin
import Pkg
Pkg.acti... | [
21017,
317,
32217,
13,
20362,
20922,
44386,
198,
2,
410,
15,
13,
1415,
13,
22,
198,
198,
3500,
2940,
2902,
198,
3500,
21365,
18274,
4487,
198,
198,
2,
2343,
243,
242,
28670,
22880,
94,
304,
22,
1878,
1558,
3070,
12,
2919,
4790,
12,
... | 1.568054 | 2,836 |
# TODO: maybe we should get rid of the LearningRate abstraction, make it a number,
# and then allow sub-learner(s) in the GradientLearner to update the learning rate?
immutable FixedLR <: LearningRate
lr::Float64
end
value(lr::FixedLR) = lr.lr
update!(lr::FixedLR, err) = lr
# ----------------------------------... | [
198,
2,
16926,
46,
25,
3863,
356,
815,
651,
5755,
286,
262,
18252,
32184,
34651,
11,
787,
340,
257,
1271,
11,
198,
2,
220,
220,
290,
788,
1249,
850,
12,
3238,
1008,
7,
82,
8,
287,
262,
17701,
1153,
14961,
1008,
284,
4296,
262,
4... | 2.443459 | 451 |
<gh_stars>1-10
import NLPModelsKnitro: knitro
#Check https://github.com/JuliaSmoothOptimizers/NLPModelsKnitro.jl/blob/master/src/NLPModelsKnitro.jl
#=
*General options*
algorithm: Indicates which algorithm to use to solve the problem
blasoption: Specifies the BLAS/LAPACK function library to use for basic vector
... | [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
11748,
399,
19930,
5841,
1424,
25095,
270,
305,
25,
30495,
305,
198,
2,
9787,
3740,
1378,
12567,
13,
785,
14,
16980,
544,
7556,
5226,
27871,
320,
11341,
14,
45,
19930,
5841,
1424,
25095,
270... | 2.689797 | 2,911 |
function U1_strip_harper_hofstadter(width;flux=pi/2,Jx=1,Jy=1,periodic=false,filling=1)
#we change the charge of the first site (c - filling), imposing a filling/width
ps1 = Rep[U₁](-filling=>1,(1-filling)=>1);
ps2 = Rep[U₁](0=>1,1=>1);
ou = oneunit(ps1);
#pspaces[i] = physical space at location i... | [
8818,
471,
16,
62,
36311,
62,
9869,
525,
62,
39891,
24107,
353,
7,
10394,
26,
69,
22564,
28,
14415,
14,
17,
11,
41,
87,
28,
16,
11,
41,
88,
28,
16,
11,
41007,
291,
28,
9562,
11,
69,
4509,
28,
16,
8,
198,
220,
220,
220,
1303,... | 1.773585 | 1,166 |
using GPUArrays
using Base.Test, GPUArrays.TestSuite
# It's kind of annoying to make FillArrays only a test dependency
# so for texting the conversion to GPUArrays of shaped iterators,
# I just copied the core types from FillArrays:s
abstract type AbstractFill{T, N} <: AbstractArray{T, N} end
@inline function Base.... | [
3500,
11362,
3163,
20477,
198,
3500,
7308,
13,
14402,
11,
11362,
3163,
20477,
13,
14402,
5606,
578,
628,
198,
198,
2,
632,
338,
1611,
286,
15774,
284,
787,
27845,
3163,
20477,
691,
257,
1332,
20203,
198,
2,
523,
329,
36634,
262,
11315... | 1.760678 | 2,950 |
<gh_stars>10-100
using SparseArrays
function edge_values(space, m)
rs = refspace(space)
supp = geometry(space)
edgs = skeleton(supp,1)
Conn = copy(transpose(connectivity(edgs, supp, identity)))
Vals = zeros(scalartype(space), length(supp), length(edgs))
for (i,sh) in enumerate(space.fns[m])
... | [
27,
456,
62,
30783,
29,
940,
12,
3064,
198,
3500,
1338,
17208,
3163,
20477,
198,
198,
8818,
5743,
62,
27160,
7,
13200,
11,
285,
8,
198,
220,
220,
220,
44608,
796,
1006,
13200,
7,
13200,
8,
198,
220,
220,
220,
802,
796,
22939,
7,
... | 1.87519 | 657 |
function Base.rand(rng::AbstractRNG, d::GrayBox.Environment)
# Sample from each distribution in the dictionary
# (similar to <NAME>'s CrossEntropyMethod.jl)
sample = GrayBox.EnvironmentSample()
for k in keys(d)
value = rand(rng, d[k])
logprob = logpdf(d[k], value)
sample[k] = Gra... | [
8818,
7308,
13,
25192,
7,
81,
782,
3712,
23839,
49,
10503,
11,
288,
3712,
46130,
14253,
13,
31441,
8,
198,
220,
220,
220,
1303,
27565,
422,
1123,
6082,
287,
262,
22155,
198,
220,
220,
220,
1303,
357,
38610,
284,
1279,
20608,
29,
6,
... | 2.664975 | 197 |
<reponame>krislock/IR-FISTA
#=
using MATLAB
function CorNewton3(G)
@assert issymmetric(G)
n = size(G, 1)
mat"
[$X,$y] = CorNewton3($(Array(G)),ones($n,1),1:$n,1:$n,0.0);
"
return Symmetric(X), y
end
=#
function fronorm(A, work)
lda, n = size(A)
ccall(
(:dlansy_64_, "libopenblas6... | [
27,
7856,
261,
480,
29,
74,
2442,
5354,
14,
4663,
12,
37,
1797,
5603,
198,
2,
28,
198,
3500,
36775,
48780,
198,
8818,
2744,
3791,
1122,
18,
7,
38,
8,
198,
220,
220,
220,
2488,
30493,
1189,
26621,
19482,
7,
38,
8,
198,
220,
220,
... | 1.609576 | 543 |
<reponame>mauriciogtec/dlgo.jl
function features(board::Board)
black_stones = zeros(Int, board.num_rows, board.num_cols)
white_stones = zeros(Int, board.num_rows, board.num_cols)
for r in 1:board.num_rows
for c in 1:board.num_cols
if board[r, c].color === black
black_ston... | [
27,
7856,
261,
480,
29,
2611,
333,
44070,
519,
36281,
14,
25404,
2188,
13,
20362,
198,
8818,
3033,
7,
3526,
3712,
29828,
8,
198,
220,
220,
220,
2042,
62,
28750,
796,
1976,
27498,
7,
5317,
11,
3096,
13,
22510,
62,
8516,
11,
3096,
1... | 2.098701 | 385 |
export PCAICA, PCA #, FA
ica() = MultivariateStats.ICA(Array{Float64,1}(),
Array{Float64,2}(undef,0,0))
pca() = MultivariateStats.PCA(Array{Float64,1}(),
Array{Float64,2}(undef,0,0),
Array{Float64,1}(),
... | [
39344,
4217,
32,
25241,
11,
4217,
32,
1303,
11,
9677,
198,
198,
3970,
3419,
796,
7854,
42524,
29668,
13,
25241,
7,
19182,
90,
43879,
2414,
11,
16,
92,
22784,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
22... | 2.129191 | 1,014 |
<gh_stars>100-1000
"""
Thread-safe logging.
"""
module Log
import Base.Threads.threadid
# logging levels in increasing verbosity
@enum LogLevel ERROR WARN INFO DEBUG
const LEVEL = Ref{LogLevel}(INFO)
const VERBOSE = Ref{Bool}(true) # print stack traces from errors
# Rank for multinode functionality (can be set on ... | [
27,
456,
62,
30783,
29,
3064,
12,
12825,
198,
37811,
198,
16818,
12,
21230,
18931,
13,
198,
37811,
198,
21412,
5972,
198,
198,
11748,
7308,
13,
16818,
82,
13,
16663,
312,
198,
198,
2,
18931,
2974,
287,
3649,
15942,
16579,
198,
31,
4... | 2.521902 | 799 |
@testset "Inverse" begin
for z ∈ Zs
@test z * inv(z) ≈ inv(z) * z ≈ 1v
end
end
| [
31,
9288,
2617,
366,
818,
4399,
1,
2221,
198,
220,
220,
220,
329,
1976,
18872,
230,
1168,
82,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
1976,
1635,
800,
7,
89,
8,
15139,
230,
800,
7,
89,
8,
1635,
1976,
15139,
230,
352,... | 1.759259 | 54 |
<reponame>KristofferC/Pkg.jl
#!/usr/bin/env julia
function write_toml(f::Function, names::String...)
path = joinpath(names...) * ".toml"
mkpath(dirname(path))
open(path, "w") do io
f(io)
end
end
toml_key(str::String) = ismatch(r"[^\w-]", str) ? repr(str) : str
toml_key(strs::String...) = join(... | [
27,
7856,
261,
480,
29,
40756,
47895,
34,
14,
47,
10025,
13,
20362,
198,
2,
48443,
14629,
14,
8800,
14,
24330,
474,
43640,
198,
198,
8818,
3551,
62,
39532,
75,
7,
69,
3712,
22203,
11,
3891,
3712,
10100,
23029,
198,
220,
220,
220,
... | 2.163472 | 1,774 |
using VoronoiCells
using Test
@testset "Sort points" begin
@testset "Average point" begin
points = [
GeometryBasics.Point2(1.0, 1.0),
GeometryBasics.Point2(3.0, 3.0)
]
avg_point = VoronoiCells.mean(points)
@test VoronoiCells.mean(points) == GeometryBasics.... | [
3500,
44143,
261,
23013,
34,
19187,
198,
3500,
6208,
628,
198,
31,
9288,
2617,
366,
42758,
2173,
1,
2221,
198,
220,
220,
220,
2488,
9288,
2617,
366,
26287,
966,
1,
2221,
198,
220,
220,
220,
220,
220,
220,
220,
2173,
796,
685,
198,
... | 2.240385 | 312 |
<reponame>tkelman/HDF5.jl
using HDF5
HDF5.init()
include("plain.jl")
include("jld.jl")
include("readremote.jl")
include("extend_test.jl")
include("gc.jl")
include("require.jl")
if Pkg.installed("DataFrames") != nothing
include("jld_dataframe.jl")
end
| [
27,
7856,
261,
480,
29,
83,
7750,
805,
14,
39,
8068,
20,
13,
20362,
198,
3500,
5572,
37,
20,
198,
39,
8068,
20,
13,
15003,
3419,
198,
198,
17256,
7203,
25638,
13,
20362,
4943,
198,
17256,
7203,
73,
335,
13,
20362,
4943,
198,
17256... | 2.485437 | 103 |
<gh_stars>1-10
# This file is part of the Julia package ModularForms.jl
#
# Copyright (c) 2018-2019: <NAME> and <NAME>.
"""
prime_range(n)
Return an array consisting of all primes up to and including `n`.
"""
function prime_range(n::Int)
primes = fill(true, n)
if n == 0
return primes
end
prim... | [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
2,
770,
2393,
318,
636,
286,
262,
22300,
5301,
3401,
934,
8479,
82,
13,
20362,
198,
2,
198,
2,
15069,
357,
66,
8,
2864,
12,
23344,
25,
1279,
20608,
29,
290,
1279,
20608,
28401,
628,
198,... | 2.311005 | 209 |
<gh_stars>0
################################################################################
#
# General utilities
#
################################################################################
export extend, restrict, sz_abc, gaussian_filt, contr2abs, abs2contr, gradprec_contr2abs, gendata, compute_y, proj_bound... | [
27,
456,
62,
30783,
29,
15,
198,
29113,
29113,
14468,
198,
2,
198,
2,
3611,
20081,
198,
2,
198,
29113,
29113,
14468,
628,
198,
39344,
9117,
11,
4239,
11,
264,
89,
62,
39305,
11,
31986,
31562,
62,
69,
2326,
11,
3445,
17,
8937,
11,
... | 2.142762 | 3,012 |
<reponame>UnofficialJuliaMirror/Catalan.jl-a10504cf-72a7-53fd-8489-d9cc60862a4b
using Catalan
using Base.Test
# catalan
@test catalan(5) == 42
@test catalan(30) == BigInt("3814986502092304")
# derangement
@test derangement(4) == 9
@test derangement(24) == BigInt("228250211305338670494289")
# doublefactorial
@test do... | [
27,
7856,
261,
480,
29,
3118,
16841,
16980,
544,
27453,
1472,
14,
39075,
272,
13,
20362,
12,
64,
940,
33580,
12993,
12,
4761,
64,
22,
12,
4310,
16344,
12,
23,
35890,
12,
67,
24,
535,
1899,
4521,
17,
64,
19,
65,
198,
3500,
31066,
... | 2.336207 | 580 |
<filename>src/AppliSales.jl
module AppliSales
using Dates
include("./infrastructure/infrastructure.jl")
export process
end # module
| [
27,
34345,
29,
10677,
14,
4677,
4528,
44490,
13,
20362,
198,
21412,
2034,
4528,
44490,
198,
198,
3500,
44712,
198,
198,
17256,
7,
1911,
14,
10745,
6410,
14,
10745,
6410,
13,
20362,
4943,
198,
198,
39344,
1429,
198,
198,
437,
1303,
826... | 3.162791 | 43 |
<filename>src/utils.jl
"""
gives the ordering for nedelec2 (divergence)
"""
function relorientation(face::SArray{Tuple{3},T,1,3}, tet::SArray{Tuple{4},T,1,4}) where {T}
# v = setdiff(tet,face)
# length(v) == 1 || return 0
# a = something(findfirst(isequal(v[1]), tet),0)
a = findfirst(x -> !(x in face)... | [
27,
34345,
29,
10677,
14,
26791,
13,
20362,
198,
37811,
198,
70,
1083,
262,
16216,
329,
299,
276,
11129,
66,
17,
357,
67,
1428,
12745,
8,
198,
37811,
198,
8818,
823,
13989,
341,
7,
2550,
3712,
50,
19182,
90,
51,
29291,
90,
18,
551... | 2.116918 | 1,129 |
@enum(Kind::UInt16,
NONE, # Placeholder; never emitted by lexer
ENDMARKER, # EOF
COMMENT, # aadsdsa, #= fdsf #=
WHITESPACE, # '\n \t'
IDENTIFIER, # foo, Σxx
AT_SIGN, # @
COMMA, #,
SEMICOLON, # ;
begin_errors,
EOF_MULTICOMMENT,
EOF_CHAR,
INVALID_NUMERIC... | [
31,
44709,
7,
35854,
3712,
52,
5317,
1433,
11,
198,
220,
220,
220,
399,
11651,
11,
220,
220,
220,
220,
220,
1303,
8474,
13829,
26,
1239,
31234,
416,
31191,
263,
198,
220,
220,
220,
23578,
44,
14175,
1137,
11,
1303,
412,
19238,
198,
... | 1.586912 | 37,164 |
<reponame>JuliaDiffEq/DiffEqParamEstim.jl<filename>docs/make.jl<gh_stars>10-100
using Documenter, DiffEqParamEstim
include("pages.jl")
makedocs(
sitename="DiffEqParamEstim.jl",
authors="<NAME> et al.",
clean=true,
doctest=false,
modules=[DiffEqParamEstim],
format=Documenter.HTML(assets=["asse... | [
27,
7856,
261,
480,
29,
16980,
544,
28813,
36,
80,
14,
28813,
36,
80,
22973,
22362,
320,
13,
20362,
27,
34345,
29,
31628,
14,
15883,
13,
20362,
27,
456,
62,
30783,
29,
940,
12,
3064,
198,
3500,
16854,
263,
11,
10631,
36,
80,
22973... | 2.200837 | 239 |
<reponame>nivupai/SampleJuliaProj.jl
module SampleJuliaProj
# Write your package code here.
using Combinatorics
export find_subset
greet() = "Hello World"
greet_random() = "Hello World Random"
# Write your package code here.
export func
"""
func(x)
Returns double the number `x` plus `1`.
"""
func(x) = 2x + 1
... | [
27,
7856,
261,
480,
29,
77,
452,
929,
1872,
14,
36674,
16980,
544,
2964,
73,
13,
20362,
198,
21412,
27565,
16980,
544,
2964,
73,
198,
198,
2,
19430,
534,
5301,
2438,
994,
13,
198,
198,
3500,
955,
8800,
1352,
873,
198,
39344,
1064,
... | 1.987196 | 781 |
# Parallel instance of fwi_objective function # Author: <NAME>, <EMAIL>
# Date: January 2017
#
"""
fwi_objective(model, source, dobs; options=Options())
Evaluate the full-waveform-inversion (reduced state) objective function. Returns a tuple with function value and vectorized \\
gradient. `model` is a `Model` str... | [
2,
42945,
4554,
286,
277,
37686,
62,
15252,
425,
2163,
1303,
6434,
25,
1279,
20608,
22330,
1279,
27630,
4146,
29,
198,
2,
7536,
25,
3269,
2177,
198,
2,
198,
198,
37811,
198,
220,
220,
220,
277,
37686,
62,
15252,
425,
7,
19849,
11,
... | 2.987152 | 467 |
<gh_stars>0
"""
struct ProductSpace{S<:ElementarySpace, N} <: CompositeSpace{S}
A `ProductSpace` is a tensor product space of `N` vector spaces of type
`S<:ElementarySpace`. Only tensor products between [`ElementarySpace`](@ref) objects of the
same type are allowed.
"""
struct ProductSpace{S<:ElementarySpace, N} <... | [
27,
456,
62,
30783,
29,
15,
198,
37811,
198,
220,
220,
220,
2878,
8721,
14106,
90,
50,
27,
25,
20180,
560,
14106,
11,
399,
92,
1279,
25,
49355,
14106,
90,
50,
92,
198,
198,
32,
4600,
15667,
14106,
63,
318,
257,
11192,
273,
1720,
... | 2.406452 | 2,480 |
<reponame>dm13450/LimitOrderBook.jl
using UnicodePlots: barplot
using Base: show, print
"""
Limit Order Book Object
fields:
`bid_orders::OneSideBook` - book of bid orders
`ask_orders::OneSideBook` - book of ask orders
`acct_map::Dict - Dict{Int64,AVLTree{Int64,Order}}` mapping account ids to orders
Init... | [
27,
7856,
261,
480,
29,
36020,
1485,
17885,
14,
39184,
18743,
10482,
13,
20362,
198,
3500,
34371,
3646,
1747,
25,
2318,
29487,
198,
3500,
7308,
25,
905,
11,
3601,
198,
198,
37811,
198,
39184,
8284,
4897,
9515,
198,
198,
25747,
25,
220... | 2.390118 | 4,068 |
module nanoJulia
using Statistics, FASTX, DataFrames, Printf, Formatting, BioAlignments, XAM, Plots, HDF5, CSV, BioSequences
export nanoread, generateStatSummary, plotReadLen2QualScatter,
plotReadLen2QualHistogram2D, readFast5, readFastq, readBAM,
plotReadQual2IdentScatter, plotReadQual2IdentHistogram2D,... | [
21412,
38706,
16980,
544,
198,
3500,
14370,
11,
376,
11262,
55,
11,
6060,
35439,
11,
12578,
69,
11,
18980,
889,
11,
16024,
2348,
570,
902,
11,
1395,
2390,
11,
1345,
1747,
11,
5572,
37,
20,
11,
44189,
11,
16024,
44015,
3007,
198,
393... | 2.161065 | 3,005 |
function johnson_shortest_paths(g::AbstractGraph{U},
distmx::AbstractMatrix{T}=weights(g)) where T <: Real where U <: Integer
nvg = nv(g)
type_distmx = typeof(distmx)
#Change when parallel implementation of Bellman Ford available
wt_transform = bellman_ford_shortest_paths(g, vertices(g), distmx).dists
... | [
8818,
45610,
1559,
62,
19509,
395,
62,
6978,
82,
7,
70,
3712,
23839,
37065,
90,
52,
5512,
198,
17080,
36802,
3712,
23839,
46912,
90,
51,
92,
28,
43775,
7,
70,
4008,
810,
309,
1279,
25,
6416,
810,
471,
1279,
25,
34142,
628,
220,
22... | 2.22805 | 877 |
using ZygoteFFTs
using Test
using FillArrays
using FFTW
using Zygote
function ngradient(f, xs::AbstractArray...)
grads = zero.(xs)
for (x, Δ) in zip(xs, grads), i in 1:length(x)
δ = sqrt(eps())
tmp = x[i]
x[i] = tmp - δ/2
y1 = f(xs...)
x[i] = tmp + δ/2
y2 = f(xs...)
x[i] = tmp
Δ[i] ... | [
3500,
1168,
35641,
1258,
5777,
33758,
198,
3500,
6208,
198,
3500,
27845,
3163,
20477,
198,
3500,
376,
9792,
54,
198,
3500,
1168,
35641,
1258,
198,
198,
8818,
299,
49607,
7,
69,
11,
2124,
82,
3712,
23839,
19182,
23029,
198,
220,
3915,
... | 1.701423 | 3,021 |
<gh_stars>1-10
using StatsBase # for sampling
using Random, Distributions # for continuous HMM
using LinearAlgebra
# Definition of HMM model type
struct HMM
# the states can be string, int, etc.
hidden_state_space::Array{<:Any, 1}
emission_space::Array{<:Any, 1}
initial_distribution::Array{Float6... | [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
3500,
20595,
14881,
220,
220,
220,
1303,
329,
19232,
198,
3500,
14534,
11,
46567,
507,
220,
220,
220,
1303,
329,
12948,
367,
12038,
198,
3500,
44800,
2348,
29230,
198,
198,
2,
30396,
286,
36... | 2.051657 | 7,666 |
using CRRao
using Documenter
DocMeta.setdocmeta!(CRRao, :DocTestSetup, :(using CRRao); recursive=true)
makedocs(;
modules=[CRRao],
authors="xKDR Forum",
repo="https://github.com/xKDR/CRRao.jl/blob/{commit}{path}#{line}",
sitename="CRRao.jl",
format=Documenter.HTML(;
prettyurls=get(ENV, "CI... | [
3500,
8740,
49,
5488,
198,
3500,
16854,
263,
198,
198,
23579,
48526,
13,
2617,
15390,
28961,
0,
7,
9419,
49,
5488,
11,
1058,
23579,
14402,
40786,
11,
36147,
3500,
8740,
49,
5488,
1776,
45115,
28,
7942,
8,
198,
198,
76,
4335,
420,
82... | 2.081967 | 305 |
<reponame>chakravala/AbstractTensors.jl<gh_stars>10-100
using AbstractTensors
using Test, LinearAlgebra, DirectSum
# example data
struct SpecialTensor{V} <: TensorAlgebra{V} end
a,b = SpecialTensor{ℝ}(), SpecialTensor{ℝ'}()
@test ndims(+(a)) == ndims(b)
## tensor operation (trivial test)
op(s::SpecialTensor{V},::Spec... | [
27,
7856,
261,
480,
29,
354,
38004,
2100,
64,
14,
23839,
51,
641,
669,
13,
20362,
27,
456,
62,
30783,
29,
940,
12,
3064,
198,
3500,
27741,
51,
641,
669,
198,
3500,
6208,
11,
44800,
2348,
29230,
11,
4128,
13065,
198,
198,
2,
1672,
... | 2.033088 | 816 |
"""
nlsolve!(nlsolver::NLSolver, nlcache::Union{NLNewtonCache,NLNewtonConstantCache}, integrator)
Perform numerically stable modified Newton iteration that is specialized for implicit
methods (see [^HS96] and [^HW96]).
It solves
```math
G(z) = dt⋅f(tmp + γ⋅z, p, t + c⋅h) - z = 0
```
by iterating
```math
W Δᵏ =... | [
37811,
198,
220,
220,
220,
299,
7278,
6442,
0,
7,
77,
7278,
14375,
3712,
45,
6561,
14375,
11,
299,
75,
23870,
3712,
38176,
90,
32572,
3791,
1122,
30562,
11,
32572,
3791,
1122,
3103,
18797,
30562,
5512,
4132,
12392,
8,
198,
198,
5990,
... | 2.212558 | 2,150 |
"""
Polysegment <: AbstractImageBinarizationAlgorithm
Polysegment()
binarize([T,] img, f::Polysegment)
binarize!([out,] img, f::Polysegment)
Uses the *polynomial segmentation* technique to group the image pixels
into two categories (foreground and background).
# Output
Return the binarized image as ... | [
37811,
198,
220,
220,
220,
12280,
325,
5154,
1279,
25,
27741,
5159,
33,
22050,
1634,
2348,
42289,
198,
220,
220,
220,
12280,
325,
5154,
3419,
628,
220,
220,
220,
9874,
283,
1096,
26933,
51,
11,
60,
33705,
11,
277,
3712,
34220,
325,
... | 2.986092 | 719 |
import .AbstractPaulis: AbstractPaulis, AbstractPauli, is_pauli_y
import ._op_term_macro_helper
import LightGraphs
import .Utils: property_graph, kron_alt, isapprox_zero, triprod, pow_of_minus_one
####
#### Constructors
####
const PauliTerm = OpTerm{Pauli}
const DensePauliTerm = DenseOpTerm{<:AbstractPauli}
const Pau... | [
11748,
764,
23839,
12041,
271,
25,
27741,
12041,
271,
11,
27741,
12041,
72,
11,
318,
62,
79,
2518,
72,
62,
88,
198,
11748,
47540,
404,
62,
4354,
62,
20285,
305,
62,
2978,
525,
198,
11748,
4401,
37065,
82,
198,
11748,
764,
18274,
448... | 2.36413 | 5,704 |
# Heerden2013 https=>//doi.org/10.1186/1475-2859-12-80.
module HeerdenData
import ..Chemostat_Heerden2013
const ChH = Chemostat_Heerden2013
import CSV
import DataFrames: DataFrame
import UtilsJL
const UJL = UtilsJL
UJL.gen_sub_proj(@__MODULE__)
include("data_interface.jl")
functi... | [
2,
679,
263,
6559,
6390,
3740,
14804,
1003,
34023,
13,
2398,
14,
940,
13,
1157,
4521,
14,
1415,
2425,
12,
2078,
3270,
12,
1065,
12,
1795,
13,
198,
198,
21412,
679,
263,
6559,
6601,
198,
220,
220,
220,
1330,
11485,
7376,
1712,
265,
... | 2.14359 | 195 |
#=
Null value for tensors having elements of a certain type.
!!! Depends on element type, not on dimensions.
=#
using Colors
#=
Runtime dispatch, for now.
TODO not assume the eltype of the array.
Here we arbitrarily choose a color, a blank char, etc.
=#
function nullElementForTensor(tensor)
elementType = elty... | [
2,
28,
198,
35067,
1988,
329,
11192,
669,
1719,
4847,
286,
257,
1728,
2099,
13,
198,
198,
10185,
2129,
2412,
319,
5002,
2099,
11,
407,
319,
15225,
13,
198,
46249,
198,
198,
3500,
29792,
628,
198,
2,
28,
198,
41006,
27965,
11,
329,
... | 2.64433 | 582 |
## R code 16.2
m16.1 <- ulam(
alist(
w ~ dlnorm( mu , sigma ),
exp(mu) <- 3.141593 * k * p^2 * h^3,
p ~ beta( 2 , 18 ),
k ~ exponential( 0.5 ),
sigma ~ exponential( 1 )
), data=d , chains=4 , cores=4 )
# run the sampler
m16.2 <- stan( model_code=Boxes_model , data=dat_li... | [
2235,
371,
2438,
1467,
13,
17,
198,
76,
1433,
13,
16,
24293,
334,
2543,
7,
198,
220,
220,
220,
435,
396,
7,
198,
220,
220,
220,
220,
220,
220,
220,
266,
5299,
288,
18755,
579,
7,
38779,
837,
264,
13495,
10612,
198,
220,
220,
220... | 1.898458 | 778 |
import PowerModelsACDC;
const _PMACDC = PowerModelsACDC;
import PowerModels;
const _PM = PowerModels;
import InfrastructureModels;
const _IM = InfrastructureModels;
import JuMP
import Gurobi
using MAT
using XLSX
using JLD2
using Statistics
include("basencont_nw.jl")
Total_sample = 500 # sample per year
total_yr = 3# ... | [
11748,
4333,
5841,
1424,
2246,
9697,
26,
198,
9979,
4808,
5868,
2246,
9697,
796,
4333,
5841,
1424,
2246,
9697,
26,
198,
11748,
4333,
5841,
1424,
26,
198,
9979,
4808,
5868,
796,
4333,
5841,
1424,
26,
198,
11748,
33709,
5841,
1424,
26,
... | 2.155682 | 3,520 |
<filename>src/xaamdi.jl
function empty_xaamdi_table()
(E = empty_col(uenergy ),
TotalAttenuation = empty_col(umassatt),
EnergyLoss = empty_col(umassatt))
end
const XAAMDITable = typeof(empty_xaamdi_table())
struct XAAMDIData <: DataSource
element_tables::Vector{XAAMDITable}
c... | [
27,
34345,
29,
10677,
14,
27865,
321,
10989,
13,
20362,
198,
8818,
6565,
62,
27865,
321,
10989,
62,
11487,
3419,
198,
220,
220,
220,
357,
36,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
6565,
62... | 2.201166 | 343 |
using Test
using BigArrays.Infos
using JSON
@testset "test Infos module" begin
fileName = joinpath(@__DIR__, "../asset/info")
str = read(fileName, String)
@test Info(str) != nothing
data = Vector{UInt8}(str)
@test Info(data) != nothing
d = JSON.parsefile(joinpath(@__DIR__, "../asset/info"... | [
3500,
6208,
220,
198,
3500,
4403,
3163,
20477,
13,
18943,
418,
220,
198,
3500,
19449,
220,
198,
198,
31,
9288,
2617,
366,
9288,
4806,
418,
8265,
1,
2221,
198,
220,
220,
220,
2393,
5376,
796,
4654,
6978,
7,
31,
834,
34720,
834,
11,
... | 2.430678 | 339 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.