text stringlengths 0 1.25M | meta stringlengths 47 1.89k |
|---|---|
Base.promote_rule(::Type{Decimal}, ::Type{<:Real}) = Decimal
# override definitions in Base
Base.promote_rule(::Type{BigFloat}, ::Type{Decimal}) = Decimal
Base.promote_rule(::Type{BigInt}, ::Type{Decimal}) = Decimal
# Addition
# To add, convert both decimals to the same exponent.
# (If the exponents are different, us... | {"hexsha": "6d2f3224832a69a0469ea7db4d85856e3668e899", "size": 1949, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/arithmetic.jl", "max_stars_repo_name": "longemen3000/Decimals.jl", "max_stars_repo_head_hexsha": "a4bb9ec23b849038f37cdc398c19181e8e15e7cf", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
# /**
# * Copyright by Ruman Gerst
# * Research Group Applied Systems Biology - Head: Prof. Dr. Marc Thilo Figge
# * https://www.leibniz-hki.de/en/applied-systems-biology.html
# * HKI-Center for Systems Biology of Infection
# * Leibniz Institute for Natural Product Research and Infection Biology - Hans Knöll Insitute (... | {"hexsha": "74dcb38d1a109fa26973087cc7ec707b6d0baf61", "size": 1816, "ext": "py", "lang": "Python", "max_stars_repo_path": "algorithms.py", "max_stars_repo_name": "applied-systems-biology/python3-snakemake-segment-cells", "max_stars_repo_head_hexsha": "3f1a62d41f97fd268826e562919473e1563a6285", "max_stars_repo_licenses... |
import pandas as pd
import numpy as np
from sklearn import svm
from sklearn.model_selection import cross_val_score
from sklearn.metrics import f1_score,classification_report,make_scorer
from sklearn.ensemble import RandomForestClassifier as RFC,AdaBoostClassifier as Ada
from sklearn.model_selection import cross_valid... | {"hexsha": "2d806b6697536e0d9a61ba0e79b74840ed1a0c57", "size": 2924, "ext": "py", "lang": "Python", "max_stars_repo_path": "feorm.py", "max_stars_repo_name": "aksheus/author-profiling", "max_stars_repo_head_hexsha": "23687eb628d3312fae28825662c75cf7b0cc4e66", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null,... |
[STATEMENT]
lemma MI_pred_MI:
assumes "MModel intT intF intP"
shows "MI_pred MI"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. MI_pred MI
[PROOF STEP]
using MI_pred[OF assms]
[PROOF STATE]
proof (prove)
using this:
Ex MI_pred
goal (1 subgoal):
1. MI_pred MI
[PROOF STEP]
unfolding MI_def
[PROOF STATE]
proof (prove... | {"llama_tokens": 206, "file": "Sort_Encodings_Mono", "length": 3} |
#include <boost/test/unit_test.hpp>
#include <joint_control_base/MotionConstraint.hpp>
#include <joint_control_base/ConstrainedJointsCmd.hpp>
using namespace std;
BOOST_AUTO_TEST_CASE(motion_constraint){
joint_control_base::MotionConstraint constraint;
BOOST_CHECK(constraint.hasMaxPosition() == false);
BO... | {"hexsha": "4243455d11a8e1efee080c5ef6fbfde6928f8ebd", "size": 2534, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "test/test.cpp", "max_stars_repo_name": "rock-control/trajectory_generation", "max_stars_repo_head_hexsha": "efaaeca345613ff13047056fb54791c81258fb96", "max_stars_repo_licenses": ["BSD-3-Clause"], "m... |
"""
function mech_and_cow()
# Example
```jldoctest
julia> cowsay("Do you ever get that feeling...?", cow=Cowsay.mech_and_cow)
__________________________________
< Do you ever get that feeling...? >
----------------------------------
\\ ,-----.
/ ... | {"hexsha": "0f4717d0b027a35f2f097449f6dbce44d7b65d4e", "size": 2035, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/cows/mech-and-cow.cow.jl", "max_stars_repo_name": "MillironX/cowsay.jl", "max_stars_repo_head_hexsha": "e1a1447918b2f11710797878da236775bc2986bc", "max_stars_repo_licenses": ["MIT"], "max_stars... |
""" Collection of functions which print multidimensional numpy arrays as SpECTRE
Tensors, wrapped inside of a CHECK() macro, defined by the catch testing library. """
import numpy as np
def printScalarEquality(name: str,checkTensor: np.ndarray) -> str:
returnString=""
returnString+=" CHECK("+name+'.get() == ... | {"hexsha": "af2fb0abf23a8de62c3f0aec96423f7fee0fdc97", "size": 2197, "ext": "py", "lang": "Python", "max_stars_repo_path": "CheckTensors.py", "max_stars_repo_name": "osheamonn/SpectreTestGeneration", "max_stars_repo_head_hexsha": "235a0bb1537442ca77ef67cfaf57155becef1021", "max_stars_repo_licenses": ["MIT"], "max_stars... |
import numpy as np
import pandas as pd
from scipy.stats import ks_2samp, chisquare
from tabulate import tabulate
def generate_experiment_report(
latex_tag, target, df_split, df_final, features, metrics_summary,
train_valid_records, test_records, save_to=None
):
train_idade_mean, train_idade_std = train_v... | {"hexsha": "46440b8564068de97273e45c14bb3a4703a03938", "size": 4644, "ext": "py", "lang": "Python", "max_stars_repo_path": "utils/report.py", "max_stars_repo_name": "vribeiro1/covid19", "max_stars_repo_head_hexsha": "2528ec2e67bee5ff864a513940fb0525f98740b0", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null,... |
# Copyright 2017 Max Planck Society
# Distributed under the BSD-3 Software license,
# (See accompanying file ./LICENSE.txt or copy at
# https://opensource.org/licenses/BSD-3-Clause)
"""
Wasserstein Auto-Encoder models
"""
import sys
import time
import os
import logging
from math import sqrt, cos, sin, pi
import nump... | {"hexsha": "12aa51d6308d708d78b8bf1caeeeedd2409fb309", "size": 50883, "ext": "py", "lang": "Python", "max_stars_repo_path": "wae.py", "max_stars_repo_name": "benoitgaujac/ss_swae", "max_stars_repo_head_hexsha": "c41ae0d031e5ee3dbc30d3d5b2be5df3bc52f76b", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_count": n... |
!
! Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
!
! NVIDIA CORPORATION and its licensors retain all intellectual property
! and proprietary rights in and to this software, related documentation
! and any modifications thereto. Any use, reproduction, disclosure or
! distribution of this software ... | {"hexsha": "a1cb4b7395b7167ee3601ad086527473fdaf5246", "size": 4231, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "examples/OpenACC/samples/acc_f3/acc_f3.f90", "max_stars_repo_name": "shubiuh/PGIexample", "max_stars_repo_head_hexsha": "90c230df7b66a4eea1ddc52d606997f56ea0e75f", "max_stars_repo_licenses": ["F... |
# Test name methods
@testset "Basics" begin
# initialize model and variable
m = InfiniteModel()
num = Float64(0)
info = VariableInfo(false, num, false, num, false, num, false, num, false, false)
new_info = VariableInfo(true, 0., true, 0., true, 0., true, 0., true, false)
bounds = ParameterBounds... | {"hexsha": "65f5e33c51051e761a65d30bea0e5ea1d8fb5cf7", "size": 39439, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/hold_variables.jl", "max_stars_repo_name": "mzagorowska/InfiniteOpt.jl", "max_stars_repo_head_hexsha": "898eed0b307bffc315827c3ebe39423fad7b40fd", "max_stars_repo_licenses": ["MIT"], "max_sta... |
[STATEMENT]
lemma sc_state_\<alpha>_sc_start_state_refine [simp]:
"sc_state_\<alpha> (sc_start_state_refine (rm_empty ()) rm_update (rm_empty ()) (rs_empty ()) f P C M vs) = sc_start_state f P C M vs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. state_refine_base.state_\<alpha> rm.\<alpha> rm.\<alpha> rs.\<alpha... | {"llama_tokens": 261, "file": "JinjaThreads_Execute_SC_Schedulers", "length": 1} |
import boto3
import datetime
import json
import random
from executor import execute
import numpy as np
def main(workload_groups, datasize_list, instance_type_list, availability_zone_list, subnet_list, iteration, dry_run):
spot_candidates = filter_spot_price(get_spot_price_history(instance_type_list, availability_... | {"hexsha": "9305412f21f5af596940b848ea1413cae957e7a8", "size": 6100, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/mybenchmark.py", "max_stars_repo_name": "jatinarora2409/scout-scripts", "max_stars_repo_head_hexsha": "7a461ea47788296ca46fcd97b5d1a6f85dc5f390", "max_stars_repo_licenses": ["MIT"], "max_s... |
__copyright__ = "Copyright (c) 2021 Jina AI Limited. All rights reserved."
__license__ = "Apache-2.0"
from pathlib import Path
from typing import List
import numpy as np
import pytest
from jina import Document, DocumentArray, Executor
from simpleranker import SimpleRanker
def test_config():
encoder = Executor.l... | {"hexsha": "531ddd51fb6d1f441fcb95a28ad2c351345c4b39", "size": 3070, "ext": "py", "lang": "Python", "max_stars_repo_path": "jinahub/rankers/SimpleRanker/tests/unit/test_ranker.py", "max_stars_repo_name": "albertocarpentieri/executors", "max_stars_repo_head_hexsha": "3b025b6106fca9dba3c2569b0e60da050273fa6e", "max_stars... |
// =============================================================================
// Copyright 2017 National Technology & Engineering Solutions of Sandia, LLC
// (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S.
// Government retains certain rights in this software.
//
// Permission is hereby grante... | {"hexsha": "84a8cb6205562e63b8f39c0c9c13427043c1483d", "size": 7819, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "datastore/importers/nmdb-import-show-cdp-neighbor/Parser.test.cpp", "max_stars_repo_name": "cmwill/netmeld", "max_stars_repo_head_hexsha": "bf72a2b2954609b9767575fd2a25bf2ac81338e3", "max_stars_repo... |
{-# OPTIONS --without-K --safe #-}
-- Monadic Adjunctions
-- https://ncatlab.org/nlab/show/monadic+adjunction
module Categories.Adjoint.Monadic where
open import Level
open import Categories.Adjoint
open import Categories.Adjoint.Properties
open import Categories.Category
open import Categories.Category.Equivalence
... | {"hexsha": "a86a01319a976c46b642c6cdd7b115e23cd960bb", "size": 976, "ext": "agda", "lang": "Agda", "max_stars_repo_path": "src/Categories/Adjoint/Monadic.agda", "max_stars_repo_name": "Trebor-Huang/agda-categories", "max_stars_repo_head_hexsha": "d9e4f578b126313058d105c61707d8c8ae987fa8", "max_stars_repo_licenses": ["M... |
module CaretLearners
export CaretLearner,fit!,transform!
export caretrun
using TSML.TSMLTypes
using TSML.Utils
using DataFrames
import TSML.TSMLTypes.fit! # importing to overload
import TSML.TSMLTypes.transform! # importing to overload
using RCall
R"library(caret)"
R"library(e1071)"
R"library(gam)"
R"library(rand... | {"hexsha": "fea2ca4e891ca831447c6419101507e2a6abdcf4", "size": 1872, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/caret.jl", "max_stars_repo_name": "ppalmes/TSML.jl", "max_stars_repo_head_hexsha": "df8ce64c49cbca0cc13142b71710edb08702742e", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 3, "max_sta... |
import seaborn as sns
import pandas as pd
import matplotlib.pyplot as py
import numpy as np
mode = 'lm'
if mode == 'sino':
df = pd.read_csv('fermi_sino.txt', delim_whitespace = True)
df = df.append(pd.read_csv('genius_sino.txt', delim_whitespace = True))
ymax = 5
elif mode == 'lm':
df = pd.read_csv('fer... | {"hexsha": "1580a77464f3b180bc91c8ead4f396f27bc2ce33", "size": 1310, "ext": "py", "lang": "Python", "max_stars_repo_path": "results/plot_results.py", "max_stars_repo_name": "KrisThielemans/parallelproj", "max_stars_repo_head_hexsha": "b9e1cb27aaec9a1605e1842b7b3be8b6f32765d3", "max_stars_repo_licenses": ["MIT"], "max_s... |
import copy
from collections import deque
from time import sleep
import gym
import numpy as np
import torch
import random
from matplotlib import pyplot as plt
from torch import nn
from Lux_Project_Env import frozen_lake
# inspired by https://github.com/mahakal001/reinforcement-learning/tree/master/cartpole-dqn
clas... | {"hexsha": "008a7ad315239061a447f37e479ebeb3ebd191f6", "size": 5550, "ext": "py", "lang": "Python", "max_stars_repo_path": "util/DQN.py", "max_stars_repo_name": "WittyTheMighty/LUX_AI_Project", "max_stars_repo_head_hexsha": "39e302798ed6cdb98b098fd2d2bb02b3d5eda762", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
using Base
using Base.Test
using CRF
v = Features(100)
w = Features(100)
# Check if adding features works like it should (you sould be able to access
# the value of global variables in the append! macro)
g = true
for i = 1:10, j = 1:10
@append! v ((g) & ((i < 7) | (j > 4)))
end
g = false
for i = 1:10, j = 1:10
... | {"hexsha": "7bac6dc7ae4c5e3051b4efe98a218417aa7e6eba", "size": 533, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/features.jl", "max_stars_repo_name": "UnofficialJuliaMirror/CRF.jl-efbd00a7-8d38-570b-a42f-2b6adcacbb8f", "max_stars_repo_head_hexsha": "c7175b69487de71e8a027ef6009c6364c0d745a6", "max_stars_re... |
[STATEMENT]
lemma right_ideal_generated_subset:
assumes "S \<subseteq> T"
shows "right_ideal_generated S \<subseteq> right_ideal_generated T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. right_ideal_generated S \<subseteq> right_ideal_generated T
[PROOF STEP]
unfolding right_ideal_generated_def
[PROOF STATE]
p... | {"llama_tokens": 276, "file": "Echelon_Form_Rings2", "length": 3} |
"""
Several subclasses of the :class:`turbopy.core.ComputeTool` class for
common scenarios
Included stock subclasses:
- Solver for the 1D radial Poisson's equation
- Helper functions for constructing sparse finite difference matrices
- Charged particle pusher using the Boris method
- Interpolate a function y(x) given... | {"hexsha": "06648f12f4061c3652d821ced9f750a1527c3e6b", "size": 15795, "ext": "py", "lang": "Python", "max_stars_repo_path": "turbopy/computetools.py", "max_stars_repo_name": "padamson/turbopy", "max_stars_repo_head_hexsha": "28793948e3fee8f9ac9ebad6c6e047ffd97aefaa", "max_stars_repo_licenses": ["CC0-1.0"], "max_stars_c... |
using MyGraph
G = buildconnectedgraph(collect(1:6), (a,b) -> first(abs.(rand(Int8, 1))))
T,t = alg1(G; source = 1, start = 1)
H,h = alg1(G; source = 3, start = 3)
| {"hexsha": "5be6046a1d712d37c306bfb7002174b7d7f03d8b", "size": 165, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/alg1test.jl", "max_stars_repo_name": "m2lde/MyGraph.jl", "max_stars_repo_head_hexsha": "ac788d6ebf89945bdfc59f8a31cabedf1a9b71d5", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "... |
module timed_app_entry_module
use :: util_api, only : &
string, &
dictionary_converter, &
measurement, &
measurement_writer, &
application_config
use :: timed_application_module, only : timed_application
implicit none
private
public :: t... | {"hexsha": "b48961a1e09e26a5f92c8f5cc2b82d1b7a00d2a8", "size": 4561, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "src/modules/timed_app/timed_app_entry.f90", "max_stars_repo_name": "cheshyre/ntcl-examples", "max_stars_repo_head_hexsha": "46e2693d13c4a1d7796f881497917b645c92a3ea", "max_stars_repo_licenses": ... |
[STATEMENT]
lemma symrun_interp_set_lifting:
assumes \<open>set \<Gamma> = set \<Gamma>'\<close>
shows \<open>\<lbrakk>\<lbrakk> \<Gamma> \<rbrakk>\<rbrakk>\<^sub>p\<^sub>r\<^sub>i\<^sub>m = \<lbrakk>\<lbrakk> \<Gamma>' \<rbrakk>\<rbrakk>\<^sub>p\<^sub>r\<^sub>i\<^sub>m\<close>
[PROOF STATE]
proof (prove)
goal (1... | {"llama_tokens": 3067, "file": "TESL_Language_SymbolicPrimitive", "length": 17} |
[STATEMENT]
lemma compatible_setter:
fixes F :: \<open>('a,'c) preregister\<close> and G :: \<open>('b,'c) preregister\<close>
assumes [simp]: \<open>register F\<close> \<open>register G\<close>
shows \<open>compatible F G \<longleftrightarrow> (\<forall>a b. setter F a o setter G b = setter G b o setter F a)\<cl... | {"llama_tokens": 6157, "file": "Registers_Classical_Extra", "length": 30} |
import argparse
import logging
import matplotlib.pyplot as plt
import numpy as np
import os
import pickle
from PySide2 import QtWidgets
from skimage.transform import resize
import scipy.io as sio
import sys
import tensorflow as tf
import trimesh
import tqdm
import yaml
from pathlib import Path
from collections import n... | {"hexsha": "764e686aca7727315728b2e9243e124f2f3ceff8", "size": 7961, "ext": "py", "lang": "Python", "max_stars_repo_path": "cnnModel/testModel.py", "max_stars_repo_name": "stephen-w-bailey/fast-n-deep-faces", "max_stars_repo_head_hexsha": "53173c6367dfa3a20d3193ad7a0e77ac1e898f02", "max_stars_repo_licenses": ["BSD-3-Cl... |
import re
import pandas as pd
import numpy as np
from gensim import corpora, models, similarities
from difflib import SequenceMatcher
from build_tfidf import split
def ratio(w1, w2):
'''
Calculate the matching ratio between 2 words.
Only account for word pairs with at least 90% similarity
'''
m = Sequence... | {"hexsha": "11a8fd3b3852ab41c4f7768d9da6d1e8f0ff21d6", "size": 3111, "ext": "py", "lang": "Python", "max_stars_repo_path": "build_features.py", "max_stars_repo_name": "CSC591ADBI-TeamProjects/Product-Search-Relevance", "max_stars_repo_head_hexsha": "c30368a70768ebf24e98ac3ceefdb0f0f2092ab6", "max_stars_repo_licenses": ... |
[STATEMENT]
lemma fps_mult_assoc: "(f::('a::type,'b::dioid_one_zero) fps) * (g * h) = (f * g) * h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. f \<cdot> (g \<cdot> h) = f \<cdot> g \<cdot> h
[PROOF STEP]
proof (rule fps_ext)
[PROOF STATE]
proof (state)
goal (1 subgoal):
1. \<And>n. (f \<cdot> (g \<cdot> h)) $ n ... | {"llama_tokens": 1453, "file": "Kleene_Algebra_Formal_Power_Series", "length": 11} |
using Primes
using LinearAlgebra
#returns a random orthogonal matrix of size n
function random_orthogonal(n::Int)
A = rand(n,n)
Q,R = qr(A)
return Q
end
#returns the array A of length L such that A[i] = 1 if i ∉ t and A[i] = 2 else
function tuple_to_index(t::Array{Int},L)
A = ones(Integer,L)
for x=t
... | {"hexsha": "288450380713d4ae2a88d6c2df115e633c143dc7", "size": 1734, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/particular_states.jl", "max_stars_repo_name": "msdupuy/Tensor-Train-Julia", "max_stars_repo_head_hexsha": "327545d2e690c40d218d6316b69cf912963591e9", "max_stars_repo_licenses": ["MIT"], "max_st... |
"""Workflows for imaging, including predict, invert, residual, restore, deconvolve, weight, taper, zero, subtract and sum results from invert
"""
__all__ = ['predict_list_serial_workflow', 'invert_list_serial_workflow', 'residual_list_serial_workflow',
'restore_list_serial_workflow', 'deconvolve_list_seria... | {"hexsha": "4db6c48534a3d7bd2185cc7c305513f28134a49c", "size": 23269, "ext": "py", "lang": "Python", "max_stars_repo_path": "rascil/workflows/serial/imaging/imaging_serial.py", "max_stars_repo_name": "SKA-ScienceDataProcessor/rascil", "max_stars_repo_head_hexsha": "bd3b47f779e18e184781e2928ad1539d1fdc1c9b", "max_stars_... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Aug 17 12:41:35 2020
@author: worklab
"""
import os
import sys,inspect
import numpy as np
import random
import math
import time
random.seed = 0
import cv2
from PIL import Image
import torch
from torch import nn, optim
from torch.utils import data
fro... | {"hexsha": "93b2fa7e6668f4832332e96d17b7e51e9f9408ee", "size": 5022, "ext": "py", "lang": "Python", "max_stars_repo_path": "models/mock_detector.py", "max_stars_repo_name": "DerekGloudemans/tensorflow-yolov4-tflite", "max_stars_repo_head_hexsha": "1faf48015f7587ce417d3623566926a5c8d30b42", "max_stars_repo_licenses": ["... |
# same as eval_fid.py in cvlab4
print("running")
import sys
import os
import inspect
import torch
import torch.nn.functional as F
from torchvision import transforms
import numpy as np
import random
from PIL import Image
import glob
import time
import random
from torchvision.utils import save_image, make_grid
import... | {"hexsha": "9ca3a97f61fd5bc9da10923db1b55791fc328ed0", "size": 5263, "ext": "py", "lang": "Python", "max_stars_repo_path": "eval/eval_fid.py", "max_stars_repo_name": "mlnyang/AE-NeRF", "max_stars_repo_head_hexsha": "08778d8c37b06c9cea2346c68318bcb1e6816237", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, ... |
!> @brief derivative version of "MOD_BLOCKING_SIZE"
MODULE g_MOD_BLOCKING_SIZE
IMPLICIT NONE
END MODULE g_MOD_BLOCKING_SIZE
| {"hexsha": "c282451a325fd0840adeb4072ab852e3df663f83", "size": 129, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "inverse/g_tap/mod_blocking_size_ftl.f90", "max_stars_repo_name": "arielthomas1/SHEMAT-Suite-Open", "max_stars_repo_head_hexsha": "f46bd3f8a9a24faea9fc7e48ea9ea88438e20d78", "max_stars_repo_licens... |
[STATEMENT]
lemma Sup_lim:
fixes a :: "'a::{complete_linorder,linorder_topology}"
assumes "\<And>n. b n \<in> s"
and "b \<longlonglongrightarrow> a"
shows "a \<le> Sup s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. a \<le> Sup s
[PROOF STEP]
by (metis Lim_bounded assms complete_lattice_class.Sup_upper) | {"llama_tokens": 128, "file": null, "length": 1} |
# -*- coding: utf-8 -*-
"""
Created on Mon Apr 4 21:27:37 2016
@author: abhishek
"""
import numpy as np
import pandas as pd
from scipy.cluster import vq
# load train and test set
train = pd.read_csv('./data/train.csv', index_col='ID')
test = pd.read_csv('./data/test.csv', index_col='ID')
# columns with high freq... | {"hexsha": "21fec4ef526ab318659cbfaba7fd7561edac6a9b", "size": 929, "ext": "py", "lang": "Python", "max_stars_repo_path": "Kaggle-Competitions/Santander-Customer-Satisfaction/scripts/vector_quantization.py", "max_stars_repo_name": "gopala-kr/ds-notebooks", "max_stars_repo_head_hexsha": "bc35430ecdd851f2ceab8f2437eec4d7... |
import json
import numpy as np
def load_json(file_path):
with open(file_path, 'r') as fid:
return json.load(fid)
def save_json(data=None, file_path=None, indent=4):
with open(file_path, 'w') as fid:
json.dump(data, fid, indent=indent)
def decdeg_to_decmin(pos, string_type=False, decimals=F... | {"hexsha": "a0ad62f4f6758a977b2d2cc8ebff27ddbaecd0b5", "size": 2101, "ext": "py", "lang": "Python", "max_stars_repo_path": "pre_system_svea/utils.py", "max_stars_repo_name": "sharksmhi/pre_system_svea", "max_stars_repo_head_hexsha": "14890ce23e149eb7a962ff785daf213eb9a2c050", "max_stars_repo_licenses": ["MIT"], "max_st... |
import numpy as np
class ActivationReLU:
def __init__(self):
self.output = np.array([])
self.inputs = np.array([])
self.dinputs = np.array([])
def forward(self, inputs): # best one most of the time
self.inputs = inputs
self.output = np.maximum(0, inputs)
def bac... | {"hexsha": "3f57c2f7f29c2bc4a2d430637a7aff1b80d8465b", "size": 585, "ext": "py", "lang": "Python", "max_stars_repo_path": "neuralnetwork/activationfunctions/ActivationReLU.py", "max_stars_repo_name": "hanzopgp/NeuralNetworkFromScratch", "max_stars_repo_head_hexsha": "a244d0ad0f192b77624f6c9f852ca3aee65d1ae7", "max_star... |
//============================================================================
// Copyright 2009-2020 ECMWF.
// This software is licensed under the terms of the Apache Licence version 2.0
// which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
// In applying this licence, ECMWF does not waive the privil... | {"hexsha": "f9f33b10dc11aca4f21adefef99d5007f725bd80", "size": 10967, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "Viewer/ecflowUI/src/InfoProvider.cpp", "max_stars_repo_name": "ecmwf/ecflow", "max_stars_repo_head_hexsha": "2498d0401d3d1133613d600d5c0e0a8a30b7b8eb", "max_stars_repo_licenses": ["Apache-2.0"], "m... |
import numpy as np
from examples.single_cond_example import create_conditions
from tensorflow.keras import Input, Model
from tensorflow.keras import Sequential
from tensorflow.keras.layers import Dense, LSTM
from cond_rnn import ConditionalRNN
NUM_SAMPLES = 10_000
INPUT_DIM = 1
NUM_CLASSES = 3
TIME_STEPS = 10
NUM_CEL... | {"hexsha": "0987b8c2e9d847f78b91d6e5a8857858657cd598", "size": 2154, "ext": "py", "lang": "Python", "max_stars_repo_path": "emotional_rnn.py", "max_stars_repo_name": "AirHorizons/cond_rnn", "max_stars_repo_head_hexsha": "8b6625e6b6f608f12e84f6249877a84b87124c31", "max_stars_repo_licenses": ["MIT"], "max_stars_count": n... |
"""Supporting functions for arbitrary order Factorization Machines."""
import itertools
from itertools import combinations_with_replacement, takewhile, count
import math
from collections import defaultdict
import numpy as np
import tensorflow as tf
def get_shorter_decompositions(basic_decomposition):
"""Returns ... | {"hexsha": "7331547ca59855ffc59fc0d56585a435a6665902", "size": 5019, "ext": "py", "lang": "Python", "max_stars_repo_path": "tffm/utils.py", "max_stars_repo_name": "vyraun/tffm", "max_stars_repo_head_hexsha": "c239b722ff1a8e3001d554843afe30622a105848", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, "max_stars... |
from copy import deepcopy
import numpy as np
import matplotlib.pylab as plt
import itertools
from IPython.display import display
from ipywidgets import widgets
import pandas as pd
from QCbaselinePY import qcbaseline
colors = plt.rcParams['axes.prop_cycle'].by_key()['color']
get_color_cycler = lambda: itertools.cycle... | {"hexsha": "f57a45153117811768df166fc632cc0ca614d70d", "size": 19461, "ext": "py", "lang": "Python", "max_stars_repo_path": "QCbaselinePY/view.py", "max_stars_repo_name": "hagne/grad_ops", "max_stars_repo_head_hexsha": "21be413218c86a9bf11dbc2d641e4cb28e9dc4ae", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nu... |
import pandas as pd
import plotly.express as px
import plotly.graph_objects as go
from sklearn.cluster import KMeans, MeanShift
from sklearn.decomposition import PCA
from sklearn.manifold import TSNE
import umap
from sklearn.mixture import GaussianMixture
from sklearn.metrics.pairwise import cosine_similarity
import ne... | {"hexsha": "31e305bd3539400289a4c782178ae42e9eb6c2af", "size": 13363, "ext": "py", "lang": "Python", "max_stars_repo_path": "main-text.py", "max_stars_repo_name": "EMBEDDIA/xl-user-comments", "max_stars_repo_head_hexsha": "ac70858ff9451e31bf5faa30700974291ce8ebfd", "max_stars_repo_licenses": ["Unlicense"], "max_stars_c... |
using JuMP, EAGO
m = Model()
EAGO.register_eago_operators!(m)
@variable(m, -1 <= x[i=1:4] <= 1)
@variable(m, -1.263105417837706 <= q <= 2.4766737340949954)
add_NL_constraint(m, :(softplus(0.7635571507341847 + -... | {"hexsha": "e75900cbe6b30c8035bed1c66b4991697fc3d180", "size": 3806, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "solver_benchmarking/MINLPLib.jl/instances/ANN_Env/23_softplus_4_4_2.jl", "max_stars_repo_name": "PSORLab/RSActivationFunctions", "max_stars_repo_head_hexsha": "0bf8b4500b21144c076ea958ce93dbdd19a53... |
#!/usr/bin/env python3
import numpy as np
import os,sys
import glob
sys.path.insert(0, '../../classifiers/')
from create_network_siamese_triplet import *
import random
import keras
import tensorflow as tf
from keras.backend.tensorflow_backend import set_session
import argparse
def choice_training(names_noAug, names,... | {"hexsha": "f581fc18d75629de4c8753dbda5a49ac768df62b", "size": 12286, "ext": "py", "lang": "Python", "max_stars_repo_path": "train_combination/training_with_different_sizes/train_classifier_triplet_vary_training.py", "max_stars_repo_name": "CarolMazini/Manifold-Learning-for-Real-World-Event-Understanding", "max_stars_r... |
/* RevKit: A Toolkit for Reversible Circuit Design (www.revkit.org)
* Copyright (C) 2009-2011 The RevKit Developers <revkit@informatik.uni-bremen.de>
*
* 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 ... | {"hexsha": "8b16fc3689701d7e235f474f7dedf2ccf56d415c", "size": 12963, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "rkqc/src/core/io/create_image.cpp", "max_stars_repo_name": "clairechingching/ScaffCC", "max_stars_repo_head_hexsha": "737ae90f85d9fe79819d66219747d27efa4fa5b9", "max_stars_repo_licenses": ["BSD-2-C... |
Require Import Reals.
Require Import Psatz.
(**********************)
(** Unitary Programs **)
(**********************)
(* Note: We only support application of 1-, 2-, and 3-qubit unitaries.
We could instead allow something more general (e.g. application of
an arbitrary unitary to a list of arguments), but this ... | {"author": "inQWIRE", "repo": "SQIR", "sha": "7d2938bf63080e37d47059befa27a57f12cc099c", "save_path": "github-repos/coq/inQWIRE-SQIR", "path": "github-repos/coq/inQWIRE-SQIR/SQIR-7d2938bf63080e37d47059befa27a57f12cc099c/SQIR/SQIR.v"} |
# ------------------------------------
# calcucation of the viscosity term by central difference
# ------------------------------------
function central_diff(E_vis_hat, F_vis_hat, G_vis_hat, QbaseU, QbaseD, QbaseL, QbaseR, QbaseF, QbaseB,
QconU, QconD, QconL, QconR, QconF, QconB, cellxmax, cellymax... | {"hexsha": "15ae4d8fd7cd4f3bff349d4380653e1892a816ec", "size": 29558, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src_muscl_3d/viscos_pturb.jl", "max_stars_repo_name": "hide-dog/general_2d_NS_LES", "max_stars_repo_head_hexsha": "571e4d3d63882ec0829ed5f56b33bec9b0eaf50e", "max_stars_repo_licenses": ["MIT"], "m... |
//
// Created by chris on 07.05.21.
//
#pragma once
#include <gsl/gsl_errno.h>
#include <gsl/gsl_fft_real.h>
#include <gsl/gsl_fft_halfcomplex.h>
#include <numeric>
#include <vector>
class test {
public:
int n;
};
/**
* Calculates autocorrelation with FFT
* @param vec
* @return
*//*
std::vector<double> ac(c... | {"hexsha": "45ea1cc93268284a480e0600ebb91b68790ca588", "size": 3592, "ext": "h", "lang": "C", "max_stars_repo_path": "Projects/HelloWorld/test.h", "max_stars_repo_name": "Babalion/NumerischeMethodenStatistischenPhysik", "max_stars_repo_head_hexsha": "ededd743fe6d8418894ae230a9783c7db114d7e2", "max_stars_repo_licenses":... |
# Test RepresentativeStateTable and DiagonalizationSector with reflection
# symmetry at k=0 and k=π
let L = 10
hs = SpinHalfHilbertSpace(ChainLattice([L]))
seed_state!(hs, N_up=0)
apply_hamiltonian = spin_half_hamiltonian(J1_z=1, h_x=0.45, h_z=0.87)
rst = RepresentativeStateTable(hs, apply_hamiltonian, ... | {"hexsha": "888806d70e5f3eb254a40f404ec9514347334a73", "size": 1114, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/abelian-reflection.jl", "max_stars_repo_name": "garrison/ExactDiag.jl", "max_stars_repo_head_hexsha": "9148f300a239c7284d9292e72d4fa6b97817e3d3", "max_stars_repo_licenses": ["MIT"], "max_stars... |
\documentclass{article}
\usepackage{jefri}
\usepackage{fullpage}
\linespread{1.3}
\begin{document}
\jefri{Divine}
\tableofcontents
\newpage
\linespread{1.6}
\section{Overview}
JEFRi Divine is a suite of tools to automatically generate contexts from a
wide variety of data sources. By analyzing a business' current... | {"hexsha": "8cfc8a3f32cc3eb808132afbf95889a819c0a3ab", "size": 3768, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "docs/divine/divine.tex", "max_stars_repo_name": "DavidSouther/JEFRi", "max_stars_repo_head_hexsha": "161f24e242e05b9b2114cc1123a257141a60eaf2", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
"""
Calibrate camera using fisheye model from opencv.
https://docs.opencv.org/trunk/db/d58/group__calib3d__fisheye.html#details
Collect images to `images/capture*.jpg` by pressing "S".
If precaptured images are found, calibration is run directly.
It is expected that chessboard calibration pattern 9x6 is on the images... | {"hexsha": "57ad1607548424980bb946f093ad537db7bbb9f7", "size": 4346, "ext": "py", "lang": "Python", "max_stars_repo_path": "osgar/tools/calibfish.py", "max_stars_repo_name": "m3d/osgar_archive_2020", "max_stars_repo_head_hexsha": "556b534e59f8aa9b6c8055e2785c8ae75a1a0a0e", "max_stars_repo_licenses": ["MIT"], "max_stars... |
Debats du Senat (hansard)
1ere Session, 36e Legislature,
Volume 137, Numero 22
Le mercredi 26 novembre 1997
L'honorable Gildas L. Molgat, President
Le Conseil de recherches medicales-Les effets de la reduction du financement
Depot du premier rapport du comite
Etat du systeme financier
Projet de loi de credits n... | {"hexsha": "b83301eb1f49dc4284578866e0fbaa884a43cacd", "size": 7149, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "data/Hansard/Training/hansard.36.1.senate.debates.1997-11-26.022.f", "max_stars_repo_name": "j1ai/Canadian_Hansards_Neural_Machine_Translation", "max_stars_repo_head_hexsha": "554666a89090fc1b1d1f... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
"""
File name: investor_server
Date created: 17/07/2019
Feature: #Enter feature description here
"""
__author__ = "Alexander Kell"
__copyright__ = "Copyright 2018, Alexander Kell"
__license__ = "MIT"
__email__... | {"hexsha": "879274839f37cbcfd364d8c1d2c5e1956201a9bf", "size": 4151, "ext": "py", "lang": "Python", "max_stars_repo_path": "run/intelligent_bidding/RL_server/intelligent_bidding_rl_server 2.py", "max_stars_repo_name": "alexanderkell/elecsim", "max_stars_repo_head_hexsha": "35e400809759a8e9a9baa3776344e383b13d8c54", "ma... |
(* @TAG(OTHER_LGPL) *)
(*
Author: Norbert Schirmer
Maintainer: Norbert Schirmer, norbert.schirmer at web de
License: LGPL
*)
(* Title: XVcg.thy
Author: Norbert Schirmer, TU Muenchen
Copyright (C) 2006-2008 Norbert Schirmer
Some rights reserved, TU Muenchen
This library is free s... | {"author": "8l", "repo": "AutoCorres", "sha": "47d800912e6e0d9b1b8009660e8b20c785a2ea8b", "save_path": "github-repos/isabelle/8l-AutoCorres", "path": "github-repos/isabelle/8l-AutoCorres/AutoCorres-47d800912e6e0d9b1b8009660e8b20c785a2ea8b/c-parser/Simpl/XVcg.thy"} |
import os
import pandas as pd
import numpy as np
# We Don't need to use test data
DATA_PATH = os.path.join(os.path.dirname(__file__), '../dataset/fashionmnist/fashion-mnist_train.csv')
IMAGE_SIZE = 28
IMAGE_PIXELS = IMAGE_SIZE * IMAGE_SIZE
IMAGE_MAX_VALUE = 255
def max_normalize(data):
"""
scale images to -... | {"hexsha": "8fbf6f365216a651c5180d4cce2db99ef236321e", "size": 1413, "ext": "py", "lang": "Python", "max_stars_repo_path": "data/fashion_mnist.py", "max_stars_repo_name": "postBG/fashionMNIST-DCGAN-tensorflow", "max_stars_repo_head_hexsha": "cd13df6425d30132064ddaa1925280433e827d2c", "max_stars_repo_licenses": ["MIT"],... |
%!TEX root = ../thesis.tex
%*******************************************************************************
%****************************** Second Chapter *********************************
%*******************************************************************************
\chapter{Adjoint based shape optimization}
\ifpd... | {"hexsha": "a18282918431b36c1096cf6800b552189ad06e3a", "size": 26835, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "Chapter2/chapter2.tex", "max_stars_repo_name": "Corwinpro/FirstYearReport", "max_stars_repo_head_hexsha": "4a8b6f5af3787dd3c182fa074d4242d8a29f8348", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
!***********************************************************************
! *
SUBROUTINE DNICMV(N, M, B, C)
! *
! Matrix-matrix product: C = AB. The lower triangle of the (N... | {"hexsha": "5f5bb7bb9d4bf4d8d740fd8389605cd46e05a67d", "size": 4445, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "src/appl/rci90_mpi/dnicmv.f90", "max_stars_repo_name": "sylas/grasp-continuum", "max_stars_repo_head_hexsha": "f5e2fb18bb2bca4f715072190bf455fba889320f", "max_stars_repo_licenses": ["MIT"], "max... |
import os
import os.path
import sys
from PIL import Image
import numpy as np
from tqdm import tqdm, trange
from data.base_dataset import BaseDataset, get_transform
import random
import torch
class ToyDataset(BaseDataset):
@staticmethod
def modify_commandline_options(parser, is_train):
"""Add new datas... | {"hexsha": "aecd76d0a3424ef5fb66987edaf16982d80d2fb3", "size": 3500, "ext": "py", "lang": "Python", "max_stars_repo_path": "data/toy_dataset.py", "max_stars_repo_name": "Gabriele91/EvolutionaryGAN-pytorch", "max_stars_repo_head_hexsha": "993cb13551908727e52aef738f8954072b5b398a", "max_stars_repo_licenses": ["MIT"], "ma... |
import os
import json
import pandas as pd
import argparse
import numpy as np
from pathlib import Path
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
import seaborn as sns
plt.style.use('ggplot')
ILURL_HOME = os.environ['ILURL_HOME']
EMISSION_PATH = \
f'{ILURL_HOME}/data/emissions'
EXC... | {"hexsha": "ce6d3ee82de182e74b022e96bfe774ffedfe5967", "size": 11936, "ext": "py", "lang": "Python", "max_stars_repo_path": "analysis/test_plots.py", "max_stars_repo_name": "guilhermevarela/ilu", "max_stars_repo_head_hexsha": "e4db9744c28f9e04ae82c884f131ee8cd9601cc8", "max_stars_repo_licenses": ["MIT"], "max_stars_cou... |
"""
pdi{T<:Number}(x::Array{T, 1})
This function will range the values of each row, so that the strongest link has
a value of one. This works for deterministic and quantitative networks.
#### References
Poisot, T., Bever, J.D., Nemri, A., Thrall, P.H., Hochberg, M.E., 2011. A
conceptual framework for the evolut... | {"hexsha": "3b9ac6519f844d86757c38b9ed7f3427b69574fa", "size": 2434, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/links/specificity.jl", "max_stars_repo_name": "FrancisBanville/EcologicalNetworks.jl", "max_stars_repo_head_hexsha": "565c9859d7ea697b560b3b47ff7fe51dceeebdc0", "max_stars_repo_licenses": ["MIT... |
[STATEMENT]
lemma nyinitcls_emptyD: "\<lbrakk>nyinitcls G s = {}; is_class G C\<rbrakk> \<Longrightarrow> initd C s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<lbrakk>nyinitcls G s = {}; is_class G C\<rbrakk> \<Longrightarrow> initd C s
[PROOF STEP]
unfolding nyinitcls_def
[PROOF STATE]
proof (prove)
goal (1 s... | {"llama_tokens": 190, "file": null, "length": 2} |
import pytest
import os
import numpy as np
import torch
import brevitas.onnx as bo
from brevitas.nn import QuantConv2d
from brevitas.core.restrict_val import RestrictValueType
from brevitas.core.quant import QuantType
from brevitas.core.scaling import ScalingImplType
from brevitas.core.stats import StatsOp
from finn.c... | {"hexsha": "198f1e7961a9e160589989b8b34b45b5fda53817", "size": 2520, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/brevitas/test_brevitas_QConv2d.py", "max_stars_repo_name": "alinavalinav/finn", "max_stars_repo_head_hexsha": "e443a5859066a410a63c08dcfec4a90527ca24be", "max_stars_repo_licenses": ["BSD-3-C... |
#define BOOST_TEST_DYN_LINK
#include <canard/net/ofp/v13/instruction/meter.hpp>
#include <boost/test/unit_test.hpp>
#include <boost/test/data/monomorphic.hpp>
#include <boost/test/data/test_case.hpp>
#include <cstdint>
#include <vector>
#include <canard/net/ofp/v13/io/openflow.hpp>
#include "../../test_utility.hpp"
... | {"hexsha": "ac6afd08e89101c4aa56b4c9c09ef88d16b4715b", "size": 3657, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "test/v13/instruction/meter_test.cpp", "max_stars_repo_name": "amedama41/bulb", "max_stars_repo_head_hexsha": "2e9fd8a8c35cfc2be2ecf5f747f83cf36ffbbdbb", "max_stars_repo_licenses": ["BSL-1.0"], "max_... |
//此源码被清华学神尹成大魔王专业翻译分析并修改
//尹成QQ77025077
//尹成微信18510341407
//尹成所在QQ群721929980
//尹成邮箱 yinc13@mails.tsinghua.edu.cn
//尹成毕业于清华大学,微软区块链领域全球最有价值专家
//https://mvp.microsoft.com/zh-cn/PublicProfile/4033620
//
//同步客户端
//~~~~~~~~~~~~~~~~~~~~~
//
//版权所有(c)2003-2012 Christopher M.Kohlhoff(Chris at Kohlhoff.com)
//
//在Boost软件许可证1.0... | {"hexsha": "9d665922818e1f1cadf4810c5a9e19cf8bf80fe7", "size": 10643, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "programs/cleos/httpc.cpp", "max_stars_repo_name": "yinchengtsinghua/EOSIOChineseCPP", "max_stars_repo_head_hexsha": "dceabf6315ab8c9a064c76e943b2b44037165a85", "max_stars_repo_licenses": ["MIT"], "... |
import torch
from torch.autograd import Variable
import torchvision
import numpy as np
import torch.utils.data as data
import torchvision.transforms as transforms
from jma_pytorch_dataset import *
from utils import AverageMeter, Logger
from criteria_precip import *
# for debug
from tools_mem import *
# training/valid... | {"hexsha": "40516e911f5921308d7e7e567c42816ea0ac6425", "size": 6278, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/train_valid_epoch_advloss.py", "max_stars_repo_name": "inoue0406/adversarial-nowcasting", "max_stars_repo_head_hexsha": "431f6bc4b7d731e85ca52f1bf81638b31c4be17e", "max_stars_repo_licenses": [... |
[STATEMENT]
lemma dg_prod_2_op_dg_dg_Arr[dg_op_simps]:
"(op_dg \<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Arr\<rparr> = (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Arr\<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. (op_dg \<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Arr\<rparr> = (\<AA> \<times>\<^su... | {"llama_tokens": 2964, "file": "CZH_Foundations_czh_digraphs_CZH_DG_PDigraph", "length": 15} |
import os
import sys
from abc import ABC, abstractmethod
from tqdm import tqdm
import numpy as np
import pickle
import tensorflow as tf
scriptdir = os.path.abspath(__file__).split('scripts')[0] + 'scripts/'
sys.path.append(scriptdir)
from datasets.tfrecord_utils import _parse_no_img_function
from datasets.pose_utils i... | {"hexsha": "40ad66f58c96adf3666830126524824b29a8ff41", "size": 34376, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/models/ekf.py", "max_stars_repo_name": "govvijaycal/confidence_aware_predictions", "max_stars_repo_head_hexsha": "c5fea8aac271dc792eedc00a689c02fcd658edec", "max_stars_repo_licenses": ["M... |
[STATEMENT]
lemma Astack_map_Dummy[simp]:
"Astack (map Dummy l) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. Astack (map Dummy l) = 0
[PROOF STEP]
by (induction l) auto | {"llama_tokens": 82, "file": "Call_Arity_ArityStack", "length": 1} |
# Available indicators here: https://python-tradingview-ta.readthedocs.io/en/latest/usage.html#retrieving-the-analysis
from tradingview_ta import TA_Handler, Interval, Exchange
# use for environment variables
import os
# use if needed to pass args to external modules
import sys
# used for directory handling
import glo... | {"hexsha": "155c6231106e0eb8b19f18f876c2b5903c6a46da", "size": 7497, "ext": "py", "lang": "Python", "max_stars_repo_path": "custsignalmod.py", "max_stars_repo_name": "gsjack/mlvisualtrader", "max_stars_repo_head_hexsha": "669a3fb01d8b5d5512b8c102d07b144214d9c985", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
module Editors
using Genie, Stipple, StippleUI, StippleUI.API
import Genie.Renderer.Html: HTMLString, normal_element, select, template
export editor
function __init__()
Genie.Renderer.Html.register_normal_element("q__editor", context = Genie.Renderer.Html)
end
"""
editor(fieldname, args...; wrap, kwargs...)
Cr... | {"hexsha": "a1c83e45ef50cdf0a84d9677ab2da6febd123ff7", "size": 1039, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/Editors.jl", "max_stars_repo_name": "GenieFramework/StippleUI.jl", "max_stars_repo_head_hexsha": "2ff71de54cafde0f7addc6f5bf3882557ac48b21", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
# --------------
# Importing header files
import numpy as np
# Path of the file has been stored in variable called 'path'
data=np.genfromtxt(path,delimiter=',',skip_header=1)
#New record
new_record=[[50, 9, 4, 1, 0, 0, 40, 0]]
new_record=np.array(new_record)
census=np.concatenate((data,new_record),axis... | {"hexsha": "f997dfc21e67682c7cf9ea1ca264585d9a998a9b", "size": 2590, "ext": "py", "lang": "Python", "max_stars_repo_path": "Sense-of-Census/code.py", "max_stars_repo_name": "shahrukh357/ga-learner-dsmp-repo", "max_stars_repo_head_hexsha": "84f479c5fbb111886a4e758c67fb9558c8cab374", "max_stars_repo_licenses": ["MIT"], "... |
#include <iostream>
#include <harp.hpp>
#include <boost/python.hpp>
#include <boost/numpy.hpp>
using namespace std;
using namespace harp;
namespace py = boost::python;
int add_five(int x) {
return x + 5;
}
BOOST_PYTHON_MODULE(Pointless)
{
py::def("add_five", add_five);
}
int main ( int argc, char *argv[]... | {"hexsha": "07435d4a557a05fd6b012879b7f96f9bc4864e33", "size": 2934, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "src/tests-python/harp_test_python.cpp", "max_stars_repo_name": "tskisner/HARP", "max_stars_repo_head_hexsha": "e21435511c3dc95ce1318c852002a95ca59634b1", "max_stars_repo_licenses": ["BSD-3-Clause-LB... |
import numpy as np
from typing import List, Tuple, Set, Dict, FrozenSet, Union
from dataclasses import dataclass
from logzero import logger
from itertools import product
from sampling_ufo2.context import Context
from sampling_ufo2.wfomc.wmc import WMC, WMCSampler
from sampling_ufo2.fol.syntax import Lit, Pred, Term, ... | {"hexsha": "8e41215d52f9d132bb42db5443953dc238581061", "size": 6567, "ext": "py", "lang": "Python", "max_stars_repo_path": "sampling_ufo2/cell_graph.py", "max_stars_repo_name": "lucienwang1009/lifted_sampling_ufo2", "max_stars_repo_head_hexsha": "ac8b041ba8a170c7bb11838fb08c4168ef95136f", "max_stars_repo_licenses": ["M... |
#Series temporais e analises preditivas - Fernando Amaral
library(ggplot2)
library(forecast)
library(seasonal)
library(seasonalview)
#sazonalidade e tendencia
plot(co2)
abline(reg=lm(co2~time(co2)))
#decomposicao classica
classicdecco2 = decompose(co2)
autoplot(classicdecco2)
#decomposicao classica
... | {"hexsha": "d87f630a4aa34cc41cf641a577e35792abdbe373", "size": 645, "ext": "r", "lang": "R", "max_stars_repo_path": "Udemy/Series Temporais e Analises Preditivas/Resources/Codigo/5.4.Decomposicao.r", "max_stars_repo_name": "tarsoqueiroz/Rlang", "max_stars_repo_head_hexsha": "b2d4fdd967ec376fbf9ddb4a7250c11d3abab52e", "... |
"""
Customized transforms using kornia for faster data augmentation
@author: delgallegon
"""
import torch
import torch.nn as nn
import kornia
import numpy as np
import torchvision.transforms as transforms
class IIDTransform(nn.Module):
def __init__(self):
super(IIDTransform, self).__init__()
se... | {"hexsha": "2762775bc6f68eb728a81d40c602b71554b63847", "size": 3188, "ext": "py", "lang": "Python", "max_stars_repo_path": "transforms/iid_transforms.py", "max_stars_repo_name": "NeilDG/NeuralNets-Experiment3", "max_stars_repo_head_hexsha": "f0d2f788eeca49f803f65810c155491ce687cf9e", "max_stars_repo_licenses": ["MIT"],... |
import math
import numpy
from wx_explore.common.models import Projection
from wx_explore.web.core import db
lut_meta = {}
def load_coordinate_lookup_meta(proj):
lats = numpy.array(proj.lats)
lons = numpy.array(proj.lons)
return (lats, lons)
def get_lookup_meta(proj):
if proj.id not in lut_meta:
... | {"hexsha": "ed2597b7830f3858b5fb34482a0a726de2b1fc91", "size": 1782, "ext": "py", "lang": "Python", "max_stars_repo_path": "wx_explore/common/location.py", "max_stars_repo_name": "computerfreak/wx_website", "max_stars_repo_head_hexsha": "c63cb39736bd60b9302f235e60be6fbb35152e6e", "max_stars_repo_licenses": ["Apache-2.0... |
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | {"hexsha": "6b31ccb3547f73284c5213433301237ad7a47432", "size": 7316, "ext": "py", "lang": "Python", "max_stars_repo_path": "ppdet/data/source/coco.py", "max_stars_repo_name": "joey12300/PaddleDetection", "max_stars_repo_head_hexsha": "bd3c36aaf3d3c728743cd8b7122a35167774c8dd", "max_stars_repo_licenses": ["Apache-2.0"],... |
\subsubsection{Commodity Forward}
The \lstinline!CommodityForwardData! node is the trade data container for the \lstinline!CommodityForward! trade type. The structure of an example \lstinline!CommodityForwardData! node is shown in Listings \ref{lst:comfwd_data} and \ref{lst:comm_fwd_lme_3M}.
\begin{listing}[H]
\begin... | {"hexsha": "d28a42f376c2515ce51c829485328db36a441252", "size": 5787, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "Docs/UserGuide/tradedata/commodityforward.tex", "max_stars_repo_name": "mrslezak/Engine", "max_stars_repo_head_hexsha": "c46ff278a2c5f4162db91a7ab500a0bb8cef7657", "max_stars_repo_licenses": ["BSD-3... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = "Lucas Miguel S Ponce"
__email__ = "lucasmsp@gmail.com"
from pycompss.api.parameter import FILE_IN
from pycompss.api.task import task
from pycompss.functions.reduce import merge_reduce
# from pycompss.api.local import local # guppy module isnt available in ... | {"hexsha": "2c09c8405ca8afd65cd227200411e4175e6000a2", "size": 3761, "ext": "py", "lang": "Python", "max_stars_repo_path": "ddf_library/functions/statistics/freq_items.py", "max_stars_repo_name": "eubr-bigsea/Compss-Python", "max_stars_repo_head_hexsha": "09ab7c474c8badc9932de3e1148f62ffba16b0b2", "max_stars_repo_licen... |
module MayOptimizeLinearAlgebraBenchmarks
export
run_benchmarks,
load_benchmarks,
save_benchmarks
const USE_AVX = false
using HDF5
using LinearAlgebra
using Statistics
using StaticArrays
using BenchmarkTools
using BenchmarkTools: Trial
using MayOptimize
using MayOptimize:
AVX,
Standard,
Cho... | {"hexsha": "edca099db5a0b5f99f230af515549771bcce3f78", "size": 15138, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/linalg-benchmarks.jl", "max_stars_repo_name": "emmt/ConditionallyOptimize", "max_stars_repo_head_hexsha": "80e32d44d429032bc203633e8d13ea737eb0a044", "max_stars_repo_licenses": ["MIT"], "max_... |
import torch
import torch.nn as nn
from torchcrf import CRF
from torch.autograd import Variable
import numpy as np
from nets.base import NN
from nets.modules import Embedding, SpatialDropout, char_RNN, word_CNN
'''
INPUT -> CHAR EMB -> CHAR CNN + - MaxPool + Global Avg - > Sigmoid(1)
-> WORD EMB ->... | {"hexsha": "db817cfd2839b1b232d12d1f1c5e05afad3c0aff", "size": 5021, "ext": "py", "lang": "Python", "max_stars_repo_path": "nets/mt/rnn_cnn.py", "max_stars_repo_name": "ndionysus/multitask-cyberthreat-detection", "max_stars_repo_head_hexsha": "c11ade47aabae459338989c08ff0ab4153e51f98", "max_stars_repo_licenses": ["MIT"... |
"""
Creates a GUI window displaying user's face getting tracked in Real Time
"""
# Importing packages
from scipy.spatial import distance as dist
from collections import OrderedDict
import numpy as np
from pyautogui import size
import time
import dlib
import cv2
import mouse
import threading
import math
# Initializing ... | {"hexsha": "1410f8a03bcfcbefc0209577db54de9578261aee", "size": 8229, "ext": "py", "lang": "Python", "max_stars_repo_path": "face_mouse_visual.py", "max_stars_repo_name": "shivang02/FaceMouse", "max_stars_repo_head_hexsha": "cc9a6eeb3a5965e31095db12f3729dbe3e1daddf", "max_stars_repo_licenses": ["CNRI-Python"], "max_star... |
from typing import NamedTuple, Any
import numpy as np
import torch
from gym import Wrapper
from rlutil.dictlist import DictList
from rlutil.experience_memory import ExperienceMemory
def train_batch(agent, batch, optimizer):
agent.train()
loss = agent.loss(batch)
optimizer.zero_grad()
loss.backward... | {"hexsha": "498208ca84255e1d1646dcb0712b24aecb8a0a92", "size": 2402, "ext": "py", "lang": "Python", "max_stars_repo_path": "envs_agents/cartpole/common.py", "max_stars_repo_name": "dertilo/reinforcement-learning", "max_stars_repo_head_hexsha": "b3e0fd2741aa167eccf0143ae7e6176b85ea2b8b", "max_stars_repo_licenses": ["MIT... |
module MaxHelpingHandFlagLogicGate
using ..Ahorn, Maple
@mapdef Entity "MaxHelpingHand/FlagLogicGate" FlagLogicGate(x::Integer, y::Integer, inputFlags::String="flag1,!flag2,flag3", outputFlag::String="flag4", func::String="AND", not::Bool=false)
const placements = Ahorn.PlacementDict(
"Flag Logic Gate (max480's... | {"hexsha": "0660fa0970b967dc47dc62854f4f99476a667e53", "size": 1168, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "Ahorn/entities/maxHelpingHandFlagLogicGate.jl", "max_stars_repo_name": "Kitty-Cats/MaxHelpingHand", "max_stars_repo_head_hexsha": "dbb21b697564a60de86a9aa9892d8c19a1a3b5fe", "max_stars_repo_license... |
"""
This file defines functions to interact with the `.CondaPkg/meta` file which records
information about the most recent resolve.
"""
const META_VERSION = 6 # increment whenever the metadata format changes
@kwdef mutable struct Meta
timestamp::Float64
load_path::Vector{String}
extra_path::Vector{String}... | {"hexsha": "8acba6a6e4986a665d86c5cfda3566fa05508d4a", "size": 2985, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/meta.jl", "max_stars_repo_name": "cjdoris/CondaPkg.jl", "max_stars_repo_head_hexsha": "cb1605b7d85460e013b29c4552358a155987f6a6", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 56, "max... |
[STATEMENT]
lemma biquadratic_solution: fixes p q :: "'a :: field_char_0"
shows "y^4 + p * y^2 + q = 0 \<longleftrightarrow> (\<exists> z. z^2 + p * z + q = 0 \<and> z = y^2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. (y ^ 4 + p * y\<^sup>2 + q = (0::'a)) = (\<exists>z. z\<^sup>2 + p * z + q = (0::'a) \<and> ... | {"llama_tokens": 188, "file": "Cubic_Quartic_Equations_Ferraris_Formula", "length": 1} |
import sys, os, argparse, cv2, glob, math, random, json
FileDirPath = os.path.dirname(os.path.realpath(__file__))
from tk3dv import pyEasel
from PyQt5.QtWidgets import QApplication
import PyQt5.QtCore as QtCore
from PyQt5.QtGui import QKeyEvent, QMouseEvent, QWheelEvent
from EaselModule import EaselModule
from Easel i... | {"hexsha": "d1bd6972de957268446d3132e8fd48d3d0388989", "size": 18120, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/visualizeNOCSMap.py", "max_stars_repo_name": "vikasTmz/tk3dv", "max_stars_repo_head_hexsha": "48430cbc80113ed9c51bdcd3fb577da22af66473", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
import os
import time
from glob import glob
import tensorflow as tf
import numpy as np
from collections import namedtuple
from module import *
from utils import *
def load_weights(saver, sess, model_dir):
ckpt = tf.train.get_checkpoint_state(model_dir)
if ckpt and ckpt.model_checkpoint_path:
ckpt_nam... | {"hexsha": "8fc5646f87d31954f9a50506b149082083ca9dd4", "size": 10147, "ext": "py", "lang": "Python", "max_stars_repo_path": "model.py", "max_stars_repo_name": "ArkaJU/Image-Colorization-CycleGAN", "max_stars_repo_head_hexsha": "1181cdae3006c502ff9385f2407c318f6b79e980", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
%!TEX root = ../informe.tex
\chapter*{Abstract}
| {"hexsha": "e4a4c1259151f49333c6819b1bdb7b6c50e17e90", "size": 49, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "frontmatter/abstract.tex", "max_stars_repo_name": "rnsavinelli/report-essay-template", "max_stars_repo_head_hexsha": "934664881a9863d11df7045aa886dac42a29b2af", "max_stars_repo_licenses": ["MIT"], "ma... |
/-
Copyright (c) 2021 Riccardo Brasca. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Riccardo Brasca
! This file was ported from Lean 3 source module linear_algebra.free_module.basic
! leanprover-community/mathlib commit 4e7e7009099d4a88a750de710909b95487bf0124
! Ple... | {"author": "leanprover-community", "repo": "mathlib3port", "sha": "62505aa236c58c8559783b16d33e30df3daa54f4", "save_path": "github-repos/lean/leanprover-community-mathlib3port", "path": "github-repos/lean/leanprover-community-mathlib3port/mathlib3port-62505aa236c58c8559783b16d33e30df3daa54f4/Mathbin/LinearAlgebra/FreeM... |
"""
plot_energy(df::DataFrame)
"""
function plot_energy(df::DataFrame) end
"""
plot_heat_capacity(df::DataFrame)
"""
function plot_heat_capacity(df::DataFrame) end
"""
plot_magnetization(df::DataFrame)
"""
function plot_magnetization(df::DataFrame) end
"""
plot_susceptibility(df::DataFrame)
""... | {"hexsha": "35710c69e766ad776c0c508cc9c6a00c1fbc8d51", "size": 467, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/plotting_methods.jl", "max_stars_repo_name": "cameronperot/MagSim.jl", "max_stars_repo_head_hexsha": "1d47dc89c22f0ceb6b171b3897ee4b2065c34565", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
[STATEMENT]
lemma (in ring) inv_neg_one [simp]: "inv (\<ominus> \<one>) = \<ominus> \<one>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. inv (\<ominus> \<one>) = \<ominus> \<one>
[PROOF STEP]
by (simp add: inv_char local.ring_axioms ring.r_minus) | {"llama_tokens": 104, "file": null, "length": 1} |
import plotly.graph_objects as go
from plotly.subplots import make_subplots
import numpy as np
import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
import pandas as pd
import json
#fnames = ["res_figure10Mill.csv"]#"res_25avg.csv","res_35avg.csv... | {"hexsha": "7242e125be95f081146c644103c20dc6eb676d4e", "size": 16336, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/temp_dash_server.py", "max_stars_repo_name": "dczifra/epidemic_seeding", "max_stars_repo_head_hexsha": "cd9534a8067e053c575e19df6354d03cba628ee6", "max_stars_repo_licenses": ["MIT"], "max_sta... |
[STATEMENT]
lemma coprime_iff_invertible'_nat:
assumes "m > 0"
shows "coprime a m \<longleftrightarrow> (\<exists>x. 0 \<le> x \<and> x < m \<and> [a * x = Suc 0] (mod m))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. coprime a m = (\<exists>x\<ge>0. x < m \<and> [a * x = Suc 0] (mod m))
[PROOF STEP]
proof -
[... | {"llama_tokens": 986, "file": null, "length": 8} |
import sys, os, copy
import numpy as np
import math
from compiler.ast import flatten
from collections import Counter
import pickle
from OwnLib import *
import datetime
# This file containts the functions of the node operation
def TreeNode_Dict_Init(world, config_i, velocity_i, contact_link_dictionary, contact_Status_D... | {"hexsha": "a691c05f75b0aa8203b0d1c2d669ceace9585f75", "size": 11039, "ext": "py", "lang": "Python", "max_stars_repo_path": "Functions/Node_Fun.py", "max_stars_repo_name": "ShihaoWang/Contact-Transition-Tree", "max_stars_repo_head_hexsha": "cf53aaea8a3a61d3eb92b96a6ca16a3b0c791afc", "max_stars_repo_licenses": ["MIT"], ... |
import torch
import torch.nn as nn
from .ghiasi import Ghiasi
from .stylePredictor import StylePredictor
import numpy as np
import sys
from os.path import join, dirname
device = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu')
class StyleAugmentor(nn.Module):
def __init__(self):
super(Style... | {"hexsha": "3f4829a942f4330d88d73d1aba4a618f2a62f239", "size": 3890, "ext": "py", "lang": "Python", "max_stars_repo_path": "Dassl/dassl/modeling/backbone/styleaugment/styleaug/styleAugmentor.py", "max_stars_repo_name": "xch-liu/geom-tex-dg", "max_stars_repo_head_hexsha": "59a93684ae13e7d962908e9971fcbfba66d90b80", "max... |
from collections import OrderedDict
import numpy as np
import torch
from torch.distributions import Normal
from scvi import REGISTRY_KEYS
from scvi._compat import Literal
from scvi.distributions import NegativeBinomial
from scvi.module.base import BaseModuleClass, LossRecorder, auto_move_data
from scvi.nn import FCLa... | {"hexsha": "60c7d6a0ae58b9195bdeaaea7b244cb3e0abc1c2", "size": 12258, "ext": "py", "lang": "Python", "max_stars_repo_path": "scvi/module/_mrdeconv.py", "max_stars_repo_name": "martinkim0/scvi-tools", "max_stars_repo_head_hexsha": "a5a7c596d1057a9fcd46dafd2a935b8ebbfbbc8d", "max_stars_repo_licenses": ["BSD-3-Clause"], "... |
program election_data
implicit none
! interface declaration
interface
! function constructs and returns header row
function construct_header(flag) result(header)
character (len=*), intent(in) :: flag
character (len=256) :: header
end function construct_header
! functio... | {"hexsha": "e2a5c896bb950da2870ff6177df703fa51ebda6f", "size": 6712, "ext": "f95", "lang": "FORTRAN", "max_stars_repo_path": "tabulate.f95", "max_stars_repo_name": "joshroybal/us_election_table_files", "max_stars_repo_head_hexsha": "a8a306d98c43eef93842c532a219ab6ea79e72d9", "max_stars_repo_licenses": ["MIT"], "max_sta... |
# cross-validation mlp ensemble on blobs dataset
from sklearn.datasets.samples_generator import make_blobs
from sklearn.model_selection import KFold
from sklearn.metrics import accuracy_score
from keras.utils import to_categorical
from keras.models import Sequential
from keras.layers import Dense
from matplotlib import... | {"hexsha": "2dfa1311ff41d244762f5cfe31dd244da8dbad20", "size": 3165, "ext": "py", "lang": "Python", "max_stars_repo_path": "corss.py", "max_stars_repo_name": "timiwany/Ensemble-NN", "max_stars_repo_head_hexsha": "25da498ccaff3cf360a87586f8a03b526e06be89", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count": nu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.