text stringlengths 0 1.25M | meta stringlengths 47 1.89k |
|---|---|
"""
Simple training loop; Boilerplate that could apply to any arbitrary neural network,
so nothing in this file really has anything to do with GPT specifically.
from karpathy/minGPT
"""
import time
import random
import numpy as np
from tqdm import tqdm, trange
from tabulate import tabulate
from text2sql.model import... | {"hexsha": "c13011e403362559fe379d3f2a99371bba04510f", "size": 7045, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/text2sql/trainer.py", "max_stars_repo_name": "yashbonde/text2sql", "max_stars_repo_head_hexsha": "a8202c2bb9c6cd845674492d900c13c07df6c69b", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
import numpy as np
import asyncio
class Subprocess:
""" For use in class FFmpeg """
################## Interface with shell #########################
async def execute_command(self, *cmd, input=None, loop=None):
p = await asyncio.create_subprocess_exec(
*cmd,
stdin=asyncio.su... | {"hexsha": "b5212b120f5e29eee892c0c0a60733430fa58605", "size": 3983, "ext": "py", "lang": "Python", "max_stars_repo_path": "sigpy/_subprocess.py", "max_stars_repo_name": "jadujoel/audio-compressor-python", "max_stars_repo_head_hexsha": "ee37e61a6f03885c36576801121ca096e77940aa", "max_stars_repo_licenses": ["MIT"], "max... |
# Copyright 2022 Google LLC.
#
# 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 to in writing, ... | {"hexsha": "948904c7caea67b83e24fa711efe9cb1bd51f8db", "size": 23869, "ext": "py", "lang": "Python", "max_stars_repo_path": "plur/model_design/evaluation.py", "max_stars_repo_name": "VHellendoorn/plur", "max_stars_repo_head_hexsha": "63ea4b8dd44b43d26177fb23b0572e0b7c20f4cd", "max_stars_repo_licenses": ["Apache-2.0"], ... |
Require Import Coq.Wellfounded.Inverse_Image.
Require Import MyTactics.
Require Export Autosubst.Autosubst.
Require Export AutosubstExtra.
Require Export Autosubst_IsRen.
Require Import Arith.
Require Import PeanoNat.
(* Require Export Autosubst_EOS. *)
Require Import Arith.Wf_nat.
Require Export Autosubst_FreeVars.
... | {"author": "CatalaLang", "repo": "catala-formalization", "sha": "30edf137f1e250a61b46ab1aef03273d9d33b8a0", "save_path": "github-repos/coq/CatalaLang-catala-formalization", "path": "github-repos/coq/CatalaLang-catala-formalization/catala-formalization-30edf137f1e250a61b46ab1aef03273d9d33b8a0/theories/lcalc/LCSyntax.v"} |
# noqa: D100
from __future__ import annotations
import cf_xarray # noqa
import numpy as np
import xarray
from xclim.core.units import convert_units_to, declare_units
# Frequencies : YS: year start, QS-DEC: seasons starting in december, MS: month start
# See https://pandas.pydata.org/pandas-docs/stable/user_guide/ti... | {"hexsha": "c1e7f1a4abc9f2788710b127180e7f586bfc7be0", "size": 3907, "ext": "py", "lang": "Python", "max_stars_repo_path": "xclim/indices/_synoptic.py", "max_stars_repo_name": "Ouranosinc/dcvar", "max_stars_repo_head_hexsha": "0737c66a36f8969e7a17276990bc7e76f7b410c4", "max_stars_repo_licenses": ["Apache-2.0"], "max_st... |
#!python
import numpy as np
from magLabUtilities.datafileutilities.timeDomain import importFromXlsx
from magLabUtilities.signalutilities.signals import SignalThread, Signal, SignalBundle
from magLabUtilities.signalutilities.hysteresis import XExpQA, HysteresisSignalBundle
from magLabUtilities.uiutilities.plottin... | {"hexsha": "80fa5869d04d26d08c6d7b737a066487fd3399dd", "size": 3115, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/tempCalculus.py", "max_stars_repo_name": "MarkTravers/magLabUtilities", "max_stars_repo_head_hexsha": "e116c8cb627cd82c3b8ba651dd6979b66e568632", "max_stars_repo_licenses": ["MIT"], "max_sta... |
function [h,tf]=Jakes_Flat(fd,Ts,Ns,t0,E0,phi_N)
% Inputs:
% fd : Doppler frequency
% Ts : sampling period
% Ns : number of samples
% t0 : initial time
% E0 : channel power
% phi_N : inital phase of the maximum doppler frequency sinusoid
% Outputs:
% h : complex fading vect... | {"author": "LyricYang", "repo": "MIMO_OFDM", "sha": "df25e1837bc4019f2bbcd946bc49b0942827a847", "save_path": "github-repos/MATLAB/LyricYang-MIMO_OFDM", "path": "github-repos/MATLAB/LyricYang-MIMO_OFDM/MIMO_OFDM-df25e1837bc4019f2bbcd946bc49b0942827a847/\u7b2c2\u7ae0 SISO\u4fe1\u9053\u6a21\u578b/Jakes\u6a21\u578b/Jakes_F... |
import numpy as np
from hdmf.common.table import VectorData
from nwbwidgets.utils.dynamictable import infer_categorical_columns
from nwbwidgets.utils.testing import dicts_exact_equal
from pynwb.core import DynamicTable
def test_infer_categorical_columns():
data1 = np.array([1, 2, 2, 3, 1, 1, 3, 2, 3])
data2 =... | {"hexsha": "6c01807b0a4424f6a476f441f3925cdeb2de7174", "size": 919, "ext": "py", "lang": "Python", "max_stars_repo_path": "nwbwidgets/test/test_utils_dynamictable.py", "max_stars_repo_name": "alejoe91/nwb-jupyter-widgets", "max_stars_repo_head_hexsha": "5703f235c5c1a1bf8b32c9af6de2a6907788ce1a", "max_stars_repo_license... |
PARAMETER (NSTEP=20)
DIMENSION PHI(0:NSTEP),S(0:NSTEP)
50 PRINT *,' Enter omega (.le. 0 to stop)'
READ *, OMEGA
IF (OMEGA .LE. 0) STOP
H=1./NSTEP
DO 10 IX=0,NSTEP
X=IX*H
S(IX)=H*H*12*X*X
PHI(IX)=0.
10 CONTINUE
DO 20 ITER=1,500
... | {"hexsha": "4aac9ae57743941a6d77501fc1c160981d5bc1b6", "size": 819, "ext": "for", "lang": "FORTRAN", "max_stars_repo_path": "Source-Koonin-Code/WarmUp/chap6a.for", "max_stars_repo_name": "ajz34/Comp-Phys-Koonin", "max_stars_repo_head_hexsha": "9fc371bdb44b7030025d254eda040a55bfa3b7cd", "max_stars_repo_licenses": ["MIT"... |
## --- Read ESRI Arc/Info ASCII grid files
function importAAIGrid(fname, T=Float64; undefval=NaN)
# Open the file
fid = open(fname)
metadata = Dict{String,Number}()
metadata["ncols"] = parse(Int64, match(r" *(.*?)$", readline(fid))[1])
metadata["nrows"] = parse(Int64, matc... | {"hexsha": "e463a0328ee5850554c7507b4e794b32e54743ab", "size": 12771, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/utilities/GIS.jl", "max_stars_repo_name": "brenhinkeller/StatGeochem.jl", "max_stars_repo_head_hexsha": "43c6ee9d6ffd49c2aac78083c3ae4640663e23d2", "max_stars_repo_licenses": ["MIT"], "max_sta... |
import numpy as np
import matplotlib.pyplot as plt
import time as time
################################################################### create message bits
###################################################################
tic = time.time()
##Generating random message bits
n = 50000
n2 = 50050
m = np.random.randi... | {"hexsha": "845115b7460c03f6ac08068448a0b86299949b46", "size": 3978, "ext": "py", "lang": "Python", "max_stars_repo_path": "error_rate_hamming_code.py", "max_stars_repo_name": "Epuerto96/Digicomm-Final-Project", "max_stars_repo_head_hexsha": "2a4c571d6b68191802bd7a00c929a28121d28d7e", "max_stars_repo_licenses": ["MIT"]... |
/-
Copyright (c) 2022 Julian Berman. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Julian Berman
-/
import group_theory.exponent
import group_theory.order_of_element
import group_theory.quotient_group
/-!
# Torsion groups
This file defines torsion groups, i.e. grou... | {"author": "subfish-zhou", "repo": "N2Lean", "sha": "8e858cc5b01f1ad921094dc355db3cb9473a42fd", "save_path": "github-repos/lean/subfish-zhou-N2Lean", "path": "github-repos/lean/subfish-zhou-N2Lean/N2Lean-8e858cc5b01f1ad921094dc355db3cb9473a42fd/group_theory/torsion.lean"} |
'''
Saves numpy array of mean pixel values across all images (clips any pixel intensities above 3 std)
For training data, also saves the mask that indicates which pixels belong to ROI
Arguments:
Path to neurofinder folder, e.g. 'C:\Users\Username\Desktop\neurofinder.00.00'
Path to save output numpy arrays
Outputs:
X_... | {"hexsha": "7321d35ac8fb047faad99659fe99c72fbbb5f491", "size": 3154, "ext": "py", "lang": "Python", "max_stars_repo_path": "Advanced_ML/Neuron_Detection/preprocessing.py", "max_stars_repo_name": "jrclimer/Projects", "max_stars_repo_head_hexsha": "6023f8309685d1a273d7e89993863c89ad85dfb5", "max_stars_repo_licenses": ["M... |
# Shree KRISHNAya Namaha
# Differentiable warper implemented in PyTorch. Warping is done on batches.
# Tested on PyTorch 1.8.1
# Author: Nagabhushan S N
# Last Modified: 27/09/2021
import datetime
import time
import traceback
from pathlib import Path
from typing import Tuple, Optional
import numpy
import skimage.io
i... | {"hexsha": "066bc90754d83e4c783fbff8533415f406c7990b", "size": 19599, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/WarperPytorch.py", "max_stars_repo_name": "NagabhushanSN95/Pose-Warping", "max_stars_repo_head_hexsha": "9d5400b6a0fe299ece3481c29b0f8fe9ba7bee4e", "max_stars_repo_licenses": ["MIT"], "max_st... |
c
c
c
c
double precision function fbody(x,y)
implicit double precision (a-h,o-z)
common /userdt/ cfl,gamma,gamma1,xprob,yprob,alpha,Re,iprob,
. ismp,gradThreshold
c
c negative inside the body (exterior to the domain), positive otherwise.
c
c no geometry
c fbody = 1.d0
c ... | {"hexsha": "6a2b60af897f1813f4bb8af62cc161dd6cbe347d", "size": 526, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "examples/horizontalShock/fbody.f", "max_stars_repo_name": "mjberger/ho_amrclaw_amrcart", "max_stars_repo_head_hexsha": "0e0d37dda52b8c813f7fc4bd7e61c5fdb33b0ada", "max_stars_repo_licenses": ["BSD-3... |
"""
Generate single-file CCS BAM and FASTQ outputs from a ConsensusReadSet.
"""
import tempfile
import logging
import uuid
import math
import sys
import os.path as op
import re
import numpy as np
from pbcommand.models import FileTypes, ResourceTypes, get_pbparser, DataStoreFile, DataStore
from pbcommand.cli import p... | {"hexsha": "a2824ddd95716f49b7b1483835a22a2900705338", "size": 6847, "ext": "py", "lang": "Python", "max_stars_repo_path": "SLpackage/private/pacbio/pythonpkgs/pbcoretools/lib/python2.7/site-packages/pbcoretools/tasks/auto_ccs_outputs.py", "max_stars_repo_name": "fanglab/6mASCOPE", "max_stars_repo_head_hexsha": "3f1fdc... |
import logging
import pandas as pd
import numpy as np
from sqlalchemy import create_engine
from mlapp.handlers.databases.database_interface import DatabaseInterface
class SQLAlchemyHandler(DatabaseInterface):
def __init__(self, settings):
"""
Initializes the SQLAlchemyHandler
:param settin... | {"hexsha": "2031c678b7e36c174a00e5a19a9095e63478e963", "size": 7612, "ext": "py", "lang": "Python", "max_stars_repo_path": "mlapp/handlers/databases/sql_alchemy_handler.py", "max_stars_repo_name": "nbk905/mlapp", "max_stars_repo_head_hexsha": "af650a8a302959674dd5a1bc6d15e30e90abf227", "max_stars_repo_licenses": ["Apac... |
import numpy as np
import sys
import Tools as tl
from scipy.io import loadmat
import matplotlib.pyplot as plt
import yaml
from anytree.importer import DictImporter
from Gesture import Gesture
from Word import Word
from pprint import pprint # just for nice printing
from anytree import RenderTree # just for nice printi... | {"hexsha": "4d8fdfcffad4333302dfd74edf28f9bd1cfa5d99", "size": 8953, "ext": "py", "lang": "Python", "max_stars_repo_path": "gest2vt-matlab/ErrorDisplay.py", "max_stars_repo_name": "toutios/garsy", "max_stars_repo_head_hexsha": "8743b9a97be10afe59357b23a5c0853a5dbceb64", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
// MIT License
//
// Copyright (c) 2018 Michal Siedlaczek
//
// 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 without restriction, including without limitation the rights
// to use, copy, m... | {"hexsha": "04974c4258a9f3276b9cc3073c94643db3d116f6", "size": 3333, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "include/irkit/coding/prefix_codec.hpp", "max_stars_repo_name": "elshize/irkit", "max_stars_repo_head_hexsha": "9fbfd0af975a7270f95fcdccba09958c818530b7", "max_stars_repo_licenses": ["MIT"], "max_sta... |
# coding=utf-8
# Copyright 2021 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | {"hexsha": "f5d9724304f2e5c7708206d57b887bad31bf1387", "size": 7924, "ext": "py", "lang": "Python", "max_stars_repo_path": "learned_optimization/optimizers/base.py", "max_stars_repo_name": "Sohl-Dickstein/learned_optimization", "max_stars_repo_head_hexsha": "cd929359a51d09444665021387c058aac11b63ba", "max_stars_repo_li... |
program t
print *,.true.
print *,.false.
end program t
| {"hexsha": "c931d8740e2a6dd20f8c49ea7e1de620a7010590", "size": 79, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "tests/t0021x/t.f", "max_stars_repo_name": "maddenp/ppp", "max_stars_repo_head_hexsha": "81956c0fc66ff742531817ac9028c4df940cc13e", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count": 2, "m... |
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import umap
from sklearn.preprocessing import StandardScaler
# load the dataframes and attach labels to the weller and wu set
ww = pd.read_csv(snakemake.input.ww, index_col=0)
jor = pd.read_csv(snakemake.input.jor, index_col=0)
labs = pd.read_csv(s... | {"hexsha": "4310de1e5712906bdc1dbedf76a163856a999319", "size": 1764, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/pres_abs_umap.py", "max_stars_repo_name": "godzilla-but-nicer/SporeLoss", "max_stars_repo_head_hexsha": "8159a628e5f17191254583c053891070ba3d6e7f", "max_stars_repo_licenses": ["MIT"], "max... |
!-------------------------------------------------------------------------------
! neural network implementation that utilizes ConvLayers and PoolLayers
! (from conv_layer_definitions.f08 and pool_layer_definitions.f08)
!-------------------------------------------------------------------------------
module conv_neural... | {"hexsha": "40389d22ac05fd7c6cba6b26314afff8233ce9d4", "size": 14812, "ext": "f08", "lang": "FORTRAN", "max_stars_repo_path": "src/conv_neural_net.f08", "max_stars_repo_name": "welchmatt/Neural-Network-Framework", "max_stars_repo_head_hexsha": "66cb1ee6a33e2114666bcdae3db2c788b964173e", "max_stars_repo_licenses": ["MIT... |
import numpy as np
import pandas as pd
import sys
# import astroquery
# import matplotlib.pyplot as plt
# import glob
from tqdm import tqdm
# import matplotlib
from tvguide import TessPointing
from astropy.coordinates import SkyCoord
from astropy import units as u
from numpy.random import poisson, beta, uniform
from nu... | {"hexsha": "fc98eda96cd0dfc4bb5af3a9d18514cf6935db4f", "size": 15066, "ext": "py", "lang": "Python", "max_stars_repo_path": "code/make_catalog.py", "max_stars_repo_name": "tessgi/textended", "max_stars_repo_head_hexsha": "a911c791b3f138d69ed6b715321ac223ad3f216a", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
"""
http://www.cs.toronto.edu/~kriz/cifar.html
"""
import numpy as np
import urllib.request
import os
import tarfile
import pickle
from PIL import Image
import matplotlib.pyplot as plt
import shutil
import glob
import sys
cifar10_url = 'https://www.cs.toronto.edu/~kriz/cifar-10-python.tar.gz'
output_path = os.path.jo... | {"hexsha": "3afd2faa149bd111ab28a85e982c5f1892b896b0", "size": 7643, "ext": "py", "lang": "Python", "max_stars_repo_path": "misc/download_dataset_cifar10.py", "max_stars_repo_name": "abhishekrana/isic2018-skin-lesion-classifier-tensorflow", "max_stars_repo_head_hexsha": "fa9fc3ab921099c447784bbf41dbf724c477d946", "max_... |
import random
import numpy as np
from .utils import get_igraph, get_full_igraph
import networkx as nx
def remove_nodes_by_attr(G, attr, remove_proportion, ascending=False):
"""
Remove some proportion of nodes (and attached edges) from a graph based on
an atrribute's numeric order.
Parameters
-----... | {"hexsha": "532218a94b317f3f187403bcbbb0d6cf8a4cb8e7", "size": 8448, "ext": "py", "lang": "Python", "max_stars_repo_path": "tools/network_vulnerability.py", "max_stars_repo_name": "andre-morelli/Urban-Analytics", "max_stars_repo_head_hexsha": "fab5beeb826b7c4128f2b6c40435644c754ec026", "max_stars_repo_licenses": ["MIT"... |
import numpy as np
from sim.sim2d_prediction import sim_run
# Simulator options.
options = {}
options['FIG_SIZE'] = [8,8]
options['ALLOW_SPEEDING'] = True
class KalmanFilter:
def __init__(self):
# Initial State
self.x = np.matrix([[55.],
[3.],
... | {"hexsha": "a9f737cb40e41f59a4ffa22e918d24a31417897f", "size": 3410, "ext": "py", "lang": "Python", "max_stars_repo_path": "assignment4.py", "max_stars_repo_name": "GKPr0/Autonomous-Robots-Kalman-Filter", "max_stars_repo_head_hexsha": "ed38e19075e5f20ca0f9e488bea9074dabe5ee6b", "max_stars_repo_licenses": ["MIT"], "max_... |
import numpy as np
import sys, os
import re
from pdb import set_trace as st
CORRUPTIONS = [
'gaussian_noise', 'shot_noise', 'impulse_noise', 'defocus_blur',
'glass_blur', 'motion_blur', 'zoom_blur', 'snow', 'frost', 'fog',
'brightness', 'contrast', 'elastic_transform', 'pixelate',
'jpe... | {"hexsha": "e0740b38eae33e12d2038d8049a03e0550905db8", "size": 2576, "ext": "py", "lang": "Python", "max_stars_repo_path": "analyze_log.py", "max_stars_repo_name": "kikacaty/dino", "max_stars_repo_head_hexsha": "7ae62d9f8d609de7a6eec91a4d21ae5737327515", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count": nul... |
import numpy as np
from optimizers.sgd import SGD
class Model():
def __init__(self):
self.layers = []
self.optimizer = None
def get_layers(self):
return self.layers
def get_output_shape(self):
return self.layers[-1].get_output_shape()
def add(self, layer):
self.layers.append(layer)
num_layers = len... | {"hexsha": "7f5f0014eefeb5e4b44236289168c47317d8b7be", "size": 800, "ext": "py", "lang": "Python", "max_stars_repo_path": "core/model.py", "max_stars_repo_name": "minqi/basicnn", "max_stars_repo_head_hexsha": "62231edfa67fdff1378849f988de8f4c42d4a48a", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_s... |
import sys
import copy
import time
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import gym
from karel_env.tool.syntax_checker import PySyntaxChecker
from karel_env.karel_supervised import Karel_world_supervised
from rl.distribut... | {"hexsha": "b7f4ed56b30719efdc6abeff1d07acca6002283f", "size": 43633, "ext": "py", "lang": "Python", "max_stars_repo_path": "pretrain/models.py", "max_stars_repo_name": "clvrai/leaps", "max_stars_repo_head_hexsha": "d04ea06a6d16fefbbd4a86d6fd9cb394fe6328d9", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 14, "m... |
import pretty_midi
import numpy as np
def test_get_beats():
pm = pretty_midi.PrettyMIDI()
# Add a note to force get_end_time() to be non-zero
i = pretty_midi.Instrument(0)
i.notes.append(pretty_midi.Note(100, 100, 0.3, 10.4))
pm.instruments.append(i)
# pretty_midi assumes 120 bpm unless otherw... | {"hexsha": "d0068c6b6af942286e919924c401c2d1587bcbf8", "size": 13125, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_pretty_midi.py", "max_stars_repo_name": "adarob/pretty-midi", "max_stars_repo_head_hexsha": "5c1a0ec193a993511ddd2938d294e20b8049b32f", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
"""
mbase module
This module contains the base model and base package classes from which
all of the other models and packages inherit from.
"""
from __future__ import print_function
import numpy as np
from numpy.lib.recfunctions import stack_arrays
import sys
import os
import subprocess as sp
import ... | {"hexsha": "7166d746b9baf7e9e1882647e828f33e321595ac", "size": 41047, "ext": "py", "lang": "Python", "max_stars_repo_path": "flopy/mbase.py", "max_stars_repo_name": "langevin/flopy", "max_stars_repo_head_hexsha": "2398a0b9a9294b4e2fb5c7e0228f0f42af45b80a", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_count":... |
[STATEMENT]
lemma epi_right_invertible:
"\<lbrakk>g \<in> hom H G; f \<in> carrier G \<rightarrow> carrier H; \<And>x. x \<in> carrier G \<Longrightarrow> g(f x) = x\<rbrakk> \<Longrightarrow> g \<in> epi H G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<lbrakk>g \<in> hom H G; f \<in> carrier G \<rightarrow>... | {"llama_tokens": 207, "file": null, "length": 1} |
[STATEMENT]
lemma deny:
"matches \<gamma> m p \<Longrightarrow> a = Drop \<or> a = Reject \<Longrightarrow> iptables_goto_bigstep \<Gamma> \<gamma> p [Rule m a] Undecided (Decision FinalDeny)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<lbrakk>matches \<gamma> m p; a = Drop \<or> a = Reject\<rbrakk> \<Lon... | {"llama_tokens": 172, "file": "Iptables_Semantics_Semantics_Goto", "length": 1} |
\subsubsection{Some sanity checks}
Let's take an example, to see what we get for a typical case. We can write the beta-model as a radially symmetric pressure model:
\begin{equation}
p(x) = {1\over{(1 + x^2)^{3\beta/2}}}
\end{equation}
In the particular case $\beta = 2/3$, the integrals become analytic. In particul... | {"hexsha": "e1ebc37f2384e817da1245dbb22674b9a8d6a9fa", "size": 2037, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "help/sanityChecks.tex", "max_stars_repo_name": "erikleitch/climax", "max_stars_repo_head_hexsha": "66ce64b0ab9f3a3722d3177cc5215ccf59369e88", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1... |
import os
import re
import sys
import time
import numpy as np
import torch
# import argparse
from datetime import datetime
# My modules
from dataset_utils import save_tokenized_dataset
from models.generators.default.generator import Generator_model as Generator
use_cuda = True
np.random.seed(234); # Fix seed
torch.... | {"hexsha": "cd6163e1b989c18d21ce89f1c7cf398782f4d749", "size": 3094, "ext": "py", "lang": "Python", "max_stars_repo_path": "generate_sentences.py", "max_stars_repo_name": "ribeirompl/GANs-text-generation", "max_stars_repo_head_hexsha": "58bfce076653aa21186bc57873443ac803ea94da", "max_stars_repo_licenses": ["BSD-3-Claus... |
import matplotlib
matplotlib.use('Agg')
import os
import numpy as np
import matplotlib.pyplot as plt
import torch
import torchvision
import torch.nn as nn
import torch.nn.functional as F
import models
models_path = './checkpoints/AdvGAN/'
losses_path = './results/losses/'
def init_weights(m):
'''
C... | {"hexsha": "ac284cbb2a90d5e66fdf958eadd2dac9c91b3f97", "size": 6685, "ext": "py", "lang": "Python", "max_stars_repo_path": "AdvGAN/advGAN.py", "max_stars_repo_name": "zhaohuajing/CaptchaGAN", "max_stars_repo_head_hexsha": "228e93a5f6a7cee240f82c60950de121d64451c2", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
import pytest
import tensorflow as tf
import numpy as np
import pandas as pd
import tempfile
import tophat.callbacks as cbks
from pathlib import Path
from tophat.data import FeatureSource, InteractionsSource
from tophat.constants import FType, FGroup
from tophat.tasks.wrapper import FactorizationTaskWrapper
from tophat... | {"hexsha": "e7a9cabeb97b45db65ff26f73542568dc859b700", "size": 4873, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_movielens_load.py", "max_stars_repo_name": "JasonTam/tophat", "max_stars_repo_head_hexsha": "ab0fc93f9caa319698db00de1586012f4049d7c1", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
[STATEMENT]
lemma Standard_starfun_iff:
assumes inj: "\<And>x y. f x = f y \<Longrightarrow> x = y"
shows "starfun f x \<in> Standard \<longleftrightarrow> x \<in> Standard"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. ((*f* f) x \<in> Standard) = (x \<in> Standard)
[PROOF STEP]
proof
[PROOF STATE]
proof (stat... | {"llama_tokens": 2376, "file": null, "length": 36} |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import unittest
import numpy as np
import gc
import utils
from data_manager import DataManager
class DataManagerTest(unittest.TestCase):
def setUp(self):
self.manager = DataMana... | {"hexsha": "e395b810bea4efec8c904b57f32482386aa997e9", "size": 1122, "ext": "py", "lang": "Python", "max_stars_repo_path": "spiral/data_manager_test.py", "max_stars_repo_name": "miyosuda/variational_walkback", "max_stars_repo_head_hexsha": "4aa613a55d41a8fdfac01458a3d2f3386e0f5c28", "max_stars_repo_licenses": ["Apache-... |
# plot the Hugoniot loci for a compressible Riemann problem
from __future__ import print_function
import matplotlib.pyplot as plt
import numpy as np
import riemann
import matplotlib as mpl
# Use LaTeX for rendering
mpl.rcParams['mathtext.fontset'] = 'cm'
mpl.rcParams['mathtext.rm'] = 'serif'
mpl.rcParams['font.size... | {"hexsha": "aa86d40633578111be4708f9fcc71ba6336149af", "size": 736, "ext": "py", "lang": "Python", "max_stars_repo_path": "compressible/riemann-phase.py", "max_stars_repo_name": "python-hydro/hydro_examples", "max_stars_repo_head_hexsha": "55b7750a7644f3e2187f7fe338b6bc1d6fb9c139", "max_stars_repo_licenses": ["BSD-3-Cl... |
from __future__ import absolute_import
import numpy
import falconn
from ann_benchmarks.algorithms.base import BaseANN
class FALCONN(BaseANN):
# See https://github.com/FALCONN-LIB/FALCONN/blob/master/src/examples/glove/glove.py
def __init__(self, metric, num_bits, num_tables, num_probes = None):
if not ... | {"hexsha": "5813a56dccbfbf782e3470cf80a1cbe510b110aa", "size": 2461, "ext": "py", "lang": "Python", "max_stars_repo_path": "ann_benchmarks/algorithms/falconn.py", "max_stars_repo_name": "maumueller/ann-benchmarks-sisap19", "max_stars_repo_head_hexsha": "43de8657f317bbd75468f0dce820f86d9497bfe6", "max_stars_repo_license... |
import dill
import numpy as np
import os
import sys
fragment_name = sys.argv[1]
level = sys.argv[2]
batch = sys.argv[3]
folder = sys.argv[4]
infile = open(fragment_name, 'rb')
frag_class = dill.load(infile)
#make changes as needed to frag_class
# example:
# frag_class.qc_backend.spin = 2
cmd = 'sbatch -J %s -o "... | {"hexsha": "0d7e503ccf312f39577c5a6b889ff6e277969fb3", "size": 514, "ext": "py", "lang": "Python", "max_stars_repo_path": "inputs/new_frag_job.py", "max_stars_repo_name": "nbraunsc/MIM", "max_stars_repo_head_hexsha": "587ae79b0ec76c20af6235a68c85ed15f2cc7155", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_cou... |
import cv2
import numpy as np
def _draw_rectangle(image_tmp, window, color, thickness, fill = False):
cv2.rectangle(image_tmp, window[0], window[1], color, thickness)
if fill:
fill_color = (color[0] //3, color[1] //3, color[2] //3)
cv2.rectangle(image_tmp, window[0], window[1], fill_color,... | {"hexsha": "99945f1662e981198e239fce43edb7b32453f972", "size": 1044, "ext": "py", "lang": "Python", "max_stars_repo_path": "code/draw.py", "max_stars_repo_name": "olasson/SDCND-T1-P5-VehicleDetection", "max_stars_repo_head_hexsha": "104bbbb5a7b62f2bd58d31ced0c407f4378235c4", "max_stars_repo_licenses": ["MIT"], "max_sta... |
import numpy as np
class StackingLayer:
def __init__(self, k_fold=5, *model_list):
self._k_fold = k_fold
self._model_list = model_list
def train(self, train_x, train_y, test_x):
each_size = int(len(train_x) / self._k_fold)
train_x_list = []
train_y_list = []
fo... | {"hexsha": "938598ff1460e9ac4df836ff197e8692abd31f74", "size": 1950, "ext": "py", "lang": "Python", "max_stars_repo_path": "model/stacking.py", "max_stars_repo_name": "Gofinge/HF", "max_stars_repo_head_hexsha": "71baee1632cd0bf3562eed1e315b6a605699dbe9", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 7, "max_st... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from pathlib import Path
import numpy as np
import torch
from torch.utils.data import DataLoader
def create_mnist_data_loader(config):
# データセットのホームディレクトリを設定
data_home = Path(config['data_home'])
# 学習データのクラス名を取得
# クラス数・ラベル名の読み込み
# 画像Pathリストの作成
... | {"hexsha": "75c5c1420a323476c1d833f34d6e699899d93735", "size": 725, "ext": "py", "lang": "Python", "max_stars_repo_path": "libs/data_loader.py", "max_stars_repo_name": "pystokes/mnist", "max_stars_repo_head_hexsha": "ad63158bb53bd7f85c531f708936684edb5b7bd0", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null,... |
###############################################################################
## Solar System Simulation ##
## Written by Jacan Chaplais, 2019 ##
## jacan.chaplais@gmail.com ##
... | {"hexsha": "227042bf4474e38eaddb3526fab1c628dfdce495", "size": 7715, "ext": "py", "lang": "Python", "max_stars_repo_path": "solar-system.py", "max_stars_repo_name": "jacanchaplais/solar-system", "max_stars_repo_head_hexsha": "86e56d127af3f91234af3b9bd72888049fe6deed", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
[STATEMENT]
lemma LT28:
assumes h: "|~ P \<longrightarrow> \<circle>P \<or> \<circle>Q"
shows "|~ (P \<longrightarrow> \<circle>P) \<or> \<diamond>Q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. |~ (P \<longrightarrow> \<circle>P) \<or> \<diamond>Q
[PROOF STEP]
using h E23[of Q]
[PROOF STATE]
proof (prove)
us... | {"llama_tokens": 220, "file": "TLA_Rules", "length": 2} |
import importlib.resources as pkg_resources
import sys
from abc import ABC, abstractmethod
import numpy as np
from pycuda.compiler import SourceModule as cpp
class KernelPrepper(ABC):
def __init__(self):
self.f = None
self.pre_kernel = []
self.kernel = None
self.kernel_lines = []... | {"hexsha": "c8cdff076821eeb614ea1eca99f45b5459f5e1b5", "size": 4239, "ext": "py", "lang": "Python", "max_stars_repo_path": "warphog/kernels/kernels.py", "max_stars_repo_name": "SamStudio8/warphog", "max_stars_repo_head_hexsha": "b5a0b5375f8cdeca160f29f22773e2f3e7234515", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
# Copyright (c) 2020 Yaoyao Liu. 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.
# A copy of the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license" file a... | {"hexsha": "d7becc2f232b5ddf1da0605654a9cacc9eabfb74", "size": 9996, "ext": "py", "lang": "Python", "max_stars_repo_path": "main.py", "max_stars_repo_name": "TristanGomez44/e3bm", "max_stars_repo_head_hexsha": "9da81d09c5ef381f3f7bb7c8372cff69a8de32f0", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count": null... |
[STATEMENT]
lemma succss_closed:
assumes inc: "nodeAbs ` succss X \<subseteq> nodeAbs ` X"
and X: "X \<subseteq> { x . isNode x }"
shows "nodeAbs ` reachable X = nodeAbs ` X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. nodeAbs ` reachable X = nodeAbs ` X
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
go... | {"llama_tokens": 5752, "file": "KBPs_DFS", "length": 36} |
from .sinkhorn_numba import sinkhorn_numba, sinkhorn_numba_parallel
from .log_domain_skh import log_domain_sinkhorn
import numpy as np
def sinkhorn(r, C, M, lamda=20, tol=1e-6, maxiter=10000, log_domain=False, parallel=False):
"""
A main sinkhorn function to call appropriate sinkhorn function according to user... | {"hexsha": "c9084aa01ae152f0586d5a1c255b940e1fbe9b8f", "size": 1356, "ext": "py", "lang": "Python", "max_stars_repo_path": "sinkhorn_663/sinkhorn_main.py", "max_stars_repo_name": "congwei-yang/663-Final-Project", "max_stars_repo_head_hexsha": "3502a00167075e8a7b7cca1da01e7352e2f1c674", "max_stars_repo_licenses": ["MIT"... |
module SymTensors
using LinearAlgebra
using Random
import Base: convert, size, show, isless, isequal, ==, isapprox, *, conj, zero, inv
import Base: eltype, similar, copyto!
import Base: fill, fill!, rand, sum
import LinearAlgebra: mul!, rmul!, axpy!, axpby!, dot, norm, normalize!, svd, diag
import Base.intersect
#us... | {"hexsha": "97955b6918a847f61c9a0d1924827270847d7c88", "size": 1664, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/SymTensors.jl", "max_stars_repo_name": "amiragha/mps", "max_stars_repo_head_hexsha": "1ccde15036d96a5ace95ed563822077d6ed0a402", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "ma... |
############################################################################################
include("params.jl")
include("construct.jl")
include("chainrules.jl")
include("types/types.jl")
include("nested/nested.jl")
include("constraints/constraints.jl")
###############################################################... | {"hexsha": "f1154cde81490ce62d567d80b8ec451b6bc1d7c4", "size": 359, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/Core/flatten/flatten.jl", "max_stars_repo_name": "paschermayr/ModelWrappers.jl", "max_stars_repo_head_hexsha": "ea2e45c6ca3b0605916cf828ed4b8ae750b73eea", "max_stars_repo_licenses": ["MIT"], "ma... |
(* GENERIC *)
Require Export ComponentSM7.
Require Export MinBFTcount_gen_tacs.
Require Export MinBFTcount_gen1.
Require Export MinBFTrep.
Require Export MinBFTprep.
Section MinBFTcount_gen2_commit.
Local Open Scope eo.
Local Open Scope proc.
Context { dtc : DTimeContext }.
Context {... | {"author": "veri-fit", "repo": "Asphalion", "sha": "fbf9c82e75dc7b5c98774e4ab07c642eb3856105", "save_path": "github-repos/coq/veri-fit-Asphalion", "path": "github-repos/coq/veri-fit-Asphalion/Asphalion-fbf9c82e75dc7b5c98774e4ab07c642eb3856105/MinBFT/MinBFTcount_gen2_commit.v"} |
import numpy as np
from sklearn.model_selection import train_test_split
from ._utils import read_csv, read_tsv, norm
def file2list(path,use_attri):
data = read_csv(path)
pairs = []
labels = [0]*(len(data)-1)
length = len(data[0])
mid = int(length/2)
if length % 2 == 1 :
labels = [ int(... | {"hexsha": "a1f11344bf0691f50817eb6776961cb4829305a9", "size": 1630, "ext": "py", "lang": "Python", "max_stars_repo_path": "dader/data/dataset.py", "max_stars_repo_name": "tuhahaha/dader-pypi", "max_stars_repo_head_hexsha": "b5867727151fe7de0f2711e8202778a901517ec0", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
import os
import sys
import tensorflow as tf
import numpy as np
from tqdm import tqdm
from wavenet.model import WaveNetModel, create_bias_variable
import nnmnkwii.preprocessing as P
class Vocoder(object):
def __init__(self, hparams, max_to_keep=5):
self.hparams = hparams
dilations_factor = hpara... | {"hexsha": "c223ff5d232374eed52776f7becd6e1775e57606", "size": 8695, "ext": "py", "lang": "Python", "max_stars_repo_path": "apps/vocoder/model/vocoder.py", "max_stars_repo_name": "DSAIL-SKKU/WaveNet-Vocoder", "max_stars_repo_head_hexsha": "e1e7f86dab85149162b7f8011a2a2c8424ac4036", "max_stars_repo_licenses": ["MIT"], "... |
import pytest
import nussl
from nussl.separation import SeparationException
import numpy as np
import os
REGRESSION_PATH = 'tests/separation/regression/spatial/'
os.makedirs(REGRESSION_PATH, exist_ok=True)
def test_spatial_clustering(mix_and_sources, check_against_regression_data):
nussl.utils.seed(0)
mix, s... | {"hexsha": "38e2fc2565ff783c09d1a552f58fe66a1768c676", "size": 4120, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/separation/test_spatial.py", "max_stars_repo_name": "ZhaoJY1/nussl", "max_stars_repo_head_hexsha": "57aabeabca3b2e75849e1659a522e3c2f77e9172", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
from tqdm import tqdm as tqdm
import numpy as np
import skimage
import lmdb
import os
from skimage.transform import resize
import deepracing.imutils
import ChannelOrder_pb2
import Image_pb2
import cv2
import time
import google.protobuf.empty_pb2 as Empty_pb2
import PIL.Image as PILImage
import torchvision, torchvision.... | {"hexsha": "64764bc61ab689987887a4cfdf9fde6a5efb8883", "size": 3819, "ext": "py", "lang": "Python", "max_stars_repo_path": "deepracing_py/deepracing/backend/OpticalFlowBackend.py", "max_stars_repo_name": "linklab-uva/deepracing", "max_stars_repo_head_hexsha": "fc25c47658277df029e7399d295d97a75fe85216", "max_stars_repo_... |
import rospy
import numpy as np
import tf.transformations
import tf2_msgs.msg
import tf2_ros
import geometry_msgs.msg
from sensor_msgs.msg import NavSatStatus, NavSatFix, Imu, MagneticField
from nav_msgs.msg import Odometry
from std_msgs.msg import UInt16, Float64
from nclt2ros.extractor.base_raw_data import BaseRawDa... | {"hexsha": "8bcb996fd0cdaf6aee08ce1a367f70fbfb58428a", "size": 21782, "ext": "py", "lang": "Python", "max_stars_repo_path": "nclt2ros/transformer/sensor_data.py", "max_stars_repo_name": "bierschi/nclt2ros", "max_stars_repo_head_hexsha": "77b30ca6750d4b0cd82ccb6660f2fd0946581091", "max_stars_repo_licenses": ["MIT"], "ma... |
import matplotlib.pyplot as plt
import numpy as np
from sklearn.datasets import load_diabetes
from sklearn.utils import shuffle
class LinearRegressionRidge:
def __init__(self, l2):
self.W = None
self.b = None
self.l2 = l2
@staticmethod
def load_data():
ds = load_diabetes()... | {"hexsha": "c98b9f07f0b5ac2b3cb1a38987f337fb53ea6544", "size": 1757, "ext": "py", "lang": "Python", "max_stars_repo_path": "01_linear_regression_ridge.py", "max_stars_repo_name": "kaimo455/numpy_ml", "max_stars_repo_head_hexsha": "00d476a776f65565b1c352883dcba1942b2b5b2b", "max_stars_repo_licenses": ["MIT"], "max_stars... |
# #! /usr/bin/env python
# Load Libraries
import numpy as np
import scipy as sp
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
import pytest
from .. import _api
def create_dummy_dataset(seed=None, n=30, base_mean=0, expt_groups=6,
... | {"hexsha": "6df1255f5ef6a9461e65fbf35ba64ea1680bddf0", "size": 5655, "ext": "py", "lang": "Python", "max_stars_repo_path": "dabest/_archive/old_test_plotting.py", "max_stars_repo_name": "adam2392/DABEST-python", "max_stars_repo_head_hexsha": "e6cd4b8620bacdfd5954bd6cf005c7cb677414e9", "max_stars_repo_licenses": ["BSD-3... |
import sys
sys.path.append('..')
import numpy as np
from scipy.spatial import Delaunay
from scipy.linalg import solve
from composites.laminate import read_isotropic
from tudaesasII.tria3r import Tria3R, update_K, DOF
#def test_nat_freq_plate(plot=False, mode=0):
plot = False
if True:
nx = 9
ny = 9
# ge... | {"hexsha": "a5fc9631ff8196cd0bb2a8836abbc7bfec0b5687", "size": 3562, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_tria3r_static_point_load.py", "max_stars_repo_name": "saullocastro/tudaesasII", "max_stars_repo_head_hexsha": "32c7e0fad9a58d783ce280270eb3556ad8946182", "max_stars_repo_licenses": ["BS... |
```python
import numpy as np
import matplotlib.pyplot as plt
import scipy
from sklearn.model_selection import ParameterGrid
from sklearn.manifold import Isomap
import time
from tqdm import tqdm
import librosa
from librosa import cqt
from librosa.core import amplitude_to_db
from librosa.display import specshow
import... | {"hexsha": "27680834484e1dee35418b03b3d3667200f1c4b3", "size": 83837, "ext": "ipynb", "lang": "Jupyter Notebook", "max_stars_repo_path": "test-notebooks/helicalitySOL_instr.ipynb", "max_stars_repo_name": "sripathisridhar/sridhar2020ismir", "max_stars_repo_head_hexsha": "7e7b621fdf83a67784ab0b1fce37e483931094f8", "max_s... |
import numpy as np
def get_first_layers(image, w1=None, b1=None):
i = image.flatten()
w_1 = np.vstack((i, np.ones_like(i)))
w_1 = np.hstack((w_1, w_1)).T
b_1 = np.hstack((0.5 * np.ones_like(i), -0.5 * np.ones_like(i))).T
w_2 = np.hstack((np.eye(i.shape[0]), -1.0 * np.eye(i.shape[0])))
b_2 = -... | {"hexsha": "667789c016b7cf83f5f5eec5a78e1d7035a1f120", "size": 1568, "ext": "py", "lang": "Python", "max_stars_repo_path": "threat_models/threat_bandc.py", "max_stars_repo_name": "JeetMo/Semantify-NN", "max_stars_repo_head_hexsha": "d641e413955f1a1f0b742313b48c8c0ad4df8278", "max_stars_repo_licenses": ["MIT"], "max_sta... |
# Figure 11.12 (b)
# Plot the full L1 regularization path for the prostate data set
from scipy.io import loadmat
from sklearn import linear_model
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
# Load prostate cancer data
data = loadmat('../data/prostate/prostateSt... | {"hexsha": "3506fa228ad7e558096efca840bf7c001987260f", "size": 831, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/lassoPathProstate.py", "max_stars_repo_name": "VaibhaviMishra04/pyprobml", "max_stars_repo_head_hexsha": "53208f571561acd25e8608ac5d1eb5e2610f6cc0", "max_stars_repo_licenses": ["MIT"], "max... |
from scipy import signal
import numpy as np
def transform(data, fs, num_rowscols, num_repeat, seconds_to_slice):
""" Given data imported from .mat, return the data in a format which is easy to use.
Args:
data (dict): The dictionary of importing .mat file.
fs (float): The sampling frequency... | {"hexsha": "b415c4bcd597a8713531a02226229631a3ce22d5", "size": 4592, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/data/preprocessing.py", "max_stars_repo_name": "Yuchen-Wang-SH/Electroencephalography-EEG-Signal-Classification-using-Deep-Learning", "max_stars_repo_head_hexsha": "55a3100182b7b5340ada375d46d... |
import numpy as np
from world.geometry import Route
def distance_from_route(route, point):
"""
:param route: the route
:type route: Route
:param point:
:type point: np.ndarray
:return:
"""
xyz = np.array([route.x, route.y, route.z]).T
if point.ndim == 1:
point = point.res... | {"hexsha": "abd950ead06a5d41b7cd9dd8ac74cda2ccf4be9f", "size": 2310, "ext": "py", "lang": "Python", "max_stars_repo_path": "stats/utils.py", "max_stars_repo_name": "jannsta1/insectvision", "max_stars_repo_head_hexsha": "d98a7acbcde1d5faf00131485fa85c706f313814", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nu... |
import eagerx
from eagerx.utils.utils import Msg
from typing import Optional, List
from std_msgs.msg import Float32, Float32MultiArray, UInt64
import numpy as np
class CustomOdeInput(eagerx.EngineNode):
@staticmethod
@eagerx.register.spec("CustomOdeInput", eagerx.EngineNode)
def spec(
spec,
... | {"hexsha": "37cce7f017947d3848c82395a329fd0667bbebea", "size": 2599, "ext": "py", "lang": "Python", "max_stars_repo_path": "eagerx_dcsc_setups/pendulum/ode/engine_nodes.py", "max_stars_repo_name": "eager-dev/eagerx_dcsc_setups", "max_stars_repo_head_hexsha": "72a14a2c640f8abb1c1bfad017caaa51fa4832ea", "max_stars_repo_l... |
import unittest
import pandas as pd
from statsmodels.stats import proportion
from meerkat_analysis import util
from meerkat_analysis import geo
class GeoTest(unittest.TestCase):
""" Testing geo methods"""
def test_incidence_rate_by_location(self):
data = pd.read_csv("meerkat_analysis/test/test_data/u... | {"hexsha": "7685f8f6eaff8588fee6a36ed2c8be291cd49c24", "size": 2162, "ext": "py", "lang": "Python", "max_stars_repo_path": "meerkat_analysis/test/test_geo.py", "max_stars_repo_name": "fjelltopp/meerkat_analysis", "max_stars_repo_head_hexsha": "ad68b02636ee5543e4aa78ac7f46126d040d67ed", "max_stars_repo_licenses": ["MIT"... |
# this contains imports plugins that configure py.test for astropy tests.
# by importing them here in conftest.py they are discoverable by py.test
# no matter how it is invoked within the source tree.
import os
from distutils.version import LooseVersion
from astropy.version import version as astropy_version
if astropy... | {"hexsha": "b54888a04195cc3d663ba1fc936636065a7cc52e", "size": 1207, "ext": "py", "lang": "Python", "max_stars_repo_path": "pvextractor/conftest.py", "max_stars_repo_name": "keflavich/pvextractor", "max_stars_repo_head_hexsha": "a61673b38d59f395f53d0069ab6a7b7e2d3b99fd", "max_stars_repo_licenses": ["BSD-3-Clause"], "ma... |
import numpy as np
from PIL import Image
import torch
from torch.utils.data import Dataset
class ClassificationDataset(Dataset):
def __init__(self, file_paths, targets, augmentations = None):
self.files = file_paths
self.targets = targets
self.augmentations = augmentations
def _... | {"hexsha": "670b67bc46ba27da72bd8a31ccf9dd0775bacffd", "size": 1136, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/dataset.py", "max_stars_repo_name": "abhinavnayak11/Hand-Cricket", "max_stars_repo_head_hexsha": "e2a52cb72ca58d447cd927e800497d469fe7bb59", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
globalVariables(c("Dy", "Total Deaths", "Mag", "Latitude", "LOCATION_NAME", "Longitude", "Mo",
"Location Name", "Year", "popup_text"))
#' Plot Earthquakes in a Map
#'
#' This function takes a dataset, with latitude and longitude columns, and displays
#' its earthquakes in a leaflet map. The data is ... | {"hexsha": "6eacb5e15360d728efa08608908819798ef72ddb", "size": 2749, "ext": "r", "lang": "R", "max_stars_repo_path": "R/earthquakes_mapping.r", "max_stars_repo_name": "MarcEres/Earthquakes", "max_stars_repo_head_hexsha": "19b0ee0b18d346c2d301b41aaa7181ccd4b12a57", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
subroutine wrtsurf(fname,flen, mid, vert, vtot,
& vindx, itot, vnor)
include 'qlog.h'
c
character*80 line(5),fname,pname
integer vtot,itot,flen,i,k
real mid(3)
c
real vert(3,vtot),vnor(3,vtot)
integer vindx(3*itot)
c
c
c NB scale and igrid only used if no bscale, and for picking purposes
c
c copy vindx4 (in... | {"hexsha": "1caab01d2f9f85b026c8f0aed178522c0ec4dcce", "size": 1740, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "lib/delphi/src/wrtsurf.f", "max_stars_repo_name": "caixiuhong/Stable-MCCE", "max_stars_repo_head_hexsha": "186bdafdf1d631994b2cdd6ec6a548383f559929", "max_stars_repo_licenses": ["MIT"], "max_stars... |
# -*- coding: utf-8 -*-
"""
Advent of Code 2021
@author marc
"""
import numpy as np
with open("input-day11", 'r') as f:
# with open("input-day11-test", 'r') as f:
lines = [[int(i) for i in l.split()[0]] for l in f.readlines()]
grid = np.array(lines, dtype=int)
# nEpochs = 100
flashcount = 0
synchronous = Fal... | {"hexsha": "45efee689cfe0045ba74b64aba2647e94d3e89d6", "size": 1943, "ext": "py", "lang": "Python", "max_stars_repo_path": "day11.py", "max_stars_repo_name": "mss2304/adventOfCode2021", "max_stars_repo_head_hexsha": "aa4e256d7a6fc29546b6bad3e82e3e5a83f09b73", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null,... |
import os
import gym
import numpy as np
import pytest
import torch
import opcc
from opcc.config import ENV_CONFIGS
DATASET_ENV_PAIRS = []
for _env_name in ENV_CONFIGS.keys():
DATASET_ENV_PAIRS += [(_env_name, dataset_name)
for dataset_name in
ENV_CONFIGS[_env_n... | {"hexsha": "dd77e33824fc522bae4f1d51361e1b33e8b799e4", "size": 6261, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_queries.py", "max_stars_repo_name": "koulanurag/opcc", "max_stars_repo_head_hexsha": "b6f99fb2f2deeef51707e136ac946b2357ac4f36", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_co... |
import scipy as sp
def Combinations(values, k):
"""This function outputs all the possible combinations of k elements from the vector values"""
if int(k) < 0:
raise ValueError("k must a positive integer")
#Make input vectors column vectors
if values.shape == (1,values.size):
va... | {"hexsha": "787051ef80d63d88a62a6f94caf2612d66e6216e", "size": 1390, "ext": "py", "lang": "Python", "max_stars_repo_path": "Applications/Recursion/combinations.py", "max_stars_repo_name": "abefrandsen/numerical_computing", "max_stars_repo_head_hexsha": "90559f7c4f387885eb44ea7b1fa19bb602f496cb", "max_stars_repo_license... |
# -*- coding: utf-8 -*-
"""Interactively select data points from muLAn output files for cleaning purpose"""
# Copyright (c) 2014-2018 Clément Ranc & Arnaud Cassan
# Distributed under the terms of the MIT license
#
# This module is part of software:
# muLAn: gravitational MICROlensing Analysis code
# https:... | {"hexsha": "dd526dc2b10ba27d8b166c9f21fb316ffa5eed8a", "size": 4077, "ext": "py", "lang": "Python", "max_stars_repo_path": "muLAn/utils/muLAnCleanData.py", "max_stars_repo_name": "muLAn-project/muLAn", "max_stars_repo_head_hexsha": "6144b315f6109715001c22b6a2ae74c1e2803cae", "max_stars_repo_licenses": ["MIT"], "max_sta... |
import os
import numpy as np
import pickle
import time
from collections import deque
from mpi4py import MPI
import tensorflow as tf
from stable_baselines import logger
from stable_baselines.common import tf_util, SetVerbosity, TensorboardWriter
from stable_baselines import DDPG
from stable_baselines.common.buffers i... | {"hexsha": "34a5138a8e542f2650817420432f27b64040b049", "size": 17187, "ext": "py", "lang": "Python", "max_stars_repo_path": "gym_environments/models/ddpgfmpi.py", "max_stars_repo_name": "szahlner/shadow-teleop", "max_stars_repo_head_hexsha": "360c7d7c2586e9295c45fca0b4850b43d230bcda", "max_stars_repo_licenses": ["MIT"]... |
"""Parallel reduction: put max at u[1,1]"""
function reduceMax!(u)
tx = blockDim().x * (blockIdx().x - 1) + threadIdx().x;
ty = blockDim().y * (blockIdx().y - 1) + threadIdx().y;
if tx < size(u, 1) + 1 && ty < size(u, 2) + 1
# reduce over x
stride = blockDim().x >> 1
while s... | {"hexsha": "5e290b9e3b2ad668556c18a853da2fdb81eef61d", "size": 1309, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "sandbox/diffusion2d_CPU_GPU/ReduceMax.jl", "max_stars_repo_name": "Deltares/Porteau.jl", "max_stars_repo_head_hexsha": "949bc40c884f7d1a5cd1decf1c63b6c0a98b3134", "max_stars_repo_licenses": ["MIT"]... |
import numpy as np
a = np.arange(10)
b = a
a[0]=11
print(b)
# return True
print(a is b)
b[1] = 12
print(a)
a[2:4]=[9,10]
print(b)
# deep copy
print("deep copy begin...")
x = a.copy()
print(x)
x[1] = 1000
# a 不会受到影响
print(a)
| {"hexsha": "ca570605a5b9d1f7871af7a4b3a6c43bf84320dd", "size": 227, "ext": "py", "lang": "Python", "max_stars_repo_path": "util_guide/play_numpy/try_numpy_array_copy.py", "max_stars_repo_name": "giraffe-tree/play-tf", "max_stars_repo_head_hexsha": "30f39f228d55fdeb35f1bd420b3bb29ecd3ade96", "max_stars_repo_licenses": [... |
import tensorflow as tf
from tensorflow.python.platform import test
from absl.testing import parameterized
from custom_helper_op import sparse_conv2d, sparse_conv3d, SparseConv3DLayer, sparse_pad
import numpy as np
from tensorflow.python.ops import gradient_checker_v2
import time
class SparseConv3DTest(test.TestCase,... | {"hexsha": "420518a063b73628a611ae69ee7849305d69bdae", "size": 4100, "ext": "py", "lang": "Python", "max_stars_repo_path": "custom_helper_op/python/ops/op_tests/sparse_pad_op_test.py", "max_stars_repo_name": "zhuimeng999/custom_helper_op", "max_stars_repo_head_hexsha": "439c01a9112160ab0a1589454393139d213dcc63", "max_s... |
import numpy as np
import pandas as pd
import unittest as ut
import querier as qr
class Testrequest(ut.TestCase):
def test_request(self):
df = pd.read_csv("tips.csv")
df1 = qr.summarize(
df, req="avg(tip), avg(size), sex, time", group_by="sex, time"
)
df2 = qr.summar... | {"hexsha": "d6f90bc2ae56ae88af6a46d0ad2c17b4eec46c65", "size": 1100, "ext": "py", "lang": "Python", "max_stars_repo_path": "querier/tests/tests_summarize.py", "max_stars_repo_name": "Techtonique/querier", "max_stars_repo_head_hexsha": "47288fc78273f248199fc67b50e96eaa7dd5441a", "max_stars_repo_licenses": ["BSD-3-Clause... |
import numpy as np
import pandas as pd
from pvanalytics import metrics
import pytest
def test_performance_ratio_nrel():
poa_global = np.array([921.75575, 916.11225, 914.8590833, 914.86375,
913.6426667, 889.6296667, 751.4611667])
temp_air = np.array([28.89891667, 29.69258333, 30.2144... | {"hexsha": "36935b34db0042b86c49128be5b2242ea646889e", "size": 2405, "ext": "py", "lang": "Python", "max_stars_repo_path": "pvanalytics/tests/test_metrics.py", "max_stars_repo_name": "MichaelHopwood/pvanalytics", "max_stars_repo_head_hexsha": "1fd4b624e8388cec0cd8830b69c6d6cd8ed8026d", "max_stars_repo_licenses": ["MIT"... |
import mayavi.mlab as mlab
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import torch
from e2edet.utils.det3d.box_ops import center_to_corner_box2d, boxes_to_corners_3d
box_colormap = ["black", "peru", "red", "green", "purple"]
def visualize_pts(
pts,
fig=None,
bgcolor=(0, 0, 0),
... | {"hexsha": "7d164ba01896d88db459e5ae1e91ed9db52b3f3d", "size": 9551, "ext": "py", "lang": "Python", "max_stars_repo_path": "e2edet/utils/det3d/visualization.py", "max_stars_repo_name": "eladb3/BoxeR", "max_stars_repo_head_hexsha": "995a38b67e3f84b5d6ea6fedbcb16896c4b1d020", "max_stars_repo_licenses": ["MIT"], "max_star... |
import numpy as np
import collections
from .penalized_regression import PenalizedRegression as PLR
from . import elbo as elbo_py
from . import coordinate_descent_step as cd_step
from ..models.normal_means_ash_scaled import NormalMeansASHScaled
from ..models.plr_ash import PenalizedMrASH
from ..models import mixture_gau... | {"hexsha": "7b5a1a0fd76172add750f01f1a8aa3902d17ae79", "size": 12956, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/mrashpen/inference/lbfgsfit.py", "max_stars_repo_name": "banskt/mr-ash-pen", "max_stars_repo_head_hexsha": "a9e574f66ce64265bff22cf0661d23a5706e4515", "max_stars_repo_licenses": ["MIT"], "max... |
#-*- coding: utf-8 -*-
from _base import *
from cqt import CNTPowerSpectrum, A0, A1, A2, C8, A8
import numpy as np
import scipy.signal as sig
inf = float('inf')
class GammatoneSpectrum(SpectrumBase):
@staticmethod
def erb_space(N, freq_base, freq_max):
EarQ = 9.26449
minBW = 24.7
q... | {"hexsha": "9e94a888882493d2447ac07707a0e9ef16f0bd63", "size": 9791, "ext": "py", "lang": "Python", "max_stars_repo_path": "dear/spectrum/auditory.py", "max_stars_repo_name": "dongying/dear", "max_stars_repo_head_hexsha": "6f9a4f63bf3ee197dc03d7d2bd0451a83906d2ba", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
#
# File:
# grb1.py
#
# Synopsis:
# Plots GRIB2 data on a rotated grid.
#
# Category:
# Contours over maps
# Maps
#
# Author:
# Mary Haley (based on NCL example from Dave Brown)
#
# Date of initial publication:
# April, 2015
#
# Description:
#
# Effects illustrated:
# o Reading data from ... | {"hexsha": "ff6ec23575cf95851f8c8ae1ca55462d7113c9ec", "size": 2056, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/grb1.py", "max_stars_repo_name": "yang69can/pyngl", "max_stars_repo_head_hexsha": "78a7040ce9de4b7a442b0c3b5faecccab2f01426", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count":... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
from jsk_topic_tools import ConnectionBasedTransport
import rospy
from sensor_msgs.msg import Image
import cv_bridge
class MaskImageToLabel(ConnectionBasedTransport):
def __init__(self):
super(MaskImageToLabel, self).__init__()
sel... | {"hexsha": "2fa6784049d5b059275e666154d25dd611e09a36", "size": 1137, "ext": "py", "lang": "Python", "max_stars_repo_path": "jsk_recognition/jsk_perception/node_scripts/mask_image_to_label.py", "max_stars_repo_name": "VT-ASIM-LAB/autoware.ai", "max_stars_repo_head_hexsha": "211dff3bee2d2782cb10444272c5d98d1f30d33a", "ma... |
[STATEMENT]
lemma path_split_second:
assumes "n -as@a#as'\<rightarrow>* n'" shows "sourcenode a -a#as'\<rightarrow>* n'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. sourcenode a -a # as'\<rightarrow>* n'
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
1. sourcenode a -a # as'\<rightarrow>* n... | {"llama_tokens": 519, "file": "Slicing_Basic_CFG", "length": 7} |
#!/usr/bin/env python
# Incorporated Daniel Ruschel Dutra's code into XDGNIRS, July 2014 -REM
################################################################################
# CHANGE LOG #
# ... | {"hexsha": "9ddc72f4da8569923e8002e4728a9909cf530241", "size": 16464, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/noise_spectrum.py", "max_stars_repo_name": "andrewwstephens/GNIRS-Pype", "max_stars_repo_head_hexsha": "eb38f75e98d4f12aee51bab3c2058f28ab2a318f", "max_stars_repo_licenses": ["BSD-3-Clause"],... |
#ifndef GP_UTILITY_RESULT
#define GP_UTILITY_RESULT
#include <variant>
#include <string>
#include <type_traits>
#include <optional>
#include <functional>
#include <boost/optional.hpp>
#include "is_detected.hpp"
#include "is_match_template.hpp"
namespace gp::utility {
template <typename T>
struct Ok{
u... | {"hexsha": "9790e9713f121faabadbdb2a0d4d68affd1fd35a", "size": 13998, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "include/gp/utility/result.hpp", "max_stars_repo_name": "ho-ri1991/genetic-programming", "max_stars_repo_head_hexsha": "06d0c1f0719f4d2ddcf9c066d9de1d0bb67772b0", "max_stars_repo_licenses": ["MIT"],... |
[STATEMENT]
lemma of_nat_real_float_equiv: "(of_nat n :: real) = (of_nat n :: float)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. real n = real_of_float (of_nat n)
[PROOF STEP]
by (induction n, simp_all add: of_nat_def) | {"llama_tokens": 97, "file": "Taylor_Models_Taylor_Models_Misc", "length": 1} |
import argparse
import os.path as osp
import shutil
import tempfile
import numpy as np
import mmcv
import torch
import torch.distributed as dist
from mmcv.runner import load_checkpoint, get_dist_info
from mmcv.parallel import MMDataParallel, MMDistributedDataParallel
from mmdet.apis import init_dist
from mmdet.core im... | {"hexsha": "08823cf3bb4cd56cc414f02de82d414167fc3ae2", "size": 3282, "ext": "py", "lang": "Python", "max_stars_repo_path": "tools/vid_vis.py", "max_stars_repo_name": "youshyee/Greatape-Detection", "max_stars_repo_head_hexsha": "333b63d8f76538659bcd2bc6022128830a7a435b", "max_stars_repo_licenses": ["Apache-2.0"], "max_s... |
##
using ACE
using Printf, Test, LinearAlgebra, StaticArrays
using ACE: evaluate, evaluate_d, evaluate_ed,
Rn1pBasis, Ylm1pBasis,
PositionState, Product1pBasis, getlabel, get_spec,
State, DState, rand_vec3, rand_radial, rand_sphere, Scal1pBasis,
discrete_jacobi
using Random: shuffle
using ... | {"hexsha": "59a516c44bdb09a4eb72df815c3d6b665165ab53", "size": 3537, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/test_1pbasis.jl", "max_stars_repo_name": "JuliaMolSim/PoSH.jl", "max_stars_repo_head_hexsha": "59ca5fece8a698ca20c820c6dca2802feb247172", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
// Copyright (C) 2015 The Regents of the University of California (Regents)
// and Google, Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must ... | {"hexsha": "61e30c4ed8ba829ec3fc3767abd63513ce685218", "size": 7742, "ext": "cc", "lang": "C++", "max_stars_repo_path": "src/theia/sfm/pose/two_point_pose_partial_rotation.cc", "max_stars_repo_name": "SpectacularAI/TheiaSfM", "max_stars_repo_head_hexsha": "3dbb45cd6c239a4bab2beb46812c4ba7094a0625", "max_stars_repo_lice... |
\section{Course program}
The course is structured into four(4) chapters. The four chapters take place during the six weeks of the course.
\subsection{Chapter 1 - statically typed programming languages}
\paragraph*{Topics}
\begin{itemize}
\item What are types?
\item (\textbf{Advanced}) Typing and semantic rules: how ... | {"hexsha": "6510a3c0050db079e51a698f8abe7988c33b9746", "size": 1744, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "Modulewijzer/Programma.tex", "max_stars_repo_name": "hogeschool/INFDEV02-3", "max_stars_repo_head_hexsha": "8593840ddb7f89e60d541ac4e936393ebf8adf05", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
#!/usr/bin/python3
from mpi4py import MPI
import random
import math
import numpy as np #Modulo que tiene operaciones para manejo de datos.
import matplotlib.pyplot as plt #Permite hacer grafics buenos.
#-------------------------------------------------------------------------
# Function: gen_data
# Purpose: Gener... | {"hexsha": "804c0b2b535ecf3aa2110e7aae84bb6e0e33b611", "size": 5639, "ext": "py", "lang": "Python", "max_stars_repo_path": "LAB_MPI/Ejercicio#2/histogram_mpi.py", "max_stars_repo_name": "oigresagetro/Programacion_ParalelaYConcurrente", "max_stars_repo_head_hexsha": "8e2d7a28c7aa0137129065eb35518cda5ee0cde8", "max_stars... |
///
/// Copyright (c) 2009-2014 Nous Xiong (348944179 at qq dot com)
///
/// 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)
///
/// See https://github.com/nousxiong/gce for latest version.
///
#ifndef GCE_A... | {"hexsha": "89ce55b3ca3f9b13d3eb5c78da229fc2c1fe8274", "size": 1018, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "gce/actor/detail/basic_socket.hpp", "max_stars_repo_name": "nousxiong/gce", "max_stars_repo_head_hexsha": "722edb8c91efaf16375664d66134ecabb16e1447", "max_stars_repo_licenses": ["BSL-1.0"], "max_sta... |
"""
Image Classification training script
Copyright (c) Yang Lu, 2017
"""
from __future__ import print_function
import inspect
import os
import sys
this_file = inspect.getfile(inspect.currentframe())
file_pth = os.path.abspath(os.path.dirname(this_file))
sys.path.append(file_pth + '/../') # path of pytorc... | {"hexsha": "fa5521bd5e9f154fb9492c4364fbfeaa4043915e", "size": 14123, "ext": "py", "lang": "Python", "max_stars_repo_path": "tools/cls_cifar.py", "max_stars_repo_name": "alex18212010045/pytorch-priv", "max_stars_repo_head_hexsha": "0c007d693ef20ed0168b8b766e58835af5e8eebf", "max_stars_repo_licenses": ["MIT"], "max_star... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.