text
stringlengths
0
1.25M
meta
stringlengths
47
1.89k
import numpy as np from typing import Any, Callable, Iterator, List, Optional, Tuple, Union, cast from d3rlpy.metrics.scorer import AlgoProtocol, _make_batches from d3rlpy.dataset import Episode from rl4rs.policy.policy_model import policy_model WINDOW_SIZE = 1024 # modify from https://github.com/takuseno/d3rlpy/blo...
{"hexsha": "7593fa1314c392d3f7661163cd03fe7f2984ca9e", "size": 5551, "ext": "py", "lang": "Python", "max_stars_repo_path": "rl4rs/utils/d3rlpy_scorer.py", "max_stars_repo_name": "fuxiAIlab/RL4RS", "max_stars_repo_head_hexsha": "e26ee5d068eaffd0f04779067614e34e313b1200", "max_stars_repo_licenses": ["Apache-2.0"], "max_s...
#pragma once #include <boost/program_options.hpp> #include <iostream> using namespace boost::program_options; using namespace std; namespace utils { /** * Prepare command line arguments processing. */ options_description prepareCommandLineOptions (); /** * Parse command line. * @param ...
{"hexsha": "60f3b6507db65b1ee9a5b20fc9841252ffbd175a", "size": 1589, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "utils/command_line.hpp", "max_stars_repo_name": "char-lie/pop3_client", "max_stars_repo_head_hexsha": "fceb4266443177358e2f0bdf2d3ebc78ab000601", "max_stars_repo_licenses": ["MIT"], "max_stars_count...
import os import yaml import time import shutil import torch import random import argparse import numpy as np import matplotlib.pyplot as plt from torch.utils import data from tqdm import tqdm from torchvision.utils import save_image, make_grid from tifffile import imsave from functools import reduce from ptsemseg.m...
{"hexsha": "c1dfeae9590b533517225c56a514a8ec5a87ac6a", "size": 20322, "ext": "py", "lang": "Python", "max_stars_repo_path": "code/UnMICST-P/train.py", "max_stars_repo_name": "Yu-AnChen/UnMICST-info", "max_stars_repo_head_hexsha": "9bcc8a408f3c0c8fab2f58778152ae47ee10ad59", "max_stars_repo_licenses": ["MIT"], "max_stars...
# convert binary into HDF5 data using HDF5 datasets = [("train", ["data_batch_$i.bin" for i in 1:5]), ("test", ["test_batch.bin"])] const width = 32 const height = 32 const channels = 3 const batch_size = 10000 mean_model = zeros(Float32, width, height, channels, 1) for (key, sources) in dat...
{"hexsha": "fa6171de36b914b2e46a9efd8b492a5c422f89ab", "size": 2067, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "examples/cifar10/convert.jl", "max_stars_repo_name": "baajur/Mocha.jl", "max_stars_repo_head_hexsha": "5e15b882d7dd615b0c5159bb6fde2cc040b2d8ee", "max_stars_repo_licenses": ["MIT"], "max_stars_coun...
\section{Nutrition} It is of my genuine belief that nutrition is of utmost importance. From personal experience, I've felt what a bad nutrition can make you think. Since what we eat is directly correlated with the compounds ours bodies are able to produce, from amino acids to hormones, it becomes clear that a good nutr...
{"hexsha": "ad7b9dd6794ecb95dc6d2d6320c3c4bab2be9add", "size": 2354, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "content/Nutrition.tex", "max_stars_repo_name": "jmoraispk/TheDocument", "max_stars_repo_head_hexsha": "ef14eaaec34cb09a0945ff4647e87ff77eac6890", "max_stars_repo_licenses": ["MIT"], "max_stars_count...
import logging import os import pickle import tempfile import shutil import operator import pandas as pd import numpy as np def loadData(currency, interval): logging.info('Data: loading {0} at {1}...'.format(currency, interval)) df = pd.read_csv( r'{0}/../../data/{1}e{2}.csv'.format(os.path.realpath(o...
{"hexsha": "9c74b89a295f131310f7100de41d93a0bfb6249d", "size": 4034, "ext": "py", "lang": "Python", "max_stars_repo_path": "16_rf_ma/stable-35-6/main.py", "max_stars_repo_name": "Tjorriemorrie/trading", "max_stars_repo_head_hexsha": "aafa15a6c564bfa86948ab30e33d554172b38a3e", "max_stars_repo_licenses": ["MIT"], "max_st...
#!/usr/bin/env python '''====================================================== Created by: D. Spencer Maughan Last updated: May 2015 File name: IRIS_DF_Controller.py Organization: RISC Lab, Utah State University Notes: ======================================================''' import roslib;...
{"hexsha": "40029c8f1caeff06f4611276973391395a0d3d7b", "size": 6110, "ext": "py", "lang": "Python", "max_stars_repo_path": "risc_control/src/IRIS_DF_Controller.py", "max_stars_repo_name": "riscmaster/risc_maap", "max_stars_repo_head_hexsha": "48b0ab79c1938bc3ed36442894dd4bf3091a2942", "max_stars_repo_licenses": ["BSD-2...
[STATEMENT] lemma [simp]: "(- grd (step ClassicMark)) loop = {}" [PROOF STATE] proof (prove) goal (1 subgoal): 1. (- grd (step ClassicMark)) loop = {} [PROOF STEP] apply safe [PROOF STATE] proof (prove) goal (1 subgoal): 1. \<And>a aa ab ac ad b. (a, aa, ab, ac, ad, b) \<in> (- grd (step ClassicMark)) loop \<Longr...
{"llama_tokens": 3135, "file": "GraphMarkingIBP_DSWMark", "length": 8}
[GOAL] p : ℕ inst✝ : Fact (Prime p) hp : p % 4 ≠ 3 ⊢ ∃ a b, a ^ 2 + b ^ 2 = p [PROOFSTEP] apply sq_add_sq_of_nat_prime_of_not_irreducible p [GOAL] p : ℕ inst✝ : Fact (Prime p) hp : p % 4 ≠ 3 ⊢ ¬Irreducible ↑p [PROOFSTEP] rwa [PrincipalIdealRing.irreducible_iff_prime, prime_iff_mod_four_eq_three_of_nat_prime p] [GOAL] R...
{"mathlib_filename": "Mathlib.NumberTheory.SumTwoSquares", "llama_tokens": 14858}
cdis Forecast Systems Laboratory cdis NOAA/OAR/ERL/FSL cdis 325 Broadway cdis Boulder, CO 80303 cdis cdis Forecast Research Division cdis Local Analysis and Prediction Branch cdis LAPS cdis cdis This software and its documentation are in the public domain and cdis are furnished "as is." ...
{"hexsha": "dcaf96acc585c7e3a71aec0d0861b07d9cc3aff9", "size": 5767, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "src/lib/newreadobs.f", "max_stars_repo_name": "maxinye/laps-mirror", "max_stars_repo_head_hexsha": "b3f7c08273299a9e19b2187f96bd3eee6e0aa01b", "max_stars_repo_licenses": ["Intel", "Unlicense", "OL...
Sandra and Joe Proudman are a husband a wife duo that are available throughout Davis and surrounding areas for event, portrait, and pet photography.
{"hexsha": "eb9c8b2347393d6381d7aa0526ba55fefd178498", "size": 157, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "lab/davisWiki/Sandra_and_Joe_Proudman_Photography.f", "max_stars_repo_name": "voflo/Search", "max_stars_repo_head_hexsha": "55088b2fe6a9d6c90590f090542e0c0e3c188c7d", "max_stars_repo_licenses": ["M...
from functools import reduce import numpy as np def _fired_rules(instance, rule_list, threshold=0.001): """Returns the rules fired by the instance given a threshold Parameters ---------- instance : dict, {feature: {set_1: pert_1, set_2: pert_2, ...}, ...} Fuzzy representation of the instance ...
{"hexsha": "94ec192b23ef4f554adf431266a95a6399ab0953", "size": 5949, "ext": "py", "lang": "Python", "max_stars_repo_path": "teacher/explanation/_factual.py", "max_stars_repo_name": "Kaysera/fuzzy-lore", "max_stars_repo_head_hexsha": "128131e0f41f480d509b63c5e75d0ce58f07bae4", "max_stars_repo_licenses": ["MIT"], "max_st...
clear clc close all addpath('data') addpath('src') dataset = {'1_mECS', '2_Kolod', '3_Pollen', '4_Usoskin'} for i = 1:4 % perform the analysis for the current dataset load(['Test_' dataset{i}]); C = max(true_labs); %%% number of clusters rng(i,'twister'); %%% for reproducibility [y, S, F, yda...
{"author": "BatzoglouLabSU", "repo": "SIMLR", "sha": "bf44967cd40d9d4c789ecf866b3aae15ae6190f5", "save_path": "github-repos/MATLAB/BatzoglouLabSU-SIMLR", "path": "github-repos/MATLAB/BatzoglouLabSU-SIMLR/SIMLR-bf44967cd40d9d4c789ecf866b3aae15ae6190f5/MATLAB/Matlab_main_demo_SIMLR.m"}
#!/usr/bin/env python from __future__ import division from builtins import range from .._externals.srm import SRM from .procrustes import procrustes import numpy as np from .format_data import format_data as formatter from .._shared.helpers import memoize import warnings @memoize def align(data, align='hyper', normal...
{"hexsha": "846a7423e82a5385e61f8007de3d707e81b644dd", "size": 5648, "ext": "py", "lang": "Python", "max_stars_repo_path": "hypertools/tools/align.py", "max_stars_repo_name": "mewbak/hypertools", "max_stars_repo_head_hexsha": "bc2947737be8bd5a6e2a3bdca84132f6fee8989c", "max_stars_repo_licenses": ["MIT"], "max_stars_cou...
########################################################################################### ## Nighttime light 1992-2018 in Mexican states' ## ## ## ## Code to clip worldwide files using Mexica...
{"hexsha": "61b505738d32392550ad430c0e370d52f0cba06f", "size": 12433, "ext": "r", "lang": "R", "max_stars_repo_path": "code/clip-estados.r", "max_stars_repo_name": "emagar/luminosity", "max_stars_repo_head_hexsha": "db40e79902ed9bf6ad517317f296f0fb82fd01d7", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, "ma...
module TestSweep using TimeZoneLookup using TimeZoneLookup: V using Test @testset "Points comparison" begin @test V(1, 2) > V(1, 3) @test V(1, 2) < V(2, 2) end end
{"hexsha": "db92a2c8fec4a09aa8d18a884b93b325c4e2fe77", "size": 175, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/test03_sweep.jl", "max_stars_repo_name": "Arkoniak/TimeZoneLookup.jl", "max_stars_repo_head_hexsha": "68c18ef9f4875c7c836b7fdb70b4c13c00de6b7d", "max_stars_repo_licenses": ["MIT"], "max_stars_c...
struct RestrictedMeasure{F,M} <: AbstractMeasure f::F base::M end @inline function logdensity(d::RestrictedMeasure, x) d.f(x) || return -Inf return 0.0 end function density(d::RestrictedMeasure, x) d.f(x) || return 0.0 return 1.0 end basemeasure(μ::RestrictedMeasure) = μ.base
{"hexsha": "5500405a8d7c52ab73cf1ff3fb0d0005642d6af2", "size": 304, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/combinators/restricted.jl", "max_stars_repo_name": "theogf/MeasureBase.jl", "max_stars_repo_head_hexsha": "917304dc4f13e8d353306d599ffc89b2f8b2acac", "max_stars_repo_licenses": ["MIT"], "max_sta...
import jax import jax.numpy as jnp import chex from typing import Tuple from ..strategy import Strategy class SimAnneal(Strategy): def __init__(self, num_dims: int, popsize: int): """Simulated Annealing (Rasdi Rere et al., 2015) Reference: https://www.sciencedirect.com/science/article/pii/S1877050...
{"hexsha": "671c4abe24a91a76f60fb0c9435d564d2fb1a565", "size": 3496, "ext": "py", "lang": "Python", "max_stars_repo_path": "evosax/strategies/sim_anneal.py", "max_stars_repo_name": "RobertTLange/evosax", "max_stars_repo_head_hexsha": "2646be9053f08c068347cda27736c1399454eedd", "max_stars_repo_licenses": ["Apache-2.0"],...
#!/usr/bin/env python import numpy as np import rospy import matplotlib.pyplot as plt from sensor_msgs.msg import NavSatFix f = plt.figure() filter_points = np.empty((0, 2), float) def callback1() def callback(nav_sat_fix): global filter_points lat = nav_sat_fix.latitude lon = nav_sat_fix.longitude ...
{"hexsha": "0d50973596ea1a9208402b647dd88a9854aab568", "size": 751, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/plot_sat.py", "max_stars_repo_name": "HMellor/LIO-SAM", "max_stars_repo_head_hexsha": "bf08441fee7de68b5d3a0efe8f0ea2e4d70ca2e9", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_count":...
# Set up and load data # Includes import sys import os import numpy as np import json import os # Setup paths containing utility curr_folder = os.getcwd() sys.path.insert(0, os.path.join(curr_folder,'../app')) # Load the data from utils import load_SQuAD_train arts = load_SQuAD_train()
{"hexsha": "d5b9050d95886e046bdb433fac150e234f745d31", "size": 290, "ext": "py", "lang": "Python", "max_stars_repo_path": "play/test.py", "max_stars_repo_name": "davestanley/animated-succotash", "max_stars_repo_head_hexsha": "174f08063c222ead153bf9db67c75e2843301912", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_s...
!************************************************************************ MODULE si3d_procedures !************************************************************************ ! ! Purpose: Procedures for the semi-implicit 3-D (si3d) hydrodynamic ! model. ! !------------------------------...
{"hexsha": "da6bb31a4bb98eac86075d5fd6ae7286c14d8c59", "size": 162079, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "PSi3DL/si3d_procedures.f90", "max_stars_repo_name": "savalbuena/2021WR030666_3D_Flow_Structures_During_Upwelling_Events_in_Lakes_of_Moderate_Size", "max_stars_repo_head_hexsha": "3f066a270da84...
# AUTOGENERATED! DO NOT EDIT! File to edit: 09_utils.ipynb (unless otherwise specified). __all__ = ['checkIsListOfStr', 'checkUnique', 'checkNoRepeated', 'checkValidArray', 'checkValidDict', 'checkDictArray'] # Cell def checkIsListOfStr(l): "Make sure that l is a list containing only strings" if not isinstanc...
{"hexsha": "3d472b99ac97aa51c1e6fecdc46fac79189f9876", "size": 1695, "ext": "py", "lang": "Python", "max_stars_repo_path": "nangs/utils.py", "max_stars_repo_name": "smatkovi/nangs", "max_stars_repo_head_hexsha": "b9ab6f32fe3632d9ee403f197742cc203670217d", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count": 2,...
#!/usr/bin/python # # Copyright 2018 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 ag...
{"hexsha": "8a8100390c92b3d7acd7f0594e0ceb0746314459", "size": 10375, "ext": "py", "lang": "Python", "max_stars_repo_path": "sg2im/bilinear.py", "max_stars_repo_name": "peter-rich/Conditional-Imitation-bedroom", "max_stars_repo_head_hexsha": "f3ee95f64d4e27c67cbcbadd08754f7bcdd0699e", "max_stars_repo_licenses": ["Apach...
import numpy as np from scipy.interpolate import interp1d from scipy import integrate from scipy.stats import norm from sphericosmo.cosmocontainer import * from sphericosmo.sphericalpower import * def SetupPiTau(piOption,zLimits,cosmoCont): zCurve=cosmoCont.zCurve tauCurve=cosmoCont.taus with...
{"hexsha": "f675b53dc66c17ff85f68bfc46c03c6a75f3982c", "size": 3747, "ext": "py", "lang": "Python", "max_stars_repo_path": "sphericosmo/pitau.py", "max_stars_repo_name": "beckrob/SpheriCosmo", "max_stars_repo_head_hexsha": "a961c70763ce29112cfc2d69bd330601608d55e7", "max_stars_repo_licenses": ["MIT"], "max_stars_count"...
#!/usr/bin/env python3 import os import time import cv2 import pycuda.autoinit # For initializing CUDA driver import pycuda.driver as cuda from utils.yolo_classes import get_cls_dict from utils.display import open_window, set_display, show_fps from utils.visualization import BBoxVisualization from utils.yolo_with_p...
{"hexsha": "4c0439fdfb595b2edea247c0e03847d0968f88e4", "size": 5969, "ext": "py", "lang": "Python", "max_stars_repo_path": "trt_yolo_v4.py", "max_stars_repo_name": "privvyledge/yolov4_trt_ros", "max_stars_repo_head_hexsha": "502a8b6cc61bf18e04033496eca11f39c242f439", "max_stars_repo_licenses": ["MIT"], "max_stars_count...
import numpy as np import pandas as pd import pickle from scipy.integrate import odeint from scipy.integrate import solve_ivp import matplotlib import matplotlib.pyplot as plt np.random.seed(10) #Function to compute equilibrium constant def compute_K(vi, Ai ,Bi, Ci, Di, Gi, Hi, T_K): #Inputs: # - vi...
{"hexsha": "96b84de971c70f52a12f2fe9523cfb9addd8eda2", "size": 10854, "ext": "py", "lang": "Python", "max_stars_repo_path": "In_Silico.py", "max_stars_repo_name": "MuRE-group/ANN_Reforming_Modeling", "max_stars_repo_head_hexsha": "88aa586a4003fff1ff7116bc33611c4c69e8655e", "max_stars_repo_licenses": ["Apache-2.0"], "ma...
module Sampling export ListSampler, RejectionSampler, UniformSampler export create_sampler using Random using DataStructures using QXContexts.Contexts # Module containing sampler objects which provide different levels of sampling features. # Each sampler has a constructor which takes a context to perform sampling i...
{"hexsha": "28fdedf0354b2287d2ca154b2d6a0857291778b3", "size": 7735, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/sampling.jl", "max_stars_repo_name": "JuliaQX/QXRun.jl", "max_stars_repo_head_hexsha": "9d1a271a56372d79a78fdeccd00d6efb45078702", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 6, "max...
import numpy as np import pygame import sys import math def main(): ROW_COUNT = 6 COLUMN_COUNT = 7 BLUE = (0, 0 ,230) BLACK = (0,0,0) RED = (255, 0, 0) YELLOW = (255, 255, 0) def create_board(): board = np.zeros((ROW_COUNT,COLUMN_COUNT)) return board def drop_peice(col, board, row, peice): board[row][...
{"hexsha": "3c19fb5b97957f5ae9cc71172ab433cc97a531f3", "size": 4110, "ext": "py", "lang": "Python", "max_stars_repo_path": "connect4 copy.py", "max_stars_repo_name": "yijiehuang0/connect4AI", "max_stars_repo_head_hexsha": "5a134ded8009fd51210a96ba2169920bf1b19aa8", "max_stars_repo_licenses": ["MIT"], "max_stars_count":...
#/usr/bin/env python import math import numpy as np import time import torch import torch.nn as nn NEG_INF = -float("inf") def logsumexp(*args): if all(a==NEG_INF for a in args): return NEG_INF a_max = max(args) lsp = math.log(sum(math.exp(a - a_max) for a in args)) return a_max + lsp def l...
{"hexsha": "fd12a8fe18a68b47d91919cc89e962495b5ee98a", "size": 6346, "ext": "py", "lang": "Python", "max_stars_repo_path": "ctc.py", "max_stars_repo_name": "robinn37/my_ctc", "max_stars_repo_head_hexsha": "616c0fa3963a4307907480e387af85f48428933a", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count": 1, "max_s...
seed!(1337) x = randn(10000) @testset "default params" begin p = @inferred histogram(x) @test_reference( "references/histogram/default.txt", @io2str(print(IOContext(::IO, :color=>true), p)), render = BeforeAfterFull() ) @test_reference( "references/histogram/default_noco...
{"hexsha": "c6faab209645d9b248123fcddd673fd3ae0e49a7", "size": 4584, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/tst_histogram.jl", "max_stars_repo_name": "simonbyrne/UnicodePlots.jl", "max_stars_repo_head_hexsha": "625ba36b2dc402839a1401a6e90a650c7668eb06", "max_stars_repo_licenses": ["MIT"], "max_stars...
import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' import io import tensorflow as tf from tensorflow import keras from tensorflow.keras.preprocessing.image import ImageDataGenerator, load_img, img_to_array import matplotlib.pyplot as plt import numpy as np from PIL import Image from flask import Flask, req...
{"hexsha": "b94302ca5181d94d729be9c2305647cbea931bc7", "size": 1589, "ext": "py", "lang": "Python", "max_stars_repo_path": "Cloud Computing Development/ml-flask-deployment/main.py", "max_stars_repo_name": "emnopal/bangkit-final-project", "max_stars_repo_head_hexsha": "b0642cb64d916a01101e35844fbf244bafdea4a2", "max_sta...
[STATEMENT] lemma set_child_nodes_pointers_preserved: assumes "w \<in> set_child_nodes_locs object_ptr" assumes "h \<turnstile> w \<rightarrow>\<^sub>h h'" shows "object_ptr_kinds h = object_ptr_kinds h'" [PROOF STATE] proof (prove) goal (1 subgoal): 1. object_ptr_kinds h = object_ptr_kinds h' [PROOF STEP] using...
{"llama_tokens": 373, "file": "Core_SC_DOM_common_Core_DOM_Functions", "length": 2}
import unittest from theano import theano, tensor as tt import numpy as np import pymc3 as pm from pymc3.distributions import HalfCauchy, Normal from pymc3 import Potential, Deterministic from pymc3.theanof import generator class NewModel(pm.Model): def __init__(self, name='', model=None): super(NewModel,...
{"hexsha": "232d1a8090a2273791e9cdeb2d4f61e824501f8b", "size": 6059, "ext": "py", "lang": "Python", "max_stars_repo_path": "pymc3/tests/test_model.py", "max_stars_repo_name": "vpolisky/pymc3", "max_stars_repo_head_hexsha": "87cdd712c86321121c2ed3150764f3d847f5083c", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars...
/************************************************************************* * Copyright (C) 2017-2019 Barcelona Supercomputing Center * * Centro Nacional de Supercomputacion * * All rights reserved. * * ...
{"hexsha": "8ff386624badf8711bc8f23ed918bbd1a494fc00", "size": 7143, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "src/io/task-info.cpp", "max_stars_repo_name": "bsc-ssrg/NORNS", "max_stars_repo_head_hexsha": "4fd2d181019eceadb8b1b04a94e3756476326239", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 2.0, ...
theory HOL_Specific imports Base "~~/src/HOL/Library/Old_Datatype" "~~/src/HOL/Library/Old_Recdef" "~~/src/Tools/Adhoc_Overloading" begin chapter \<open>Higher-Order Logic\<close> text \<open>Isabelle/HOL is based on Higher-Order Logic, a polymorphic version of Church's Simple Theory of Types. HOL can be best ...
{"author": "Josh-Tilles", "repo": "isabelle", "sha": "990accf749b8a6e037d25012258ecae20d59ca62", "save_path": "github-repos/isabelle/Josh-Tilles-isabelle", "path": "github-repos/isabelle/Josh-Tilles-isabelle/isabelle-990accf749b8a6e037d25012258ecae20d59ca62/src/Doc/Isar_Ref/HOL_Specific.thy"}
### A Pluto.jl notebook ### # v0.14.5 using Markdown using InteractiveUtils # ╔═╡ f11023e5-8f7b-4f40-86d3-3407b61863d9 begin using PlutoUI, Viznet, Compose, Plots function shrink(a, b, da, db) d = b .- a r = sqrt(sum(abs2, d)) unitd = d ./ r a .+ unitd .* da, b .- unitd .* db end end; # ╔═╡ ce44f8bd-692e-...
{"hexsha": "b3b02773fa886d7899ecb38fb4f5b221268b998b", "size": 51355, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "notebooks/autodiff.jl", "max_stars_repo_name": "GiggleLiu/NiLang.jl", "max_stars_repo_head_hexsha": "f24036c478ace467ae71f630e1db2698e38fd64d", "max_stars_repo_licenses": ["Apache-2.0"], "max_star...
## This script generates a curves for fluid particle trajectories ## This is intended as the script of a 'Programmable Source' ## Author: Kelton Halbert ## Institution: University of Wisconsin - Madison ## Department: Atmospheric and Oceanic Sciences ## Research Group: Cooperative Institute for Meteorological Satellit...
{"hexsha": "7517cdd54c1a70362b92df06022092d4ce272326", "size": 4379, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/pvplugin.py", "max_stars_repo_name": "keltonhalbert/LOFT", "max_stars_repo_head_hexsha": "23a242dd23036a50a932a25ecb85116ce3194177", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_c...
# -*- coding: utf-8 -*- import numpy as np import torch as th def is_indexable(data): if isinstance(data, tuple): return True elif isinstance(data, list): return True elif isinstance(data, np.ndarray): return True elif isinstance(data, th._TensorBase): return True ...
{"hexsha": "ab8b064feaec20c0eceb9698677d4cadb85e4842", "size": 532, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/flare/util/iter.py", "max_stars_repo_name": "mountain/planetarium", "max_stars_repo_head_hexsha": "14c5a75f9ac0be36f28d059c7bf7a77635d617da", "max_stars_repo_licenses": ["MIT"], "max_stars_coun...
""" This script is organized like so: + `if __name__ == "__main__" sets up the Streamlit UI elements + `generate_image` houses interactions between UI and the CLIP image generation models + Core model code is abstracted in `logic.py` and imported in `generate_image` """ import streamlit as st from pathlib import Path ...
{"hexsha": "d5fdac1838719736239d9b0bc5363ffd34a4045e", "size": 19174, "ext": "py", "lang": "Python", "max_stars_repo_path": "app.py", "max_stars_repo_name": "marklr/vqgan-clip-app", "max_stars_repo_head_hexsha": "23edb7ae6234ab177a91865c02be160151fcf566", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "ma...
import torch import numpy as np def squash(tensor): """ Squash function, defined in [1]. Works as a non-linearity for CapsNets. Input tensor will be of format (bs, units, C, H, W) or (bs, units, C) Norm should be computed on the axis representing the number of units. Parameters ---------- ...
{"hexsha": "f36202abd36716cf3e5b3f4142628b339ffbcd01", "size": 1245, "ext": "py", "lang": "Python", "max_stars_repo_path": "utils.py", "max_stars_repo_name": "apsvieira/Capsule-Networks", "max_stars_repo_head_hexsha": "18bb4429bbcec0508f7760a14c312eb9fdcdd117", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nul...
# -*- coding: utf-8 -*- """ Created on Sun Mar 22 00:39:18 2020 @author: nikbakht """ import tensorflow as tf from tensorflow.keras.layers import Layer import numpy as np class Data(Layer): def __init__(self,Nuser, **kwargs): super(Data, self).__init__(**kwargs) self.EX=100 self.EY=100 ...
{"hexsha": "65c875d98cbc12f75d6a7b98658d78d7f27c454a", "size": 4818, "ext": "py", "lang": "Python", "max_stars_repo_path": "Cellular/Uplink/lib/Data0.py", "max_stars_repo_name": "FerdinandHannequart/Nikbakht", "max_stars_repo_head_hexsha": "85e1b3ec400338de0dea6ad37ce773024d4cd571", "max_stars_repo_licenses": ["MIT"], ...
from pytest import raises from numpy import arange, prod, array, full from hypothesis import given, example from hypothesis.strategies import integers, one_of from ..ndindex import ndindex from ..tuple import Tuple from ..integer import Integer from .helpers import ndindices, check_same, short_shapes @example(..., ...
{"hexsha": "bd6022a64c659c112d5499ba77092d7ca3811c36", "size": 1676, "ext": "py", "lang": "Python", "max_stars_repo_path": "ndindex/tests/test_newshape.py", "max_stars_repo_name": "Quansight/ndindex", "max_stars_repo_head_hexsha": "5957c70d1ab5fab66f7c87aba8030a45f858085c", "max_stars_repo_licenses": ["MIT"], "max_star...
# Use baremodule to shave off a few KB from the serialized `.ji` file baremodule Cubature_jll using Base using Base: UUID import JLLWrappers JLLWrappers.@generate_main_file_header("Cubature") JLLWrappers.@generate_main_file("Cubature", UUID("7bc98958-0e37-5d67-a6ac-a3a19030071a")) end # module Cubature_jll
{"hexsha": "14f9e0436600d5f688230d28dc637903a42b685f", "size": 310, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/Cubature_jll.jl", "max_stars_repo_name": "JuliaBinaryWrappers/Cubature_jll.jl", "max_stars_repo_head_hexsha": "b8ebd00e185c66d6f20613dbb30ad469f8d144e7", "max_stars_repo_licenses": ["MIT"], "max...
[STATEMENT] lemma has_derivative_power[simp, derivative_intros]: fixes f :: "'a :: real_normed_vector \<Rightarrow> 'b :: real_normed_field" assumes f: "(f has_derivative f') (at x within S)" shows "((\<lambda>x. f x^n) has_derivative (\<lambda>y. of_nat n * f' y * f x^(n - 1))) (at x within S)" [PROOF STATE] pro...
{"llama_tokens": 376, "file": null, "length": 2}
import os.path as osp import Image from scipy.misc import fromimage import numpy as np from ImageProcessing import thresholdNDArray from DefinitionsAndUtils import * from GraphAndHistogramUtilities import countQuantiles from CurrentLM import applyCurrentLM, iles, ileNames def applyPredThresh(pixels): # zero remo...
{"hexsha": "1e06435b59cdbeef586efd393b88f7746919e2c7", "size": 1782, "ext": "py", "lang": "Python", "max_stars_repo_path": "thresholdAnImage.py", "max_stars_repo_name": "mfenner1/py_coloc_utils", "max_stars_repo_head_hexsha": "1d98c8e9934928ced9d92f8dcef64471aa4b9dbc", "max_stars_repo_licenses": ["Unlicense", "BSD-3-Cl...
# -*- coding: utf-8 -*- from scipy.constants import Avogadro from pymatgen.core.structure import Structure as Structure_PMG # from pymatgen.analysis.prototypes import AflowPrototypeMatcher from simmate.database.base_data_types import ( DatabaseTable, table_column, Spacegroup, ) # TODO: # Explore polymo...
{"hexsha": "0da110f43f4e8c419cf5f32ced055a04a438d10c", "size": 14381, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/simmate/database/base_data_types/structure.py", "max_stars_repo_name": "sionab/simmate", "max_stars_repo_head_hexsha": "6dedea7310829aae425bf3393e7923e454a0129f", "max_stars_repo_licenses": [...
import numpy as np import heapq import os import time import random import csv import scipy as sp import scipy.stats # Global Variables for easier use in the simulation. # ----------------------------------- Parameters ----------------------------------- pm = 0 # Number of parallel simulations k = 0 # Num...
{"hexsha": "d7db0c2e5199d9d2fb56960ce1d32f4c90281879", "size": 29974, "ext": "py", "lang": "Python", "max_stars_repo_path": "5_server_queue.py", "max_stars_repo_name": "LaughMachine/Summer-Internship-Project", "max_stars_repo_head_hexsha": "9f4a0560853de2b988d08716479b3e62f092f85b", "max_stars_repo_licenses": ["MIT"], ...
from wtpy import BaseCtaStrategy from wtpy import CtaContext import numpy as np import statsmodels.tsa.stattools as ts # 我们首先创建一个函数用来协整检验 def cointegration_check(series01, series02): urt_1 = ts.adfuller(np.array(series01), 1)[1] urt_2 = ts.adfuller(np.array(series02), 1)[1] # 同时平稳或不平稳则差分再次检验 ...
{"hexsha": "e0def8c442ba4bd30c1e801bb4c8867caa3c5a59", "size": 4543, "ext": "py", "lang": "Python", "max_stars_repo_path": "demos/cta_arbitrage_bt/Strategies/T1.py", "max_stars_repo_name": "systemtrader/wtpy", "max_stars_repo_head_hexsha": "5654662618b7281d12eedc4a782251838e7a9048", "max_stars_repo_licenses": ["MIT"], ...
#=~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=# # Problem set 5 solutions # Written by Tyler Ransom # Commented by Giuseppe Grasso # Recording available in Notability #=~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=# using Random using LinearAlgebra using Statistics using Optim using DataFrames using DataFramesM...
{"hexsha": "66898fa3781458f6f7d842c082c4bdedec263a1c", "size": 20103, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "ProblemSets/PS5-ddc/PS5solutions_GG.jl", "max_stars_repo_name": "peppegrass/fall-2020", "max_stars_repo_head_hexsha": "03f90548ca4d800146bbeaf9dceca917a21c1195", "max_stars_repo_licenses": ["MIT"]...
import gc import numba from numba import jit import numpy as np import sklearn import tqdm import warnings @jit(nopython=True, nogil=True, fastmath=True) def _update_wgrad_clipped(learning_rate, loss, w1, w2): """same as above, clamped in unit sphere""" for k in range(w1.size): grad = loss * w2[k] ...
{"hexsha": "461d48046f6c4e9b6e5625441ff1a85c3ac324f4", "size": 7732, "ext": "py", "lang": "Python", "max_stars_repo_path": "csrgraph/ggvec.py", "max_stars_repo_name": "netrias/CSRGraph", "max_stars_repo_head_hexsha": "b35460c8d84906d203f66b511b8eb553a97a622b", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 79, ...
"""librarian: Librarian and Settings classes. Contains the Librarian class and the Settings class. The Librarian class is the main Librarian class sets up and runs the librarian program. It reads settings from the librarian.yaml file. Copyright (c) 2017 by Jeff Bass. License: MIT, see LICENSE for more details. """ ...
{"hexsha": "b45d7a6f1e3403d1d60af3d7afba31a4d9dd5090", "size": 8342, "ext": "py", "lang": "Python", "max_stars_repo_path": "librarian-prototype/librarian/helpers/library.py", "max_stars_repo_name": "jeffbass/yin-yang-ranch", "max_stars_repo_head_hexsha": "234a3120d4f134a65ab8f064fb5805a436874498", "max_stars_repo_licen...
from src import data_generator from io import StringIO import numpy as np import pytest class TestFetchDataset: def test_fetch_dataset_from_right_formatted_data(self): source = StringIO( "species,culmen_length_mm,culmen_depth_mm,flipper_length_mm,body_mass_g\n" "0,0.25454545454545...
{"hexsha": "645ee5d60e02040ee8d88fe23132e882eb201b66", "size": 979, "ext": "py", "lang": "Python", "max_stars_repo_path": "kfp/components/data_generator/tests/test_main.py", "max_stars_repo_name": "hotchpotch/lab_sample_pipelines", "max_stars_repo_head_hexsha": "7c266d807eff861140d4b51c267b0bfba8c50263", "max_stars_rep...
import numpy as np import random data = np.loadtxt('env_sorter.cfg',skiprows=10) print(data) print(np.shape(data), type(data)) print(data[3][3], type(data[3][3])) # print(data[73][69], data[88][38]) file1 = open("addverb2.scen","a") count = 0 for i in range(1000): x_i = random.randint(1,87) y_i = random.rand...
{"hexsha": "df6b6ab2bb58c979685d6b85f3258753ebbe1141", "size": 659, "ext": "py", "lang": "Python", "max_stars_repo_path": "addverb_random_benchmarks.py", "max_stars_repo_name": "Aakriti05/ORCA_Astar-warehouse-navigation", "max_stars_repo_head_hexsha": "8699b30c25cacf1a7be1f56dc34db90d5a757b36", "max_stars_repo_licenses...
#Author Lucas Saraiva import re import networkx as nx import sys def compute_triangle_and_balance(G): triangles = {} ballanced = 0 unballanced = 0 print len(G.edges()) print "Calculating triangles status, it may take a while" triadsVisited = set() i = 0 for u in G.nodes(): ...
{"hexsha": "056b39be683944c473089ec3d1809a2737f648b9", "size": 2801, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/Triangles/triangles_python27.py", "max_stars_repo_name": "saraiva3/Shape-of-War", "max_stars_repo_head_hexsha": "454f7d77f919742420dfa4cdc44820f0c88f91ea", "max_stars_repo_licenses": ["MIT"], ...
! $UWHPSC/codes/fortran/ifelse1.f90 program ifelse1 implicit none real(kind=8) :: x integer :: i i = 3 if (i<2) then print *, "i is less than 2" else print *, "i is not less than 2" endif if (i<=2) then print *, "i is less or equal to 2" else if (i/=5) the...
{"hexsha": "1720c37ebf970a5e151401c681304f788afe54f4", "size": 456, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "uwhpsc/codes/fortran/ifelse1.f90", "max_stars_repo_name": "philipwangdk/HPC", "max_stars_repo_head_hexsha": "e2937016821701adb80ece5bf65d43d1860640c0", "max_stars_repo_licenses": ["MIT"], "max_st...
\section{Padding} \label{sec:padding} The \fw{Padding} module provides a wrapper widget type, \fw{Padded}, which wraps another widget with a specified amount of padding on any or all four of its sides. We create padded widgets with the \fw{padded} function, which takes a child of type \fw{Widget a} and a padding valu...
{"hexsha": "441a0659ca9ce71b657420892351b2745efabdc0", "size": 2248, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "doc/ch4/Padded.tex", "max_stars_repo_name": "erikd/vty-ui", "max_stars_repo_head_hexsha": "250474a8d9dc5e22b8dc80cfa871d9ac4c12ce04", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_count": ...
import pickle import numpy as np import re counts_list = [] price_list = [] for i in range(9): with open('info/info-{}.pkl'.format(i+1), 'rb') as f: temp = pickle.load(f) counts_list.append(temp[0]) price_list.append(temp[1]) # Aggergate information counts = counts_list[0] for i in range...
{"hexsha": "1f8a90f8bd00cec4cb11ff06ba7e2afb6a7f7651", "size": 1065, "ext": "py", "lang": "Python", "max_stars_repo_path": "info.py", "max_stars_repo_name": "HarangDev/ka-1", "max_stars_repo_head_hexsha": "065f4fa7966fbb0a5e97a696e9890ee2d291826b", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count": null, "ma...
import numpy as np import scipy as sp #Given a data matrix X, this picks
{"hexsha": "902c20b9996c6009179a55121303fe7e88966cd3", "size": 74, "ext": "py", "lang": "Python", "max_stars_repo_path": "bandwidth_selection.py", "max_stars_repo_name": "bubble-07/FETISH3", "max_stars_repo_head_hexsha": "243429acd16d55b30a0de4f1f5d72b0cd7dc84b7", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ...
// (C) Copyright 2015 - 2018 Christopher Beck // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef SPIRIT_PO_EXCEPTIONS_HPP_INCLUDED #define SPIRIT_PO_EXCEPTIONS_HPP_INCLUDED #include <boost/spirit/include/support_...
{"hexsha": "603ae6fcfc2de9067571482382aea9319c35e97c", "size": 2212, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "include/spirit_po/exceptions.hpp", "max_stars_repo_name": "fcojavmc/spirit-po", "max_stars_repo_head_hexsha": "5f88675757a44f86eae845a703c697f93d9cae39", "max_stars_repo_licenses": ["BSL-1.0"], "max...
''' Created on Jul 3, 2014 @author: roj-idl71 ''' import os import datetime import numpy try: from gevent import sleep except: from time import sleep from schainpy.model.data.jroheaderIO import RadarControllerHeader, SystemHeader from schainpy.model.data.jrodata import Voltage from schainpy.model.proc.jropro...
{"hexsha": "1ac362b7ed779c7ddd1f7f913f9af6d1c368946c", "size": 19528, "ext": "py", "lang": "Python", "max_stars_repo_path": "schainpy/model/io/jroIO_usrp.py", "max_stars_repo_name": "LuisRondoCuevas/schainpy", "max_stars_repo_head_hexsha": "ef41efe03993a6ae56e587334a1bfc529fccc2df", "max_stars_repo_licenses": ["BSD-3-C...
# # Princeton University licenses this file to You 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 writ...
{"hexsha": "e04beea9d192547fa647471f0760b4ec2da65d3b", "size": 177428, "ext": "py", "lang": "Python", "max_stars_repo_path": "psyneulink/core/components/functions/nonstateful/transferfunctions.py", "max_stars_repo_name": "MetaCell/PsyNeuLink", "max_stars_repo_head_hexsha": "aeddf3e8ea62504a5d928b100b59aa18e593156c", "m...
''' Created on Sep 19, 2013 @author: johannes ''' # create some test cases import scipy as SP from limix_legacy.ensemble import lmm_forest_utils as utils import h5py from limix_legacy.ensemble.lmm_forest import Forest as MF import os import unittest class TestMixedForest(unittest.TestCase): def setUp(self, n=10...
{"hexsha": "7f95d5fbd911415024080d45b6f958627f9b4fb3", "size": 8456, "ext": "py", "lang": "Python", "max_stars_repo_path": "limix_legacy/test/lmm_forest/test_lmm_forest.py", "max_stars_repo_name": "michoel-lab/limix-legacy", "max_stars_repo_head_hexsha": "cd6c9887a2c411372beeddde3a86979b2aa21837", "max_stars_repo_licen...
import numpy as np import pandas as pd import random import subprocess from termcolor import colored import matplotlib.pyplot as plt MIN_NUMBERS = 8 MAX_NUMBERS = 24 NUMBER_STEP = 1 TEST_REPEAT = 5 MIN_RANGE = 0 MAX_RANGE = 100 FLOAT_MIN = -3.40282e+38 def compute_angles(numbers): angles = [round(np.arctan( (numb...
{"hexsha": "3e64f2c66628474f8a76cf12e98c699e62cda4be", "size": 4104, "ext": "py", "lang": "Python", "max_stars_repo_path": "test.py", "max_stars_repo_name": "xstupi00/Line-of-Sight", "max_stars_repo_head_hexsha": "1d4b00d655e34017cd152c088a7329a12cd3baaa", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "m...
# coding=utf-8 # Copyright 2018 The Dopamine 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...
{"hexsha": "c70b3687ccdd277d412fcd8a7f5f08bebc97526c", "size": 4265, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/dopamine/discrete_domains/atari_lib_test.py", "max_stars_repo_name": "aghinsa/dopamine", "max_stars_repo_head_hexsha": "e7d780d7c80954b7c396d984325002d60557f7d1", "max_stars_repo_licenses": ...
import os import numpy as np import argparse from sklearn.model_selection import StratifiedKFold #from data.image_folder import make_dataset #from tensorflow.keras.preprocessing.image import ImageDataGenerator import tensorflow as tf import json import pandas as pd import numpy as np import os, sys import glob import...
{"hexsha": "d1fc417939f9071ab9558bc0b04de9acb77ad0f7", "size": 6734, "ext": "py", "lang": "Python", "max_stars_repo_path": "versions/v1/v1_tb/aux_kfold.py", "max_stars_repo_name": "otavares93/rxpix2pix", "max_stars_repo_head_hexsha": "cc72ff165769bc4f0c312372fe7c3b52ecda45a0", "max_stars_repo_licenses": ["BSD-3-Clause"...
[GOAL] α : Type u_1 β : Type u_2 γ : Type u_3 δ : Type u_4 inst✝¹ : AddCommMonoid α inst✝ : TopologicalSpace α f g : β → α a b : α s : Finset β ⊢ HasSum (fun x => 0) 0 [PROOFSTEP] simp [HasSum, tendsto_const_nhds] [GOAL] α : Type u_1 β : Type u_2 γ : Type u_3 δ : Type u_4 inst✝² : AddCommMonoid α inst✝¹ : TopologicalSp...
{"mathlib_filename": "Mathlib.Topology.Algebra.InfiniteSum.Basic", "llama_tokens": 75911}
import os import json import xml.etree.ElementTree as ET from PIL import Image from collections import defaultdict import torch import numpy as np import pycocotools.mask as mask_util from torchvision import transforms from .generalized_dataset import GeneralizedDataset VOC_CLASSES = ( "aeroplane", "bicycle"...
{"hexsha": "816154425db7b762d5213474d772bd601b9a696f", "size": 5772, "ext": "py", "lang": "Python", "max_stars_repo_path": "pytorch_mask_rcnn/datasets/voc_dataset.py", "max_stars_repo_name": "JinchengHeRyan/STATS402_Final_MaskRcnn", "max_stars_repo_head_hexsha": "c8103751008afb2f969c7e321a7e843a50c0f681", "max_stars_re...
import keras import numpy as np import AxonDeepSeg.ads_utils as ads from scipy import ndimage from skimage import exposure import AxonDeepSeg.ads_utils from AxonDeepSeg.ads_utils import convert_path class DataGen(keras.utils.Sequence): """Generates data for Keras""" def __init__( self, ids...
{"hexsha": "913375dc88d7d8c51ea4bdd6cf418d804d1798fc", "size": 4728, "ext": "py", "lang": "Python", "max_stars_repo_path": "AxonDeepSeg/data_management/input_data.py", "max_stars_repo_name": "mariehbourget/axondeepseg", "max_stars_repo_head_hexsha": "23c3f7355f85b9800e16acca980be1f5cae79b21", "max_stars_repo_licenses":...
/** * \file dcs/testbed/constant_signal_generator.hpp * * \brief Generates constant signals. * * \author Marco Guazzone (marco.guazzone@gmail.com) * * <hr/> * * Copyright 2012 Marco Guazzone (marco.guazzone@gmail.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this...
{"hexsha": "e50b6e7e6504fed6a6e4d737f7605124bc6b4e87", "size": 2348, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "inc/dcs/testbed/constant_signal_generator.hpp", "max_stars_repo_name": "sguazt/dcsxx-testbed", "max_stars_repo_head_hexsha": "e7210f0c7f54256d5bf0c90297e0c4f9eaf82da0", "max_stars_repo_licenses": ["...
# coding: utf-8 def load_pickle(fname): with open(fname, 'rb') as f: return pickle.load(f) ## time def aexp2zred(aexp): return [1.0/a - 1.0 for a in aexp] def zred2aexp(zred): return [1.0/(1.0 + z) for z in zred] def lbt2aexp(lts): import astropy.units as u from astropy.cosmology import W...
{"hexsha": "6ccafc0da1910ad8584e619f6b3913eb1e54324d", "size": 8611, "ext": "py", "lang": "Python", "max_stars_repo_path": "pyram/analysis/save_mpgs3.py", "max_stars_repo_name": "Hoseung/pyRamAn", "max_stars_repo_head_hexsha": "f9386fa5a9f045f98590039988d3cd50bc488dc2", "max_stars_repo_licenses": ["MIT"], "max_stars_co...
from __future__ import division from psychopy.visual import TextStim, Window from psychopy import core, event, gui, data, logging import numpy as np import pandas as pd import os from routines import Routine # Code for the choice titration experiment of Weber and Chapman (2005) https://doi.org/10.1016/j.obhdp.2005.01...
{"hexsha": "2c85e8a230e5861025c4e5d171799a8b00fda215", "size": 3495, "ext": "py", "lang": "Python", "max_stars_repo_path": "example_2.py", "max_stars_repo_name": "laurafontanesi/psych-routines", "max_stars_repo_head_hexsha": "fe3a1ff055fd5b32bc1ca666a2d86ee19b3a2f49", "max_stars_repo_licenses": ["MIT"], "max_stars_coun...
#include "rotation.h" #include <Eigen/Dense> #include <Eigen/Geometry> #include <iostream> namespace cpt { Eigen::Matrix3f get_angle_axis_rotation_matrix(const Eigen::Vector3f& angleAxis) { return Eigen::AngleAxisf(angleAxis.norm(), angleAxis.normalized()).toRotationMatrix(); } Eigen::Matrix3f get_euler_xyz_ro...
{"hexsha": "05314a00d4e969315f3c3bd9668fc77d9527f72b", "size": 913, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "lib/math/rotation.cpp", "max_stars_repo_name": "b3h47pte/cuda-path-tracing", "max_stars_repo_head_hexsha": "b874b86f15b4aca18ecd40e9eb962996298f5fa8", "max_stars_repo_licenses": ["MIT"], "max_stars_c...
"""Script to calulate the value of pre-flop hands for n_players Examples: Call this file like so to get the help: ```bash $ python monte_carlo_rank.py --help Usage: monte_carlo_rank.py [OPTIONS] Multithreaded monte carlo pre-flop hand equity calculation. Over `n_threads` threads, rank the pre-flop hands accord...
{"hexsha": "8fda9163a2c3393cc74bef909c9c6f1aacd09efd", "size": 8483, "ext": "py", "lang": "Python", "max_stars_repo_path": "research/preflop_hand_ranking/monte_carlo_rank.py", "max_stars_repo_name": "keithlee96/pluribus-poker-AI", "max_stars_repo_head_hexsha": "15e52fe73dd09570e782dd0e7b9069865eb5823d", "max_stars_repo...
# Elaine Laguerta (github: @elaguerta) # LBNL GIG # File created: 19 February 2021 # Create Circuit class to mirror a dss Circuit object # used by Solution objects to solve powerflow import numpy as np import pandas as pd from . bus_group import BusGroup from . line_group import LineGroup from . load_group import Loa...
{"hexsha": "5d83041491983c7cebe106cba0a3c8173462fc7c", "size": 7955, "ext": "py", "lang": "Python", "max_stars_repo_path": "gigpower/src/gigpower/circuit.py", "max_stars_repo_name": "elaguerta/gigpower", "max_stars_repo_head_hexsha": "22e0a6152fa8d7a04f6067f3d500bfee042a98f9", "max_stars_repo_licenses": ["Unlicense"], ...
#include <gtest/gtest.h> #include <boost/math/quaternion.hpp> #include "test_util.h" #include "ApproachCube.hpp" #include "SwarmieSensors.hpp" #include "Tag.hpp" class ApproachCubeTest : public testing::Test { protected: SwarmieSensors sensors; ApproachCube approach; boost::math::quaternion<double> defaultO...
{"hexsha": "64466cfa9e4e5adf145dc3647cd7e5cef44da987", "size": 5223, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "src/behaviours/test/approach_cube_test.cpp", "max_stars_repo_name": "BCLab-UNM/SwarmBaseCode-Modular-Public", "max_stars_repo_head_hexsha": "2061796570baf65deeb74f29444fcaf3b6464aa1", "max_stars_rep...
from itertools import combinations_with_replacement as cwr import numpy as np from rpy2.robjects.packages import importr import rpy2.robjects as ro import scipy.sparse as sp import anndata2ri from anndata._core.sparse_dataset import SparseDataset from controller.cellar.utils.exceptions import UserError from ._neighbo...
{"hexsha": "60f20d5dd89f7f29faa8d269d502d1919c65205a", "size": 6593, "ext": "py", "lang": "Python", "max_stars_repo_path": "controller/cellar/core/_spatial_scores.py", "max_stars_repo_name": "euxhenh/cellar", "max_stars_repo_head_hexsha": "679387216043f3d287ea29a15f78868f412d2948", "max_stars_repo_licenses": ["MIT"], "...
[STATEMENT] lemma equivalent_complements: assumes \<open>complements F G\<close> assumes \<open>equivalent_registers G G'\<close> shows \<open>complements F G'\<close> [PROOF STATE] proof (prove) goal (1 subgoal): 1. complements F G' [PROOF STEP] apply (rule complementsI) [PROOF STATE] proof (prove) goal (2 subg...
{"llama_tokens": 270, "file": "Registers_Laws_Complement_Quantum", "length": 3}
# This file was generated, do not modify it. # hide using HTTP using MLJ using PyPlot import DataFrames: DataFrame, describe using UrlDownload MLJ.color_off() # hide url = "http://archive.ics.uci.edu/ml/machine-learning-databases/wine/wine.data" header = ["Class", "Alcool", "Malic acid", "Ash", "Alcalinity of ash", ...
{"hexsha": "75f90ce643128b2e63bd80be5a3013f2e7411e7b", "size": 561, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "__site/assets/end-to-end/wine/code/ex1.jl", "max_stars_repo_name": "giordano/DataScienceTutorials.jl", "max_stars_repo_head_hexsha": "8284298842e0d77061cf8ee767d0899fb7d051ff", "max_stars_repo_licen...
(* 1st-order unification did not work when in competition with pattern unif. *) Set Implicit Arguments. Lemma test : forall (A : Type) (B : Type) (f : A -> B) (S : B -> Prop) (EV : forall y (f':A->B), (forall x', S (f' x')) -> S (f y)) (HS : forall x', S (f x')) (x : A), S (f x). Proof. intros. eappl...
{"author": "mattam82", "repo": "Coq-misc", "sha": "60bc3cbe72083f4fa1aa759914936e4fa3d6b42e", "save_path": "github-repos/coq/mattam82-Coq-misc", "path": "github-repos/coq/mattam82-Coq-misc/Coq-misc-60bc3cbe72083f4fa1aa759914936e4fa3d6b42e/test-suite/bugs/closed/shouldsucceed/2244.v"}
""" Provides functions for processing a video file into numpy arrays for RGB data and optical flow data, which can be used with the I3D model. """ import cv2 import numpy as np def _raw_numpy_array(video_file, nframes=None): """ Loads a video from the given file. Will set the number of frames to `nframes` if t...
{"hexsha": "284896f1a986946cea2667aa9b467c23ce2dd02f", "size": 3839, "ext": "py", "lang": "Python", "max_stars_repo_path": "video-classifier/process_video.py", "max_stars_repo_name": "Sben05/Sportable", "max_stars_repo_head_hexsha": "70a7c315b24a72e32a957978ec901d35507a0456", "max_stars_repo_licenses": ["MIT"], "max_st...
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. import unittest from dataclasses import dataclass from typing import Dict, List import numpy as np import numpy.testing as npt from caffe2.python import schema, workspace from ml.rl import types as rlt from ml.rl.preprocess...
{"hexsha": "62d9e03ebfc781345b411924ee43757b6c4201f3", "size": 62107, "ext": "py", "lang": "Python", "max_stars_repo_path": "ml/rl/test/preprocessing/test_feature_extractor.py", "max_stars_repo_name": "michaeltashman/Horizon", "max_stars_repo_head_hexsha": "ee310b34adeb807bbae379a6e1703d0f725f26a9", "max_stars_repo_lic...
import pandas as pd from os import path import cartopy.crs as ccrs import matplotlib.pyplot as plt from cartopy.mpl.gridliner import LONGITUDE_FORMATTER, LATITUDE_FORMATTER import matplotlib.ticker as mticker from cartopy.feature.nightshade import Nightshade from datetime import datetime import numpy as np import shape...
{"hexsha": "e6c6a5a8b83ab4e4449445ff1101893df71b76e9", "size": 3880, "ext": "py", "lang": "Python", "max_stars_repo_path": "freshmapping.py", "max_stars_repo_name": "JacobParrott/OccultationProfiler", "max_stars_repo_head_hexsha": "f537555d44239e29bbba69c83d2413eec14f9c88", "max_stars_repo_licenses": ["MIT"], "max_star...
import os import MySQLdb import os, sys, anydbm, time #from config import datb, dataloc #db = anydbm.open("./db/" + cluster,'c') import lib #lib.galextinct(cluster, db) #db[sys.argv[0][:-3]] = 'Started/' + time.asctime() spectype = 'full' if len(sys.argv) > 2: if sys.argv[2] == 'spec': spectype = 'spec' listfile...
{"hexsha": "5047f4fe4c83b950445227a5fb82de08f547793c", "size": 2197, "ext": "py", "lang": "Python", "max_stars_repo_path": "mkplotsspecme.py", "max_stars_repo_name": "deapplegate/wtgpipeline", "max_stars_repo_head_hexsha": "9693e8562022cc97bf5a96427e22965e1a5e8497", "max_stars_repo_licenses": ["MIT"], "max_stars_count"...
import json import csv import codecs from collections import Counter, namedtuple import numpy as np from correlations import Correlations #from analyzer import SortedThetas SortedThetas = namedtuple('SortedThetas', 'thetas labels histogram correlations') class ComplexDecoder(object): '''Decodes json complex array...
{"hexsha": "6f876350811ec7c6ebdaf94080bc717bda476a1b", "size": 7457, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/dao.py", "max_stars_repo_name": "DogeMajor/GDFT", "max_stars_repo_head_hexsha": "bd84a8cef8d68f88c3c80de9936ee65ce85fcb40", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_st...
import time import argparse import traceback import numpy as np import torch from torch.utils.data import DataLoader import networkx as nx import dgl from models import MLP, InteractionNet, PrepareLayer from dataloader import MultiBodyGraphCollator, MultiBodyTrainDataset,\ MultiBodyValidDataset, MultiBodyTestData...
{"hexsha": "103aa2fe2e1217139be35631e990fa4d9d552cd5", "size": 7027, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/pytorch/graphsim/train.py", "max_stars_repo_name": "ketyi/dgl", "max_stars_repo_head_hexsha": "a1b859c29b63a673c148d13231a49504740e0e01", "max_stars_repo_licenses": ["Apache-2.0"], "max_s...
# Activation normalization from Kingma & Dhariwal (2018) # Author: Philipp Witte, pwitte3@gatech.edu # Date: January 2020 using InvertibleNetworks, LinearAlgebra, Test # Input nx = 64 ny = 64 k = 10 batchsize = 4 # Input image: nx x ny x k x batchsize X = randn(Float32, nx, ny, k, batchsize) Y = randn(Float32, nx, n...
{"hexsha": "dd7f4f049d21c2b5c332a7a67bab3d73af26de9d", "size": 572, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "examples/layers/layer_actnorm.jl", "max_stars_repo_name": "PetersBas/InvertibleNetworks.jl", "max_stars_repo_head_hexsha": "c53dacf426ecd1381f79f297f6954e6695c515b3", "max_stars_repo_licenses": ["MI...
#!/usr/bin/env python3 # -*- coding: latin-1 -*- # HEREHEREHERE # MAINMAINMAIN ############################################################################# # fits2psqlraw # # ls -1 *fits > input.txt # 7421 files # fits2psqlraw --list input.txt -D wayne -t myfits -c # # /home/git/clones/NGSL/data/stis_xxx/fits2psql...
{"hexsha": "3afcd69afafc11987da8a83ec26f5ae14e388198", "size": 20802, "ext": "py", "lang": "Python", "max_stars_repo_path": "py/fits2psqlraw.py", "max_stars_repo_name": "The-SMTSci/NGSL", "max_stars_repo_head_hexsha": "dbdad80ef521811387eeaafd90821b07df2fe6b0", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_co...
from functools import partial import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from pycpd import deformable_registration import numpy as np import time def visualize(iteration, error, X, Y, ax): plt.cla() ax.scatter(X[:,0], X[:,1], X[:,2], color='red', label='Target') ax.scatter(Y[:...
{"hexsha": "0a5779d986326eef36e40101288e5afed58116e8", "size": 1457, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/fish_deformable_3D.py", "max_stars_repo_name": "KingDeng005/pycpd", "max_stars_repo_head_hexsha": "a2d383d5aee96b2e0fc4d5efa238efb57f8536c8", "max_stars_repo_licenses": ["MIT"], "max_star...
!==============================================================================! subroutine Backup_Mod_Write_Variable(fh, disp, vc, var_name, var) !------------------------------------------------------------------------------! ! Writes a whole variable to backup file. ! !--------...
{"hexsha": "81d5d1d2a17b042e0848a5e432dd9a72831ca44b", "size": 1578, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "Sources/Process/Backup_Mod/Write_Variable.f90", "max_stars_repo_name": "MassimoBorrelliPhysicist/T-Flows", "max_stars_repo_head_hexsha": "48c330f1e9576bf0ef79edbee1b7bc09092e0706", "max_stars_re...
from typing import Optional import gym import numpy as np import pytest from gym.spaces import Box, Dict, Discrete from gym.utils.env_checker import check_env class ActionDictTestEnv(gym.Env): action_space = Dict({"position": Discrete(1), "velocity": Discrete(1)}) observation_space = Box(low=-1.0, high=2.0,...
{"hexsha": "32dd2f7b89c3e6f9a70cbd84209c9c886bf94507", "size": 1073, "ext": "py", "lang": "Python", "max_stars_repo_path": "libs/gym/tests/utils/test_env_checker.py", "max_stars_repo_name": "maxgold/icml22", "max_stars_repo_head_hexsha": "49f026dd2314091639b52f5b8364a29e8000b738", "max_stars_repo_licenses": ["MIT"], "m...
%%%%% CPLOP %%%%% \section{\cploplong{}}\label{sec:background:cplop} This section details the aspects of \cploplong{} (\cplop{}) relevant to \mstlong{} (\mst{}). It explains the nature of \pyros{} and the \pyro{}ing process, including what segments of \ecoli{} \dna{} \cplop{} researchers use and how they collect the \...
{"hexsha": "fd2335f0312c779c2914dc9d2f118109237d42e8", "size": 22319, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "chapters/background/cplop.tex", "max_stars_repo_name": "jmcgover/thesis", "max_stars_repo_head_hexsha": "25664684158d00864dbe697276d2691ba84461cb", "max_stars_repo_licenses": ["MIT"], "max_stars_co...
[STATEMENT] lemma compE1_eq_Call [simp]: "compE1 Vs e = obj\<bullet>M(params) \<longleftrightarrow> (\<exists>obj' params'. e = obj'\<bullet>M(params') \<and> compE1 Vs obj' = obj \<and> compEs1 Vs params' = params)" [PROOF STATE] proof (prove) goal (1 subgoal): 1. (compE1 Vs e = obj\<bullet>M(params)) = (\<exists>o...
{"llama_tokens": 182, "file": "JinjaThreads_Compiler_Compiler1", "length": 1}
import pandas as pd import numpy as np from tqdm import trange from time import sleep import glob import os import matplotlib.pyplot as plt # Import module to get a current time and date used to name the files containing normalization information from datetime import datetime import csv try: # Use gitpython to ...
{"hexsha": "bef2e58abaff75959cd129834ffbca719868b106", "size": 19147, "ext": "py", "lang": "Python", "max_stars_repo_path": "SI_Toolkit/load_and_normalize.py", "max_stars_repo_name": "jhuebotter/CartpoleSNNdemo", "max_stars_repo_head_hexsha": "d18a85cbc45bff48295c46c9cd8c9fc00192318c", "max_stars_repo_licenses": ["MIT"...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat May 4 12:25:18 2019 @author: liujinyang """ import zlib import pandas as pd import sys import os import tarfile import glob import multiprocessing as mp import re import json import pickle import time import itertools import shutil import lzma import ...
{"hexsha": "0c45cf3fb9a9c5ca823cff1e8a22a1325241193d", "size": 13361, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/logzip/zipper_longgest.py", "max_stars_repo_name": "JinYang88/LogZip", "max_stars_repo_head_hexsha": "796bd632623d010989fb7dfa61f51c72ea6b68b4", "max_stars_repo_licenses": ["MIT"], "max_stars...
(* Title: HOL/Auth/KerberosV.thy Author: Giampaolo Bella, Catania University *) section\<open>The Kerberos Protocol, Version V\<close> theory KerberosV imports Public begin text\<open>The "u" prefix indicates theorems referring to an updated version of the protocol. The "r" suffix indicates theorems wh...
{"author": "seL4", "repo": "isabelle", "sha": "e1ab32a3bb41728cd19541063283e37919978a4c", "save_path": "github-repos/isabelle/seL4-isabelle", "path": "github-repos/isabelle/seL4-isabelle/isabelle-e1ab32a3bb41728cd19541063283e37919978a4c/src/HOL/Auth/KerberosV.thy"}
""" Collection of generic numpy array functions """ import math import warnings import numpy as np from margrie_libs.margrie_libs.signal_processing.exceptions import BadRandomError, PeakDetectionError def _get_decimate_new_n_pnts(trace, window_width, end_method): methods = ("drop", "strict", "pad") ...
{"hexsha": "e0485bec65d56b984c8b4e363e80c4ab4a1d4cbe", "size": 10436, "ext": "py", "lang": "Python", "max_stars_repo_path": "margrie_libs/margrie_libs/signal_processing/mat_utils.py", "max_stars_repo_name": "Sepidak/spikeGUI", "max_stars_repo_head_hexsha": "25ae60160308c0a34e7180f3e39a1c4dc6aad708", "max_stars_repo_lic...
%============================================================================== % This code is part of the Matlab-based toolbox % LagLDDDM - A Lagrangian Gauss--Newton--Krylov Solver for Mass- and % Intensity-Preserving Diffeomorphic Image Registration % % For details and license info see % -...
{"author": "C4IR", "repo": "FAIR.m", "sha": "975edebd37b833ae76696792870de5c05efcb9cb", "save_path": "github-repos/MATLAB/C4IR-FAIR.m", "path": "github-repos/MATLAB/C4IR-FAIR.m/FAIR.m-975edebd37b833ae76696792870de5c05efcb9cb/add-ons/LagLDDMM/mfDiffusionST.m"}
# importing some useful packages import matplotlib.pyplot as plt import matplotlib.image as mpimg import matplotlib import numpy as np import cv2 from warnings import warn from collections import deque from sklearn.cluster import KMeans as ClusterFinder def grayscale(img): """Applies the Grayscale transform ...
{"hexsha": "a69fe4fa0b1f8bd0d0c577eebbb2844bf6887405", "size": 17506, "ext": "py", "lang": "Python", "max_stars_repo_path": "laneLines.py", "max_stars_repo_name": "tsbertalan/CarND-LaneLines-P1", "max_stars_repo_head_hexsha": "ba7bb0e1f60bb5c84425021b6bdb0d7162171fa8", "max_stars_repo_licenses": ["MIT"], "max_stars_cou...
#!/usr/bin/env julia push!(LOAD_PATH, ".") using HelloWorld using Test @test HelloWorld.greet("John") == "Hello, John"
{"hexsha": "c01fac05c52b2f113d92cc358d3234ac43c75d37", "size": 120, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/hello_world/test.jl", "max_stars_repo_name": "vtavernier/jomw", "max_stars_repo_head_hexsha": "3de1c99579381be4485825f2942fb555da45be4f", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ...
import logging import numpy as np import xobjects as xo import xtrack.linear_normal_form as lnf import xpart as xp # To get the right Particles class depending on pyheatail interface state logger = logging.getLogger(__name__) def _check_lengths(**kwargs): length = None for nn, xx in kwargs.items(): ...
{"hexsha": "61205360fe00af0d87992b8aa534023f062d2ee3", "size": 17110, "ext": "py", "lang": "Python", "max_stars_repo_path": "xpart/build_particles.py", "max_stars_repo_name": "pkicsiny/xpart", "max_stars_repo_head_hexsha": "cddf3eb65ffc198c22dd37204139ce3177a9bd96", "max_stars_repo_licenses": ["MIT"], "max_stars_count"...