text
stringlengths
0
1.25M
meta
stringlengths
47
1.89k
import numpy as np import numpy.linalg as la def singular_values(ttslice,center,svd=la.svd): ''' Assume ttslice is canonical and extract the singular values ''' if center<0: center=len(ttslice)+center return left_singular_values(ttslice[:center+1],svd,False)+right_singular_values(ttslice...
{"hexsha": "09c952e71185a4b160016cf876d82e956b526661", "size": 4481, "ext": "py", "lang": "Python", "max_stars_repo_path": "ttarray/raw/svd.py", "max_stars_repo_name": "sonnerm/ttarray", "max_stars_repo_head_hexsha": "c962cb2be303dfdb6743aa802bd11b89043e7b71", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null...
"""monthly comparisons""" import datetime import calendar from collections import OrderedDict import numpy as np from scipy import stats from pandas.io.sql import read_sql import pandas as pd from pyiem.plot.use_agg import plt from pyiem import network, util from pyiem.exceptions import NoDataFound PDICT = OrderedDic...
{"hexsha": "38fa2b0512245d10348302c0e9dbb9b92467e415", "size": 9582, "ext": "py", "lang": "Python", "max_stars_repo_path": "htdocs/plotting/auto/scripts/p1.py", "max_stars_repo_name": "jamayfieldjr/iem", "max_stars_repo_head_hexsha": "275b77a65f3b12e26e6cbdb230786b9c7d2b9c9a", "max_stars_repo_licenses": ["MIT"], "max_s...
pdf_file<-"pdf/tablecharts_ballonplot.pdf" cairo_pdf(bg="grey98",pdf_file,width=9,height=9) par(omi=c(0.75,0.25,0.5,0.25),mai=c(0.25,0.55,0.25,0),family="Lato Light",cex=1.15) library(gplots) # Import data and prepare chart data(Titanic) myData<-as.data.frame(Titanic) # convert to 1 entry per row format attach(myD...
{"hexsha": "dceea3bc5e530ce88363629c60b26dbe94f6b56e", "size": 1179, "ext": "r", "lang": "R", "max_stars_repo_path": "src/scripts/tablecharts_ballonplot.r", "max_stars_repo_name": "wilsonify/data-visualization", "max_stars_repo_head_hexsha": "4a4295a59f666625f4a47b2ad6a6f1eb06f9e8d3", "max_stars_repo_licenses": ["MIT"]...
# import the necessary packages from __future__ import print_function from imutils.object_detection import non_max_suppression from imutils import paths import numpy as np import argparse import imutils import cv2 import time # construct the argument parse and parse the arguments ap = argparse.ArgumentParser() ap.add...
{"hexsha": "76b58a3921fde80517c335eac842d56cf12cfe49", "size": 2101, "ext": "py", "lang": "Python", "max_stars_repo_path": "crowd_detection/detect.py", "max_stars_repo_name": "naitikshukla/drone", "max_stars_repo_head_hexsha": "f855994cfb1a9515989e95656f52efe4b0e58e8b", "max_stars_repo_licenses": ["Unlicense"], "max_st...
\subsubsection*{Filter Functions\hspace*{\fill}\hyperlink{SignalProcessing}{(up)}\hypertarget{filterFunctions}{}} \addcontentsline{toc}{subsubsection}{Filter Functions} Finite Impulse Response (FIR) functions defined in C VSIPL are included in \pyjv. \begin{table}[H] \caption{Filter Functions} \label{tab:filterFunctio...
{"hexsha": "816a5f237aaf5cba9c91159eb80a0a09c4874fdf", "size": 723, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "doc/jvsip_book/FilterFunctions.tex", "max_stars_repo_name": "rrjudd/jvsip", "max_stars_repo_head_hexsha": "56a965fff595b027139ff151d27d434f2480b9e8", "max_stars_repo_licenses": ["MIT"], "max_stars_co...
# -*- coding: utf-8 -*- """ Created on Fri May 14 23:16:52 2021 @author: Priyanka """ import scipy from scipy import spatial import pandas as pd import numpy as np import math from math import radians, cos, sin, asin, sqrt import datetime import os import pandas as pd import plotly import plotly.express as px #setti...
{"hexsha": "d9c3a06bb64298df89fe9449c4c3e375020e4dc2", "size": 5626, "ext": "py", "lang": "Python", "max_stars_repo_path": "main.py", "max_stars_repo_name": "priyankadawn/SupplyChain_OutofbeatIndex", "max_stars_repo_head_hexsha": "a9d165c0a53f6470bc72f6aaad48d980d3fe6685", "max_stars_repo_licenses": ["Apache-2.0"], "ma...
[STATEMENT] lemma l2_inv8_step4: "{l2_inv8 \<inter> l2_inv1 \<inter> l2_inv3 \<inter> l2_inv4 \<inter> l2_inv4'} l2_step4 Rb A B gnx {> l2_inv8}" [PROOF STATE] proof (prove) goal (1 subgoal): 1. {l2_inv8 \<inter> l2_inv1 \<inter> l2_inv3 \<inter> l2_inv4 \<inter> l2_inv4'} l2_step4 Rb A B gnx {> l2_inv8} [PROOF STEP...
{"llama_tokens": 14392, "file": "Key_Agreement_Strong_Adversaries_dhlvl2", "length": 40}
// (c) Copyright Raffi Enficiaud 2017. // 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 http://www.boost.org/libs/test for the library home page. // //! @file //! An observer for monitoring the success/fai...
{"hexsha": "a44382eed501e7b799480f61e55d3b4e4e3d40b4", "size": 3051, "ext": "ipp", "lang": "C++", "max_stars_repo_path": "boost/test/impl/test_framework_init_observer.ipp", "max_stars_repo_name": "cpp-pm/boost", "max_stars_repo_head_hexsha": "38c6c8c07f2fcc42d573b10807fef27ec14930f8", "max_stars_repo_licenses": ["BSL-1...
import logging import os import time as ttime import numpy as np import pandas as pd from databroker.core import SingleRunCache from event_model import RunRouter logger = logging.getLogger('bluesky') logger.setLevel('INFO') def export_scan( sid, filename='', path='/home/xf12id/users/',verbose=True ): """ E...
{"hexsha": "46c5c1dbbf281c3780c5742ff6bad127fa1a2d5b", "size": 3341, "ext": "py", "lang": "Python", "max_stars_repo_path": "startup/99-exporting.py", "max_stars_repo_name": "NSLS-II-SMI/profile_collection", "max_stars_repo_head_hexsha": "c1e2236a7520f605ac85e7591f05682add06357c", "max_stars_repo_licenses": ["BSD-3-Clau...
From iris.proofmode Require Import tactics. From Perennial.goose_lang Require Import lang notation typing. From Perennial.goose_lang.lib Require Import typed_mem.impl slice.impl map.impl. Set Default Proof Using "Type". Section goose_lang. Context {ext} {ext_ty:ext_types ext}. Definition Var' s : @expr ext := Va...
{"author": "mit-pdos", "repo": "perennial", "sha": "76dafee3cd47e1c5e5a6d5436f87738a06f13ee0", "save_path": "github-repos/coq/mit-pdos-perennial", "path": "github-repos/coq/mit-pdos-perennial/perennial-76dafee3cd47e1c5e5a6d5436f87738a06f13ee0/src/goose_lang/lib/encoding/impl.v"}
# -*- coding: utf-8 -*- """Random lifeforms are generated on-the-fly without specific configuration""" # Import standard library from typing import Tuple # Import modules import numpy as np from .base import Lifeform class RandomBox(Lifeform): """A random box with arbitrarily-set shape""" def __init__(se...
{"hexsha": "816cf0b16c29e42574680284e7a85a9d5e09fb1e", "size": 783, "ext": "py", "lang": "Python", "max_stars_repo_path": "seagull/lifeforms/random.py", "max_stars_repo_name": "altazur/seagull", "max_stars_repo_head_hexsha": "20fe72ef43e27a7e6a64c6a288696a8fd8ea1c1a", "max_stars_repo_licenses": ["MIT"], "max_stars_coun...
# noqa: D100 import numpy as np from sklearn.base import BaseEstimator, ClassifierMixin from sklearn.utils.validation import check_X_y, check_is_fitted from sklearn.utils.validation import check_array from sklearn.metrics import pairwise_distances from sklearn.preprocessing import LabelEncoder class OneNearestNeighbo...
{"hexsha": "e040d7a55c48b7029533c9090dbef4e526cd8f40", "size": 2399, "ext": "py", "lang": "Python", "max_stars_repo_path": "sklearn_questions.py", "max_stars_repo_name": "oulianov/datacamp-assignment1", "max_stars_repo_head_hexsha": "8c2f6c7f8b4118110edc1fc4993aa0af74524a21", "max_stars_repo_licenses": ["BSD-2-Clause"]...
from pathlib import Path from util.plotutil import info_graph, info_graph_separate, make_gif, info_graph_detail from stable_baselines3.common.callbacks import CheckpointCallback from stable_baselines3 import PPO, SAC, DDPG, A2C, DQN, TD3 import numpy as np from PIL import Image from rl_env.adv_spd_env_road_multi_fromsr...
{"hexsha": "ad9fe5b083e3a9a2867b7fbf9e2735611179f2a5", "size": 4138, "ext": "py", "lang": "Python", "max_stars_repo_path": "render_road_multi_fromsrc.py", "max_stars_repo_name": "benchoi93/AdvSpdRL", "max_stars_repo_head_hexsha": "2cf6ac7934ad48b85f1e90df1d5015853a09ac5c", "max_stars_repo_licenses": ["MIT"], "max_stars...
% ------------------------------------------------------------------------------ % NOTE: The change summary is added to the table of contents without % a paragraph number. \phantomsection \addcontentsline{toc}{section}{Change Summary} \section*{Change Summary}\label{sec:changesummary} \begin{longtable}[h]{|L{7.5cm}|L{...
{"hexsha": "19e5ec73400421cfd3fb7b9cc671441d1cfcca6c", "size": 529, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "data/change-summary.tex", "max_stars_repo_name": "Traap/newdoc", "max_stars_repo_head_hexsha": "a5f74ae71640f2422436cbe506b35a9d0fd4e903", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_coun...
import numpy as np import matplotlib.pyplot as plt import seaborn as sns from helpers import simple_moving_average def plot_history(history, smoothing=1): _, ax = plt.subplots(1, 3, figsize=(20, 4)) ax[0].plot(simple_moving_average(history['regrets'], smoothing)) ax[0].set_title("Smoothed regret vs time_...
{"hexsha": "aa6b31a5276616fbcd006d8da48e51e569d1ddaa", "size": 829, "ext": "py", "lang": "Python", "max_stars_repo_path": "helpers_lecture2.py", "max_stars_repo_name": "alexander-soare/deepmind_rl2021_notebooks", "max_stars_repo_head_hexsha": "99342381528fcde9908b97245eb35a937a0f46b9", "max_stars_repo_licenses": ["Apac...
from PIL import Image import numpy as np import math import torch from torch import nn from torchvision import transforms, models from collections import OrderedDict # Get network model def getModel(arch, input_size, output_size, hidden_layers, class_to_idx): if arch == 'resnet18': model = models.resnet1...
{"hexsha": "a8a2ac7b1c104e69976fcffe3d0f33cd15fd8ac3", "size": 4679, "ext": "py", "lang": "Python", "max_stars_repo_path": "helpers.py", "max_stars_repo_name": "gvhuyssteen/aipnd-project", "max_stars_repo_head_hexsha": "75da5dd01f7d8b81cce2b09a1fc1d3f254c5e659", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nu...
# # A Simplified Version of the Kinetic Learning Algorithm # # There was a bunch of kruft in the old kinetic learning source code. I boiled it down into its key components and simplified the data structures. Now the code is more managable, understandable, and extensible. # # **Todo:** # 1. Add Smoothing to Data A...
{"hexsha": "a94ab7ae38d7bb0a90670237a7e50bbd1e7ace74", "size": 9886, "ext": "py", "lang": "Python", "max_stars_repo_path": "KineticLearning/__init__.py", "max_stars_repo_name": "JBEI/KineticLearning", "max_stars_repo_head_hexsha": "c34249105c43dc4b7889bee7ebb82531f3e89fb5", "max_stars_repo_licenses": ["BSD-2-Clause-Pat...
import pandas as pd import numpy as np from sklearn.feature_extraction.text import CountVectorizer from sklearn.metrics.pairwise import cosine_similarity ###### helper functions. Use them when needed ####### def get_title_from_index(index): return df[df.index == index]["title"].values[0] def get_index_from_ti...
{"hexsha": "ac11bf883f44238e24ae6d25d7edaf911a0167e2", "size": 1800, "ext": "py", "lang": "Python", "max_stars_repo_path": "Building a Movie Recommendation Engine/movie_recommender_completed.py", "max_stars_repo_name": "satyamiitbhu/Introduction-to-Machine-Learning", "max_stars_repo_head_hexsha": "7a1cbbfb1457ec956e4bb...
from functools import partial import os import numpy as np from sklearn.preprocessing import LabelEncoder from .. import SDC, NuSDC, Features data_dir = os.path.join(os.path.dirname(__file__), 'data') ################################################################################ # TODO: add *real* tests def _ch...
{"hexsha": "1b678beb2bb546521cfc3b27dd7b3f043f67331e", "size": 1555, "ext": "py", "lang": "Python", "max_stars_repo_path": "sdm/tests/test_sdm.py", "max_stars_repo_name": "dougalsutherland/py-sdm", "max_stars_repo_head_hexsha": "9773bf33438986a8312db82b1c9086c81fae5099", "max_stars_repo_licenses": ["BSD-3-Clause"], "ma...
import numpy as np from sklearn.metrics import confusion_matrix, precision_recall_fscore_support, \ accuracy_score def zip_data(data, target): return {study: (data[study], target[study]) for study in data} def unzip_data(data): return {study: data[study][0] for study in data}, \ {study: data[...
{"hexsha": "fa30d9d3e78a63342fef59d58b3b16f51a46b14c", "size": 3538, "ext": "py", "lang": "Python", "max_stars_repo_path": "cogspaces/utils.py", "max_stars_repo_name": "arthurmensch/cogspaces", "max_stars_repo_head_hexsha": "497c5202405a85981f2bcddff0609d2af2acdbfd", "max_stars_repo_licenses": ["BSD-2-Clause"], "max_st...
[STATEMENT] theorem set_vebt_maxt': "invar_vebt t n \<Longrightarrow> vebt_maxt t = Some x \<longleftrightarrow> (x\<in>set_vebt t \<and> (\<forall>y\<in>set_vebt t. x\<ge>y))" [PROOF STATE] proof (prove) goal (1 subgoal): 1. invar_vebt t n \<Longrightarrow> (vebt_maxt t = Some x) = (x \<in> set_vebt t \<and> (\<foral...
{"llama_tokens": 467, "file": "Van_Emde_Boas_Trees_VEBT_Intf_Functional", "length": 3}
# Build the SGA and return-- if args.build_SGA: if rank == 0: tall = time.time() from legacyhalos.SGA import _init_ellipse_SGA, _write_ellipse_SGA buildit, filenames, refcat = _init_ellipse_SGA(clobber=args.clobber) else: buildit, filenames, refcat...
{"hexsha": "b45b75455e1c177d8cb83c26a703547e26c5c6e3", "size": 3792, "ext": "py", "lang": "Python", "max_stars_repo_path": "py/legacyhalos/sandbox/build_SGA_mpi.py", "max_stars_repo_name": "Christopher-Bradshaw/legacyhalos", "max_stars_repo_head_hexsha": "8a7644425dedc85849dc532d8252f280fa6d1f56", "max_stars_repo_licen...
# Copyright (c) 2021 Anita Hu, Martin Ethier. # # This work is licensed under the terms of the MIT license. # For a copy, see <https://opensource.org/licenses/MIT>. import carla import numpy as np import pygame import json import os from scipy.interpolate import CubicSpline from matplotlib import pyplot as plt import ...
{"hexsha": "784dbaa96a315842158bec7b4a9648e68ec5c0a2", "size": 18000, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/lane_utils.py", "max_stars_repo_name": "anita-hu/simulanes", "max_stars_repo_head_hexsha": "d9674031e5401568724d9eae164e8f029d1db1cb", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1...
using .CUDA export CuBlobDescriptor, CuPODBlobDescriptor, CuTensorBlobDescriptor, CuFilterBlobDescriptor export CuTensorBlob immutable CuTensorBlob{T<:AbstractFloat,N} <: Blob{T,N} ptr :: CuPtr shape :: NTuple{N, Int} len :: Int end function CuTensorBlob{T<:AbstractFloat, N}(dtype::Type{T}, dims::NTuple{N,I...
{"hexsha": "dcd22196df916c2bdfe347bf35b0bb47320b341d", "size": 1669, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/cuda/blob.jl", "max_stars_repo_name": "baajur/Mocha.jl", "max_stars_repo_head_hexsha": "5e15b882d7dd615b0c5159bb6fde2cc040b2d8ee", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1397, "...
## Update notes ## # Heuristic algorthim has been added. 14/03/22 from tokenize import Double """from stable_baselines.common.policies import MlpPolicy from stable_baselines.common.policies import FeedForwardPolicy, register_policy from stable_baselines.common.vec_env import SubprocVecEnv from stable_baselines im...
{"hexsha": "05393c1d1169fe18bb5b78c1248bf8fd61328170", "size": 20682, "ext": "py", "lang": "Python", "max_stars_repo_path": "Pytorch_v03.py", "max_stars_repo_name": "Herdol/FL_RAT_allocation", "max_stars_repo_head_hexsha": "481b51cf9c18bede2bd1ae44daf5cfcf36b62c0e", "max_stars_repo_licenses": ["MIT"], "max_stars_count"...
''' intraday trading module ''' import pandas as pd import numpy as np import datetime as dt class IntradayTrade: def sampling(self, prices_df, s_date, s_codes): sample = pd.DataFrame() sample = prices_df.loc[s_date:][s_codes].copy() return (sample) def create_trade_b...
{"hexsha": "89580d266bb719515ba1ce8aea07bd8f64024604", "size": 21264, "ext": "py", "lang": "Python", "max_stars_repo_path": "w5/finterstellar/trading_intraday.py", "max_stars_repo_name": "finterstellar/lecture", "max_stars_repo_head_hexsha": "fb14fb1c6a842e2ee2f79b0225ac9f4d11c3ca47", "max_stars_repo_licenses": ["MIT"]...
const FILENAMES = ("epsg", "esri") parse_projection(line::String) = match(r"<(\d+)>\s+(.*?)\s+<>", line) println("# Contents of this file is generated on $(now()). Do not edit by hand!") println("# \$ julia generate_projection_codes.jl > projection_codes.jl\n") for filename in FILENAMES if !is...
{"hexsha": "d64d817df423a130a0f3ffc70e7df98c3c5c5464", "size": 872, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "gen/generate_projection_codes.jl", "max_stars_repo_name": "JuliaPackageMirrors/Proj4.jl", "max_stars_repo_head_hexsha": "a39ff0df7af51f4b7f9deabd7dd0af78bcd45bd7", "max_stars_repo_licenses": ["MIT"]...
''' Core types for the connectivity model of an articulated mechanism. ''' import logging, enum import networkx as nx import io import kgprim.core as gr class Joint: ''' A placeholder for a joint of a mechanism. A joint only has a name and a kind, the latter being one of the values defined in `Joint...
{"hexsha": "77dd7b5957773a48385ef5076c4d4db155711eb6", "size": 4808, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/robmodel/connectivity.py", "max_stars_repo_name": "mfrigerio17/robot-model-tools", "max_stars_repo_head_hexsha": "97e25d5c4d1386c503d37a70b57400022c5b7ca0", "max_stars_repo_licenses": ["BSD-3-...
function out = fatrix2_subsref_dot(st, args) %function out = fatrix2_subsref_dot(st, args) % handle subscript references like ob.ref or ob.ref(arg[s]) % This will called from ../subsref with struct(ob) % and it will have arg(1).type = '.' % Based on @strum/subsref % Copyright 2006-1-19, Jeff Fessler, University of Mic...
{"author": "JeffFessler", "repo": "mirt", "sha": "b7f36cc46916821e8bc8502301b1554ebc7efe1d", "save_path": "github-repos/MATLAB/JeffFessler-mirt", "path": "github-repos/MATLAB/JeffFessler-mirt/mirt-b7f36cc46916821e8bc8502301b1554ebc7efe1d/systems/@fatrix2/private/fatrix2_subsref_dot.m"}
### A Pluto.jl notebook ### # v0.17.5 using Markdown using InteractiveUtils # ╔═╡ 4e046622-7300-11ec-0a1d-974094a4752e # hideall let docs_dir = dirname(dirname(@__DIR__)) pkg_dir = dirname(docs_dir) using Pkg: Pkg Pkg.activate(docs_dir) Pkg.develop(; path=pkg_dir) Pkg.instantiate() # Put...
{"hexsha": "da9507c077e5a0ba06c0422e07b26ad9e781b2f9", "size": 3304, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "docs/src/tutorials/logistic_regression.jl", "max_stars_repo_name": "kleinschmidt/TuringGLM.jl", "max_stars_repo_head_hexsha": "87561c2da4ca1b6dc0410fbcc475115716e15a1e", "max_stars_repo_licenses": ...
#!/bin/env/python # David Wright # Copyright 2017 # Written for Python 3.5.2 #Import import sys from PyQt5.QtWidgets import (QWidget, QTreeView, QMessageBox, QHBoxLayout, QFileDialog, QLabel, QSlider, QCheckBox, QLineEdit, QVBoxLayout, QApplication...
{"hexsha": "56d1a95319f3742c15966238cfec2facb51f023d", "size": 28516, "ext": "py", "lang": "Python", "max_stars_repo_path": "FourBar/FourBarOptimization.py", "max_stars_repo_name": "Wright4TheJob/Optimizing", "max_stars_repo_head_hexsha": "0f056e40a24380a48ed469bd4bb565948f7ffaf2", "max_stars_repo_licenses": ["MIT"], "...
//------------------------------------------------------------------------------ // @file : vicon_stream.cpp // @brief : data stream using ViconSDK v1.3 / simple version // @author : Yoonseok Pyo // @version: Ver0.2.0 (since 2014.05.02) // @date : 2015.08.26 //------------------------------------------------------...
{"hexsha": "4f606fc83cc557a82a90a54fa393dd12a76cedd9", "size": 16528, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "tms_ss/tms_ss_vicon/src/vicon_stream.cpp", "max_stars_repo_name": "robotpilot/ros_tms", "max_stars_repo_head_hexsha": "3d6b6579e89aa9cb216cd3cb6157fabc553c18f1", "max_stars_repo_licenses": ["BSD-3-...
[STATEMENT] lemma ins_queue_invar: "\<lbrakk>tree_invar t; queue_invar q\<rbrakk> \<Longrightarrow> queue_invar (ins t q)" [PROOF STATE] proof (prove) goal (1 subgoal): 1. \<lbrakk>tree_invar t; queue_invar q\<rbrakk> \<Longrightarrow> queue_invar (ins t q) [PROOF STEP] proof (induct q arbitrary: t) [PROOF STATE] proo...
{"llama_tokens": 3072, "file": "Binomial-Heaps_SkewBinomialHeap", "length": 30}
# BayesFactorFMRI: This is a GUI-aided tool to perform Bayesian meta-analysis of fMRI data and Bayesian second-level analysis of fMRI contrast files (one-sample t-test) with multiprocessing. # author: Hyemin Han, University of Alabama (hyemin.han@ua.edu) # BayesFactorFMRI is licensed under MIT License. # Citations # I...
{"hexsha": "fa648ac31cd3ff9b69d969d66a010db861016689", "size": 3465, "ext": "py", "lang": "Python", "max_stars_repo_path": "bayes_correction_main.py", "max_stars_repo_name": "hyemin-han/BayesFactorFMRI_TWOT", "max_stars_repo_head_hexsha": "1b22c87998bea473d3f62241f7e248352b476735", "max_stars_repo_licenses": ["MIT"], "...
""" Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. This source code is licensed under the MIT-style license found in the LICENSE file in the root directory of this source tree. ---------- Compute upper and lower limits on word perplexity for kenlm ngram models Command : python3 compute_upper_...
{"hexsha": "90ed4a61d0ccd265ffb97e01f703134ae082aff1", "size": 5939, "ext": "py", "lang": "Python", "max_stars_repo_path": "recipes/lexicon_free/utilities/compute_lower_ppl_kenlm.py", "max_stars_repo_name": "Zilv1128/test1", "max_stars_repo_head_hexsha": "49fbb1392e69b5194c077df9847505ec995b4e3d", "max_stars_repo_licen...
import numpy as np import pyqtgraph as pg from numpy import pi from scipy.signal import butter, sosfilt from PyQt5 import QtCore from acconeer.exptool import configs, utils from acconeer.exptool.clients import SocketClient, SPIClient, UARTClient from acconeer.exptool.pg_process import PGProccessDiedException, PGProce...
{"hexsha": "1370b223832be94cf12e7ef0079adf67ce5030c8", "size": 12918, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/processing/breathing.py", "max_stars_repo_name": "crzdg/acconeer-python-exploration", "max_stars_repo_head_hexsha": "26c16a3164199c58fe2940fe7050664d0d0e1161", "max_stars_repo_licenses":...
[STATEMENT] lemma run_return_env [simp]: "run_env (return_env x) r = return x" [PROOF STATE] proof (prove) goal (1 subgoal): 1. run_env (local.return_env x) r = return x [PROOF STEP] by(simp add: return_env_def)
{"llama_tokens": 88, "file": "Monomorphic_Monad_Monomorphic_Monad", "length": 1}
using Documenter using FrankenTuples makedocs(modules=[FrankenTuples], sitename="FrankenTuples.jl", authors="Alex Arslan", pages=["index.md"]) deploydocs(repo="github.com/ararslan/FrankenTuples.jl.git", target="build")
{"hexsha": "6788bf866e6fc66cf8750881daa0a0d9a11332ba", "size": 248, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "docs/make.jl", "max_stars_repo_name": "goretkin/FrankenTuples.jl", "max_stars_repo_head_hexsha": "6cc32fd462b54248fd49cb64f2f6fb1507201781", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 18...
import numpy as np import matplotlib.pyplot as plt import cv2 from scipy import fftpack,signal import scipy.signal import skimage.measure class PSFManager: def CreatePSF(self,name:str, **kwargs): choice = name.lower() if choice == 'sinc': return self.__sinc__(**kwargs) ...
{"hexsha": "a644c130b1920804bba13946fd6b23544f2bd203", "size": 1986, "ext": "py", "lang": "Python", "max_stars_repo_path": "hw2/ref/.py", "max_stars_repo_name": "kfirgirstein/DIP_HW_cs236860", "max_stars_repo_head_hexsha": "b26da2751e2345335175b1c7514f729e2d9a316f", "max_stars_repo_licenses": ["MIT"], "max_stars_count"...
# # The main tests for the code in single.py are currently located in # sympy/solvers/tests/test_ode.py # from sympy import (cos, Derivative, diff, Eq, exp, log, pi, Rational, sin, sqrt, symbols, Ei, erfi) from sympy.core import Function, Symbol from sympy.functions import airyai, airybi, besselj, bessely from...
{"hexsha": "531e2507c04aa5521edd4b49f266034074eb45e8", "size": 12079, "ext": "py", "lang": "Python", "max_stars_repo_path": "sympy/solvers/ode/tests/test_single.py", "max_stars_repo_name": "AyushGit123/sympy", "max_stars_repo_head_hexsha": "bd79440abfa41d175737d1a138e63e16f9f51994", "max_stars_repo_licenses": ["BSD-3-C...
''' AAA lllllll lllllll iiii A:::A l:::::l l:::::l i::::i A:::::A l:::::l l:::::l iiii A:::::::A l:::::l l:::::l ...
{"hexsha": "549ede1e569581c23d1a6214d4b4bd36dbe75313", "size": 22798, "ext": "py", "lang": "Python", "max_stars_repo_path": "data/test/allie/features/audio_features/featurize.py", "max_stars_repo_name": "jim-schwoebel/voiceome", "max_stars_repo_head_hexsha": "9af84a8568a7a0630992ec56be03521ff9547c68", "max_stars_repo_l...
""" @ Filename: NaiveBayes_TEST.py @ Author: Danc1elion @ Create Date: 2019-05-16 @ Update Date: 2019-05-16 @ Description: Implement NaiveBayes_TEST """ import time,sys,os # LIB is the parent directory of the directory where program resides. LIB = os.path.join(os.path.dirname(__file_...
{"hexsha": "d7613c20dcf12b5f2e6b8ec4cdd62708f9bd8879", "size": 1483, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/NaiveBayes_TEST.py", "max_stars_repo_name": "ffcccc/MachineLearning", "max_stars_repo_head_hexsha": "78bc9c5df08b14f5d70ad5d6774c74f85a585c7e", "max_stars_repo_licenses": ["Apache-2.0"], ...
import numpy as np from .VariableUnitTest import VariableUnitTest from gwlfe.Input.WaterBudget import AvWithdrawal class TestAvWithdrawal(VariableUnitTest): def test_AvWithdrawal(self): z = self.z np.testing.assert_array_almost_equal( AvWithdrawal.AvWithdrawal_f(z.NYrs, z.StreamWithd...
{"hexsha": "eae865d87c20e2c09e333e3b57f155c243f87508", "size": 446, "ext": "py", "lang": "Python", "max_stars_repo_path": "test/unittests/test_AvWithdrawal.py", "max_stars_repo_name": "rajadain/gwlf-e", "max_stars_repo_head_hexsha": "ba2fb9dbc08a3d7a4ced4b83b6f0f1307814e2a3", "max_stars_repo_licenses": ["Apache-2.0"], ...
__author__ = 'ltnghia' import os import cv2 import numpy as np from tqdm import tqdm import imgaug.augmenters as iaa sometimes = lambda aug: iaa.Sometimes(0.5, aug) def augmentation_lvl1(): seq = iaa.SomeOf((1, 2), [ iaa.SomeOf((1, 3), [ # Hue iaa.OneOf([ iaa.AddT...
{"hexsha": "50f333b1363c72e529b55e60fdccdc4b0ed234b6", "size": 24339, "ext": "py", "lang": "Python", "max_stars_repo_path": "augmentation.py", "max_stars_repo_name": "ltnghia/openforensics", "max_stars_repo_head_hexsha": "0f0776eb349d16e267d18cc906851b757aa0ac50", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Dec 1 17:45:35 2020 @author: ghiggi """ ### Currently rely on CDO for interpolation weights definition # pip install --upgrade git+https://github.com/epfl-lts2/pygsp@sphere-graphs # conda install -c conda-forge trimesh # conda install -c conda-forge c...
{"hexsha": "3d94a24d5c04c7146bc991269c8e16e8649a01f8", "size": 5258, "ext": "py", "lang": "Python", "max_stars_repo_path": "tutorials/example_remap_weights.py", "max_stars_repo_name": "deepsphere/deepsphere-weather", "max_stars_repo_head_hexsha": "a9c75de9c9852a2832883cd998efd16d6542b083", "max_stars_repo_licenses": ["...
import os import sys import setuptools import socket # Bootstrap a numpy installation before trying to import it. import imp try: imp.find_module('numpy') except ImportError: import subprocess subprocess.call([sys.executable, '-m', 'pip', 'install', 'numpy']) if not socket.gethostname().startswith("cheyen...
{"hexsha": "9304ff409c02f6c0c8d8b937c6271fce69ef01a3", "size": 4532, "ext": "py", "lang": "Python", "max_stars_repo_path": "setup.py", "max_stars_repo_name": "skysightsoaringweather/wrf-python", "max_stars_repo_head_hexsha": "1f12654263c9d7bdd0b309a98eb5c1dbc2564901", "max_stars_repo_licenses": ["Apache-2.0"], "max_sta...
from typing import NoReturn from ...base import BaseEstimator import numpy as np class GaussianNaiveBayes(BaseEstimator): """ Gaussian Naive-Bayes classifier """ def __init__(self): """ Instantiate a Gaussian Naive Bayes classifier Attributes ---------- self.cla...
{"hexsha": "a301ad8337f343efa5b131ce3b80d56ffc863304", "size": 4362, "ext": "py", "lang": "Python", "max_stars_repo_path": "IMLearn/learners/classifiers/gaussian_naive_bayes.py", "max_stars_repo_name": "noambn/IML.HUJI", "max_stars_repo_head_hexsha": "95089fdd619ed09f16e166906787a6a2a1bdb449", "max_stars_repo_licenses"...
"""Bandit wrapper around base AL sampling methods. Assumes adversarial multi-armed bandit setting where arms correspond to mixtures of different AL methods. Uses EXP3 algorithm to decide which AL method to use to create the next batch. Similar to Hsu & Lin 2015, Active Learning by Learning. https://www.csie.ntu.edu....
{"hexsha": "865630573842000425f07ec1ad47396da81a58d3", "size": 3795, "ext": "py", "lang": "Python", "max_stars_repo_path": "test code/adversarial_attack/PytorchPlus-1.0.0/build/lib/PytorchPlus/active_learning/bandit_discrete.py", "max_stars_repo_name": "Phoenix1153/20TeamA", "max_stars_repo_head_hexsha": "022cc6686776c...
from models.model_template import ModelTemplate import torch import torch.nn as nn from torch.autograd import Variable import numpy as np import math import argparse class Baseline(ModelTemplate): @staticmethod def get_parser(parser = None): """ returns a parser for the given model. Can ...
{"hexsha": "362f27d5be27b958f2b18c6b078b91db737d8769", "size": 6262, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/models/baseline.py", "max_stars_repo_name": "mattochal/fsl_tutorial_public", "max_stars_repo_head_hexsha": "f3a65a1f36c2d785e2f7b92638d289dd97439ede", "max_stars_repo_licenses": ["MIT"], "max_...
import jpype import jpype.imports import os import subprocess from pathlib import Path import numpy as np class ReebGraph: def __init__(self, jsrc_path): """ :param jsrc_path: (str) Path that contains compiled reeb_graph java project (https://github.com/dbespalov/...
{"hexsha": "0b867cf8e51187fa68bde4605d44054965d10325", "size": 4887, "ext": "py", "lang": "Python", "max_stars_repo_path": "egad/reeb.py", "max_stars_repo_name": "gachiemchiep/egad", "max_stars_repo_head_hexsha": "5b61f28024a34ec0112ce939bf0166b995b9138f", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_count":...
r"""Singularities :mod:`abelfunctions.singularities` ================================================ A module for computing the singular points of a complex plane algebraic curve including their multiplicities, branching numbers, multiplicities, and delta invariants. Each singularity :math:`P = (x,y,z)` on the proje...
{"hexsha": "3c8ddd9d6335f19a1f34699af8afe2d5ade6e118", "size": 11573, "ext": "py", "lang": "Python", "max_stars_repo_path": "abelfunctions/singularities.py", "max_stars_repo_name": "DisneyHogg/abelfunctions", "max_stars_repo_head_hexsha": "67757a0b3744191c179ca4757e0db4a312bfd86a", "max_stars_repo_licenses": ["MIT"], "...
[STATEMENT] lemma object_type_object_clean [simp]: "object_type (object_clean x cmp) = object_type x" [PROOF STATE] proof (prove) goal (1 subgoal): 1. object_type (object_clean x cmp) = object_type x [PROOF STEP] by (clarsimp simp: object_clean_def)
{"llama_tokens": 98, "file": "Separation_Algebra_ex_capDL_Abstract_Separation_D", "length": 1}
#!/usr/bin/env python """ This script identifies correlations between splicing factors or other input gene lists and splicing events in an pre-filtered PSI events file. The expression and PSI file must have the same sample order as input. """ import os, sys, string, getopt import math, numpy from scipy import stat...
{"hexsha": "52fc1c4d82255e4febb827e8c61e31b235b3884d", "size": 15859, "ext": "py", "lang": "Python", "max_stars_repo_path": "stats_scripts/SpliceEnricher.py", "max_stars_repo_name": "michalkouril/altanalyze", "max_stars_repo_head_hexsha": "e721c79c56f7b0022516ff5456ebaa14104c933b", "max_stars_repo_licenses": ["Apache-2...
from datetime import datetime import numpy as np import tensorflow as tf import tensorflow_probability as tfp from tensorflow.keras import layers from tensorflow import keras from keras import backend as K import matplotlib.pyplot as plt import tracks num_states = 5 num_actions = 2 upper_bound = 1 lower_bound = -1 ...
{"hexsha": "6b7cb79bbcf28cb235aa2a62b50cd728399bd904", "size": 10651, "ext": "py", "lang": "Python", "max_stars_repo_path": "PPO.py", "max_stars_repo_name": "DelBrutto/MicroRacer", "max_stars_repo_head_hexsha": "37769aef579c5623a00e1cee88f5d0e0c21ba11f", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, "max_st...
"""TORA (translational oscillation with rotational actuation) system.""" import gym from gym_socks.envs.dynamical_system import DynamicalSystem import numpy as np class TORAEnv(DynamicalSystem): """TORA (translational oscillation with rotational actuation) system. Bases: :py:class:`gym_socks.envs.dynamical...
{"hexsha": "c9f83d180e2f6200220a0132d312e33a583a9fd6", "size": 1808, "ext": "py", "lang": "Python", "max_stars_repo_path": "gym_socks/envs/tora.py", "max_stars_repo_name": "ajthor/socks", "max_stars_repo_head_hexsha": "77063064ceb5a5da3f01733bef0885b00d4b2bed", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nul...
import Lean import Lean.Parser.Command import Lean.Parser.Term namespace NamedState open Lean Elab Command Term Meta TSyntax -- -- A monad to read/write from multiples state variables, using string lookup. -- As an example if your state is the struct { z : Nat, y : String } then you -- can (getNamed "y") or (putNam...
{"author": "Izzimach", "repo": "qinglong", "sha": "d2f4e4656d86fdbace9bbbdc94f8e1de1a67f97f", "save_path": "github-repos/lean/Izzimach-qinglong", "path": "github-repos/lean/Izzimach-qinglong/qinglong-d2f4e4656d86fdbace9bbbdc94f8e1de1a67f97f/src/QingLong/Data/NamedState.lean"}
import os import numpy as np path = os.path.dirname(os.path.realpath(__file__)) def consumption(lines:list): data = [[int(i) for i in list(line.strip())] for line in lines] arr = np.array(data, dtype='int32') l = len(arr) w = len(arr[0]) gamma_rate = [] epsilon_rate = [] for i in range(w):...
{"hexsha": "cf74849532f9e1acbec31a9916ed8f30e0b4d6f0", "size": 2187, "ext": "py", "lang": "Python", "max_stars_repo_path": "Mikel/Day3/main.py", "max_stars_repo_name": "coolafabbe/AdventOfCode2021", "max_stars_repo_head_hexsha": "97a2e4c7d887ef6f1ae477becb25cc1d97114781", "max_stars_repo_licenses": ["MIT"], "max_stars_...
""" This file defines a class MicrogridEnv that wraps the Simulator in this package, so that it follows the OpenAI gym (https://github.com/openai/gym) format. """ import gym import numpy as np from gym import spaces from gym.utils import seeding from microgridRLsimulator.simulate import Simulator from datetime import...
{"hexsha": "0f191e4afea521ac57fa395c1452d06921354125", "size": 5854, "ext": "py", "lang": "Python", "max_stars_repo_path": "microgridRLsimulator/gym_wrapper/microgrid_env.py", "max_stars_repo_name": "bcornelusse/microgridRLsimulator", "max_stars_repo_head_hexsha": "f2d7a0c77c47b9727d69c14d80fa521dea6a3861", "max_stars_...
C C*********************************************************************** C * C NACHOS II - A Finite Element Computer Program * C for Incompressible Flow Problems * C ...
{"hexsha": "59523b24685cf84a0444fb91b8512c906082fb5c", "size": 2291, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "src/spoint.f", "max_stars_repo_name": "nachos-ii/nachos-ii", "max_stars_repo_head_hexsha": "f7479fc36919de64136c1aaa4c420ad1bcebb004", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_count...
#!/usr/bin/env python # encoding: utf-8 # Andre Anjos <andre.anjos@idiap.ch> # Wed 17 Jun 18:31:35 CEST 2015 '''User script to conduct the first hypothesis in the course''' import logging import itertools import numpy numpy.seterr(divide='ignore') from . import database from . import preprocessor from . import alg...
{"hexsha": "9f23ea4587d33a0d80a4990425f7e3bb6c5dc3cb", "size": 3029, "ext": "py", "lang": "Python", "max_stars_repo_path": "rr/paper.py", "max_stars_repo_name": "anjos/rrpack", "max_stars_repo_head_hexsha": "41ab4bf8c1d2cbe17e75c0916d4b29cd99d03825", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_count": null,...
# This file is part of GridCal. # # GridCal is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # GridCal is distributed in the hope that...
{"hexsha": "16141352873dfcf4112ad2bc08d70c9f02b57d14", "size": 25418, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/GridCal/Engine/Simulations/ATC/available_transfer_capacity_driver.py", "max_stars_repo_name": "mzy2240/GridCal", "max_stars_repo_head_hexsha": "0352f0e9ce09a9c037722bf2f2afc0a31ccd2880", "max...
""" Drawings and calculations useful for research in the theory of Iterated Functions Systems (IFSs) in the euclidean and complex planes. """ module SDDIFS using Reexport @reexport using SDDCore, SDDGeometry, SDDGraphics include("IFSs.jl") export AbstractIFS, AbstractIFSComplex, IFSComplex, IFSCom...
{"hexsha": "d5fb68d22f542049da28af4f0cf540f62d0a034d", "size": 767, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/SDDIFS.jl", "max_stars_repo_name": "Colectivo-SDD/SDDIFS.jl", "max_stars_repo_head_hexsha": "85eff2e20fbd4d5f5e58f611789dc701af6a3ba3", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nul...
import unittest import dolphindb as ddb import numpy as np import pandas as pd from numpy.testing import assert_array_equal, assert_array_almost_equal from pandas.testing import assert_frame_equal, assert_series_equal from setup import HOST, PORT, WORK_DIR, DATA_DIR class TestRunFunction(unittest.TestCase): ...
{"hexsha": "a8f98fb010cb0491f03bd8f7b88d2ab8c28a5737", "size": 17208, "ext": "py", "lang": "Python", "max_stars_repo_path": "test/test_run_function.py", "max_stars_repo_name": "dolphindb/api_python3", "max_stars_repo_head_hexsha": "caf1c6a38fe3dc0febf33ca5f299c2cdae0f139d", "max_stars_repo_licenses": ["Apache-2.0"], "m...
SUBROUTINE SHN_5004 ( nmin, iret ) C************************************************************************ C* SHN_5004 * C* * C* This subroutine determines the number of minutes elapsed between * C* the current report date-time and the previous 7:00am local time * C* at the location corresponding to ...
{"hexsha": "b0ca5d1aaa64cfcd064391ae658b3d45eb93b1c2", "size": 3573, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "gempak/source/bridge/sh/shn5004.f", "max_stars_repo_name": "oxelson/gempak", "max_stars_repo_head_hexsha": "e7c477814d7084c87d3313c94e192d13d8341fa1", "max_stars_repo_licenses": ["BSD-3-Clause"], ...
# -*- coding: utf-8 -*- import pandas as pd import numpy as np __updated__ = "2021-08-29" class DataBackend(object): skip_suspended = True def get_price(self, order_book_id, start, end, freq): """ :param order_book_id: e.g. 000002.XSHE :param start: 20160101 :param end: 20160...
{"hexsha": "793bb7a1bb6fdae2ffdec763333852400fb83954", "size": 1337, "ext": "py", "lang": "Python", "max_stars_repo_path": "funcat/data/backend.py", "max_stars_repo_name": "pchaos/funcat2", "max_stars_repo_head_hexsha": "ff554cc134906a5a182fc31774488d62a839b314", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_co...
2011 Warrior Pride 10k & 5k Fun Running Run http://evbdn.eventbrite.com/s3s3/eventlogos/15759181/17424306571.jpg When: Saturday August 13, 2011 Where: Starts at the Winters High School Track 101 Grant Avenue Winters, CA 956941698 Time: 10K: 7 a.m. 5K: 7:15 a.m. PreRegistration Cost: 10K: $35.00 5K $25.00 Reg. Cost ...
{"hexsha": "116b8b8afc21f0e22f667381f575013bdfeb9f9e", "size": 822, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "lab/davisWiki/2011_Warrior_Pride_10k_%26_5k_Fun_Run.f", "max_stars_repo_name": "voflo/Search", "max_stars_repo_head_hexsha": "55088b2fe6a9d6c90590f090542e0c0e3c188c7d", "max_stars_repo_licenses": [...
""" The effect functions do not augment an AudioSignal object, but rather return a FFmpegFilter or a SoXFilter, which may be called on either a sox.transform.Transformer or a python-ffmpeg stream, depending on the specific effect. To apply the effect on an AudioSignal, apply_effect_sox or apply_effect_ffmpeg must be ...
{"hexsha": "908820d8090ae11fbc42b8dce880e463ad4e0799", "size": 29756, "ext": "py", "lang": "Python", "max_stars_repo_path": "nussl/core/effects.py", "max_stars_repo_name": "ZhaoJY1/nussl", "max_stars_repo_head_hexsha": "57aabeabca3b2e75849e1659a522e3c2f77e9172", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1,...
import os import glob import math import random import pickle from collections import defaultdict import hickle from tqdm import tqdm, trange import numpy as np PAD_INDEX = 0 PAD_WORD = '<PAD>' START_INDEX = 1 START_WORD = '<STR>' END_INDEX = 2 END_WORD = '<END>' UNK_INDEX = 3 UNK_WORD = '<UNK>' def get_review_d...
{"hexsha": "829d8f61940e6fd68b2807f1344ec9cbf9d5079a", "size": 5827, "ext": "py", "lang": "Python", "max_stars_repo_path": "reader.py", "max_stars_repo_name": "ximua00/mrg", "max_stars_repo_head_hexsha": "cc262184a341d6f7496ff8c3e43dd867f1289343", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 23, "max_stars_re...
c sub-program exchange program ffmod2 c subroutine ffmod2 c cross-section and phase shifts calculations c coded by a.ankudinov 2000 c INPUT: mod2.inp geom.dat global.inp and pot.pad c OUTPUT: xsect.bin and xsph.bin implicit double precision (a-h, o-z) include '../HEADERS/d...
{"hexsha": "d894822e7632b4bfdbc3a9f711c6e45ff04fa3cc", "size": 3401, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "src/XSPH/ffmod2.f", "max_stars_repo_name": "bruceravel/feff85exafs", "max_stars_repo_head_hexsha": "9698ce3703a73def4c1a965f276708d689ea5acb", "max_stars_repo_licenses": ["BSD-2-Clause"], "max_sta...
from numba import jit from math import log, sqrt, exp, erf def blackScholesPut(s, k, rr, tt, sd): if tt == 0 and (s / k > 1): p = 0 elif tt == 0 and (s / k < 1): p = k - s elif tt == 0 and (s / k == 1): p = 0 else: d1 = (log(s / k) + (rr + (1 / 2) * sd ** 2) * tt) / (sd...
{"hexsha": "a4782d0bc5bb18270fcd908cc440367a270780e4", "size": 958, "ext": "py", "lang": "Python", "max_stars_repo_path": "poptions/BlackScholes.py", "max_stars_repo_name": "Talha-Tariq/poptions", "max_stars_repo_head_hexsha": "4bc54b7c31ec57a3b1094aafdd103c7d0a711519", "max_stars_repo_licenses": ["MIT"], "max_stars_co...
import numpy as np import tensorflow as tf from tensorflow.keras import layers import matplotlib.pyplot as plt import math from tensorflow.keras.models import load_model from matplotlib import animation from env_predict import * from buffer import * from model import * from noise import * dt = 0.4 v = 1...
{"hexsha": "060d91d98cf50dfe7b09fa612b44c1ea377349ae", "size": 5502, "ext": "py", "lang": "Python", "max_stars_repo_path": "predict.py", "max_stars_repo_name": "pr-shukla/maddpg-keras", "max_stars_repo_head_hexsha": "8e3d1501f78ac2b78ee2c7053dc9299862386c17", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 4, "m...
#!/usr/bin/env python3 import numpy as np def sigmoid(z): #SIGMOID Compute sigmoid functoon # J = SIGMOID(z) computes the sigmoid of z. g = 1.0 / (1.0 + np.exp(-z)) return g
{"hexsha": "85f5ada72a0d84702060b03259ed7cf3ce382c28", "size": 195, "ext": "py", "lang": "Python", "max_stars_repo_path": "machine-learning-ex3/ex3/sigmoid.py", "max_stars_repo_name": "altermarkive/machine-learning-course", "max_stars_repo_head_hexsha": "2f0a2c2269dab2bd61d34d96a75ccdd8b87683c7", "max_stars_repo_licens...
(* * Copyright 2014, General Dynamics C4 Systems * * SPDX-License-Identifier: GPL-2.0-only *) (* ARM_HYP-specific VSpace invariants *) theory ArchVSpace_AI imports "../VSpacePre_AI" begin (* FIXME: move *) lemma get_tcb_None_tcb_at: "(get_tcb p s = None) = (\<not>tcb_at p s)" by (auto simp: get_tcb_def obj_a...
{"author": "NICTA", "repo": "l4v", "sha": "3c3514fe99082f7b6a6fb8445b8dfc592ff7f02b", "save_path": "github-repos/isabelle/NICTA-l4v", "path": "github-repos/isabelle/NICTA-l4v/l4v-3c3514fe99082f7b6a6fb8445b8dfc592ff7f02b/proof/invariant-abstract/ARM_HYP/ArchVSpace_AI.thy"}
import numpy as np import pickle import os class data_reader(): def __init__(self): if os.path.exists('./data.pkl'): print('Loading from pickle') data = pickle.load(open('./data.pkl','rb')) self.adj, self.paper_category, self.features = data print('Loaded') else: print('No pkl found, generatin...
{"hexsha": "5902b01be5677810a6c1e8f8cae5eb28a544651f", "size": 2315, "ext": "py", "lang": "Python", "max_stars_repo_path": "example/graph_conv/data_reader.py", "max_stars_repo_name": "ddddwee1/SULT", "max_stars_repo_head_hexsha": "0ff31b602d20dd8bc5cf4a6f4f5bc193d636e784", "max_stars_repo_licenses": ["WTFPL"], "max_sta...
import os from DIRAC.Core.Base import Script Script.parseCommandLine() # this might be needed. No idea why. This seems highly fishy. Also this interfers with click. what the actual F from DIRAC.Interfaces.API.Job import Job from DIRAC.Interfaces.API.Dirac import Dirac import click import numpy as np from tqdm import t...
{"hexsha": "b0ba0c46e74ac2669893b6cf90862a526893003e", "size": 2970, "ext": "py", "lang": "Python", "max_stars_repo_path": "dirac/start_jobs.py", "max_stars_repo_name": "tudo-astroparticlephysics/cta_preprocessing", "max_stars_repo_head_hexsha": "e7e6c8f9974007d18a8baeb7078f393217d6ca7b", "max_stars_repo_licenses": ["M...
#= Generates an array of draws from a discrete random variable with a specified vector of probabilities. @author : Spencer Lyon <spencer.lyon@nyu.edu> @date: 2014-07-10 References ---------- http://quant-econ.net/jl/finite_markov.html?highlight=discrete_rv TODO: as of 07/10/2014 it is not possible to define the ...
{"hexsha": "11de1f984c2b1f7271665c3ffd3707107f6b8837", "size": 1671, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/discrete_rv.jl", "max_stars_repo_name": "greimel/QuantEcon.jl", "max_stars_repo_head_hexsha": "5ea70a3762485cf54f4d9e65872a1300fa86eafb", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars...
from torch.utils.data import Dataset import torch import pickle import os import numpy as np import torchvision.transforms as transforms from PIL import Image import torchvision from torchvision.datasets import VisionDataset class Cifar10(Dataset): def __init__(self, is_train, transform): sup...
{"hexsha": "6a52c94cfde56ab4a3617a83c46b5d8f89108617", "size": 4910, "ext": "py", "lang": "Python", "max_stars_repo_path": "dataset.py", "max_stars_repo_name": "zhoufengfan/torchvision_resnet", "max_stars_repo_head_hexsha": "bae0d6664f8c32d96e2166d8f6d6163e274d988e", "max_stars_repo_licenses": ["MIT"], "max_stars_count...
# -*- coding: utf-8 -*- #ckwg +28 # Copyright 2017 by Kitware, 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 retain the above copyright notice, # ...
{"hexsha": "6a622f3701fc421c260e0173945c32eb9677ad52", "size": 17671, "ext": "py", "lang": "Python", "max_stars_repo_path": "plugins/camtrawl/python/viame/processes/camtrawl/processes.py", "max_stars_repo_name": "melster1010/VIAME", "max_stars_repo_head_hexsha": "0062265088aae65effbfcd130bfb874c343c785f", "max_stars_re...
import unittest import logging from UnitTesting.setup_trusted_values_dict import setup_trusted_values_dict logging.basicConfig(level=logging.DEBUG) class TestGlobals(unittest.TestCase): def setUp(self): self.path = r'/home/zetienne/juppp/nrpytutorial/GiRaFFEfood_HO/tests' # Create trusted_val...
{"hexsha": "8c9dbc55edf0214a65dca0c2ff6c21b72c8590c4", "size": 5010, "ext": "py", "lang": "Python", "max_stars_repo_path": "in_progress/GiRaFFEfood_NRPy/tests/GiRaFFEfood_HO__GiRaFFEfood_HO__test.py", "max_stars_repo_name": "Steve-Hawk/nrpytutorial", "max_stars_repo_head_hexsha": "42d7450dba8bf43aa9c2d8f38f85f18803de69...
"""Calculate forces for individuals and groups""" import re from abc import ABC, abstractmethod import numpy as np from pysocialforce.potentials import PedPedPotential, PedSpacePotential from pysocialforce.fieldofview import FieldOfView from pysocialforce.utils import Config, stateutils, logger def camel_to_snake(c...
{"hexsha": "e8538af29543d926242fc753bc48d1d05f8903ba", "size": 12262, "ext": "py", "lang": "Python", "max_stars_repo_path": "pysocialforce/forces.py", "max_stars_repo_name": "evnor/PySocialForce", "max_stars_repo_head_hexsha": "48ec407363ab0900ad923c64ad70ad675075e3ce", "max_stars_repo_licenses": ["MIT"], "max_stars_co...
from typing import List import numpy as np import onnx import pytest from tests.utils.common import check_onnx_model from tests.utils.common import make_model_from_nodes def _test_functions(function: str, data: np.ndarray, opset_version, **kwargs) -> None: test_inputs = {'input_tensor': data} node = onnx.h...
{"hexsha": "b37805759f135386baefe41156aa47b64d53e613", "size": 2357, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/node_converters/test_functions.py", "max_stars_repo_name": "niobeus/onnx2torch", "max_stars_repo_head_hexsha": "d2dc0a0927ced3ac32d4a1dc925a5528874b5c0c", "max_stars_repo_licenses": ["Apache...
/* * Copyright (c) 2013 Juniper Networks, Inc. All rights reserved. */ #include "bgp/bgp_config_listener.h" #include <boost/assign/list_of.hpp> #include <string> #include "bgp/bgp_config_ifmap.h" #include "ifmap/ifmap_dependency_tracker.h" using boost::assign::list_of; using boost::assign::map_list_of; using std...
{"hexsha": "c86297259017c603bd718119af367c26ea35096d", "size": 3654, "ext": "cc", "lang": "C++", "max_stars_repo_path": "src/bgp/bgp_config_listener.cc", "max_stars_repo_name": "sagarc-contrail/contrail-controller", "max_stars_repo_head_hexsha": "834302367f3ff81f1ce93f4036b6b3788dfd6994", "max_stars_repo_licenses": ["A...
if haskey(ENV, "CI") && ENV["CI"] == "true" ENV["PYTHON"] = "" using Pkg Pkg.build("PyCall") end using Test using CUDA using PyPlot using Oceananigans using ConvergenceTests using ConvergenceTests.OneDimensionalCosineAdvectionDiffusion: run_test using ConvergenceTests.OneDimensionalUtils: plot_solutions!,...
{"hexsha": "c54b53f595efa34bc2b88d864e5168891719d55f", "size": 4361, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "validation/convergence_tests/one_dimensional_cosine_advection_diffusion.jl", "max_stars_repo_name": "charleskawczynski/Oceananigans.jl", "max_stars_repo_head_hexsha": "c34e6cd2166bbaa057186ffa795d3...
module VanFoFy include("all_modules.jl") using .Input: CellData using .Ellipticals: Weierstrass, Theta, theta using .Symbolic: VarLinForm, variables, add!, add_conjugated!, mul! function construct_problem(cell::CellData) wei = Weierstrass(cell) #Q = Q_special(wei) #lshear = construct_lshear(cell, wei) ...
{"hexsha": "4ab4a079c49ff8f49c77e534b88f5e485d74341e", "size": 502, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/VanFoFy.jl", "max_stars_repo_name": "YuryKotin/VanFoFy.jl", "max_stars_repo_head_hexsha": "9bac1a58e9b86ede6bd18cab43c1f41ae512f8a9", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null,...
struct SIFTSXML <: FileFormat end # Download SIFTS # ============== """ Download the gzipped SIFTS xml for the `pdbcode`. The extension of the downloaded file is `.xml.gz` by default. The `filename` can be changed, but the `.xml.gz` at the end is mandatory. Extra keyword arguments are passed to `download_file`. """ ...
{"hexsha": "5964b858d616a981e01879c42be5c79503a2b533", "size": 3138, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/SIFTS/XMLParser.jl", "max_stars_repo_name": "timholy/MIToS.jl", "max_stars_repo_head_hexsha": "520213e62c00f87f198b001105bbca5b1dc5bd65", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ...
"""Script to quickly and reproducibly create test data Note: We may want to delete this at some point. """ from typing import Dict, Iterable, Tuple import geopandas as gpd import numpy as np from geograph.constants import SRC_PATH from geograph.tests.utils import get_array_transform, polygonise_sub_array from geograp...
{"hexsha": "093a9944c7a03de8f510cab874758569fc23b494", "size": 3548, "ext": "py", "lang": "Python", "max_stars_repo_path": "geograph/tests/create_test_data.py", "max_stars_repo_name": "ai4er-cdt/gtc-biodiversity", "max_stars_repo_head_hexsha": "03ab82dee1fdf40bcd7c4fcd459728b0ec3a3aa1", "max_stars_repo_licenses": ["MIT...
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' dqlearning.py (c) Will Roberts 2 February, 2017 Double Q-Learning API We assume that Q-learning is accomplished using a model that takes one or more state vectors and produces one or more Q-value vectors, each of length M, which record the model's estimate of the v...
{"hexsha": "9701479e155f7ce45963a1b22451139bbc95c4f3", "size": 13752, "ext": "py", "lang": "Python", "max_stars_repo_path": "cribbage/dqlearning.py", "max_stars_repo_name": "wroberts/cribbage", "max_stars_repo_head_hexsha": "5f0f038900102b77e8b6b51cb10e1c7550873f71", "max_stars_repo_licenses": ["MIT"], "max_stars_count...
# In this tutorial, we will learn # - How to implement multi-field PDEs # - How to build div-conforming FE spaces # - How to impose boundary conditions in multi-field problems # # ## Problem statement # # In this tutorial, we show how to solve a multi-field PDE in Gridap. As a model problem, we consider the Darcy ...
{"hexsha": "0bc7dd50ca6c744990ccf4bbc8a74b9893b8111f", "size": 8574, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/darcy.jl", "max_stars_repo_name": "andre-massing/Tutorials", "max_stars_repo_head_hexsha": "ee4e354f311d6423916127d4b94f5242404d07eb", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nul...
$$\newcommand{\ket}[1]{\left|{#1}\right\rangle}$$ $$\newcommand{\bra}[1]{\left\langle{#1}\right|}$$ ## Tehtävä 1 Kvanttitietokoneen muistissa tieto esitetään kubittien avulla. Kertauksena viime kierrokselta, kubitin perustilat ovat $\ket 0$ ja $\ket{1}$, ja ne esitetään pystyvektoreina $$ \begin{align} \ket 0 &= \pm...
{"hexsha": "a3aa277c582b8f440d85b09a3e12a4bf5a727239", "size": 28054, "ext": "ipynb", "lang": "Jupyter Notebook", "max_stars_repo_path": "kv_laskuharjoitukset/kierros2/Kvanttilaskenta, kierros 2.ipynb", "max_stars_repo_name": "otaniemen-lukio/projects", "max_stars_repo_head_hexsha": "eb73d9055747dc39aa2607af6f29aee0217...
import numpy as np import pandas as pd import os from rdkit import Chem from keras.models import load_model from keras import backend as K from keras import metrics import tensorflow as tf from SMILESX import utils, model, token, augm ## config = tf.ConfigProto() config.gpu_options.allow_growth = True # dynamicall...
{"hexsha": "606d6fd70fa0a3360a7a416c40a3b96fe6475029", "size": 5770, "ext": "py", "lang": "Python", "max_stars_repo_path": "SMILESX/inference.py", "max_stars_repo_name": "pnavaro/SMILES-X", "max_stars_repo_head_hexsha": "c053de6639ee356e3408d289ab45f8885a5b6f46", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 3...
\RequirePackage[l2tabu, orthodox]{nag} % tells out-of-date packages \documentclass[10pt, letterpaper]{scrartcl} \usepackage{amssymb,amsfonts} \usepackage{amsthm} % if using theorems and proofs \usepackage[cmex10]{amsmath} \usepackage[usenames,dvipsnames,svgnames]{xcolor} % use like \textcolor{red}{..} or {\color{red} ...
{"hexsha": "72c62427d293ffa81df3ac2cbec9e3ae72dbdc20", "size": 8555, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "Homeworks/APPM47205720Spr19_RandomizedAlgos_Homework07.tex", "max_stars_repo_name": "jakeknigge/randomized-algorithm-class", "max_stars_repo_head_hexsha": "5d1318ed06e59e518f815013c12d3e0935032cd4",...
import os import logging logger = logging.getLogger(__name__) import numpy as np import astropy.io.fits as fits import scipy.interpolate as intp from scipy.signal import savgol_filter import matplotlib.pyplot as plt def get_region_lst(header): """Get a list of array indices. Args: header (): Retu...
{"hexsha": "20ed8420bdfe713561a7c08e88c1c5309e22cae4", "size": 11012, "ext": "py", "lang": "Python", "max_stars_repo_path": "gamse/pipelines/hds/common.py", "max_stars_repo_name": "wangleon/gamse", "max_stars_repo_head_hexsha": "ed2a3730469a1eeef3def1beca990e9d2641a53b", "max_stars_repo_licenses": ["Apache-2.0"], "max_...
function acq = acqfsn2_vbmc(Xs,vp,gp,optimState,fmu,fs2,fbar,vtot) %ACQFSN2_VBMC Acquisition fcn. for noisy prospective uncertainty search. % Xs is in *transformed* coordinates % Probability density of variational posterior at test points p = max(vbmc_pdf(vp,Xs,0),realmin); % Estimate observation noise at test point...
{"author": "acerbilab", "repo": "vbmc", "sha": "54ba2cdd6c11d2595b9613557da14573abbb7b92", "save_path": "github-repos/MATLAB/acerbilab-vbmc", "path": "github-repos/MATLAB/acerbilab-vbmc/vbmc-54ba2cdd6c11d2595b9613557da14573abbb7b92/acq/acqfsn2_vbmc.m"}
# Copyright 2021 The Deluca Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in w...
{"hexsha": "002094b531ac7664852844cc2fd18c719c687300", "size": 3084, "ext": "py", "lang": "Python", "max_stars_repo_path": "deluca/lung/controllers/_pid.py", "max_stars_repo_name": "google/deluca", "max_stars_repo_head_hexsha": "626ade7bfa44afc52e6ffb9a9e6e94258b4dc024", "max_stars_repo_licenses": ["Apache-2.0"], "max_...
"""Test Braun-Willett and non-fastscape stream power component. A simple driver implementing Braun-Willett flow routing and then a (non-fastscape) stream power component. """ # DEJH, 09/15/14 import os import numpy from numpy.testing import assert_array_almost_equal from landlab import RasterModelGrid from landlab ...
{"hexsha": "165795a25523acf2c8c2602a800e44bd6ce86a8d", "size": 5624, "ext": "py", "lang": "Python", "max_stars_repo_path": "landlab/components/stream_power/tests/test_simple.py", "max_stars_repo_name": "awickert/landlab", "max_stars_repo_head_hexsha": "496de56717a5877db96f354a1b1285bfabe8b56f", "max_stars_repo_licenses...
import warnings warnings.filterwarnings('ignore') import matplotlib.pyplot as plt import pandas as pd import scipy.stats as stats import numpy as np import seaborn as sns import os,sys import itertools import datetime import scipy.signal as signal import matplotlib.dates as mdates from sklearn.neighbors._kde import Ke...
{"hexsha": "5379b37ab9fe390c6f06cf0904ad5c59350bd8a9", "size": 10147, "ext": "py", "lang": "Python", "max_stars_repo_path": "openbadge_analysis/preprocessing/audio.py", "max_stars_repo_name": "Finale21/openbadge", "max_stars_repo_head_hexsha": "48990b73185c76a35b08963c03447b06dfe2727d", "max_stars_repo_licenses": ["MIT...
#!/usr/bin/env python # -*- coding: utf-8 -*- # core modules import os import gym from gym import spaces from gym.utils import seeding import numpy as np from scipy.integrate import odeint from scipy.stats import truncnorm from scipy.signal import savgol_filter class Diabetic0Env(gym.Env): """ Description: ...
{"hexsha": "0bf9f63a377d5c335d696bf57dce7739577ca953", "size": 19989, "ext": "py", "lang": "Python", "max_stars_repo_path": "dosing_rl_gym/envs/diabetic_env.py", "max_stars_repo_name": "strongio/dosing-rl-gym", "max_stars_repo_head_hexsha": "e9f0553080830dc621e97e0652c68b86788b7296", "max_stars_repo_licenses": ["MIT"],...
""" This module provides an implementation of NetMSA algorithm in Julia, which can be used for multiple sequence alignment. """ module NetMSA using StatsBase export createPeerMatrix, matrixalignment @doc raw""" Store the position of a given particle. Position ``x_{s_{i}}(r)`` of the particle ``p_{s_{i}}`` is defined...
{"hexsha": "09b656539bacf17c2fbe4316c44cfa0726e73833", "size": 15293, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/NetMSA.jl", "max_stars_repo_name": "aadimator/NetMSA.jl", "max_stars_repo_head_hexsha": "e2a9282010e7b451254133512708654df7b8714f", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, "m...
from typing import Dict import gym import numpy as np from gym import spaces from quadruped_gym.quadruped.a1_pybullet import A1PyBulletRobot def _flatten_observation_space(observation_space: spaces.Dict): assert isinstance(observation_space, spaces.Dict) lower_bound = [] upper_bound = [] for _, val...
{"hexsha": "5996477ac1a2c8b886220f6aeb01a7cf6a157748", "size": 2297, "ext": "py", "lang": "Python", "max_stars_repo_path": "quadruped_gym/gym/wrappers/wrappers.py", "max_stars_repo_name": "dtch1997/quadruped-gym", "max_stars_repo_head_hexsha": "e3a3709b8bbcedd75ec6716187a2bd0a55599c5e", "max_stars_repo_licenses": ["MIT...
""" ------------------------------------------------------------------------------- G E N E R A L I N F O R M A T I O N ------------------------------------------------------------------------------- This file contains general constants and information about the SAM variables saved in the netCDF file needed for plotg...
{"hexsha": "6e5877837778eb46d37bbdff9eb335488208dddf", "size": 4635, "ext": "py", "lang": "Python", "max_stars_repo_path": "postprocessing/python_sam_budgets_plotter/cases/sam_3d_variables.py", "max_stars_repo_name": "larson-group/clubb_release", "max_stars_repo_head_hexsha": "b4d671e3e238dbe00752c0dead6a0d4f9897350a",...