text stringlengths 0 1.25M | meta stringlengths 47 1.89k |
|---|---|
Lemma foo4 : forall A B: Prop, A -> B -> A \/ B.
Proof.
try split; intro; intro; try assumption; auto.
Qed.
(*
Lemma foo4 : forall A B: Prop, A -> B -> A /\ B.
Proof.
intros; split; assumption.
Qed.
*)
| {"author": "ml4tp", "repo": "gamepad", "sha": "7092f50a96eae9a862e72ecb8a55a217fa97723c", "save_path": "github-repos/coq/ml4tp-gamepad", "path": "github-repos/coq/ml4tp-gamepad/gamepad-7092f50a96eae9a862e72ecb8a55a217fa97723c/examples/foo4.v"} |
import cvxpy as cvx
import numpy as np
import mosek
from envs.custom_env_dir.data_handler import DataHandler
import gym
import os
''' CALCULATE THEORETICAL OPTIMUM BY MEANS OF CONVEX OPTIMIZATION ASSUMING COMPLETE KNOWLEDGE OF FUTURE DATA '''
class ConvOptim():
def run_optimizer(self, store_dir, benchmark, supe... | {"hexsha": "c6dce3157efada72396f2d3617f4aec79e729057", "size": 10659, "ext": "py", "lang": "Python", "max_stars_repo_path": "envs/custom_env_dir/conv_optim.py", "max_stars_repo_name": "johannesruetten/ChargingEnvironment", "max_stars_repo_head_hexsha": "5624e2cf33681704f366e852d0ee9ed0908c7e61", "max_stars_repo_license... |
function aspect_ratio(g::OSMGraph)
max_y, min_y = extrema(first, g.node_coordinates)
mid_y = (max_y + min_y)/2
return 1/cos(mid_y * pi/180)
end
aspect_ratio(sg::SimplifiedOSMGraph) = aspect_ratio(sg.parent)
RecipesBase.@recipe function f(g::AbstractOSMGraph)
color --> :black
aspect_ratio --> aspe... | {"hexsha": "7efa0ba72ec5b42b57889cf6135a47851962face", "size": 403, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/plotrecipes.jl", "max_stars_repo_name": "rush42/LightOSM.jl", "max_stars_repo_head_hexsha": "77dd2c368ca1fd72e3c56a62dc4d457808961084", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_co... |
# pylint: disable=invalid-name
'''
Pytests for the common utilities included in this package. Includes:
- conversions.py
- specs.py
- utils.py
To run the tests, type the following in the top level repo directory:
python -m pytest --nat-file [path/to/gribfile] --prs-file [path/to/gribfile]
'''
from... | {"hexsha": "5a54a96d2f3cc1d14a3c5a24eab90fe8dfc58c84", "size": 16305, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_common.py", "max_stars_repo_name": "NOAA-GSL/adb_graphics", "max_stars_repo_head_hexsha": "b9a3d567efa0de5a175be8404f351b901a8f382f", "max_stars_repo_licenses": ["MIT"], "max_stars_cou... |
# -*- coding: utf-8 -*-
import numpy as np
from datetime import datetime, timedelta
from pymongo import MongoClient
def today_customers():
purchases = today_purchases()
customers_ids = [0]
for purchase in purchases:
if purchase['customer_id'] not in customers_ids:
customers_ids.a... | {"hexsha": "5e87cc02bc9ad44d86a2218d92c531f3137efd3c", "size": 2218, "ext": "py", "lang": "Python", "max_stars_repo_path": "maps/acme_database.py", "max_stars_repo_name": "alesanmed/as-route", "max_stars_repo_head_hexsha": "fc7fcb65496188f7c7e12626e2169f5315e4e3d1", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars... |
import torch
import torch.optim as optim
import torch.nn as nn
from time import time
from os import path
from copy import copy, deepcopy
import pandas as pd
import numpy as np
import torch.nn.init as init
import os
class CrossValidationSplit:
"""A class to create training and validation sets for a k-fold cross va... | {"hexsha": "a1a3713a42cee0328808075ec30b190087650df2", "size": 13392, "ext": "py", "lang": "Python", "max_stars_repo_path": "main/training_functions.py", "max_stars_repo_name": "14thibea/deep_learning_ADNI", "max_stars_repo_head_hexsha": "baa889bd44039e74f0443dfe86be47189a04f5d8", "max_stars_repo_licenses": ["MIT"], "m... |
from itertools import product
from PIL import Image, ImageFont, ImageDraw
import numpy as np
import torch
import torch.nn.functional as F
from pydantic import BaseModel
from typing import Tuple
from {{cookiecutter.package_name}} import problem, tools
class Prediction(BaseModel):
logits: torch.Tensor
class C... | {"hexsha": "5f92ba379c012b60fc0a63fa6835ffddfc33d108", "size": 2867, "ext": "py", "lang": "Python", "max_stars_repo_path": "template/{{cookiecutter.repository_name}}/{{cookiecutter.package_name}}/architecture/prediction.py", "max_stars_repo_name": "Aiwizo/ml-workflow", "max_stars_repo_head_hexsha": "88e104fce571dd3b769... |
import numpy as np
from shapely import geometry
def shrink(coords: np.ndarray, dist: np.ndarray) -> tuple[np.ndarray]:
"""Shrinks a 2D polygon by a given distance.
The coordinates of the polygon are expected as an N x 2-matrix,
and a positive distance results in inward shrinking.
An empty set is ... | {"hexsha": "790bb2ff511a693f4e1285c5398343c2b12ed192", "size": 2608, "ext": "py", "lang": "Python", "max_stars_repo_path": "geometry_tools.py", "max_stars_repo_name": "helkebir/Reachable-Set-Inner-Approximation", "max_stars_repo_head_hexsha": "4e05780b692214c26c76692f65f61d2f7f506e79", "max_stars_repo_licenses": ["MIT"... |
import pandas as pd
#allow plotting without Xwindows
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
clean_techs = snakemake.config['ci']['clean_techs']
tech_colors = snakemake.config['tech_colors']
def used():
fig, ax = plt.subplots()
fig.set_size_inches((4,3))... | {"hexsha": "95707643d87b4c8228fa9fd3f42bb2bfe82e9374", "size": 3356, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/plot_summary.py", "max_stars_repo_name": "PyPSA/247-cfe", "max_stars_repo_head_hexsha": "1754309f881f41d3f5335ee374c0a758dbbb4879", "max_stars_repo_licenses": ["MIT"], "max_stars_count": n... |
[STATEMENT]
lemma summable_Suc_iff: "summable (\<lambda>n. f (Suc n)) = summable f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. summable (\<lambda>n. f (Suc n)) = summable f
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
1. summable (\<lambda>n. f (Suc n)) \<Longrightarrow> summable f
2. summ... | {"llama_tokens": 985, "file": null, "length": 13} |
#the aim of this file will be to traverse my dataset and output an array containing features for each track with corresponding labels
import glob
import os
import sys
import librosa
import matplotlib.pyplot as plt
import tensorflow as tf
import numpy as np
import pickle
# np.set_printoptions(threshold='nan')
genreDic... | {"hexsha": "52895a2e61f1a078e6753f4c0c792b5f7ddf9492", "size": 3074, "ext": "py", "lang": "Python", "max_stars_repo_path": "code/feature-converter.py", "max_stars_repo_name": "SylCard/Content-based-Music-Recommendation", "max_stars_repo_head_hexsha": "334de19393d39e07c07de704233bd8da193d8355", "max_stars_repo_licenses"... |
import warnings
import scipy.sparse
import scipy.sparse.linalg as spalg
try:
import pyamg
HAS_PYAMG = True
except ImportError:
HAS_PYAMG = False
from .. import cyclic, utilities
from ... import veros_method
@veros_method
def initialize_solver(vs):
matrix = _assemble_poisson_matrix(vs)
preconditi... | {"hexsha": "f3da142e87fd1b21461e4463be24cfc61b767faa", "size": 5562, "ext": "py", "lang": "Python", "max_stars_repo_path": "veros/core/external/solve_poisson.py", "max_stars_repo_name": "madsbk/veros", "max_stars_repo_head_hexsha": "00d2c33e28f0bd098a81bd6ac48436067e7eb8f5", "max_stars_repo_licenses": ["MIT"], "max_sta... |
import sys
import numpy as np
from src import config
import io
import pickle
def sentence_to_vec(words, embedding_dict):
"""
Given a sentence and other information, this function returns embedding for the whole sentence
:param words: sentence, string
:param embedding_dict: dictionary word:vector
... | {"hexsha": "eb5971016dbeb7666608e99e289217815e11e1df", "size": 4189, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/model_similarity.py", "max_stars_repo_name": "olivier-nouchi/glowing-octo-eureka", "max_stars_repo_head_hexsha": "11f6ee08cb16a85bd816a006d73fd1edf5cb1b49", "max_stars_repo_licenses": ["OML"],... |
import tensorflow as tf
from tensorflow_probability import distributions as tfd
import gpflow
from gpflow.utilities import to_default_float
import numpy as np
float_type = gpflow.config.default_float()
def randomize(model, mean=1, sigma=0.01):
model.kernel.lengthscales.assign(
mean + sigma*np.random.normal... | {"hexsha": "a13f34e1d7e0d449ec4a34cd3b8ce4f27fba77bb", "size": 8004, "ext": "py", "lang": "Python", "max_stars_repo_path": "pilco/models/mgpr.py", "max_stars_repo_name": "ss555/pilco", "max_stars_repo_head_hexsha": "212206086973fe157c7fd3e34e95a31edff2d615", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 277, "... |
from competition_and_mutation import Competition, MoranStyleComp, normal_fitness_dist, uniform_fitness_dist
from colourscales import get_colourscale_with_random_mutation_colour
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import numpy as np
def example1():
# Run a single simulation of algorithm 1
... | {"hexsha": "9bafc3d5c2905e6507d39a3bdc29dc79e184f602", "size": 5616, "ext": "py", "lang": "Python", "max_stars_repo_path": "clone-competition-simulation/examples.py", "max_stars_repo_name": "PHJonesGroup/Murai_etal_SI_code", "max_stars_repo_head_hexsha": "ec320032e7d11bca27bf83090dc6d4e581bb3606", "max_stars_repo_licen... |
from skimage import measure
import numpy as np
import torch
from .sdf import create_grid, eval_grid_octree, eval_grid
from skimage import measure
import trimesh
def reconstruction(structured_implicit,
resolution, b_min, b_max,
use_octree=False, num_samples=10000,
... | {"hexsha": "186aa6d5c122f7e11f2ccc72c08b58178cfdf3c4", "size": 3877, "ext": "py", "lang": "Python", "max_stars_repo_path": "external/PIFu/lib/mesh_util.py", "max_stars_repo_name": "jiyeonkim127/im3d", "max_stars_repo_head_hexsha": "9062322462611f931299a38d633fac757592bacc", "max_stars_repo_licenses": ["MIT"], "max_star... |
# -*- coding: utf-8 -*-
import re
from typing import Dict, List, Optional
import numpy as np
from seqeval.metrics import classification_report
from langml import TF_VERSION
from langml.utils import bio_decode
from langml.tensor_typing import Models
re_split = re.compile(r'.*?[\n。]+')
class Infer:
def __init_... | {"hexsha": "7c64d854fe5fdcf8623fd903700c0397a18381d8", "size": 3761, "ext": "py", "lang": "Python", "max_stars_repo_path": "langml/baselines/ner/__init__.py", "max_stars_repo_name": "4AI/langml", "max_stars_repo_head_hexsha": "92a94ae63733bdca393061c2307499adfec663f4", "max_stars_repo_licenses": ["MIT"], "max_stars_cou... |
\subsubsection{\stid{4.06} ECP EZ: Fast, Effective, Parallel Error-bounded Exascale Lossy Compression for Scientific Data}
\paragraph{Overview}
Extreme scale simulations and experiments are generating more data than can be stored, communicated and analyzed. Current lossless compression methods suffer from low compres... | {"hexsha": "91a12fc97da47c69da3b2f4f66e2f3887c9e65c3", "size": 7762, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "projects/2.3.4-DataViz/2.3.4.06-EZ/2.3.4.06-EZ.tex", "max_stars_repo_name": "tgamblin/ECP-ST-CAR-PUBLIC", "max_stars_repo_head_hexsha": "74d6fb18bae7ff1c32b78dd8cd7ae29e91218c33", "max_stars_repo_li... |
"""
Weight lattice realizations
"""
# ****************************************************************************
# Copyright (C) 2007-2012 Nicolas M. Thiery <nthiery at users.sf.net>
#
# (with contributions of many others)
#
# Distributed under the terms of the GNU General Public License (GPL)
#
# Thi... | {"hexsha": "bc9baf632b4a54eeae68a267c9c40d5a89c8536e", "size": 47236, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/sage/combinat/root_system/weight_lattice_realizations.py", "max_stars_repo_name": "abcijkxyz/sage", "max_stars_repo_head_hexsha": "6ec717a56dcb0fd629ca850d9b9391ea8d96ccac", "max_stars_repo_l... |
// Copyright 2020 The Defold Foundation
// Licensed under the Defold License version 1.0 (the "License"); you may not use
// this file except in compliance with the License.
//
// You may obtain a copy of the License, together with FAQs at
// https://www.defold.com/license
//
// Unless required by applicable law or a... | {"hexsha": "4b95fe24b69844aa9c44558c09df88370a65d749", "size": 8368, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "engine/gamesys/src/gamesys/gamesys_private.cpp", "max_stars_repo_name": "hakoptak/defold", "max_stars_repo_head_hexsha": "1e0dfbe5941c0cc119b24b68241ec536dbefc5de", "max_stars_repo_licenses": ["ECL-... |
import tensorflow as tf
import tensorflow.contrib.layers as tcl
import numpy as np
from tensorflow.python.tools import inspect_checkpoint as chkp
from sklearn.metrics import confusion_matrix as cm
from sklearn.metrics import classification_report as cr
from sklearn.metrics import roc_curve as rc
import Utility
class... | {"hexsha": "cedd78834b5ce1081b2d124e44f0b5c421c5db50", "size": 12113, "ext": "py", "lang": "Python", "max_stars_repo_path": "Monolithic.py", "max_stars_repo_name": "beckylum0216/MurdochNet_Yale_tf", "max_stars_repo_head_hexsha": "f1d9dacb15e0194790393395eeacce97d40e25d3", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
[STATEMENT]
lemma (in topological_space) nhds_generated_topology:
"open = generate_topology T \<Longrightarrow> nhds x = (INF S\<in>{S\<in>T. x \<in> S}. principal S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. open = generate_topology T \<Longrightarrow> nhds x = Inf (principal ` {S \<in> T. x \<in> S})
[PROO... | {"llama_tokens": 1077, "file": null, "length": 8} |
*DECK ZUNIK
SUBROUTINE ZUNIK (ZRR, ZRI, FNU, IKFLG, IPMTR, TOL, INIT, PHIR,
+ PHII, ZETA1R, ZETA1I, ZETA2R, ZETA2I, SUMR, SUMI, CWRKR, CWRKI)
C***BEGIN PROLOGUE ZUNIK
C***SUBSIDIARY
C***PURPOSE Subsidiary to ZBESI and ZBESK
C***LIBRARY SLATEC
C***TYPE ALL (CUNIK-A, ZUNIK-A)
C***AUTHOR Amos, D. E.... | {"hexsha": "b7fd5adb1c3e9bea3e89aa7d7984e68807673a81", "size": 9732, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "COMPDIRS/debug.BIN.mac/bessel/zunik.f", "max_stars_repo_name": "danhax/V1-temp", "max_stars_repo_head_hexsha": "efbcba25dbd8550e62f1a83ce8c2328a30659466", "max_stars_repo_licenses": ["Apache-2.0"]... |
[STATEMENT]
lemma Prop1: "\<^bold>\<circ>\<^sup>BA \<^bold>\<approx> \<I>\<^sup>f\<^sup>p A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. [\<^bold>\<turnstile> \<lambda>w. (\<^bold>\<circ>\<^sup>BA) w = \<I>\<^sup>f\<^sup>p A w]
[PROOF STEP]
using fp1
[PROOF STATE]
proof (prove)
using this:
\<I>\<^sup>f\<^sup>p \<... | {"llama_tokens": 338, "file": "Topological_Semantics_ex_LFIs", "length": 3} |
'''
===============================================================================
-- Author: Hamid Doostmohammadi, Azadeh Nazemi
-- Create date: 01/11/2020
-- Description: This code is for HOG feature test (prediction).
-- Status: In progress
=================================================================... | {"hexsha": "e072a43dac5ed5ec3808bb2bdbde707ff1638bbb", "size": 1519, "ext": "py", "lang": "Python", "max_stars_repo_path": "HOG_feature_test_SVM.py", "max_stars_repo_name": "HamidDoost/machine-learning", "max_stars_repo_head_hexsha": "aa4612dff3a6e403f0d0e425c9cc02115723ef80", "max_stars_repo_licenses": ["MIT"], "max_s... |
'''
Created on Jul 13, 2014
@author: flurin, nicholas
'''
import pandas as pd
import numpy as np
class TrainArrival:
'''
Class defining the train arrival object. Contains a mapping
between the train length and the different usage of each access ramps.
'''
platformTrainTypeMap = {'shortTrain': {1:... | {"hexsha": "88b0fb468048d9f4adfb38155693aab895360a4a", "size": 6033, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/Train.py", "max_stars_repo_name": "flurinus/demand-estimation", "max_stars_repo_head_hexsha": "8431df42fda62f55a5ec60c3cca9b7d651ba23ee", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_star... |
import numpy as np
import matplotlib.pyplot as plt
from psana.momentum.IonMomentumFlat import IonMomentumFlat
from psana.momentum.Energy import CalcEnergy
names = ["Ion N","Events","TOF","Mass","Charge","X","Y","Z","Vx","Vy","Vz","KE"]
name2ind = {}
for i, name in enumerate(names):
name2ind[name] = i
amu2au =... | {"hexsha": "71810b6029deb1caac09161b12d08ad5452dad6c", "size": 2874, "ext": "py", "lang": "Python", "max_stars_repo_path": "psana/psana/momentum/examples/ionMomenFlat.py", "max_stars_repo_name": "JBlaschke/lcls2", "max_stars_repo_head_hexsha": "30523ef069e823535475d68fa283c6387bcf817b", "max_stars_repo_licenses": ["BSD... |
"""
A few ABFs were recorded with incorrect scaling factors.
This script can fix them.
"""
import os
import sys
import glob
import time
import numpy as np
import matplotlib.pyplot as plt
PATH_HERE = os.path.abspath(os.path.dirname(__file__))
PATH_DATA = os.path.abspath(PATH_HERE+"../../../data/abfs/")
PATH_SRC = os.p... | {"hexsha": "6ebbfca90a581bf7aca175ac14247d54012de0ef", "size": 1081, "ext": "py", "lang": "Python", "max_stars_repo_path": "dev/python/2018-12-06 correct scaling.py", "max_stars_repo_name": "konung-yaropolk/pyABF", "max_stars_repo_head_hexsha": "b5620e73ac5d060129b844da44f8b2611536ac56", "max_stars_repo_licenses": ["MI... |
"""
MCIndices(sz::NTuple{N,AbstractVector{Int}}) -> R
MCIndices(A::AbstractArray) -> R
A `CartesianIndices` like type defines mutable and disconnected region `R`.
# Examples
```jldoctest
julia> im = MCIndices(([1, 3], [2, 4]))
2×2 MCIndices{2}:
(1, 2) (1, 4)
(3, 2) (3, 4)
julia> im[1]
(1, 2)
julia> im[... | {"hexsha": "da660f698b2eeb180cc1bd49ffe364ca95578af1", "size": 3061, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/utils.jl", "max_stars_repo_name": "wangl-cc/RecordedArray.jl", "max_stars_repo_head_hexsha": "f858f2a141f98c467a2dd9e2c51cb582a607ca40", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 2... |
import utils.qonversion_tools as qonvert
import utils.bit_tools as bit
#import cs_vqe.circuit as cs_circ
#from openfermion.ops import QubitOperator
#from openfermion.linalg import LinearQubitOperator, get_sparse_operator, get_ground_state
import numpy as np
import scipy
import math
def get_ground_state(sparse_operato... | {"hexsha": "5b3b394c1c144f4468e26a1479e3497216597da8", "size": 5740, "ext": "py", "lang": "Python", "max_stars_repo_path": "utils/linalg_tools.py", "max_stars_repo_name": "wmkirby1/CS-VQE", "max_stars_repo_head_hexsha": "9a0a7634dcb77f064957c772cf229b7103cce3a8", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_co... |
# Copyright 2019 The FastEstimator Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | {"hexsha": "007f7729859290cc43a7edf372dd0b50dd4ca094", "size": 3182, "ext": "py", "lang": "Python", "max_stars_repo_path": "fastestimator/backend/_roll.py", "max_stars_repo_name": "DwijayDS/fastestimator", "max_stars_repo_head_hexsha": "9b288cb2bd870f971ec4cee09d0b3205e1316a94", "max_stars_repo_licenses": ["Apache-2.0"... |
import paddlehub as hub
import cv2
import numpy as np
# import pygame as pg
import time
import random
import os
import math
import copy
import glob
from ffpyplayer.player import MediaPlayer
from PIL import Image, ImageDraw, ImageFont
import argparse
import _thread
import sound
os.environ['CUDA_VISIBLE_DEVICES'] = '0'
... | {"hexsha": "739c3b8df7b4839aa22a2e7850b7e038c0808de2", "size": 22331, "ext": "py", "lang": "Python", "max_stars_repo_path": "erxianqiao_map_skill_sound.py", "max_stars_repo_name": "ninetailskim/DodgeFace-EXQver", "max_stars_repo_head_hexsha": "a1199a6262ddd1b72137d23b90f63fe7ec288bfa", "max_stars_repo_licenses": ["Apac... |
import matplotlib.pyplot as plot
from scipy.io import wavfile
import scipy.signal as signal
import numpy as np
from typing import List
import warnings
import pandas as pd
import random
filenames = ['recordings/' + f + '.wav' for f in '2eur 1eur 50cent-eur 20cent-eur 10cent-eur 5cent-eur 2cent-eur 5rand 2rand 1rand 50c... | {"hexsha": "5fe41f4dcbb258c7cbb35205112cd172c558fe83", "size": 6100, "ext": "py", "lang": "Python", "max_stars_repo_path": "main.py", "max_stars_repo_name": "kontheocharis/coin-spectra", "max_stars_repo_head_hexsha": "cfedbd6142cffa663d2e73f8f997aa2da42c1625", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null... |
import os, sys
import argparse
import time
import scipy
import numpy as np
import torch
from torch import nn, optim
from torch.utils.data import DataLoader
from torchvision import transforms, utils
from scipy.misc import imread
from tensorboardX import SummaryWriter
from tqdm import tqdm
from PIL import Image
from demo... | {"hexsha": "7b2a90b8fa141428a058f6ed613325d73c8df879", "size": 1476, "ext": "py", "lang": "Python", "max_stars_repo_path": "metric.py", "max_stars_repo_name": "Maikouuu/PBHC", "max_stars_repo_head_hexsha": "adfa6201bf7351921f830dc1694784acaa4e9a84", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 3, "max_stars_r... |
import re
import numpy as np
import matplotlib.pyplot as plt
class GSS(object):
def __init__(self):
# 输入gate_list格式类似为 ['X0','X1','Y2p1',['X2n0','Y2'],'S0_1','CP1_2','S0_1:2','CP1_2:3','G0_1']
# 其中内部的 [ ] 内门操作表示为同时进行的操作
# 单比特门最后一个数字表示qubit序号
# 两比特门 ':' 前的两个数字表示对应两个control和target qu... | {"hexsha": "6a423d06eafa6101d57034c4e16381cf542edf9e", "size": 13766, "ext": "py", "lang": "Python", "max_stars_repo_path": "qulab/tools/gate_sequence_simulator/_GSS.py", "max_stars_repo_name": "liuqichun3809/quantum-lab", "max_stars_repo_head_hexsha": "05bea707b314ea1687866f56ee439079336cfbbc", "max_stars_repo_license... |
import copy, operator
from queue import PriorityQueue
import numpy as np
import torch
import torch.nn.functional as F
from torch import nn
from torch.autograd import Variable
from torch.distributions import Categorical
import utils
from config import global_config as cfg
import trade
np.set_printoptions(precision=2,s... | {"hexsha": "a2f8879f415337c7ee72543fa6b6d35192f42536", "size": 76038, "ext": "py", "lang": "Python", "max_stars_repo_path": "damd_net.py", "max_stars_repo_name": "gusalsdmlwlq/DAMD", "max_stars_repo_head_hexsha": "e98feaf5d9f251132e655bbc5fdb2c080cbed90e", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count": n... |
import threading
from rclpy.node import Node
from rclpy.logging import get_logger
from src.can_utils.common import make_can_frame
from src.devices.base import VehicleState
from src.devices.communications import Communications
from src.devices.pid import PIDF
import numpy as np
from time import sleep
class Steering:... | {"hexsha": "228d2a49b3134ffe8b7658b34930aa0d1d47d410", "size": 4141, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/actuators/steering.py", "max_stars_repo_name": "Dorniak/NEVA_Control", "max_stars_repo_head_hexsha": "d946ff27f4c1196ac2808d8fe4a1227406a8b3c2", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
# Taken from https://www.rdocumentation.org/packages/base/versions/3.6.2/topics/data.frame
# NOT RUN {
L3 <- LETTERS[1:3]
fac <- sample(L3, 10, replace = TRUE)
(d <- data.frame(x = 1, y = 1:10, fac = fac))
## The "same" with automatic column names:
data.frame(n=1, 1:10, sample(L3, 10, replace = TRUE))
is.data.frame(d)... | {"hexsha": "e19cc1781a882a9746caf45adaa6d09001882665", "size": 698, "ext": "r", "lang": "R", "max_stars_repo_path": "third_party/universal-ctags/ctags/Units/parser-r.r/r-dataframe.d/input.r", "max_stars_repo_name": "f110/wing", "max_stars_repo_head_hexsha": "31b259f723b57a6481252a4b8b717fcee6b01ff4", "max_stars_repo_li... |
# coding=utf-8
from utils.data_convert import str_to_arr
from torch.utils.data import Dataset
from datasets import transformers
from PIL import Image
import numpy as np
import glob
import cv2
import os
__all__ = ['SegDataset']
class SegDataset(Dataset):
"""
Basic dataset for segmentation.
Params:
... | {"hexsha": "2c9ef75d6850e8a6892e5e0952cdf508705fb8a4", "size": 11488, "ext": "py", "lang": "Python", "max_stars_repo_path": "datasets/seg_data.py", "max_stars_repo_name": "Memoristor/LightWeight-HRRSI", "max_stars_repo_head_hexsha": "8656d33cc092bb3b3eff1d58183a15e013a7d4fd", "max_stars_repo_licenses": ["MIT"], "max_st... |
# -*- coding: utf-8 -*-
"""
Initial version of Python API for NeuroML2
Author: Padraig Gleeson
"""
from neuroml import *
if __name__ == "__main__":
reader = NeuroMLReader()
filename = "../../../testFiles/CA1.nml"
print "Reading in NeuroML 2 file: "+ filename
nml2Doc = reader.read_neuroml(filenam... | {"hexsha": "39a2c3600eaf584cbbbab3d632e038c1281385d9", "size": 1703, "ext": "py", "lang": "Python", "max_stars_repo_path": "ideas/padraig/hdf5tests/readCA1.py", "max_stars_repo_name": "mattions/libNeuroML", "max_stars_repo_head_hexsha": "c623292c7832c84421d55799efdbd7711cca54ae", "max_stars_repo_licenses": ["BSD-3-Clau... |
import pandas as pd
import numpy as np
from matplotlib import gridspec
from sklearn.model_selection import cross_val_predict
from sklearn.ensemble import RandomForestClassifier
import matplotlib.pyplot as plt
import sklearn.metrics as met
#Insert data set
data=pd.read_csv('tae.csv',sep=',',header=None)
train=data.ix[... | {"hexsha": "4af4fa3cf9c2156ad36e2600da7e878076368a71", "size": 2180, "ext": "py", "lang": "Python", "max_stars_repo_path": "Practice2/RandomForest.py", "max_stars_repo_name": "m-mostafavi/Arshad", "max_stars_repo_head_hexsha": "ca9bff4f66562be8cd50b3703f51061f48ee1612", "max_stars_repo_licenses": ["Unlicense"], "max_st... |
import torch
import torch.nn as nn
import torch.optim as optim
from torch.optim import lr_scheduler
import numpy as np
import torchvision
from torchvision import datasets, models, transforms
#import matplotlib.pyplot as plt
import time
import os
import copy
import torch.nn.functional as F
from PIL import Image, ExifTag... | {"hexsha": "ec9737d0fe472ffd9268c88520d4067385d1e896", "size": 6563, "ext": "py", "lang": "Python", "max_stars_repo_path": "Image Classification/CGIAR Computer Vision for Crop Disease/crop disease/utils.py", "max_stars_repo_name": "ZindiAfrica/Computer-Vision", "max_stars_repo_head_hexsha": "bf4c00a0633506270dc6d07df93... |
[STATEMENT]
lemma to_bl_to_bin [simp] : "bl_to_bin (to_bl w) = uint w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. bl_to_bin (to_bl w) = uint w
[PROOF STEP]
by (simp add: uint_bl word_size) | {"llama_tokens": 92, "file": "Word_Lib_Reversed_Bit_Lists", "length": 1} |
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
def plot3d(Re, Ri, Rd, t, rLe, rLp, We, Wp, angle):
"""Plot the trajectories of the electron, the ion and the drift trajectory"""
fig = plt.figure(figsize=(13,10))
ax = fig.add_subplot(2, 2, 1, projection='3d... | {"hexsha": "26d160e7ffb14ccc391cdfaac2fd30076f2cac3c", "size": 1904, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/plotEB.py", "max_stars_repo_name": "npinhao/APPLAuSE-lectures", "max_stars_repo_head_hexsha": "00f05a43732804d32d2f4891040961f99a390836", "max_stars_repo_licenses": ["CC0-1.0"], "max_stars... |
#
# Copyright 2016 The BigDL 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 by applicable law or agreed to in ... | {"hexsha": "a6fa1121f1c95522bff39094e206ac7470c624ef", "size": 3352, "ext": "py", "lang": "Python", "max_stars_repo_path": "python/chronos/test/bigdl/chronos/model/tf2/test_Seq2Seq_keras.py", "max_stars_repo_name": "Forest216/BigDL", "max_stars_repo_head_hexsha": "840da9a2eaf395978dd83730b02aa5e5dfbd7989", "max_stars_r... |
"""
struct Grid1D{Tx<:AbstractTopology} <: AbstractGrid
Returns a one-dimensional staggered `grid` with topology `Tx`.
$(TYPEDFIELDS)
"""
struct Grid1D{Tx<:AbstractTopology} <: AbstractGrid
"Number of points in x-direction"
nx::Int
"Number of halo points in x-direction"
hx::Int
"Grid spacing i... | {"hexsha": "70cfb3681f4e479dc62ac4f4414e8c9b7f63b804", "size": 5640, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/grids.jl", "max_stars_repo_name": "ClimateFluidPhysics-ANU/MixedLayerThermoclineDynamics.jl", "max_stars_repo_head_hexsha": "e964658a1b22ee44fb9f88e8ca069f5b4ca218a2", "max_stars_repo_licenses"... |
import sys
import numpy as np
from models.evaluation import compute_proportions_from_predicted_labels
class ACC:
"""
Secondary correction model to correct for label shift (ACC)
"""
def __init__(self):
self._p_pred_given_true = None
self._model = None
def fit(self, model, X, lab... | {"hexsha": "5de71a65b573da346b2e0c13329f2ddcd3819224", "size": 3044, "ext": "py", "lang": "Python", "max_stars_repo_path": "models/secondary_model_acc.py", "max_stars_repo_name": "dallascard/proportions", "max_stars_repo_head_hexsha": "f01502428333e45310654a36d26503612fe45234", "max_stars_repo_licenses": ["Apache-2.0"]... |
"""
===========================
Creating a Heliographic Map
===========================
In this example we use the `reproject` generate an image in heliographic coordinates from an AIA image.
You will need `reproject <https://reproject.readthedocs.io/en/stable/>`__ v0.6 or higher installed.
"""
# sphinx_gallery_thumb... | {"hexsha": "0c9880bde5e9a1d571220337b03ddceb4ff55328", "size": 2198, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/map_transformations/reprojection_heliographic_stonyhurst.py", "max_stars_repo_name": "jgieseler/sunpy", "max_stars_repo_head_hexsha": "9eb01ce9eea43512cc928b17c6d79ac06dce0ece", "max_star... |
function test_plu ( )
%*****************************************************************************80
%
%% TEST_PLU tests the PLU factors.
%
% Licensing:
%
% This code is distributed under the GNU LGPL license.
%
% Modified:
%
% 07 April 2015
%
% Author:
%
% John Burkardt
%
fprintf ( 1, '\n' );
fprint... | {"author": "johannesgerer", "repo": "jburkardt-m", "sha": "1726deb4a34dd08a49c26359d44ef47253f006c1", "save_path": "github-repos/MATLAB/johannesgerer-jburkardt-m", "path": "github-repos/MATLAB/johannesgerer-jburkardt-m/jburkardt-m-1726deb4a34dd08a49c26359d44ef47253f006c1/test_mat/test_plu.m"} |
"""
Code by Tony Duan was forked from https://github.com/tonyduan/normalizing-flows
MIT License
Copyright (c) 2019 Tony Duan, 2019 Peter Zagubisalo
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 Softwar... | {"hexsha": "64d6b1957907cdd59163cb86511344b4d245870b", "size": 15895, "ext": "py", "lang": "Python", "max_stars_repo_path": "normalizing_flows_typed/flows.py", "max_stars_repo_name": "kiwi0fruit/jats-semi-supervised-pytorch", "max_stars_repo_head_hexsha": "67e9bb85f09f8ef02e17e495784d1d9a71c3adec", "max_stars_repo_lice... |
#############################################
# Copyright (c) 2017 Inversebit
#
# This code is free under the MIT License.
# Full license text: https://opensource.org/licenses/MIT
#
# IMEK v3. This code will analyze an image and search for
# boxes. Then it'll extract them to separate images.
#
# You can try it with the... | {"hexsha": "3c21540b1237a25533a92dbc23c59282e4508017", "size": 5183, "ext": "py", "lang": "Python", "max_stars_repo_path": "prototype/itr3/imek3.py", "max_stars_repo_name": "Inversebit/imek", "max_stars_repo_head_hexsha": "435df4cf7717df0d0a56cd56e9cf81feeed4cb6a", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
import os
import sys
BASE_DIR = os.path.join(os.path.dirname(__file__), '..')
sys.path.append(BASE_DIR)
import math
import numpy as np
import torch
import torch.autograd as autograd
import torch.nn as nn
import torch.nn.functional as F
from causallearn.utils.KCI.KCI import KCI_UInd
import torch.autograd as autograd
... | {"hexsha": "8973854bbc2bb61e51c26b46c9cb1d966a920289", "size": 7072, "ext": "py", "lang": "Python", "max_stars_repo_path": "causallearn/search/FCMBased/PNL/PNL.py", "max_stars_repo_name": "softsys4ai/causal-config-labyrinth", "max_stars_repo_head_hexsha": "4f50f9ff15429b0ac6ad0a99fbe4cfdd17e360fc", "max_stars_repo_lice... |
#!/usr/bin/env python
from __future__ import print_function
import os
import sys
import time
import copy
import yaml
import json
import threading
import numpy as np
import rospy
import angle_utils
import lowpass_filter
import std_msgs.msg
from ledpanels import display_ctrl
from basic_led_strip_proxy import BasicLedStr... | {"hexsha": "2bcf884b64580445b7667c296573abd445ab7a92", "size": 6779, "ext": "py", "lang": "Python", "max_stars_repo_path": "nodes/magno_arena_node.py", "max_stars_repo_name": "willdickson/virtual_desert", "max_stars_repo_head_hexsha": "989e5b9e3f19e1c502795ae5033873365d325d1b", "max_stars_repo_licenses": ["MIT"], "max_... |
# -*- coding: utf-8 -*-
"""
Created on Sun May 24
@author: Mehmeta
"""
import pandas as pd
import numpy as np
import GetOldTweets3 as got
# Dokümantasyona buradan ulaşabilirsiniz: https://github.com/Mottl/GetOldTweets3
import time
tweetCriteria = got.manager.TweetCriteria().setQuerySearch('aramak_is... | {"hexsha": "a7c26915736ad881644b753b00e16b680e8dc3d8", "size": 2986, "ext": "py", "lang": "Python", "max_stars_repo_path": "1_tweet_collect.py", "max_stars_repo_name": "patronlargibi/TwitterTroll", "max_stars_repo_head_hexsha": "cd23ca4636e067f8d7d139c549b5494875a4ecdd", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
[STATEMENT]
lemma dirichlet_prod_neutral_right_neutral:
"dirichlet_prod f dirichlet_prod_neutral n = f n " if "n > 0" for f :: "nat \<Rightarrow> complex" and n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. dirichlet_prod f dirichlet_prod_neutral n = f n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 sub... | {"llama_tokens": 2649, "file": "Gauss_Sums_Gauss_Sums_Auxiliary", "length": 30} |
module NewPkgEval
using BinaryBuilder
using BinaryProvider
using LightGraphs
import Pkg.TOML
using Pkg
import Base: UUID
using Dates
using DataStructures
import LibGit2
downloads_dir(name) = joinpath(@__DIR__, "..", "deps", "downloads", name)
julia_path(ver) = joinpath(@__D... | {"hexsha": "bfb32b86ce7058be46ab14e9a3f8f3a4bc78b8a0", "size": 16354, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/NewPkgEval.jl", "max_stars_repo_name": "invenia/NewPkgEval.jl", "max_stars_repo_head_hexsha": "4f806fc9742b690de1fc50e27d737fd07fb16679", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
import matplotlib.pyplot as plt
import matplotlib as mpl
from matplotlib import cm
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import animation
import numpy as np
from hilbertcurve.hilbertcurve import HilbertCurve
N = 3
p = 3
hc = HilbertCurve(p, N)
npts = 2**(N*p)
pts = []
for i in range(npts):
pts.ap... | {"hexsha": "d9f6d81de2f62c6cd065571c57367b333dd95e32", "size": 1448, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/make_anim_3d.py", "max_stars_repo_name": "C-Jameson/hilbertcurve", "max_stars_repo_head_hexsha": "328a8eb4580ba425c08faa4b5ae8572f88347743", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
import numpy as np
import tensorflow as tf
from tensorflow.python import keras
import matplotlib.pyplot as plt
import pandas as pd
from keras.callbacks import EarlyStopping
from PIL import Image
from skimage import color, io
import cv2
from PIL import Image
"""train_X = train_df.iloc[:,1:]
train_Y = train_... | {"hexsha": "87e75e03e1def95f29c91209dbe551781b7d7c05", "size": 2551, "ext": "py", "lang": "Python", "max_stars_repo_path": "utils.py", "max_stars_repo_name": "darhal/ASLRecognizer", "max_stars_repo_head_hexsha": "d6d5aa38c329042a97d057de6f639810945d956c", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "ma... |
# -*- coding: utf-8 -*-
"""
Compute ROI labeled mask from spm contrast image or images
"""
import sys, os
#sys.path.append('../irm_analysis')
#from define_variables import *
from graphpype.labeled_mask import compute_recombined_HO_template
from graphpype.utils_dtype_coord import *
import glob
from xml.dom... | {"hexsha": "3cd80827014afb9da410e57079445e485050c846", "size": 39360, "ext": "py", "lang": "Python", "max_stars_repo_path": "graphpype/peak_labelled_mask.py", "max_stars_repo_name": "EtienneCmb/graphpype", "max_stars_repo_head_hexsha": "f19fdcd8e98660625a53c733ff8e44d60c31bd68", "max_stars_repo_licenses": ["BSD-3-Claus... |
! MIT License
!
! Copyright (c) 2020 SHEMAT-Suite
!
! 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, merge,... | {"hexsha": "8d38ea46a37c346271acfeedd8eac2446824205c", "size": 9077, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "forward/dealloc_arrays.f90", "max_stars_repo_name": "arielthomas1/SHEMAT-Suite-Open", "max_stars_repo_head_hexsha": "f46bd3f8a9a24faea9fc7e48ea9ea88438e20d78", "max_stars_repo_licenses": ["MIT"]... |
[STATEMENT]
lemma pa_not_zero: "p ^ a \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. p ^ a \<noteq> 0
[PROOF STEP]
by (simp add: prime_gt_0_nat prime_p) | {"llama_tokens": 81, "file": "Secondary_Sylow_SndSylow", "length": 1} |
import abc
from typing import NamedTuple, List, Tuple
import numpy as np
from mlagents.tf_utils import tf
from mlagents.trainers.models import ModelUtils
EPSILON = 1e-6 # Small value to avoid divide by zero
class OutputDistribution(abc.ABC):
@abc.abstractproperty
def log_probs(self) -> tf.Tensor:
"... | {"hexsha": "294bad11cb0512a5d6d606e54a90e557846429a9", "size": 10718, "ext": "py", "lang": "Python", "max_stars_repo_path": "ml-agents/mlagents/trainers/distributions.py", "max_stars_repo_name": "bobcy2015/ml-agents", "max_stars_repo_head_hexsha": "5d02292ad889f1884fa98bd92f127f17cbfe0112", "max_stars_repo_licenses": [... |
/**
* Copyright (c) 2011-2017 libbitcoin developers (see AUTHORS)
*
* This file is part of libbitcoin.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the Lic... | {"hexsha": "131778fdcdd857f76d3057c9bce6933d39debbb4", "size": 28231, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "3rdparty/libbitcoin/src/chain/chain_state.cpp", "max_stars_repo_name": "anatolse/beam", "max_stars_repo_head_hexsha": "43c4ce0011598641d9cdeffbfdee66fde0a49730", "max_stars_repo_licenses": ["Apache... |
import pandas as pd
import numpy as np
from sklearn.base import ClusterMixin
from sklearn.preprocessing import KBinsDiscretizer
class KBinsCluster(ClusterMixin):
"""
This cluster transformer takes as input a similarity matrix X of size (n_samples, n_features).
It then sums the score along the n_features ax... | {"hexsha": "122ba4408cae7e658c13199d92f037380062f353", "size": 1826, "ext": "py", "lang": "Python", "max_stars_repo_path": "suricate/explore/kbinscluster.py", "max_stars_repo_name": "ogierpaul/suricate", "max_stars_repo_head_hexsha": "fd43627e5d2a92fe4bf7b562f65ab89ec07ee49c", "max_stars_repo_licenses": ["MIT"], "max_s... |
from unittest import TestCase
import os.path as osp
import numpy as np
from datumaro.components.extractor import DatasetItem
from datumaro.components.project import Dataset
from datumaro.plugins.image_zip_format import ImageZipConverter, ImageZipPath
from datumaro.util.image import Image, save_image
from datumaro.uti... | {"hexsha": "2970dfc65d68be5691c3b0f5ee54c5461eda4bb6", "size": 4216, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_image_zip_format.py", "max_stars_repo_name": "IRDonch/datumaro", "max_stars_repo_head_hexsha": "d029e67549b7359c887bd15039997bd8bbae7c0c", "max_stars_repo_licenses": ["MIT"], "max_stars... |
/-
Copyright (c) 2021 Aaron Anderson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Aaron Anderson
-/
import data.set.finite
import order.well_founded
import order.order_iso_nat
import algebra.pointwise
/-!
# Well-founded sets
A well-founded subset of an ordered typ... | {"author": "jjaassoonn", "repo": "projective_space", "sha": "11fe19fe9d7991a272e7a40be4b6ad9b0c10c7ce", "save_path": "github-repos/lean/jjaassoonn-projective_space", "path": "github-repos/lean/jjaassoonn-projective_space/projective_space-11fe19fe9d7991a272e7a40be4b6ad9b0c10c7ce/src/order/well_founded_set.lean"} |
"""
Negative of a distribution.
Example usage
-------------
Invert sign of a distribution::
>>> distribution = -chaospy.Uniform(0, 1)
>>> print(distribution)
(-Uniform(0,1))
>>> print(numpy.around(distribution.sample(5), 4))
[-0.3464 -0.885 -0.0497 -0.5178 -0.1275]
>>> print(distribution.fwd... | {"hexsha": "a020815d9975c7ba81de67a6c7ede19533e8ccd9", "size": 2281, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/chaospy/distributions/operators/negative.py", "max_stars_repo_name": "yoon-gu/chaospy", "max_stars_repo_head_hexsha": "fe541840a79882008f38764cd7ba4935a4fd4fa3", "max_stars_repo_licenses": ["B... |
/*
Copyright 2015 Ruben Moreno Montoliu <ruben3d at gmail dot com>
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": "ee43f7031e1fbe49261ae7e79758dfbded451cb7", "size": 3305, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "src/core/RenderTask.cpp", "max_stars_repo_name": "ruben3d/luna-raytracer", "max_stars_repo_head_hexsha": "14def80f3a11502d78fd0bed757ba19edd0d9057", "max_stars_repo_licenses": ["Apache-2.0"], "max_s... |
'''
Function:
define the transforms for data augmentations
Author:
Zhenchao Jin
'''
import cv2
import torch
import random
import numpy as np
'''resize image'''
class Resize(object):
def __init__(self, output_size=None, output_size_list=None, keep_ratio=True, bbox_clip_border=True, interpolation='bilinear'... | {"hexsha": "5658eb47a0877e333791303b52367b971f49f917", "size": 10781, "ext": "py", "lang": "Python", "max_stars_repo_path": "wsdet/modules/datasets/transforms.py", "max_stars_repo_name": "DetectionBLWX/WSDDN.pytorch", "max_stars_repo_head_hexsha": "05020d9d0445af90ba0af3f095aa12b18e3da7d2", "max_stars_repo_licenses": [... |
/*
* Copyright (C) 2015 University of Oregon
*
* You may distribute under the terms of either the GNU General Public
* License or the Apache License, as specified in the LICENSE file.
*
* For more information, see the LICENSE file.
*/
/*---------------------------------------------------------------------------... | {"hexsha": "2e7a34217d25fd2b357802e079eae98763b39d93", "size": 2421, "ext": "h", "lang": "C", "max_stars_repo_path": "src/bin_image/utils.h", "max_stars_repo_name": "DanIverson/OpenVnmrJ", "max_stars_repo_head_hexsha": "0db324603dbd8f618a6a9526b9477a999c5a4cc3", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_cou... |
/* vim:set ts=3 sw=3 sts=3 et: */
/**
* Copyright © 2008-2013 Last.fm Limited
*
* This file is part of libmoost.
*
* 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,
... | {"hexsha": "1f330d98ef58d089a263a2094a864b0437c2499b", "size": 8187, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "include/moost/terminal_format.hpp", "max_stars_repo_name": "lastfm/libmoost", "max_stars_repo_head_hexsha": "895db7cc5468626f520971648741488c373c5cff", "max_stars_repo_licenses": ["MIT"], "max_stars... |
import numpy
import math
from rpncalc.classes import ActionEnum
class BinaryOperator(ActionEnum):
addition = '+'
subtraction = '-'
multiplication = '*'
division = '/'
integer_division = '//'
power = '^'
atan2 = 'atan2', \
"Returns quadrant correct polar coordinate theta = atan2(y,... | {"hexsha": "f716dd589103e434f5c06b8eb30e4fe38d5df1b6", "size": 1790, "ext": "py", "lang": "Python", "max_stars_repo_path": "rpncalc/binaryoperator.py", "max_stars_repo_name": "newmanrs/rpncalc", "max_stars_repo_head_hexsha": "8663e5221efd78c12889b6db4eda20821b27d52a", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
"""Tests for utils.py"""
import os
from os import path as op, makedirs
import shutil
import tempfile
import unittest
import numpy as np
from PIL import Image
from label_maker.utils import url, class_match, get_tile_tif, get_tile_wms, is_tif
class TestUtils(unittest.TestCase):
"""Tests for utility functions"""
... | {"hexsha": "0eee186cc1ac97e6a7d5703bc21405f520893ae1", "size": 5366, "ext": "py", "lang": "Python", "max_stars_repo_path": "test/unit/test_utils.py", "max_stars_repo_name": "lebusini/label-maker", "max_stars_repo_head_hexsha": "23d9cf2006fb43a87f8aa080ed8cb155061a7445", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
"""
Set up the plot figures, axes, and items to be done for each frame.
This module is imported by the plotting routines and then the
function setplot is called to set the plot parameters.
"""
import numpy as np
import os, shutil
from mapping import Mapping
from clawpack.clawutil.data import ClawData
import clawpac... | {"hexsha": "7cbdaa8228b3bcadfedd4074e09a93517c7f22ba", "size": 5439, "ext": "py", "lang": "Python", "max_stars_repo_path": "3d/sloping_fault/setplot.py", "max_stars_repo_name": "rjleveque/seismic", "max_stars_repo_head_hexsha": "962cbf6d541fe547cc2093ea1368a9752d5f9659", "max_stars_repo_licenses": ["BSD-2-Clause"], "ma... |
optim_path='/home/z***/script/v8/utmost/'
#args = commandArgs(trailingOnly=TRUE)
### optimization part ###
grad_prep <- function(X, Y){
## pre-calculate some metrics for gradient
## args
## X: a list of covariate matrices corresponding to each response
## Y: a list of response vectors
## value
... | {"hexsha": "d1a19b445ffa9624a9e5aac7aee7901f39d1e3a0", "size": 9886, "ext": "r", "lang": "R", "max_stars_repo_path": "model_training/UTMOST/glasso.r", "max_stars_repo_name": "mjbetti/MR-JTI", "max_stars_repo_head_hexsha": "0bb96993ce15f2cb4b3e234d4de39a05b0f92d84", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
"""Tests of the base module."""
import numpy as np
import nibabel as nb
import pytest
import h5py
from ..base import SpatialReference, SampledSpatialData, ImageGrid, TransformBase
from .. import linear as nitl
def test_SpatialReference(testdata_path):
"""Ensure the reference factory is working properly."""
o... | {"hexsha": "4940ac4f01ff2b81c0fdb5b9999043fa70e7ac3d", "size": 5257, "ext": "py", "lang": "Python", "max_stars_repo_path": "nitransforms/tests/test_base.py", "max_stars_repo_name": "mgxd/transforms", "max_stars_repo_head_hexsha": "1a34ccc7588f83a03f6b9013307492d95584ce55", "max_stars_repo_licenses": ["MIT"], "max_stars... |
import unittest
import numpy as np
import pandas as pd
from pyfair.model.model_calc import FairCalculations
class TestFairModelCalc(unittest.TestCase):
# Raw data
_CHILD_1_DATA = pd.Series([1,2,3,4,5])
_CHILD_2_DATA = pd.Series([5,4,3,2,1])
_MULT_OUTPUT = pd.Series([5,8,9,8,5])
_ADD_O... | {"hexsha": "6d6794e28eb49a454c5fdd93101f14f47e15970b", "size": 1861, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/model/test_model_calc.py", "max_stars_repo_name": "andysvints/pyfair", "max_stars_repo_head_hexsha": "737388a4ef341e9b6698871138926199285d359c", "max_stars_repo_licenses": ["MIT"], "max_star... |
"""
=================
Constraint KMeans
=================
Simple example to show how to cluster keeping
approximatively the same number of points in every
cluster.
.. contents::
:local:
Data
====
"""
from collections import Counter
import numpy
import matplotlib.pyplot as plt
from sklearn.datasets import make_bl... | {"hexsha": "0b93e33a30617663db391c3680a8f78d9fc2fb1b", "size": 4081, "ext": "py", "lang": "Python", "max_stars_repo_path": "_doc/examples/plot_constraint_kmeans.py", "max_stars_repo_name": "sdpython/mlinsights", "max_stars_repo_head_hexsha": "bae59cda775a69bcce83b16b88df2f34a092cb60", "max_stars_repo_licenses": ["MIT"]... |
"""Module for learning and predicting pairwise relation types through K-means
clustering."""
import numpy as np
from sklearn.cluster import KMeans
def from_dataset(joints, k, scales, template_size):
"""Takes the joints from a set and learns a set of k different pairwise
relation types for each joint.
:... | {"hexsha": "9e68a043e12c646e91f1f9c9a51d1c9ff8f92f10", "size": 4848, "ext": "py", "lang": "Python", "max_stars_repo_path": "project/pairwise_relations.py", "max_stars_repo_name": "qxcv/comp2560", "max_stars_repo_head_hexsha": "930adfffe95313ad0e43ca782b1ad8140948ff33", "max_stars_repo_licenses": ["Apache-2.0"], "max_st... |
fib : HasIO io => Integer -> io Integer
fib 0 = pure 0
fib 1 = pure 1
fib n = pure $ !(fib (n - 1)) + !(fib (n - 2))
main : IO ()
main = do
value <- getLine
printLn !(fib (cast value))
| {"hexsha": "085e353c8ba8a50a83cfe4723da5dc8933fc4966", "size": 193, "ext": "idr", "lang": "Idris", "max_stars_repo_path": "idris2/benchmark/benchmarks/erl_fib5_HasIO/erl_fib5_HasIO.idr", "max_stars_repo_name": "chrrasmussen/Idris2-Erlang", "max_stars_repo_head_hexsha": "dfa38cd866fd683d4bdda49fc0bf2f860de273b4", "max_s... |
"""Fit a classifier based on input train data.
Save the models and coefficients in a table as png.
Usage: train.py [--data_file=<data_file>] [--out_dir=<out_dir>]
Options:
[--data_file=<data_file>] Data set file train are saved as csv.
[--out_dir=<out_dir>] Output path to save model, tables and image... | {"hexsha": "c0e0ca03d9c52e408525b63554eed9d1ad528e0e", "size": 6390, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/model_train.py", "max_stars_repo_name": "UBC-MDS/DSCI_522_Heart_Failure_Exploratory_Analysis", "max_stars_repo_head_hexsha": "ffee5c477fd0d4fffe8fa699b7134d31bed43298", "max_stars_repo_license... |
import pytest
import numpy as np
# from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_allclose
from mutar import IndLasso, IndRewLasso
from itertools import product
@pytest.mark.parametrize("fit_intercept, normalize, positive",
product([False, Tru... | {"hexsha": "66b9792a55072c28b94516036859959d9cb510c6", "size": 2437, "ext": "py", "lang": "Python", "max_stars_repo_path": "mutar/tests/test_indlasso.py", "max_stars_repo_name": "vishalbelsare/mutar", "max_stars_repo_head_hexsha": "b682ba951fdcb5cb18fb6eeca0de976de96d3193", "max_stars_repo_licenses": ["BSD-3-Clause"], ... |
# solve the Riemann problem for a gamma-law gas
from __future__ import print_function
import enum
import numpy as np
import scipy.optimize as optimize
@enum.unique
class _Side(enum.Enum):
Right = enum.auto()
Left = enum.auto()
class _State:
side = None
density = None
pressure = None
veloci... | {"hexsha": "04964bab6581fd36fb3bcdf50b9c39b93bb65b80", "size": 7982, "ext": "py", "lang": "Python", "max_stars_repo_path": "pydro/NewtonianRiemannSolver.py", "max_stars_repo_name": "nilsdeppe/pydro", "max_stars_repo_head_hexsha": "aae4a985d45228301fabd8b725da682a545d9d32", "max_stars_repo_licenses": ["BSL-1.0"], "max_s... |
import numpy as np
from sklearn.metrics import auc
def quantile_score(y_true, y_pred, percent = 80):
"""
Calculates the "quantile score" defined as mean of true returns where
prediction is the highest 20 percentile.
Keyword arguments:
y_true -- numpy array of true returns
y_pred -- numpy array... | {"hexsha": "45d927a918f4e669d53158260bad7100ddcc9411", "size": 1766, "ext": "py", "lang": "Python", "max_stars_repo_path": "marketpy/metrics.py", "max_stars_repo_name": "pythonist2/marketpy", "max_stars_repo_head_hexsha": "50df49337012cc4049c395b4ed672e2710f22514", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
# Copyright 2020 The FedLearner Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | {"hexsha": "827a6c83450fa0bf7be25b3fcd9a43666a9f4eab", "size": 6420, "ext": "py", "lang": "Python", "max_stars_repo_path": "test/trainer/test_nn_online_training.py", "max_stars_repo_name": "chen1i/fedlearner", "max_stars_repo_head_hexsha": "981514dadbd0aa49ae87d185dd247d310e35605c", "max_stars_repo_licenses": ["Apache-... |
import numpy as np
import time
import sys
import os
import copy
import math
import scipy.ndimage
import chainer.functions as F
from PIL import Image
import threading
import signal
import copy
from matplotlib.pyplot import margins
from gpu import GPU
import chainer
import chainer.distributions as D
from chainer import... | {"hexsha": "362ba8a60a3466a2ad9fc6b5885197be035f52f7", "size": 36069, "ext": "py", "lang": "Python", "max_stars_repo_path": "nf_model_reduction_att_vae_double.py", "max_stars_repo_name": "pouyaAB/Accept_Synthetic_Objects_as_Real", "max_stars_repo_head_hexsha": "127172fbfbac0af01184eff8cabba3d6afd2ac0b", "max_stars_repo... |
from collections import Counter
import inspect
import multiprocessing as mp
import os
from copy import deepcopy, copy
from importlib import import_module
from typing import Union, Optional, Dict, Any, List, Type
import numpy as np
import pandas as pd
from ConfigSpace import ConfigurationSpace
from frozendict import fr... | {"hexsha": "1fb8f7370bcdad76a7ba7606e0dff4b22a2cef6c", "size": 34248, "ext": "py", "lang": "Python", "max_stars_repo_path": "autoflow/core/base.py", "max_stars_repo_name": "auto-flow/autoflow", "max_stars_repo_head_hexsha": "f5903424ad8694d57741a0bd6dfeaba320ea6517", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_st... |
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | {"hexsha": "146df7d071603719cf89b38e0596f37ead7ba075", "size": 3990, "ext": "py", "lang": "Python", "max_stars_repo_path": "lite/examples/speech_commands/ml/callbacks.py", "max_stars_repo_name": "sidd04/Traffic-Counter", "max_stars_repo_head_hexsha": "d168b92041b14429914667c835578fc31bacdaf3", "max_stars_repo_licenses"... |
classdef FDV < ALGORITHM
% <multi/many> <real/integer> <large/none>
% Fuzzy decision variable framework with various internal optimizers
% Rate --- 0.8 --- Fuzzy evolution rate. Default = 0.8
% Acc --- 0.4 --- Step acceleration. Default = 0.4
% optimizer --- 5 --- Internal optimisation algorithm. 1 = NSGA... | {"author": "BIMK", "repo": "PlatEMO", "sha": "c5b5b7c37a9bb42689a5ac2a0d638d9c4f5693d5", "save_path": "github-repos/MATLAB/BIMK-PlatEMO", "path": "github-repos/MATLAB/BIMK-PlatEMO/PlatEMO-c5b5b7c37a9bb42689a5ac2a0d638d9c4f5693d5/PlatEMO/Algorithms/Multi-objective optimization/FDV/FDV.m"} |
"""
FEMMDeforLinearIMModule
Module for operations on interiors of domains to construct system matrices and
system vectors for linear deformation models: incompatible-mode formulation.
"""
module FEMMDeforLinearIMModule
__precompile__(true)
using FinEtools.FTypesModule: FInt, FFlt, FCplxFlt, FFltVec, FIntVec, FFl... | {"hexsha": "bb7cbe9680e89f636a054738ca3a7177e3503350", "size": 14461, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/FEMMDeforLinearIMModule.jl", "max_stars_repo_name": "PetrKryslUCSD/FinEtoolsDeforLinear.jl", "max_stars_repo_head_hexsha": "2be05b98954d75fc7980ef3c82b0babf748fa18d", "max_stars_repo_licenses"... |
#====-------------------------------------------------====#
# Drawer.
# This file is responsible for generating the contours
# and actually moving the mouse along their points.
#====-------------------------------------------------====#
import main
import functions
import time
import... | {"hexsha": "55cdfb1bbd208cdd48c910957ccc0658c04f52ed", "size": 2935, "ext": "py", "lang": "Python", "max_stars_repo_path": "drawer.py", "max_stars_repo_name": "GustavoHenriqueMuller/AutoDrawer", "max_stars_repo_head_hexsha": "504ca01bae92a2438e58f45cf99c1f6fcc7ca741", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
# %% [markdown]
"""
# Linear System ID
This example demonstrates the linear system identification algorithm.
By default, it uses the CWH4D system dynamics. Try setting the regularization
parameter lower for higher accuracy. Note that this can introduce numerical
instability if set too low.
To run the example, use th... | {"hexsha": "1674adfa5c5ed4c1c30792b1f797244be644641a", "size": 3547, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/identification/linear_id.py", "max_stars_repo_name": "ajthor/socks", "max_stars_repo_head_hexsha": "77063064ceb5a5da3f01733bef0885b00d4b2bed", "max_stars_repo_licenses": ["MIT"], "max_sta... |
#
# # EXAMPLE OF RUNNING STEPWISE CONDITIONAL TRANSFORMATION # #
#
import numpy as np
import matplotlib.pyplot as plt
from scipy import stats
from context import SeReMpy
from SeReMpy.Geostats import NonParametricToUniform, UniformToNonParametric
# Load example data following a non-parametric six-variate distributi... | {"hexsha": "64d40a7ff82333a8b291dbf27d0ae6c0ebd99c88", "size": 3075, "ext": "py", "lang": "Python", "max_stars_repo_path": "Additional_examples/example_stepwiseCondTransf.py", "max_stars_repo_name": "ADharaUTEXAS123007/SeReMpy", "max_stars_repo_head_hexsha": "1977bfc30bfa884947fc02ed8c626a9729b29105", "max_stars_repo_l... |
#=
Compare a 2D E/I linear model to the corresponding Hawkes process
=#
using LinearAlgebra,Statistics,StatsBase,Distributions
using Plots,NamedColors ; theme(:dark) ; plotlyjs()
using FFTW
using ProgressMeter
using Random
Random.seed!(0)
using HawkesSimulator; const global H = HawkesSimulator
function onedmat(x::R... | {"hexsha": "a55a0a03c680b65b2a6a4b75144d12f14c64422f", "size": 2703, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "examples/hawkes_and_rates_linear.jl", "max_stars_repo_name": "dylanfesta/HawkesSimulator.jl", "max_stars_repo_head_hexsha": "c774b1e1976139f7dfd11d063e76a0f9364a9479", "max_stars_repo_licenses": ["... |
# SPDX-License-Identifier: Apache-2.0
import os
import pytest
import numpy as np
import tensorflow as tf
from mock_keras2onnx.proto import keras, is_tf_keras
from test_utils import run_onnx_runtime
from mock_keras2onnx.proto.tfcompat import is_tf2
K = keras.backend
@pytest.fixture(scope='function')
def runner():
... | {"hexsha": "758c31f7f925fbc965e61bb7bf3f49dd68670f70", "size": 880, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/keras2onnx_unit_tests/conftest.py", "max_stars_repo_name": "pbeukema/tensorflow-onnx", "max_stars_repo_head_hexsha": "a8d5a3cc72d24ca18d64572588ad06490940a230", "max_stars_repo_licenses": ["A... |
# Standard Library
import json
import os
import time
from abc import ABC, abstractmethod
from bisect import bisect_left
from typing import Dict, List, Tuple
# Third Party
import numpy as np
# First Party
from smdebug.core.access_layer.s3handler import ReadObjectRequest, S3Handler
from smdebug.core.access_layer.utils ... | {"hexsha": "8123da3533095e254df944d1020567e98813c2f1", "size": 17228, "ext": "py", "lang": "Python", "max_stars_repo_path": "smdebug/core/index_reader.py", "max_stars_repo_name": "jigsaw004/sagemaker-debugger", "max_stars_repo_head_hexsha": "580fe8f9f3925496b7d557deab7a0721f15badb3", "max_stars_repo_licenses": ["Apache... |
import numpy as np
from numpy.testing import assert_array_equal, assert_array_almost_equal
from scipy.spatial.transform import Rotation
from tadataka.dataset.euroc import EurocDataset
from tadataka.camera.parameters import CameraParameters
from tadataka.camera.distortion import RadTan
from tests.dataset.path import ... | {"hexsha": "0fc3aaf88a8e5e766a2ae4c713db3593aa7028ed", "size": 2105, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/dataset/test_euroc.py", "max_stars_repo_name": "IshitaTakeshi/Tadataka", "max_stars_repo_head_hexsha": "852c7afb904503005e51884408e1492ef0be836f", "max_stars_repo_licenses": ["Apache-2.0"], ... |
# base.py
# Author: Jacob Schreiber <jmschreiber91@gmail.com>
"""
This file contains code that implements the core of the submodular selection
algorithms.
"""
import numpy
from tqdm import tqdm
from ..optimizers import BaseOptimizer
from ..optimizers import NaiveGreedy
from ..optimizers import LazyGreedy
from ..opt... | {"hexsha": "b3f308f892778fab972e80ce97c74f3b6117f123", "size": 24552, "ext": "py", "lang": "Python", "max_stars_repo_path": "apricot/functions/base.py", "max_stars_repo_name": "wfondrie/apricot", "max_stars_repo_head_hexsha": "d31365c96bcb61a7ae2550f39a5f9c144e1346ac", "max_stars_repo_licenses": ["MIT"], "max_stars_cou... |
# Downloads v and t on a given pressure level for S2S data, one hindcast at a time for all years
# e.g. 19810101, 19820101, 19830101, etc.., then calculates the meridionally averaged zonal-mean
# eddy heat flux, and puts it into one netcdf as a fxn of (time,ensemble_member).
# Control forecasts are included in as the l... | {"hexsha": "9066ba6081db5aa6c40f51da0987831671c8cb85", "size": 3501, "ext": "py", "lang": "Python", "max_stars_repo_path": "code/download/1.0-download-zm-vt.py", "max_stars_repo_name": "edunnsigouin/l21", "max_stars_repo_head_hexsha": "5d5dffb5c1bcae09a19b8a6bce48153989b1f1fe", "max_stars_repo_licenses": ["MIT"], "max_... |
# -*- coding: utf-8 -*-
"""
Created on Mon Aug 16 06:42:45 2021
@author: RPL 2020
"""
from lib import loaddata,plot,ae,citra
from sklearn.model_selection import train_test_split
from cv2 import resize
import numpy as np
# In[]: Load data rekon dan miyawaki
label,pred,allscoreresults=loaddata.fromArch(0)
labelm,pred... | {"hexsha": "292e84eba0aa07f0a997749bc2b03d765025d17b", "size": 1210, "ext": "py", "lang": "Python", "max_stars_repo_path": "main/reconstruction/nnmodel/denoisingaecnn.py", "max_stars_repo_name": "awangga/braindecoding", "max_stars_repo_head_hexsha": "97128a8346263c81c9ccd606cfa54b35dacd6ca1", "max_stars_repo_licenses":... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.