content stringlengths 6 1.03M | input_ids listlengths 4 535k | ratio_char_token float64 0.68 8.61 | token_count int64 4 535k |
|---|---|---|---|
using ITensors
function main(; Nx = 6,
Ny = 3,
U = 4.0,
t = 1.0)
N = Nx * Ny
sweeps = Sweeps(10)
maxdim!(sweeps, 100, 200, 400, 800, 1600)
cutoff!(sweeps, 1e-6)
noise!(sweeps, 1e-6, 1e-7, 1e-8, 0.0)
@show sweeps
sites = siteinds("Electron", N;
... | [
3500,
7283,
641,
669,
198,
198,
8818,
1388,
7,
26,
399,
87,
796,
718,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
17735,
796,
513,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2... | 1.908273 | 556 |
export pmult, imult
export psparse, ParallelSparseMatrix
export SparseMatrixCSR, sparse_csr
type ParallelSparseMatrix{TF}
F::TF
refs::Vector{Any}
procs::Vector{Int}
end
function psparse(F, procs)
ParallelSparseMatrix(
F,
Any[@spawnat(i, fetch(F)) for i in procs],
procs)
end
import Base.At_mul_B
i... | [
39344,
9114,
586,
11,
545,
586,
198,
39344,
26692,
29572,
11,
42945,
50,
29572,
46912,
198,
39344,
1338,
17208,
46912,
7902,
49,
11,
29877,
62,
6359,
81,
198,
198,
4906,
42945,
50,
29572,
46912,
90,
10234,
92,
198,
220,
376,
3712,
102... | 2.049356 | 1,398 |
module TestTransducers
using Test
@testset "$file" for file in [
"test_library.jl",
"test_processes.jl",
"test_ir.jl",
]
include(file)
end
end # module
| [
21412,
6208,
8291,
41213,
198,
3500,
6208,
198,
198,
31,
9288,
2617,
17971,
7753,
1,
329,
2393,
287,
685,
198,
220,
220,
220,
220,
220,
220,
220,
366,
9288,
62,
32016,
13,
20362,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
366,
... | 2.098901 | 91 |
<reponame>HoangMHNguyen/ReactiveMP.jl
export Gamma, GammaShapeScale, GammaDistributionsFamily
import SpecialFunctions: loggamma, digamma
import Distributions: Gamma, shape, scale, cov
import StatsFuns: log2π
const GammaShapeScale = Gamma
const GammaDistributionsFamily{T} = Union{GammaShapeScale{T}, GammaS... | [
27,
7856,
261,
480,
29,
28900,
648,
36208,
45,
39922,
14,
3041,
5275,
7378,
13,
20362,
198,
39344,
43595,
11,
43595,
33383,
29990,
11,
43595,
20344,
2455,
507,
24094,
198,
198,
11748,
6093,
24629,
2733,
25,
2604,
28483,
2611,
11,
3100,
... | 2.862103 | 1,008 |
using CoffeeBreak
using Documenter
DocMeta.setdocmeta!(CoffeeBreak, :DocTestSetup, :(using CoffeeBreak); recursive=true)
makedocs(;
modules=[CoffeeBreak],
authors="<NAME>",
repo="https://github.com/markusdemartini/CoffeeBreak.jl/blob/{commit}{path}#{line}",
sitename="CoffeeBreak.jl",
format=Docume... | [
3500,
19443,
31737,
198,
3500,
16854,
263,
198,
198,
23579,
48526,
13,
2617,
15390,
28961,
0,
7,
34,
2364,
1453,
31737,
11,
1058,
23579,
14402,
40786,
11,
36147,
3500,
19443,
31737,
1776,
45115,
28,
7942,
8,
198,
198,
76,
4335,
420,
8... | 2.286232 | 276 |
<gh_stars>1-10
include("header.jl")
# http://docs.julialang.org/en/latest/manual/arrays.html#man-supported-index-types-1
# Test KnetArray operations: cat, convert, copy, display, eachindex,
# eltype, endof, fill!, first, getindex, hcat, isempty, length,
# linearindexing, ndims, ones, pointer, rand!, reshape, setindex... | [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
17256,
7203,
25677,
13,
20362,
4943,
198,
198,
2,
2638,
1378,
31628,
13,
73,
377,
498,
648,
13,
2398,
14,
268,
14,
42861,
14,
805,
723,
14,
3258,
592,
13,
6494,
2,
805,
12,
15999,
12,
... | 1.652209 | 3,666 |
using Test
using Multilane
using MCTS
using RobustMCTS
using POMDPs
using POMDPModelTools
using POMDPSimulators
using Random
using Test
using Cairo
#Set up problem configuration
nb_lanes = 4
pp = PhysicalParam(nb_lanes,lane_length=100.) #2.=>col_length=8
_discount = 1.
nb_cars=10
rmodel = NoCrashRewardModel()
dmodel... | [
3500,
6208,
198,
3500,
7854,
346,
1531,
198,
3500,
337,
4177,
50,
198,
3500,
3851,
436,
44,
4177,
50,
198,
3500,
350,
2662,
6322,
82,
198,
3500,
350,
2662,
6322,
17633,
33637,
198,
3500,
350,
2662,
35,
3705,
320,
24325,
198,
3500,
1... | 2.224561 | 570 |
<reponame>cameronperot/explosive-percolation<filename>code/scaling/scaling_observables.jl<gh_stars>0
path = "/home/user/GraphEvolve.jl/src"
# path = "/home/perot/julia/GraphEvolve.jl/src";
push!(LOAD_PATH, path);
using GraphEvolve;
using Plots; pyplot(fmt="png");
PyPlot.matplotlib.rc("mathtext", fontset="cm");
PyPlot.m... | [
27,
7856,
261,
480,
29,
66,
41639,
525,
313,
14,
20676,
418,
425,
12,
525,
4033,
341,
27,
34345,
29,
8189,
14,
1416,
4272,
14,
1416,
4272,
62,
672,
3168,
2977,
13,
20362,
27,
456,
62,
30783,
29,
15,
198,
6978,
796,
12813,
11195,
... | 2.070342 | 2,630 |
<reponame>hshindo/JukaiNLP<filename>src/dev/depparsing/old/depparser.jl
import .ArcStd: State, expand_gold, expand_pred, toheads
type DepParser
end
const num_feats = 1 << 26
const weights = [fill(0.0,num_feats) for i=1:3]
function tohash(data::Vector{Int})
hash = 1
for x in data
hash += x
has... | [
27,
7856,
261,
480,
29,
71,
1477,
521,
78,
14,
41,
2724,
1872,
45,
19930,
27,
34345,
29,
10677,
14,
7959,
14,
2934,
381,
945,
278,
14,
727,
14,
2934,
381,
28198,
13,
20362,
198,
11748,
764,
24021,
1273,
67,
25,
1812,
11,
4292,
6... | 1.935691 | 1,555 |
include("miscellaneous.jl")
include("def.jl")
include("util_iter.jl")
include("util_macros.jl")
include("error.jl")
include("runtime.jl")
include("agent.jl")
include("signal.jl")
include("aql.jl")
include("memory.jl")
include("queue.jl")
include("code.jl")
include("config.jl")
include("extensions.jl")
| [
17256,
7203,
25413,
25673,
13,
20362,
4943,
198,
17256,
7203,
4299,
13,
20362,
4943,
198,
17256,
7203,
22602,
62,
2676,
13,
20362,
4943,
198,
17256,
7203,
22602,
62,
20285,
4951,
13,
20362,
4943,
198,
17256,
7203,
18224,
13,
20362,
4943,
... | 2.831776 | 107 |
macro import_rectangle_huge()
:(
using ComplexVisual:
CV_Rectangle, cv_rect_blwh, cv_width, cv_height, cv_is_inside,
cv_anchor, cv_pad, cv_intersect, CV_RectangleStore,
cv_add_rectangle!, cv_find_first_nonempty_intersection,
cv_compute_bounding_box
)
end
... | [
20285,
305,
1330,
62,
2554,
9248,
62,
40878,
3419,
198,
220,
220,
220,
36147,
198,
220,
220,
220,
220,
220,
220,
220,
1262,
19157,
36259,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26196,
62,
45474,
9248,
11,
... | 2.223369 | 3,586 |
<filename>src/solvers/dg/2d/amr.jl<gh_stars>1-10
# This file contains functions that are related to the AMR capabilities of the DG solver
# Refine elements in the DG solver based on a list of cell_ids that should be refined
function refine!(dg::Dg2D{Eqn, MeshType, NVARS, POLYDEG}, mesh::TreeMesh,
cell... | [
27,
34345,
29,
10677,
14,
34453,
690,
14,
67,
70,
14,
17,
67,
14,
321,
81,
13,
20362,
27,
456,
62,
30783,
29,
16,
12,
940,
198,
2,
770,
2393,
4909,
5499,
326,
389,
3519,
284,
262,
3001,
49,
9889,
286,
262,
46133,
1540,
332,
19... | 2.389936 | 8,645 |
<filename>src/wrappers/i686-linux-gnu.jl
# Autogenerated wrapper script for Zellij_jll for i686-linux-gnu
export zellij
JLLWrappers.@generate_wrapper_header("Zellij")
JLLWrappers.@declare_executable_product(zellij)
function __init__()
JLLWrappers.@generate_init_header()
JLLWrappers.@init_executable_product(
... | [
27,
34345,
29,
10677,
14,
29988,
11799,
14,
72,
33808,
12,
23289,
12,
41791,
13,
20362,
198,
2,
5231,
519,
877,
515,
29908,
4226,
329,
1168,
695,
2926,
62,
73,
297,
329,
1312,
33808,
12,
23289,
12,
41791,
198,
39344,
1976,
695,
2926... | 2.338889 | 180 |
<reponame>sloede/julia
# This file is a part of Julia. License is MIT: https://julialang.org/license
import Libdl
# helper function for passing input to stdin
# and returning the stdout result
function writereadpipeline(input, exename)
p = open(exename, "w+")
@async begin
write(p.in, input)
cl... | [
27,
7856,
261,
480,
29,
82,
5439,
18654,
14,
73,
43640,
198,
2,
770,
2393,
318,
257,
636,
286,
22300,
13,
13789,
318,
17168,
25,
3740,
1378,
73,
377,
498,
648,
13,
2398,
14,
43085,
198,
198,
11748,
7980,
25404,
198,
198,
2,
31904,... | 2.031018 | 13,895 |
<reponame>keiikegami/DefferedAcceptance.jl
using DefferedAcceptance
using Base.Test
const _deferred_acceptance = DefferedAcceptance.ikegami
const test_matrix = false
function mat2vecs{T<:Integer}(prefs::Matrix{T})
return [prefs[1:findfirst(prefs[:, j], 0)-1, j] for j in 1:size(prefs, 2)]
end
function sort_matche... | [
27,
7856,
261,
480,
29,
365,
72,
522,
70,
6277,
14,
5005,
487,
1068,
38855,
590,
13,
20362,
198,
3500,
1024,
487,
1068,
38855,
590,
198,
3500,
7308,
13,
14402,
198,
198,
9979,
4808,
4299,
17436,
62,
13635,
590,
796,
1024,
487,
1068,... | 1.70703 | 5,021 |
module TestSPPL
using SPPL
using Test
include("examples.jl")
end # module
| [
21412,
6208,
4303,
6489,
198,
198,
3500,
6226,
6489,
198,
3500,
6208,
198,
198,
17256,
7203,
1069,
12629,
13,
20362,
4943,
198,
198,
437,
1303,
8265,
198
] | 2.851852 | 27 |
<reponame>terasakisatoshi/juliaExer
using Flux: onehot, onehotbatch, onecold
@show onehot(1,[1,2,3])
@show onehotbatch([1,2], [1,2,3])
@show onecold([0.3,0.2,0.5],[1,2,3])
| [
27,
7856,
261,
480,
29,
353,
292,
27321,
265,
13704,
14,
73,
43640,
3109,
263,
198,
3500,
1610,
2821,
25,
530,
8940,
11,
530,
8940,
43501,
11,
530,
36673,
198,
198,
31,
12860,
530,
8940,
7,
16,
17414,
16,
11,
17,
11,
18,
12962,
... | 1.988506 | 87 |
@testset "add" begin
x1 = [1,2,3]
x2 = Var([1,2,3])
y = x1 + x2
@test y.data == [2,4,6]
x = randn(3, 3)
y = randn(3, 3)
f = x -> x + y
@test gradcheck(f, x)
x = Var(randn(3, 3))
y = randn(3)
@test gradcheck(f, x)
end
@testset "mul" begin
x1 = [1, 2, 3]
x2 = Va... | [
31,
9288,
2617,
366,
2860,
1,
2221,
198,
220,
220,
220,
2124,
16,
796,
685,
16,
11,
17,
11,
18,
60,
198,
220,
220,
220,
2124,
17,
796,
12372,
26933,
16,
11,
17,
11,
18,
12962,
198,
220,
220,
220,
331,
796,
2124,
16,
1343,
2124... | 1.728546 | 571 |
<filename>examples/imgui_ex.jl
using CImGui
using CImGui.CSyntax
using CImGui.CSyntax.CStatic
using CImGui.GLFWBackend
using CImGui.OpenGLBackend
using CImGui.GLFWBackend.GLFW
using CImGui.OpenGLBackend.ModernGL
using Printf
using GR
using LaTeXStrings
const glsl_version = 150
GLFW.WindowHint(GLFW.CONTEXT_VERSION_MAJ... | [
27,
34345,
29,
1069,
12629,
14,
320,
48317,
62,
1069,
13,
20362,
198,
3500,
327,
3546,
8205,
72,
198,
3500,
327,
3546,
8205,
72,
13,
7902,
33567,
897,
198,
3500,
327,
3546,
8205,
72,
13,
7902,
33567,
897,
13,
34,
45442,
198,
3500,
... | 2.136919 | 1,636 |
struct DataValue{T}
hasvalue::Bool
value::T
DataValue{T}() where {T} = new(false)
DataValue{T}(value::T, hasvalue::Bool=true) where {T} = new(hasvalue, value)
end
struct DataValueException <: Exception
end
const NA = DataValue{Union{}}()
DataValue(value::T, hasvalue::Bool=true) where {T} = DataValue... | [
7249,
6060,
11395,
90,
51,
92,
198,
220,
220,
220,
468,
8367,
3712,
33,
970,
198,
220,
220,
220,
1988,
3712,
51,
628,
220,
220,
220,
6060,
11395,
90,
51,
92,
3419,
810,
1391,
51,
92,
796,
649,
7,
9562,
8,
198,
220,
220,
220,
6... | 2.254837 | 5,117 |
<filename>docs/make.jl
using Documenter, ColorBlendModes
module CompositingExamples
using ColorBlendModes, PNGFiles
export load, save # just for examples
export generate
images = Dict{String, AbstractMatrix}()
function load(filename)
img = get(images, filename, nothing)
if img ==... | [
27,
34345,
29,
31628,
14,
15883,
13,
20362,
198,
3500,
16854,
263,
11,
5315,
3629,
437,
44,
4147,
198,
198,
21412,
29936,
1780,
27730,
198,
220,
220,
220,
1262,
5315,
3629,
437,
44,
4147,
11,
36182,
25876,
628,
220,
220,
220,
10784,
... | 2.25247 | 911 |
# This file was generated by the Julia Swagger Code Generator
# Do not modify this file directly. Modify the swagger specification instead.
mutable struct IoK8sApiCoreV1NodeSystemInfo <: SwaggerModel
architecture::Any # spec type: Union{ Nothing, String } # spec name: architecture
bootID::Any # spec type: Un... | [
2,
770,
2393,
373,
7560,
416,
262,
22300,
2451,
7928,
6127,
35986,
198,
2,
2141,
407,
13096,
428,
2393,
3264,
13,
3401,
1958,
262,
1509,
7928,
20855,
2427,
13,
628,
198,
198,
76,
18187,
2878,
27853,
42,
23,
82,
32,
14415,
14055,
53,... | 2.991516 | 1,768 |
<filename>src/solvers/exact.jl
using JuMP
using Convex
import MathOptInterface as MOI
"""
Solve the QAP using quadratic integer progamming.
"""
function qap_exact(A::AbstractArray{<:Real,2}, B::AbstractArray{<:Real,2}, obj::Symbol; seeds::Int=0)
@assert obj in [:min, :max]
n = size(A,1) - seeds
if seeds != 0
A ... | [
27,
34345,
29,
10677,
14,
34453,
690,
14,
1069,
529,
13,
20362,
198,
3500,
12585,
7378,
198,
3500,
1482,
303,
87,
198,
11748,
16320,
27871,
39317,
355,
13070,
40,
628,
198,
37811,
198,
50,
6442,
262,
1195,
2969,
1262,
15094,
81,
1512,... | 2.362903 | 744 |
<filename>src/unit_convention.jl<gh_stars>1-10
# The unit convention throughout the package and other packages in the CESMIX Julia Suite
# is to assume all unspecified units to be atomic units as defined in UnitfulAtomic.jl.
# Here we provide constants for the atomic units we use to make the code more readable.
const... | [
27,
34345,
29,
10677,
14,
20850,
62,
1102,
4018,
13,
20362,
27,
456,
62,
30783,
29,
16,
12,
940,
198,
2,
383,
4326,
9831,
3690,
262,
5301,
290,
584,
10392,
287,
262,
42700,
8895,
55,
22300,
26264,
198,
2,
318,
284,
7048,
477,
2954... | 3.109677 | 155 |
# Rational Quadratic Isotropic Covariance Function
"""
RQIso <: Isotropic{SqEuclidean}
Isotropic Rational Quadratic kernel (covariance)
```math
k(x,x') = σ²(1 + (x - x')ᵀ(x - x')/(2αℓ²))^{-α}
```
with length scale ``ℓ``, signal standard deviation ``σ``, and shape parameter ``α``.
"""
mutable struct RQIso <: Isotr... | [
2,
46863,
20648,
81,
1512,
1148,
46084,
39751,
2743,
590,
15553,
198,
198,
37811,
198,
220,
220,
220,
371,
48,
40,
568,
1279,
25,
1148,
46084,
90,
50,
80,
36,
36616,
485,
272,
92,
198,
198,
3792,
46084,
46863,
20648,
81,
1512,
9720,... | 1.913183 | 933 |
<filename>src/backends/precomputed.jl
function geom(x::Blade, y::Blade)
i, ρ = TABLE[x.index, y.index]
Blade(ρ * x.coef * y.coef, i)
end
| [
27,
34345,
29,
10677,
14,
1891,
2412,
14,
3866,
785,
17128,
13,
20362,
198,
8818,
4903,
296,
7,
87,
3712,
47520,
11,
331,
3712,
47520,
8,
198,
220,
220,
220,
1312,
11,
18074,
223,
796,
43679,
58,
87,
13,
9630,
11,
331,
13,
9630,
... | 2.132353 | 68 |
##
# These routines simplify the multiplication of two operators
# they are currently used for dekron of PDEs to make sure equivalent operators are
# recognized as the same
# I put this in Extras as it's currently a "hack"
#
# In the future, product rule/etc. could be implemented, and some sort of ordering
# to recogn... | [
198,
2235,
198,
2,
2312,
31878,
30276,
262,
48473,
286,
734,
12879,
198,
2,
484,
389,
3058,
973,
329,
390,
74,
1313,
286,
350,
7206,
82,
284,
787,
1654,
7548,
12879,
389,
198,
2,
8018,
355,
262,
976,
198,
2,
314,
1234,
428,
287,
... | 2.539419 | 482 |
<reponame>arashfs92/arashfs007<filename>test/runtests.jl
# Copyright 2015, 2016, 2017, 2018 <NAME>
# See accompanying license file.
include("checklic.jl")
using ACME
using Compat: argmin, range
import Compat.Test
using Compat.Test: @test, @test_broken, @test_throws, @test_warn, @testset
using ProgressMeter
using Comp... | [
27,
7856,
261,
480,
29,
283,
1077,
9501,
5892,
14,
283,
1077,
9501,
25816,
27,
34345,
29,
9288,
14,
81,
2797,
3558,
13,
20362,
198,
2,
15069,
1853,
11,
1584,
11,
2177,
11,
2864,
1279,
20608,
29,
198,
2,
4091,
19249,
5964,
2393,
13... | 1.875737 | 11,532 |
<filename>docs/components_page/components/dropdown/content.jl
using DashBootstrapComponents
dropdown = dbc_dropdownmenu(
[
dbc_dropdownmenuitem("Header", header = true),
dbc_dropdownmenuitem("An item"),
dbc_dropdownmenuitem(divider = true),
dbc_dropdownmenuitem("Active and disabled"... | [
27,
34345,
29,
31628,
14,
5589,
3906,
62,
7700,
14,
5589,
3906,
14,
14781,
2902,
14,
11299,
13,
20362,
198,
3500,
16189,
36476,
26418,
7293,
3906,
198,
198,
14781,
2902,
796,
288,
15630,
62,
14781,
2902,
26272,
7,
198,
220,
220,
220,
... | 2.315254 | 295 |
using Random
import ParticleInCell.F90
@testset "deposition" begin
dimx, dimy = 4π, 4π
nx, ny = 128, 128
mesh = TwoDGrid(dimx, nx, dimy, ny)
fdtd = FDTD(mesh)
rng = MersenneTwister(1234)
nbpart = 1_000_000
jx = zeros(nx+1, ny+1)
jy = zeros(nx+1, ny+1)
kernel = CloudInCell()
... | [
3500,
14534,
198,
11748,
2142,
1548,
818,
28780,
13,
37,
3829,
198,
198,
31,
9288,
2617,
366,
10378,
3507,
1,
2221,
628,
198,
220,
220,
220,
5391,
87,
11,
5391,
88,
796,
604,
46582,
11,
604,
46582,
198,
220,
220,
220,
299,
87,
11,... | 1.871951 | 492 |
<reponame>yeesian/Circuitscape.jl<filename>src/network/pairwise.jl<gh_stars>0
"""
Primary driver for network pairwise.
"""
function network_pairwise(T, V, cfg)::Matrix{T}
# Get input
networkdata = get_network_data(T, V, cfg)
# Get compute flags
flags = get_network_flags(cfg)
# Compute graph data ... | [
27,
7856,
261,
480,
29,
88,
2841,
666,
14,
31560,
15379,
36435,
13,
20362,
27,
34345,
29,
10677,
14,
27349,
14,
24874,
3083,
13,
20362,
27,
456,
62,
30783,
29,
15,
198,
37811,
198,
35170,
4639,
329,
3127,
5166,
3083,
13,
198,
37811,... | 2.249397 | 1,243 |
<reponame>MatthewMcLeod/curiosity<filename>src/agent/tile_coder.jl
module TileCoding
mutable struct IHT
size::Integer
overfullCount::Int64
dictionary::Dict{Array{Int64, 1}, Int64}
IHT(sizeval) = new(sizeval, 0, Dict{Array{Int64, 1}, Int64}())
end
capacity(iht::IHT) = iht.size
count(iht::IHT) = length(... | [
27,
7856,
261,
480,
29,
25372,
9742,
44559,
14,
22019,
15023,
27,
34345,
29,
10677,
14,
25781,
14,
40927,
62,
66,
12342,
13,
20362,
198,
21412,
47870,
34,
7656,
198,
198,
76,
18187,
2878,
314,
6535,
198,
220,
220,
220,
2546,
3712,
4... | 2.119743 | 2,021 |
using BinaryBuilder
name = "Libffi"
version = v"3.2.1"
# Collection of sources required to build libffi
sources = [
ArchiveSource("https://sourceware.org/pub/libffi/libffi-$(version).tar.gz",
"d06ebb8e1d9a22d19e38d63fdb83954253f39bedc5d46232a05645685722ca37"),
]
# Bash recipe for building acro... | [
3500,
45755,
32875,
198,
198,
3672,
796,
366,
25835,
487,
72,
1,
198,
9641,
796,
410,
1,
18,
13,
17,
13,
16,
1,
628,
198,
2,
12251,
286,
4237,
2672,
284,
1382,
9195,
487,
72,
198,
82,
2203,
796,
685,
198,
220,
220,
220,
20816,
... | 3 | 344 |
<reponame>bjack205/NewPackage.jl
@testset "Foo test" begin
v = NewPackage.foo(10,5)
@test v[1] == 10
@test v[2] == 5
@test eltype(v) == Int
v = NewPackage.foo(10.0, 5)
@test v[1] == 10
@test v[2] == 5
@test eltype(v) == Float64
end
| [
27,
7856,
261,
480,
29,
65,
19650,
21261,
14,
3791,
27813,
13,
20362,
198,
31,
9288,
2617,
366,
37,
2238,
1332,
1,
2221,
198,
220,
220,
220,
410,
796,
968,
27813,
13,
21943,
7,
940,
11,
20,
8,
198,
220,
220,
220,
2488,
9288,
410... | 1.977612 | 134 |
# Autogenerated wrapper script for Mineos_jll for x86_64-w64-mingw32-libgfortran3
export cucss2sac, eigcon, eigen2asc, endi, green, minos_bran, simpledit, syndat
using CompilerSupportLibraries_jll
JLLWrappers.@generate_wrapper_header("Mineos")
JLLWrappers.@declare_executable_product(cucss2sac)
JLLWrappers.@declare_exe... | [
2,
5231,
519,
877,
515,
29908,
4226,
329,
11517,
418,
62,
73,
297,
329,
2124,
4521,
62,
2414,
12,
86,
2414,
12,
2229,
86,
2624,
12,
8019,
70,
3319,
2596,
18,
198,
39344,
38421,
824,
17,
30584,
11,
304,
328,
1102,
11,
304,
9324,
... | 2.16737 | 711 |
module ParDiffEqnSuite
using StaticArrays
include("FDapproxOnGrid.jl")
export
fntdiff1d, fntdiff1d!
end
| [
21412,
2547,
28813,
36,
80,
77,
5606,
578,
198,
198,
3500,
36125,
3163,
20477,
198,
198,
17256,
7203,
26009,
1324,
13907,
2202,
41339,
13,
20362,
4943,
628,
198,
39344,
220,
198,
69,
429,
26069,
16,
67,
11,
277,
429,
26069,
16,
67,
... | 2.369565 | 46 |
### A Pluto.jl notebook ###
# v0.14.7
using Markdown
using InteractiveUtils
# ╔═╡ 0758937c-478f-45b7-a1d4-31810eecfd60
begin
using PlutoUI
PlutoUI.TableOfContents(aside=true)
end
# ╔═╡ 7bf123d1-dc37-44d0-9da9-982dbca9ec02
using LinearAlgebra
# ╔═╡ e0d1f2ca-ea96-4ae8-a3bd-cfabe92978d5
using SparseArrays
# ╔═╡ ea4... | [
21017,
317,
32217,
13,
20362,
20922,
44386,
198,
2,
410,
15,
13,
1415,
13,
22,
198,
198,
3500,
2940,
2902,
198,
3500,
21365,
18274,
4487,
198,
198,
2,
2343,
243,
242,
28670,
22880,
94,
657,
2425,
4531,
2718,
66,
12,
29059,
69,
12,
... | 1.673863 | 7,782 |
using Roots
f(x) = x^3 - x - 1
@show fzeros(f)
println()
@show fzero(f, [-2,2])
println()
@show fzero(f, 1.0)
println()
f(x) = exp(x) - x^4
fp(x) = exp(x) - 4x^3
fpp(x) = exp(x) - 12x^2
newton(f, fp, 8) # 8.613169456441398
newton(f, 8)
halley(f, fp, fpp, 8)
halley(f, 8)
secant_method(f, 8, 8.5) | [
3500,
34341,
198,
198,
69,
7,
87,
8,
796,
2124,
61,
18,
532,
2124,
532,
352,
198,
31,
12860,
277,
9107,
418,
7,
69,
8,
198,
35235,
3419,
198,
198,
31,
12860,
277,
22570,
7,
69,
11,
25915,
17,
11,
17,
12962,
198,
35235,
3419,
1... | 1.703297 | 182 |
<reponame>pszufe/LTMSim.jl
using DataStructures
function generateHypergraph()
h = Hypergraph{Bool}(5,3)
h[[1,2,5],1] .= true;
h[:, 2] .= true;
h[[1,3,5],3] .= true;
metaV = [2,2,1,1,2]
metaE = [2,2,2]
actV = zeros(Bool, nhv(h));
actE = zeros(Bool, nhe(h));
actV[[1,4]] .= true;
(... | [
27,
7856,
261,
480,
29,
862,
89,
3046,
68,
14,
27734,
5653,
320,
13,
20362,
198,
3500,
6060,
44909,
942,
198,
198,
8818,
7716,
38197,
34960,
3419,
198,
220,
220,
220,
289,
796,
15079,
34960,
90,
33,
970,
92,
7,
20,
11,
18,
8,
19... | 1.798374 | 1,230 |
module KeyTuples
import DataFrames: DataFrame
import NullableArrays: NullableArray
export KeyTuple, keytuples_to_df
"""
Tuple-like type with keys for accessing elements. Valid keys are
symbols. Use the constructor
```julia
KeyTuple(:a => 1, :b => 2)
```
to create objects.
"""
immutable KeyTuple{K,T <: Tuple} <: Asso... | [
21412,
7383,
47247,
2374,
198,
198,
11748,
6060,
35439,
25,
6060,
19778,
198,
11748,
35886,
540,
3163,
20477,
25,
35886,
540,
19182,
198,
198,
39344,
7383,
51,
29291,
11,
1994,
28047,
2374,
62,
1462,
62,
7568,
198,
198,
37811,
198,
51,
... | 2.276051 | 1,094 |
# survreg.jl
| [
2,
3343,
2301,
13,
20362,
198
] | 2.166667 | 6 |
<gh_stars>0
using SymbolicUtils
using SymbolicUtils: Term
using SpecialFunctions
using Test
import IfElse: ifelse
import IfElse
using SymbolicUtils: showraw, Symbolic
function rand_input(T)
if T == Bool
return rand(Bool)
elseif T <: Integer
x = rand(-100:100)
while iszero(x)
... | [
27,
456,
62,
30783,
29,
15,
198,
3500,
41327,
4160,
18274,
4487,
198,
3500,
41327,
4160,
18274,
4487,
25,
35118,
198,
3500,
6093,
24629,
2733,
198,
3500,
6208,
198,
11748,
1002,
40674,
25,
611,
17772,
198,
11748,
1002,
40674,
198,
198,
... | 1.825263 | 3,800 |
<reponame>mrufsvold/TopicModelsVB.jl
mutable struct CTPF <: TopicModel
"Collaborative topic Poisson factorization."
K::Int
M::Int
V::Int
U::Int
N::Vector{Int}
C::Vector{Int}
R::Vector{Int}
corp::Corpus
topics::VectorList{Int}
scores::Matrix{Float64}
libs::VectorList{Int}
drecs::VectorList{Int}
urecs::Vec... | [
27,
7856,
261,
480,
29,
76,
622,
9501,
85,
727,
14,
33221,
5841,
1424,
44526,
13,
20362,
198,
76,
18187,
2878,
327,
7250,
37,
1279,
25,
47373,
17633,
198,
197,
1,
22667,
4820,
876,
7243,
7695,
30927,
5766,
1634,
526,
628,
197,
42,
... | 2.138099 | 5,554 |
module Visualize_SolidFileMesh
using Modia3D
using Modia3D.StaticArrays
vmat1 = Modia3D.Material(color="LightBlue" , transparency=0.5) # material of SolidFileMesh
vmat2 = deepcopy(vmat1) # material of convex decomposition of SolidFileMesh
vmat2.transparency = 0.7
font = ... | [
21412,
15612,
1096,
62,
46933,
8979,
37031,
198,
198,
3500,
3401,
544,
18,
35,
198,
3500,
3401,
544,
18,
35,
13,
45442,
3163,
20477,
198,
198,
85,
6759,
16,
796,
3401,
544,
18,
35,
13,
17518,
7,
8043,
2625,
15047,
14573,
1,
837,
1... | 2.332623 | 469 |
<reponame>essenciary/RandomS.jl<gh_stars>1-10
@testset "Random Symbols" begin
@test isa(rand(Symbol), Symbol)
@test length(rand(Symbol) |> string) == 8
@test length(rand(Symbol, 10) |> string) == 10
end | [
27,
7856,
261,
480,
29,
44483,
979,
560,
14,
29531,
50,
13,
20362,
27,
456,
62,
30783,
29,
16,
12,
940,
198,
31,
9288,
2617,
366,
29531,
41327,
10220,
1,
2221,
198,
220,
2488,
9288,
318,
64,
7,
25192,
7,
13940,
23650,
828,
38357,
... | 2.506024 | 83 |
using DimensionalData, Test
@test name(nothing) == ""
@test name(Nothing) == ""
@test dims(1) == nothing
@test_throws ErrorException dims(nothing)
@test refdims(1) == ()
| [
3500,
360,
16198,
6601,
11,
6208,
198,
198,
31,
9288,
1438,
7,
22366,
8,
6624,
13538,
198,
31,
9288,
1438,
7,
18465,
8,
6624,
13538,
198,
31,
9288,
5391,
82,
7,
16,
8,
6624,
2147,
198,
31,
9288,
62,
400,
8516,
13047,
16922,
5391,
... | 2.819672 | 61 |
<reponame>UnofficialJuliaMirror/BayesianNonparametrics.jl-7e49bc5d-d907-5fdd-93a4-11f1b4f8bb51
export HDPHyperparam
"Hierarchical Dirichlet Process Mixture Model Hyperparameters"
struct HDPHyperparam <: AbstractHyperparam
γ_a::Float64
γ_b::Float64
α_a::Float64
α_b::Float64
"default values"
HDPHyperparam... | [
27,
7856,
261,
480,
29,
3118,
16841,
16980,
544,
27453,
1472,
14,
15262,
35610,
15419,
17143,
316,
10466,
13,
20362,
12,
22,
68,
2920,
15630,
20,
67,
12,
67,
24,
2998,
12,
20,
69,
1860,
12,
6052,
64,
19,
12,
1157,
69,
16,
65,
19... | 1.914396 | 3,119 |
<reponame>Micki-D/BAT.jl
# This file is a part of BAT.jl, licensed under the MIT License (MIT).
_h5io_keys(df::HDF5.H5DataStore) = keys(df)
_h5io_keys(df::HDF5.Dataset) = nothing
_h5io_objtype(df::HDF5.H5DataStore) = Val(:datafile)
_h5io_objtype(df::HDF5.Dataset) = Val(:dataset)
# Should be available from HDF5 v0.1... | [
27,
7856,
261,
480,
29,
44,
624,
72,
12,
35,
14,
47379,
13,
20362,
198,
2,
770,
2393,
318,
257,
636,
286,
37421,
13,
20362,
11,
11971,
739,
262,
17168,
13789,
357,
36393,
737,
628,
198,
62,
71,
20,
952,
62,
13083,
7,
7568,
3712,... | 2.205853 | 991 |
using AMQPClient
using MbedTLS
compose_auth(user::String,password::String) =
Dict{String,Any}("MECHANISM"=>"AMQPLAIN", "LOGIN"=>user, "PASSWORD"=>password)
struct AmqpConnectionDef
virtualhost::String
host::String
port::Int64
auth_params::Dict{String,Any}
amqps::Union{Nothing, MbedT... | [
3500,
3001,
48,
47,
11792,
201,
198,
3500,
337,
3077,
51,
6561,
201,
198,
201,
198,
785,
3455,
62,
18439,
7,
7220,
3712,
10100,
11,
28712,
3712,
10100,
8,
796,
201,
198,
220,
220,
220,
360,
713,
90,
10100,
11,
7149,
92,
7203,
44,
... | 2.276986 | 491 |
#= iterators from https://lostella.github.io/blog/2018/07/25/iterative-methods-done-right =#
#Halting
struct HaltingIterable{I, F}
iter::I
fun::F
end
function iterate(iter::HaltingIterable)
next = iterate(iter.iter)
return dispatch(iter, next)
end
function iterate(iter::HaltingIterable, (instruction, ... | [
2,
28,
11629,
2024,
422,
3740,
1378,
33224,
12627,
13,
12567,
13,
952,
14,
14036,
14,
7908,
14,
2998,
14,
1495,
14,
2676,
876,
12,
24396,
82,
12,
28060,
12,
3506,
796,
2,
198,
2,
40202,
889,
198,
7249,
11023,
889,
29993,
540,
90,
... | 2.565757 | 806 |
include("./shared.jl")
## 3D tests
include("../scripts/diff_3D/diff_3D_nonlin_perf.jl")
@reset_parallel_stencil()
indsx = Int.(ceil.(LinRange(1, length(xc), 12)))
indsy = Int.(ceil.(LinRange(1, length(yc), 12)))
indsz = Int.(ceil.(LinRange(1, length(zc), 12)))
d3d = Dict(:X=> xc[indsx], :H=>H[indsx,indsy,indsz])
@... | [
198,
17256,
7,
1911,
14,
28710,
13,
20362,
4943,
198,
198,
2235,
513,
35,
5254,
198,
17256,
7203,
40720,
46521,
14,
26069,
62,
18,
35,
14,
26069,
62,
18,
35,
62,
13159,
2815,
62,
525,
69,
13,
20362,
4943,
198,
31,
42503,
62,
1845,... | 2.235294 | 221 |
<filename>src/atoms/exp_cone/entropy.jl<gh_stars>1-10
#############################################################################
# entropy.jl
# entropy (ie, sum_i( -x_i log (x_i) ) of an expression x
# All expressions and atoms are subtypes of AbstractExpr.
# Please read expressions.jl first.
#######################... | [
27,
34345,
29,
10677,
14,
265,
3150,
14,
11201,
62,
49180,
14,
298,
28338,
13,
20362,
27,
456,
62,
30783,
29,
16,
12,
940,
198,
29113,
29113,
7804,
4242,
2,
198,
2,
40709,
13,
20362,
198,
2,
40709,
357,
494,
11,
2160,
62,
72,
7,... | 2.436081 | 837 |
<gh_stars>1-10
module AtomicMass
using JuliaDB
srcdir= @__DIR__
pt=load(srcdir * "/atomicmass.db");
function _atomicmass(s::T) where T<:AbstractString
filter(x->x.Symbol==s, pt)[1].m
end
function _atomicmass(s::T1, A::T2) where {T1<:AbstractString , T2<:Integer}
filter(x->(x.Symbol==s && x.A==A), pt)[1].m
end... | [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
21412,
28976,
20273,
198,
3500,
22300,
11012,
198,
198,
10677,
15908,
28,
2488,
834,
34720,
834,
198,
457,
28,
2220,
7,
10677,
15908,
1635,
12813,
47116,
22208,
13,
9945,
15341,
198,
198,
8818... | 2.244406 | 581 |
"""
Trains SeqModel given a config dict.
Returns dict containing results.
Differs from easy_sample.jl in that it uses masks and masked gibbs sampling.
Used for doing cross-validation on speckled hold-out data.
"""
function easy_sample_masked!(
model::Union{SeqModel,DistributedSeqModel},
spikes::Vector... | [
37811,
198,
2898,
1299,
1001,
80,
17633,
1813,
257,
4566,
8633,
13,
198,
198,
35561,
8633,
7268,
2482,
13,
198,
198,
28813,
364,
422,
2562,
62,
39873,
13,
20362,
287,
326,
340,
3544,
20680,
290,
29229,
46795,
1443,
19232,
13,
198,
380... | 2.094958 | 1,190 |
#=
Here we solve the equation:
```math
q + dot(∇, uq) = 0
p - dot(∇, up) = 0
```
on a sphere to test the conservation of the numerics
The boundary conditions are `p = q` when `dot(n, u) > 0` and
`q = p` when `dot(n, u) < 0` (i.e., `p` flows into `q` and vice-sersa).
=#
using MPI
using CLIMA
using CLIMA.Mesh.Topolog... | [
2,
28,
198,
4342,
356,
8494,
262,
16022,
25,
198,
15506,
63,
11018,
198,
10662,
1343,
16605,
7,
24861,
229,
11,
334,
80,
8,
796,
657,
198,
279,
532,
16605,
7,
24861,
229,
11,
510,
8,
796,
657,
198,
15506,
63,
198,
261,
257,
1655... | 1.94458 | 2,454 |
<gh_stars>0
@testset "CircularBuffer" begin
@testset "Core Functionality" begin
cb = CircularBuffer{Int}(5)
@testset "When empty" begin
@test length(cb) == 0
@test capacity(cb) == 5
@test_throws BoundsError first(cb)
@test isempty(cb) == true
... | [
27,
456,
62,
30783,
29,
15,
198,
31,
9288,
2617,
366,
31560,
934,
28632,
1,
2221,
628,
220,
220,
220,
2488,
9288,
2617,
366,
14055,
15553,
1483,
1,
2221,
198,
220,
220,
220,
220,
220,
220,
220,
269,
65,
796,
7672,
934,
28632,
90,
... | 1.756027 | 2,074 |
################################################################################
# SUPPORT ITERATION METHODS
################################################################################
## Form a placeholder parameter reference given the object index
# IndependentParameterIndex
function _t... | [
29113,
29113,
14468,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
43333,
314,
5781,
6234,
337,
36252,
50,
198,
29113,
29113,
14468,
198,
... | 2.600649 | 14,481 |
using SQLite_Octo
adapter = SQL.connect(db="test.db")
SQL.execute(adapter, """
DROP TABLE IF EXISTS users; """)
SQL.execute(adapter, """
CREATE TABLE users (
id INT NOT NULL,
name VARCHAR(20),
PRIMARY KEY (id)
); """)
SQL.execute(adapter, "SELECT name FROM sqlite_master WHERE type='table';")
SQL.execut... | [
3500,
16363,
578,
62,
12349,
78,
198,
198,
324,
3429,
796,
16363,
13,
8443,
7,
9945,
2625,
9288,
13,
9945,
4943,
198,
198,
17861,
13,
41049,
7,
324,
3429,
11,
37227,
198,
7707,
3185,
43679,
16876,
7788,
1797,
4694,
2985,
26,
13538,
... | 2.648148 | 162 |
<reponame>mehalter/Comonicon.jl
using Comonicon
using Test
Comonicon.disable_cache()
@testset "codegen" begin
include("codegen.jl")
end
@testset "parse" begin
include("parse.jl")
end
@testset "build" begin
include("build.jl")
end
| [
27,
7856,
261,
480,
29,
1326,
14201,
353,
14,
5377,
261,
4749,
13,
20362,
198,
3500,
955,
261,
4749,
198,
3500,
6208,
198,
198,
5377,
261,
4749,
13,
40223,
62,
23870,
3419,
198,
198,
31,
9288,
2617,
366,
8189,
5235,
1,
2221,
198,
... | 2.510204 | 98 |
<gh_stars>0
# ---
# jupyter:
# jupytext:
# formats: ipynb,jl:light
# text_representation:
# extension: .jl
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.6.0
# kernelspec:
# display_name: Julia 1.5.2
# language: julia
# name: julia-1.5
# ---
# # WebIO... | [
27,
456,
62,
30783,
29,
15,
198,
2,
11420,
198,
2,
474,
929,
88,
353,
25,
198,
2,
220,
220,
474,
929,
88,
5239,
25,
198,
2,
220,
220,
220,
220,
17519,
25,
20966,
2047,
65,
11,
20362,
25,
2971,
198,
2,
220,
220,
220,
220,
242... | 2.081301 | 369 |
#-------------------------------------------------------------------
#* EMSO Model Library (EML) Copyright (C) 2004 - 2007 ALSOC.
#*
#* This LIBRARY is free software; you can distribute it and/or modify
#* it under the therms of the ALSOC FREE LICENSE as available at
#* http://www.enq.ufrgs.br/alsoc.
#*
#* EMSO Copyrig... | [
2,
10097,
6329,
198,
2,
9,
41363,
46,
9104,
10074,
357,
3620,
43,
8,
15069,
357,
34,
8,
5472,
532,
4343,
27249,
4503,
13,
198,
2,
9,
198,
2,
9,
770,
45651,
49,
13153,
318,
1479,
3788,
26,
345,
460,
14983,
340,
290,
14,
273,
13... | 2.479528 | 2,540 |
<reponame>UnofficialJuliaMirror/Bukdu.jl-3e78a19a-cc83-51d8-955b-515f39fd7955<filename>test/bukdu/system.jl
module test_bukdu_system
module NAStuff
using Bukdu
struct NA <: ApplicationController; conn::Conn end
index(c::NA) = nothing
hello(c::NA) = TEST_INTERNAL_ERROR
end # module NAStuff
using Test
using Bukdu
us... | [
27,
7856,
261,
480,
29,
3118,
16841,
16980,
544,
27453,
1472,
14,
33,
2724,
646,
13,
20362,
12,
18,
68,
3695,
64,
1129,
64,
12,
535,
5999,
12,
4349,
67,
23,
12,
24,
2816,
65,
12,
45969,
69,
2670,
16344,
3720,
2816,
27,
34345,
29... | 2.698514 | 471 |
<gh_stars>10-100
using Distributed
addprocs(2) # add 2 workers
@everywhere using Pkg
@everywhere Pkg.activate(joinpath(@__DIR__, "..", "examples"))
@everywhere using ProgressiveHedging
@everywhere import JuMP
@everywhere import Ipopt
@everywhere function two_stage_model(scenario_id::ScenarioID)
model = JuMP.Mo... | [
27,
456,
62,
30783,
29,
940,
12,
3064,
198,
198,
3500,
4307,
6169,
198,
2860,
1676,
6359,
7,
17,
8,
1303,
751,
362,
3259,
198,
198,
31,
16833,
3003,
1262,
350,
10025,
198,
31,
16833,
3003,
350,
10025,
13,
39022,
7,
22179,
6978,
7,... | 1.853562 | 758 |
<reponame>Mikewl/julia<gh_stars>1-10
# This file is a part of Julia. License is MIT: https://julialang.org/license
"""
message(c::GitCommit, raw::Bool=false)
Return the commit message describing the changes made in commit `c`. If
`raw` is `false`, return a slightly "cleaned up" message (which has any
leading newl... | [
27,
7856,
261,
480,
29,
16073,
40989,
14,
73,
43640,
27,
456,
62,
30783,
29,
16,
12,
940,
198,
2,
770,
2393,
318,
257,
636,
286,
22300,
13,
13789,
318,
17168,
25,
3740,
1378,
73,
377,
498,
648,
13,
2398,
14,
43085,
198,
198,
378... | 2.270105 | 1,803 |
<reponame>fp4code/LMDB.jl<filename>deps/build.jl
using BinDeps
@BinDeps.setup
version = "0.9.15"
url = "https://github.com/LMDB/lmdb/archive/LMDB_$(version).tar.gz"
liblmdb = library_dependency("liblmdb")
provides(Sources, URI(url), liblmdb, unpacked_dir="lmdb-LMDB_$version")
lmdbsrcdir = joinpath(BinDeps.srcdir(l... | [
27,
7856,
261,
480,
29,
46428,
19,
8189,
14,
31288,
11012,
13,
20362,
27,
34345,
29,
10378,
82,
14,
11249,
13,
20362,
198,
3500,
20828,
12156,
82,
198,
198,
31,
33,
259,
12156,
82,
13,
40406,
198,
198,
9641,
796,
366,
15,
13,
24,
... | 2.107735 | 362 |
module JungleHelperBouncyShroom
using ..Ahorn, Maple
@mapdef Entity "JungleHelper/BouncyShroomUp" BouncyShroomUp(x::Integer, y::Integer, yeetx::Integer = 200, yeety::Integer = -290, spriteDirectory::String="JungleHelper/BouncyShroom")
@mapdef Entity "JungleHelper/BouncyShroomLeft" BouncyShroomLeft(x::Integer, y:... | [
21412,
26411,
47429,
33,
977,
948,
2484,
3823,
201,
198,
201,
198,
3500,
11485,
10910,
1211,
11,
21249,
201,
198,
201,
198,
31,
8899,
4299,
20885,
366,
41,
13687,
47429,
14,
33,
977,
948,
2484,
3823,
4933,
1,
347,
977,
948,
2484,
38... | 2.506313 | 792 |
"""
Problem: 120-bit sparse subset
Let a 120-bit string be b = [b_1|b_2|···|b_20], where b_i, i = 1, 2, ..., 20 are
six-bit substrings referred to as blocks. Define the sequence `000001` to be
the target configuration for a block, and denote this configuration by b_t.
The objective function is defined such that the op... | [
37811,
198,
40781,
25,
7982,
12,
2545,
29877,
24637,
198,
198,
5756,
257,
7982,
12,
2545,
4731,
307,
275,
796,
685,
65,
62,
16,
91,
65,
62,
17,
91,
35147,
9129,
91,
65,
62,
1238,
4357,
810,
275,
62,
72,
11,
1312,
796,
352,
11,
... | 2.24496 | 992 |
mutable struct DLNode{T}
value::T
pred::Union{DLNode{T}, Nothing}
succ::Union{DLNode{T}, Nothing}
DLNode(v) = new{typeof(v)}(v, nothing, nothing)
end
function insertpost(prevnode, node)
succ = prevnode.succ
prevnode.succ = node
node.pred = prevnode
node.succ = succ
if succ != nothin... | [
76,
18187,
2878,
23641,
19667,
90,
51,
92,
198,
220,
220,
220,
1988,
3712,
51,
198,
220,
220,
220,
2747,
3712,
38176,
90,
19260,
19667,
90,
51,
5512,
10528,
92,
198,
220,
220,
220,
17458,
3712,
38176,
90,
19260,
19667,
90,
51,
5512,... | 2.237467 | 758 |
mutable struct ErgodicPolicySE2 <: FEBOL.Policy
execution_horizon::Int # how long should we execute
horizon_index::Int #
em::ErgodicManagerSE2
tm::TrajectoryManager
cache::Array{Float64,4}
visualize::Bool
xd::VVF
ud::VVF
end
function ErgodicPolicySE2(f::DF;
... | [
198,
76,
18187,
2878,
5256,
25344,
291,
36727,
5188,
17,
1279,
25,
18630,
33,
3535,
13,
36727,
198,
220,
220,
220,
9706,
62,
17899,
8637,
3712,
5317,
220,
220,
220,
220,
220,
1303,
703,
890,
815,
356,
12260,
198,
220,
220,
220,
1781... | 1.732267 | 1,438 |
# K Nearest Neighbor Module
module KNN
export cosine_sim, dist_sim, majority_vote, predict_naive
export KdTree, create_kdtree, predict_kdtree
export BallTree, create_balltree, predict_balltree
import Statistics
import Random
import LinearAlgebra
"""
Cosine similarity between 2 vectors\\
`X1` and `X2` should have same... | [
2,
509,
3169,
12423,
28708,
19937,
198,
21412,
509,
6144,
198,
39344,
8615,
500,
62,
14323,
11,
1233,
62,
14323,
11,
3741,
62,
27257,
11,
4331,
62,
2616,
425,
198,
39344,
509,
67,
27660,
11,
2251,
62,
74,
67,
21048,
11,
4331,
62,
... | 2.039778 | 8,095 |
function work(x)
x * 2
end
work_single_line(x) = x+5
passed = work_single_line
println(work(4))
println(work_single_line(20))
println(passed(25)) | [
8818,
670,
7,
87,
8,
198,
220,
220,
220,
2124,
1635,
362,
198,
437,
198,
198,
1818,
62,
29762,
62,
1370,
7,
87,
8,
796,
2124,
10,
20,
198,
6603,
276,
796,
670,
62,
29762,
62,
1370,
628,
198,
35235,
7,
1818,
7,
19,
4008,
198,
... | 2.375 | 64 |
<reponame>honzabim/kNN.jl<filename>test/regress.jl
module TestRegress
using Test
using kNN
using StatsBase
using Statistics
using Random
Random.seed!(1)
n = 1_000
x = 10 * randn(n)
y = sin.(x) + 0.5 * randn(n)
fit = kernelregression(x, y)
grid = minimum(x):0.1:maximum(x)
predictions = predict(fit, grid)
... | [
27,
7856,
261,
480,
29,
71,
13569,
397,
320,
14,
74,
6144,
13,
20362,
27,
34345,
29,
9288,
14,
2301,
601,
13,
20362,
198,
21412,
6208,
8081,
601,
198,
197,
3500,
6208,
198,
197,
3500,
479,
6144,
198,
197,
3500,
20595,
14881,
198,
... | 2.480687 | 233 |
<gh_stars>0
module AlgebraicDistance
using LinearAlgebra
using Random
function sumzero!(X)
for j in axes(X, 2)
acc = 0
@simd for i in axes(X, 1)
acc += X[i, j]
end
acc /= size(X, 1)
@simd for i in axes(X, 1)
X[i, j] -= acc
end
end
ret... | [
27,
456,
62,
30783,
29,
15,
198,
21412,
978,
29230,
291,
45767,
198,
198,
3500,
44800,
2348,
29230,
198,
3500,
14534,
198,
198,
8818,
2160,
22570,
0,
7,
55,
8,
198,
220,
220,
220,
329,
474,
287,
34197,
7,
55,
11,
362,
8,
198,
22... | 1.839851 | 537 |
println("Dn) Test of the ImpactExcitation module with ASF from an internally generated initial- and final-state multiplet.")
@warn("\n\n !!! This example does not work properly at present !!! \n\n")
#
setDefaults("print summary: open", "zzz-ImpactExcitation.sum")
wa = Atomic.Computation(Atomic.Computation(), name="xx"... | [
35235,
7203,
35,
77,
8,
6208,
286,
262,
17677,
40127,
3780,
8265,
351,
7054,
37,
422,
281,
20947,
7560,
4238,
12,
290,
2457,
12,
5219,
18540,
1616,
19570,
198,
198,
31,
40539,
7203,
59,
77,
59,
77,
220,
10185,
770,
1672,
857,
407,
... | 2.359621 | 317 |
# This file is a part of Julia. License is MIT: http://julialang.org/license
## type join (closest common ancestor, or least upper bound) ##
typejoin() = (@_pure_meta; Bottom)
typejoin(t::ANY) = (@_pure_meta; t)
typejoin(t::ANY, ts...) = (@_pure_meta; typejoin(t, typejoin(ts...)))
function typejoin(a::ANY, b::ANY)
... | [
2,
770,
2393,
318,
257,
636,
286,
22300,
13,
13789,
318,
17168,
25,
2638,
1378,
73,
377,
498,
648,
13,
2398,
14,
43085,
198,
198,
2235,
2099,
4654,
357,
565,
418,
395,
2219,
31836,
11,
393,
1551,
6727,
5421,
8,
22492,
198,
198,
49... | 2.016627 | 4,631 |
<reponame>StefanKarpinski/Resolver.jl
include("setup.jl")
@testset "core solver" begin
@testset "basic example" begin
packages = [fill("A", 2); fill("B", 4); fill("C", 4)]
conflicts = [(1, 3), (1, 7), (3, 7), (2, 10)]
solutions = [[1, 4, 8], [2, 3, 8], [2, 4, 7]]
@test solutions == ... | [
27,
7856,
261,
480,
29,
7447,
24408,
42,
5117,
21141,
14,
4965,
14375,
13,
20362,
198,
17256,
7203,
40406,
13,
20362,
4943,
198,
198,
31,
9288,
2617,
366,
7295,
1540,
332,
1,
2221,
198,
220,
220,
220,
2488,
9288,
2617,
366,
35487,
1... | 1.826558 | 6,273 |
<reponame>UnofficialJuliaMirrorSnapshots/MCMCChain.jl-1671dc4f-43c8-512c-ab25-e1704a74065e
using Turing, Test
ProjDir = mktempdir()
@testset "serialization read and write test" begin
@model gdemo(x) = begin
s ~ InverseGamma(2,3)
m ~ Normal(0, sqrt(s))
for i in eachindex(x)
x[i]... | [
27,
7856,
261,
480,
29,
3118,
16841,
16980,
544,
27453,
1472,
43826,
20910,
14,
9655,
9655,
35491,
13,
20362,
12,
1433,
4869,
17896,
19,
69,
12,
3559,
66,
23,
12,
25836,
66,
12,
397,
1495,
12,
68,
1558,
3023,
64,
45598,
2996,
68,
... | 2.120921 | 521 |
using OptimalSpacecraftTrajectories
using Test
@testset "OptimalSpacecraftTrajectories.jl" begin
# Write your tests here.
end
| [
3500,
13123,
4402,
14106,
3323,
15721,
752,
1749,
198,
3500,
6208,
198,
198,
31,
9288,
2617,
366,
27871,
4402,
14106,
3323,
15721,
752,
1749,
13,
20362,
1,
2221,
198,
220,
220,
220,
1303,
19430,
534,
5254,
994,
13,
198,
437,
198
] | 3.195122 | 41 |
#################### Geweke Diagnostic ####################
function gewekediag(x::Vector{T}; first::Real=0.1, last::Real=0.5,
etype=:imse, args...) where {T<:Real}
if !(0.0 < first < 1.0)
throw(ArgumentError("first is not in (0, 1)"))
elseif !(0.0 < last < 1.0)
throw(ArgumentE... | [
14468,
4242,
402,
413,
68,
365,
31549,
15132,
1303,
14468,
21017,
198,
198,
8818,
308,
413,
988,
13740,
363,
7,
87,
3712,
38469,
90,
51,
19629,
717,
3712,
15633,
28,
15,
13,
16,
11,
938,
3712,
15633,
28,
15,
13,
20,
11,
198,
220,
... | 2.1 | 590 |
#= Required interface:
* `default(src)`
* `eachrow(src [, fields...])`
* `eltypes(src [, fields...])`
Note that `default` must return a type that satisfies the column indexable
interface
=#
"""
default(tbl::AbstractTable)
Produce an empty table of an appropriate default type.
"""
function default en... | [
2,
28,
20906,
7071,
25,
628,
220,
220,
220,
1635,
4600,
12286,
7,
10677,
8,
63,
198,
220,
220,
220,
1635,
4600,
27379,
808,
7,
10677,
685,
11,
7032,
986,
12962,
63,
198,
220,
220,
220,
1635,
4600,
417,
19199,
7,
10677,
685,
11,
... | 2.986486 | 148 |
<reponame>UnofficialJuliaMirror/SGDOptim.jl-35d56a6d-6727-516e-9b7e-96cab7480cce
# Data streams
abstract SampleStream
# auxiliary functions
gets(x::DenseVector, i::Integer) = x[i]
gets(x::DenseVector, i::UnitRange) = view(x, i)
gets(x::DenseVector, i::AbstractVector) = x[i]
gets(x::DenseMatrix, i::Integer) = view(x,... | [
27,
7856,
261,
480,
29,
3118,
16841,
16980,
544,
27453,
1472,
14,
38475,
18227,
457,
320,
13,
20362,
12,
2327,
67,
3980,
64,
21,
67,
12,
3134,
1983,
12,
47493,
68,
12,
24,
65,
22,
68,
12,
4846,
66,
397,
4524,
1795,
66,
344,
198,... | 2.105202 | 865 |
# QuEST_jl/src/base/QASM_logging.jl
#
function clearRecordedQASM(qureg ::QuEST_Types.Qureg) ::Nothing
ccall(:clearRecordedQASM, Cvoid, (QuEST_Types.Qureg,), qureg)
return nothing
end
function printRecordedQASM(qureg ::QuEST_Types.Qureg) ::Nothing
ccall(:printRecordedQASM, Cvoid, (QuEST_Types.Qureg,), qure... | [
2,
2264,
6465,
62,
20362,
14,
10677,
14,
8692,
14,
48,
1921,
44,
62,
6404,
2667,
13,
20362,
198,
2,
198,
198,
8818,
1598,
23739,
276,
48,
1921,
44,
7,
421,
2301,
7904,
4507,
6465,
62,
31431,
13,
48,
495,
70,
8,
7904,
18465,
198,... | 2.279446 | 433 |
<reponame>YayeIrene/Cuas.jl
function targetPos(target::AbstractTarget, tank::Tank)
rdoelprimprim = [target.ρ; 0; 0]
Rhull = angle_to_dcm(-deg2rad(tank.hull.Φ), -deg2rad(tank.hull.ψ), deg2rad(tank.hull.χ), :XZY)
RLos = angle_to_dcm(0, -deg2rad(tank.sight.θ), deg2rad(tank.sight.ξ), :XZY)
rdoelprim = Rhull*RLos*rdoelpri... | [
27,
7856,
261,
480,
29,
56,
48822,
40,
25924,
14,
46141,
292,
13,
20362,
628,
198,
8818,
2496,
21604,
7,
16793,
3712,
23839,
21745,
11,
6873,
3712,
32978,
8,
198,
4372,
78,
417,
19795,
19795,
796,
685,
16793,
13,
33643,
26,
657,
26,... | 1.942511 | 661 |
<reponame>KlausC/AstroTime.jl<filename>src/AstroDates.jl
module AstroDates
import Dates
import Dates: year, month, day,
hour, minute, second, millisecond,
yearmonthday, dayofyear
const J2000 = 2.4515445e6
abstract type Calendar end
struct ProlepticJulianCalendar <: Calendar end
struct JulianCalendar <: Cal... | [
27,
7856,
261,
480,
29,
42,
38024,
34,
14,
32,
20661,
7575,
13,
20362,
27,
34345,
29,
10677,
14,
32,
20661,
35,
689,
13,
20362,
198,
21412,
35167,
35,
689,
198,
198,
11748,
44712,
198,
11748,
44712,
25,
614,
11,
1227,
11,
1110,
11... | 2.279856 | 3,902 |
using HorizonSideRobots
include("../basics.jl")
md"""
task_3 c перегородками
"""
include("../task_3/solution.jl")
"""Решение задачи 16"""
function solve_16!(r)
solve_problem_3!(r)
end
| [
3500,
22776,
24819,
14350,
1747,
198,
17256,
7203,
40720,
12093,
873,
13,
20362,
4943,
628,
198,
9132,
37811,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4876,
62,
18,
269,
12466,
123,
16843,
21169,
16843,
140,
111,
15... | 1.855856 | 111 |
# brick wall scanning for a single MERA layer with treatment to the tail
function correlation_matrix_to_gmps_brickwall_tailed(
Λ0::AbstractMatrix{ElT},
inds::Vector{Int};
eigval_cutoff::Float64=1e-8,
maxblocksize::Int=size(Λ0, 1),
) where {ElT<:Number}
Λ = Hermitian(Λ0)
N = size(Λ, 1)
V = Circuit{ElT}([])... | [
2,
17214,
3355,
21976,
329,
257,
2060,
34482,
32,
7679,
351,
3513,
284,
262,
7894,
198,
8818,
16096,
62,
6759,
8609,
62,
1462,
62,
39870,
862,
62,
1671,
624,
11930,
62,
34966,
7,
198,
220,
7377,
249,
15,
3712,
23839,
46912,
90,
9527... | 2.231895 | 2,596 |
<reponame>honzabim/kNN.jl
module TestClassifier
using Test
using kNN
using DataFrames
using RDatasets
using Distances
using StatsBase
using Statistics
iris = dataset("datasets", "iris")
X = collect(convert(Array, iris[1:4])')
y = convert(Array, iris[5])
model = knn(X, y, metric = Euclid... | [
27,
7856,
261,
480,
29,
71,
13569,
397,
320,
14,
74,
6144,
13,
20362,
198,
21412,
6208,
9487,
7483,
198,
197,
3500,
6208,
198,
197,
3500,
479,
6144,
198,
197,
3500,
6060,
35439,
198,
220,
220,
220,
1262,
371,
27354,
292,
1039,
198,
... | 2.238095 | 294 |
<filename>src/Ravana.jl
#__precompile__()
module Ravana
# Module Initializer
function __init__()
init_raft()
end
# Source Files
include("Utils.jl")
include("CoreOps.jl")
include("Raft.jl")
include("ProtocolServer.jl")
include("Server.jl")
# Exported
export raft_client, init_cluster
# Deprecated
end # module ... | [
27,
34345,
29,
10677,
14,
49,
615,
2271,
13,
20362,
198,
2,
834,
3866,
5589,
576,
834,
3419,
198,
198,
21412,
28146,
2271,
628,
198,
2,
19937,
20768,
7509,
198,
8818,
11593,
15003,
834,
3419,
198,
220,
220,
220,
2315,
62,
1617,
3419... | 2.771186 | 118 |
#=
Afft.jl
2019-07-07, <NAME>, University of Michigan
2020-06-30 in-place fft!
=#
export Afft
# using MIRT: embed!, getindex!
using LinearMapsAA: LinearMapAA, LinearMapAM, LinearMapAO
using FFTW: fft!, bfft!
"""
A = Afft(samp::AbstractArray{Bool} ; T::DataType = ComplexF32)
Make a LinearMapAO object for (under-... | [
2,
28,
198,
35191,
83,
13,
20362,
198,
23344,
12,
2998,
12,
2998,
11,
1279,
20608,
22330,
2059,
286,
7055,
198,
42334,
12,
3312,
12,
1270,
287,
12,
5372,
277,
701,
0,
198,
46249,
198,
198,
39344,
6708,
83,
198,
198,
2,
1262,
337,
... | 2.241667 | 600 |
# TODO: Rename this file
using Plots
using DSP
using FFTW
include("NoiseWaveform.jl")
"""
write_binary_file(data,filename,dtype)
# Arguments
- `data`: Data to be saved
- `filename::String`: Name of the file to be saved (path relative to current directory)
- `dtype::DataType`: Data type of the data to be saved
... | [
2,
16926,
46,
25,
7152,
480,
428,
2393,
198,
198,
3500,
1345,
1747,
198,
3500,
360,
4303,
198,
3500,
376,
9792,
54,
198,
17256,
7203,
2949,
786,
39709,
687,
13,
20362,
4943,
198,
198,
37811,
198,
13564,
62,
39491,
62,
7753,
7,
7890,... | 2.784708 | 497 |
<filename>src/cuda/cuda.jl
module CUDA
using ..CuArrays
using Pkg.TOML
function version_check()
minor_version = 9
project = joinpath(dirname(pathof(CuArrays)), "../Project.toml")
project = TOML.parse(String(read(project)))
version = VersionNumber(get(project, "version", "0.0.0"))
if !(version.major == 0 && ... | [
27,
34345,
29,
10677,
14,
66,
15339,
14,
66,
15339,
13,
20362,
198,
21412,
29369,
5631,
198,
198,
3500,
11485,
46141,
3163,
20477,
198,
3500,
350,
10025,
13,
51,
2662,
43,
198,
198,
8818,
2196,
62,
9122,
3419,
198,
220,
4159,
62,
96... | 2.581006 | 358 |
using Documenter
using WiSARD
# Set up to run docstrings with jldoctest
DocMeta.setdocmeta!(
WiSARD, :DocTestSetup, :(using WiSARD); recursive=true
)
makedocs(;
modules=[WiSARD],
doctest=true,
clean=true,
format=Documenter.HTML(
assets = ["assets/extra_styles.css", "assets/favicon.ico"],
... | [
3500,
16854,
263,
198,
3500,
11759,
50,
9795,
198,
198,
2,
5345,
510,
284,
1057,
2205,
37336,
351,
474,
335,
38441,
395,
198,
23579,
48526,
13,
2617,
15390,
28961,
0,
7,
198,
220,
220,
220,
11759,
50,
9795,
11,
1058,
23579,
14402,
4... | 2.147059 | 306 |
using Quaternions
using LinearAlgebra
using Random
using Test
@testset "Octonion" begin
@testset "type aliases" begin
@test OctonionF16 === Octonion{Float16}
@test OctonionF32 === Octonion{Float32}
@test OctonionF64 === Octonion{Float64}
end
@testset "Constructors" begin
@t... | [
3500,
2264,
9205,
507,
198,
3500,
44800,
2348,
29230,
198,
3500,
14534,
198,
3500,
6208,
198,
198,
31,
9288,
2617,
366,
12349,
261,
295,
1,
2221,
198,
220,
220,
220,
2488,
9288,
2617,
366,
4906,
47217,
1,
2221,
198,
220,
220,
220,
2... | 1.645374 | 11,663 |
# This file was formerly a part of Julia. License is MIT: https://julialang.org/license
include("ZMQCM.jl")
start_broker()
| [
2,
770,
2393,
373,
15734,
257,
636,
286,
22300,
13,
13789,
318,
17168,
25,
3740,
1378,
73,
377,
498,
648,
13,
2398,
14,
43085,
198,
198,
17256,
7203,
57,
49215,
24187,
13,
20362,
4943,
198,
9688,
62,
7957,
6122,
3419,
198
] | 3.02439 | 41 |
<reponame>Ianlmgoddard/UKCarbonIntensityData.jl
"""
get_carbon_intensity(start_date::ZonedDateTime, end_date::ZonedDateTime)
Returns a DataFrame of the nationwide forecast and actual carbon intensity between the
given `start_date` and `end_date`.
"""
function get_carbon_intensity(start_date::ZonedDateTime, end_dat... | [
27,
7856,
261,
480,
29,
37776,
75,
11296,
5088,
446,
14,
15039,
9914,
4189,
5317,
6377,
6601,
13,
20362,
198,
37811,
198,
220,
220,
220,
651,
62,
29255,
62,
47799,
7,
9688,
62,
4475,
3712,
57,
12004,
10430,
7575,
11,
886,
62,
4475,
... | 2.614304 | 2,349 |
<reponame>JKSano/netgameproj
using DataStructures
abstract gameState
abstract function draw(g::gameState,dt::Real)
abstract function update(g::gameState,dt::Real)
abstract function handleInput(g::gameState)
type game
stack::Stack
window
end
abstract function pushState(g::game,state::gameState)
abstract func... | [
27,
7856,
261,
480,
29,
41,
27015,
5733,
14,
3262,
6057,
1676,
73,
198,
3500,
6060,
44909,
942,
198,
198,
397,
8709,
983,
9012,
198,
198,
397,
8709,
2163,
3197,
7,
70,
3712,
6057,
9012,
11,
28664,
3712,
15633,
8,
198,
397,
8709,
2... | 3.078431 | 153 |
<reponame>JuliaGraphics/Immerse.jl
# module DisplayGadfly
#using GtkUtilities, ..Graphics, Colors
# import Gadfly, Compose, Gtk
import Gadfly: Plot, Aesthetics, Coord.Cartesian
import Gtk: GtkCanvas, showall
# import ..Immerse
# import ..Immerse: absolute_to_data, find_tagged, setproperty!
# export
# Figure,
# ... | [
27,
7856,
261,
480,
29,
16980,
544,
18172,
14,
3546,
647,
325,
13,
20362,
198,
2,
8265,
16531,
38,
324,
12254,
198,
198,
2,
3500,
402,
30488,
18274,
2410,
11,
11485,
18172,
11,
29792,
198,
198,
2,
1330,
20925,
12254,
11,
3082,
577,
... | 2.196229 | 7,425 |
<gh_stars>10-100
# enable type inference for constructor
Linear(::Type{T}, ::Type{I}, weight::W, bias::B) where {T, I, W, B} =
Linear{T, W, B, I}(weight, bias, zeros(weight), bias === nothing ? nothing : zeros(bias))
Linear(weight::WeightType{T}, bias::BiasType{T}; nbatch=1) where {T} =
Linear(T, linear_input_... | [
27,
456,
62,
30783,
29,
940,
12,
3064,
198,
2,
7139,
2099,
32278,
329,
23772,
198,
14993,
451,
7,
3712,
6030,
90,
51,
5512,
7904,
6030,
90,
40,
5512,
3463,
3712,
54,
11,
10690,
3712,
33,
8,
810,
1391,
51,
11,
314,
11,
370,
11,
... | 2.398252 | 801 |
<gh_stars>10-100
# GGGenome
# ======
#
# APIs for GGGenome.
#
# This file is a part of BioJulia.
# License is MIT: https://github.com/BioJulia/BioServices.jl/blob/master/LICENSE.md
"""
GGGenome module.
The `GGGenome` module provides a programming interface to GGGenome,
an ultrafast DNA sequence search service, hoste... | [
27,
456,
62,
30783,
29,
940,
12,
3064,
198,
2,
402,
11190,
268,
462,
198,
2,
29335,
28,
198,
2,
198,
2,
23113,
329,
402,
11190,
268,
462,
13,
198,
2,
198,
2,
770,
2393,
318,
257,
636,
286,
16024,
16980,
544,
13,
198,
2,
13789,... | 2.400442 | 1,808 |
<filename>Chapter01/chapter-1.jl
# simple print statement
println("Hello World")
# julia REPL can be used as a calculator
4+11
# simple function to print hello world
function helloworld()
println("Hello world from chapter-1.jl")
end
helloworld()
# include hello.jl
include("hello.jl")
# helloworld from hello.jl... | [
27,
34345,
29,
14126,
486,
14,
43582,
12,
16,
13,
20362,
198,
2,
2829,
3601,
2643,
198,
35235,
7203,
15496,
2159,
4943,
198,
198,
2,
474,
43640,
45285,
460,
307,
973,
355,
257,
28260,
198,
19,
10,
1157,
198,
198,
2,
2829,
2163,
28... | 3.180952 | 105 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.