text
stringlengths
0
1.25M
meta
stringlengths
47
1.89k
""" output_type(f, arg_types...) Return the output type of the specified function. Tries to be fast where possible. """ output_type(f, arg_types...) = Union{Base.return_types(f, arg_types)...} output_type(::typeof(-), x) = x # TODO more efficient versions for common exp & log cases output_type(::typeof(+), x, y)...
{"hexsha": "9e0c7feb2c9ad1ab66b5a43ce18e2c8bd7b76621", "size": 742, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/output_type.jl", "max_stars_repo_name": "invenia/TimeDag.jl", "max_stars_repo_head_hexsha": "aa81512796f087815027c67dba4ab3766590a439", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 16,...
Require Export RelDefinitions. Require Export RelOperators. Require Export Relators. Require Import Delay. (** ** The [monotonicity] tactic *) (** The purpose of the [monotonicity] tactic is to automatically select and apply a theorem of the form [Monotonic ?m ?R] in order to make progress when the goal is an app...
{"author": "CertiKOS", "repo": "coqrel", "sha": "71699719ffd1cd8202e8ffeaf0faf890c765105a", "save_path": "github-repos/coq/CertiKOS-coqrel", "path": "github-repos/coq/CertiKOS-coqrel/coqrel-71699719ffd1cd8202e8ffeaf0faf890c765105a/Monotonicity.v"}
@testset "Demultiplexer" begin function randdna(n) return LongDNASeq(rand([DNA_A, DNA_C, DNA_G, DNA_T, DNA_N], n)) end function make_errors(seq, p=0.03) seq = copy(seq) nucs = DNA['A', 'C', 'G', 'T', 'N'] i = 1 while i ≤ lastindex(seq) if rand() < p ...
{"hexsha": "fd9ab72d5fb1167491810b20c8e3253cf79a44e9", "size": 4142, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/demultiplexer.jl", "max_stars_repo_name": "cjprybol/BioSequences.jl", "max_stars_repo_head_hexsha": "01fbc26dc6209e86ec13cdee5f8598469e98ff35", "max_stars_repo_licenses": ["MIT"], "max_stars_c...
[STATEMENT] lemma fac_simp [simp]: "0 < i \<Longrightarrow> fac i = i * fac (i - 1)" [PROOF STATE] proof (prove) goal (1 subgoal): 1. 0 < i \<Longrightarrow> fac i = i * fac (i - 1) [PROOF STEP] by (cases i) simp_all
{"llama_tokens": 92, "file": "Simpl_ex_VcgExTotal", "length": 1}
/* * Copyright (c) Facebook, Inc. and its affiliates. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. */ #include "StructuredHeadersEncoder.h" #include <boost/lexical_cast.hpp> #include <boost/variant.hpp> ...
{"hexsha": "1155940fb00e4fb036aa963fadfe309432bcbfad", "size": 5418, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "proxygen/lib/http/structuredheaders/StructuredHeadersEncoder.cpp", "max_stars_repo_name": "yunyuncc/proxygen", "max_stars_repo_head_hexsha": "1ec10a60ab7634d6f804ccada7b3e123a93e23d6", "max_stars_re...
function f = randarb(x,y) % RANDARB generates a random observation from any arbitrary PDF defined by x,y % function f = hfarbrand(x,y) x and y are vectors of length N that describe a PDF % to some precision implicitly dictated by the size of N. Fhe returned scalar f % is an observation from the set of x with a probabi...
{"author": "Sable", "repo": "mcbench-benchmarks", "sha": "ba13b2f0296ef49491b95e3f984c7c41fccdb6d8", "save_path": "github-repos/MATLAB/Sable-mcbench-benchmarks", "path": "github-repos/MATLAB/Sable-mcbench-benchmarks/mcbench-benchmarks-ba13b2f0296ef49491b95e3f984c7c41fccdb6d8/6506-obs-from-arbitrary-pdf/randarb.m"}
[STATEMENT] lemma getParts_nonempty_elems: "\<forall>w\<in>set (getParts rs). \<not> wordinterval_empty w" [PROOF STATE] proof (prove) goal (1 subgoal): 1. \<forall>w\<in>set (getParts rs). \<not> wordinterval_empty w [PROOF STEP] unfolding getParts_def [PROOF STATE] proof (prove) goal (1 subgoal): 1. \<forall>w\<in>...
{"llama_tokens": 2388, "file": "Simple_Firewall_Service_Matrix", "length": 19}
%------------------------- % Resume in Latex % Author : Ibrahim Eren Tilla % License : MIT %------------------------ \documentclass[letterpaper,11pt]{article} \usepackage{latexsym} \usepackage[empty]{fullpage} \usepackage{titlesec} \usepackage{marvosym} \usepackage[usenames,dvipsnames]{color} \usepackage{verbatim} \...
{"hexsha": "60da26dbbcbda7494e4233d84846d90307485c65", "size": 7932, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "eren_tilla_resume.tex", "max_stars_repo_name": "erentilla/resume", "max_stars_repo_head_hexsha": "49104f3b00ee6db53b79f0b9092afe4193e783db", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nu...
[STATEMENT] lemma infinite_term_UNIV[simp, intro]: "infinite (UNIV :: ('f,'v)term set)" [PROOF STATE] proof (prove) goal (1 subgoal): 1. infinite UNIV [PROOF STEP] proof - [PROOF STATE] proof (state) goal (1 subgoal): 1. infinite UNIV [PROOF STEP] fix f :: 'f and v :: 'v [PROOF STATE] proof (state) goal (1 subgoal): ...
{"llama_tokens": 598, "file": "Regular_Tree_Relations_Tree_Automata_Tree_Automata_Class_Instances_Impl", "length": 10}
[STATEMENT] lemma set_split: "{k. k<(Suc n)} = {k. k<n} \<union> {n}" [PROOF STATE] proof (prove) goal (1 subgoal): 1. {k. k < Suc n} = {k. k < n} \<union> {n} [PROOF STEP] apply auto [PROOF STATE] proof (prove) goal: No subgoals! [PROOF STEP] done
{"llama_tokens": 124, "file": "BDD_General", "length": 2}
import numpy as np from itertools import product from scipy.stats import poisson POISSON_UPPER_BOUND = 11 def state_value_compute(state, action, states_value, gamma=0.9): state_value = 0.0 state_value -= 2 * abs(action) for (lent1, lent2) in product(range(POISSON_UPPER_BOUND), range(POISSON_UPPER_BOUND)...
{"hexsha": "e7ba8a4bd4b2540025897440d17c7ab7722e648e", "size": 2361, "ext": "py", "lang": "Python", "max_stars_repo_path": "c4.py", "max_stars_repo_name": "renlikun1988/rl", "max_stars_repo_head_hexsha": "286749086011c60cb6d46dca0eac594ee7e255e3", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_stars_...
""" Example usage: baseline_df, base_reform_df, budget = get_data() ubi_df = set_ubi(base_reform_df, budget, 0, 0, 0, 0, 0, np.zeros((12)), verbose=True) """ from openfisca_uk.tools.simulation import PopulationSim import frs import pandas as pd import numpy as np from rdbl import gbp from openfisca_uk.tools.general ...
{"hexsha": "8ac53b0704168cefe2d682190da92cfd8327c18f", "size": 9865, "ext": "py", "lang": "Python", "max_stars_repo_path": "py/calc_ubi.py", "max_stars_repo_name": "DeepakSingh98/uk", "max_stars_repo_head_hexsha": "81f5f20d1198c3dcd4197ab574995816c257ac4a", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "...
#imports import numpy as np import time from RaDeep import * x_list = [[[0, 0]], [[0, 1]], [[1, 0]], [[1, 1]]] y_list = [[[0]], [[1]], [[1]], [[0]]] x = [variable(x_item) for x_item in x_list] y = [variable(y_item) for y_item in y_list] hidden_size = 6 num_epochs = 500 lrate = 0.1 i2h_list = np.rando...
{"hexsha": "f956aa32d287af896870f5a60baa7d5eabd7705a", "size": 2175, "ext": "py", "lang": "Python", "max_stars_repo_path": "RaDeep/mlp.py", "max_stars_repo_name": "rajasekar-venkatesan/Deep_Learning", "max_stars_repo_head_hexsha": "c375dab303f44043a4dc30ea53b298d7eca1d5a7", "max_stars_repo_licenses": ["MIT"], "max_star...
[STATEMENT] lemma ESem_considers_fv': "\<lbrakk> e \<rbrakk>\<^bsub>\<rho>\<^esub> = \<lbrakk> e \<rbrakk>\<^bsub>\<rho> f|` (fv e)\<^esub>" [PROOF STATE] proof (prove) goal (1 subgoal): 1. \<lbrakk> e \<rbrakk>\<^bsub>\<rho>\<^esub> = \<lbrakk> e \<rbrakk>\<^bsub>\<rho> f|` fv e\<^esub> [PROOF STEP] proof (induct e a...
{"llama_tokens": 18844, "file": "Launchbury_Abstract-Denotational-Props", "length": 47}
from es_distributed.policies import MujocoPolicy from es_distributed.es import RunningStat import gym, roboschool import tensorflow as tf import numpy as np def jupyter_cell(): ob_stat = RunningStat( env.observation_space.shape, eps=1e-2 # eps to prevent dividing by zero at the beginning when com...
{"hexsha": "093ce099aece44aaa94986d03d39670e855d6a5a", "size": 1906, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/keras-test.py", "max_stars_repo_name": "spikingevolution/evolution-strategies", "max_stars_repo_head_hexsha": "21f6032df0d5aa5e5dcecedd2520b0492e2361f2", "max_stars_repo_licenses": ["MIT"], ...
# Copyright (c) Materials Virtual Lab. # Distributed under the terms of the BSD License. """ Functions for creating supercells for NEB calculations """ import logging from typing import List, Tuple, Union, Optional import numpy as np # from ase.build import find_optimal_cell_shape, get_deviation_from_optimal_cell_sha...
{"hexsha": "e6e2d6091447057acf10c5ad6320c3c8c7dff62f", "size": 7097, "ext": "py", "lang": "Python", "max_stars_repo_path": "pymatgen/analysis/diffusion/utils/supercells.py", "max_stars_repo_name": "materialsvirtuallab/pymatgen-analysis-diffusion", "max_stars_repo_head_hexsha": "fddb01992bc8288cdbaba77b3b064b106a1cd274"...
import os import h5py import argparse import pandas as pd import numpy as np import seaborn as sns import matplotlib.pyplot as plt from scipy.spatial import distance parser = argparse.ArgumentParser() parser.add_argument( "--partition_file", type=str, default="data/partition_files/wikiner_pa...
{"hexsha": "c5077433c32a18aa143cfae20215d79ad4a5ee38", "size": 4263, "ext": "py", "lang": "Python", "max_stars_repo_path": "app/fednlp/data/advanced_partition/util/visualization_distplot.py", "max_stars_repo_name": "ray-ruisun/FedML", "max_stars_repo_head_hexsha": "24ff30d636bb70f64e94e9ca205375033597d3dd", "max_stars_...
#! /usr/bin/env python from __future__ import print_function from timeit import default_timer as time import sys import numpy as np from numba import dppl import dppl.ocldrv as ocldrv @dppl.kernel def data_parallel_sum(a, b, c): i = dppl.get_global_id(0) j = dppl.get_global_id(1) c[i,j] = a[i,j] + b[i,j]...
{"hexsha": "0ff945c5ed86b4069f942bcea204c218ac845513", "size": 1408, "ext": "py", "lang": "Python", "max_stars_repo_path": "numba/dppl/examples/sum2D.py", "max_stars_repo_name": "AlexanderKalistratov/numba", "max_stars_repo_head_hexsha": "f5c5ba339b980830e73f1dc76efb6b043adcddbb", "max_stars_repo_licenses": ["BSD-2-Cla...
# -*- noplot -*- """ https://matplotlib.org/examples/pylab_examples/ginput_manual_clabel.html This provides examples of uses of interactive functions, such as ginput, waitforbuttonpress and manual clabel placement. This script must be run interactively using a backend that has a graphical user interface (for example, ...
{"hexsha": "076bde9e6067c690c30a352a9ce62a499e4d7706", "size": 2567, "ext": "py", "lang": "Python", "max_stars_repo_path": "tutorial/matplotlib-tutorial/ginput_manual_clabel.py", "max_stars_repo_name": "zixia/python-facenet", "max_stars_repo_head_hexsha": "d86e0c49a9ce413bef6e58a19a9f723aadcef968", "max_stars_repo_lice...
import glob import matplotlib.pyplot as plt import numpy as np from icecube import dataio import simweights corsika_dataset_dir = "/data/sim/IceCube/2016/filtered/level2/CORSIKA-in-ice/20904/" corsika_filelist = list( glob.glob(corsika_dataset_dir + "0000000-0000999/Level2_IC86.2016_corsika.020904.00000*.i3.zst"...
{"hexsha": "fa103e9e258875d138cd4e83dfbe42a625a46e15", "size": 4210, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/tutorial_corsika.py", "max_stars_repo_name": "icecube/simweights", "max_stars_repo_head_hexsha": "f8a7c35a8f54a7cca17ff1e1cd73cc3424b57980", "max_stars_repo_licenses": ["OLDAP-2.5"], "max...
import torch import torch.nn as nn import numpy as np class _ModeNormalization(nn.Module): def __init__(self, dim, n_components, eps): super(_ModeNormalization, self).__init__() self.eps = eps self.dim = dim self.n_components = n_components self.alpha = nn.Parameter(torch....
{"hexsha": "a09cb89d50da0a40f75e172184d4336496c4b583", "size": 3966, "ext": "py", "lang": "Python", "max_stars_repo_path": "models/mn.py", "max_stars_repo_name": "Buhua-Liu/ShapeTextureDebiasedTraining", "max_stars_repo_head_hexsha": "f0f564214e2b0e8fc0dbb98cbd58994e7ef5b23e", "max_stars_repo_licenses": ["MIT"], "max_s...
from running_metrics.running_metric import RunningMetric import numpy as np class RunningConfusionMatrix(RunningMetric): def __init__(self, classes): super().__init__(classes) self.num_classes = len(classes) self.cm = [] self.eye = np.eye(self.num_classes, self.num_classes) de...
{"hexsha": "efc55e482016a99bd2092b3d37a237ac63411d77", "size": 1512, "ext": "py", "lang": "Python", "max_stars_repo_path": "evaluation/running_metrics/running_confusion_matrix.py", "max_stars_repo_name": "amithjkamath/stochastic_segmentation_networks", "max_stars_repo_head_hexsha": "295f9322f78e4407ad13438ed6e93b77e3ff...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2016-2017, Cabral, Juan; Luczywo, Nadia # All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retai...
{"hexsha": "cad899f0a0e1eccda3385a0462773488bb876f04", "size": 11957, "ext": "py", "lang": "Python", "max_stars_repo_path": "skcriteria/plot/__init__.py", "max_stars_repo_name": "dand-oss/scikit-criteria", "max_stars_repo_head_hexsha": "1ca7667e08e79d551f8241278c939f604800d81b", "max_stars_repo_licenses": ["BSD-3-Claus...
""" 打包成图片 """ import os from PIL import Image import numpy as np def chunks(l, n): for i in range(0, len(l), n): yield l[i:i + n] def packimg(array, i, file_path): data = list(chunks(array, 28)) data = np.array(data) data = np.matrix(data) img = Image.fromarray(data.astype(np.uint8)) ...
{"hexsha": "0f94bba49b6f3001d7624a7d74fda12c98839e16", "size": 388, "ext": "py", "lang": "Python", "max_stars_repo_path": "img.py", "max_stars_repo_name": "wlnyx/-", "max_stars_repo_head_hexsha": "9a7ea36b4c04afabd426b8c48d7874d1738e4c5c", "max_stars_repo_licenses": ["MulanPSL-1.0"], "max_stars_count": null, "max_stars...
[STATEMENT] lemma subst_LLq[simp]: assumes [simp]: "t1 \<in> atrm" "t2 \<in> atrm" "s \<in> atrm" "x \<in> var" shows "subst (LLq t1 t2) s x = LLq (substT t1 s x) (substT t2 s x)" [PROOF STATE] proof (prove) goal (1 subgoal): 1. subst (LLq t1 t2) s x = LLq (substT t1 s x) (substT t2 s x) [PROOF STEP] proof- [PROOF STA...
{"llama_tokens": 1583, "file": "Syntax_Independent_Logic_Syntax_Arith", "length": 9}
module AuthenticationsController using Genie, Genie.Renderer, Genie.Router, Genie.Sessions, Genie.Helpers using SearchLight, SearchLight.QueryBuilder using GenieAuthentication function show_login() html!(:authentications, :show_login, context = @__MODULE__) end function login() query = (from(User) + where("usern...
{"hexsha": "89e0e413cba53fa5c15e0e8de69a6bd1ea9360ab", "size": 746, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "app/resources/authentications/AuthenticationsController.jl", "max_stars_repo_name": "tetsugps/julia", "max_stars_repo_head_hexsha": "715a511bba2be07f99e9c7a6671e8d2200cf5df8", "max_stars_repo_licens...
// // Copyright (c) 2016,2018 CNRS // #ifndef __pinocchio_joint_generic_hpp__ #define __pinocchio_joint_generic_hpp__ #include "pinocchio/multibody/joint/joint-collection.hpp" #include "pinocchio/multibody/joint/joint-composite.hpp" #include "pinocchio/multibody/joint/joint-basic-visitors.hxx" #include "pinocchio/con...
{"hexsha": "282a9c1edd4bcd354b3b22d00fe6bbf5288f96de", "size": 8618, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "src/multibody/joint/joint-generic.hpp", "max_stars_repo_name": "mkatliar/pinocchio", "max_stars_repo_head_hexsha": "b755b9cf2567eab39de30a68b2a80fac802a4042", "max_stars_repo_licenses": ["BSD-2-Clau...
from base import * import numpy as np from typing import List def numpy_heavy_mult(a_b: List[np.array], base): start = time.time() - base np.multiply(*a_b) stop = time.time() - base return start, stop DIMS = 9000 a = np.random.rand(DIMS, DIMS) b = np.random.rand(DIMS, DIMS) a_b_arr = [(a, b)] * 8 ...
{"hexsha": "28fd8331506fc0eca7e5d8fae29fd82722b01744", "size": 356, "ext": "py", "lang": "Python", "max_stars_repo_path": "5.py", "max_stars_repo_name": "broccoli-smuggler/lightning-talk-snakes", "max_stars_repo_head_hexsha": "661a6306c7b5e35480984440caa430cc87dbea26", "max_stars_repo_licenses": ["MIT"], "max_stars_cou...
import matplotlib.pyplot as plt import networkx as nx from agents.AgentBase import AgentBase import logger from agentNet.agent_net import AgentNet from agents.Offer import Offer, OfferType import numpy as np import queue def get_id(jid=''): jid = str(jid) return int(jid[len('agent_'):-(len(AgentBase.HOST) + 1...
{"hexsha": "bbed082616a8101f063a9c87ecad56d7b53799e1", "size": 4039, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/agentPlot/display_graph.py", "max_stars_repo_name": "warbarbye/SAG-2019Z", "max_stars_repo_head_hexsha": "b2dbdac80228a83680b4245c1ef30e1940bd8ee7", "max_stars_repo_licenses": ["MIT"], "max_st...
# Example : 5.3A Chapter : 5.3 Page No: 277 # Nullspace of matrix as transpose of Cofactor matrix nullspacebasis<-function(A){ C<-matrix(c(1:9),ncol=3) for(i in 1:3){ for(j in 1:3){ if((i+j)%%2==0){ x<-1 } else{ x<--1 } C[i,j]<-x*det(A[-i,-j]) ...
{"hexsha": "ac70393c89916b4e7f29d1233a0c7cb324501cd3", "size": 653, "ext": "r", "lang": "R", "max_stars_repo_path": "Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH5/EX5.3.a/Ex5_5.3A.r", "max_stars_repo_name": "prashantsinalkar/R_TBC_Uploads", "max_stars_repo_head_hexsha": "b3f3a8ecd454359a2e992161844f2fb599f8238a"...
\chapter{Introduction} \label{ch:introduction} \section{} \section{} \section{}
{"hexsha": "16a98065e253753998235de5dde254d290805d6f", "size": 84, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "Chapters/chap00.tex", "max_stars_repo_name": "fmr42/MasterThesis", "max_stars_repo_head_hexsha": "0ff0d2100d6547afb67af40c0f355bec1a3c9150", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null...
from argparse import ArgumentParser from pathlib import Path import numpy as np DIR_HERE = Path(__file__).resolve().parent def parse_args(args=None): argparser = ArgumentParser() argparser.add_argument('--shape', nargs='+', type=int, default=[1000, 800]) argparser.add_argument('--nattrs', nargs='+', type...
{"hexsha": "320683b8f987caf74197efc649357bb812c04212", "size": 4300, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/make_examples.py", "max_stars_repo_name": "pedroilidio/hyper_tree", "max_stars_repo_head_hexsha": "f637f01398ddbe6f7f8600f2d72c5424939de98e", "max_stars_repo_licenses": ["BSD-3-Clause"], "ma...
# -*- coding: utf-8 -*- # Morra project: Base parser # # Copyright (C) 2020-present by Sergei Ternovykh # License: BSD, see LICENSE for details """ Base classes for the project. """ from collections import OrderedDict, defaultdict from copy import deepcopy from math import isclose import pickle import random from rando...
{"hexsha": "e24815d16327a4a4b68f0953c260989d1e1c2402", "size": 36624, "ext": "py", "lang": "Python", "max_stars_repo_path": "morra/base_parser.py", "max_stars_repo_name": "fostroll/morra", "max_stars_repo_head_hexsha": "6363c74f6575c061347e0c9372348f83792f5128", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_c...
import numpy as np import scipy.io as sio from pyplfv.wavelet import save_waveleted_signal_with_farray from pyplfv.tve import save_normalized_tve_with_farray from pyplfv.plv import save_plv_with_farray from pyplfv.utility import save_data from pyplfv.utility import load_data from pyplfv.plv import plv_with_farray from ...
{"hexsha": "48affb2e9c6e26aceb279faaea8611e0498c1e20", "size": 2448, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/plv_test.py", "max_stars_repo_name": "SakuragiYoshimasa/EEG_DataProcessing", "max_stars_repo_head_hexsha": "6d41db008964bbe4bd27eb3312aba78fd4db9608", "max_stars_repo_licenses": ["MIT"], "ma...
from sklearn.feature_extraction.text import CountVectorizer from sklearn import preprocessing scaler = preprocessing.StandardScaler(); from sklearn import svm from scipy.sparse import coo_matrix, hstack def combineFeatures(f1,f2): f1 = coo_matrix(f1) f2 = coo_matrix(f2) return hstack([f1,f2]).toarray() in...
{"hexsha": "2968d662b9e20e2aac5a815d370fcbf3b9b240b3", "size": 2594, "ext": "py", "lang": "Python", "max_stars_repo_path": "Supervised and Unsupervised learning/n-grams.py", "max_stars_repo_name": "prernaa/NLPCourseProj", "max_stars_repo_head_hexsha": "77027b3adac06d2e99af7f6ff50265f77aa70cfb", "max_stars_repo_licenses...
/- Copyright (c) 2021 Adam Topaz. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Adam Topaz -/ import topology.category.Profinite import topology.locally_constant.basic import topology.discrete_quotient /-! # Cofiltered limits of profinite sets. This file contains so...
{"author": "jjaassoonn", "repo": "projective_space", "sha": "11fe19fe9d7991a272e7a40be4b6ad9b0c10c7ce", "save_path": "github-repos/lean/jjaassoonn-projective_space", "path": "github-repos/lean/jjaassoonn-projective_space/projective_space-11fe19fe9d7991a272e7a40be4b6ad9b0c10c7ce/src/topology/category/Profinite/cofiltere...
#!/usr/bin/env python3 # -*- encoding: utf8 -*- import json import numpy as np from ref_finder import RefFinder class GlyphModel(object): def _build_glyph_model(self): # A helper function to convert a control point representation to a list as_list = lambda pt: [ pt['x'], pt['y'] ] # On points of the con...
{"hexsha": "d8be2262d8206d69042d1f0f148001dfbc1e337a", "size": 4284, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/cv/glyph_model.py", "max_stars_repo_name": "lvwzhen/glow-sans", "max_stars_repo_head_hexsha": "715f35148a9e023568839b9740908fe1feccbd19", "max_stars_repo_licenses": ["MIT"], "max_stars_count":...
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
{"hexsha": "658cb4edcda86c18c161ee3c181da102807287eb", "size": 7615, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/unit_tests/pandas_postprocessing/test_pivot.py", "max_stars_repo_name": "7vikpeculiar/superset", "max_stars_repo_head_hexsha": "800ced5e257d5d83d6dbe4ced0e7318ac40d026f", "max_stars_repo_lic...
[STATEMENT] lemma DF_unfold : "DF A = (\<sqinter> z \<in> A \<rightarrow> DF A)" [PROOF STATE] proof (prove) goal (1 subgoal): 1. DF A = (\<sqinter>z\<in>A \<rightarrow> DF A) [PROOF STEP] by(simp add: DF_def, rule trans, rule fix_eq, simp)
{"llama_tokens": 106, "file": "HOL-CSP_Assertions", "length": 1}
import copy import random from dataclasses import dataclass from typing import Dict import numpy as np import tensorflow as tf import torch from torch import nn, optim from thesis import memory, networks_torch, utils def egreedy_act( num_actions: int, state: np.ndarray, q_net: nn.Module, eps: float = 0.01 ) -> ...
{"hexsha": "88803335a233ae5d929b30275264acf9f9e82c6b", "size": 4572, "ext": "py", "lang": "Python", "max_stars_repo_path": "dopamine/thesis/scratch/dqn_torch.py", "max_stars_repo_name": "xqz-u/dopamine", "max_stars_repo_head_hexsha": "d562750a58bcf681a6f8b590f4e4dfb263654b5e", "max_stars_repo_licenses": ["Apache-2.0"],...
import os from flask import Flask def create_app(test_config=None, dbfile=None): # create and configure the app app = Flask(__name__, instance_relative_config=True) app.config.from_mapping( SECRET_KEY='dev', DATABASE=os.path.join(app.instance_path, dbfile), ) if test_config is None...
{"hexsha": "e824e789b789543167005e82de8f632b6f0076f5", "size": 1387, "ext": "py", "lang": "Python", "max_stars_repo_path": "server/flaskr/create.py", "max_stars_repo_name": "Intel-OpenVINO-Edge-AI-Scholarship/arcface-project", "max_stars_repo_head_hexsha": "86458a207c8e265bfc231736234ec38e4e70588b", "max_stars_repo_lic...
[STATEMENT] lemma synth_trans: "[| X\<in> synth G; G \<subseteq> synth H |] ==> X\<in> synth H" [PROOF STATE] proof (prove) goal (1 subgoal): 1. \<lbrakk>X \<in> synth G; G \<subseteq> synth H\<rbrakk> \<Longrightarrow> X \<in> synth H [PROOF STEP] by (drule synth_mono, blast)
{"llama_tokens": 113, "file": null, "length": 1}
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. """ This module implements a core class LammpsData for generating/parsing LAMMPS data file, and other bridging classes to build LammpsData from molecules. This module also implements a subclass CombinedData for...
{"hexsha": "9ed502eb52422307dfe3eb751f27ec76ac451144", "size": 89784, "ext": "py", "lang": "Python", "max_stars_repo_path": "pymatgen/io/lammps/data.py", "max_stars_repo_name": "mmbliss/pymatgen", "max_stars_repo_head_hexsha": "0d2e39bb6406d934c03e08919f2cd4dedb41bc22", "max_stars_repo_licenses": ["MIT"], "max_stars_co...
# -*- coding: utf-8 -*- """ Module to produce cartesian gridded traveltime look-up tables. """ import math import warnings import pickle import struct from copy import copy import os import skfmm import pyproj import numpy as np import pandas as pd from scipy.interpolate import RegularGridInterpolator, griddata, int...
{"hexsha": "15ee55bd8b69acad36299909ae856ecda075bcce", "size": 51755, "ext": "py", "lang": "Python", "max_stars_repo_path": "QMigrate/core/model.py", "max_stars_repo_name": "TomWinder/QuakeMigrate", "max_stars_repo_head_hexsha": "c5d2de4104a113192dd3d722adcaf58e90dd0c4f", "max_stars_repo_licenses": ["MIT"], "max_stars_...
include("src/test.jl")
{"hexsha": "46de126a5c3bdb31c891bf001211410fad210ce9", "size": 23, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "runtests.jl", "max_stars_repo_name": "silky/Cosmology.jl", "max_stars_repo_head_hexsha": "34a98aefa0d5f1bef407f990107a940b57aed651", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, "max_sta...
import os import pickle import sys import time from collections import OrderedDict import sklearn.metrics as skm from taggers.lample_lstm_tagger.utils import create_input from taggers.lample_lstm_tagger.utils import models_path from taggers.lample_lstm_tagger.loader import word_mapping, char_mapping from taggers.lamp...
{"hexsha": "6c5004a4a9860693c36ebecfa286a2806ed6a8cc", "size": 12090, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/taggers/lample_lstm_tagger/lstm_wrapper.py", "max_stars_repo_name": "anbasile/arxiv2018-bayesian-ensembles", "max_stars_repo_head_hexsha": "52e2741540ce0466666aaca9fe9dd148c144123a", "max_sta...
# calculation of time (in seconds) that elapsed between the stimulation is applied and the VAS # score is register import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt # set path path = '../data/data_sub.xlsx' dataFrame = pd.read_excel(path, header=2, sheet_name='trials_noTime'...
{"hexsha": "ed67579df11e7362ed1efebcca102dfd8e623111", "size": 10926, "ext": "py", "lang": "Python", "max_stars_repo_path": "py/deprecated/data_swarm.py", "max_stars_repo_name": "EdgardoCS/Arduino_tesis", "max_stars_repo_head_hexsha": "0e7278834fe59c4e54aff45c1152acb9c21b2a24", "max_stars_repo_licenses": ["MIT"], "max_...
[STATEMENT] lemma project_constrains: "(project h C F \<in> A co B) = (F \<in> (C \<inter> extend_set h A) co (extend_set h B) & A \<subseteq> B)" [PROOF STATE] proof (prove) goal (1 subgoal): 1. (project h C F \<in> A co B) = (F \<in> C \<inter> extend_set h A co extend_set h B \<and> A \<subseteq> B)...
{"llama_tokens": 856, "file": null, "length": 6}
import itertools as it import time from contextlib import contextmanager import git import numpy as np from recsys.log_utils import get_logger logger = get_logger() @contextmanager def timer(name): t0 = time.time() yield logger.info(f"[{name}] done in {time.time() - t0:.0f} s") def group_lengths(group...
{"hexsha": "a2f0274a50bb49f3797d513eef48940d25af2c54", "size": 2905, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/recsys/utils.py", "max_stars_repo_name": "atakanerbas/recsys2019", "max_stars_repo_head_hexsha": "c0caed220056d3758d7e8b0032e89429fc07f8cf", "max_stars_repo_licenses": ["Apache-2.0"], "max_sta...
# coding=utf-8 """ Copyright 2021 Huawei Technologies Co., Ltd 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 agre...
{"hexsha": "1ad53111535df6d52aa6c4cec6afc59ce8a23b17", "size": 3208, "ext": "py", "lang": "Python", "max_stars_repo_path": "research/audio/fcn-4/infer/utils/audio2melgram.py", "max_stars_repo_name": "leelige/mindspore", "max_stars_repo_head_hexsha": "5199e05ba3888963473f2b07da3f7bca5b9ef6dc", "max_stars_repo_licenses":...
from collections.abc import Mapping, Iterable import warnings import numpy as np from sklearn.utils import check_random_state from sklearn.utils.random import sample_without_replacement from sklearn.model_selection import ParameterGrid class BatchParameterSampler: def __init__(self, param_distribution, n_iter, ...
{"hexsha": "395b84717f4175c9e74e3e92c12253966d959666", "size": 2974, "ext": "py", "lang": "Python", "max_stars_repo_path": "mango/domain/batch_parameter_sampler.py", "max_stars_repo_name": "jashanmeet-collab/mango", "max_stars_repo_head_hexsha": "ed1fb80fda35d00f6cdfc06e71f55b1a0a9cf4b3", "max_stars_repo_licenses": ["A...
import torch import numpy as np import torch.nn as nn import torchvision from numpy import linalg as la import time class HighTkd2ConvRSvd(nn.Module): def __init__(self, conv_nn_module, k11, k12, r31, r32, r4): def simple_randomized_torch_svd(M, k=10): B = torch.tensor(M).cuda(0) ...
{"hexsha": "e39c1443a6980548ba08ca6876a0f9ac60246233", "size": 8514, "ext": "py", "lang": "Python", "max_stars_repo_path": "decomp/hotcake_rsvd.py", "max_stars_repo_name": "RuiLin0212/HOTCAKE", "max_stars_repo_head_hexsha": "f973d8a39971209f4e10cdb9ff89e9ca194bacc4", "max_stars_repo_licenses": ["MIT"], "max_stars_count...
// Copyright (c) 2012-2018 The Elastos Open Source Project // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include <vector> #include <map> #include <boost/scoped_ptr.hpp> #include "SidechainSubWallet.h" #include "ELACoreExt/EL...
{"hexsha": "8f270c5875749742f647ed6127e276076da6dff1", "size": 4654, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "SDK/Implement/SidechainSubWallet.cpp", "max_stars_repo_name": "RainFallsSilent/Elastos.ELA.SPV.Cpp", "max_stars_repo_head_hexsha": "f2663de380b413efd6e10430cdada3701cb84698", "max_stars_repo_license...
\SetAPI{J-C} \section{cache.child.onupdate.overwritetomany} \label{configuration:CacheChildOnupdateOverwritetomany} \ClearAPI Defines whether during an update of the cache the to-many relations should be resetted. Valid values are "true" and "false". %% GENERATED USAGE REFERENCE - DO NOT EDIT \begin{longtable}{ l l } \...
{"hexsha": "6198e88fd4df9f26d612c0c0913b7d0d936e7432", "size": 864, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "doc/reference-manual/tex/configuration/CacheChildOnupdateOverwritetomany.tex", "max_stars_repo_name": "Dennis-Koch/ambeth", "max_stars_repo_head_hexsha": "8552b210b8b37d3d8f66bdac2e094bf23c8b5fda", "...
import requests import pandas as pd import numpy as np class Federation(): def __init__(self) -> None: self._cartola_base_url = "https://api.cartolafc.globo.com/" self._market_status_url = self._cartola_base_url + "mercado/status" self._market_highlights_url = self._cartola_base_url + "mer...
{"hexsha": "782ce05c42739bc9595e9bc3dff80b21575be12e", "size": 7034, "ext": "py", "lang": "Python", "max_stars_repo_path": "pytolafc/Federation.py", "max_stars_repo_name": "gabrielsouzaesilva/pytolafc", "max_stars_repo_head_hexsha": "09ec865c300341b7ddc57cb3a5dec88bbf195553", "max_stars_repo_licenses": ["MIT"], "max_st...
cdis Forecast Systems Laboratory cdis NOAA/OAR/ERL/FSL cdis 325 Broadway cdis Boulder, CO 80303 cdis cdis Forecast Research Division cdis Local Analysis and Prediction Branch cdis LAPS cdis cdis This software and its documentation are in the public domain and cdis are furnished "as is...
{"hexsha": "be8e2ac1313f976c105203376ad0cc79c4538862", "size": 4284, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "src/ingest/radar/wsiremap/vrc/table/genvrclut.f", "max_stars_repo_name": "maxinye/laps-mirror", "max_stars_repo_head_hexsha": "b3f7c08273299a9e19b2187f96bd3eee6e0aa01b", "max_stars_repo_licenses":...
""" """ import pydiffvg import torch import os import numpy as np import cv2 import skimage import skimage.io import matplotlib.pyplot as plt import random import argparse import math import errno from tqdm import tqdm from torch.optim.lr_scheduler import CosineAnnealingLR from torch.nn.functional import adaptive_avg_p...
{"hexsha": "f676f05bb7906c9235679eb6952013f7a6e4a1f3", "size": 6663, "ext": "py", "lang": "Python", "max_stars_repo_path": "pair/generate/generate_template.py", "max_stars_repo_name": "13952522076/diffvg", "max_stars_repo_head_hexsha": "2c5af9ecf470b1c7071e821583e5ba09cb2c4622", "max_stars_repo_licenses": ["Apache-2.0"...
[STATEMENT] lemma connectedin_path_image: "pathin X g \<Longrightarrow> connectedin X (g ` ({0..1}))" [PROOF STATE] proof (prove) goal (1 subgoal): 1. pathin X g \<Longrightarrow> connectedin X (g ` {0..1}) [PROOF STEP] by (simp add: path_connectedin_imp_connectedin path_connectedin_path_image)
{"llama_tokens": 107, "file": null, "length": 1}
import numpy as np from funcs_thermo import pv_c, pd_c, sv_c, sd_c, cpm_c, exner_c def convert_forcing_entropy(p_0, q_tot, q_vap, T, q_tot_tendency, T_tendency): p_vap = pv_c(p_0, q_tot, q_vap) p_dry = pd_c(p_0, q_tot, q_vap) return cpm_c(q_tot) * T_tendency/T + (sv_c(p_vap,T)-sd_c(p_dry,T)) * q_tot_tenden...
{"hexsha": "49fd4e50f183184ba33d7fc331c7f75b822135e8", "size": 437, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/funcs_forcing.py", "max_stars_repo_name": "charleskawczynski/SCAMPy", "max_stars_repo_head_hexsha": "b43c8a639b6b3e185ac667cb64359de9029bc3af", "max_stars_repo_licenses": ["Apache-2.0"], "max_s...
from __future__ import print_function, division import svgpathtools import numpy as np from matplotlib import pyplot as plt PAGE_HEIGHT = 32000 PAGE_WIDTH = 32000 OFFSET_WIDTH = 3200 OFFSET_HEIGHT = 3200 DEFAULT_X, DEFAULT_Y = 0, 0 def get_paths(file_path, debug=False): _paths, attributes = svgpathtools.svg2pa...
{"hexsha": "ea39bd99349eb4bf8190f643ccd20a1ace7cd886", "size": 3054, "ext": "py", "lang": "Python", "max_stars_repo_path": "main.py", "max_stars_repo_name": "damo-da/cnc-rpi-drawing-robot", "max_stars_repo_head_hexsha": "5bd3285267ae740f2472a4458500e96375260611", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1...
module Main where import Criterion.Main import Statistics.Sample.Histogram.Magnitude import Data.Functor.Identity main = defaultMain [ bgroup "resolution" [ bench "1" . nf (foldHist 1) $ Identity (1 :: Double) , bench "2" . nf (foldHist 2) $ Identity (1 :: Double) ,...
{"hexsha": "c369aeb74dd1b08da4b34ce8eb91fc0b2482224e", "size": 660, "ext": "hs", "lang": "Haskell", "max_stars_repo_path": "benchmark/Bench.hs", "max_stars_repo_name": "skedgeme/histogram-magnitude", "max_stars_repo_head_hexsha": "a8417dfdb002f99dba8740925f2eaa58de8509ea", "max_stars_repo_licenses": ["BSD-3-Clause"], "...
[STATEMENT] lemma C_eq_id: "wellformed_policy1_strong p \<Longrightarrow> C(list2FWpolicy (insertDeny p)) = C (list2FWpolicy p)" [PROOF STATE] proof (prove) goal (1 subgoal): 1. wellformed_policy1_strong p \<Longrightarrow> C (list2FWpolicy (insertDeny p)) = C (list2FWpolicy p) [PROOF STEP] by (rule ext) (auto int...
{"llama_tokens": 145, "file": "UPF_Firewall_FWNormalisation_NormalisationIntegerPortProof", "length": 1}
import json import os import sys from typing import Text, List, Dict, Any import numpy as np import matplotlib.pyplot as plt import torch from torch import nn from mixin import NameMixIn class BaseModel(nn.Module): """ Tracks objects attributes and provides methods for model serialization/deserialization ...
{"hexsha": "fb8e70165e26abb340172365f7f844703393d961", "size": 4181, "ext": "py", "lang": "Python", "max_stars_repo_path": "base.py", "max_stars_repo_name": "bvezilic/Transformer", "max_stars_repo_head_hexsha": "99a8a4687dceb3d08140d009b1295748f37632ca", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count": nul...
""" Facilities to interface with the Heliophysics Events Knowledgebase. """ import json import codecs import urllib import inspect from itertools import chain import astropy.table from astropy.table import Row import sunpy.net._attrs as core_attrs from sunpy import log from sunpy.net import attr from sunpy.net.base_c...
{"hexsha": "86edffcc0bc50f054c4ba494ac25b0d5e04886d3", "size": 7273, "ext": "py", "lang": "Python", "max_stars_repo_path": "sunpy/net/hek/hek.py", "max_stars_repo_name": "jgieseler/sunpy", "max_stars_repo_head_hexsha": "9eb01ce9eea43512cc928b17c6d79ac06dce0ece", "max_stars_repo_licenses": ["BSD-2-Clause"], "max_stars_c...
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. from __future__ import unicode_literals import numpy as np from pymatgen.util.coord import Simplex from functools import cmp_to_key from scipy.spatial import HalfspaceIntersection, ConvexHull from pymatgen.an...
{"hexsha": "2e24b0c0a26b36a89154433df2a8ad8206ebd40c", "size": 14473, "ext": "py", "lang": "Python", "max_stars_repo_path": "pymatgen/analysis/pourbaix/analyzer.py", "max_stars_repo_name": "frssp/pymatgen", "max_stars_repo_head_hexsha": "bdd977f065b66191557c7398b31a1571bc541fdb", "max_stars_repo_licenses": ["MIT"], "ma...
import numpy as np import sys, time # time.clock() is cpu time of current process # time.time() is wall time # to see what this does, try # for x in progprint_xrange(100): # time.sleep(0.01) # TODO there are probably better progress bar libraries I could use def progprint_xrange(*args,**kwargs): xr = xrange...
{"hexsha": "7bcc02f9b5f314c1607f929b872d2b29ee5372ae", "size": 1503, "ext": "py", "lang": "Python", "max_stars_repo_path": "core/util/text.py", "max_stars_repo_name": "Ardavans/sHDP", "max_stars_repo_head_hexsha": "4fc18a86668b1c1eebd416857184d60079db2ed6", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 74, "ma...
# -*- coding: utf-8 -*- # ################# # This script takes as input the EIA sectorial energy consumption data # in .csv format, stripped of the explanatory text, # and returns a csv file with the processed time series. # Original Data are provided in BTU per year, and are converted here to TW. # # Last updated: No...
{"hexsha": "80296b74f7158e3e0a6b5c2417597bfce1507441", "size": 1608, "ext": "py", "lang": "Python", "max_stars_repo_path": "data/energy/EIA_energy_consumption_by_sector/code/get_sectorial_trends.py", "max_stars_repo_name": "ilopezgp/human_impacts", "max_stars_repo_head_hexsha": "b2758245edac0946080a647f1dbfd1098c0f0b27...
accum_type(::Type{T}) where {T<:Integer} = Int accum_type(::Type{Float32}) = Float32 accum_type(::Type{T}) where {T<:Real} = Float64 accum_type(::Type{T}) where {T<:FixedPoint} = floattype(T) accum_type(::Type{C}) where {C<:Colorant} = base_colorant_type(C){accum_type(eltype(C))} accum_type(...
{"hexsha": "b6dbfc0d70a3c11e0d6f3e0a37d0bf53c6002cac", "size": 13760, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/core.jl", "max_stars_repo_name": "JuliaImages/ImageSegmentation.jl", "max_stars_repo_head_hexsha": "252e083626481ebf2260605b95ff19a5c8039e83", "max_stars_repo_licenses": ["MIT"], "max_stars_co...
import gym import numpy as np from gym import spaces from gym.utils import seeding from .agent import PusherActions from .minigrid import COLOR_NAMES, CELL_PIXELS, Grid class PusherGridEnv(gym.Env): """ 2D grid world game environment """ metadata = { 'render.modes': ['human', 'rgb_array', 'p...
{"hexsha": "0093fd68338f27d7eadaf4172cde9f5726b43273", "size": 12044, "ext": "py", "lang": "Python", "max_stars_repo_path": "gym_minigrid/pushergrid.py", "max_stars_repo_name": "Rockett8855/gym-minigrid", "max_stars_repo_head_hexsha": "e8f50fae6f0eb64b2c5a91db2164cd8114a7bf4a", "max_stars_repo_licenses": ["BSD-3-Clause...
#!/usr/bin/env python # -*- coding: UTF-8 -*- import socket import threading from numpy import true_divide def get_ip_x(): s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) try: s.connect(('10.255.255.255', 1)) IP = s.getsockname()[0] print("rmip:"+IP) except: IP = '127...
{"hexsha": "013a1d7d8f2db659931f9c48a6ee0379fc1d7306", "size": 1068, "ext": "py", "lang": "Python", "max_stars_repo_path": "nodes/tianbot_mini_scan_ip.py", "max_stars_repo_name": "tianbot/abc_swarm", "max_stars_repo_head_hexsha": "ac0c3b42e6c76a19403b93aeeb887c0c85237508", "max_stars_repo_licenses": ["BSD-3-Clause"], "...
import mysql.connector import requests import json import os import numpy as np import wikipedia # /index.py from flask import Flask, request, jsonify, render_template, url_for from fuzzywuzzy import fuzz from fuzzywuzzy import process class queryFunctions(): def __init__(self, api_keys): self.API...
{"hexsha": "2fd57644acfedb0fbc6f7db756e5b3fc8d47524e", "size": 8832, "ext": "py", "lang": "Python", "max_stars_repo_path": "queryFunctions.py", "max_stars_repo_name": "NickDST/Interactive-Assistant-Winter", "max_stars_repo_head_hexsha": "7b4ea5bea45201a8a091134cdfab9e8bd3419d65", "max_stars_repo_licenses": ["MIT"], "ma...
import timeit import time import matplotlib.pyplot as plt import numpy as np # Find target 22 (i.e. return its index)in a sorted list # Here we use Binary Search algorithm because its time complexity is O(log n) def binarySearch(lst, search): lower_bound = 0 upper_bound = len(lst) - 1 while True: ...
{"hexsha": "68e1a7747b5b672f99b949e823f373ffdfbd6105", "size": 2513, "ext": "py", "lang": "Python", "max_stars_repo_path": "bigO_presentation/src/Searching.py", "max_stars_repo_name": "ypraw/bigOPYID", "max_stars_repo_head_hexsha": "82fc45595bbb650379b97c220981b5118647d9d8", "max_stars_repo_licenses": ["MIT"], "max_sta...
C Copyright(C) 2011 Sandia Corporation. Under the terms of Contract C DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains C certain rights in this software C C Redistribution and use in source and binary forms, with or without C modification, are permitted provided that the following conditions are...
{"hexsha": "8d7079ad208db58d2cd2e136f6706b746acbc5e4", "size": 3582, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "packages/seacas/applications/gen3d/g3_relblk.f", "max_stars_repo_name": "milljm/seacas", "max_stars_repo_head_hexsha": "4990651554b336901e260304067ff91c7284531f", "max_stars_repo_licenses": ["NetC...
#ifndef HEADER_GUARD_a51a7157f86a31d744e2508bdac9271d #define HEADER_GUARD_a51a7157f86a31d744e2508bdac9271d #include <boost/range/reference.hpp> #include "jbms/is_contiguous.hpp" #include <cstring> #include <type_traits> #include "jbms/print_fwd.hpp" #include "jbms/enable_if.hpp" namespace jbms { template <class T> ...
{"hexsha": "083cc0f6a76bdfc299af1c9d682849b4e2052b5f", "size": 9217, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "src/jbms/array_view.hpp", "max_stars_repo_name": "ezhu5121/array_view", "max_stars_repo_head_hexsha": "58e8eab6957066033f1c967c8db5317d42a596a8", "max_stars_repo_licenses": ["BSL-1.0"], "max_stars_c...
# -*- coding: utf-8 -*- # @Author : Tek Raj Chhetri # @Email : tekraj.chhetri@sti2.at # @Web : http://tekrajchhetri.com/ # @File : Download.py # @Software: PyCharm import urllib.parse import requests import pandas as pd import json import csv from itertools import zip_longest import urllib.parse import reque...
{"hexsha": "49586dde4b109df4f450efbf4a1a7e8373b60ae0", "size": 14962, "ext": "py", "lang": "Python", "max_stars_repo_path": "Download.py", "max_stars_repo_name": "tekrajchhetri/combined-system-metrics-to-cloud-services-reliability", "max_stars_repo_head_hexsha": "770828747b70bb763339f4aa5e7bc0ba143ad095", "max_stars_re...
""" Author: Johnny Lu Date: 6th/July/2020 Copyright: Johnny Lu, 2020 email: joh@johdev.com website: https://johdev.com """ import pandas as pd import numpy as np import matplotlib.pyplot as plt from sklearn.ensemble import RandomForestRegressor, GradientBoostingRegressor from sklearn.model_selection import cross_va...
{"hexsha": "8714b8e34578f4bf3854de4f0d7568bc006f661b", "size": 3017, "ext": "py", "lang": "Python", "max_stars_repo_path": "main.py", "max_stars_repo_name": "JL1829/EmployeeSalaryPrediction", "max_stars_repo_head_hexsha": "55ba4209f23e2ed5fac47c46fc7a112b82d78e14", "max_stars_repo_licenses": ["MIT"], "max_stars_count":...
import data_decoder as dc import numpy as np import pickle from sklearn.neural_network import MLPClassifier from sklearn.preprocessing import StandardScaler from sklearn.metrics import confusion_matrix, classification_report, accuracy_score, f1_score from sklearn.model_selection import GridSearchCV from Game import G...
{"hexsha": "0c850e10385f2d7f4944fdfeb7a850123276cccb", "size": 2949, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/main.py", "max_stars_repo_name": "koodimonsteri/DigitClassifier", "max_stars_repo_head_hexsha": "fc9e772f713587aa45813e51183392cada0a1dec", "max_stars_repo_licenses": ["MIT"], "max_stars_count...
subroutine dredge(nmmax ,lsedtot,nst , & & cdryb ,dps ,dbodsd ,kfsed , & & s1 ,timhr ,morhr ,gdp ) !----- GPL --------------------------------------------------------------------- ! ! Copyri...
{"hexsha": "09c53bd14b8b44cac517532270f22dd455e7b2e1", "size": 69529, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "docker/water/delft3d/tags/v6686/src/engines_gpl/flow2d3d/packages/kernel/src/compute_sediment/dredge.f90", "max_stars_repo_name": "liujiamingustc/phd", "max_stars_repo_head_hexsha": "4f815a738a...
import numpy as np from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister from qiskit import execute, BasicAer from qiskit.compiler import transpile from qiskit.quantum_info.operators import Operator, Pauli from qiskit.quantum_info import process_fidelity from qiskit.extensions import RXGate, XGate, CX...
{"hexsha": "b1b90ff0142edd4b57ee62d8845519bbc0fb29fd", "size": 4335, "ext": "py", "lang": "Python", "max_stars_repo_path": "2. Advanced Circuits/operators.py", "max_stars_repo_name": "apcarrik/qiskit", "max_stars_repo_head_hexsha": "bfad886cacb80a7dae80f67dfadd80d12bcb3b13", "max_stars_repo_licenses": ["MIT"], "max_sta...
from builtins import str import unittest import copy import os import numpy as num from anuga.file_conversion.grd2array import grd2array #Aux for fit_interpolate.fit example def linear_function(point): point = num.array(point) return point[:,0]+3*point[:,1] #return point[:,1...
{"hexsha": "a301553df2a40c66f83a4b27c6371f2e645a3723", "size": 8914, "ext": "py", "lang": "Python", "max_stars_repo_path": "anuga/file_conversion/tests/test_grd2array.py", "max_stars_repo_name": "samcom12/anuga_core", "max_stars_repo_head_hexsha": "f4378114dbf02d666fe6423de45798add5c42806", "max_stars_repo_licenses": [...
/* Copyright 2019 Tenable, Inc. ...
{"hexsha": "cd8ee621debb8a6b241a53cc18dfdecc5efa54b0", "size": 9270, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "cleaner_wrasse/src/makemessage.hpp", "max_stars_repo_name": "Bram-Wel/routeros", "max_stars_repo_head_hexsha": "21d721384c25edbca66a3d52c853edc9faa83cad", "max_stars_repo_licenses": ["BSD-3-Clause"]...
[STATEMENT] theorem load_after_free_2: assumes "free h c = Success (h', cap)" and "block_id cap \<noteq> block_id cap'" shows "load h cap' t = load h' cap' t" [PROOF STATE] proof (prove) goal (1 subgoal): 1. load h cap' t = load h' cap' t [PROOF STEP] using assms free_cond[OF assms(1)] [PROOF STATE] proof (pro...
{"llama_tokens": 1426, "file": "CHERI-C_Memory_Model_CHERI_C_Concrete_Memory_Model", "length": 3}
# https://people.csail.mit.edu/rivest/pubs/RST01.pdf
{"hexsha": "8a68690c19fb00cc6cf6330dfff70d0e3840018e", "size": 53, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/ringsignatures.jl", "max_stars_repo_name": "UnofficialJuliaMirrorSnapshots/CryptoSignatures.jl-35cc5888-0c46-470e-89c7-eafcaf79a1aa", "max_stars_repo_head_hexsha": "2b1a4e92bf93b285f7ab4b5b5900d1...
#!/usr/bin/env python from nose.tools import assert_equal, assert_true, assert_is, assert_is_not from numpy.testing import assert_array_less, assert_array_almost_equal import numpy as np from six.moves import range from heat import BmiHeat def test_get_initial_value(): model = BmiHeat() model.initialize() ...
{"hexsha": "9c9e2646c4d9df88d1ccdc4e91f0720211ba43f5", "size": 1725, "ext": "py", "lang": "Python", "max_stars_repo_path": "test/heat/tests/test_get_value.py", "max_stars_repo_name": "franklinzhanggis/model-interoperable-engine", "max_stars_repo_head_hexsha": "40b724813bec9af16f4ca95e36f8ff16be787315", "max_stars_repo_...
import logging import ast import os import struct import sys import math import random import time from os.path import join as pjoin from collections import deque, namedtuple import numpy as np import tensorflow as tf from tensorflow import keras from .timer import Timer logger = logging.getLogger("MCDose."+__name__...
{"hexsha": "83e050c6dc88d10d06c673b08e13afdb3c90e456", "size": 9850, "ext": "py", "lang": "Python", "max_stars_repo_path": "MC simulation/mcdose/mcdose/dataloader.py", "max_stars_repo_name": "qihuilyu/P2T", "max_stars_repo_head_hexsha": "6b8a24a632354d70c8ba44df717291573a5e0bd2", "max_stars_repo_licenses": ["MIT"], "ma...
@testset "Unconstrained" begin include("double_msd.jl") include("AJPR14e54.jl") include("AP12e21.jl") include("JCG14e61.jl") include("JCG14e63.jl") include("PJ08e28.jl") include("PJ08e54.jl") end @testset "Constrained" begin include("PEDJ16s4.jl") end
{"hexsha": "63dd8e3a96bb9e02a3876bcbf2e7e49923718651", "size": 284, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/discrete.jl", "max_stars_repo_name": "UnofficialJuliaMirrorSnapshots/SwitchOnSafety.jl-ceb7f16a-07bf-5f4a-9354-b68f01b1610f", "max_stars_repo_head_hexsha": "e9fefe2cb8f45f27ed9ea95d3edee725e8b8...
c c file resc2.f c c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . c . . c . copyright (c) 1999 by UCAR . c . . c . UNIVERSITY CORPORA...
{"hexsha": "fd8becab67879da4119f6f47348957f7f2b788b7", "size": 4437, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "external/mudpack/resc2.f", "max_stars_repo_name": "utastudents/selalib", "max_stars_repo_head_hexsha": "84af43d0e82d4686a837c64384bbd173412df50e", "max_stars_repo_licenses": ["CECILL-B"], "max_sta...
[STATEMENT] lemma starfun_n_eq [simp]: "( *fn* f) (star_of n) = star_n (\<lambda>i. f i n)" [PROOF STATE] proof (prove) goal (1 subgoal): 1. (*fn* f) (star_of n) = star_n (\<lambda>i. f i n) [PROOF STEP] by (simp add: starfun_n star_of_def)
{"llama_tokens": 112, "file": null, "length": 1}
import Lean def checkWithMkMatcherInput (matcher : Lean.Name) : Lean.MetaM Unit := Lean.Meta.Match.withMkMatcherInput matcher fun input => do let res ← Lean.Meta.Match.mkMatcher input let origMatcher ← Lean.getConstInfo matcher if not <| input.matcherName == matcher then throwError "matcher name not recons...
{"author": "subfish-zhou", "repo": "leanprover-zh_CN.github.io", "sha": "8b2985d4a3d458ceda9361ac454c28168d920d3f", "save_path": "github-repos/lean/subfish-zhou-leanprover-zh_CN.github.io", "path": "github-repos/lean/subfish-zhou-leanprover-zh_CN.github.io/leanprover-zh_CN.github.io-8b2985d4a3d458ceda9361ac454c28168d92...
#include "lexer.hpp" #include "args-parser.hpp" #include <exception> #include <iostream> #include <map> #include <regex> #include <boost/algorithm/string/split.hpp> #include <boost/algorithm/string/classification.hpp> const std::map<TokenType, std::regex> tokenRegexMap { { TokenType::WORD, std::regex("(\\b[\\w_][\...
{"hexsha": "50e77c08cd25c66c8c6125b33ac1be867a68e818", "size": 8597, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "engines/cpp/src/lexer.cpp", "max_stars_repo_name": "muditg317/Bokay", "max_stars_repo_head_hexsha": "0fd7717d05f7885f8e2e6448f3f45899fbb6d1cb", "max_stars_repo_licenses": ["MIT"], "max_stars_count":...
import numbers import numpy as np import pandas as pd def cusum_filter(raw_time_series, threshold, timestamps=True): """ Snippet 2.4, page 39, The Symmetric CUSUM Filter. :return: """ if not isinstance(threshold, numbers.Number): return cusum_filter_dynamic(raw_time_series, threshold, t...
{"hexsha": "baa949e1f3a74aa3287bbf35515cfc531e6db71c", "size": 1920, "ext": "py", "lang": "Python", "max_stars_repo_path": "adv_finance/labeling/filters.py", "max_stars_repo_name": "cw-jang/adv_finance", "max_stars_repo_head_hexsha": "240ce03e53fc6eead469a1ce7a220510a78c437e", "max_stars_repo_licenses": ["BSD-3-Clause"...
module DistributionsAD using PDMats, ForwardDiff, Zygote, LinearAlgebra, Distributions, Random, Combinatorics, SpecialFunctions, StatsFuns, Compat using Tracker: Tracker, TrackedReal, TrackedVector, TrackedMatrix, TrackedArray, TrackedVecOrMa...
{"hexsha": "4bf5fc8018d02200715f8ade1be60c11d725042e", "size": 1560, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/DistributionsAD.jl", "max_stars_repo_name": "AStupidBear/DistributionsAD.jl", "max_stars_repo_head_hexsha": "d5cb1f9ead07122d4e3b51f0207053554e2b7446", "max_stars_repo_licenses": ["MIT"], "max_...
! The Basic Model Interface ISO_C_BINDINGING compatible free functions ! ! @author: Nels Frazier ! @email: nels.frazier@noaa.gov ! Date: August 23, 2021 ! ! This module provides a set of ISO_C_BINDING compatable functions ! that allow a Fortran BMI compatible model to interoperate with a C program, given that the ! BMI...
{"hexsha": "50cea2313e41c2318a084685acdd80f9613e1000", "size": 66328, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "iso_c_bmi.f90", "max_stars_repo_name": "zhengtaocui/bmi-fortran", "max_stars_repo_head_hexsha": "1729d684ad6e8aa0da0f85c92ac501032feb0f39", "max_stars_repo_licenses": ["MIT"], "max_stars_count"...
from scipy.signal import lfilter import numpy as np from scipy.signal.signaltools import lfilter from scipy.stats import linregress from datetime import timedelta # import matplotlib.pyplot as plt ######################################################## # automated extraction of the baseflow recession coefficient k ...
{"hexsha": "527ea0b4fe1d3eaffe73ee89a18161d60b35cbc4", "size": 4477, "ext": "py", "lang": "Python", "max_stars_repo_path": "hydrographSeparation.py", "max_stars_repo_name": "maseology/pyDrology", "max_stars_repo_head_hexsha": "eb8b677c077c50a309110a8a3a2bd0dd63b041e2", "max_stars_repo_licenses": ["MIT"], "max_stars_cou...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Feb 10 09:32:34 2020 @author: ravinderjit Reject trials with large p2p deflections Calculate system functions from EEG data for Dynamic Binaural Msequence project Also compute noise floors """ import matplotlib.pyplot as plt import matplotlib.colors a...
{"hexsha": "506d5bf7a423bbda65f1865e266f9b21644f26dd", "size": 4250, "ext": "py", "lang": "Python", "max_stars_repo_path": "EEG_analysis/DynBin_sysFuncs_PCA.py", "max_stars_repo_name": "Ravinderjit-S/DynamicBinauralProcessing", "max_stars_repo_head_hexsha": "ceb4c6aa6e9f903eb6e3d4f41ff8b1ea292e6f5c", "max_stars_repo_li...
#include <nameclaim.h> #include <core_io.h> #include <boost/test/unit_test.hpp> #include <primitives/transaction.h> #include <test/test_bitcoin.h> BOOST_FIXTURE_TEST_SUITE(nameclaim_tests, BasicTestingSetup) BOOST_AUTO_TEST_CASE(calc_min_claimtrie_fee) { CMutableTransaction tx; tx.vout.resize(1); tx.vout...
{"hexsha": "d928c2265cfb216223c9b71609e044e6d0a45ad8", "size": 2517, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "src/test/nameclaim_tests.cpp", "max_stars_repo_name": "AlessandroSpallina/lbrycrd", "max_stars_repo_head_hexsha": "51618ce73bdf8798c70a12fe48484358f2df4b06", "max_stars_repo_licenses": ["MIT"], "max...
import numpy as np import gym import time # Execution def execute(env, policy, gamma=1.0, render=False): """ Args: policy: [S,A] shaped matrix representing the policy env: OpenAI gym env env.P represents the transition probabilities of the environment env.P[...
{"hexsha": "681e984907d6ab224962bc02dc2d3c74b5cae074", "size": 3985, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/dynamic_programming/value_policy_iteration/policy_iteration.py", "max_stars_repo_name": "johannesharmse/move_37_course", "max_stars_repo_head_hexsha": "a2060129cbc6fb651113aa18f1a6ea2673845182...
# # Copyright 2016 Quantopian, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
{"hexsha": "37c7f35307819005a10faaad053d48027b0b4977", "size": 25621, "ext": "py", "lang": "Python", "max_stars_repo_path": "zipline/utils/calendars/trading_calendar.py", "max_stars_repo_name": "nathanwolfe/zipline-minute-bars", "max_stars_repo_head_hexsha": "bcc6532731503c4521c6f7c4f9ee5e7ee545c013", "max_stars_repo_l...
C##################################################################### C C FILE - C C Source code for geological applications using x3dgen C Original file was adrivgen.f by Carl Gable C C CHANGE HISTORY - C C Original version - Carl Gable - 97 C error checking and extensions - T.Cherry -...
{"hexsha": "cb3c12a3eb2a2419ce220f6d9a3293bd3b767e0e", "size": 27523, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "src/tempgable.f", "max_stars_repo_name": "millerta/LaGriT-1", "max_stars_repo_head_hexsha": "511ef22f3b7e839c7e0484604cd7f6a2278ae6b9", "max_stars_repo_licenses": ["CNRI-Python"], "max_stars_coun...
import torch import torch.nn as nn import torch.nn.functional as F import numpy as np from itertools import chain from utils.misc import convert_to_one_hot from IPython import embed MODULE_INPUT_NUM = { '_NoOp': 1, '_Find': 0, '_Transform': 1, '_Filter': 1, '_And': 2, '_Describe': 1, } MODULE_...
{"hexsha": "f07d67958a80174af504c750dac2b33e55247ee6", "size": 9085, "ext": "py", "lang": "Python", "max_stars_repo_path": "exp_vqa/model/composite_modules.py", "max_stars_repo_name": "qiuyue1993/XNM-Net", "max_stars_repo_head_hexsha": "1c4a16fd745d9e90e0d7a08b21e7efca4d2c6195", "max_stars_repo_licenses": ["MIT"], "max...