text stringlengths 0 1.25M | meta stringlengths 47 1.89k |
|---|---|
import unittest
from hashlib import sha256
import numpy as np
import pandas as pd
from rowgenerators.appurl import parse_app_url
from publicdata.census.api.censusapi import CensusApi
from publicdata.census.api.url import CensusApiUrl
def test_data(*paths):
from os.path import dirname, join, abspath
return ... | {"hexsha": "9839cf532b57a58bd0086aea9592d039111d52e3", "size": 1989, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/publicdata/census/api/test/test_censusapi.py", "max_stars_repo_name": "Metatab/publicdata_census", "max_stars_repo_head_hexsha": "ea2319bb2bd16718b522924fa690b3154ea3dc32", "max_stars_repo_lic... |
[STATEMENT]
lemma ok_SKIP2 [iff]: "F ok SKIP"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. F ok \<bottom>
[PROOF STEP]
by (simp add: ok_def) | {"llama_tokens": 67, "file": null, "length": 1} |
[STATEMENT]
lemma index_simp:
"(u = v) = (u none = v none \<and> u some = v some)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. (u = v) = (u none = v none \<and> u some = v some)
[PROOF STEP]
by (safe, rule ext, case_tac "x", auto) | {"llama_tokens": 103, "file": "GraphMarkingIBP_DSWMark", "length": 1} |
[STATEMENT]
lemma start_of_lessE[elim]: "\<lbrakk>abc_fetch as ap = Some (Dec n e);
start_of (layout_of ap) as < start_of (layout_of ap) e;
start_of (layout_of ap) e \<le> Suc (start_of (layout_of ap) as + 2 * n)\<rbrakk>
\<Longrightarrow> RR"
[PROOF STATE]
proof (prove)
goal (1 ... | {"llama_tokens": 747, "file": "Universal_Turing_Machine_Abacus", "length": 4} |
from PIL import Image
import numpy
from tensorflow.python.keras.preprocessing.image import ImageDataGenerator
from tensorflow.python.keras.applications.mobilenet import MobileNet
from tensorflow.python.keras.models import Model
from tensorflow.python.keras.layers import Dense, Dropout, BatchNormalization
from tensorflo... | {"hexsha": "f76feb57c37edd471173755ae80575b821e01189", "size": 2031, "ext": "py", "lang": "Python", "max_stars_repo_path": "python/02_train.py", "max_stars_repo_name": "PPACI/Devoxx19-TensorflowJS", "max_stars_repo_head_hexsha": "4096c8ea460af8a9f8a36df01e88309568318ab8", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
# -*- coding: utf-8 -*-
"""
workflow.py
Richard Wen (rwenite@gmail.com)
===============================================================
A script for interfacing with input and output files via
a workflow based approach. Handles progress saving by only
incorporating file checks to see if a particular process
ha... | {"hexsha": "38ce5ba81844e610f4632dcccc46f63560bf2ac3", "size": 41979, "ext": "py", "lang": "Python", "max_stars_repo_path": "py/modules/workflow.py", "max_stars_repo_name": "rwenite/msa-thesis", "max_stars_repo_head_hexsha": "4b72d5571b91ef1ca5266c8e151fdc5e387d57ac", "max_stars_repo_licenses": ["Apache-2.0"], "max_sta... |
# coding: utf-8
import rospy
import pid_controll
import numpy as np
from time import sleep
import matplotlib.pyplot as plt
from sensor_msgs.msg import LaserScan
from ackermann_msgs.msg import AckermannDriveStamped
class lidar_controll:
def __init__(self):
self.left_data = []
self.right_data = []... | {"hexsha": "ddd2ccbdbb7d33b2703f3c85d68dd77b3a24399a", "size": 1591, "ext": "py", "lang": "Python", "max_stars_repo_path": "lidar_module.py", "max_stars_repo_name": "CanKorkut/PID-Control-with-ROS-Gazebo", "max_stars_repo_head_hexsha": "4380d17fc65b46a82384574917acfd1ad2b80b62", "max_stars_repo_licenses": ["Apache-2.0"... |
# -*- coding:utf-8 -*-
# Created Time: 2018/05/11 11:50:23
# Author: Taihong Xiao <xiaotaihong@126.com>
from dataset import config, ShapeNet
from nets import Generator, Discriminator
import os, argparse
import torch
import numpy as np
import scipy.io as sio
from tensorboardX import SummaryWriter
from itertools import... | {"hexsha": "07acf12658c2671045453845a327b5bae8d55d02", "size": 7217, "ext": "py", "lang": "Python", "max_stars_repo_path": "3dgan.py", "max_stars_repo_name": "yodahuang/3D-GAN-pytorch", "max_stars_repo_head_hexsha": "4671a73001b11db718a892c8e3560344ddd50425", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null,... |
from typing import Tuple, List
import numpy as np
from scipy.spatial.distance import cdist
from sklearn.utils.linear_assignment_ import linear_assignment
from lib.trace import Trace
from utils import box
def iou_distance(first: List[Trace], second: List[Trace]) \
-> np.ndarray:
"""Compute cost based on ... | {"hexsha": "934d2cf905d0f6ac2f2fb2110ec04dfdfed8abdb", "size": 2712, "ext": "py", "lang": "Python", "max_stars_repo_path": "lib/matching.py", "max_stars_repo_name": "MaybeS/MOT", "max_stars_repo_head_hexsha": "bae66c46c0cd74b29a0e66c5af58422ad050977b", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 4, "max_star... |
# Tests of rankings
using Stats
using Base.Test
a = [1.0, 2.0, 2.0, 3.0, 4.0, 4.0, 4.0, 5.0]
x = [3.0, 1.0, 2.0, 4.0, 4.0, 2.0, 5.0, 4.0] # x is a permutated version of a
@test ordinalrank(a) == [1, 2, 3, 4, 5, 6, 7, 8]
@test ordinalrank(x) == [4, 1, 2, 5, 6, 3, 8, 7]
@test competerank(a) == [1, 2, 2, 4, 5, 5, 5, ... | {"hexsha": "dc734a67a8f0780da5aa7140334fa7ae336d85bf", "size": 592, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/ranking.jl", "max_stars_repo_name": "rened/Stats.jl", "max_stars_repo_head_hexsha": "0efba512a2bf8faa21e61c9568222ae1ae96acbb", "max_stars_repo_licenses": ["Xnet", "X11"], "max_stars_count": 1,... |
"""
A program that will accept a singlevariable function and a value of that variable and check
whether the input function is continuous at the point where the variable
assumes the value input
"""
from sympy import Symbol, sympify, Limit
def is_continuous(epxr, var, value):
l_limit = Limit(expr, var, value, dir=... | {"hexsha": "0540df2a44a465891368c8d5bfdfcffc3cc40392", "size": 1020, "ext": "py", "lang": "Python", "max_stars_repo_path": "Math/Continuity.py", "max_stars_repo_name": "Gerile3/My_Python", "max_stars_repo_head_hexsha": "8623470ddd866b6b0c3eb34a2572a91458a3e1b1", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nu... |
(** ** Variadic Preservation *)
Require Export ARS Program.Equality.
Require Import core fintype.
Import ScopedNotations.
From Chapter6 Require Export variadic_fin.
Set Implicit Arguments.
Unset Strict Implicit.
Ltac inv H := dependent destruction H.
Hint Constructors star.
(** *** Single-step reduction *)
Inductive... | {"author": "addap", "repo": "autosubst-ocaml", "sha": "f820bde3c51299b5f54ef21af39ac4654854d124", "save_path": "github-repos/coq/addap-autosubst-ocaml", "path": "github-repos/coq/addap-autosubst-ocaml/autosubst-ocaml-f820bde3c51299b5f54ef21af39ac4654854d124/case-studies/kathrin/coq/Chapter9/variadic_preservation.v"} |
!
! CalculiX - A 3-dimensional finite element program
! Copyright (C) 1998-2020 Guido Dhondt
!
! This program is free software; you can redistribute it and/or
! modify it under the terms of the GNU General Public License as
! published by the Free Software Foundation(version 2);
!
!
! ... | {"hexsha": "f3557f7a5de64bbf3e49d6acb0e62e3dfe81b776", "size": 45574, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "ccx_prool/CalculiX/ccx_2.17/src/liquidchannel.f", "max_stars_repo_name": "alleindrach/calculix-desktop", "max_stars_repo_head_hexsha": "2cb2c434b536eb668ff88bdf82538d22f4f0f711", "max_stars_repo_... |
"""
Presents a unified API for the various weights methods
"""
from SparseSC.fit_loo import loo_weights
from SparseSC.fit_ct import ct_weights
from SparseSC.fit_fold import fold_weights
import numpy as np
def weights(X, X_treat=None, grad_splits=None, custom_donor_pool=None, **kwargs):
""" Calculate synthetic co... | {"hexsha": "b1b194b117534c613b56b647318adbffe9b2768b", "size": 2137, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/SparseSC/weights.py", "max_stars_repo_name": "wofein/SparseSC", "max_stars_repo_head_hexsha": "fd8125015c65829458bfee2ae94c24981112d2d8", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
import numpy as np
from probflow.data import ArrayDataGenerator, make_generator
def test_make_generator():
# Create some data
x = np.random.randn(100, 3)
w = np.random.randn(3, 1)
b = np.random.randn()
y = x @ w + b
# Should return an ArrayDataGenerator
dg = make_generator(x, y)
ass... | {"hexsha": "44506114e6e87f7b6fa2bd97296b4af6d157abe6", "size": 559, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/unit/tensorflow/data/test_make_generator.py", "max_stars_repo_name": "chiragnagpal/probflow", "max_stars_repo_head_hexsha": "1ba0619cd4f482a015cd25633d2f113d5d0f3476", "max_stars_repo_license... |
[STATEMENT]
lemma (in Corps) val_1px:"\<lbrakk>valuation K v; x \<in> carrier K; 0 \<le> (v (1\<^sub>r \<plusminus> x))\<rbrakk>
\<Longrightarrow> 0 \<le> (v x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<lbrakk>valuation K v; x \<in> carrier K; 0 \<le> v (1\<^sub>r \<plusminus> x)\<rbrakk> \<Longrigh... | {"llama_tokens": 592, "file": "Valuation_Valuation1", "length": 4} |
#ifndef BOOST_SMART_PTR_DETAIL_SP_COUNTED_BASE_GCC_SPARC_HPP_INCLUDED
#define BOOST_SMART_PTR_DETAIL_SP_COUNTED_BASE_GCC_SPARC_HPP_INCLUDED
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
#pragma once
#endif
// detail/sp_counted_base_gcc_sparc.hpp - g++ on Sparc V8+
//
//... | {"hexsha": "eb4157ccee52742d09fa5aee892dfcc20a063474", "size": 3292, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "libs/boost_1_72_0/boost/smart_ptr/detail/sp_counted_base_gcc_sparc.hpp", "max_stars_repo_name": "henrywarhurst/matrix", "max_stars_repo_head_hexsha": "317a2a7c35c1c7e3730986668ad2270dc19809ef", "max... |
from typing import Optional
import numpy as np
from scipy import stats
from naive_bayes.distributions.abstract import AbstractDistribution
class MultivariateNormal(AbstractDistribution):
"""
Multivariate Normal (gaussian) distribution with parameters mu and sigma.
"""
def fit(self, X: np.ndarray, y... | {"hexsha": "c314a436afbbc18899f8b4a5b9c83a679436d810", "size": 4309, "ext": "py", "lang": "Python", "max_stars_repo_path": "naive_bayes/distributions/multivariate/continuous.py", "max_stars_repo_name": "dayyass/extended_naive_bayes", "max_stars_repo_head_hexsha": "3178b3a79b4094ec7e0a553e9203ac947a83aadd", "max_stars_r... |
From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat.
Set Implicit Arguments.
Module MyNamespace.
(** Euclidean division: returns quotient and reminder *)
(** Type constructors, Product type *)
Section ProductType.
Inductive prod (A B : Type) : Type :=
| pair of A & B.
About pair.
(** Explicit bindin... | {"author": "anton-trunov", "repo": "coq-lecture-notes", "sha": "e012addae82da6d8d03f6e789e43f35140dcdfea", "save_path": "github-repos/coq/anton-trunov-coq-lecture-notes", "path": "github-repos/coq/anton-trunov-coq-lecture-notes/coq-lecture-notes-e012addae82da6d8d03f6e789e43f35140dcdfea/code/lecture02.v"} |
# Importing libraries
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import preprocessing as preprocessing
import seaborn as sns
from pyexpat import model
from sklearn import preprocessing, tree
from sklearn.model_selection import train_test_split, KFold, cross_val_score, StratifiedKFold... | {"hexsha": "b80a5649fb3473a47dd8b52d56a4aaecae7ce3e9", "size": 14961, "ext": "py", "lang": "Python", "max_stars_repo_path": "Diabetes_Prediction.py", "max_stars_repo_name": "mehtapbaglan/Diabetes-Prediction", "max_stars_repo_head_hexsha": "97edfb18d1fa822a79e3d4bcf3b5c7935a092581", "max_stars_repo_licenses": ["MIT"], "... |
# encoding=utf-8
"""
Created on 21:29 2018/11/12
@author: Jindong Wang
"""
import numpy as np
import scipy.io
import scipy.linalg
import sklearn.metrics
from sklearn.neighbors import KNeighborsClassifier
def kernel(ker, X1, X2, gamma):
K = None
if not ker or ker == 'primal':
K = X1
elif k... | {"hexsha": "c47eb5ab9ea0e10d381a3edf140b7de84441f316", "size": 3554, "ext": "py", "lang": "Python", "max_stars_repo_path": "code/traditional/TCA/TCA.py", "max_stars_repo_name": "Flsahkong/transferlearning", "max_stars_repo_head_hexsha": "fdc76a7e03d7771517ea938cb5b90aa5dfb8dfbd", "max_stars_repo_licenses": ["MIT"], "ma... |
# Copyright 2018 The Cirq Developers
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | {"hexsha": "fc8f623874dec6cf5101e12080d838f6a1be61a9", "size": 29363, "ext": "py", "lang": "Python", "max_stars_repo_path": "cirq/ops/common_gates.py", "max_stars_repo_name": "sleichen/Cirq", "max_stars_repo_head_hexsha": "02f715203406d1f2af2d86e7561af09a2cdd4d45", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_... |
# Lint as: python3
# Copyright 2020 The TensorFlow Probability Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | {"hexsha": "91e65092d02da54e47f5493bb7a3a2c881314ba8", "size": 6246, "ext": "py", "lang": "Python", "max_stars_repo_path": "spinoffs/inference_gym/tools/get_ground_truth.py", "max_stars_repo_name": "KonstantinKlepikov/probability", "max_stars_repo_head_hexsha": "0cc6c5febf3b10ece5bb2b9877bd695137a420ea", "max_stars_rep... |
import numpy as np
from typing import List, NamedTuple, Callable, Optional, Union
import mindspore.ops.operations as P
from mindspore._c_expression import Tensor as _Tensor
from mindspore.common import dtype as mstype
from ._utils import _tensor_getitem
add = P.Add()
cast = P.Cast()
sum = P.ReduceSum()
sum_keepdims = ... | {"hexsha": "3a0079257686e171f6375c4e4d2de9868b75b27b", "size": 11593, "ext": "py", "lang": "Python", "max_stars_repo_path": "autograd/tensor.py", "max_stars_repo_name": "lvyufeng/autograd_ms", "max_stars_repo_head_hexsha": "f9e6920cc4fcc85a9d514820f2c3932a4926d436", "max_stars_repo_licenses": ["MIT"], "max_stars_count"... |
import numpy as np
import pandas as pd
import argparse
from mbi import Domain, Dataset
import json
def discretize(df, schema):
new = df.copy()
domain = { }
for col in new.columns:
if col not in schema:
continue
info = schema[col]
if 'bins' in info:
# Things t... | {"hexsha": "cf23de92fca0b0770be35052bb0435a5c0211abd", "size": 3726, "ext": "py", "lang": "Python", "max_stars_repo_path": "extensions/transform.py", "max_stars_repo_name": "meijiu/nist-synthetic-data-2021", "max_stars_repo_head_hexsha": "19f6d31b48902743e2efb4820ad77f8ed42c469d", "max_stars_repo_licenses": ["Apache-2.... |
# Activate local environment
using Pkg
Pkg.activate(".")
printstyled(" Running "; color = :green, bold = true)
print("model...\n")
# Load module
using Negotiations
# Run model
params = parameter_set_from_config("config.yaml")
db = load_database("db.sqlite")
model = setup_model(params, db)
rule1 = BoundedConfidence(... | {"hexsha": "da6e92d8edc0f634bda36e0bdf8d569c28921afc", "size": 532, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "run_model.jl", "max_stars_repo_name": "social-dynamics/btw21-negotiation", "max_stars_repo_head_hexsha": "bc779a4ad4da0b5dd827707824d083d198f2e833", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Penetration Test Report Template %
% cyber@cfreg %
% https://hack.newhaven.edu/ %
% %
% Contributors: ... | {"hexsha": "f50f3b28fc02e2e9c05422f261b55fccd713c94f", "size": 4990, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "tex/sections/2_1_observations.tex", "max_stars_repo_name": "cyber-cfreg/Penetration-Test-Report-Template", "max_stars_repo_head_hexsha": "f4908a4c92c55acdd1b4ab4fb014fac262eba229", "max_stars_repo_l... |
[STATEMENT]
lemma EnsuresInfinite:
"\<lbrakk> sigma \<Turnstile> \<box>\<diamond>P; sigma \<Turnstile> \<box>A; \<turnstile> A \<and> $P \<longrightarrow> Q` \<rbrakk> \<Longrightarrow> sigma \<Turnstile> \<box>\<diamond>Q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<lbrakk>sigma \<Turnstile> \<box>\<diamon... | {"llama_tokens": 397, "file": null, "length": 4} |
import numpy
from skimage.exposure import rescale_intensity
from aydin.features.groups.random import RandomFeatures
from aydin.io.datasets import camera
def n(image):
return rescale_intensity(
image.astype(numpy.float32), in_range='image', out_range=(0, 1)
)
def test_random_feature_group():
# g... | {"hexsha": "c86ccd7d5a4be3fb2dee96e98cfe468e4ee3b29d", "size": 863, "ext": "py", "lang": "Python", "max_stars_repo_path": "aydin/features/groups/test/test_random_feature_group.py", "max_stars_repo_name": "royerloic/aydin", "max_stars_repo_head_hexsha": "f9c61a24030891d008c318b250da5faec69fcd7d", "max_stars_repo_license... |
@info "Running show tests"
const TEMPLATES_DIR = contractuser(PT.default_file())
const LICENSES_DIR = joinpath(TEMPLATES_DIR, "licenses")
function test_show(expected::AbstractString, observed::AbstractString)
if expected == observed
@test true
else
print_diff(expected, observed)
@test ... | {"hexsha": "7fcb60b6383193b7bc62fc56f5d5c6a416830547", "size": 4150, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/show.jl", "max_stars_repo_name": "charlieIT/PkgTemplates.jl", "max_stars_repo_head_hexsha": "1cb56bf90326d47c402af51537c9c669e9b08a24", "max_stars_repo_licenses": ["MIT"], "max_stars_count": n... |
[STATEMENT]
lemma continuous_on_map_topology2:
"continuous_map T X (g \<circ> f) \<longleftrightarrow> continuous_map (map_topology f T) X g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. continuous_map T X (g \<circ> f) = continuous_map (map_topology f T) X g
[PROOF STEP]
unfolding map_topology_def
[PROOF STATE]... | {"llama_tokens": 1313, "file": "Smooth_Manifolds_Analysis_More", "length": 16} |
[STATEMENT]
lemma bounded_linear_Blinfun_apply: "bounded_linear f \<Longrightarrow> blinfun_apply (Blinfun f) = f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. bounded_linear f \<Longrightarrow> blinfun_apply (Blinfun f) = f
[PROOF STEP]
by (auto simp: Blinfun_inverse) | {"llama_tokens": 103, "file": null, "length": 1} |
"""Regression with abstention network architecture."""
import numpy as np
import tensorflow as tf
from tensorflow.keras.layers import Dense
from tensorflow.keras import regularizers
from tensorflow.keras.models import Sequential
__author__ = "Elizabeth A. Barnes and Randal J. Barnes"
__date__ = "March 4, 2021"
np.wa... | {"hexsha": "03300c9011a651f491d2af3feff71bdf8bfdce77", "size": 4054, "ext": "py", "lang": "Python", "max_stars_repo_path": "manuscript_code/regression_JAMES/network.py", "max_stars_repo_name": "eabarnes1010/controlled_abstention_networks", "max_stars_repo_head_hexsha": "4519ff710d2562a25045d0a2bdd26b3b6a98fa32", "max_s... |
using TestPackage2
TestPackage2.greet()
| {"hexsha": "1fd891654dd2dce825ba6f7374e2f648d42a15fb", "size": 41, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/TestPackage2/snoop/snoopfile.jl", "max_stars_repo_name": "daviehh/PackageCompiler.jl", "max_stars_repo_head_hexsha": "9a9e7b9f36bbcbf3cca2d53c99a82b59afdda37e", "max_stars_repo_licenses": ["MIT"... |
"""
function gheader(gt)
Retrieve the header infomation of a packed genotype file.
"""
function gheader(gt)
nlc, nid, dms, gt_majored = nothing, nothing, nothing, true
open(gt, "r") do io
header = mmap(io, Vector{Int64}, 3)
gt_majored = (header[1] == 1)
nlc, nid = gt_majored ? header... | {"hexsha": "13a39b57540ddf1e85afa9958fa75813193bad15", "size": 2278, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/picd/picd.jl", "max_stars_repo_name": "xijiang/AGH.jl", "max_stars_repo_head_hexsha": "3fd0213f43f27c254fcfb77b1b14d71524c5e322", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "m... |
"""
Distributions of the Cramer-von Mises statistic.
After doi:10.2307/2346175.
Original Work (scikit-gof) Copyright (c) 2015 Wojciech Ruszczewski <scipy@wr.waw.pl>
Modified Work Copyright (c) 2020 h-bryant
"""
from __future__ import division
from numpy import arange, dot, exp, newaxis, pi, tensordot
from scipy.spe... | {"hexsha": "b4b9336381aefb3cc82666419b1e7358d0814858", "size": 2699, "ext": "py", "lang": "Python", "max_stars_repo_path": "funcsim/cvmdist.py", "max_stars_repo_name": "h-bryant/funcsim", "max_stars_repo_head_hexsha": "6f0ec2365e3ed6d9478e2f92e755cebafaf6528d", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_co... |
[STATEMENT]
lemma (in Firstprogram) "STUTINV phi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. STUTINV phi
[PROOF STEP]
by (auto simp: phi_def init_def m1_def m2_def Live_def stutinvs nstutinvs livestutinv) | {"llama_tokens": 95, "file": "TLA_Inc", "length": 1} |
import numpy as np
import pandas as pd
import scipy.spatial
import triangle
from . import cleanup
from . import points_in_mesh
from . import boundary
def replace_triangles(points, vertices=None, triangles=None, **tri):
if vertices is None:
vertices = pd.DataFrame({"X": [], "Y": []})
if triangles is No... | {"hexsha": "464899d66b5cb62b2aa2c33f3765cc2265d1a68c", "size": 7746, "ext": "py", "lang": "Python", "max_stars_repo_path": "emeraldtriangles/refine_mesh.py", "max_stars_repo_name": "emerald-geomodelling/EmeraldTriangles", "max_stars_repo_head_hexsha": "f65d5ba8cc6206b11e649124e2a1f61d46d80690", "max_stars_repo_licenses... |
from rllab.policies.base import StochasticPolicy
from sandbox.finetuning.policies.test_hier_snn_mlp_policy import GaussianMLPPolicy_snn_hier
from rllab.envs.normalized_env import normalize
from sandbox.finetuning.envs.mujoco.swimmer_env import SwimmerEnv
from sandbox.finetuning.envs.mujoco.gather.swimmer_gather_env imp... | {"hexsha": "e944d93b7197d03763439492b4e059997c43792d", "size": 9202, "ext": "py", "lang": "Python", "max_stars_repo_path": "sandbox/finetuning/policies/concurrent_policy_random_time.py", "max_stars_repo_name": "andrewli77/rllab-finetuning", "max_stars_repo_head_hexsha": "2dae9141d0fdc284d04f18931907131d66b43023", "max_... |
# -*- coding: utf-8 -*-
"""
Created on Sun Oct 12 13:08:12 2014
@author: Ken
"""
import marisa_trie
import re
import pandas as pd
import numpy as np
import sys
if sys.version_info[0] == 3:
basestring = str
unicode = str
from multiprocessing import Pool, cpu_count
"""
testTrie = marisa_tri... | {"hexsha": "b3704d7b31ba339d35509770d828de11d55b7994", "size": 8149, "ext": "py", "lang": "Python", "max_stars_repo_path": "BulkFindReplace/BulkFindReplace.py", "max_stars_repo_name": "KCzar/BulkFindReplace", "max_stars_repo_head_hexsha": "4783836508bad9428bc55307774546ba00447e42", "max_stars_repo_licenses": ["MIT"], "... |
import os
os.environ['DGLBACKEND'] = 'mxnet'
import mxnet as mx
import numpy as np
import scipy as sp
import dgl
from dgl import utils
def generate_rand_graph(n):
arr = (sp.sparse.random(n, n, density=0.1, format='coo') != 0).astype(np.int64)
return dgl.DGLGraph(arr, readonly=True)
def test_1neighbor_sampler_... | {"hexsha": "422a0d8c8bfaafdeae336e4ee7dbdb8c05ffbe23", "size": 4038, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/mxnet/test_sampler.py", "max_stars_repo_name": "sufeidechabei/dgl", "max_stars_repo_head_hexsha": "f9f92803b422c04b6d8e3f95b18f71cf158f3b1f", "max_stars_repo_licenses": ["Apache-2.0"], "max_... |
# This proposal samples from prior and updates exogenous variables
# Using inverse transform
# function stdproposal(qω, x::T, ω) where T
# display(ω)
# @show T
# if x in keys(ω.data)
# nothing
# else
# x_ = rand(qω, x.class)
# @show x => x_
# end
# @show T
# @assert false
# end
stdpropo... | {"hexsha": "b4bb72f669fb04fef142786b4481e8ecd90437a0", "size": 573, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "OmegaCore/src/proposal/stdproposal.jl", "max_stars_repo_name": "zenna/expect", "max_stars_repo_head_hexsha": "48bd661df410777eeb8940876a5cc8817eed2ac5", "max_stars_repo_licenses": ["MIT"], "max_star... |
import data.nat.basic
example (u w x y z : ℕ) (h₁ : x = y + z) (h₂ : w = u + x) :
w = z + y + u :=
by simp [*, add_assoc, add_comm, add_left_comm]
variables (p q r : Prop)
example (hp : p) : p ∧ q ↔ q :=
by simp *
example (hp : p) : p ∨ q :=
by simp *
example (hp : p) (hq : q) : p ∧ (q ∨ r) :=
by simp *
| {"author": "agryman", "repo": "theorem-proving-in-lean", "sha": "cf5a3a19d0d9d9c0a4f178f79e9b0fa67c5cddb9", "save_path": "github-repos/lean/agryman-theorem-proving-in-lean", "path": "github-repos/lean/agryman-theorem-proving-in-lean/theorem-proving-in-lean-cf5a3a19d0d9d9c0a4f178f79e9b0fa67c5cddb9/src/05-Tactics/example... |
from os.path import join
import numpy as np
import pytest
from warnings import catch_warnings
from hera_sim.defaults import defaults
from hera_sim.config import CONFIG_PATH
from hera_sim.sigchain import gen_bandpass
from hera_sim.interpolators import Tsky, Beam
def test_config_swap():
defaults.set("h1c")
conf... | {"hexsha": "b0cc661522242711a4653b5e7228b6b4def7a5f5", "size": 3117, "ext": "py", "lang": "Python", "max_stars_repo_path": "hera_sim/tests/test_defaults.py", "max_stars_repo_name": "hughbg/hera_sim", "max_stars_repo_head_hexsha": "b9f4fc39437f586f6ddfa908cf5c5f2e2a6d2231", "max_stars_repo_licenses": ["MIT"], "max_stars... |
import pandas as pd
import numpy as np
from pyfolio import timeseries
import pyfolio
import matplotlib.pyplot as plt
from copy import deepcopy
from finrl.marketdata.yahoodownloader import YahooDownloader
from finrl.config import config
def get_daily_return(df, value_col_name="account_value"):
'''
This funct... | {"hexsha": "7ed7ab27f08d16ae0e2197d739b42eda484461f6", "size": 2438, "ext": "py", "lang": "Python", "max_stars_repo_path": "finrl/trade/backtest.py", "max_stars_repo_name": "zhaoranwang/FinRL-Library", "max_stars_repo_head_hexsha": "08351591ac104484b6e23ed3a311e02bb23afda2", "max_stars_repo_licenses": ["MIT"], "max_sta... |
[STATEMENT]
lemma evalc_evaln: "<c,s> -c-> t \<Longrightarrow> \<exists>n. <c,s> -n-> t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. <c,s> -c-> t \<Longrightarrow> \<exists>n. <c,s> -n-> t
[PROOF STEP]
apply (erule evalc.induct)
[PROOF STATE]
proof (prove)
goal (10 subgoals):
1. \<And>s. \<exists>n. <SKIP,s> -n-... | {"llama_tokens": 2807, "file": null, "length": 5} |
import re
import pandas as pd
import numpy as np
import plotly.graph_objects as go
from plotly.offline import plot
from plotly.colors import n_colors
class autoViz:
"""This class implements model visualization.
Parameters
----------
preprocess_dict : dict, default = None
1st output result... | {"hexsha": "fc37acd8512d04482d8852ee628f6b1c07d7b4e5", "size": 19640, "ext": "py", "lang": "Python", "max_stars_repo_path": "optimalflow/autoViz.py", "max_stars_repo_name": "tonyleidong/OptimalFlow", "max_stars_repo_head_hexsha": "f2aaddaa083673f0343a579899ad0db7ee294707", "max_stars_repo_licenses": ["MIT"], "max_stars... |
function test_measures()
m1 = Lebesgue()
@test !isdiscrete(m1)
@test iscontinuous(m1)
@test !isnormalized(m1)
@test domaintype(m1) == Float64
@test DomainIntegrals.unsafe_weightfun(m1, 0.4) == 1
m2 = DomainIntegrals.LebesgueUnit()
@test !isdiscrete(m2)
@test iscontinuous(m2)
@t... | {"hexsha": "1856cba7c2fe462ef53e74a1a23003c8d9e60e91", "size": 1981, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/test_measures.jl", "max_stars_repo_name": "JuliaApproximation/DomainIntegrals.jl", "max_stars_repo_head_hexsha": "b2cb2fc9df91aef66fe1318c568da487ca433064", "max_stars_repo_licenses": ["MIT"],... |
# This file is a part of ROOTFramework.jl, licensed under the MIT License (MIT).
cxxinclude("TBufferJSON.h")
export rootjson
rootjson(obj::CppValue, compact::Integer = 3) =
rootjson(pointer_to(obj), compact)
rootjson(obj::CppPtr, compact::Integer = 3) =
string(@cxx TBufferJSON::ConvertToJSON(obj, Int32(compact))... | {"hexsha": "ae046dc3b313de757b30c8c1dd3742732c2e94c7", "size": 322, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/json.jl", "max_stars_repo_name": "mppmu/ROOTFramework.jl", "max_stars_repo_head_hexsha": "30e162deb826356a9c7d792ab2c8d2aa61494f63", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 4, "ma... |
# Make the model, perform cross validation and export submission file.
from sklearn.model_selection import cross_val_score
from sklearn import metrics
import pandas as pd
import numpy as np
def modelfit(algorthm, dftrain, dftest, predictors, target, IDcol, filename=None):
#Fit the algorthmorithm on the data
... | {"hexsha": "914106e53bed4a6b677a7a92afa5626aa06e70f1", "size": 1484, "ext": "py", "lang": "Python", "max_stars_repo_path": "support/mfit.py", "max_stars_repo_name": "NageshVani/BlackFridaySales", "max_stars_repo_head_hexsha": "8ca79ea99fbfaa475642e30df71c7c0950039f25", "max_stars_repo_licenses": ["MIT"], "max_stars_cou... |
import cv2
import imutils
import numpy as np
from DetectRed import *
from DetectRed import checkRed
def splitIntoCardImages(img):
#Splits the image into an array of images that each have 1 card in them
images = []
blur = cv2.GaussianBlur(img, (9, 9), 0)
## convert to hsv
hsv = cv2.cvtColor(blur, c... | {"hexsha": "5b14b3d0b1a05800f3f6b34b69e08141513611c2", "size": 6231, "ext": "py", "lang": "Python", "max_stars_repo_path": "openCV_version/venv/Scripts/finalCode/ImageSplit.py", "max_stars_repo_name": "Jokubas126/PokerAssistant_CV", "max_stars_repo_head_hexsha": "930c945c11634dce9702fd9774dd43161da11fee", "max_stars_re... |
// Boost.Geometry
// Copyright (c) 2020, Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
// Licensed under the Boost Software License version 1.0.
// http://www.boost.org/users/license.html
#ifndef BOOST_GEOMETRY_STRATEGIES_RELATE_CARTESIAN_HPP
#define BOOST_GEOM... | {"hexsha": "3ddc766a21e3706d549189b432527f8aa1045e13", "size": 13571, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "include/boost/geometry/strategies/relate/cartesian.hpp", "max_stars_repo_name": "jhypolite/geometry", "max_stars_repo_head_hexsha": "f79b3f0c457bc4ae4bb1c1cb5a117efbe97be3c4", "max_stars_repo_licen... |
#' @export
load.tped <- function(prefix) {
tped.file <- paste0(prefix, '.tped')
tfam.file <- paste0(prefix, '.tfam')
stopifnot(file.exists(tped.file), file.exists(tfam.file))
geno.samples <- read.table(tfam.file)
n.samples <- nrow(geno.samples)
geno.data <- scan(tped.file, character())
n.snps <- le... | {"hexsha": "748cc6aac5f4c4925d325c3d8d7f99fdbd17c183", "size": 1580, "ext": "r", "lang": "R", "max_stars_repo_path": "R/load_tped.r", "max_stars_repo_name": "sushilashenoy/zoom.plot", "max_stars_repo_head_hexsha": "036aa60980fdf7d86b5168f08e63aa13ca1f9e4b", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 3, "max... |
FROM ghcr.io/lballabio/quantlib-swig-devenv:default
MAINTAINER Luigi Ballabio <luigi.ballabio@gmail.com>
LABEL Description="A development environment for building QuantLib-SWIG on Travis CI"
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y r-base-dev texlive \
&& apt-get clean \
&& rm -rf /... | {"hexsha": "ea67a63d291b1d7ed5431fffa01213297a998fab", "size": 341, "ext": "r", "lang": "R", "max_stars_repo_path": "quantlib-swig-devenv/Dockerfile.r", "max_stars_repo_name": "yrtf/dockerfiles", "max_stars_repo_head_hexsha": "83aba03c93f8012cbe493f4c5c60034a1e083135", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_... |
"Holds the tableau of an variational partitioned additive Runge-Kutta method."
struct TableauVPARK{T} <: AbstractTableau{T}
name::Symbol
o::Int
s::Int
r::Int
q::CoefficientsARK{T}
p::CoefficientsARK{T}
q̃::CoefficientsPRK{T}
p̃::CoefficientsPRK{T}
λ::CoefficientsMRK{T}
d::Vec... | {"hexsha": "277e2c92c1e258e77e72c3698b61ee6718a75d6d", "size": 20178, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/integrators/spark/integrators_vpark.jl", "max_stars_repo_name": "UnofficialJuliaMirrorSnapshots/GeometricIntegrators.jl-dcce2d33-59f6-5b8d-9047-0defad88ae06", "max_stars_repo_head_hexsha": "5f... |
from collections import defaultdict
import sys
import os
import argparse
import madmom
import numpy as np
import pandas as pd
import pretty_midi
import librosa
import h5py
import math
from config import load_config
import numpy as np
def readmm(d, args):
ipath = os.path.join(d, 'input.dat')
note_range = ... | {"hexsha": "d605126f25cff8dd183e12f1a9c86d4d761d6e5d", "size": 11905, "ext": "py", "lang": "Python", "max_stars_repo_path": "preprocess.py", "max_stars_repo_name": "KimberleyEvans-Parker/wav2mid", "max_stars_repo_head_hexsha": "de37c8e5e61b9f43401ac3885b455231c7e9ecec", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
import numpy as np
import sys
import os
import nrrd
if (len(sys.argv) < 2):
print('Error: missing arguments!')
print('e.g. python copyHeader.py template.nrrd target.nrrd')
else:
print('Loading header from %s...' % (str(sys.argv[1])))
data1, header1 = nrrd.read(str(sys.argv[1]))
size = np.shape(data... | {"hexsha": "359b1b0a4bb81e87a54d709be7d016964a2284ca", "size": 802, "ext": "py", "lang": "Python", "max_stars_repo_path": "copyHeader.py", "max_stars_repo_name": "Robbie1977/NRRDtools", "max_stars_repo_head_hexsha": "e16f1e49fccadc5f717f55b7c2c3dc49ec96f89f", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, "m... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Apr 11 10:34:23 2018
@author: liushenghui
"""
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# comment_classifier.py
#
# Vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
# Python source code - replace this with a description
# of the code and write... | {"hexsha": "5be2905e3eac0b7f33aad01b542eb2688ef4042d", "size": 3955, "ext": "py", "lang": "Python", "max_stars_repo_path": "data_preprocess.py", "max_stars_repo_name": "fightingst/text-classification-cnn-rnn", "max_stars_repo_head_hexsha": "dda5b98a6bb5db897dc7db1966d8be74eb555adb", "max_stars_repo_licenses": ["MIT"], ... |
import numpy as np
from scipy.cluster import hierarchy
import sys
import json
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
codebasesPath = str(sys.argv[1])
codebaseName = str(sys.argv[2])
dendrogramName = str(sys.argv[3])
with open(codebasesPath + codebaseName + "/" + dendrogramName + "/s... | {"hexsha": "21f4ffa650d22d392f2a0d9eb4d66d582f04b2c0", "size": 814, "ext": "py", "lang": "Python", "max_stars_repo_path": "backend/src/main/resources/createDendrogram.py", "max_stars_repo_name": "ritosilva/mono2micro", "max_stars_repo_head_hexsha": "c45813443cbf4519797c9b8368220667cd3cb0ea", "max_stars_repo_licenses": ... |
/*
* Copyright (c) 2015 Samsung Electronics 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 l... | {"hexsha": "9ecda8bdb7d2571f91ee73ec536be25f1419cee1", "size": 5650, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "services/HistoryUI/HistoryUI.cpp", "max_stars_repo_name": "knowac/tizen-browser-30", "max_stars_repo_head_hexsha": "0ea06a4cd6bdca3dc3da674dd8189bf528c166f8", "max_stars_repo_licenses": ["Apache-2.0... |
# Copyright (c) 2019 Graphcore Ltd. All rights reserved.
import numpy as np
import pytest
import popart
import pprint
import json
import platform
# 'import test_util' requires adding to sys.path
import sys
from pathlib import Path
sys.path.append(str(Path(__file__).resolve().parent.parent))
import test_util as tu
de... | {"hexsha": "9e19c2f17c443b25620608e6ad8e6995c97757d3", "size": 66666, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/integration/transformation_tests/serializematmul.py", "max_stars_repo_name": "gglin001/popart", "max_stars_repo_head_hexsha": "3225214343f6d98550b6620e809a3544e8bcbfc6", "max_stars_repo_lic... |
#!/usr/bin/env python
import os
from setuptools import find_packages
from distutils.errors import CCompilerError, DistutilsExecError, DistutilsPlatformError, DistutilsError
from numpy.distutils.core import setup, Extension
from numpy.distutils.command.build_ext import build_ext as old_build_ext
from numpy.distutils.fc... | {"hexsha": "b35fabc4c1bc087d543a830df0faa5dddc3cdcdb", "size": 2911, "ext": "py", "lang": "Python", "max_stars_repo_path": "setup.py", "max_stars_repo_name": "hase1128/dragonfly", "max_stars_repo_head_hexsha": "4be7e4c539d3edccc4d243ab9f972b1ffb0d9a5c", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_... |
# octree的具体实现,包括构建和查找
import random
import math
import numpy as np
import time
from result_set import KNNResultSet, RadiusNNResultSet
# 节点,构成OCtree的基本元素
class Octant:
def __init__(self, children, center, extent, point_indices, is_leaf):
self.children = children
self.center = center
self.e... | {"hexsha": "fc2660dfaafda6024a750716cd80c8a1a449349a", "size": 12689, "ext": "py", "lang": "Python", "max_stars_repo_path": "Homework/Homework II/solution/octree.py", "max_stars_repo_name": "SS47816/3D-PointCloud", "max_stars_repo_head_hexsha": "60b58d09b8c07b5359801e442f9ba70174065827", "max_stars_repo_licenses": ["MI... |
from PIL import Image as PILImage
import math
import torchvision.transforms as T
import torch.nn.functional as F
import torch.nn as nn
import torch
import matplotlib.pyplot as plt
import numpy as np
import random
import time
import os
import sys
"""## Step 1: We initialize the Experience Replay memory"""
... | {"hexsha": "ec2c7bf2959accc8985364afab44d451c9cd053c", "size": 12001, "ext": "py", "lang": "Python", "max_stars_repo_path": "example/ai.py", "max_stars_repo_name": "bhuvnk/myGymEnvs", "max_stars_repo_head_hexsha": "61cd214de05d91100db5a0be52ea919f2b6d0639", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "... |
import sys
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from mpl_toolkits import mplot3d
def trajectory_generator(T_final, N, traj=0, show_traj=False):
'''
Generates a circular trajectory given a final time and a sampling time
'''
r = 1 # radius
th = np.linspace(0,6*np.p... | {"hexsha": "b4b57d86083ad35098d957683f2f07aeae9ae245", "size": 11474, "ext": "py", "lang": "Python", "max_stars_repo_path": "planar_mpc/trajectory.py", "max_stars_repo_name": "enhatem/quadrotor_mpc_acados", "max_stars_repo_head_hexsha": "9ca50ecc0a852ba5f9464df0ccd5d40e3ebfc295", "max_stars_repo_licenses": ["Apache-2.0... |
# -*- coding: utf-8 -*-
"""
Created on Mon Oct 30 19:44:02 2017
@author: user
"""
import argparse
import torch
import torch.nn as nn
from flyai.dataset import Dataset
from torch.optim import Adam, SGD
from torch.optim.lr_scheduler import *
import numpy as np
from model import Model
from path import MODEL_PATH
from fly... | {"hexsha": "7ee2a76fb3567a2a6d2dc582f6d9eed95a57b77b", "size": 3786, "ext": "py", "lang": "Python", "max_stars_repo_path": "Sky_Seg_FlyAI/main.py", "max_stars_repo_name": "invisprints/flyai_match", "max_stars_repo_head_hexsha": "d087279268b10efed156292dc6e5844b03940192", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
import logging
import math
import matplotlib.pyplot as plt
import heartpy as hp
import numpy as np
import json
logging.basicConfig(filename='bad_data.log',
filemode='w',
level=logging.INFO)
def output_file(metrics, filename):
"""This function writes the output json file f... | {"hexsha": "5cc996ee1e30a98a02b45da5df6e1511061323d7", "size": 15291, "ext": "py", "lang": "Python", "max_stars_repo_path": "ecg_analysis.py", "max_stars_repo_name": "cduncan9/ECG-Analysis", "max_stars_repo_head_hexsha": "17517b86970d320ad749d04b3c54ad0929c286d3", "max_stars_repo_licenses": ["Unlicense"], "max_stars_co... |
#
# General-purpose Photovoltaic Device Model - a drift diffusion base/Shockley-Read-Hall
# model for 1st, 2nd and 3rd generation solar cells.
# Copyright (C) 2008-2022 Roderick C. I. MacKenzie r.c.i.mackenzie at googlemail.com
#
# https://www.gpvdm.com
#
# This program is free software; you can redist... | {"hexsha": "e320ac19cd3645ac30d95b07031684ce156c41aa", "size": 2015, "ext": "py", "lang": "Python", "max_stars_repo_path": "gpvdm_gui/gui/gl_lib.py", "max_stars_repo_name": "roderickmackenzie/gpvdm", "max_stars_repo_head_hexsha": "914fd2ee93e7202339853acaec1d61d59b789987", "max_stars_repo_licenses": ["BSD-3-Clause"], "... |
//
// helper.hpp
// arb-avm-cpp
//
// Created by Harry Kalodner on 5/17/20.
//
#ifndef avm_tests_helper_hpp
#define avm_tests_helper_hpp
#include <boost/filesystem.hpp>
#include <string>
extern std::string dbpath;
struct DBDeleter {
~DBDeleter() { boost::filesystem::remove_all(dbpath); }
};
#endif /* avm_t... | {"hexsha": "e7f172eae57e829a05cc85bf67e6814406dc8ee5", "size": 339, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "packages/arb-avm-cpp/tests/helper.hpp", "max_stars_repo_name": "mrsmkl/arbitrum", "max_stars_repo_head_hexsha": "7941a8c4870f98ed7999357049a5eec4a75d8c78", "max_stars_repo_licenses": ["Apache-2.0"], ... |
import string
import numpy as np
import pandas as pd
from pandas import DataFrame
import pandas._testing as tm
from pandas.api.types import (
is_extension_array_dtype,
pandas_dtype,
)
from .pandas_vb_common import (
datetime_dtypes,
extension_dtypes,
numeric_dtypes,
string_dtypes,
)
_numpy_d... | {"hexsha": "c45d5a0814544af5affbb4bb593bb418a33254af", "size": 3167, "ext": "py", "lang": "Python", "max_stars_repo_path": "asv_bench/benchmarks/dtypes.py", "max_stars_repo_name": "KiranHipparagi/pandas", "max_stars_repo_head_hexsha": "cc743996fe49aab5a9226444d98a6faa423f4aec", "max_stars_repo_licenses": ["PSF-2.0", "A... |
import os
import struct
from multiprocessing.pool import Pool
import numpy as np
class PointCloud:
"""
PCD format to (x, y, z, intensity) data.
Only binary-based PCD is supported.
Use attribute 'data' to get the numpy array (float32).
"""
def __init__(self, filename: str, use_intensity=True... | {"hexsha": "c96485190f3ce20b02193f3488bd83b1fe3a6e88", "size": 5226, "ext": "py", "lang": "Python", "max_stars_repo_path": "pcdet/datasets/sustech/pcd_utils.py", "max_stars_repo_name": "Kemo-Huang/OpenPCDet", "max_stars_repo_head_hexsha": "2f1c9d46ea8ba342dbbcf1b50054d38f99234dfc", "max_stars_repo_licenses": ["Apache-2... |
#!/usr/bin/python3.6
import os
#import gunicorn
import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output, State,Event
import time
from rq import Queue
from worker import conn
import uuid
from data_import import *
from graph_manipulation import *
f... | {"hexsha": "7f2503b1572963d66c1e2ac501f9cd91e6afe338", "size": 40698, "ext": "py", "lang": "Python", "max_stars_repo_path": "toy_example/recommend.py", "max_stars_repo_name": "hericonejito/health_recommendations", "max_stars_repo_head_hexsha": "14f3d98df4ab548441dd3bac730175892722dca9", "max_stars_repo_licenses": ["MIT... |
import numpy as np
from src.network_elements.network_element import NetworkElement
class LayersLinker(NetworkElement):
def __init__(self, previous_layer_dimension, next_layer_dimension) -> None:
self.previous_layer_dimension = previous_layer_dimension
self.next_layer_dimension = next_layer_dimension
... | {"hexsha": "4153b441f71fa78958caa128a12adb8f1cfdc6d8", "size": 1738, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/network_elements/layers_linker.py", "max_stars_repo_name": "Mathieu-R/neurawine", "max_stars_repo_head_hexsha": "9093662ef7df6d0a8c2de8a6aeb9b5598c63b576", "max_stars_repo_licenses": ["MIT"], ... |
using Test
using DataFlowTasks
using DataFlowTasks: R,W,RW, execute_dag
using LinearAlgebra
sch = DataFlowTasks.StaticScheduler()
DataFlowTasks.setscheduler!(sch)
include(joinpath(DataFlowTasks.PROJECT_ROOT,"test","testutils.jl"))
@testset "Static scheduler" begin
@testset "Fork-join" begin
m = 50
... | {"hexsha": "d1fc9443883feaaf33a5626545f445bc511235e4", "size": 1160, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/staticscheduler_test.jl", "max_stars_repo_name": "maltezfaria/DataFlowTasks.jl", "max_stars_repo_head_hexsha": "5fda1dfa60f381cdb3f3164c95aa6beb5b2b8ef6", "max_stars_repo_licenses": ["MIT"], "... |
from neat.population import Population
from neat.neural_network import NeuralNetwork, CTRNN, Neuron, Connection
from neat.genome import Genome
from neat.evolution import Neat, TrainTask
from hyperneat.substrate import Substrate
from hyperneat.spatial_node import SpatialNode, SpatialNodeType
import json
import copy
imp... | {"hexsha": "0546d3ac37f00397400915b8482160255649c973", "size": 7281, "ext": "py", "lang": "Python", "max_stars_repo_path": "hyperneat/evolution.py", "max_stars_repo_name": "pabloreyesrobles/py-hyperneat", "max_stars_repo_head_hexsha": "3a651b5955fe5d5b4abe2d6abeb161a4d1e6845a", "max_stars_repo_licenses": ["MIT"], "max_... |
/-
Copyright (c) 2022 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison
-/
import analysis.normed_space.dual
import analysis.normed_space.star.basic
import analysis.complex.basic
import analysis.inner_product_space.adjoint
import algebra.sta... | {"author": "leanprover-community", "repo": "mathlib", "sha": "5e526d18cea33550268dcbbddcb822d5cde40654", "save_path": "github-repos/lean/leanprover-community-mathlib", "path": "github-repos/lean/leanprover-community-mathlib/mathlib-5e526d18cea33550268dcbbddcb822d5cde40654/src/analysis/von_neumann_algebra/basic.lean"} |
import itertools
import os
from tqdm import tqdm
import numpy as np
from absl import flags
from absl import app
import pickle
import util
import sys
import glob
import data
import rouge_functions
FLAGS = flags.FLAGS
if 'dataset_name' not in flags.FLAGS:
flags.DEFINE_string('dataset_name', 'cnn_dm'... | {"hexsha": "ddd609f6aa67bfffc88d6ae109f9190d319b9425", "size": 10276, "ext": "py", "lang": "Python", "max_stars_repo_path": "kaiqiang_data.py", "max_stars_repo_name": "loganlebanoff/correct_summarization", "max_stars_repo_head_hexsha": "cec0d5401ddb5f7c33aca14f31da68b2f8092c53", "max_stars_repo_licenses": ["BSD-3-Claus... |
# Adapted from https://github.com/bensadeghi/DecisionTree.jl
__precompile__()
module Estimators
import Base: length, convert, promote_rule, show, start, next, done
export Estimator, Leaf, Node,
depth,
fit_regression_tree,
predict, assign_leaves
float(x) = map(Float64, x)
neg(arr) = map(!, arr) # ... | {"hexsha": "259d065793e1111f43fa668bcd639df736878852", "size": 6104, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/Julia/estimators.jl", "max_stars_repo_name": "naskoD/bachelorThesis", "max_stars_repo_head_hexsha": "028ffe0990df9fc72f43024eae67d968dbfb7ae6", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
from __future__ import print_function
from scipy.misc import imsave
import image
import os
import struct
import json
class BasicRunner(object):
def __init__(self, config, optimizer):
self.config = config
self.optimizer = optimizer
def run(self, (initial_image, initial_loss)):
self.sa... | {"hexsha": "4de87a892f65f08e896e0740089c7e16b838ebba", "size": 2539, "ext": "py", "lang": "Python", "max_stars_repo_path": "apps/pycasso/runner.py", "max_stars_repo_name": "danmarcab/deep_painting", "max_stars_repo_head_hexsha": "860c7d02bd6b112fffa199f715e61d895cba6623", "max_stars_repo_licenses": ["Apache-2.0"], "max... |
import pandas
import numpy
import json
import seaborn as sns
from pymea import spikelists as sl
from matplotlib import pyplot as plt
from os import path
from argparse import ArgumentParser
def configure_parser():
parser = ArgumentParser(description='Generates lineplots from one or more spike_list.csv files')
p... | {"hexsha": "bc73aab844ceb488e43a198a7eae859738fe664e", "size": 4392, "ext": "py", "lang": "Python", "max_stars_repo_path": "python/generate_lineplots.py", "max_stars_repo_name": "sdrendall/mea_analysis", "max_stars_repo_head_hexsha": "62006e35bcf92b5d9ec19a6f89f4a748ae36bf76", "max_stars_repo_licenses": ["MIT"], "max_s... |
#!/usr/bin/env python3
"""
Author: Jordan R. Abrahams (jabrahams@hmc.edu)
Last Updated: 11 January 2018
This program runs multiple Monte-Carlo simulations for a given execution
strategy.
This file is the primary running access point for the new RobotBrunch
simulator. Thus, it holds the main() function.
This file al... | {"hexsha": "dea3582e221eb8b74502d3ecc016219a2f8e4ea3", "size": 19120, "ext": "py", "lang": "Python", "max_stars_repo_path": "run_simulator.py", "max_stars_repo_name": "HEATlab/DREAM", "max_stars_repo_head_hexsha": "3e63d04ad77bbeefc102a72c7b131bc0a6a33656", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, "max... |
import numpy as np
from tqdm import tqdm
import lasagne
import theano
def create_dataset(npts):
""" Sample data uniformly in a [-5,5] x [-5, 5] window"""
# Create data
np.random.seed(20) # set seed for reproducibility
X = np.random.uniform(-5,5, (npts, 2)).astype(np.float32)
return X
def get_... | {"hexsha": "856be77b5c6fde858b89aabcf50310d1f6f253df", "size": 2055, "ext": "py", "lang": "Python", "max_stars_repo_path": "Sobolev/utils.py", "max_stars_repo_name": "inamori/DeepLearningImplementations", "max_stars_repo_head_hexsha": "8bbd3c5a4a7d24b2c098ba47cfd45fe2c152771d", "max_stars_repo_licenses": ["MIT"], "max_... |
import random
import numpy as np
import tensorflow as tf
import rlkit.misc.hyperparameter as hyp
from rlkit.envs.multitask.ant_env import GoalXYPosAnt
from rlkit.envs.multitask.pusher2d import CylinderXYPusher2DEnv
from rlkit.envs.multitask.her_half_cheetah import HalfCheetah, \
half_cheetah_cost_fn
from rlkit.en... | {"hexsha": "3852faa016e53dbd37bbf1df122262bf50ccd417", "size": 5729, "ext": "py", "lang": "Python", "max_stars_repo_path": "experiments/state_distance/baselines/abhishek_mb.py", "max_stars_repo_name": "Asap7772/railrl_evalsawyer", "max_stars_repo_head_hexsha": "baba8ce634d32a48c7dfe4dc03b123e18e96e0a3", "max_stars_repo... |
import numpy as np
import matplotlib.pyplot as plt
import scipy as sp
import scipy.optimize as scop
def get_maxima_minima(xs, ys):
ys_avg = moving_average(ys, n=30)
maxima = []
minima = []
last = ys_avg[0]
status = "up"
for y_idx, y in enumerate(ys_avg):
if status=="up... | {"hexsha": "7ca83682af6a18f16e3d66d0ab4f2c23a5a08950", "size": 14006, "ext": "py", "lang": "Python", "max_stars_repo_path": "code/utils.py", "max_stars_repo_name": "aimat-lab/ML4HEOs", "max_stars_repo_head_hexsha": "047f3414e77cbdad2c0264e54f1395b699f7eb31", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, ... |
import torch
torch.manual_seed(10)
torch.cuda.manual_seed_all(10)
import os
import numpy as np
from sklearn.metrics.pairwise import cosine_similarity as cs
import Energies
import Leapfrog
import Tangent
from Utils import writer,Off,Obj,Pts,rect_remesh
import header
from torch.autograd import Variable
def hmcExplore(... | {"hexsha": "c888d8092648ae639b43970894029ac72192f17a", "size": 5963, "ext": "py", "lang": "Python", "max_stars_repo_path": "Src/latentSpaceExplore_VanillaHMC.py", "max_stars_repo_name": "sanjeevmk/GLASS", "max_stars_repo_head_hexsha": "91c0954eab87d25d4866fea5c338f79fbca4f79e", "max_stars_repo_licenses": ["MIT"], "max_... |
[STATEMENT]
lemma zfact_iso_bij:
"bij_betw (zfact_iso n) {..<n} (carrier (ZFact (int n)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. bij_betw (zfact_iso n) {..<n} (carrier (ZFact (int n)))
[PROOF STEP]
using bij_betw_def zfact_iso_inj zfact_iso_ran
[PROOF STATE]
proof (prove)
using this:
bij_betw ?f ?A ?B = ... | {"llama_tokens": 262, "file": "Finite_Fields_Ring_Characteristic", "length": 2} |
# coding: utf-8
__author__ = 'Alain Lichnewsky'
__license__ = 'MIT License'
__version__ = '1.0'
# (C) A.Lichnewsky, 2018, 2020
#
# My own library organization (TBD: clean up ?)
import sys
import traceback
sys.path.append("pylib")
from UnitTest import *
# Common toolkit imports
import numpy as NP
impor... | {"hexsha": "a767a9922f7c8c53b66021fce8b9643d7ee13bed", "size": 18857, "ext": "py", "lang": "Python", "max_stars_repo_path": "source/lib/testDataCTE.py", "max_stars_repo_name": "AlainLich/COVID-Data", "max_stars_repo_head_hexsha": "43d7f950c86270bfe411af8bc899464f0599f48e", "max_stars_repo_licenses": ["MIT"], "max_stars... |
############################################################
# joLinearFunction - operator constructors ################
############################################################
# FFT operators: joDFT
include("joLinearFunctionConstructors/joDFT.jl")
# DCT operators: joDCT
include("joLinearFunctionConstructors/jo... | {"hexsha": "e154d9e09c18b3a7e89e8f6ebd49a51e06aeec8e", "size": 1227, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/joLinearFunctionConstructors.jl", "max_stars_repo_name": "slimgroup/JOLI.jl", "max_stars_repo_head_hexsha": "c1f669e34353394fd9a4711dc0038cf697bc0ad3", "max_stars_repo_licenses": ["MIT"], "max_... |
[STATEMENT]
lemma sort_conv_fold:
"sort xs = fold insort xs []"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. sort xs = fold insort xs []
[PROOF STEP]
by (rule sort_key_conv_fold) simp | {"llama_tokens": 79, "file": null, "length": 1} |
from ..utils import unique_row_count
from numpy import (array, atleast_1d, digitize, empty, floor, linspace, log2,
histogramdd, hstack, ndarray, sqrt, vstack)
from scipy.stats import skew
__all__ = ['hist', 'symbolic', 'doanes_rule']
def doanes_rule(x):
"""Convenience function for choosing an... | {"hexsha": "34345a54d5bfdc2dc09994ef452f4bc84e3756fe", "size": 2055, "ext": "py", "lang": "Python", "max_stars_repo_path": "mdentropy/core/binning.py", "max_stars_repo_name": "msmbuilder/mdentropy", "max_stars_repo_head_hexsha": "82d616ddffe11283052b2d870c3b0274736a173c", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
using Plots, LaTeXStrings, Measures; pyplot()
a, c, m = 69069, 1, 2^32
next(z) = (a*z + c) % m
N = 10^6
data = Array{Float64,1}(undef, N)
x = 808
for i in 1:N
data[i] = x/m
global x = next(x)
end
p1 = scatter(1:1000, data[1:1000],
c=:blue, m=4, msw=0, xlabel=L"n", ylabel=L"x_n")
p2 = histogram(data, bi... | {"hexsha": "4383542e57dd7535966d9ed17b445124fb226e29", "size": 454, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "1_chapter/lcg.jl", "max_stars_repo_name": "Yoshinobu-Ishizaki/StatsWithJuliaBook", "max_stars_repo_head_hexsha": "4c704e96d87b91e680122a6b6fa2d2083c70ea88", "max_stars_repo_licenses": ["MIT"], "max_... |
from pymongo import MongoClient, TEXT
import argparse
import numpy as np
parser = argparse.ArgumentParser(description='No description')
parser.add_argument('--embeddings', type=str, help='embeddings txt file', required=True)
parser.add_argument('--port', type=int, help='local mongo instance port', required=True)
args ... | {"hexsha": "37e164e408e2f4a03cfc8d4e83df99397e281204", "size": 891, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/create_embeddings_database.py", "max_stars_repo_name": "lffloyd/reddit-topic-modelling", "max_stars_repo_head_hexsha": "b34d7095cdd3ee66dfd95f8319f078449213e26f", "max_stars_repo_licenses":... |
%
% LibQPEP: A Library for Globally Optimal Solving Quadratic Pose Estimation Problems (QPEPs),
% It also gives highly accurate uncertainty description of the solutions.
%
%
% Article:
% Wu, J., Zheng, Y., Gao, Z., Jiang, Y., Hu, X., Zhu, Y., Jiao, J., Liu, M. (2020)
% Quadratic Pose Estimatio... | {"author": "zarathustr", "repo": "LibQPEP", "sha": "99e5c23e746ace0bac4a86742c31db6fcf7297ba", "save_path": "github-repos/MATLAB/zarathustr-LibQPEP", "path": "github-repos/MATLAB/zarathustr-LibQPEP/LibQPEP-99e5c23e746ace0bac4a86742c31db6fcf7297ba/MATLAB/test_stewart.m"} |
\section{Other Characteristics}
\label{sec:3_other}
{\bf Lifetime\ } We chose Mozilla to investigate the lifetime of performance bugs,
due to its convenient CVS query interface.
We consider a bug's life to have started when its buggy code
was first written. The 36 Mozilla bugs in our study
took 966 days on average to... | {"hexsha": "ec0ee1d35b75391a23373e0b1ddd8de6a929082a", "size": 5632, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "chapter-study/8_other.tex", "max_stars_repo_name": "songlh/thesis", "max_stars_repo_head_hexsha": "d5820825a2e9e3c53de37f2925ea0d87b8b2c73b", "max_stars_repo_licenses": ["Artistic-1.0-Perl", "ClArti... |
import cv2
import random
import numpy as np
IMG_WIDTH = 1200
IMG_HEIGHT = 800
WATERMARK_WIDTH = 256
WATERMARK_HEIGHT = 256
IMG_SIZE = IMG_HEIGHT * IMG_WIDTH
WATERMARK_SIZE = WATERMARK_HEIGHT * WATERMARK_WIDTH
KEY = 1001
THRESH = 75
def xor(x ,y):
if x == 0 and y == 0:
return 0
elif x == 0 and y != 0... | {"hexsha": "159f9b796deee599550ec149ac3c53a5435a1905", "size": 2658, "ext": "py", "lang": "Python", "max_stars_repo_path": "owernership_share_generator.py", "max_stars_repo_name": "Shikhar0051/Visual-Cryptography-for-Copyright-Protection", "max_stars_repo_head_hexsha": "9605b99cdae7c0c3ca398bf3d291cb5a6b7c622d", "max_s... |
#!/usr/bin/env python
"""
This module is used for carrying out a simple Metropolis Monte Carlo simulation of Lennard Jones particles
"""
import numpy as np
import pint
ureg = pint.UnitRegistry()
Q_ = ureg.Quantity
class MCLJ:
"""
This module is used for carrying out a simple Metropolis Monte Carlo simulation ... | {"hexsha": "a457412edd24d12a5c92c317bafb99293ca2a908", "size": 6713, "ext": "py", "lang": "Python", "max_stars_repo_path": "lj_mmcmd/mclj.py", "max_stars_repo_name": "wwilla7/lj-mmcmd", "max_stars_repo_head_hexsha": "e7b6e18c0eb2ff9d612e579d6c93b79ef7ec352e", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null,... |
[STATEMENT]
lemma fbd_inj_iff: "(bd\<^sub>\<F> f = bd\<^sub>\<F> g) = (f = g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. (bd\<^sub>\<F> f = bd\<^sub>\<F> g) = (f = g)
[PROOF STEP]
by (meson injD fbd_inj) | {"llama_tokens": 107, "file": "Transformer_Semantics_Kleisli_Transformers", "length": 1} |
% Normalized Leaky Kernel Affine Projection Algorithm
%
% W. Liu and J.C. Principe, "Kernel Affine Projection Algorithms", EURASIP
% Journal on Advances in Signal Processing, Volume 2008, Article ID 784292,
% 12 pages. http://dx.doi.org/10.1155/2008/784292
%
% Remark: This implementation includes a maximum dictionary s... | {"author": "steven2358", "repo": "kafbox", "sha": "694cf94df02a9728a90d7bacda1a8520b425f86f", "save_path": "github-repos/MATLAB/steven2358-kafbox", "path": "github-repos/MATLAB/steven2358-kafbox/kafbox-694cf94df02a9728a90d7bacda1a8520b425f86f/lib/nlkapa.m"} |
#!/usr/bin/python
# ホモグラフィ変換
# sympyを使って連立方程式を解き、その解を用いてopenCVでホモグラフィ変換を行なう
#
# Copyright 2020 YUUKIToriyama
import cv2
import sympy as sym
import numpy as np
import json
import math
# Webページから送られてきたJSONファイルの読み込み
tmp = open("test.json", "r")
json = json.load(tmp)
ab = math.floor(np.sqrt((json[0]["x"] - json[1]["x"])... | {"hexsha": "2deac77dc33f7972e95091b5d70d22c67c44a830", "size": 1330, "ext": "py", "lang": "Python", "max_stars_repo_path": "main.py", "max_stars_repo_name": "YUUKIToriyama/homograpy-sample", "max_stars_repo_head_hexsha": "6ba52a9675ea69f6d6acf3d1780898315d55d8b8", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
import numpy as np
from ..local_interpolation import ThirdOrderHermitePolynomialInterpolation
from .runge_kutta import AbstractESDIRK, ButcherTableau
# This γ notation is from the original paper. All the coefficients are described in
# terms of it.
#
# In passing: DifferentialEquations.jl actually gets this wrong. I... | {"hexsha": "f5b15da7f4a096f735b1374558dcbeb5d2869f97", "size": 3237, "ext": "py", "lang": "Python", "max_stars_repo_path": "diffrax/solver/kvaerno4.py", "max_stars_repo_name": "FedericoV/diffrax", "max_stars_repo_head_hexsha": "98b010242394491fea832e77dc94f456b48495fa", "max_stars_repo_licenses": ["Apache-2.0"], "max_s... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.