content stringlengths 6 1.03M | input_ids listlengths 4 535k | ratio_char_token float64 0.68 8.61 | token_count int64 4 535k |
|---|---|---|---|
nn = 20
tot = collect(1:nn)
trnidx = view(tot, [1,3,6,9,10,11,12,13,14,15,19])
res
| [
20471,
796,
1160,
198,
83,
313,
796,
2824,
7,
16,
25,
20471,
8,
198,
2213,
77,
312,
87,
796,
1570,
7,
83,
313,
11,
685,
16,
11,
18,
11,
21,
11,
24,
11,
940,
11,
1157,
11,
1065,
11,
1485,
11,
1415,
11,
1314,
11,
1129,
12962,
... | 1.647059 | 51 |
# SPD-License-Identifier: MIT
using ArgParse
using JLD2
using MarkovModels
using TOML
function parse_commandline()
s = ArgParseSettings()
@add_arg_table s begin
"topology"
required = true
help = "hmm topology in TOML format"
"units"
required = true
... | [
2,
30628,
12,
34156,
12,
33234,
7483,
25,
17168,
198,
198,
3500,
20559,
10044,
325,
198,
3500,
449,
11163,
17,
198,
3500,
2940,
709,
5841,
1424,
198,
3500,
41526,
43,
198,
198,
8818,
21136,
62,
21812,
1370,
3419,
198,
220,
220,
220,
... | 2.116711 | 1,131 |
# This file was generated by the Julia Swagger Code Generator
# Do not modify this file directly. Modify the swagger specification instead.
mutable struct IoK8sApiCoreV1SELinuxOptions <: SwaggerModel
level::Any # spec type: Union{ Nothing, String } # spec name: level
role::Any # spec type: Union{ Nothing, Str... | [
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,
76,
18187,
2878,
27853,
42,
23,
82,
32,
14415,
14055,
53,
16,
... | 2.579075 | 822 |
<reponame>kernelmethod/HTTP.jl
using Test
using HTTP
using HTTP.IOExtras, HTTP.Sockets
using Sockets
@testset "websockets.jl" begin
p = 8085 # rand(8000:8999)
socket_type = ["wss", "ws"]
function listen_localhost()
@async HTTP.listen(Sockets.localhost, p) do http
if HTTP.WebSockets.is_... | [
27,
7856,
261,
480,
29,
33885,
24396,
14,
40717,
13,
20362,
198,
3500,
6208,
198,
3500,
14626,
198,
3500,
14626,
13,
9399,
11627,
8847,
11,
14626,
13,
50,
11603,
198,
3500,
311,
11603,
198,
198,
31,
9288,
2617,
366,
732,
1443,
11603,
... | 1.840998 | 1,283 |
# Use baremodule to shave off a few KB from the serialized `.ji` file
baremodule OpenLSTO_jll
using Base
using Base: UUID
import JLLWrappers
JLLWrappers.@generate_main_file_header("OpenLSTO")
JLLWrappers.@generate_main_file("OpenLSTO", UUID("a318411f-452f-5433-884b-1f6a35676cea"))
end # module OpenLSTO_jll
| [
2,
5765,
6247,
21412,
284,
34494,
572,
257,
1178,
14204,
422,
262,
11389,
1143,
4600,
13,
7285,
63,
2393,
198,
49382,
21412,
4946,
43,
2257,
46,
62,
73,
297,
198,
3500,
7308,
198,
3500,
7308,
25,
471,
27586,
198,
11748,
449,
3069,
3... | 2.48 | 125 |
<filename>src/Functors.jl
module Functors
using MacroTools
export @functor, fmap, fmapstructure, fcollect
include("functor.jl")
end # module
| [
27,
34345,
29,
10677,
14,
24629,
5217,
13,
20362,
198,
21412,
11138,
5217,
198,
198,
3500,
42755,
33637,
198,
198,
39344,
2488,
12543,
2715,
11,
277,
8899,
11,
277,
8899,
301,
5620,
11,
277,
33327,
198,
198,
17256,
7203,
12543,
2715,
... | 2.9 | 50 |
cd(@__DIR__)
using Pkg
Pkg.activate(".")
Pkg.instantiate()
module TestModule
export plusOne, multiply # functions, structs, and other objects that will be directly available once `using ModuleName` is typed
plusOne(x) = x + 1
multiply(x,y) = x * y
end
using .TestModule
plusOne(1.0)
plusOne(1)
multiply(2,3)
inc... | [
198,
10210,
7,
31,
834,
34720,
834,
8,
198,
3500,
350,
10025,
198,
47,
10025,
13,
39022,
7203,
19570,
198,
47,
10025,
13,
8625,
415,
9386,
3419,
198,
198,
21412,
6208,
26796,
198,
39344,
5556,
3198,
11,
29162,
1303,
5499,
11,
2878,
... | 2.79558 | 181 |
<filename>src/newton_method_ad.jl
##### NewtonsMethodAD
export NewtonsMethodAD
"""
NewtonsMethodAD(f!::F!, x_init::A) where {F!, A <: AbstractArray}
A non-linear system of equations type.
# Fields
$(DocStringExtensions.FIELDS)
"""
struct NewtonsMethodAD{FT, F!, A, JA} <: AbstractNonlinearSolverMethod{FT}
"F... | [
27,
34345,
29,
10677,
14,
3605,
1122,
62,
24396,
62,
324,
13,
20362,
198,
4242,
2,
968,
27288,
17410,
2885,
198,
198,
39344,
968,
27288,
17410,
2885,
198,
198,
37811,
198,
220,
220,
220,
968,
27288,
17410,
2885,
7,
69,
0,
3712,
37,
... | 1.8058 | 1,138 |
# Methods for accessing Cartesian Tuple metadata.
Base.summary(t::CartesianTuple{N,T,U}) where {N,T,U} = "$(N)-dimensional $(T) $(name(U))"
Base.show(io::IO, t::CartesianTuple) = print(io, "$(summary(t)) $(t.coordinates)")
# Iteration, indexing, and field access.
Base.iterate(t::CartesianTuple, state...) = iterate(t... | [
2,
25458,
329,
22534,
13690,
35610,
309,
29291,
20150,
13,
198,
198,
14881,
13,
49736,
7,
83,
3712,
43476,
35610,
51,
29291,
90,
45,
11,
51,
11,
52,
30072,
810,
1391,
45,
11,
51,
11,
52,
92,
796,
17971,
7,
45,
13219,
19577,
29568,... | 2.213178 | 1,032 |
<filename>toy_nlp_tools/idf.jl<gh_stars>0
struct FileHolder
fileProcessor::Dict{String, Function}
FileHolder(processor::Dict{String, Function}) = new(processor)
end
function FileHolder(filenames::Vector{String})
processor(line::String) = split(line, ' ')
FileHolder(Dict{String, Function}(filename => p... | [
27,
34345,
29,
83,
726,
62,
21283,
79,
62,
31391,
14,
312,
69,
13,
20362,
27,
456,
62,
30783,
29,
15,
198,
7249,
9220,
39,
19892,
198,
220,
220,
220,
2393,
18709,
273,
3712,
35,
713,
90,
10100,
11,
15553,
92,
628,
220,
220,
220,... | 2.356877 | 807 |
<filename>test/runtests.jl<gh_stars>0
using Pda
using Test
@testset "Pda.jl" begin
# Write your tests here.
end
| [
27,
34345,
29,
9288,
14,
81,
2797,
3558,
13,
20362,
27,
456,
62,
30783,
29,
15,
198,
3500,
350,
6814,
198,
3500,
6208,
198,
198,
31,
9288,
2617,
366,
47,
6814,
13,
20362,
1,
2221,
198,
220,
220,
220,
1303,
19430,
534,
5254,
994,
... | 2.4375 | 48 |
<reponame>alejandroclaro/Cryptography.jl
#
# @description Unit tests for RC4 stream-cipher.
#
# @author <NAME> (<EMAIL>)
#
# Copyright 2017 All rights reserved.
# Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.
#
@testset "RC4 cipher tests" begin
cipher = Rc4... | [
27,
7856,
261,
480,
29,
1000,
47983,
565,
12022,
14,
23919,
4867,
13,
20362,
198,
2,
201,
198,
2,
2488,
11213,
11801,
5254,
329,
13987,
19,
4269,
12,
66,
10803,
13,
201,
198,
2,
201,
198,
2,
2488,
9800,
1279,
20608,
29,
38155,
276... | 2.128947 | 380 |
using Plots
pyplot() # Use PyPlot as a backend (may already be the default)
#x = collect(1:7)
#y = []
#for item in x
#push!(y, 2 - 2*item + item^2/4)
#end
#plot(x,y)
#plot!(x, y, marker = :diamond, linewidth=2)
#plot!(title = "Sample plot", leg=false)
x = [1 2 3 4 5 6]'
#y = (x-3).^2/4
y = []
for item in x
... | [
3500,
1345,
1747,
198,
9078,
29487,
3419,
1303,
5765,
9485,
43328,
355,
257,
30203,
357,
11261,
1541,
307,
262,
4277,
8,
198,
198,
2,
87,
796,
2824,
7,
16,
25,
22,
8,
198,
2,
88,
796,
17635,
198,
198,
2,
1640,
2378,
287,
2124,
1... | 2.188341 | 223 |
import DataFrames
"""
"""
function fit!(
transformer::ImmutablePredictionsSingleLabelInt2StringTransformer,
varargs...;
kwargs...
)
if length(varargs) == 1
return varargs[1]
else
return varargs
end
end
"""
"""
function predict(
transformer::Immutable... | [
11748,
6060,
35439,
198,
198,
37811,
198,
37811,
198,
8818,
4197,
0,
7,
198,
220,
220,
220,
220,
220,
220,
220,
47385,
3712,
24675,
18187,
39156,
9278,
28008,
33986,
5317,
17,
10100,
8291,
16354,
11,
198,
220,
220,
220,
220,
220,
220,... | 2.298883 | 716 |
function chop_sections(set1, set2, n :: Integer, spacing = "cosine"; flip = false)
if lowercase(spacing) == "uniform"
space = uniform_spacing(0., 1., n + 1)
elseif lowercase(spacing) == "sine"
space = sine_spacing(0., 1., (n + 1) * ifelse(flip, -1, 1))
else
space = cosine_spacing(0.5... | [
8818,
30506,
62,
23946,
7,
2617,
16,
11,
900,
17,
11,
299,
7904,
34142,
11,
31050,
796,
366,
6966,
500,
8172,
14283,
796,
3991,
8,
198,
220,
220,
220,
611,
2793,
7442,
7,
2777,
4092,
8,
6624,
366,
403,
6933,
1,
198,
220,
220,
22... | 2.420613 | 718 |
<filename>hsic.jl
using LinearAlgebra
using Distances
# unittest performance
# versus python hsic_varioustests_npy.py unittest:
# 20sec elapsed / 52sec user (i.e. multithreaded)
# using distmat1: 10.3sec
# using Distances.jl pairwise 13.2sec
# using distmatvec: 10.7sec
# performance discussion see https://discours... | [
27,
34345,
29,
11994,
291,
13,
20362,
198,
3500,
44800,
2348,
29230,
198,
3500,
4307,
1817,
198,
198,
2,
555,
715,
395,
2854,
198,
2,
9051,
21015,
289,
21383,
62,
25641,
23968,
3558,
62,
77,
9078,
13,
9078,
555,
715,
395,
25,
198,
... | 2.048428 | 1,590 |
using Cosmology
using Test, Unitful, UnitfulAstro, QuadGK
# values from http://icosmos.co.uk/
dist_rtol = 1e-6
age_rtol = 2e-4
# Integrating a unitful function would require UnitfulIntegration.jl. Without using it, we
# strip the units away from the integrand function
integrand(c, z) = 4pi*ustrip(comoving_volume_ele... | [
3500,
10437,
29126,
198,
3500,
6208,
11,
11801,
913,
11,
11801,
913,
32,
20661,
11,
20648,
38,
42,
198,
198,
2,
3815,
422,
2638,
1378,
291,
418,
16785,
13,
1073,
13,
2724,
14,
198,
198,
17080,
62,
17034,
349,
796,
352,
68,
12,
21,... | 1.908986 | 4,329 |
# Libraries
include("./get_h10_dataset.jl");
using MessyTimeSeriesOptim;
using FileIO, JLD;
using Random, Statistics;
#=
Load arguments passed through the command line
=#
# VAR or VMA
is_var = parse(Bool, ARGS[1]);
log_folder_path = ARGS[2];
#=
Load benchmark grid of candidates from any run
=#
candidates = load(".... | [
2,
46267,
198,
17256,
7,
1911,
14,
1136,
62,
71,
940,
62,
19608,
292,
316,
13,
20362,
15341,
198,
3500,
10626,
88,
7575,
27996,
27871,
320,
26,
198,
3500,
9220,
9399,
11,
449,
11163,
26,
198,
3500,
14534,
11,
14370,
26,
198,
198,
... | 2.696 | 1,375 |
module KhepriRadiance
using KhepriBase
# functions that need specialization
include(khepribase_interface_file())
include("Radiance.jl")
function __init__()
set_material(radiance, material_basic, radiance_material_neutral)
set_material(radiance, material_metal, radiance_generic_metal)
set_material(radiance, mate... | [
21412,
48888,
3448,
15546,
3610,
198,
3500,
48888,
3448,
14881,
198,
198,
2,
5499,
326,
761,
43135,
198,
17256,
7,
74,
258,
79,
822,
589,
62,
39994,
62,
7753,
28955,
198,
17256,
7203,
15546,
3610,
13,
20362,
4943,
198,
198,
8818,
1159... | 3.149485 | 194 |
@system VaporPressure begin
# Campbell and Norman (1998), p 41 Saturation vapor pressure in kPa
a => 0.611 ~ preserve(u"kPa", parameter)
b => 17.502 ~ preserve(parameter)
c => 240.97 ~ preserve(parameter) # °C
es(a, b, c; T(u"°C")): saturation => (t = Cropbox.deunitfy(T); a*exp((b*t)/(c+t))) ~ call... | [
31,
10057,
43382,
13800,
495,
2221,
198,
220,
220,
220,
1303,
14327,
290,
19636,
357,
21113,
828,
279,
6073,
311,
36921,
20199,
3833,
287,
479,
28875,
198,
220,
220,
220,
257,
5218,
657,
13,
21,
1157,
5299,
12201,
7,
84,
1,
74,
2887... | 2.149144 | 409 |
# __precompile__()
module LightDarkPOMDPs
importall POMDPs
using StaticArrays
using Plots
using POMDPToolbox
using Parameters # for @with_kw
using ParticleFilters # for AbstractParticleBelief
export
AbstractLD2,
LightDark2D,
LightDark2DTarget,
LightDark2DKalman,
SymmetricNormal2,
Vec2
incl... | [
2,
11593,
3866,
5589,
576,
834,
3419,
198,
198,
21412,
4401,
17367,
47,
2662,
6322,
82,
198,
198,
11748,
439,
350,
2662,
6322,
82,
198,
198,
3500,
36125,
3163,
20477,
198,
3500,
1345,
1747,
198,
3500,
350,
2662,
6322,
25391,
3524,
198... | 2.610465 | 172 |
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Desription
# ==============================================================================
#
# Tests related to conversion from Euler angles to quaternion.
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #... | [
2,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
... | 1.845088 | 2,453 |
export Grid, δx, δy, δz, δ, x, y, z, x⃗, xc, yc, zc, x⃗c, N, g⃗, _fftaxes, Nranges, ∫
struct Grid{ND,T}
Δx::T
Δy::T
Δz::T
Nx::Int
Ny::Int
Nz::Int
end
Grid(Δx::T, Δy::T, Δz::T, Nx::Int, Ny::Int, Nz::Int) where {T<:Real} = Grid{3,T}(
Δx,
Δy,
Δz,
Nx,
Ny,
Nz,
)
Grid(Δx::T, Δy::T, Nx::... | [
39344,
24846,
11,
7377,
112,
87,
11,
7377,
112,
88,
11,
7377,
112,
89,
11,
7377,
112,
11,
2124,
11,
331,
11,
1976,
11,
2124,
158,
225,
245,
11,
2124,
66,
11,
331,
66,
11,
1976,
66,
11,
2124,
158,
225,
245,
66,
11,
399,
11,
3... | 1.692449 | 2,185 |
<reponame>isrlab/Multibody-Dynamics<filename>UdKaDyn/Examples/testGimbal.jl
# To test a simplified 2 axis gimbal.
# Modeling the system as a cube and the gimbal placed on top.
# We need two revolute joints between the cube and gimbal.
include("../src/plotSol.jl")
include("../src/simulate.jl")
include("../src/Orientati... | [
27,
7856,
261,
480,
29,
271,
81,
23912,
14,
15205,
571,
1118,
12,
35,
4989,
873,
27,
34345,
29,
52,
67,
37281,
35,
2047,
14,
27730,
14,
9288,
38,
320,
6893,
13,
20362,
198,
2,
1675,
1332,
257,
27009,
362,
16488,
308,
320,
6893,
... | 1.893276 | 1,874 |
<reponame>UnofficialJuliaMirror/Octo.jl-16905944-f982-529b-abb2-b839f98f160b
module test_octo_as
using Test
using Octo.Adapters.SQL # from to_sql
@test to_sql([as(AVG(:n), :avg_n)]) == "AVG(n) AS avg_n"
struct User
end
u = from(User)
n = as(u.name, :n)
@test to_sql([n]) == "name AS n"
end # module test_octo_as
| [
27,
7856,
261,
480,
29,
3118,
16841,
16980,
544,
27453,
1472,
14,
12349,
78,
13,
20362,
12,
22172,
46712,
2598,
12,
69,
4089,
17,
12,
49721,
65,
12,
6485,
17,
12,
65,
23,
2670,
69,
4089,
69,
14198,
65,
198,
21412,
1332,
62,
38441,... | 2.064935 | 154 |
using AppliSales
using Test
@testset "AppliSales.jl" begin
orders = process()
first_order = orders[1]
second_order = orders[2]
@test length(orders) == 3
@test first_order.org.name == "Scrooge Investment Bank"
@test first_order.contact_name == "<NAME>"
@test length(second_order.students) =... | [
3500,
2034,
4528,
44490,
198,
3500,
6208,
198,
198,
31,
9288,
2617,
366,
4677,
4528,
44490,
13,
20362,
1,
2221,
198,
220,
220,
220,
6266,
796,
1429,
3419,
198,
220,
220,
220,
717,
62,
2875,
796,
6266,
58,
16,
60,
198,
220,
220,
22... | 2.669014 | 142 |
<reponame>ericjang/CircularArrays.jl
type CircularArray{T,N}
data::AbstractArray{T,N}
cdim::Integer # dimension to cycle along
cl::Integer # size of cycle dimension
head::Integer # starting point of the array
end
# CONSTRUCTORS
function CircularArray(A,cdim)
if cdim > ndims(A)
error("A does not have enough dim... | [
27,
7856,
261,
480,
29,
35626,
73,
648,
14,
31560,
934,
3163,
20477,
13,
20362,
198,
4906,
7672,
934,
19182,
90,
51,
11,
45,
92,
198,
197,
7890,
3712,
23839,
19182,
90,
51,
11,
45,
92,
198,
197,
10210,
320,
3712,
46541,
1303,
1579... | 2.659817 | 438 |
<filename>test/extract_domain_polyopt.jl
# Test for the example https://github.com/JuliaOpt/SumOfSquares.jl/blob/master/examples/Polynomial_Optimization.ipynb
using JuMP
using SumOfSquares
using MultivariateMoments
@testset "Polynomial Optimization example with $(factory.constructor)" for factory in sdp_factories
... | [
27,
34345,
29,
9288,
14,
2302,
974,
62,
27830,
62,
35428,
8738,
13,
20362,
198,
2,
6208,
329,
262,
1672,
3740,
1378,
12567,
13,
785,
14,
16980,
544,
27871,
14,
13065,
5189,
22266,
3565,
13,
20362,
14,
2436,
672,
14,
9866,
14,
1069,
... | 1.971391 | 769 |
using LTC
using Plots
gr()
using BenchmarkTools
using DiffEqSensitivity
using OrdinaryDiffEq
using DiffEqFlux
using GalacticOptim
using Juno
using Cthulhu
using Profile
#using PProf
function generate_data()
in_features = 2
out_features = 1
N = 48
data_x = [sin.(range(0,stop=3π,length=N)), cos.(range(0,... | [
3500,
406,
4825,
198,
3500,
1345,
1747,
198,
2164,
3419,
198,
3500,
25187,
4102,
33637,
198,
3500,
10631,
36,
80,
50,
40545,
198,
3500,
14230,
3219,
28813,
36,
80,
198,
3500,
10631,
36,
80,
37,
22564,
198,
3500,
23509,
27871,
320,
198... | 2.129502 | 4,193 |
<filename>src/filetypes/cd.jl<gh_stars>0
function DataFrames.rename!(df, ::DataFile{Val{Symbol("C&D")}})
namemap = Dict("WE(1).Potential (V)"=>"Potential (V)",
"Time (s)"=>"Other Time (s)",
"Corrected time (s)"=>"Time (s)")
rename!(df, namemap)
end
function find_pair(dataf... | [
27,
34345,
29,
10677,
14,
7753,
19199,
14,
10210,
13,
20362,
27,
456,
62,
30783,
29,
15,
198,
8818,
6060,
35439,
13,
918,
480,
0,
7,
7568,
11,
7904,
6601,
8979,
90,
7762,
90,
13940,
23650,
7203,
34,
5,
35,
4943,
11709,
8,
198,
2... | 1.910861 | 1,335 |
# ==========================================
# Cell - a single piece of table data
# ==========================================
"""
A `Cell` is a single piece of data annotated by a column name
"""
immutable Cell{Name, ElType}
data::ElType
function Cell{T}(x::T)
check_Cell(Val{Name},ElType)
... | [
2,
46111,
2559,
28,
198,
2,
220,
220,
220,
12440,
532,
257,
2060,
3704,
286,
3084,
1366,
198,
2,
46111,
2559,
28,
198,
198,
37811,
198,
32,
4600,
28780,
63,
318,
257,
2060,
3704,
286,
1366,
24708,
515,
416,
257,
5721,
1438,
198,
3... | 2.448485 | 1,320 |
export Portfolio
function Portfolio(cbmo::Float64,mu::Vector,
Q::Any,u::Vector{Float64},
kappa::Int64,z0::Vector{Float64}
;relax::Function=NL,
t::Float64=0.0,
n::Int64=5,
tol::Float64=1e-6)
c1=z->sum(z[1:n]);lc1=1.0;uc1=1.0;
c2=z-... | [
39344,
4347,
13652,
198,
198,
8818,
4347,
13652,
7,
21101,
5908,
3712,
43879,
2414,
11,
30300,
3712,
38469,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1195,
3712,
7149,
11,
84,... | 1.551417 | 1,235 |
function code_js(ex, A)
cinfo = code_lowered(ex, A)[1]
restructure(cinfo.code)
end
macro code_js(ex)
isexpr(ex, :call) || error("@code_wasm f(xs...)")
:(code_js($(esc(ex.args[1])), Tuple{$(map(_ -> Any, ex.args[2:end])...)}))
end
| [
8818,
2438,
62,
8457,
7,
1069,
11,
317,
8,
198,
220,
269,
10951,
796,
2438,
62,
9319,
1068,
7,
1069,
11,
317,
38381,
16,
60,
198,
220,
1334,
5620,
7,
66,
10951,
13,
8189,
8,
198,
437,
198,
198,
20285,
305,
2438,
62,
8457,
7,
1... | 2.153153 | 111 |
<gh_stars>0
# ---
# title: 1003. Check If Word Is Valid After Substitutions
# id: problem1003
# author: <NAME>
# date: 2020-10-31
# difficulty: Medium
# categories: String, Stack
# link: <https://leetcode.com/problems/check-if-word-is-valid-after-substitutions/description/>
# hidden: true
# ---
#
# Given a string `s`,... | [
27,
456,
62,
30783,
29,
15,
198,
2,
11420,
198,
2,
3670,
25,
1802,
18,
13,
6822,
1002,
9678,
1148,
48951,
2293,
24944,
270,
3508,
198,
2,
4686,
25,
1917,
3064,
18,
198,
2,
1772,
25,
1279,
20608,
29,
198,
2,
3128,
25,
12131,
12,
... | 2.270341 | 762 |
<gh_stars>10-100
export unary_operators, binary_operators, nary_operators, compute
export AbstractExpression
# Define abstract base type
abstract type AbstractExpression end
# Define Algebraic Operators
include("abstract_operations.jl")
# Define Domains
include("abstract_domains.jl")
# Define Fields
include("abstra... | [
27,
456,
62,
30783,
29,
940,
12,
3064,
198,
39344,
555,
560,
62,
3575,
2024,
11,
13934,
62,
3575,
2024,
11,
299,
560,
62,
3575,
2024,
11,
24061,
198,
39344,
27741,
16870,
2234,
198,
198,
2,
2896,
500,
12531,
2779,
2099,
198,
397,
... | 2.372845 | 928 |
# https://adventofcode.com/2020/day/9
# XMAS starts by transmitting a preamble of 25 numbers. After that, each number
# you receive should be the sum of any two of the 25 immediately previous numbers.
# The two numbers will have different values, and there might be more than one
# such pair.
function is_xmas_seq(num... | [
198,
2,
3740,
1378,
324,
1151,
1659,
8189,
13,
785,
14,
42334,
14,
820,
14,
24,
198,
198,
2,
1395,
31180,
4940,
416,
39573,
257,
662,
321,
903,
286,
1679,
3146,
13,
2293,
326,
11,
1123,
1271,
198,
2,
345,
3328,
815,
307,
262,
21... | 2.343434 | 1,188 |
<reponame>JuliaGPU/VulkanAbstraction<gh_stars>0
is_optional(member::SpecStructMember) = member.name == :pNext || member.requirement ∈ [OPTIONAL, POINTER_OPTIONAL] || is_inferable_length(member)
is_optional(param::SpecFuncParam) = param.requirement ∈ [OPTIONAL, POINTER_OPTIONAL]
"""
Represent an integer that gives the ... | [
27,
7856,
261,
480,
29,
16980,
544,
33346,
14,
53,
31263,
4826,
301,
7861,
27,
456,
62,
30783,
29,
15,
198,
271,
62,
25968,
7,
19522,
3712,
22882,
44909,
27608,
8,
796,
2888,
13,
3672,
6624,
1058,
79,
10019,
8614,
2888,
13,
8897,
... | 2.572072 | 888 |
<gh_stars>1-10
include("params.jl")
include("run_rtaa.jl")
include("run_cmax.jl")
include("run_finite_model_class.jl")
include("run_model_search.jl")
include("run_agnostic_sysid.jl")
include("run_online_model_search.jl")
function mountaincar_all_main()
rtaa_steps = mountaincar_rtaa_main()
cmax_steps = mountain... | [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
17256,
7203,
37266,
13,
20362,
4943,
198,
17256,
7203,
5143,
62,
17034,
7252,
13,
20362,
4943,
198,
17256,
7203,
5143,
62,
66,
9806,
13,
20362,
4943,
198,
17256,
7203,
5143,
62,
69,
9504,
62... | 2.444122 | 689 |
<filename>JuliaBasics.jl
# to create vector, put comma
V = [1, 2, 3, 4, 5, 6]
# to create matrix just add space
V1 = [1 2 3 4 5 6]
# to declare an array just put semicolon
M1 = [1 2 3; 4 5 6; 7 8 9]
# to resahepe vector or matrix just use resahepe()
V3 = [1, 2, 3, 4, 5, 6, 7, 8, 9]
reshape(V3, 3,3) # for vector
M2... | [
27,
34345,
29,
16980,
544,
15522,
873,
13,
20362,
198,
2,
284,
2251,
15879,
11,
1234,
39650,
198,
53,
796,
685,
16,
11,
362,
11,
513,
11,
604,
11,
642,
11,
718,
60,
198,
198,
2,
1849,
1462,
2251,
17593,
655,
751,
2272,
198,
53,
... | 2.13278 | 1,205 |
<filename>src/sum0.jl
function sum0(a)
# create variable to store ouput
out = 0.0
# loop
for i in a
out += i
end
# return
return out
end | [
27,
34345,
29,
10677,
14,
16345,
15,
13,
20362,
198,
8818,
2160,
15,
7,
64,
8,
198,
220,
220,
220,
1303,
2251,
7885,
284,
3650,
267,
929,
315,
198,
220,
220,
220,
503,
796,
657,
13,
15,
628,
220,
220,
220,
1303,
9052,
198,
220,
... | 2.148148 | 81 |
using Test
using NeXLCore
@testset "MIP" begin
@test all(map(z -> isapprox(J(Bloch1933, z) / z, 13.5, rtol = 1.0e-8), 1:99))
@test all(
map(
z -> isapprox(
J(Jensen1937, z) / z,
9.0 * (1.0 + 0.5 * z^(-2.0 / 3.0)),
rtol = 1.0e-8,
),... | [
3500,
6208,
198,
3500,
3169,
55,
5639,
382,
198,
198,
31,
9288,
2617,
366,
44,
4061,
1,
2221,
198,
220,
220,
220,
2488,
9288,
477,
7,
8899,
7,
89,
4613,
318,
1324,
13907,
7,
41,
7,
3629,
5374,
1129,
2091,
11,
1976,
8,
1220,
1976... | 1.496045 | 885 |
# ------------------------------------------------------------------------------------------
# # 多重派发
#
# **多重派发**是这篇notebook要探索的Julia的一个关键特性。
#
# 它有助于快速开发。它也让软件可拓展、可设计和更好把玩。
#
# 它可能是并行计算取得重大突破的预兆。
#
# ## 大纲
# 1. 罗马数字
# 2. 函数
# 3. 并行计算
# ---------------------------------------------------------------------------------... | [
198,
2,
16529,
22369,
438,
198,
2,
1303,
36469,
21253,
229,
235,
162,
112,
122,
20998,
239,
198,
2,
198,
2,
12429,
13783,
21253,
229,
235,
162,
112,
122,
20998,
239,
1174,
42468,
32573,
247,
163,
107,
229,
11295,
2070,
17358,
223,
1... | 2.029293 | 2,970 |
<gh_stars>1-10
module ImageNoise
using Reexport
include("NoiseAPI/NoiseAPI.jl")
include("ApplyNoise/ApplyNoise.jl")
include("ReduceNoise/ReduceNoise.jl")
@reexport using .ApplyNoise
@reexport using .ReduceNoise
end # module
| [
27,
456,
62,
30783,
29,
16,
12,
940,
198,
21412,
7412,
2949,
786,
198,
198,
3500,
797,
39344,
198,
198,
17256,
7203,
2949,
786,
17614,
14,
2949,
786,
17614,
13,
20362,
4943,
198,
17256,
7203,
44836,
2949,
786,
14,
44836,
2949,
786,
... | 2.590909 | 88 |
using CompileBot
snoop_bench(BotConfig("RecipesPipeline"))
| [
3500,
3082,
576,
20630,
198,
198,
82,
3919,
404,
62,
26968,
7,
20630,
16934,
7203,
6690,
18636,
47,
541,
4470,
48774,
198
] | 2.727273 | 22 |
module Synthesize
using Random, Distributions
export musicFromNotes
export Music
export default, flute, flute2, organ
# instrument profiles (just a bunch of random numbers, needs revising)
default = Dict{Rational, Float64}(1 => 1)
flute = Dict{Rational, Float64}(1//2 => 1, 1 => 10^0.7, 2 => 10^0.6, 3 => 10^0.6, 4 =>... | [
21412,
26375,
956,
1096,
198,
198,
3500,
14534,
11,
46567,
507,
198,
198,
39344,
2647,
4863,
16130,
198,
39344,
7849,
198,
39344,
4277,
11,
781,
1133,
11,
781,
1133,
17,
11,
1618,
198,
198,
2,
8875,
16545,
357,
3137,
257,
7684,
286,
... | 2.281931 | 1,284 |
############################################################################################
"""
$(TYPEDEF)
Default arguments for PMCMC constructor.
# Fields
$(TYPEDFIELDS)
"""
struct ParticleGibbs{P<:ParticleFilter,M<:MCMC} <: PMCMCKernel
"Particle Filter kernel to estimate latent trajectory."
pf::P
"MCM... | [
29113,
29113,
14468,
7804,
4242,
198,
37811,
198,
3,
7,
9936,
47,
1961,
25425,
8,
198,
198,
19463,
7159,
329,
3122,
34,
9655,
23772,
13,
198,
198,
2,
23948,
198,
3,
7,
9936,
47,
1961,
11674,
3698,
5258,
8,
198,
37811,
198,
7249,
2... | 2.925433 | 751 |
<gh_stars>0
# ---
# title: 363. Max Sum of Rectangle No Larger Than K
# id: problem363
# author: <NAME>
# date: 2020-10-31
# difficulty: Hard
# categories: Binary Search, Dynamic Programming, Queue
# link: <https://leetcode.com/problems/max-sum-of-rectangle-no-larger-than-k/description/>
# hidden: true
# ---
#
# Given... | [
27,
456,
62,
30783,
29,
15,
198,
2,
11420,
198,
2,
3670,
25,
49327,
13,
5436,
5060,
286,
48599,
9248,
1400,
406,
32270,
17924,
509,
198,
2,
4686,
25,
1917,
35447,
198,
2,
1772,
25,
1279,
20608,
29,
198,
2,
3128,
25,
12131,
12,
9... | 2.559783 | 368 |
<reponame>MattWillFlood/EntropyHub.jl<filename>src/_MSEn.jl<gh_stars>1-10
module _MSEn
export MSEn, EMD
using Statistics: std, mean, median, var
#using DataInterpolations: CubicSpline
using Dierckx: Spline1D
using Plots
#=function __init__()
@warn("\n\n Methodx option IMF (Intrinisic Mode Function) is not stable.
Ran... | [
27,
7856,
261,
480,
29,
13448,
8743,
7414,
702,
14,
14539,
28338,
16066,
13,
20362,
27,
34345,
29,
10677,
47835,
5653,
4834,
13,
20362,
27,
456,
62,
30783,
29,
16,
12,
940,
198,
21412,
4808,
5653,
4834,
198,
39344,
6579,
4834,
11,
4... | 1.982796 | 5,929 |
<reponame>MisterBiggs/BeautifulMakie<filename>_assets/scripts/BoxErrorBarsCmap.jl<gh_stars>100-1000
# by lazarusA # HIDE
#using GLMakie, Random # HIDE
using CairoMakie, Random
CairoMakie.activate!() #HIDE
let
Random.seed!(145)
x, y, yerr = 1:2:20, 5*rand(10), 0.4*abs.(randn(10))
fig = Figure(resolution = (7... | [
27,
7856,
261,
480,
29,
44,
1694,
33,
20340,
14,
38413,
4135,
44,
461,
494,
27,
34345,
29,
62,
19668,
14,
46521,
14,
14253,
12331,
33,
945,
34,
8899,
13,
20362,
27,
456,
62,
30783,
29,
3064,
12,
12825,
198,
2,
416,
37296,
20272,
... | 2.211144 | 341 |
<reponame>ericbdaniels/dash-vtk
# AUTO GENERATED FILE - DO NOT EDIT
export vtk_imagedata
"""
vtk_imagedata(;kwargs...)
vtk_imagedata(children::Any;kwargs...)
vtk_imagedata(children_maker::Function;kwargs...)
An ImageData component.
ImageData is exposing a vtkImageData to a downstream filter
It takes the... | [
27,
7856,
261,
480,
29,
35626,
17457,
3216,
1424,
14,
42460,
12,
85,
30488,
198,
2,
47044,
46,
24700,
1137,
11617,
45811,
532,
8410,
5626,
48483,
198,
198,
39344,
410,
30488,
62,
320,
1886,
1045,
198,
198,
37811,
198,
220,
220,
220,
... | 2.839161 | 572 |
"""
hasconverged(s::ConvergenceState)
Returns true if `s.converged` is true.
"""
hasconverged(s::ConvergenceState) = s.converged
"""
hasconverged(s::Solution)
Returns true if `hasconverged(s.convstate)` is true.
"""
hasconverged(s::Solution) = hasconverged(s.convstate)
"""
```
assess_convergence!(
solution::S... | [
198,
37811,
198,
10134,
1102,
332,
2004,
7,
82,
3712,
3103,
332,
12745,
9012,
8,
198,
198,
35561,
2081,
611,
4600,
82,
13,
1102,
332,
2004,
63,
318,
2081,
13,
198,
37811,
198,
10134,
1102,
332,
2004,
7,
82,
3712,
3103,
332,
12745,
... | 2.02207 | 2,628 |
using MakieLayout
using Makie
using KernelDensity
function kdepoly!(la::LAxis, vec, reverse=false; kwargs...)
kderesult = kde(vec; npoints=32)
x = kderesult.x
y = kderesult.density
if reverse
poly!(la, Point2.(y, x); kwargs...)
else
poly!(la, Point2.(x, y); kwargs...)
end
end... | [
3500,
15841,
494,
32517,
198,
3500,
15841,
494,
198,
3500,
32169,
35,
6377,
628,
198,
8818,
479,
10378,
3366,
0,
7,
5031,
3712,
13534,
87,
271,
11,
43030,
11,
9575,
28,
9562,
26,
479,
86,
22046,
23029,
198,
220,
220,
220,
479,
2934,... | 2.085485 | 1,743 |
module Ripser
export ripser
using SparseArrays: AbstractSparseMatrix, findnz
const depsfile = joinpath(dirname(@__DIR__), "deps", "deps.jl")
if isfile(depsfile)
include("../deps/deps.jl")
else
error("Ripser in not properly installed. Please run Pkg.build(\"Ripser\").")
end
__init__() = check_deps()
# The val... | [
21412,
371,
2419,
263,
198,
39344,
374,
2419,
263,
198,
198,
3500,
1338,
17208,
3163,
20477,
25,
27741,
50,
29572,
46912,
11,
1064,
27305,
198,
198,
9979,
390,
862,
7753,
796,
4654,
6978,
7,
15908,
3672,
7,
31,
834,
34720,
834,
828,
... | 1.91151 | 3,006 |
<reponame>DelMaestroGroup/OperationalEntanglementFreeFermions
module FreeFermionsOEE
using Printf
export
operational_entanglement
include("operational_entanglement.jl")
end
| [
27,
7856,
261,
480,
29,
13856,
21467,
47692,
13247,
14,
18843,
864,
14539,
648,
1732,
11146,
37,
7780,
507,
198,
21412,
3232,
37,
7780,
507,
46,
6500,
198,
198,
3500,
12578,
69,
198,
198,
39344,
198,
220,
220,
220,
13919,
62,
298,
6... | 3 | 60 |
using KitBase, FluxReconstruction, OrdinaryDiffEq, Langevin, LinearAlgebra, Plots
using ProgressMeter: @showprogress
begin
x0 = 0
x1 = 1
ncell = 100
nface = ncell + 1
dx = (x1 - x0) / ncell
deg = 2 # polynomial degree
nsp = deg + 1
γ = 7 / 5
cfl = 0.05
dt = cfl * dx / (2.0)
... | [
3500,
10897,
14881,
11,
1610,
2821,
6690,
261,
15019,
11,
14230,
3219,
28813,
36,
80,
11,
47579,
7114,
11,
44800,
2348,
29230,
11,
1345,
1747,
198,
3500,
18387,
44,
2357,
25,
2488,
12860,
33723,
198,
198,
27471,
198,
220,
220,
220,
21... | 1.585946 | 3,828 |
module ComputationalHomology
using LinearAlgebra
using Hungarian: hungarian
using SmithNormalForm: smith
using Distances: Metric, Euclidean, pairwise, colwise, pairwise!
using Random: shuffle!, randperm
using BoundingSphere: boundingsphere
using SparseArrays: SparseMatrixCSC, spzeros, findnz
using Combinatorics: combi... | [
21412,
22476,
864,
28718,
1435,
198,
198,
3500,
44800,
2348,
29230,
198,
3500,
27304,
25,
9174,
3699,
198,
3500,
4176,
26447,
8479,
25,
895,
342,
198,
3500,
4307,
1817,
25,
3395,
1173,
11,
48862,
485,
272,
11,
5166,
3083,
11,
951,
308... | 2.712974 | 871 |
using Sockets
include("header.jl")
include("strings.jl")
function play_roulette(p :: Player)
result = rand(1:36)
total_bet = 0
winnings = 0
print_dict(p, "roulette_0")
printBalance(p)
print_dict(p, "roulette_1")
while true
print_dict(p, "roulette_2")
s = readline(p.socket)
... | [
3500,
311,
11603,
198,
17256,
7203,
25677,
13,
20362,
4943,
198,
17256,
7203,
37336,
13,
20362,
4943,
198,
198,
8818,
711,
62,
472,
21348,
7,
79,
7904,
7853,
8,
198,
220,
220,
220,
1255,
796,
43720,
7,
16,
25,
2623,
8,
198,
220,
2... | 1.610024 | 2,095 |
using ThreeBodyDecay
using Plots
using Zygote
tbs = let m1 = 0.938, m2 = 0.49367, m3 = 0.13957, m0 = 2.46867
ThreeBodySystem(m1,m2,m3,m0)
end
#
# let
# σ1v = LinRange(tbs.mthsq[1], tbs.sthsq[1],300)
# σ3m = [σ3of1(σ,-1.0,tbs) for σ in σ1v]
# σ3p = [σ3of1(σ, 1.0,tbs) for σ in σ1v]
# plot(σ1v, [σ3m... | [
3500,
7683,
25842,
10707,
323,
198,
3500,
1345,
1747,
198,
3500,
1168,
35641,
1258,
628,
198,
83,
1443,
796,
1309,
285,
16,
796,
657,
13,
24,
2548,
11,
285,
17,
796,
657,
13,
2920,
27824,
11,
285,
18,
796,
657,
13,
20219,
3553,
11... | 1.600355 | 1,689 |
<reponame>Alchemist-yao/Julia4Derivatives
using Random,StatsBase,Distributions,Polynomials
Random.seed!(150000)
#LSM原始算法,针对美式PUT
function LSM_PRIMAL(S0::Float64,K::Float64,T::Float64,r::Float64,σ::Float64,I::Int,M::Int)
"""
# Arguments
- `S0`: 初始标的值.
- `K`: 行权值
- `T`: 到期时间,年为单位
- `r... | [
27,
7856,
261,
480,
29,
2348,
28899,
12,
3972,
78,
14,
16980,
544,
19,
28532,
452,
2929,
198,
3500,
14534,
11,
29668,
14881,
11,
20344,
2455,
507,
11,
34220,
26601,
8231,
201,
198,
29531,
13,
28826,
0,
7,
1314,
2388,
8,
201,
198,
... | 1.259134 | 2,655 |
@testset "testing GoF, multinomial distribution" begin
df = DataFrame(CSV.File(joinpath(dirname(Base.find_package("PhyloNetworks")),"..","examples","buckyCF.csv")), copycols=false)
d0 = readTableCF(df)
d = deepcopy(d0)
net3 = readTopology("((((D:0.4,C:0.4):4.8,((A:0.8,B:0.8):2.2)#H1:2.2::0.7):4.0,(#H1:0::0.3,E:3.0):6.... | [
31,
9288,
2617,
366,
33407,
1514,
37,
11,
1963,
259,
49070,
6082,
1,
2221,
198,
198,
7568,
796,
6060,
19778,
7,
7902,
53,
13,
8979,
7,
22179,
6978,
7,
15908,
3672,
7,
14881,
13,
19796,
62,
26495,
7203,
2725,
2645,
78,
7934,
5225,
... | 2.202299 | 2,610 |
#==========================================================================================#
# INTERFACE
function fit(M::Type{<: OneStageModel}, MD::Microdata; novar::Bool = false, kwargs...)
obj = M(MD; kwargs...)
_fit!(obj, MD.weights)
novar || _vcov!(obj, getcorr(obj), MD.weights)
return obj
end... | [
2,
23926,
4770,
2559,
855,
2,
198,
198,
2,
23255,
49836,
198,
198,
8818,
4197,
7,
44,
3712,
6030,
90,
27,
25,
1881,
29391,
17633,
5512,
10670,
3712,
13031,
7890,
26,
645,
7785,
3712,
33,
970,
796,
3991,
11,
479,
86,
22046,
23029,
... | 2.665706 | 1,041 |
<filename>test/estimate/regime_switching_mh.jl
using DSGE, ModelConstructors, HDF5, Random, FileIO, Test, Dates
writing_output = false
regenerate_sim_data = false
if VERSION < v"1.5"
ver = "111"
else
ver = "150"
end
#########################
# Regime-switching test #
# w/ An-Schorfheide #
###############... | [
27,
34345,
29,
9288,
14,
395,
1920,
14,
2301,
524,
62,
2032,
19811,
62,
76,
71,
13,
20362,
198,
3500,
17400,
8264,
11,
9104,
42316,
669,
11,
5572,
37,
20,
11,
14534,
11,
9220,
9399,
11,
6208,
11,
44712,
198,
198,
16502,
62,
22915,... | 2.308161 | 2,132 |
using SymbolicRegression, Test
include("test_params.jl")
_inv(x::Float32)::Float32 = 1.0f0 / x
X = rand(Float32, 5, 100) .+ 1
y = 1.2f0 .+ 2 ./ X[3, :]
options = SymbolicRegression.Options(;
default_params..., binary_operators=(+, *), unary_operators=(_inv,), npopulations=8
)
hallOfFame = EquationSearch(X, y; nit... | [
3500,
41327,
4160,
8081,
2234,
11,
6208,
198,
17256,
7203,
9288,
62,
37266,
13,
20362,
4943,
198,
198,
62,
16340,
7,
87,
3712,
43879,
2624,
2599,
25,
43879,
2624,
796,
352,
13,
15,
69,
15,
1220,
2124,
198,
55,
796,
43720,
7,
43879,
... | 2.545 | 200 |
"""
Covariance Matrix Adaptation Evolution Strategy Implementation: (μ/μ_I,λ)-CMA-ES
The constructor takes following keyword arguments:
- `μ` is the number of parents
- `λ` is the number of offspring
- `τ` is a time constant for a direction vector `s`
- `τ_c` is a time constant for a covariance matrix `C`
- `τ_σ` is ... | [
37811,
198,
34,
709,
2743,
590,
24936,
30019,
341,
15815,
20561,
46333,
25,
357,
34703,
14,
34703,
62,
40,
11,
39377,
13219,
34,
5673,
12,
1546,
198,
198,
464,
23772,
2753,
1708,
21179,
7159,
25,
198,
198,
12,
4600,
34703,
63,
318,
... | 2.058577 | 1,673 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.