text stringlengths 0 1.25M | meta stringlengths 47 1.89k |
|---|---|
using BenchmarkTools, Test, CUDA
a = CUDA.zeros(1024)
function kernel(a)
i = threadIdx().x
a[i] += 1
return
end
@cuda threads=length(a) kernel(a)
##
N = 2^20
x_d = CUDA.fill(1.0f0, N) # a vector stored on the GPU filled with 1.0 (Float32)
y_d = CUDA.fill(2.0f0, N) # a vector stored on the GPU filled ... | {"hexsha": "e5e44f76994b10cf1b27d82920f3d07fb5571ef8", "size": 1159, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "scripts/cuda_debug.jl", "max_stars_repo_name": "doddgray/OptiMode.jl", "max_stars_repo_head_hexsha": "8d3185000218e0094c01b83f420dcebdf270b2c3", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
#!/usr/bin/env python3
import numpy as np
import tensorflow as tf
import cart_pole_evaluator
class Network:
def __init__(self, threads, seed=42):
# Create an empty graph and a session
graph = tf.Graph()
graph.seed = seed
self.session = tf.Session(graph = graph, config=tf.ConfigProt... | {"hexsha": "61a0ea735248d83dd4994c5d1afb197d463c1a0d", "size": 4646, "ext": "py", "lang": "Python", "max_stars_repo_path": "charles-university/deep-learning/labs/12/reinforce.py", "max_stars_repo_name": "Hyperparticle/lct-master", "max_stars_repo_head_hexsha": "8acb0ca8fe14bb86305f235e3fec0a595acae2de", "max_stars_repo... |
import chess
import numpy as np
import time
from numpy.random import default_rng
rng = default_rng()
class MCTS_graph:
def __init__(self,agent):
self.root=agent.root
self.temperature = agent.temperature
def make_graph(self,depth=1000):
self.cont=0
self.nodes = {}
... | {"hexsha": "d4f27f5a3133c797071081b88b7c6d69a9460a27", "size": 7779, "ext": "py", "lang": "Python", "max_stars_repo_path": "chesslab/agent_mcts.py", "max_stars_repo_name": "yniad/chesslab", "max_stars_repo_head_hexsha": "4720bfd093e9657798953702a1fa918f85991f65", "max_stars_repo_licenses": ["MIT"], "max_stars_count": n... |
#include <string>
#include <iostream>
#include <iomanip>
#include <fstream>
#include <boost/filesystem.hpp>
#include "res2h.h"
#include "res2hutils.hpp"
struct FileData {
boost::filesystem::path inPath;
boost::filesystem::path outPath;
std::string internalName;
std::string dataVariableName;
std::string sizeVari... | {"hexsha": "69fae17903c065ca3ede622d5ff2a554d803d064", "size": 36469, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "data/res2h-master/src/res2h.cpp", "max_stars_repo_name": "tlanks/esbusyness", "max_stars_repo_head_hexsha": "41ed9e6b552585476c81f2f89b9e3d539c54d4ab", "max_stars_repo_licenses": ["Apache-2.0", "MI... |
\section{Discussion}\label{section:discussion}
We have introduced relative suffix trees (\RCST), a new kind of compressed suffix tree for repetitive sequence collections. Our \RCST{} compresses the suffix tree of an individual sequence relative to the suffix tree of a reference sequence. It combines an already known... | {"hexsha": "6ca296c09b4e58f46fa017390b2bc475b10b2d42", "size": 2681, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "rcst/concl.tex", "max_stars_repo_name": "jltsiren/relative-fm", "max_stars_repo_head_hexsha": "68c11f172fd2a546792aad3ad81ee1e185b5ee7f", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 16, "... |
import os
import numpy.linalg as la
import numpy as np
from skimage.draw import line_nd
from os.path import join, expanduser
from dipy.io import read_bvals_bvecs
from dipy.io.image import load_nifti, save_nifti
rel_path = '~/.dnn/datasets/synth'
name = 'synth'
def process_movement():
bvals, bvecs = load_bvals_... | {"hexsha": "cf71e616c93f24230b80d9ff351ad76474645a18", "size": 2586, "ext": "py", "lang": "Python", "max_stars_repo_path": "dataset/mnist/dwi/movement.py", "max_stars_repo_name": "cassianobecker/dnn", "max_stars_repo_head_hexsha": "bb2ea04f77733de9df10f795bb049ac3b9d30478", "max_stars_repo_licenses": ["MIT"], "max_star... |
[STATEMENT]
lemma vars_of_instances:
shows "vars_of (subst t \<sigma>)
= \<Union> { V. \<exists>x. (x \<in> (vars_of t)) \<and> (V = vars_of (subst (Var x) \<sigma>)) }"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. vars_of (t \<lhd> \<sigma>) = \<Union> {V. \<exists>x. x \<in> vars_of t \<and> V = vars_of (... | {"llama_tokens": 9771, "file": "SuperCalc_terms", "length": 44} |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.neural_network import MLPRegressor
from sklearn.model_selection import LeaveOneGroupOut
from plot_with_PE_imputation import plot_with_PE_imputation
import matplotlib.colors as colors
from mpl_toolkits.axes_grid1 import make_axes_locata... | {"hexsha": "e6bbf3ea06862e0e492948c45271192370b86fdb", "size": 3154, "ext": "py", "lang": "Python", "max_stars_repo_path": "MLP_mean_impute.py", "max_stars_repo_name": "suniipang/PE_Imputation", "max_stars_repo_head_hexsha": "836b9c687883ac87f091785fc17fded6d122be83", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
[STATEMENT]
lemma ns_mul_ext_bottom: "(A,{#}) \<in> ns_mul_ext ns s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. (A, {#}) \<in> ns_mul_ext ns s
[PROOF STEP]
by (auto intro!: ns_mul_extI) | {"llama_tokens": 92, "file": "Weighted_Path_Order_Multiset_Extension2", "length": 1} |
from policy import LSTMPolicy, MlpPolicyValue
import gym
import gym_compete
import pickle
import sys
import argparse
import tensorflow as tf
import numpy as np
def load_from_file(param_pkl_path):
with open(param_pkl_path, 'rb') as f:
params = pickle.load(f)
return params
def setFromFlat(var_list, flat... | {"hexsha": "d2997f9fd0befd133e3a7728c04ecbf4d5053abb", "size": 4910, "ext": "py", "lang": "Python", "max_stars_repo_path": "multiagent-competition/main.py", "max_stars_repo_name": "MachengShen/torchbeast", "max_stars_repo_head_hexsha": "3853fdda44db4d91d773ff2a3db3658a02fa1a15", "max_stars_repo_licenses": ["Apache-2.0"... |
# -*- coding:utf-8 -*-
###############################################################################
# Rutap Bot 2019 Hangul Clock Module #
# 해당 모듈은 한글시계에서 파생된 소프트웨어로서, GPLv3 라이선스의 적용을 받습니다. #
# 모듈 사용시 원작자분께 허락을 받으시길 바랍니다. #
# ... | {"hexsha": "1d4fc7c4808fd7099ec15a4757909fe0a8de1007", "size": 2263, "ext": "py", "lang": "Python", "max_stars_repo_path": "hangul_clock.py", "max_stars_repo_name": "HyunsDev/Rutap-bot_Discord", "max_stars_repo_head_hexsha": "13f664864953e56a4bb887fd9cc29519a58b49db", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_s... |
from __future__ import division, absolute_import, print_function
import glob
import argparse
import os
import shutil
import pdb
import numpy as np
from tqdm import tqdm
CONTINUAL_LEARNING_LABELS = ['CC', 'SC', 'EC', 'SQC']
CL_LABEL_KEY = "continual_learning_label"
def main():
parser = argparse.ArgumentParser(d... | {"hexsha": "21b874d5a5239f77ef89feee4906bb387aeb0323", "size": 11782, "ext": "py", "lang": "Python", "max_stars_repo_path": "environments/dataset_merger.py", "max_stars_repo_name": "sun-te/robotics-rl-srl", "max_stars_repo_head_hexsha": "d321085b81eef63dcac58028af87eec6de7633b4", "max_stars_repo_licenses": ["MIT"], "ma... |
from pathlib import Path
import numpy as np
from tensorflow import keras
from tensorflow.keras.preprocessing.image import load_img
class MaskSequence(keras.utils.Sequence):
def __init__(self, base_path, split, batch_size, img_size):
self.batch_size = batch_size
self.img_size = img_size
s... | {"hexsha": "7b2e0c5eede2942dbe7d1c75add953385cc3089d", "size": 1916, "ext": "py", "lang": "Python", "max_stars_repo_path": "fashiondatasets/MaskSequence.py", "max_stars_repo_name": "NiklasHoltmeyer/FashionDatasets", "max_stars_repo_head_hexsha": "a9309f90abd6bff739ecffafd69cf52506f2cb97", "max_stars_repo_licenses": ["M... |
%% Copyright (C) 2014, 2016-2017, 2019, 2022 Colin B. Macdonald
%% Copyright (C) 2020 Mike Miller
%% Copyright (C) 2020 Fernando Alvarruiz
%%
%% This file is part of OctSymPy.
%%
%% OctSymPy is free software; you can redistribute it and/or modify
%% it under the terms of the GNU General Public License as published
%% b... | {"author": "cbm755", "repo": "octsympy", "sha": "c1ecd1e08f027d5101d0f4250dfc496aa98c8bcd", "save_path": "github-repos/MATLAB/cbm755-octsympy", "path": "github-repos/MATLAB/cbm755-octsympy/octsympy-c1ecd1e08f027d5101d0f4250dfc496aa98c8bcd/inst/@sym/private/mat_rclist_asgn.m"} |
import numpy as np
import os
import textwrap
import tkinter as tk
import tkinter.ttk as tk_ttk
import matplotlib
matplotlib.use('TkAgg')
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
TREEVIEW_SELECT_EVENT = '<<treeview_select>>'
class FullDisplay(tk.Frame):
def __init__(self, master):
s... | {"hexsha": "4474ea2f2b460f2931327cd2b8210c28ed377ca0", "size": 5683, "ext": "py", "lang": "Python", "max_stars_repo_path": "data_browser/data_browser.py", "max_stars_repo_name": "gfetterman/file_browser", "max_stars_repo_head_hexsha": "8f54fb0f3a4a1fcce93b98ae44431accd943ac00", "max_stars_repo_licenses": ["MIT"], "max_... |
[STATEMENT]
lemma rt_graph_not_dip [dest]:
"\<And>ip ip' \<sigma> dip. (ip, ip') \<in> rt_graph \<sigma> dip \<Longrightarrow> ip \<noteq> dip"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<And>ip ip' \<sigma> dip. (ip, ip') \<in> rt_graph \<sigma> dip \<Longrightarrow> ip \<noteq> dip
[PROOF STEP]
unfolding rt... | {"llama_tokens": 261, "file": "AODV_variants_c_gtobcast_C_Loop_Freedom", "length": 2} |
module LibRealSense
# Load in `deps.jl`, complaining if it does not exist
const depsjl_path = joinpath(@__DIR__, "..", "deps", "deps.jl")
if !isfile(depsjl_path)
error("LibRealSense was not build properly. Please run Pkg.build(\"LibRealSense\").")
end
include(depsjl_path)
# Module initialization function
function... | {"hexsha": "575c309884d625c1fd6887594b6d814be89b08da", "size": 977, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/LibRealSense.jl", "max_stars_repo_name": "UnofficialJuliaMirrorSnapshots/RealSense.jl-1d20419d-a1bd-598e-846b-24709a6a9336", "max_stars_repo_head_hexsha": "3cdc32505064468416fc891dfd877daf265d48... |
import time
from random import *
import numpy as np
import matplotlib.pyplot as plt
def question_1():
# 初始化生成器
seed()
# 返回给定范围内的随机数
print(randrange(-10, 8))
# 返回给定范围内的随机数
print(randint(0, 20))
# 返回给定序列的随机元素
print(choice([1, 2, 5, 3, 5, 7]))
# 返回序列的给定样本
print(sample([1, 2, 3, 5,... | {"hexsha": "d964f09281ac1a16b182274671829ab480293f5a", "size": 2703, "ext": "py", "lang": "Python", "max_stars_repo_path": "basic_exercises/experiment_3.py", "max_stars_repo_name": "vuhe/LearnPython", "max_stars_repo_head_hexsha": "0a081a85456557ae542925cce950b23313c3c9b9", "max_stars_repo_licenses": ["MIT"], "max_star... |
/*
* VisualServoing is a tutorial program for introducing students to
* robotics.
*
* Copyright 2009, 2010 Kevin Quigley <kevin.quigley@gmail.com> and
* Marsette Vona <vona@ccs.neu.edu>
*
* VisualServoing is free software: you can redistribute it andor modify
* it under the terms of the GNU General Public Lice... | {"hexsha": "0dbc5c42afbc92ce92ea827adfc0d1d19f68e9d9", "size": 19550, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "Source/rvctools 1/robot/interfaces/crustcrawler/VisualServoing.cpp", "max_stars_repo_name": "Maria-Paulacf/PlumaBot", "max_stars_repo_head_hexsha": "d4bf2e667b88e955f40e33d55db2a8f22c35b47b", "max_... |
import re
import argparse
import emoji
import MeCab
import numpy as np
import matplotlib.pyplot as plt
mecab = MeCab.Tagger('-Ochasen')
letters_pattern = re.compile(r'[a-zA-Z]+')
bracket_pairs = [['[', ']'], ['(', ')'], ['「', '」'], ['『', '』'], ['(', ')'],
['(', ')'], ['(', ')']]
# Non-breaking space... | {"hexsha": "dbe54f8d627f9c590bb3316f3fbe3c593d5c92db", "size": 3836, "ext": "py", "lang": "Python", "max_stars_repo_path": "image-comment-generation/data/clean.py", "max_stars_repo_name": "stonyhu/Image-Commenting", "max_stars_repo_head_hexsha": "eb925a3f99075d8b74c6cabd125f7b9a1f9786d2", "max_stars_repo_licenses": ["A... |
from scipy import spatial
# Find the distance between each embedding
def get_pairwise_dist(embeddings):
return spatial.distance.squareform(spatial.distance.pdist(embeddings, metric="cosine"))
| {"hexsha": "cf15412fe9b44f24408a1a6ad77545e5ccb9c23f", "size": 197, "ext": "py", "lang": "Python", "max_stars_repo_path": "similarity.py", "max_stars_repo_name": "Peter-Devine/text_finder", "max_stars_repo_head_hexsha": "b09ae796511dc1d000b07c12996d25576566e012", "max_stars_repo_licenses": ["MIT"], "max_stars_count": n... |
import numpy as np
from core.buffer.replay_buffer import ReplayBuffer
def test_replay_buffer(mock_transition):
buffer_size = 10
memory = ReplayBuffer(buffer_size=buffer_size)
# test after init
assert memory.buffer_size == buffer_size
assert memory.buffer_index == 0
assert memory.size == 0
... | {"hexsha": "026d6ef7181b7626bb6c14f052acf2ba3a45ee56", "size": 1181, "ext": "py", "lang": "Python", "max_stars_repo_path": "jorldy/test/core/buffer/test_replay_buffer.py", "max_stars_repo_name": "zenoengine/JORLDY", "max_stars_repo_head_hexsha": "1eb867e52a03e0282a55fa612cbc5b5de701ffe7", "max_stars_repo_licenses": ["A... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Jun 3 01:30:26 2021
@author: alan
"""
import tensorflow as tf
import glob
import random
import tensorflow.keras.layers as layers
import numpy as np
from skimage.io import imread
import os
import matplotlib.pyplot as plt
import cv2
from datetime impor... | {"hexsha": "0cec8392a4c8f81e84914c431af17f474b4de088", "size": 6639, "ext": "py", "lang": "Python", "max_stars_repo_path": "segmentacionCNN.py", "max_stars_repo_name": "alandgabriel/LV-Segmentation-with-U-Net", "max_stars_repo_head_hexsha": "7cfad5791e91321a1d4afb73559dbeeeeaee9347", "max_stars_repo_licenses": ["MIT"],... |
# Copyright (c) 2017- Salas Lin (leVirve)
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
import numpy as np
from scipy.optimize import linear_sum_assignment
np.seterr(divide='ignore', invalid='ignore')
def confusion_table(preds, labels, num_class: int):
''' Calculat... | {"hexsha": "b6434705a9c84e6382a3b4cbf62adb6db847cd45", "size": 3520, "ext": "py", "lang": "Python", "max_stars_repo_path": "onegan/metrics/semantic_segmentation.py", "max_stars_repo_name": "leVirve/OneGAN", "max_stars_repo_head_hexsha": "e0d5f387c957fbf599919078d8c6277740015336", "max_stars_repo_licenses": ["MIT"], "ma... |
# Pre-image for Gaussian kernel
# From Kwok and Tsang, "The Pre-Image problem in kernel methods", ICML 2003
# (based on matlab code provided by authors)
# Also:
# Mika, et al. "Kernel PCA and Denoising in Feature Spaces", NIPS 1998
# and
# Teixeira et al. "KPCA Denoising and the pre-image problem revisited", DSP 2008
#... | {"hexsha": "91a4b0374c0e56afcd4ed27c084140bb0e33d2cb", "size": 4055, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/PreImage.jl", "max_stars_repo_name": "daniel-perry/Kernel.jl", "max_stars_repo_head_hexsha": "da7255ffe7b9e1341d4f2decc82128451dc3d383", "max_stars_repo_licenses": ["MIT"], "max_stars_count": n... |
#!/usr/bin/env python
import numpy as np
def get_input(prompt, default):
return input(prompt) or str(default)
N = int(get_input('Number of NUWS dimensions [1]: ', 1))
cos_power = int(get_input('Power of window function, n (cos^n) [2]: ',2))
Nmax = int(get_input('Maximum number of repeats [16]: ', 16))
print('Ple... | {"hexsha": "2669a329c656d228dc07c5c54eb98fa9b7e60c61", "size": 1752, "ext": "py", "lang": "Python", "max_stars_repo_path": "util/make-nuws.py", "max_stars_repo_name": "chriswaudby/pp", "max_stars_repo_head_hexsha": "a1da83b5cba5ebb5e42b846478dc4bce8bace875", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, ... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import torch
import numpy as np
from models.losses import FocalLoss
from models.losses import RegL1Loss, RegLoss, NormRegL1Loss, RegWeightedL1Loss
from models.decode import ctdet_decode
from models.utils impor... | {"hexsha": "9c10d03971a33006c42d75000aaf91d4f16f01dc", "size": 5626, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/lib/trains/ctdet.py", "max_stars_repo_name": "hrlblab/CircleNet", "max_stars_repo_head_hexsha": "219aa47fa4dc4f362b28448c0dcd41b29c4f1166", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
# -*- coding: utf-8 -*-
"""
@File : generator.py
@Time : 2019/12/22 下午8:22
@Author : yizuotian
@Description : 中文数据生成器
"""
import random
import cv2
import numpy as np
from PIL import Image, ImageDraw, ImageFont
from torch.utils.data.dataset import Dataset
from fontutils import FONT_CHARS_DICT
def rand... | {"hexsha": "632d1a859abe80752ea5bb45da5c96aecc64a69f", "size": 7090, "ext": "py", "lang": "Python", "max_stars_repo_path": "generator.py", "max_stars_repo_name": "yizt/crnn.pytorch", "max_stars_repo_head_hexsha": "2f626841f35c8f69a23518ee2496554cac080cff", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count": 1... |
from keras.models import load_model
from keras.models import Sequential
from keras.layers.core import Dense, Dropout, Activation, Flatten
from keras.layers.convolutional import Conv2D, MaxPooling2D, AveragePooling2D
from keras.layers.advanced_activations import LeakyReLU, PReLU
from keras.utils import np_utils, generic... | {"hexsha": "41b29c5438c65a899dde510ce8ec5290216632c7", "size": 1016, "ext": "py", "lang": "Python", "max_stars_repo_path": "Assignment06/test.py", "max_stars_repo_name": "Ericbrod10/Deep-Learning", "max_stars_repo_head_hexsha": "5b0a01597ce19f2da5bf45b76023b898c494f46a", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
classdef ControlMode < Simulink.IntEnumType
enumeration
None(0)
Manual(1)
Acro(2)
Stabilize(3)
ALTCTL(4)
POSCTL(5)
Offboard(6)
end
methods (Static)
function defaultValue = getDefaultValue()
% GETDEFAULTVALUE Returns the de... | {"author": "Firmament-Autopilot", "repo": "FMT-Model", "sha": "adb85b9379cb4268f60bd8414f35aacfbdf8dec1", "save_path": "github-repos/MATLAB/Firmament-Autopilot-FMT-Model", "path": "github-repos/MATLAB/Firmament-Autopilot-FMT-Model/FMT-Model-adb85b9379cb4268f60bd8414f35aacfbdf8dec1/bus/enum/ControlMode.m"} |
from pymc import *
from numpy import ones, array
# Samples for each dose level
n = 5 * ones(4, dtype=int)
# Log-dose
dose = array([-.86, -.3, -.05, .73])
# Logit-linear model parameters
alpha = Normal('alpha', 0, 0.01)
beta = Normal('beta', 0, 0.01)
# Calculate probabilities of death
theta = Lambda('theta', lambda a... | {"hexsha": "422d7a35ebc83cfaa94575b141bc8e5f9d476904", "size": 641, "ext": "py", "lang": "Python", "max_stars_repo_path": "pymc/examples/gelman_bioassay.py", "max_stars_repo_name": "kyleabeauchamp/pymc", "max_stars_repo_head_hexsha": "6ce0094584f1fa00eed0b2ecee533c2fb7f190d6", "max_stars_repo_licenses": ["AFL-3.0"], "m... |
###################################################################
# Imports e inits #
###################################################################
import streamlit as st
import yfinance as yf
import pandas as pd
import numpy as np
import plotly.express as px
###... | {"hexsha": "828b56074b60e1d17662a677c47a1baf95d292a2", "size": 3114, "ext": "py", "lang": "Python", "max_stars_repo_path": "app-st.py", "max_stars_repo_name": "appznoix/streamlit-yfinance-range-hist", "max_stars_repo_head_hexsha": "4f8a4f513a2eec47299f0530f0c688c2707b38cc", "max_stars_repo_licenses": ["MIT"], "max_star... |
import math
import numpy as np
import tensorflow as tf
def identity_initializer(scale=1.0):
"""Identity initializer by Quoc V. Le et al.
This is also recommended by at least one paper to initialize
the weights matrix in a RNN.
References:
Paper: Quoc V. Le et al., http://arxiv.org/abs/1504.00... | {"hexsha": "04c69ca7b9953161f587bd3a91c8271ec075a3e3", "size": 4059, "ext": "py", "lang": "Python", "max_stars_repo_path": "tensorlight/init.py", "max_stars_repo_name": "bsautermeister/tensorlight", "max_stars_repo_head_hexsha": "3139cf508a4d4d76e30c1591e26933d117883b49", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import cv2
import os, sys
from numba import jit
from etaprogress.progress import ProgressBar
"""Previous version of Kullback Leivier Divergence(KLD).
This module calculate real values of KLD of optical flow with motion platform vector. See
https:/... | {"hexsha": "600c0d45d4eeabb0031c85f54294b071a93dc8bf", "size": 5436, "ext": "py", "lang": "Python", "max_stars_repo_path": "test/test4.py", "max_stars_repo_name": "nearj/mpvr-motionfiltering", "max_stars_repo_head_hexsha": "478304391e031a11bd15a604a272017ce8e48abf", "max_stars_repo_licenses": ["MIT"], "max_stars_count"... |
@doc raw"""
Entropy <: AbstractImageBinarizationAlgorithm
Entropy()
binarize([T,] img, f::Entropy)
binarize!([out,] img, f::Entropy)
An algorithm for finding the binarization threshold value using
the entropy of the image histogram.
# Output
Return the binarized image as an `Array{Gray{T}}` of size ... | {"hexsha": "825602a45a5e2a236b3c4f42604bd5adb77810d1", "size": 2992, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/algorithms/entropy.jl", "max_stars_repo_name": "UnofficialJuliaMirror/ImageBinarization.jl-cbc4b850-ae4b-5111-9e64-df94c024a13d", "max_stars_repo_head_hexsha": "e6b3b13279196544e815c821e45e2bef... |
import numpy as np
from multiagent.core import World, Landmark
from multiagent.scenario import BaseScenario
from particle_environments.mager.world import MortalAgent, HazardousWorld
from particle_environments.mager.observation import format_observation
from particle_environments.common import is_collision, distance, de... | {"hexsha": "dfebad03b12b1249c6d8085c1387992b76a74cd6", "size": 5919, "ext": "py", "lang": "Python", "max_stars_repo_path": "particle_environments/mager/scenarios/old_ergo_spread.py", "max_stars_repo_name": "rallen10/ergo_particle_gym", "max_stars_repo_head_hexsha": "5bb8073d880ab1da60ee333d892ea8a4720f3396", "max_stars... |
import numpy as np
import pandas as pd
import geopandas as gpd
from geopandas import GeoDataFrame, GeoSeries
import pysal
# Load initial csv file
routing = pd.read_csv('/var/otp/scripting/output/otp-scripting-newark-parcels.csv')
routing["min_time"] = routing["min_time"].astype(float)
# Split out by mode of transport... | {"hexsha": "20d8fe8c4a8f45bdf04bb081b27c64b317383aba", "size": 4095, "ext": "py", "lang": "Python", "max_stars_repo_path": "make-shp.py", "max_stars_repo_name": "pjsier/newark-parcel-routing", "max_stars_repo_head_hexsha": "ade320dfd3525eee3e1668b5c2ffa6b987be7176", "max_stars_repo_licenses": ["MIT"], "max_stars_count"... |
from __future__ import print_function
import torch.nn as nn
from torch.autograd import Variable
import torch as t
import torch.cuda as torch
import torch.nn.functional as F
import time
from collections import defaultdict
import random
import math
import sys
import argparse
import numpy as np
# much of the beginning i... | {"hexsha": "8805d353f5b2fa4480b4a39690a6c759930389fb", "size": 7262, "ext": "py", "lang": "Python", "max_stars_repo_path": "08-condlm-pytorch/cuda_version.py", "max_stars_repo_name": "tinySean/nn4nlp-tensorflow", "max_stars_repo_head_hexsha": "17d64427ad3cf276f2d43eac706d14a6145cc3e6", "max_stars_repo_licenses": ["Apac... |
/*=========================================================================
Program: Visualization Toolkit
Module: TestBoostAlgorithms.cxx
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This softw... | {"hexsha": "1066b5b80be81a45e45a832b7d1399ae42acfee0", "size": 3637, "ext": "cxx", "lang": "C++", "max_stars_repo_path": "Infovis/BoostGraphAlgorithms/Testing/Cxx/TestBoostBetweennessClustering.cxx", "max_stars_repo_name": "jasper-yeh/VtkDotNet", "max_stars_repo_head_hexsha": "84b56f781cb511694e4380cebfb245bbefe2560b",... |
#include "net/rpc/server.h"
#include <algorithm>
#include <cstddef>
#include <cstdint>
#include <functional>
#include <optional>
#include <system_error>
#include <utility>
#include <boost/icl/interval_set.hpp>
#include <boost/smart_ptr/intrusive_ptr.hpp>
#include <boost/smart_ptr/intrusive_ref_counter.hpp>
#include "b... | {"hexsha": "c9b6cf430815cdc4a150b1a72e825e4443f3de65", "size": 10300, "ext": "cc", "lang": "C++", "max_stars_repo_path": "net/rpc/server.cc", "max_stars_repo_name": "iceboy233/trunk", "max_stars_repo_head_hexsha": "83024a83f07a587e00a3f2e1906361de521d8f12", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count": ... |
'''
GloVe embedding functions
Created June, 2017
Author: xiaodl@microsoft.com
'''
import numpy as np
import tqdm
from .tokenizer import normalize_text
from .utils import count_lines
def load_emb_vocab(path, dim=300, fast_vec_format=False):
vocab = set()
num_lines = count_lines(path)
with open(path, enco... | {"hexsha": "58c6275672ae3d9b6fc16adae28d001458877237", "size": 1439, "ext": "py", "lang": "Python", "max_stars_repo_path": "my_utils/word2vec_utils.py", "max_stars_repo_name": "ashishbaghudana/san_mrc", "max_stars_repo_head_hexsha": "03ed7d94c735f1fe2854bb9c208385b5fde44905", "max_stars_repo_licenses": ["BSD-3-Clause"]... |
# =============================================================================
# Authors: PAR Government
# Organization: DARPA
#
# Copyright (c) 2016 PAR Government
# All rights reserved.
# ==============================================================================
from maskgen.mask_rules import Probe, VideoSegmen... | {"hexsha": "3f728bf7aa2ba6be0c8627b7baed851ceae854eb", "size": 7598, "ext": "py", "lang": "Python", "max_stars_repo_path": "maskgen/serialization/probes.py", "max_stars_repo_name": "j-h-m/Media-Journaling-Tool", "max_stars_repo_head_hexsha": "4ab6961e2768dc002c9bbad182f83188631f01bd", "max_stars_repo_licenses": ["BSD-3... |
"""
Script to create grid(s), given input args.
"""
# Authors: Gianni Barlacchi <gianni.barlacchi@gmail.com>
import argparse
import sys
import logging
import pandas as pd
import gensim
import pkg_resources
from geol.geol_logger.geol_logger import logger
from geol.utils import utils
import re
import os
import numpy as... | {"hexsha": "25965e76b296c05f9e2807f144e0ac0f709f2a6e", "size": 3914, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/SPTK_matrix.py", "max_stars_repo_name": "PyGeoL/GeoL", "max_stars_repo_head_hexsha": "67a5bd2f63091e19041094c14d419055fa5ce6f0", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 8, "... |
[STATEMENT]
lemma map_ide_simp [simp]:
assumes "A.ide a"
shows "map a = B.inv (\<tau> a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. local.map a = B.inv (\<tau> a)
[PROOF STEP]
using assms map_def
[PROOF STATE]
proof (prove)
using this:
A.ide a
local.map = \<tau>'.map
goal (1 subgoal):
1. local.map a =... | {"llama_tokens": 159, "file": "Category3_NaturalTransformation", "length": 2} |
import ctypes
import numpy
import six
import cupy
from cupy import cuda
def prod(args, init=1):
for arg in args:
init *= arg
return init
def get_reduced_dims(shape, strides, itemsize):
if not shape:
return (), ()
elif 0 in shape:
return (0,), (itemsize,)
reduced_shape =... | {"hexsha": "2decec416a21e4aa4a601450d14dceaf3ce9c29a", "size": 3834, "ext": "py", "lang": "Python", "max_stars_repo_path": "cupy/internal.py", "max_stars_repo_name": "umitanuki/chainer", "max_stars_repo_head_hexsha": "225c56b233e684ff4855451d2af4c2fb66915f21", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null... |
# Class contains auxiliary methods
from numpy import array
from numpy.linalg import det
from .Intersection import Intersection
def isValidPos(oPos, sl):
if oPos < 0 or oPos >= len(sl):
return False
return True
# credit to Dr. Sheehy for provinding orientation class code
def orientation(*points):
d = array(... | {"hexsha": "f7dd69ad24d07da6c84cec4802a6ccd15682c9d3", "size": 1636, "ext": "py", "lang": "Python", "max_stars_repo_path": "linesegmentintersections/helper.py", "max_stars_repo_name": "LiahNikol/line-segment-intersections", "max_stars_repo_head_hexsha": "0a2eb14b54619568d2b79839319c079b27a53d77", "max_stars_repo_licens... |
function mdl_outer_ode!(device_states,
output_ode,
f0,
device::DynInverter{C,VirtualInertiaQdroop{VirtualInertia,ReactivePowerDroop},VC,DC,P,F}) where {C <: Converter,
VC<: VSControl,
... | {"hexsha": "2845c571984bf871329aea94684821ccb441283f", "size": 3006, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/models/inverter_models/outer_control_models.jl", "max_stars_repo_name": "UnofficialJuliaMirror/LITS.jl-86b0dc02-7903-11e9-325f-f195ca7e6c1a", "max_stars_repo_head_hexsha": "e27e29e21487737d5faa... |
# Hep Recommender
> A recommender system for scientific articles in the field of High Energy Physics.
- toc: true
- badges: true
- comments: true
- categories: [jupyter]
- image: images/hep_recommender.png
# Introduction
In this note I want to discuss [hep-recommender](https://hep-recommender.herokuapp.com/), a rec... | {"hexsha": "46c1c34efc98f4665aef8c0d409aaac66f6206e6", "size": 19499, "ext": "ipynb", "lang": "Jupyter Notebook", "max_stars_repo_path": "_notebooks/2020-02-20-hep-recommender.ipynb", "max_stars_repo_name": "celis/personal", "max_stars_repo_head_hexsha": "c10d3159f830c463711aec6db6e6189c09c50449", "max_stars_repo_licen... |
#include <HElib/FHE.h>
#include <HElib/FHEContext.h>
#include <HElib/EncryptedArray.h>
#include <HElib/NumbTh.h>
#include "SMP/Matrix.hpp"
#include "SMP/Timer.hpp"
#include "SMP/literal.hpp"
#include "SMP/network/net_io.hpp"
#include <boost/asio.hpp>
#include <boost/asio/ip/tcp.hpp>
#include <iostream>
#include <nume... | {"hexsha": "ce43fbc2979c61026c432f9c88b97580afeb46dd", "size": 11274, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "src/MiniONN.cpp", "max_stars_repo_name": "Vampsj/SMP", "max_stars_repo_head_hexsha": "ec332ed29bc33685d050478090e0a679ddef0e4d", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_st... |
(* Definitions and theory of natural numbers that is useful in cryptographi proofs. *)
Set Implicit Arguments.
Require Export Arith.
Require Export Omega.
Require Export Arith.Div2.
Require Export Coq.Numbers.Natural.Peano.NPeano.
Require Import Coq.NArith.BinNat.
Lemma mult_same_r : forall n1 n2 n3,
n3 > 0 ->
... | {"author": "FreeAndFair", "repo": "RLA", "sha": "4295e4bb700ebbfe69affeb35dda7ed42273c3a1", "save_path": "github-repos/coq/FreeAndFair-RLA", "path": "github-repos/coq/FreeAndFair-RLA/RLA-4295e4bb700ebbfe69affeb35dda7ed42273c3a1/src/fcf/StdNat.v"} |
import Base.map
# Utility structure for collections of samples.
mutable struct Particles{C}
calls::Vector{C}
lws::Vector{Float64}
lmle::Float64
end
map(fn::Function, ps::Particles) = map(fn, ps.calls)
include("inference/is.jl")
include("inference/pf.jl")
include("inference/mh.jl")
include("inference/vi.j... | {"hexsha": "53652d93c6cd235c25c795cce8a37686f66c5351", "size": 4579, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/inference.jl", "max_stars_repo_name": "mschauer/Jaynes.jl", "max_stars_repo_head_hexsha": "f76ec08b4e4eb517ae55c52232b0f6ec0914a469", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null... |
[STATEMENT]
lemma HT_Wait: "HT(Wait(n)) = Wait(n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. HT (Wait n) = Wait n
[PROOF STEP]
by (rel_auto) | {"llama_tokens": 69, "file": "UTP_utp_examples_utp_simple_time", "length": 1} |
include("straight_roadways.jl")
include("vehicles.jl") | {"hexsha": "c99c7151f6992e90f21981ce6de6ef657fe9b0d5", "size": 54, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/1d/main.jl", "max_stars_repo_name": "wxuejing/AutoViz.jl", "max_stars_repo_head_hexsha": "91a6b57949f5d839bda55ad18d81667d6930da09", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "... |
[STATEMENT]
lemma ld_alt[simp]: "n > 0 \<Longrightarrow> ld n = Max {i. 2 ^ i \<le> n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. 0 < n \<Longrightarrow> ld n = Max {i. 2 ^ i \<le> n}
[PROOF STEP]
proof (safe intro!: Max_eqI[symmetric])
[PROOF STATE]
proof (state)
goal (3 subgoals):
1. 0 < n \<Longrightarrow> ... | {"llama_tokens": 2189, "file": "Formula_Derivatives_WS1S_Formula", "length": 20} |
import numpy as np
import cv2
def detect_shadow(img_bgr):
kernel = np.ones((5, 5), np.uint8)
height, width, depth = img_bgr.shape
black_img = np.zeros((height, width, 1), dtype="uint8")
img_hsv: np.ndarray = cv2.cvtColor(img_bgr, cv2.COLOR_BGR2HSV)
mask = cv2.inRange(src=img_hsv, lowerb=np.array(... | {"hexsha": "11b342e146b5c9b70d9babb0c6cb0289f394ed1d", "size": 837, "ext": "py", "lang": "Python", "max_stars_repo_path": "trajectory-extraction/object_detection/shadow_detection.py", "max_stars_repo_name": "JudithVerstegen/scarabs-abm", "max_stars_repo_head_hexsha": "09cd43ae43e0faccb1a725037d226a29cd390fe2", "max_sta... |
"""
Test Autodock Vina Utility Functions.
"""
import os
import numpy as np
import unittest
from deepchem.utils import vina_utils
from deepchem.utils import rdkit_utils
class TestVinaUtils(unittest.TestCase):
def setUp(self):
# TODO test more formats for ligand
current_dir = os.path.dirname(os.path.realpath... | {"hexsha": "7c0a147ffcfa477678f2a7ca52e2115493b95d81", "size": 1567, "ext": "py", "lang": "Python", "max_stars_repo_path": "deepchem/utils/test/test_vina_utils.py", "max_stars_repo_name": "cjgalvin/deepchem", "max_stars_repo_head_hexsha": "64993a129e7f0f78fed9500298b1828ac8a0757a", "max_stars_repo_licenses": ["MIT"], "... |
"""Tests for locomotion.tasks.two_tap."""
import multi_gpu
import functools
from unittest.mock import patch
from absl.testing import absltest
import numpy as np
import os
DEMO_PATH = "../demo/markerless_mouse_1"
os.chdir(DEMO_PATH)
CONFIG_PATH = "../../tests/configs/config_mousetest.yaml"
MULTI_INSTANCE_CONFIG_PATH ... | {"hexsha": "8c38af4bc655047d812e1a8372a59968b9d21f8d", "size": 3102, "ext": "py", "lang": "Python", "max_stars_repo_path": "cluster/multi_gpu_test.py", "max_stars_repo_name": "tqxli/dannce-pytorch", "max_stars_repo_head_hexsha": "7676f4f7bfc7f9ce7dabf39e55d02823f3f18c1b", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
/-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
! This file was ported from Lean 3 source module data.finset.powerset
! leanprover-community/mathlib commit cc70d9141824ea8982d1562ce009952f2c3ece30
! Please do not edi... | {"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/Data/Finset/Powerse... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Aug 23 12:11:15 2020
Modified from the cornstover biorefinery constructed in Cortes-Peña et al., 2020,
with modification of fermentation system for 2,3-Butanediol instead of the original ethanol
[1] Cortes-Peña et al., BioSTEAM: A Fast and Flexible Pla... | {"hexsha": "fc87088c5315b853a73e0fe22daf1d8dd2bdee57", "size": 10198, "ext": "py", "lang": "Python", "max_stars_repo_path": "BioSTEAM 2.x.x/biorefineries/TAL/utils.py", "max_stars_repo_name": "yoelcortes/Bioindustrial-Complex", "max_stars_repo_head_hexsha": "d39edfec88e443ef7a62218ca0215e3b105f4b96", "max_stars_repo_li... |
[STATEMENT]
lemma ereal_leq_imp_neg_leq [mono_intros]:
fixes x y::ereal
assumes "x \<le> y"
shows "-y \<le> -x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. - y \<le> - x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<le> y
goal (1 subgoal):
1. - y \<le> - x
[PROOF STEP]
by auto | {"llama_tokens": 148, "file": "Gromov_Hyperbolicity_Library_Complements", "length": 2} |
cBHEADER**********************************************************************
c Copyright (c) 2008, Lawrence Livermore National Security, LLC.
c Produced at the Lawrence Livermore National Laboratory.
c This file is part of HYPRE. See file COPYRIGHT for details.
c
c HYPRE is free software; you can redistribute it an... | {"hexsha": "38404f3e5628247921d8c7fdd373ecdbf5600ad9", "size": 79700, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "linux_packages/source/hypre-2.9.0b/src/test/fstruct_ls.f", "max_stars_repo_name": "pangkeji/warp3d", "max_stars_repo_head_hexsha": "8b273b337e557f734298940a63291697cd561d02", "max_stars_repo_lice... |
# Copyright 2016 The TensorFlow 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 applica... | {"hexsha": "c1975dcbeb8d81bc081b72e840b756cce035be80", "size": 19077, "ext": "py", "lang": "Python", "max_stars_repo_path": "utils/dataset_utils.py", "max_stars_repo_name": "xuyongzhi/SparseVoxelNet", "max_stars_repo_head_hexsha": "2b8338c3291880ee1ef7739580eeaefb737f6164", "max_stars_repo_licenses": ["MIT"], "max_star... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import time
import numpy as np
from common import write_csv
from device import Oscilloscope, SignalGenerator
from gui import GPIBArgumentParser, DialogMode
from logging import getLogger, INFO, StreamHandler, NullHandler
root_logger = getLogger()
root_logger.add... | {"hexsha": "7bc2143d70467684eafd9ace4401771762da4e9d", "size": 2657, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/frequency_sweep_oscilloscpoe_monitor.py", "max_stars_repo_name": "heptaliane/my_measurements_scripts", "max_stars_repo_head_hexsha": "0c977a1677d7881a33863ab376cab48a387a7d52", "max_stars_... |
"""Tests for the attribute .X"""
import numpy as np
from scipy import sparse
from anndata import AnnData
from anndata.utils import asarray
import pytest
from anndata.tests.helpers import gen_adata, assert_equal
UNLABELLED_ARRAY_TYPES = [
pytest.param(sparse.csr_matrix, id="csr"),
pytest.param(sparse.csc_mat... | {"hexsha": "0cade171239ef8bf7acef707e8482d556c1071fb", "size": 2134, "ext": "py", "lang": "Python", "max_stars_repo_path": "anndata/tests/test_x.py", "max_stars_repo_name": "michalk8/anndata", "max_stars_repo_head_hexsha": "664e32b0aa6625fe593370d37174384c05abfd4e", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_sta... |
# Detect objects using tensorflow-gpu served by zerorpc.
#
# This needs to be called from a zerorpc client with an array of alarm frame image paths.
# Image paths must be in the form of:
# '/nvr/zoneminder/events/BackPorch/18/06/20/19/20/04/00224-capture.jpg'.
#
# This program should be run in the 'od' virtual python e... | {"hexsha": "418cd4f0da51cf45d38eed66282a7b98af2a17bb", "size": 9749, "ext": "py", "lang": "Python", "max_stars_repo_path": "obj-detect/obj_detect_server.py", "max_stars_repo_name": "EmpireofKings/smart-zoneminder", "max_stars_repo_head_hexsha": "78c62bd9cf730e0081741f7fe7a51339e0a5c46b", "max_stars_repo_licenses": ["MI... |
#include "streamTrace.hpp"
#include "writeRinex.hpp"
#include "acsConfig.hpp"
#include <boost/algorithm/string/replace.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/log/trivial.hpp>
#include <algorithm>
#include <fstream>
#include <math.h>
void recordRinexObservations(
RinexOutput& rinexOutput,
ObsLi... | {"hexsha": "8cdbbf038957e68a00086e375ee0554015fa3937", "size": 8799, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "src/cpp/common/writeRinex.cpp", "max_stars_repo_name": "umma-zannat/ginan", "max_stars_repo_head_hexsha": "a4d1a3bb8696267f23d26e8c6a2f6080b87bb494", "max_stars_repo_licenses": ["Apache-2.0"], "max_... |
[STATEMENT]
lemma map_graph_inv' [simp]:
"graph_map' (map_graph f) = Some f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. graph_map' (map_graph f) = Some f
[PROOF STEP]
by (simp add: graph_map'_def) | {"llama_tokens": 89, "file": "UTP_toolkit_Map_Extra", "length": 1} |
import numpy as np
from scipy.stats import median_test
from lemonadefashion_flask_monitoringdashboard.core.reporting.questions.report_question import (
ReportAnswer,
ReportQuestion,
)
from lemonadefashion_flask_monitoringdashboard.database import session_scope
from lemonadefashion_flask_monitoringdashboard.dat... | {"hexsha": "a3f7837b1136220e76797101a9abea60269b279b", "size": 2982, "ext": "py", "lang": "Python", "max_stars_repo_path": "lemonadefashion_flask_monitoringdashboard/core/reporting/questions/median_latency.py", "max_stars_repo_name": "us88/LF_Flask-MonitoringDashboard", "max_stars_repo_head_hexsha": "5917543fe480a3d46b... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% GKS User Guide -- LaTeX Source %
% %
% Chapter 1 ... | {"hexsha": "f26312715156ec438126c30a98a6747b947728f5", "size": 219442, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "gks/gksch1.tex", "max_stars_repo_name": "berghaus/cernlib-docs", "max_stars_repo_head_hexsha": "76048db0ca60708a16661e8494e1fcaa76a83db7", "max_stars_repo_licenses": ["CC-BY-4.0"], "max_stars_coun... |
import argparse
import math
from urllib.request import urlopen
import sys
import os
import subprocess
import glob
from braceexpand import braceexpand
from types import SimpleNamespace
import os.path
from omegaconf import OmegaConf
import torch
from torch import nn, optim
from torch.nn import functional as F
from tor... | {"hexsha": "9b7dc3a056a2b2f804d82edc3b7999e32678067f", "size": 3565, "ext": "py", "lang": "Python", "max_stars_repo_path": "colorlookup.py", "max_stars_repo_name": "noble-born/pixray", "max_stars_repo_head_hexsha": "2ec9aa04a4dd0ce6c196f5fd473af3684bb4ef87", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 343, "... |
function arclen (r,z,crv,n)
c implicit double precision (a-h,o-z) dp
dimension crv(2,*)
tol=.001
arclen=0.
if (abs(r-crv(1,1)).le..001.and.abs(z-crv(2,1)).le..001) return
do 10 i=2,n
r1=crv(1,i-1)
z1=crv(2,i-1)
r2=crv(1,i)
... | {"hexsha": "b5bd308c7ae3722bd75a6c8b8316d31c2cbac411", "size": 663, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "src/arclen.f", "max_stars_repo_name": "imohame/LabCode", "max_stars_repo_head_hexsha": "b7fca6e58f6c26917ff4a8862ab473da282d027d", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_... |
#pragma once
#include <atomic>
#include <stdexcept>
#include <thread>
#include <cassert>
#include <future>
#include <boost/asio.hpp>
#include <boost/thread.hpp>
#include <boost/date_time.hpp>
#include <boost/variant.hpp>
namespace co
{
namespace impl
{
struct Unset{};
template<typename T>
struct ValueHandling
{
... | {"hexsha": "35dcd02f15094ebd64f55c78103e4f69902140da", "size": 10525, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "include/co/future.hpp", "max_stars_repo_name": "mrpi/CoAwaitLib", "max_stars_repo_head_hexsha": "374990809ffb588453c8b9c8ab623d1e04b3ccf0", "max_stars_repo_licenses": ["BSL-1.0"], "max_stars_count"... |
# %%
import numpy as np
import matplotlib.pyplot as plt
def reconstruct_with_sinc(ts,fd,t):
n, = ts.shape
dt = ts[1] - ts[0]
fr = []
for k,ti in enumerate(t):
# for each time point
sumf = 0.0
for i in range(n):
# for each point in a sampled set
sumf += fd[... | {"hexsha": "6212ed665ec7ef37e7be35e17ce2a4320803e8bf", "size": 969, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/reconstruct_with_sinc.py", "max_stars_repo_name": "alexlib/engineering_experiments_measurements_course", "max_stars_repo_head_hexsha": "0b80d90519a2a72547ffd9ef4da2158530016196", "max_stars... |
from tensorflow.keras.layers import Conv2D, Flatten, Dense
from tensorflow.keras.layers import Dropout, Lambda
from tensorflow.keras.layers import MaxPooling2D, Input
from tensorflow.keras.models import Sequential, Model
from tensorflow.keras.callbacks import ModelCheckpoint, CSVLogger
from tensorflow.keras.optimi... | {"hexsha": "eb6591eb6ca0797e9eaaf6a3e9a01e11a082a414", "size": 4773, "ext": "py", "lang": "Python", "max_stars_repo_path": "train_model.py", "max_stars_repo_name": "abhipn/Automate-Driving-Behaviour", "max_stars_repo_head_hexsha": "8c16f9819d3528bebc73724dc4fa0eba6835471e", "max_stars_repo_licenses": ["MIT"], "max_star... |
[STATEMENT]
lemma sequence_number_increases':
"paodv i \<TTurnstile>\<^sub>A (\<lambda>((\<xi>, _), _, (\<xi>', _)). sn \<xi> \<le> sn \<xi>')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. paodv i \<TTurnstile>\<^sub>A (\<lambda>((\<xi>, uu_), uu_, \<xi>', uu_). sn \<xi> \<le> sn \<xi>')
[PROOF STEP]
by (rule st... | {"llama_tokens": 169, "file": "AODV_variants_d_fwdrreqs_D_Seq_Invariants", "length": 1} |
import pytest
import jax.numpy as np
import jax.random as jr
from vmfg_etc import VonMisesFisherGaussian
SEED = jr.PRNGKey(1325)
@pytest.fixture
def sample_shape():
return (4,5,3) # (B1, B2, D)
@pytest.fixture
def vmfg(sample_shape):
"""Randomly instantiate a VonMisesFisherGuassian distribution object and
... | {"hexsha": "3b53dd83b73dd9ae32ac6f91e3600d08467920ac", "size": 1599, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_vmfg.py", "max_stars_repo_name": "ezhang94/vmfg", "max_stars_repo_head_hexsha": "1ee655be6979ddb2c00b689639a4eb3c13b7f83f", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, ... |
from .stationdata import build_station_list
from .stationdata import update_water_levels
from .analysis import poly_deriv
from .analysis import polyfit
import datetime
from floodsystem.datafetcher import fetch_measure_levels
import numpy as np
import matplotlib
def stations_level_over_threshold(stations, tol):
"""... | {"hexsha": "8bcd1079269ca8d7691523ec1ad6464a23278fe8", "size": 4226, "ext": "py", "lang": "Python", "max_stars_repo_path": "floodsystem/flood.py", "max_stars_repo_name": "dan7267/1a-flood-risk-project-93", "max_stars_repo_head_hexsha": "d95cee987f5673d637626e1804f719371a25daa8", "max_stars_repo_licenses": ["MIT"], "max... |
import pytest
import os
import numpy as np
from numpy.testing import assert_almost_equal
import time
import random
from termcolor import cprint
from itertools import product
import cProfile
import pstats
from compas.datastructures import Mesh
from compas.geometry import Frame, Transformation
from compas.robots import... | {"hexsha": "d9aca62ebb06e6b7ff4243cbb5f1c955a7c12cb0", "size": 25821, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_pb_client.py", "max_stars_repo_name": "yijiangh/compas_fab_pychoreo", "max_stars_repo_head_hexsha": "42a03c85331f6bab9383e162c62b099a34593d5f", "max_stars_repo_licenses": ["MIT"], "max... |
\section*{Week 4: Intangible Assets; Statement of Cash Flows}
\subsection*{Intangible Assets}
Intangible assets include:
\begin{itemize}[noitemsep,topsep=0pt]
\item Intellectual property (Patents, Copyrights, Trademarks)
\item Licenses, Franchise rights
\item Brand value
\item Customer lists
\item Goodwill
\end... | {"hexsha": "1aa4867723f03c6bd5ad6e0a53d6ce6424c5f09f", "size": 1776, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "15.516x/assets/week_04.tex", "max_stars_repo_name": "j053g/cheatsheets", "max_stars_repo_head_hexsha": "22f7a84879c04d44de40467ddcc0f6e551b812c7", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
# -*- coding: utf-8 -*-
"""
Created on Mon Feb 29 2016
Author: Cedric Vallee
"""
import os
import re
from bs4 import BeautifulSoup
import pandas as pd
import numpy as np
import nltk
from nltk.corpus import stopwords
from sklearn.cross_validation import train_test_split
from sklearn.feature_extraction.text import Count... | {"hexsha": "396e1c0811740c6ea1af83ec8d461cac54abfcd5", "size": 5016, "ext": "py", "lang": "Python", "max_stars_repo_path": "FinancialAnalystV1/main.py", "max_stars_repo_name": "CedricVallee/pythonFinancialAnalyst", "max_stars_repo_head_hexsha": "64c562134de7801aeef3981f4ef4ac5d5b5fd70b", "max_stars_repo_licenses": ["MI... |
// =-=-=-=-=-=-=-
// local includes
#include "s3_archive_operations.hpp"
#include "libirods_s3.hpp"
// =-=-=-=-=-=-=-
// irods includes
#include <msParam.h>
#include <rcConnect.h>
#include <rodsLog.h>
#include <rodsErrorTable.h>
#include <objInfo.h>
#include <rsRegReplica.hpp>
#include <dataObjOpr.hpp>
#include <irod... | {"hexsha": "a1b90d9cf8101569889841787057bcfca97ab1c2", "size": 29124, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "s3/s3_archive_operations.cpp", "max_stars_repo_name": "korydraughn/irods_resource_plugin_s3", "max_stars_repo_head_hexsha": "8a06e03685982755c008e2d6a97603458995af3e", "max_stars_repo_licenses": ["... |
[STATEMENT]
lemma (in Order) Iod_less:
"\<lbrakk>T \<subseteq> carrier D; a \<in> T; b \<in> T\<rbrakk> \<Longrightarrow> (a \<prec>\<^bsub>Iod D T\<^esub> b) = (a \<prec> b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<lbrakk>T \<subseteq> carrier D; a \<in> T; b \<in> T\<rbrakk> \<Longrightarrow> a \<prec>\... | {"llama_tokens": 327, "file": "Group-Ring-Module_Algebra1", "length": 3} |
import numpy as np
import matplotlib.pyplot as plt
def gradient_pbl(
lidar_profile: np.ndarray,
min_grad: float = -2,
max_grad: float = 0.5,
) -> np.ndarray:
"""Gives the pblh heights given profiles
Args:
lidar_profile (np.ndarray): 2D array of lidar profile
max_grad (float, optio... | {"hexsha": "dd6043274a122f2029ff3de14eb4702a65896b86", "size": 3017, "ext": "py", "lang": "Python", "max_stars_repo_path": "lidar_pbl/core/methods.py", "max_stars_repo_name": "jdlar1/lidar-pbl", "max_stars_repo_head_hexsha": "6eb605c25719b77abe6e6f676f098e47c0d91292", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
module Dbcritic.Check.PrimaryKey
import Control.IOExcept
import Dbcritic.Check
import Dbcritic.Libpq
mkIssue : String -> Issue
mkIssue table =
let
identifier = [ table ]
description = "The table ‘" ++ table ++ "’ is missing a primary key constraint."
problems = [ "Rows cannot be indivi... | {"hexsha": "914c2c661b2cbf7d81aeeaaa8aa6c77ede445f49", "size": 1734, "ext": "idr", "lang": "Idris", "max_stars_repo_path": "Dbcritic/Check/PrimaryKey.idr", "max_stars_repo_name": "channable/dbcritic", "max_stars_repo_head_hexsha": "a58bb730ff94f45a502bf769d302ef570a23dcba", "max_stars_repo_licenses": ["BSD-3-Clause"], ... |
from ..BaseClass import BaseSpOptHeuristicSolver
from warnings import warn
from sklearn.cluster import (
AffinityPropagation,
AgglomerativeClustering,
KMeans,
MiniBatchKMeans,
SpectralClustering,
)
class WardSpatial(BaseSpOptHeuristicSolver):
""" Agglomerative clustering using Ward linkage with... | {"hexsha": "5048f011226d67481396405105d04cc8be8cd9e1", "size": 2563, "ext": "py", "lang": "Python", "max_stars_repo_path": "spopt/region/ward.py", "max_stars_repo_name": "fiendskrah/spopt", "max_stars_repo_head_hexsha": "b0f4b682f9246670241c415c4023fcb3e596c372", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_... |
!! N-dimensional system of array encapsulation.
!
! This file is part of LIBPFASST.
!
!> Module to define and encapsulation for a system of N-dimensional arrays
!!
!! When a new solution is created by a PFASST level, this encapsulation
!! uses the levels 'arr_shape' attribute to create a new multi-component array wi... | {"hexsha": "04d5aa27e6759221a40735ffb2ef3ca02f684c12", "size": 12962, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "src/pf_ndsysarray_encap.f90", "max_stars_repo_name": "wavefunction91/LibPFASST", "max_stars_repo_head_hexsha": "8bf49000d4e613496e824bb98f368527044f7064", "max_stars_repo_licenses": ["BSD-3-Cla... |
#include "generator/hierarchy.hpp"
#include "indexer/feature_algo.hpp"
#include "geometry/mercator.hpp"
#include "geometry/rect2d.hpp"
#include "base/assert.hpp"
#include "base/stl_helpers.hpp"
#include <algorithm>
#include <cmath>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iterator>
#inc... | {"hexsha": "e7546a5480ed8d3c259bfc24f56aa3539fad8015", "size": 10660, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "generator/hierarchy.cpp", "max_stars_repo_name": "vicpopov/omim", "max_stars_repo_head_hexsha": "664b458998fb0f2405f68ae830c2798e027b2dcc", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_cou... |
"""
Created on Mon Jun 24 10:52:25 2019
Reads a wav file with SDR IQ capture of FM stations located in :
https://mega.nz/#F!3UUUnSiD!WLhWZ3ff4f4Pi7Ko_zcodQ
Also: https://drive.google.com/open?id=1itb_ePcPeDRXrVBIVL-1Y3wrt8yvpW28
Also generates IQ stream sampled at 2.4Msps to simulate a ... | {"hexsha": "6cb1d4b5595af89892b42aa0b64b0889f73cb796", "size": 3313, "ext": "py", "lang": "Python", "max_stars_repo_path": "DTV/generate_DTV_interference.py", "max_stars_repo_name": "ska-telescope/sim-lowlevel-rfi", "max_stars_repo_head_hexsha": "24ebb5a738321641eefbff0a1d754b1043ff61c0", "max_stars_repo_licenses": ["B... |
# %%
import pandas as pd
import boto3
import sagemaker
from sagemaker import get_execution_role
from sagemaker.serializers import JSONSerializer
from sagemaker.deserializers import JSONDeserializer
# %%
endpoint_name = "endpoint-cdk-model-test"
predictor = sagemaker.predictor.Predictor(
endpoint_name=endpoint_na... | {"hexsha": "d989a1ebd91e3e72fa642e9296c6c73e05bce730", "size": 609, "ext": "py", "lang": "Python", "max_stars_repo_path": "notebooks/endpoint_test.py", "max_stars_repo_name": "a-barton/cdk-model-test", "max_stars_repo_head_hexsha": "b7a0a88d4e674759967aa983321568b071a33fa6", "max_stars_repo_licenses": ["MIT"], "max_sta... |
[STATEMENT]
lemma bisimSubstOutputPushRes:
fixes x :: name
and \<Psi> :: 'b
and M :: 'a
and N :: 'a
and P :: "('a, 'b, 'c) psi"
assumes "x \<sharp> M"
and "x \<sharp> N"
shows "\<Psi> \<rhd> \<lparr>\<nu>x\<rparr>(M\<langle>N\<rangle>.P) \<sim>\<^sub>s M\<langle>N\<rangle>.\<lparr>\<nu>x\<... | {"llama_tokens": 3567, "file": "Psi_Calculi_Bisim_Subst", "length": 21} |
using BenchmarkTools
SUITE = BenchmarkGroup()
BCST_A = parse(Int, ENV["BCST_A"])
for i in [0, 1]
k1 = i * BCST_A
SUITE["k1=$k1"] = @benchmarkable nothing
end
| {"hexsha": "b1d553cd6053ad58f230c81ce34c42bec239fc63", "size": 167, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/BenchmarkConfigSweepsTests/src/example1.jl", "max_stars_repo_name": "tkf/BenchmarkConfigSweeps.jl", "max_stars_repo_head_hexsha": "778c6c754eef1c7edc1ab57fb8e4758a68c96742", "max_stars_repo_lic... |
import json
import logging
import os
import numpy as np
from draco.learn import data_util, linear
from draco.learn.helper import current_weights
from draco.run import run
from draco.spec import Task
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
def absolute_path(p: str) -> str:
... | {"hexsha": "307da47ce132e6e32ea6e2c96bbd11fa03900687", "size": 3790, "ext": "py", "lang": "Python", "max_stars_repo_path": "draco/learn/playground.py", "max_stars_repo_name": "ngehlenborg/draco", "max_stars_repo_head_hexsha": "e7e958d9494413e0578053359368b7918a0135de", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_... |
[STATEMENT]
lemma min_satisfying_Some:
"min_satisfying P l = Some x \<longrightarrow>
x \<in> set l \<and> P x \<and> (\<forall> x' \<in> set l. x' < x \<longrightarrow> \<not> P x')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. min_satisfying P l = Some x \<longrightarrow> x \<in> set l \<and> P x \<and... | {"llama_tokens": 2464, "file": "Simplex_Simplex_Auxiliary", "length": 30} |
[STATEMENT]
lemma R_join:
assumes "x is R healthy"
and "y is R healthy"
shows "(x \<sqinter> y) is R healthy"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. x \<or> y is R healthy
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
1. x \<or> y is R healthy
[PROOF STEP]
have "R x = x" and "R y... | {"llama_tokens": 693, "file": "Circus_Reactive_Processes", "length": 11} |
import numpy as np
from math import sqrt
from mpl_toolkits.mplot3d import Axes3D
from sklearn.datasets import make_circles
import matplotlib.pyplot as plt
import pylab as pl
"""
Demonstrates how a linearly nonseparable dataset in R^2 can be
linearly separable in R^3 after a transformation via an appropriate
kernel fu... | {"hexsha": "b4878a8d9ba3da2230b850bc17915a4f8686189c", "size": 3532, "ext": "py", "lang": "Python", "max_stars_repo_path": "svm/KernelTrick/code/demo_data_transform.py", "max_stars_repo_name": "uredkar/mymlstat", "max_stars_repo_head_hexsha": "b36a2097d76ca9c8071e60d57331945b978ca6bc", "max_stars_repo_licenses": ["Unli... |
import numpy as np
import timeit
import lpnorm
import smmprod
from scipy.sparse import coo_matrix as spmatrix
class RobustAlgo(object):
# This class implements the smoothed lp-norm loss function and its gradient
def __init__(self, k, p, mu):
self.k = k
self.p = p
self.mu = mu
def ... | {"hexsha": "950a2852f6792dca53fa038dd9129132563bd25f", "size": 21871, "ext": "py", "lang": "Python", "max_stars_repo_path": "grslra/problems.py", "max_stars_repo_name": "clemenshage/grslra", "max_stars_repo_head_hexsha": "00f61b4ef08208d12e8e803d10f8ebbe16d8614a", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
import sys
sys.path.append('')
from espnet2.VC_SRC import melspectrogram,load_wav
import numpy as np
import os
def cal_mel_target(dir): #这个函数遍历文件夹中所有wav文件并且计算相应的mel谱,保存为同名.npy
for root, dirs, files in os.walk(dir):
for f in files:
if ".wav" in f:
wav_path=os.path.join(roo... | {"hexsha": "a5f392ca60b25f7d42c5976da146e5035bf60e69", "size": 757, "ext": "py", "lang": "Python", "max_stars_repo_path": "espnet2/VC_SRC/evaluation/wav2mel.py", "max_stars_repo_name": "victor45664/espnet", "max_stars_repo_head_hexsha": "0ccacc32d25feddec5270cb3f8e08c24183755d8", "max_stars_repo_licenses": ["Apache-2.0... |
import matplotlib.pyplot as plt
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
def plot_supercell(orthonormal_positions, atoms2plot):
op = orthonormal_positions
'''
Plot all (or only desired) atoms in orthormalised supercell
'''
# This is required to filter out atoms which want plot... | {"hexsha": "6820f57638312a7b308548489c5e6679ebba0141", "size": 1460, "ext": "py", "lang": "Python", "max_stars_repo_path": "rmcalyse/plotting_functions/plot_supercell.py", "max_stars_repo_name": "antgobar/rmcalyse", "max_stars_repo_head_hexsha": "dee40416bfd7cf73a4ede6eb309b484397e11310", "max_stars_repo_licenses": ["M... |
# importing the necessary libraries
import matplotlib.pyplot as plt
import pandas as pd
import re
import random
import math
import numpy as np
random.seed(10)
"""
Read text data from file and pre-process text by doing the following
1. convert to lowercase
2. convert tabs to spaces
3. remove "non-word" characters
Store... | {"hexsha": "da49a78a925e8b2685b1b2ccd24067e5390bc039", "size": 15114, "ext": "py", "lang": "Python", "max_stars_repo_path": "nbayes.py", "max_stars_repo_name": "yashchitre03/Naive-Bayes-SMS-Classification", "max_stars_repo_head_hexsha": "ac9a5dea982e262a29e107d83887db11b86fb675", "max_stars_repo_licenses": ["MIT"], "ma... |
import cuttsum.events
import cuttsum.corpora
from cuttsum.pipeline import InputStreamResource
from mpi4py import MPI
from cuttsum.misc import enum
from cuttsum.classifiers import NuggetRegressor
import numpy as np
import pandas as pd
import random
import pyvw
from datetime import datetime
from sklearn.feature_extractio... | {"hexsha": "441cffbbd75d7ec327699c07bcdc662ad344d775", "size": 26909, "ext": "py", "lang": "Python", "max_stars_repo_path": "trec2015/sbin/cross-validation/cross-validate-l2s.py", "max_stars_repo_name": "kedz/cuttsum", "max_stars_repo_head_hexsha": "992c21192af03fd2ef863f5ab7d10752f75580fa", "max_stars_repo_licenses": ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.