text stringlengths 0 1.25M | meta stringlengths 47 1.89k |
|---|---|
import numpy as np
from model import Game, Object, Cenario
from function import imageFunction
class PerformanceMeasurement():
def __init__(self,game,folder,amountOfThings,percentualBigThings,
objectSize,objectSpaceCostSize,objectBigProportion,
objectSmallProportion,objectVelocity,mustPopula... | {"hexsha": "90423f5a8298f4d29c85fd8ec35689f71869c748", "size": 3985, "ext": "py", "lang": "Python", "max_stars_repo_path": "model/performance_measurement/PerformanceMeasurement.py", "max_stars_repo_name": "SamuelJansen/Morgs", "max_stars_repo_head_hexsha": "b65d25c34ae92a7713125bb5c8f8d54226dc92bf", "max_stars_repo_lic... |
# *coding:utf-8*
"""
Define Equation class.Creates objects that holds equations and re-evaluates its value using the literal definition of the equation provided
Define Connection class. Special type of Equation that are used as source or sink terms (process inlet or outlet, respectively) or to connect two different M... | {"hexsha": "698ed937dc538307441f83dc0cf32ead8726dc2b", "size": 16798, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/sloth/core/equation.py", "max_stars_repo_name": "hfsf/sloth", "max_stars_repo_head_hexsha": "1e9ab7cdff149c39f676adb595de28c21a012a9c", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
# This file is a part of BAT.jl, licensed under the MIT License (MIT).
"""
abstract type BAT.InitvalAlgorithm
Abstract type for BAT initial/starting value generation algorithms.
Many algorithms in BAT, like MCMC and optimization, need initial/starting
values.
"""
abstract type InitvalAlgorithm end
export Initval... | {"hexsha": "f32c930c362c55e8f84d37b232e4bd33300189ed", "size": 3559, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/algotypes/initval_algorithm.jl", "max_stars_repo_name": "pitmonticone/BAT.jl", "max_stars_repo_head_hexsha": "64226c8a95b2f6edaa61f42384ff6ea9bf2f28de", "max_stars_repo_licenses": ["MIT"], "max... |
import numpy as np
import kinematicAnalysis as kA
import dynamicAnalysis as dA
import matplotlib.pyplot as plt
from matplotlib import rc
rc('text', usetex=True)
def pos(theta1, AB, AD, BC, CD):
rB = kA.toExp(AB, theta1)
rDB = AD - rB
# find angle of rCB, rDC
res1, res2 = kA.CPA4(BC, CD, rDB)... | {"hexsha": "0cd1798855a5e5db6ce8ca51cce6f4863d58f218", "size": 5486, "ext": "py", "lang": "Python", "max_stars_repo_path": "Finished/Other mechanisms/Mechanism 1/mechanism1.py", "max_stars_repo_name": "HungNguyenDang/literate-meme", "max_stars_repo_head_hexsha": "ed3383576918b6ca1480e45c6ed689c87636fc41", "max_stars_re... |
# -*- coding: utf-8 -*-
import os
import warnings
from abc import ABC, abstractmethod
from pathlib import Path
from random import randint
os.environ['PATH'] += ':/usr/local/bin'
import networkx as nx
import matplotlib.pyplot as plt
from networkx.drawing.nx_pydot import graphviz_layout
warnings.filterwarnings("ignore"... | {"hexsha": "f5bce6b2d7b9d905437a1c3fda7e07a4ac319faa", "size": 17835, "ext": "py", "lang": "Python", "max_stars_repo_path": "alg_complexity/trees.py", "max_stars_repo_name": "iraquitan/algorithms-analysis-ufpa", "max_stars_repo_head_hexsha": "c4d574d16cfad104b1feb6839fa75b7b539f2499", "max_stars_repo_licenses": ["MIT"]... |
from __future__ import print_function, division, absolute_import, unicode_literals
from builtins import bytes, dict, object, range, map, input, str
from future.utils import itervalues, viewitems, iteritems, listvalues, listitems
from io import open
import rfpipe
import pytest
from astropy import time
tparams = [(0, 0... | {"hexsha": "b923d217cc77af2a81afd2f6fe4f4c29fca8ddb0", "size": 2441, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_sim.py", "max_stars_repo_name": "KshitijAggarwal/rfpipe", "max_stars_repo_head_hexsha": "63b8a30c7186dbe982ab141c2978826f22603e48", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_sta... |
/-
Copyright (c) 2020 Simon Hudon. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Author: Simon Hudon
-/
import Mathlib.PrePort
import Mathlib.Lean3Lib.init.default
import Mathlib.data.nat.basic
import Mathlib.PostPort
namespace Mathlib
/-!
# `nat.upto`
`nat.upto p`, with `p... | {"author": "AurelienSaue", "repo": "Mathlib4_auto", "sha": "590df64109b08190abe22358fabc3eae000943f2", "save_path": "github-repos/lean/AurelienSaue-Mathlib4_auto", "path": "github-repos/lean/AurelienSaue-Mathlib4_auto/Mathlib4_auto-590df64109b08190abe22358fabc3eae000943f2/Mathlib/data/nat/upto_auto.lean"} |
import os
from typing import Optional
import numpy as np
import optuna
from matplotlib import pyplot as plt
from stable_baselines3.common.callbacks import BaseCallback, EvalCallback
from stable_baselines3.common.vec_env import DummyVecEnv, VecEnv
class SaveVecNormalizeCallback(BaseCallback):
"""
Callback for ... | {"hexsha": "8f994eafe81008772887d01dee1bae02ce54d672", "size": 1662, "ext": "py", "lang": "Python", "max_stars_repo_path": "rl-fmri/common/callbacks/fromzoo.py", "max_stars_repo_name": "liusida/thesis-bodies", "max_stars_repo_head_hexsha": "dceb8a36efd2cefc611f6749a52b56b9d3572f7a", "max_stars_repo_licenses": ["MIT"], ... |
from __future__ import print_function, absolute_import, division
import tensorflow as tf
import numpy as np
def conv_layer(layer_name, input_tensor, filter_height, filter_width, in_channels, out_channels,
stride_height, stride_width, padding='SAME', activation_function=tf.nn.relu,
filter... | {"hexsha": "d287e9954283091c663560b6fdce89b01f687348", "size": 4666, "ext": "py", "lang": "Python", "max_stars_repo_path": "FCN_layers.py", "max_stars_repo_name": "urun4m0r1/FCN_for_crack_recognition", "max_stars_repo_head_hexsha": "a663e063c675cf214ee776eb993ff4a88de40684", "max_stars_repo_licenses": ["MIT"], "max_sta... |
#%%
import pickle
import h5py
import numpy as np
import scipy.constants as const
import matplotlib.pyplot as plt
from matplotlib import cm
import matplotlib.animation as animation
from adjoint_bte.phonon_bte import PhononBTE
from tqdm import tqdm
from pymatgen.core import Structure
import torch
import torch.nn as nn
... | {"hexsha": "f5017d613ccf83b2b95878f973872db726eea437", "size": 23058, "ext": "py", "lang": "Python", "max_stars_repo_path": "Simulation_HeteroStruct.py", "max_stars_repo_name": "zhantaochen/panoramic-phonon-ued", "max_stars_repo_head_hexsha": "f66d409858e0670d28b81ecf2c7a56052cfed491", "max_stars_repo_licenses": ["MIT"... |
# --------------------------------------------------------
# Multitask Network Cascade
# Modified from py-faster-rcnn (https://github.com/rbgirshick/py-faster-rcnn)
# Copyright (c) 2016, Haozhi Qi
# Licensed under The MIT License [see LICENSE for details]
# --------------------------------------------------------
impo... | {"hexsha": "3d8dcd51d403ae3224e1454f978f00aa85347e51", "size": 9757, "ext": "py", "lang": "Python", "max_stars_repo_path": "lib/pylayer/anchor_target_layer.py", "max_stars_repo_name": "giladsharir/MNC-1", "max_stars_repo_head_hexsha": "449c8c6584c1ba634121c22d5f13c6720100e00b", "max_stars_repo_licenses": ["BSD-2-Clause... |
@generated function _index(::Val{name}) where {name}
#:(Int((ccall("llvm.nvvm.read.ptx.sreg.ctaid.x", llvmcall, UInt32, ()))+UInt32(1)))
s = "llvm.nvvm.read.ptx.sreg.ctaid.$name"
:(Int((ccall($s, llvmcall, UInt32, ()))+UInt32(1)))
end
#@inline blockIdx_x() = Int((ccall("llvm.nvvm.read.ptx.sreg.ctaid.x", ... | {"hexsha": "4d4f24cf64084339eea3422551e13327cfe6924c", "size": 767, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test_cudanative/fail_vadd_1_2.jl", "max_stars_repo_name": "hverr/TinyCassette.jl", "max_stars_repo_head_hexsha": "4f91cb886733571cc5e9a1e32af160d27bddc99a", "max_stars_repo_licenses": ["BSD-3-Clause... |
using Logging
#
# Plain implementation, no Stopping, simplified Armijo (Wolfe) linesearch
#
println("\n Newton-spectral plain with simple Armijo LineSearch ")
logger = Logging.ConsoleLogger(stderr,Logging.Warn)
Logging.with_logger(logger) do # execute twice to eliminate compilation time randomness
@time iter, f... | {"hexsha": "929c3255704e45906339a814d92103cc99afecc9", "size": 4394, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/DebugNewton.jl", "max_stars_repo_name": "tmigot/LSDescent", "max_stars_repo_head_hexsha": "9a5e6055894abaeb87d8a95c7b10382440311a8e", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 2, ... |
from typing import Union, Optional, Dict, List
import numpy as np
import xarray as xr
from pywatts.core.base import BaseTransformer
from pywatts.core.exceptions.wrong_parameter_exception import WrongParameterException
from pywatts.utils._xarray_time_series_utils import _get_time_indeces
class Differentiate(BaseTran... | {"hexsha": "257b4ec4caece52944932d2ca639714949bd8523", "size": 6109, "ext": "py", "lang": "Python", "max_stars_repo_path": "pywatts/modules/differentiate.py", "max_stars_repo_name": "zyxsachin/pyWATTS", "max_stars_repo_head_hexsha": "0ecf0263a620a77c0dafbf94e1ba251bf04720be", "max_stars_repo_licenses": ["MIT"], "max_st... |
[STATEMENT]
lemma mat_arc_pos_zero:
assumes n0: "n > 0"
shows "\<not> mat_arc_posI arc_pos (0\<^sub>m n n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<not> mat_arc_pos (0\<^sub>m n n)
[PROOF STEP]
unfolding mat_arc_posI_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<not> arc_pos (0\<^sub>m n n $$ ... | {"llama_tokens": 298, "file": "Jordan_Normal_Form_Matrix_Comparison", "length": 4} |
import numpy as np
import pandas as pd
import panel as pn
import panel.widgets as pnw
from matplotlib.backends.backend_agg import FigureCanvas
from matplotlib.figure import Figure
DATA_URL = (
"https://raw.githubusercontent.com/LuisM78/Occupancy-detection-data/master/datatraining.txt"
)
data = pd.read_... | {"hexsha": "c0810d807d15f9124bbf0cbe44b504a70fb436d4", "size": 1401, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/discourse_1739.py", "max_stars_repo_name": "gmatteo/awesome-panel", "max_stars_repo_head_hexsha": "7eb6965f4b3a7eca08c07561e631e5beb189ffd3", "max_stars_repo_licenses": ["Apache-2.0"], "ma... |
#
# Jacobi routine for CFD calculation
#
import numpy as np
import sys
def jacobi(niter, psi):
(m, n) = psi.shape
m = m - 2
n = n - 2
tmp = np.zeros((m+2, n+2))
for iter in range(1,niter+1):
# Use index notation and offsets to compute the stream function
tmp[1:m+1,1:n+1] = 0.25 ... | {"hexsha": "338bb7b4f9548a33a1a477b051e3559f886c6560", "size": 563, "ext": "py", "lang": "Python", "max_stars_repo_path": "P-SER/jacobi_numpy.py", "max_stars_repo_name": "athiracm/cfd", "max_stars_repo_head_hexsha": "ecf72aa9eaf16b1959ccde77d62a8c0cfac3aae7", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count"... |
import numpy as np
import pinocchio
from .differential_action import DifferentialActionDataAbstract, DifferentialActionModelAbstract
from .state import StatePinocchio
from .utils import a2m, m2a
class DifferentialActionModelFloatingInContact(DifferentialActionModelAbstract):
def __init__(self, pinocchioModel, ac... | {"hexsha": "7cc2f9aa3ea36db18770a67b760c98ac59e20b2e", "size": 5784, "ext": "py", "lang": "Python", "max_stars_repo_path": "unittest/python/crocoddyl/floating_contact.py", "max_stars_repo_name": "pFernbach/crocoddyl", "max_stars_repo_head_hexsha": "cbf81a329e3abaf4ce1b4a8fab1431f93cd9a5c8", "max_stars_repo_licenses": [... |
# vim: expandtab:ts=4:sw=4
import argparse
import pandas as pd
import numpy as np
import os
from tqdm import tqdm
def join(df_track):
prev_frame_idx = min(df_track['track_id'].index)
results = []
for frame_idx, currrent_row in df_track.iterrows():
gap = frame_idx - prev_frame_idx
if(gap > ... | {"hexsha": "d95e6b4c578fbf8def7b97c1274dbd45acabbc9d", "size": 2932, "ext": "py", "lang": "Python", "max_stars_repo_path": "object_tracking/4_concatenate.py", "max_stars_repo_name": "pcrete/humanet", "max_stars_repo_head_hexsha": "a956c0903d4a6ebff987da723ce8e80ada692585", "max_stars_repo_licenses": ["Apache-2.0"], "ma... |
*
* -------------------------------------------------------------
* O R B I T O R B I T
* -------------------------------------------------------------
* *
* THIS PACKAGE DETERMINES THE VALUES OF MATRIX ELEMENTS *
* OF ORBIT -... | {"hexsha": "d6ad75688d4ede09b81c91a0eca3c666fd55abec", "size": 1933, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "src/lib/libang/orbitorbit.f", "max_stars_repo_name": "mansour2014/ATSP2K_plus", "max_stars_repo_head_hexsha": "30842b9f086d1e497aeb778e2a352d1e8e520ec3", "max_stars_repo_licenses": ["BSD-4-Clause-... |
#include "rundeck_opts.h"
MODULE LANDICE
!@sum LANDICE contains variables and routines dealing with land ice
!@auth Original Development Team
!@ver 1.0
!@cont PRECLI,LNDICE
USE CONSTANT, only : lhm,rhoi,shi
#ifdef TRACERS_WATER
USE TRACER_COM, only : ntm
#endif
IMPLICIT NONE
SAVE
!@var ... | {"hexsha": "3b20d9ad68b755be28877bb029787595550caa0d", "size": 9336, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "source/model/LANDICE.f", "max_stars_repo_name": "Climostatistics/giss_model_e", "max_stars_repo_head_hexsha": "2ec1e4fd6ef009fe894a98955ef6e1586753ff79", "max_stars_repo_licenses": ["CC0-1.0"], "m... |
import configparser
import numpy as np
from chemical_hamiltonians import qiskit_LiH_chem, convert_from_qiskit, qiskit_H2_chem, paulis2matrices
import json
from itertools import product
from qulacs import Observable
def gen_hamiltonian(num_qubits, conf, taper=True, exact_en=False):
if conf["ham_type"] == 'LiH':... | {"hexsha": "b20ea99cadcb4a46982d1e9fbb22ff6688ae5e81", "size": 4943, "ext": "py", "lang": "Python", "max_stars_repo_path": "utils.py", "max_stars_repo_name": "mostaszewski314/RL_for_optimization_of_VQE_circuit_architectures", "max_stars_repo_head_hexsha": "75346f2f4ab4961337a2a729fdf8a8d723bfe2df", "max_stars_repo_lice... |
"""
ffmpeg -r 12 -i interp_%03d.png interp.mp4
"""
import sys
import os
import argparse
import PIL
import numpy as np
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
from torch.utils.data import Dataset, DataLoader
import kf
import flows
import geometry as geo
from data import MSRADataset, SUBJECTS,... | {"hexsha": "40fc4c0fd017e3e65d378efdee253829513d34b0", "size": 12650, "ext": "py", "lang": "Python", "max_stars_repo_path": "eval.py", "max_stars_repo_name": "ekrim/latent-tracking", "max_stars_repo_head_hexsha": "2688cd9adad18b301552b033b20acecbcce17868", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "m... |
import Bio.SeqIO, time, gzip
from operator import itemgetter
import numpy as np, argparse
def parse_blast(handle):
for line in handle:
r = line.split()
yield {
'qname':r[0],
'tname':r[1],
'pid':float(r[2]),
'len':float(r[3]),
'qcoords':sorted([int(r[6]), int(r[7])]),
'tcoords':sorted([int(r[8])... | {"hexsha": "c5b1d41d7ed661c40ea84fad60082fd476b23642", "size": 3343, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/anicalc.py", "max_stars_repo_name": "wolfQK/CheckV-fork", "max_stars_repo_head_hexsha": "3519bf4bf07fb73806225946a5629ddc542b4252", "max_stars_repo_licenses": ["BSD-3-Clause-LBNL"], "max_s... |
!*****************************************************************************
!
! Rokko: Integrated Interface for libraries of eigenvalue decomposition
!
! Copyright (C) 2012-2019 by Rokko Developers https://github.com/t-sakashita/rokko
!
! Distributed under the Boost Software License, Version 1.0. (See accompanying
!... | {"hexsha": "b188468f8c9beea102e6430cc0c79560803e9f95", "size": 828, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "example/fortran/dense/generate_vector/eigen_vector_set_elem.f90", "max_stars_repo_name": "t-sakashita/rokko", "max_stars_repo_head_hexsha": "ebd49e1198c4ec9e7612ad4a9806d16a4ff0bdc9", "max_stars_... |
(* Testing eta-expansion of elimination predicate *)
Section NATIND2.
Variable P : nat -> Type.
Variable H0 : P 0.
Variable H1 : P 1.
Variable H2 : forall n : nat, P n -> P (S (S n)).
Fixpoint nat_ind2 (n : nat) : P n :=
match n as x return (P x) with
| O => H0
| S O => H1
| S (S n) => H2 n (nat_ind2 n)
end.... | {"author": "mattam82", "repo": "Coq-misc", "sha": "60bc3cbe72083f4fa1aa759914936e4fa3d6b42e", "save_path": "github-repos/coq/mattam82-Coq-misc", "path": "github-repos/coq/mattam82-Coq-misc/Coq-misc-60bc3cbe72083f4fa1aa759914936e4fa3d6b42e/test-suite/success/Case1.v"} |
# 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 agreed to... | {"hexsha": "435e8afe3fd677fe0d58c08f9e9ca8c3d5bf8743", "size": 8507, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/ut/python/dataset/test_slice_patches.py", "max_stars_repo_name": "PowerOlive/mindspore", "max_stars_repo_head_hexsha": "bda20724a94113cedd12c3ed9083141012da1f15", "max_stars_repo_licenses": ... |
[STATEMENT]
lemma glue_nemp [simp, intro!]: "us \<noteq> \<epsilon> \<Longrightarrow> glue w us \<noteq> \<epsilon>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. us \<noteq> \<epsilon> \<Longrightarrow> glue w us \<noteq> \<epsilon>
[PROOF STEP]
by (elim hd_tlE) (auto simp only: glue.simps Let_def split!: if_split... | {"llama_tokens": 125, "file": "Combinatorics_Words_Graph_Lemma_Glued_Codes", "length": 1} |
import pytest
import numpy as np
from spike import simulation
PRECISION = 10
def test_rotateaxis():
x, y = simulation.Physics.rotateaxis(np.array([1.0, 0.0]), 0)
assert round(x, PRECISION) == 1.0 and round(y, PRECISION) == 0.0
x, y = simulation.Physics.rotateaxis(np.array([0.0, 1.0]), 0)
assert roun... | {"hexsha": "5e640cd3ae81d32f42efa4806a39785de6a68d79", "size": 4547, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/spike/test_simulation.py", "max_stars_repo_name": "rewolf93/CS370", "max_stars_repo_head_hexsha": "2239f8434df13bb7ac57fed05610850caa5800ad", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
import math
import random
from typing import Dict
import cv2
import numpy as np
from PIL import Image
def crop_or_padding_to_fixed_size(img, th, tw):
h, w, _ = img.shape
hpad, wpad = th >= h, tw >= w
hbeg = 0 if hpad else np.random.randint(0, h - th)
wbeg = (
0 if wpad else np.random.randint... | {"hexsha": "4d73b5e669a2688bd9177e724f73212e9527026a", "size": 7863, "ext": "py", "lang": "Python", "max_stars_repo_path": "lib/datasets/augmentation.py", "max_stars_repo_name": "f121606/OrigNet", "max_stars_repo_head_hexsha": "3684b1c53fc401b4d6b6c129d46ddb76a29294df", "max_stars_repo_licenses": ["Apache-2.0"], "max_s... |
import numpy as np
from example_process import polynomial
N = 10
x = np.array([np.linspace(0, 1, N)]).T
y = polynomial(x, sigma_noise=0.05)
| {"hexsha": "441b23e4aa926230cdef584359d26ddccc98b52a", "size": 143, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/train_model.py", "max_stars_repo_name": "harbenml/rbf-network", "max_stars_repo_head_hexsha": "a29cafdd8a7048804f18abc7621071b1131962d0", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
import numpy as np
import matplotlib.pyplot as plt
from mdp.fetchenv import FetchEnv
from boirlscenarios.irlobject import IRLObject
import os
from tqdm import tqdm
import boirlscenarios.constants as constants
from mdp.metafetch.fetchgeneratetrajs import generate_trajectories
folder = "logs/"
def evalsuccessrate(algo,... | {"hexsha": "342a45b4d86f861d16e31c2ba0ca3ddb0298b27b", "size": 3521, "ext": "py", "lang": "Python", "max_stars_repo_path": "boirlscenarios/calculatefetchsuccessrate.py", "max_stars_repo_name": "clear-nus/BOIRL", "max_stars_repo_head_hexsha": "cc872111fda3c7b8118e1a864831013c30f63948", "max_stars_repo_licenses": ["MIT"]... |
import numpy as np
from gym.envs.registration import register
from gym_conservation.envs.base_env import BaseEcologyEnv
class Allen(BaseEcologyEnv):
def __init__(
self,
r=0.3,
K=1,
C=0.5,
sigma=0.0,
init_state=0.75,
cost=1.0,
benefit=5.0,
Tm... | {"hexsha": "85220134ef08f39121f35604cf7118e27d0fe297", "size": 8170, "ext": "py", "lang": "Python", "max_stars_repo_path": "gym_conservation/envs/growth_models.py", "max_stars_repo_name": "boettiger-lab/gym_conservation", "max_stars_repo_head_hexsha": "ed48c99005722b08160f6da51de5674929eaa912", "max_stars_repo_licenses... |
function [denoised, noise] = denoise(noisy_signal,prior,std_noise)
% Given a noisy image and a similar prior image and the standard deviation of
% the noise (assumes gaussian distribution) denoise the iamge by building a
% steerable freq pyramid and using probabilistic algorithms to build a coring
% function (h... | {"author": "alecjacobson", "repo": "gptoolbox", "sha": "a0cb37d8edbcfb1e3587f793df8f24c76a2d7305", "save_path": "github-repos/MATLAB/alecjacobson-gptoolbox", "path": "github-repos/MATLAB/alecjacobson-gptoolbox/gptoolbox-a0cb37d8edbcfb1e3587f793df8f24c76a2d7305/imageprocessing/denoise.m"} |
[STATEMENT]
lemma map_dds_parametric [transfer_rule]:
"((A' ===> A) ===> (B ===> B') ===> rel_dds A B ===> rel_dds A' B') map_dds map_dds"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. ((A' ===> A) ===> (B ===> B') ===> rel_dds A B ===> rel_dds A' B') map_dds map_dds
[PROOF STEP]
unfolding map_dds_def
[PROOF STAT... | {"llama_tokens": 345, "file": "BNF_CC_DDS", "length": 2} |
#### Bandits
## Packages
import numpy as np
import random as rd
from bandits_to_rank.sampling.metropolis_hasting import *
from bandits_to_rank.sampling.proposal import *
from bandits_to_rank.sampling.target import *
from bandits_to_rank.opponents.greedy import GetSVD
from bandits_to_rank.tools.tools import order_... | {"hexsha": "594e4b11ac9bf46c0c80139247cad1ffe69d2a7b", "size": 13775, "ext": "py", "lang": "Python", "max_stars_repo_path": "bandits_to_rank/opponents/pb_mhb.py", "max_stars_repo_name": "gaudel/ranking_bandits", "max_stars_repo_head_hexsha": "1fe4a38b17a3bb7ccab3ae0f4d0afb70fe54dbc9", "max_stars_repo_licenses": ["MIT"]... |
# MIT License
#
# Copyright (c) 2021, Alex M. Maldonado
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify... | {"hexsha": "7260866f25a7f19d22965c1bb5c3591d7069f14b", "size": 2869, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_apdft_analysis.py", "max_stars_repo_name": "keithgroup/qa-atoms-dimers", "max_stars_repo_head_hexsha": "fff24f5658b45618de8f2dcb35b3b0b7e87898d0", "max_stars_repo_licenses": ["MIT"], "m... |
import tensorflow as tf
import numpy as np
from tensorflow.python.ipu.scopes import ipu_scope
from tensorflow.contrib.compiler.xla import xla
from tensorflow.python.ipu import utils
from tensorflow.python import ipu
from tensorflow.python.ipu.autoshard import automatic_sharding
def graph(x, y):
with ipu.ops.ipu_s... | {"hexsha": "cd9349914da0e321190c7e4fe0d8de4cdf779a6c", "size": 1714, "ext": "py", "lang": "Python", "max_stars_repo_path": "applications/tensorflow/cnns/training/inception_v1/ipu_shard.py", "max_stars_repo_name": "Splendon/examples", "max_stars_repo_head_hexsha": "ed4a8a01857b6ddca49559141acf5d0986eb01e1", "max_stars_r... |
// 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... | {"hexsha": "33bf2a5ff70798b5005833e0a1416028984c48c1", "size": 5571, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "be/src/common/status.cpp", "max_stars_repo_name": "gitter-badger/incubator-doris", "max_stars_repo_head_hexsha": "c877b4301331811c8fea4ef21f77bbf5a284f954", "max_stars_repo_licenses": ["Apache-2.0"]... |
/*
+----------------------------------------------------------------------+
| HipHop for PHP |
+----------------------------------------------------------------------+
| Copyright (c) 2010-2013 Facebook, Inc. (http://www.facebook.com) |
+---------... | {"hexsha": "4b5eea164fc9f5b3be7b79fb6d068c076a7efd47", "size": 12760, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "hphp/compiler/expression/closure_expression.cpp", "max_stars_repo_name": "dolfly/hhvm", "max_stars_repo_head_hexsha": "2153ed0f4a010e412902388341435a9d517cf3e3", "max_stars_repo_licenses": ["PHP-3.... |
"""
seppexp
~~~~~~~
Implements the ETAS (Epidemic Type Aftershock-Sequences) model intensity
estimation scheme outlined in Mohler et al. (2015). This model is somewhat
different, and simplified, from that used in the :mod:`open_cp.sepp` module:
- This is an explicitly grid based model. All events are assigned to th... | {"hexsha": "0fc1bcb43d054d3d1c31b9513eb09e142537f40c", "size": 13873, "ext": "py", "lang": "Python", "max_stars_repo_path": "open_cp/seppexp.py", "max_stars_repo_name": "sumau/PredictCode", "max_stars_repo_head_hexsha": "e2a2d5a8fa5d83f011c33e18d4ce6ac7e1429aa8", "max_stars_repo_licenses": ["Artistic-2.0"], "max_stars_... |
[STATEMENT]
lemma finite_gpv_Done [simp]: "finite_gpv (Done x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. local.finite_gpv (Generative_Probabilistic_Value.Done x)
[PROOF STEP]
by(auto intro: finite_gpvI) | {"llama_tokens": 92, "file": "CryptHOL_Generative_Probabilistic_Value", "length": 1} |
#!/usr/bin/env python
import matplotlib.pyplot as plt
import numpy as np
from scipy.signal import convolve2d
from skimage import color, data, restoration
if __name__ == '__main__':
image = color.rgb2gray(data.astronaut())
point_spread_func = np.ones((5, 5))/25.0
image = convolve2d(image, point_spread_func... | {"hexsha": "4519c1811894775d9fb923080f6ce767d9e7fba0", "size": 939, "ext": "py", "lang": "Python", "max_stars_repo_path": "Python/ImageProcessing/denoise.py", "max_stars_repo_name": "Gjacquenot/training-material", "max_stars_repo_head_hexsha": "16b29962bf5683f97a1072d961dd9f31e7468b8d", "max_stars_repo_licenses": ["CC-... |
import MsgPack
import UUIDs: UUID
import HTTP
import Sockets
"Will hold all 'response handlers': functions that respond to a WebSocket request from the client. These are defined in `src/webserver/Dynamic.jl`."
const funkies = Dict{Symbol,Function}()
macro expose(funcdef::Expr)
quote
funky = $(esc(funcdef)... | {"hexsha": "5bf4ebdb61fe1bd8a987bb9a0b826e3c12139be4", "size": 10082, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "server.jl", "max_stars_repo_name": "fonsp/MargoAPI.jl", "max_stars_repo_head_hexsha": "7495bbd0d57eda83c4dc308e7450fd52ab1b6a8b", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 4, "max_sta... |
using PyPlot, PyCall
include("amplt.jl")
PyDict(matplotlib["rcParams"])["axes.formatter.use_locale"] = true
sexframes = Dict(1=>readtable(joinpath("data", "mse14.csv")),
2=>readtable(joinpath("data", "fse14.csv")))
sexlabels = ["män"; "kvinnor"]
cdicts = vcat(map(sex -> map(ncd -> amplt(ratechange(sexframes[sex], 4/5,... | {"hexsha": "15ed750991eeef76f47e8a1275a08a289f55d490", "size": 712, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "postdata/2018-04-14-absolut/amp_fig_rr.jl", "max_stars_repo_name": "klpn/static-dust", "max_stars_repo_head_hexsha": "e0e963a0ab99f2727670f8e20ae9a733bcfb636d", "max_stars_repo_licenses": ["BSD-3-Cl... |
'''Deals with reading various types of csv file'''
import numpy as np
import csv
# moved np.array from str_2_num to the here - this helps sort out pcolor plots. It might screw things up, though
def vect_read(fname):
vect_out = __csv_vect_read__(fname)
if np.all(vect_out) == 4:
print "empty csv"
... | {"hexsha": "ad0920604619b6ca6cdbfc57002e0e03296ab7b5", "size": 1781, "ext": "py", "lang": "Python", "max_stars_repo_path": "data_io_fns/import_data/csv_functions.py", "max_stars_repo_name": "chrisjdavie/ws_cross_project", "max_stars_repo_head_hexsha": "10ffd6d0df1aeea0e5d2d6c5dfddab907a2cd439", "max_stars_repo_licenses... |
# code to try to figure out problem with gammaz inequality in bad diamond I
# Claudia March 2015
# test optBL with Case F Bad Diamond I
# Claudia January 2015
## include("../examples/case_f_example.jl");
## parameters!(net)
## q1 = Quartet(1,["6","7","4","8"],[0.5,0.4,0.1]);
## q2 = Quartet(2,["6","7","10","8"],[0.5... | {"hexsha": "01408b8e6d67a8ea10d8ca94bb72201dce45abf4", "size": 3085, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/debug_optBL.jl", "max_stars_repo_name": "kwsparks/PhyloNetworks.jl", "max_stars_repo_head_hexsha": "f466c13fa599cd8bc546e5ad4f2f0e5e64756805", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
import streamlit as st # web development
import numpy as np # np mean, np random
import pandas as pd # read csv, df manipulation
import time # to simulate a real time data, time loop
import plotly.express as px # interactive charts
# read csv from a github repo
df = pd.read_csv("https://raw.githubusercontent.com/L... | {"hexsha": "ac2c4fbc88dd909c10b15938d1091b8b904be397", "size": 2227, "ext": "py", "lang": "Python", "max_stars_repo_path": "app.py", "max_stars_repo_name": "amrrs/real-time-live-streamlit-dashboard-python", "max_stars_repo_head_hexsha": "72347d9de864218944aa3d7ad93a10133defc49b", "max_stars_repo_licenses": ["MIT"], "ma... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{\hspace{0.1in} Research Perspective in Computer Engineering: November 5, 2010}
\label{computerengrresearch}
Let me begin by quoting the president of USC, C. L. Max Nikias, who has echoed the importance of having good breath and depth in our higher education that... | {"hexsha": "9ccb9d932f3e67b38f2724469b0067b4ab051df8", "size": 15377, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "notes/research_perspective_in_computer_engineering.tex", "max_stars_repo_name": "eda-ricercatore/eecs-stem-outreach", "max_stars_repo_head_hexsha": "af17d1b753127db7a57f314e99bd1be2f708356a", "max_... |
import datetime
import pandas
import urllib
import json
import time
import sys
import datetime
import time
import requests
from yahoo_earnings_calendar import YahooEarningsCalendar
import numpy as np
import os
import requests as r
def get_income_q(t):
req = r.get("https://financialmodelingprep.com/... | {"hexsha": "5fb014927194f53a18aa0cc07770eb34631849f8", "size": 6142, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/ingest/iexGet.py", "max_stars_repo_name": "cpc-azimuths/azimuth-rain", "max_stars_repo_head_hexsha": "60ae6c338f24523a9168ccbed28b18b6f68538cc", "max_stars_repo_licenses": ["BSD-3-Clause"], "m... |
[STATEMENT]
lemma (in module) lmult_0 [simp]:
assumes 1: "m\<in>carrier M"
shows "\<zero>\<^bsub>R\<^esub>\<odot>\<^bsub>M\<^esub> m=\<zero>\<^bsub>M\<^esub>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<zero> \<odot>\<^bsub>M\<^esub> m = \<zero>\<^bsub>M\<^esub>
[PROOF STEP]
proof -
[PROOF STATE]
proof (sta... | {"llama_tokens": 2397, "file": "VectorSpace_RingModuleFacts", "length": 19} |
from sklearn.naive_bayes import GaussianNB
import numpy as np
import itertools
import csv
import pickle
import psutil
def __loadData(dataFile, isNumericData = False):
data = []
with open(dataFile, 'rt') as csvfile:
datas = csv.reader(csvfile, delimiter = ',')
for row in datas:
if ro... | {"hexsha": "38debba7509cad857e87a4b9314e803273054afe", "size": 2842, "ext": "py", "lang": "Python", "max_stars_repo_path": "Code/gtex_ExceptOne_NormalizedTraining_ExportPkl.py", "max_stars_repo_name": "HalforcNull/Research_PatternRecognition", "max_stars_repo_head_hexsha": "e9cbe8df75ae775e0ed813ac4956973b4e857979", "m... |
# Copyright (c) Meta Platforms, Inc. and affiliates. All Rights Reserved.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import argparse
import ast
import copy
import logging
import os
import time
from argparse import Namespace
from typing ... | {"hexsha": "8b269332dab20450b3465abb3451a89915ca49e7", "size": 26443, "ext": "py", "lang": "Python", "max_stars_repo_path": "metaseq/hub_utils.py", "max_stars_repo_name": "dedsecurity/gpt-ded", "max_stars_repo_head_hexsha": "0ac5a12418c0eb0906ba6072c141a1323ee6470b", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
'''
Title : Zeros and Ones
Subdomain : Numpy
Domain : Python
Author : codeperfectplus
Created : 17 January 2020
'''
import numpy
nums = tuple(map(int, input().split()))
print(numpy.zeros(nums, int))
print(numpy.ones(nums, int))
| {"hexsha": "40fc71923aee64769a89187ce211d322a0bab5f1", "size": 240, "ext": "py", "lang": "Python", "max_stars_repo_path": "HackerRank/PythonHackerRankSolutions/Numpy/ZerosandOnes.py", "max_stars_repo_name": "accidentalgenius09/competitive-programming-solution", "max_stars_repo_head_hexsha": "210746a7928dcd601ad9a735de5... |
import math
import numba
import numba.cuda as cuda
import numpy as np
import sys
from timing import time_region, time_region_cuda
def print_usage():
print(f'Usage: {sys.argv[0]} <arraydim> <version>', file=sys.stderr)
@numba.njit(cache=True, parallel=True)
def gemv_v1(alpha, A, x, beta, y):
N, M = A.shape
... | {"hexsha": "9ef12c1445d17ba6332f03ea10e33a7ee5019c3b", "size": 5003, "ext": "py", "lang": "Python", "max_stars_repo_path": "numba-cuda/src/matvec.py", "max_stars_repo_name": "edoardob90/PythonHPC", "max_stars_repo_head_hexsha": "cd931c70dbd974ad38a10229ae2563688199c14d", "max_stars_repo_licenses": ["BSD-3-Clause"], "ma... |
[STATEMENT]
lemma phiArg_disjoint_paths_extend:
assumes "var g r = V" and "var g s = V" and "r \<in> allVars g" and "s \<in> allVars g"
and "V \<in> oldDefs g n" and "V \<in> oldDefs g m"
and "g \<turnstile> n-ns\<rightarrow>defNode g r" and "g \<turnstile> m-ms\<rightarrow>defNode g s"
and "set ns \<inter> set ms = {}... | {"llama_tokens": 31657, "file": "Minimal_SSA_Irreducible", "length": 247} |
"""
Copyright 2018 NAVER Corp.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disc... | {"hexsha": "ed390a05e7a5737e86c6a8e0987506ce07a0b0f4", "size": 13358, "ext": "py", "lang": "Python", "max_stars_repo_path": "train.py", "max_stars_repo_name": "joyousprakhar/DialogWAE", "max_stars_repo_head_hexsha": "5d3a32f131ac80d0c7e25d24735933264703346d", "max_stars_repo_licenses": ["Unlicense"], "max_stars_count":... |
# Copyright (c) 2018: Matthew Wilhelm & Matthew Stuber.
# This code is licensed under MIT license (see LICENSE.md for full details)
#############################################################################
# EAGO
# A development environment for robust and global optimization
# See https://github.com/PSORLab/EA... | {"hexsha": "3a4e7e239974453aa2dd847dab66a7316dcaa5a0", "size": 20347, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/eago_optimizer/relax.jl", "max_stars_repo_name": "evrenmturan/EAGO.jl", "max_stars_repo_head_hexsha": "f2575a845fe3bb517ca53d5c1c490676bb0dca5e", "max_stars_repo_licenses": ["MIT"], "max_stars... |
/-
Copyright (c) 2018 Chris Hughes. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Chris Hughes, Abhimanyu Pallavi Sudhir, Jean Lo, Calle Sönne, Benjamin Davidson
-/
import analysis.special_functions.trigonometric.basic
import topology.algebra.order.proj_Icc
/-!
# In... | {"author": "nick-kuhn", "repo": "leantools", "sha": "567a98c031fffe3f270b7b8dea48389bc70d7abb", "save_path": "github-repos/lean/nick-kuhn-leantools", "path": "github-repos/lean/nick-kuhn-leantools/leantools-567a98c031fffe3f270b7b8dea48389bc70d7abb/src/analysis/special_functions/trigonometric/inverse.lean"} |
import glob
import os
import xml.etree.ElementTree as ET
import cv2
import numpy as np
import csv
from generate_dataset import TRAIN_OUTPUT_FILE, VALIDATION_OUTPUT_FILE, DATASET_FOLDER, TRAIN_FOLDER
from train_model import create_model, IMAGE_SIZE, ALPHA, MEAN
DEBUG = False
WEIGHTS_FILE = "model-741.78.h5"
def iou(... | {"hexsha": "8a96577db0e8bada4e4362474efaa9a35a590222", "size": 3305, "ext": "py", "lang": "Python", "max_stars_repo_path": "evaluate_performance.py", "max_stars_repo_name": "ChocoShell/object-localization", "max_stars_repo_head_hexsha": "f5fcaccf241603c42722486ee92828f96a0b3eda", "max_stars_repo_licenses": ["MIT"], "ma... |
# %%
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable
import pandas as pd
from os.path import join as ospj
import json
# Get paths from config file and metadata
with open("config.json") as f:
config = json.load(f)
repo_path = config['repositoryPath']
metada... | {"hexsha": "fb7af8bc3ed0086f2d35de7591f09530560b5779", "size": 4145, "ext": "py", "lang": "Python", "max_stars_repo_path": "code/fig-00-sz_dissim_mat.py", "max_stars_repo_name": "akashpattnaik/pre-ictal-similarity", "max_stars_repo_head_hexsha": "85f963aa0c6d2d0a6e971ffa005c400e136a0a76", "max_stars_repo_licenses": ["M... |
[STATEMENT]
lemma tuple_prj:
assumes "cospan f g" and "seq \<p>\<^sub>1[f, g] h"
shows "\<langle>\<p>\<^sub>1[f, g] \<cdot> h \<lbrakk>f, g\<rbrakk> \<p>\<^sub>0[f, g] \<cdot> h\<rangle> = h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<langle>\<p>\<^sub>1[f, g] \<cdot> h \<lbrakk>f, g\<rbrakk> \<p>\<^su... | {"llama_tokens": 3819, "file": "Category3_CategoryWithPullbacks", "length": 17} |
# ite relative
from . import network # noqa: F401
from . import numpy # noqa: F401
from . import tensorflow # noqa: F401
from . import torch # noqa: F401
| {"hexsha": "43fb6db1aeca12efb5b3d06845e423e102249efe", "size": 158, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/ite/utils/__init__.py", "max_stars_repo_name": "bcebere/ite-api", "max_stars_repo_head_hexsha": "f01ea235a92bd70e16c776b4ce2ce920ca91fbc0", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars... |
\subsection{<Scan Name>}\label{sec:<Scan label><Tex run>}
% Please add the following required packages to your document preamble:
% \usepackage{booktabs}
\begin{table}[h]
\centering
\caption{<Scan Name>}
\label{tab:<Scan label><Tex run>}
\begin{tabular}{@{}|l|l|l|l|l|l|@{}}
\toprule
\textbf{SW Version} ... | {"hexsha": "c23b101320523e16bccf22a40d1a414cf5befd22", "size": 1611, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "in/tex/ScanTemplate.tex", "max_stars_repo_name": "mvsoliveira/IBERTpy", "max_stars_repo_head_hexsha": "7d702ed87f0c8fbe90f4ef0445e2d4f77a79ec02", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Exports subset of an IBEIS database to a new IBEIS database
"""
from __future__ import absolute_import, division, print_function
import utool as ut
from ibeis.other import ibsfuncs
from ibeis import constants as const
(print, rrr, profile) = ut.inject2(__name__)
def ... | {"hexsha": "915fcc65aeed5b2f9915759d9b933f2008e80b29", "size": 47707, "ext": "py", "lang": "Python", "max_stars_repo_path": "ibeis/dbio/export_subset.py", "max_stars_repo_name": "brmscheiner/ibeis", "max_stars_repo_head_hexsha": "9bb93a6cd74ac47921e734c80917a38609dfe661", "max_stars_repo_licenses": ["Apache-2.0"], "max... |
(* Property from Productive Use of Failure in Inductive Proof,
Andrew Ireland and Alan Bundy, JAR 1996.
This Isabelle theory is produced using the TIP tool offered at the following website:
https://github.com/tip-org/tools
This file was originally provided as part of TIP benchmark at the following web... | {"author": "data61", "repo": "PSL", "sha": "2a71eac0db39ad490fe4921a5ce1e4344dc43b12", "save_path": "github-repos/isabelle/data61-PSL", "path": "github-repos/isabelle/data61-PSL/PSL-2a71eac0db39ad490fe4921a5ce1e4344dc43b12/UR/TIP_with_Proof/Prod/Prod/TIP_prop_47.thy"} |
import json
import sys
import numpy as np
from sklearn import metrics
from sklearn.linear_model import LinearRegression
from sklearn.model_selection import train_test_split
from script.TrustScore import TrustScore
sys.path.append("..")
from mwapi import Session
from maya.extractors import api
import pandas as pd
fro... | {"hexsha": "1228f246ef008a2e82f572f961c815dbccd9dc1d", "size": 3524, "ext": "py", "lang": "Python", "max_stars_repo_path": "script/LongevityRegressionGraph.py", "max_stars_repo_name": "wahabjawed/wiki-maya", "max_stars_repo_head_hexsha": "b6b24b02e64d3613e6641c1d67d2847dcc6590e6", "max_stars_repo_licenses": ["MIT"], "m... |
import os
import mat73
import json
import numpy as np
import pandas as pd
import cv2
import math
def normalized2KITTI(box):
"""
convert Bbox format
:param box: [X, Y, width, height]
:return: [xmin, ymin, xmax, ymax]
"""
o_x, o_y, o_width, o_height = box
xmin = int(o_x)
ymin = int(o_y)
... | {"hexsha": "b4ef424f9b61039adcfa9172c85532709997d125", "size": 10526, "ext": "py", "lang": "Python", "max_stars_repo_path": "svhnl/converter.py", "max_stars_repo_name": "ACRA-FL/svhnL", "max_stars_repo_head_hexsha": "c16f5543b1572ba8567f968a289e6d8663b609d8", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null,... |
# axes = [0, 2, 1] first two are the planes we are graphing in, last one we are not
# 3D simulation of bouncing particles
#
# author: Konstantin Lübeck (Embedded Systems, Universtiy of Tuebingen)
# adapted from: Stephan Schirrecker (schirrecker)
# https://gist.github.com/schirrecker/982847faeea703dd6f1dd8a09eab13... | {"hexsha": "b8ff7ade9ce130a236923e3a47daf9accd7375b6", "size": 6294, "ext": "py", "lang": "Python", "max_stars_repo_path": "Scratch Python Particle Simulator/Animated2D noninteracting refinded simulation.py", "max_stars_repo_name": "TrentConley/Capstone", "max_stars_repo_head_hexsha": "9b36a7fa8d6531235fb3efcc60e357786... |
theory PMF_Sampler
imports Main
"HOL-Probability.Probability"
"HOL-Library.Code_Lazy"
"Zeta_Function.Zeta_Library"
(* The last import is to pull set_nn_integral_cong which should be in
HOL-Analysis.Set_Integral. *)
begin
hide_const (open) ord
text \<open>Abbreviation for the discrete $\sigma$-al... | {"author": "ekarayel", "repo": "random_code_gen", "sha": "master", "save_path": "github-repos/isabelle/ekarayel-random_code_gen", "path": "github-repos/isabelle/ekarayel-random_code_gen/random_code_gen-main/Random_Code_Generation/archive/PMF_Sampler.thy"} |
/-
Copyright (c) 2018 Simon Hudon. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Simon Hudon, Patrick Massot, Eric Wieser
-/
import algebra.group.prod
import group_theory.group_action.defs
/-!
# Prod instances for additive and multiplicative actions
> THIS FILE IS S... | {"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/group_theory/group_action/prod.lean"} |
# Copyright (C) 2017-2019 Intel Corporation
#
# SPDX-License-Identifier: MIT
import argparse
from bench import parse_args, time_mean_min, print_header, print_row
import daal4py
from daal4py.sklearn.utils import getFPType
import numpy as np
parser = argparse.ArgumentParser(description='daal4py pairwise distances '
... | {"hexsha": "2b352fad30a3e6791791c788c26070d7459bd6dd", "size": 1390, "ext": "py", "lang": "Python", "max_stars_repo_path": "daal4py/distances.py", "max_stars_repo_name": "amueller/scikit-learn_bench", "max_stars_repo_head_hexsha": "4752e4590c11cdd6c13a4af5aaf9f88e8a86ecbb", "max_stars_repo_licenses": ["MIT"], "max_star... |
from lesson_functions import extract_features
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import GridSearchCV
from sklearn.model_selection import train_test_split
from sklearn import svm
import time
import pickle
import numpy as np
import os
LABELED_DATA_DIR=os.path.dirname(os.path.ab... | {"hexsha": "aa0a8c7670447c7d655f18b9c6a2776609d94246", "size": 3214, "ext": "py", "lang": "Python", "max_stars_repo_path": "train.py", "max_stars_repo_name": "MarkBroerkens/CarND-Vehicle-Detection", "max_stars_repo_head_hexsha": "2194acebf0ff1b8e50f8ced37248da9847537e6b", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
from configpkg.FeatureSelectionConfig import FeatureSelectionConfig
from configpkg.ClassifiersConfig import ClassifiersConfig
class ModelConf:
def __init__(self, fsel, clf, conf_id):
assert fsel is not None
assert clf is not None
assert conf_id is not None
self.__conf_id = conf_id... | {"hexsha": "c42c0197bc84078904166b262b97e29466b2c913", "size": 2936, "ext": "py", "lang": "Python", "max_stars_repo_path": "PredictiveOutlierExplanationBenchmark/src/holders/ModelConf.py", "max_stars_repo_name": "myrtakis/MxM", "max_stars_repo_head_hexsha": "552fa5ad27e542f41ade04ad1af565fdc6213be7", "max_stars_repo_li... |
[STATEMENT]
lemma (in Module) mpj_surjec:"submodule R M H \<Longrightarrow>
surjec\<^bsub>M,(M /\<^sub>m H)\<^esub> (mpj M H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. submodule R M H \<Longrightarrow> surjec\<^bsub>M,M /\<^sub>m H\<^esub> mpj M H
[PROOF STEP]
apply (simp add:surje... | {"llama_tokens": 1122, "file": "Group-Ring-Module_Algebra7", "length": 10} |
from operator import ge
from KMC.AFP.AFP_lattice import AFP_square_lattice
import numpy as np
def generate_data():
a = 0.1
Lx = 10
Ly = 10
L = 2
W = 3
sl = AFP_square_lattice(a, Lx, Ly)
angle60 = sl.square_offset(L, W,60 )
angle120 = sl.square_offset(L, W, 120)
angle0 = ... | {"hexsha": "41791ef6f91449f6eb32d6ce391215234d898916", "size": 1127, "ext": "py", "lang": "Python", "max_stars_repo_path": "KMC/AFP/test/test_lattice/test_square.py", "max_stars_repo_name": "Yusheng-cai/KMC_python", "max_stars_repo_head_hexsha": "d139f47ad5f67e456adfe53228d2f1add3f2f6ac", "max_stars_repo_licenses": ["M... |
import numpy as np
from sklearn.metrics import accuracy_score, hamming_loss, precision_recall_fscore_support
import keras
from keras.utils import to_categorical
from keras.applications import VGG16
from keras.applications.inception_v3 import InceptionV3
from keras.applications.resnet50 import ResNet50
from keras.appli... | {"hexsha": "8b257799218cd428805491f367238eea61ce3564", "size": 8689, "ext": "py", "lang": "Python", "max_stars_repo_path": "ExpModel.py", "max_stars_repo_name": "Moda007/MethodicalSplit", "max_stars_repo_head_hexsha": "a9a56e310bf822c21141deb90569721b25628c88", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nul... |
using Jchemo
n = 50 ; p = 7 ; q = 2
Xtrain = rand(n, p) ; Ytrain = rand(n, q)
ytrain = Ytrain[:, 1]
m = 3
Xtest = rand(m, p) ; Ytest = rand(m, q)
ytest = Ytest[:, 1]
########### PLSR
nlv = 0:2
pars = mpars(nlv = nlv)
gridscore(Xtrain, Ytrain, Xtest, Ytest;
score = msep, fun = plskern, pars = pars)
# Fast... | {"hexsha": "a4e3eb9d859e9f6e2302ca74fbcf1e2ca5376180", "size": 2939, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "docs/src/demos/ex/ex_gridscore_r.jl", "max_stars_repo_name": "mlesnoff/Jchemo.jl", "max_stars_repo_head_hexsha": "fea8da15c0458c0e68921cda55a5bf448170eb53", "max_stars_repo_licenses": ["MIT"], "max... |
[STATEMENT]
lemma NSTD_lemma2': "(rec_exec rec_NSTD [c] = Suc 0) \<Longrightarrow> NSTD c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. rec_exec rec_NSTD [c] = Suc 0 \<Longrightarrow> NSTD c
[PROOF STEP]
apply(simp add: rec_exec.simps rec_NSTD_def stat_lemma left_lemma
lg_lemma right_lemma power_lemma NSTD.... | {"llama_tokens": 554, "file": "Universal_Turing_Machine_UF", "length": 4} |
#ifndef MATRIX_FILE_READER_HPP
#define MATRIX_FILE_READER_HPP
#include <boost/algorithm/string.hpp>
#include <fstream>
#include <string>
template <typename T> class MatrixFileReader {
public:
MatrixFileReader(std::string fileName, std::string delimiter = ",") {
std::ifstream file(fileName);
std::vector<std... | {"hexsha": "cd9a830cef65893938fc9162fa96b81d4ecbe9de", "size": 610, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "src/core/MatrixFileReader.hpp", "max_stars_repo_name": "henrywarhurst/matrix", "max_stars_repo_head_hexsha": "317a2a7c35c1c7e3730986668ad2270dc19809ef", "max_stars_repo_licenses": ["BSD-3-Clause"], "... |
# https://github.com/fixstars/ion-csharp/blob/master/test/Test.cs
from ionpy import Node, Builder, Buffer, PortMap, Port, Param, Type, TypeCode
import numpy as np # TODO: rewrite with pure python
def test_all():
t = Type(code_=TypeCode.Int, bits_=32, lanes_=1)
input_port = Port(key='input', type=t, dim=2)
... | {"hexsha": "f78a248c389319bda4ea5d473419f1418bcf63fd", "size": 1374, "ext": "py", "lang": "Python", "max_stars_repo_path": "python/tests/test_all.py", "max_stars_repo_name": "tk1012/ion-kit", "max_stars_repo_head_hexsha": "d42be09dfd78fe415058723c186a76a84c699d45", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
## TEMPAUTOCORR PLOT
from __future__ import print_function
path = '/home/mkloewer/python/swm/'
import os; os.chdir(path) # change working directory
import numpy as np
import matplotlib.pyplot as plt
from scipy.integrate import cumtrapz
## read data
runpath1 = path+'data/run%04i' % 0
D1 = np.load(runpath1+'/analysis/a... | {"hexsha": "89adf5e860feb423ea5dce139151ae4905c09f9a", "size": 3288, "ext": "py", "lang": "Python", "max_stars_repo_path": "swm-master/swm-master/calc/misc/tempautocorr_plot_bf.py", "max_stars_repo_name": "m2lines/subgrid", "max_stars_repo_head_hexsha": "3de5d14c5525a62529d43cbafccda716c74e32df", "max_stars_repo_licens... |
print("Importing libraries...")
import cv2
import numpy as np
import os
import random
import h5py
data_directory = "./data" #insert the directory you'll be working with
img_size = 128
categories = ["Positive", "Negative"]
training_data = []
def create_training_data():
for category in categories:
... | {"hexsha": "d793da166c19a6742c3ead8f1c98f4308ddd3f21", "size": 1840, "ext": "py", "lang": "Python", "max_stars_repo_path": "prep.py", "max_stars_repo_name": "TejasReddy9/crack_detection", "max_stars_repo_head_hexsha": "9cb37f11945f252e4916a2129f8a0c7765f4669c", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_coun... |
# FIXME: This module is a part of Array functionality, so it is located on CLUDA level,
# but it requires some high-level Reikna functionality (computations and transformations).
# So it is a bit of circular dependency.
# Ideally, this should be moved to computation level, perhaps creating two versions of Array -
# CLU... | {"hexsha": "c366d5bb7e0fcd38003665c22ef2938f0d2d9cf7", "size": 7411, "ext": "py", "lang": "Python", "max_stars_repo_path": "reikna/cluda/array_helpers.py", "max_stars_repo_name": "fjarri/reikna", "max_stars_repo_head_hexsha": "171bf233664f5f7ec4f457e826e0b91849e91384", "max_stars_repo_licenses": ["MIT"], "max_stars_cou... |
import os
import numpy as np
import json
import logging
from pipeline_monitor import prometheus_monitor as monitor
from pipeline_logger import log
import logging
import mxnet as mx
_logger = logging.getLogger('pipeline-logger')
_logger.setLevel(logging.INFO)
_logger_stream_handler = logging.StreamHandler()
_logger_st... | {"hexsha": "077cf8cf5cae48e2dd3ab3ef4ee7916c077deb97", "size": 3224, "ext": "py", "lang": "Python", "max_stars_repo_path": "mxnet/mnist-v1/model/pipeline_invoke_python.py", "max_stars_repo_name": "PipelineAI/models", "max_stars_repo_head_hexsha": "d8df07877aa8b10ce9b84983bb440af75e84dca7", "max_stars_repo_licenses": ["... |
# adapted from https://github.com/chaaland/EllipseFit.jl by Casey Haaland
using LinearAlgebra
export ParametricFormEllipse, ConicFormEllipse, parametric2conic, conic2parametric
abstract type EllipseForm end
struct ParametricFormEllipse{T<:Real, U<:Real, V<:Real}
axis_lengths::Array{T}
center::Array{U}
... | {"hexsha": "b421fe53566e3a8107401b59f655cfb37d1c5b1d", "size": 3865, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/ellipse.jl", "max_stars_repo_name": "razvangheorghe/HexapoleDataFit.jl", "max_stars_repo_head_hexsha": "7586e7465f6c339fcedaf17d55978dcbc23d9aa1", "max_stars_repo_licenses": ["MIT"], "max_stars... |
# Code partially adopted from https://gist.github.com/noname01/e91e9bea678f0b2f1c9bd283f5b0f452
import sys
import numpy as np
import tensorflow as tf
from seq2seq import tasks, models
from seq2seq.training import utils as training_utils
from seq2seq.tasks.inference_task import InferenceTask, unbatch_dict
from pydoc im... | {"hexsha": "be3701bc8c655b81623e40f010aa216b81561581", "size": 6120, "ext": "py", "lang": "Python", "max_stars_repo_path": "generator/slug2slug/single_inference.py", "max_stars_repo_name": "irenenikk/e2e-generator", "max_stars_repo_head_hexsha": "49c7c92c877905bdb165f5f3afaa822f97a10b0f", "max_stars_repo_licenses": ["A... |
"""Actors for generating trajectories."""
from typing import Optional
import chex
import jax
import numpy as np
from algorithms.types import ActorOutput, Params
class Actor(object):
def __init__(self, envs, agent):
self._envs = envs
self._agent_step = jax.jit(agent.batch_step)
num_envs =... | {"hexsha": "d37b5978ab542a8e8bbe5ab69c1b3404c1377b95", "size": 3170, "ext": "py", "lang": "Python", "max_stars_repo_path": "algorithms/actors.py", "max_stars_repo_name": "Hwhitetooth/jax_muzero", "max_stars_repo_head_hexsha": "b8ab36251d22e0246d61514841ba17a22f4b2a36", "max_stars_repo_licenses": ["MIT"], "max_stars_cou... |
from __future__ import annotations
from scanpy import logging as logg
from anndata import AnnData
from scanpy.plotting._utils import add_colors_for_categorical_sample_annotation
from numba import njit
from scipy.spatial import KDTree
from pandas._libs.lib import infer_dtype
from pandas.core.dtypes.common import is_ca... | {"hexsha": "451a440b88756959b27c14e59f30ad42b413b2aa", "size": 2962, "ext": "py", "lang": "Python", "max_stars_repo_path": "squidpy/pl/_interactive/_utils.py", "max_stars_repo_name": "dnjst/squidpy", "max_stars_repo_head_hexsha": "ca765d04b9621debb8752d3d4693dd68f6909513", "max_stars_repo_licenses": ["BSD-3-Clause"], "... |
#Example : 2.2A Chapter : 2.2 page no : 50
#Pivots and Multipliers in converting matrix to upper traingular system
matrix(c(1,-1,0,-1,2,-1,0,-1,2),ncol=3)->A
A
print(paste("First pivot is",A[1,1]))
l21<-A[2,1]/A[1,1]
print(paste("Multiplier L21 to convert the second row first element to 0 is",l21))
A[... | {"hexsha": "f543583ee8925c9140e2d3ac7783631304ac0218", "size": 505, "ext": "r", "lang": "R", "max_stars_repo_path": "Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.2.a/Ex2_2.2a.r", "max_stars_repo_name": "prashantsinalkar/R_TBC_Uploads", "max_stars_repo_head_hexsha": "b3f3a8ecd454359a2e992161844f2fb599f8238a"... |
import numpy.linalg as la
def svd_truncate_with_singular_values(ttslice,center,svs,cutoff=None,chi_max=None,chi_min=None):
pass
def svd_truncate(ttslice,center,cutoff=None,chi_max=None,chi_min=None,svd=la.svd):
pass
def var_truncate(ttslice,chi=None):
pass
| {"hexsha": "12ebd156e5958d999b4e58559d9af1dd17ac0a2f", "size": 270, "ext": "py", "lang": "Python", "max_stars_repo_path": "ttarray/raw/truncate.py", "max_stars_repo_name": "sonnerm/ttarray", "max_stars_repo_head_hexsha": "c962cb2be303dfdb6743aa802bd11b89043e7b71", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
import tensorflow as tf
import numpy as np
import json, pickle, os
from CNN_GloVe.CNN.input_data import DatasetManager
from CNN_GloVe.CNN.model import CNN_GloVe
from utils import F1_score
class Run_CNN_GloVe:
'''
run CNN-GloVe model
'''
def __init__(self, vector_size, **kwargs):
self.save_dir ... | {"hexsha": "bbeb43668cb1d95486437356fe9eb6f853c1b8a7", "size": 9473, "ext": "py", "lang": "Python", "max_stars_repo_path": "CNN_GloVe/CNN/run_model.py", "max_stars_repo_name": "YinpeiDai/NAUM", "max_stars_repo_head_hexsha": "d8328b8c10ab26b069bfa12176d7b39c260acafc", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
import sys
sys.path.append('../..')
import matplotlib.pyplot as plt
import numpy as np
from composites.laminate import read_isotropic
from tudaesasII.quad4r import Quad4R, update_K, update_M, DOF
from tudaesasII.utils import plot_sparse_matrix
nx = 5
ny = 18
a = 0.3
b = 0.5
# Material Lastrobe Lescalloy
E = 203.e... | {"hexsha": "b436204364d24f46ca0b45b52ea8b8005ec24708", "size": 1689, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts_lectures/MDOF_systems/mdof13_plot_sparse_matrix_Quad4R.py", "max_stars_repo_name": "saullocastro/tudaesasII", "max_stars_repo_head_hexsha": "32c7e0fad9a58d783ce280270eb3556ad8946182", "max... |
#using Revise
#using CUDA, LinearAlgebra, BenchmarkTools, Zygote, SparseArrays, UnPack
#import Base.*
#abstract type AbstractAnnhilator{T} end
#creates a pre-calculated projection object for the dummy matrix in a fixed effect regression
#this approach should balance speed and performance
struct FixedAnnihilator{TF,T} ... | {"hexsha": "839172318173fcc2aad8987a225615a7ad83009a", "size": 7395, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "Capacity/src/Utilities/Annihilator.jl", "max_stars_repo_name": "clintonTE/CCA", "max_stars_repo_head_hexsha": "a555cc1fa4b6d5f1464de44e2e322d32336d1e3a", "max_stars_repo_licenses": ["MIT"], "max_st... |
import gym
import gym.spaces
import numpy as np
import pytest
import pfrl
class ActionRecordingEnv(gym.Env):
observation_space = gym.spaces.Box(low=-1, high=1, shape=(1,))
action_space = gym.spaces.Discrete(3)
def __init__(self):
self.past_actions = []
def reset(self):
return self.... | {"hexsha": "3d7826ef43f7be4b19c3e71dd1079642ea0cfcc5", "size": 1973, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/wrappers_tests/test_randomize_action.py", "max_stars_repo_name": "g-votte/pfrl", "max_stars_repo_head_hexsha": "4c30c1d73f0941a2b649b62937eec346bb55a95e", "max_stars_repo_licenses": ["MIT"],... |
//
// experimental/detail/coro_traits.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2021-2022 Klemens D. Morgenstern
// (klemens dot morgenstern at gmx dot net)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at ... | {"hexsha": "bcd92aad527a52837cbf2a65937c99ac1e2f9bc8", "size": 6798, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "AqooleEngine/src/main/cpp/boost/boost/asio/experimental/coro_traits.hpp", "max_stars_repo_name": "kodai731/Aqoole-Engine-Android-Vulkan-Rendering-Engine-", "max_stars_repo_head_hexsha": "72c8f34b6b6... |
#======================================================================
# The EASE recommender code modified from https://github.com/Darel13712/ease_rec
# Authors: Darel13712
# XUEPAI team
#======================================================================
from scipy.sparse import csr_matrix
import numpy ... | {"hexsha": "42b7e3025dc87d8f23f0f21a94a1d37d4d43e798", "size": 2173, "ext": "py", "lang": "Python", "max_stars_repo_path": "candidate_matching/benchmarks/EASE_r/src/ease_rec.py", "max_stars_repo_name": "jimzhu/OpenCTR-benchmarks", "max_stars_repo_head_hexsha": "e8e723cd7a0ef5ddd40e735b85ce7669955a3a99", "max_stars_repo... |
using JuliaImageMaker
using Test
@testset "JuliaImageMaker.jl" begin
# Write your tests here.
end
| {"hexsha": "163c92250707d60a41c6c7a7fd4e3d84a22266ed", "size": 103, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/runtests.jl", "max_stars_repo_name": "tk3369/JuliaImageMaker.jl", "max_stars_repo_head_hexsha": "eb967ddb157c35909273e1d03c4c3c73a69524fd", "max_stars_repo_licenses": ["MIT"], "max_stars_count"... |
%islscalar - Test if parameter is a (pseudo) logical scalar.
%
% USAGE
%
% test = islscalar(x)
%
% x parameter to test
%
% NOTE
%
% To be considered logical, the scalar should be equal to 0 or 1, but it does
% not need to actually be of class 'logical' (class(x) could be e.g. 'double').
%
% ... | {"author": "buzsakilab", "repo": "buzcode", "sha": "2d700a38b3c2a860ad1333be90f14d7a37a72815", "save_path": "github-repos/MATLAB/buzsakilab-buzcode", "path": "github-repos/MATLAB/buzsakilab-buzcode/buzcode-2d700a38b3c2a860ad1333be90f14d7a37a72815/externalPackages/FMAToolbox/Helpers/islscalar.m"} |
/*
* img_align.cpp
*
* Created on: Aug 22, 2012
* Author: cforster
*/
#include <vector>
#include <string>
#include <stdint.h>
#include <stdio.h>
#include <iostream>
#include <math.h>
#include <Eigen/Core>
#include <Eigen/StdVector>
#include <opencv2/opencv.hpp>
#include <vikit/math_utils.h>
#include <vikit/... | {"hexsha": "8b9269646bbd2a2940df958f626082d72dc7dad9", "size": 13870, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "3rdparty/vikit_common/src/img_align.cpp", "max_stars_repo_name": "gaoxiang12/zed-slam", "max_stars_repo_head_hexsha": "7f8e84fa2d4e9965edcc907e2b1a5f51bd15ec94", "max_stars_repo_licenses": ["MIT"],... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.