content stringlengths 6 1.03M | input_ids listlengths 4 535k | ratio_char_token float64 0.68 8.61 | token_count int64 4 535k |
|---|---|---|---|
# TODO:
# 1- I need Zygote.jacobian and gradient return Zero for any argument of type "Int"
# NOTE: Lessons learned:
# 1- I should remove all kwargs to make gradients and Zygote.jacobian calculations smooth
#############################################################################################
using LinearAlgeb... | [
2,
16926,
46,
25,
198,
2,
352,
12,
314,
761,
1168,
35641,
1258,
13,
30482,
672,
666,
290,
31312,
1441,
12169,
329,
597,
4578,
286,
2099,
366,
5317,
1,
198,
198,
2,
24550,
25,
46885,
4499,
25,
198,
2,
352,
12,
314,
815,
4781,
477... | 1.791118 | 7,521 |
<reponame>lorenzoh/Pollen.jl
abstract type XTree end
struct XNode{T<:XTree, V} <: XTree
tag::Symbol
attributes::Dict{Symbol, V}
children::Vector{T}
end
Base.show(io::IO, xnode::XNode) = print_tree(io, xnode, 3)
XNode(tag::Symbol) = XNode(tag, XTree[])
XNode(tag::Symbol, attributes::Dict) = XNode(tag, att... | [
27,
7856,
261,
480,
29,
31131,
27305,
1219,
14,
47,
29952,
13,
20362,
198,
397,
8709,
2099,
1395,
27660,
886,
198,
198,
7249,
1395,
19667,
90,
51,
27,
25,
25010,
631,
11,
569,
92,
1279,
25,
1395,
27660,
198,
220,
220,
220,
7621,
3... | 2.274538 | 1,406 |
<reponame>cossio/TruncatedNormal.jl<gh_stars>1-10
using Test, SpecialFunctions
import TruncatedNormal as TN
@test TN.tnmom1c(0, -Inf, Inf) == 0
@test TN.tnmom1c(0, -Inf, 0) ≈ TN.tnmean(-Inf, 0)
@test TN.tnmom1c(0, 0, +Inf) ≈ TN.tnmean(0, +Inf)
@test TN.tnmom1c(0, +Inf, +Inf) == +Inf
@test TN.tnmom1c(0, -Inf, -Inf) ==... | [
27,
7856,
261,
480,
29,
66,
793,
952,
14,
2898,
19524,
515,
26447,
13,
20362,
27,
456,
62,
30783,
29,
16,
12,
940,
198,
3500,
6208,
11,
6093,
24629,
2733,
198,
11748,
833,
19524,
515,
26447,
355,
29025,
198,
198,
31,
9288,
29025,
... | 1.757511 | 1,398 |
using CompScienceMeshes
using StaticArrays
using Test
p1 = point(1.0, 0.0, 0.0)
p2 = point(10.0, 0.0, 1.0)
p3 = point(0.0, 2.0, 5.0)
ch = simplex(p1,p2,p3)
dom = domain(ch)
q, u = quadpoints(dom, 7)
@which neighborhood(ch, q[1])
pw = CompScienceMeshes.quadpoints(ch, 7);
#t1 = sum(w)
t1 = sum(q[2] for q in pw)
t2 =... | [
3500,
3082,
26959,
44,
274,
956,
198,
3500,
36125,
3163,
20477,
198,
3500,
6208,
198,
198,
79,
16,
796,
966,
7,
16,
13,
15,
11,
657,
13,
15,
11,
657,
13,
15,
8,
198,
79,
17,
796,
966,
7,
940,
13,
15,
11,
657,
13,
15,
11,
3... | 1.728532 | 361 |
<gh_stars>1-10
export sum2, jacobian, ε⁻¹_bar!, ε⁻¹_bar, ∂ω²∂k_adj, Mₖᵀ_plus_Mₖ, ∂²ω²∂k², herm
export ∇ₖmag_m_n, ∇HMₖH, ∇M̂, ∇solve_k, ∇solve_k!, solve_adj!, neff_ng_gvd, ∂ε⁻¹_∂ω, ∂nng⁻¹_∂ω
export ∇ₖmag_mn
### ForwardDiff Comoplex number support
# ref: https://github.com/JuliaLang/julia/pull/36030
# https://github.com/... | [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
39344,
2160,
17,
11,
474,
330,
672,
666,
11,
7377,
113,
46256,
119,
126,
117,
62,
5657,
28265,
7377,
113,
46256,
119,
126,
117,
62,
5657,
11,
18872,
224,
49535,
31185,
24861,
224,
74,
62,
... | 1.620573 | 48,170 |
<filename>src/calculusTerms.jl<gh_stars>10-100
# ===============================
# Written by AAE
# <NAME>, Spring 2014
# simulkade.com
# ===============================
# ================================================================
# Changes:
# 2014-12-30 added 2D radial and 3D cylindrical grids
# 2014-12-3... | [
27,
34345,
29,
10677,
14,
9948,
17576,
15156,
907,
13,
20362,
27,
456,
62,
30783,
29,
940,
12,
3064,
198,
2,
36658,
25609,
855,
198,
2,
22503,
416,
317,
14242,
198,
2,
1279,
20608,
22330,
8225,
1946,
198,
2,
985,
12171,
671,
13,
7... | 2.057332 | 6,506 |
<filename>src/device/pointer.jl
# oneAPI-specific operations on pointers with address spaces
## adrspace aliases
export AS
module AS
const Private = 0
const Global = 1
const Constant = 2
const Local = 3
const Generic = 4
const Input = 5
const Output = 6
const Count = 7
end
| [
27,
34345,
29,
10677,
14,
25202,
14,
29536,
13,
20362,
198,
2,
530,
17614,
12,
11423,
4560,
319,
32007,
351,
2209,
9029,
198,
198,
2235,
512,
81,
13200,
47217,
198,
198,
39344,
7054,
198,
198,
21412,
7054,
198,
198,
9979,
15348,
220,
... | 2.743363 | 113 |
# This is used on Julia version that have the Base.Ryu module.
using Base.Ryu
function plain_precision_heuristic(xs::AbstractArray{<:AbstractFloat})
ys = filter(isfinite, xs)
e10max = -(e10min = typemax(Int))
for y in ys
if isapprox(y, 0, atol=1e-16)
continue
end
_, e10... | [
2,
770,
318,
973,
319,
22300,
2196,
326,
423,
262,
7308,
13,
49,
24767,
8265,
13,
198,
198,
3500,
7308,
13,
49,
24767,
198,
198,
8818,
8631,
62,
3866,
16005,
62,
258,
27915,
7,
34223,
3712,
23839,
19182,
90,
27,
25,
23839,
43879,
... | 2.340014 | 1,397 |
using DataArrays, Documenter
makedocs(
modules = [DataArrays],
clean = false,
format = :html,
sitename = "DataArrays.jl",
authors = "<NAME>, <NAME>, and other contributors",
pages = [
"Home" => "index.md",
"Missing Data and Arrays" => "da.md",
"Utilities" => "util.md",
... | [
3500,
6060,
3163,
20477,
11,
16854,
263,
198,
198,
76,
4335,
420,
82,
7,
198,
220,
220,
220,
13103,
796,
685,
6601,
3163,
20477,
4357,
198,
220,
220,
220,
3424,
796,
3991,
11,
198,
220,
220,
220,
5794,
796,
1058,
6494,
11,
198,
22... | 2.295 | 200 |
<reponame>lofox/AbstractPlotting.jl<filename>test/runtests.jl<gh_stars>0
using AbstractPlotting
using MakieGallery
using Test
using GLMakie
# Download reference images from master
MakieGallery.current_ref_version[] = "master"
const MINIMAL = get(ENV, "ABSTRACTPLOTTING_MINIMAL", "false")
# does this machine have a OP... | [
27,
7856,
261,
480,
29,
75,
1659,
1140,
14,
23839,
43328,
889,
13,
20362,
27,
34345,
29,
9288,
14,
81,
2797,
3558,
13,
20362,
27,
456,
62,
30783,
29,
15,
198,
3500,
27741,
43328,
889,
198,
3500,
15841,
494,
29352,
198,
3500,
6208,
... | 2.49429 | 2,189 |
<filename>test/WeakGradTests.jl<gh_stars>10-100
module WeakGradTests
using Gridap
using GridapGeosciences
import Gridap.Fields: ∇, divergence
using Plots
using Test
include("ConvergenceAnalysisTools.jl")
function ω(xyz)
θϕ = xyz2θϕ(xyz)
θ,ϕ = θϕ
cos(θ)*cos(ϕ)^2
end
function ... | [
27,
34345,
29,
9288,
14,
44898,
42731,
51,
3558,
13,
20362,
27,
456,
62,
30783,
29,
940,
12,
3064,
198,
21412,
28788,
42731,
51,
3558,
198,
220,
220,
1262,
24846,
499,
198,
220,
220,
1262,
24846,
499,
10082,
418,
979,
3007,
198,
220... | 1.940311 | 1,223 |
<gh_stars>0
"""
This provides units and creates a non-dimensionalization object
"""
module Units
using Unitful
import Unitful: superscript
using Parameters
using Setfield # allows modifying fields in immutable struct
import Base: show, isapprox, isequal, convert, length, size, getindex, setindex!, getproperty
impo... | [
27,
456,
62,
30783,
29,
15,
198,
37811,
198,
220,
220,
220,
770,
3769,
4991,
290,
8075,
257,
1729,
12,
19577,
1634,
2134,
198,
37811,
198,
21412,
27719,
198,
3500,
11801,
913,
198,
11748,
11801,
913,
25,
22754,
6519,
198,
3500,
40117,... | 2.161564 | 13,097 |
import PyPlot
function plot1D(gp::GP; clim::Tuple{Float64, Float64}=(minimum(gp.X), maximum(gp.X)), CI::Float64=1.96, res::Int=1000, fname::AbstractString="")
sx = (clim[2]-clim[1])/(res-1)
x=collect(clim[1]:sx:clim[2])
mu, Sigma = predict(gp, x)
conf = CI*sqrt(Sigma)
u = mu + conf
l = mu - c... | [
11748,
9485,
43328,
628,
198,
8818,
7110,
16,
35,
7,
31197,
3712,
16960,
26,
5424,
3712,
51,
29291,
90,
43879,
2414,
11,
48436,
2414,
92,
16193,
39504,
7,
31197,
13,
55,
828,
5415,
7,
31197,
13,
55,
36911,
14514,
3712,
43879,
2414,
... | 2.097462 | 985 |
export Configuration
lazy_artifact(x) = @artifact_str(x)
const rootfs_lock = ReentrantLock()
const rootfs_cache = Dict()
function prepare_rootfs(distro="debian"; uid=1000, user="pkgeval", gid=1000, group="pkgeval", home="/home/$user")
lock(rootfs_lock) do
get!(rootfs_cache, (distro, uid, user, gid, group,... | [
39344,
28373,
198,
198,
75,
12582,
62,
433,
29660,
7,
87,
8,
796,
2488,
433,
29660,
62,
2536,
7,
87,
8,
198,
198,
9979,
6808,
9501,
62,
5354,
796,
797,
298,
5250,
25392,
3419,
198,
9979,
6808,
9501,
62,
23870,
796,
360,
713,
3419,... | 1.966267 | 12,095 |
<reponame>UnofficialJuliaMirrorSnapshots/Azure.jl-34b51195-c7f2-5807-8107-6ca017e2682c<filename>src/Compute/ComputeManagementClient/model_VirtualMachineScaleSetUpdateOSDisk.jl
# This file was generated by the Julia Swagger Code Generator
# Do not modify this file directly. Modify the swagger specification instead.
m... | [
27,
7856,
261,
480,
29,
3118,
16841,
16980,
544,
27453,
1472,
43826,
20910,
14,
26903,
495,
13,
20362,
12,
2682,
65,
4349,
22186,
12,
66,
22,
69,
17,
12,
20,
36928,
12,
23,
15982,
12,
21,
6888,
29326,
68,
2075,
6469,
66,
27,
34345... | 3.241877 | 831 |
function sweepline(V,EV)
# event generation and ordering
segments = presortedlines(V,EV)
evpairs = [[(v1,v2,"start",k), (v2,v1,"end",k)] for (k,(v1,v2)) in enumerate(segments)]
isless0 = (x,y) -> [x[1][1],x[1][2],x[2][2]] < [y[1][1],y[1][2],y[2][2]]
events = sort(cat(evpairs),lt=isless0)
# Initialize event queue ... | [
8818,
3490,
68,
489,
500,
7,
53,
11,
20114,
8,
198,
197,
2,
1785,
5270,
290,
16216,
198,
197,
325,
11726,
796,
906,
9741,
6615,
7,
53,
11,
20114,
8,
198,
197,
1990,
79,
3468,
796,
16410,
7,
85,
16,
11,
85,
17,
553,
9688,
1600,... | 1.924367 | 2,803 |
<reponame>IDSIA/cjuice
module StructureLearner
using LogicCircuits
using ..Utils
using ..Probabilistic
using ..CSDD
using ..IO
export
# ChowLiuTree
learn_chow_liu_tree, parent_vector, print_tree, CLT,
# CircuitBuilder
compile_prob_circuit_from_clt, learn_probabilistic_circuit, BaseCache, ⊤, LitCache, learn_credal_ci... | [
27,
7856,
261,
480,
29,
14255,
3539,
14,
66,
14396,
501,
198,
21412,
32522,
14961,
1008,
198,
198,
3500,
30146,
31560,
15379,
198,
3500,
11485,
18274,
4487,
198,
3500,
11485,
2964,
65,
14991,
2569,
198,
3500,
11485,
7902,
16458,
198,
35... | 2.580357 | 224 |
<filename>ShatteringExamples/syntheticSparsityTest.jl<gh_stars>1-10
using Shearlab, FFTW, Plots
function reorderCoeff(A::AbstractArray{T,2}) where T
if size(A,1)==1
includingZeros = reshape(sort(abs.(A), dims =
length(size(A)),rev=true), (length(A,)))
else
i... | [
27,
34345,
29,
2484,
16475,
27730,
14,
1837,
429,
6587,
4561,
45826,
14402,
13,
20362,
27,
456,
62,
30783,
29,
16,
12,
940,
198,
3500,
1375,
7063,
397,
11,
376,
9792,
54,
11,
1345,
1747,
198,
8818,
302,
2875,
34,
2577,
487,
7,
32,... | 2.153141 | 764 |
module JuliaConSamplePackage
using ForwardDiff
export newton
"""
newton(f, f′, x₀; maxiter = 100, tol = 1e-8)
Find `f`s root via Newton's method.
"""
function newton(f, f′, x₀; maxiter = 100, tol = 1e-8)
xₙ₊₁ = x₀
xₙ = NaN
iter = 0
while true
fₓ₊₁ = f(xₙ₊₁)
fₓ = f(xₙ)
if ab... | [
21412,
22300,
3103,
36674,
27813,
198,
3500,
19530,
28813,
198,
198,
39344,
649,
1122,
198,
198,
37811,
198,
220,
220,
220,
649,
1122,
7,
69,
11,
277,
17478,
11,
2124,
158,
224,
222,
26,
3509,
2676,
796,
1802,
11,
284,
75,
796,
352,... | 1.434783 | 529 |
# diric.jl Dirichlet kernel tests
@testset "diric" begin
@test_throws ArgumentError diric(0, -2)
@test @inferred(diric(0, 4)) ≈ 1
@test @inferred(diric(0 // 1, 5)) == 1
@test @inferred(diric(4π, 4)) ≈ 1
@test @inferred(diric(2π, 4)) ≈ -1
@test @inferred(diric(0, 5)) ≈ 1
@test @inferred(diri... | [
2,
26672,
291,
13,
20362,
36202,
488,
1616,
9720,
5254,
198,
198,
31,
9288,
2617,
366,
15908,
291,
1,
2221,
198,
220,
220,
220,
2488,
9288,
62,
400,
8516,
45751,
12331,
26672,
291,
7,
15,
11,
532,
17,
8,
198,
220,
220,
220,
2488,
... | 1.911523 | 486 |
<gh_stars>1-10
using DiffEqMonteCarlo, StochasticDiffEq, DiffEqBase,
DiffEqProblemLibrary, OrdinaryDiffEq
using Test
using DiffEqProblemLibrary.SDEProblemLibrary: importsdeproblems; importsdeproblems()
import DiffEqProblemLibrary.SDEProblemLibrary: prob_sde_linear, prob_sde_2Dlinear
prob = prob_sde_linear
prob2... | [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
3500,
10631,
36,
80,
9069,
660,
9914,
5439,
11,
520,
5374,
3477,
28813,
36,
80,
11,
10631,
36,
80,
14881,
11,
198,
220,
220,
220,
220,
220,
10631,
36,
80,
40781,
23377,
11,
14230,
3219,
... | 1.983846 | 1,919 |
<reponame>UnofficialJuliaMirror/CPLEX.jl-a076750e-1247-5638-91d2-ce28b192dca0
@testset "Low-level API" begin
env = CPLEX.Env()
CPLEX.set_logfile(env, "cplex.log")
CPLEX.close_CPLEX(env)
end
| [
27,
7856,
261,
480,
29,
3118,
16841,
16980,
544,
27453,
1472,
14,
8697,
2538,
55,
13,
20362,
12,
64,
2998,
3134,
1120,
68,
12,
1065,
2857,
12,
3980,
2548,
12,
6420,
67,
17,
12,
344,
2078,
65,
17477,
67,
6888,
15,
198,
31,
9288,
... | 1.92381 | 105 |
<gh_stars>1-10
using Mathy
using Test
include("../docs/utils.jl")
@testset "Mathy.jl" begin
@test (mathy_makedocs(); true)
end
| [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
3500,
337,
10036,
198,
3500,
6208,
198,
198,
17256,
7203,
40720,
31628,
14,
26791,
13,
20362,
4943,
198,
198,
31,
9288,
2617,
366,
44,
10036,
13,
20362,
1,
2221,
198,
220,
220,
220,
2488,
... | 2.293103 | 58 |
using CLIMA.VariableTemplates
import CLIMA.DGmethods: BalanceLaw, vars_aux, vars_state, vars_gradient,
vars_diffusive, flux_nondiffusive!, flux_diffusive!,
source!, wavespeed, boundary_state!,
gradvariables!,
diffusive!, in... | [
3500,
7852,
3955,
32,
13,
43015,
12966,
17041,
198,
198,
11748,
7852,
3955,
32,
13,
35,
38,
24396,
82,
25,
22924,
16966,
11,
410,
945,
62,
14644,
11,
410,
945,
62,
5219,
11,
410,
945,
62,
49607,
11,
198,
220,
220,
220,
220,
220,
... | 1.920275 | 2,471 |
convert(::Type{DoubleFloat{T}}, x::T) where {T<:IEEEFloat} = DoubleFloat{T}(x)
convert(::Type{T}, x::DoubleFloat{T}) where {T<:IEEEFloat} = HI(x)
convert(::Type{DoubleFloat{T}}, x::I) where {T<:IEEEFloat, I<:Integer} = DoubleFloat{T}(T(x))
convert(::Type{I}, x::DoubleFloat{T}) where {T<:IEEEFloat, I<:Integer} = I(roun... | [
1102,
1851,
7,
3712,
6030,
90,
25628,
43879,
90,
51,
92,
5512,
2124,
3712,
51,
8,
810,
1391,
51,
27,
25,
40,
6500,
25425,
5439,
265,
92,
796,
11198,
43879,
90,
51,
92,
7,
87,
8,
198,
1102,
1851,
7,
3712,
6030,
90,
51,
5512,
21... | 2.394198 | 586 |
@otestset "Visualization" begin
# test that this all at least runs
surf1 = AcceleratedParametricSurface(TestData.beziersurface(), 15)
surf2 = AcceleratedParametricSurface(TestData.upsidedownbeziersurface(), 15)
m = csgintersection(leaf(surf1, translation(-0.5, -0.5, 0.0)), csgintersection(leaf(Cylinder(... | [
31,
313,
395,
2617,
366,
36259,
1634,
1,
2221,
198,
220,
220,
220,
1303,
1332,
326,
428,
477,
379,
1551,
4539,
198,
220,
220,
220,
9053,
16,
796,
29805,
515,
22973,
19482,
14214,
2550,
7,
14402,
6601,
13,
1350,
89,
3183,
333,
2550,
... | 2.237647 | 425 |
function SGP4(arg0::TLE, arg1::AttitudeProvider, arg2::jdouble)
return SGP4((TLE, AttitudeProvider, jdouble), arg0, arg1, arg2)
end
function SGP4(arg0::TLE, arg1::AttitudeProvider, arg2::jdouble, arg3::Frame)
return SGP4((TLE, AttitudeProvider, jdouble, Frame), arg0, arg1, arg2, arg3)
end
| [
8818,
311,
16960,
19,
7,
853,
15,
3712,
51,
2538,
11,
1822,
16,
3712,
8086,
3984,
29495,
11,
1822,
17,
3712,
73,
23352,
8,
198,
220,
220,
220,
1441,
311,
16960,
19,
19510,
51,
2538,
11,
3460,
3984,
29495,
11,
474,
23352,
828,
1822... | 2.479339 | 121 |
n = 79 # rand(40:100)
A = matrixdepot("gilbert", n)
@test issymmetric(A)
B = matrixdepot("gilbert", n, 0.2)
C = matrixdepot("gilbert", Int, n, 0.5)
@test nnz(B) <= nnz(C)
@test matrixdepot("gilbert", Int, 1) !== nothing
println("'gilbert' passed test ...")
| [
77,
796,
9225,
1303,
43720,
7,
1821,
25,
3064,
8,
198,
32,
796,
17593,
10378,
313,
7203,
37718,
4835,
1600,
299,
8,
198,
31,
9288,
1189,
26621,
19482,
7,
32,
8,
198,
198,
33,
796,
17593,
10378,
313,
7203,
37718,
4835,
1600,
299,
1... | 2.354545 | 110 |
<filename>src/integrators/initial_guess/initial_guess_ode.jl
"""
`InitialGuessODE`: Initial guess for ordinary differential equations
### Fields
* `int`: interpolation structure
* `v`: vector field
* `Δt`: time step
* `s`: number of extrapolation stages (for initialisation)
"""
mutable struct InitialGuessODE{DT... | [
27,
34345,
29,
10677,
14,
18908,
18942,
14,
36733,
62,
5162,
408,
14,
36733,
62,
5162,
408,
62,
1098,
13,
20362,
198,
37811,
198,
63,
24243,
8205,
408,
16820,
63,
25,
20768,
4724,
329,
8850,
22577,
27490,
198,
198,
21017,
23948,
198,
... | 1.87125 | 1,600 |
<reponame>Micki-D/BAT.jl<gh_stars>100-1000
abstract type HMCMetric end
struct DiagEuclideanMetric <: HMCMetric end
function ahmc_metric(metric::DiagEuclideanMetric, dim::Integer)
return AdvancedHMC.DiagEuclideanMetric(dim)
end
struct UnitEuclideanMetric <: HMCMetric end
function ahmc_metric(metric::UnitEucl... | [
27,
7856,
261,
480,
29,
44,
624,
72,
12,
35,
14,
47379,
13,
20362,
27,
456,
62,
30783,
29,
3064,
12,
12825,
198,
397,
8709,
2099,
367,
9655,
9171,
1173,
886,
628,
198,
198,
7249,
6031,
363,
36,
36616,
485,
272,
9171,
1173,
1279,
... | 2.489083 | 229 |
"""
module Vision
Data blocks, encodings and more for computer vision.
The most important [`Block`] is [`Image`](#)`{N}`.
Blocks:
- [`Image`](#)`{N}`: an `N`-dimensional color image
- [`Mask`](#)`{N}`: an `N`-dimensional categorical mask
- [`Keypoints`](#)`{N}`: a fixed number of `N`-dimensional keypoints
En... | [
37811,
198,
220,
220,
220,
8265,
19009,
198,
198,
6601,
7021,
11,
2207,
375,
654,
290,
517,
329,
3644,
5761,
13,
198,
198,
464,
749,
1593,
685,
63,
12235,
63,
60,
318,
685,
63,
5159,
63,
16151,
2,
8,
63,
90,
45,
92,
44646,
628,
... | 2.891837 | 980 |
<gh_stars>0
using PracticePackage
using Test
using TestSetExtensions | [
27,
456,
62,
30783,
29,
15,
198,
3500,
19939,
27813,
198,
3500,
6208,
198,
3500,
6208,
7248,
11627,
5736
] | 3.578947 | 19 |
abstract DirichletPrior
type UniformPrior <: DirichletPrior
α::Float64
UniformPrior(α::Float64=1.0) = new(α)
end
type BDeuPrior <: DirichletPrior
#=
Assigns equal scores to Markov equivalent structures
α_ijk = x/{q_i * r_i} ∀ j, k and some given x
see DMU section 2.4.3
=#
x::Float64
... | [
397,
8709,
36202,
488,
1616,
22442,
198,
4906,
35712,
22442,
1279,
25,
36202,
488,
1616,
22442,
198,
220,
220,
220,
26367,
3712,
43879,
2414,
198,
220,
220,
220,
35712,
22442,
7,
17394,
3712,
43879,
2414,
28,
16,
13,
15,
8,
796,
649,
... | 2.222433 | 526 |
using ValkyrieRobot
using ValkyrieRobot.BipedControlUtil
using RigidBodyTreeInspector
using Base.Test
@testset "side" begin
@test -left == right
@test -right == left
sides = [rand(Side) for i = 1 : 10000];
@test isapprox(count(side -> side == left, sides) / length(sides), 0.5; atol = 0.05)
@test ... | [
3500,
23620,
14350,
313,
198,
3500,
23620,
14350,
313,
13,
33,
46647,
15988,
18274,
346,
198,
3500,
24666,
312,
25842,
27660,
818,
4443,
273,
198,
3500,
7308,
13,
14402,
198,
198,
31,
9288,
2617,
366,
1589,
1,
2221,
198,
220,
220,
220... | 2.612766 | 235 |
<reponame>maleadt/NVTX.jl
## low-level API
const nvtxDomainHandle_t = Ptr{Cvoid}
struct Domain
handle::nvtxDomainHandle_t
function Domain(name::String)
info("Creating domain $name")
handle = ccall((:nvtxDomainCreateA, libnvtx), nvtxDomainHandle_t, (Cstring,), name)
new(handle)
end... | [
27,
7856,
261,
480,
29,
22606,
324,
83,
14,
27159,
29551,
13,
20362,
198,
2235,
1877,
12,
5715,
7824,
198,
198,
9979,
299,
85,
17602,
43961,
37508,
62,
83,
796,
350,
2213,
90,
34,
19382,
92,
198,
198,
7249,
20021,
198,
220,
220,
2... | 2.529197 | 274 |
<reponame>SERVIR/fier-cli
function buildregressions(config::Dict{<:Any,<:Any})
# @info config
# extract out the information on reading observation
obspath = config["input"]["path"]
datavar = config["input"]["datavar"]
timevar = config["input"]["timevar"]
yvar = config["input"]["yvar"]
xv... | [
27,
7856,
261,
480,
29,
35009,
53,
4663,
14,
69,
959,
12,
44506,
198,
198,
8818,
1382,
2301,
601,
507,
7,
11250,
3712,
35,
713,
90,
27,
25,
7149,
11,
27,
25,
7149,
30072,
628,
220,
220,
220,
1303,
2488,
10951,
4566,
628,
198,
22... | 2.312471 | 2,189 |
using NODEData
using Test
using OrdinaryDiffEq
@testset "NODEDataloader" begin
f(u,p,t) = 1.01*u
u0 = 1/2
tspan = (0.0,10.0)
prob = ODEProblem(f,u0,tspan)
sol = solve(prob, Tsit5(), reltol=1e-8, abstol=1e-8)
# interpolate
data = NODEDataloader(sol, 20, dt=0.2)
@test size(data[1][2])[... | [
3500,
399,
3727,
1961,
1045,
198,
3500,
6208,
198,
3500,
14230,
3219,
28813,
36,
80,
198,
198,
31,
9288,
2617,
366,
45,
3727,
1961,
10254,
1170,
263,
1,
2221,
628,
220,
220,
220,
277,
7,
84,
11,
79,
11,
83,
8,
796,
352,
13,
486,... | 1.914246 | 723 |
<reponame>UnofficialJuliaMirrorSnapshots/RoME.jl-91fb55c2-4c03-5a59-ba21-f4ea956187b8
# inertial pose3
export
PreintegralCompensationGradients,
InertialPose3Container,
oplus,
⊕,
getSample,
InertialPose3,
PackedInertialPose3,
PriorInertialPose3,
PackedPriorInertialPose3,
compare
abstract type Prein... | [
27,
7856,
261,
480,
29,
3118,
16841,
16980,
544,
27453,
1472,
43826,
20910,
14,
15450,
11682,
13,
20362,
12,
6420,
21855,
2816,
66,
17,
12,
19,
66,
3070,
12,
20,
64,
3270,
12,
7012,
2481,
12,
69,
19,
18213,
50148,
23451,
65,
23,
1... | 2.025485 | 4,944 |
using ModelingToolkitStandardLibrary.Thermal, ModelingToolkit, OrdinaryDiffEq, Test
@parameters t
D = Differential(t)
# Modelica example
begin
@named mass1 = HeatCapacitor(C=15, T_start=373.15)
@named mass2 = HeatCapacitor(C=15, T_start=273.15)
@named conduction = ThermalConductor(G=10)
@named Tsensor1... | [
3500,
9104,
278,
25391,
15813,
23615,
23377,
13,
35048,
7617,
11,
9104,
278,
25391,
15813,
11,
14230,
3219,
28813,
36,
80,
11,
6208,
198,
31,
17143,
7307,
256,
198,
35,
796,
20615,
498,
7,
83,
8,
198,
198,
2,
9104,
3970,
1672,
198,
... | 2.436997 | 373 |
# This file is auto-generated by AWSMetadata.jl
using AWS
using AWS.AWSServices: ebs
using AWS.Compat
using AWS.UUIDs
"""
complete_snapshot(snapshot_id, x-amz-_changed_blocks_count)
complete_snapshot(snapshot_id, x-amz-_changed_blocks_count, params::Dict{String,<:Any})
Seals and completes the snapshot after a... | [
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,
304,
1443,
198,
3500,
30865,
13,
40073,
198,
3500,
30865,
13,
52,
27586,
82,
198,
198,
37811,
... | 3.348862 | 3,778 |
<gh_stars>1-10
# ## [Time Domain Simulation of a Typical Section](@id section-simulation)
#
# In this example, we simulate the response of two degree of freedom typical section model.
# We use the same parameters as in the [previous example](@ref section-stability)
#
# 
#
#-
#md # !... | [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
2,
22492,
685,
7575,
20021,
41798,
286,
257,
48752,
7275,
16151,
31,
312,
2665,
12,
14323,
1741,
8,
198,
2,
220,
198,
2,
554,
428,
1672,
11,
356,
29308,
262,
2882,
286,
734,
4922,
286,
4... | 2.46281 | 1,452 |
using Statistics, SpecialFunctions
"""
tnvar(a, b)
Variance of the standard normal distribution truncated to the interval [a,b].
"""
function tnvar(a::Real, b::Real)
if a == b
return zero(middle(a, b))
elseif a < b
m1 = tnmean(a, b)
m2 = √tnmom2(a, b)
return (m2 - m1) * (m2... | [
3500,
14370,
11,
6093,
24629,
2733,
198,
198,
37811,
198,
220,
220,
220,
256,
77,
7785,
7,
64,
11,
275,
8,
198,
198,
23907,
590,
286,
262,
3210,
3487,
6082,
40122,
515,
284,
262,
16654,
685,
64,
11,
65,
4083,
198,
37811,
198,
8818... | 2.030137 | 365 |
#####
##### PushVector
#####
mutable struct PushVector{T} <: AbstractVector{T}
data::Vector{T}
len::Int
end
PushVector{T}() where {T} = PushVector{T}(T[], 0)
Base.size(v::PushVector) = (v.len,)
maxlength(v::PushVector) = length(v.data)
Base.IndexStyle(::PushVector) = Base.IndexLinear()
Base.@propagate_inboun... | [
4242,
2,
198,
4242,
2,
23691,
38469,
198,
4242,
2,
198,
198,
76,
18187,
2878,
23691,
38469,
90,
51,
92,
1279,
25,
27741,
38469,
90,
51,
92,
198,
220,
220,
220,
1366,
3712,
38469,
90,
51,
92,
198,
220,
220,
220,
18896,
3712,
5317,
... | 2.259963 | 5,897 |
function itensor(I::UniformScaling, is...)
return ITensor(I, is...)
end
function ITensor(I::UniformScaling, is...)
return ITensor(I(isqrt(dim(is))), is...)
end
# Using ITensors.jl definitions
function _ITensor(
which_op::AbstractString, sites::Tuple, params::NamedTuple, s::Vector{<:Index}
)
return op(which_op... | [
8818,
340,
22854,
7,
40,
3712,
3118,
6933,
3351,
4272,
11,
318,
23029,
198,
220,
1441,
7283,
22854,
7,
40,
11,
318,
23029,
198,
437,
198,
198,
8818,
7283,
22854,
7,
40,
3712,
3118,
6933,
3351,
4272,
11,
318,
23029,
198,
220,
1441,
... | 2.297401 | 1,308 |
function ReceiverAntenna(arg0::JString, arg1::JString, arg2::Map, arg3::JString)
return ReceiverAntenna((JString, JString, Map, JString), arg0, arg1, arg2, arg3)
end
function get_serial_number(obj::ReceiverAntenna)
return jcall(obj, "getSerialNumber", JString, ())
end
| [
8818,
39106,
13217,
13713,
7,
853,
15,
3712,
41,
10100,
11,
1822,
16,
3712,
41,
10100,
11,
1822,
17,
3712,
13912,
11,
1822,
18,
3712,
41,
10100,
8,
198,
220,
220,
220,
1441,
39106,
13217,
13713,
19510,
41,
10100,
11,
449,
10100,
11,... | 2.79 | 100 |
<reponame>jmmshn/LeetCode.jl
# ---
# title: 1662. Check If Two String Arrays are Equivalent
# id: problem1662
# author: <NAME>
# date: 2020-10-31
# difficulty: Easy
# categories: String
# link: <https://leetcode.com/problems/check-if-two-string-arrays-are-equivalent/description/>
# hidden: true
# ---
#
# Given two str... | [
27,
7856,
261,
480,
29,
73,
76,
907,
21116,
14,
3123,
316,
10669,
13,
20362,
198,
2,
11420,
198,
2,
3670,
25,
1467,
5237,
13,
6822,
1002,
4930,
10903,
943,
20477,
389,
7889,
29540,
198,
2,
4686,
25,
1917,
1433,
5237,
198,
2,
1772,... | 2.306321 | 617 |
<reponame>JuliaDiffEq/ArrayInterface.jl
@test @inferred(ArrayInterface.size(sv5)) === (StaticInt(5),)
@test @inferred(ArrayInterface.size(v5)) === (5,)
@test @inferred(ArrayInterface.size(A)) === (3, 4, 5)
@test @inferred(ArrayInterface.size(Ap)) === (2, 5)
@test @inferred(ArrayInterface.size(A)) === size(A)
@test @in... | [
27,
7856,
261,
480,
29,
16980,
544,
28813,
36,
80,
14,
19182,
39317,
13,
20362,
198,
198,
31,
9288,
2488,
259,
18186,
7,
19182,
39317,
13,
7857,
7,
21370,
20,
4008,
24844,
357,
45442,
5317,
7,
20,
828,
8,
198,
31,
9288,
2488,
259,... | 2.707296 | 2,330 |
<reponame>simeonschaub/ReverseModePluto
### A Pluto.jl notebook ###
# v0.18.2
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 ... | [
27,
7856,
261,
480,
29,
82,
524,
684,
11693,
549,
14,
49,
964,
325,
19076,
3646,
9390,
198,
21017,
317,
32217,
13,
20362,
20922,
44386,
198,
2,
410,
15,
13,
1507,
13,
17,
198,
198,
3500,
2940,
2902,
198,
3500,
21365,
18274,
4487,
... | 1.842902 | 26,614 |
@recipe function f(bg::BondGraph)
# Default attributes
nodecolor --> nodecolours(bg.nodes)
title --> bg.name
names --> bg.nodes
# Forced attributes
curves := false
nodeshape := :rect
GraphRecipes.GraphPlot([bg])
end
function nodecolours(nodes)
colours = []
for n in nodes
... | [
31,
29102,
431,
2163,
277,
7,
35904,
3712,
33,
623,
37065,
8,
198,
220,
220,
220,
1303,
15161,
12608,
198,
220,
220,
220,
18666,
721,
45621,
14610,
18666,
721,
349,
4662,
7,
35904,
13,
77,
4147,
8,
198,
220,
220,
220,
3670,
14610,
... | 2.076687 | 326 |
<reponame>xiaodaigh/DataConvenience<filename>test/runtests.jl
using DataConvenience
using Test
include("canonicalcor.jl")
include("janitor.jl")
include("read-csv-in-chunks.jl")
include("test-fsort-dataframes.jl")
include("missing.jl")
include("sample.jl")
@testset "DataConvenience.jl" begin
# Write your own tests... | [
27,
7856,
261,
480,
29,
36072,
11329,
394,
14,
6601,
3103,
574,
1240,
27,
34345,
29,
9288,
14,
81,
2797,
3558,
13,
20362,
198,
3500,
6060,
3103,
574,
1240,
198,
3500,
6208,
198,
198,
17256,
7203,
49883,
605,
10215,
13,
20362,
4943,
... | 2.781513 | 119 |
using PkgTemplates
t = Template(;
user="csimal",
license="MIT",
authors=["<NAME>"],
plugins=[
TravisCI(),
Codecov(),
Coveralls(),
AppVeyor(),
GitHubPages(),
],
)
generate("TestPackage", t)
| [
3500,
350,
10025,
12966,
17041,
198,
198,
83,
796,
37350,
7,
26,
198,
220,
220,
220,
220,
220,
220,
220,
2836,
2625,
6359,
4402,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
5964,
2625,
36393,
1600,
198,
220,
220,
220,
220,
220,
... | 1.770588 | 170 |
<filename>src/classifiers/classifier_randomOC.jl
mutable struct RandomOCClassifier <: OCClassifier
data
outlier_bias
RandomOCClassifier(data) = new(data, 0.1)
RandomOCClassifier(data, pools::Vector) = RandomOCClassifier(data)
RandomOCClassifier(data, outlier_bias::Float64) = new(data, outlier_bias)
... | [
27,
34345,
29,
10677,
14,
4871,
13350,
14,
4871,
7483,
62,
25120,
4503,
13,
20362,
198,
76,
18187,
2878,
14534,
4503,
9487,
7483,
1279,
25,
24775,
9487,
7483,
198,
220,
220,
220,
1366,
198,
220,
220,
220,
503,
2505,
62,
65,
4448,
19... | 2.831915 | 470 |
<gh_stars>0
using PlanningVsCompensatoryCaching
using Test
| [
27,
456,
62,
30783,
29,
15,
198,
3500,
21913,
23266,
7293,
641,
2870,
34,
8103,
198,
3500,
6208,
198
] | 3.105263 | 19 |
<gh_stars>1-10
using LinearAlgebra, Interpolations, Plots
using HA_solver
Model = HA_solver.NCS_growth_params()
HA_solver.Find_eq_NCS_Smolyak(Model)
| [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
3500,
44800,
2348,
29230,
11,
4225,
16104,
602,
11,
1345,
1747,
198,
3500,
14558,
62,
82,
14375,
198,
198,
17633,
796,
14558,
62,
82,
14375,
13,
7792,
50,
62,
27922,
62,
37266,
3419,
198,
... | 2.435484 | 62 |
<gh_stars>0
using LinearAlgebra
using BesselFunctions
using LegendrePolynomials
using QuadGK
using Dierckx
using MsgWrap
####################################
# * Potential funcs
#----------------------------------
Δk_func(k1,k2,cosθ) = sqrt(k2^2 + k1^2 - 2*k1*k2*cosθ)
function VkkFromVΔk(k1, k2, l, VΔk_func)
val... | [
27,
456,
62,
30783,
29,
15,
198,
3500,
44800,
2348,
29230,
198,
3500,
347,
7878,
24629,
2733,
198,
3500,
9883,
260,
34220,
26601,
8231,
198,
3500,
20648,
38,
42,
198,
3500,
360,
959,
694,
87,
198,
3500,
6997,
70,
54,
2416,
198,
198,... | 2.250907 | 3,308 |
<reponame>ACEsuit/ACEatoms.jl
module PairPotentials
include("../ext_imports.jl")
using LinearAlgebra: norm, dot
using JuLIP.Potentials: ZList, SZList, @pot, @D,
PairPotential, SimplePairPotential
using StaticArrays: SMatrix
include("pair_basis.jl")
include("pair_pot.jl")
include("repuls... | [
27,
7856,
261,
480,
29,
11598,
6063,
14,
11598,
265,
3150,
13,
20362,
628,
198,
198,
21412,
39645,
25396,
14817,
198,
198,
17256,
7203,
40720,
2302,
62,
320,
3742,
13,
20362,
4943,
198,
198,
3500,
44800,
2348,
29230,
25,
2593,
11,
166... | 2.385714 | 140 |
using LinearAlgebra: svd, svdvals, cond, pinv, I, diagm
using Statistics
using Distributions
using Random
using JLD
include("../../../Potentials.jl/src/Potentials.jl")
include("solver_utils.jl")
# Parameters
kb = 8.617e-5 # eV/K
Tc = 120.0 # K
μ = 39.948 # u
ϵ ... | [
3500,
44800,
2348,
29230,
25,
264,
20306,
11,
264,
20306,
12786,
11,
1779,
11,
6757,
85,
11,
314,
11,
2566,
363,
76,
198,
3500,
14370,
198,
3500,
46567,
507,
198,
3500,
14534,
198,
3500,
449,
11163,
198,
198,
17256,
7203,
40720,
40720... | 1.914132 | 1,118 |
using HMCExamples
HMCExamples.main_FVGQ_1_kalman(ARGS)
| [
3500,
367,
9655,
27730,
198,
198,
39,
9655,
27730,
13,
12417,
62,
37,
43490,
48,
62,
16,
62,
74,
282,
805,
7,
1503,
14313,
8,
198
] | 2.153846 | 26 |
module EmpiricalCDFs
import Statistics
import Printf
"""
module EmpiricalCDFs
Build and use empirical cumulative distribution functions.
Types/constructors: `AbstractEmpiricalCDF`, `EmpiricalCDF`, `EmpiricalCDFHi`
Functions/methods: Many of the methods defined for `AbstractEmpiricalCDF` are forwarded to the und... | [
21412,
2295,
4063,
605,
34,
8068,
82,
198,
11748,
14370,
198,
11748,
12578,
69,
198,
198,
37811,
198,
220,
220,
220,
8265,
2295,
4063,
605,
34,
8068,
82,
198,
198,
15580,
290,
779,
21594,
23818,
6082,
5499,
13,
198,
198,
31431,
14,
... | 2.793413 | 334 |
struct POWNodeBelief{S,A,O,P}
model::P
a::A # may be needed in push_weighted! and since a is constant for a node, we store it
o::O
dist::CategoricalVector{Tuple{S,Float64}}
POWNodeBelief{S,A,O,P}(m,a,o,d) where {S,A,O,P} = new(m,a,o,d)
function POWNodeBelief{S, A, O, P}(m::P, s::S, a::A, s... | [
7249,
350,
14165,
1098,
12193,
2086,
90,
50,
11,
32,
11,
46,
11,
47,
92,
198,
220,
220,
220,
2746,
3712,
47,
198,
220,
220,
220,
257,
3712,
32,
1303,
743,
307,
2622,
287,
4574,
62,
6551,
276,
0,
290,
1201,
257,
318,
6937,
329,
... | 1.727085 | 971 |
using Random
Random.seed!(7)
dt = 0.01
integration = :rk4
###################
## Parallel Park ##
###################
opts = SolverOptions()
opts.verbose = false
opts.cost_tolerance = 1e-5
opts.cost_tolerance_intermediate = 1e-5
opts.constraint_tolerance = 1e-5
opts.resolve_feasible = true
opts.outer_loop_update_typ... | [
3500,
14534,
198,
29531,
13,
28826,
0,
7,
22,
8,
198,
198,
28664,
796,
657,
13,
486,
198,
18908,
1358,
796,
1058,
81,
74,
19,
198,
198,
14468,
21017,
198,
2235,
42945,
3250,
22492,
198,
14468,
21017,
198,
198,
404,
912,
796,
4294,
... | 2.523256 | 516 |
using Random
export rand_supremacy2d
export pair_supremacy, print_square_bond, cz_entangler
"""
control-Z entangler.
"""
cz_entangler(n::Int, pairs) = chain(n, control(n, [ctrl], target=>Z) for (ctrl, target) in pairs)
"""
rand_supremacy2d(nx::Int, ny::Int, depth::Int; seed=1) -> AbstactBlock
random supremacy cir... | [
3500,
14534,
198,
39344,
43720,
62,
37330,
2787,
1590,
17,
67,
198,
39344,
5166,
62,
37330,
2787,
1590,
11,
3601,
62,
23415,
62,
65,
623,
11,
24785,
62,
298,
49910,
198,
37811,
198,
13716,
12,
57,
920,
49910,
13,
198,
37811,
198,
26... | 1.885915 | 1,420 |
<reponame>isaacsas/ParseRxNetwork.jl
"""
Parsing routines for BioNetGen .net files. Note, this only handles a subset
of the BioNetGen .net file format. In particular, any functions in the file
that use non-Julia expressions (i.e. like conditional logic) or time-dependent
features, will definitely not work.
"""
"""
Se... | [
27,
7856,
261,
480,
29,
9160,
16436,
292,
14,
10044,
325,
49,
87,
26245,
13,
20362,
198,
37811,
198,
47,
945,
278,
31878,
329,
16024,
7934,
13746,
764,
3262,
3696,
13,
5740,
11,
428,
691,
17105,
257,
24637,
198,
1659,
262,
16024,
79... | 2.206937 | 3,373 |
module PkgButlerEngine
import Mustache
import Pkg
function configure_pkg(path::AbstractString; channel=:auto)
channel in (:auto, :stable, :dev) || error("Invalid value for channel.")
path_for_butler_workflows_folder = joinpath(path, ".github", "workflows")
path_for_main_butler_workflow = joinpath(path_f... | [
21412,
350,
10025,
1537,
1754,
13798,
198,
198,
11748,
12039,
4891,
198,
11748,
350,
10025,
198,
198,
8818,
17425,
62,
35339,
7,
6978,
3712,
23839,
10100,
26,
6518,
28,
25,
23736,
8,
198,
220,
220,
220,
6518,
287,
357,
25,
23736,
11,
... | 2.249123 | 2,280 |
import Pkg
Pkg.activate(".")
Pkg.instantiate()
include("src/ForwardCurveSmoother.jl")
# If the packages below are not yet installed, you must install it once using the following command:
# Pkg.add("DataFrames")
# Pkg.add("CSV")
# After the installation, run the commands below to load the package.
using DataFrames
usi... | [
11748,
350,
10025,
198,
47,
10025,
13,
39022,
7203,
19570,
198,
47,
10025,
13,
8625,
415,
9386,
3419,
198,
198,
17256,
7203,
10677,
14,
39746,
26628,
303,
50,
5908,
847,
13,
20362,
4943,
198,
198,
2,
1002,
262,
10392,
2174,
389,
407,
... | 2.646361 | 1,264 |
"""
Various macro helpers.
"""
module Macros
using Genie, Genie.Configuration
export @devtools, @ifdevtools
export @run_with_time, @unless, @psst, @in_repl, @location_in_file
"""
devtools()
Injects modules to be used in development mode, such as the `Gallium` debugger.
To be used as a concise one liner to inclu... | [
37811,
198,
40009,
15021,
49385,
13,
198,
37811,
198,
21412,
4100,
4951,
198,
198,
3500,
49405,
11,
49405,
13,
38149,
198,
198,
39344,
2488,
7959,
31391,
11,
2488,
361,
7959,
31391,
198,
39344,
2488,
5143,
62,
4480,
62,
2435,
11,
2488,
... | 2.71134 | 582 |
<reponame>ChitambarLab/CVChannel.jl
using LinearAlgebra
using CVChannel
using Convex
using Test
using DelimitedFiles
"""
This code first verifies the non-multiplicativity of the Werner-Holevo over the PPT
cone when tensored with the identity. This is different than over the separable cone.
We verify this using an a li... | [
27,
7856,
261,
480,
29,
1925,
270,
4131,
283,
17822,
14,
33538,
29239,
13,
20362,
198,
3500,
44800,
2348,
29230,
198,
3500,
26196,
29239,
198,
3500,
1482,
303,
87,
198,
3500,
6208,
198,
3500,
4216,
320,
863,
25876,
198,
198,
37811,
19... | 2.128286 | 1,902 |
<gh_stars>1-10
#
# vectors.jl -
#
# Implement basic operations for *vectors*. Here arrays of any rank are
# considered as *vectors*, the only requirements are that, when combining
# *vectors*, they have the same list of axes (i.e. the same dimensions for
# most arrays). These methods are intended to be used for numer... | [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
2,
198,
2,
30104,
13,
20362,
532,
198,
2,
198,
2,
48282,
4096,
4560,
329,
1635,
303,
5217,
24620,
220,
3423,
26515,
286,
597,
4279,
389,
198,
2,
3177,
355,
1635,
303,
5217,
25666,
262,
6... | 2.156592 | 10,224 |
using Documenter
using FundamentalsNumericalComputation
Documenter.Writers.HTMLWriter.HTML(sidebar_sitename=false)
makedocs(
sitename = "FNC Functions",
format = Documenter.HTML(),
modules = [FundamentalsNumericalComputation],
pages = [
"index.md",
"Functions" => "functions.md",
]
)... | [
3500,
16854,
263,
198,
3500,
7557,
3263,
874,
45,
6975,
605,
5377,
1996,
341,
198,
198,
24941,
263,
13,
20257,
364,
13,
28656,
34379,
13,
28656,
7,
1589,
5657,
62,
48937,
12453,
28,
9562,
8,
198,
76,
4335,
420,
82,
7,
198,
220,
22... | 2.745763 | 236 |
module MPC
using MPFR
export
MPCComplex,
prec,
prec2,
get_default_precision,
set_default_precision,
with_precision
import
Base.(*),
Base.+,
Base.-,
Base./,
Base.<,
Base.<<,
Base.>>,
Base.<=,
Base.==,
Base.>,
Base.>=,
Base.^,
Base.(~),
... | [
21412,
4904,
34,
198,
3500,
4904,
10913,
198,
198,
39344,
198,
220,
220,
220,
4904,
4093,
296,
11141,
11,
198,
220,
220,
220,
3718,
11,
198,
220,
220,
220,
3718,
17,
11,
198,
220,
220,
220,
651,
62,
12286,
62,
3866,
16005,
11,
198... | 2.035156 | 4,864 |
<gh_stars>1-10
using ESDLZarr
using ESDL
using Zarr
@static if VERSION < v"0.7.0-DEV.2005"
using Base.Test
else
using Test
end
c1 = Cube("/BGI/scratch/DataCube/v1.0.0/low-res/")
d1 = getCubeData(c1,variable="air_temperature_2m",longitude=(30,31),latitude=(50,51),time=(Date("2002-01-01"),Date("2008-12-31")))
... | [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
3500,
412,
10305,
43,
57,
3258,
198,
3500,
412,
10305,
43,
198,
3500,
1168,
3258,
198,
31,
12708,
611,
44156,
2849,
1279,
410,
1,
15,
13,
22,
13,
15,
12,
39345,
13,
14315,
1,
198,
220,
... | 2.114391 | 271 |
function test_print(name, value)
println("=================================================================")
println(name)
println(value)
println("-----------------------------------------------------------------")
end # test_print
| [
8818,
1332,
62,
4798,
7,
3672,
11,
1988,
8,
198,
220,
220,
220,
44872,
7203,
23926,
2625,
8,
198,
220,
220,
220,
44872,
7,
3672,
8,
198,
220,
220,
220,
44872,
7,
8367,
8,
198,
220,
220,
220,
44872,
7203,
10097,
12,
4943,
198,
43... | 4.98 | 50 |
<reponame>UnofficialJuliaMirrorSnapshots/Bootstrap.jl-e28b5b4c-05e8-5b66-bc03-6f0c0a0a06e0
import Base.@deprecate
import Base.depwarn
# ci -> confint
@deprecate ci(bs::BootstrapSample, cim::ConfIntMethod) confint(bs, cim)
@deprecate ci(bs::BootstrapSample, cim::ConfIntMethod, i::Int) confint(bs, cim, i)
@deprecate ci(... | [
27,
7856,
261,
480,
29,
3118,
16841,
16980,
544,
27453,
1472,
43826,
20910,
14,
36476,
26418,
13,
20362,
12,
68,
2078,
65,
20,
65,
19,
66,
12,
2713,
68,
23,
12,
20,
65,
2791,
12,
15630,
3070,
12,
21,
69,
15,
66,
15,
64,
15,
64... | 2.652174 | 322 |
export iauUt1utc
"""
Time scale transformation: Universal Time, UT1, to Coordinated
Universal Time, UTC.
This function is part of the International Astronomical Union's
SOFA (Standards of Fundamental Astronomy) software collection.
Status: canonical.
Given:
ut11,ut12 double UT1 as a 2-part Julian Date (Note ... | [
39344,
220,
544,
84,
18274,
16,
315,
66,
198,
37811,
198,
7575,
5046,
13389,
25,
220,
14499,
3862,
11,
19255,
16,
11,
284,
22819,
3898,
198,
38747,
3862,
11,
18119,
13,
198,
198,
1212,
2163,
318,
636,
286,
262,
4037,
25398,
22545,
4... | 2.721747 | 1,053 |
<gh_stars>0
using Base.Threads: lock, unlock, SpinLock
const _lock = SpinLock()
const CacheComplexityThres = 32
const CacheComplexityDepthFactor = 2
const RevShiftBits = 2
const ShiftBits = sizeof(UInt) * 8 - RevShiftBits
const HAS_FLAGS = UInt(0b11) << ShiftBits
struct BitsValue{L}
value::L
end
const FLAGS = (A... | [
27,
456,
62,
30783,
29,
15,
198,
3500,
7308,
13,
16818,
82,
25,
5793,
11,
12116,
11,
28002,
25392,
198,
9979,
4808,
5354,
796,
28002,
25392,
3419,
198,
198,
9979,
34088,
5377,
11141,
414,
817,
411,
796,
3933,
198,
9979,
34088,
5377,
... | 2.210102 | 2,851 |
# --------------------------------------------------------------
# Methods to automatically generate colorschemes for color selection based on
# background color and a short list of seed colors
# here are some magic constants that could be changed if you really want
const _lightness_darkbg = [80.0]
const _lightness_... | [
198,
2,
20368,
1783,
26171,
198,
198,
2,
25458,
284,
6338,
7716,
7577,
2395,
6880,
329,
3124,
6356,
1912,
319,
198,
2,
4469,
3124,
290,
257,
1790,
1351,
286,
9403,
7577,
198,
198,
2,
994,
389,
617,
5536,
38491,
326,
714,
307,
3421,
... | 2.259314 | 1,342 |
<filename>bioinformatics/QpcrAnalysis/defines/StandardCurveResult.jl
#===============================================================================
StandardCurveResult.jl
Author: <NAME>
Date: Dec 2018
===============================================================================#
abstract type Stan... | [
27,
34345,
29,
65,
952,
259,
18982,
873,
14,
48,
79,
6098,
32750,
14,
4299,
1127,
14,
23615,
26628,
303,
23004,
13,
20362,
198,
2,
23926,
25609,
18604,
628,
220,
220,
220,
8997,
26628,
303,
23004,
13,
20362,
628,
220,
220,
220,
6434... | 2.657233 | 318 |
<reponame>gcalderone/GFit.jl
using MacroTools
macro internal_patch!(assert_existence, _expr)
expr = prettify(_expr)
mname = Symbol[]
check = Expr[]
fixed = Expr[]
function extract_param_expr(ex::Expr)
if (ex.head == :.) &&
(length(ex.args) == 2)
cname =... | [
27,
7856,
261,
480,
29,
70,
9948,
1082,
505,
14,
21713,
270,
13,
20362,
198,
3500,
42755,
33637,
198,
198,
20285,
305,
5387,
62,
17147,
0,
7,
30493,
62,
41084,
11,
4808,
31937,
8,
198,
220,
220,
220,
44052,
796,
46442,
1958,
28264,
... | 1.753949 | 1,646 |
<reponame>PierreBarrat/RecombTools<gh_stars>1-10
"""
Core function for computing splits in MCCs. Include root of MCC if it's not root of tree.
"""
function _splits_in_mcc(
m::Array{<:AbstractString},
t::Tree,
leaves::Array{<:AbstractString},
leafmap::Dict
)
# Mask corresponding to leaves in the MCC
mask = z... | [
27,
7856,
261,
480,
29,
36910,
33,
3258,
265,
14,
6690,
2381,
33637,
27,
456,
62,
30783,
29,
16,
12,
940,
198,
37811,
198,
14055,
2163,
329,
14492,
30778,
287,
337,
4093,
82,
13,
40348,
6808,
286,
337,
4093,
611,
340,
338,
407,
68... | 2.435789 | 1,425 |
<reponame>bionanoimaging/PSFDistiller.jl<gh_stars>0
export align_all, distille_PSF, nn_mutual, select_rois, clear_border, border_dist, remove_border, precise_extract
"""
align_all(rois; shifts=nothing, optimizer=LBFGS(), iterations=500, verbose=false)
aligns a series of regions of interest `rois` of equal sizes t... | [
27,
7856,
261,
480,
29,
65,
295,
5733,
320,
3039,
14,
3705,
37,
20344,
4665,
13,
20362,
27,
456,
62,
30783,
29,
15,
198,
39344,
10548,
62,
439,
11,
1233,
8270,
62,
3705,
37,
11,
299,
77,
62,
21973,
723,
11,
2922,
62,
305,
271,
... | 2.495329 | 4,175 |
<gh_stars>1-10
# Helper type
# n-face of the polytope, i.e., any polytope of lower dimension `N` representing
# its boundary and the polytope itself (for `N` equal to the space dimension `D`)
struct NFace{D}
anchor::Point{D,Int}
extrusion::Point{D,Int}
end
"""
struct ExtrusionPolytope{D} <: Polytope{D}
... | [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
198,
2,
5053,
525,
2099,
198,
2,
299,
12,
2550,
286,
262,
7514,
83,
3008,
11,
1312,
13,
68,
1539,
597,
7514,
83,
3008,
286,
2793,
15793,
4600,
45,
63,
10200,
198,
2,
663,
18645,
290,
2... | 2.133017 | 6,112 |
using DifferentialEquations
using Test
using MRIgeneralizedBloch
using MRIgeneralizedBloch: apply_hamiltonian_graham_superlorentzian!
##
max_error = 5e-2
## set parameters
ω1 = π / 500e-6
ω0 = 200.0
B1 = 1.0
m0s = 0.15
R1f = 0.3
R1s = 2.0
R2f = 1 / 65e-3
T2s = 10e-6
Rx = 30.0
TRF = 500e-6
alg = Tsit5()
## baseline ... | [
3500,
20615,
498,
23588,
602,
198,
3500,
6208,
198,
3500,
30278,
24622,
1143,
3629,
5374,
198,
3500,
30278,
24622,
1143,
3629,
5374,
25,
4174,
62,
2763,
9044,
666,
62,
70,
13220,
62,
16668,
31131,
429,
89,
666,
0,
198,
198,
2235,
220,... | 1.740598 | 5,690 |
<filename>src/ShallowWaters.jl
module ShallowWaters
export run_model, Parameter, ∂x, ∂y, Ix, Iy, ∇²
using NetCDF, Parameters, Printf, Dates, Interpolations
include("default_parameters.jl")
include("grid.jl")
include("constants.jl")
include("forcing.jl")
include("model_setup.jl")
inclu... | [
27,
34345,
29,
10677,
14,
2484,
12154,
54,
8605,
13,
20362,
198,
21412,
911,
12154,
54,
8605,
628,
220,
220,
220,
10784,
1057,
62,
19849,
11,
25139,
2357,
11,
18872,
224,
87,
11,
18872,
224,
88,
11,
314,
87,
11,
314,
88,
11,
18872... | 2.498371 | 307 |
<reponame>pdbartlett/misc-stuff<gh_stars>0
pint(s) = parse(Int, s)
max = 0
for a = 1:100, b = 1:100
global max
n = BigInt(a) ^ BigInt(b)
digits = split(string(n), "")
s = sum(pint, digits)
if s > max
max = s
end
end
println(max) | [
27,
7856,
261,
480,
29,
79,
9945,
433,
15503,
14,
44374,
12,
41094,
27,
456,
62,
30783,
29,
15,
198,
79,
600,
7,
82,
8,
796,
21136,
7,
5317,
11,
264,
8,
198,
198,
9806,
796,
657,
198,
1640,
257,
796,
352,
25,
3064,
11,
275,
... | 2.130435 | 115 |
<gh_stars>10-100
# bookkeeping data for a screen
# Screen is unique also in that its instantiation requires a window. It's because often we'd simply
# supply the rootwin that has already been created.
function newTwScreen( win::Ptr{Void} )
obj = TwObj( TwScreenData(), Val{ :Screen } )
begy, begx = getwinbegyx(... | [
27,
456,
62,
30783,
29,
940,
12,
3064,
198,
2,
1492,
19934,
1366,
329,
257,
3159,
198,
198,
2,
15216,
318,
3748,
635,
287,
326,
663,
9113,
3920,
4433,
257,
4324,
13,
632,
338,
780,
1690,
356,
1549,
2391,
198,
2,
5127,
262,
6808,
... | 1.973815 | 5,614 |
<gh_stars>10-100
using GenomicFeatures
using Test
using Documenter
import Random
include(joinpath(@__DIR__, "Utilities.jl"))
import .Utilities: random_intervals
# Test that an array of intervals is well ordered
function is_all_ordered(intervals::Vector{I}) where I <: Interval
for i = 2:length(intervals)
... | [
27,
456,
62,
30783,
29,
940,
12,
3064,
198,
3500,
5215,
10179,
23595,
198,
3500,
6208,
198,
3500,
16854,
263,
198,
198,
11748,
14534,
198,
198,
17256,
7,
22179,
6978,
7,
31,
834,
34720,
834,
11,
366,
18274,
2410,
13,
20362,
48774,
1... | 2.115181 | 6,607 |
<filename>src/jld22sac.jl
export jld22sac
#
using Dates, SeisIO, JLD2, SeisNoise, Sockets, Logging
"""
Converting JLD2 format to sac files. There are options to read in JLD2 data
in different types: SeisData (defined in SeisIO) and CorrData (defined in SeisNoise).
"""
#base function to output usage information... | [
27,
34345,
29,
10677,
14,
73,
335,
1828,
30584,
13,
20362,
198,
39344,
474,
335,
1828,
30584,
198,
2,
198,
3500,
44712,
11,
1001,
271,
9399,
11,
449,
11163,
17,
11,
1001,
271,
2949,
786,
11,
311,
11603,
11,
5972,
2667,
198,
37811,
... | 1.736476 | 5,176 |
<reponame>wwangnju/ExactDiagonalization.jl<gh_stars>0
module Perturbation
using Printf: @printf, @sprintf
#using QuantumLattices:
using ExactDiagonalization.FEDW: matrix, NCBasis
using ExactDiagonalization.FED: FockBasis
using LinearAlgebra: diagm,eigen,Hermitian
import ExactDiagonalization.FEDW: bkron,boplus,dimensi... | [
27,
7856,
261,
480,
29,
1383,
648,
77,
14396,
14,
3109,
529,
18683,
27923,
1634,
13,
20362,
27,
456,
62,
30783,
29,
15,
198,
21412,
350,
861,
5945,
341,
198,
3500,
12578,
69,
25,
2488,
37435,
11,
2488,
82,
37435,
198,
2,
3500,
290... | 2.190275 | 3,558 |
# Note that this script can accept some limited command-line arguments, run
# `julia build_tarballs.jl --help` to see a usage message.
using BinaryBuilder, Pkg
name = "LoopTools"
version = v"2.15"
# Collection of sources required to complete build
sources = [
ArchiveSource("http://www.feynarts.de/looptools/LoopTo... | [
2,
5740,
326,
428,
4226,
460,
2453,
617,
3614,
3141,
12,
1370,
7159,
11,
1057,
198,
2,
4600,
73,
43640,
1382,
62,
18870,
21591,
13,
20362,
1377,
16794,
63,
284,
766,
257,
8748,
3275,
13,
198,
3500,
45755,
32875,
11,
350,
10025,
198,... | 2.803797 | 632 |
<reponame>UnofficialJuliaMirrorSnapshots/PatternDispatch.jl-ce139433-ee8c-55ca-82ca-af437e33ffbc
module PartialOrder
export subDAGof, ordered_subDAGof, copyDAG, raw_filter!
type Node{T}
value::T
gt::Set{Node{T}}
Node(value) = new(value, Set{Node{T}}())
Node(value, gt) = new(value, gt)
end
Node{T}... | [
27,
7856,
261,
480,
29,
3118,
16841,
16980,
544,
27453,
1472,
43826,
20910,
14,
47546,
49354,
13,
20362,
12,
344,
1485,
5824,
2091,
12,
1453,
23,
66,
12,
2816,
6888,
12,
6469,
6888,
12,
1878,
43284,
68,
2091,
487,
15630,
198,
198,
2... | 2.138765 | 1,117 |
using LinearAlgebra
struct ValueOne; end
ValueOne()
# Compute X <- a X + b I.
function matfun_axpby!(X,a,b,Y::UniformScaling)
m,n=size(X)
if ~(a isa ValueOne)
rmul!(X,a)
end
@inbounds for i=1:n
X[i,i]+=(b isa ValueOne) ? 1 : b
end
end
@inline function exp_sastre_opt_rho1_9(A)
... | [
3500,
44800,
2348,
29230,
198,
198,
7249,
11052,
3198,
26,
886,
198,
11395,
3198,
3419,
198,
198,
2,
3082,
1133,
1395,
24293,
257,
1395,
1343,
275,
314,
13,
198,
8818,
2603,
12543,
62,
897,
79,
1525,
0,
7,
55,
11,
64,
11,
65,
11,
... | 1.896955 | 2,824 |
<gh_stars>0
module OpenSpiel
include("$(@__DIR__)/../deps/deps.jl")
using CxxWrap
import CxxWrap:argument_overloads
@wrapmodule(LIB_OPEN_SPIEL)
include("patch.jl")
# export all
for n in names(@__MODULE__(); all=true)
if Base.isidentifier(n) &&
!startswith(String(n), "_") &&
n ∉ (Symbol(@__MODUL... | [
27,
456,
62,
30783,
29,
15,
198,
21412,
4946,
4561,
8207,
198,
198,
17256,
7203,
3,
7,
31,
834,
34720,
834,
20679,
40720,
10378,
82,
14,
10378,
82,
13,
20362,
4943,
198,
198,
3500,
327,
5324,
54,
2416,
198,
11748,
327,
5324,
54,
2... | 2.168367 | 196 |
<filename>src/watch.jl
# module Jive
using FileWatching
const watched_folders = Dict{String, Tuple{FolderMonitor,Task}}()
"""
watch(callback::Function, dir::String; targets=ARGS, sources::Union{Vector{Any},Vector{String}}=[])
watch the folders.
"""
function watch(callback::Function, dir::String; targets=ARGS, s... | [
27,
34345,
29,
10677,
14,
8340,
13,
20362,
198,
2,
8265,
449,
425,
198,
198,
3500,
9220,
10723,
278,
198,
198,
9979,
7342,
62,
11379,
364,
796,
360,
713,
90,
10100,
11,
309,
29291,
90,
41092,
35479,
11,
25714,
11709,
3419,
198,
198,... | 2.122881 | 1,180 |
# transact helper method
function transact(fa::FinancialAsset, qty::Int, fill::Float64)
if fa.quantity + qty == 0
fa.basis = 0
fa.quantity = 0
else
fa.basis = ((fa.basis * fa.quantity) + (fill * qty)) / (fa.quantity + qty)
fa.quantity += qty
end
fa
end
| [
2,
48878,
31904,
2446,
198,
198,
8818,
48878,
7,
13331,
3712,
43621,
45869,
11,
10662,
774,
3712,
5317,
11,
6070,
3712,
43879,
2414,
8,
198,
220,
220,
220,
611,
24685,
13,
40972,
414,
1343,
10662,
774,
6624,
657,
198,
220,
220,
220,
... | 2.148936 | 141 |
# This is test of the code for computing a transit model integrated over a time step.
# Computes derivatives over the timestep.
using PyPlot
#include("../src/integrate_transit_cubature.jl")
#include("../src/integrate_transit_simpson_vec.jl")
include("integrate_transit_simpson.jl")
# Test it out:
include("../../test/... | [
2,
770,
318,
1332,
286,
262,
2438,
329,
14492,
257,
11168,
2746,
11521,
625,
257,
640,
2239,
13,
198,
2,
3082,
1769,
28486,
625,
262,
4628,
395,
538,
13,
198,
3500,
9485,
43328,
198,
198,
2,
17256,
7203,
40720,
10677,
14,
18908,
487... | 1.938969 | 2,212 |
# This file was generated by the Julia Swagger Code Generator
# Do not modify this file directly. Modify the swagger specification instead.
mutable struct ExpressRouteCircuitArpTable <: SwaggerModel
age::Any # spec type: Union{ Nothing, Int32 } # spec name: age
interface::Any # spec type: Union{ Nothing, Str... | [
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,
10604,
43401,
31560,
5013,
3163,
79,
10962... | 3.133053 | 714 |
# Use baremodule to shave off a few KB from the serialized `.ji` file
baremodule librdkafka_jll
using Base
using Base: UUID
import JLLWrappers
JLLWrappers.@generate_main_file_header("librdkafka")
JLLWrappers.@generate_main_file("librdkafka", UUID("7943bfb0-7437-5acd-a008-22777931c7aa"))
end # module librdkafka_jll
| [
2,
5765,
6247,
21412,
284,
34494,
572,
257,
1178,
14204,
422,
262,
11389,
1143,
4600,
13,
7285,
63,
2393,
198,
49382,
21412,
300,
2889,
34388,
1878,
4914,
62,
73,
297,
198,
3500,
7308,
198,
3500,
7308,
25,
471,
27586,
198,
11748,
449,... | 2.465116 | 129 |
<reponame>gabrielgellner/OdinSon
using OdinSon
#=
# parameters common to containers
- limits
- xlim
- ylim
=#
GraphicsView # plot container without axes/scales
AxesView # with axes/scale
# should have a axes setting parameters
| [
27,
7856,
261,
480,
29,
70,
397,
11719,
469,
297,
1008,
14,
46,
25194,
31056,
198,
3500,
19758,
31056,
198,
198,
2,
28,
198,
2,
10007,
2219,
284,
16472,
198,
12,
7095,
198,
220,
220,
220,
532,
2124,
2475,
198,
220,
220,
220,
532,
... | 2.975309 | 81 |
using QuantumControlBase.QuantumPropagators: propstep!, write_to_storage!, get_from_storage!
using QuantumControlBase: evalcontrols!
using QuantumControlBase.Functionals: make_chi
using QuantumControlBase.ConditionalThreads: @threadsif
using LinearAlgebra
using Printf
"""Optimize a control problem using Krotov's meth... | [
3500,
29082,
15988,
14881,
13,
24915,
388,
24331,
363,
2024,
25,
2632,
9662,
28265,
3551,
62,
1462,
62,
35350,
28265,
651,
62,
6738,
62,
35350,
0,
198,
3500,
29082,
15988,
14881,
25,
5418,
13716,
82,
0,
198,
3500,
29082,
15988,
14881,
... | 2.025914 | 5,634 |
<gh_stars>1-10
# This is part of Calendars.jl. See the copyright note there.
# ===================== European calendar ===================
# The Gregorian calendar is used for dates on and after
# CE 1582-10-15, otherwise the Julian calendar is used.
# Is the date a valid European date?
function isValidDateEuropean... | [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
2,
770,
318,
636,
286,
2199,
44942,
13,
20362,
13,
4091,
262,
6634,
3465,
612,
13,
198,
2,
36658,
1421,
3427,
11845,
36658,
855,
198,
198,
2,
383,
8547,
22618,
11845,
318,
973,
329,
9667,
... | 2.793632 | 848 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.