content stringlengths 6 1.03M | input_ids listlengths 4 535k | ratio_char_token float64 0.68 8.61 | token_count int64 4 535k |
|---|---|---|---|
<gh_stars>1-10
const URANUS_X_NUM = (
1432,
628,
234,
79,
10,
)
const URANUS_X_0_AMP = [
19.17286937362,
1.32301898121,
0.44400556159,
0.14667584671,
0.14129215712,
0.06200970387,
0.01542890129,
0.0144415347,
0.00944969862,
0.00657496073,
0.00621603101,
... | [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
9979,
37902,
1565,
2937,
62,
55,
62,
41359,
796,
357,
198,
220,
220,
220,
1478,
2624,
11,
198,
220,
220,
220,
718,
2078,
11,
198,
220,
220,
220,
34323,
11,
198,
220,
220,
220,
9225,
11,
... | 1.523137 | 180,532 |
<gh_stars>1-10
#=
# 3D Poisson, Dirichlet bc
=#
### If the Finch package has already been added, use this line #########
using Finch # Note: to add the package, first do: ]add "https://github.com/paralab/Finch.git"
### If not, use these four lines (working from the examples directory) ###
# if !@isdefined(Finch)
# ... | [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
2,
28,
198,
2,
513,
35,
7695,
30927,
11,
36202,
488,
1616,
47125,
198,
46249,
198,
198,
21017,
1002,
262,
45277,
5301,
468,
1541,
587,
2087,
11,
779,
428,
1627,
1303,
7804,
198,
3500,
4527... | 2.373134 | 536 |
<filename>src/synthesizeNTF.jl
using ControlSystems
"""
ntf = synthesizeNTF(order=3, osr=64, opt=0, H_inf=1.5, f0=0)
Synthesize a noise transfer function for a delta-sigma modulator.
- `order`: order of the modulator
- `osr`: oversampling ratio
- `opt`: flag for optimized zeros
- 0 -> not optimized
- 1 ->... | [
27,
34345,
29,
10677,
14,
1837,
429,
956,
1096,
45,
10234,
13,
20362,
198,
3500,
6779,
11964,
82,
198,
198,
37811,
198,
220,
220,
220,
299,
27110,
796,
24983,
1096,
45,
10234,
7,
2875,
28,
18,
11,
267,
27891,
28,
2414,
11,
2172,
2... | 1.769938 | 3,373 |
mutable struct Stats
model::String
constraint::String
solver::String
optimizer::String
evals::Int
evaltime::Real
bytes::Real
end
local stats
stats = Stats("model", "constraint", "solver", "optimizer", 0, 0, 0)
function reset_stats(s::Solver, m::DRO)
stats.model = "DRO"
stat... | [
76,
18187,
2878,
20595,
198,
220,
220,
220,
2746,
3712,
10100,
198,
220,
220,
220,
32315,
3712,
10100,
198,
220,
220,
220,
1540,
332,
3712,
10100,
198,
220,
220,
220,
6436,
7509,
3712,
10100,
198,
220,
220,
220,
819,
874,
3712,
5317,
... | 2.218097 | 431 |
<filename>test/TestPackage/test/runtests.jl
using TestPackage
TestPackage.greet()
| [
27,
34345,
29,
9288,
14,
14402,
27813,
14,
9288,
14,
81,
2797,
3558,
13,
20362,
198,
3500,
6208,
27813,
198,
198,
14402,
27813,
13,
70,
2871,
3419,
198
] | 2.964286 | 28 |
# Only run coverage from linux Julia 0.6 build on travis.
get(ENV, "TRAVIS_OS_NAME", "") == "linux" || exit()
get(ENV, "TRAVIS_JULIA_VERSION", "") == "0.6" || exit()
Pkg.add("Coverage")
using Coverage
cd(joinpath(dirname(@__FILE__), "..")) do
processed = process_folder()
Coveralls.submit(processed)
... | [
2,
5514,
1057,
5197,
422,
32639,
22300,
657,
13,
21,
1382,
319,
1291,
4703,
13,
198,
1136,
7,
1677,
53,
11,
366,
51,
3861,
29817,
62,
2640,
62,
20608,
1600,
366,
4943,
220,
220,
220,
220,
220,
220,
6624,
366,
23289,
1,
220,
220,
... | 2.444444 | 144 |
<filename>src/sdp.jl<gh_stars>1-10
#======================================
Methods using semidefinite programming
======================================#
using .SumOfSquares
"""
new_sos(backend; kwargs...)
Return a new (empty) sum-of-squares optimization problem for the given backend.
### Input
- `backend` -- t... | [
27,
34345,
29,
10677,
14,
21282,
79,
13,
20362,
27,
456,
62,
30783,
29,
16,
12,
940,
198,
2,
10052,
50155,
198,
46202,
1262,
5026,
485,
69,
9504,
8300,
198,
10052,
50155,
2,
198,
3500,
764,
13065,
5189,
22266,
3565,
198,
198,
37811,... | 2.412127 | 1,138 |
# script that outputs some statistics of the model fits
using DataFrames, Gadfly, Colors, MAT, CSV
import Cairo, Fontconfig
include("common.jl")
include("models.jl")
include("behaviorstats.jl")
include("simmodel.jl")
include("modelfitting.jl")
# settings (when manually evaluating the objective function)
const blockr... | [
2,
4226,
326,
23862,
617,
7869,
286,
262,
2746,
11414,
198,
198,
3500,
6060,
35439,
11,
20925,
12254,
11,
29792,
11,
36775,
11,
44189,
198,
11748,
23732,
11,
24060,
11250,
198,
198,
17256,
7203,
11321,
13,
20362,
4943,
198,
17256,
7203,... | 2.159452 | 9,056 |
# GraffSDK integration file
using GraffSDK
using DocStringExtensions # temporary while $(SIGNATURES) is in use in this file
const Graff = GraffSDK
"""
GraffSLAM
An object definition containing the require variables to leverage the server side SLAM solution per user, robot, and session.
"""
mutable struct GraffS... | [
2,
7037,
487,
10305,
42,
11812,
2393,
198,
198,
3500,
7037,
487,
10305,
42,
198,
3500,
14432,
10100,
11627,
5736,
1303,
8584,
981,
29568,
46224,
47471,
8,
318,
287,
779,
287,
428,
2393,
198,
198,
9979,
7037,
487,
796,
7037,
487,
10305... | 2.742611 | 1,624 |
@doc raw"""
BurresWassertseinMetric <: AbstractMetric
The Bures Wasserstein metric for symmetric positive definite matrices[^MalagoMontruccioPistone2018].
[^MalagoMontruccioPistone2018]:
> <NAME>., <NAME>., <NAME>.:
> _Wasserstein Riemannian geometry of Gaussian densities_.
> Information Geometry, 1, ... | [
31,
15390,
8246,
37811,
198,
220,
220,
220,
5481,
411,
54,
30493,
20719,
9171,
1173,
1279,
25,
27741,
9171,
1173,
198,
198,
464,
347,
942,
370,
24929,
5714,
18663,
329,
23606,
19482,
3967,
21892,
2603,
45977,
58,
61,
15029,
3839,
26031,... | 2.228902 | 1,813 |
<filename>docs/src/literate/diffeq.jl
# # [Using GXBeam with DifferentialEquations.jl](@id diffeq)
#
# While the capabilities provided by GXBeam are probably sufficient for most users,
# advanced users may wish to make use of some of the features of the
# [`DifferentialEquations`](https://github.com/SciML/Differentia... | [
27,
34345,
29,
31628,
14,
10677,
14,
17201,
378,
14,
67,
22391,
80,
13,
20362,
198,
2,
1303,
685,
12814,
402,
55,
3856,
321,
351,
20615,
498,
23588,
602,
13,
20362,
16151,
31,
312,
814,
27363,
8,
198,
2,
198,
2,
2893,
262,
9889,
... | 2.040252 | 4,447 |
<gh_stars>1-10
module Transducers
export ttake, tmap, tfilter, partition_all, random_sample, transduce,
dedupe, treplace, tpush!
type Reduced
val
end
function ensure_reduced(x::Reduced)
x
end
function ensure_reduced(x)
Reduced(x)
end
function unreduced(x::Reduced)
x.val
end
function unreduced(x)
... | [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
21412,
3602,
41213,
198,
198,
39344,
256,
20657,
11,
256,
8899,
11,
256,
24455,
11,
18398,
62,
439,
11,
4738,
62,
39873,
11,
1007,
646,
344,
11,
198,
220,
220,
220,
220,
220,
220,
4648,
... | 2.198347 | 1,452 |
gear = [KPDSupply("map", 9, 150),
KPDSupply("compass", 13, 35),
KPDSupply("water", 153, 200),
KPDSupply("sandwich", 50, 160),
KPDSupply("glucose", 15, 60),
KPDSupply("tin", 68, 45),
KPDSupply("banana", 27, 60),
KPDSupply("apple", 39, 40),
KPDSupply("cheese... | [
31763,
796,
685,
42,
47,
5258,
7211,
306,
7203,
8899,
1600,
860,
11,
6640,
828,
198,
220,
220,
220,
220,
220,
220,
220,
45814,
5258,
7211,
306,
7203,
5589,
562,
1600,
1511,
11,
3439,
828,
198,
220,
220,
220,
220,
220,
220,
220,
45... | 2.053435 | 524 |
<reponame>xijiang/ABG.jl
"""
fr2ped(dir, list, ped, allele)
---
# Description
Given a `list` of final report files, this function merge them into one file
`ped`.
The function will analyse the first file in the list to see if `allele` format
e.g., `Top`, `AB`", `Forward`, `Design`, or `Plus`, is available. The co... | [
27,
7856,
261,
480,
29,
87,
2926,
15483,
14,
6242,
38,
13,
20362,
198,
37811,
198,
220,
220,
220,
1216,
17,
9124,
7,
15908,
11,
1351,
11,
7190,
11,
45907,
8,
198,
6329,
198,
198,
2,
12489,
198,
15056,
257,
4600,
4868,
63,
286,
2... | 1.995235 | 1,469 |
<reponame>giordano/DataScienceTutorials.jl
# This file was generated, do not modify it. # hide
feature = ["AA", "BB", "AA", "AA", "BB"]
elscitype(feature) | [
27,
7856,
261,
480,
29,
12397,
585,
5733,
14,
6601,
26959,
51,
44917,
82,
13,
20362,
198,
2,
770,
2393,
373,
7560,
11,
466,
407,
13096,
340,
13,
1303,
7808,
198,
30053,
796,
14631,
3838,
1600,
366,
15199,
1600,
366,
3838,
1600,
366,... | 2.75 | 56 |
<filename>test/dataframes_impl.jl
import DataFrames
import DataArrays: isna
function test_dataframes()
df = connect(Postgres, "localhost", "postgres", "", "julia_test") do conn
stmt = prepare(conn, "SELECT 4::integer as foo, 4.0::DOUBLE PRECISION as bar, " *
"NULL::integer as foobar;")
... | [
27,
34345,
29,
9288,
14,
7890,
37805,
62,
23928,
13,
20362,
198,
11748,
6060,
35439,
198,
11748,
6060,
3163,
20477,
25,
2125,
64,
198,
198,
8818,
1332,
62,
7890,
37805,
3419,
198,
220,
220,
220,
47764,
796,
2018,
7,
6307,
34239,
11,
... | 2.170274 | 693 |
@testset "653.two-sum-iv-input-is-a-bst.jl" begin
@test find_target_inorder_traversal(TreeNode{Int}([5, 3, 6, 2, 4, nothing, 7]), 9) ==
true
@test find_target_inorder_traversal(TreeNode{Int}([5, 3, 6, 2, 4, nothing, 7]), 28) ==
false
@test find_target_inorder_traversal(TreeNode{Int}([2, 1, 3... | [
31,
9288,
2617,
366,
46435,
13,
11545,
12,
16345,
12,
452,
12,
15414,
12,
271,
12,
64,
12,
65,
301,
13,
20362,
1,
2221,
198,
220,
220,
220,
2488,
9288,
1064,
62,
16793,
62,
259,
2875,
62,
9535,
690,
282,
7,
27660,
19667,
90,
531... | 2.205357 | 224 |
<reponame>dhonza/SampleArrays.jl<filename>src/magphase.jl
export MagPhase, zerophase
export SignalElement
import Base: Complex, promote_rule, abs, angle
struct MagPhase{T<:Real} <: Number
mag::T
phi::T
function MagPhase{T}(mag::T, phi::T) where {T <: Real}
mag < 0 && throw(ArgumentError("negative ... | [
27,
7856,
261,
480,
29,
67,
24130,
4496,
14,
36674,
3163,
20477,
13,
20362,
27,
34345,
29,
10677,
14,
19726,
40715,
13,
20362,
198,
39344,
2944,
35645,
11,
1976,
263,
2522,
589,
198,
39344,
26484,
20180,
198,
198,
11748,
7308,
25,
191... | 2.254799 | 573 |
<gh_stars>0
@test yyyymmdd2yyyy(19240401) == 1924
@test yyyymmdd2yyyy(20240401) == 2024
@test yyyymmdd2yyyymm(19240401) == 192404
@test yyyymmdd2yyyymm(20240401) == 202404
@test yyyymmdd2date(19240401) == Date(1924,4,1)
@test yyyymmdd2date(20240401) == Date(2024,4,1)
@test dduuuyyyy2date("01Apr1924") == Date(1924,4,... | [
27,
456,
62,
30783,
29,
15,
198,
31,
9288,
331,
22556,
26621,
1860,
17,
22556,
22556,
7,
1129,
1731,
3023,
486,
8,
6624,
37547,
198,
31,
9288,
331,
22556,
26621,
1860,
17,
22556,
22556,
7,
1238,
1731,
3023,
486,
8,
6624,
48609,
198,... | 2.159162 | 955 |
n = 4
p = [ 2 , 4 , 3 , 1 ]
d = [ 1 , 2 , 4 , 6 ]
r = [ 0 , 0 , 0 , 0 ]
w = [ 1 , 1 , 1 , 1 ]
using vOptSpecific
id = set2OSP( n , p , d , r , w )
solver = OSP_VanWassenhove1980( )
z1, z2 , S = vSolve( id , solver ) | [
77,
796,
604,
198,
79,
796,
685,
220,
362,
837,
604,
837,
513,
837,
352,
2361,
198,
67,
796,
685,
220,
352,
837,
362,
837,
604,
837,
718,
2361,
198,
81,
796,
685,
220,
657,
837,
657,
837,
657,
837,
657,
2361,
198,
86,
796,
685... | 1.973214 | 112 |
<gh_stars>0
# Translated from PyTorch version, see cnn_minst.py
using Avalon
import Avalon: accuracy
using MLDatasets
# include("../src/core.jl")
# __init__()
mutable struct Net
conv1::Conv2d
conv2::Conv2d
fc1::Linear
fc2::Linear
end
Net() = Net(
Conv2d(1, 20, 5),
Conv2d(20, 50, 5),
Lin... | [
27,
456,
62,
30783,
29,
15,
198,
2,
3602,
17249,
422,
9485,
15884,
354,
2196,
11,
766,
269,
20471,
62,
1084,
301,
13,
9078,
198,
198,
3500,
39600,
198,
11748,
39600,
25,
9922,
198,
3500,
10373,
27354,
292,
1039,
198,
198,
2,
2291,
... | 2.249653 | 721 |
<filename>concordancer.jl
#=
Julia function to create a .csv file with a concordance of matches of a regular expression in a directory of .txt files (other file types in the directory are ignored). The surrounding context includes up to the number of characters specified in the 'context_size' argument or all available ... | [
27,
34345,
29,
1102,
66,
585,
8250,
13,
20362,
198,
2,
28,
198,
16980,
544,
2163,
284,
2251,
257,
764,
40664,
2393,
351,
257,
1673,
585,
590,
286,
7466,
286,
257,
3218,
5408,
287,
257,
8619,
286,
764,
14116,
3696,
357,
847,
2393,
... | 2.48821 | 1,145 |
<gh_stars>0
# return perm[newid]=oldid sorted by idtable
# perm[newid] = origid
# invp[origid] = newid
function sort_by_dict(idtable::Dict{String,Int},n::Int)
perm = zeros(Int,n)
invp = zeros(Int,n)
newid = 0
for key in sort(collect(keys(idtable)))
origid = idtable[key]
if key!="0" && ... | [
27,
456,
62,
30783,
29,
15,
198,
2,
1441,
9943,
58,
3605,
312,
22241,
727,
312,
23243,
416,
4686,
11487,
201,
198,
2,
9943,
58,
3605,
312,
60,
220,
796,
1796,
312,
201,
198,
2,
800,
79,
58,
11612,
312,
60,
796,
649,
312,
201,
... | 1.968254 | 378 |
function checkInput()
if haskey(ENV, "PDESOLVER_BUNDLE_DEPS")
if !haskey(ENV, "PDESOLVER_PKGDIR")
error("PDESOLVER_PKGDIR environment variable must be specified when bundling dependencies")
end
pkgdir = ENV["PDESOLVER_PKGDIR"]
if !isdir(pkgdir)
error("PDESOLVER_PKGDIR $pkgdir must exist... | [
8818,
2198,
20560,
3419,
628,
220,
611,
468,
2539,
7,
1677,
53,
11,
366,
5760,
1546,
3535,
5959,
62,
33,
4944,
35,
2538,
62,
7206,
3705,
4943,
628,
220,
220,
220,
611,
5145,
10134,
2539,
7,
1677,
53,
11,
366,
5760,
1546,
3535,
595... | 2.811321 | 3,021 |
import QuadTreeMeshes
using Base.Test
import GeometryTypes
plot = true
if plot==true
import Plots
Plots.plotlyjs()
end
include("TestHelpers.jl")
include("CurrentTest.jl")
#include("MeshTests.jl")
#include("QuadTreeTests.jl")
| [
11748,
20648,
27660,
44,
274,
956,
198,
3500,
7308,
13,
14402,
198,
11748,
2269,
15748,
31431,
198,
198,
29487,
796,
2081,
198,
198,
361,
7110,
855,
7942,
198,
220,
220,
220,
1330,
1345,
1747,
198,
220,
220,
220,
1345,
1747,
13,
29487... | 2.662921 | 89 |
<gh_stars>1-10
# function calculate how close a matrix is to identity (up to permutations and rescaling)
using Combinatorics, LinearAlgebra
"""
err_pd(Ie)
Calculate the error (up to permuataion and rescaling) between Ie and identity matrix:
```math
err = \\mathrm{min}_{P, D} ||PDI_{e} - I||_{F},
```
where ``P``... | [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
2,
2163,
15284,
703,
1969,
257,
17593,
318,
284,
5369,
357,
929,
284,
9943,
32855,
290,
6811,
4272,
8,
220,
198,
3500,
955,
8800,
1352,
873,
11,
44800,
2348,
29230,
198,
37811,
198,
220,
2... | 2.336756 | 487 |
<reponame>MaximeRivest/Makie.jl
using Makie, GeometryTypes
import AbstractPlotting: convert_arguments, plot!, convert_arguments, extrema_nan
@recipe(Bar, x, y) do scene
Theme(;
fillto = 0.0,
color = theme(scene, :color),
colormap = theme(scene, :colormap),
colorrange = nothing,
... | [
27,
7856,
261,
480,
29,
11518,
524,
49,
452,
395,
14,
44,
461,
494,
13,
20362,
198,
3500,
15841,
494,
11,
2269,
15748,
31431,
198,
11748,
27741,
43328,
889,
25,
10385,
62,
853,
2886,
11,
7110,
28265,
10385,
62,
853,
2886,
11,
1070,
... | 1.986223 | 4,210 |
# ------------------------------------------------------------------------------------------
# # Arrays and Loops
#
# We'll cover:
# 1. Array literals
# 2. Concatenation
# 3. For loops
# 4. Comprehensions
# 5. Element types
# 6. Dequeues
# 7. The `bang!` convention
# 8. Variable names vs. copies
#
# # Arrays
#
# Julia ... | [
2,
16529,
22369,
438,
198,
2,
1303,
943,
20477,
290,
6706,
2840,
198,
2,
198,
2,
775,
1183,
3002,
25,
198,
2,
352,
13,
15690,
4187,
874,
198,
2,
362,
13,
1482,
9246,
268,
341,
198,
2,
513,
13,
1114,
23607,
198,
2,
604,
13,
308... | 4.461487 | 1,506 |
@doc raw"""
The s-stage Radau IA nodes are defined as the roots of the following polynomial of degree $s$:
```math
\frac{d^{s-1}}{dx^{s-1}} \big( x^s (x - 1)^{s-1} \big) .
```
"""
function get_radau_1_nodes(::Type{T}, s) where {T}
if s == 1
throw(ErrorException("Radau nodes for one stage are not defined.")... | [
198,
31,
15390,
8246,
37811,
198,
464,
264,
12,
14247,
5325,
559,
35229,
13760,
389,
5447,
355,
262,
11135,
286,
262,
1708,
745,
6213,
49070,
286,
4922,
720,
82,
3,
25,
198,
15506,
63,
11018,
198,
59,
31944,
90,
67,
36796,
82,
12,
... | 2.375086 | 2,922 |
"""
show_states_initial_value(sim::Simulation)
Function to print initial states.
# Arguments
- `sim::Simulation` : Simulation object that contains the initial condition
"""
function show_states_initial_value(sim::Simulation)
inputs = sim.inputs
bus_size = get_bus_count(inputs)
system = get_system(sim... | [
37811,
198,
220,
220,
220,
905,
62,
27219,
62,
36733,
62,
8367,
7,
14323,
3712,
8890,
1741,
8,
198,
198,
22203,
284,
3601,
4238,
2585,
13,
198,
198,
2,
20559,
2886,
198,
198,
12,
4600,
14323,
3712,
8890,
1741,
63,
1058,
41798,
2134,... | 2.176758 | 1,024 |
<reponame>MarkNahabedian/AnotherParser.jl
export BNFNode, Empty, Sequence, Alternatives, NonTerminal,
CharacterLiteral, StringLiteral
export Constructor, StringCollector
export BNFRef, recognize, logReductions, loggingReductions
export BNFGrammar, DerivationRule
export AllGrammars
using NahaJuliaLib
trace_recogn... | [
27,
7856,
261,
480,
29,
9704,
45,
993,
397,
276,
666,
14,
6610,
46677,
13,
20362,
198,
39344,
347,
21870,
19667,
11,
33523,
11,
45835,
11,
13243,
2929,
11,
220,
8504,
44798,
282,
11,
198,
220,
220,
220,
15684,
43,
270,
1691,
11,
1... | 2.651571 | 2,959 |
<reponame>fadihamad94/OnePhase.jl
include("system_rhs.jl")
include("kkt_system_solver.jl")
include("schur.jl")
include("schur_direct.jl")
include("symmetric.jl")
include("clever_symmetric.jl")
| [
27,
7856,
261,
480,
29,
69,
9189,
2763,
324,
5824,
14,
3198,
35645,
13,
20362,
198,
17256,
7203,
10057,
62,
81,
11994,
13,
20362,
4943,
198,
17256,
7203,
74,
21841,
62,
10057,
62,
82,
14375,
13,
20362,
4943,
198,
17256,
7203,
20601,
... | 2.474359 | 78 |
<filename>src/examples/sn_example1.jl
# Configuration for running simple neutral copy error simulation
#=
Recommended command line to run:
> julia neutral.jl examples/sn_example1
=#
export simtype
@everywhere simtype = 3
@everywhere const N = 10 # population size
const mutstddev = 0.04
const ngens = 1001
const ... | [
27,
34345,
29,
10677,
14,
1069,
12629,
14,
16184,
62,
20688,
16,
13,
20362,
198,
2,
28373,
329,
2491,
2829,
8500,
4866,
4049,
18640,
198,
2,
28,
198,
36171,
3141,
1627,
284,
1057,
25,
198,
29,
220,
474,
43640,
8500,
13,
20362,
6096,... | 3.137255 | 153 |
@inline trans(b::NNlib.BatchedAdjOrTrans) = (b isa NNlib.BatchedTranspose ? static(Int('T')) : static(Int('C'))), parent(b)
@inline trans(x) = static(Int('N')), x
@inline trans(c, x) = Int(c) == static(Int('T')) ? batched_transpose(x) :
Int(c) == static(Int('C')) ? batched_adjoint(x) : x
matmul(a, b) = matmul(a, b... | [
31,
45145,
1007,
7,
65,
3712,
6144,
8019,
13,
33,
14265,
2782,
73,
5574,
8291,
8,
796,
357,
65,
318,
64,
399,
45,
8019,
13,
33,
14265,
8291,
3455,
5633,
9037,
7,
5317,
10786,
51,
6,
4008,
1058,
9037,
7,
5317,
10786,
34,
6,
4008,... | 2.254579 | 2,184 |
<gh_stars>0
function make_operation(@nospecialize(op), args)
if op === (*)
args = filter(!_isone, args)
if isempty(args)
return 1
end
elseif op === (+)
args = filter(!_iszero, args)
if isempty(args)
return 0
end
end
return op(args..... | [
27,
456,
62,
30783,
29,
15,
198,
8818,
787,
62,
27184,
7,
31,
39369,
431,
2413,
1096,
7,
404,
828,
26498,
8,
198,
220,
220,
220,
611,
1034,
24844,
20789,
8,
198,
220,
220,
220,
220,
220,
220,
220,
26498,
796,
8106,
7,
0,
62,
2... | 2.129066 | 1,906 |
@testset "utils.jl" begin
@testset "DiscreteMeasure" begin
@test_throws ErrorException SOT.DiscreteMeasure(randn(3), rand(2))
end
@testset "gradient step" begin
c(x, y) = abs(x - y)
τ = rand()
x = randn()
xs = randn(100)
ps = rand(100)
ps ./= sum(ps)
... | [
31,
9288,
2617,
366,
26791,
13,
20362,
1,
2221,
198,
220,
220,
220,
2488,
9288,
2617,
366,
15642,
8374,
47384,
1,
2221,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
9288,
62,
400,
8516,
13047,
16922,
311,
2394,
13,
15642,
8374,
473... | 1.803783 | 423 |
<filename>src/GE/src/GEExprSearch.jl
# *****************************************************************************
# Written by <NAME>, <EMAIL>
# *****************************************************************************
# Copyright ã 2015, United States Government, as represented by the
# Administrator of the Nat... | [
27,
34345,
29,
10677,
14,
8264,
14,
10677,
14,
8264,
3109,
1050,
18243,
13,
20362,
198,
2,
41906,
17174,
4557,
35625,
198,
2,
22503,
416,
1279,
20608,
22330,
1279,
27630,
4146,
29,
198,
2,
41906,
17174,
4557,
35625,
198,
2,
15069,
618... | 2.722854 | 3,168 |
using NewtonsMethod3
using Test
@testset "NewtonsMethod3.jl" begin
# Write your own tests here.
end
| [
3500,
968,
27288,
17410,
18,
198,
3500,
6208,
198,
198,
31,
9288,
2617,
366,
3791,
27288,
17410,
18,
13,
20362,
1,
2221,
198,
220,
220,
220,
1303,
19430,
534,
898,
5254,
994,
13,
198,
437,
198
] | 2.916667 | 36 |
<filename>Julia/jl0502/test8.jl
binomial_rv4 = (n, p) -> length(filter(x -> x < p, [rand() for i in range(1, n)]))
head = 1/2 < rand() ? true : false
function pay()
s = 0
for i in range(1, 10)
1/2 < rand() ? s += 1 : s = 0
end
s >= 3 ? true : false
end
#println(head)
println(pay())
function ts(t, alpha)... | [
27,
34345,
29,
16980,
544,
14,
20362,
28669,
17,
14,
9288,
23,
13,
20362,
198,
8800,
49070,
62,
81,
85,
19,
796,
357,
77,
11,
279,
8,
4613,
4129,
7,
24455,
7,
87,
4613,
2124,
1279,
279,
11,
685,
25192,
3419,
329,
1312,
287,
2837... | 2.177936 | 281 |
using Slurm
using Base.Test
# write your own tests here
include("hostlist.jl")
| [
3500,
3454,
333,
76,
198,
3500,
7308,
13,
14402,
198,
198,
2,
3551,
534,
898,
5254,
994,
198,
198,
17256,
7203,
4774,
4868,
13,
20362,
4943,
198
] | 3 | 27 |
using AlphaZero
using ProgressMeter
using Statistics: mean
gspec = Examples.games["tictactoe"]
baseline = MinMax.Player(depth=5, amplify_rewards=true, τ=0.2)
mcts = MCTS.Env(gspec, MCTS.RolloutOracle(gspec))
mcts = MctsPlayer(mcts, niters=1000, τ=ConstSchedule(0.5))
player = TwoPlayers(mcts, baseline)
num_games = 200... | [
3500,
12995,
28667,
198,
3500,
18387,
44,
2357,
198,
3500,
14370,
25,
1612,
198,
198,
70,
16684,
796,
21066,
13,
19966,
14692,
83,
713,
529,
2577,
8973,
198,
12093,
4470,
796,
1855,
11518,
13,
14140,
7,
18053,
28,
20,
11,
47366,
62,
... | 2.563452 | 197 |
<reponame>UnofficialJuliaMirror/AuditoryFilters.jl-2b6db37a-05bd-5fbd-94f7-97a8281041e3
# testing ERB filterbank design
using Compat.DelimitedFiles
fb = make_erb_filterbank(16000, 23, 150)
fb_matlab = readdlm(open(joinpath(dirname(@__FILE__), "data", "ERB_filter_coeffs.csv")), ',')
@test length(fb.filters) == size(fb_m... | [
27,
7856,
261,
480,
29,
3118,
16841,
16980,
544,
27453,
1472,
14,
16353,
37765,
11928,
1010,
13,
20362,
12,
17,
65,
21,
9945,
2718,
64,
12,
2713,
17457,
12,
20,
69,
17457,
12,
5824,
69,
22,
12,
5607,
64,
23,
2078,
940,
3901,
68,
... | 1.910891 | 505 |
# Note that this script can accept some limited command-line arguments, run
# `julia build_tarballs.jl --help` to see a usage message.
using BinaryBuilder
name = "Arpack"
version = v"3.5.0-3"
# Collection of sources required to build ArpackMKLBuilder
sources = [
"https://github.com/opencollab/arpack-ng.git" =>
... | [
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,
198,
198,
3672,
796,... | 2.313684 | 1,425 |
<gh_stars>1-10
using LinearAlgebra
export translate, scale, rotate
import Base: position
"""
translate(v::Vec2D) -> Matrix
Creates a 3x3 matrix that would translate points
in the `v` direction.
"""
function translate(v::Union{Vec2D, Point})
A = zeros(3, 3) + I
A[1, 3] = v.x
A[2, 3] = v.y
A
end
"""
... | [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
3500,
44800,
2348,
29230,
198,
198,
39344,
15772,
11,
5046,
11,
23064,
198,
198,
11748,
7308,
25,
2292,
198,
198,
37811,
198,
220,
220,
220,
15772,
7,
85,
3712,
53,
721,
17,
35,
8,
4613,
... | 2.368171 | 421 |
using BinDeps
@BinDeps.setup
polylib = library_dependency("libpolylib", aliases=["libpolylib64-8"]) | [
3500,
20828,
12156,
82,
198,
198,
31,
33,
259,
12156,
82,
13,
40406,
198,
198,
35428,
8019,
796,
5888,
62,
45841,
1387,
7203,
8019,
35428,
8019,
1600,
47217,
28,
14692,
8019,
35428,
8019,
2414,
12,
23,
8973,
8
] | 2.657895 | 38 |
using ApproxFun, SpectralMeasures, Test, LinearAlgebra
import ApproxFun: ldiv_coefficients
############
### Tests
############
@testset "Spectral measures" begin
@testset "Chebyshev U" begin
a = Float64[]; b= Float64[]
@time μ=spectralmeasure(a,b)
@test μ.(-.99:.01:.99) ≈ sqrt.(1 .-(-.9... | [
3500,
2034,
13907,
24629,
11,
13058,
1373,
5308,
13846,
11,
6208,
11,
44800,
2348,
29230,
198,
220,
220,
220,
1330,
2034,
13907,
24629,
25,
300,
7146,
62,
1073,
41945,
198,
7804,
4242,
198,
21017,
30307,
198,
7804,
4242,
198,
198,
31,
... | 1.650304 | 2,139 |
<gh_stars>0
"""
House
Data stucture that represents a house and its appliances.
# Attributes
- `index`: Index of that house
- `num_timesteps`: Number of time-steps in the time horizon
- `netload_min`: House's minimum net load, for each time-step
- `netload_max`:
- `price`: Electricity price, in dollar per kWh
- `... | [
27,
456,
62,
30783,
29,
15,
198,
37811,
198,
220,
220,
220,
2097,
198,
198,
6601,
336,
4782,
495,
326,
6870,
257,
2156,
290,
663,
29834,
13,
198,
198,
2,
49213,
198,
12,
4600,
9630,
63,
25,
12901,
286,
326,
2156,
198,
12,
4600,
... | 2.379054 | 1,480 |
### General constraint Jacobians match known solutions
pI = 6
n = 3
m = 3
function cI(cdot,x,u)
cdot[1] = x[1]^3 + u[1]^2
cdot[2] = x[2]*u[2]
cdot[3] = x[3]
cdot[4] = u[1]^2
cdot[5] = u[2]^3
cdot[6] = u[3]
end
c_jac = TrajectoryOptimization.generate_general_constraint_jacobian(cI,pI,n,m)
x = ... | [
21017,
3611,
32315,
12806,
1547,
2872,
1900,
8136,
198,
79,
40,
796,
718,
198,
77,
796,
513,
198,
76,
796,
513,
198,
198,
8818,
269,
40,
7,
10210,
313,
11,
87,
11,
84,
8,
198,
220,
220,
220,
22927,
313,
58,
16,
60,
796,
2124,
... | 2.096735 | 827 |
import ImpulseResponse
using HDF5
using Test
@everywhere using DeviceUnderTest
@everywhere using Soundcard
let (f,h,d,t) = ImpulseResponse.expsinesweep_simulate()
end
function asio_test()
ms = zeros(1,8)
ms[1,1] = 1
mm = zeros(8,1)
mm[1,1] = 1
ImpulseResponse.expsinesweep_asio(ms, mm, 48000, 22... | [
11748,
9855,
9615,
31077,
198,
198,
3500,
5572,
37,
20,
198,
3500,
6208,
198,
31,
16833,
3003,
1262,
16232,
9203,
14402,
198,
31,
16833,
3003,
1262,
9506,
9517,
628,
198,
1616,
357,
69,
11,
71,
11,
67,
11,
83,
8,
796,
9855,
9615,
... | 1.9801 | 1,206 |
using GLMNet
N = 10000
K = 3
active = shuffle(collect(1:N))[1:K]
beta_intercept = 10.0
beta_slope = 1.0
betas = abs(beta_intercept + beta_slope * randn(K, 1))
ofunc(x) = sum(x[active] .* betas)
S = int(10*K*log10(N));
xs = randn(S, N);
y = [ofunc(xs[i,:]) for i in 1:S];
cv = glmnetcv(xs, y; standardize = false)
pbetas ... | [
3500,
10188,
44,
7934,
198,
45,
796,
33028,
198,
42,
796,
513,
198,
5275,
796,
36273,
7,
33327,
7,
16,
25,
45,
4008,
58,
16,
25,
42,
60,
198,
31361,
62,
3849,
984,
796,
838,
13,
15,
198,
31361,
62,
6649,
3008,
796,
352,
13,
15... | 2.054913 | 346 |
@testset "LUGS" begin
𝒮 = georef((z=[0.,1.,0.,1.,0.],), [0. 25. 50. 75. 100.])
𝒟 = CartesianGrid(100)
# ----------------------
# conditional simulation
# ----------------------
problem = SimulationProblem(𝒮, 𝒟, :z, 2)
solver = LUGS(:z => (variogram=SphericalVariogram(range=10.),))
Random.seed!(201... | [
31,
9288,
2617,
366,
43,
7340,
50,
1,
2221,
198,
220,
220,
47728,
240,
106,
796,
4903,
382,
69,
19510,
89,
41888,
15,
1539,
16,
1539,
15,
1539,
16,
1539,
15,
13,
4357,
828,
685,
15,
13,
1679,
13,
2026,
13,
5441,
13,
1802,
8183,
... | 2.483835 | 897 |
module CleanEOSTable
export cleanEOSTable
using HDF5
function clip(range::Range{Int}, mask::Range{Int})::Range{Int}
imin = max(start(range), start(mask))
imax = min(last(range), last(mask))
imin:imax
end
function linterp{T<:AbstractFloat}(x0::T, y0::T, x1::T, y1::T, x::T,
... | [
21412,
5985,
4720,
2257,
540,
198,
198,
39344,
3424,
4720,
2257,
540,
198,
198,
3500,
5572,
37,
20,
628,
198,
198,
8818,
10651,
7,
9521,
3712,
17257,
90,
5317,
5512,
9335,
3712,
17257,
90,
5317,
92,
2599,
25,
17257,
90,
5317,
92,
19... | 1.874174 | 4,538 |
# Performance and runtime benchmark to the original MATLAB implementation
# julia> versioninfo()
# Julia Version 1.7.0-beta4
# Commit d<PASSWORD> (2021-08-24 12:35 UTC)
# Platform Info:
# OS: macOS (x86_64-apple-darwin19.6.0)
# CPU: Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
# WORD_SIZE: 64
# LIBM: libopenlibm
#... | [
2,
15193,
290,
19124,
18335,
284,
262,
2656,
36775,
48780,
7822,
198,
198,
2,
474,
43640,
29,
2196,
10951,
3419,
198,
2,
22300,
10628,
352,
13,
22,
13,
15,
12,
31361,
19,
198,
2,
35910,
288,
27,
47924,
54,
12532,
29,
357,
1238,
24... | 2.220957 | 439 |
<reponame>david-macmahon/FringeExplorer.jl
# Helper functions to simplify ERFA usage
using ERFA: DAS2R, DJM0, apco13, atciq, atco13, atioq
using RadioInterferometry: dms2rad
using EarthOrientation: getΔUT1, getxp, getyp
const MJD0 = DJM0
"""
radec2hadec(α, δ, jdutc;
longitude, latitude, altitude,... | [
27,
7856,
261,
480,
29,
67,
8490,
12,
20285,
76,
30491,
14,
37,
38229,
18438,
11934,
13,
20362,
198,
2,
5053,
525,
5499,
284,
30276,
13793,
7708,
8748,
198,
198,
3500,
13793,
7708,
25,
360,
1921,
17,
49,
11,
13004,
44,
15,
11,
247... | 1.793874 | 2,416 |
function FixedTransformProvider(arg0::Transform)
return FixedTransformProvider((Transform,), arg0)
end
| [
8818,
10832,
41762,
29495,
7,
853,
15,
3712,
41762,
8,
198,
220,
220,
220,
1441,
10832,
41762,
29495,
19510,
41762,
11,
828,
1822,
15,
8,
198,
437,
628
] | 3.857143 | 28 |
__precompile__(true)
"""
StrBase package
Copyright 2017-2018 <NAME>, Inc., <NAME>,
and other contributors to the Julia language
Licensed under MIT License, see LICENSE.md
Based partly on code in LegacyStrings that used to be part of Julia
"""
module StrBase
using ModuleInterfaceTools
@api extend! ChrBase
# Public T... | [
834,
3866,
5589,
576,
834,
7,
7942,
8,
198,
37811,
198,
13290,
14881,
5301,
198,
198,
15269,
2177,
12,
7908,
1279,
20608,
22330,
3457,
1539,
1279,
20608,
22330,
198,
392,
584,
20420,
284,
262,
22300,
3303,
198,
26656,
15385,
739,
17168,... | 2.437365 | 926 |
<reponame>NikonPic/REINFORCEMENT-JULIA<filename>RL_Algorithms/src/sac/updates.jl<gh_stars>1-10
#Contains functions to update the networks
#Simply iterate trough the dataset and update:
function do_sac_update(Pl::Any,Qf1::Any, Qf2::Any, Vf::Any,Vf_tar::Any,buffer::Traj_Data,params::Params, opt_para_pl, opt_para_qf1, op... | [
27,
7856,
261,
480,
29,
40979,
261,
39507,
14,
2200,
1268,
13775,
34,
12529,
12,
41,
6239,
3539,
27,
34345,
29,
7836,
62,
2348,
7727,
907,
14,
10677,
14,
30584,
14,
929,
19581,
13,
20362,
27,
456,
62,
30783,
29,
16,
12,
940,
198,
... | 1.945512 | 2,551 |
using FastTransforms, Compat
using Compat.Test
import FastTransforms: normalizecolumns!, maxcolnorm
if VERSION ≥ v"0.7-"
vecnorm(A, p...) = norm(A, p...)
end
@testset "Synthesis and analysis" begin
# Starting with normalized spherical harmonic coefficients,
n = 50
F = sphrandn(Float64, n, n);
n... | [
3500,
12549,
8291,
23914,
11,
3082,
265,
198,
3500,
3082,
265,
13,
14402,
198,
198,
11748,
12549,
8291,
23914,
25,
3487,
528,
721,
349,
4182,
82,
28265,
3509,
4033,
27237,
198,
198,
361,
44156,
2849,
26870,
410,
1,
15,
13,
22,
21215,
... | 1.691829 | 2,411 |
<filename>src/MyPackage.jl
module MyPackage
using ForwardDiff
greet() = print("Hello World!")
include("my_func.jl")
export my_func, derivative_of_my_func
end # module
| [
27,
34345,
29,
10677,
14,
3666,
27813,
13,
20362,
198,
21412,
2011,
27813,
198,
198,
3500,
19530,
28813,
198,
198,
70,
2871,
3419,
796,
3601,
7203,
15496,
2159,
2474,
8,
198,
198,
17256,
7203,
1820,
62,
20786,
13,
20362,
4943,
198,
19... | 2.866667 | 60 |
"""
mergesorted(x::Vector{T}, y::T)
"""
function mergesorted(x::Vector{T}, y::T) where T
z, indexes = mergesorted(x, [y])
return z, indexes[1]
end
"""
mergesorted(x::Vector{T}, y::Vector{S})
"""
function mergesorted(x::Vector{T}, y::Vector{S}) where {T,S}
nx = length(x)
ny = length(y)
... | [
37811,
198,
220,
220,
220,
4017,
3212,
9741,
7,
87,
3712,
38469,
90,
51,
5512,
331,
3712,
51,
8,
628,
198,
37811,
198,
8818,
4017,
3212,
9741,
7,
87,
3712,
38469,
90,
51,
5512,
331,
3712,
51,
8,
810,
309,
198,
220,
220,
220,
197... | 1.756497 | 1,039 |
"""
abstract type NonlinearSolver <: GridapType end
- [`solve!(x::AbstractVector,nls::NonlinearSolver,op::NonlinearOperator)`](@ref)
- [`solve!(x::AbstractVector,nls::NonlinearSolver,op::NonlinearOperator, cache)`](@ref)
"""
abstract type NonlinearSolver <: GridapType end
"""
solve!(x::AbstractVector,nls::No... | [
198,
37811,
198,
220,
220,
220,
12531,
2099,
8504,
29127,
50,
14375,
1279,
25,
24846,
499,
6030,
886,
198,
198,
12,
685,
63,
82,
6442,
0,
7,
87,
3712,
23839,
38469,
11,
77,
7278,
3712,
15419,
29127,
50,
14375,
11,
404,
3712,
15419,
... | 2.485317 | 647 |
<reponame>ee7/julia
# Julia 1.0 compat
if VERSION < v"1.1"
@eval isnothing(::Any) = false
@eval isnothing(::Nothing) = true
end
"""
has_card(deck, card)
Return true if `deck` contains `card`.
"""
has_card(deck, card) = card ∈ deck
"""
find_card(deck, card)
Return the index of `card` in `deck`.
"""
f... | [
27,
7856,
261,
480,
29,
1453,
22,
14,
73,
43640,
198,
2,
22300,
352,
13,
15,
8330,
198,
361,
44156,
2849,
1279,
410,
1,
16,
13,
16,
1,
198,
220,
220,
220,
2488,
18206,
318,
22366,
7,
3712,
7149,
8,
796,
3991,
198,
220,
220,
22... | 2.539846 | 389 |
#########
#File: c:\Users\digan\Dropbox\Dynamic_Networks\repos\ScoreDrivenExponentialRandomGraphs\scripts\simulationsAndPlotsPaper\reciprocity_p_star\simulate_AR_and_estimate_variance_edges_GWESP.jl
#Project: c:\Users\digan\Dropbox\Dynamic_Networks\repos\ScoreDrivenExponentialRandomGraphs\scripts\simulationsAndPlotsPap... | [
7804,
2,
198,
2,
8979,
25,
269,
7479,
14490,
59,
67,
5516,
59,
26932,
3524,
59,
44090,
62,
7934,
5225,
59,
260,
1930,
59,
26595,
20564,
574,
16870,
35470,
29531,
37065,
82,
59,
46521,
59,
14323,
5768,
1870,
3646,
1747,
42950,
59,
83... | 2.203019 | 1,325 |
#######################
# recursive fibonacci #
#######################
perf_micro_fib(n) = n < 2 ? n : perf_micro_fib(n-1) + perf_micro_fib(n-2)
############
# parseint #
############
function perf_micro_parseint(t)
local n, m
for i=1:t
n = rand(UInt32)
s = string(n, base=16)
m = UIn... | [
14468,
4242,
21017,
198,
2,
45115,
12900,
261,
44456,
1303,
198,
14468,
4242,
21017,
198,
198,
525,
69,
62,
24055,
62,
69,
571,
7,
77,
8,
796,
299,
1279,
362,
5633,
299,
1058,
23035,
62,
24055,
62,
69,
571,
7,
77,
12,
16,
8,
134... | 1.835957 | 1,207 |
<gh_stars>1-10
export DeepQuadratic_fast,DeepQuadratic
"""
DeepQuadratic_fast(param;label,dealias)
Same as `DeepQuadratic`, but faster.
"""
mutable struct DeepQuadratic_fast <: AbstractModel
label :: String
f! :: Function
mapto :: Function
mapfro :: Function
param :: NamedTuple
kwargs :: NamedTuple
... | [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
39344,
10766,
4507,
41909,
1512,
62,
7217,
11,
29744,
4507,
41909,
1512,
198,
198,
37811,
198,
220,
220,
220,
10766,
4507,
41909,
1512,
62,
7217,
7,
17143,
26,
18242,
11,
31769,
4448,
8,
198... | 2.072965 | 2,604 |
#=
Generate steady states and the stability state
Reference
---------
1. Source code from https://www.nature.com/articles/s41598-017-15889-2
=#
steadies1, jac_ms1, stab_modes1 = fixedpoint_gen(sp.ODE!, sp.u0, sp.p, [-10.:1.0:10.,-10.:1.0:10.])
steadies2, jac_ms2, stab_modes2 = fixedpoint_gen(sp.ODE!, sp.p, [-10.:1.... | [
2,
28,
198,
8645,
378,
11831,
2585,
290,
262,
10159,
1181,
198,
198,
26687,
220,
198,
45537,
198,
16,
13,
8090,
2438,
422,
3740,
1378,
2503,
13,
21353,
13,
785,
14,
26845,
14,
82,
35038,
4089,
12,
29326,
12,
1314,
39121,
12,
17,
1... | 2.278912 | 294 |
# include("sei3r.jl")
# include("evolution.jl")
using XLSX
using Plots
using DiseaseOutbreak
# TODO: make numerical tests to replace plot tests
using Test
# default parameters for RCAN model
d0 = getParams(5.0,6.0,0.5,0.1,0.1,0.15,0.06,6.0,8.0,0.4,SEI3R())
# social distancing reducing transmission probs by 1/2
d1 = g... | [
2,
2291,
7203,
36455,
18,
81,
13,
20362,
4943,
198,
2,
2291,
7203,
1990,
2122,
13,
20362,
4943,
198,
198,
3500,
1395,
6561,
55,
198,
3500,
1345,
1747,
198,
3500,
17344,
7975,
9032,
198,
2,
16926,
46,
25,
787,
29052,
5254,
284,
6330,... | 2.05245 | 1,449 |
module EvaluateEquationModule
import ..CoreModule: Node, Options
import ..UtilsModule: @return_on_false, is_bad_array
macro return_on_check(val, T, n)
# This will generate the following code:
# if !isfinite(val)
# return (Array{T, 1}(undef, n), false)
# end
:(
if !isfinite($(esc(val))... | [
21412,
26439,
4985,
23588,
341,
26796,
198,
198,
11748,
11485,
14055,
26796,
25,
19081,
11,
18634,
198,
11748,
11485,
18274,
4487,
26796,
25,
2488,
7783,
62,
261,
62,
9562,
11,
318,
62,
14774,
62,
18747,
198,
198,
20285,
305,
1441,
62,
... | 2.089711 | 5,919 |
using Pkg
Pkg.build("AprilTags")
using Documenter, AprilTags
makedocs(
modules = [AprilTags],
format = :html,
sitename = "AprilTags.jl",
pages = Any[
"Home" => "index.md",
"Functions" => "func_ref.md"
]
# html_prettyurls = !("local" in ARGS),
)
deploydocs(
repo = "gi... | [
3500,
350,
10025,
198,
47,
10025,
13,
11249,
7203,
16784,
36142,
4943,
198,
3500,
16854,
263,
11,
3035,
36142,
198,
198,
76,
4335,
420,
82,
7,
198,
220,
220,
220,
13103,
796,
685,
16784,
36142,
4357,
198,
220,
220,
220,
5794,
796,
1... | 2.2 | 175 |
# ------------------------------------------------------------------------------
# BLAS LEVEL 2
# ------------------------------------------------------------------------------
if debug println("MKL : BLAS LEVEL 2") end
for fname in ( :mkl_gemv!,)
if debug println("export : ... | [
2,
16529,
26171,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9878,
1921,
49277,
362,
198,
2,
16529,
26171,
198,
198,
361,
14257,
44872,
... | 1.953153 | 1,110 |
<filename>src/brain.jl
const _braincols = [
"Left-Lateral-Ventricle",
"Left-Inf-Lat-Vent",
"Left-Cerebellum-White-Matter",
"Left-Cerebellum-Cortex",
"Left-Thalamus-Proper",
"Left-Caudate",
"Left-Putamen",
"Left-Pallidum",
"3rd-Ventricle",
"4th-Ventricle",
"Brain-Stem",
"L... | [
27,
34345,
29,
10677,
14,
27825,
13,
20362,
198,
9979,
4808,
27825,
4033,
82,
796,
685,
198,
220,
220,
220,
366,
18819,
12,
43,
10534,
12,
53,
22317,
293,
1600,
198,
220,
220,
220,
366,
18819,
12,
18943,
12,
24220,
12,
53,
298,
16... | 2.043029 | 1,162 |
<filename>src/fixheader.jl
#!/usr/bin/env julia
"""
Fixing VCF files generated from variant calling
to load into IGV
"""
function fixHeader(vcf=ARGS[1])
file = open(vcf)
lines = readlines(file)
info = "##fileformat=VCFv4.1
##fileDate=20151202
##source=Variant Calling
##reference=/wrk/annalam/organisms/hom... | [
27,
34345,
29,
10677,
14,
13049,
25677,
13,
20362,
198,
2,
48443,
14629,
14,
8800,
14,
24330,
474,
43640,
198,
198,
37811,
198,
22743,
278,
569,
22495,
3696,
7560,
422,
15304,
4585,
198,
1462,
3440,
656,
35336,
53,
198,
37811,
198,
19... | 2.32906 | 234 |
@testset "Find" begin
seq = dna"ACGNA"
@test findnext(DNA_A, seq, 1) == 1
@test findnext(DNA_C, seq, 1) == 2
@test findnext(DNA_G, seq, 1) == 3
@test findnext(DNA_N, seq, 1) == 4
@test findnext(DNA_T, seq, 1) == nothing
@test findnext(DNA_A, seq, 2) == 5
@test_throws BoundsError findnex... | [
31,
9288,
2617,
366,
16742,
1,
2221,
198,
220,
220,
220,
33756,
796,
288,
2616,
1,
2246,
38,
4535,
1,
198,
220,
220,
220,
2488,
9288,
1064,
19545,
7,
28886,
62,
32,
11,
33756,
11,
352,
8,
6624,
352,
198,
220,
220,
220,
2488,
928... | 2.189956 | 458 |
import Base.Threads: @spawn, @threads
function run_simulations(r::Rheology,p::Params,D₀::Vector,σ₂₂::Real,ϵ̇₁₁::Real,tspan ; multithreaded=true)
# Vector variable
vec_var = D₀
# initial higher compressive stress multiplier (S = σ₁₁/σ₂₂)
S = 1.0
# Create a Rheology type instance containing elastic moduli ... | [
11748,
7308,
13,
16818,
82,
25,
2488,
48183,
11,
2488,
16663,
82,
198,
198,
8818,
1057,
62,
14323,
5768,
7,
81,
3712,
49,
258,
1435,
11,
79,
3712,
10044,
4105,
11,
35,
158,
224,
222,
3712,
38469,
11,
38392,
158,
224,
224,
158,
224... | 1.890931 | 2,503 |
module CubedSphereDiscreteModelsTestsSeq
using Gridap
using GridapGeosciences
using FillArrays
using Test
include("../CubedSphereDiscreteModelsTests.jl")
include("../ConvergenceAnalysisTools.jl")
n_values=generate_n_values(2)
hs=[2.0/n for n in n_values]
model_args_series=zip(n_values,Fill(1,length... | [
21412,
7070,
276,
38882,
15642,
8374,
5841,
1424,
51,
3558,
4653,
80,
198,
220,
1262,
24846,
499,
198,
220,
1262,
24846,
499,
10082,
418,
979,
3007,
198,
220,
1262,
27845,
3163,
20477,
198,
220,
1262,
6208,
628,
220,
2291,
7203,
40720,
... | 2.351852 | 324 |
<filename>src/WikiSort.jl<gh_stars>0
module WikiSort
const DEFAULT_CACHE_SIZE = 512
immutable WikiSorter{T}
cache::Vector{T}
cache_size::Int
end
function call{T}(::Type{WikiSorter{T}}, cache_size::Integer=DEFAULT_CACHE_SIZE)
return WikiSorter{T}(fill(zero(T), cache_size), cache_size)
end
function revers... | [
27,
34345,
29,
10677,
14,
32603,
42758,
13,
20362,
27,
456,
62,
30783,
29,
15,
198,
21412,
13078,
42758,
198,
198,
9979,
5550,
38865,
62,
34,
2246,
13909,
62,
33489,
796,
22243,
198,
198,
8608,
18187,
13078,
50,
4337,
90,
51,
92,
19... | 2.097928 | 1,593 |
using DrWatson
using DataFrames
raw = collect_results(datadir("gadi"))
cols = eachcol(raw)
vals = map(values(cols)) do col
map(col) do v
if isa(v,NamedTuple)
v.max
elseif isa(v,Tuple)
first(v)
else
v
end
end
end
notimings = [:errnorm,:ir,:nc,:np,:ngcells,:ngdofs,:path]
dfmax ... | [
198,
3500,
1583,
54,
13506,
198,
3500,
6060,
35439,
198,
198,
1831,
796,
2824,
62,
43420,
7,
19608,
324,
343,
7203,
70,
9189,
48774,
198,
198,
4033,
82,
796,
1123,
4033,
7,
1831,
8,
198,
198,
12786,
796,
3975,
7,
27160,
7,
4033,
8... | 2.030303 | 396 |
<gh_stars>1-10
module Q
export K, K_Atom, K_Vector, K_Table, K_KeyTable
export hopen, hclose, hget
export KdbException
using DataFrames
"""
KDB_HANDLE
The handle to a kdb+ server. When `Q.jl` is embedded in kdb+, `KDB_HANDLE[]`
is always `0`, which is the handle to the current process. When `Q.jl` is
loaded in ... | [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
21412,
1195,
198,
39344,
509,
11,
509,
62,
2953,
296,
11,
509,
62,
38469,
11,
509,
62,
10962,
11,
509,
62,
9218,
10962,
198,
39344,
1725,
268,
11,
289,
19836,
11,
289,
1136,
198,
39344,
... | 2.199023 | 1,638 |
#=
This script runs step-by-step through md-cRQA analysis in Julia. It uses DynamicalSystems.jl for delay embedding and analysis.
Please see 'example_embedding.jl' for more info
=#
# ----- this script relies on the following packages -----
using Pkg
Pkg.add("DataFrames");
Pkg.add("CSV");
Pkg.add("DelayEmbeddings");... | [
198,
2,
28,
198,
1212,
4226,
4539,
2239,
12,
1525,
12,
9662,
832,
45243,
12,
66,
49,
48,
32,
3781,
287,
22300,
13,
632,
3544,
14970,
605,
11964,
82,
13,
20362,
329,
5711,
11525,
12083,
290,
3781,
13,
220,
198,
5492,
766,
705,
2068... | 2.519206 | 2,317 |
__precompile__()
module Units
export regconv, toSI, fromSI, get_toSI_converter, get_fromSI_converter
"""
`Conversion` is the container for forward and backward conversion of units
of measure (`toSI` and `fromSI` fields)
"""
immutable Conversion
toSI :: Function
fromSI :: Function
end
"""
Dictionary of units conver... | [
834,
3866,
5589,
576,
834,
3419,
198,
21412,
27719,
198,
198,
39344,
842,
42946,
11,
284,
11584,
11,
422,
11584,
11,
651,
62,
1462,
11584,
62,
1102,
332,
353,
11,
651,
62,
6738,
11584,
62,
1102,
332,
353,
198,
198,
37811,
198,
63,
... | 2.675302 | 1,158 |
include("../../mesh.jl")
include("../../utils.jl")
include("../../connectique.jl")
# include("../../visu.jl")
include("toyPbs.jl")
function validateToyProblem(nod2e::Array{Array{Int64, 1}, 1},
e2neighs::Array{Array{Int64, 1}, 1}, nedg::Int64, e2edg::Array{Array{Int64, 1}, 1},
freeedg::Array{Bool, 1}, freenod:... | [
17256,
7203,
40720,
40720,
76,
5069,
13,
20362,
4943,
198,
17256,
7203,
40720,
40720,
26791,
13,
20362,
4943,
198,
17256,
7203,
40720,
40720,
8443,
2350,
13,
20362,
4943,
198,
2,
2291,
7203,
40720,
40720,
4703,
84,
13,
20362,
4943,
198,
... | 2.245591 | 1,531 |
<gh_stars>1-10
using ACEdocs
using Test
@testset "ACEdocs.jl" begin
# Write your tests here.
end
| [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
3500,
40488,
31628,
198,
3500,
6208,
198,
198,
31,
9288,
2617,
366,
2246,
7407,
420,
82,
13,
20362,
1,
2221,
198,
220,
220,
220,
1303,
19430,
534,
5254,
994,
13,
198,
437,
198
] | 2.428571 | 42 |
"""
_abstractify_grouping(f::FormulaTerm)
Remove concrete levels associated with a schematized FormulaTerm.
Returns the formula with the grouping variables made abstract again
and a Dictionary of `Grouping()` contrasts.
"""
function _abstractify_grouping(f::FormulaTerm)
fe = filter(x -> !isa(x, AbstractReTerm... | [
37811,
198,
220,
220,
220,
4808,
397,
8709,
1958,
62,
8094,
278,
7,
69,
3712,
8479,
4712,
40596,
8,
198,
198,
27914,
10017,
2974,
3917,
351,
257,
3897,
6759,
1143,
19639,
40596,
13,
198,
198,
35561,
262,
10451,
351,
262,
36115,
9633,
... | 2.391059 | 2,304 |
# ------------------------------------------------------------------
# Licensed under the MIT License. See LICENSE in the project root.
# ------------------------------------------------------------------
"""
OrdinaryKriging(γ)
OrdinaryKriging(data, γ)
Ordinary Kriging with variogram model `γ`.
Optionally, p... | [
2,
16529,
438,
198,
2,
49962,
739,
262,
17168,
13789,
13,
4091,
38559,
24290,
287,
262,
1628,
6808,
13,
198,
2,
16529,
438,
198,
198,
37811,
198,
220,
220,
220,
14230,
3219,
42,
4359,
278,
7,
42063,
8,
198,
220,
220,
220,
14230,
3... | 2.679587 | 387 |
function read_ts_from_json(ts_path)
if isfile(ts_path)
time_series = Dict()
open(ts_path, "r") do f
time_series = JSON.parse(f)
end
else
@error "no time series data is available at $(ts_path)"
end
return time_series
end
function set_pq_from_timeseries!(mn, ... | [
8818,
1100,
62,
912,
62,
6738,
62,
17752,
7,
912,
62,
6978,
8,
198,
220,
220,
220,
611,
318,
7753,
7,
912,
62,
6978,
8,
198,
220,
220,
220,
220,
220,
220,
220,
640,
62,
25076,
220,
796,
360,
713,
3419,
198,
220,
220,
220,
220,... | 2.043478 | 276 |
using DiffEqCallbacks
using OrdinaryDiffEq
using SimulationLogs
using Test
function lotka!(du, u, p, t)
@log t
@log x, y = u
@log α, β, δ, γ = p
@log total_population = x + y
du[1] = α*x - β*x*y
du[2] = δ*x*y - γ*y
end
function lotka(u, p, t)
du = similar(u)
lotka!(du, u, p , t)
r... | [
3500,
10631,
36,
80,
14134,
10146,
198,
3500,
14230,
3219,
28813,
36,
80,
198,
3500,
41798,
11187,
82,
198,
3500,
6208,
198,
198,
8818,
1256,
4914,
0,
7,
646,
11,
334,
11,
279,
11,
256,
8,
198,
220,
220,
220,
2488,
6404,
256,
198,... | 2.010256 | 1,170 |
<gh_stars>0
using Polynomials, LinearMaps
using LinearAlgebra, SparseArrays
mutable struct CustomBOSolver{T} <: COSMO.AbstractKKTSolver
k::Int
σ::T
ρ1::T
ρ2::T
n::Int
m::Int
sqrt_dim::Int
A1::SparseMatrixCSC{T, Int}
A::SparseMatrixCSC{T, Int}
P::SparseMatrixCSC{T, Int}
tmp_n:... | [
27,
456,
62,
30783,
29,
15,
198,
3500,
12280,
26601,
8231,
11,
44800,
47010,
198,
3500,
44800,
2348,
29230,
11,
1338,
17208,
3163,
20477,
198,
76,
18187,
2878,
8562,
33,
2640,
14375,
90,
51,
92,
1279,
25,
327,
2640,
11770,
13,
23839,
... | 1.589811 | 1,531 |
<reponame>JuliaPackageMirrors/OnlineStats.jl
# Online MM algorithm via quadratic upper bound
# Majorizing function: f(u) + ∇f(u)'(Θ - u) + .5 * (Θ - u)'H(Θ - u)
# Q_t(Θ) = (Θ' * A * Θ) + (b' * Θ) + c
# Where:
# A = (1 - γ) * A + γ * H
# b = (1 - γ) * b + γ * (∇f(Θ) - H * Θ)
immutable MMQuadUpBound
A::MatF
... | [
27,
7856,
261,
480,
29,
16980,
544,
27813,
27453,
5965,
14,
14439,
29668,
13,
20362,
198,
2,
7467,
20806,
11862,
2884,
15094,
81,
1512,
6727,
5421,
198,
2,
8386,
2890,
2163,
25,
277,
7,
84,
8,
1343,
18872,
229,
69,
7,
84,
33047,
7... | 1.818182 | 253 |
<filename>docs/make.jl<gh_stars>0
#! /usr/bin/env julia
using Documenter
using GeometryBasics
# Copy the README to serve as the homepage
cp(joinpath(@__DIR__, "..", "README.md"), joinpath(@__DIR__, "src", "index.md"))
makedocs(
format = Documenter.HTML(),
sitename = "GeometryBasics.jl",
pages = [
... | [
27,
34345,
29,
31628,
14,
15883,
13,
20362,
27,
456,
62,
30783,
29,
15,
198,
2,
0,
1220,
14629,
14,
8800,
14,
24330,
474,
43640,
198,
198,
3500,
16854,
263,
198,
198,
3500,
2269,
15748,
15522,
873,
198,
198,
2,
17393,
262,
20832,
... | 2.127796 | 313 |
<reponame>danielzhaotongliu/MALTrendsWeb
{"score": 8.41, "timestamp": 1580609936.0, "score_count": 192529}
{"score": 8.42, "timestamp": 1574473816.0, "score_count": 188731}
{"score": 8.42, "timestamp": 1572936788.0, "score_count": 187641}
{"score": 8.43, "timestamp": 1567156758.0, "score_count": 183842}
{"score": 8.43,... | [
27,
7856,
261,
480,
29,
67,
6321,
89,
3099,
313,
506,
4528,
84,
14,
44,
31429,
10920,
82,
13908,
198,
4895,
26675,
1298,
807,
13,
3901,
11,
366,
16514,
27823,
1298,
1315,
1795,
1899,
2079,
2623,
13,
15,
11,
366,
26675,
62,
9127,
1... | 2.345717 | 22,180 |
println("\n\nmake_d_location: start")
prepend!(LOAD_PATH, ["Project.toml"])
import LibPQ
DISASTER_PASSWORD = read("./etc/disaster-pass", String)
postgres = LibPQ.Connection("host=127.0.0.1 port=5432 dbname=disaster user=disaster password=$<PASSWORD>")
sql =
"""
drop table if exists public.d_location;
create table i... | [
35235,
7203,
59,
77,
59,
77,
15883,
62,
67,
62,
24886,
25,
923,
4943,
198,
198,
3866,
37038,
0,
7,
35613,
62,
34219,
11,
14631,
16775,
13,
39532,
75,
8973,
8,
198,
11748,
7980,
47,
48,
198,
198,
26288,
1921,
5781,
62,
47924,
54,
... | 2.502463 | 406 |
<filename>SSPS/src/SSPS.jl<gh_stars>10-100
module SSPS
using Gen
using GLMNet
using ArgParse
using JSON
export julia_main
include("dbn_preprocess.jl")
include("dbn_models.jl")
include("dbn_proposals.jl")
include("mcmc_inference.jl")
include("state_updates.jl")
@load_generated_functions()
"""
Given the results of... | [
27,
34345,
29,
5432,
3705,
14,
10677,
14,
5432,
3705,
13,
20362,
27,
456,
62,
30783,
29,
940,
12,
3064,
198,
21412,
6723,
3705,
198,
198,
3500,
5215,
198,
3500,
10188,
44,
7934,
198,
3500,
20559,
10044,
325,
198,
3500,
19449,
198,
1... | 2.132708 | 3,519 |
include("libavresample_h.jl")
#include("avresample.jl")
| [
17256,
7203,
8019,
615,
411,
1403,
62,
71,
13,
20362,
4943,
198,
198,
2,
17256,
7203,
615,
411,
1403,
13,
20362,
4943,
198
] | 2.478261 | 23 |
abstract type Logger end
struct NoLogger <:Logger end
struct ThermoLogger <:Logger
freq::Int64
Step::Bool
Temp::Bool
Energy::Bool
Momentum::Bool
index::Array{Int64,1}
Write::Bool
File::String
Info::Array{Array{Float64,1}}
function ThermoLogger(freq::Int64,
... | [
397,
8709,
2099,
5972,
1362,
886,
198,
198,
7249,
1400,
11187,
1362,
1279,
25,
11187,
1362,
886,
628,
198,
7249,
12634,
5908,
11187,
1362,
1279,
25,
11187,
1362,
198,
220,
220,
220,
2030,
80,
3712,
5317,
2414,
198,
220,
220,
220,
5012... | 1.709951 | 1,417 |
include("utils.jl")
@testset "Euclidean" begin
E = Manifolds.Euclidean(3)
EM = Manifolds.MetricManifold(E,Manifolds.EuclideanMetric())
@test is_default_metric(EM) == Val{true}()
@test is_default_metric(E,Manifolds.EuclideanMetric()) == Val{true}()
x = zeros(3)
@test det_local_metric(EM,x) == on... | [
17256,
7203,
26791,
13,
20362,
4943,
198,
198,
31,
9288,
2617,
366,
36,
36616,
485,
272,
1,
2221,
198,
220,
220,
220,
412,
796,
1869,
361,
10119,
13,
36,
36616,
485,
272,
7,
18,
8,
198,
220,
220,
220,
17228,
796,
1869,
361,
10119,... | 1.726804 | 970 |
<gh_stars>100-1000
export Exponential, exp
"""
Description:
Maps a location to a scale parameter by exponentiation
f(out,in1) = δ(out - exp(in1))
Interfaces:
1. out
2. in1
Construction:
Exponential(out, in1, id=:some_id)
"""
mutable struct Exponential <: DeltaFactor
id::Symbol
interfa... | [
27,
456,
62,
30783,
29,
3064,
12,
12825,
198,
39344,
5518,
35470,
11,
1033,
198,
198,
37811,
198,
11828,
25,
628,
220,
220,
220,
20347,
257,
4067,
284,
257,
5046,
11507,
416,
28622,
3920,
628,
220,
220,
220,
277,
7,
448,
11,
259,
... | 2.428571 | 371 |
<reponame>Goysa2/ARCTR.jl<gh_stars>0
export TRLDLt_HO_vs_Nwt_λ
function TRLDLt_HO_vs_Nwt_λ(nlp :: AbstractNLPModel,
nlpstop :: NLPStopping;
corr_ho :: Symbol = :Shamanskii,
nwt_res_fact = 0.25,
λfact = 1.0,
kwargs...
... | [
27,
7856,
261,
480,
29,
38,
726,
11400,
17,
14,
1503,
4177,
49,
13,
20362,
27,
456,
62,
30783,
29,
15,
198,
39344,
7579,
11163,
49578,
62,
32298,
62,
14259,
62,
45,
46569,
62,
39377,
198,
198,
8818,
7579,
11163,
49578,
62,
32298,
... | 1.7325 | 400 |
<filename>_assets/pages/end-to-end/horse/code/ex14.jl<gh_stars>10-100
# This file was generated, do not modify it. # hide
@load OneHotEncoder
@load MultinomialClassifier pkg="MLJLinearModels" | [
27,
34345,
29,
62,
19668,
14,
31126,
14,
437,
12,
1462,
12,
437,
14,
30527,
14,
8189,
14,
1069,
1415,
13,
20362,
27,
456,
62,
30783,
29,
940,
12,
3064,
198,
2,
770,
2393,
373,
7560,
11,
466,
407,
13096,
340,
13,
1303,
7808,
198,... | 2.768116 | 69 |
# Estimation/Simulation options, part of each model
@with_kw mutable struct estimOptions
algo = NelderMead()
innerAlgo = NLopt.LN_BOBYQA # used only for MultiStart
lb = nothing
ub = nothing
autodiff = GalacticOptim.AutoFiniteDiff(;fdtype = Val(:central),fdhtype = Val(:hcentral))
nDraws::Int64 = 500
use... | [
2,
10062,
18991,
14,
8890,
1741,
3689,
11,
636,
286,
1123,
2746,
220,
201,
198,
31,
4480,
62,
46265,
4517,
540,
2878,
3959,
29046,
201,
198,
197,
282,
2188,
796,
3169,
6499,
44,
1329,
3419,
201,
198,
197,
5083,
2348,
2188,
796,
2287... | 2.346203 | 777 |
<filename>src/autodiff/dual.jl
# ComplexDual encompasses all complex dual types
const ComplexDual{T,V,N} = Complex{Dual{T,V,N}}
# Constructor for ComplexDual based on real Partials for dreal and dimag
@inline function ComplexDual{T,V,N}(z::Number,dr::Partials{N,V},di::Partials{N,V}) where {T,N,V<:Real}
zr, zi = re... | [
27,
34345,
29,
10677,
14,
2306,
375,
733,
14,
646,
282,
13,
20362,
198,
2,
19157,
36248,
38932,
477,
3716,
10668,
3858,
198,
9979,
19157,
36248,
90,
51,
11,
53,
11,
45,
92,
796,
19157,
90,
36248,
90,
51,
11,
53,
11,
45,
11709,
1... | 2.309828 | 1,801 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.