text stringlengths 0 1.25M | meta stringlengths 47 1.89k |
|---|---|
"""
peakproms(peaks, x;
strict=true,
minprom=nothing,
maxprom=nothing
) -> (peaks, proms)
Calculate the prominences of `peaks` in `x`, filtering peaks with prominences less than
`minprom` and greater than `maxprom`, if either are given.
Peak prominence is the absolute height difference... | {"hexsha": "92afb4a79a7be1ce53919f7632333b8f270d2714", "size": 6833, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/peakprom.jl", "max_stars_repo_name": "JuliaTagBot/Peaks.jl", "max_stars_repo_head_hexsha": "140d7b5496cdfb63d24443bc741b9053196d2a3a", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nul... |
import math
import numpy as np
import scipy.stats as ss
def observed_lift(trials, successes, lift="relative"):
pa = successes[0] / trials[0]
pb = successes[1] / trials[1]
if lift == "relative":
ote = (pb - pa) / pa
else:
ote = pb - pa
return ote
def mle_under_null(trials, succes... | {"hexsha": "50b40878e927dcf2b5429045f3e820a027f618f7", "size": 29340, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/core.py", "max_stars_repo_name": "rwilson4/abtesting-public", "max_stars_repo_head_hexsha": "03d466d87c45820de29c5481e22aa853b03788ae", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_c... |
import torch
import torch.nn as nn
from torch.distributions import Categorical
import gym
import minerl
import numpy as np
import logging
from network import ConvNet
logging.basicConfig(level=logging.DEBUG)
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
def converter(observation):
regio... | {"hexsha": "cd524e0519ceef70076b71b3b6294d18f51bc6dc", "size": 10064, "ext": "py", "lang": "Python", "max_stars_repo_path": "PPO.py", "max_stars_repo_name": "paulesta55/PPO-PyTorch", "max_stars_repo_head_hexsha": "a609c1a9a33533d80130cad7b43436c92c69c97d", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "m... |
[STATEMENT]
lemma (in ring) canonical_proj_ker:
assumes "ideal I R" and "ideal J R"
shows "a_kernel R (RDirProd (R Quot I) (R Quot J)) (canonical_proj I J) = I \<inter> J"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. a_kernel R (RDirProd (R Quot I) (R Quot J)) (canonical_proj I J) = I \<inter> J
[PROOF STEP]
p... | {"llama_tokens": 5576, "file": null, "length": 19} |
"""
Classic cart-pole system implemented by Rich Sutton et al.
Copied from http://incompleteideas.net/sutton/book/code/pole.c
permalink: https://perma.cc/C9ZM-652R
"""
import math
from typing import List
import gym
from gym import spaces, logger
from gym.utils import seeding
import numpy as np
float_type = np.float6... | {"hexsha": "58d8b3672eebfbe292b8ade805593e0342fd66ac", "size": 9749, "ext": "py", "lang": "Python", "max_stars_repo_path": "dao/envs/cartpole_env.py", "max_stars_repo_name": "nrjc/LEOC", "max_stars_repo_head_hexsha": "70dc15f0f0c9f32df25ae90734e3f491fc98fbfc", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, "... |
import matplotlib.pyplot as plt
from matplotlib import rcParams, rcParamsDefault
import numpy as np
from experiments.visualization.visualization_utils import get_figsize, reformat_large_tick_values
from test_utils.test_utils import read_config_file
import os
import sys
import matplotlib.ticker as tick
def get_mean_an... | {"hexsha": "f52724102b0809732ae865269ff636b4fb7517ae", "size": 17826, "ext": "py", "lang": "Python", "max_stars_repo_path": "experiments/visualization/plot_dimensions_stats.py", "max_stars_repo_name": "hsivan/automon", "max_stars_repo_head_hexsha": "222b17651533bdb2abce7de36a80156ab7b9cc21", "max_stars_repo_licenses": ... |
#include <boost/uuid/sha1.hpp>
#include <cradle/api.hpp>
#include <cradle/api_index.hpp>
#include <cradle/encoding.hpp>
#include <cradle/io/generic_io.hpp>
#include <boost/algorithm/string/regex.hpp>
#include <boost/algorithm/string/replace.hpp>
#include <boost/algorithm/string/split.hpp>
#include <boost/regex.hpp>
n... | {"hexsha": "ee56961e6cbccca943ee9e982be4432454eea5b7", "size": 15412, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "src/cradle/api.cpp", "max_stars_repo_name": "mghro/astroid-core", "max_stars_repo_head_hexsha": "72736f64bed19ec3bb0e92ebee4d7cf09fc0399f", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nu... |
import numpy as np
from typing import List, Optional, Tuple
from .LeastSq import LeastSq
class Rescale3D(LeastSq):
"""Calculates affine using using least squares, constrained to re-scale each axis"""
def get_matrix(
self,
matrix: List[List[float]],
absolutes: Optional[Tuple[List[floa... | {"hexsha": "aa1c58b2f9bfeae68e716c6eb5e5c0f4dfa9a819", "size": 1360, "ext": "py", "lang": "Python", "max_stars_repo_path": "geomagio/adjusted/transform/Rescale3D.py", "max_stars_repo_name": "usgs/geomag-algorithms", "max_stars_repo_head_hexsha": "a83a0e36bed9307828e37b9130c25dbc26dd1bc9", "max_stars_repo_licenses": ["C... |
from lost.pyapi import script
import os
from sklearn.cluster import KMeans
import numpy as np
from keras.applications.resnet50 import ResNet50
from keras.preprocessing import image
from keras.applications.resnet50 import preprocess_input
from keras.models import Model
from keras.preprocessing import image as keras_ima... | {"hexsha": "c6865bd2461618efa9b942108964b0ec401fceb6", "size": 2896, "ext": "py", "lang": "Python", "max_stars_repo_path": "backend/lost/pyapi/examples/pipes/mia/cluster_kmeans.py", "max_stars_repo_name": "PavelTkachen/lost", "max_stars_repo_head_hexsha": "6da0cbc2952a95b2c9153c15df66a738b16ec9b0", "max_stars_repo_lice... |
# Import useful libraries
import cv2
import numpy as np
import matplotlib.pyplot as plt
cv2.destroyAllWindows()
img1 = cv2.imread('/Users/icunitz/Desktop/bat_detection/frames/clear_background/bats/close/2016-07-30_014634/frame55.jpg')
img1_gray = cv2.cvtColor(img1, cv2.COLOR_BGR2GRAY)
ret, thresh = cv2.threshold(img1... | {"hexsha": "8de2a8b41ac8d93c0fcf140a2614b2f9f198da68", "size": 2969, "ext": "py", "lang": "Python", "max_stars_repo_path": "python_scripts/practice/edge_detection.py", "max_stars_repo_name": "lawsonro3/bat_detection", "max_stars_repo_head_hexsha": "2f6a291adf4ef612117a695d0b52167aa35f57d3", "max_stars_repo_licenses": [... |
\documentclass[sigconf]{acmart}
\input{preamble}
\copyrightyear{2017}
\setcopyright{acmcopyright}
\acmConference[SCAV 2017]{2017 1st International Workshop on Safe Control of Connected and Autonomous Vehicles (SCAV 2017)}{April 2017}{Pittsburgh, PA USA}
\acmISBN{978-1-4503-4976-5/17/04}
\acmPrice{15.00}
\acmDOI{http... | {"hexsha": "0658e646efe38f002eb4d43d14a5713747ccbea9", "size": 3302, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "paper/SCAV17/main.tex", "max_stars_repo_name": "santolucito/Haskell-TORCS", "max_stars_repo_head_hexsha": "95eef93f7089bbe95f0f28fa21f0f636d7ffc39f", "max_stars_repo_licenses": ["BSD-3-Clause"], "ma... |
#####################################################################
# #
# /__init__.py #
# #
# Copyright 2013, Monash University ... | {"hexsha": "a1a4714a3e5cc98a7e7f26e678782adc6d88b60a", "size": 38534, "ext": "py", "lang": "Python", "max_stars_repo_path": "lyse/__init__.py", "max_stars_repo_name": "chrisjbillington/lyse", "max_stars_repo_head_hexsha": "8596deaf5e57cab160c47f6c5081ecaebd429920", "max_stars_repo_licenses": ["BSD-2-Clause", "BSD-3-Cla... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import cProfile
import numpy as np
from scipy import sparse
from kaggler.online_model import FTRL
from kaggler.metrics import auc
np.random.seed(1234)
N_VALUE = int(4e6)
N_OBS = int(1e6)
N_FEATURE = 100
def ... | {"hexsha": "36d202be3428a1b37ef2b64ae477e54dbfeeb2cd", "size": 970, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_ftrl.py", "max_stars_repo_name": "ppstacy/Kaggler", "max_stars_repo_head_hexsha": "4fedc30153a4a74343fdec91468b96372873ebac", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, "m... |
import itertools
import numpy as np
import nose.tools as nt
import regreg.api as rr
from ..sparse_group_block import (sparse_group_block,
sparse_group_block_dual,
_inside_set,
_gauge_f... | {"hexsha": "d6fe5884ab678cc4bea7dfed23162badb9dae78b", "size": 4663, "ext": "py", "lang": "Python", "max_stars_repo_path": "regreg/atoms/tests/test_sparse_group_block.py", "max_stars_repo_name": "vishalbelsare/regreg", "max_stars_repo_head_hexsha": "d1b62cc43cdd83331f2b0817b0ae099d5ef97966", "max_stars_repo_licenses": ... |
"""
Copyright (c) 2020, salesforce.com, inc.
All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
Utilities for managing input and output vocabularies.
"""
import collections
import numpy as np
fun... | {"hexsha": "269528afa97bf9112e8538ca91f1f7e6fe1665e1", "size": 8523, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/data_processor/vocab_utils.py", "max_stars_repo_name": "sythello/TabularSemanticParsing", "max_stars_repo_head_hexsha": "c5cfcac262784d197ce40ec785b0b289bcc0d36e", "max_stars_repo_licenses": [... |
/* test_extreme_value_distribution.cpp
*
* Copyright Steven Watanabe 2010
* Distributed under the Boost Software License, Version 1.0. (See
* accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* $Id: test_extreme_value_distribution.cpp 71018 2011-04-05 21:27:52Z steven_... | {"hexsha": "29cb2a7aaae313e42831e2a7f634b5191c19c557", "size": 1354, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "libs/random/test/test_extreme_value_distribution.cpp", "max_stars_repo_name": "jmuskaan72/Boost", "max_stars_repo_head_hexsha": "047e36c01841a8cd6a5c74d4e3034da46e327bc1", "max_stars_repo_licenses":... |
import math
import numpy as np
# Disclaimer: this way of maintaining constraints for hyper-parameters is inspired from gpytorch.
# Gpytorch: https://github.com/cornellius-gp/gpytorch/blob/master/gpytorch/constraints/constraints.py
DEFAULT_SOFTPLUS_VALUE = 0.5413248546129181 # This leads to 1 in the parametric s... | {"hexsha": "b38bc6cb84df35a678bd0999a8e0f11659ded40e", "size": 5611, "ext": "py", "lang": "Python", "max_stars_repo_path": "fkigp/gps/constraints.py", "max_stars_repo_name": "ymohit/fkigp", "max_stars_repo_head_hexsha": "0a5330c86d5228ff69c9c6f91a73769f792f586f", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1... |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | {"hexsha": "54d227d0d33cc7a6fb9677fe9e86db1892126ade", "size": 2224, "ext": "py", "lang": "Python", "max_stars_repo_path": "python/examples/logistic_regression.py", "max_stars_repo_name": "jerryshao/spark", "max_stars_repo_head_hexsha": "31ec72b243459e0d1d9c89033328e1d79f3aa76f", "max_stars_repo_licenses": ["Apache-2.0... |
#!/usr/bin/python
#coding: utf-8
from pylab import plot,show
from numpy import vstack,array
from numpy.random import rand
from scipy.cluster.vq import kmeans,vq
# data generation
data = vstack((rand(150,2) + array([.5,.5]),rand(150,2))) #vstack 连接作用
print data.shape
# computing K-Means with K = 2 (2 clusters)
cent... | {"hexsha": "a971d73b4b4e3c3b504692b8c9535e79faf641d3", "size": 632, "ext": "py", "lang": "Python", "max_stars_repo_path": "example.py", "max_stars_repo_name": "wuhaifengdhu/zh_recover", "max_stars_repo_head_hexsha": "0cfef0c2bc9d027b164d737b0d90afa38a1db84a", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count"... |
\section{Categories of language changes}
Intro - remember to include characteristics of each category change (including e.g. speed)
\subsection{Grammar changes}
\subsection{Phonetic changes}
\subsubsection{Binary changes}
\subsubsection{Continuous changes}
\subsection{Vocabulary changes}
incl. extinction and invent... | {"hexsha": "7962aa764080deaa6a04f34e7bd136dda9541790", "size": 538, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "LaTeX/Introduction_Categories.tex", "max_stars_repo_name": "eMaerthin/agent-based-models-for-language-evolution-phd-thesis", "max_stars_repo_head_hexsha": "d61ad554f7a3bf5093aeffb5d83d56a8055ad9b8", ... |
# -*- coding: utf-8 -*-
import os
# Set log level before import, 0-debug(default) 1-info 2-warnning 3-error
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
from skimage import transform
from mtcnn.mtcnn import MTCNN
import numpy as np
import random
import cv2
os.environ['CUDA_VISIBLE_DEVICES'] = '0'
IMG_SHAPE = (112, 112) #... | {"hexsha": "255bfe93b44e6935d844bf72cc66bd6640657375", "size": 3907, "ext": "py", "lang": "Python", "max_stars_repo_path": "data_preprocessing_cele_win.py", "max_stars_repo_name": "wanghh2000/MobileFaceNet-Keras", "max_stars_repo_head_hexsha": "16d316cc4737056c855cba9017fd83b1735c4ef4", "max_stars_repo_licenses": ["MIT... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Nov 4 09:32:28 2020
@author: Kim Miikki
Arguments example:
-bp 0 -wp 100 -gamma .9 -obp 2 -owp 253 -png
"""
import cv2
import numpy as np
import argparse
import os
import re
import sys
from datetime import datetime
from pathlib import Path
from rpi.i... | {"hexsha": "18acac947f092501bd4bdd6d6fc557ab13ec996f", "size": 7119, "ext": "py", "lang": "Python", "max_stars_repo_path": "python/levels-batch.py", "max_stars_repo_name": "ElsevierSoftwareX/SOFTX-D-20-00089", "max_stars_repo_head_hexsha": "180298d7de98eba4ae4d183e9b6a5ed65178d37a", "max_stars_repo_licenses": ["MIT"], ... |
using Test, DiscreteExteriorCalculus
using Combinatorics: combinations
@testset "relative orientation" begin
s = Simplex(Point(0,0,0), Point(1,0,0))
comp = CellComplex([s])
for v in comp.cells[1]
@test length(v.parents) == 1
p = collect(keys(v.parents))[1]
o = v.parents[p]
@... | {"hexsha": "f435976e9f697f067e5eb708ea409410575d3c5d", "size": 2791, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/test_cell_complex.jl", "max_stars_repo_name": "mgscheer/DiscreteExteriorCalculus.jl", "max_stars_repo_head_hexsha": "6e95c222921fed6119824c2771740f030101ac59", "max_stars_repo_licenses": ["BSD... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import glob
import re
import sys
import urllib
import tarfile
import zipfile
import os.path as osp
from scipy.io import loadmat
import numpy as np
import h5py
class ValSet(object):
dataset_dir =... | {"hexsha": "8570ba4b6750d0e0b6e8ed5cf7e12d325670c8d5", "size": 4599, "ext": "py", "lang": "Python", "max_stars_repo_path": "torchreid/datasets/valset.py", "max_stars_repo_name": "theodorhusefest/ABD-Net", "max_stars_repo_head_hexsha": "4ad71205954726b88d081ca079c28378f74e3007", "max_stars_repo_licenses": ["MIT"], "max_... |
import sys
import math
import timeit
import numpy as np
import pandas as pd
from transonic import jit
def load_input_data(path):
df = pd.read_csv(
path, names = ["mass", "x", "y", "z", "vx", "vy", "vz"], delimiter=r"\s+"
)
masses = df["mass"].values.copy()
positions = df.loc[:, ["x", "y", "... | {"hexsha": "7cad8ab8e3dbc4b904cd451962382e55e449ee13", "size": 3063, "ext": "py", "lang": "Python", "max_stars_repo_path": "nbody_problem/python/compiled_methods.py", "max_stars_repo_name": "khushi-411/numpyorg-benchmarks", "max_stars_repo_head_hexsha": "2fbcbc57903a6ab37f1ff84b8295fc3e9f12ec2d", "max_stars_repo_licens... |
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
import re
import numpy as np
from . import param
#########################################################################
#
# Code shamelessly stolen from http://jdreaver.com/posts/2014-07-28-scientific-notation-spin-box-pyside.html.
... | {"hexsha": "f40507f8d064e196ecabc3a6c3b34b68836d33c1", "size": 4085, "ext": "py", "lang": "Python", "max_stars_repo_path": "pmgr/MyDelegate.py", "max_stars_repo_name": "mcb64/pmgr", "max_stars_repo_head_hexsha": "70b372385ed8e67b30ecaa20e1ae356c85222256", "max_stars_repo_licenses": ["BSD-3-Clause-LBNL"], "max_stars_cou... |
#define BOOST_TEST_MODULE uri__parsers__rules__uri__fragment_hpp
#include <boost/test/unit_test.hpp>
#include "../../test_parser.hpp"
#include "../make_char_map.hpp"
#include <uri/parsers/rules/uri/fragment.hpp>
namespace uri {
namespace parsers {
namespace rules {
namespace uri {
namespace test {
BOOST_AUTO_TE... | {"hexsha": "dda1c526a1b619bf8be89be3bc7acbd3530e6704", "size": 1177, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "test/uri/parsers/rules/uri/fragment.test.cpp", "max_stars_repo_name": "ledocc/uri", "max_stars_repo_head_hexsha": "0767d923f7d1690e495ddca8a84352746b572904", "max_stars_repo_licenses": ["BSL-1.0"], ... |
function blas1_d_test05 ( )
%*****************************************************************************80
%
%% TEST05 demonstrates DMACH.
%
% Licensing:
%
% This code is distributed under the GNU LGPL license.
%
% Modified:
%
% 09 May 2006
%
% Author:
%
% John Burkardt
%
fprintf ( 1, '\n' );
fprintf... | {"author": "johannesgerer", "repo": "jburkardt-m", "sha": "1726deb4a34dd08a49c26359d44ef47253f006c1", "save_path": "github-repos/MATLAB/johannesgerer-jburkardt-m", "path": "github-repos/MATLAB/johannesgerer-jburkardt-m/jburkardt-m-1726deb4a34dd08a49c26359d44ef47253f006c1/blas1_d/blas1_d_test05.m"} |
import numpy as np
from bleu import BLEUwithForget
from latency import consecutiveWaitDelay, averageProportion
def return_rewards(**_k):
def NewReward():
# params
maxsrc = _k['maxsrc']
target = _k['target']
cw = _k['cw']
beta = 0.03 # 0.5
q0 = BLEUwit... | {"hexsha": "0322206c9bb4f45d2e9d540ef91121a242c76a22", "size": 1243, "ext": "py", "lang": "Python", "max_stars_repo_path": "fairseq/RL/env/reward/returns.py", "max_stars_repo_name": "Joshwlks/RL-SLT", "max_stars_repo_head_hexsha": "65828bbcdb2cdd9c9d56c38e64ea7887e4c1db50", "max_stars_repo_licenses": ["MIT"], "max_star... |
[STATEMENT]
lemma sdrop_strict[simp]:
"sdrop\<cdot>\<bottom> = \<bottom>"
"sdrop\<cdot>i\<cdot>\<bottom> = \<bottom>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. sdrop\<cdot>\<bottom> = \<bottom> &&& sdrop\<cdot>i\<cdot>\<bottom> = \<bottom>
[PROOF STEP]
by fixrec_simp+ | {"llama_tokens": 113, "file": "BirdKMP_Theory_Of_Lists", "length": 1} |
# Gradient Boosting --> XGBoost Regression and Light GBM Regression
from numpy import asarray
from pandas import read_csv
from pandas import DataFrame
from pandas import concat
from sklearn.metrics import mean_absolute_error
from xgboost import XGBRegressor
from lightgbm import LGBMRegressor
from matplotlib import pypl... | {"hexsha": "c0ab5cad1646e1cc5836d48591f40639a3881173", "size": 3878, "ext": "py", "lang": "Python", "max_stars_repo_path": "Model/Gradient_Boosting.py", "max_stars_repo_name": "kimdanny/Quant", "max_stars_repo_head_hexsha": "69d66f98bd2882f7fc54d3408aa1f943d487bcb9", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
import numpy as np
from astropy import constants
import dask
import dask.array as da
import dask.dataframe as dd
def ccdid_qid_to_rcid(ccdid, qid):
""" """
return 4*(ccdid - 1) + qid - 1
def rcid_to_ccdid_qid(rcid):
""" computes the rcid """
qid = (rcid%4)+1
ccdid = int((rcid-(qid - 1))/4 +1)
... | {"hexsha": "43db7ce35901961550212b0e0bc632bae16d5218", "size": 18821, "ext": "py", "lang": "Python", "max_stars_repo_path": "ztfimg/tools.py", "max_stars_repo_name": "MickaelRigault/ztfimg", "max_stars_repo_head_hexsha": "6d8cd841e92297038fa57687edf37c65bc019af1", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_c... |
[STATEMENT]
theorem RA1: "(P ;; (Q ;; R)) = ((P ;; Q) ;; R)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. P ;; Q ;; R = (P ;; Q) ;; R
[PROOF STEP]
by (simp add: seqr_assoc) | {"llama_tokens": 82, "file": "UTP_utp_utp_rel_laws", "length": 1} |
int main() {
int c = 0;
while(true) {
int h = 56;
for(int i = 0; i < 100; i+=1) {
if(c > 0) {
String g = "Soy string";
float fr = 0.5;
} elif(c > 8) {
int c1 = 1;
int c2 = 2;
int c3 = 3;
} else {
char f = '0';
}
}
}
} | {"hexsha": "cb71fe8d4645bcad232b4aa92f391091c25a3c99", "size": 296, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "tests/q/deleteLocalVariables.f", "max_stars_repo_name": "pablomoralesgomez/compilador_PL", "max_stars_repo_head_hexsha": "89bf9debffcc948e9b92f5809ea3e7d5061284c8", "max_stars_repo_licenses": ["Apa... |
import numpy as np
from simulator import simul
from bolasso_cd import bolasso
from tqdm import tqdm
##########################################
# define the class 'simulation_function' #
##########################################
'''
this class is used to compute average runtime of bolasso (solved by coordinate... | {"hexsha": "c30bb2b5edb0668392bce7bffb252155a4e6b497", "size": 4408, "ext": "py", "lang": "Python", "max_stars_repo_path": "simul_bolasso_bsolar/runtime/simul_cd_parallel.py", "max_stars_repo_name": "isaac2math/solarpy", "max_stars_repo_head_hexsha": "d050b01b0507ecc6a42d499098205785b3027bf2", "max_stars_repo_licenses"... |
using DataFrames, FreqTables, StatsBase, BenchmarkTools
srand(1); x = rand(1:100, 10^6); y = categorical(x); z = string.(x);
using FastGroupBy
@benchmark freqtable($x)
@benchmark fastby(sum, $x, $x |> length |> fcollect)
@benchmark sumby(x, x |> length |> fcollect)
@benchmark countmap($x)
@benchmark freqtable($y)
# ... | {"hexsha": "bb90718bdfa40a15cc7db93565a9fe8d02fa4b7f", "size": 1116, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "benchmark/tut_df_blog1.jl", "max_stars_repo_name": "UnofficialJuliaMirrorSnapshots/FastGroupBy.jl-e6aeac8e-85c6-520e-8612-effc59bc0f33", "max_stars_repo_head_hexsha": "6ff821172ef37ba446b83ce3d861f... |
import numpy as np
from dolfin import *
from dolfin_adjoint import *
from mpi4py import MPI
import fenics_optimize as op
from fecr import from_numpy
comm = MPI.COMM_WORLD
eps = 0.25
recorder = op.Recorder('./results', 'field')
class VectorField(UserExpression):
def eval(self, val, x):
val[0] = 1/np.sqrt(... | {"hexsha": "3573057b321b278a105ceaa62496f6834dec7f08", "size": 1147, "ext": "py", "lang": "Python", "max_stars_repo_path": "stripe.py", "max_stars_repo_name": "Naruki-Ichihara/stripe", "max_stars_repo_head_hexsha": "8d0cedd67c87203809ef61cee6a45404f3b9d9d9", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, ... |
from abc import ABC, abstractmethod
import numpy as np
import struct
class FeatureTransformer(ABC):
"""
A features transformer preparing features for a classifier.
"""
@abstractmethod
def transform(self, x):
"""
Transforms a given feature to a different representation.
A... | {"hexsha": "86476d0a4265e291af438903f5eb3e6ddef26792", "size": 2677, "ext": "py", "lang": "Python", "max_stars_repo_path": "dpsniper/classifiers/feature_transformer.py", "max_stars_repo_name": "barryZZJ/dp-sniper", "max_stars_repo_head_hexsha": "71a3fc06f3fc319b023bde9aad8f05b8c5a47a80", "max_stars_repo_licenses": ["MI... |
[STATEMENT]
lemma (in LCD) foldD_insert:
assumes "finite A" "x \<notin> A" "x \<in> B" "e \<in> D" "A \<subseteq> B"
shows "foldD D f e (insert x A) = f x (foldD D f e A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. foldD D (\<cdot>) e (insert x A) = x \<cdot> foldD D (\<cdot>) e A
[PROOF STEP]
proof -
[PROOF... | {"llama_tokens": 1182, "file": null, "length": 9} |
[STATEMENT]
lemma HComplex_minus [simp]: "\<And>x y. - HComplex x y = HComplex (- x) (- y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<And>x y. - HComplex x y = HComplex (- x) (- y)
[PROOF STEP]
by transfer (rule complex_minus) | {"llama_tokens": 99, "file": null, "length": 1} |
"""
==============================
Random Numbers in ``vivarium``
==============================
This module contains classes and functions supporting common random numbers.
Vivarium has some peculiar needs around randomness. We need to be totally
consistent between branches in a comparison. For example, if a simulan... | {"hexsha": "8f8ffc8c17903b23f930f5b98fa869d8b286051b", "size": 30988, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/vivarium/framework/randomness.py", "max_stars_repo_name": "ihmeuw/vivarium", "max_stars_repo_head_hexsha": "77393d2e84ff2351c926f65b33272b7225cf9628", "max_stars_repo_licenses": ["BSD-3-Claus... |
[STATEMENT]
lemma (in category) cat_Hom_is_functor':
assumes "\<beta> = \<alpha>" and "\<AA>' = op_cat \<CC> \<times>\<^sub>C \<CC>" and "\<BB>' = cat_Set \<alpha>"
shows "Hom\<^sub>O\<^sub>.\<^sub>C\<^bsub>\<alpha>\<^esub>\<CC>(-,-) : \<AA>' \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<beta>\<^esub> \<BB>'"
[PROOF STATE]
p... | {"llama_tokens": 313, "file": "CZH_Elementary_Categories_czh_ecategories_CZH_ECAT_Hom", "length": 2} |
"""Plotting resources for the WEak Layer AntiCrack nucleation model."""
# pylint: disable=invalid-name,too-many-locals,too-many-branches
# pylint: disable=too-many-arguments,too-many-statements
# Third party imports
from matplotlib.colors import Normalize
import numpy as np
import matplotlib.pyplot as plt
# Project i... | {"hexsha": "dc03755dc6fa39216155caaa08600af14bc5d18f", "size": 12992, "ext": "py", "lang": "Python", "max_stars_repo_path": "weac/plot.py", "max_stars_repo_name": "2phi/waec", "max_stars_repo_head_hexsha": "eadffce924e8a160b4ec97735461b3f6d7e5c665", "max_stars_repo_licenses": ["Unlicense"], "max_stars_count": 12, "max_... |
From Test Require Import tactic.
Section FOFProblem.
Variable Universe : Set.
Variable UniverseElement : Universe.
Variable wd_ : Universe -> Universe -> Prop.
Variable col_ : Universe -> Universe -> Universe -> Prop.
Variable col_swap1_1 : (forall A B C : Universe, (col_ A B C -> col_ B A C)).
Variable col_swap2_... | {"author": "janicicpredrag", "repo": "Larus", "sha": "a095ca588fbb0e4a64a26d92946485bbf85e1e08", "save_path": "github-repos/coq/janicicpredrag-Larus", "path": "github-repos/coq/janicicpredrag-Larus/Larus-a095ca588fbb0e4a64a26d92946485bbf85e1e08/benchmarks/coq-problems/col-trans/col_trans_1273.v"} |
from shapely.geometry import Point, Polygon,mapping, shape
import shapely.wkt
import cx_Oracle
import geopandas as gpd
from geojson import Feature, FeatureCollection, Point
import json
from bokeh.io import show, output_notebook,output_file, curdoc
from bokeh.plotting import figure
from bokeh.models import GeoJSONDataSo... | {"hexsha": "b65afc915e1a59ee0a343157c3ac183c06e13bb7", "size": 7116, "ext": "py", "lang": "Python", "max_stars_repo_path": "workshops/python4atp/lab-resources/mapPlottingPy/regions.py", "max_stars_repo_name": "christytan/learning-library", "max_stars_repo_head_hexsha": "c73ea8451ce2998924e414da92e28d7770b1fe4b", "max_s... |
"""
Classes for performing statistical data analysis.
"""
import logging
import abc
import sys
import os
from collections import OrderedDict, Sequence
from functools import partial
from datetime import datetime
from typing import Iterable
from pydoc import locate
from copy import copy
import numpy as np
import xarray... | {"hexsha": "513f0fd6db26b190b647cb6f3a6c4f7d686b3178", "size": 38592, "ext": "py", "lang": "Python", "max_stars_repo_path": "datacube_stats/statistics.py", "max_stars_repo_name": "daleroberts/datacube-stats", "max_stars_repo_head_hexsha": "3b29235d3e8b238756b9b12034fe79fd0915b8a4", "max_stars_repo_licenses": ["Apache-2... |
# Copyright 2019 The TensorNetwork Authors
#
# 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 applicable law or agreed ... | {"hexsha": "0dc2447bf122e36a39fea916b0400207c6e7a523", "size": 3011, "ext": "py", "lang": "Python", "max_stars_repo_path": "tensornetwork/block_sparse/caching.py", "max_stars_repo_name": "jeff-bezos-amazon/TensorNetwork", "max_stars_repo_head_hexsha": "79337eeb4d0accf263a3bbc27e16de0d6be547df", "max_stars_repo_licenses... |
import numpy as np
def count_parameters_in_MB(model):
return np.sum(np.prod(v.size()) for v in model.parameters())/1e6
| {"hexsha": "b19726120f9aa585948dcc6045c251320dbd7b8d", "size": 122, "ext": "py", "lang": "Python", "max_stars_repo_path": "utils.py", "max_stars_repo_name": "sg-nm/Operation-wise-attention-network", "max_stars_repo_head_hexsha": "d66c319884c89ac613064136977a16d06418f276", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
# Copyright (c) 2019, Xilinx
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions an... | {"hexsha": "7421f577a916ab11318d10ae3dc1fbed9c570216", "size": 4496, "ext": "py", "lang": "Python", "max_stars_repo_path": "darwinn/optimizers/deap.py", "max_stars_repo_name": "Xilinx/DarwiNN", "max_stars_repo_head_hexsha": "65eef8004609f3684848c1206f39776545a928b0", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_st... |
!==============================================================================!
subroutine Comm_Mod_Read_Real_Array(fh, arr, disp)
!------------------------------------------------------------------------------!
! Read real array for sequential runs. !
!-----------------------... | {"hexsha": "161fc78605a15bb8634eaddd483537a84f032fbe", "size": 1009, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "Sources/Shared/Comm_Mod/Sequential/Read_Real_Array.f90", "max_stars_repo_name": "Dundj/Convex_Geomotry", "max_stars_repo_head_hexsha": "38507824d97270b3e4ead194a16148ff6158b59f", "max_stars_repo... |
section \<open>Refined Code Generation for Test Suites\<close>
text \<open>This theory provides alternative code equations for selected functions on test suites.
Currently only Mapping via RBT is supported.\<close>
theory Test_Suite_Representations_Refined
imports Test_Suite_Representations "../Prefix_Tree_Refi... | {"author": "isabelle-prover", "repo": "mirror-afp-devel", "sha": "c84055551f07621736c3eb6a1ef4fb7e8cc57dd1", "save_path": "github-repos/isabelle/isabelle-prover-mirror-afp-devel", "path": "github-repos/isabelle/isabelle-prover-mirror-afp-devel/mirror-afp-devel-c84055551f07621736c3eb6a1ef4fb7e8cc57dd1/thys/FSM_Tests/Equ... |
# -*- coding: utf-8 -*-
"""
Created on Thu Jun 17 15:52:02 2021
@author: romi
"""
import pandas as pd
import os
import glob
import random
from datetime import datetime
import inspect
#import datetime
#import math
#%%
#path = (r'E:\unir\apuntes\TFM doc\doc_mri\docs') #store the name of the path
path... | {"hexsha": "e7a643e22c5209c8beb49994662b46cb6e551572", "size": 17818, "ext": "py", "lang": "Python", "max_stars_repo_path": "Randomize logs.py", "max_stars_repo_name": "romihache/TFM", "max_stars_repo_head_hexsha": "f1f490276881934f67548a987580e58b43d282e1", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, ... |
using Documenter, DocumenterMarkdown, PuiseuxPolynomials, LaurentPolynomials
makedocs(sitename="Mvps.jl documentation",format=Markdown(),modules=[PuiseuxPolynomials])
| {"hexsha": "fc9bec1d01d1011f78db30397c8a668a199c2d5c", "size": 168, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "docs/make.jl", "max_stars_repo_name": "jmichel7/PuiseuxPolynomials.jl", "max_stars_repo_head_hexsha": "0fa23b3372032ae8b76e3ad1afd30ded34dbf063", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
# RGI-based runs for ESA
using BSON, VAWTools
region = [3, 4, 14, 11, 7][3]
runtyp = ["test", "testmid", "prodlow", "prod"][3]
runtyp == :test && println("\n\nTEST RUN !!!!!!!!\n\n")
parallel = true
all_glaciers = parallel
repeat_mode_1 = 1 # number of mode-1 repetitions to be able to calculate Rhat
repeat_mode_2 = 1 ... | {"hexsha": "dce3202ed0c6f04def4d01d6302eeba358633b2d", "size": 7732, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "scripts/rgi-inverse-parallel.jl", "max_stars_repo_name": "mauro3/BITEmodel.jl", "max_stars_repo_head_hexsha": "897eca85fc3c3b736ef49e23850b8f4bd6f2806a", "max_stars_repo_licenses": ["MIT"], "max_st... |
// Copyright 2018 Hans Dembinski
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt
// or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <boost/histogram/axis.hpp>
#include <iostream>
#define SHOW_SIZE(x) std::cout << #x << " " << sizeof(x) << std::endl
... | {"hexsha": "54f551316e61fcded7d1d3d8229a9deda18b0c6d", "size": 1063, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "3rdParty/boost/1.71.0/libs/histogram/test/axis_size.cpp", "max_stars_repo_name": "rajeev02101987/arangodb", "max_stars_repo_head_hexsha": "817e6c04cb82777d266f3b444494140676da98e2", "max_stars_repo_... |
#!/usr/bin/env python
# Check if Gibbs sampling for fixed margin generation is actually
# working and, if so, how quickly...
# Daniel Klein, 2014-03-05
import numpy as np
import matplotlib.pyplot as plt
from Network import Network
from Models import NonstationaryLogistic
from Models import FixedMargins
from Models i... | {"hexsha": "593ef88a54a89c7c97318a3fc6a1095dc69b48b6", "size": 3955, "ext": "py", "lang": "Python", "max_stars_repo_path": "test_gibbs.py", "max_stars_repo_name": "othercriteria/StochasticBlockmodel", "max_stars_repo_head_hexsha": "a33b274bc8196c38fc659e44941a9ecf589cb739", "max_stars_repo_licenses": ["MIT"], "max_star... |
# coding: utf-8
import argparse
import os
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable
def parse_data(filename, colnum, sep=':', savecsv=False):
'''
Parse data from `filename` to pandas DataFrame
Args:
filename : s... | {"hexsha": "631b136a3bfcfb94aaaa7d44207786187f4f8948", "size": 3386, "ext": "py", "lang": "Python", "max_stars_repo_path": "xrdtools.py", "max_stars_repo_name": "lmmentel/xrd-to-heatmap", "max_stars_repo_head_hexsha": "c39b5f2148acabca597f86ce5d6504ed65b5d4ff", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, ... |
import pytest
import sys
from collections import namedtuple
from io import StringIO
from unittest import mock
from packaging.version import Version
import mlflow
from mlflow.utils.autologging_utils import (
get_autologging_config,
autologging_is_disabled,
AutologgingEventLogger,
)
import tensorflow
import... | {"hexsha": "f8d454211ee47675b4475cc0c6a54d3eab04c39e", "size": 12660, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/tracking/fluent/test_fluent_autolog.py", "max_stars_repo_name": "jinzhang21/mlflow", "max_stars_repo_head_hexsha": "e926be917795fd945ea347e02cf31214008d3f1e", "max_stars_repo_licenses": ["A... |
// Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers
// Copyright (c) 2017-2019, The Iridium developers
// Copyright (c) 2018-2019, The MonetaVerde developers
//
// This file is part of Bytecoin.
//
// Bytecoin is free software: you can redistribute it and/or modify
// it under the terms of th... | {"hexsha": "87e4329f2b324b2edb11955e4e97887c0e7d6b48", "size": 37428, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "src/CryptoNoteCore/Currency.cpp", "max_stars_repo_name": "Camellia73/BlackRoseCoin_Diamond_V2", "max_stars_repo_head_hexsha": "f155f7f9eb7f8db711b9e3a0d417038321a92abe", "max_stars_repo_licenses": ... |
/* movstat/apply.c
*
* Copyright (C) 2018 Patrick Alken
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or (at
* your option) any later version.
*
*... | {"hexsha": "8ad56ebb9b37beca83f3523f71a37c3d6a1c8156", "size": 6601, "ext": "c", "lang": "C", "max_stars_repo_path": "gsl-2.6/movstat/apply.c", "max_stars_repo_name": "ielomariala/Hex-Game", "max_stars_repo_head_hexsha": "2c2e7c85f8414cb0e654cb82e9686cce5e75c63a", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
SUBROUTINE PARUTG(LUN,IO,UTG,NOD,KON,VAL)
C$$$ SUBPROGRAM DOCUMENTATION BLOCK
C
C SUBPROGRAM: PARUTG
C PRGMMR: WOOLLEN ORG: NP20 DATE: 1994-01-06
C
C ABSTRACT: THIS SUBROUTINE PARSES A USER-SPECIFIED TAG (MNEMONIC)
C (UTG) THAT REPRESENTS A VALUE EITHER BEING DECODED FROM A BUFR FILE
C (... | {"hexsha": "2300ecb474ecfb75221f2ad123295968d8c94c43", "size": 11149, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "var/external/bufr/parutg.f", "max_stars_repo_name": "matzegoebel/WRF-fluxavg", "max_stars_repo_head_hexsha": "686ae53053bf7cb55d6f078916d0de50f819fc62", "max_stars_repo_licenses": ["BSD-2-Clause"... |
(* This Isabelle theory is produced using the TIP tool offered at the following website:
https://github.com/tip-org/tools
This file was originally provided as part of TIP benchmark at the following website:
https://github.com/tip-org/benchmarks
Yutaka Nagashima at CIIRC, CTU changed the TIP output th... | {"author": "data61", "repo": "PSL", "sha": "2a71eac0db39ad490fe4921a5ce1e4344dc43b12", "save_path": "github-repos/isabelle/data61-PSL", "path": "github-repos/isabelle/data61-PSL/PSL-2a71eac0db39ad490fe4921a5ce1e4344dc43b12/UR/TIP/TIP15/TIP15/TIP_int_add_assoc.thy"} |
"""
trim(model, xu_trim_guess, xu_xdot_trimmed, i_xu_xdot_trimmed, lxu, uxu;
derivatives = SNOW.ComplexStep(),
solver = SNOW.IPOPT(),
objective = (g, xu) -> LA.norm(g, Inf)
)
Obtains a trimmed state of the model.
# Arguments
* `model<:AbstractModel` - model to be trimmed
* `xu_trim_gu... | {"hexsha": "38ef3c906c36b480b8514217cb84997efad34e6a", "size": 2420, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/trim.jl", "max_stars_repo_name": "byuflowlab/MultifidelityTrajectories", "max_stars_repo_head_hexsha": "083ed7ec51e042a65ac3c05b445b85ecdedc87d0", "max_stars_repo_licenses": ["MIT"], "max_stars... |
import os
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data import DataLoader
import numpy as np
import pandas as pd
from tqdm import tqdm
from collections import OrderedDict
import math
import cv2
import skimage.io
def tile(img, sz=128, N=12):
img = img.resha... | {"hexsha": "708a29944f256ee93848949039a763676d74d086", "size": 20651, "ext": "py", "lang": "Python", "max_stars_repo_path": "train_rguo/train_code/predict_rguo_part1.py", "max_stars_repo_name": "DrHB/PANDA-2nd-place-solution", "max_stars_repo_head_hexsha": "44ab72780f9e3594811f2a7520456de7a9e677db", "max_stars_repo_lic... |
# -*- coding: utf-8 -*-
# Author: Aris Tritas <aris.tritas@u-psud.fr>
# License: BSD 3-clause
import numpy as np
class UCBF:
"""
Reference
---------
Bubeck, S., Stoltz, G., Szepesvári, C., & Munos, R. (2009).
Online optimization in X-armed bandits.
In Advances in Neural Information Processing... | {"hexsha": "93d9e12e072d8ccfdd4e0537f936e2a666c5f622", "size": 2386, "ext": "py", "lang": "Python", "max_stars_repo_path": "bitl/policies/ucbf.py", "max_stars_repo_name": "tritas/bitl", "max_stars_repo_head_hexsha": "f394e633e38f983fed10c3e672af7be2883cbdbb", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_coun... |
import numpy as np
Amp = 7.5*np.pi/180
Base = 90*np.pi/180
Freq = 2*np.pi
# N_seconds = 1
# N = N_seconds*10000 + 1
# t = np.linspace(0,N_seconds,N)
# dt = t[1]-t[0]
### Reference Trajectory ###
# coeffs = [126,-420,540,-315,70]
#
# r = lambda t: float(np.piecewise(t,[t%1<0.5,t%1>=0.5],
# [
# lambda t : ... | {"hexsha": "c1a76c845f1c1f2f8d7efa3178231a676fabfb54", "size": 4112, "ext": "py", "lang": "Python", "max_stars_repo_path": "pendulum_eqns/reference_trajectories/_01.py", "max_stars_repo_name": "danhagen/NonlinearControl", "max_stars_repo_head_hexsha": "3bda71a058ec3b1a598df886e9485fd4d08982ba", "max_stars_repo_licenses... |
import lightgbm as lgbm
from sklearn.model_selection import KFold
import gc
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
import matplotlib.pyplot as plt # plots
import os
from pathlib import Path
from tqdm import tqdm
import datetime
from sklearn.model_selec... | {"hexsha": "96109174824836a60ce6c666e1eedbec2a0fb065", "size": 2926, "ext": "py", "lang": "Python", "max_stars_repo_path": "train/Train.py", "max_stars_repo_name": "blank1996/INGV_Kaggle_Baseline", "max_stars_repo_head_hexsha": "ad8f0adc10a709cca60e4503c40848b449240591", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
import multiprocessing as mp
import pickle
import sys
import os
import scipy as sp
import numpy as np
import scipy.special as spec
import fbutils as _fb
from micemag.fieldmanip import polarMeasurement as rphiz
import micemag.utils as utils
#Consolidate all of this into a class to remove need for global values etc..... | {"hexsha": "8d653e66ff4d97d1799cfb170657d5289a82d6bf", "size": 7822, "ext": "py", "lang": "Python", "max_stars_repo_path": "micemag/fbutils/applyfb.py", "max_stars_repo_name": "JoeLanglands/MICE-MagneticFieldMapping", "max_stars_repo_head_hexsha": "e8d58614e8d341bffe3691574885c4148620e0f4", "max_stars_repo_licenses": [... |
/*!
\file gpp_random.hpp
\rst
This file specifies two classes for abstracting/handling psuedo-random number generation. Currently, we have:
1. UniformRandomGenerator (container for a PRNG "engine")
2. NormalRNG (functor for N(0, 1)-distributed PRNs, uses UniformRandomGenerator)
It additionally contains t... | {"hexsha": "6aba104079418868bc2cde30bf39499c5315bf26", "size": 16559, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "moe/optimal_learning/cpp/gpp_random.hpp", "max_stars_repo_name": "dstoeckel/MOE", "max_stars_repo_head_hexsha": "5b5a6a2c6c3cf47320126f7f5894e2a83e347f5c", "max_stars_repo_licenses": ["Apache-2.0"]... |
{-# OPTIONS --safe #-}
module Cubical.Algebra.CommMonoid.Base where
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.Isomorphism
open import Cubical.Foundations.Equiv
open import Cubical.Foundations.HLevels
open import Cubical.Foundations.SIP
open import Cubical.Data.Sigma
open import Cubical.... | {"hexsha": "9eea8077460dec193ea2656042457c7fc9c3664a", "size": 4256, "ext": "agda", "lang": "Agda", "max_stars_repo_path": "Cubical/Algebra/CommMonoid/Base.agda", "max_stars_repo_name": "thomas-lamiaux/cubical", "max_stars_repo_head_hexsha": "58c0b83bb0fed0dc683f3d29b1709effe51c1689", "max_stars_repo_licenses": ["MIT"]... |
(*
$Id: sol.thy,v 1.4 2010/11/29 07:13:36 kleing Exp $
Author: Martin Strecker
*)
header {* The Euclidean Algorithm -- Inductively *}
(*<*) theory sol imports Main begin (*>*)
subsection {* Rules without base case *}
text {* Show that the following *}
inductive_set evenempty :: "nat set" where
Add2Ie: "n \... | {"author": "zchn", "repo": "isabelle-practice", "sha": "1c6de196ca011593faeed229808e65c9bfeb659e", "save_path": "github-repos/isabelle/zchn-isabelle-practice", "path": "github-repos/isabelle/zchn-isabelle-practice/isabelle-practice-1c6de196ca011593faeed229808e65c9bfeb659e/exercises/solutions/isabelle.in.tum.de/exercise... |
"""
Created by Shane Bussmann
2012 January 9
Last modified: 2013 April 14
Purpose: plot cutouts of ALMA imaging + VIKING K + SPIRE 250um
"""
import math
import numpy
from astropy.table import Table
from astropy import wcs
from astropy.io import fits
#from astropy.coordinates import ICRS
from astropy.coordinates impo... | {"hexsha": "2659257486d490a2f6fd9d24bf5bd800268adc8d", "size": 21079, "ext": "py", "lang": "Python", "max_stars_repo_path": "Code/herschel_alma_overlay.py", "max_stars_repo_name": "sbussmann/Bussmann2015", "max_stars_repo_head_hexsha": "38515be0b8973a66e4e509a3a25369b4af0a5a85", "max_stars_repo_licenses": ["MIT"], "max... |
import numpy as np
class SoftmaxWithLossLayer(object):
def __init__(self):
self.__type = "loss"
self.__name = "softmax_with_loss"
def type(self):
return self.__type
def name(self):
return self.__name
def loadLabel(self, label):
self.__label = label
def for... | {"hexsha": "b267aeae80ef0c020bc3aebe8aae80b5d476b1e8", "size": 1601, "ext": "py", "lang": "Python", "max_stars_repo_path": "Layer/Softmax.py", "max_stars_repo_name": "xiaohuihuichao/Net_Numpy", "max_stars_repo_head_hexsha": "e74208c10d565106e948e83b56ad639e8310390c", "max_stars_repo_licenses": ["ICU"], "max_stars_count... |
import numpy as np
import pandas as pd
import torch
from torch import optim
from torch.nn import parameter
import torch.nn.functional as F
import discriminator
import tqdm
import math
import random
import gc
from scipy.spatial import distance_matrix
def get_one_hot_label(labels=None, num_classes=10, device = 'cpu... | {"hexsha": "c2c164b2968e581ac49ad4cebe405e91a4d669a4", "size": 31382, "ext": "py", "lang": "Python", "max_stars_repo_path": "query_methods_sub.py", "max_stars_repo_name": "GhostAnderson/Nearest-Neighbor-Classifier-with-Margin-Penalty-for-Active-Learning", "max_stars_repo_head_hexsha": "c11b91a7a28fce4ea69e56bb9035646c2... |
from random import randint
import pandas as pd
import numpy as np
from binodcli.binodfile import binodfunc #pip install binodtharu-cli
import tensorflow as tf #pip install tensorflow
model = tf.keras.models.load_model("/content/BLSTM.h5")
binodfunc('https://drive.google.com/file/d/1yVcCs6QE2EAfbiq-vbWjn4BEGp89E1h7/vi... | {"hexsha": "260e17e88b18c94c28be680ba6a7ba835894162d", "size": 1663, "ext": "py", "lang": "Python", "max_stars_repo_path": "model_inf.py", "max_stars_repo_name": "soumya997/insincere-questions-not-found", "max_stars_repo_head_hexsha": "10cd3f63b0f3713febfaaf7ad9cd084d91a16ff6", "max_stars_repo_licenses": ["MIT"], "max_... |
# Belief Propagation #
# --------------------------------- #
@rule MvNormalMeanCovariance(:μ, Marginalisation) (m_out::PointMass, m_Σ::PointMass) = MvNormalMeanCovariance(mean(m_out), mean(m_Σ))
@rule MvNormalMeanCovariance(:μ, Marginalisation) (m_out::MultivariateNormalDistributionsFamily, m_Σ::PointM... | {"hexsha": "2aa229e5f275e9a5a9e2623b922f31093f3416de", "size": 1013, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/rules/mv_normal_mean_covariance/mean.jl", "max_stars_repo_name": "HoangMHNguyen/ReactiveMP.jl", "max_stars_repo_head_hexsha": "f3e848ab171e0786e3d8eb6a0843dbf6dacc7415", "max_stars_repo_license... |
# Lib
import logging
import numpy as np
import pandas as pd
from ..utils.progress_bar import * # checks environment and imports tqdm appropriately.
from collections import Counter
from pathlib import Path
import pickle
# App
from ..files import Manifest, get_sample_sheet, create_sample_sheet
from ..models import Channe... | {"hexsha": "04cf9f8a39d5747bca72629a7046d32fd91a922c", "size": 32475, "ext": "py", "lang": "Python", "max_stars_repo_path": "methylprep/processing/pipeline.py", "max_stars_repo_name": "holonomicjl/methylprep", "max_stars_repo_head_hexsha": "6a503263ae4399a25e13238a6e4890d891f4dec9", "max_stars_repo_licenses": ["MIT"], ... |
SUBROUTINE convert_boundary(rbc, zbs, rhobc, mpol, ntor,pexp)
USE stel_kinds
IMPLICIT NONE
!-----------------------------------------------
! D u m m y A r g u m e n t s
!-----------------------------------------------
INTEGER, INTENT(in) :: mpol, ntor
REAL(rprec), DIMENSION(-ntor:ntor... | {"hexsha": "aff465daefb5d6ba15baea92e9ed11d141401971", "size": 2839, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "LIBSTELL/Sources/Miscel/convert_boundary.f", "max_stars_repo_name": "joseluisvelasco/STELLOPT", "max_stars_repo_head_hexsha": "e064ebb96414d5afc4e205f43b44766558dca2af", "max_stars_repo_licenses":... |
from trafpy.manager.src.schedulers.schedulertoolbox import SchedulerToolbox, SchedulerToolbox_v2
import json
import numpy as np
import copy
from collections import defaultdict # use for initialising arbitrary length nested dict
class FairShare:
def __init__(self,
Graph,
RWA,
... | {"hexsha": "1e45a98990ab58bd82b84bf6b376968731e0f3e7", "size": 10843, "ext": "py", "lang": "Python", "max_stars_repo_path": "trafpy/manager/src/schedulers/fair_share.py", "max_stars_repo_name": "cwfparsonson/trafpy", "max_stars_repo_head_hexsha": "23b27abb2352990522b21dc1b14f0310abf84a17", "max_stars_repo_licenses": ["... |
\PassOptionsToPackage{unicode=true}{hyperref} % options for packages loaded elsewhere
\PassOptionsToPackage{hyphens}{url}
%
\documentclass[]{article}
\usepackage{lmodern}
\usepackage{amssymb,amsmath}
\usepackage{ifxetex,ifluatex}
\usepackage{fixltx2e} % provides \textsubscript
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if... | {"hexsha": "54f40f75fc35b058a00d9e69561249ecd06c69df", "size": 14651, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "docs/finalreport.tex", "max_stars_repo_name": "mnybe1/group_2_youtube", "max_stars_repo_head_hexsha": "a9244a8360657729a49c2e23fb1c64f1f5d8fb51", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
""" This module is loosely defined as those visualization operations
which take in data and generate an image. For example, a mosaic image
from an inpute medical volume. May be collapsed at a later date into
another module if use cases are insufficient.
"""
import numpy as np
import os
import glob
from sh... | {"hexsha": "410ba77a5722b208259f995416a296bdbfbc3d56", "size": 7936, "ext": "py", "lang": "Python", "max_stars_repo_path": "qtim_tools/qtim_visualization/image.py", "max_stars_repo_name": "QTIM-Lab/qtim_tools", "max_stars_repo_head_hexsha": "92bd15ec7a81c5eda70d11a015f74538f3c41e22", "max_stars_repo_licenses": ["Apache... |
from copy import deepcopy
from scipy.interpolate import splev
from scipy.optimize import least_squares, minimize, LinearConstraint
import numpy as np
from .functionaldefinition import Functional, Functional2, Functional3
from .splineutils import splevper
def correlate(x, y):
"""Compute the correlation between t... | {"hexsha": "746b98e02d47069f209e6527d91a1e344a5145c4", "size": 5917, "ext": "py", "lang": "Python", "max_stars_repo_path": "morphodynamics/displacementestimation.py", "max_stars_repo_name": "ZejjT5E44/MorphoDynamics", "max_stars_repo_head_hexsha": "8e14c07112aedd1fcbbb14140dc65d3132fabab7", "max_stars_repo_licenses": [... |
import argparse
import cv2
import numpy as np
import torch
import timm
import os,sys
sys.path.append(r"F:\大学\MTFwiki\pytorch-grad-cam")
from pytorch_grad_cam import GradCAM, \
ScoreCAM, \
GradCAMPlusPlus, \
AblationCAM, \
XGradCAM, \
EigenCAM, \
EigenGradCAM, \
LayerCAM, \
FullGrad
fro... | {"hexsha": "ed29623410738045455ccc58efdeae8ed051aaa4", "size": 3907, "ext": "py", "lang": "Python", "max_stars_repo_path": "usage_examples/swinT_example.py", "max_stars_repo_name": "KaguraTart/pytorch-grad-cam", "max_stars_repo_head_hexsha": "e16c92179d271603d5169750d78c6ddd327e87d2", "max_stars_repo_licenses": ["MIT"]... |
// Generated Files
${PROJ_DIR}/llink/script/premade_examples/axi_st_d128_asym/axi_st_d128_asym_half_slave_top.sv
${PROJ_DIR}/llink/script/premade_examples/axi_st_d128_asym/axi_st_d128_asym_half_slave_concat.sv
${PROJ_DIR}/llink/script/premade_examples/axi_st_d128_asym/axi_st_d128_asym_half_slave_name.sv
// Logic ... | {"hexsha": "a3ec1856e063d4d3b0ec4171ee280b6461cb7cc7", "size": 416, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "llink/script/premade_examples/axi_st_d128_asym/axi_st_d128_asym_half_slave.f", "max_stars_repo_name": "chipsalliance/aib-protocols", "max_stars_repo_head_hexsha": "98858e6707f30ed6ea714598e3e324d75... |
%
% Copyright (c) 2005 IBM Corporation and others.
% All rights reserved. This program and the accompanying materials
% are made available under the terms of the Common Public License v1.0
% which accompanies this distribution, and is available at
% http://www.eclipse.org/legal/cpl-v10.html
%
% Contributors:
% IBM - I... | {"hexsha": "04414af5c7ca0a781c70732abf2df468edbfce36", "size": 24685, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "decreasoner.win32/doc/doc.tex", "max_stars_repo_name": "problem-frames/openpf", "max_stars_repo_head_hexsha": "55100bd9cca61a182fc00cd3818bd59a6343ae6e", "max_stars_repo_licenses": ["BSD-3-Clause"]... |
[STATEMENT]
lemma Irint_C1: "Irint (IC 1) vs = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. Irint (IC 1) vs = 1
[PROOF STEP]
by simp | {"llama_tokens": 72, "file": null, "length": 1} |
using Mamba
## Data
leuk = Dict{Symbol, Any}(
:t_obs =>
[1, 1, 2, 2, 3, 4, 4, 5, 5, 8, 8, 8, 8, 11, 11, 12, 12, 15, 17, 22, 23, 6,
6, 6, 6, 7, 9, 10, 10, 11, 13, 16, 17, 19, 20, 22, 23, 25, 32, 32, 34, 35],
:fail =>
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
1, 0,... | {"hexsha": "0275ccf8f67af022119b18167d5ac047d8af259d", "size": 2105, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "doc/examples/leuk.jl", "max_stars_repo_name": "JuliaPackageMirrors/Mamba.jl", "max_stars_repo_head_hexsha": "61d716958902077d0c9e7030ae490153ac515ae1", "max_stars_repo_licenses": ["MIT"], "max_star... |
library(dplyr)
library(readr)
library(ggplot2)
library(GGally)
library(tidyr)
library(purrr)
data_fixed <- read.csv('./data/fixed/data_nomissing.csv')
data_fixed$predict <- factor(data_fixed$predict, levels=c(0,1), labels=c('Non-missing', 'Predicted'))
brand_preference_plot_plain <- ggplot(data_fixed, aes(brand, fill... | {"hexsha": "153f501d6d63257bd7198449cf09705250bf31d3", "size": 1767, "ext": "r", "lang": "R", "max_stars_repo_path": "scr/fixed_results_and_analysis.r", "max_stars_repo_name": "TuomoKareoja/brand-preferance-prediction", "max_stars_repo_head_hexsha": "2b8ae54a39d7fd8710f70dbd59034453cb803690", "max_stars_repo_licenses":... |
import os
import numpy as np
import argparse
import tensorflow as tf
from tqdm import tqdm
import cv2
def main(args):
reader = tf.TFRecordReader()
filename_queue = tf.train.string_input_producer([args.tfrecords_file])
_, serialized_example = reader.read(filename_queue)
features = t... | {"hexsha": "65aebd36c02b2ee64482ba7680dee6bcff854dfe", "size": 2778, "ext": "py", "lang": "Python", "max_stars_repo_path": "tools/check_tfrecord.py", "max_stars_repo_name": "LXLun/text_render_pos", "max_stars_repo_head_hexsha": "dd7fce78a61c4a46483c7e58a455983271b5bb51", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
import numpy as np
import matplotlib.pyplot as plt
from os.path import isfile
root = '/shared/data-camelot/cotar/Asiago_binaries_programme/'
dir_g = root + 'GZ_Dra/spec/'
dir_k = root + 'GZ_Dra_obdelava_klemen/'
exposure = 'EC62320'
for i_eo in range(1, 32):
f1 = dir_g + exposure + '.ec.vh/' + exposure + '.ec.vh... | {"hexsha": "7d6ebfbc6ae9a903b4f572f1d8148e967fa26342", "size": 947, "ext": "py", "lang": "Python", "max_stars_repo_path": "reduction_compare.py", "max_stars_repo_name": "kcotar/Spectroscopic-binary-decomposition", "max_stars_repo_head_hexsha": "bf16a8f70fe659e7c3128f3e981f6e1e058a5a20", "max_stars_repo_licenses": ["MIT... |
module EqInterf
import Data.Nat
infix 6 =~=
--------------------------------------------------
--- Interfaces and general functions over them ---
--------------------------------------------------
interface Equ ty where
data (=~=) : ty -> ty -> Type
0 fromPropositional : {0 x, y : ty} -> (0 _ : x = y) -> x =~=... | {"hexsha": "2a7727de009bcd9462f8148929bb5ffd53c25e57", "size": 3002, "ext": "idr", "lang": "Idris", "max_stars_repo_path": "EqInterf.idr", "max_stars_repo_name": "buzden/idris-playground", "max_stars_repo_head_hexsha": "414729c5dbd665fdb05cdfe5318f972fb277a726", "max_stars_repo_licenses": ["CC0-1.0"], "max_stars_count"... |
import numpy as np
from renormalizer.utils import Quantity, constant
from renormalizer.model import HolsteinModel, Mol, Phonon
def construct_model(nmols, dmrg_nphs, hartree_nphs) -> HolsteinModel:
assert dmrg_nphs + hartree_nphs == 10
elocalex = Quantity(2.13 / constant.au2ev)
dipole_abs = 1.0
# cm^... | {"hexsha": "425e15742c64cf652f29b6acb92d5380970da1c6", "size": 1330, "ext": "py", "lang": "Python", "max_stars_repo_path": "renormalizer/tests/parameter_PBI.py", "max_stars_repo_name": "shuaigroup/Renormalizer", "max_stars_repo_head_hexsha": "963d52efdaa247320e781a96b64d41c9cadf6f0e", "max_stars_repo_licenses": ["Apach... |
\section{Introduction}
% a contextual description of the goals of experiment
In 1921, Michelson and Peace developed the concept of {\it astronomy interferometry} \cite{michel}, measuring the {\it angular diameter} of one the brightness star in the sky, {\it Betelgeuse}, with an {\it optical telescope}. Nowadays, Mich... | {"hexsha": "9414fc1297e8960d61d90bb55c22f0f28a84e9dd", "size": 12842, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "tex/intro.tex", "max_stars_repo_name": "bt3gl/Tool-Calculating_the_Diameter_of_Sun", "max_stars_repo_head_hexsha": "f8f7729c2caad2f411e9835a3a28d33a03dff73e", "max_stars_repo_licenses": ["Apache-2.... |
# necessary packages
import pandas as pd
import os
import numpy as np
import pytz
from datetime import datetime
import csv
# load my own modules
import before_and_after_final_tpu
import data_paths
import utils
import wordcloud_generate
# packages for regression
import statsmodels.formula.api as smf
from statsmodels.s... | {"hexsha": "2ce253b1c031494e10c6bc8610861d6610b075e2", "size": 56343, "ext": "py", "lang": "Python", "max_stars_repo_path": "transit_non_transit_comparision/cross_sectional_study.py", "max_stars_repo_name": "bright1993ff66/Social-Media-Data-Analysis", "max_stars_repo_head_hexsha": "ab192217bc42db5fb80c97766b7993e451c73... |
from numpy import concatenate, zeros
from scipy.linalg import toeplitz
import torch
from torch import nn
import numpy as np
import matplotlib as mat
mat.use("TkAgg")
import matplotlib.pyplot as plt
import time
from torch.autograd import Variable
import cv2
torch.manual_seed(1) # reproducible
mat.use("TkAgg")
hidde... | {"hexsha": "8b04158faf68f4d5e091f67535cb0f47fe2b2f31", "size": 9409, "ext": "py", "lang": "Python", "max_stars_repo_path": "test_cases/square_wave/square_wave_dd_lstm.py", "max_stars_repo_name": "msc-acse/acse-9-independent-research-project-Wade003", "max_stars_repo_head_hexsha": "cfcba990d52ccf535171cf54c0a91b184db6f2... |
"""Module for validating data and raising informative errors."""
from typing import Sequence, Tuple, Union
import numpy as np
import pandas as pd
def check_1d(seq: Sequence) -> Sequence:
"""Check given seq is one-dimensional. Raise error if can't be easily transformed."""
e = ValueError("Too many dimensions."... | {"hexsha": "a6d35afdff9c76fb8dde9e531f326bfa7f569f75", "size": 4421, "ext": "py", "lang": "Python", "max_stars_repo_path": "pyshgp/validation.py", "max_stars_repo_name": "nayabur/pyshgp", "max_stars_repo_head_hexsha": "8a9360b2eb5ebc1f6fdf7f011180034d492fae99", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nul... |
! The Computer Language Benchmarks Game
! https://salsa.debian.org/benchmarksgame-team/benchmarksgame/
!
! Author: Jannis Teunissen
! Heavily based on Fortran code contributed by Pascal Parois
!
! Compilation:
! gfortran -pipe -O3 -fomit-frame-pointer -march=core2 \
! -fopenmp mandelbrot.f90 -o mandelbrot
! if... | {"hexsha": "921f110c60f30a9bfe6f0c66bc2478fd6866b57f", "size": 4312, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "mandelbrot/mandelbrot.f90", "max_stars_repo_name": "jannisteunissen/benchmarksgame", "max_stars_repo_head_hexsha": "dd9980958c8ad7c0ceb4517bb3ee3c24c754eb73", "max_stars_repo_licenses": ["BSD-3-... |
import unittest
from setup.settings import *
from numpy.testing import *
from pandas.util.testing import *
import numpy as np
import dolphindb_numpy as dnp
import pandas as pd
import orca
class FunctionDivmodTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
# connect to a DolphinDB server
... | {"hexsha": "5a99aeb900518c737fc085b2c6a5240b91b21dc2", "size": 2807, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/numpy_unit_testing/test_function_binary_operator_divmod.py", "max_stars_repo_name": "jiajiaxu123/Orca", "max_stars_repo_head_hexsha": "e86189e70c1d0387816bb98b8047a6232fbda9df", "max_stars_r... |
#--------------------------------------------------------------------------------
# Copyright (c) 2020 Michael A. Boemo (mb915@cam.ac.uk)
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software with... | {"hexsha": "c5d295b8b40b11845392417ba4dcb7a0b3e84426", "size": 12160, "ext": "py", "lang": "Python", "max_stars_repo_path": "refine.py", "max_stars_repo_name": "alexanderma11/clonalMasker", "max_stars_repo_head_hexsha": "fed9c1d26af0aa8c0bdb809a093d2b397f6ba64d", "max_stars_repo_licenses": ["MIT"], "max_stars_count": n... |
import os
import random
import shutil
import cv2
import numpy as np
from tqdm import tqdm
from utils.masked_face_creator import MaskedFaceCreator
class YoutubeMaskedFaceDatasetCreator:
def __init__(self, dataset_path, new_dataset_folder_path, mask_type="a"):
self.dataset_path = dataset_path
self... | {"hexsha": "992203038d665536906ad706f78186ee70355a87", "size": 2590, "ext": "py", "lang": "Python", "max_stars_repo_path": "datasets_util/youtube_faces_dataset.py", "max_stars_repo_name": "sachith500/MaskedFaceRepresentation", "max_stars_repo_head_hexsha": "9d1ab60d70b9cad3d2b7848e5bfe13565ab424ce", "max_stars_repo_lic... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.