content stringlengths 6 1.03M | input_ids listlengths 4 535k | ratio_char_token float64 0.68 8.61 | token_count int64 4 535k |
|---|---|---|---|
"""
fm = parse_source(filename::AbstractString, mod::Module)
Parse the source `filename`, returning a [`FileModules`](@ref) `fm`.
`mod` is the "parent" module for the file (i.e., the one that `include`d the file);
if `filename` defines more module(s) then these will all have separate entries in `fm`.
If parsing `... | [
37811,
198,
220,
220,
220,
277,
76,
796,
21136,
62,
10459,
7,
34345,
3712,
23839,
10100,
11,
953,
3712,
26796,
8,
198,
198,
10044,
325,
262,
2723,
4600,
34345,
47671,
8024,
257,
685,
63,
8979,
5841,
5028,
63,
16151,
31,
5420,
8,
460... | 2.298381 | 4,015 |
<reponame>jakubMitura14/NuclearMedEval
module MainLoopKernel
using CUDA, Logging,..CUDAGpuUtils, ..ResultListUtils,..WorkQueueUtils,..ScanForDuplicates, Logging,StaticArrays, ..IterationUtils, ..ReductionUtils, ..CUDAAtomicUtils,..MetaDataUtils
using ..BitWiseUtils,..MetadataAnalyzePass, ..ScanForDuplicates, ..ProcessM... | [
27,
7856,
261,
480,
29,
73,
461,
549,
43339,
5330,
1415,
14,
45,
4016,
9921,
36,
2100,
198,
21412,
8774,
39516,
42,
7948,
198,
3500,
29369,
5631,
11,
5972,
2667,
11,
492,
34,
8322,
4760,
19944,
18274,
4487,
11,
11485,
23004,
8053,
1... | 2.576777 | 6,838 |
<gh_stars>0
function ontologygraphs(ontol)
Dict("P" => ontologygraph(ontol, biological_process),
"F" => ontologygraph(ontol, molecular_function),
"C" => ontologygraph(ontol, cellular_component))
end
function ontologygraph(ontol, ontology=biological_process)
gids = collect(Iterators.filter(... | [
27,
456,
62,
30783,
29,
15,
628,
198,
8818,
39585,
1435,
34960,
82,
7,
756,
349,
8,
198,
220,
220,
220,
360,
713,
7203,
47,
1,
5218,
39585,
1435,
34960,
7,
756,
349,
11,
10685,
62,
14681,
828,
198,
220,
220,
220,
220,
220,
220,
... | 2.063218 | 1,044 |
<gh_stars>1-10
"""
CovMoment(f; m = 0)
Calculate the spectural densitiy matrix - p.190 equation (145) in Cochrane (2000)
INPUT
`f`: T x q array of q moment conditions
`cov_method': method for calculating the variance-covariance matrix of the error terms:
- time iid: error terms are iid across time but cro... | [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
37811,
198,
34,
709,
29252,
298,
7,
69,
26,
285,
796,
657,
8,
198,
198,
9771,
3129,
378,
262,
5444,
1523,
29509,
270,
7745,
17593,
532,
279,
13,
19782,
16022,
357,
18781,
8,
287,
33005,
... | 2.276973 | 621 |
"""
set_root!(tree::BnBTree, node_info::NamedTuple)
Set the root node information based on the `node_info` which needs to include the same fields as the `Node` struct given
to the [`initialize`](@ref) method. (Besides the `std` field which is set by Bonobo automatically)
# Example
If your node structure is the f... | [
37811,
198,
220,
220,
220,
900,
62,
15763,
0,
7,
21048,
3712,
33,
77,
19313,
631,
11,
10139,
62,
10951,
3712,
45,
2434,
51,
29291,
8,
198,
198,
7248,
262,
6808,
10139,
1321,
1912,
319,
262,
4600,
17440,
62,
10951,
63,
543,
2476,
2... | 2.591111 | 900 |
<reponame>jpjones76/SeisIO.jl
export demean!, demean, detrend!, detrend
@doc """
demean!(S::SeisData[; chans=CC, irr=false])
Remove the mean from all channels `i` with `S.fs[i] > 0.0`. Specify `irr=true`
to also remove the mean from irregularly sampled channels (with S.fs[i] == 0.0).
Specifying a channel list wit... | [
27,
7856,
261,
480,
29,
34523,
73,
1952,
4304,
14,
4653,
271,
9399,
13,
20362,
198,
39344,
1357,
11025,
28265,
1357,
11025,
11,
1062,
10920,
28265,
1062,
10920,
198,
198,
31,
15390,
37227,
198,
220,
220,
220,
1357,
11025,
0,
7,
50,
... | 2.058983 | 1,848 |
<gh_stars>0
using Test
using Neo4jBolt
# Unit Tests
println("Unit Tests")
include("unit/test_api.jl")
include("unit/test_record.jl")
include("unit/test_security.jl")
include("unit/test_types.jl")
# Integration Tests Using Local Neo4j Database
println("Integration Tests")
struct TestCase
driver
end
functio... | [
27,
456,
62,
30783,
29,
15,
198,
3500,
6208,
198,
198,
3500,
21227,
19,
73,
33,
5978,
198,
198,
2,
11801,
30307,
198,
35235,
7203,
26453,
30307,
4943,
198,
198,
17256,
7203,
20850,
14,
9288,
62,
15042,
13,
20362,
4943,
198,
17256,
7... | 2.870293 | 239 |
<gh_stars>0
@testset "Image Partitioning" begin
img = testimage("mandrill")
# Window size divides image size without remainder.
subdivision = partition_image(AllowContraction(), img, 32)
size(subdivision) == (16,16)
for i in subdivision
@test length.(i) == (32,32)
end
# Window size... | [
27,
456,
62,
30783,
29,
15,
198,
198,
31,
9288,
2617,
366,
5159,
2142,
653,
278,
1,
2221,
198,
220,
220,
220,
33705,
796,
8844,
496,
7203,
22249,
20190,
4943,
198,
220,
220,
220,
1303,
26580,
2546,
36319,
2939,
2546,
1231,
17675,
13... | 1.977011 | 435 |
# Autogenerated thin wrapper around CNOVAS using Clang.jl
module LibNOVAS
using NOVAS_jll
export NOVAS_jll
using CEnum
function solarsystem(tjd, body, origin, position, velocity)
return ccall((:solarsystem, libnovas), Cshort,
(Cdouble, Cshort, Cshort, Ptr{Cdouble}, Ptr{Cdouble}), tjd, body, orig... | [
2,
5231,
519,
877,
515,
7888,
29908,
1088,
31171,
8874,
1921,
1262,
1012,
648,
13,
20362,
198,
21412,
7980,
45,
8874,
1921,
198,
198,
3500,
8005,
53,
1921,
62,
73,
297,
198,
39344,
8005,
53,
1921,
62,
73,
297,
198,
198,
3500,
327,
... | 2.051555 | 9,679 |
<reponame>MatthiasJReisinger/PollyBenchmarks.jl<filename>src/stencils/seidel-2d.jl<gh_stars>1-10
@polly function kernel_seidel_2d(tsteps, A)
n = size(A,1)
for t = 1:tsteps, i = 2:(n-1), j = 2:(n-1)
A[i,j] = (A[i-1,j-1] + A[i-1,j] + A[i-1,j+1] + A[i,j-1] + A[i,j] + A[i,j+1] + A[i+1,j-1] + A[i+1,j] + A[i... | [
27,
7856,
261,
480,
29,
19044,
400,
4448,
41,
3041,
1710,
263,
14,
47,
5098,
44199,
14306,
13,
20362,
27,
34345,
29,
10677,
14,
26400,
2856,
82,
14,
325,
5943,
12,
17,
67,
13,
20362,
27,
456,
62,
30783,
29,
16,
12,
940,
198,
31,... | 1.694118 | 340 |
<reponame>hildebrandmw/Persistence.jl<filename>test/runtests.jl
using Persistence
using Test
include("lib.jl")
include("transactions.jl")
include("persist.jl")
| [
27,
7856,
261,
480,
29,
71,
44725,
17938,
76,
86,
14,
30946,
13274,
13,
20362,
27,
34345,
29,
9288,
14,
81,
2797,
3558,
13,
20362,
198,
3500,
9467,
13274,
198,
3500,
6208,
198,
198,
17256,
7203,
8019,
13,
20362,
4943,
198,
17256,
72... | 2.824561 | 57 |
<filename>test/poissonbinomial.jl
using Distributions
using Base.Test
# Test the special base where PoissonBinomial distribution reduces
# to Binomial distribution
for (p, n) in [(0.8, 6), (0.5, 10), (0.04, 20)]
d = PoissonBinomial(fill(p, n))
dref = Binomial(n, p)
println(" testing PoissonBinomial p=$... | [
27,
34345,
29,
9288,
14,
7501,
30927,
8800,
49070,
13,
20362,
198,
3500,
46567,
507,
198,
3500,
7308,
13,
14402,
198,
198,
2,
6208,
262,
2041,
2779,
810,
7695,
30927,
33,
259,
49070,
6082,
12850,
220,
198,
2,
284,
20828,
49070,
6082,
... | 1.986717 | 527 |
using FlightMechanics
using FlightMechanics.Models
using Dierckx
##----------------------------------------------------------------------------------------------------
## imports
# Aerodynamics
import FlightMechanics.Models:
calculate_aerodynamics
# Propulsion
import FlightMechanics.Models:
get_pfm, get_cj, ... | [
3500,
13365,
28452,
272,
873,
198,
3500,
13365,
28452,
272,
873,
13,
5841,
1424,
198,
3500,
360,
959,
694,
87,
198,
198,
2235,
10097,
3880,
650,
198,
2235,
17944,
198,
198,
2,
15781,
44124,
198,
11748,
13365,
28452,
272,
873,
13,
5841... | 1.937789 | 8,439 |
module DungAnalyse
using DungBase, ProgressMeter, DelimitedFiles, ProgressMeter
# import Base.Threads: @spawn, @threads
export main, homing, searching, searchcenter, turningpoint
include("load_from_csv.jl")
include("ffmpeg.jl")
include("calibrate.jl")
include("common.jl")
function temp2pixel(coffeesource, temporal2... | [
21412,
360,
2150,
37702,
325,
198,
198,
3500,
360,
2150,
14881,
11,
18387,
44,
2357,
11,
4216,
320,
863,
25876,
11,
18387,
44,
2357,
198,
2,
1330,
7308,
13,
16818,
82,
25,
2488,
48183,
11,
2488,
16663,
82,
198,
198,
39344,
1388,
11,... | 2.585098 | 1,275 |
<reponame>byuflowlab/ning2020-bem<filename>hover.jl
using CCBlade
using Statistics: mean
# Comparison using geometry and data from)
# https://rotorcraft.arc.nasa.gov/Publications/files/RamasamyGB_ERF10_836.pdf
# add an "overloaded" function to handle the tip loss used just for hover)
function solvehover(rotor, secti... | [
27,
7856,
261,
480,
29,
1525,
84,
2704,
4883,
397,
14,
768,
42334,
12,
65,
368,
27,
34345,
29,
43753,
13,
20362,
198,
3500,
12624,
47520,
198,
3500,
14370,
25,
1612,
198,
198,
2,
34420,
1262,
22939,
290,
1366,
422,
8,
198,
2,
3740... | 2.044068 | 6,490 |
using PPInterpolation
import AQFED.TermStructure:
TSBlackModel, varianceByLogmoneyness, discountFactor, logForward, forward
#Runge-Kutta-Legendre FDM for the American option.
function makeFDMPriceInterpolation(isCall, isEuropean, model, T, strike, N, M; method = "RKL2", sDisc = "Sinh", useExponentialFitting = fal... | [
3500,
21082,
9492,
16104,
341,
198,
11748,
39514,
37,
1961,
13,
40596,
1273,
5620,
25,
198,
220,
220,
220,
26136,
9915,
17633,
11,
24198,
3886,
11187,
26316,
1108,
11,
9780,
41384,
11,
2604,
39746,
11,
2651,
198,
198,
2,
10987,
469,
1... | 1.740064 | 5,913 |
export securitydice, normaldice, riskydice
"""
securitydice(list)
Computes the transition probability matrix for the security dice
with squares types defined in `list`.
"""
function securitydice(list::Vector{Int64})::Array{Float64,2}
proba = zeros(15, 15)
for i = 1:14
proba[i,i] = 0.5
if i... | [
39344,
2324,
67,
501,
11,
2593,
1940,
501,
11,
2526,
5173,
501,
198,
198,
37811,
198,
220,
220,
220,
2324,
67,
501,
7,
4868,
8,
198,
198,
7293,
1769,
262,
6801,
12867,
17593,
329,
262,
2324,
17963,
198,
4480,
24438,
3858,
5447,
287,... | 1.638978 | 2,817 |
abstract type AbstractLattice{E,L,T} end
#######################################################################
# Sublat (sublattice)
#######################################################################
struct Sublat{E,T,V<:AbstractVector{SVector{E,T}}}
sites::V
name::NameType
end
Base.empty(s::Sublat) = ... | [
397,
8709,
2099,
27741,
43,
1078,
501,
90,
36,
11,
43,
11,
51,
92,
886,
198,
198,
29113,
29113,
4242,
21017,
198,
2,
3834,
15460,
357,
7266,
75,
1078,
501,
8,
198,
29113,
29113,
4242,
21017,
198,
7249,
3834,
15460,
90,
36,
11,
51,... | 2.449883 | 14,097 |
import .Cairo: CairoContext, CairoSurface, CairoARGBSurface, CairoEPSSurface,
CairoPDFSurface, CairoSVGSurface, CairoImageSurface
abstract type ImageBackend end
abstract type PNGBackend <: ImageBackend end
abstract type VectorImageBackend <: ImageBackend end
abstract type SVGBackend <: VectorImageBackend end
abstract... | [
11748,
764,
34,
18131,
25,
23732,
21947,
11,
23732,
14214,
2550,
11,
23732,
1503,
38,
4462,
333,
2550,
11,
23732,
36,
3705,
14214,
2550,
11,
198,
34,
18131,
5760,
10652,
333,
2550,
11,
23732,
50,
43490,
14214,
2550,
11,
23732,
5159,
1... | 2.28626 | 12,045 |
<reponame>corail-research/ReinforcementLearning.jl<filename>src/ReinforcementLearningCore/src/core/run.jl
import Base: run
function run(
policy::AbstractPolicy,
env::AbstractEnv,
stop_condition = StopAfterEpisode(1),
hook = EmptyHook(),
)
check(policy, env)
_run(policy, env, stop_condition, hoo... | [
27,
7856,
261,
480,
29,
10215,
603,
12,
34033,
14,
3041,
259,
13442,
41730,
13,
20362,
27,
34345,
29,
10677,
14,
3041,
259,
13442,
41730,
14055,
14,
10677,
14,
7295,
14,
5143,
13,
20362,
198,
11748,
7308,
25,
1057,
198,
198,
8818,
1... | 2.230171 | 643 |
<reponame>sgoodlett/Fermi.jl
using Fermi
using LinearAlgebra
Nt = Threads.nthreads()
Fermi.tblis_set_num_threads(Nt)
BLAS.set_num_threads(Nt)
output("NUMBER OF THREADS: {}", Threads.nthreads())
function get_hc(N)
molstring = ""
f = false
for l = eachline(joinpath(@__DIR__, "alkanes.xyz"))
if occ... | [
27,
7856,
261,
480,
29,
82,
11274,
15503,
14,
37,
7780,
72,
13,
20362,
198,
3500,
376,
7780,
72,
198,
3500,
44800,
2348,
29230,
198,
198,
45,
83,
796,
14122,
82,
13,
77,
16663,
82,
3419,
198,
37,
7780,
72,
13,
83,
2436,
271,
62,... | 1.932476 | 622 |
# This file was generated, do not modify it. # hide
mach = machine(mdl, X2, y)
fit!(mach)
ŷ = predict(mach, X2)
round(rms(ŷ, y), sigdigits=4) | [
2,
770,
2393,
373,
7560,
11,
466,
407,
13096,
340,
13,
1303,
7808,
198,
76,
620,
796,
4572,
7,
9132,
75,
11,
1395,
17,
11,
331,
8,
198,
11147,
0,
7,
76,
620,
8,
198,
88,
136,
224,
796,
4331,
7,
76,
620,
11,
1395,
17,
8,
19... | 2.2 | 65 |
<reponame>lpmdiaz/Simulacrum.jl<gh_stars>0
using Simulacrum
using HyperGraphs, Symbolics
# cloning one hypergraph
chx = ChemicalHyperGraph{Num}()
@test (clone(chx, 1) == chx) && !(clone(chx, 1) === chx)
# cloning n hypergraphs
@variables t X(t) Y(t) k
che = ChemicalHyperEdge([X], [Y], k)
n = rand(1:100)
cloned_chxs =... | [
27,
7856,
261,
480,
29,
75,
4426,
67,
17890,
14,
8890,
377,
330,
6582,
13,
20362,
27,
456,
62,
30783,
29,
15,
198,
3500,
3184,
377,
330,
6582,
198,
3500,
15079,
37065,
82,
11,
41327,
19615,
198,
198,
2,
45973,
530,
8718,
34960,
19... | 2.741935 | 403 |
<reponame>numericalEFT/NumericalEFT.jl
"""
Composite grid that has tree structure. The whole interval is first divided by a panel grid,
then each interval of a panel grid is divided by a smaller grid in subgrids. Subgrid could also be
composite grid.
"""
module CompositeG
export LogDensedGrid, Composite, denseindex
u... | [
27,
7856,
261,
480,
29,
77,
6975,
605,
36,
9792,
14,
45,
6975,
605,
36,
9792,
13,
20362,
198,
37811,
198,
5377,
1930,
578,
10706,
326,
468,
5509,
4645,
13,
383,
2187,
16654,
318,
717,
9086,
416,
257,
6103,
10706,
11,
198,
8524,
11... | 2.138133 | 4,264 |
"""
Star log likelihood maker. Creates a star log prob function that is
parameterized by a flat vector
- th : [log_fluxes; unconstrained_pos]
Args:
imgs: Array of observed data Images with the .pixel field
pos0: Initial location of the source in ra/dec
pos_delta: (optional) determines how much ra/dec we allo... | [
37811,
198,
8248,
2604,
14955,
16009,
13,
220,
7921,
274,
257,
3491,
2604,
1861,
2163,
326,
318,
198,
17143,
2357,
1143,
416,
257,
6228,
15879,
628,
220,
532,
294,
1058,
685,
6404,
62,
69,
22564,
274,
26,
21254,
2536,
1328,
62,
1930,
... | 1.996617 | 5,025 |
<reponame>nkhedekar/Caesar.jl
function drawTagDetection(vis::Visualizer, tagname, Q, T, bTc, bP2t; posename=:test)
# draw tag triad
setobject!(vis[currtag], Triad(0.2))
settransform!(vis[currtag], bTt)
# draw ray to tag
v = vis[posename][:lines][tagname]
geometry = PointCloud(
GeometryTypes.Point.([bT... | [
27,
7856,
261,
480,
29,
77,
74,
704,
988,
283,
14,
24334,
18964,
13,
20362,
628,
198,
198,
8818,
3197,
24835,
11242,
3213,
7,
4703,
3712,
36259,
7509,
11,
7621,
3672,
11,
1195,
11,
309,
11,
275,
51,
66,
11,
275,
47,
17,
83,
26,
... | 1.952292 | 3,731 |
using PDBTools #, ComplexMixtures
function autocorr(trajectory::Trajectory)
# number of atoms
nprot = length(trajectory.x_solute)
nsvt = length(trajectory.x_solvent)
nframes = trajectory.nframes
# vector with time - ns
delta = 0.01
time = zeros(nframes)
t1 = 0.
for i in... | [
220,
1262,
350,
11012,
33637,
220,
1303,
11,
19157,
44,
25506,
198,
220,
2163,
1960,
420,
38890,
7,
9535,
752,
652,
3712,
15721,
752,
652,
8,
198,
220,
220,
198,
220,
220,
220,
1303,
1271,
286,
23235,
198,
220,
220,
220,
299,
11235,... | 2.02 | 850 |
using DifferentialEquations
using Plots
n_parasites = 100;
c = 4.0;
ux = 0.2;
ux1 = fill(0.2, n_parasites); #le ux et uy 1000 à cause de la β # une autre façon :[0.2 for x in 1:1000]
Random.seed!(1234);
uy = rand(200:1000, n_parasites)/1000;
Random.seed!(1235);
r1 = rand(Float64, n_parasites)
Random.seed!(1236);
r2 =... | [
3500,
20615,
498,
23588,
602,
198,
3500,
1345,
1747,
198,
198,
77,
62,
1845,
292,
2737,
796,
1802,
26,
198,
198,
66,
796,
604,
13,
15,
26,
198,
2821,
796,
657,
13,
17,
26,
198,
2821,
16,
796,
6070,
7,
15,
13,
17,
11,
299,
62,
... | 2.011905 | 1,428 |
<filename>test/dbscan.jl
@testset "DBSCAN" begin
Random.seed!(42)
df = CSV.read("data/blob_data.csv", DataFrame, drop=[1]);
X = df[:,1:2];
ϵ = 0.35;
min_pts = 10;
@testset "test errors" begin
@test_throws ArgumentError dbscan(X[:, 2], ϵ, min_pts)
end
@testset "test A... | [
27,
34345,
29,
9288,
14,
9945,
35836,
13,
20362,
198,
31,
9288,
2617,
366,
35,
4462,
44565,
1,
2221,
628,
220,
220,
220,
14534,
13,
28826,
0,
7,
3682,
8,
628,
220,
220,
220,
47764,
796,
44189,
13,
961,
7203,
7890,
14,
2436,
672,
... | 2.040816 | 588 |
function nlsfitworker(model::Function, y::Matrix{T}, x::Vector{T}, p0::Vector{T}; kwargs...) where T
# performs Levenberg-Marquardt fitting
nparams = length(p0)
n = size(y,2)
params = zeros(nparams, n)
resids = similar(y)
for j in 1:n
fit = curve_fit(model, x, y[:,j], p0)
params[:,j] = fit.param
... | [
8818,
299,
7278,
11147,
28816,
7,
19849,
3712,
22203,
11,
331,
3712,
46912,
90,
51,
5512,
2124,
3712,
38469,
90,
51,
5512,
279,
15,
3712,
38469,
90,
51,
19629,
479,
86,
22046,
23029,
810,
309,
198,
220,
1303,
17706,
1004,
574,
3900,
... | 2.4604 | 1,351 |
using Plots
function export_plot(
token_stream,
code;
path::S,
filename::S = "./scope_per_flag.png",
) where {S}
ei = eachindex(code)
plot()
@inbounds for (flag, scope) in token_stream
plot!([i for i in ei], scope, label=replace(flag, "\n" => ""))
end
scop... | [
3500,
1345,
1747,
198,
8818,
10784,
62,
29487,
7,
198,
220,
220,
220,
220,
220,
220,
220,
11241,
62,
5532,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2438,
26,
198,
220,
220,
220,
220,
220,
220,
220,
3108,
3712,
50,
11,
198,
22... | 2.227642 | 246 |
<filename>test/runtests_old.jl
#
# This file is part of the DiscreteEvents.jl Julia package, MIT license
#
# <NAME>, 2019
#
# This is a Julia package for discrete event simulation
#
using DiscreteEvents, Random, Unitful, Test, .Threads, DataStructures
import Unitful: Time, ms, s, minute, hr
x = 2 # set global (Main) ... | [
27,
34345,
29,
9288,
14,
81,
2797,
3558,
62,
727,
13,
20362,
198,
2,
198,
2,
770,
2393,
318,
636,
286,
262,
8444,
8374,
37103,
13,
20362,
22300,
5301,
11,
17168,
5964,
198,
2,
198,
2,
1279,
20608,
22330,
13130,
198,
2,
198,
2,
7... | 2.692144 | 471 |
<filename>src/composition/learning_networks/machines.jl
## LEARNING NETWORK MACHINES
surrogate(::Type{<:Deterministic}) = Deterministic()
surrogate(::Type{<:Probabilistic}) = Probabilistic()
surrogate(::Type{<:Unsupervised}) = Unsupervised()
surrogate(::Type{<:Static}) = Static()
"""
model_supertype(signature)... | [
27,
34345,
29,
10677,
14,
785,
9150,
14,
40684,
62,
3262,
5225,
14,
76,
620,
1127,
13,
20362,
198,
2235,
12509,
1503,
15871,
49791,
337,
16219,
1268,
1546,
198,
198,
11793,
3828,
378,
7,
3712,
6030,
90,
27,
25,
35,
2357,
49228,
3007... | 2.503395 | 5,743 |
<gh_stars>0
using Test
using MathOptInterface
const MOI = MathOptInterface
const MOIT = MathOptInterface.Test
const MOIU = MathOptInterface.Utilities
const MOIB = MathOptInterface.Bridges
const MOIBC = MathOptInterface.Bridges.Constraint
include("../utilities.jl")
mock = MOIU.MockOptimizer(MOIU.UniversalFallback(MOI... | [
27,
456,
62,
30783,
29,
15,
198,
3500,
6208,
198,
198,
3500,
16320,
27871,
39317,
198,
9979,
13070,
40,
796,
16320,
27871,
39317,
198,
9979,
13070,
2043,
796,
16320,
27871,
39317,
13,
14402,
198,
9979,
13070,
44958,
796,
16320,
27871,
3... | 1.799516 | 3,721 |
<filename>src/qpool.jl
#############################
# Internal Structures
#############################
const MaybeTask = Union{Nothing, Task}
mutable struct QueuePool <: AbstractThreadPool
inq :: Channel{Task}
outq :: Channel{Task}
cnt :: Threads.Atomic{Int}
QueuePool(tids, handler::Function) = ... | [
27,
34345,
29,
10677,
14,
80,
7742,
13,
20362,
198,
198,
14468,
7804,
4242,
2,
198,
2,
18628,
32112,
942,
198,
14468,
7804,
4242,
2,
198,
198,
9979,
6674,
25714,
796,
4479,
90,
18465,
11,
15941,
92,
198,
198,
76,
18187,
2878,
4670,
... | 2.713002 | 1,892 |
<filename>src/TFR.jl
import Base.eps
import DSP.spectrogram, DSP.stft
export spectrogram, stft, istft, phase_vocoder
""""""
function spectrogram(audio::SampleBuf{T, 1},
windowsize::Int = 1024,
hopsize::Int = windowsize >> 2;
window = hanning, kwa... | [
27,
34345,
29,
10677,
14,
10234,
49,
13,
20362,
198,
198,
11748,
7308,
13,
25386,
198,
11748,
360,
4303,
13,
4443,
39529,
11,
360,
4303,
13,
301,
701,
198,
39344,
5444,
39529,
11,
336,
701,
11,
318,
83,
701,
11,
7108,
62,
18893,
1... | 2.022121 | 4,611 |
<gh_stars>0
using Dates
DFG_VERSION = "0.18.1";
@enum FactorType begin
PRIORPOSE2
POSE2POSE2
POSE2APRILTAG4CORNERS
end
Base.@kwdef mutable struct FactorData
eliminated::Bool = false
potentialused::Bool = false
edgeIDs::Vector{String} = []
fnc::InferenceType
multihypo::Vector{Float64} ... | [
27,
456,
62,
30783,
29,
15,
198,
3500,
44712,
198,
198,
8068,
38,
62,
43717,
796,
366,
15,
13,
1507,
13,
16,
8172,
198,
198,
31,
44709,
27929,
6030,
2221,
198,
220,
220,
220,
4810,
41254,
48933,
17,
198,
220,
220,
220,
350,
14058,... | 2.503932 | 3,052 |
module QuantumESPRESSO
include("Inputs.jl")
include("Outputs.jl")
include("Commands.jl")
end
| [
21412,
29082,
1546,
32761,
46,
198,
198,
17256,
7203,
20560,
82,
13,
20362,
4943,
198,
17256,
7203,
26410,
82,
13,
20362,
4943,
198,
17256,
7203,
6935,
1746,
13,
20362,
4943,
198,
198,
437,
198
] | 2.794118 | 34 |
# AUTO GENERATED FILE - DO NOT EDIT
export datetimepicker
"""
datetimepicker(;kwargs...)
A DateTimePicker component.
DateTimePicker is a datetime input component.
The inputs can be initialized with the `defaultValue` property and the
input date, on ISO format, is specified with the `value` property.
Keyword argu... | [
2,
47044,
46,
24700,
1137,
11617,
45811,
532,
8410,
5626,
48483,
198,
198,
39344,
4818,
8079,
79,
15799,
198,
198,
37811,
198,
220,
220,
220,
4818,
8079,
79,
15799,
7,
26,
46265,
22046,
23029,
198,
198,
32,
7536,
7575,
47,
15799,
7515... | 3.394432 | 431 |
<filename>fermions.jl<gh_stars>0
#unique!(push!(LOAD_PATH, "~/Documents/UGent/PhD/Code_cMPS/julia1.0/CMPSKit.jl/src/"))
unique!(push!(LOAD_PATH, joinpath(pwd(), "src")))
using Revise
using CMPSKit
using KrylovKit
using OptimKit
using LinearAlgebra
using JLD2
using TensorOperations
using Plots
D = 4
k = 1.
g = 1.
Λ =... | [
27,
34345,
29,
2232,
76,
507,
13,
20362,
27,
456,
62,
30783,
29,
15,
198,
2,
34642,
0,
7,
14689,
0,
7,
35613,
62,
34219,
11,
366,
93,
14,
38354,
14,
7340,
298,
14,
2725,
35,
14,
10669,
62,
66,
44,
3705,
14,
73,
43640,
16,
13... | 1.573731 | 2,482 |
function fast_pca!(X::Matrix{T}, λ::Vector{T}, P::Matrix{T}, n::Int) where T<:AbstractFloat
r = sum(λ .> 0)
s = n - r
if r == 0
X .= zeros(T, n, n)
elseif r == n
return nothing
elseif r == 1
X .= (λ[1] * λ[1]) * (P[:,1] * P[:,1]')
elseif r ≤ s
P₁ = @view P[... | [
8818,
3049,
62,
79,
6888,
0,
7,
55,
3712,
46912,
90,
51,
5512,
7377,
119,
3712,
38469,
90,
51,
5512,
350,
3712,
46912,
90,
51,
5512,
299,
3712,
5317,
8,
810,
309,
27,
25,
23839,
43879,
198,
220,
220,
220,
374,
796,
2160,
7,
3937... | 1.787629 | 1,455 |
using Luna
a = 13e-6
gas = :Ar
pres = 5
flength = 15e-2
τfwhm = 30e-15
λ0 = 800e-9
energy=1e-6
modes = (
Capillary.MarcatiliMode(a, gas, pres, n=1, m=1, kind=:HE, ϕ=0.0, loss=false),
Capillary.MarcatiliMode(a, gas, pres, n=1, m=2, kind=:HE, ϕ=0.0, loss=false),
)
nmodes = length(modes)
grid = Grid.RealGrid(f... | [
3500,
23694,
198,
198,
64,
796,
1511,
68,
12,
21,
198,
22649,
796,
1058,
3163,
198,
18302,
796,
642,
198,
2704,
3286,
796,
1315,
68,
12,
17,
198,
198,
32830,
69,
1929,
76,
796,
1542,
68,
12,
1314,
198,
39377,
15,
796,
10460,
68,
... | 2.211268 | 568 |
#=
Copyright (c) 2018-2022 <NAME>, <NAME>, and contributors
This Julia package Hypatia.jl is released under the MIT license; see LICENSE
file in the root directory or at https://github.com/chriscoey/Hypatia.jl
given a sequence of observations X₁,...,Xᵢ with each Xᵢ in Rᵈ,
find a density function f maximizing the log ... | [
2,
28,
198,
15269,
357,
66,
8,
2864,
12,
1238,
1828,
1279,
20608,
22330,
1279,
20608,
22330,
290,
20420,
198,
198,
1212,
22300,
5301,
21209,
265,
544,
13,
20362,
318,
2716,
739,
262,
17168,
5964,
26,
766,
38559,
24290,
198,
7753,
287,... | 1.832009 | 3,649 |
<filename>src/page.jl<gh_stars>1-10
## Page("SOme blurb", (q1,q2,q3, ...);
#DBSubject="Calculus",
#KEYWORDS="limits",
#AuthorText="<NAME>"
#AuthorText2="<NAME>"
#)
raw"""
Page(intro, questions; context="", meta...)
Create a page which prints as a `pg` file.
* `intro` may be marked up using modified markdow... | [
27,
34345,
29,
10677,
14,
7700,
13,
20362,
27,
456,
62,
30783,
29,
16,
12,
940,
198,
198,
2235,
7873,
7203,
15821,
1326,
698,
5945,
1600,
220,
357,
80,
16,
11,
80,
17,
11,
80,
18,
11,
2644,
1776,
198,
2,
35,
4462,
549,
752,
26... | 2.294974 | 3,780 |
<gh_stars>10-100
struct VectorBackedUTF8String <: AbstractString
buffer::Vector{UInt8}
end
Base.:(==)(x::VectorBackedUTF8String, y::VectorBackedUTF8String) = x.buffer == y.buffer
function Base.show(io::IO, x::VectorBackedUTF8String)
print(io, '"')
print(io, string(x))
print(io, '"')
return
end
Ba... | [
27,
456,
62,
30783,
29,
940,
12,
3064,
198,
7249,
20650,
33,
6021,
48504,
23,
10100,
1279,
25,
27741,
10100,
198,
220,
220,
220,
11876,
3712,
38469,
90,
52,
5317,
23,
92,
198,
437,
198,
198,
14881,
11207,
7,
855,
5769,
87,
3712,
3... | 2.615954 | 1,216 |
<gh_stars>1-10
using CSetAutomorphisms, Profile, PProf
using Catlab.Graphs, Catlab.CategoricalAlgebra
# Graphs
#-------
g1 = star_graph(Graph, 5)
g2 = path_graph(Graph, 5)
g = Graph(1)
[copy_parts!(g, h) for h in [g1, g2, g1, g2]]
color_saturate(g)
@profile color_saturate(g)
pprof()
PProf.refresh(file="profile.pb.gz") | [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
3500,
327,
7248,
16541,
25831,
6583,
11,
13118,
11,
350,
15404,
198,
3500,
5181,
23912,
13,
37065,
82,
11,
5181,
23912,
13,
34,
2397,
12409,
2348,
29230,
198,
198,
2,
29681,
82,
198,
2,
26... | 2.253521 | 142 |
using JuMP
using GLPK
using Crayons
using OVERT
using Requires
"""
----------------------------------------------
main structure
----------------------------------------------
"""
"""
This structure is a mixed-integer-representation of Overt. The relu and max
operations are turned into mix integer programs following ... | [
3500,
12585,
7378,
198,
3500,
10188,
40492,
198,
3500,
327,
2433,
684,
198,
3500,
440,
15858,
198,
3500,
26848,
198,
198,
37811,
198,
3880,
26171,
198,
12417,
4645,
198,
3880,
26171,
198,
37811,
198,
198,
37811,
198,
1212,
4645,
318,
25... | 2.273266 | 4,728 |
module dir
end
| [
21412,
26672,
198,
198,
437,
198
] | 2.666667 | 6 |
<gh_stars>1-10
using JLD2,CSV
#Load CsV files and save as julia data
T = 59
assetHeader = "names"
for a=2:21
assetHeader = [assetHeader;"$(a)"]
end
matrT = [ zeros(Int,2,2) for t=1:T]
equityT = [ zeros(Int,1) for t=1:T]
IDsT = [ zeros(Int,1) for t=1:T]
for t=1:T
matfilename = "/home/Domenico/Dropbox/Network_E... | [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
3500,
449,
11163,
17,
11,
7902,
53,
198,
2,
8912,
327,
82,
53,
3696,
290,
3613,
355,
474,
43640,
1366,
198,
51,
796,
7863,
198,
198,
562,
316,
39681,
796,
366,
14933,
1,
198,
1640,
257,
... | 2.187891 | 479 |
export fixed_field, subfields
# Compute basis for the subfield of K that is generated by the elements of as.
function _subfield_basis(K::S, as::Vector{T}) where {
S <: Union{AnticNumberField, Hecke.NfRel},
T <: Union{nf_elem, Hecke.NfRelElem}
}
if isempty(as)
return [gen(K)]
end
# Notation: k bas... | [
39344,
5969,
62,
3245,
11,
850,
25747,
198,
198,
2,
3082,
1133,
4308,
329,
262,
850,
3245,
286,
509,
326,
318,
7560,
416,
262,
4847,
286,
355,
13,
198,
8818,
4808,
7266,
3245,
62,
12093,
271,
7,
42,
3712,
50,
11,
355,
3712,
38469,... | 2.322198 | 3,203 |
module ReinforcementLearning
export RL
const RL = ReinforcementLearning
using ReinforcementLearningEnvironments
include("extensions/extensions.jl")
using Reexport
include("Utils/Utils.jl")
include("components/components.jl")
include("glue/glue.jl")
end | [
21412,
22299,
13442,
41730,
198,
39344,
45715,
198,
9979,
45715,
796,
22299,
13442,
41730,
198,
198,
3500,
22299,
13442,
41730,
4834,
12103,
198,
198,
17256,
7203,
2302,
5736,
14,
2302,
5736,
13,
20362,
4943,
198,
198,
3500,
797,
39344,
1... | 3.445946 | 74 |
<reponame>oxinabox/LightGraphs.jl<gh_stars>0
export RandomVertexCover
struct RandomVertexCover end
"""
vertex_cover(g, RandomVertexCover())
Find a set of vertices such that every edge in `g` has some vertex in the set as
atleast one of its end point.
### Implementation Notes
Performs [Approximate Minimum Verte... | [
27,
7856,
261,
480,
29,
39366,
397,
1140,
14,
15047,
37065,
82,
13,
20362,
27,
456,
62,
30783,
29,
15,
198,
39344,
14534,
13414,
16886,
27245,
198,
198,
7249,
14534,
13414,
16886,
27245,
886,
198,
198,
37811,
198,
220,
220,
220,
37423... | 2.42217 | 424 |
<reponame>jonniedie/Advent2020
module Day6
export get_inputs, get_solution1, get_solution2
## Input getting
function get_inputs()
test_input1 = test_input2 = read_inputs("test_input1.txt")
test_output1 = 11
test_output2 = 6
data = read_inputs("input.txt")
return (; test_input1, test_input2, test_... | [
27,
7856,
261,
480,
29,
46286,
77,
798,
494,
14,
2782,
1151,
42334,
198,
21412,
3596,
21,
198,
198,
39344,
651,
62,
15414,
82,
11,
651,
62,
82,
2122,
16,
11,
651,
62,
82,
2122,
17,
628,
198,
2235,
23412,
1972,
198,
8818,
651,
62... | 2.475 | 280 |
<reponame>UnofficialJuliaMirrorSnapshots/DiffEqBiological.jl-eb300fae-53e8-50a0-950c-e21f52c2b7e0
### File declaring all the various reaction networks the package is tested on ###
#A large number of reaction networks are added to test as many different cases as possible.
#More test networks can be added favourably.
#D... | [
27,
7856,
261,
480,
29,
3118,
16841,
16980,
544,
27453,
1472,
43826,
20910,
14,
28813,
36,
80,
33,
15071,
13,
20362,
12,
1765,
6200,
69,
3609,
12,
4310,
68,
23,
12,
1120,
64,
15,
12,
31027,
66,
12,
68,
2481,
69,
4309,
66,
17,
65... | 1.675688 | 6,503 |
# using Pipelines
function julia_program_warn(p::JuliaProgram)
if nthreads() == 1
@warn "Submitting a JuliaProgram with 1-threaded Julia session is not recommended because it might block schedulers. Starting Julia with multi-threads is suggested. Help: https://docs.julialang.org/en/v1/manual/multi-threadin... | [
2,
1262,
25149,
20655,
198,
198,
8818,
474,
43640,
62,
23065,
62,
40539,
7,
79,
3712,
16980,
544,
15167,
8,
198,
220,
220,
220,
611,
299,
16663,
82,
3419,
6624,
352,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
40539,
366,
7004,
... | 2.492912 | 1,552 |
# This example shows how to use custom datatypes and reduction operators
# It computes the variance in parallel in a numerically stable way
using MPI, Statistics
MPI.Init()
const comm = MPI.COMM_WORLD
const root = 0
# Define a custom struct
# This contains the summary statistics (mean, variance, length) of a vector
... | [
2,
770,
1672,
2523,
703,
284,
779,
2183,
4818,
265,
9497,
290,
7741,
12879,
198,
2,
632,
552,
1769,
262,
24198,
287,
10730,
287,
257,
5470,
1146,
8245,
835,
198,
198,
3500,
4904,
40,
11,
14370,
198,
198,
7378,
40,
13,
31768,
3419,
... | 2.51462 | 513 |
### Histograms of recurrence structures
# Add one item to position `p` in the histogram `h` that has precalculated length `n`
# - update the histogram and return its new length
@inline function extendhistogram!(h::Vector{Int}, n::Int, p::Int)
if p > n
append!(h, zeros(p-n))
n = p
end
h[p] +... | [
21017,
5590,
26836,
286,
664,
33928,
8573,
198,
198,
2,
3060,
530,
2378,
284,
2292,
4600,
79,
63,
287,
262,
1554,
21857,
4600,
71,
63,
326,
468,
3718,
282,
49262,
4129,
4600,
77,
63,
198,
2,
532,
4296,
262,
1554,
21857,
290,
1441,
... | 2.306985 | 4,023 |
function UnivariateProcessNoise(arg0::RealMatrix, arg1::LOFType, arg2::PositionAngle, arg3::Vector{UnivariateFunction}, arg4::Vector{UnivariateFunction})
return UnivariateProcessNoise((RealMatrix, LOFType, PositionAngle, Vector{UnivariateFunction}, Vector{UnivariateFunction}), arg0, arg1, arg2, arg3, arg4)
end
fun... | [
8818,
791,
42524,
18709,
2949,
786,
7,
853,
15,
3712,
15633,
46912,
11,
1822,
16,
3712,
43,
19238,
6030,
11,
1822,
17,
3712,
26545,
13450,
293,
11,
1822,
18,
3712,
38469,
90,
3118,
42524,
22203,
5512,
1822,
19,
3712,
38469,
90,
3118,
... | 3.110497 | 362 |
export
ispentagonal,
nthpentagonal, npentagonal,
allpentagonal, somepentagonal, exactpentagonal
ispentagonal(n::Integer) = begin
t = 24*n + 1
r = isqrt(t)
(r^2 == t) && (r % 6 == 5)
end
nthpentagonal(n::Integer) = (n * (3n-1)) ÷ 2
npentagonal(n::Int, T::Type = Int) = collect(exactpentagonal(n,... | [
39344,
198,
220,
220,
220,
318,
16923,
27923,
11,
198,
220,
220,
220,
299,
400,
16923,
27923,
11,
299,
16923,
27923,
11,
198,
220,
220,
220,
477,
16923,
27923,
11,
617,
16923,
27923,
11,
2748,
16923,
27923,
198,
198,
8802,
298,
27923,... | 2.421546 | 427 |
<filename>src/templating.jl
export newTemplate, render2file
################################################################
"""
newTemplate(name)
Create new destination html file as the template
newTemplate(name, :function)
Prints a function to be used as a template
# Examples
```julia
# you can create a f... | [
27,
34345,
29,
10677,
14,
11498,
489,
803,
13,
20362,
198,
39344,
649,
30800,
11,
8543,
17,
7753,
198,
29113,
29113,
198,
37811,
198,
220,
220,
220,
649,
30800,
7,
3672,
8,
198,
198,
16447,
649,
10965,
27711,
2393,
355,
262,
11055,
... | 2.632911 | 1,738 |
<gh_stars>10-100
@doc raw"""
Ray3
An object `r` of the data type [`Ray3`](@ref) is a directed straight ray in the
three-dimensional Euclidean space ``Ε^2``.
It starts in a point called the *source* of `r` and goes to infinity.
"""
Ray3
"""
Ray3(p::Point3, q::Point3)
Introduces a ray `r` with source `p` and ... | [
27,
456,
62,
30783,
29,
940,
12,
3064,
198,
31,
15390,
8246,
37811,
198,
220,
220,
220,
7760,
18,
198,
198,
2025,
2134,
4600,
81,
63,
286,
262,
1366,
2099,
685,
63,
19591,
18,
63,
16151,
31,
5420,
8,
318,
257,
7924,
3892,
26842,
... | 2.539813 | 854 |
<gh_stars>1-10
import Pkg
Pkg.add("Documenter")
using Documenter, BosonSampling
push!(LOAD_PATH, "./src")
DocMeta.setdocmeta!(BosonSampling, :DocTestSetup, :(using MyPackage); recursive=true)
makedocs(
source = "./src/",
sitename = "BosonSampling.jl",
modules = [BosonSampling],
authors = "<NAME>, <NAM... | [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
11748,
350,
10025,
198,
47,
10025,
13,
2860,
7203,
24941,
263,
4943,
198,
3500,
16854,
263,
11,
14548,
261,
16305,
11347,
198,
14689,
0,
7,
35613,
62,
34219,
11,
366,
19571,
10677,
4943,
198... | 2 | 1,248 |
function reset!(alg::TrustRegion)
alg.Δ[] = alg.Δ₀
return nothing
end
function step!(x, alg::TrustRegion, f::Function, state)
Δ = alg.Δ[]
Δₘₐₓ = alg.Δₘₐₓ
η = alg.η
ηₛ = alg.ηₛ
ηₑ = alg.ηₑ
fx = state.f
∇fx = state.∇f
B = approx_hessian(alg.hessian, state)
model(p) = fx + ∇fx⋅... | [
8818,
13259,
0,
7,
14016,
3712,
33814,
47371,
8,
198,
220,
220,
220,
435,
70,
13,
138,
242,
21737,
796,
435,
70,
13,
138,
242,
158,
224,
222,
198,
220,
220,
220,
1441,
2147,
198,
437,
198,
198,
8818,
2239,
0,
7,
87,
11,
435,
7... | 1.577197 | 421 |
@testset "parse single subject" begin
bids_root = joinpath(
@__DIR__,
"data",
"bids_root"
)
my_layout = Layout(bids_root)
@test my_layout.root == bids_root
@test my_layout.longitudinal == true
@test my_layout.description == OrderedDict{String,Any}()
@test my_layout.... | [
31,
9288,
2617,
366,
29572,
2060,
2426,
1,
2221,
198,
220,
220,
220,
27837,
62,
15763,
796,
4654,
6978,
7,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
834,
34720,
834,
11,
198,
220,
220,
220,
220,
220,
220,
220,
366,
7890,
1600,... | 2.178525 | 773 |
<filename>src/EnglishText.jl
module EnglishText
# code to text
include("semantics.jl")
include("articulate.jl")
include("list.jl")
include("numeric.jl")
include("pluralize.jl")
include("quantity.jl")
# text to code
include("text.jl")
end # module
| [
27,
34345,
29,
10677,
14,
15823,
8206,
13,
20362,
198,
21412,
3594,
8206,
198,
198,
2,
2438,
284,
2420,
198,
17256,
7203,
43616,
29320,
13,
20362,
4943,
198,
17256,
7203,
433,
291,
5039,
13,
20362,
4943,
198,
17256,
7203,
4868,
13,
20... | 2.873563 | 87 |
<gh_stars>0
using Revise
#Question- do residuals of the within model equal residuals of a FI model?
#=using FixedEffectModels, DataFrames
function testwithinresid( N::Int=100, K=10; NG = N ÷ 2K)
#form the test data
X = rand(N,K)
X .*= collect(1:K)'
Gval = (i->i% NG).(1:N)
for (i,r) ∈ enumerate(eachrow(... | [
27,
456,
62,
30783,
29,
15,
198,
3500,
5416,
786,
628,
628,
628,
198,
2,
24361,
12,
466,
29598,
82,
286,
262,
1626,
2746,
4961,
29598,
82,
286,
257,
18930,
2746,
30,
198,
2,
28,
3500,
10832,
18610,
5841,
1424,
11,
6060,
35439,
198... | 2.040355 | 13,629 |
<reponame>PtFEM/NumericalMethodsforEngineers.jl
using NumericalMethodsforEngineers
a = [16. 4. 8.; 4. 5. -4.; 8. -4. 22.]
b = [4., 2., 5.]
f = cholesky(a)
f.U |> display
y = f.L \ b
c = f.U \ y
maxiters = 5
x = [(i=i, cg=cg(a, b; maxiter=i)) for i in 1:maxiters]
x |> display
@test round.(x[3].cg; digits=9) == roun... | [
27,
7856,
261,
480,
29,
47,
83,
37,
3620,
14,
45,
6975,
605,
46202,
1640,
28620,
13,
20362,
198,
3500,
399,
6975,
605,
46202,
1640,
28620,
198,
198,
64,
796,
685,
1433,
13,
604,
13,
807,
15089,
604,
13,
642,
13,
532,
19,
15089,
... | 2.024096 | 166 |
# Rooted tree
# parent of root is self
# the kids of node i are children[kidsPtr[i] : kidsPtr[i]-numKids[i]-1 ]
# the weigts of edges from parents to kids are indexed similarly.
# that is, weights holds the weight of an edge to the parent.
#
# We require that the children appears in a dfs order
#
type RootedTr... | [
198,
2,
20410,
276,
5509,
198,
2,
220,
220,
2560,
286,
6808,
318,
2116,
198,
2,
220,
220,
262,
3988,
286,
10139,
1312,
389,
1751,
58,
45235,
46745,
58,
72,
60,
1058,
3988,
46745,
58,
72,
45297,
22510,
40229,
58,
72,
45297,
16,
236... | 2.18749 | 6,523 |
<gh_stars>0
module Unroll
copy_and_substitute_tree(e, varname, newtext) = e
copy_and_substitute_tree(e::Symbol, varname, newtext) =
e == varname? newtext : e
function copy_and_substitute_tree(e::Expr, varname, newtext)
e2 = Expr(e.head)
for subexp in e.args
push!(e2.args, copy_and_substitute_tr... | [
27,
456,
62,
30783,
29,
15,
198,
21412,
791,
2487,
628,
198,
30073,
62,
392,
62,
7266,
301,
3678,
62,
21048,
7,
68,
11,
1401,
3672,
11,
649,
5239,
8,
796,
304,
198,
198,
30073,
62,
392,
62,
7266,
301,
3678,
62,
21048,
7,
68,
3... | 2.011815 | 931 |
export OptimizationProblem, primalDualSolve
######
# Simple Primal-Dual IP for the problem
#
# min_x f(x)
# Cx -h <= 0.0
immutable OptimizationProblem
d :: Int64
m :: Int64
f_g_h :: Function
#R^d |----> R, returns a tuple with function value, gradient, hessian
C :: Matrix{Float64} #C \in R^(d,m)
h :: Vec... | [
39344,
30011,
1634,
40781,
11,
43750,
36248,
50,
6442,
198,
4242,
2235,
198,
2,
17427,
37712,
12,
36248,
6101,
329,
262,
1917,
198,
2,
198,
2,
949,
62,
87,
277,
7,
87,
8,
198,
2,
220,
220,
327,
87,
532,
71,
19841,
657,
13,
15,
... | 2.253429 | 1,531 |
<reponame>idrougge/ple
using InteractiveUtils
function print_tree(t, indent)
println("$(repeat(" ", indent))$t")
for s in subtypes(t)
if s != Any && s != Function
print_tree(s, indent + 1)
end
end
end
print_tree(Any, 0)
| [
27,
7856,
261,
480,
29,
312,
472,
70,
469,
14,
1154,
198,
3500,
21365,
18274,
4487,
198,
198,
8818,
3601,
62,
21048,
7,
83,
11,
33793,
8,
198,
220,
44872,
7203,
3,
7,
44754,
7203,
220,
220,
220,
33172,
33793,
4008,
3,
83,
4943,
... | 2.378641 | 103 |
# MIT license
# Copyright (c) Microsoft Corporation. All rights reserved.
# See LICENSE in the project root for full license information.
"""
AcceleratedParametricSurface{T,N,S} <: ParametricSurface{T,N}
Wrapper class for [`ParametricSurface`](@ref)s where analytical intersection isn't feasible (e.g. [`ZernikeSur... | [
2,
17168,
5964,
198,
2,
15069,
357,
66,
8,
5413,
10501,
13,
1439,
2489,
10395,
13,
198,
2,
4091,
38559,
24290,
287,
262,
1628,
6808,
329,
1336,
5964,
1321,
13,
198,
198,
37811,
198,
220,
220,
220,
29805,
515,
22973,
19482,
14214,
25... | 2.221985 | 6,568 |
<filename>src/modes.jl
# Copyright (c) 2020 California Institute of Technology (“Caltech”). U.S.
# Government sponsorship acknowledged.
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# • Redi... | [
27,
34345,
29,
10677,
14,
76,
4147,
13,
20362,
198,
2,
15069,
357,
66,
8,
12131,
3442,
5136,
286,
8987,
357,
447,
250,
9771,
13670,
447,
251,
737,
471,
13,
50,
13,
198,
2,
5070,
27418,
10810,
13,
198,
2,
198,
2,
1439,
2489,
1039... | 1.988677 | 9,980 |
<reponame>ajozefiak/julia
# This file is a part of Julia. License is MIT: https://julialang.org/license
import LinearAlgebra: AbstractTriangular
"""
SparseMatrixCSCSymmHerm
`Symmetric` or `Hermitian` of a `SparseMatrixCSC` or `SparseMatrixCSCView`.
"""
const SparseMatrixCSCSymmHerm{Tv,Ti} = Union{Symmetric{Tv,<:... | [
27,
7856,
261,
480,
29,
1228,
8590,
891,
32994,
14,
73,
43640,
198,
2,
770,
2393,
318,
257,
636,
286,
22300,
13,
13789,
318,
17168,
25,
3740,
1378,
73,
377,
498,
648,
13,
2398,
14,
43085,
198,
198,
11748,
44800,
2348,
29230,
25,
2... | 2.026204 | 4,694 |
<reponame>tkf/Reagents.jl<gh_stars>10-100
module TestLocks
using Base.Experimental: @sync
using Reagents
using Test
include("../../../examples/locks.jl")
end # module
| [
27,
7856,
261,
480,
29,
30488,
69,
14,
3041,
49638,
13,
20362,
27,
456,
62,
30783,
29,
940,
12,
3064,
198,
21412,
6208,
43,
3320,
198,
198,
3500,
7308,
13,
20468,
9134,
25,
2488,
27261,
198,
3500,
797,
49638,
198,
3500,
6208,
198,
... | 2.714286 | 63 |
<gh_stars>10-100
using LiveServer
export
build_templates,
serve_templates
"""
newsite(topdir; template="basic", cd=true)
Generate a new folder (an error is thrown if it already exists) that contains
the skeleton of a website that can be processed by Franklin. The user can
specify a `template` out of the... | [
27,
456,
62,
30783,
29,
940,
12,
3064,
198,
3500,
7547,
10697,
198,
198,
39344,
220,
198,
220,
220,
220,
1382,
62,
11498,
17041,
11,
198,
220,
220,
220,
4691,
62,
11498,
17041,
198,
198,
37811,
198,
220,
220,
220,
1705,
578,
7,
48... | 2.430791 | 3,475 |
<reponame>UnofficialJuliaMirror/StringParserPEG.jl-2f5ab805-579b-5381-9d0b-584976f35e23<gh_stars>0
type Grammar
rules::Dict{Symbol, Rule}
end
function show(io::IO,grammar::Grammar)
println("StringParserPEG.Grammar(Dict{Symbol,StringParserPEG.Rule}(")
for (sym,rule) in grammar.rules
println(" $sym => $(stri... | [
27,
7856,
261,
480,
29,
3118,
16841,
16980,
544,
27453,
1472,
14,
10100,
46677,
47,
7156,
13,
20362,
12,
17,
69,
20,
397,
28256,
12,
41734,
65,
12,
20,
36626,
12,
24,
67,
15,
65,
12,
3365,
2920,
4304,
69,
2327,
68,
1954,
27,
456... | 2.58209 | 268 |
# Autogenerated wrapper script for nghttp2_jll for x86_64-w64-mingw32
export libnghttp2
JLLWrappers.@generate_wrapper_header("nghttp2")
JLLWrappers.@declare_library_product(libnghttp2, "libnghttp2-14.dll")
function __init__()
JLLWrappers.@generate_init_header()
JLLWrappers.@init_library_product(
libngh... | [
2,
5231,
519,
877,
515,
29908,
4226,
329,
299,
456,
29281,
17,
62,
73,
297,
329,
2124,
4521,
62,
2414,
12,
86,
2414,
12,
2229,
86,
2624,
198,
39344,
9195,
77,
456,
29281,
17,
198,
198,
41,
3069,
36918,
11799,
13,
31,
8612,
378,
... | 2.149533 | 214 |
using Polynomials
using LsqFit
using Plots
function main()
# nonlinear fit stuff
p0 = [0.5, 0.5] # guess
model(t, p) = p[1] * exp.(-p[2] * t) # model trying to fit
model1(t, p) = p[1] * sin.(p[2] * t) + p[3]
xdata = range(0, stop=10, length=20)
ydata ... | [
3500,
12280,
26601,
8231,
201,
198,
3500,
406,
31166,
31805,
201,
198,
201,
198,
3500,
1345,
1747,
201,
198,
201,
198,
8818,
1388,
3419,
201,
198,
201,
198,
220,
220,
220,
1303,
1729,
29127,
4197,
3404,
220,
201,
198,
220,
220,
220,
... | 1.911797 | 907 |
<filename>test/polyhedral_test.jl
@testset "Polyhedral" begin
@testset "Start Solutions Iterator" begin
f = equations(cyclic(5))
iter = HC.PolyhedralStartSolutionsIterator(f)
mv = 0
for (cell, X) in iter
mv += cell.volume
@test size(X,2) == cell.volume
... | [
27,
34345,
29,
9288,
14,
35428,
21962,
62,
9288,
13,
20362,
198,
31,
9288,
2617,
366,
34220,
21962,
1,
2221,
198,
220,
220,
220,
2488,
9288,
2617,
366,
10434,
23555,
40806,
1352,
1,
2221,
198,
220,
220,
220,
220,
220,
220,
220,
277,... | 1.97561 | 1,066 |
struct TimeHomogeneousForwardCorrelation end
function evolved_matrices(::Type{TimeHomogeneousForwardCorrelation}, fwdCorrelation::Matrix{Float64})
numberOfRates = size(fwdCorrelation)[1]
correlations = Matrix{Float64}[zeros(numberOfRates, numberOfRates) for i = 1:numberOfRates]
# correlations = fill(zeros(number... | [
7249,
3862,
28718,
32269,
39746,
10606,
49501,
886,
198,
198,
8818,
12572,
62,
6759,
45977,
7,
3712,
6030,
90,
7575,
28718,
32269,
39746,
10606,
49501,
5512,
277,
16993,
10606,
49501,
3712,
46912,
90,
43879,
2414,
30072,
198,
220,
1271,
5... | 2.763566 | 258 |
<reponame>jkrumbiegel/GLMakie.jl
function RenderObject(
data::Dict{Symbol}, program, pre,
bbs = Node(AABB{Float32}(Vec3f0(0),Vec3f0(1))),
main = nothing
)
RenderObject(convert(Dict{Symbol,Any}, data), program, pre, bbs, main)
end
function Base.show(io::IO, obj::RenderObject)
println... | [
27,
7856,
261,
480,
29,
73,
38584,
2178,
28210,
14,
8763,
44,
461,
494,
13,
20362,
198,
8818,
46722,
10267,
7,
198,
220,
220,
220,
220,
220,
220,
220,
1366,
3712,
35,
713,
90,
13940,
23650,
5512,
1430,
11,
662,
11,
198,
220,
220,
... | 2.648352 | 2,457 |
function git_make_commit(; commit_message::String)
result = try
cmd = `git commit -m $(commit_message)`
p = pipeline(cmd; stdout=stdout, stderr=stderr)
success(p)
catch
false
end
return result
end
| [
8818,
17606,
62,
15883,
62,
41509,
7,
26,
4589,
62,
20500,
3712,
10100,
8,
198,
220,
220,
220,
1255,
796,
1949,
198,
220,
220,
220,
220,
220,
220,
220,
23991,
796,
4600,
18300,
4589,
532,
76,
29568,
41509,
62,
20500,
8,
63,
198,
2... | 2.227273 | 110 |
<reponame>UnofficialJuliaMirror/Quandl.jl-9ee2f689-5b39-572f-ac38-e7a530c1478e
using JLD, TimeSeries
include(joinpath(dirname(@__FILE__),"../src/timearray.jl"))
r = load(joinpath(dirname(@__FILE__),"resp.jld"), "resp")
ta = timearray(r)["Close"]
facts("timearray works on Request object") do
context("there are 30... | [
27,
7856,
261,
480,
29,
3118,
16841,
16980,
544,
27453,
1472,
14,
4507,
392,
75,
13,
20362,
12,
24,
1453,
17,
69,
40523,
12,
20,
65,
2670,
12,
48724,
69,
12,
330,
2548,
12,
68,
22,
64,
38612,
66,
1415,
3695,
68,
198,
3500,
449,
... | 2.342233 | 412 |
#currently, matrix solve operations are on hold.
@doc """
SigmoidNumbers.get_unscaled_replacement_row!(rr, M, row, cache, quire)
takes the matrix M and specifies a good "replacement row" for it. You should
also supply a cache vector which is used to store magic values, it should be
the length of rr.
"""
fun... | [
2,
41745,
11,
17593,
8494,
4560,
389,
319,
1745,
13,
628,
198,
31,
15390,
37227,
198,
220,
311,
17225,
1868,
49601,
13,
1136,
62,
403,
1416,
3021,
62,
35666,
5592,
62,
808,
0,
7,
21062,
11,
337,
11,
5752,
11,
12940,
11,
627,
557,
... | 2.473811 | 2,902 |
# Tables.jl interface
Tables.istable(::Type{<:TableRowIterator}) = true
Tables.rowaccess(::Type{<:TableRowIterator}) = true
Tables.rows(itr::TableRowIterator) = itr
Tables.schema(itr::TableRowIterator) = Tables.Schema(itr.index.column_labels, fill(Any, length(itr.index.column_labels)))
Tables.columnnames(tr::TableRow... | [
198,
2,
33220,
13,
20362,
7071,
198,
198,
51,
2977,
13,
396,
540,
7,
3712,
6030,
90,
27,
25,
10962,
25166,
37787,
30072,
796,
2081,
198,
51,
2977,
13,
808,
15526,
7,
3712,
6030,
90,
27,
25,
10962,
25166,
37787,
30072,
796,
2081,
1... | 2.740558 | 609 |
<reponame>m-j-w/CpuId.jl<gh_stars>10-100
#=--- CpuId / CpuId.jl ----------------------------------------------------=#
"""
# Module CpuId
Query information about and directly from your CPU.
"""
module CpuId
export cpuvendor, cpubrand, cpumodel, cachesize, cachelinesize,
simdbytes, simdbits, address_size, phys... | [
27,
7856,
261,
480,
29,
76,
12,
73,
12,
86,
14,
34,
19944,
7390,
13,
20362,
27,
456,
62,
30783,
29,
940,
12,
3064,
198,
2,
28,
6329,
327,
19944,
7390,
1220,
327,
19944,
7390,
13,
20362,
20368,
19351,
46249,
198,
198,
37811,
198,
... | 2.488059 | 14,111 |
function calculate_error(predictions::T₁,
targets::T₂) where {T₁ <: AbstractVector,
T₂ <: AbstractVector}
y = predictions
t = targets
N = length(y)
sum(sign.(y) .!= sign.(t)) / N
end
| [
8818,
15284,
62,
18224,
7,
28764,
9278,
3712,
51,
158,
224,
223,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6670,
3712,
51,
158,
224,
224,
8,
... | 1.730769 | 156 |
<filename>test/simpleCIM.jl
using Distributions
using SpinGlassNetworks
function ramp(t::T, τ::T, α::T, pi::T, pf::T) where T <: Real
p = (pf + pi) + (pf - pi) * tanh(α * (2.0 * t / τ - 1.0))
p / 2.0
end
@testset "Simple Coherent Ising Machine simulator for small Ising instances." begin
L = 4
ig = isi... | [
27,
34345,
29,
9288,
14,
36439,
34,
3955,
13,
20362,
198,
3500,
46567,
507,
198,
3500,
28002,
47698,
7934,
5225,
198,
198,
8818,
10454,
7,
83,
3712,
51,
11,
46651,
3712,
51,
11,
26367,
3712,
51,
11,
31028,
3712,
51,
11,
279,
69,
3... | 2.153005 | 549 |
module SpaceJam
using ..Ahorn, Maple
const placements = Ahorn.PlacementDict(
"Space Jam" => Ahorn.EntityPlacement(
Maple.DreamBlock,
"rectangle"
)
)
Ahorn.nodeLimits(entity::Maple.DreamBlock) = 0, 1
Ahorn.minimumSize(entity::Maple.DreamBlock) = 8, 8
Ahorn.resizable(entity::Maple.DreamBlock)... | [
21412,
4687,
30380,
198,
198,
3500,
11485,
10910,
1211,
11,
21249,
198,
198,
9979,
21957,
3196,
796,
7900,
1211,
13,
3646,
5592,
35,
713,
7,
198,
220,
220,
220,
366,
14106,
9986,
1,
5218,
7900,
1211,
13,
32398,
3646,
5592,
7,
198,
2... | 2.295954 | 865 |
<gh_stars>1-10
export
TaskGraphsMILP,
AssignmentMILP,
AdjacencyMILP,
SparseAdjacencyMILP,
FastSparseAdjacencyMILP
"""
TaskGraphsMILP
Concrete subtypes of `TaskGraphsMILP` define different ways to formulate the
sequential assignment portion of a PC-TAPF problem.
"""
abstract type TaskGraphsMILP... | [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
39344,
198,
220,
220,
220,
15941,
37065,
82,
44,
4146,
47,
11,
198,
220,
220,
220,
50144,
44,
4146,
47,
11,
198,
220,
220,
220,
1215,
30482,
1387,
44,
4146,
47,
11,
198,
220,
220,
220,
... | 2.136644 | 30,005 |
export to_basictypes
"""
to_basictypes(block::AbstractBlock{N}) where N
convert gates to basic types
* ChainBlock
* PutBlock
* PrimitiveBlock
"""
function to_basictypes end
to_basictypes(block::PrimitiveBlock) = block
function to_basictypes(block::AbstractBlock{N}) where {N}
throw(NotImplemented... | [
39344,
284,
62,
12093,
713,
9497,
198,
198,
37811,
198,
220,
220,
220,
284,
62,
12093,
713,
9497,
7,
9967,
3712,
23839,
12235,
90,
45,
30072,
810,
399,
198,
198,
1102,
1851,
17435,
284,
4096,
3858,
628,
220,
220,
220,
1635,
21853,
1... | 2.698718 | 468 |
<reponame>mewilhel/IntervalArithmetic.jl
#= Design summary:
This is a so-called "traits-based" design, as follows.
The main body of the file defines versions of elementary functions with all allowed
interval rounding types, e.g.
+(IntervalRounding{:tight}, a, b, RoundDown)
+(IntervalRounding{:accurate}, a, b, RoundDo... | [
27,
7856,
261,
480,
29,
76,
413,
346,
2978,
14,
9492,
2100,
3163,
29848,
13,
20362,
198,
2,
28,
8495,
10638,
25,
198,
198,
1212,
318,
257,
523,
12,
7174,
366,
9535,
896,
12,
3106,
1,
1486,
11,
355,
5679,
13,
198,
198,
464,
1388,... | 2.189638 | 4,092 |
import ChainRulesCore: frule, rrule
using LinearAlgebra
function compute_gn_jac(u_n::AbstractVector{T}) where T
n = length(u_n) - 1
g_n = zero(u_n)
# using `similar` in case u_n is e.g., `CuArray`
dgdu = fill!(similar(u_n, n + 1, n + 1), zero(T))
## First: calculate the a_n terms (eqn. 10)
a_n... | [
11748,
21853,
37766,
14055,
25,
12658,
293,
11,
374,
25135,
198,
3500,
44800,
2348,
29230,
198,
198,
8818,
24061,
62,
4593,
62,
30482,
7,
84,
62,
77,
3712,
23839,
38469,
90,
51,
30072,
810,
309,
198,
220,
220,
220,
299,
796,
4129,
7... | 1.71836 | 7,609 |
export dual_set
# Additional dual_set
function dual_set(::MOI.GreaterThan{T}) where T
return MOI.GreaterThan(zero(T))
end
function dual_set(::MOI.LessThan{T}) where T
return MOI.LessThan(zero(T))
end
function dual_set(::MOI.EqualTo{T}) where T
return # Maybe return Reals in the future
end | [
39344,
10668,
62,
2617,
198,
198,
2,
15891,
10668,
62,
2617,
220,
198,
8818,
10668,
62,
2617,
7,
3712,
11770,
40,
13,
13681,
263,
817,
272,
90,
51,
30072,
810,
309,
198,
220,
220,
220,
1441,
13070,
40,
13,
13681,
263,
817,
272,
7,... | 2.520661 | 121 |
<gh_stars>1-10
using Pkg
using Documenter, BED
format = Documenter.HTML(
edit_link = "develop"
)
makedocs(
format = format,
checkdocs = :all,
linkcheck = true,
modules = [BED],
sitename = "BED.jl",
pages = [
"Home" => "index.md",
"BED" => "man/bed.md",
"API Referenc... | [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
3500,
350,
10025,
198,
3500,
16854,
263,
11,
347,
1961,
198,
198,
18982,
796,
16854,
263,
13,
28656,
7,
198,
220,
220,
220,
4370,
62,
8726,
796,
366,
16244,
1,
198,
8,
198,
198,
76,
4335... | 2.252747 | 273 |
<reponame>ElOceanografo/Stheno.jl<gh_stars>0
import Base: rand, length
import Distributions: logpdf, AbstractMvNormal
export elbo, dtc
export SparseFiniteGP
"""
SparseFiniteGP{T1<:FiniteGP, T2<:FiniteGP}
A finite-dimensional projection of an `AbstractGP` `f` at locations `x`, which uses a second
`FiniteGP` defin... | [
27,
7856,
261,
480,
29,
9527,
46607,
519,
430,
6513,
14,
1273,
831,
78,
13,
20362,
27,
456,
62,
30783,
29,
15,
198,
11748,
7308,
25,
43720,
11,
4129,
198,
11748,
46567,
507,
25,
2604,
12315,
11,
27741,
44,
85,
26447,
198,
198,
393... | 2.464523 | 902 |
using Documenter, ReachabilityModels
using ReachabilityModels: generate_summary
DocMeta.setdocmeta!(ReachabilityModels, :DocTestSetup,
:(using ReachabilityModels); recursive=true)
# generate notebooks
include("generate.jl")
# generate bibliography
#include("bibliography.jl")
generate_summary()
... | [
3500,
16854,
263,
11,
25146,
1799,
5841,
1424,
198,
3500,
25146,
1799,
5841,
1424,
25,
7716,
62,
49736,
198,
198,
23579,
48526,
13,
2617,
15390,
28961,
0,
7,
3041,
620,
1799,
5841,
1424,
11,
1058,
23579,
14402,
40786,
11,
198,
220,
22... | 1.994914 | 1,573 |
<filename>gen/HipparchusWrapper/AnalysisWrapper/IntegrationWrapper/GaussWrapper/hermite_rule_factory.jl<gh_stars>1-10
function HermiteRuleFactory()
return HermiteRuleFactory(())
end
| [
27,
34345,
29,
5235,
14,
39,
3974,
998,
385,
36918,
2848,
14,
32750,
36918,
2848,
14,
34500,
1358,
36918,
2848,
14,
35389,
1046,
36918,
2848,
14,
372,
32937,
62,
25135,
62,
69,
9548,
13,
20362,
27,
456,
62,
30783,
29,
16,
12,
940,
... | 2.921875 | 64 |
<filename>src/Utilities/copy.jl
# This file contains default implementations for the `MOI.copy_to` function that
# can be used by a model.
@deprecate automatic_copy_to default_copy_to
@deprecate supports_default_copy_to MOI.supports_incremental_interface
include("copy/index_map.jl")
"""
pass_attributes(
... | [
27,
34345,
29,
10677,
14,
18274,
2410,
14,
30073,
13,
20362,
198,
2,
770,
2393,
4909,
4277,
25504,
329,
262,
4600,
11770,
40,
13,
30073,
62,
1462,
63,
2163,
326,
198,
2,
460,
307,
973,
416,
257,
2746,
13,
198,
198,
31,
10378,
8344... | 2.394964 | 7,069 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.