text
stringlengths
0
1.25M
meta
stringlengths
47
1.89k
import os import pymysql.cursors from pprint import pprint from sklearn.tree import DecisionTreeClassifier, export_graphviz from sklearn.feature_extraction import DictVectorizer from sklearn.model_selection import train_test_split import graphviz from numpy import shape from sklearn.metrics import accuracy_score from s...
{"hexsha": "0f05dbf657f4c9fd6ee5ec0c8368a0c8123a421b", "size": 2946, "ext": "py", "lang": "Python", "max_stars_repo_path": "classification/classification.py", "max_stars_repo_name": "bcso/bkf356", "max_stars_repo_head_hexsha": "c350c97e1aa515b2b2411eafd38a6b74e06d02d3", "max_stars_repo_licenses": ["Apache-2.0"], "max_s...
""" complex.py ---------- Cell complex from planar primitive arrangement. A linear cell complex is constructed from planar primitives with adaptive binary space partitioning: upon insertion of a primitive only the local cells that are intersecting it will be updated, so will be the corresponding adjacency graph of th...
{"hexsha": "56fd68ad23463be5314cc14255a08ac793acee9d", "size": 28735, "ext": "py", "lang": "Python", "max_stars_repo_path": "abspy/complex.py", "max_stars_repo_name": "chenzhaiyu/abspy", "max_stars_repo_head_hexsha": "c03d26e4ddb81d17467573ca2f399a9cb608a4be", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 5, "...
import numpy as np from scipy.spatial.distance import cdist class KMeans: def __init__( self, k: int, metric: str = "euclidean", tol: float = 1e-6, max_iter: int = 100): """ inputs: k: int the number of centroid...
{"hexsha": "12bb2af418ddc4d07119f7d29621ee5a6b995f1b", "size": 8438, "ext": "py", "lang": "Python", "max_stars_repo_path": "cluster/kmeans.py", "max_stars_repo_name": "gramey02/project5", "max_stars_repo_head_hexsha": "445c683f87984de3f2f697f67339c2bc9d675188", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nul...
import pandas as pd from scipy import sparse import copy from rdkit import Chem from rdkit.Chem import SaltRemover from rdkit.Chem import Descriptors import tqdm import numpy as np interaction_data = pd.read_csv('raw_data/interaction_data_pchembl.csv') interaction_data=interaction_data.rename(columns = {'chembl_id.1...
{"hexsha": "324eb066788e1777325c68ee1dde07563beb4da4", "size": 3267, "ext": "py", "lang": "Python", "max_stars_repo_path": "code/raw_data/parse_interactions.py", "max_stars_repo_name": "ljmartin/fp_generalizability", "max_stars_repo_head_hexsha": "091a34a6f19f68cc6245345083dc4c15fcbbcbfc", "max_stars_repo_licenses": ["...
import numpy as np import scipy class metrics: def __init__(self, ref, sat): self.N = len(sat) self.ref = ref self.diff = sat - ref self.difflog = np.log10(sat) - np.log10(ref) self.rmse = self._rmse() self.rmse_log = self._rmse_log() self.bias = self._bia...
{"hexsha": "8dba05a1af5cd58fd57a622f45310a4a075e42ba", "size": 1797, "ext": "py", "lang": "Python", "max_stars_repo_path": "satmatchup/metrics.py", "max_stars_repo_name": "Tristanovsk/satmatchup", "max_stars_repo_head_hexsha": "1702229b49f2c83badf69e3a2bb8b12376132b84", "max_stars_repo_licenses": ["MIT"], "max_stars_co...
# -*- coding: utf-8 -*- import os.path as osp from collections import Iterable import numpy as np META_TOKEN = "__virtual_meta" def valid_tile_size(shape, tile_size): if isinstance(tile_size, Iterable): assert len(tile_size) == len(shape), \ "tile_size and shape must have same dimension" ...
{"hexsha": "8d7b0a4591752c6c0d6cf7159add040c908815e3", "size": 6807, "ext": "py", "lang": "Python", "max_stars_repo_path": "zqy_utils/virtual_data.py", "max_stars_repo_name": "qianyizhang/zqy-utils", "max_stars_repo_head_hexsha": "2bbd1c6b3372814227a1e9061f34a0eae100b860", "max_stars_repo_licenses": ["MIT"], "max_stars...
[STATEMENT] lemma relation_of_Var: "relation_of (Var v A) = ((R(true \<turnstile> (\<lambda> (A, A'). \<exists> a. tr A' = tr A \<and> \<not>wait A' \<and> more A' = (increase v a (more A)))));; (relation_of A;; (R(true \<turnstile> (\<lambda> (A, A'). tr A' = tr A \<and> \<not>wait A' \<and> more A' =...
{"llama_tokens": 806, "file": "Circus_Denotational_Semantics", "length": 4}
import serial import time import re import numpy as np import sys from PyQt5.QtWidgets import QApplication, QWidget, QLabel, QGridLayout, QPushButton import PyQt5 import yaml import os # from PyQt5.QtCore.Qt import AlignHCenter from functools import partial from frgpascal.hardware.helpers import get_port MODULE_DIR ...
{"hexsha": "f11a10ab5a58a353f76a84ef6bda2c977f9958fd", "size": 16371, "ext": "py", "lang": "Python", "max_stars_repo_path": "frgpascal/hardware/gantry.py", "max_stars_repo_name": "fenning-research-group/PASCAL", "max_stars_repo_head_hexsha": "c175e60ec2015ac8dce1ed3ae037619072d48cea", "max_stars_repo_licenses": ["MIT"]...
# Dijkstra path planning. # This algorithm is named after Edsger W. Dijkstra, 1930-2002. # See: http://en.wikipedia.org/wiki/Edsger_W._Dijkstra. # # Make sure you have installed all the required libraries (see the extra # document with the installation instructions). # # First version: most simple implementation...
{"hexsha": "fbe9dc8ebe92b981cd708f4bb1e5be6063689ea1", "size": 5119, "ext": "py", "lang": "Python", "max_stars_repo_path": "SLAM_Lectures/Unit_PP/pp_01_a_dijkstra_question.py", "max_stars_repo_name": "yubaoliu/AISLAM", "max_stars_repo_head_hexsha": "b12bba78b17ca61253ee0584927e3efaaa3d13d8", "max_stars_repo_licenses": ...
##CHAPTER 4 library(modreg) aux <- read.table("Data/Sr.dat") x <- aux[,1]; y <- aux[,2] postscript("Plots/plot-04-01.ps",horizontal=T) plot(x,y,xlab="Time in millions of years", ylab="Strontium ratios") abline(v=66.4) dev.off() pen <- c(0.1,.5,1,1.5) postscript("Plots/plot-04-02.ps",horizontal=F) par(mfrow=c(2,2)) sa...
{"hexsha": "e8605b86e1f21f77d7baf7384a9572d8c314e2df", "size": 561, "ext": "r", "lang": "R", "max_stars_repo_path": "pages/754/code-04.r", "max_stars_repo_name": "igrabski/rafalab.github.io", "max_stars_repo_head_hexsha": "2f27ea0d9e0b8a2342bb851ae7415ba3268fd00f", "max_stars_repo_licenses": ["MIT"], "max_stars_count":...
// // detail/chrono.hpp // ~~~~~~~~~~~~~~~~~ // // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // #ifndef BOOST_ASIO_DETAIL_CHRONO_...
{"hexsha": "7804866f31fc1e7a2c92d95f1e4aeb0338943001", "size": 2126, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "lslboost/boost/asio/detail/chrono.hpp", "max_stars_repo_name": "samuelpowell/liblsl", "max_stars_repo_head_hexsha": "92f0e2f4870cd9b505cd35c89f70c7a9d3b191a3", "max_stars_repo_licenses": ["MIT"], "m...
From fae_gtlc_mu.refinements.static_gradual Require Export compat_cast.defs. From fae_gtlc_mu.backtranslation Require Export general_def_lemmas. From fae_gtlc_mu.cast_calculus Require Export lang. Section compat_cast_arrow_arrow. Context `{!implG Σ,!specG Σ}. (** The case `throughArrow` in our proof by induction ...
{"author": "scaup", "repo": "fae-gtlc-mu", "sha": "6c6e64f0844327d55059b97c7aefab023385973e", "save_path": "github-repos/coq/scaup-fae-gtlc-mu", "path": "github-repos/coq/scaup-fae-gtlc-mu/fae-gtlc-mu-6c6e64f0844327d55059b97c7aefab023385973e/theories/refinements/static_gradual/compat_cast/arrow_arrow.v"}
from hklearn_genetic.genetic_algorithm import GeneticAlgorithm from hklearn_genetic.problem import BinaryRastrigin, BinaryBeale, BinaryHimmelblau, BinaryEggholder, RealRastrigin, RealBeale, RealHimmelblau, RealEggholder from hklearn_genetic.pso import pso, RealRastriginPSO, RealBealePSO, RealHimmelblauPSO, RealEggholde...
{"hexsha": "22e0625adda145561091e049cace7703b972f79a", "size": 6344, "ext": "py", "lang": "Python", "max_stars_repo_path": "pso_tests.py", "max_stars_repo_name": "leguiart/Evolutionary_Computing", "max_stars_repo_head_hexsha": "67dc2d8e284ea4b9d21af10793778b942708114b", "max_stars_repo_licenses": ["MIT"], "max_stars_co...
[STATEMENT] lemma AQ_D: assumes "v \<in> lang n (Atom (AQ m a))" "m < n" "a \<in> set \<Sigma>" shows "\<exists>x. v = [x] \<and> fst x = a \<and> snd x ! m" [PROOF STATE] proof (prove) goal (1 subgoal): 1. \<exists>x. v = [x] \<and> fst x = a \<and> snd x ! m [PROOF STEP] using assms [PROOF STATE] proof (prove) u...
{"llama_tokens": 232, "file": "MSO_Regex_Equivalence_Formula", "length": 2}
from typing import List import numpy from rl.action import DiscreteAction class DiscreteActionFeatures(dict): """ A dict-like class that assigns a featurized representation to every action. Keys are actions and values are numpy arrays """ def values(self) -> List[numpy.ndarray]: return l...
{"hexsha": "3a76e405b80df6fcb4706526ffeedf95f1c5c6ac", "size": 1300, "ext": "py", "lang": "Python", "max_stars_repo_path": "rl/action/action_features.py", "max_stars_repo_name": "tomasruizt/Reinforcement-Learning", "max_stars_repo_head_hexsha": "b8a01b08c1086da3c972846d3b038e233189103f", "max_stars_repo_licenses": ["Ap...
import hashlib import matplotlib.mlab as mlab import numpy as np import lib.helpers.wavio from lib.helpers.peaks import get_2D_peaks IDX_FREQ_I = 0 IDX_TIME_J = 1 ###################################################################### # Thresholds on how close or far fingerprints can be in time in order # to be paire...
{"hexsha": "7eabd1115de5b168db03e30e5bed0b52d4ea5d8a", "size": 3945, "ext": "py", "lang": "Python", "max_stars_repo_path": "lib/fingerprinting.py", "max_stars_repo_name": "allatrack/audio-search-engine", "max_stars_repo_head_hexsha": "94900c26b1d4f6b9d070cc78d26cff3f6bad5d44", "max_stars_repo_licenses": ["MIT"], "max_s...
import pytest import numpy as np import torch import torchgeometry as tgm from torch.autograd import gradcheck from torch.testing import assert_allclose import utils # test utils from utils import check_equal_torch, check_equal_numpy from common import device_type # based on: # https://github.com/ceres-solver/cere...
{"hexsha": "386de40a8705af7c27e09b6fa84aaefeb6cd96ab", "size": 9942, "ext": "py", "lang": "Python", "max_stars_repo_path": "test/test_conversions.py", "max_stars_repo_name": "tina300399/torchgeometry", "max_stars_repo_head_hexsha": "48d8026f0a5f3d4ac5567b7b2738390892b3cc8d", "max_stars_repo_licenses": ["Apache-2.0"], "...
import numpy as np import pandas as pd from sklearn.linear_model import LogisticRegression from sklearn.multiclass import OneVsOneClassifier from sklearn.ensemble import RandomForestClassifier from sklearn.tree import DecisionTreeClassifier from sklearn.metrics import accuracy_score from sklearn.model_selection import...
{"hexsha": "963fdf26144e9bbc569f152e041a7b715ef53561", "size": 3585, "ext": "py", "lang": "Python", "max_stars_repo_path": "kaggle/ghouls-goblins-and-ghosts-boo/script_20.py", "max_stars_repo_name": "josepablocam/janus-public", "max_stars_repo_head_hexsha": "4713092b27d02386bdb408213d8edc0dc5859eec", "max_stars_repo_li...
import numpy as np from PIL import Image def transform_format(val): if val == 0: return 255 else: return val #image for mask image = np.array(Image.open(".png")) transformed_image_mask = np.ndarray((image.shape[0],image.shape[1]), np.int32) for i in range(len(brasil)): transformed_bras...
{"hexsha": "e0dcb56544b2ebf52fe5b8568014410207975c60", "size": 414, "ext": "py", "lang": "Python", "max_stars_repo_path": "image.py", "max_stars_repo_name": "ferNoronha/twitterWordCloud", "max_stars_repo_head_hexsha": "549a228aad76135dabbccf59d880d36a8fbcde10", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, ...
/* Siconos is a program dedicated to modeling, simulation and control * of non smooth dynamical systems. * * Copyright 2020 INRIA. * * 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 * *...
{"hexsha": "31d182c09a19d4811ab009e94750bb9f5109609d", "size": 17199, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "kernel/src/utils/SiconosAlgebra/SimpleMatrixBLAS3.cpp", "max_stars_repo_name": "fperignon/sandbox", "max_stars_repo_head_hexsha": "649f09d6db7bbd84c2418de74eb9453c0131f070", "max_stars_repo_license...
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import numpy as np from ax.core.arm import Arm from ax.core.generator_run import GeneratorRun from ax.core.objective im...
{"hexsha": "52bb680e555ad66f529130583205668c945ecf7f", "size": 5836, "ext": "py", "lang": "Python", "max_stars_repo_path": "ax/service/tests/test_best_point_utils.py", "max_stars_repo_name": "facebook/Ax", "max_stars_repo_head_hexsha": "4929a2e93e92d31c61c29974610d363df361bafb", "max_stars_repo_licenses": ["MIT"], "max...
import time import numpy as np import tensorflow as tf #import matplotlib.pyplot as plt #from alexnet import * #from vgg16net_rcnn import Vgg16Net_RCNN #from vgg16net_ssd import Vgg16Net_SSD #from vgg16_ctpn_crnn_ctc import Vgg16_CTPN_CRNN_CTC #from resnet50_dssd_leye import Resnet50_DSSD_LEYE #from resnet101_fcis impo...
{"hexsha": "2c37220dace49a606406803ae185aafbef9564ae", "size": 2562, "ext": "py", "lang": "Python", "max_stars_repo_path": "test1.py", "max_stars_repo_name": "czyczyyzc/MyMaskRCNN", "max_stars_repo_head_hexsha": "e5a451fd05c593ae05d6e596813fc63aad7af2de", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, "max_s...
from itertools import groupby, count import scipy.io as sio import numpy as np from .timedautomata import timed_automaton @timed_automaton class TA: """ Base function for abstracting TA's. Is decorated as a TA """ def __init__(self, abstraction, *args, **kwargs): super().__init__() if ...
{"hexsha": "81ec8f4583420e25d775768bb450837b62557181", "size": 7204, "ext": "py", "lang": "Python", "max_stars_repo_path": "tga_models/ta/abstractions.py", "max_stars_repo_name": "asamant/masters-thesis-sched-strat", "max_stars_repo_head_hexsha": "25382b935bde1b249afe18cf48fe9ff3ed855323", "max_stars_repo_licenses": ["...
[STATEMENT] lemma "x\<^sup>\<star> = x \<longleftrightarrow> x = 1 + x \<cdot> x" [PROOF STATE] proof (prove) goal (1 subgoal): 1. (x\<^sup>\<star> = x) = (x = (1::'a) + x \<cdot> x) [PROOF STEP] (*nitpick [expect=genuine]*) [PROOF STATE] proof (prove) goal (1 subgoal): 1. (x\<^sup>\<star> = x) = (x = (1::'a) + x \<c...
{"llama_tokens": 164, "file": "Kleene_Algebra_Kleene_Algebra", "length": 2}
import numpy as np from aiclust.core.Kohonen_layer import * class KohonenNetwork(KohonenLayer): def fit(self, X, max_iter=10, alpha=1): '''[summary] Arguments: X {[type]} -- [description] Keyword Arguments: max_iter {int} -- [description] (default: {10}) ...
{"hexsha": "a3063b2992584867fb8e4e7b047b511cd64b9836", "size": 1016, "ext": "py", "lang": "Python", "max_stars_repo_path": "pynnclust/KohonenNetwork.py", "max_stars_repo_name": "MedvedevDenis/aiclust", "max_stars_repo_head_hexsha": "f32b0ec621ea0eb985d01c28dd58fa3f2d32bbb4", "max_stars_repo_licenses": ["MIT"], "max_sta...
-makelib ies_lib/xilinx_vip -sv \ "C:/Xilinx/Vivado/2020.1/data/xilinx_vip/hdl/axi4stream_vip_axi4streampc.sv" \ "C:/Xilinx/Vivado/2020.1/data/xilinx_vip/hdl/axi_vip_axi4pc.sv" \ "C:/Xilinx/Vivado/2020.1/data/xilinx_vip/hdl/xil_common_vip_pkg.sv" \ "C:/Xilinx/Vivado/2020.1/data/xilinx_vip/hdl/axi4stream_vip_pkg...
{"hexsha": "c40ef1945adfeb8a8d68693014425f510dbe56f9", "size": 5649, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "LBlock/LblockCipher.ip_user_files/sim_scripts/design_1/ies/run.f", "max_stars_repo_name": "jedla97/HW-encoder-for-lightweigth-cryptography", "max_stars_repo_head_hexsha": "b45f296657e2e6d266cf2ea6...
import pandas as pd import numpy as np import matplotlib.pyplot as plt import matplotlib from xgboost import XGBClassifier from sklearn.model_selection import train_test_split, GridSearchCV, StratifiedKFold from sklearn.metrics import accuracy_score from sklearn.neural_network import MLPClassifier from sklearn.preproce...
{"hexsha": "cf9bfcf626249e5d6e775988e12e372b0c066135", "size": 4446, "ext": "py", "lang": "Python", "max_stars_repo_path": "5_Misc/t-sne/tsne_only_tensorboard.py", "max_stars_repo_name": "yoonsikp/cnv-pathogenicity-prediction", "max_stars_repo_head_hexsha": "5ae82c0f4f56bba3d7abbcd32199e434a937b7ec", "max_stars_repo_li...
# -*- coding: utf-8 -*- # Copyright (c) 2014, Vispy Development Team. # Distributed under the (new) BSD License. See LICENSE.txt for more info. """ Reading and writing of data like images and meshes. """ import os import bz2 import numpy as np from .wavefront import WavefrontReader, WavefrontWriter THISDIR = os.pat...
{"hexsha": "8ab394789508959d584484b8c0637c2aae2b5b28", "size": 4134, "ext": "py", "lang": "Python", "max_stars_repo_path": "vispy/util/dataio/io.py", "max_stars_repo_name": "MatthieuDartiailh/vispy", "max_stars_repo_head_hexsha": "09d429be361a148b0614a192f56d4070c624072c", "max_stars_repo_licenses": ["BSD-3-Clause"], "...
# Sparsity-promoting least squares migration with source subsampling using the linearized Bregman algorithm # Author: Philipp Witte, pwitte@eos.ubc.ca # Date: December 2016 # export linbreg_lsrtm function linbreg_lsrtm(J::TimeModeling.joJacobian, dD::TimeModeling.joData; iterations=10, lambda=[], shots_per_iteration=...
{"hexsha": "b0b2550a12fab60d1040e29ae283241e02cbd22d", "size": 1454, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/LeastSquaresMigration/linbreg_lsrtm.jl", "max_stars_repo_name": "SINBADconsortium/opesciSLIM", "max_stars_repo_head_hexsha": "8c3af2d8e9809fcd4d53fa160c01dbd624b6bb25", "max_stars_repo_licenses...
module SpikeTools export raster, paddedbins, boxcarsmooth function raster(spike_times::Vector{Float64}, start_times, r) firstr = first(r) lastr = last(r) n = length(r) - 1 rasters = zeros(Int32, length(r) - 1, length(start_times)) n = length(spike_times) j = 1 for i = 1:length(start_times)...
{"hexsha": "a9269b03460410df7f55e8891f08df4282a3fe0c", "size": 1598, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/SpikeTools.jl", "max_stars_repo_name": "simonster/Persistent-Single-Neuron-Activity-during-Working-Memory-in-the-Human-Medial-Temporal-Lobe", "max_stars_repo_head_hexsha": "4b46fef287b3d849695e...
# # Copyright (c) 2021, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed ...
{"hexsha": "9aa2a45291375bcce89ca47809314abd8fef9626", "size": 21381, "ext": "py", "lang": "Python", "max_stars_repo_path": "merlin/models/torch/model/base.py", "max_stars_repo_name": "jperez999/models-1", "max_stars_repo_head_hexsha": "44c71fd5168cae60c56ad300c6e21522a86c1908", "max_stars_repo_licenses": ["Apache-2.0"...
#!/bin/env python # -*- coding: utf-8 -*- ## # simulator.py: Defines a class that implements a single qubit simulator. ## # Copyright (c) Sarah Kaiser and Chris Granade. # Code sample from the book "Learn Quantum Computing with Python and Q#" by # Sarah Kaiser and Chris Granade, published by Manning Publications...
{"hexsha": "81b377d3979d535be0715f78b9fced86b9e0264c", "size": 1400, "ext": "py", "lang": "Python", "max_stars_repo_path": "ch03/simulator.py", "max_stars_repo_name": "tjmcode/learn-qc-with-python-and-qsharp", "max_stars_repo_head_hexsha": "e6697e989553ef484737ea5ba89fdc320a6e2493", "max_stars_repo_licenses": ["MIT"], ...
# -*- coding: utf-8 -*- """COV19-forecast_mlmodels.ipynb Automatically generated by Colaboratory. Original file is located at https://colab.research.google.com/drive/1jj0460ZGHDOaujyT49lWci2kFrdxWkkL """ #### Install MLMODELS in Colab ! bash <(wget -qO- https://cutt.ly/mlmodels) &> log.txt !pip install pyda...
{"hexsha": "f6ea5c2cbdf808761d04635e180bb60ccf16f747", "size": 23314, "ext": "py", "lang": "Python", "max_stars_repo_path": "tseries_m5_gluon/gluon/cov19_forecast_mlmodels.py", "max_stars_repo_name": "arita37/data", "max_stars_repo_head_hexsha": "0d1a38fd9b564cfb9c34ad521e7df2b3b6e2316b", "max_stars_repo_licenses": ["M...
# program shows LU decomposition import numpy as np import scipy.linalg A = np.array([(9,8,-2,2,-2), (7,-3,-2,7,2), (2,-2,2,-7,6), (4,8,-3,3,-1), (2,2,-1,1,4)]) def LU(N,A): P, L_, U_ = scipy.linalg.lu(A) L = np.zeros((N, N), dtype=float, order='C') U = np.zeros((N, N), dtype=float, order='C') w =...
{"hexsha": "452dcf4b01170f27e1544ddd894c36a4f9aad9a2", "size": 1878, "ext": "py", "lang": "Python", "max_stars_repo_path": "lab3/lab3.py", "max_stars_repo_name": "zuza3012/MN", "max_stars_repo_head_hexsha": "b056b26697b31575fafec755f6421fe72080d0ed", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_sta...
function countingsort(x::AbstractArray{<:Int})::AbstractArray{<:Int} l = length(x) n = maximum(x)+1 count = zeros(Int, n) aux = copy(x) for i ∈ 1:l @inbounds count[x[i]+1]+=1 end for i ∈ 2:n @inbounds count[i] += count[i-1] end for i ∈ l:-1:1 @inbounds aux[cou...
{"hexsha": "7b4ea165d521fb18a59d5af35be26baea259ddbb", "size": 401, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "sorting/src/counting.jl", "max_stars_repo_name": "tirthasheshpatel/Algorithms.jl", "max_stars_repo_head_hexsha": "d4a8c7d63d3245bc403fe811d6ed36479b0d9415", "max_stars_repo_licenses": ["MIT"], "max_...
import os import cv2 import time import argparse import logging import numpy as np import tensorflow as tf #from utils.app_utils import FPS, WebcamVideoStream, HLSVideoStream #from multiprocessing import Queue, Pool from object_detection.utils import label_map_util from object_detection.utils import visualization_util...
{"hexsha": "db4acbaafaaffdc543655652376ab9cdb1448edd", "size": 3916, "ext": "py", "lang": "Python", "max_stars_repo_path": "object_detection_images.py", "max_stars_repo_name": "snehasagar24/pallet-loading", "max_stars_repo_head_hexsha": "19790c2f86454b4e5ca32f936b2a3370af6161fb", "max_stars_repo_licenses": ["MIT"], "ma...
%------------------------- % Resume in Latex % Author : Yao-Chung Chang % License : MIT %------------------------ \documentclass[letterpaper,11pt]{article} \usepackage{latexsym} \usepackage[empty]{fullpage} \usepackage{titlesec} \usepackage{marvosym} \usepackage[usenames,dvipsnames]{color} \usepackage{verbatim} \usep...
{"hexsha": "ecd7088d71a4316724f8022e8af69a110ba09060", "size": 5685, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "sourabh_bajaj_resume.tex", "max_stars_repo_name": "B04902020/Software-Developer-Resume", "max_stars_repo_head_hexsha": "8bdbb04e06a1a430477292966ac27ce569326c64", "max_stars_repo_licenses": ["MIT"],...
""" DNN is a little python module to demonstrate the basic elements of a deep neural network in action. """ import numpy as np import matplotlib.pyplot as plt from pointwise_activations import func_list from loss_functions import loss_list class Solver(object): """ Solver object contains the method employ...
{"hexsha": "9262a9966b0c5d2e7ea523c2b203375368c2783b", "size": 7066, "ext": "py", "lang": "Python", "max_stars_repo_path": "Solvers.py", "max_stars_repo_name": "luisitobarcito/mini-DNN", "max_stars_repo_head_hexsha": "a05b4a316d1777e0962b429c7c31a4e9e7feb14b", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 3, "...
''' Provider class and helper functions for Frustum PointNets. Author: Charles R. Qi Date: September 2017 ''' from __future__ import print_function #import cPickle as pickle #import pcl import sys import os import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D BASE_DIR = os.path.d...
{"hexsha": "e026366edecacb7c47f8a993f49b85a9e4d2b4ce", "size": 26887, "ext": "py", "lang": "Python", "max_stars_repo_path": "train/provider_dfd_batch_test_raw.py", "max_stars_repo_name": "ben0110/frustum-pointnets_RSC_RADAR_fil_PC_batch_para", "max_stars_repo_head_hexsha": "a796fd4a775179c4daa342872ea1bbc5ba5d5026", "m...
#!/usr/bin/env python # coding: utf-8 # <!-- HTML file automatically generated from DocOnce source (https://github.com/doconce/doconce/) # doconce format html hw5.do.txt --no_mako --> # <!-- dom:TITLE: PHY321: Classical Mechanics 1 --> # # PHY321: Classical Mechanics 1 # **Homework 5, due Friday February 18** # # ...
{"hexsha": "8068a452d839b2993f6d04c06b183d3303c4bb34", "size": 17008, "ext": "py", "lang": "Python", "max_stars_repo_path": "doc/LectureNotes/_build/jupyter_execute/hw5.py", "max_stars_repo_name": "Shield94/Physics321", "max_stars_repo_head_hexsha": "9875a3bf840b0fa164b865a3cb13073aff9094ca", "max_stars_repo_licenses":...
using BarycentricLagrange using BenchmarkTools # Chebyshev nodes n = 100 x = cos.((0:n)*pi/n) w = bclag_interp_weights(x) F = x -> sin(x) f = F.(x) xx = collect(-1:0.01:1) ref = F.(xx) # Benchmarks println("Direct eval") @btime bclag_interp_eval(x, f, xx) println("Compute weights") @btime bclag_interp_weights(x) pr...
{"hexsha": "44d3907b0ca2258fbab05d97df834126ab1f456e", "size": 579, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "perf/timings.jl", "max_stars_repo_name": "ludvigak/BarycentricLagrange.jl", "max_stars_repo_head_hexsha": "d6d60b24dca217ca03dbb73aa7a5ac633d294e8f", "max_stars_repo_licenses": ["MIT"], "max_stars_c...
# --- # title: 233. Number of Digit One # id: problem233 # author: zhwang # date: 2022-03-12 # difficulty: Hard # categories: Math # link: <https://leetcode.com/problems/number-of-digit-one/description/> # hidden: true # --- # # Given an integer n, count the total number of digit 1 appearing in all non- # negative int...
{"hexsha": "bd680c7fd35ee9aaebfcaa3f1c661bb5c8fe6e41", "size": 1225, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/problems/233.number-of-digit-one.jl", "max_stars_repo_name": "RexWzh/LeetCode.jl", "max_stars_repo_head_hexsha": "d86109b9d5a15491304ff9d2ee66e506f60d2146", "max_stars_repo_licenses": ["MIT"], ...
from tensorflow.keras import layers from tensorflow.python.keras.utils.data_utils import Sequence import numpy as np import os import skimage from compute.ssd_calculus import SSDCalculus from image_process.frame_decorator import Frame from image_process.resize import Resize from skimage.io import imread class SSD...
{"hexsha": "1d35085ef9359d6a89d39304bb1fd33a868d2bde", "size": 7694, "ext": "py", "lang": "Python", "max_stars_repo_path": "pytwovision/datasets_loader/ssd_dataset_generator.py", "max_stars_repo_name": "corvus96/PyTwoVision", "max_stars_repo_head_hexsha": "324b4e4ca99f8b3d07df3d8b63f119ed8f3a9051", "max_stars_repo_lice...
# coding: UTF-8 import torch import torch.nn as nn import torch.nn.functional as F import numpy as np class Config(object): """配置参数""" def __init__(self): self.model_name = 'FastText' self.model_name = 'DPCNN' self.embedding_pretrained = None # 预训练词向量 ...
{"hexsha": "b5a6f0aa07df12d10784b77fc6daf1409170f53e", "size": 2335, "ext": "py", "lang": "Python", "max_stars_repo_path": "ailib/fastai/FastText.py", "max_stars_repo_name": "vandykai/ailib", "max_stars_repo_head_hexsha": "6ccb9536dc3f6f8ff138335d0153a2982635fca8", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_...
import numpy as np import re import functools class CubeFile(): """ A class to read, write, and manipulate cube files This class assumes that all coordinates (atoms, grid points) are stored in atomic units Uses code from the parse_cube function written by Andy Simmonett (psi4 project) Attri...
{"hexsha": "d94bdc2566e42b0f527c677e3e72c93174306fc2", "size": 8086, "ext": "py", "lang": "Python", "max_stars_repo_path": "fortecubeview/cube_file.py", "max_stars_repo_name": "evangelistalab/fortecubeview", "max_stars_repo_head_hexsha": "46ba1ee1c49f0764018c3ce1ff00c5a2daa95429", "max_stars_repo_licenses": ["MIT"], "m...
#!/usr/bin/env julia using Weber version = v"0.0.1" sid,skip = @read_args("Duration Discrimination ($version).") #====================================================================== Experiment Setup ======================================================================# # 2AFC duration discrimination. Each stimul...
{"hexsha": "660f0fd81f1f465a8d57630676a97ecf6f49b991", "size": 3510, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "examples/interval2afc.jl", "max_stars_repo_name": "haberdashPI/Psychotask.jl", "max_stars_repo_head_hexsha": "38ea873da5e7238307e530b5a9ea355f56d6cdc9", "max_stars_repo_licenses": ["MIT"], "max_sta...
# -*- coding: utf-8 -*- """ Auxiliary functions and operations for network construction, some of which have been deprecated for high-level modules in TensorFlow. @author: Xinzhe Luo """ from __future__ import print_function, division, absolute_import, unicode_literals import tensorflow as tf import numpy as...
{"hexsha": "fdbab5f75b429524cd17c4c3ac94c0c5b71ed445", "size": 42918, "ext": "py", "lang": "Python", "max_stars_repo_path": "src_2d/core/layers_2d.py", "max_stars_repo_name": "xzluo97/MvMM-RegNet", "max_stars_repo_head_hexsha": "c08d5df14b4a9c4a98c66973ff4950aba7f416e4", "max_stars_repo_licenses": ["MIT"], "max_stars_c...
[STATEMENT] lemma fps_inverse_code [code]: "inverse (fps_of_ratfps x) = fps_of_ratfps (inverse x)" [PROOF STATE] proof (prove) goal (1 subgoal): 1. inverse (fps_of_ratfps x) = fps_of_ratfps (inverse x) [PROOF STEP] by simp
{"llama_tokens": 105, "file": "Linear_Recurrences_RatFPS", "length": 1}
# ------------------------------------------------------------------ # Licensed under the MIT License. See LICENSE in the project root. # ------------------------------------------------------------------ """ DomainView(domain, inds) Return a view of `domain` at `inds`. """ struct DomainView{𝒟,I} <: AbstractDoma...
{"hexsha": "2d1529dbf4f6468e3ac1a8c9f7e24c7bee573b9b", "size": 962, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/domainview.jl", "max_stars_repo_name": "Mattriks/GeoStatsBase.jl", "max_stars_repo_head_hexsha": "b2abd1e9424cc1606274fbe4a4f7975c181e0a01", "max_stars_repo_licenses": ["MIT"], "max_stars_count"...
#! /usr/bin/env python # Copyright 2021 Intel Corporation # # 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...
{"hexsha": "bf6e8c837f34bcbac52e4ec7d9a7e69009a2f161", "size": 8540, "ext": "py", "lang": "Python", "max_stars_repo_path": "numba_dppy/tests/debugging/test_info.py", "max_stars_repo_name": "akharche/numba-dppy", "max_stars_repo_head_hexsha": "f12dac64b149bd72f305f341ff64b796bbb648c1", "max_stars_repo_licenses": ["Apach...
""" Test the optimization using SMC. """ from sepdesign import * import pickle import numpy as np import matplotlib.pyplot as plt import pymc as pm import pysmc as ps import pickle import mpi4py.MPI as mpi class SteadyPaceSMC(ps.SMC): pass #def _find_next_gamma(self, gamma): # self._loglike = self....
{"hexsha": "3dee379bdf1943dd1cf1cc54447011316b73c773", "size": 3465, "ext": "py", "lang": "Python", "max_stars_repo_path": "mcmc_runs/ad_arb1.py", "max_stars_repo_name": "salarsk1/principal-agent-bilevel-programming", "max_stars_repo_head_hexsha": "e09b9456dff1e5d253b57bd4bc60f87fd36a749b", "max_stars_repo_licenses": [...
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
{"hexsha": "daac776747585f60b16fe4c473a0e6ba61f2ae0d", "size": 5075, "ext": "py", "lang": "Python", "max_stars_repo_path": "ogb_examples/lsc/MAG240M/models/rgat.py", "max_stars_repo_name": "zbmain/PGL", "max_stars_repo_head_hexsha": "dbded6a1543248b0a33c05eb476ddc513401a774", "max_stars_repo_licenses": ["Apache-2.0"], ...
# =========== # # Libraries # # =========== # # System Libraries import math import os from datetime import datetime # matplotlib.use("Agg") import cmapy import cv2 import matplotlib.pyplot as plt import numpy as np import scipy.stats as stats # Torch Libraries import torch import torch.nn.parallel...
{"hexsha": "529c3c65202ada88d733e63df3a50a9c4fa3f6bf", "size": 12124, "ext": "py", "lang": "Python", "max_stars_repo_path": "depthEstimation_nick_gpu/ensembling_train.py", "max_stars_repo_name": "nicolasrosa-forks/evaluating_bdl", "max_stars_repo_head_hexsha": "2973b0d018551de0c9f087e2ae4e6b2c22f2ce3c", "max_stars_repo...
module Regression export ridge, predict, mse, cross_validate, kfold, Kfold include("cross_validation.jl") include("ridge.jl") include("mse.jl") end
{"hexsha": "f754c934b324aad8cad13d25fe34ea2496e1a0c1", "size": 151, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/Regression.jl", "max_stars_repo_name": "tbepler/julia-regression", "max_stars_repo_head_hexsha": "eb950a1a400092921aa99194ca968c79b1dd5006", "max_stars_repo_licenses": ["MIT"], "max_stars_count"...
""" Testing module for the Swarm class """ import unittest from unittest import mock import numpy as np import pynmmso.swarm as swarm import math class BasicProblem: def __init__(self, inverse=False): self.inverse = inverse def fitness(self, x): res = sum(x * x) if self.inverse:...
{"hexsha": "71fc62d1a8543de194d156a4dee98bbcc32f5065", "size": 18162, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/swarm_tests.py", "max_stars_repo_name": "wood-chris/pynmmso", "max_stars_repo_head_hexsha": "e13f8139160421a9d3f7e650ad6f988c9244ca69", "max_stars_repo_licenses": ["MIT"], "max_stars_count"...
""" Created on Tue Mar 5 08:14:54 2019 @author: kajoel """ import scipy.sparse as sparse import numpy as np import pyquil.paulis from openfermion.ops import FermionOperator from openfermion.ops import QubitOperator from forestopenfermion import qubitop_to_pyquilpauli from openfermion.transforms import jordan_wigner ...
{"hexsha": "6868924e756775f057737a914ba9db7b5d676869", "size": 3474, "ext": "py", "lang": "Python", "max_stars_repo_path": "core/matrix_to_op.py", "max_stars_repo_name": "kajoel/Simulating_quantum_systems_on_an_emulated_quantum_computer", "max_stars_repo_head_hexsha": "f78d0880e1a75a147ac4d858a01edb9bea5eb625", "max_st...
#!/usr/bin/env python from __future__ import print_function import sys, os import pickle, shutil import re, string, time import random import numpy as np from scipy import optimize from scipy.fftpack import fft import matplotlib.pyplot as plt import matplotlib as mpl from matplotlib import cm from mpl_toolkits.mplot3d ...
{"hexsha": "fb63237b67653a06fd7dc6e6b48f10f289cbe652", "size": 22712, "ext": "py", "lang": "Python", "max_stars_repo_path": "mokas_G4Chi4.py", "max_stars_repo_name": "gdurin/mokas", "max_stars_repo_head_hexsha": "57893d0191c988b241dcf5701d4213a3cbcf587a", "max_stars_repo_licenses": ["CC-BY-3.0"], "max_stars_count": nul...
namespace prop_17 variables A B : Prop theorem prop_17 : ¬ (¬ A ∧ ¬ B) → (A ∨ B) := assume h1: ¬ (¬ A ∧ ¬ B), show A ∨ B, from or.elim (classical.em A) (assume h2: A, or.inl h2) (assume h3: ¬ A, show A ∨ B, from or.inr (show B, from (classical.by_contradiction (assume h4: ¬ B, ...
{"author": "tomasz-lisowski", "repo": "lean-logic-examples", "sha": "2b2ccd467b49c3989bf6c92ec0358a8d6ee68c5d", "save_path": "github-repos/lean/tomasz-lisowski-lean-logic-examples", "path": "github-repos/lean/tomasz-lisowski-lean-logic-examples/lean-logic-examples-2b2ccd467b49c3989bf6c92ec0358a8d6ee68c5d/src/logic_prop...
# An alternative resampling algorithm described in Fearnhead (2004): # # for each particle, generate putatives (z_1:n^i, j) # sample one successor proportional to p((z_1:n^i, j) | x_1:n+1) # assign weight based on sum_1^k_i+1(p((z_1:n^i, j) | x_1:n+1)/p(z_1:n^i | x_1:n)) mutable struct ChenLiuParticles{P} <: ParticleF...
{"hexsha": "311d0cef9c17b82a2011453e38cfa294cc91d323", "size": 2591, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/chenliu.jl", "max_stars_repo_name": "kleinschmidt/Particles.jl", "max_stars_repo_head_hexsha": "040125c6401ca76f0604a447a3c151460cb4f607", "max_stars_repo_licenses": ["MIT"], "max_stars_count":...
import numpy as np input_file = "../input.txt" with open(input_file, 'r') as f: input_text = f.read() image_data = np.array([int(i) for i in input_text.strip()]).reshape((-1, 6, 25)) # Test: # image_data = np.array([int(i) for i in "123456789012"]).reshape((-1, 2, 3)) fewest_zeros = np.argmin([np.count_nonzero(...
{"hexsha": "1cd4efa32da1d8d8078b74691dcf785a361e51a8", "size": 806, "ext": "py", "lang": "Python", "max_stars_repo_path": "day8/python/main.py", "max_stars_repo_name": "freidrichen/advent-of-code-2019", "max_stars_repo_head_hexsha": "08aca50e86700504d35c934a308a640a95de586e", "max_stars_repo_licenses": ["MIT"], "max_st...
from numpy import linalg from numpy import array from numpy import s_ from numpy import delete from copy import deepcopy #Funcao de calculo da Matriz Inversa def criaMatrizInversa(ordem, matriz): mat_aux = array(matriz) #Criando uma matriz auxiliar exatamente igual a matriz de entrada mat_aux = delete(delete(m...
{"hexsha": "d6b11fc7998871e79eb514628989b03c6fe26545", "size": 1001, "ext": "py", "lang": "Python", "max_stars_repo_path": "12_Metodo_Minimos_Quadrados__EnzoAppi/creation/invmatrix.py", "max_stars_repo_name": "enzoappi/CalculoNumerico-FEMASS", "max_stars_repo_head_hexsha": "1cbeaeb52e57bb13286a8958a701d5d05db25f11", "m...
\ Could probably speed things up by not using a counter var but \ replace it with a time threshold var so we're referencing the single #FRAMES counter empty include le/le import bu/mo/rsort autodata ex/le/ct 21 36 2200man.image subdivide 18 20 alfador.image subdivide 21 28 fairgirl.image subdivide \ ENUM...
{"hexsha": "fca2338752909f42c59dfe457781f386b831f376", "size": 4420, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "ex/le/depthdemo.f", "max_stars_repo_name": "RogerLevy/lantern", "max_stars_repo_head_hexsha": "3f5c0fd75fd3c18dc6ac5082827c0f905ebbf2d7", "max_stars_repo_licenses": ["Unlicense"], "max_stars_count...
import numpy import sys import time import pandas as pd from sklearn import svm, datasets from sklearn.model_selection import train_test_split sys.path.insert(0, './algorithm') sys.path.insert(0, './config_files') sys.path.insert(0, './data') sys.path.insert(0, './evaluator') sys.path.insert(0, './main') sys.path.inser...
{"hexsha": "593d87054bfea7d290fe7678bc69f755a6502624", "size": 2608, "ext": "py", "lang": "Python", "max_stars_repo_path": "evaluator_main.py", "max_stars_repo_name": "saisrikosaraju/StreamEROld", "max_stars_repo_head_hexsha": "5e814ec07f6769ed39843e4619610e1ea638633b", "max_stars_repo_licenses": ["Apache-2.0"], "max_s...
from .conftest import base_config import numpy as np from numpy.testing import assert_allclose, assert_array_equal import openamundsen as oa import openamundsen.errors as errors import pandas as pd from pathlib import Path import pytest import xarray as xr def meteo_to_netcdf(ds, out_dir): ds = ds.copy(deep=True)...
{"hexsha": "a6dbe30bdfe823b98f99cb1599ebd84e34bc47a9", "size": 16137, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_meteo_input.py", "max_stars_repo_name": "openamundsen/openamundsen", "max_stars_repo_head_hexsha": "2ac09eb34b0c72c84c421a0dac08d114a05b7b1c", "max_stars_repo_licenses": ["MIT"], "max_...
import logging import pandas as pd import numpy as np import matplotlib.pyplot as plt import matplotlib as mpl from matplotlib import rcParams import scipy.stats from scipy.special import gamma rcParams.update({'figure.autolayout': True}) logger = logging.getLogger(__name__) logging.basicConfig(level=logging.WARN) ...
{"hexsha": "a37dae487ab3a79c0ad49cea97b8a3d337e407f6", "size": 30316, "ext": "py", "lang": "Python", "max_stars_repo_path": "weibull/weibull.py", "max_stars_repo_name": "KTCrisis/weibull", "max_stars_repo_head_hexsha": "2384342c2e2fc6554d8cdf1556528c99480f2386", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1,...
# -*- coding: utf-8 -*- import os, sys, pdb import numpy as np FILE_PATH = os.path.abspath(__file__) PRJ_PATH = os.path.dirname(os.path.dirname(FILE_PATH)) sys.path.append(PRJ_PATH) from yolo_v2.datasets.knee import Knee if __name__ == '__main__': data_root = "../../data/DetKneeData" train_set = Knee(data_ro...
{"hexsha": "ddd768e9e1925026df0210d35c1c6fdb2ab1e88b", "size": 501, "ext": "py", "lang": "Python", "max_stars_repo_path": "DetJoint/train/cal_mean_var.py", "max_stars_repo_name": "Tommy-Ngx/AutoGradingOA", "max_stars_repo_head_hexsha": "5e69bd38abaf01f03d8d837da68701a86bac1bb0", "max_stars_repo_licenses": ["MIT"], "max...
#simulate some data set.seed(1) x<-seq(0,100,1) y<-((runif(1,10,20)*x)/(runif(1,0,10)+x))+rnorm(51,0,1) #***** Simple Linear Regression ******** l_model <- lm( y ~ x ) l_pred <- predict(l_model) #get some estimation of goodness of fit cor(y , l_pred) #***** Non - Linear Regression ******** ## Using nls funct...
{"hexsha": "18e67ebc1ab3369d36a735fe4a6a3aab837a32a4", "size": 600, "ext": "r", "lang": "R", "max_stars_repo_path": "Section 4/4 Non-LinearModels.r", "max_stars_repo_name": "PacktPublishing/Programming-for-Data-Science-with-R-", "max_stars_repo_head_hexsha": "749186567519d15abdca815ff8072fb40cca803a", "max_stars_repo_l...
//================================================================================================== /*! Copyright 2016 NumScale SAS Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) */ //====================================...
{"hexsha": "f616be0692fe70f6c05eeb2bc16f121a2e448c59", "size": 1332, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "test/function/scalar/stirling.cpp", "max_stars_repo_name": "TobiasLudwig/boost.simd", "max_stars_repo_head_hexsha": "c04d0cc56747188ddb9a128ccb5715dd3608dbc1", "max_stars_repo_licenses": ["BSL-1.0"]...
import os import shutil import tempfile import unittest import numpy as np import tensorflow as tf from headliner.losses import masked_crossentropy from headliner.model.basic_summarizer import BasicSummarizer from headliner.preprocessing.keras_tokenizer import KerasTokenizer from headliner.preprocessing.preprocessor...
{"hexsha": "f0865bb1a1095baa1bdffbad544d86b3ff4e20cb", "size": 2577, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/model/test_summarizer.py", "max_stars_repo_name": "audriusuzkuraitis/headliner", "max_stars_repo_head_hexsha": "f915306fd80218949a6447aa915c93ef4b44fdd0", "max_stars_repo_licenses": ["MIT"],...
#! /usr/bin/env python """ This class contains a squared trajectory in 3D given the 4 vertices, and it publishes in rviz @author: Silvia Cruciani (cruciani@kth.se) """ import rospy import rospkg rospack = rospkg.RosPack() from geometry_msgs.msg import Pose, PoseArray import numpy as np class SquareTrajector...
{"hexsha": "82ee9e1bed84906fff7afc17f4a4dc3babf6483c", "size": 4521, "ext": "py", "lang": "Python", "max_stars_repo_path": "kinematics_assignment_metapackage/kinematics_assignment/scripts/square_trajectory.py", "max_stars_repo_name": "ajinkyakhoche/Introduction-to-Robotics-DD2410-", "max_stars_repo_head_hexsha": "66134...
""" author: @nimrobotics description: calculates the functional connectivity between regions and plots them """ import numpy as np import scipy.io import glob import os from fnirslib.connectivity import functionalConnectivity from fnirslib.plots import plotData if __name__ == '__main__': in_dir = "./procData/" #d...
{"hexsha": "ecd0bfdbd93e258da996ea7fb45cde1d63a4ddcc", "size": 1968, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/FC.py", "max_stars_repo_name": "nimRobotics/fnirslib", "max_stars_repo_head_hexsha": "0273c0da5f4a41d7cf4dac0fc9686c38f2c7b0cd", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nul...
def test_egm_mc(): from dolo import yaml_import from dolo.algos.egm import egm import numpy as np model = yaml_import("examples/models/consumption_savings.yaml") sol = egm(model, a_grid=np.linspace(0.1, 10, 10) ** 2, verbose=True) def test_egm_iid(): from dolo import yaml_import from do...
{"hexsha": "02755a89f36cbb72861c4a9b445f6e43b04ee612", "size": 513, "ext": "py", "lang": "Python", "max_stars_repo_path": "dolo/tests/test_egm.py", "max_stars_repo_name": "EconForge/dolo", "max_stars_repo_head_hexsha": "9bb75b8f6ea87578393fe748003092ffb745e8d6", "max_stars_repo_licenses": ["BSD-2-Clause"], "max_stars_c...
#encoding = utf-8 import numpy as np import math import tensorflow as tf from tensorflow.python.ops import control_flow_ops from tensorflow.contrib.training.python.training import evaluation from datasets import dataset_factory from preprocessing import ssd_vgg_preprocessing from tf_extended import metrics as tfe_metr...
{"hexsha": "0bd806c803045d9e5ff3da7e4826f83c6dc78de8", "size": 7884, "ext": "py", "lang": "Python", "max_stars_repo_path": "test_pixel_link_on_any_image.py", "max_stars_repo_name": "NSEVC/pixel_link", "max_stars_repo_head_hexsha": "c801b4e57e88182e7fc507c560cbbd6187df91b2", "max_stars_repo_licenses": ["MIT"], "max_star...
""" This is the main environment for the state-space model. """ import os import time import numpy as np from statsmodels.iolib.smpickle import load_pickle from data_loader import load_data from state_space import SSMS from utils import forecast_error, plot_states, prepare_forecast def main(): model_select = F...
{"hexsha": "a849d2c069ad77afd1c7c2b65c3fa69f16a4173b", "size": 4912, "ext": "py", "lang": "Python", "max_stars_repo_path": "main.py", "max_stars_repo_name": "stefanvanberkum/SSMS", "max_stars_repo_head_hexsha": "8e1eea8a1c52f4cef0fa63168846d3b192e4dda0", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max...
import collections import enum import numpy as np from ..mathematics import defaults, coordinates, projections, transforms, vectors class Projection(object): def __init__(self, fov=np.pi/2.0, near=0.1, far=1000.0, n=defaults.DEFAULT_N, m=defaults.DEFAULT_M, dtype=defaults.DEFAULT_DTYPE): super().__init_...
{"hexsha": "517ce02afa058639cf99bb0fc6b258bd02833453", "size": 998, "ext": "py", "lang": "Python", "max_stars_repo_path": "glance/scenes/projections.py", "max_stars_repo_name": "filonik/glance", "max_stars_repo_head_hexsha": "053e5e9567c76774b56597dfa854fd29efaf48fd", "max_stars_repo_licenses": ["MIT"], "max_stars_coun...
import data.set.basic universes u v variable (ι : Type u) variable (Obj : ι → Type v) variable (Mor : Π x y, set (Obj x → Obj y)) variable (Hid : ∀ x, id ∈ Mor x x) variable (Hcomp : ∀ (x y z) (f : Mor x y) (g : Mor y z), g.1 ∘ f.1 ∈ Mor x z) def limit : Type (max u v) := { p : Π x, Obj x // ∀ (x y) (f : Obj x → Obj...
{"author": "kckennylau", "repo": "Lean", "sha": "907d0a4d2bd8f23785abd6142ad53d308c54fdcb", "save_path": "github-repos/lean/kckennylau-Lean", "path": "github-repos/lean/kckennylau-Lean/Lean-907d0a4d2bd8f23785abd6142ad53d308c54fdcb/limit.lean"}
#i!/usr/bin/python import sys, getopt import asyncore import numpy as np import pickle import socket import struct import cv2 import open3d as o3d from argparse import ArgumentParser save_path = "./dataset" port = 1024 chunk_size = 4096 isWindowOpen = True mc_ip_address = "224.0.0.1" mc_message = "PiSensePing" def ...
{"hexsha": "abdc97a64a9c5578cfa523217f54b354e64c5071", "size": 5425, "ext": "py", "lang": "Python", "max_stars_repo_path": "realsense_client/EtherSenseClient.py", "max_stars_repo_name": "yutashx/PiSense", "max_stars_repo_head_hexsha": "bc059e8e0bf17adafc116e10bd4a6a69b6d99cf1", "max_stars_repo_licenses": ["MIT"], "max_...
""" ============================================================================= Manifold learning on handwritten digits: Locally Linear Embedding, Isomap... ============================================================================= An illustration of various embeddings on the digits dataset. The RandomTreesEmbed...
{"hexsha": "133d81bab0f625fab9c35b23188f3e004200d239", "size": 8572, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/manifold/plot_lle_digits.py", "max_stars_repo_name": "DeuroIO/Deuro-scikit-learn", "max_stars_repo_head_hexsha": "9dd09a19593d1224077fe0d1a754aed936269528", "max_stars_repo_licenses": ["M...
# # @Author : Jean-Pascal Mercier <jean-pascal.mercier@agsis.com> # # # __doc__ = \ """ TODO : BIG DESCRIPTION OF EXCHANGE DATA """ import numpy as np import pickle import copy from functools import wraps def memoize(fct): """ This is a decorator which cache the result of a function based on the given pa...
{"hexsha": "5554509d04ff11ef8d43b7e726fdd9dc154a7305", "size": 5197, "ext": "py", "lang": "Python", "max_stars_repo_path": "useis/tomography/data.py", "max_stars_repo_name": "jeanphilippemercier/uquake-useis", "max_stars_repo_head_hexsha": "fb03197852e4180ad32c6308787543b2af95f798", "max_stars_repo_licenses": ["MIT"], ...
import numpy as np import numpy.random as npr import matplotlib.pyplot as plt import matplotlib.animation as animation n = 400 state = np.zeros([n, n]) m = int(0.25*n) state[m:3*m, m:3*m] = npr.randint(2, size=(2*m, 2*m)) # G = np.array([[0, 1, 0], [0, 0, 1], [1, 1, 1]]) # This is a Gosper glider # A[3:6, 3:6] = G ...
{"hexsha": "7d8d37b27f38eba1c694d49a0f3d5266b1a00ec5", "size": 1209, "ext": "py", "lang": "Python", "max_stars_repo_path": "life.py", "max_stars_repo_name": "BenGravell/gridtoy", "max_stars_repo_head_hexsha": "6e2ea208803d81fee739473ab5dcfbab46c64d0a", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_s...
"""Module containing classes for extracting/constructing features from data""" import abc import numpy as np from scipy import stats from fsic import util class FeatureMap(metaclass=abc.ABCMeta): """Abstract class for a feature map function""" @abc.abstractmethod def gen_features(self, X): """...
{"hexsha": "30a040684041cf05ed3da1afaa6e76ff8c6d741d", "size": 4004, "ext": "py", "lang": "Python", "max_stars_repo_path": "fsic/feature.py", "max_stars_repo_name": "Renelvon/fsic", "max_stars_repo_head_hexsha": "24878074bb465f05bd0e0b1e9cff947dd73b391b", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "ma...
# Solution to IBM's Ponder This challenge from January 2022 # https://research.ibm.com/haifa/ponderthis/challenges/January2022.html # Solved by Alexander Gramolin (https://github.com/gramolin/ponderthis) from time import time from sympy import isprime def generate_primes(d): """Generate a set of all primes with ...
{"hexsha": "f95f526b4f9684a2c64e415efac87312184d976e", "size": 4794, "ext": "py", "lang": "Python", "max_stars_repo_path": "2022/01/main.py", "max_stars_repo_name": "gramolin/ponderthis", "max_stars_repo_head_hexsha": "0ab4dae93c2ebb96ca8c66d3bfbe3dbbfe1974b6", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nul...
import numpy as np import torch from torch import nn class LAIDataset(torch.utils.data.Dataset): def __init__(self, data, labels): self.labels = labels self.data = data def __len__(self): return len(self.data) def __getitem__(self, index): # select sample X =...
{"hexsha": "ffe729c2ca0da653290e0d1dcc5fd5d49eb5622c", "size": 5720, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/Smooth/cnn.py", "max_stars_repo_name": "popgengent/gnomix", "max_stars_repo_head_hexsha": "6caf793761a3a40b315e0e93d301434d3f249a31", "max_stars_repo_licenses": ["AFL-1.1"], "max_stars_count":...
module Language.LSP.Message.Location import Data.URI import Language.JSON import Language.LSP.Message.Derive import Language.LSP.Message.URI import Language.LSP.Message.Utils import Language.Reflection %hide Prelude.Range %language ElabReflection %default total ||| Refer to https://microsoft.github.io/language-serve...
{"hexsha": "ba12ec2a446b1e4503117b5a5884149863589606", "size": 1639, "ext": "idr", "lang": "Idris", "max_stars_repo_path": "src/Language/LSP/Message/Location.idr", "max_stars_repo_name": "gwerbin/idris2-lsp", "max_stars_repo_head_hexsha": "7a93df7f6da7a8e6924c60bd95e66d653fdb0bc4", "max_stars_repo_licenses": ["BSD-3-Cl...
@testset "IO" begin tmpdir = joinpath(tempdir(), "LibPNG") isdir(tmpdir) && rm(tmpdir, recursive = true) mkdir(tmpdir) img = rand(Bool, 5, 5, 5, 5) fn = joinpath(tmpdir, "5x5x5x5.png") @test_throws ErrorException writeimage(fn, img) @testset "Binary Image" begin a = rand(Bool, 11, ...
{"hexsha": "2741f3913edea3b99fabd8bea03016ae965a070c", "size": 2381, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/images.jl", "max_stars_repo_name": "FugroRoames/LibPNG", "max_stars_repo_head_hexsha": "dd2e3601171b978b491e542b39440a6108f70609", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 3, "ma...
from theano import function import theano.tensor as tt import pymc3.distributions.special as ps import scipy.special as ss import numpy as np from .checks import close_to def test_functions(): xvals = list(map(np.atleast_1d, [.01, .1, 2, 100, 10000])) x = tt.dvector('x') x.tag.test_value = xvals[0] ...
{"hexsha": "c02f3fba0c29f21efc8d2424d052f61caef4f08e", "size": 1360, "ext": "py", "lang": "Python", "max_stars_repo_path": "pymc3/tests/test_special_functions.py", "max_stars_repo_name": "katosh/pymc3", "max_stars_repo_head_hexsha": "38fa415c15b0c0469fbd9cad3a3b9ba974fc8733", "max_stars_repo_licenses": ["Apache-2.0"], ...
__author__ = 'sibirrer' from lenstronomy.LensModel.Profiles.gaussian_potential import Gaussian from lenstronomy.LensModel.Profiles.gaussian_kappa import GaussianKappa import numpy as np import numpy.testing as npt import pytest class TestGaussian(object): """ tests the Gaussian methods """ def setup(...
{"hexsha": "dbc55ca50be763d028a5777d4028c3c7a62757d6", "size": 4756, "ext": "py", "lang": "Python", "max_stars_repo_path": "test/test_LensModel/test_Profiles/test_gaussian.py", "max_stars_repo_name": "tvelagapudi/lenstronomy", "max_stars_repo_head_hexsha": "e9fe311c58897da8022840e392aa30ca022d5641", "max_stars_repo_lic...
function nf90_get_var_1D_OneByteInt(ncid, varid, values, start, count, stride, map) use, intrinsic :: iso_c_binding implicit none integer :: nf90_get_var_1D_OneByteInt integer, intent(in) :: ncid, varid integer(c_int8_t), target, dimension(:), intent(out) :: values integer, dimension(:), optional, inte...
{"hexsha": "5b3bd4644c21db00158a25d1df69fbac2ccb5477", "size": 175392, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "fortran/netcdf_get_nd_expanded.f90", "max_stars_repo_name": "MuellerSeb/netcdf-fortran", "max_stars_repo_head_hexsha": "43e3308bba4b6139c12bed53f10fd2dea9f55014", "max_stars_repo_licenses": ["...
r=359.33 https://sandbox.dams.library.ucdavis.edu/fcrepo/rest/collection/sherry-lehmann/catalogs/d7q30n/media/images/d7q30n-003/svc:tesseract/full/full/359.33/default.jpg Accept:application/hocr+xml
{"hexsha": "7808c858c2d6dc4e8ce3a189192b8a164ab1819e", "size": 199, "ext": "r", "lang": "R", "max_stars_repo_path": "tesseract/rotate/d7q30n-003.r", "max_stars_repo_name": "ucd-library/wine-price-extraction", "max_stars_repo_head_hexsha": "c346e48b5cda8377335b66e4a1f57c013aa06f1f", "max_stars_repo_licenses": ["MIT"], "...
import numpy as np from .rustem import EM def restructure(em): # assign each data point to its closest cluster max_vals = np.argmax(em.get_gamma(), axis=1) return em.get_mu()[max_vals, :] def save_new(em, out_path): new_image = restructure(em) em.convert_image(new_image, out_path) return
{"hexsha": "46ff942a604f0a2584a5ccbca73f3cdcc98ef166", "size": 318, "ext": "py", "lang": "Python", "max_stars_repo_path": "rustem/__init__.py", "max_stars_repo_name": "geoph9/em-img-seg", "max_stars_repo_head_hexsha": "7ff8a94e04ee5d9538e897a61f479ffa1249a785", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, ...
# ---------------------------------------------------------------------------- # Title: Scientific Visualisation - Python & Matplotlib # Author: Nicolas P. Rougier # License: BSD # ---------------------------------------------------------------------------- # Illustrate rotated & translated axis (using axisartists t...
{"hexsha": "e5b28895bd02cb1f1d9988aa861ce3108570c198", "size": 5516, "ext": "py", "lang": "Python", "max_stars_repo_path": "code/coordinates/transforms-hist.py", "max_stars_repo_name": "geo7/scientific-visualization-book", "max_stars_repo_head_hexsha": "71f6bac4db7ee2f26e88052fe7faa800303d8b00", "max_stars_repo_license...
# # Copyright © 2018 United States Government as represented by the Administrator of the # National Aeronautics and Space Administration. All Rights Reserved. # import time import numpy as np import sunpy.map import sunpy.io import json import astropy.units as u import pandas as pd from scipy import stats from scipy...
{"hexsha": "25105f0077a2d6af0ea173b383c42b8116e37b7c", "size": 10708, "ext": "py", "lang": "Python", "max_stars_repo_path": "swpc_utils.py", "max_stars_repo_name": "nasa/ccmc-swpc-cat-web", "max_stars_repo_head_hexsha": "43094cb06d417fceac2532d85e6424838d82a30c", "max_stars_repo_licenses": ["NASA-1.3"], "max_stars_coun...
//---------------------------------------------------------------------------// // Copyright (c) 2018-2021 Mikhail Komarov <nemo@nil.foundation> // // MIT License // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), t...
{"hexsha": "1f125f975d77abd2f1a58563849d80d5df1fa78e", "size": 25841, "ext": "cc", "lang": "C++", "max_stars_repo_path": "examples/apps/io_tester/io_tester.cc", "max_stars_repo_name": "NilFoundation/actor", "max_stars_repo_head_hexsha": "b7602106c2ec254bc68592b41ccf4e5497206d43", "max_stars_repo_licenses": ["Apache-2.0...
[STATEMENT] lemma integral_density: fixes f :: "'a \<Rightarrow> 'b::{banach, second_countable_topology}" and g :: "'a \<Rightarrow> real" assumes f: "f \<in> borel_measurable M" and g[measurable]: "g \<in> borel_measurable M" "AE x in M. 0 \<le> g x" shows "integral\<^sup>L (density M g) f = integral\<^sup>L...
{"llama_tokens": 18516, "file": null, "length": 69}
# HOW TO HANDLE MISSING DATA IN PANDAS # Santiago Garcia Arango, June 2020 import numpy as np import pandas as pd # Create a dictionary with missing values (to show missing data examples) dictionary = { "A": [1, 2, np.nan, 5], "B": [5, np.nan, np.nan, 2], "C": [1, 2, 3, 4], "D": [3, np.nan, 3, 5] ...
{"hexsha": "1c09b7412f150e623c50f1724c2487d49e66fc14", "size": 1230, "ext": "py", "lang": "Python", "max_stars_repo_path": "00_LIBRARIES/01_PANDAS/03_pandas_missing_data.py", "max_stars_repo_name": "san99tiago/ML_BASICS", "max_stars_repo_head_hexsha": "ebd51827f7dd427c848b5c8e1d4bfd017d2fb56f", "max_stars_repo_licenses...
[STATEMENT] lemma one_in_Polys: "1 \<in> P[X]" [PROOF STATE] proof (prove) goal (1 subgoal): 1. 1 \<in> P[X] [PROOF STEP] by (simp add: Polys_def zero_in_PPs)
{"llama_tokens": 80, "file": "Polynomials_MPoly_PM", "length": 1}
from human import Human from loop import game_loop from bot import RandomBot, MCTSBot, GreedyActionBot, HybridBot from board import Board import numpy as np def main(): board = Board() players = [Human(0), RandomBot(1), GreedyActionBot(2, time=120), MCTSBot(3, adaptive_budget=True)] scores = game_loop(boa...
{"hexsha": "4c4bbd58d7b504be8ba5620305e873f48375bb69", "size": 453, "ext": "py", "lang": "Python", "max_stars_repo_path": "game.py", "max_stars_repo_name": "ColinVDH/blokus", "max_stars_repo_head_hexsha": "a2c7f6f7b65653b0fd942c181eae3944fb2ed7d8", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, "max_stars_re...
#!/usr/bin/python3 -i # -*- coding: utf-8 -*- ########################################################################### # # Script to batch convert multiple lammps .dump trajectory files to hdf5 # and store all of them in the same mfp5 file (must exist beforehand) # ################################################...
{"hexsha": "dfadbdc1e56781df62ab2b78ed1f144b0adb92b0", "size": 1601, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/add_all_dump_to_mfp5.py", "max_stars_repo_name": "MOFplus/pylmps_rel", "max_stars_repo_head_hexsha": "77e2a93ab9c55e98c23315a56aff613df4dafb8e", "max_stars_repo_licenses": ["MIT"], "max_st...
#ifndef __ENVIRE_CORE_FRAME__ #define __ENVIRE_CORE_FRAME__ #include <boost/uuid/uuid.hpp> #include <boost/uuid/uuid_generators.hpp> #include <boost/intrusive_ptr.hpp> #include <vector> #include <string> #include <envire_core/ItemBase.hpp> #include <envire_core/RandomGenerator.hpp> namespace envire { namespace core ...
{"hexsha": "ec36c7fece7d5499243a4e48f51e0b530898acfd", "size": 1220, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "src/Frame.hpp", "max_stars_repo_name": "jhidalgocarrio/slam-envire_core", "max_stars_repo_head_hexsha": "4a1bc6b458989e39e4f16cab80777fdbb76cbff3", "max_stars_repo_licenses": ["BSD-2-Clause"], "max_...
#================================================================================================== # Project: Road Sign Search # File: SignSearch.py # Author: Stephen Deline # Description: The main processing class of the Road Sign Search program # This module takes in a provided input filename and output filena...
{"hexsha": "8fcfa26f5a3a71fc3d66cee13f9883025b39b725", "size": 10493, "ext": "py", "lang": "Python", "max_stars_repo_path": "Sign_Search/signSearch.py", "max_stars_repo_name": "ViridianLime/Road-Sign-Search", "max_stars_repo_head_hexsha": "252c5d1fff7d99dc48f6503308d99ad4bab3af1d", "max_stars_repo_licenses": ["MIT"], "...