content stringlengths 6 1.03M | input_ids listlengths 4 535k | ratio_char_token float64 0.68 8.61 | token_count int64 4 535k |
|---|---|---|---|
<filename>test/coverage/coverage-summary.jl
using Coverage
cd(joinpath(@__DIR__, "..", "..")) do
coverage = process_folder()
covered_lines, total_lines = get_summary(coverage)
mkdir("coverage")
Coverage.LCOV.writefile("coverage/lcov.info", coverage)
branch = strip(read(`git branch`, String), [' ', '... | [
27,
34345,
29,
9288,
14,
1073,
1857,
14,
1073,
1857,
12,
49736,
13,
20362,
198,
3500,
33998,
198,
10210,
7,
22179,
6978,
7,
31,
834,
34720,
834,
11,
366,
492,
1600,
366,
492,
48774,
466,
198,
220,
220,
220,
5197,
796,
1429,
62,
43... | 2.684211 | 209 |
# General DEQ Utils
mutable struct DEQTrainingStats
nfe::Int
end
"""
get_and_clear_nfe!(model::AbstractDeepEquilibriumNetwork)
Return the number of function evaluations (NFE) and clear the counter.
"""
function get_and_clear_nfe!(model::AbstractDeepEquilibriumNetwork)
nfe = model.stats.nfe
model.stats... | [
2,
3611,
5550,
48,
7273,
4487,
198,
76,
18187,
2878,
5550,
48,
44357,
29668,
198,
220,
220,
220,
299,
5036,
3712,
5317,
198,
437,
198,
198,
37811,
198,
220,
220,
220,
651,
62,
392,
62,
20063,
62,
77,
5036,
0,
7,
19849,
3712,
23839... | 2.369629 | 2,048 |
<filename>src/Optimizations/peps/approximate_peps.jl
using Zygote, OptimKit
using ..ITensorAutoHOOT
using ..ITensorNetworks
using ..ITensorAutoHOOT: batch_tensor_contraction
using ..ITensorNetworks:
PEPS, inner_network, inner_networks, flatten, rayleigh_quotient, tree, Models
function loss_grad_wrap(peps::PEPS, Hs::... | [
27,
34345,
29,
10677,
14,
27871,
320,
4582,
14,
431,
862,
14,
1324,
13907,
1920,
62,
431,
862,
13,
20362,
198,
3500,
1168,
35641,
1258,
11,
30011,
20827,
198,
3500,
11485,
2043,
22854,
27722,
32298,
2394,
198,
3500,
11485,
2043,
22854,
... | 2.426639 | 961 |
using Test
using LinearAlgebra
include("./KTBC.jl")
using .KTBC: CreateKTBC
function CreateK2D(dimSquared=2)
IdentityFixedDims = I(dimSquared)
K, T, B, C = CreateKTBC(dimSquared)
return kron(IdentityFixedDims, K) + kron(K, IdentityFixedDims)
end
IMatrixTestDims = I(2)
@test CreateK2D() == [
K + 2 * IMatrix... | [
3500,
6208,
198,
3500,
44800,
2348,
29230,
198,
198,
17256,
7,
1911,
14,
42176,
2749,
13,
20362,
4943,
198,
3500,
764,
42176,
2749,
25,
13610,
42176,
2749,
198,
198,
8818,
13610,
42,
17,
35,
7,
27740,
22266,
1144,
28,
17,
8,
198,
22... | 2.281081 | 185 |
<gh_stars>1-10
module VarinnerBenchs
using InplaceArrays.Arrays
using InplaceArrays.Fields
using InplaceArrays.Fields: MockField, MockBasis
using InplaceArrays.TensorValues
using FillArrays
@inline function loop(a,cache)
for i in eachindex(a)
ai = getindex!(cache,a,i)
end
end
function bench1(n)
p1 = Point(... | [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
21412,
12372,
5083,
44199,
82,
198,
198,
3500,
554,
5372,
3163,
20477,
13,
3163,
20477,
198,
3500,
554,
5372,
3163,
20477,
13,
15878,
82,
198,
3500,
554,
5372,
3163,
20477,
13,
15878,
82,
25... | 1.978583 | 607 |
<gh_stars>0
module CUDNN
using ..CUDA
if is_windows()
const libcudnn = Libdl.find_library(["cudnn64_5","cudnn64_4"])
else
const libcudnn = Libdl.find_library(["libcudnn"])
end
isempty(libcudnn) && throw("CUDNN library cannot be found.")
const version = ccall((:cudnnGetVersion,libcudnn),Cint,())
const major =... | [
27,
456,
62,
30783,
29,
15,
198,
21412,
327,
8322,
6144,
198,
198,
3500,
11485,
43633,
5631,
198,
198,
361,
318,
62,
28457,
3419,
198,
220,
220,
220,
1500,
9195,
66,
463,
20471,
796,
7980,
25404,
13,
19796,
62,
32016,
7,
14692,
66,
... | 2.379725 | 582 |
module SimulacoesTemplate
f(x) = 2*x
export f
end
| [
21412,
3184,
377,
330,
3028,
30800,
628,
220,
277,
7,
87,
8,
796,
362,
9,
87,
628,
220,
10784,
277,
198,
198,
437,
198
] | 2.375 | 24 |
<gh_stars>10-100
export Strang
"""
`Strang` matrix
A special `SymTridiagonal` matrix named after <NAME>
```julia
julia> Strang(6)
6x6 Strang{Float64}:
2.0 -1.0 0.0 0.0 0.0 0.0
-1.0 2.0 -1.0 0.0 0.0 0.0
0.0 -1.0 2.0 -1.0 0.0 0.0
0.0 0.0 -1.0 2.0 -1.0 0.0
0.0 0.0 0.0 -1.0... | [
27,
456,
62,
30783,
29,
940,
12,
3064,
198,
39344,
4285,
648,
198,
37811,
198,
63,
13290,
648,
63,
17593,
198,
198,
32,
2041,
4600,
43094,
2898,
19830,
27923,
63,
17593,
3706,
706,
1279,
20608,
29,
198,
198,
15506,
63,
73,
43640,
19... | 1.881326 | 573 |
<filename>src/wrappers/x86_64-linux-gnu-cxx11.jl
# Autogenerated wrapper script for vtkfig_jll for x86_64-linux-gnu-cxx11
export libvtkfig
using VTKMinimalQT_jll
## Global variables
PATH = ""
LIBPATH = ""
LIBPATH_env = "LD_LIBRARY_PATH"
LIBPATH_default = ""
# Relative path to `libvtkfig`
const libvtkfig_splitpath = [... | [
27,
34345,
29,
10677,
14,
29988,
11799,
14,
87,
4521,
62,
2414,
12,
23289,
12,
41791,
12,
66,
5324,
1157,
13,
20362,
198,
2,
5231,
519,
877,
515,
29908,
4226,
329,
410,
30488,
5647,
62,
73,
297,
329,
2124,
4521,
62,
2414,
12,
2328... | 2.786704 | 722 |
<reponame>helgee/Python.jl
for n in [:DateTime, :Date, :Time, :TimeDelta, :TZInfo, :TimeZone]
p = lowercase(string(n))
t = Symbol(:Py, n, :_Type)
r = Symbol(t, :__ref)
c = Symbol(:Py, n, :_Check)
@eval $r = Ref(PyNULL)
@eval $t(doimport::Bool = true) = begin
ptr = $r[]
isnull(ptr... | [
27,
7856,
261,
480,
29,
2978,
29622,
14,
37906,
13,
20362,
198,
1640,
299,
287,
685,
25,
10430,
7575,
11,
1058,
10430,
11,
1058,
7575,
11,
1058,
7575,
42430,
11,
1058,
51,
57,
12360,
11,
1058,
7575,
26961,
60,
198,
220,
220,
220,
... | 2.14699 | 5,150 |
#=
NEMO: Next Energy Modeling system for Optimization.
https://github.com/sei-international/NemoMod.jl
Copyright © 2019: Stockholm Environment Institute U.S.
File description: Tests for NemoMod package. Running full suite of tests requires
GLPK, Cbc, CPLEX, Gurobi, Mosek, and Xpress solvers. Howe... | [
2,
28,
198,
220,
220,
220,
399,
3620,
46,
25,
7406,
6682,
9104,
278,
1080,
329,
30011,
1634,
13,
198,
220,
220,
220,
3740,
1378,
12567,
13,
785,
14,
36455,
12,
45609,
14,
45,
41903,
5841,
13,
20362,
628,
220,
220,
220,
15069,
1067... | 2.564778 | 1,783 |
<gh_stars>0
export StructLogicCircuit, PlainStructLogicCircuit,
PlainStructLogicLeafNode, PlainStructLogicInnerNode,
PlainStructLiteralNode, PlainStructConstantNode, PlainStructTrueNode, PlainStructFalseNode,
PlainStruct⋀Node, PlainStruct⋁Node,
vtree, vtree_safe, prime, sub
#####################
# Log... | [
27,
456,
62,
30783,
29,
15,
198,
39344,
32112,
11187,
291,
31560,
5013,
11,
28847,
44909,
11187,
291,
31560,
5013,
11,
220,
198,
220,
220,
220,
28847,
44909,
11187,
291,
3123,
1878,
19667,
11,
28847,
44909,
11187,
291,
818,
1008,
19667,... | 2.733357 | 2,839 |
<reponame>laughingrice/Devito.jl
using Documenter, Devito
makedocs(sitename="Devito", modules=[Devito])
deploydocs(
repo = "github.com/ChevronETC/Devito.jl.git",
) | [
27,
7856,
261,
480,
29,
44944,
278,
20970,
14,
13603,
10094,
13,
20362,
198,
3500,
16854,
263,
11,
6245,
10094,
198,
198,
76,
4335,
420,
82,
7,
48937,
12453,
2625,
13603,
10094,
1600,
13103,
41888,
13603,
10094,
12962,
198,
198,
2934,
... | 2.414286 | 70 |
"""
This module allows users to push data using the [Pushbullet](http://pushbullet.com) service. It requires that the user have a Pushbullet account. The necessary Pushbullet token can be acquired from the [account settings](https://www.pushbullet.com/account) page.
"""
module Pushbullet
export user, devices, push_not... | [
37811,
198,
1212,
8265,
3578,
2985,
284,
4574,
1366,
1262,
262,
685,
49222,
15065,
1616,
16151,
4023,
1378,
14689,
15065,
1616,
13,
785,
8,
2139,
13,
632,
4433,
326,
262,
2836,
423,
257,
23691,
15065,
1616,
1848,
13,
383,
3306,
23691,
... | 2.684178 | 1,618 |
<reponame>freesurfer/jupysurf
#=
Original Author: <NAME>
Copyright © 2022 The General Hospital Corporation (Boston, MA) "MGH"
Terms and conditions for use, reproduction, distribution and contribution
are found in the 'FreeSurfer Software License Agreement' contained
in the file 'LICENSE' found in the FreeS... | [
27,
7856,
261,
480,
29,
69,
6037,
333,
2232,
14,
73,
929,
893,
333,
69,
198,
2,
28,
198,
220,
13745,
6434,
25,
1279,
20608,
29,
628,
220,
15069,
10673,
33160,
383,
3611,
9256,
10501,
357,
31710,
11,
8779,
8,
366,
44,
17511,
1,
1... | 2.119227 | 931 |
<filename>docs/make.jl
using Documenter, LimitOrderBook
makedocs(modules = [LimitOrderBook], sitename = "LimitOrderBook.jl")
deploydocs(
repo = "github.com/JuliaLang/LimitOrderBook.jl.git",
)
| [
27,
34345,
29,
31628,
14,
15883,
13,
20362,
198,
3500,
16854,
263,
11,
27272,
18743,
10482,
198,
198,
76,
4335,
420,
82,
7,
18170,
796,
685,
39184,
18743,
10482,
4357,
1650,
12453,
796,
366,
39184,
18743,
10482,
13,
20362,
4943,
198,
... | 2.712329 | 73 |
import Base: getindex, setindex!
abstract type Absolute end
abstract type Brake end
abstract type ControlPosition end
abstract type Info end
abstract type Edges end
abstract type Engine end
abstract type Feedback end
abstract type Hard end
abstract type Home end
abstract type Kind end
abstract type Loft end... | [
11748,
7308,
25,
651,
9630,
11,
900,
9630,
0,
198,
198,
397,
8709,
2099,
220,
36532,
886,
198,
397,
8709,
2099,
220,
9718,
365,
886,
198,
397,
8709,
2099,
220,
6779,
26545,
886,
198,
397,
8709,
2099,
220,
14151,
886,
198,
397,
8709,... | 2.251716 | 7,866 |
<reponame>MKAbdElrahman/Photon.jl<gh_stars>1-10
export Simulation
include("Grid.jl")
Base.@kwdef mutable struct Simulation{Dim}
grid::Grid{Dim}
λ₀::Float
J_x::Array{CFloat,Dim} = zeros(CFloat,size(grid))
J_y::Array{CFloat,Dim} = zeros(CFloat,size(grid))
J_z::Array{CFloat,Dim} = zeros(CFloat,size(grid)... | [
27,
7856,
261,
480,
29,
33907,
4826,
67,
9527,
11392,
805,
14,
2725,
18970,
13,
20362,
27,
456,
62,
30783,
29,
16,
12,
940,
198,
39344,
41798,
198,
198,
17256,
7203,
41339,
13,
20362,
4943,
197,
198,
198,
14881,
13,
31,
46265,
4299,... | 2.10498 | 743 |
<filename>test/solvers/jacobian_tests.jl<gh_stars>0
@testset "$(rpad("Jacobian",80))" begin
n = 1
T = Float64
x = [T(π),]
j = reshape(2x, 1, 1)
function F(x::Vector, b::Vector)
b[:] = x.^2
end
function J(x::Vector, A::Matrix)
A[:,:] = 2x
end
set_config(:jacobi... | [
27,
34345,
29,
9288,
14,
34453,
690,
14,
30482,
672,
666,
62,
41989,
13,
20362,
27,
456,
62,
30783,
29,
15,
198,
198,
31,
9288,
2617,
17971,
7,
81,
15636,
7203,
46751,
666,
1600,
1795,
4008,
1,
2221,
628,
220,
220,
220,
299,
796,
... | 1.977707 | 628 |
getline(source::IO, ::UInt8) = Vector{UInt8}(readline(source))
getline(source::IO, ::Base.Chars) = readline(source)
"""
`scan(source, blank; skip, nrow)
Reads fixed wdith format file or stream `source`.
Returns `Vector{UnitRange{Int}}` with autotetected fields in `source`.
Detects only fields that exist in all checke... | [
1136,
1370,
7,
10459,
3712,
9399,
11,
7904,
52,
5317,
23,
8,
796,
20650,
90,
52,
5317,
23,
92,
7,
961,
1370,
7,
10459,
4008,
198,
1136,
1370,
7,
10459,
3712,
9399,
11,
7904,
14881,
13,
1925,
945,
8,
796,
1100,
1370,
7,
10459,
8,... | 2.466739 | 917 |
# Copyright 2017, <NAME>, <NAME>, <NAME>, and contributors
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
#########################################################... | [
2,
220,
15069,
2177,
11,
1279,
20608,
22330,
1279,
20608,
22330,
1279,
20608,
22330,
290,
20420,
198,
2,
220,
770,
8090,
6127,
5178,
318,
2426,
284,
262,
2846,
286,
262,
29258,
5094,
198,
2,
220,
13789,
11,
410,
13,
362,
13,
15,
13,... | 2.390779 | 911 |
@testset "tuples" begin
for n = 1:4
for t in unique(combinations(repeat(1:n, n), n))
@test all(Bennu.tuplesort(tuple(t...)) .== sort(t))
@test all(t[collect(Bennu.tuplesortperm(tuple(t...)))] .== sort(t))
end
for t in permutations(1:n)
@test all(Bennu.tup... | [
31,
9288,
2617,
366,
28047,
2374,
1,
2221,
198,
220,
220,
220,
329,
299,
796,
352,
25,
19,
198,
220,
220,
220,
220,
220,
220,
220,
329,
256,
287,
3748,
7,
24011,
7352,
7,
44754,
7,
16,
25,
77,
11,
299,
828,
299,
4008,
198,
220... | 1.955975 | 318 |
<filename>docs/example.jl<gh_stars>1-10
using Extremes, DataFrames, Distributions, Gadfly, Dates. Mamba
data = load("wooster")
x = collect(Date(1983,1,1):Day(1):Date(1987,12,31))
data[!,:Date] = x
select!(data, [:Date, :Temperature])
data
plot(data, x=:Date, y=:Temperature, Geom.point)
df = copy(data)
df[!,:Temp... | [
27,
34345,
29,
31628,
14,
20688,
13,
20362,
27,
456,
62,
30783,
29,
16,
12,
940,
198,
3500,
47871,
274,
11,
6060,
35439,
11,
46567,
507,
11,
20925,
12254,
11,
44712,
13,
337,
31842,
198,
198,
7890,
796,
3440,
7203,
21638,
6197,
4943... | 2.311688 | 616 |
<gh_stars>0
# Full positive definite matrix together with a Cholesky factorization object
immutable PDMat{T<:Real,S<:AbstractMatrix} <: AbstractPDMat{T}
dim::Int
mat::S
chol::CholType{T,S}
PDMat(d::Int,m::AbstractMatrix{T},c::CholType{T,S}) = new(d,m,c)
end
function PDMat(mat::AbstractMatrix,chol::Chol... | [
27,
456,
62,
30783,
29,
15,
198,
2,
6462,
3967,
21892,
17593,
1978,
351,
257,
609,
4316,
2584,
5766,
1634,
2134,
198,
8608,
18187,
14340,
19044,
90,
51,
27,
25,
15633,
11,
50,
27,
25,
23839,
46912,
92,
1279,
25,
27741,
5760,
19044,
... | 1.941395 | 1,348 |
<gh_stars>0
function canvasonly(canvas::GtkCanvas, widgets::GtkWidget...)
for widget in widgets
@warn """
Attempt to add widget of type '$(typeof(widget))', but the current layout
is 'canvasonly'. If you want to add other widgets aside from just the
canvas, call the `uselayout` fu... | [
27,
456,
62,
30783,
29,
15,
198,
8818,
39614,
888,
306,
7,
5171,
11017,
3712,
38,
30488,
6090,
11017,
11,
40803,
3712,
38,
30488,
38300,
23029,
628,
220,
220,
220,
329,
26295,
287,
40803,
198,
220,
220,
220,
220,
220,
220,
220,
2488... | 2.406425 | 716 |
<filename>test/geometry.jl
@testset "Geometry" begin
Random.seed!(5) # reproducability
@testset "generate_point" begin
SAMPLES = 10000
@testset "$geom" for geom in (Box, BoxPBC)
lengths = [1,2,3]
b = geom(lengths)
testpoints = hcat([XXZNumerics.generate_p... | [
27,
34345,
29,
9288,
14,
469,
15748,
13,
20362,
198,
198,
31,
9288,
2617,
366,
10082,
15748,
1,
2221,
628,
220,
220,
220,
14534,
13,
28826,
0,
7,
20,
8,
1303,
8186,
66,
1799,
220,
628,
220,
220,
220,
2488,
9288,
2617,
366,
8612,
... | 1.799459 | 2,957 |
# Copyright (c) 2021 <NAME>
# Copyright (c) 2000 <NAME>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later versi... | [
2,
220,
220,
220,
15069,
357,
66,
8,
33448,
1279,
20608,
29,
198,
2,
220,
220,
220,
15069,
357,
66,
8,
4751,
1279,
20608,
29,
198,
2,
198,
2,
220,
220,
220,
770,
1430,
318,
1479,
3788,
26,
345,
460,
17678,
4163,
340,
290,
14,
... | 2.660377 | 477 |
<filename>src/stacking.jl
using FFTW
export stack_images, align_images, align_channel!, align_images_crop
export align_channel_crop!
@doc raw"""
align_images(ref::Array, obj::Array, size::Tuple)
This function align two images, using the cross-correlation methods. It works for x-y translations but it fails if the ... | [
27,
34345,
29,
10677,
14,
301,
5430,
13,
20362,
198,
3500,
376,
9792,
54,
198,
39344,
8931,
62,
17566,
11,
10548,
62,
17566,
11,
10548,
62,
17620,
28265,
10548,
62,
17566,
62,
31476,
198,
39344,
10548,
62,
17620,
62,
31476,
0,
198,
... | 1.962349 | 1,992 |
"""
Estimate a linear model with high dimensional categorical variables / instrumental variables
### Arguments
* `df::AbstractDataFrame`
* `model::Model`: A model created using [`@model`](@ref)
* `save::Union{Bool, Symbol} = false`: Should residuals and eventual estimated fixed effects saved in a dataframe? Use `save ... | [
37811,
198,
22362,
1920,
257,
14174,
2746,
351,
1029,
38517,
4253,
12409,
9633,
1220,
21543,
9633,
198,
198,
21017,
20559,
2886,
198,
9,
4600,
7568,
3712,
23839,
6601,
19778,
63,
198,
9,
4600,
19849,
3712,
17633,
63,
25,
317,
2746,
2727... | 2.37894 | 6,980 |
<filename>src/mesh.jl<gh_stars>1-10
import Printf
function voxelize(cloud, resolution)
cloud_xyz = round.(cloud[1:min(size(cloud,1), 3),:] ./ resolution) * resolution
idxs = unique(i -> cloud_xyz[:,i], 1:size(cloud_xyz)[2])
cloud[:, idxs]
end
const cube_vertices = [
1. -1. 1. ;
-1. ... | [
27,
34345,
29,
10677,
14,
76,
5069,
13,
20362,
27,
456,
62,
30783,
29,
16,
12,
940,
198,
11748,
12578,
69,
198,
198,
8818,
410,
1140,
417,
1096,
7,
17721,
11,
6323,
8,
198,
220,
220,
220,
6279,
62,
5431,
89,
796,
2835,
12195,
17... | 1.730831 | 2,478 |
module SettingsWindow
using Gtk, Gtk.ShortNames, Gtk.GConstants
using ..Ahorn, Maple
settingsWindow = nothing
function getOptions(data::Dict{Any, Any}, dropdownOptions::Dict{String, Any}, langdata::Ahorn.LangData)
res = Ahorn.Form.Option[]
names = get(langdata, :names)
tooltips = get(langdata, :tooltips... | [
21412,
16163,
27703,
198,
198,
3500,
402,
30488,
11,
402,
30488,
13,
16438,
36690,
11,
402,
30488,
13,
38,
34184,
1187,
198,
3500,
11485,
10910,
1211,
11,
21249,
198,
198,
33692,
27703,
796,
2147,
198,
198,
8818,
651,
29046,
7,
7890,
... | 2.699371 | 795 |
import URIParser
function getrepohttpurl(reporemoteurl::AbstractString)
repouri = URIParser.URI(reporemoteurl)
repopath = splitext(repouri.path)[1] # remove git suffix
repourl = URIParser.URI("https", repouri.host, repouri.port, repopath)
string(repourl)
end
| [
11748,
471,
32618,
28198,
198,
198,
8818,
651,
7856,
1219,
29281,
6371,
7,
7856,
29625,
1258,
6371,
3712,
23839,
10100,
8,
198,
220,
220,
220,
1128,
10300,
796,
471,
32618,
28198,
13,
47269,
7,
7856,
29625,
1258,
6371,
8,
198,
220,
22... | 2.679612 | 103 |
# This Map has non-trivial domain, thus we need the define testargs
"""
PosNegReindex(values_pos,values_neg)
"""
struct PosNegReindex{A,B} <: Map
values_pos::A
values_neg::B
end
function testargs(k::PosNegReindex,i::Integer)
@check length(k.values_pos) !=0 || length(k.values_neg) != 0 "This map has empty dom... | [
2,
770,
9347,
468,
1729,
12,
83,
15104,
498,
7386,
11,
4145,
356,
761,
262,
8160,
1332,
22046,
198,
37811,
198,
220,
220,
220,
18574,
32863,
3041,
9630,
7,
27160,
62,
1930,
11,
27160,
62,
12480,
8,
198,
37811,
198,
7249,
18574,
3286... | 2.0866 | 3,418 |
<filename>test/system_multivariate.jl
using DynamicPolynomials
using MultivariateMoments
using SemialgebraicSets
using CSDP
# -----------------------------------------------------------------------------
# <NAME>, <NAME>, & <NAME>. (2018).
# The Saddle Point Problem of Polynomials.
# ----------------------------------... | [
27,
34345,
29,
9288,
14,
10057,
62,
16680,
42524,
13,
20362,
198,
3500,
26977,
34220,
26601,
8231,
198,
3500,
7854,
42524,
29252,
658,
198,
3500,
12449,
498,
29230,
291,
50,
1039,
198,
3500,
9429,
6322,
198,
198,
2,
16529,
32501,
198,
... | 1.664246 | 6,472 |
<gh_stars>0
module HFMod
if length(findin("C:\\Users\\Clinton\\Dropbox\\Projects\\SummerProject17",LOAD_PATH)) == 0
push!(LOAD_PATH,"C:\\Users\\Clinton\\Dropbox\\Projects\\SummerProject17")
end
#=TODO:
1) IV=#
#2) Run specifications
using DataFrames, Distributions, StatsBase, GZip, JLD, Gadfly, CTMod
#importall C... | [
27,
456,
62,
30783,
29,
15,
198,
198,
21412,
42253,
5841,
198,
198,
361,
4129,
7,
19796,
259,
7203,
34,
25,
6852,
14490,
6852,
16549,
6852,
26932,
3524,
6852,
16775,
82,
6852,
33560,
16775,
1558,
1600,
35613,
62,
34219,
4008,
6624,
65... | 2.361227 | 11,998 |
##########################################################################################
######################### Este archivo contiene los tipos usados y ####################
######################### las funciones que los crean ####################
###############################################... | [
29113,
29113,
14468,
7804,
2235,
198,
14468,
7804,
2,
412,
4169,
3934,
23593,
542,
72,
1734,
22346,
8171,
418,
514,
22484,
331,
220,
220,
220,
1303,
14468,
21017,
198,
14468,
7804,
2,
39990,
25439,
295,
274,
8358,
22346,
1126,
272,
220,... | 2.597598 | 333 |
<reponame>NREL/PowerSimulations.jl
"""
Default PowerSimulations Emulation Problem Type
"""
struct GenericEmulationProblem <: EmulationProblem end
"""
EmulationModel(::Type{M},
template::ProblemTemplate,
sys::PSY.System,
jump_model::Union{Nothing, JuMP.Model}=nothing;
kwargs...) where {M<:EmulationP... | [
27,
7856,
261,
480,
29,
45,
16448,
14,
13434,
8890,
5768,
13,
20362,
198,
37811,
198,
19463,
4333,
8890,
5768,
2295,
1741,
20647,
5994,
198,
37811,
198,
7249,
42044,
10161,
1741,
40781,
1279,
25,
2295,
1741,
40781,
886,
198,
198,
37811,... | 2.592701 | 7,535 |
<reponame>sebmart/TimingsInference.jl
###################################################
## network/solvers/socp.jl
## SOCP that finds new traveltimes to optimize cost function
###################################################
"""
socpTimes :
optimize travel times to minimize L1 error from data with given ... | [
27,
7856,
261,
480,
29,
325,
65,
13822,
14,
14967,
654,
818,
4288,
13,
20362,
198,
29113,
14468,
21017,
198,
2235,
3127,
14,
34453,
690,
14,
35634,
79,
13,
20362,
198,
2235,
31430,
47,
326,
7228,
649,
3067,
22355,
284,
27183,
1575,
... | 2.100198 | 3,034 |
<filename>ML_Tyo_pluto6.jl
### A Pluto.jl notebook ###
# v0.18.0
using Markdown
using InteractiveUtils
# This Pluto notebook uses @bind for interactivity. When running this notebook outside of Pluto, the following 'mock version' of @bind gives bound variables a default value (instead of an error).
macro bind(def, ele... | [
27,
34345,
29,
5805,
62,
51,
8226,
62,
489,
9390,
21,
13,
20362,
198,
21017,
317,
32217,
13,
20362,
20922,
44386,
198,
2,
410,
15,
13,
1507,
13,
15,
198,
198,
3500,
2940,
2902,
198,
3500,
21365,
18274,
4487,
198,
198,
2,
770,
3221... | 1.761057 | 26,726 |
using NBody
function main()
nb = NBody.read_nbody_json()
NBody.set_ids(nb)
NBody.write_snapshot(nb)
end
main()
| [
3500,
399,
25842,
198,
198,
8818,
1388,
3419,
198,
220,
299,
65,
796,
399,
25842,
13,
961,
62,
77,
2618,
62,
17752,
3419,
198,
220,
399,
25842,
13,
2617,
62,
2340,
7,
46803,
8,
198,
220,
399,
25842,
13,
13564,
62,
45380,
9442,
7,
... | 2.245283 | 53 |
<reponame>biobakery/GaPLAC<filename>bin/cli/mcmc.jl
module MCMC
using GaPLAC
using GaPLAC.AbstractGPs
using GaPLAC.Turing
using GaPLAC.CSV
using GaPLAC.DataFrames
using GaPLAC.Distributions
using Statistics
function run(args)
@info "running 'mcmc'"
gpspec = GaPLAC.gp_formula(args["formula"])
@debug ... | [
27,
7856,
261,
480,
29,
8482,
672,
33684,
14,
35389,
6489,
2246,
27,
34345,
29,
8800,
14,
44506,
14,
76,
11215,
66,
13,
20362,
198,
21412,
13122,
9655,
198,
198,
3500,
12822,
6489,
2246,
198,
3500,
12822,
6489,
2246,
13,
23839,
38,
... | 2.313856 | 599 |
<gh_stars>0
using Plots
function michalewicz(x; m=10)
return -sum(sin(v)*sin(i*v^2/π)^(2m) for
(i,v) in enumerate(x));
end
# plot
heatmap(0:0.1:4, 0:0.1:4, (x, y)->michalewicz([x, y]))
| [
27,
456,
62,
30783,
29,
15,
198,
3500,
1345,
1747,
628,
198,
198,
8818,
285,
488,
282,
413,
28051,
7,
87,
26,
285,
28,
940,
8,
198,
220,
220,
220,
1441,
532,
16345,
7,
31369,
7,
85,
27493,
31369,
7,
72,
9,
85,
61,
17,
14,
46... | 1.711864 | 118 |
using Test
include("lasagna.jl")
@testset "preparation time" begin
@test preptime(2) == 4
@test preptime(3) == 6
@test preptime(8) == 16
end
@testset "remaining time" begin
@test remaining_time(30) == 30
@test remaining_time(50) == 10
@test remaining_time(60) == 0
end
@testset "total working... | [
3500,
6208,
198,
198,
17256,
7203,
21921,
48669,
13,
20362,
4943,
198,
198,
31,
9288,
2617,
366,
3866,
1845,
341,
640,
1,
2221,
198,
220,
220,
220,
2488,
9288,
662,
457,
524,
7,
17,
8,
6624,
604,
198,
220,
220,
220,
2488,
9288,
66... | 2.461039 | 154 |
<gh_stars>0
haversine(lat1, lon1, lat2, lon2) =
2 * 6372.8 * asin(sqrt(sind((lat2 - lat1) / 2) ^ 2 +
cosd(lat1) * cosd(lat2) * sind((lon2 - lon1) / 2) ^ 2))
@show haversine(36.12, -86.67, 33.94, -118.4)
| [
27,
456,
62,
30783,
29,
15,
198,
3099,
690,
500,
7,
15460,
16,
11,
300,
261,
16,
11,
3042,
17,
11,
300,
261,
17,
8,
796,
198,
220,
220,
220,
362,
1635,
718,
36720,
13,
23,
1635,
355,
259,
7,
31166,
17034,
7,
82,
521,
19510,
... | 1.781513 | 119 |
<filename>src/Structures/TS.jl
"""
DiscreteTimeTypes
Type for discrete time handling.
"""
DiscreteTimeTypes = Union{Integer, TimeType}
"""
SupportedTimeTypes
Types supported for the timestamps data in the time series.
"""
SupportedTimeTypes = Union{Real, DiscreteTimeTypes}
"""
TS{P}
Abstract type to s... | [
27,
34345,
29,
10677,
14,
44909,
942,
14,
4694,
13,
20362,
198,
37811,
198,
220,
220,
220,
8444,
8374,
7575,
31431,
198,
198,
6030,
329,
28810,
640,
9041,
13,
198,
37811,
198,
15642,
8374,
7575,
31431,
796,
4479,
90,
46541,
11,
3862,
... | 2.886447 | 273 |
<gh_stars>0
"""
BinaryWhiteRBM(a, b, w, affine_v, affine_h)
BinaryWhiteRBM(a, b, w)
Construct a whitened RBM with binary visible and hidden units.
"""
function BinaryWhiteRBM(
a::AbstractArray, b::AbstractArray, w::AbstractArray,
affine_v::Affine, affine_h::Affine
)
rbm = RBMs.BinaryRBM(a, b, w)
... | [
27,
456,
62,
30783,
29,
15,
198,
37811,
198,
220,
220,
220,
45755,
12256,
49,
12261,
7,
64,
11,
275,
11,
266,
11,
1527,
500,
62,
85,
11,
1527,
500,
62,
71,
8,
198,
220,
220,
220,
45755,
12256,
49,
12261,
7,
64,
11,
275,
11,
... | 2.356481 | 216 |
mutable struct PReLU{T, W, O} <: AbstractBlock
weight::W
output::O
PReLU{T, W, O}(weight::W) where {T, W, O} = new{T, W, O}(weight)
end
PReLU(::Type{T}, ::Type{O}, weight::W) where {T, W, O} = PReLU{T, W, O}(weight)
PReLU(::Type{T}, weight::W; nbatch=1) where {T, W} =
PReLU(T, nbatch > 1 ? Matrix{T} :... | [
76,
18187,
2878,
350,
3041,
41596,
90,
51,
11,
370,
11,
440,
92,
1279,
25,
27741,
12235,
198,
220,
220,
220,
3463,
3712,
54,
198,
220,
220,
220,
5072,
3712,
46,
198,
220,
220,
220,
350,
3041,
41596,
90,
51,
11,
370,
11,
440,
92,... | 2.131528 | 517 |
# For the conversion to go through ForwardDiff, I need
#Base.convert(FDT::Type{ForwardDiff.Dual{T,V,N}}, p::AIBECS.Parameters) where {T,V,N} = AIBECS.Parameters(convert(Vector{FDT}, vec(p))...)
@testset "Derivatives" begin
nt = length(T_all)
n = nt * nb
@unpack xgeo = p
x = xgeo * ones(n)
testp... | [
628,
198,
2,
1114,
262,
11315,
284,
467,
832,
19530,
28813,
11,
314,
761,
198,
2,
14881,
13,
1102,
1851,
7,
37,
24544,
3712,
6030,
90,
39746,
28813,
13,
36248,
90,
51,
11,
53,
11,
45,
92,
5512,
279,
3712,
32,
9865,
2943,
50,
13,... | 1.920145 | 551 |
<gh_stars>1-10
# Only works from within IJulia, since uses widgets
module RepoHistoryBrowser
export browse_history
using Interact
# Concatenate two HTML representations
# HTML is a type defined in Interact.jl
+(a::HTML, b::HTML) = html(string(a.value, b.value))
# Syntax for using git on another directory:
# git ... | [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
2,
5514,
2499,
422,
1626,
314,
16980,
544,
11,
1201,
3544,
40803,
198,
198,
21412,
1432,
78,
18122,
46532,
198,
198,
39344,
25675,
62,
23569,
198,
198,
3500,
4225,
529,
628,
198,
2,
1482,
... | 3.048825 | 553 |
<reponame>vitskvara/FewShotAnomalyDetection.jl
using FewShotAnomalyDetection
using Adapt
using Flux
using MLDataPattern
using JLD2
using FileIO
using FluxExtensions
using ADatasets
using StatsBase
folderpath = "D:/dev/julia/"
# folderpath = "/home/bimjan/dev/julia/
"""
gridSearch(f, parameters...)
Maps `f` to pro... | [
27,
7856,
261,
480,
29,
85,
896,
74,
85,
3301,
14,
32351,
28512,
2025,
24335,
11242,
3213,
13,
20362,
198,
3500,
20463,
28512,
2025,
24335,
11242,
3213,
198,
3500,
30019,
198,
3500,
1610,
2821,
198,
3500,
10373,
6601,
47546,
198,
3500,
... | 2.499375 | 1,600 |
# Julia wrapper for header: /usr/include/scip/pub_cons.h
# Automatically generated using Clang.jl wrap_c
function SCIPconshdlrCompSepa(elem1, elem2)
ccall((:SCIPconshdlrCompSepa, libscip), Cint, (Ptr{Cvoid}, Ptr{Cvoid}), elem1, elem2)
end
function SCIPconshdlrCompEnfo(elem1, elem2)
ccall((:SCIPconshdlrCompEn... | [
2,
22300,
29908,
329,
13639,
25,
1220,
14629,
14,
17256,
14,
1416,
541,
14,
12984,
62,
5936,
13,
71,
198,
2,
17406,
4142,
7560,
1262,
1012,
648,
13,
20362,
14441,
62,
66,
628,
198,
8818,
6374,
4061,
5936,
31298,
14050,
7293,
19117,
... | 2.314532 | 7,659 |
using BayesMultiFit
using Test
BAMF=BayesMultiFit
using ReversibleJumpMCMC
const RJMCMC = ReversibleJumpMCMC
using Random
using Distributions
using MicroscopePSFs
PSF=MicroscopePSFs
include("testhelpers.jl")
@testset "BayesMultiFit.jl" begin
#TODO: update tests to use examples and test overall functionality
... | [
3500,
4696,
274,
29800,
31805,
198,
3500,
6208,
198,
33,
2390,
37,
28,
15262,
274,
29800,
31805,
198,
3500,
797,
37393,
36046,
9655,
9655,
198,
9979,
46642,
9655,
9655,
796,
797,
37393,
36046,
9655,
9655,
198,
3500,
14534,
198,
3500,
46... | 1.954876 | 687 |
"""
Utils
Module containing various utility functions for `WaveProp`.
"""
module Utils
using DocStringExtensions
using StaticArrays
using WaveProp
export
svector,
matrix_to_blockmatrix,
blockmatrix_to_matrix,
blockvector_to_vector,
vector_to_blockvector,
notimplemented,
abstractme... | [
37811,
198,
220,
220,
220,
7273,
4487,
198,
198,
26796,
7268,
2972,
10361,
5499,
329,
4600,
39709,
24331,
44646,
198,
37811,
198,
21412,
7273,
4487,
198,
198,
3500,
14432,
10100,
11627,
5736,
198,
3500,
36125,
3163,
20477,
198,
198,
3500,... | 2.388404 | 1,604 |
<reponame>aadimator/NetMSA.jl
using NetMSA
using Documenter
makedocs(;
modules=[NetMSA],
authors="Aadam <<EMAIL>> and contributors",
repo="https://github.com/aadimator/NetMSA.jl/blob/{commit}{path}#L{line}",
sitename="NetMSA.jl",
format=Documenter.HTML(;
prettyurls=get(ENV, "CI", "false") =... | [
27,
7856,
261,
480,
29,
64,
324,
320,
1352,
14,
7934,
44,
4090,
13,
20362,
198,
3500,
3433,
44,
4090,
198,
3500,
16854,
263,
198,
198,
76,
4335,
420,
82,
7,
26,
198,
220,
220,
220,
13103,
41888,
7934,
44,
4090,
4357,
198,
220,
2... | 2.098814 | 253 |
<reponame>UnofficialJuliaMirrorSnapshots/Faker.jl-0efc519c-db33-5916-ab87-703215c3906f
function mime_type()
executor(data["en"]["faker"]["file"]["mime_type"])
end
#param category: application|audio|image|message|model|multipart|text|video
function file_extension()
executor(data["e... | [
27,
7856,
261,
480,
29,
3118,
16841,
16980,
544,
27453,
1472,
43826,
20910,
14,
37,
3110,
13,
20362,
12,
15,
891,
66,
47785,
66,
12,
9945,
2091,
12,
3270,
1433,
12,
397,
5774,
12,
2154,
2624,
1314,
66,
2670,
3312,
69,
628,
220,
22... | 2.324111 | 253 |
<filename>src/digit.jl
export ispalindrome_string
export ispalindrome_integer
export ispalindrome
export reverse_sum
export reverse_sum_integer
export digitindex
export integer_to_string
"""
Returns whether a number is a palindrome or not, using String operations
to pull out digits.
"""
function ispalindrome_string(n:... | [
27,
34345,
29,
10677,
14,
27003,
13,
20362,
198,
39344,
318,
18596,
521,
5998,
62,
8841,
198,
39344,
318,
18596,
521,
5998,
62,
41433,
198,
39344,
318,
18596,
521,
5998,
198,
39344,
9575,
62,
16345,
198,
39344,
9575,
62,
16345,
62,
41... | 1.81386 | 3,218 |
is_circ(e, set) = false
function is_circ(e::Expr, set)
if e.head === :call
if length(e.args) == 1 || ((length(e.args) == 2) && (e.args[2] ∈ set))
# f() or f(x)
return true
elseif length(e.args) == 2
# f(g(...))
return is_circ(e.args[2], set)
en... | [
271,
62,
21170,
7,
68,
11,
900,
8,
796,
3991,
198,
8818,
318,
62,
21170,
7,
68,
3712,
3109,
1050,
11,
900,
8,
198,
220,
220,
220,
611,
304,
13,
2256,
24844,
1058,
13345,
198,
220,
220,
220,
220,
220,
220,
220,
611,
4129,
7,
68... | 1.798982 | 393 |
<gh_stars>0
# This file contains code that was a part of Julia. License is MIT: https://julialang.org/license
# It fixes problems with dealing with AbstractString types that don't use the Char type
import Base: parseint_iterate, parseint_preamble, tryparse_internal
import Base.Checked: add_with_overflow, mul_with_over... | [
27,
456,
62,
30783,
29,
15,
198,
2,
770,
2393,
4909,
2438,
326,
373,
257,
636,
286,
22300,
13,
13789,
318,
17168,
25,
3740,
1378,
73,
377,
498,
648,
13,
2398,
14,
43085,
198,
2,
632,
13040,
2761,
351,
7219,
351,
27741,
10100,
3858... | 2 | 2,127 |
module testCI
"""
lol()
Demo-function to test documentation.
### Examples
```julia
julia> lol(5)
5
```
"""
function lol(x)
return x
end
"""
lol2()
Says hello as our new toolbox.
### Examples
```julia
julia> lol2()=="hallo"
true
```
"""
function lol2()
return "hallo"
end
end
| [
21412,
1332,
25690,
198,
198,
37811,
198,
197,
47288,
3419,
198,
198,
11522,
78,
12,
8818,
284,
1332,
10314,
13,
220,
198,
198,
21017,
21066,
198,
15506,
63,
73,
43640,
220,
198,
73,
43640,
29,
19462,
7,
20,
8,
198,
20,
198,
15506,
... | 2.330645 | 124 |
<filename>test/imports.jl
using Test
using TestSetExtensions
using FluxTraining
using FluxTraining: EpochEnd, LR, getdataloader, getoptimparam, setoptimparam!, protect, Protected, ProtectedException
using Flux: trainable
include("./testdata.jl")
| [
27,
34345,
29,
9288,
14,
320,
3742,
13,
20362,
198,
3500,
6208,
198,
3500,
6208,
7248,
11627,
5736,
198,
3500,
1610,
2821,
44357,
198,
3500,
1610,
2821,
44357,
25,
4551,
5374,
12915,
11,
37491,
11,
651,
67,
10254,
1170,
263,
11,
651,
... | 3.25 | 76 |
# (31+42)::Float64 #> TypeError(:typeassert,"",Float64,73)
# convert(Int64, 7.01) #> ERROR: InexactError()
convert(Int64, 7.0) #> 7
int64(7.0) #> 7
int64(7.01) #> 7
# convert(Int64, "CV")
# ERROR: `convert` has no method matching convert(::Type{Int64}, ::ASCIIString)
# convert(Int64, "123") # same ERROR as above
promo... | [
2,
357,
3132,
10,
3682,
2599,
25,
43879,
2414,
1303,
29,
5994,
12331,
7,
25,
4906,
30493,
553,
1600,
43879,
2414,
11,
4790,
8,
198,
2,
10385,
7,
5317,
2414,
11,
767,
13,
486,
8,
1303,
29,
33854,
25,
554,
1069,
529,
12331,
3419,
... | 2.021097 | 237 |
<filename>src/deprecated/EasyConf.jl
#EasyConf: Interface to read/write simple configuration files
module EasyConf
export EasyConfFile
export getvalue
# Types
################################################################################
mutable struct ConfigDict
d::Dict{String, Any}
end
ConfigDict() = ConfigDi... | [
27,
34345,
29,
10677,
14,
10378,
31023,
14,
28406,
18546,
13,
20362,
198,
2,
28406,
18546,
25,
26491,
284,
1100,
14,
13564,
2829,
8398,
3696,
198,
198,
21412,
16789,
18546,
198,
198,
39344,
16789,
18546,
8979,
198,
39344,
651,
8367,
628... | 3.587537 | 674 |
function cards_gained_counter!( output::SimOutput, cards_gained::Vector{Int}, deckstatus; rep, deckindex, column)
for card in cards_gained
for elem in deckstatus
if card == elem.card
@inbounds output.card_sources[rep,deckindex,elem.rarity,column] += 1
end
... | [
8818,
4116,
62,
70,
1328,
62,
24588,
0,
7,
5072,
3712,
8890,
26410,
11,
4116,
62,
70,
1328,
3712,
38469,
90,
5317,
5512,
6203,
13376,
26,
1128,
11,
6203,
9630,
11,
5721,
8,
201,
198,
220,
220,
220,
329,
2657,
287,
4116,
62,
70,
... | 2.21592 | 1,005 |
struct EnumerableOrderby{T,S,KS<:Function,TKS} <: Enumerable
source::S
keySelector::KS
descending::Bool
end
Base.IteratorSize(::Type{EnumerableOrderby{T,S,KS,TKS}}) where {T,S,KS,TKS} = haslength(S)
Base.eltype(::Type{EnumerableOrderby{T,S,KS,TKS}}) where {T,S,KS,TKS} = T
Base.length(iter::EnumerableOrde... | [
7249,
2039,
30831,
18743,
1525,
90,
51,
11,
50,
11,
27015,
27,
25,
22203,
11,
51,
27015,
92,
1279,
25,
2039,
30831,
198,
220,
220,
220,
2723,
3712,
50,
198,
220,
220,
220,
1994,
17563,
273,
3712,
27015,
198,
220,
220,
220,
31491,
... | 2.217901 | 1,877 |
<reponame>UnofficialJuliaMirrorSnapshots/MarketTechnicals.jl-4f8c86c6-9e40-5506-9807-98571cb48bc8
doc"""
obv(ohlcv; price="Close", v="Volume")
On Balance Volume
```math
OBV_t = OBV_{t - 1} +
\begin{cases}
volume & \text{if} \ close_t > close_{t-1} \\
0 & \text{if} \ clos... | [
27,
7856,
261,
480,
29,
3118,
16841,
16980,
544,
27453,
1472,
43826,
20910,
14,
27470,
25574,
20155,
13,
20362,
12,
19,
69,
23,
66,
4521,
66,
21,
12,
24,
68,
1821,
12,
22730,
21,
12,
24,
36928,
12,
4089,
42875,
21101,
2780,
15630,
... | 2.009322 | 1,180 |
using Makie
meshscatter(rand(100), rand(100), rand(100))
AbstractPlotting.current_scene()
scatter(
Point3f0[(1,0,0), (0,1,0), (0,0,1)],
marker = [:x, :circle, :cross]
)
s = heatmap(rand(100, 100))
Makie.center!(s)
s
scene = contour(-1..1, -1..1, rand(100, 100))
scene
surface(rand(100, 100))
surface(-1..1,... | [
3500,
15841,
494,
198,
198,
76,
5069,
1416,
1436,
7,
25192,
7,
3064,
828,
43720,
7,
3064,
828,
43720,
7,
3064,
4008,
198,
198,
23839,
43328,
889,
13,
14421,
62,
29734,
3419,
198,
198,
1416,
1436,
7,
198,
220,
220,
220,
6252,
18,
6... | 2.182278 | 2,370 |
<gh_stars>0
println("Hello, World!")
# This is a comment
#= This is a multi-line comment
The second line of the comment =#
# println ("this is not allowed")
println("This is allowed.")
println("This is also allowed.");
println(1 + 2)
1 + 2 # Will not print in script
# Installing, updating and removing packages
usi... | [
27,
456,
62,
30783,
29,
15,
198,
35235,
7203,
15496,
11,
2159,
2474,
8,
198,
198,
2,
770,
318,
257,
2912,
198,
198,
2,
28,
770,
318,
257,
5021,
12,
1370,
2912,
198,
464,
1218,
1627,
286,
262,
2912,
796,
2,
198,
198,
2,
44872,
... | 3.405263 | 190 |
module GeoInterfaceRecipes
using GeoInterface, RecipesBase
const GI = GeoInterface
export @enable_geo_plots
"""
GeoInterfaceRecipes.@enable_geo_plots(typ)
Macro to add plot recipes to a geometry type.
"""
macro enable_geo_plots(typ)
quote
# We recreate the apply_recipe functions manually here
... | [
21412,
32960,
39317,
6690,
18636,
198,
198,
3500,
32960,
39317,
11,
44229,
14881,
198,
198,
9979,
30616,
796,
32960,
39317,
198,
198,
39344,
2488,
21633,
62,
469,
78,
62,
489,
1747,
198,
198,
37811,
198,
220,
220,
220,
220,
32960,
39317... | 2.053242 | 2,329 |
using IrisFlower
using Test
@testset "IrisFlower.jl" begin
# Write your own tests here.
end
| [
3500,
34230,
7414,
789,
198,
3500,
6208,
198,
198,
31,
9288,
2617,
366,
40,
2442,
7414,
789,
13,
20362,
1,
2221,
198,
220,
220,
220,
1303,
19430,
534,
898,
5254,
994,
13,
198,
437,
198
] | 2.771429 | 35 |
<gh_stars>1-10
# This file includes modified source code from https://github.com/odow/SDDP.jl
# as at 5b3ba3910f6347765708dd6e7058e2fcf7d13ae5
# Copyright 2017, <NAME> and contributors
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed w... | [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
2,
770,
2393,
3407,
9518,
2723,
2438,
422,
3740,
1378,
12567,
13,
785,
14,
375,
322,
14,
10305,
6322,
13,
20362,
198,
2,
355,
379,
642,
65,
18,
7012,
2670,
940,
69,
21,
2682,
3324,
2996,... | 1.86699 | 2,887 |
import ContentHashes
const C = ContentHashes
using Test
@testset "ContentHashes.jl" begin
struct T{S}
x::S
end
@testset "primatives" begin
@test C.hash(1) === C.hash(1)
@test C.hash("string"^10) === C.hash("string"^10)
@test C.hash([]) === C.hash([])
@test C.hash(()... | [
11748,
14041,
39,
7465,
198,
9979,
327,
796,
14041,
39,
7465,
198,
198,
3500,
6208,
198,
198,
31,
9288,
2617,
366,
19746,
39,
7465,
13,
20362,
1,
2221,
198,
220,
220,
220,
2878,
309,
90,
50,
92,
198,
220,
220,
220,
220,
220,
220,
... | 1.803815 | 734 |
using PlotlyJS
function house()
trace1 = scatter()
x0 = [2, 2, 5.5, 9, 9, 2, 5, 5, 6]
y0 = [1, 5.5, 9.5, 5.5, 1, 5.5, 1, 4, 4]
x1 = [2, 5.5, 9, 9, 2, 9, 5, 6, 6]
y1 = [5.5, 9.5, 5.5, 1, 1, 5.5, 4, 4, 1]
shapes = line(x0, x1, y0, y1; xref="x", yref="y")
plot([trace1],
... | [
3500,
28114,
306,
20120,
198,
198,
8818,
2156,
3419,
198,
220,
220,
220,
12854,
16,
796,
41058,
3419,
198,
220,
220,
220,
2124,
15,
796,
685,
17,
11,
220,
220,
362,
11,
220,
220,
642,
13,
20,
11,
860,
11,
220,
220,
860,
11,
362,... | 2.096926 | 2,342 |
using SpecialFunctions: loggamma, digamma
import Distributions: entropy
using StaticArrays
export Dirichlet, DirichletClassifier, Categorical
################################################################################
##### Dirichlet
###############################################################################... | [
3500,
6093,
24629,
2733,
25,
2604,
28483,
2611,
11,
3100,
321,
2611,
198,
11748,
46567,
507,
25,
40709,
198,
3500,
36125,
3163,
20477,
198,
198,
39344,
36202,
488,
1616,
11,
36202,
488,
1616,
9487,
7483,
11,
327,
2397,
12409,
198,
198,
... | 2.322299 | 2,175 |
Yao.measure(reg::StabilizerReg; nshot::Integer = 1) = [measure!(copy(reg)) for _ = 1:nshot]
function Yao.measure!(reg::StabilizerReg)
n = Yao.nqubits(reg)
if n < 64
meas_res = zero(Int64)
elseif n < 128
meas_res = zero(Int128)
else
meas_res = zero(BigInt)
end
idn = ['I' f... | [
56,
5488,
13,
1326,
5015,
7,
2301,
3712,
1273,
14991,
7509,
8081,
26,
299,
9442,
3712,
46541,
796,
352,
8,
796,
685,
1326,
5015,
0,
7,
30073,
7,
2301,
4008,
329,
4808,
796,
352,
25,
77,
9442,
60,
198,
8818,
37826,
13,
1326,
5015,
... | 1.997358 | 757 |
using Distances
using NPZ
using Iterators
using Images
verbose = true
array = convert(Array{Float64,2}, npzread("myo_footprints.npy")')
exp_schedule(t, tf) = (α0 =0.5; αf = 0.01; σ0 = 10.; σf = 1.; (α0 * exp(-t * log(αf/α0)/tf), σ0 * exp(-t * log(σf/σ0)/tf)))
gauss_transform(dmap, d, t, tf, α, σ) = α .* exp(-dmap.... | [
3500,
4307,
1817,
198,
3500,
28498,
57,
198,
3500,
40806,
2024,
198,
3500,
5382,
198,
198,
19011,
577,
796,
2081,
198,
198,
18747,
796,
10385,
7,
19182,
90,
43879,
2414,
11,
17,
5512,
45941,
89,
961,
7203,
1820,
78,
62,
5898,
17190,
... | 2.048409 | 2,169 |
abstract type Optimizer end
export Optimizer
# optimizers with L1 and L2 weight decay
include("./1-SGDL1L2.jl")
include("./2-MomentumL1L2.jl")
include("./3-AdamL1L2.jl")
include("./4-AdaGradL1L2.jl")
include("./5-RMSPropL1L2.jl")
export SGD
export Momentum
export Adam
export AdaGrad
export RMSProp
# auto gradient cl... | [
397,
8709,
2099,
30011,
7509,
886,
198,
39344,
30011,
7509,
628,
198,
2,
6436,
11341,
351,
406,
16,
290,
406,
17,
3463,
22119,
198,
17256,
7,
1911,
14,
16,
12,
38475,
19260,
16,
43,
17,
13,
20362,
4943,
198,
17256,
7,
1911,
14,
17... | 1.966021 | 2,531 |
<reponame>paralab/Finch
# Find a way to run these example in isolation
using Finch
init_finch("poisson1d")
useLog("poisson1dlog")
domain(1)
functionSpace(order=3)
mesh(LINEMESH, elsperdim=20)
u = variable("u")
testSymbol("v")
boundary(u, 1, DIRICHLET, 0)
coefficient("f", "-100*pi*pi*sin(10*pi*x)*sin(pi*x) -
... | [
27,
7856,
261,
480,
29,
1845,
282,
397,
14,
37,
8589,
198,
2,
9938,
257,
835,
284,
1057,
777,
1672,
287,
15133,
198,
3500,
45277,
628,
198,
15003,
62,
69,
8589,
7203,
7501,
30927,
16,
67,
4943,
198,
198,
1904,
11187,
7203,
7501,
3... | 1.971377 | 559 |
function gnorm!(c::AbstractVector, γ)
T = eltype(c)
if γ == zero(T)
c[1] = exp(c[1])
return c
end
gain = one(T) + γ*c[1]
for i=2:length(c)
@inbounds c[i] /= gain
end
c[1] = gain^(one(T)/γ)
c
end
gnorm(c::AbstractVector, γ=0.0) = gnorm!(copy(c), γ)
function gn... | [
198,
8818,
19967,
579,
0,
7,
66,
3712,
23839,
38469,
11,
7377,
111,
8,
198,
220,
220,
220,
309,
796,
1288,
4906,
7,
66,
8,
198,
220,
220,
220,
611,
7377,
111,
6624,
6632,
7,
51,
8,
198,
220,
220,
220,
220,
220,
220,
220,
269,
... | 2.089372 | 414 |
function KlobucharIonoModel(arg0::Vector{jdouble}, arg1::Vector{jdouble})
return KlobucharIonoModel((Vector{jdouble}, Vector{jdouble}), arg0, arg1)
end
function KlobucharIonoModel(arg0::Vector{jdouble}, arg1::Vector{jdouble}, arg2::TimeScale)
return KlobucharIonoModel((Vector{jdouble}, Vector{jdouble}, TimeSca... | [
8818,
14770,
672,
794,
283,
40,
29941,
17633,
7,
853,
15,
3712,
38469,
90,
73,
23352,
5512,
1822,
16,
3712,
38469,
90,
73,
23352,
30072,
198,
220,
220,
220,
1441,
14770,
672,
794,
283,
40,
29941,
17633,
19510,
38469,
90,
73,
23352,
... | 2.789137 | 626 |
<reponame>hhaensel/MolecularGraph.jl<filename>src/structurematch.jl<gh_stars>100-1000
#
# This file is a part of MolecularGraph.jl
# Licensed under the MIT License http://opensource.org/licenses/MIT
#
export
atommatch, bondmatch,
exactatommatch, exactbondmatch,
structmatches,
exactmatches, hasexactmatc... | [
27,
7856,
261,
480,
29,
71,
3099,
268,
741,
14,
44,
2305,
10440,
37065,
13,
20362,
27,
34345,
29,
10677,
14,
301,
5620,
15699,
13,
20362,
27,
456,
62,
30783,
29,
3064,
12,
12825,
198,
2,
198,
2,
770,
2393,
318,
257,
636,
286,
38... | 2.522306 | 6,747 |
using DiffEqBase, DiffEqOperators, LinearAlgebra, Zygote, Test
const A = rand(Float32, 300, 300)
f(du, u, p, t) = mul!(du, A, u)
f(u, p, t) = A * u
x = rand(Float32, 300)
v = rand(Float32, 300)
du = similar(x)
J = VecJacOperator(f, x)
actual_vjp = Zygote.jacobian(x -> f(x, nothing, nothing), x)[1]' * v
@test J * v ≈ a... | [
3500,
10631,
36,
80,
14881,
11,
10631,
36,
80,
18843,
2024,
11,
44800,
2348,
29230,
11,
1168,
35641,
1258,
11,
6208,
198,
9979,
317,
796,
43720,
7,
43879,
2624,
11,
5867,
11,
5867,
8,
198,
69,
7,
646,
11,
334,
11,
279,
11,
256,
... | 2.205556 | 180 |
<filename>test/nuclearmodels.jl
module NuclearModelTests
using AtomicMiscellany.NuclearModels
using Test
using QuadGK
maxnonzero(::AbstractNuclearModel) = Inf
maxnonzero(m::UniformSphericalNucleus) = m.R
@testset "Nuclear models" begin
# Test that any AbstractNuclearModel broadcasts like a scalar
@test length... | [
27,
34345,
29,
9288,
14,
77,
14913,
1670,
375,
1424,
13,
20362,
198,
21412,
19229,
17633,
51,
3558,
198,
3500,
28976,
31281,
3846,
1092,
13,
45,
4016,
5841,
1424,
198,
3500,
6208,
198,
3500,
20648,
38,
42,
198,
198,
9806,
13159,
22570... | 2.153174 | 2,174 |
#=
The File contains types and interfaces definitions
=#
# All interfaces defined here must provide one-based indexing,
# yet internal indexing is implementation-defined
#------------------------------------------------------------------------------
# AbstractSparseObject<T>
#
# `T` is the type of... | [
201,
198,
2,
28,
201,
198,
220,
220,
220,
383,
9220,
4909,
3858,
290,
20314,
17336,
201,
198,
46249,
201,
198,
201,
198,
201,
198,
2,
1439,
20314,
5447,
994,
1276,
2148,
530,
12,
3106,
6376,
278,
11,
201,
198,
2,
1865,
5387,
6376,... | 3.436653 | 1,255 |
module Smg2s
using LinearAlgebra
using SparseArrays
using Random
export Nilpotent, Nilp
export Spectrum!, checkSpectrum
export initMat!
export nonherm, nonsym
export NilpxM, MxNilp, MNilpM, NilpMat
include("nilpotent.jl")
include("spectrum.jl")
include("init.jl")
include("nonsym.jl")
include("nonherm.jl")
end #endm... | [
21412,
2439,
70,
17,
82,
198,
198,
3500,
44800,
2348,
29230,
198,
3500,
1338,
17208,
3163,
20477,
198,
3500,
14534,
198,
198,
39344,
29213,
13059,
298,
11,
29213,
79,
198,
39344,
27217,
28265,
2198,
49738,
6582,
198,
39344,
2315,
19044,
... | 2.739496 | 119 |
<reponame>tkelman/QuantumOptics.jl
using Base.Test
using QuantumOptics
N = 500
xmin = -62.5
xmax = 70.1
basis_position = PositionBasis(xmin, xmax, N)
basis_momentum = MomentumBasis(basis_position)
# Test Gaussian wave-packet in both bases
x0 = 5.1
p0 = -3.2
sigma = 1.
sigma_x = sigma/sqrt(2)
sigma_p = 1./(sigma*sqrt... | [
27,
7856,
261,
480,
29,
83,
7750,
805,
14,
24915,
388,
27871,
873,
13,
20362,
198,
3500,
7308,
13,
14402,
198,
3500,
29082,
27871,
873,
198,
198,
45,
796,
5323,
198,
87,
1084,
796,
532,
5237,
13,
20,
198,
87,
9806,
796,
4317,
13,
... | 2.046771 | 2,694 |
using ErgodicControl
using ErgodicControlPlots
# Set up different domains with different discretizations
d = Domain([1,1], 100)
num_agents = 10
# Set up distribution and ergodic manager
K = 5
means = [[.3,.7], [.7,.3]]
Sigmas = [.025*eye(2), .025*eye(2)]
phi = gaussian(d, means, Sigmas)
#phi = circle(d, ... | [
3500,
5256,
25344,
291,
15988,
201,
198,
3500,
5256,
25344,
291,
15988,
3646,
1747,
201,
198,
201,
198,
2,
5345,
510,
1180,
18209,
351,
1180,
1221,
1186,
4582,
201,
198,
67,
796,
20021,
26933,
16,
11,
16,
4357,
1802,
8,
201,
198,
22... | 1.768713 | 3,420 |
using Test
using DataStructure101
const DS = DataStructure101
@testset "Test Deque" begin
# Initial a Deque with data '0'
T_e = Int64
T = DS.Deque{T_e}
data= T_e[0]
deque = T(0)
@test deque.data == data
#Type test:
@test deque isa T
# Push test: Push data into deque 20 times by 1... | [
3500,
6208,
198,
3500,
6060,
1273,
5620,
8784,
198,
9979,
17400,
796,
6060,
1273,
5620,
8784,
198,
198,
31,
9288,
2617,
366,
14402,
1024,
4188,
1,
2221,
628,
220,
220,
220,
1303,
20768,
257,
1024,
4188,
351,
1366,
705,
15,
6,
198,
2... | 2.083333 | 588 |
<gh_stars>0
using
PyPlot,
JLD2,
Printf,
FourierFlows
using FFTW: ifft
import GeophysicalFlows.MultilayerQG
import GeophysicalFlows.MultilayerQG: energies, fluxes
# Numerical parameters and time-stepping parameters
nx = 128 # 2D resolution = nx^2
ny = nx
stepper = "FilteredRK4" # timestepper
dt ... | [
27,
456,
62,
30783,
29,
15,
198,
3500,
198,
220,
9485,
43328,
11,
198,
220,
449,
11163,
17,
11,
198,
220,
12578,
69,
11,
198,
220,
34296,
5277,
7414,
1666,
198,
198,
3500,
376,
9792,
54,
25,
611,
701,
198,
198,
11748,
2269,
41789,... | 2.094988 | 1,716 |
macro unreachable(message="This line of code cannot be reached. Please file an issue.")
quote
error($(esc(message)))
end
end
| [
20285,
305,
14880,
34446,
7,
20500,
2625,
1212,
1627,
286,
2438,
2314,
307,
4251,
13,
4222,
2393,
281,
2071,
19570,
198,
220,
220,
220,
9577,
198,
220,
220,
220,
220,
220,
220,
220,
4049,
16763,
7,
3798,
7,
20500,
22305,
198,
220,
2... | 2.9375 | 48 |
using DelaunayTriangulations:
KDTree,
Node,
spatial_order,
biased_random_order
function test_binary_search_property(tree, node_id, dim)
root = tree.nodes[node_id]
if root.left != 0
left = tree.nodes[root.left]
@test root.value[dim] >= left.value[dim]
test_binary_search_p... | [
3500,
4216,
1942,
323,
14824,
648,
5768,
25,
198,
220,
220,
220,
509,
24544,
631,
11,
198,
220,
220,
220,
19081,
11,
198,
220,
220,
220,
21739,
62,
2875,
11,
198,
220,
220,
220,
21925,
62,
25120,
62,
2875,
198,
198,
8818,
1332,
62... | 2.021303 | 798 |
"""
showitems(items)
Visualize `items`.
"""
function showitems(items; C=RGBA{N0f8}, showbounds = false)
bounds = boundsof([getbounds(item) for item in items])
a = OffsetArray(zeros(C, length.(bounds.rs)...), bounds.rs...)
for item in items
showitem!(a, item)
end
if showbounds
... | [
37811,
198,
220,
220,
220,
905,
23814,
7,
23814,
8,
198,
198,
36259,
1096,
4600,
23814,
44646,
198,
37811,
198,
8818,
905,
23814,
7,
23814,
26,
327,
28,
48192,
4339,
90,
45,
15,
69,
23,
5512,
905,
65,
3733,
796,
3991,
8,
198,
220,... | 2.274157 | 890 |
# QuEST_jl/src/base/decoherence.jl
#
function mixDamping(qureg :: QuEST_Types.Qureg,
targetQubit :: Integer,
prob :: Qreal) ::Nothing
ccall(:mixDamping, Cvoid,
(QuEST_Types.Qureg, Cint, Qreal),
qureg, targetQubit, prob)... | [
2,
2264,
6465,
62,
20362,
14,
10677,
14,
8692,
14,
12501,
78,
23545,
13,
20362,
198,
2,
198,
198,
8818,
5022,
35,
37843,
7,
421,
2301,
220,
220,
220,
220,
220,
220,
7904,
2264,
6465,
62,
31431,
13,
48,
495,
70,
11,
198,
220,
220... | 1.680655 | 2,502 |
@inline function parent_cell(p::NTuple{N,A}, dxi::NTuple{N,B}) where {N,A,B}
return ntuple(i -> Int16(p[i] ÷ dxi[i]) + 1, Val(N))
end
# dimension-agnostic fully unrolled euclidean distance
@generated function distance(a::NTuple{N,T}, b::NTuple{N,T}) where {N,T}
ex = zero(T)
@inbounds for i in 1:N
e... | [
31,
45145,
2163,
2560,
62,
3846,
7,
79,
3712,
11251,
29291,
90,
45,
11,
32,
5512,
288,
29992,
3712,
11251,
29291,
90,
45,
11,
33,
30072,
810,
1391,
45,
11,
32,
11,
33,
92,
198,
220,
220,
220,
1441,
299,
83,
29291,
7,
72,
4613,
... | 1.914342 | 2,043 |
<filename>src/Core/tuning/phase.jl
############################################################################################
"""
$(TYPEDEF)
Sampling Container that determines tuning updates.
# Fields
$(TYPEDFIELDS)
"""
abstract type SamplingPhase end
" Find/converges to the typical set (estimators suffer from init... | [
27,
34345,
29,
10677,
14,
14055,
14,
28286,
278,
14,
40715,
13,
20362,
198,
29113,
29113,
14468,
7804,
4242,
198,
37811,
198,
3,
7,
9936,
47,
1961,
25425,
8,
198,
198,
16305,
11347,
43101,
326,
15947,
24549,
5992,
13,
198,
198,
2,
2... | 2.692843 | 2,012 |
<filename>src/Multroot.jl
"""
module Multroot
Calculate mutiple roots of a real or complex polymomial exploiting the
multiplicity structure of the root.
Using methods develped by Zhang et. al.
"""
module Multroot
using Printf
using LinearAlgebra
export multroot, gcdroot, pejroot
export sylves, sylves1, sylmat, cau... | [
27,
34345,
29,
10677,
14,
15205,
15763,
13,
20362,
198,
37811,
198,
220,
8265,
7854,
15763,
198,
198,
9771,
3129,
378,
4517,
2480,
11135,
286,
257,
1103,
393,
3716,
7514,
32542,
498,
29440,
262,
198,
47945,
8467,
4645,
286,
262,
6808,
... | 2.737542 | 301 |
"""
Parameters for NFW Profile, includes useful quantities defined by parameters
"""
type NFWParameters{G <: AbstractFloat}
a::G
d::G
e::G
Ec::G
rlim::G
b::G
q::G
Jb::G
vmax::G
rmax::G
#secondary parameters
rs::G
Φs::G
xlim::G
Φlim::G
#adjusted parameter... | [
37811,
198,
48944,
329,
399,
24160,
13118,
11,
3407,
4465,
17794,
5447,
416,
10007,
198,
37811,
198,
4906,
399,
24160,
48944,
90,
38,
1279,
25,
27741,
43879,
92,
198,
220,
220,
220,
257,
3712,
38,
198,
220,
220,
220,
288,
3712,
38,
... | 1.987047 | 386 |
"""
abstract type AbstractScalarDiffusivity <: AbstractTurbulenceClosure end
Abstract type for closures with *isotropic* diffusivities.
"""
abstract type AbstractScalarDiffusivity{TD, F} <: AbstractTurbulenceClosure{TD} end
"""
struct ThreeDimensional end
Specifies a three-dimensionally-isotropic `ScalarDiff... | [
37811,
198,
220,
220,
220,
12531,
2099,
27741,
3351,
282,
283,
28813,
385,
3458,
1279,
25,
27741,
51,
5945,
32401,
45398,
886,
198,
198,
23839,
2099,
329,
32149,
351,
1635,
271,
46084,
9,
814,
385,
28720,
13,
198,
37811,
198,
397,
870... | 2.2187 | 3,786 |
module LightPropagationRunTests
using Test
@time @testset "DAsemiinf" begin include("DAsemiinfTests/runtests.jl") end
@time @testset "DAslab" begin include("DAslabTests/runtests.jl") end
@time @testset "DAparalpip" begin include("DAparalpipTests/runtests.jl") end
@time @testset "DA_Nlayer" begin include("DA_Nlayer... | [
21412,
4401,
24331,
363,
341,
10987,
51,
3558,
198,
198,
3500,
6208,
198,
198,
31,
2435,
2488,
9288,
2617,
366,
5631,
325,
11632,
10745,
1,
2221,
2291,
7203,
5631,
325,
11632,
10745,
51,
3558,
14,
81,
2797,
3558,
13,
20362,
4943,
886,... | 2.557895 | 190 |
<filename>test/bsplines/runtests.jl<gh_stars>10-100
@testset "B-splines" begin
include("knot_sets.jl")
include("splines.jl")
include("operators.jl")
include("derivatives.jl")
end
| [
27,
34345,
29,
9288,
14,
1443,
489,
1127,
14,
81,
2797,
3558,
13,
20362,
27,
456,
62,
30783,
29,
940,
12,
3064,
198,
31,
9288,
2617,
366,
33,
12,
22018,
1127,
1,
2221,
198,
220,
220,
220,
2291,
7203,
74,
1662,
62,
28709,
13,
203... | 2.349398 | 83 |
# This file is a part of UltraNest.jl, licensed under the MIT License (MIT).
| [
2,
770,
2393,
318,
257,
636,
286,
14563,
45,
395,
13,
20362,
11,
11971,
739,
262,
17168,
13789,
357,
36393,
737,
198
] | 3.5 | 22 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.