text
stringlengths
0
1.25M
meta
stringlengths
47
1.89k
import tensorflow as tf import numpy as np class TextCNN(object): """ CNN 2-chanels model for text classification. """ def __init__(self, sentence_len, vocab_size, embedding_size, num_classes, static_embedding_filter, filter_sizes, num_filters, l2_reg_lambda = 0.0): ...
{"hexsha": "0eec22c8ce754d4117bd679fc4205412bf6d3a72", "size": 3837, "ext": "py", "lang": "Python", "max_stars_repo_path": "text_CNN.py", "max_stars_repo_name": "ddajing/multilayer-cnn-text-classification", "max_stars_repo_head_hexsha": "ea97105de2e4411eb492e0c268045006a9a3669f", "max_stars_repo_licenses": ["Apache-2.0...
function test_exponential_neuron(backend::Backend, T, eps) println("-- Testing Exponential neuron on $(typeof(backend)){$T}...") data = rand(T, 3,4,5,6) - convert(T, 0.5) data_blob = make_blob(backend, data) neuron = Neurons.Exponential() println(" > Forward") forward(backend, neuron, data_blob) expe...
{"hexsha": "4ca3edd0d6540fb451cb3166aa3899d00363e849", "size": 1043, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/neurons/exponential.jl", "max_stars_repo_name": "baajur/Mocha.jl", "max_stars_repo_head_hexsha": "5e15b882d7dd615b0c5159bb6fde2cc040b2d8ee", "max_stars_repo_licenses": ["MIT"], "max_stars_coun...
[STATEMENT] lemma inj_setminus: "inj_on uminus (A::'a set set)" [PROOF STATE] proof (prove) goal (1 subgoal): 1. inj_on uminus A [PROOF STEP] by (auto simp: inj_on_def)
{"llama_tokens": 75, "file": null, "length": 1}
import math import numpy as np from functools import reduce # A utility wrapper around numpy.array # mainly to name things how I like them def Vec2(x, y): return np.array([x,y], dtype=float) def Vec3(x, y, z): return np.array([x,y,z], dtype=float) UCONST_Pi = 3.1415926 URotation180 = float(32768) URotationT...
{"hexsha": "1bb392df877a841274a7bbeb33f82cd04d51ba93", "size": 3848, "ext": "py", "lang": "Python", "max_stars_repo_path": "RLBotPack/DomNomNom/NomBot_v1.0/NomBot/vector_math.py", "max_stars_repo_name": "RLMarvin/RLBotPack", "max_stars_repo_head_hexsha": "c88c4111bf67d324b471ad87ad962e7bc8c2a202", "max_stars_repo_licen...
""" Editor Bin H. Quantum Optimal Control Example One Control Parameter Model """ import numpy as np import matplotlib.pyplot as plt from scipy.linalg import expm from time import clock class QH: """ Initial data/conditions of Quantum Hamiltonian and initial states. """ def __init__(self, H0, Hctrl, ctrl_i, phi...
{"hexsha": "6d8fb36e7a04fcf3e9e8a5dd5377acd0a9a9cd41", "size": 5513, "ext": "py", "lang": "Python", "max_stars_repo_path": "abintb/qoct/qoct.py", "max_stars_repo_name": "abyellow/abin-tight-binding", "max_stars_repo_head_hexsha": "538aef632937b1840d5ffd184f162858637b01f5", "max_stars_repo_licenses": ["MIT"], "max_stars...
# -------------- import numpy as np import pandas as pd import matplotlib.pyplot as plt # code starts here df = pd.read_csv(path) p_a = len(df[df['fico']>700])/len(df) print(p_a) p_b = len(df[df['purpose']=='debt_consolidation'])/len(df) df1 = len(df[df['purpose']=='debt_consolidation']) p_a_b = (p_a * p_b)/p_a p_b_a ...
{"hexsha": "558a8b5164dfc1a1f6b3f3188d80a9befba312b6", "size": 1114, "ext": "py", "lang": "Python", "max_stars_repo_path": "Probability/code.py", "max_stars_repo_name": "Sadique96645/ga-learner-dsmp-repo", "max_stars_repo_head_hexsha": "155f039083c22755b32c7dead39bfd86aff4c157", "max_stars_repo_licenses": ["MIT"], "max...
""" ====== Cutout ====== Generate a cutout image from a .fits file """ try: import astropy.io.fits as pyfits import astropy.wcs as pywcs except ImportError: import pyfits import pywcs import numpy try: import coords except ImportError: pass # maybe should do something smarter here, but I want a...
{"hexsha": "e05b74ceec4c93bc98c0f1d44f3f07a60ea2b53e", "size": 4918, "ext": "py", "lang": "Python", "max_stars_repo_path": "agpy/cutout.py", "max_stars_repo_name": "keflavich/agpy", "max_stars_repo_head_hexsha": "fb3a42d9909b7cd1ba74247530bcc8742f5aaeb1", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 16, "max_...
# https://towardsdatascience.com/activation-functions-neural-networks-1cbd9f8d91d6 # https://keras.io/layers/core/ # gsettings set org.gnome.desktop.interface cursor-size 32 # open image # open csv import tensorflow as tf import numpy as np import pandas as pd from collections import Counter from sklearn.model_selectio...
{"hexsha": "f30151323cf137a320977eb1da4b99e8bdf0acfd", "size": 1440, "ext": "py", "lang": "Python", "max_stars_repo_path": "tictacnet.py", "max_stars_repo_name": "angelasof25/TicTacToeML", "max_stars_repo_head_hexsha": "655ce609ec1ab371d1646b3443921b5a1569e27a", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nu...
[STATEMENT] lemma exp_of_minus_half_pi: fixes x:: real assumes "x = pi/2" shows "exp (-(\<i> * complex_of_real x)) = -\<i>" [PROOF STATE] proof (prove) goal (1 subgoal): 1. exp (- (\<i> * complex_of_real x)) = - \<i> [PROOF STEP] using assms cis_conv_exp cis_minus_pi_half [PROOF STATE] proof (prove) using this:...
{"llama_tokens": 222, "file": "Isabelle_Marries_Dirac_Basics", "length": 2}
import Base.convert abstract type DynamicSystem end show(io::IO, ds::DynamicSystem) = print( io, """$(typeof(ds)) x = $(get_x(ds)) dx/dt = $(get_x_dot(ds)) """ ) get_x(ds::DynamicSystem) = ds.x get_x(ds::DynamicSystem, state::State) = get_x(convert(typeof(ds), state)) get_x_dot(ds::DynamicSy...
{"hexsha": "c63b601318f6b02e78ea0c39dcbe7bd0c8c8aaec", "size": 7605, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/models/dynamic_systems.jl", "max_stars_repo_name": "AlexS12/FlightMechanics.jl", "max_stars_repo_head_hexsha": "12bc740341aee3fd61f5a43f1253b598725989fd", "max_stars_repo_licenses": ["MIT"], "m...
# coding=utf-8 """Evaluate embeddings on downstream tasks.""" import os import shutil import math import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import pprint import torch import numpy as np import pickle from itertools import chain from tqdm import tqdm from torch.utils.tensorboard import Sum...
{"hexsha": "be9b3537bee886f05261858cb0d2204f2edf6aeb", "size": 14321, "ext": "py", "lang": "Python", "max_stars_repo_path": "evaluate_finegym.py", "max_stars_repo_name": "minghchen/CARL_code", "max_stars_repo_head_hexsha": "c574312969c35963fc0050a5b5dbd3e4aa590318", "max_stars_repo_licenses": ["MIT"], "max_stars_count"...
# linear algebra import numpy as np import pandas as pd # text vectorizer from sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer # for nearest neighbor from sklearn.neighbors import NearestNeighbors # cosine similarity from sklearn.metrics.pairwise import linear_kernel as cosine_similarity # n...
{"hexsha": "f88107e79b9f6c73ff9ec20c4984b31f39e7afcd", "size": 9729, "ext": "py", "lang": "Python", "max_stars_repo_path": "analysis.py", "max_stars_repo_name": "Hikari9/Matching", "max_stars_repo_head_hexsha": "5bf8b9b229db507679d5c839f205a3d85864c504", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count": nul...
[STATEMENT] lemma mono_closed_real: fixes S :: "real set" assumes mono: "\<forall>y z. y \<in> S \<and> y \<le> z \<longrightarrow> z \<in> S" and "closed S" shows "S = {} \<or> S = UNIV \<or> (\<exists>a. S = {a..})" [PROOF STATE] proof (prove) goal (1 subgoal): 1. S = {} \<or> S = UNIV \<or> (\<exists>a. S...
{"llama_tokens": 4317, "file": null, "length": 54}
/* *Author:GeneralSandman *Code:https://github.com/GeneralSandman/TinyWeb *E-mail:generalsandman@163.com *Web:www.dissigil.cn */ /*---XXX--- * **************************************** * */ #include <tiny_base/api.h> #include <tiny_base/log.h> #include <tiny_base/sync.h> #include <tiny_core/eventloop.h> #incl...
{"hexsha": "65e2359f859b2c5fb0d513324d25563f633823e6", "size": 4246, "ext": "cc", "lang": "C++", "max_stars_repo_path": "src/tiny_core/process.cc", "max_stars_repo_name": "swaroop0707/TinyWeb", "max_stars_repo_head_hexsha": "79d20f2bb858581cc5a0ea229bba3a54e5d1bd3e", "max_stars_repo_licenses": ["MIT"], "max_stars_count...
import pandas as pd import os import numpy as np import cv2 datapath1='D:/Minor Project/COVID-19 Detection/Files/Covid-19 prediction using X-Ray images/covid-chestxray-dataset-master/' dataset_path='D:/Minor Project/COVID-19 Detection/Files/Covid-19 prediction using X-Ray images/dataset' categories=os.listd...
{"hexsha": "01ad161e174b4fec185952d1f4096c4c21b41a6f", "size": 1563, "ext": "py", "lang": "Python", "max_stars_repo_path": "CreatingDataset.py", "max_stars_repo_name": "amitd307/Covid-19-prediction-using-X-Ray-images", "max_stars_repo_head_hexsha": "2a12f6975b3301466957d41e08899940ebd44840", "max_stars_repo_licenses": ...
[STATEMENT] lemma subset_fst_imageI: "A \<times> B \<subseteq> S \<Longrightarrow> y \<in> B \<Longrightarrow> A \<subseteq> fst ` S" [PROOF STATE] proof (prove) goal (1 subgoal): 1. \<lbrakk>A \<times> B \<subseteq> S; y \<in> B\<rbrakk> \<Longrightarrow> A \<subseteq> fst ` S [PROOF STEP] unfolding image_def subset_...
{"llama_tokens": 224, "file": null, "length": 2}
AgeFitsSrv <- function(dat=am1, case_label="2010 assessment",f=1) { subtle.color <- "gray40" attach(dat) #ages <- c(1,11) #age range tmp1 <- paste("phat_srv_",f,sep="") tmp2 <- paste("pobs_srv_",f,sep="") tmp3 <- paste("pobs_srv_",f,sep="") print(tmp1) pred.data = get(tmp1)[,-1] obs....
{"hexsha": "5c31f5c1f4c02be6aad66d428aa070daf580d130", "size": 2835, "ext": "r", "lang": "R", "max_stars_repo_path": "examples/atka/R/af_srv.r", "max_stars_repo_name": "NMFS-toolbox/AMAK", "max_stars_repo_head_hexsha": "701d016cf26943050ee42488f5b5f328f79ce5d6", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1,...
""" Script for extracting an analyzing the filaments attached to a membrane from several input datasets DEPRECATED: USE mb_graph_batch.py instead Input: - Density map tomogram - Segmentation tomogram Output: - Connectors clusters """ __author__ = 'Antonio Martinez-Sanchez' # #########...
{"hexsha": "8bb988e9de953cb79db484887e8c91759f0bf11c", "size": 9246, "ext": "py", "lang": "Python", "max_stars_repo_path": "code/pyseg/psd/mb_fil_batch.py", "max_stars_repo_name": "anmartinezs/pyseg_system", "max_stars_repo_head_hexsha": "5bb07c7901062452a34b73f376057cabc15a13c3", "max_stars_repo_licenses": ["Apache-2....
''' Loads a trained model, and classifies an image argv[1]: path to hdf5 model to load argv[2]: path to image to classify ''' from tensorflow.keras.models import load_model from tensorflow.keras.preprocessing.image import load_img, img_to_array, array_to_img import sys import time import numpy as np model = load_mo...
{"hexsha": "252fc2f92c1b8bef9f0f2a60ea6df1b7e6038598", "size": 861, "ext": "py", "lang": "Python", "max_stars_repo_path": "predict.py", "max_stars_repo_name": "jakogut/brass-sorter", "max_stars_repo_head_hexsha": "34db44c34241c32dbb38759d3e0201fc0a0c19b8", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 3, "max_...
import torch.nn as nn import torch import torch.nn.functional as F import numpy as np import cv2 from utils import calc_pairwise_distance_3d # from hrnet.init_hrnet import cls_hrnet_w32, pose_hrnet_w32 from config import Config ################# Bilinear Pooling Reasoning Module ################### class...
{"hexsha": "3948dd17578beca2963ecad0ae5677942fd6e4dd", "size": 18235, "ext": "py", "lang": "Python", "max_stars_repo_path": "infer_module/TCE_STBiP_module.py", "max_stars_repo_name": "ch-its/DIN-Group-Activity-Recognition-Benchmark", "max_stars_repo_head_hexsha": "02d29decc7ed8c6c85bf53436956ef36f76e4872", "max_stars_r...
/* * websocket_ConnectionListener.cpp */ #include <boost/asio/ip/tcp.hpp> #include "logging/log_Logger.h" #include "websocket_WebsocketDriver.h" #include "websocket_RawHttpConnection.h" #include "websocket_ConnectionListener.h" namespace mutgos { namespace websocket { // --------------------------------------...
{"hexsha": "760e3d26442e8d76ba151e105c60d9594af3b9a3", "size": 4078, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "src/websocketcomm/websocket_ConnectionListener.cpp", "max_stars_repo_name": "hyena/mutgos_server", "max_stars_repo_head_hexsha": "855c154be840f70c3b878fabde23d2148ad028b3", "max_stars_repo_licenses"...
[STATEMENT] lemma is_shortest_path_onD1 [forward]: "is_shortest_path_on G m n p V \<Longrightarrow> p \<in> path_set_on G m n V" [PROOF STATE] proof (prove) goal (1 subgoal): 1. is_shortest_path_on G m n p V \<Longrightarrow> p \<in> path_set_on G m n V [PROOF STEP] by auto2
{"llama_tokens": 117, "file": "Auto2_Imperative_HOL_Functional_Dijkstra", "length": 1}
import porespy as ps import numpy as np import pytest class DNSTest(): def setup_class(self): np.random.seed(10) def test_tortuosity_2D_lattice_spheres_axis_1(self): im = ps.generators.lattice_spheres(shape=[200, 200], radius=8, offset=5) t = ps.dns.tortuosity(im=im, axis=1) ...
{"hexsha": "73a715be57df5ece82ba5716c91463a3358894a4", "size": 1261, "ext": "py", "lang": "Python", "max_stars_repo_path": "test/unit/test_dns.py", "max_stars_repo_name": "hfathian/porespy", "max_stars_repo_head_hexsha": "8747e675ba8e6410d8448492c70f6911e0eb816a", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ...
#!/usr/bin/python """ Output table of instrumental specifications. """ import numpy as np import radiofisher as rf e = rf.experiments expt_list = [ ( 'exptS', e.exptS ), # 0 ( 'iexptM', e.exptM ), # 1 ( 'exptL', e.exptL ), # 2 ( 'iexptL', e...
{"hexsha": "6c4a7bffec346760adb96b6f47a61111cb839dcb", "size": 3795, "ext": "py", "lang": "Python", "max_stars_repo_path": "specs_table.py", "max_stars_repo_name": "sjforeman/RadioFisher", "max_stars_repo_head_hexsha": "fe25f969de9a700c5697168ba9e0d2645c55ed81", "max_stars_repo_licenses": ["AFL-3.0"], "max_stars_count"...
/* * Copyright (c) 2016 George Ungureanu <ugeorge@kth.se> * 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": "a2b447b86b405c5797246cba514a99d73f306127", "size": 7359, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "src/settings/config.hpp", "max_stars_repo_name": "forsyde/DeSyDe", "max_stars_repo_head_hexsha": "48c55861ed78dd240451787258ee286b0f46aea5", "max_stars_repo_licenses": ["BSD-2-Clause"], "max_stars_c...
[STATEMENT] lemma delete_type: "t \<in> B h \<Longrightarrow> delete x t \<in> B h \<union> B(h-1)" [PROOF STATE] proof (prove) goal (1 subgoal): 1. t \<in> B h \<Longrightarrow> delete x t \<in> B h \<union> B (h - 1) [PROOF STEP] unfolding delete_def [PROOF STATE] proof (prove) goal (1 subgoal): 1. t \<in> B h \<...
{"llama_tokens": 201, "file": null, "length": 2}
"""Parameter or state variable as random variable """ from __future__ import division import json import logging import sys import itertools from collections import OrderedDict as odict import numpy as np import runner.xparams as xp from runner.xparams import XParams from runner.lib.doelhs import lhs from runner.tools...
{"hexsha": "c7006d02c64a6e9919f3c559645785b53b3d0e69", "size": 8358, "ext": "py", "lang": "Python", "max_stars_repo_path": "runner/param.py", "max_stars_repo_name": "alex-robinson/runner", "max_stars_repo_head_hexsha": "5e992ef7eaf82b4a69be8c6db9e572421323bc69", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 2,...
function write_surf(fname, vert, face) % write_surf - FreeSurfer I/O function to write a surface file % % write_surf(fname, vert, face) % % writes a surface triangulation into a binary file % fname - name of file to write % vert - Nx3 matrix of vertex coordinates % face - Mx3 matrix of face triangulation indices %...
{"author": "fieldtrip", "repo": "fieldtrip", "sha": "c2039be598a02d86b39aae76bfa7aaa720f9801c", "save_path": "github-repos/MATLAB/fieldtrip-fieldtrip", "path": "github-repos/MATLAB/fieldtrip-fieldtrip/fieldtrip-c2039be598a02d86b39aae76bfa7aaa720f9801c/external/freesurfer/write_surf.m"}
from collections import defaultdict from torchseq.metric_hooks.base import MetricHook from torchseq.utils.tokenizer import Tokenizer from torchseq.utils.metrics import bleu_corpus, meteor_corpus, ibleu_corpus from torchseq.utils.sari import SARIsent import torch import numpy as np class TextualMetricHook(MetricHook):...
{"hexsha": "b5e03b87df91f0f68ffbce5817971bcb58946e06", "size": 2174, "ext": "py", "lang": "Python", "max_stars_repo_path": "torchseq/metric_hooks/textual.py", "max_stars_repo_name": "tomhosking/torchseq", "max_stars_repo_head_hexsha": "1b08c16822a553ecb77b96289fb21eb0a13d9c6b", "max_stars_repo_licenses": ["Apache-2.0"]...
import math import numpy as np DEFAULT_FRAMERATE = 44100 import matplotlib.pyplot as pl DoublePI = math.pi * 2 import wave import matplotlib.pyplot as plt import sounddevice as sd import scipy.stats import scipy.fftpack def serial_corr(wave, lag = 1): n = len(wave) y1 = wave[lag:] y2 = wave[:n-lag] ...
{"hexsha": "fe4a7b410404f46b057150bc38cc716c79d55352", "size": 16107, "ext": "py", "lang": "Python", "max_stars_repo_path": "19-q2/endpoint_detection/volume.py", "max_stars_repo_name": "18325391772/blog-code-example", "max_stars_repo_head_hexsha": "8ea0cc00855334da045b4566072611c24c14c844", "max_stars_repo_licenses": [...
import numpy as np import os import shutil import glob import argparse import os.path as osp import xml.etree.ElementTree as et from xml.dom import minidom import pickle import random import copy import cv2 import pickle def loadMesh(name ): vertices = [] faces = [] with open(name, 'r') as meshIn: ...
{"hexsha": "dc9b8b9f5a47b7055b75b8240f53bca74cca3330", "size": 12140, "ext": "py", "lang": "Python", "max_stars_repo_path": "utils_OR/DatasetCreation/renderLSImage.py", "max_stars_repo_name": "Jerrypiglet/Total3DUnderstanding", "max_stars_repo_head_hexsha": "655d00a988c839af3b73f8ab890c3f70c1500147", "max_stars_repo_li...
import os import re import html import nltk import numpy as np from math import log from collections import Counter,defaultdict from scipy import sparse import pickle import logging logging.basicConfig(format='%(asctime)s %(levelname)-8s %(message)s', \ level=logging.INFO, \ da...
{"hexsha": "21c5a2269e5b8fb843cba99c30d2fedd7aebfee4", "size": 4489, "ext": "py", "lang": "Python", "max_stars_repo_path": "features_generator_bow.py", "max_stars_repo_name": "tellesleandro/mo444_final_project", "max_stars_repo_head_hexsha": "66cf996c8add125272040777edc5c64b3a7323c8", "max_stars_repo_licenses": ["MIT"]...
import numpy as np import jax import jax.numpy as jnp import jax.scipy as jsp import jaxtorch from jaxtorch import PRNG, Context, Module, nn, init from diffusion_models.common import * from diffusion_models.schedules import cosine class ResidualBlock(nn.Module): def __init__(self, main, skip=None): super(...
{"hexsha": "6b5fa8057437a36d4a0131f4c016d83427d43415", "size": 4758, "ext": "py", "lang": "Python", "max_stars_repo_path": "jax-diffusion/jax-guided-diffusion/diffusion_models/pixelart.py", "max_stars_repo_name": "Baughn/nixgan", "max_stars_repo_head_hexsha": "20639e37f8263187ef3928fa91974e9d9d0848d8", "max_stars_repo_...
import unittest import pandas as pd import os import numpy as np from mlapp.utils.metrics.pandas import regression from mlapp.utils.general import get_project_root from mlapp.managers import ModelManager, DataManager from mlapp.managers.io_manager import IOManager from mlapp.utils.automl import AutoMLResults from pyspa...
{"hexsha": "246e4f5465600e99d8907f312cd34c6433c46895", "size": 7357, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_managers.py", "max_stars_repo_name": "kerenleibovich/mlapp", "max_stars_repo_head_hexsha": "0b8dfaba7a7070ab68cb29ff61dd1c7dd8076693", "max_stars_repo_licenses": ["Apache-2.0"], "max_st...
import numpy as np import csv from datetime import datetime from PyQt5 import uic, QtCore, QtWidgets, QtGui from PyQt5.QtWidgets import QDialog import matplotlib from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas from matplotlib.figure import Figure import matplotlib.pyplot as plt matp...
{"hexsha": "5b5a0f5ff633cc0332ade7b9162b7bcf12d96beb", "size": 13654, "ext": "py", "lang": "Python", "max_stars_repo_path": "SingleIRdetection/gui/dialogs/dialog_live_graphs.py", "max_stars_repo_name": "biqute/QTLab2122", "max_stars_repo_head_hexsha": "4d53d4c660bb5931615d8652e698f6d689a4dead", "max_stars_repo_licenses...
# ---------------------------------------- # Written by Yude Wang # ---------------------------------------- import random import numpy as np import torch import torch.nn.functional as F from torch import nn from torch.utils.data import DataLoader from lib.utils.test_utils import single_gpu_test from lib.utils.DenseC...
{"hexsha": "5ff78b1f98c1cf0b506b1e0fa32309953fda20ab", "size": 4077, "ext": "py", "lang": "Python", "max_stars_repo_path": "experiment/deeplabv3_voc/test.py", "max_stars_repo_name": "giussepi/semantic-segmentation-codebase", "max_stars_repo_head_hexsha": "163b0edfa30a8e1147b532a737d0784ea09f4fc2", "max_stars_repo_licen...
import numba as nb import numpy as np FASTMATH=True PARALLEL = True CACHE=True njitSerial = nb.njit(fastmath=FASTMATH,cache=CACHE) jitSerial = nb.jit(fastmath=FASTMATH,cache=CACHE) njitParallel = nb.njit(fastmath=FASTMATH,cache=CACHE,parallel=PARALLEL) jitParallel = nb.jit(fastmath=FASTMATH,cache=CACHE,parallel=PARALLE...
{"hexsha": "a409c109418516b2d975ed28eb033da81dcefcbe", "size": 1603, "ext": "py", "lang": "Python", "max_stars_repo_path": "Legacy/mcmc/autocorr.py", "max_stars_repo_name": "puat133/MCMC-MultiSPDE", "max_stars_repo_head_hexsha": "2beca39f32c0cdd7664baeacd495b193850d8e7d", "max_stars_repo_licenses": ["Apache-2.0"], "max...
from flask import Flask, render_template, request app = Flask(__name__) @app.route('/') def index(): return render_template("index.html") @app.route('/inputs') def inputs(): return render_template("inputs.html") @app.route('/lookup') def lookup(): return render_template("lookup.html") ...
{"hexsha": "83e4d24f1c10a980d975e98cc21be7ac4b7366f7", "size": 4949, "ext": "py", "lang": "Python", "max_stars_repo_path": "app.py", "max_stars_repo_name": "xdhacksteam/xdhacksteam", "max_stars_repo_head_hexsha": "52c1922e59a3846772da887e0da2e0546a9e0d33", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 4, "max_...
import numpy as np import subprocess import os.path import sys class MetisGraphHelper(object): def __init__(self, metisUndirectedGraphFile, partitionNum, machineNum, machineScale, hyperMetisGraphFiles, metisDistFiles): self.metisUndirectedGraphFile = metisUndirectedGraphFile self.metisUndirectedGr...
{"hexsha": "9857823e711ffb0a49d62ce703f407a48c9f0317", "size": 22171, "ext": "py", "lang": "Python", "max_stars_repo_path": "metis_graph_helper.py", "max_stars_repo_name": "HolyLow/Balanced_Graph_Partitioning", "max_stars_repo_head_hexsha": "72aecb42c1edbd7973babf4779d3aea4ad6cdf6b", "max_stars_repo_licenses": ["Apache...
using DataStructures: OrderedDict using DataFrames: DataFrame using Dates: AbstractTime struct Simulation base::Union{String,Symbol,Nothing} index::OrderedDict{Symbol,Any} target::OrderedDict{Symbol,Any} mapping::OrderedDict{Symbol,Any} meta::OrderedDict{Symbol,Any} result::DataFrame end simul...
{"hexsha": "3fab5431f94ddf9ecd659d48dd1646e1ef39fb34", "size": 9376, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/util/simulate.jl", "max_stars_repo_name": "tomyun/Cropbox.jl", "max_stars_repo_head_hexsha": "10d2180d213919c91c911b6718460057a4c8be9d", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 2...
import os import numpy as np import xarray as xr from echopype.convert import Convert from echopype.model import EchoData # ek60_raw_path = './echopype/test_data/ek60/2015843-D20151023-T190636.raw' # Varying ranges ek60_raw_path = './echopype/test_data/ek60/DY1801_EK60-D20180211-T164025.raw' # Constant ranges ek...
{"hexsha": "5ee472753c2158c773c8c150d24d811de3cf3f35", "size": 4994, "ext": "py", "lang": "Python", "max_stars_repo_path": "echopype/tests/test_ek60_model.py", "max_stars_repo_name": "leewujung/echopype-lfs-test", "max_stars_repo_head_hexsha": "b76dcf42631d0ac9cef0efeced9be4afdc15e659", "max_stars_repo_licenses": ["Apa...
[STATEMENT] lemma Qs_member_iff [simp]: "q |\<in>| Qs A \<longleftrightarrow> (\<exists> f ps p. TA_rule (Some f) ps p |\<in>| rules A \<and> (p = q \<or> (p, q) |\<in>| (eps A)|\<^sup>+|))" (is "?Ls \<longleftrightarrow> ?Rs") [PROOF STATE] proof (prove) goal (1 subgoal): 1. (q |\<in>| Qs A) = (\<exists>f ps p. So...
{"llama_tokens": 2591, "file": "Regular_Tree_Relations_RRn_Automata", "length": 17}
#!/usr/bin/env python #-*- coding: utf-8 -*- """ meep_materials.py This script contains definitions of materials suitable for the FDTD algorithm. However, only the materials from the sections "Generic" and "Prepared for FDTD" are ready to be fed to MEEP, and they are valid only for a given spectral range. On the cont...
{"hexsha": "b0e8948bc1df02b313472d79cb84846c7f367992", "size": 25704, "ext": "py", "lang": "Python", "max_stars_repo_path": "meep_materials.py", "max_stars_repo_name": "LeiDai/meep_metamaterials", "max_stars_repo_head_hexsha": "2ca51c861e1f69e638e920c9bdacc7c583e22aed", "max_stars_repo_licenses": ["MIT"], "max_stars_co...
''' Copyright (C) 2016 The Crown (i.e. Her Majesty the Queen in Right of Canada) This file is an add-on to RAVE. RAVE is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (a...
{"hexsha": "80355bd42492e6f8f0f5c08ee5d7ef50cb979f4b", "size": 4835, "ext": "py", "lang": "Python", "max_stars_repo_path": "rave_ec/test/pytest/ECDopvolFilterTest.py", "max_stars_repo_name": "DanielMichelson/drqc_article", "max_stars_repo_head_hexsha": "cd7df2f7290adedb557bbc6ba484d30039a23ce2", "max_stars_repo_license...
#utility functions for debugging and plotting import matplotlib.pyplot as plt import matplotlib.image as mpimg import numpy as np import cv2 #*NOTE* constants definition used for finding lines WIN_NUM = 12 WIN_MARGIN = 100 MIN_PIX = 50 X_CORNER = 9 Y_CORNER = 6 #*NOTE* pre-requisite: image has already been converte...
{"hexsha": "d1cc9e229fedd0ea0863ee186d4abb3bd7504de6", "size": 2376, "ext": "py", "lang": "Python", "max_stars_repo_path": "utilities.py", "max_stars_repo_name": "zhengweiqi/AdvancedLaneDetection", "max_stars_repo_head_hexsha": "a443b8c12a79ac8ae8b43dfd5f7a8cf9f9547314", "max_stars_repo_licenses": ["MIT"], "max_stars_c...
\section{Conclusion} This study presents an approach to account for plastic deformation in a velocity based formulation. In the introduced method, the plastic deformation takes place if the force or moment exceeds the given limit, the deformation absorbs energy and the joint breaks if plastic capacity is exceeded. ...
{"hexsha": "c59885121d381ac12767a6d9df46285164e1995c", "size": 1815, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "pdocs/thesis/article-conclusion.tex", "max_stars_repo_name": "simo-11/bullet3", "max_stars_repo_head_hexsha": "af7753f5d7fbc0030a3abbe43356d9a9ea784a62", "max_stars_repo_licenses": ["Zlib"], "max_st...
# from sensible_raw.loaders import loader from world_viewer.synthetic_world import SyntheticWorld from world_viewer.glasses import Glasses import pandas as pd import matplotlib.pyplot as plt import numpy as np import networkx as nx from matplotlib.colors import LogNorm from sklearn.utils import shuffle import pickle d...
{"hexsha": "c4428f7c9bb62e63e16889a1aa0c0355abef4336", "size": 1218, "ext": "py", "lang": "Python", "max_stars_repo_path": "CreateSurrogates/AVM_surrogate_time-edges-complete.py", "max_stars_repo_name": "pik-copan/pydrf", "max_stars_repo_head_hexsha": "998072d655331ca6669c71bb6df665292e8972e7", "max_stars_repo_licenses...
#1 -)ARRAYS # reversing numpy array import numpy def arrays(arr): return numpy.array(arr, float)[::-1] arr = input().strip().split(' ') result = arrays(arr) print(result) #2 -)SHAPE AND RESHAPE # reshaping with reshape function import numpy print(numpy.array(list(map(int, input().rstrip().split()))).reshape(3...
{"hexsha": "033a442a5c4b9688955004fa52efd4ea5d31026b", "size": 3651, "ext": "py", "lang": "Python", "max_stars_repo_path": "hw1scripts/numpy.py", "max_stars_repo_name": "vedatk67/ADM-HW1", "max_stars_repo_head_hexsha": "21da1ba0c4f08a8d3fb14d40a65476b39761b4f9", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nu...
import pybullet as p import time import math from datetime import datetime from numpy import * from pylab import * import struct import sys import os, fnmatch import argparse from time import sleep def readLogFile(filename, verbose = True): f = open(filename, 'rb') print('Opened'), print(filename) keys = f...
{"hexsha": "5b02f1b72d11b97b9ce90be4f9aa07a3d20bf2d7", "size": 1835, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/pybullet/examples/kuka_with_cube_playback.py", "max_stars_repo_name": "frk2/bullet3", "max_stars_repo_head_hexsha": "225d823e4dc3f952c6c39920c3f87390383e0602", "max_stars_repo_licenses": ...
[STATEMENT] lemma eval_preserves_sconf: "\<lbrakk> wf_C_prog P; P,E \<turnstile> \<langle>e,s\<rangle> \<Rightarrow> \<langle>e',s'\<rangle>; P,E \<turnstile> e::T; P,E \<turnstile> s \<surd> \<rbrakk> \<Longrightarrow> P,E \<turnstile> s' \<surd>" [PROOF STATE] proof (prove) goal (1 subgoal): 1. \<lbrakk>wf_C_prog ...
{"llama_tokens": 262, "file": "CoreC++_TypeSafe", "length": 1}
from scipy.spatial import cKDTree from deduplication.duplicatefinder.NearDuplicateImageFinder import NearDuplicateImageFinder class cKDTreeFinder(NearDuplicateImageFinder): valid_metrics = [ 'manhattan', 'euclidean' ] def __init__(self, img_file_list, distance_metric, leaf_size=40, paral...
{"hexsha": "dd1cf0b316eaef90169ca452a16ca36cb8d7a155", "size": 2855, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/deduplication/duplicatefinder/cKDTreeFinder.py", "max_stars_repo_name": "rebinsilva/fast-near-duplicate-image-search", "max_stars_repo_head_hexsha": "eed7776c423e9b870b8f3c08b3e4f56019bace10",...
import json import sys import numpy as np import networkx as nx from tqdm import tqdm from util.config import JAVADOC_GLOBAL_NAME, EXP_DEUS_X_MACHINA_CONCEPT_SEARCH_RESULT_STORE_PATH, EXP_DEUS_X_MACHINA_LITERAL_STRICT_SEARCH_RESULT_STORE_PATH,EXP_DEUX_X_MACHINA_LITERAL_SEARCH_RESULT_STORE_PATH, base_dir from util.conc...
{"hexsha": "ba727a9ac977e8f5bad3125cec25d5aa2a00286c", "size": 8930, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/DEUS-X-MACHINA_EXP_2-statistic_min_concept_map_distance.py", "max_stars_repo_name": "delavet/SOworkspace", "max_stars_repo_head_hexsha": "74bbcfa62c7e293b2b02f23249ac408aa22b44af", "max_stars_...
/////////////////////////////////////////////////////////////////////////////// // Copyright (C) 2013, PAL Robotics S.L. // // 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 reta...
{"hexsha": "ed97684c3a1f4d9e56a8978e285e9527affe560e", "size": 5001, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "play_motion/play_motion/test/play_motion_test.cpp", "max_stars_repo_name": "hect1995/Robotics_intro", "max_stars_repo_head_hexsha": "1b687585c20db5f1114d8ca6811a70313d325dd6", "max_stars_repo_licens...
%%%%%%%%%%%%%%%%%%%%%definitions%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \input{../header.tex} \input{../newcommands.tex} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%DOCUMENT%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{document} %\preprint{} \title{The parallel derivative on structured grids} \author{M.~Wiesenberger and M.~ Held...
{"hexsha": "94ff9fe721db16b8d4dac710dd51d9f942c07cd5", "size": 33819, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "doc/related_pages/parallel/parallel.tex", "max_stars_repo_name": "gregordecristoforo/feltor", "max_stars_repo_head_hexsha": "d3b7b296e6f5be3a9ff9d602d98461ed9c60033a", "max_stars_repo_licenses": ["...
from keras.preprocessing.image import ImageDataGenerator import numpy as np from keras import backend as K import os target_size = (512, 512) batch_size = 2 path_train = 'data/train' path_test = 'data/test' # generate train data def gen_train_data(): data_gen_args = dict( rotation_range=...
{"hexsha": "5a63f4003452e4c0b094a7f7aa9b1488b3c4cda4", "size": 2571, "ext": "py", "lang": "Python", "max_stars_repo_path": "U-net-re/data_generator.py", "max_stars_repo_name": "BillChan226/In-Field-Crop-Disease-Regnition-via-Domain-Adaptation", "max_stars_repo_head_hexsha": "4500e7149a51eab66778471750b84b09d415e578", "...
import os import sys import torch import argparse import collections import numpy as np sys.path.append('.') import darknet import shufflenetv2 import yolov3 if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('--model', type=str, help='path to the model') parser.add...
{"hexsha": "d7918458d7885cf3768d0a21957c00f700d903f4", "size": 1635, "ext": "py", "lang": "Python", "max_stars_repo_path": "tools/valid_tensorrt_output.py", "max_stars_repo_name": "Royzon/JDE", "max_stars_repo_head_hexsha": "76258ffbfc51d20ebdd2a1fc152a91fe43a12f1c", "max_stars_repo_licenses": ["MIT"], "max_stars_count...
""" Generates some prediction plots for the Herschel I paper. :author: Sami-Matias Niemi :contact: sammy@sammyniemi.com :version: 0.5 """ import matplotlib #matplotlib.use('Cairo') matplotlib.use('Agg') matplotlib.rc('text', usetex=True) matplotlib.rcParams['font.size'] = 17 matplotlib.rc('xtick', labelsize=14) matpl...
{"hexsha": "b18370c41d4bd6369beb8716a89405f761501116", "size": 23995, "ext": "py", "lang": "Python", "max_stars_repo_path": "herschel/plotmergersPaper.py", "max_stars_repo_name": "sniemi/SamPy", "max_stars_repo_head_hexsha": "e048756feca67197cf5f995afd7d75d8286e017b", "max_stars_repo_licenses": ["BSD-2-Clause"], "max_s...
import pytest import pandas as pd import numpy as np from mlserver.codecs.pandas import PandasCodec, _to_response_output from mlserver.types import ( InferenceRequest, InferenceResponse, RequestInput, Parameters, ResponseOutput, ) @pytest.mark.parametrize( "series, expected", [ ( ...
{"hexsha": "fe24b34bdd7a9e07f92c985bf8f140a270ac6d2b", "size": 3968, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/codecs/test_pandas.py", "max_stars_repo_name": "JakeNeyer/MLServer", "max_stars_repo_head_hexsha": "a283d3c0008c944b28cdd39c2ffec73f59296603", "max_stars_repo_licenses": ["Apache-2.0"], "max...
# %load_ext rpy2.ipython # %matplotlib inline from fbprophet import Prophet import pandas as pd import numpy as np from matplotlib import pyplot as plt import logging logging.getLogger('fbprophet').setLevel(logging.ERROR) import warnings warnings.filterwarnings("ignore") df = pd.read_csv('../examples/example_wp_peyton_...
{"hexsha": "c3029f11dfeea829a410911ed9588a68312c419c", "size": 2151, "ext": "py", "lang": "Python", "max_stars_repo_path": "notebook/seasonality_and_holiday_effects.py", "max_stars_repo_name": "wuliuyuedetian/prophet", "max_stars_repo_head_hexsha": "32c623721315eba562e422a7ef341ff2e5182eb4", "max_stars_repo_licenses": ...
#!/usr/bin/env python from __future__ import division, absolute_import, print_function import numpy as np """ Defines signatures of discharge time series. They are: autocorrelation flow duration curves rising and declining limb densities maximum monthly flow moments ...
{"hexsha": "07f8d97e61a3f2caf220456248890d4ccf28274b", "size": 21511, "ext": "py", "lang": "Python", "max_stars_repo_path": "jams/qa/signatures.py", "max_stars_repo_name": "MuellerSeb/jams_python", "max_stars_repo_head_hexsha": "1bca04557da79d8f8a4c447f5ccc517c40ab7dfc", "max_stars_repo_licenses": ["MIT"], "max_stars_c...
#!/usr/bin/python2.7 # _*_ coding: utf-8 _*_ """ @Author: MarkLiu """ import AdaBoostAndNavieBayes.AdaboostNavieBayes as boostNaiveBayes import random import numpy as np def trainingAdaboostGetDS(iterateNum=40): """ 测试分类的错误率 :param iterateNum: :return: """ filename = '../emails/training/SMSCo...
{"hexsha": "ab1c160cb08d5d9610903b4fbd47607124f29f81", "size": 3543, "ext": "py", "lang": "Python", "max_stars_repo_path": "AdaBoostAndNavieBayes/training.py", "max_stars_repo_name": "steveatgit/Bayes", "max_stars_repo_head_hexsha": "7e64789466dd29ed1e5b1590c21573903aaa2cc5", "max_stars_repo_licenses": ["MIT"], "max_st...
import numpy as np import math from scipy.spatial.transform import Rotation as R from math import ceil,trunc,floor,sin,cos,atan,acos,sqrt EPS = 1e-6 def angle_axis_from_quaternion(quater): angle = 2 * acos(quater[3]) axis = quater[:3]/(sin(angle/2)+EPS) return angle * axis def angle_axis_from_quaternion_batch(...
{"hexsha": "a0f882be83ae029ea1dc63a8259785bc6ac552d4", "size": 13412, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/utils/rotation_lib.py", "max_stars_repo_name": "yifan-you-37/omnihang", "max_stars_repo_head_hexsha": "c80b699b2cf2cf3422201cc8c3fa572d0e01d5a2", "max_stars_repo_licenses": ["MIT"], "max_star...
# This file is a part of AstroLib.jl. License is MIT "Expat". # Copyright (C) 2016 Mosè Giordano. function kepler_solver(_M::Real, e::Real) @assert 0 <= e <= 1 "eccentricity must be in the range [0, 1]" # M must be in the range [-pi, pi], see Markley (1995), page 2. M = rem2pi(_M, RoundNearest) T = flo...
{"hexsha": "c64170410edaf4f82954661722b89151389f9da6", "size": 3477, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/kepler_solver.jl", "max_stars_repo_name": "TobiasHeinicke/AstroLib.jl", "max_stars_repo_head_hexsha": "c3dbc7437dd95d3deb42d23f8d5f6c9cc1abfbe5", "max_stars_repo_licenses": ["MIT"], "max_stars_...
# %% import numpy as np import tensorflow as tf from tensorflow import keras # %% (x_train, y_train), (x_test, y_test) = keras.datasets.mnist.load_data() x_train = x_train.reshape((60000, 28, 28, 1)) / 255 x_test = x_test.reshape((10000, 28, 28, 1)) / 255 n_train = x_train.shape[0] x_train_expanded = np.zeros((5*n_...
{"hexsha": "715edeb3b18546eef7ff7deddc16bf9134d3a3b3", "size": 2387, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/convolutional.py", "max_stars_repo_name": "thinety/neural-networks-and-deep-learning", "max_stars_repo_head_hexsha": "c6485a68b12522f1d1d489a76f68964ecff917ea", "max_stars_repo_licenses": ["MI...
#include "worker.hpp" #include <beasty-tepee/request_header_handler.hpp> #include <boost/asio/io_context_strand.hpp> #include <boost/coroutine2/coroutine.hpp> #include <boost/beast/http/write.hpp> #include <boost/beast/core/span.hpp> namespace tepee::server { worker::worker(boost::asio::io_context& ...
{"hexsha": "677f91692e74564a02f6c89cc4de13b068687a37", "size": 4205, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "src/worker.cpp", "max_stars_repo_name": "syoliver/beasty-tepee", "max_stars_repo_head_hexsha": "64240264ae16885894e1372e1a98176935b5594e", "max_stars_repo_licenses": ["BSL-1.0"], "max_stars_count": ...
// ------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License (MIT). See License.txt in the repo root for license information. // ------------------------------------------------------------ #include "stdafx.h" #include ...
{"hexsha": "e6876c257478cd5a9e3b9333f40d4923d87c9852", "size": 112919, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "src/prod/src/data/tstore/Merge.Test.cpp", "max_stars_repo_name": "vishnuk007/service-fabric", "max_stars_repo_head_hexsha": "d0afdea185ae932cc3c9eacf179692e6fddbc630", "max_stars_repo_licenses": [...
\pagebreak \section*{\underline{Abstract}} This document is an example of one-page abstract for the book of abstracts of the Modelica Conference 2011. The full conference proceedings will be only published electronically on a memory stick and on the Web. However, for the conference attendant's convenience, a smaller ...
{"hexsha": "7a020f9e86358490afad4125a19dacb3ce976731", "size": 2288, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "Chapter/abstract.tex", "max_stars_repo_name": "drwalles/Project-II-Book", "max_stars_repo_head_hexsha": "9ec82150d5151a1159336b0d5ad0a6ca6776e646", "max_stars_repo_licenses": ["MIT"], "max_stars_cou...
#!/usr/bin/env python3 '''Generate a rollout using a random policy. This is useful for getting data to trian the VAE. ''' import argparse import cv2 import json import gym import matplotlib.pyplot as plt import numpy as np import os import torch import settings from PIL import Image from gym.envs.box2d.car_racing im...
{"hexsha": "4d12c2cee730f3bee5faaa8e94f42372467b4697", "size": 4694, "ext": "py", "lang": "Python", "max_stars_repo_path": "dataset/car_racing/rollout.py", "max_stars_repo_name": "prakharsingh95/Model-vs-Model-Free-RL", "max_stars_repo_head_hexsha": "1ddcc54bab66905a44997c48df1d2034c3b8b903", "max_stars_repo_licenses":...
""" Date: 07/11/2020 Author: Carlo Cena Implementation of minmax algorithm with alpha-beta pruning. """ import numpy as np import time from tablut.state.tablut_state import State from tablut.utils.state_utils import MAX_VAL_HEURISTIC from threading import Thread, Lock lock_2 = Lock() #TODO: remove num_state_visited,...
{"hexsha": "f4f992d209a831d7b6d93fdc50b5894f84534736", "size": 13981, "ext": "py", "lang": "Python", "max_stars_repo_path": "tablut/search/min_max_parallel_2.py", "max_stars_repo_name": "carlo98/tablut-THOR", "max_stars_repo_head_hexsha": "b990d49c66735c40afbfa7d26aeec7694a80a729", "max_stars_repo_licenses": ["MIT"], "...
using LinearAlgebra function get_module_3_excersise_4_author_name() return "YOUR NAME HERE" end function problem_4(a) A = [ a 1 0 0 0 1 1 a 1 0 0 0 0 1 a 1 0 0 0 0 1 a 1 0 0 0 0 1 a 1 1 0 0 0 1 a ] eigen_vals = [] eigen_vectors = [] return eigen_vals, eigen_vect...
{"hexsha": "99c8094b3b1c918edcb1c70085a82c9de4975846", "size": 328, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "module3/module-3-exercise-4.jl", "max_stars_repo_name": "j-hayes/chem-324-programming-tutorials", "max_stars_repo_head_hexsha": "ff9a72685a9d1000026941abb1a680fffb927468", "max_stars_repo_licenses":...
import numpy as np import matplotlib.pyplot as plt def step(space): neighbor_count = sum(np.roll(space, (dr, dc), (0, 1)) for dr in (-1,0,1) for dc in (-1,0,1)) - space return ((neighbor_count == 3) | (space & (neighbor_count == 2))).astype(np.int) def show(space): for i in range(space.shape[0]): ...
{"hexsha": "1c69252f3b76b223473e6824d4245ab5434dae34", "size": 883, "ext": "py", "lang": "Python", "max_stars_repo_path": "game_of_life.py", "max_stars_repo_name": "cosmo-jana/numerics-physics-stuff", "max_stars_repo_head_hexsha": "f5fb35c00c84ca713877e20c1d8186e76883cd28", "max_stars_repo_licenses": ["MIT"], "max_star...
import h5py import matplotlib matplotlib.use('Agg') from matplotlib import pyplot as plt import keras import h5py import numpy as np from keras.layers import Input, Dense, Conv1D, MaxPooling2D, MaxPooling1D, BatchNormalization from keras.layers.core import Dropout, Activation, Flatten from keras.layers.merge import...
{"hexsha": "7e1402108bb7de514c010b6024727269126e3752", "size": 4364, "ext": "py", "lang": "Python", "max_stars_repo_path": "dcnn/Basset/Basset/basset.py", "max_stars_repo_name": "wzthu/NeuronMotif", "max_stars_repo_head_hexsha": "0f7f786e4b75916039388824d04d2041747fd299", "max_stars_repo_licenses": ["MIT"], "max_stars_...
import numpy as np # Generate a random Latin Hypercube Design (LHD) def rLHD(nrows,ncols,unit_cube=False): """ Generate a random Latin Hypercube Design (LHD) Args: nrows (int): A positive integer specifying the number of rows ncols (int): A postive integer specifying the number of columns unit_...
{"hexsha": "44f77b7ff3577b686be7967dc9000beb047b6c89", "size": 1882, "ext": "py", "lang": "Python", "max_stars_repo_path": "pyLHD/base_designs.py", "max_stars_repo_name": "toledo60/pyLHD", "max_stars_repo_head_hexsha": "40df7f2015e06e9e1190cce49c68f17068b86070", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1,...
# MIT License - Copyright Petri Laarne and contributors # See the LICENSE.md file included in this source code package """A simplified version of the case study in the documentation.""" from __future__ import annotations from ennemi import estimate_mi, pairwise_mi import numpy as np import pandas as pd import unittes...
{"hexsha": "a1493d6097216bbc63d9b726e80264e7a7ecedfb", "size": 3131, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/pandas/test_pandas_workflow.py", "max_stars_repo_name": "polsys/ennemi", "max_stars_repo_head_hexsha": "2c3fe839cb2f416e9f7132fd38277ab97f7c53a0", "max_stars_repo_licenses": ["MIT"], "max_st...
import json, logging, pickle, os, sys, time from shapely import geometry from pulp import * import pandas as pd import geopandas as gpd import numpy as np from geopy.distance import geodesic import matplotlib.pyplot as plt import matplotlib.lines as mlines tic = time.time() from shapely.strtree import STRtree im...
{"hexsha": "2a437c8daf51b86cd3231d80bc80ba2be120b8f8", "size": 11638, "ext": "py", "lang": "Python", "max_stars_repo_path": "solarpv/analysis/matching/match_region.py", "max_stars_repo_name": "shivareddyiirs/solar-pv-global-inventory", "max_stars_repo_head_hexsha": "9940a454de88a39ca92dbabf07e98d8623f0ec8b", "max_stars...
#!/usr/bin/env python3 # Written by Christopher Hempel (hempelc@uoguelph.ca) on 22 Jul 2021 # This script processes the output from the script "metrics_generation.py" and # determines the Euclidean distance of pipelines to the reference mock community, # the correaltion between Euclidean distance and tools, and clust...
{"hexsha": "54b46704c7e40c6659406f8074405b695c9130dc", "size": 13061, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/statistics/eucdist_correlation_clustering_metrics.py", "max_stars_repo_name": "hempelc/metagenomics-vs-totalRNASeq", "max_stars_repo_head_hexsha": "ff2c70351f09654455be056fb0edefc1f0b0f3c...
module Writer export write_pddl, write_domain, write_problem export save_domain, save_problem using Julog using ..PDDL: IMPLIED_REQUIREMENTS, Domain, Problem, Action, get_name, get_requirements, get_typetree, get_constants, get_constypes, get_predicates, get_functions, get_actions, get_axioms, get_dom...
{"hexsha": "09eec86675a5b181bba8bc5880c90acd5be264a5", "size": 8597, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/writer/writer.jl", "max_stars_repo_name": "Leticia-maria/PDDL.jl", "max_stars_repo_head_hexsha": "f462be51f94c6f97b1ba70c992987094116b0cdb", "max_stars_repo_licenses": ["Apache-2.0"], "max_star...
import pytest import numpy as np import os, sys os.path.join(os.path.dirname(os.path.abspath(__file__)),'../../..') from tests.embeddings_pipelines.model.test_models import AbstractTestMultipleWordsEmbeddingModel sys.path.append( os.path.join(os.path.dirname(os.path.abspath(__file__)),'../../../src') ) from embeddings_...
{"hexsha": "49d020eadee94fbae7347879418b5d088b88a438", "size": 1022, "ext": "py", "lang": "Python", "max_stars_repo_path": "playground/oliver_ilnicki/embeddings_pipelines/tests/embeddings_pipelines/models/test_multiple_words_embedding_models.py", "max_stars_repo_name": "toedtli/rg_text_to_sound", "max_stars_repo_head_h...
#!/usr/bin/env python3 import csv import numpy as np def main(): with open('../data/abbreviations.csv', 'r') as read_csv: reader = csv.reader(read_csv, delimiter=' ') abbreviations = [] for line in reader: abbreviations.append(line[0]) read_csv.close() with open('../dat...
{"hexsha": "ae3770e3e9ed4dc9281901507f3c67418d8f94c3", "size": 1319, "ext": "py", "lang": "Python", "max_stars_repo_path": "bin/feature_generator.py", "max_stars_repo_name": "michaelneuder/plant_clustering", "max_stars_repo_head_hexsha": "38a32f800b4a6dafaa2c40dbce6333fc6db3a1fa", "max_stars_repo_licenses": ["MIT"], "m...
function new_PreequilibriumData(projBaryons, projProtons, & & targBaryons, targProtons, kinEnergyMeV, & & clientFissBarr, clientIO) & & result(preeqData) ! ====================================================================== ! ! Constructor for the PreequilibriumData class. ! ! USE: ! pree...
{"hexsha": "92bf333aac27ded71a0b1c2133e8f19839b28c50", "size": 3924, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "src/Preequilibrium/ModelData/new_PreequilibriumDataClass.f90", "max_stars_repo_name": "lanl/generalized-spallation-model", "max_stars_repo_head_hexsha": "4a2f01a873d2e8f2304b8fd1474d43d1ce8d744d...
from unittest import TestCase from unittest.mock import Mock, create_autospec import numpy as np import pandas as pd from acnportal.acnsim import Simulator from acnportal.acnsim.network import ChargingNetwork from acnportal.algorithms import BaseAlgorithm from acnportal.acnsim.events import EventQueue, Event from dat...
{"hexsha": "856eb04f856c4dd73be35a05100c075f0020e98c", "size": 2919, "ext": "py", "lang": "Python", "max_stars_repo_path": "acnportal/acnsim/tests/test_simulator.py", "max_stars_repo_name": "irasus-technologies/acnportal", "max_stars_repo_head_hexsha": "f6ac7b9ddb28ab48177c51a676f1619e88ea91e0", "max_stars_repo_license...
# Utilities ## repeat each element in a vector function repeach{T}(x::AbstractVector{T}, n::Integer) k = length(x) r = Array(T, k * n) p = 0 @inbounds for i = 1:k xi = x[i] for j = 1:n r[p += 1] = xi end end return r end function repeach{T}(x::AbstractVect...
{"hexsha": "eb7cb17b92fac53ac29d30aff77204ac49ed3cc5", "size": 2438, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/utils.jl", "max_stars_repo_name": "yuehhua/MLBase.jl", "max_stars_repo_head_hexsha": "438a2cbbfc6d3071d113c3e9703adc4fb86cb84c", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "ma...
import os import pickle import cv2 import numpy as np import open3d as o3d # import pyrealsense2 as rs2 import config def load_kntcalibmat(amat_path=os.path.join(config.ROOT, "./camcalib/data/"), f_name="knt_calibmat.pkl"): amat = pickle.load(open(amat_path + f_name, "rb")) return amat def map_depth2pcd(d...
{"hexsha": "c560f92f07324af10d03eeb7cae9630342a41905", "size": 3213, "ext": "py", "lang": "Python", "max_stars_repo_path": "0000_students_work/2021tro/gaussian_surface_bug/vision_utils.py", "max_stars_repo_name": "takuya-ki/wrs", "max_stars_repo_head_hexsha": "f6e1009b94332504042fbde9b39323410394ecde", "max_stars_repo_...
import numpy as np class Casino: """ Occasionally dishonest casino from Machine Learning: A Probabilistic Perspective, Chapter 17. """ Z_HONEST = 0 Z_DISHONEST = 1 A = np.array([ [0.95, 0.05], [0.1, 0.9] ]) PX = np.array([ [1/6, 1/6, 1/6, 1/6, 1/6, 1/6], ...
{"hexsha": "8496daae82b0750aec20ba97bf5448b44ebfe1fc", "size": 923, "ext": "py", "lang": "Python", "max_stars_repo_path": "hmm/casino.py", "max_stars_repo_name": "ondrejba/hmm", "max_stars_repo_head_hexsha": "1e9fe47a6057d93e7c77614016a89d5d46959e97", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_st...
\documentclass[12pt]{article} \newcommand{\VERSION}{1.8.0} \usepackage[utf8]{inputenc} \usepackage[english]{babel} \usepackage{csquotes} \usepackage{xcolor} \usepackage{listings, lstautogobble} \usepackage{booktabs} \setlength{\heavyrulewidth}{1.5pt} \setlength{\abovetopsep}{4pt} \lstset{language=bash, keywordst...
{"hexsha": "97f0b228043362a04795ade82cd54e0a85af8b34", "size": 16940, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "doc/tex/DTarray_pro-Userguide.tex", "max_stars_repo_name": "ajmaurais/DTarray_pro", "max_stars_repo_head_hexsha": "5601660b43ccfa4e46e4a3c503eb251f062d34b4", "max_stars_repo_licenses": ["MIT"], "ma...
"""Pumps Module: This module calculates and produces pump curves based on mfg's data points """ from __future__ import print_function, division import matplotlib.pyplot as plt from numpy import linspace, any, interp, array import sqlite3 from os import path BASE_DIR = path.dirname(path.abspath(__file__)) db_path ...
{"hexsha": "0faa2afd9fb2d72894a2fec60004715fc9dfc29f", "size": 17093, "ext": "py", "lang": "Python", "max_stars_repo_path": "Water/pumps.py", "max_stars_repo_name": "hasemar/water", "max_stars_repo_head_hexsha": "b8cac349f4bf86be50ac29ae8c31a2fe74d71acf", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "ma...
from . import zernike #from .test.multiproc import MultiprocPipeline from mindboggle.mio.vtks import read_vtk import numpy as np import argparse import logging #import profilehooks def example1(): # >>> # Example 1: simple cube (decimation results in a Segmentation Fault): # >>> from mindboggle.shapes.z...
{"hexsha": "21165cfb23be805ee74ce7929a5c19ba63605408", "size": 2830, "ext": "py", "lang": "Python", "max_stars_repo_path": "mindboggle/shapes/zernike/__main__.py", "max_stars_repo_name": "cemlyn007/mindboggle", "max_stars_repo_head_hexsha": "947d4b3f41fb7a24c079550c7255c4d16939d740", "max_stars_repo_licenses": ["CC-BY-...
(* Title: HOL/Auth/n_germanSymIndex_lemma_on_inv__45.thy Author: Yongjian Li and Kaiqiang Duan, State Key Lab of Computer Science, Institute of Software, Chinese Academy of Sciences Copyright 2016 State Key Lab of Computer Science, Institute of Software, Chinese Academy of Sciences *) header{*The ...
{"author": "lyj238Gmail", "repo": "newParaVerifier", "sha": "5c2d49bf8e6c46c60efa53c98b0ba5c577d59618", "save_path": "github-repos/isabelle/lyj238Gmail-newParaVerifier", "path": "github-repos/isabelle/lyj238Gmail-newParaVerifier/newParaVerifier-5c2d49bf8e6c46c60efa53c98b0ba5c577d59618/examples/n_germanSymIndex/n_german...
import numpy as np import plotly.graph_objects as go from pathlib import Path from src.utils.cmd_parser import parsing_params # Tested wave files # Path("data/a0e55.csv") # Path("data/a0e45_a-90e3.csv") # Path("data/a0e45_a270e3_a90e42.csv") class PlotlySphere: def __init__(self, r=1): self.r = r ...
{"hexsha": "a9d5146729ab92be4afef1498da9ee1ea3c04dc4", "size": 5160, "ext": "py", "lang": "Python", "max_stars_repo_path": "srp_visualizer.py", "max_stars_repo_name": "BrownsugarZeer/Multi_SSL", "max_stars_repo_head_hexsha": "f0ce429d95680e4eb56d99f04a4bbccf33c27cc9", "max_stars_repo_licenses": ["MIT"], "max_stars_coun...
#!/usr/bin/python # -*- coding: latin-1 -*- """ Cameras produce the initial ray from the camera position through the currently rendered pixel and into the scene. .. moduleauthor:: Adrian Köring """ import numpy as np from padvinder.ray import Ray from padvinder.util import normalize from padvinder.util import check_...
{"hexsha": "6670e5ea54d979b0cc793cdec5acf00483d6ab72", "size": 10211, "ext": "py", "lang": "Python", "max_stars_repo_path": "padvinder/camera.py", "max_stars_repo_name": "adriankoering/padvinder", "max_stars_repo_head_hexsha": "eaebd80867f22c8ca8cc3b97bf0b726f408d928a", "max_stars_repo_licenses": ["MIT"], "max_stars_co...
import numpy as np from math import log, pow from scipy.stats import entropy class level: def __init__(self, start, end, depth): self.start = start self.end = end self.depth = depth def MDLPDiscretize(col, y, min_depth): """Performs MDLP discretization on X and y""" order = np.ar...
{"hexsha": "b08924b6aa24fb94c8268bc5a88ce4d1fb65205f", "size": 4136, "ext": "py", "lang": "Python", "max_stars_repo_path": "mdlp/_mdlp.py", "max_stars_repo_name": "Lean-Y/mdlp-discretization", "max_stars_repo_head_hexsha": "9b9b151eeb1c5a69e4e0e150c415aff6d217e9b1", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_sta...
/* * fixp.hpp * * Created on: 03.01.2016 * Author: Marius */ #ifndef IT_FIXP_FIXP_HPP_ #define IT_FIXP_FIXP_HPP_ #include <boost/container/flat_map.hpp> #include <array> #include <typeinfo> #include <typeindex> namespace fixp { class security_id_source_isin_number { public: constexpr char value='4'; }; ...
{"hexsha": "3b635457f113a515a417577f9aced9bec92df0ae", "size": 1130, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "fixp/fixp.hpp", "max_stars_repo_name": "mdobrea/effective-fix", "max_stars_repo_head_hexsha": "0dc8013a8470366f99281f191ea4379d59ef761a", "max_stars_repo_licenses": ["BSD-2-Clause"], "max_stars_coun...
!----------------------------------------------------------------------- ! Interface file for kncmbpush3.c module kncmbpush3_h implicit none ! interface subroutine ckncgbppush3lt(ppart,fxyz,bxyz,kpic,qbm,dt,dtc,ek, & &idimp,nppmx,nx,ny,nz,mx,my,mz,nxv,nyv,nzv,mx1,my1,mxyz1,ipbc) ...
{"hexsha": "0a54ee5a1be78247bc32d68884755abc176963c3", "size": 12977, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "vectorization/vbpic3/kncmbpush3_h.f90", "max_stars_repo_name": "gcasabona/cuda", "max_stars_repo_head_hexsha": "064cfa02398e2402c113d45153d7ba36ae930f7e", "max_stars_repo_licenses": ["W3C"], "m...
#!/usr/bin/env python import ctypes import datetime from time import sleep import cv2 import numpy as np import sounddevice as sd from pydub import AudioSegment from pydub.silence import detect_nonsilent from scipy.io import loadmat, wavfile import csv """ ~~~~~~~~~~~~~ TUNABLE PARAMETERS ~~~~~~~~~...
{"hexsha": "915e287cbc8ce1b57d4eb965967c2f125b42d9f3", "size": 8516, "ext": "py", "lang": "Python", "max_stars_repo_path": "color_reaction.py", "max_stars_repo_name": "NickPulsone/colors_test_with_reatction", "max_stars_repo_head_hexsha": "7698f2f126fc3d99d47c049adba5062a08ec4cac", "max_stars_repo_licenses": ["MIT"], "...
### Day 23 ## Safe Cracking ## Author: Thanasis Georgiou workspace() # Convert anything to integer int(any) = parse(Int, any) # Type union of String and Int to use in instructions IntOrString = Union{Int, String} # Instruction struct immutable Instruction opcode::String args::Array{IntOrString} end # A CPU with...
{"hexsha": "a0f10d3d3713eee5d33f0dc67579088608ea4f81", "size": 3775, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/day-23.jl", "max_stars_repo_name": "sakisds/AoC-2016", "max_stars_repo_head_hexsha": "626ace2c5945daa3a5e4a7a980aae04469da3e76", "max_stars_repo_licenses": ["Unlicense"], "max_stars_count": 1, ...
from typing import Tuple, Union import numpy as np from ...utils.translations import trans from ._text_constants import Anchor def get_text_anchors( view_data: Union[np.ndarray, list], ndisplay: int, anchor: Anchor = Anchor.CENTER, ) -> np.ndarray: # Explicitly convert to an Anchor so that string va...
{"hexsha": "2604f371945032e212db933e466a33f53decb810", "size": 4808, "ext": "py", "lang": "Python", "max_stars_repo_path": "napari/layers/utils/_text_utils.py", "max_stars_repo_name": "jojoelfe/napari", "max_stars_repo_head_hexsha": "b52a136dad392c091b0008c0b8d7fcc5ef460f66", "max_stars_repo_licenses": ["BSD-3-Clause"]...
import numpy as np import pandas as pd import random as rd import matplotlib.pyplot as plt import seaborn as sns import random from math import log, gamma from scipy.stats import expon, weibull_min import os,sys from datetime import datetime import nMGA as gil_nMGA import REGIR as gil_REGIR """ ---------------------...
{"hexsha": "c646594b0d8de79cf36eea176da1b76605636ebd", "size": 7884, "ext": "py", "lang": "Python", "max_stars_repo_path": "REGIR/Benchmarking/Benchmarking_speed (Fig.1B).py", "max_stars_repo_name": "Aurelien-Pelissier/REGIR", "max_stars_repo_head_hexsha": "2420de16526d0aa318dee560341f6c7e850161a8", "max_stars_repo_lic...
program cstexp c To check that max0 parameter (i=1, j=2*i, k = max0(i,j)) real a(i), b(j), c(k) print *, a(i) l = k print *,l end
{"hexsha": "0d7e44d865432259ee436867d145146f7aff2d6a", "size": 180, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "packages/PIPS/validation/Syntax/cstexp.f", "max_stars_repo_name": "DVSR1966/par4all", "max_stars_repo_head_hexsha": "86b33ca9da736e832b568c5637a2381f360f1996", "max_stars_repo_licenses": ["MIT"], "...
import functools from operator import mul import unittest import numpy import six import chainer from chainer.backends import cuda from chainer import functions from chainer import testing from chainer.testing import attr from chainer.utils import conv from chainer_tests.functions_tests.pooling_tests import pooling_n...
{"hexsha": "906a71b75a7ae69c80425af2d54b2babbb57abd8", "size": 7481, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/chainer_tests/functions_tests/pooling_tests/test_max_pooling_nd.py", "max_stars_repo_name": "zjzh/chainer", "max_stars_repo_head_hexsha": "e9da1423255c58c37be9733f51b158aa9b39dc93", "max_sta...
# -*- coding: utf-8 -*- """HDF5 input and output.""" #------------------------------------------------------------------------------ # Imports #------------------------------------------------------------------------------ import logging import numpy as np import h5py from six import string_types logger = logging....
{"hexsha": "bd0bd3729bd05839aac6821f7be897840473bada", "size": 10912, "ext": "py", "lang": "Python", "max_stars_repo_path": "klusta/kwik/h5.py", "max_stars_repo_name": "hrnciar/klusta", "max_stars_repo_head_hexsha": "408e898e8d5dd1788841d1f682e51d0dc003a296", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_coun...