text
stringlengths
0
1.25M
meta
stringlengths
47
1.89k
import numpy as np from sklearn import preprocessing import pandas as pd class K_Means: def __init__(self, k=2, tol=0.001, max_iter=300): self.k = k self.tol = tol self.max_iter = max_iter def fit(self, data): self.centroids = {} for i in range(self.k): sel...
{"hexsha": "1751e7ca791ea3c547d708e2277e700e6785461e", "size": 2916, "ext": "py", "lang": "Python", "max_stars_repo_path": "05. Clustering/ownAlgorithm-titanic-data.py", "max_stars_repo_name": "Rocamadour7/ml_tutorial", "max_stars_repo_head_hexsha": "1b7e562b41453d7b5de19a74180ef8fbd136dbb9", "max_stars_repo_licenses":...
section \<open>Examples\<close> (*<*) theory Examples imports Restrict_Frees_Impl begin (*>*) global_interpretation extra_cp: simplification cp cpropagated defines RB = "simplification.rb_impl_det cp" and assemble = "simplification.assemble cp" and SPLIT = "simplification.split_impl_det cp" by standar...
{"author": "isabelle-prover", "repo": "mirror-afp-devel", "sha": "c84055551f07621736c3eb6a1ef4fb7e8cc57dd1", "save_path": "github-repos/isabelle/isabelle-prover-mirror-afp-devel", "path": "github-repos/isabelle/isabelle-prover-mirror-afp-devel/mirror-afp-devel-c84055551f07621736c3eb6a1ef4fb7e8cc57dd1/thys/Safe_Range_RC...
from __future__ import print_function import numpy as np import matplotlib.pyplot as plt from teff_bv import teff2bv_orig import astropy.constants as const # Global parameters Gmin, Gmax = 5200, 6000 Gteff = .5 * (Gmin + Gmax) Kmin, Kmax = 3700, 5200 Kteff = .5 * (Kmin + Kmax) Mmin, Mmax = 2400, 3700 # Mmin, Mmax = 24...
{"hexsha": "0b7ec799e6265faabc0f89a57e4de10d490eb8a6", "size": 3310, "ext": "py", "lang": "Python", "max_stars_repo_path": "code/generate_cluster_files.py", "max_stars_repo_name": "RuthAngus/LSST-max", "max_stars_repo_head_hexsha": "88abfa4aedd5837c9d1f1b9e17a8fd2d1713488b", "max_stars_repo_licenses": ["MIT"], "max_sta...
import numpy as np import cv2 inputImg = cv2.imread('input.jpg', 0) flat = np.array(inputImg).flatten() cv2.imshow('input', inputImg) # size of the image(row, col) row = inputImg.shape[0] col = inputImg.shape[1] flattenSize = row * col # get sliding window and look ahead window sizes slidingWindow = int...
{"hexsha": "1c29daa89886356dd74486d80a4fe6067a3da7a7", "size": 2789, "ext": "py", "lang": "Python", "max_stars_repo_path": "encoding.py", "max_stars_repo_name": "AbdallahHemdan/LZ77-compression-algorithm", "max_stars_repo_head_hexsha": "03677b8c368bd7e84ea08dab9159c686e9fb3144", "max_stars_repo_licenses": ["MIT"], "max...
import tensorflow as tf from model.pooling import statistics_pooling, self_attention, ghost_vlad from model.common import prelu, shape_list from collections import OrderedDict from six.moves import range def tdnn_distill(features, params, is_training=None, reuse_variables=None, aux_features=None): """Build a TDNN n...
{"hexsha": "54e5da10d481a1e106dfe1f16c3b86c24ad078b2", "size": 30195, "ext": "py", "lang": "Python", "max_stars_repo_path": "model/ftdnn.py", "max_stars_repo_name": "ishine/tf-kaldi-speaker-master", "max_stars_repo_head_hexsha": "4b93110c4aa54f4764c58d9ffef3aec2efce39db", "max_stars_repo_licenses": ["Apache-2.0"], "max...
import numpy as np from gym import utils from gym.envs.mujoco import mujoco_env from gym.envs.mujoco.jaco import JacoEnv class JacoPickEnv(JacoEnv): def __init__(self, with_rot=1): super().__init__(with_rot=with_rot) self._config.update({ "pick_reward": 10, "random_box": 0...
{"hexsha": "4b0b41a7a779e9a0aefb796d5169303f7c5bc931", "size": 3378, "ext": "py", "lang": "Python", "max_stars_repo_path": "gym/gym/envs/mujoco/jaco_pick.py", "max_stars_repo_name": "youngwoon/DnC-RL-Tensorflow", "max_stars_repo_head_hexsha": "02dc2750fe301a01e3bd68b1e56fc7fd754c2f3f", "max_stars_repo_licenses": ["MIT"...
Require Import VST.msl.msl_standard. Require Import VST.msl.Coqlib2. Require Import Coq.ZArith.ZArith. Require Import VST.zlist.sublist. Set Implicit Arguments. Inductive fold_rel (A: Type) (f: A -> A -> A -> Prop): A -> list A -> A -> Prop := | fold_rel_nil: forall w, fold_rel f w nil w | fold_rel_cons: forall a l w...
{"author": "PrincetonUniversity", "repo": "VST", "sha": "7d3133f3ff626e3c98bec2bd603ac74af2aff6d9", "save_path": "github-repos/coq/PrincetonUniversity-VST", "path": "github-repos/coq/PrincetonUniversity-VST/VST-7d3133f3ff626e3c98bec2bd603ac74af2aff6d9/msl/sepalg_list.v"}
struct Archer name::String health::Int arrows::Int end struct Pikeman name::String health::Int end struct Knight name::String health::Int mounted::Bool end iswinner(a::Archer, b::Pikeman) = true iswinner(a::Archer, b::Knight) = false iswinner(a::Knight, b::Pikeman) = false function i...
{"hexsha": "8a023cd8051167c20189501576e9d66d161e7583", "size": 681, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "examples/multiple-dispatch.jl", "max_stars_repo_name": "ordovician/BattleSim", "max_stars_repo_head_hexsha": "d8d62c0e99c6752695268dab11a8358c49a74d47", "max_stars_repo_licenses": ["MIT"], "max_star...
import numpy as np import torch.nn as nn import torch.nn.functional as F from torch import Tensor from numpy import ndarray class FFNN(nn.Module): def __init__(self, X: ndarray, in_dropout=0.1, hidden_dropout=0.1): super().__init__() self.n_features = X.shape[1] self.N_CLASSES = 3 ...
{"hexsha": "66636bc55abdd1f946b9927d84b0a8e8ccc7a53a", "size": 1013, "ext": "py", "lang": "Python", "max_stars_repo_path": "genomics_gans/models.py", "max_stars_repo_name": "Unique-Divine/GANs-for-Genomics", "max_stars_repo_head_hexsha": "e023455ae7c18d5e624bb618184c41e91261a0e4", "max_stars_repo_licenses": ["MIT"], "m...
#!/usr/bin/env python #-*- coding: utf-8 -*- # Python 3.7 # # @Author: Jxtopher # @License: * # @Date: 2019-06 # @Version: 1 # @Purpose: https://en.wikipedia.org/wiki/Component_(graph_theory) # pip install networkx # import matplotlib.pyplot as plt import networkx as nx import numpy as np import random fro...
{"hexsha": "42cb3e8b19286abe74d83f7a08ba5603adc9b484", "size": 3792, "ext": "py", "lang": "Python", "max_stars_repo_path": "graph/connected-component/connected-component.py", "max_stars_repo_name": "Jxtopher/Results", "max_stars_repo_head_hexsha": "8e86c47dae4d68e8e881a80148b4d384bc1e0ecc", "max_stars_repo_licenses": [...
import numpy as np import pandas as pd np.random.seed(0) from keras.models import Model from keras.layers import Dense, Input, Dropout, LSTM, Activation, BatchNormalization,concatenate,Subtract, Dot, Multiply,Bidirectional,Lambda from keras.layers.embeddings import Embedding from keras.initializers import glorot_unifo...
{"hexsha": "e5b8841d204bf40c28eef925a1a50bb91a1686d4", "size": 7562, "ext": "py", "lang": "Python", "max_stars_repo_path": "Question-Pairs-Matching/siamese_lstm_with_distance_and_angle.py", "max_stars_repo_name": "ares5221/Question-Answer-Datasets", "max_stars_repo_head_hexsha": "7067bd7cbdddf1c09c5532e95a9e2d968533ab7...
import argparse import math import random import os import numpy as np from sklearn.metrics import roc_auc_score import torch from torch import nn, autograd, optim from torch.nn import functional as F from torch.utils import data import torch.distributed as dist from torchvision import transforms, utils f...
{"hexsha": "9c837a80fcfe94ebc1a18dc49fe917ba7c5ca6ee", "size": 11269, "ext": "py", "lang": "Python", "max_stars_repo_path": "train_texencoder_cxr14.py", "max_stars_repo_name": "cvlab-stonybrook/LSAE", "max_stars_repo_head_hexsha": "d2bdc1ee31fed68c96c3793b1373d446954d83b2", "max_stars_repo_licenses": ["MIT"], "max_star...
C Copyright(C) 1999-2020 National Technology & Engineering Solutions C of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with C NTESS, the U.S. Government retains certain rights in this software. C C See packages/seacas/LICENSE for details C==============================================================...
{"hexsha": "1b544a896f966c469a8d18d8ca160bace45df0ae", "size": 1612, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "packages/seacas/applications/gjoin/gj_munxyz.f", "max_stars_repo_name": "jschueller/seacas", "max_stars_repo_head_hexsha": "14c34ae08b757cba43a3a03ec0f129c8a168a9d3", "max_stars_repo_licenses": ["...
import itertools import logging import os import re import sys import pdb import matplotlib.pyplot as plt import matplotlib.ticker as mtick import numpy as np import pandas as pd import pygeoutil.util as util import constants import crop_stats import plots # Logging cur_flname = os.path.splitext(os.path.basename(__...
{"hexsha": "8bd7a59ccff0a15ff2a2e2ff7ba7675cde361e81", "size": 9833, "ext": "py", "lang": "Python", "max_stars_repo_path": "LUH2/GlobalCropRotations/crop_rotations.py", "max_stars_repo_name": "ritviksahajpal/LUH2", "max_stars_repo_head_hexsha": "aec79f737aebcaa273de5f8f1aeadd3317d03aa4", "max_stars_repo_licenses": ["MI...
import _pickle as cPickle import time import numpy as np from cognitive_programs.program_induction.argument_expansion import \ CondProgramModel from cognitive_programs.program_induction.tree_traversal import all_nodes_dfs, \ first_node_dfs, next_node_dfs def concept_search_n(concept): with open('share...
{"hexsha": "6aac8c98508bf02d39f0e21d8b9bd0a27347d091", "size": 3552, "ext": "py", "lang": "Python", "max_stars_repo_path": "cognitive_programs/program_induction/search_one_task.py", "max_stars_repo_name": "irom-lab/science_cognitive_programs", "max_stars_repo_head_hexsha": "f4df3dd151816dbd1d698f13653d051c8b4749e9", "m...
import numpy as np import torch import torch.utils.data from torch import nn, optim from torch.nn import functional as F from gsae.utils import eval_metrics # DEFINE THESE GLOBAL VARIABLES WITH YOUR OWN PATHS TO DATA ######################################## SEQ3_DATA_DIR = '' SEQ4_DATA_DIR = '' HIVTAR_DATA_DIR = '' ...
{"hexsha": "7952619ae3844ac0b36c3566ebb9a2737af62eb2", "size": 7587, "ext": "py", "lang": "Python", "max_stars_repo_path": "gsae/utils/load_splits.py", "max_stars_repo_name": "dbhaskar92/GSAE", "max_stars_repo_head_hexsha": "3340dfc38f95b29ff04d890d93deedf8dcae9324", "max_stars_repo_licenses": ["Apache-2.0"], "max_star...
import os, sys #os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID" os.environ["CUDA_VISIBLE_DEVICES"]="1" import numpy as np import pandas as pd import matplotlib.pyplot as plt import skimage.io from skimage.transform import resize from imgaug import augmenters as iaa from tqdm import tqdm import PIL from PIL import Image...
{"hexsha": "e6b24c866b8db3c5f1f7550a0da7d2cc44d0e16f", "size": 8344, "ext": "py", "lang": "Python", "max_stars_repo_path": "wienerschnitzelgemeinschaft/src/Christof/models/DenseNet121/1/snaps/train_f1_2.py", "max_stars_repo_name": "guitarmind/HPA-competition-solutions", "max_stars_repo_head_hexsha": "547d53aaca148fdb5f...
import math import numpy as np import modern_robotics as mr def saveLog(i, thetalist, Tsb, Vb, omg_b_norm, v_b_norm, isappend="w"): """ Creates a log.txt file with a report for each iteration of the Newton-Raphson process :param i: Iteration number :param thetalist: Join vector :param Tsb: The des...
{"hexsha": "150e9bf456ac27f4e7244cb583e84ca1303b7727", "size": 5146, "ext": "py", "lang": "Python", "max_stars_repo_path": "packages/Python/exercises/code/MR2RobotKinematicsProjectCode.py", "max_stars_repo_name": "YueErro/ModernRobotics", "max_stars_repo_head_hexsha": "82345c04157c1322b24553bf00abd1f2b03281a5", "max_st...
#ifndef STAN_MATH_TORSTEN_GENERALODEMODEL_BDF_HPP #define STAN_MATH_TORSTEN_GENERALODEMODEL_BDF_HPP #include <Eigen/Dense> #include <stan/math/torsten/PKModel/functors/general_functor.hpp> #include <stan/math/torsten/PKModel/PKModel.hpp> #include <stan/math/torsten/PKModel/Pred/Pred1_general.hpp> #include <stan/math/t...
{"hexsha": "b9c01e48191c5cf83a098b96de02462ad8180f7f", "size": 16358, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "cmdstan/stan/lib/stan_math/stan/math/torsten/generalOdeModel_bdf.hpp", "max_stars_repo_name": "yizhang-cae/torsten", "max_stars_repo_head_hexsha": "dc82080ca032325040844cbabe81c9a2b5e046f9", "max_s...
#include "engine/routing_algorithms/routing_base_mld.hpp" #include "engine/routing_algorithms/shortest_path_impl.hpp" #include "engine/search_engine_data.hpp" #include "util/integer_range.hpp" #include <boost/test/unit_test.hpp> namespace osrm { namespace engine { namespace routing_algorithms { // Declare offline da...
{"hexsha": "a9f6c617df95ddb986039879f9afd87141c347d6", "size": 14760, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "unit_tests/engine/offline_facade.cpp", "max_stars_repo_name": "AugustoQueiroz/pedalavel-backend", "max_stars_repo_head_hexsha": "c7fa405ff6f6823bdc9d4bb857eddc7197be1f4f", "max_stars_repo_licenses"...
import matplotlib matplotlib.use("Agg") from matplotlib.patches import Rectangle import matplotlib.colorbar as cbar import matplotlib.pyplot as plt from matplotlib.lines import Line2D import torch import gym import numpy as np from utils import helpers as utl from torchkit import pytorch_utils as ptu from sklearn.mani...
{"hexsha": "7c7e9775a6dae561144afc2b3ae0cd78991bec28", "size": 20203, "ext": "py", "lang": "Python", "max_stars_repo_path": "BOReL/utils/evaluation.py", "max_stars_repo_name": "hai-h-nguyen/pomdp-baselines", "max_stars_repo_head_hexsha": "629180d56641810d99653a116cca41ede65172eb", "max_stars_repo_licenses": ["MIT"], "m...
# licensed under a 3-clause bsd style license - see license.rst from __future__ import absolute_import, division, print_function, unicode_literals from astropy.coordinates import SkyCoord import astropy.units as u from regions import CircleSkyRegion __all__ = [ 'Target', ] class Target(object): """Observatio...
{"hexsha": "8b8f2c6eb7b51f08f327eaadfa3402eaf7acdcae", "size": 3056, "ext": "py", "lang": "Python", "max_stars_repo_path": "gammapy/data/target.py", "max_stars_repo_name": "gabemery/gammapy", "max_stars_repo_head_hexsha": "99e5c5d38e4920dddd7bca41fb1539ccda8bea2d", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_star...
#!/usr/bin/env python # coding: utf-8 import requests from PIL import Image import numpy as np import matplotlib.pyplot as plt from io import BytesIO import base64 import os import gradio as gr from dalle_mini.helpers import captioned_strip backend_url = os.environ["BACKEND_SERVER"] class ServiceError(Exception)...
{"hexsha": "e9cdec0214864eb1c97fc0b1d470e7381530d40c", "size": 2912, "ext": "py", "lang": "Python", "max_stars_repo_path": "app/gradio/app_gradio_ngrok.py", "max_stars_repo_name": "jonathanfrawley/dalle-mini", "max_stars_repo_head_hexsha": "f3670e020a916c0d592a7e18b5d6ec31bc10a244", "max_stars_repo_licenses": ["Apache-...
# coding: utf8 import scipy.misc from traits.api import TraitError from traitsui.api import Handler from pyface.api import AboutDialog, FileDialog, OK from AcquisitionThread import AcquisitionThread from IconFinder import find_icon class MainHandler(Handler): # Signal handlers def action_about(self, info): ...
{"hexsha": "d82e177cf318052d553ca3866c0f36d4d711bce3", "size": 2385, "ext": "py", "lang": "Python", "max_stars_repo_path": "beams/MainHandler.py", "max_stars_repo_name": "Yaccoub/Beams", "max_stars_repo_head_hexsha": "f3634980e1794d0ee2c537db329a9e2eb2481803", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 11, ...
import os import re import nltk import torch import argparse import numpy as np import allennlp_models.tagging import jiant.utils.python.io as py_io from nltk.corpus import stopwords from nltk.tokenize import word_tokenize from rich.progress import track from allennlp.predictors.predictor import Predictor stop_words...
{"hexsha": "b758ac2574c6c3a1e7c44f4261c34d0d0d659dad", "size": 2958, "ext": "py", "lang": "Python", "max_stars_repo_path": "analyze.py", "max_stars_repo_name": "eric11eca/inference-information-probing", "max_stars_repo_head_hexsha": "f55156201992cb024edf112e06dd2d7fe09381e4", "max_stars_repo_licenses": ["MIT"], "max_st...
[STATEMENT] lemma opar_comp_def': "s \<langle>\<langle>\<^bsub>i\<^esub> t = \<lparr> init = {(\<sigma>, (s\<^sub>l, t\<^sub>l))|\<sigma> s\<^sub>l t\<^sub>l. (\<sigma>, s\<^sub>l) \<in> init s \<and> t\<^sub>l \<in> init t}, trans = oparp_sos i (trans s) (trans t) \<rparr>" [PROOF STATE] proof (prove...
{"llama_tokens": 521, "file": "AWN_OAWN_SOS", "length": 2}
"""Hierarchical reduction""" import numpy as np from gameanalysis import paygame from gameanalysis import restrict from gameanalysis import rsgame from gameanalysis import utils from gameanalysis.reduction import _common def reduce_game(full_game, red_players): """Reduce a game using hierarchical reduction ...
{"hexsha": "250ecff528a729f84e6ff791bb9d4945c0ae3d4b", "size": 3504, "ext": "py", "lang": "Python", "max_stars_repo_path": "gameanalysis/reduction/hierarchical.py", "max_stars_repo_name": "egtaonline/GameAnalysis", "max_stars_repo_head_hexsha": "32be1a6b9f616e794362639367ad64360f3e118f", "max_stars_repo_licenses": ["Ap...
# v2 # 7/11/2018 import argparse import os import glob import numpy as np import cv2 import torch import traceback import sys import sklearn.feature_extraction.image import ttach as tta from QA_utils import get_torch_device from unet import UNet # -----helper function to split data into batches def divide_batch(l, ...
{"hexsha": "91411ffcf9663f95c21f8997ac26e4545c5b7641", "size": 7522, "ext": "py", "lang": "Python", "max_stars_repo_path": "make_output_unet_cmd.py", "max_stars_repo_name": "darshats/QuickAnnotator", "max_stars_repo_head_hexsha": "0dcab5dcc22ca7f5c8b3b823ae772bbd84b1d7a7", "max_stars_repo_licenses": ["BSD-3-Clause-Clea...
[STATEMENT] lemma inj_on_set_remdups'[simp]: "inj_on f (set (remdups' f xs))" [PROOF STATE] proof (prove) goal (1 subgoal): 1. inj_on f (set (remdups' f xs)) [PROOF STEP] by (induct xs) (auto split: option.splits simp add: find_None_iff dest!: mp_remdups')
{"llama_tokens": 114, "file": "MSO_Regex_Equivalence_List_More", "length": 1}
# Machine # ======= struct Node state::Int edges::Vector{Tuple{Edge,Node}} end function Node(state::Int) return Node(state, Tuple{Edge,Node}[]) end function Base.show(io::IO, node::Node) print(io, summary(node), "(<state=$(node.state),#edges=$(length(node.edges))>)") end function findedge(s::Node, b...
{"hexsha": "70f61fa15ec61842718b37e0ee92c8db5a02d984", "size": 2470, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/machine.jl", "max_stars_repo_name": "UnofficialJuliaMirrorSnapshots/Automa.jl-67c07d97-cdcb-5c2c-af73-a7f9c32a568b", "max_stars_repo_head_hexsha": "0fbb001b8f92f0360409317220e45932899c6106", "m...
import pandas as pd import numpy as np import config class Result: """ A class used to represent a Result. Attributes ---------- ticker : sequence The stock ticker. data : dataframe The historical data associated with the ticker. strategy : Strategy An instance of ...
{"hexsha": "0f6b371b0a16989746fb27292fcca20857d312e8", "size": 16411, "ext": "py", "lang": "Python", "max_stars_repo_path": "Result.py", "max_stars_repo_name": "jrandj/trading_strategy", "max_stars_repo_head_hexsha": "28e23dc510089c28bb8c420241d5660b474552bf", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 2, "...
#!/usr/bin/env python3 import subprocess import sys import io import numpy as np import pandas as pd #Интервал времени в секундах деления пакетов DATE_INTERVAL = 60 #Список конечных параметров для сравнения потоков. В коде помечены теми же числами для ориентирования FEATURES = [ 'client_package_size_mean', #1 Средни...
{"hexsha": "d2e9a6343592d1287f3285d32b5352afb847cda2", "size": 12282, "ext": "py", "lang": "Python", "max_stars_repo_path": "prepare_data.py", "max_stars_repo_name": "TheEshka/traffic_analyzer", "max_stars_repo_head_hexsha": "64dfc5768abb30b949781da346fc9d3fae64606a", "max_stars_repo_licenses": ["MIT"], "max_stars_coun...
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this so...
{"hexsha": "2dd8bd96f4b74bdfb274f25d810ddfd43dc44068", "size": 16343, "ext": "py", "lang": "Python", "max_stars_repo_path": "gui_utils/gl_utils.py", "max_stars_repo_name": "kazakh-shai/stylegan3", "max_stars_repo_head_hexsha": "68d83b5167b266c68415629c0bc687c714d0835e", "max_stars_repo_licenses": ["BSD-Source-Code"], "...
# -*- coding: utf-8 -*- """ Created on Sun Feb 07 14:31:53 2016 @author: Dominic O'Kane """ from math import exp, log, fabs from numba import njit, float64, int64 import numpy as np ############################################################################### from enum import Enum class FinInterpMethods(Enum): ...
{"hexsha": "d0ffb568ba326ac121d1b5c0178f715c601d3c9b", "size": 5456, "ext": "py", "lang": "Python", "max_stars_repo_path": "financepy/market/curves/FinInterpolate.py", "max_stars_repo_name": "suhasghorp/FinancePy", "max_stars_repo_head_hexsha": "567486785b33768f229a404e860f92fd042034a2", "max_stars_repo_licenses": ["BS...
from multiprocessing import Pool,Pipe,cpu_count,Manager from pandas import DataFrame import numpy as np import operator from STRATEGY.bk_strategy import * import pymysql import time def pysql_connect(): db = pymysql.connect("localhost", "root", "12345678", "qtsm") cursor = db.cursor() return {'db':db,'cur...
{"hexsha": "b215343466b566c41c0430cd6b7829582f36e023", "size": 5101, "ext": "py", "lang": "Python", "max_stars_repo_path": "BACKTEST/backtest.py", "max_stars_repo_name": "CJuanvip/quant-trading-system", "max_stars_repo_head_hexsha": "bfc3894f451d5046f004de53d5aa380efa2d2efb", "max_stars_repo_licenses": ["Apache-2.0"], ...
# ___________________________________________________________________________ # # EGRET: Electrical Grid Research and Engineering Tools # Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC # (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S. # Government retains certain r...
{"hexsha": "9acce0f353a6e7ff9f7b1809604a35ba8c926346", "size": 6073, "ext": "py", "lang": "Python", "max_stars_repo_path": "egret/models/tests/test_relaxations.py", "max_stars_repo_name": "bknueven/Egret", "max_stars_repo_head_hexsha": "37567c1ec3bc0072b61124ce46ceb28add9ad539", "max_stars_repo_licenses": ["BSD-3-Claus...
#!/usr/bin/env python """ Exercise 2 is about lazyflow, the lazy operations framework that lays the foundation for all ilastik workflows. The main feature of lazyflow is its laziness, which can be compared to lazy evaluation in functional languages. In general, data is only processed if it is really needed, which make...
{"hexsha": "96da8f6b377de3658dc884eeb0ece0166615c851", "size": 7032, "ext": "py", "lang": "Python", "max_stars_repo_path": "exercises/02/operator_usage.py", "max_stars_repo_name": "burgerdev/ilastik-tutorial", "max_stars_repo_head_hexsha": "e037a88e1fb68eac045dbfda44d21ab160e35647", "max_stars_repo_licenses": ["CC0-1.0...
from course_lib.Base.Recommender_utils import check_matrix, similarityMatrixTopK from course_lib.Base.BaseSimilarityMatrixRecommender import BaseItemSimilarityMatrixRecommender from course_lib.Base.IR_feature_weighting import okapi_BM_25, TF_IDF import numpy as np from sklearn.preprocessing import normalize as normal...
{"hexsha": "13abba4cf7bb682caf24c372f79c194e560ae9bd", "size": 2036, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/model/KNN/ItemKNNDotCFRecommender.py", "max_stars_repo_name": "riccardopoiani/recsys_2019", "max_stars_repo_head_hexsha": "47a44d2f7d85e76e31dacf4ba2e69721d010b6b8", "max_stars_repo_licenses":...
using Printf using Keyboard setmargin(6) function test_readkey() println() println("Press any key combination (^C to exit).") println("METAKEY, KEYCHAR, SPECIALKEY") while true r = readkey(prompt = "") r.metakey === Keyboard.METAKEYNAMES_TABLE.ctrl && r.keychar == 'C' && b...
{"hexsha": "14c153fc46008be1598d6ee9dde2e1683b5582ba", "size": 6906, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/testkeyboard.jl", "max_stars_repo_name": "johntrinder/Keyboard.jl", "max_stars_repo_head_hexsha": "e977d27a1e6704dd11561973c9805131671bf82d", "max_stars_repo_licenses": ["MIT"], "max_stars_cou...
""" aero_csm_component.py Created by NWTC Systems Engineering Sub-Task on 2012-08-01. Copyright (c) NREL. All rights reserved. """ import numpy as np from math import pi, gamma, exp from nrelcsm.utilities import smooth_abs, smooth_min, hstack from nrelcsm.config import * # NREL Cost and Scaling Model plant energy mo...
{"hexsha": "be5c640b7483e777cbabef9525fa4a533346c577", "size": 86721, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/nrelcsm/nrel_csm.py", "max_stars_repo_name": "WISDEM/NREL_CSM", "max_stars_repo_head_hexsha": "ef45233e98be99e540ac6f3fc372ab10aa6d66b9", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars...
# The Linear Classifier ```{eval-rst} Last updated |lastupdate| ``` [](https://colab.research.google.com/github/vanvalenlab/bebi205/blob/master/bebi205/notebooks/linear-classifier.ipynb) [](https://colab.research.google.com/github/vanvalenlab/bebi205/blob/master/bebi205/notebooks/linear-classifier-key.ipynb) To illus...
{"hexsha": "8780a0be254be93ce28b887962fdd5691af6d986", "size": 21942, "ext": "ipynb", "lang": "Jupyter Notebook", "max_stars_repo_path": "bebi205/notebooks/linear-classifier.ipynb", "max_stars_repo_name": "vanvalenlab/bebi205", "max_stars_repo_head_hexsha": "14f0d9d266b1fb329f34cc882c4f27778bca626a", "max_stars_repo_li...
[STATEMENT] lemma knows_Spy_Says [simp]: "knows Spy (Says A B X # evs) = insert X (knows Spy evs)" [PROOF STATE] proof (prove) goal (1 subgoal): 1. knows Spy (Says A B X # evs) = insert X (knows Spy evs) [PROOF STEP] by simp
{"llama_tokens": 103, "file": null, "length": 1}
// Copyright (c) 2009-2012 Bitcoin Developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "init.h" // for pwalletMain #include "bitcoinrpc.h" #include "ui_interface.h" #include "base58.h" #include "bip38.h" #in...
{"hexsha": "c66f114334f054fbfa70029841097d72cbac93db", "size": 6525, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "src/rpcdump.cpp", "max_stars_repo_name": "cybershrapnel/hyperfun", "max_stars_repo_head_hexsha": "104df8f015345263aeb68518a561177f45228af1", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1....
import os from operator import itemgetter import numpy as np import torch import yaml from torch.utils.data import Dataset from datasets.functions import read_video, create_jpg_image, read_csv, read_image, read_combine MMACT_YAML_CONFIG = 'mmact.yaml' class MmactDataset(Dataset): def __init__(self, modality, t...
{"hexsha": "b525af393034295c768ecaba592bd28304018c15", "size": 6069, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/datasets/mmact.py", "max_stars_repo_name": "gpatsiaouras/multimodal-har-thesis", "max_stars_repo_head_hexsha": "e2a7edf1efdedfdf3c9a81ad93383c39e728bd88", "max_stars_repo_licenses": ["MIT"], "...
#!/usr/bin python3 """ Face and landmarks detection for faceswap.py """ import logging from zlib import compress, decompress import cv2 import numpy as np from lib.aligner import Extract as AlignerExtract, get_align_mat, get_matrix_scaling logger = logging.getLogger(__name__) # pylint: disable=invalid-name class...
{"hexsha": "b253cad5840cac5c12991f9bcff051d5103f883a", "size": 36918, "ext": "py", "lang": "Python", "max_stars_repo_path": "faceswap/lib/faces_detect.py", "max_stars_repo_name": "huangjunxiong11/FaceMap", "max_stars_repo_head_hexsha": "f320ce517edcaa4d9963ad0571e686cbe07fdfbb", "max_stars_repo_licenses": ["MIT"], "max...
[STATEMENT] lemma system_if_mat_kernel: assumes sq_Q: "dim_row Q = dim_col Q" and v: "dim_row Q = dim_vec v" shows "(transpose_mat Q *\<^sub>v v = v) \<longleftrightarrow> v \<in> mat_kernel (transpose_mat (Q - (1\<^sub>m (dim_row Q))))" [PROOF STATE] proof (prove) goal (1 subgoal): 1. (Q\<^sup>T *\<^sub>v v = v) = (v...
{"llama_tokens": 1977, "file": "Berlekamp_Zassenhaus_Berlekamp_Type_Based", "length": 14}
""" Takes a directory with various semesters of "raw" catalog information, and synthesizes them into a "consensus" catalog containing the most recent version of each course. The related file is copied directly from the most recent semester. """ import os import sys import csv import re import pandas as pd import numpy...
{"hexsha": "d3b5383e351d2846a2218355e905722e4fe793aa", "size": 5742, "ext": "py", "lang": "Python", "max_stars_repo_path": "catalog_parse/consensus_catalog.py", "max_stars_repo_name": "georgiashay/fireroad-server2", "max_stars_repo_head_hexsha": "fe6be11d3aaa6496c5464a764ef9a4cbfcba1bd7", "max_stars_repo_licenses": ["M...
@with_kw mutable struct TrainingParams loss optimizer = ADAM(3f-4) regularizer = (π) -> 0 batch_size = 128 epochs = 80 update_every = 1 early_stopping = (info) -> false name = "" max_batches=Inf end Flux.Optimise.train!(π::N, loss::Function, p::TrainingParams; info = Dict()) where {...
{"hexsha": "01de1e104c3a9a6ddd290bf88fc9d2b61ddb5f9b", "size": 2157, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/training.jl", "max_stars_repo_name": "ancorso/Shard.jl", "max_stars_repo_head_hexsha": "77b3b891494ca7f12113d86854641404ac961ad6", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "...
# -*- encoding: utf-8 -*- """ The backend used for doctests This backend is active during doctests. It should mimic the behavior of the IPython command line as close as possible. Without actually launching image viewers, of course. EXAMPLES:: sage: from sage.repl.rich_output import get_display_manager sage: ...
{"hexsha": "869089c2c6d2acaf4eecb1c2e902c769058889b5", "size": 12537, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/sage/repl/rich_output/backend_doctest.py", "max_stars_repo_name": "fredstro/sage", "max_stars_repo_head_hexsha": "c936d2cda81ec7ec3552a3bdb29c994b40d1bb24", "max_stars_repo_licenses": ["BSL-1...
from types import TracebackType import numpy as np import pandas as pd from pygbif import registry, species, maps from pygbif import occurrences as occ import os import json import datetime class SRMGbifClient(): def __init__(self, species_list, taxon_keys, country, limit, file_path): self.species_list = ...
{"hexsha": "b427e497de15b63d83512c827f75aae943c636f0", "size": 2503, "ext": "py", "lang": "Python", "max_stars_repo_path": "pygbif_client/pygbif_client.py", "max_stars_repo_name": "thisishardik/srm-nature-vault-client", "max_stars_repo_head_hexsha": "87158fe4d72e072607cdaeef3ebb317678d0c605", "max_stars_repo_licenses":...
import numpy as np from neuronpp.cells.cell import Cell from neuronpp.utils.record import Record from agents.agent import Agent from populations.ebner_hebbian_population import EbnerHebbianPopulation from populations.ebner_modulatory_population import EbnerModulatoryPopulation class EbnerOlfactoryAgent(Agent): ...
{"hexsha": "bc43518ae298e976f6311bef0d070ab2849e3ba3", "size": 3396, "ext": "py", "lang": "Python", "max_stars_repo_path": "agents/ebner_olfactory_agent.py", "max_stars_repo_name": "wsredniawa/neuronpp_gym", "max_stars_repo_head_hexsha": "1a495cdd1a723973a70ef8fa33f3fdb86db95da7", "max_stars_repo_licenses": ["MIT"], "m...
{-# OPTIONS --cubical --no-import-sorts #-} module Number.Instances.QuoQ where open import Agda.Primitive renaming (_⊔_ to ℓ-max; lsuc to ℓ-suc; lzero to ℓ-zero) open import Cubical.Foundations.Everything renaming (_⁻¹ to _⁻¹ᵖ; assoc to ∙-assoc) open import Cubical.Foundations.Logic renaming (inl to inlᵖ; inr to inrᵖ...
{"hexsha": "c1ce00002b54748f21c8a7d19168f2fbf5bacd7d", "size": 32798, "ext": "agda", "lang": "Agda", "max_stars_repo_path": "agda/Number/Instances/QuoQ.agda", "max_stars_repo_name": "mchristianl/synthetic-reals", "max_stars_repo_head_hexsha": "10206b5c3eaef99ece5d18bf703c9e8b2371bde4", "max_stars_repo_licenses": ["MIT"...
# Copyright 2020 Google Inc. 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 applicable law or a...
{"hexsha": "cb9627216b29887ab712950637914c93152cf63b", "size": 13902, "ext": "py", "lang": "Python", "max_stars_repo_path": "tensorflow_transform/gaussianization.py", "max_stars_repo_name": "jechague/transform", "max_stars_repo_head_hexsha": "3338036a35de8d8fcaa8da294d2041e29ba62a5b", "max_stars_repo_licenses": ["Apach...
''' Class for creating various plots ''' from os.path import join import torch import numpy as np from matplotlib import pyplot as plt import matplotlib.font_manager from matplotlib import rc from sklearn.manifold import TSNE import umap from collections import OrderedDict from ..utils.io_utils import ResultsWriter fr...
{"hexsha": "9895cfaa05b828ff2fcd5f834ccc6425e9f6c38b", "size": 9106, "ext": "py", "lang": "Python", "max_stars_repo_path": "multiae/plot/plotting.py", "max_stars_repo_name": "alawryaguila/multiAE", "max_stars_repo_head_hexsha": "77a7ec2ad1a0226ba8a7045eb01a5a308f274f16", "max_stars_repo_licenses": ["MIT"], "max_stars_c...
""" 2D Directional Fourier filter test """ from iwatlas import sshdriver import numpy as np import matplotlib.pyplot as plt # Interpolate the amplitude onto a grid prior to DFF ### # xlims = (114,118) # ylims = (-12,-9.35) xlims = (122,124.5) ylims = (-15,-12.43) dx = 0.02 time = np.array([np.datetime64('2013-06-01...
{"hexsha": "8f8ca15086f8291650542e6c60c86b9e2a865c15", "size": 1294, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_dff2d.py", "max_stars_repo_name": "Yadidya5/iwatlas", "max_stars_repo_head_hexsha": "7cf2a8778b9ebefe564f93efe013d6d3743c94ec", "max_stars_repo_licenses": ["BSD-2-Clause"], "max_stars_c...
import logging import os import re from contextlib import contextmanager from itertools import cycle from importlib import import_module from typing import Callable, ContextManager, Dict, Iterable, Iterator, Optional, Tuple from cv2 import cv2 import numpy as np from ..utils.path import parse_type_path from ..utils.i...
{"hexsha": "cb5c3500a764ccb8a7c5835bc51ddb4f62ea0ac8", "size": 4379, "ext": "py", "lang": "Python", "max_stars_repo_path": "layered_vision/sources/api.py", "max_stars_repo_name": "Pandinosaurus/layered-vision", "max_stars_repo_head_hexsha": "d5204d7da6eab25d5cc40a3d93d8453758f6ccc9", "max_stars_repo_licenses": ["MIT"],...
import numpy as np import pandas as pd import nltk import re from bs4 import BeautifulSoup from sklearn.model_selection import train_test_split class BIO_Tagger(): ''' __init__ : INPUT- Mandatory - Data loading, and column definitions clean_text : changes can be made as per your requirement INPUT- te...
{"hexsha": "975ab903d2bb9f64061498241fd2dd2e8092e8d0", "size": 6451, "ext": "py", "lang": "Python", "max_stars_repo_path": "July_27_New Training Data/CLASS_BIO_Format_Tagging.py", "max_stars_repo_name": "mohit-bags/BERT-Notebooks", "max_stars_repo_head_hexsha": "71971a57d2e1eda701a93fa3bfcca75c2ec95ca8", "max_stars_rep...
""" Common functions for package biobb_vs.utils """ from pathlib import Path, PurePath import re import shutil import numpy as np import Bio.PDB import Bio.pairwise2 import Bio.SubsMat.MatrixInfo #from Bio.Align import substitution_matrices from Bio.Data.SCOPData import protein_letters_3to1 as prot_one_letter from biob...
{"hexsha": "0225e425071459443dcb3295b6a29eb72d718839", "size": 36240, "ext": "py", "lang": "Python", "max_stars_repo_path": "biobb_vs/utils/common.py", "max_stars_repo_name": "bioexcel/biobb_vs", "max_stars_repo_head_hexsha": "6f492d317b3783e6fd8468ca62883d1db7fa4bc6", "max_stars_repo_licenses": ["Apache-2.0"], "max_st...
import cv2 import numpy as np import matplotlib.pyplot as plt img = cv2.imread("imori.jpg").astype(np.float) H,W,C=img.shape a=1. b=0. c=0. d=1. tx = 30 ty = 30 y = np.arange(H).repeat(W).reshape(W, -1) x = np.tile(np.arange(W), (H, 1)) out =np.zeros((H+1,W+1,C),dtype=np.float32) x_new=a*x+b*y+tx y_new=c*x+d*y+ty ...
{"hexsha": "e7551c44f10542a3731d670c5d56bb79270c24e5", "size": 593, "ext": "py", "lang": "Python", "max_stars_repo_path": "Question_21_30/codes/question28.py", "max_stars_repo_name": "uehir0/Gasyori100knock", "max_stars_repo_head_hexsha": "a38d3c516f5f965822610edcf113f59412905c03", "max_stars_repo_licenses": ["MIT"], "...
# -*- coding: utf-8 -*- # Created on Tue Dec 24 16:49:20 2019 # @author: arthurd """ Route Module. Track - OSM network interactions. """ # Classic Library import networkx as nx import osmnx as ox # OSM import numpy as np import copy # for graph copy from pypro...
{"hexsha": "7f684b7d6c1d58e6e6ac065743ea7989a3975f98", "size": 7322, "ext": "py", "lang": "Python", "max_stars_repo_path": "noiseplanet/matcher/model/route.py", "max_stars_repo_name": "jks-liu/noiseplanet", "max_stars_repo_head_hexsha": "907b2bb9a93df48a266ad01c7cad0d8ef2367e78", "max_stars_repo_licenses": ["Apache-2.0...
classdef PrimalUpdaterFactory < handle methods (Access = public, Static) function p = create(cParams) switch cParams.optimizerNames.primal case 'SLERP' p = SLERP(cParams); case 'PROJECTED GRADIENT' p = Projecte...
{"author": "SwanLab", "repo": "Swan", "sha": "f8355f3561bb1a1603f56b3676873147d22a511e", "save_path": "github-repos/MATLAB/SwanLab-Swan", "path": "github-repos/MATLAB/SwanLab-Swan/Swan-f8355f3561bb1a1603f56b3676873147d22a511e/Topology Optimization/Optimizers/PrimalUpdater/PrimalUpdaterFactory.m"}
import pandas as pd import numpy as np from sklearn.preprocessing import LabelEncoder df = pd.read_csv('train(2).csv') df2 = df[["KitchenQual" , "BldgType"]] #LAbel Encoder le = LabelEncoder() data = le.fit_transform(df2["BldgType"]) print(data) df2["BldType_l_enc"] = data #count number of class in a column pr...
{"hexsha": "7f7356dcac238b97ce72ba31683942264a22953e", "size": 543, "ext": "py", "lang": "Python", "max_stars_repo_path": "preprocessing/label_ordianl_encoding.py", "max_stars_repo_name": "Kunal614/Machine-Learning", "max_stars_repo_head_hexsha": "26b3e0f3397ddb524c96c5b6c99b173b6fc80501", "max_stars_repo_licenses": ["...
import numpy as np if __name__ == '__main__': a = np.array([[0, 1, 2], [1, 2, 3], [3, 4, 5], [1, 2, 3]]) b = np.array([[2], [2], [2], [2]]) print(a.shape) print(b.shape) print(np.multiply(a, b))
{"hexsha": "f5aa40131e0415afafa84a69cb81c1e801ff2bb9", "size": 216, "ext": "py", "lang": "Python", "max_stars_repo_path": "Util/test.py", "max_stars_repo_name": "Golden-Slumber/GIANT-Python-Code", "max_stars_repo_head_hexsha": "0e15bcd0ec2db8b520697f02be010ee71e02c3d4", "max_stars_repo_licenses": ["MIT"], "max_stars_co...
[STATEMENT] lemma fct_gen_subalgebra_cong: assumes "space M = space P" and "sets N = sets Q" shows "fct_gen_subalgebra M N X = fct_gen_subalgebra P Q X" [PROOF STATE] proof (prove) goal (1 subgoal): 1. fct_gen_subalgebra M N X = fct_gen_subalgebra P Q X [PROOF STEP] proof - [PROOF STATE] proof (state) goal (1 su...
{"llama_tokens": 692, "file": "DiscretePricing_Generated_Subalgebra", "length": 9}
""" batch.py Widgets for batch processing videos. """ import os import pickle import time from datetime import datetime import motmot.FlyMovieFormat.FlyMovieFormat as FMF import numpy as np from PyQt5.QtCore import (pyqtSignal, pyqtSlot, Qt, QSize, QThread) from PyQt5.QtGui import (QPixmap) from PyQt5...
{"hexsha": "24ca0c5beed12235d951c19d8384c498c168b021", "size": 63563, "ext": "py", "lang": "Python", "max_stars_repo_path": "courtship/app/widgets/batch.py", "max_stars_repo_name": "regginold/drosophila-courtship", "max_stars_repo_head_hexsha": "a40249ee538a73f66b25d55c47e06f8505ba10f2", "max_stars_repo_licenses": ["MI...
#!/usr/bin/env python ################################################################################ # # # PLOTS SOME QUANTITIES CALCULATED IN-SITU # # ...
{"hexsha": "6e396cae8411396373bfb133be1421cda869b97f", "size": 4410, "ext": "py", "lang": "Python", "max_stars_repo_path": "script/analysis/diag.py", "max_stars_repo_name": "soumide1102/nubhlight", "max_stars_repo_head_hexsha": "85046add8b7e2c1419538864eb54205d33078772", "max_stars_repo_licenses": ["BSD-3-Clause"], "ma...
import numpy as np import matplotlib.pyplot as plt import sys import pandas as pd import seaborn as sns run_or_load = 'run' ### -------- # Defaults ### -------- print('set defaults') rootdir = 'myPath' tracts_df = pd.DataFrame(columns=('species', 'hemi', 'tract', 'tract_name')) tracts_df.loc[len(tracts_df)] = ['hum...
{"hexsha": "6f73bf3315d652a558b1f679fa63c90d3ef10ba5", "size": 6213, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/plot_metrics.py", "max_stars_repo_name": "elifesciences-publications/project_msm", "max_stars_repo_head_hexsha": "f9f8cee0c5207c57a80ef0b395a5d17bc6b52b1a", "max_stars_repo_licenses": ["MI...
#!/usr/bin/env python # # Copyright 2012-2019 CNRS-UM LIRMM, CNRS-AIST JRL # import hashlib import os GEN_DIMS = [2,3,4,6] def n2c(n): t = "" if n == -1: t = "dynamic" elif n == 1: t = "one" elif n == 2: t = "two" elif n == 3: t = "three" elif n == 4: t = "four" elif n == 6: t ...
{"hexsha": "e2322ffff2b9f19a644291bad353dab4edb7a69b", "size": 23959, "ext": "py", "lang": "Python", "max_stars_repo_path": "utils/generate_eigen_pyx.py", "max_stars_repo_name": "RyodoTanaka/Eigen3ToPython", "max_stars_repo_head_hexsha": "6bb9e44be553e996541b019c1d5aefcdbdfcb482", "max_stars_repo_licenses": ["BSD-2-Cla...
""" matte_example(example, path; force = false, activate = true) Create a new Matte app, based on the example specified by `example`. See the manual for a list of examples that you can use here. `path` should be a folder that doesn't exist. If it doesnt, you can use `force = true` to overwrite. `activate` contro...
{"hexsha": "32c14b3781dab3ced7221fe8c7df85a4b88c303d", "size": 1349, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/usethis.jl", "max_stars_repo_name": "cyberbryce/Matte.jl", "max_stars_repo_head_hexsha": "fa12e3d807043e0aea69ff78263fa0fc64d84e26", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 71, "...
import base64 import json import cv2 import numpy as np from decouple import config from flask import Flask, request from api.face import FaceVerification from db.mongo import FaceEncodings app = Flask(__name__) face_verification = FaceVerification( FaceEncodings( config("DATABASE_URI") ) ) @app.r...
{"hexsha": "a1598c87fa86cafa50f3fc423b523b699932eeaf", "size": 1507, "ext": "py", "lang": "Python", "max_stars_repo_path": "app.py", "max_stars_repo_name": "MZO9400/FaceAuth", "max_stars_repo_head_hexsha": "0b18b3cf425b09e0fac3ee1064c74b654bcb8aba", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_star...
import pygame from pygame import draw import pygame.display import pygame.mixer from pygame import gfxdraw, init import numpy as np import pysprint_car import pysprint_tracks import random import json #New awesome imports from shazz from managers.sample_manager import SampleManager from pathlib import Path from loguru...
{"hexsha": "6ac54580c7a7707bf7e21045d9589f8e747b11c3", "size": 133205, "ext": "py", "lang": "Python", "max_stars_repo_path": "pysprint.py", "max_stars_repo_name": "elfosardo/PySprint", "max_stars_repo_head_hexsha": "2d74b7944d92d041d0cfdf34140d2fe148a68d14", "max_stars_repo_licenses": ["CC0-1.0"], "max_stars_count": nu...
C C NUMERICAL MATHEMATICS AND COMPUTING, CHENEY/KINCAID, (c) 1985 C C FILE: rk4sys.f C C RUNGE-KUTTA METHOD OF ORDER 4 FOR A SYSTEM OF ODE'S (RK4SYS,XPSYS) C DOUBLE PRECISION X,T,H DIMENSION X(3) DATA N/3/, T/0.0/, X/8.5,3.1,1.2/ DATA H/1E-10/, NSTEP/20000000/ CALL RK4SYS(N,T,X,H,NST...
{"hexsha": "d47e532980e70e7bf43c22ada9452c3879bc25cb", "size": 1387, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "Modules/ego_planner/ego-planner-swarm/src/uav_simulator/so3_quadrotor_simulator/include/ode/libs/numeric/odeint/performance/rk4_lorenz.f", "max_stars_repo_name": "473867143/Prometheus", "max_stars...
"""Utility functions for match.scripts""" from __future__ import print_function import logging import os import re import sys import numpy as np try: from .fileio import read_binned_sfh except SystemError: from fileio import read_binned_sfh logger = logging.getLogger() __all__ = ['check_boundaries', 'strip...
{"hexsha": "b6e206ddbf5c06d6352d6a6712eb08ec445f0759", "size": 9612, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/utils.py", "max_stars_repo_name": "kmcquinn/match", "max_stars_repo_head_hexsha": "e92a23de28eab13b6b01c5d8fc48086bc1551bd7", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "...
#include <boost/test/unit_test.hpp> #ifndef ING_TEST_SOURCE_LOCATION #define ING_TEST_SOURCE_LOCATION no_std #define ING_NO_STD_SOURCE_LOCATION #endif #include <ing/source_location.hpp> BOOST_AUTO_TEST_SUITE(ING_TEST_SOURCE_LOCATION) BOOST_AUTO_TEST_CASE(current_source_location) { ing::source_location macro = I...
{"hexsha": "fb63d26d630b0d50ce0458bf8fef25c11624f522", "size": 1103, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "test/test_source_location.cpp", "max_stars_repo_name": "huangqinjin/ing", "max_stars_repo_head_hexsha": "433ae68a979f6d79a2fe80bfa65fd8fc6fadd2ee", "max_stars_repo_licenses": ["BSL-1.0"], "max_stars...
import numpy as np import tensorflow as tf from tensorflow.python.client.session import Session from utils.model_utils import ( keras_serializable, get_initializer, shape_list, TFConv1D, TFSharedEmbeddings, input_processing ) from utils.activation import get_activation from config.config_gpt2...
{"hexsha": "d827d80a4304655e87cfa99cc17cb0bc75ed5b5c", "size": 18410, "ext": "py", "lang": "Python", "max_stars_repo_path": "model/gpt2.py", "max_stars_repo_name": "ChristianLin0420/Simulating-Brain-signal-to-control-Hand-Movement-using-GPT2", "max_stars_repo_head_hexsha": "cb2e441a81f947ba17bb921f4b374953ecf6818c", "m...
function hellofunc(name, len) implicit none integer(8) hellofunc integer len character(len=len), intent(in) :: name write(*,*) '[VH libvhhello_f.so:hellofunc] 1starg:', name write(*,*) '[VH libvhhello_f.so:hellofunc] 2ndarg:', len hellofunc = 999 return end fu...
{"hexsha": "73d1d6a67fed6d6cc8b4ac6490eb90904ae9a4f7", "size": 576, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "examples/vhcall/libvhhello.f", "max_stars_repo_name": "veos-sxarr/libsysve", "max_stars_repo_head_hexsha": "361110a48b2b3746278309b6f76444a9b1349629", "max_stars_repo_licenses": ["MIT"], "max_stars...
/** * @copyright Copyright 2018 The J-PET Framework 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 find a copy of the License in the LICENCE file. * * Unless required by applicable la...
{"hexsha": "9e639a061de7b918a4c5c3151896cb35e4720b48", "size": 6532, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "LargeBarrelAnalysis/UniversalFileLoader.cpp", "max_stars_repo_name": "kdulski/j-pet-framework-examples", "max_stars_repo_head_hexsha": "ab2592a2c6cf8f901f5732f8878b750b9a7b6a49", "max_stars_repo_lic...
module TestMacrosGroupBy import Test: @testset, @test import Volcanito: @group_by, materialize import DataFrames: DataFrame, groupby @testset "@group_by" begin df = DataFrame( a = [1, 2, 3, 4], b = [2, 3, 4, 5], ) plan = @group_by(df, a) res = materialize(plan) @test res == group...
{"hexsha": "11e808be4abe323dd56e890e1266e015b1176035", "size": 340, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/query/macros/group_by.jl", "max_stars_repo_name": "johnmyleswhite/Volcanito.jl", "max_stars_repo_head_hexsha": "d182ea3715016e3ef215cd54e8737ef422132350", "max_stars_repo_licenses": ["MIT"], "m...
subsection \<open>The view-partitioning equivalence relation\<close> theory Step_vpeq imports Step Step_invariants begin text \<open>The view consists of \begin{enumerate} \item View of object values. \item View of subject-subject dynamic policy. The threads can discover the policy at runtime, e.g. by cal...
{"author": "data61", "repo": "PSL", "sha": "2a71eac0db39ad490fe4921a5ce1e4344dc43b12", "save_path": "github-repos/isabelle/data61-PSL", "path": "github-repos/isabelle/data61-PSL/PSL-2a71eac0db39ad490fe4921a5ce1e4344dc43b12/SeLFiE/Example/afp-2020-05-16/thys/CISC-Kernel/step/Step_vpeq.thy"}
#' Horizontal error bars #' #' A rotated version of [geom_errorbar()]. #' #' @eval rd_aesthetics("geom", "errorbarh") #' @inheritParams layer #' @inheritParams geom_point #' @export #' @examples #' df <- data.frame( #' trt = factor(c(1, 1, 2, 2)), #' resp = c(1, 5, 3, 4), #' group = factor(c(1, 2, 1, 2)), #' se...
{"hexsha": "91d3569e863dca67cbca5c1688e137f996762ae7", "size": 2342, "ext": "r", "lang": "R", "max_stars_repo_path": "R/geom-errorbarh.r", "max_stars_repo_name": "mjskay/ggplot2", "max_stars_repo_head_hexsha": "5d31bba13cfdd83baa8dd20c2fd43e6d18d562f2", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 2, "max_sta...
int_rules_3_1_2 = @theory begin #= ::Subsection::Closed:: =# #= 3.1.2*(d*x)^m*(a+b*log(c*x^n))^p =# @apply_utils Antiderivative((~(a') + ~(b') * log(~(c') * (~x) ^ ~(n'))) / ~x, ~x) => (~a + ~b * log(~c * (~x) ^ ~n)) ^ 2 / (2 * ~b * ~n) <-- FreeQ([~a, ~b, ~c, ~n], ~x) @apply_utils Antiderivative((~(a')...
{"hexsha": "c0fb8d0cc02739ad6a34a3d8482df9684ea3ac4b", "size": 3529, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/rules/3 Logarithms/3.1.2 (d x)^m (a+b log(c x^n))^p.jl", "max_stars_repo_name": "gronniger/RubiSymbolics.jl", "max_stars_repo_head_hexsha": "dd117985dea699be7ddf14c3e6bdf4f407bb8da6", "max_star...
* MB02ID EXAMPLE PROGRAM TEXT * Copyright (c) 2002-2020 NICONET e.V. * * .. Parameters .. INTEGER NIN, NOUT PARAMETER ( NIN = 5, NOUT = 6 ) INTEGER KMAX, LMAX, MMAX, NMAX, RBMAX, RCMAX PARAMETER ( KMAX = 20, LMAX = 20, MMAX = 20, NMAX = 20, $ ...
{"hexsha": "a2e5ee32e1c65ab13f73363e9261b0a417e5219e", "size": 3790, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "examples/TMB02ID.f", "max_stars_repo_name": "bnavigator/SLICOT-Reference", "max_stars_repo_head_hexsha": "7b96b6470ee0eaf75519a612d15d5e3e2857407d", "max_stars_repo_licenses": ["BSD-3-Clause"], "m...
# model visualization with tensorboard import tensorflow as tf from tensorflow import keras from utils import norm_zero_centred, norm_to_one import numpy as np from model import ResNet from argparse import ArgumentParser parser = ArgumentParser() parser.add_argument("-gpu", dest="gpu", type=int, default=3) parser....
{"hexsha": "c9f157d6667dad5f6677b5bd9e86500ce6975b79", "size": 3250, "ext": "py", "lang": "Python", "max_stars_repo_path": "tensor_resnet.py", "max_stars_repo_name": "mknw/mask-rcnn", "max_stars_repo_head_hexsha": "0e7d14abeecb208e63dc5a9f7c05dbd0419afbe7", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "...
""" TMatrix <: SMatrix{4, 4, T} A custom `SMatrix` subtype that represents the `T` matrix from [Clemmow1954] that is semi-sparse. The form of the matrix is: ``` ┌ ┐ | T₁₁ T₁₂ 0 T₁₄ | | 0 0 1 0 | | T₃₁ T₃₂ 0 T₃₄ | | T₄₁ T₄₂ 0 T₄₄ | └ ┘ ``` `TMatrix` implements efficient mat...
{"hexsha": "efecd655aefffaf42d595357fb5c40a70352022b", "size": 10201, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/TMatrix.jl", "max_stars_repo_name": "fgasdia/LongwaveModePropagator.jl", "max_stars_repo_head_hexsha": "d99750b7e248f93c36beb9a291e6481da08bb8c9", "max_stars_repo_licenses": ["MIT"], "max_star...
# -*- coding: utf-8 -*- """ this script counts # of buggy files from the group of tested product codes. this script also counts # of buggy files from the group of not-tested product codes. you have to the full path of the SZZnized git repo before execution. input: SZZnized git repo. output: buggy_file_list.txt ...
{"hexsha": "d60551153c78bdc8d957c1ff6b391fcb10e42d1f", "size": 1240, "ext": "py", "lang": "Python", "max_stars_repo_path": "IWESEP2016/bug_count/buggy_file_counter.py", "max_stars_repo_name": "hideshis/scripts_for_research", "max_stars_repo_head_hexsha": "f633bdef0f9b959d7b18c8b95f169306eb8bb50d", "max_stars_repo_licen...
import numpy as np def simple_discrete_reward(result, sc=None): if result[1] > 0: scenario_reward = -1.0 elif result[0] > 0: scenario_reward = 1.0 else: scenario_reward = 0.0 return scenario_reward def simple_continuous_reward(result, sc=None): failure_count = result[0] ...
{"hexsha": "20aeaf4f5547e6e147d760e1a69411d3ef8e3faa", "size": 2580, "ext": "py", "lang": "Python", "max_stars_repo_path": "reward.py", "max_stars_repo_name": "jlousada315/RETECS", "max_stars_repo_head_hexsha": "2b8a974690a8e4dee9137c9988763ea0553630b3", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 4, "max_st...
# -*- coding: utf-8 -*- """ Spyder Editor This is a temporary script file. """ import os, sys, urllib, re, string, nltk import pandas as pd import numpy as np from pathlib import Path from tqdm import tqdm from html.parser import HTMLParser from nltk.stem.snowball import SnowballStemmer from sklearn.feature_extracti...
{"hexsha": "57e864f88d9b2ed998b51151ed2b9a788cd40435", "size": 5596, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/extract_feature_MDAs.py", "max_stars_repo_name": "albigrucci/textual-analysis-replication-financial-contraints", "max_stars_repo_head_hexsha": "917f0eef749c7999e793813ea62fa4899f9fb338", "max_...
import jax import jax.numpy as jnp import numpy as np from emlp.reps import T, Rep, Scalar from emlp.reps import bilinear_weights # from emlp.reps import LinearOperator # why does this not work? from emlp.reps.linear_operator_base import LinearOperator from emlp.reps.product_sum_reps import SumRep from emlp.groups impo...
{"hexsha": "225c1fe33519b738af66e63a4faa99cb8143eb3c", "size": 5621, "ext": "py", "lang": "Python", "max_stars_repo_path": "emlp/nn/flax.py", "max_stars_repo_name": "marcelroed/equivariant-MLP", "max_stars_repo_head_hexsha": "453d948055936aab3e718c36863c2db318c038ce", "max_stars_repo_licenses": ["MIT"], "max_stars_coun...
# -*- coding: utf-8 -*- """ A helper function to ternary plot. """ # # written by Chengcheng Shao <sccotte@gmail.com> import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np from ternary.helpers import simplex_iterator def heatmap_density(X, Y, Z, scale, boundary=True): """ A function to...
{"hexsha": "7ab28adbe870e554a407de945b939127b6e02113", "size": 2016, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/ternary_heatmap_helper.py", "max_stars_repo_name": "glciampaglia/HoaxyBots", "max_stars_repo_head_hexsha": "db8d2b7d9927d5d4d94ded125f9785590dace906", "max_stars_repo_licenses": ["MIT"], "...
SUBROUTINE atimes_sp(x,r,itrnsp) USE mo_kind, only: sp, i4 USE mo_nrutil, ONLY : assert_eq use mo_nr, ONLY : sprsax,sprstx USE xlinbcg_data_sp REAL(SP), DIMENSION(:), INTENT(IN) :: x REAL(SP), DIMENSION(:), INTENT(OUT) :: r INTEGER(I4), INTENT(IN) :: itrnsp INTEGER(I4) :: n n=assert_eq(size(x),size(r)...
{"hexsha": "b3d000b7da8aa1cb25fff3d4fa1eac3274278778", "size": 900, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "nr_jams/atimes.f90", "max_stars_repo_name": "mcuntz/jams_fortran", "max_stars_repo_head_hexsha": "a1dcab78eda21f930aa6c8c3633598a522f01659", "max_stars_repo_licenses": ["MIT"], "max_stars_count":...
import os import sys sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) from smartphone_connector import Connector import numpy as np from examples.server_address import SERVER_ADDRESS device = Connector(SERVER_ADDRESS, 'FooBar') grid1 = np.transpose([[1, 2, 3], [1, 2, 3], [1, 2, 3]]) ...
{"hexsha": "46418baac3266b1589e662a855e4aa86d4979bf6", "size": 641, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/latest_grid.py", "max_stars_repo_name": "lebalz/smartphone-connector", "max_stars_repo_head_hexsha": "303cbdb851416c1da7329e7bae2ee4a12aa7f5b0", "max_stars_repo_licenses": ["MIT"], "max_st...
k# -*- coding: utf-8 -*- import sys from colorama import Fore, Back # Style from tqdm import tqdm import time import numpy blad = 1 blad1 = True for i in tqdm(range(100)): time.sleep(0.005) for i in tqdm(range(87)): time.sleep(0.005) for i in tqdm(range(75)): time.sleep(0.005) for i in tqdm(range(62)): ...
{"hexsha": "bb500abad6c946bedaebce24df738b460268eee4", "size": 23411, "ext": "py", "lang": "Python", "max_stars_repo_path": "kalkulator v 1.7.py", "max_stars_repo_name": "Krecik-dev/kalkulator-PL", "max_stars_repo_head_hexsha": "e2650e142afa0b831519dfee149175591f452540", "max_stars_repo_licenses": ["CC0-1.0"], "max_sta...
function update_visualization_func = show_video(img_files, video_path, resize_image) %SHOW_VIDEO % Visualizes a tracker in an interactive figure, given a cell array of % image file names, their path, and whether to resize the images to % half size or not. % % This function returns an UPDATE_VISUALIZATION functi...
{"author": "ihpdep", "repo": "samf", "sha": "9dbc25bca08cd269a3c080e3143c9e9981b89966", "save_path": "github-repos/MATLAB/ihpdep-samf", "path": "github-repos/MATLAB/ihpdep-samf/samf-9dbc25bca08cd269a3c080e3143c9e9981b89966/show_video.m"}
# -*- mode: python; coding: utf-8 -* # Copyright (c) 2018 Radio Astronomy Software Group # Licensed under the 2-clause BSD License """Tests for HDF5 object """ from __future__ import absolute_import, division, print_function import os import six import numpy as np import pytest from astropy.time import Time import h...
{"hexsha": "eb4febee17366e4c6a48ffbdd911f5c5d301ab09", "size": 79261, "ext": "py", "lang": "Python", "max_stars_repo_path": "pyuvdata/tests/test_uvh5.py", "max_stars_repo_name": "ntk688/pyuvdata", "max_stars_repo_head_hexsha": "96be086324ba8f35815dd590429c6415411c15ea", "max_stars_repo_licenses": ["BSD-2-Clause"], "max...
import argparse import glob import os import os.path as op import sys import time try: from PyQt4 import QtGui, QtCore except ImportError: from PySide import QtGui, QtCore Qt = QtCore.Qt import numpy as np import pyqtgraph from pyqtgraph import dockarea import mt import utils def respfunc_viewer(path): ...
{"hexsha": "8fa26d8bb36a293adc8b74ff73f850fdf09304e2", "size": 9579, "ext": "py", "lang": "Python", "max_stars_repo_path": "mtwaffle/rfviewer.py", "max_stars_repo_name": "leomiquelutti/mtwaffle", "max_stars_repo_head_hexsha": "99f769a5796c27adf0dd7e8c30fecadec4fa9581", "max_stars_repo_licenses": ["MIT"], "max_stars_cou...
[STATEMENT] lemma TID_sym: "turn_into_distance f x y = turn_into_distance f y x" [PROOF STATE] proof (prove) goal (1 subgoal): 1. turn_into_distance f x y = turn_into_distance f y x [PROOF STEP] proof - [PROOF STATE] proof (state) goal (1 subgoal): 1. turn_into_distance f x y = turn_into_distance f y x [PROOF STEP]...
{"llama_tokens": 5304, "file": "Gromov_Hyperbolicity_Gromov_Boundary", "length": 44}
import matplotlib.pyplot as plt import numpy as np from sklearn.cluster import _kmeans from sklearn.metrics.pairwise import check_pairwise_arrays, euclidean_distances def new_euclidean_distances(X, Y=None, Y_norm_squared=None, squared=False): """ k-means で用いる独自の距離関数。 n_features が 3 以上で、X[:, :2] が coo...
{"hexsha": "0ff3848b548fe56ff6b68b632fd8ea8e6bea2c24", "size": 3355, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/pkg/my_kmeans.py", "max_stars_repo_name": "goat1010/astronomy-anomaly", "max_stars_repo_head_hexsha": "7061327b7e3b0a0e3db2ec68553c3553626b219e", "max_stars_repo_licenses": ["MIT"], "max_stars...
### A Pluto.jl notebook ### # v0.18.4 using Markdown using InteractiveUtils # ╔═╡ 89efa14e-b00c-11ec-09fe-15316ef94166 1+1 # ╔═╡ 00000000-0000-0000-0000-000000000001 PLUTO_PROJECT_TOML_CONTENTS = """ [deps] """ # ╔═╡ 00000000-0000-0000-0000-000000000002 PLUTO_MANIFEST_TOML_CONTENTS = """ # This file is machine-gene...
{"hexsha": "a3f1c0b134f9b69300bdc8fc886404980a346732", "size": 566, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test.jl", "max_stars_repo_name": "seoyeonc/julia", "max_stars_repo_head_hexsha": "31891941736b4794ff4adf796b8cdd3b500c8921", "max_stars_repo_licenses": ["Unlicense"], "max_stars_count": null, "max_s...
import numpy as np # Can't do this bc of circular imports: #from instResp.libInst import getResponse import instResp ''' This module contains a collection of non-bulletproof codes for creating/manipulating instrument response stages, particularly the first stage = analog polezero stage. polezero is ...
{"hexsha": "6f931a9140216a9fbf3ab7bf174ba6fdb02f1077", "size": 3229, "ext": "py", "lang": "Python", "max_stars_repo_path": "instResp/polezero.py", "max_stars_repo_name": "mikehagerty/instResp", "max_stars_repo_head_hexsha": "3feb7a1b3db2e539f7aecf6492439f92adb70e01", "max_stars_repo_licenses": ["MIT"], "max_stars_count...
""" HMCSampling(;ϵ::T=1e-5,nBurnin::Int=100,thinning::Int=10) Draw samples from the true posterior via Hamiltonian Monte Carlo. ## Keywords arguments - `ϵ::T` : convergence criteria - `nBurnin::Int` : Number of samples discarded before starting to save samples - `thinning::Int` : Frequency of sampling """ mutable...
{"hexsha": "69e8a08239e1d2597280691dd08b23aa9261434f", "size": 3433, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/inference/hmcsampling.jl", "max_stars_repo_name": "theogf/DataAugmentedModels.jl", "max_stars_repo_head_hexsha": "74169ce2fa55edb65cc2b11a89cbe11c0c99e2f5", "max_stars_repo_licenses": ["MIT"], ...