content stringlengths 6 1.03M | input_ids listlengths 4 535k | ratio_char_token float64 0.68 8.61 | token_count int64 4 535k |
|---|---|---|---|
function test_circuit_codes( p::Parameters )
funcs = default_funcs( p.numinputs )
c = random_chromosome( p, funcs )
cc = circuit_code( c )
# See https://en.wikibooks.org/wiki/Introducing_Julia/Strings_and_characters#Streams
iobuffer = IOBuffer()
print_build_chromosome(iobuffer,c)
c_str = String(take!(... | [
198,
8818,
1332,
62,
21170,
5013,
62,
40148,
7,
279,
3712,
48944,
1267,
198,
220,
1257,
6359,
796,
4277,
62,
12543,
6359,
7,
279,
13,
77,
7230,
1996,
82,
1267,
198,
220,
269,
796,
4738,
62,
28663,
418,
462,
7,
279,
11,
1257,
6359,... | 2.053 | 1,000 |
#=These are the initial XB Code States for the I5 code,
initial_xb_code_states[1] is a 1 3 chip array which represent the shift
register values initial_xb_code_states[3][4] represents the 4th shift register
of the GPS Signal with PRN numver 3 =#
const INITIAL_XB_CODE_STATES = [ #sat PRN number
[0, 1... | [
2,
28,
4711,
389,
262,
4238,
1395,
33,
6127,
1829,
329,
262,
314,
20,
2438,
11,
198,
36733,
62,
30894,
62,
8189,
62,
27219,
58,
16,
60,
318,
257,
352,
513,
11594,
7177,
543,
2380,
262,
6482,
198,
30238,
3815,
4238,
62,
30894,
62,
... | 1.943218 | 3,170 |
<filename>src/nalu.jl
# structs and methods for basic neural accumulator / neural arithmetic
# logic unit.
# - Neural Accumulator - #
"""
A linear layer whose weights are soft constrained to be near one of
{-1, 0, 1}. The weights are calculated by tanh.(W) .* σ.(M).
"""
struct NeuralAccumulator{R <: AbstractMatrix}
... | [
27,
34345,
29,
10677,
14,
77,
282,
84,
13,
20362,
198,
2,
2878,
82,
290,
5050,
329,
4096,
17019,
10507,
8927,
1220,
17019,
34768,
198,
2,
9156,
4326,
13,
628,
198,
2,
532,
47986,
6366,
388,
8927,
532,
1303,
198,
37811,
198,
32,
14... | 2.331804 | 654 |
const DEFAULT_PRIORITY = 1000
const DEFAULT_TEMPLATE_DIR = Ref{String}(joinpath(dirname(dirname(pathof(PkgTemplates))), "templates"))
"""
@plugin struct ... end
Define a plugin subtype with keyword constructors and default values.
For details on the general syntax, see
[Parameters.jl](https://mauro3.github.io/Pa... | [
9979,
5550,
38865,
62,
4805,
41254,
9050,
796,
8576,
198,
9979,
5550,
38865,
62,
51,
3620,
6489,
6158,
62,
34720,
796,
6524,
90,
10100,
92,
7,
22179,
6978,
7,
15908,
3672,
7,
15908,
3672,
7,
6978,
1659,
7,
47,
10025,
12966,
17041,
4... | 3.087822 | 3,917 |
<reponame>DDMGNI/GeometricProblems.jl
@doc raw"""
"""
module LotkaVolterra4d
using GeometricEquations
using Parameters
export hamiltonian, ϑ, ϑ₁, ϑ₂, ω
export lotka_volterra_4d_ode,
lotka_volterra_4d_pode, lotka_volterra_4d_pdae,
lotka_volterra_4d_iode, lotka_volterra_4d_idae,... | [
27,
7856,
261,
480,
29,
16458,
44,
16630,
40,
14,
10082,
16996,
2964,
22143,
13,
20362,
198,
31,
15390,
8246,
37811,
198,
198,
37811,
198,
21412,
15099,
4914,
16598,
353,
430,
19,
67,
628,
220,
220,
220,
1262,
2269,
16996,
23588,
602,... | 1.359414 | 9,905 |
__precompile__()
module FastaIO
using Compat
using GZip
export
FastaReader,
readentry,
rewind,
readfasta,
FastaWriter,
writeentry,
writefasta
import Base.start, Base.done, Base.next, Base.readall,
Base.close, Base.show, Base.eof, Base.write
import Compat: String
const fasta_buf... | [
834,
3866,
5589,
576,
834,
3419,
198,
198,
21412,
12549,
64,
9399,
198,
198,
3500,
3082,
265,
198,
3500,
402,
41729,
198,
198,
39344,
198,
220,
220,
220,
12549,
64,
33634,
11,
198,
220,
220,
220,
1100,
13000,
11,
198,
220,
220,
220,... | 2.012859 | 5,599 |
<reponame>jkrch/MatrixMarket.jl
module MatrixMarket
using Compat.SparseArrays
using Compat.LinearAlgebra
export mmread, mmwrite
struct ParseError
error :: String
end
_parseint(x) = parse(Int, x)
"""
### mmread(filename, infoonly::Bool=false, retcoord::Bool=false)
Read the contents of the Matrix Market file 'f... | [
27,
7856,
261,
480,
29,
73,
38584,
354,
14,
46912,
27470,
13,
20362,
198,
21412,
24936,
27470,
198,
198,
3500,
3082,
265,
13,
50,
29572,
3163,
20477,
198,
3500,
3082,
265,
13,
14993,
451,
2348,
29230,
198,
198,
39344,
8085,
961,
11,
... | 2.14822 | 3,090 |
using SolidStateDetectors
include("Plotting.jl")
include("ReadGeant4Hits.jl")
include("EventSimulation.jl")
defaultDir = "plots/"
T = Float32
function BiasVariation(configFile::String, initVoltage::Real, finalVoltage::Real, length::Integer, CCDName::String="")::AbstractDict{Real, Simulation}
biasRange = range(i... | [
3500,
15831,
9012,
47504,
669,
198,
198,
17256,
7203,
43328,
889,
13,
20362,
4943,
198,
17256,
7203,
5569,
10082,
415,
19,
39,
896,
13,
20362,
4943,
198,
17256,
7203,
9237,
8890,
1741,
13,
20362,
4943,
198,
198,
12286,
35277,
796,
366,
... | 2.443946 | 1,784 |
# demo for double loop
for i = 1:2, j = 3:4
println((i, j))
end | [
2,
13605,
329,
4274,
9052,
198,
1640,
1312,
796,
352,
25,
17,
11,
474,
796,
513,
25,
19,
198,
220,
220,
220,
44872,
19510,
72,
11,
474,
4008,
198,
437
] | 2.233333 | 30 |
<reponame>BottomHoleAssemblyAnalysis/Cases.jl<gh_stars>0
using BHAtp, Statistics
ProjDir = @__DIR__
!isdir(joinpath(ProjDir, "plots")) && mkdir(joinpath(ProjDir, "plots"))
ProjName = split(ProjDir, "/")[end]
bhaj = BHAtp.BHAJ(ProjName, ProjDir)
bhaj.ratio = 0.5
segs = [
# Element type, Material, Length, ID... | [
27,
7856,
261,
480,
29,
34104,
39,
2305,
49670,
32750,
14,
34,
1386,
13,
20362,
27,
456,
62,
30783,
29,
15,
198,
3500,
347,
39,
2953,
79,
11,
14370,
198,
198,
2964,
73,
35277,
796,
2488,
834,
34720,
834,
198,
0,
9409,
343,
7,
22... | 1.812637 | 1,820 |
using Base.Test
#-------------------------------------------------------------------------------------------------#
include("../src/pccf.jl")
@test Pccf.pccfWithConfirmation([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15],2,[3,7,10]) == [1,2, 1,2,3,4,5,6,7, 1,2,3,4,5,6] # confirmed=[3,10]
#-------------------------------------... | [
3500,
7308,
13,
14402,
198,
198,
2,
10097,
3880,
12,
2,
198,
17256,
7203,
40720,
10677,
14,
79,
535,
69,
13,
20362,
4943,
198,
31,
9288,
350,
535,
69,
13,
79,
535,
69,
3152,
18546,
36241,
26933,
16,
11,
17,
11,
18,
11,
19,
11,
... | 2.112005 | 1,616 |
<filename>Examples/Julia/SP500.jl
##
using CSV, DataFrames, DataFramesMeta, StatsPlots, Dates, DelimitedFiles
cd(@__DIR__)
# download and unzip the data file, from
# https://realized.oxford-man.ox.ac.uk/images/oxfordmanrealizedvolatilityindices.zip
## read the data into a DataFrame
data = CSV.read("oxfordmanrealizedvo... | [
27,
34345,
29,
27730,
14,
16980,
544,
14,
4303,
4059,
13,
20362,
198,
2235,
198,
3500,
44189,
11,
6060,
35439,
11,
6060,
35439,
48526,
11,
20595,
3646,
1747,
11,
44712,
11,
4216,
320,
863,
25876,
198,
10210,
7,
31,
834,
34720,
834,
... | 2.683607 | 610 |
module ArrayIterators
export EachRow, EachCol
@static if VERSION < v"1.1"
# added in https://github.com/JuliaLang/julia/pull/29749
# once available in Compat, we should re-export here
# https://github.com/JuliaLang/Compat.jl/issues/639
error("Julia version $VERSION is not supported")
end
const EachRo... | [
21412,
15690,
29993,
2024,
198,
198,
39344,
5501,
25166,
11,
5501,
5216,
198,
198,
31,
12708,
611,
44156,
2849,
1279,
410,
1,
16,
13,
16,
1,
198,
220,
220,
220,
1303,
2087,
287,
3740,
1378,
12567,
13,
785,
14,
16980,
544,
43,
648,
... | 2.374083 | 409 |
<gh_stars>10-100
@test_throws DimensionMismatch shuffleobs((X, rand(149)))
@testset "typestability" begin
for var in vars
@test typeof(@inferred(shuffleobs(var))) <: SubArray
end
for tup in tuples
@test typeof(@inferred(shuffleobs(tup))) <: Tuple
end
end
@testset "Array and SubArray" b... | [
27,
456,
62,
30783,
29,
940,
12,
3064,
198,
31,
9288,
62,
400,
8516,
34024,
44,
1042,
963,
36273,
8158,
19510,
55,
11,
43720,
7,
19442,
22305,
198,
198,
31,
9288,
2617,
366,
28004,
395,
1799,
1,
2221,
198,
220,
220,
220,
329,
1401... | 2.291837 | 980 |
using ChemistryFeaturization
# Batching Utilities
"""
batch_graph_data(laplacians, encoded_features)
Takes vectors of laplacians and encoded features and joins them
into a single graph of disjoint subgraphs. The resulting graph
is massive and hence the return types are sparse. Few of the layers
don't work with Sp... | [
3500,
27867,
14304,
2541,
1634,
198,
198,
2,
347,
19775,
41086,
198,
37811,
198,
220,
220,
220,
15458,
62,
34960,
62,
7890,
7,
5031,
489,
330,
1547,
11,
30240,
62,
40890,
8,
198,
198,
51,
1124,
30104,
286,
8591,
489,
330,
1547,
290,... | 2.574046 | 655 |
<reponame>ettersi/SparseFactorizations
"""
selinv_from_ldlt(Fp,Fi,Fv; conj = conj) -> Bv
Compute the entries `Bv` of the inverse of `A = F.L*F.D*F.Lt` contained in
the sparsity pattern of the (incomplete) LDLt factorization `F`.
"""
function selinv_from_ldlt(Fp,Fi,Fv; conj = Base.conj)
Tv = eltype(Fv)
n = ... | [
27,
7856,
261,
480,
29,
316,
1010,
72,
14,
50,
29572,
41384,
4582,
198,
37811,
198,
220,
220,
220,
384,
2815,
85,
62,
6738,
62,
335,
2528,
7,
37,
79,
11,
10547,
11,
37,
85,
26,
11644,
796,
11644,
8,
4613,
347,
85,
198,
198,
72... | 1.53604 | 1,207 |
using AbstractLogic
using Test
using Suppressor
@test LogicalCombo() |> nfeasible == 0
logicset = @suppress logicalparse("a,b,c,d,e in 1:2")
@test logicset[1,1] == 1
@test logicset[4^3,3] == 2
@test logicset[:,:a] == logicset[:,1]
logicset = @suppress logicalparse("a.1,a.2,a.3,b.1,b.2,b.3 in 1:3 || {{j}}.1 != {{j}}.... | [
3500,
27741,
11187,
291,
198,
3500,
6208,
198,
3500,
8105,
44292,
198,
198,
31,
9288,
5972,
605,
5377,
2127,
3419,
930,
29,
299,
5036,
292,
856,
6624,
657,
198,
198,
6404,
873,
316,
796,
2488,
18608,
601,
12219,
29572,
7203,
64,
11,
... | 2.296069 | 1,628 |
module TestEquality
using Compat
using Compat.Test
using CategoricalArrays
@testset "== and isequal() for CategoricalPool{Int} and CategoricalPool{Float64}" begin
pool1 = CategoricalPool([1, 2, 3])
pool2 = CategoricalPool([2.0, 1.0, 3.0])
@test isequal(pool1, pool1) === true
@test isequal(pool1, pool2... | [
21412,
6208,
36,
13237,
198,
3500,
3082,
265,
198,
3500,
3082,
265,
13,
14402,
198,
3500,
327,
2397,
12409,
3163,
20477,
198,
198,
31,
9288,
2617,
366,
855,
290,
318,
40496,
3419,
329,
327,
2397,
12409,
27201,
90,
5317,
92,
290,
327,
... | 2.128367 | 2,376 |
<gh_stars>1-10
# # Little Group in 2D
# ## Preamble
using LatticeTools
using Formatting
using Plots
function display_matrix(io::IO, matrix::AbstractMatrix; prefix::AbstractString="")
width = ceil(Int, maximum(length("$item")+1 for item in matrix)/4)*4
for row in eachrow(matrix)
for (icol, col) in enum... | [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
2,
1303,
7703,
4912,
287,
362,
35,
198,
198,
2,
22492,
350,
1476,
903,
198,
3500,
406,
1078,
501,
33637,
198,
3500,
18980,
889,
198,
3500,
1345,
1747,
198,
198,
8818,
3359,
62,
6759,
8609,... | 2.550781 | 1,024 |
<reponame>cmuenger/ShunnHamQuadrature.jl<gh_stars>0
using StaticArrays
const hexateron1an = [
SVector{6}([0.16666666666666666 0.16666666666666666 0.16666666666666666 0.16666666666666666 0.16666666666666666 0.16666666666666666])
]
const hexateron1wn = [
1.0,
]
#x = [0.10367258783179548]
#w = [0.1666666666666666... | [
27,
7856,
261,
480,
29,
11215,
84,
6540,
14,
2484,
20935,
21281,
4507,
41909,
1300,
13,
20362,
27,
456,
62,
30783,
29,
15,
198,
3500,
36125,
3163,
20477,
198,
198,
9979,
17910,
729,
261,
16,
272,
796,
685,
198,
220,
220,
220,
20546,... | 1.953325 | 39,057 |
using Test, StatsBase, CUDA, FixedEffects, PooledArrays, CategoricalArrays
p1 = repeat(1:5, inner = 2)
p2 = repeat(1:5, outer = 2)
x = [ 0.5548445405298847 , 0.9444014472663531 , 0.0510866660400604 , 0.9415750229576445 , 0.697755708534771 , 0.9664962514198971 , 0.12752269572311858, 0.4633531422366297 , 0.03341608526... | [
3500,
6208,
11,
20595,
14881,
11,
29369,
5631,
11,
10832,
47738,
11,
19850,
276,
3163,
20477,
11,
327,
2397,
12409,
3163,
20477,
628,
198,
79,
16,
796,
9585,
7,
16,
25,
20,
11,
8434,
796,
362,
8,
198,
79,
17,
796,
9585,
7,
16,
2... | 2.291237 | 776 |
<filename>src/UI.jl<gh_stars>0
# GridWhale module
# Copyright (c) 2020 <NAME>, LLC. All Rights Reserved.
#
# This file provides functions for interacting with the UI. It is part of the
# GridWhale module.
module UI
end
| [
27,
34345,
29,
10677,
14,
10080,
13,
20362,
27,
456,
62,
30783,
29,
15,
198,
2,
197,
41339,
1199,
1000,
8265,
198,
2,
197,
15269,
357,
66,
8,
12131,
1279,
20608,
22330,
11419,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
197,
1212,
... | 3.041096 | 73 |
<filename>tester/testsuite/bad/bad028.jl
void main(){
String x;
}
| [
27,
34345,
29,
4879,
353,
14,
9288,
2385,
578,
14,
14774,
14,
14774,
46957,
13,
20362,
198,
19382,
1388,
39893,
198,
220,
220,
220,
10903,
2124,
26,
198,
92,
198
] | 2.333333 | 30 |
<filename>src/PowerSystemsUnits.jl
module PowerSystemsUnits
import Unitful
import Unitful: J, W, hr, 𝐋, 𝐌, 𝐓
using Unitful: @unit, @derived_dimension, @dimension, @refunit, @u_str, uconvert, Quantity
export asqtype, fustrip, UnitfulMissing
# Power Units
@derived_dimension PowerHour 𝐋^2*𝐌*𝐓^-2
@unit Wh "Wh" Wat... | [
27,
34345,
29,
10677,
14,
13434,
11964,
82,
3118,
896,
13,
20362,
198,
21412,
4333,
11964,
82,
3118,
896,
198,
198,
11748,
11801,
913,
198,
11748,
11801,
913,
25,
449,
11,
370,
11,
39436,
11,
220,
47728,
238,
233,
11,
220,
47728,
23... | 2.655172 | 406 |
function grpc_result_or_error(result::T,
status::Task,
f::Function) where {T<:Union{<:Proto.ProtoType,<:Channel{<:Proto.ProtoType},<:Nothing}}
if istaskdone(status)
s = fetch(status)
if !s.success
throw(TypeDBClientException(s.message, gRPCServiceCallException(s.grpc_status,fetc... | [
8818,
1036,
14751,
62,
20274,
62,
273,
62,
18224,
7,
20274,
3712,
51,
11,
198,
220,
220,
220,
3722,
3712,
25714,
11,
198,
220,
220,
220,
277,
3712,
22203,
8,
810,
1391,
51,
27,
25,
38176,
90,
27,
25,
2964,
1462,
13,
2964,
1462,
... | 2.375546 | 229 |
<filename>test/examples/atlas.jl
using ConstrainedDynamics
path = "examples/examples_files/atlas_simple.urdf"
mech, shapes = Mechanism(path, floating=false, g = -.5)
| [
27,
34345,
29,
9288,
14,
1069,
12629,
14,
265,
21921,
13,
20362,
198,
3500,
1482,
2536,
1328,
35,
4989,
873,
628,
198,
6978,
796,
366,
1069,
12629,
14,
1069,
12629,
62,
16624,
14,
265,
21921,
62,
36439,
13,
2799,
69,
1,
198,
1326,
... | 2.666667 | 63 |
using SparseArrays
using LinearAlgebra
using QuadGK
mutable struct modelParameters
N
c1
c2
K
xf
τ
A1
solDir
T
tMax
solAdj
phaseSensNorm
end
function setParams(N,c1,c2,K,xf,τ,print=false)
D = zeros(N,N)
Om = zeros(N,N)
Id = zeros(N,N)
for i in 1:N
D[i,i] ... | [
3500,
1338,
17208,
3163,
20477,
198,
3500,
44800,
2348,
29230,
198,
3500,
20648,
38,
42,
198,
198,
76,
18187,
2878,
2746,
48944,
198,
220,
220,
220,
399,
198,
220,
220,
220,
269,
16,
198,
220,
220,
220,
269,
17,
198,
220,
220,
220,
... | 1.904977 | 1,989 |
function ftriple!(f::Vector{Float64},x::Vector{Float64},beta::Vector{Float64},A0::Vector{Float64},
rho::Float64,c0::Vector{Float64},W::Vector{Float64})
# f = zeros(8);
# conservation of mass
f[1] = x[1] .- x[3] .- x[5] .- x[7];
# total P
f[2] = (beta[1].*(sqrt.(x[2]) .- sqrt.(A0[1])) + 0.5.*rho... | [
8818,
10117,
380,
1154,
0,
7,
69,
3712,
38469,
90,
43879,
2414,
5512,
87,
3712,
38469,
90,
43879,
2414,
5512,
31361,
3712,
38469,
90,
43879,
2414,
5512,
32,
15,
3712,
38469,
90,
43879,
2414,
5512,
198,
220,
220,
220,
374,
8873,
3712,
... | 1.58042 | 715 |
import Printf
import Random
using LinearAlgebra
import DifferentialEquations
import Distributions
import PyPlot
import StatsBase
import StatsFuns
import Printf
import Utilities # https://gitlab.com/RoyCCWang/utilities
import Calculus
import AdaptiveRKHS
import Statistics
include("../src/misc/declarations.jl")
... | [
198,
11748,
12578,
69,
198,
11748,
14534,
198,
3500,
44800,
2348,
29230,
198,
198,
11748,
20615,
498,
23588,
602,
198,
198,
11748,
46567,
507,
198,
198,
11748,
9485,
43328,
198,
198,
11748,
20595,
14881,
198,
11748,
20595,
37,
13271,
198,... | 2.013252 | 2,943 |
<gh_stars>0
"""
$(SIGNATURES)
Macro to set common fields in structs. See
https://discourse.julialang.org/t/julia-learning-macros-metaprogramming/45753/3
# Example
```
@common_fields set1 begin
x :: Int
y :: Float64
end
struct Foo
@set1
z
end
```
"""
macro common_fields(name, definition)
return q... | [
27,
456,
62,
30783,
29,
15,
198,
37811,
198,
197,
3,
7,
46224,
47471,
8,
198,
198,
14155,
305,
284,
900,
2219,
7032,
287,
2878,
82,
13,
4091,
198,
5450,
1378,
15410,
9047,
13,
73,
377,
498,
648,
13,
2398,
14,
83,
14,
73,
43640,
... | 2.326316 | 190 |
using PyPlot
pospart(x) = ( x > 0 ? x : zero(x) )
function K2(x, y, a, b)
pt = [a, (a+b)/2, b]
ℓ2 = (x-pt[1])*(x-pt[3])/((pt[2]-pt[1])*(pt[2]-pt[3]))
ℓ3 = (x-pt[1])*(x-pt[2])/((pt[3]-pt[1])*(pt[3]-pt[2]))
Qπ = pospart(pt[2]-y)^2 * ℓ2 / 2 + (b-y)^2 * ℓ3 / 2
return Qπ - pospart(x-y)^2/2
end
a = -1.... | [
3500,
9485,
43328,
198,
198,
1930,
3911,
7,
87,
8,
796,
357,
2124,
1875,
657,
5633,
2124,
1058,
6632,
7,
87,
8,
1267,
198,
198,
8818,
509,
17,
7,
87,
11,
331,
11,
257,
11,
275,
8,
198,
220,
220,
220,
42975,
796,
685,
64,
11,
... | 1.664444 | 450 |
# reference implementation on the CPU
# note that most of the code in this file serves to define a functional array type,
# the actual implementation of GPUArrays-interfaces is much more limited.
module JLArrays
export JLArray, jl
using GPUArrays
using Adapt
#
# Device functionality
#
## device properties
stru... | [
2,
4941,
7822,
319,
262,
9135,
198,
198,
2,
3465,
326,
749,
286,
262,
2438,
287,
428,
2393,
9179,
284,
8160,
257,
10345,
7177,
2099,
11,
198,
2,
262,
4036,
7822,
286,
11362,
3163,
20477,
12,
3849,
32186,
318,
881,
517,
3614,
13,
1... | 2.307008 | 4,495 |
<reponame>ptiede/ROSEx.jl
using MeasureBase: logdensityof, Likelihood
export RadioLikelihood, logdensityof, MultiRadioLikelihood
using LinearAlgebra
struct RadioLikelihood{T,A} <: MB.AbstractMeasure
lklhds::T
ac::A
end
struct MultiRadioLikelihood{L} <: MB.AbstractMeasure
lklhds::L
end
"""
`MultiRad... | [
27,
7856,
261,
480,
29,
457,
798,
68,
14,
49,
2640,
3109,
13,
20362,
198,
3500,
24291,
14881,
25,
2604,
43337,
1659,
11,
4525,
11935,
198,
39344,
8829,
7594,
11935,
11,
2604,
43337,
1659,
11,
15237,
26093,
7594,
11935,
198,
3500,
4480... | 2.535969 | 1,821 |
<filename>src/pricing_engines/black_calculator.jl
mutable struct BlackCalculator{S <: StrikedTypePayoff}
payoff::S
strike::Float64
forward::Float64
stdDev::Float64
discount::Float64
variance::Float64
d1::Float64
d2::Float64
alpha::Float64
beta::Float64
DalphaDd1::Float64
DbetaDd2::Float64
n_d1... | [
27,
34345,
29,
10677,
14,
1050,
6345,
62,
1516,
1127,
14,
13424,
62,
9948,
3129,
1352,
13,
20362,
198,
76,
18187,
2878,
2619,
9771,
3129,
1352,
90,
50,
1279,
25,
26137,
9091,
6030,
19197,
2364,
92,
198,
220,
43843,
3712,
50,
198,
22... | 2.316686 | 2,643 |
module ModuleReplicable
using Test
using Hyperspecialize
global A = Set{Type}([])
struct Weeble <: Real
x::Int
end
f(::Real) = false
using Qux
import Qux.h
Qux.h(::Weeble, ::Real) = true
@testset "Module Replicable" begin
# First, a test for module local widening
@concretize TypicalTag []
@replicable f... | [
21412,
19937,
39232,
18424,
198,
198,
3500,
6208,
198,
3500,
21209,
364,
431,
2413,
1096,
198,
198,
20541,
317,
796,
5345,
90,
6030,
92,
26933,
12962,
198,
198,
7249,
48643,
903,
1279,
25,
6416,
198,
220,
2124,
3712,
5317,
198,
437,
1... | 2.318681 | 364 |
using IncrementalInference, KernelDensityEstimate
fg = emptyFactorGraph()
N=100
doors = reshape(Float64[-100.0;0.0;100.0;300.0],1,4)
pd = kde!(doors,[3.0])
pd = resample(pd,N);
bws = getBW(pd)[:,1]
doors2 = getPoints(pd);
v1 = addNode!(fg,:x0,doors,N=N)
f1 = addFactor!(fg,[v1],Obsv2( doors2, reshape(bws,1,1), [1.0... | [
3500,
10791,
37098,
818,
4288,
11,
32169,
35,
6377,
22362,
1920,
198,
198,
40616,
796,
6565,
41384,
37065,
3419,
198,
198,
45,
28,
3064,
198,
198,
19559,
796,
27179,
1758,
7,
43879,
2414,
58,
12,
3064,
13,
15,
26,
15,
13,
15,
26,
... | 1.91701 | 1,458 |
using Photometry.Aperture: bounds
@testset "Apertures" begin
ap_rect = RectangularAperture(50, 40, 10, 10, 0)
@test center(ap_rect) == (50, 40)
@test bounds(ap_rect) == (45, 55, 35, 45)
@test size(ap_rect) == (11, 11)
@test size(ap_rect, 1) == 11
@test RectangularAperture([50, 40], 10, 10, 0) =... | [
3500,
5919,
15748,
13,
32,
27286,
25,
22303,
198,
198,
31,
9288,
2617,
366,
32,
11766,
942,
1,
2221,
198,
220,
220,
220,
2471,
62,
2554,
796,
48599,
21413,
32,
27286,
7,
1120,
11,
2319,
11,
838,
11,
838,
11,
657,
8,
198,
220,
22... | 2.125761 | 493 |
# TODO: have a doc for ops here.
#"@knet function dot(w,x) is matrix multiplication."
#"@knet function input() fetches the next network input."
# ### mul2 element-wise multiplication:
abstract Op
# Each op must provide the following:
# back_reads_y (tosave)
# back_reads_x (tosave)
# ninputs (netcomp1)
# infersize (us... | [
2,
16926,
46,
25,
423,
257,
2205,
329,
39628,
994,
13,
198,
2,
1,
31,
74,
3262,
2163,
16605,
7,
86,
11,
87,
8,
318,
17593,
48473,
526,
198,
2,
1,
31,
74,
3262,
2163,
5128,
3419,
11351,
2052,
262,
1306,
3127,
5128,
526,
198,
2,... | 2.633127 | 646 |
<filename>src/CatalystInterop.jl
""" Supports conversion from PetriNets to Catalyst ReactionSystems
This provides access to the parameter estimation, optimization, and sensitivity
tooling provided in the Catalyst library
"""
module CatalystInterop
using AlgebraicPetri
using Catlab.CategoricalAlgebra
using ...Ca... | [
27,
34345,
29,
10677,
14,
21979,
21470,
9492,
404,
13,
20362,
198,
37811,
45267,
11315,
422,
4767,
380,
45,
1039,
284,
48238,
39912,
11964,
82,
198,
198,
1212,
3769,
1895,
284,
262,
11507,
31850,
11,
23989,
11,
290,
14233,
198,
25981,
... | 2.705394 | 482 |
# This file is part of GenericSchur.jl, released under the MIT "Expat" license
# The methods in this file are derived from LAPACK's ztgsyl etc.
# LAPACK is released under a BSD license, and is
# Copyright:
# Univ. of Tennessee
# Univ. of California Berkeley
# Univ. of Colorado Denver
# NAG Ltd.
# Note: since this is ... | [
2,
770,
2393,
318,
636,
286,
42044,
14874,
333,
13,
20362,
11,
2716,
739,
262,
17168,
366,
3109,
8071,
1,
5964,
198,
198,
2,
383,
5050,
287,
428,
2393,
389,
10944,
422,
406,
2969,
8120,
338,
1976,
25297,
1837,
75,
3503,
13,
198,
2... | 1.82916 | 2,476 |
# broadcast2arg:
# These functions use broadcasting to handle arrays of different sizes.
# Unless otherwise specified they support:
# (N,N) (N,A) (A,N) (A,A) (A,B)
# where N:Number, A,B arrays of broadcast compatible sizes.
broadcast2arg = [
(:.+, :dy, :dy), # extra (A,)
(:.*, :(dy.*x2), :(dy.*x1)),... | [
2,
7025,
17,
853,
25,
198,
2,
2312,
5499,
779,
22978,
284,
5412,
26515,
286,
1180,
10620,
13,
198,
2,
17486,
4306,
7368,
484,
1104,
25,
198,
2,
357,
45,
11,
45,
8,
357,
45,
11,
32,
8,
357,
32,
11,
45,
8,
357,
32,
11,
32,
8... | 2.133767 | 1,383 |
# to get rid of eventually
const Columns = StructVector
# IndexedTable-like API
"""
colnames(itr)
Returns the names of the "columns" in `itr`.
# Examples:
colnames(1:3)
colnames(Columns([1,2,3], [3,4,5]))
colnames(table([1,2,3], [3,4,5]))
colnames(Columns(x=[1,2,3], y=[3,4,5]))
colnames(tab... | [
2,
284,
651,
5755,
286,
4191,
198,
9979,
29201,
82,
796,
32112,
38469,
198,
198,
2,
12901,
276,
10962,
12,
2339,
7824,
198,
198,
37811,
198,
220,
220,
220,
951,
14933,
7,
270,
81,
8,
198,
198,
35561,
262,
3891,
286,
262,
366,
2866... | 2.184316 | 9,717 |
<reponame>UnofficialJuliaMirrorSnapshots/QuantumBayesian.jl-dfba31c6-ed66-5d02-bd53-3eb16f72707f<gh_stars>0
### QuantumOscillator.jl
# Convenience functionality for handling finite-dimensional systems,
# specifically related to the (truncated) harmonic oscillator
###
"""
osc(n::Int[, name="Osc(n)"::QName])
Create... | [
27,
7856,
261,
480,
29,
3118,
16841,
16980,
544,
27453,
1472,
43826,
20910,
14,
24915,
388,
15262,
35610,
13,
20362,
12,
7568,
7012,
3132,
66,
21,
12,
276,
2791,
12,
20,
67,
2999,
12,
17457,
4310,
12,
18,
1765,
1433,
69,
47760,
2998... | 2.366873 | 646 |
# Map a rule over the grids it reads from and updating the grids it writes to.
# This is broken into a setup method and an application method
# to introduce a function barrier, for type stability.
maprule!(data::SimData, rule) = maprule!(data, Val{ruletype(rule)}(), rule)
function maprule!(data::SimData, ruletype::Val{... | [
2,
9347,
257,
3896,
625,
262,
50000,
340,
9743,
422,
290,
19698,
262,
50000,
340,
6797,
284,
13,
198,
2,
770,
318,
5445,
656,
257,
9058,
2446,
290,
281,
3586,
2446,
198,
2,
284,
10400,
257,
2163,
13054,
11,
329,
2099,
10159,
13,
1... | 2.270883 | 8,428 |
<gh_stars>1-10
using Query
using FileIO
"""
Create a parameter `component`_`name` with the given value,
and connect parameter `name` within `component` to this distinct global parameter.
"""
function setdistinctparameter(m::Model, component::Symbol, name::Symbol, value)
globalname = Symbol(string(component, '_', n... | [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
3500,
43301,
198,
3500,
9220,
9399,
198,
198,
37811,
198,
16447,
257,
11507,
4600,
42895,
63,
62,
63,
3672,
63,
351,
262,
1813,
1988,
11,
198,
392,
2018,
11507,
4600,
3672,
63,
1626,
4600,
... | 2.339744 | 624 |
<gh_stars>1-10
#module ArraySlices
using Compat.view
import Base: length, size, eltype, getindex
export slices, columns, rows
# Type parameters
#
# F : type of SubArray
# D : indexed dimension of the array
# A : array type
#
immutable SliceIterator{F, D, A<:AbstractArray} <: AbstractVector{F}
array::A
end
# en... | [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
2,
21412,
15690,
50,
677,
274,
198,
198,
3500,
3082,
265,
13,
1177,
198,
198,
11748,
7308,
25,
4129,
11,
2546,
11,
1288,
4906,
11,
651,
9630,
198,
198,
39344,
24314,
11,
15180,
11,
15274,
... | 2.523216 | 883 |
<gh_stars>1-10
"""
AbstractResponse
"""
abstract type AbstractResponse end
"""
`Response <: AbstractResponse`
# Description
An immutable which holds the information about response, such as the identifier of the examinee who gave the response,
`examinee_id::String`, the identifier of the answered item `item_idx::... | [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
37811,
198,
220,
220,
220,
27741,
31077,
198,
37811,
198,
397,
8709,
2099,
27741,
31077,
886,
198,
198,
37811,
198,
63,
31077,
1279,
25,
27741,
31077,
63,
198,
198,
2,
12489,
198,
198,
2025,... | 2.503513 | 3,416 |
<gh_stars>0
# generate examples
import Literate
EXAMPLEDIR = joinpath(@__DIR__, "src", "literate")
GENERATEDDIR = joinpath(@__DIR__, "src", "examples")
mkpath(GENERATEDDIR)
# Copy supplementary files first
suplementary_fileextensions = [".inp", ".svg", ".png", ".jpg", ".gif"]
for example in readdir(EXAMPLEDIR)
if... | [
27,
456,
62,
30783,
29,
15,
198,
2,
7716,
6096,
198,
11748,
17667,
378,
198,
198,
6369,
2390,
6489,
1961,
4663,
796,
4654,
6978,
7,
31,
834,
34720,
834,
11,
366,
10677,
1600,
366,
17201,
378,
4943,
198,
35353,
1137,
11617,
34720,
79... | 2.464286 | 616 |
macro S_str(terms)
_lookup(terms)
end
| [
20285,
305,
311,
62,
2536,
7,
38707,
8,
198,
220,
220,
220,
4808,
5460,
929,
7,
38707,
8,
198,
437,
198
] | 2 | 21 |
<reponame>1ozturkbe/ROdemos
# Activating Julia environment
using Pkg
Pkg.activate(".")
# Packages
using JuMP, Gurobi, Random, Distributions, LinearAlgebra, Plots
T = 25
S = 5
I = 6
Random.seed!(MersenneTwister(314)) # Do not change the seed.
function generate_data(I::Int64, S::Int64, T::Int64)
mvdist = Multinomi... | [
27,
7856,
261,
480,
29,
16,
8590,
36590,
74,
1350,
14,
13252,
9536,
418,
198,
2,
13144,
803,
22300,
2858,
198,
3500,
350,
10025,
198,
47,
10025,
13,
39022,
7203,
19570,
198,
198,
2,
6400,
1095,
198,
3500,
12585,
7378,
11,
402,
1434,... | 1.942733 | 2,532 |
using Test
for testscen in 1:2
valdir, scenario, use_permafrost, use_seaice = get_scenario(testscen)
println(scenario)
m = page_model()
include("../src/components/CH4forcing.jl")
add_comp!(m, ch4forcing, :ch4forcing)
set_param!(m, :ch4forcing, :c_N2Oconcentration, readpagedata(m,"test/valida... | [
3500,
6208,
198,
198,
1640,
1332,
1416,
268,
287,
352,
25,
17,
198,
220,
220,
220,
1188,
15908,
11,
8883,
11,
779,
62,
16321,
1878,
23341,
11,
779,
62,
8583,
501,
796,
651,
62,
1416,
39055,
7,
9288,
1416,
268,
8,
198,
220,
220,
... | 2.31677 | 322 |
using TERMIOS
using Test
const c_iflag = Sys.islinux() ? 0x00000500 : 0x0000000000006b02
const c_oflag = Sys.islinux() ? 0x00000005 : 0x0000000000000003
const c_cflag = Sys.islinux() ? 0x000000bf : 0x0000000000004b00
const c_lflag = Sys.islinux() ? 0x00008a3b : 0x00000000000005cf
const c_cc = Sys.islinux() ? (0x03, 0x... | [
3500,
28994,
8895,
2640,
198,
3500,
6208,
198,
198,
9979,
269,
62,
361,
30909,
796,
311,
893,
13,
271,
23289,
3419,
5633,
657,
87,
20483,
4059,
1058,
657,
87,
8269,
2388,
21,
65,
2999,
198,
9979,
269,
62,
1659,
30909,
796,
311,
893,... | 2.03691 | 1,165 |
# # Simple multi-layer perceptron
# In this example, we create a simple [multi-layer perceptron](https://en.wikipedia.org/wiki/Multilayer_perceptron) (MLP) that classifies handwritten digits
# using the [MNIST dataset](http://yann.lecun.com/exdb/mnist/). A MLP consists of at least *three layers* of stacked perceptron... | [
2,
1303,
17427,
5021,
12,
29289,
34953,
1313,
628,
198,
2,
554,
428,
1672,
11,
356,
2251,
257,
2829,
685,
41684,
12,
29289,
34953,
1313,
16151,
5450,
1378,
268,
13,
31266,
13,
2398,
14,
15466,
14,
15205,
346,
2794,
62,
525,
984,
131... | 2.863298 | 2,553 |
# Autogenerated wrapper script for Cgl_jll for i686-linux-musl-cxx11
export libCgl
using Clp_jll
using Osi_jll
using CoinUtils_jll
using CompilerSupportLibraries_jll
JLLWrappers.@generate_wrapper_header("Cgl")
JLLWrappers.@declare_library_product(libCgl, "libCgl.so.1")
function __init__()
JLLWrappers.@generate_ini... | [
2,
5231,
519,
877,
515,
29908,
4226,
329,
327,
4743,
62,
73,
297,
329,
1312,
33808,
12,
23289,
12,
14664,
75,
12,
66,
5324,
1157,
198,
39344,
9195,
34,
4743,
198,
198,
3500,
1012,
79,
62,
73,
297,
198,
3500,
8834,
72,
62,
73,
29... | 2.217054 | 258 |
using QuantumStatePlots
using QuantumStateBase
using Test
@testset "QuantumStatePlots.jl" begin
ENV["GKSwstype"]="nul"
@testset "plot wigner" begin
x_range = -5:1.0:5
p_range = -5:1.0:5
wf = WignerFunction(x_range, p_range)
state = VacuumState()
ws = wf(state)
file_path = "wigner.png"
... | [
3500,
29082,
9012,
3646,
1747,
198,
3500,
29082,
9012,
14881,
198,
3500,
6208,
198,
198,
31,
9288,
2617,
366,
24915,
388,
9012,
3646,
1747,
13,
20362,
1,
2221,
198,
198,
1677,
53,
14692,
38,
42,
10462,
301,
2981,
8973,
2625,
77,
377,
... | 2.138796 | 598 |
using Documenter, Espresso
makedocs()
deploydocs(
deps = Deps.pip("mkdocs", "python-markdown-math"),
repo = "github.com/dfdx/Espresso.jl.git",
julia = "0.6"
)
| [
198,
3500,
16854,
263,
11,
20386,
33852,
198,
198,
76,
4335,
420,
82,
3419,
198,
198,
2934,
1420,
31628,
7,
198,
220,
220,
220,
390,
862,
220,
220,
796,
2129,
82,
13,
79,
541,
7203,
28015,
31628,
1600,
366,
29412,
12,
4102,
2902,
... | 2.107143 | 84 |
<filename>src/operators/limit_subscribers.jl<gh_stars>100-1000
export limit_subscribers, LimitSubscribersGuard
import Base: show
import DataStructures: isfull
"""
LimitSubscribersGuard(limit::Int = 1, exclusive = true)
Guard structure used in `limit_subscribers` operator.
# Arguments
- `limit`: number of concur... | [
27,
34345,
29,
10677,
14,
3575,
2024,
14,
32374,
62,
7266,
40075,
364,
13,
20362,
27,
456,
62,
30783,
29,
3064,
12,
12825,
198,
39344,
4179,
62,
7266,
40075,
364,
11,
27272,
7004,
40075,
364,
24502,
198,
198,
11748,
7308,
25,
905,
1... | 3.066522 | 1,849 |
using Random
traj_folder = joinpath(dirname(pathof(TrajectoryOptimization)),"..")
urdf_folder = joinpath(traj_folder, "dynamics","urdf")
urdf_kuka_orig = joinpath(urdf_folder, "kuka_iiwa.urdf")
urdf_kuka = joinpath(urdf_folder, "temp","kuka.urdf")
function write_kuka_urdf()
kuka_mesh_dir = joinpath(TrajectoryOptim... | [
3500,
14534,
198,
9535,
73,
62,
43551,
796,
4654,
6978,
7,
15908,
3672,
7,
6978,
1659,
7,
15721,
752,
652,
27871,
320,
1634,
4008,
553,
492,
4943,
198,
2799,
69,
62,
43551,
796,
4654,
6978,
7,
9535,
73,
62,
43551,
11,
366,
67,
498... | 2.076853 | 2,199 |
module Nektar
using Mesh2d
type NektarBndry <: Mesh2d.Bndry
tag::Char
elem::Int
edge::Int
params::Array{Float64,1}
funs::Array{String, 1}
NektarBndry(bt, el, ed, p, funs=Array(String,0)) = new(bt, el, ed, p, funs)
end
function section(flines, header)
nl = length(flines)
for i in 1:nl... | [
198,
21412,
37167,
18870,
198,
3500,
47529,
17,
67,
198,
198,
4906,
37167,
18870,
33,
358,
563,
1279,
25,
47529,
17,
67,
13,
33,
358,
563,
198,
220,
220,
220,
7621,
3712,
12441,
198,
220,
220,
220,
9766,
76,
3712,
5317,
198,
220,
... | 1.821882 | 2,285 |
<gh_stars>0
mutable struct EmpiricalMean{T<:Real,V<:AbstractVector{<:Real}} <: PriorMean{T}
C::V
opt::Optimizer
end
"""
**EmpiricalMean**
```julia`
function EmpiricalMean(c::V=1.0;opt::Optimizer=Adam(α=0.01)) where {V<:AbstractVector{<:Real}}
```
Construct a constant mean with values `c`
Optionally give an opt... | [
27,
456,
62,
30783,
29,
15,
198,
76,
18187,
2878,
2295,
4063,
605,
5308,
272,
90,
51,
27,
25,
15633,
11,
53,
27,
25,
23839,
38469,
90,
27,
25,
15633,
11709,
1279,
25,
14481,
5308,
272,
90,
51,
92,
198,
220,
220,
220,
327,
3712,
... | 2.086351 | 718 |
module NEPCore
using SparseArrays
using LinearAlgebra
# Fundamental nonlinear eigenvalue problems
export NEP
#
export NoConvergenceException
export LostOrthogonalityException
export interpolate
# Core interfaces
export compute_Mder
export compute_Mlincomb
export compute... | [
21412,
10635,
5662,
382,
198,
220,
220,
220,
1262,
1338,
17208,
3163,
20477,
198,
220,
220,
220,
1262,
44800,
2348,
29230,
628,
220,
220,
220,
1303,
49983,
1729,
29127,
304,
9324,
8367,
2761,
198,
220,
220,
220,
10784,
399,
8905,
198,
... | 2.384033 | 4,885 |
@testset "is_schur" begin
A = [0.5][:,:]
@test InvariantSets.is_schur(A)
end
| [
31,
9288,
2617,
366,
271,
62,
20601,
333,
1,
2221,
198,
220,
220,
220,
317,
796,
685,
15,
13,
20,
7131,
45299,
47715,
198,
220,
220,
220,
2488,
9288,
10001,
2743,
415,
50,
1039,
13,
271,
62,
20601,
333,
7,
32,
8,
198,
437,
198
] | 1.888889 | 45 |
module RegistryTests
using Pkg, UUIDs, LibGit2, Test
using Pkg: depots1
using Pkg.REPLMode: pkgstr
using Pkg.Types: PkgError
include("utils.jl")
function setup_test_registries(dir = pwd())
# Set up two registries with the same name, with different uuid
pkg_uuids = ["c5f1542f-b8aa-45da-ab42-05303d706c66", "d... | [
21412,
33432,
51,
3558,
198,
198,
3500,
350,
10025,
11,
471,
27586,
82,
11,
7980,
38,
270,
17,
11,
6208,
198,
3500,
350,
10025,
25,
1207,
1747,
16,
198,
3500,
350,
10025,
13,
2200,
6489,
19076,
25,
279,
10025,
2536,
198,
3500,
350,
... | 2.031868 | 4,958 |
using Test, TransferEntropy
x, y = rand(100), rand(100)
###########################################
# Set `dim` and infer `k`, `l` and `m`.
###########################################
tol = 1e-12
# Only with time series
@test all(transferentropy(x, y) .>= 0 - tol)
@test all(transferentropy(x, y, dim = 3) .>= 0 - tol... | [
3500,
6208,
11,
20558,
14539,
28338,
198,
198,
87,
11,
331,
796,
43720,
7,
3064,
828,
43720,
7,
3064,
8,
198,
198,
29113,
7804,
21017,
198,
2,
5345,
4600,
27740,
63,
290,
13249,
4600,
74,
47671,
4600,
75,
63,
290,
4600,
76,
44646,
... | 2.576547 | 614 |
module MakieLayout
using AbstractPlotting
using AbstractPlotting: Rect2D
import AbstractPlotting: IRect2D
using AbstractPlotting.Keyboard
using AbstractPlotting.Mouse
using AbstractPlotting: ispressed, is_mouseinside
using Observables: onany
import Observables
import Formatting
using Match
import Animations
import Plo... | [
21412,
15841,
494,
32517,
198,
198,
3500,
27741,
43328,
889,
198,
3500,
27741,
43328,
889,
25,
48599,
17,
35,
198,
11748,
27741,
43328,
889,
25,
14826,
478,
17,
35,
198,
3500,
27741,
43328,
889,
13,
9218,
3526,
198,
3500,
27741,
43328,
... | 3.217949 | 702 |
__precompile__(true)
module WinReg
import Compat: @static
export querykey
const HKEY_CLASSES_ROOT = 0x80000000
const HKEY_CURRENT_USER = 0x80000001
const HKEY_LOCAL_MACHINE = 0x80000002
const HKEY_USERS = 0x80000003
const HKEY_PERFORMANCE_DATA = 0x80000004
const HKEY_CURRENT_CONFIG = 0x800000... | [
834,
3866,
5589,
576,
834,
7,
7942,
8,
198,
21412,
7178,
8081,
198,
198,
11748,
3082,
265,
25,
2488,
12708,
198,
198,
39344,
12405,
2539,
198,
198,
9979,
367,
20373,
62,
31631,
1546,
62,
13252,
2394,
220,
220,
220,
220,
796,
657,
87... | 2.287327 | 2,391 |
<gh_stars>0
using RobustAdaptiveMetropolisSampler, Distributions, LinearAlgebra, VegaLite, DataFrames
chain, accrate, S = RAM_sample(
p -> logpdf(Normal(3., 2), p[1]), # log target function
[0.], # Initial values
0.5, # Scaling factor
100_000 ... | [
27,
456,
62,
30783,
29,
15,
198,
3500,
3851,
436,
48003,
425,
9171,
25986,
16305,
20053,
11,
46567,
507,
11,
44800,
2348,
29230,
11,
30310,
43,
578,
11,
6060,
35439,
198,
198,
7983,
11,
697,
4873,
11,
311,
796,
13931,
62,
39873,
7,
... | 1.964912 | 228 |
using Plots, Test
pgfplotsx()
function create_plot(args...; kwargs...)
pgfx_plot = plot(args...; kwargs...)
return pgfx_plot, repr("application/x-tex", pgfx_plot)
end
function create_plot!(args...; kwargs...)
pgfx_plot = plot!(args...; kwargs...)
return pgfx_plot, repr("application/x-tex", pgfx_plot)
end
... | [
3500,
1345,
1747,
11,
6208,
198,
6024,
69,
489,
1747,
87,
3419,
198,
198,
8818,
2251,
62,
29487,
7,
22046,
986,
26,
479,
86,
22046,
23029,
198,
220,
220,
23241,
21373,
62,
29487,
796,
7110,
7,
22046,
986,
26,
479,
86,
22046,
23029,
... | 1.951613 | 6,014 |
<reponame>SchusterLab/RobotDynamics.jl
struct Satellite <: LieGroupModel
J::Diagonal{Float64,SVector{3,Float64}}
end
Satellite() = Satellite(Diagonal(@SVector ones(3)))
RobotDynamics.control_dim(::Satellite) = 3
Base.position(::Satellite, x::SVector) = @SVector zeros(3)
RobotDynamics.orientation(::Satellite, x::S... | [
27,
7856,
261,
480,
29,
14874,
5819,
17822,
14,
14350,
313,
35,
4989,
873,
13,
20362,
198,
7249,
33530,
1279,
25,
12060,
13247,
17633,
198,
220,
220,
220,
449,
3712,
18683,
27923,
90,
43879,
2414,
11,
50,
38469,
90,
18,
11,
43879,
2... | 2.161695 | 637 |
<reponame>Oblynx/htm.jl
const VecTuple{N,T}= Union{NTuple{N,T}, Vector{NTuple{N,T}}}
# This is a bit inefficient. The more verbose implementation below is more efficient and
# allows use of the internal expand!
#expand(I::Vector{NTuple{N,T}}) where {N,T}= [map(a->a[i], I) for i in 1:N]
expand(I::Vector{NTuple{N,T}})... | [
27,
7856,
261,
480,
29,
5944,
6213,
87,
14,
19211,
13,
20362,
198,
9979,
38692,
51,
29291,
90,
45,
11,
51,
92,
28,
4479,
90,
11251,
29291,
90,
45,
11,
51,
5512,
20650,
90,
11251,
29291,
90,
45,
11,
51,
42535,
198,
198,
2,
770,
... | 2.090214 | 654 |
"""
NormalCanon(η, λ)
Canonical parametrisation of the Normal distribution with canonical parameters `η` and `λ`.
The two *canonical parameters* of a normal distribution ``\\mathcal{N}(\\mu, \\sigma^2)`` with mean ``\\mu`` and
standard deviation ``\\sigma`` are ``\\eta = \\sigma^{-2} \\mu`` and ``\\lambda = \\sig... | [
37811,
198,
220,
220,
220,
14435,
6090,
261,
7,
138,
115,
11,
7377,
119,
8,
198,
198,
6090,
261,
605,
5772,
316,
2442,
341,
286,
262,
14435,
6082,
351,
40091,
10007,
4600,
138,
115,
63,
290,
4600,
39377,
44646,
198,
198,
464,
734,
... | 2.185999 | 1,457 |
<reponame>Ved-Mahajan/PatternFolds.jl
using PatternFolds
using Documenter
DocMeta.setdocmeta!(PatternFolds, :DocTestSetup, :(using PatternFolds); recursive=true)
makedocs(;
modules=[PatternFolds],
authors="<NAME>",
repo="https://github.com/Humans-of-Julia/PatternFolds.jl/blob/{commit}{path}#{line}",
s... | [
27,
7856,
261,
480,
29,
53,
276,
12,
40936,
1228,
272,
14,
47546,
37,
10119,
13,
20362,
198,
3500,
23939,
37,
10119,
198,
3500,
16854,
263,
198,
198,
23579,
48526,
13,
2617,
15390,
28961,
0,
7,
47546,
37,
10119,
11,
1058,
23579,
144... | 2.287162 | 296 |
@block SimonDanisch ["2d"] begin
@cell "Test heatmap + image overlap" [image, heatmap, transparency] begin
heatmap(rand(32, 32))
image!(map(x->RGBAf0(x,0.5, 0.5, 0.8), rand(32,32)))
end
@cell "Interaction" [scatter, linesegment, record] begin
scene = Scene()
f(t, v, s) = (... | [
198,
31,
9967,
11288,
21174,
25308,
14631,
17,
67,
8973,
2221,
628,
220,
220,
220,
2488,
3846,
366,
14402,
4894,
8899,
1343,
2939,
21721,
1,
685,
9060,
11,
4894,
8899,
11,
13902,
60,
2221,
198,
220,
220,
220,
220,
220,
220,
220,
489... | 1.887733 | 5,095 |
<reponame>MiroK/emi-cylinders<filename>emi.jl/demos/circle_pieces.jl
include("../emi.jl")
using EMI
using EMI.Draw, EMI.Gmsh
loop = Loop([CircleArc(Point(1, 0), Point(0, 0), Point(0, 1)),
CircleArc(Point(0, 1), Point(0, 0), Point(-1, 0)),
CircleArc(Point(-1, 0), Point(0, 0), Point(0, -1)),
... | [
27,
7856,
261,
480,
29,
44,
7058,
42,
14,
43967,
12,
38801,
29700,
27,
34345,
29,
43967,
13,
20362,
14,
9536,
418,
14,
45597,
62,
34154,
13,
20362,
198,
17256,
7203,
40720,
43967,
13,
20362,
4943,
198,
3500,
412,
8895,
198,
3500,
41... | 2.038298 | 235 |
<filename>src/config.jl<gh_stars>1-10
module Config
struct SimulationConfig
time_step_update_period::UInt8
"function defining a(t)"
a
end
end # module | [
27,
34345,
29,
10677,
14,
11250,
13,
20362,
27,
456,
62,
30783,
29,
16,
12,
940,
198,
21412,
17056,
198,
198,
7249,
41798,
16934,
198,
220,
220,
220,
640,
62,
9662,
62,
19119,
62,
41007,
3712,
52,
5317,
23,
198,
220,
220,
220,
366... | 2.645161 | 62 |
########################## Auxiliary functions #############################
function eye(tpe::Type,n::S) where {S <: Integer}
if tpe <: Number
return Matrix{tpe}(I,n,n)
end
end
eye(n::Integer) = eye(Float64,n::Integer)
function tracem(x::Array{T,2}) where {T <: Real}
# Computes the matrix-trace as defi... | [
14468,
7804,
2235,
47105,
28129,
5499,
1303,
14468,
7804,
4242,
198,
198,
8818,
4151,
7,
83,
431,
3712,
6030,
11,
77,
3712,
50,
8,
810,
1391,
50,
1279,
25,
34142,
92,
628,
220,
611,
256,
431,
1279,
25,
7913,
198,
220,
220,
220,
22... | 2.085888 | 9,687 |
@testset "Diffusion Simulation" begin
gx = complete_graph(5)
for g in testgraphs(gx) # this makes graphs of different eltypes
# Most basic
@test @inferred(diffusion_rate(g, 1.0, 4)) == [1, 5, 5, 5]
end
for i in 1:5
add_vertex!(gx)
end
for g in testgraphs(gx) # this makes graphs of different eltypes
... | [
198,
31,
9288,
2617,
366,
28813,
4241,
41798,
1,
2221,
198,
198,
70,
87,
796,
1844,
62,
34960,
7,
20,
8,
198,
198,
1640,
308,
287,
1332,
34960,
82,
7,
70,
87,
8,
220,
1303,
428,
1838,
28770,
286,
1180,
1288,
19199,
198,
220,
220... | 1.753394 | 2,725 |
<reponame>cosmhology/PhysicalConstants.jl
module PhysicalConstant
using Measurements, Unitful
import Measurements: value, uncertainty
struct Constant{sym} <: Number end
function name end
function ref end
macro constant(sym, name, val, def, unit, unc, bigunc, reference)
esym = esc(sym)
qsym = esc(Expr(:quot... | [
27,
7856,
261,
480,
29,
6966,
76,
71,
1435,
14,
31611,
34184,
1187,
13,
20362,
198,
21412,
16331,
3103,
18797,
198,
198,
3500,
24291,
902,
11,
11801,
913,
198,
198,
11748,
24291,
902,
25,
1988,
11,
13479,
198,
198,
7249,
20217,
90,
... | 2.08737 | 3,571 |
"""
pctOnly(df::DataFrame, ColPct::String)
Creates a new dataframe without rows without precipitation.
# Arguments
- `df::DataFrame`: The dataframe containing the data.
- `ColPct::String`: The name of the column of `df` that allows to know if it has rained or not during the time division used.
"""
function pctOn... | [
37811,
198,
220,
220,
220,
279,
310,
10049,
7,
7568,
3712,
6601,
19778,
11,
1623,
47,
310,
3712,
10100,
8,
198,
198,
16719,
274,
257,
649,
1366,
14535,
1231,
15274,
1231,
32025,
13,
198,
198,
2,
20559,
2886,
198,
198,
12,
4600,
7568... | 3.015444 | 518 |
module AttemptAtQNM
include("SpectralSolver.jl")
include("NewtonSolver.jl")
include("SchwarszchildModes.jl")
include("Interface.jl")
using .Interface
# Write your package code here.
struct Potato
Root::Float64
end
print(GetModes(2,2,2,2))
export Potato
export GetModes
end
| [
21412,
25770,
2953,
48,
32755,
198,
198,
17256,
7203,
49738,
1373,
50,
14375,
13,
20362,
4943,
198,
17256,
7203,
3791,
1122,
50,
14375,
13,
20362,
4943,
198,
17256,
7203,
14874,
86,
945,
89,
9410,
44,
4147,
13,
20362,
4943,
198,
17256,
... | 2.76699 | 103 |
# A general unary operation uses the following pipeline
# 0. special rules `Identity` and `Tr`,
# 1. rules reducing dimensions `Diag` and `Sum`
# 2. `Permutedims`,
# 3. `Repeat` and `Duplicate`,
# `NT` for number of tensors
abstract type EinRule{NT} end
struct Tr <: EinRule{1} end
struct Sum <: EinRule{1} end
struct ... | [
2,
317,
2276,
555,
560,
4905,
3544,
262,
1708,
11523,
198,
2,
657,
13,
2041,
3173,
4600,
7390,
26858,
63,
290,
4600,
2898,
47671,
198,
2,
352,
13,
3173,
8868,
15225,
4600,
18683,
363,
63,
290,
4600,
13065,
63,
198,
2,
362,
13,
460... | 1.971488 | 3,367 |
module FLOWVPM
import Dates
import GeometricTools: create_path
const RealFMM = Float64
# Available Kernels
const kernel_singular = (args...)->nothing
const kernel_gaussian = (args...)->nothing
const kernel_gaussianerf = (args...)->nothing
const kernel_winckelmans = (args...)->nothing
const singular = kernel_singular... | [
21412,
9977,
3913,
53,
5868,
198,
198,
11748,
44712,
198,
11748,
2269,
16996,
33637,
25,
2251,
62,
6978,
198,
198,
9979,
6416,
37,
12038,
796,
48436,
2414,
198,
198,
2,
14898,
509,
44930,
198,
9979,
9720,
62,
12215,
934,
796,
357,
220... | 1.97353 | 6,309 |
# TODO:
# - refactor, simplify branching, unify duplications
# - (maybe) export latex completions into a separate package
struct CompletionState
offset::Int
completions::Dict{String,CompletionItem}
range::Range
x::EXPR
doc::Document
server::LanguageServerInstance
using_stmts::Dict{String,An... | [
2,
16926,
46,
25,
198,
2,
532,
1006,
11218,
11,
30276,
49526,
11,
555,
1958,
14184,
3736,
198,
2,
532,
357,
25991,
8,
10784,
47038,
1224,
45240,
656,
257,
4553,
5301,
198,
198,
7249,
955,
24547,
9012,
198,
220,
220,
220,
11677,
3712... | 2.165435 | 12,452 |
# generateur d'Instances pour la RODD
n = 10
m = 10
# Ouvrir le fichier "output.txt" dans lequel on pourra écrire
fout = open("outputn10m10.txt", "w")
println(fout, "title")
println(fout, "n = " * string(n))
println(fout, "m = " * string(m))
for i in 1:n
myLine = ""
for j in 1:(m-1)
myLine = myLine * str... | [
2,
7716,
333,
288,
6,
6310,
1817,
12797,
8591,
371,
3727,
35,
628,
198,
77,
796,
838,
198,
76,
796,
838,
628,
198,
198,
2,
440,
14795,
29283,
443,
277,
488,
959,
366,
22915,
13,
14116,
1,
288,
504,
443,
31735,
319,
12797,
430,
3... | 2.252632 | 190 |
<gh_stars>0
#ДАНО: Робот находится в произвольной клетке ограниченного прямоугольного поля без внутренних перегородок и маркеров.
#РЕЗУЛЬТАТ: Робот — в исходном положении в центре прямого креста из маркеров, расставленных вплоть до внешней рамки.
function crest!(r::Robot)
for side in (HorizonSide(i) for i=0:3)... | [
27,
456,
62,
30783,
29,
15,
198,
2,
140,
242,
140,
238,
140,
251,
140,
252,
25,
12466,
254,
25443,
109,
15166,
20375,
12466,
121,
16142,
141,
227,
25443,
112,
18849,
20375,
21727,
40623,
12466,
110,
12466,
123,
21169,
15166,
18849,
14... | 1.440385 | 520 |
<filename>ViscosityDrop/src/simulation/boundary_conditions.jl
function no_slip_bc(grid)
v_bcs = VVelocityBoundaryConditions(grid,
top = BoundaryCondition(Value, 0.0),
bottom = BoundaryCondition(Value, 0.0),
north = BoundaryCondition(NormalFlow, 0.0),
south = BoundaryC... | [
27,
34345,
29,
53,
2304,
16579,
26932,
14,
10677,
14,
14323,
1741,
14,
7784,
560,
62,
17561,
1756,
13,
20362,
198,
8818,
645,
62,
6649,
541,
62,
15630,
7,
25928,
8,
198,
220,
220,
410,
62,
65,
6359,
796,
569,
46261,
11683,
49646,
... | 2.270758 | 277 |
<gh_stars>1-10
module FSimROS
using PyCall
using UnPack
using FSimBase, FSimZoo
using StaticArrays, ReferenceFrameRotations
include("convert.jl")
export state_to_msg, msg_to_state
end
| [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
21412,
376,
8890,
49,
2640,
198,
198,
3500,
9485,
14134,
198,
198,
3500,
791,
11869,
198,
198,
3500,
376,
8890,
14881,
11,
376,
8890,
57,
2238,
198,
3500,
36125,
3163,
20477,
11,
20984,
1977... | 2.652778 | 72 |
<reponame>f6v/STMO<filename>test/optimaltransport.jl
@testset "Optimal tranport" begin
using STMO.OptimalTransport
C = [1 1 0;
0 1 1;
1 0 1]
@testset "Monge" begin
@test monge_brute_force(C) == ([3, 1, 2], 0)
@test monge_brute_force(1.0C) == ([3, 1, 2], 0.0)
end
@... | [
27,
7856,
261,
480,
29,
69,
21,
85,
14,
2257,
11770,
27,
34345,
29,
9288,
14,
8738,
4402,
7645,
634,
13,
20362,
198,
31,
9288,
2617,
366,
27871,
4402,
491,
272,
634,
1,
2221,
198,
220,
220,
220,
1262,
3563,
11770,
13,
27871,
4402,... | 1.717489 | 446 |
<filename>src/TreeTools/src/prunegraft.jl<gh_stars>1-10
export prunenode!, prunenode, graftnode!, delete_node!, delete_null_branches!, remove_internal_singletons, prunesubtree!
"""
prunenode!(node::TreeNode)
Prune node `node` by detaching it from its ancestor. Return pruned `node` and the root of its ancestor. The ... | [
27,
34345,
29,
10677,
14,
27660,
33637,
14,
10677,
14,
1050,
403,
1533,
1617,
13,
20362,
27,
456,
62,
30783,
29,
16,
12,
940,
198,
39344,
778,
403,
268,
1098,
28265,
778,
403,
268,
1098,
11,
38455,
17440,
28265,
12233,
62,
17440,
28... | 2.539254 | 2,331 |
<reponame>UnofficialJuliaMirror/CxxWrap.jl-1f15a43c-97ca-5a2a-ae31-89f07a497df4<gh_stars>0
module StdLib
using ..CxxWrap
abstract type CppBasicString <: AbstractString end
# These are defined in C++, but the functions need to exist to add methods
function append end
function cppsize end
function cxxgetindex end
func... | [
27,
7856,
261,
480,
29,
3118,
16841,
16980,
544,
27453,
1472,
14,
34,
5324,
54,
2416,
13,
20362,
12,
16,
69,
1314,
64,
3559,
66,
12,
5607,
6888,
12,
20,
64,
17,
64,
12,
3609,
3132,
12,
4531,
69,
2998,
64,
38073,
7568,
19,
27,
... | 2.465852 | 1,391 |
<filename>other/housing/housing.jl
# # Housing data
# In this example, we create a linear regression model that predicts housing data.
# It replicates the housing data example from the [Knet.jl readme](https://github.com/denizyuret/Knet.jl).
# Although we could have reused more of Flux (see the MNIST example), the l... | [
27,
34345,
29,
847,
14,
50028,
14,
50028,
13,
20362,
198,
2,
1303,
16797,
1366,
198,
198,
2,
554,
428,
1672,
11,
356,
2251,
257,
14174,
20683,
2746,
326,
26334,
5627,
1366,
13,
220,
198,
2,
632,
2186,
16856,
262,
5627,
1366,
1672,
... | 2.86239 | 1,824 |
<filename>src/likelihoods/poisson.jl
"""
PoisLik <: Likelihood
Poisson likelihood
```math
p(yᵢ = k | fᵢ) = θᵏ\\exp(-θ)/k!
```
for ``k ∈ N₀``, where ``θ = \\exp(f)`` and ``f`` is the latent Gaussian process.
"""
struct PoisLik <: Likelihood end
#log of probability density
function log_dens(poisson::PoisLik, f::Abs... | [
27,
34345,
29,
10677,
14,
2339,
11935,
82,
14,
7501,
30927,
13,
20362,
198,
37811,
198,
220,
220,
220,
7695,
271,
43,
1134,
1279,
25,
4525,
11935,
198,
198,
18833,
30927,
14955,
198,
15506,
63,
11018,
198,
79,
7,
88,
39611,
95,
796,... | 2.299013 | 709 |
################################################################################
#
# Roots
#
################################################################################
function roots(f::Generic.Poly{T}) where T <: Union{padic, qadic, LocalFieldElem}
K = base_ring(f)
e = absolute_ramification_index(K)
k, ... | [
29113,
29113,
14468,
198,
2,
198,
2,
220,
220,
34341,
198,
2,
198,
29113,
29113,
14468,
198,
198,
8818,
11135,
7,
69,
3712,
46189,
13,
34220,
90,
51,
30072,
810,
309,
1279,
25,
4479,
90,
15636,
291,
11,
10662,
23876,
11,
10714,
1587... | 2.410045 | 2,668 |
<reponame>KristofferC/GitForge.jl<filename>src/forges/GitLab/users.jl
@json struct Identity
provider::String
extern_uid::String
end
@json struct User
id::Int
username::String
email::String
name::String
state::String
avatar_url::String
web_url::String
created_at::DateTime
is_... | [
27,
7856,
261,
480,
29,
40756,
47895,
34,
14,
38,
270,
19857,
13,
20362,
27,
34345,
29,
10677,
14,
1640,
3212,
14,
38,
270,
17822,
14,
18417,
13,
20362,
198,
31,
17752,
2878,
27207,
198,
220,
220,
220,
10131,
3712,
10100,
198,
220,
... | 2.485149 | 808 |
<filename>test/runtests.jl<gh_stars>0
using Cmdl
using Base.Test
# write your own tests here
#@test 1 == 2
| [
27,
34345,
29,
9288,
14,
81,
2797,
3558,
13,
20362,
27,
456,
62,
30783,
29,
15,
198,
3500,
327,
9132,
75,
198,
3500,
7308,
13,
14402,
198,
198,
2,
3551,
534,
898,
5254,
994,
198,
2,
31,
9288,
352,
6624,
362,
198
] | 2.571429 | 42 |
<reponame>za-gao/CHEME-5440-7770-Cornell-Spring-2022
### A Pluto.jl notebook ###
# v0.18.0
using Markdown
using InteractiveUtils
# ╔═╡ 6b1ad54f-61e4-490d-9032-7a557e8dc82f
md"""
## CHEME 5440/7770: Structural Analysis of the Urea Cycle Network (PS2)
"""
# ╔═╡ 7057c8e4-9e94-4a28-a885-07f5c96ebe39
html"""
<p style="fo... | [
27,
7856,
261,
480,
29,
4496,
12,
4908,
78,
14,
3398,
3620,
36,
12,
4051,
1821,
12,
3324,
2154,
12,
41389,
695,
12,
30387,
12,
1238,
1828,
198,
21017,
317,
32217,
13,
20362,
20922,
44386,
198,
2,
410,
15,
13,
1507,
13,
15,
198,
... | 1.850162 | 5,566 |
module ShapML
using Distributed
using DataFrames
using Random
include("shap_sample.jl") # Load _shap_sample().
include("aggregate.jl") # Load _aggregate().
include("predict.jl") # Load _predict().
export shap
"""
shap(explain::DataFrame,
reference::Union{DataFrame, Nothing} = nothing,
... | [
21412,
29198,
5805,
201,
198,
201,
198,
3500,
4307,
6169,
201,
198,
3500,
6060,
35439,
201,
198,
3500,
14534,
201,
198,
201,
198,
17256,
7203,
1477,
499,
62,
39873,
13,
20362,
4943,
220,
1303,
8778,
4808,
1477,
499,
62,
39873,
22446,
... | 2.30593 | 4,671 |
#
# Copyright (c) 2021 <NAME>, <NAME>
# Licensed under the MIT license. See LICENSE file in the project root for details.
#
using FMI
using Flux
using DifferentialEquations: Tsit5
import Random
Random.seed!(5678);
t_start = 0.0
t_step = 0.1
t_stop = 3.0
tData = t_start:t_step:t_stop
# generate training data
realFM... | [
2,
198,
2,
15069,
357,
66,
8,
33448,
1279,
20608,
22330,
1279,
20608,
29,
198,
2,
49962,
739,
262,
17168,
5964,
13,
4091,
38559,
24290,
2393,
287,
262,
1628,
6808,
329,
3307,
13,
198,
2,
198,
198,
3500,
376,
8895,
198,
3500,
1610,
... | 2.232726 | 2,359 |
<reponame>vikashdwd/JuML<gh_stars>0
struct OrdinalFactor{T<:Unsigned} <: AbstractFactor{T}
name::String
levels::AbstractVector{<:AbstractString}
basefactor::AbstractFactor{T}
newindex::Vector{T}
end
Base.length(factor::OrdinalFactor{T}) where {T<:Unsigned} = length(factor.basefactor)
function OrdinalF... | [
27,
7856,
261,
480,
29,
28930,
1077,
67,
16993,
14,
33018,
5805,
27,
456,
62,
30783,
29,
15,
198,
7249,
14230,
1292,
41384,
90,
51,
27,
25,
3118,
32696,
92,
1279,
25,
27741,
41384,
90,
51,
92,
198,
220,
220,
220,
1438,
3712,
10100... | 2.585069 | 576 |
# To run this script, `cd` to the `./test/fixtures` directory and then, from the Julia terminal, `include("./runner.jl")`.
import JSON
function gen( x, name )
y = Array( Any, length( x ) );
for i in eachindex(x)
y[i] = bits( convert( UInt8, x[i] ) );
end
data = Dict([
("x", x),
("expected", y)
]);
outfi... | [
2,
1675,
1057,
428,
4226,
11,
4600,
10210,
63,
284,
262,
4600,
19571,
9288,
14,
69,
25506,
63,
8619,
290,
788,
11,
422,
262,
22300,
12094,
11,
4600,
17256,
7,
1911,
14,
16737,
13,
20362,
4943,
44646,
198,
198,
11748,
19449,
198,
198... | 2.47644 | 191 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.