text
stringlengths
0
1.25M
meta
stringlengths
47
1.89k
"""Tests for :class:`~sudoku_solver.Grid'.""" import numpy as np import pytest @pytest.fixture def custom_grid(): """Pytest fixture that provides a (9, 9) numpy grid of non-zero integers.""" return np.arange(1, 82, dtype=np.int32).reshape((9, 9)) def test_create_default_grid(): """Test creating a :cla...
{"hexsha": "0e74a13461ca3a29a701cf7cab46855ee7267439", "size": 1006, "ext": "py", "lang": "Python", "max_stars_repo_path": "sudoku_solver/tests/test_grid.py", "max_stars_repo_name": "ctimmortal/sudoku_solver", "max_stars_repo_head_hexsha": "ef1858558b0e19964a7390ceea7dcd54a217eafa", "max_stars_repo_licenses": ["MIT"], ...
# Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. import itertools import random import unittest import numpy as np import torch from pytorch3d.structures.meshe...
{"hexsha": "7718c18706c9dda0721e11fb18ed0681d3cadc9b", "size": 59508, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_meshes.py", "max_stars_repo_name": "ParikhKadam/pytorch3d", "max_stars_repo_head_hexsha": "5cd70067e2ba642d98fd36e8e31273366d1599cb", "max_stars_repo_licenses": ["MIT", "BSD-3-Clause"]...
# -*- coding: utf-8 -*- """ Created on Tue Mar 16 11:13:37 2021 @author: dv516 """ import numpy as np import pickle import pyro pyro.enable_validation(True) # can help with debugging pyro.set_rng_seed(1) from algorithms.PyBobyqa_wrapped.Wrapper_for_pybobyqa import PyBobyqaWrapper from algorithms.Bayesian_opt_Pyro....
{"hexsha": "4669d9ed3fb3c9341cd6178834b2028cad92c8d2", "size": 27067, "ext": "py", "lang": "Python", "max_stars_repo_path": "RB_algorithms_comp/test_comparisons.py", "max_stars_repo_name": "OptiMaL-PSE-Lab/Expensive-Black-Box-Optim-ChemEng", "max_stars_repo_head_hexsha": "19c34dcff8c983926df501b93152fa3b3b0305d6", "max...
# Data Augmentation Pipelines import os import numpy as np import multiprocessing as mtps import json from DataAugmentationUtils import Utils from DataAugmentationUtils import Embedder from DataAugmentationUtils import Sampler ################################# Augmentaiton Pipelines ###################################...
{"hexsha": "0a5a55f851942ce885bab37a751fb8665b715210", "size": 4610, "ext": "py", "lang": "Python", "max_stars_repo_path": "Python/DataAugmentationUtilsPackage/DataAugmentationUtils/DataAugmentation.py", "max_stars_repo_name": "danlamanna/ShapeWorks", "max_stars_repo_head_hexsha": "58ffac86cbea1e7f0b4ede9ff6ded167bd5df...
!----- GPL --------------------------------------------------------------------- ! ! Copyright (C) Stichting Deltares, 2011-2016. ! ...
{"hexsha": "ad348ad0ecf4c8cba02770ca5be8430024e9be94", "size": 9142, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "docker/water/delft3d/tags/v6686/src/utils_lgpl/hyd_to_waq_part_lib/packages/hyd_to_waq_part_lib/src/write_rfl.f90", "max_stars_repo_name": "liujiamingustc/phd", "max_stars_repo_head_hexsha": "4f...
! ############################################################### ! # # ! # THE VLIDORT MODEL # ! # # ! # Vectorized LInearized Discrete Ordinate Radiative T...
{"hexsha": "0a60721d9339773d514a03a207361bb6c8ad69f0", "size": 85208, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "src/Components/rtms/RTSI/VLIDORT2OS/sourcecode_str/tmp/vlidort_lpc_solutions.f90", "max_stars_repo_name": "GEOS-ESM/AeroApps", "max_stars_repo_head_hexsha": "874dad6f34420c014d98eccbe81a061bdc0...
import os import tensorflow as tf from keras import optimizers from keras.models import Model from keras.layers import * from keras.engine.topology import Layer from keras.applications.vgg16 import VGG16 from squeezenet import SqueezeNet from keras import activations from keras import backend as K from keras.utils imp...
{"hexsha": "058f86e6cc684e8d8898fd3377622a1270ef05a3", "size": 10163, "ext": "py", "lang": "Python", "max_stars_repo_path": "Linux_project/PyQt5/model_build.py", "max_stars_repo_name": "Junnozyp/my_recyclable_net", "max_stars_repo_head_hexsha": "b3b981ac5bb454f698b7d4681d01503d60b2e22b", "max_stars_repo_licenses": ["MI...
# python3 # Copyright 2021 InstaDeep Ltd. 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 applic...
{"hexsha": "226aca86c612b46b3ec8d39cd59e8d261de0de19", "size": 21571, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/wrappers/wrapper_test.py", "max_stars_repo_name": "1998x-stack/Mava", "max_stars_repo_head_hexsha": "2c8f7f59f235340886e92045b6730cf5a542a496", "max_stars_repo_licenses": ["Apache-2.0"], "m...
""" Run supervised segmentation experiment with superpixels and training examples Pipeline: 1. segment SLIC superpixels 2. compute features (color and texture) 3. estimate model from single image or whole set 4. segment new images .. note:: there are a few constants to that have an impact on the experiment, see...
{"hexsha": "ab49be70b10981a529cdf357c33894f77bd785f2", "size": 21225, "ext": "py", "lang": "Python", "max_stars_repo_path": "experiments_segmentation/run_segm_slic_model_graphcut.py", "max_stars_repo_name": "Meniscus-and-DaveMemo-Group/pyImSegm", "max_stars_repo_head_hexsha": "631d8ece817b93990a77bb89d41d6b5fe6deb1bb",...
*> \brief \b SLATMR * * =========== DOCUMENTATION =========== * * Online html documentation available at * http://www.netlib.org/lapack/explore-html/ * * Definition: * =========== * * SUBROUTINE SLATMR( M, N, DIST, ISEED, SYM, D, MODE, COND, DMAX, * RSIGN, GRADE, DL, MODEL, ...
{"hexsha": "e4705994ab3f0f30b4dfe13c31441009fd99b72e", "size": 42862, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "lapack-netlib/TESTING/MATGEN/slatmr.f", "max_stars_repo_name": "RashmicaG/OpenBLAS", "max_stars_repo_head_hexsha": "bcdf1d49170508fd5c8250f802dd9018b7771534", "max_stars_repo_licenses": ["BSD-3-C...
import cv2.cv2 as cv2 import numpy as np import os def apply_ccm(im, ccm): pixels = np.reshape(im, [im.shape[0]*im.shape[1], im.shape[2]]) pixels_converted = np.matmul(pixels, ccm.T) im = np.reshape(pixels_converted, im.shape) return im def blacklevel_saturation_correct(im, sensor, saturation_scale = ...
{"hexsha": "66f1687b1ec1d5c63bdda134109da1123cfe6df5", "size": 3543, "ext": "py", "lang": "Python", "max_stars_repo_path": "img_process.py", "max_stars_repo_name": "WhuEven/multi_hyp_cc", "max_stars_repo_head_hexsha": "53a6bc438b865d606f5e6a53a442efbd8a04fe5b", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, ...
[GOAL] α β : PartOrdCat e : ↑α ≃o ↑β ⊢ ↑e ≫ ↑(OrderIso.symm e) = 𝟙 α [PROOFSTEP] ext x [GOAL] case w α β : PartOrdCat e : ↑α ≃o ↑β x : (forget PartOrdCat).obj α ⊢ ↑(↑e ≫ ↑(OrderIso.symm e)) x = ↑(𝟙 α) x [PROOFSTEP] exact e.symm_apply_apply x [GOAL] α β : PartOrdCat e : ↑α ≃o ↑β ⊢ ↑(OrderIso.symm e) ≫ ↑e = 𝟙 β [PROOF...
{"mathlib_filename": "Mathlib.Order.Category.PartOrdCat", "llama_tokens": 1377}
\documentclass[11pt,pdflatex,makeidx]{scrbook} % Book class in 11 points \usepackage[margin=0.5in]{geometry} \usepackage{color} \usepackage{makeidx} \usepackage{hyperref} <% if erudite::*latex-highlight-syntax* %> \usepackage{minted} \usepackage{mdframed} <% else %> \usepackage{listings} <% end %> \usepackage{hyperre...
{"hexsha": "caeb45b0b36f019c71c46d5ca37c1d722a000ba5", "size": 1646, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "resource/template.tex", "max_stars_repo_name": "cldm/erudite", "max_stars_repo_head_hexsha": "a0fddba8bafc03cb4703a87d58e1f478d8405d8e", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 58, "m...
"""Generates some dummy raster data to test elapid functions.""" import logging import os import sys from copy import copy import numpy as np import rasterio as rio # set logging logging.basicConfig( level=logging.INFO, format=("%(asctime)s %(levelname)s %(name)s [%(funcName)s] | %(message)s"), stream=sy...
{"hexsha": "95801266bd3522fdd97dbfa2b4d952d4a7f46892", "size": 2216, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/create_test_data.py", "max_stars_repo_name": "earth-chris/elapid", "max_stars_repo_head_hexsha": "b4cd61dab08442c7ad8c5a257ae036f985e6cdfb", "max_stars_repo_licenses": ["MIT"], "max_stars_co...
import theano import numpy as np # You can get the values being used to configure Theano like so: print(theano.config.device) print(theano.config.floatX) # You can also get/set them at runtime: old_floatX = theano.config.floatX theano.config.floatX = 'float32' # Be careful that you're actually using floatX! # For ...
{"hexsha": "c41703ec522a60e0f87172609fbd1b283d423904", "size": 716, "ext": "py", "lang": "Python", "max_stars_repo_path": "theano/gpu.py", "max_stars_repo_name": "alexey-ernest/nn", "max_stars_repo_head_hexsha": "c7a76205c80d72c45a0b747d53f4c6ac456ab4f6", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "ma...
# Import utilities from Basilisk.utilities import orbitalMotion, macros, unitTestSupport from Basilisk.utilities import RigidBodyKinematics as rbk # Get current file path import sys, os, inspect, time, signal, subprocess filename = inspect.getframeinfo(inspect.currentframe()).filename path = os.path.dirname(os.path....
{"hexsha": "329bf38ab7a37dd0bb2709ddece68faa7a9c4f1f", "size": 13789, "ext": "py", "lang": "Python", "max_stars_repo_path": "basilisk_env/simulators/scenario_OpNavOD.py", "max_stars_repo_name": "atharris/basilisk_env", "max_stars_repo_head_hexsha": "8fa610520859eb020ad226e9dedb38fb1c1ad678", "max_stars_repo_licenses": ...
import os import argparse import numpy as np from PIL import Image from tqdm import tqdm parser = argparse.ArgumentParser() parser.add_argument('--original', type=str, default='../data/original') parser.add_argument('--grayscale', type=str, default='../data/grayscale') parser.add_argument('--combined', type=str, defa...
{"hexsha": "c57e0539200073defe326d57ec40f56169c1b603", "size": 985, "ext": "py", "lang": "Python", "max_stars_repo_path": "dataset/combine_images.py", "max_stars_repo_name": "adriacabeza/GAN-Workshop", "max_stars_repo_head_hexsha": "a9a9accc43d3da01679621a6b789949c0cebef8c", "max_stars_repo_licenses": ["MIT"], "max_sta...
# Lab 4 Multi-variable linear regression import tensorflow as tf import numpy as np tf.set_random_seed(777) # numpy 내장 함수 xy = np.loadtxt('data-01-test-score.csv', delimiter=',', dtype=np.float32) x_data = xy[:, 0:-1] y_data = xy[:, [-1]] #print(xy) # shape과 data 확인 print(x_data.shape, x_data, len(x_data)) # 25x3,...
{"hexsha": "f303d80cdc55ed65bb6766b8604875b481590ae6", "size": 1615, "ext": "py", "lang": "Python", "max_stars_repo_path": "Python/tensorflow/DeepLearningZeroToAll/ver.py/Lab04-3-file_input_linear_regression.py", "max_stars_repo_name": "statKim/TIL", "max_stars_repo_head_hexsha": "3297d09023d97653773b35160794d3324b95c1...
# -*- coding: utf-8 -*- import numpy as np from copy import deepcopy from collections import namedtuple import torch import torch.nn.functional as F from .base_dpg import BaseDPGPolicy from .ddpg import DDPGPolicy class TD3Policy(BaseDPGPolicy): def __init__(self, actor, critic, critic2, actor_optim, critic_optim...
{"hexsha": "5e3f24e621df7e4f23338d11a9deb9e3b6279510", "size": 3232, "ext": "py", "lang": "Python", "max_stars_repo_path": "shark/policy/td3p.py", "max_stars_repo_name": "7starsea/shark", "max_stars_repo_head_hexsha": "5030f576da6f5998728d80170480e68a3debfe79", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nul...
import pygame from math import sin,cos,pi import math from pygame.draw import line,circle,rect from pygame.gfxdraw import aacircle from pygame import gfxdraw import random import time import numpy as np import sys sys.setrecursionlimit(10000) # random.seed(0) pygame.init() HIGHT,WIDTH= 600,600 BLAC...
{"hexsha": "83f97d00bd9daeb40a612fe2be4aaac09dcac636", "size": 12075, "ext": "py", "lang": "Python", "max_stars_repo_path": "quadtree.py", "max_stars_repo_name": "joey00072/Quadtree-in-python", "max_stars_repo_head_hexsha": "f3a03d80a62529116fea47518fbf37df0b0e9e35", "max_stars_repo_licenses": ["MIT"], "max_stars_count...
from UtilLibs_W import * import gc from tensorflow.keras import backend as K from tensorflow.keras.regularizers import L1L2 from tensorflow.keras.layers import Input, Dense, Lambda, Activation from tensorflow.keras.layers import concatenate as concat from tensorflow.keras.models import Model import glob # tf.device("c...
{"hexsha": "135b7d8e5a0558d6c3dc2fcf14ffb291271c46f0", "size": 15508, "ext": "py", "lang": "Python", "max_stars_repo_path": "utils/n_ZW.py", "max_stars_repo_name": "OmidSaj/HyDRA", "max_stars_repo_head_hexsha": "de7c3fefd90fb965b47f3db75ed9c9349f4e54c8", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 2, "max_st...
import random import matplotlib.pyplot as plt import numpy #read n = int(input('quantos movimentos?')) x = numpy.zeros(n) y = numpy.zeros(n) #simulate for i in range(1, n): dir = random.randint(1, 4) if dir == 1: x[i] = x[i - 1] + 1 y[i] = y[i - 1] elif dir == 2: x[i] = x[i - 1] - 1 ...
{"hexsha": "8063950a8452e75b5ff29570e61188222c21d1a7", "size": 830, "ext": "py", "lang": "Python", "max_stars_repo_path": "randomwalk2d.py", "max_stars_repo_name": "frestivo/python", "max_stars_repo_head_hexsha": "c4ae99288dd5419cead74693f1663f13c722f919", "max_stars_repo_licenses": ["CC0-1.0"], "max_stars_count": 1, "...
#!/usr/bin/env python3 import matplotlib.pyplot as plt import numpy as np # from matplotlib.axes import Axes # from matplotlib.lines import Line2D def plot_sln_dym(sln): plt.axis([120000, 150000, 20000, 50000]) plt.ion() data = np.load('ja9847.npy') for i, city in enumerate(sln): city_current...
{"hexsha": "fb03ac37a0e6bdf94bcbe1660c378db7bb3bdc57", "size": 946, "ext": "py", "lang": "Python", "max_stars_repo_path": "plot.py", "max_stars_repo_name": "lonelyandrew/TSP", "max_stars_repo_head_hexsha": "aea2be853d3596657e96390a06c826115a8e3e4d", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_star...
/* * Copyright (C) 2012 Open Source Robotics Foundation * * 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": "bcc13bf9466d4708a6fb7c484499b06d5b16c9a2", "size": 7119, "ext": "hh", "lang": "C++", "max_stars_repo_path": "include/nps_uw_multibeam_sonar/gazebo_multibeam_sonar_ray_based.hh", "max_stars_repo_name": "jpcoffelt/nps_uw_multibeam_sonar", "max_stars_repo_head_hexsha": "dd9fd3ebb613f9cb5b8f63b6032d1883aefb0507...
import numpy as np import torch # 创建Tensor # 1. import from numpy ===> use torch.from_numpy() a = np.array([2, 3.3]) a = torch.from_numpy(a) print(a) # 2. import from list # .tensor 参数是现成的数据: 标量、list、numpy b = torch.tensor([2, 3.2]) # .Tensor 参数为list、numpy,则和.tensor一样,为标量则当成shape来生成数据 # 推荐小写用在现成的数据转化,大写用在shape # 3...
{"hexsha": "b52852a74baa6c7bc9ab2d13ebca406540d3b7af", "size": 1332, "ext": "py", "lang": "Python", "max_stars_repo_path": "04/16-17.py", "max_stars_repo_name": "LCL121/start-leanring-pytorch", "max_stars_repo_head_hexsha": "f077ec892b538f3bff5825acce02872d31a1ab5d", "max_stars_repo_licenses": ["MIT"], "max_stars_count...
import os import sqlalchemy import scipy from sklearn import svm import numpy as np import matplotlib.pyplot as plt def clean( l1, l2, inc): ''' This method produces the difference between two predictions. During this process, the variables also get mapped into the result space of [0,1] This is done b...
{"hexsha": "d1b1d9c2aba56434907b1272ffea418dfecfd253", "size": 17026, "ext": "py", "lang": "Python", "max_stars_repo_path": "code/python_code/analyse.py", "max_stars_repo_name": "UKPLab/acl2019-ctest-difficulty-manipulation", "max_stars_repo_head_hexsha": "e8940132f2c175f1933cd92a6b671ce41d2b5ee9", "max_stars_repo_lice...
\input{spiff_workflow.tex} % Import common styles. \fancyfoot[C]{Page \thepage} \title{\productname\ Release \productversion\\ User Documentation\\ \vspace{5 mm} \large A workflow engine for Python applications} \author{Samuel Abels} \begin{document} \maketitle \tableofcontents \newpage \section{Introduction} \subs...
{"hexsha": "9152099d2695b896bf2b21d8e4e4cd06413ed770", "size": 1698, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "contrib/workflow/SpiffWorkflow/doc/spiff_workflow.en.tex", "max_stars_repo_name": "gonicus/clacks", "max_stars_repo_head_hexsha": "da579f0acc4e48cf2e9451417ac6792282cf7ab6", "max_stars_repo_licenses...
[STATEMENT] lemma zero_set_nonzero_constant: assumes "a \<noteq> \<zero>" assumes "a \<in> carrier R" shows "zero_set R n (coord_const a) = {}" [PROOF STATE] proof (prove) goal (1 subgoal): 1. V n (R.indexed_const a) = {} [PROOF STEP] proof(rule ccontr) [PROOF STATE] proof (state) goal (1 subgoal): 1. V n (R.in...
{"llama_tokens": 688, "file": "Padic_Field_Ring_Powers", "length": 9}
from frankapy import FrankaArm import GPy as gpy import sys import scipy.stats mvn = scipy.stats.multivariate_normal import os from shapes import Circle, Rectangle, Obstacle, Square import rospy import time from pyquaternion import Quaternion import cv_bridge import time #rospy.init_node("planorparam") import numpy as ...
{"hexsha": "6583439af9701edb0d1b66091bcde62f01ef2d83", "size": 39256, "ext": "py", "lang": "Python", "max_stars_repo_path": "planorparam/real_robot/realpeginsert.py", "max_stars_repo_name": "lagrassa/pipescrew", "max_stars_repo_head_hexsha": "6ec162f2f1e48fa0a21a3dd708ef4875c4cbd148", "max_stars_repo_licenses": ["MIT"]...
#!/usr/bin/env python # Copyright 2014-2019 The PySCF Developers. 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 # # U...
{"hexsha": "8ac2cd3d0fd8dd685c01fdf892979edb116c461f", "size": 65566, "ext": "py", "lang": "Python", "max_stars_repo_path": "pyscf/scf/hf.py", "max_stars_repo_name": "Warlocat/pyscf", "max_stars_repo_head_hexsha": "94c21e2e9745800c7efc7256de0d628fc60afc36", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count": ...
from __future__ import print_function from __future__ import division from utils.data import load_data, show_data_splits, shape_data from utils.evaluation import mask_array_rows, evaluate from utils.mf import select_model, show_design, load_mf, train, fit import implicit import time import argparse import os os.envi...
{"hexsha": "fbea3440aa8fb1167ab9b3dda73183bd52a3d973", "size": 9486, "ext": "py", "lang": "Python", "max_stars_repo_path": "mf_weak.py", "max_stars_repo_name": "andreuvall/HybridPlaylistContinuation", "max_stars_repo_head_hexsha": "6e31e50050c61a2c3ae55183e18b665fd54c7250", "max_stars_repo_licenses": ["BSD-2-Clause"], ...
import json import math import sys import os import numpy as np from op_server import affine_transform def load_file(input_file): with open(input_file) as data_file: pose_details = json.load(data_file) return pose_details def jedi_match(json1, json2): pose_points1 = json1['people'][0]['pose_keypo...
{"hexsha": "ba75e2969f9d09e897b21184a438c973b84cae12", "size": 3498, "ext": "py", "lang": "Python", "max_stars_repo_path": "op_server/ddr_score.py", "max_stars_repo_name": "sshvans/are-you-the-jedi-master", "max_stars_repo_head_hexsha": "a99a13ae96a464f2137b25529984099478e2d8be", "max_stars_repo_licenses": ["MIT"], "ma...
## ## calculate LOOs for each of the multilevel models ## library(rstanarm) library(loo) source("init if necessary.r") source("model comparison functions.r") # load customised functions for model comparison # rstan_options(auto_write = TRUE) # options(mc.cores = parallel::detectCores()) load(file.path(models.dir, g...
{"hexsha": "d4047d3ff27137ca65f9c695654a0e9d10e7d9ad", "size": 2699, "ext": "r", "lang": "R", "max_stars_repo_path": "multilevel models - compare.r", "max_stars_repo_name": "matthewgthomas/hierarchies-gifts", "max_stars_repo_head_hexsha": "7855e25e974b50c4c42d966ccd8ca75b3002f241", "max_stars_repo_licenses": ["MIT"], "...
[STATEMENT] lemma assoc'_simps [simp]: assumes "ide f" and "ide g" and "ide h" and "src f = trg g" and "src g = trg h" shows "arr (assoc'\<^sub>S\<^sub>B f g h)" and "dom (assoc'\<^sub>S\<^sub>B f g h) = f \<star> g \<star> h" and "cod (assoc'\<^sub>S\<^sub>B f g h) = (f \<star> g) \<star> h" and "src (...
{"llama_tokens": 1595, "file": "Bicategory_SpanBicategory", "length": 2}
import numpy from pyscf import gto, scf, ao2mo, mcscf, cc, mp ''' User-defined Hamiltonian for CASSCF module. Defining Hamiltonian once for SCF object, the derivate post-HF method get the Hamiltonian automatically. ''' mol = gto.M() mol.nelectron = 6 # incore_anyway=True ensures the customized Hamiltonian (the _eri ...
{"hexsha": "a4b507e505463add8c9f15b1198c7272c5dfc64c", "size": 999, "ext": "py", "lang": "Python", "max_stars_repo_path": "figs/pyscf_examples/custom_ham.py", "max_stars_repo_name": "jamesETsmith/2021_09_24_pyscf_overview_talk", "max_stars_repo_head_hexsha": "e121c6754dc3854b868f9753a56543f79a8f68a0", "max_stars_repo_l...
subroutine cutgrz(nowcrp,sdate,iplane) c c ... update perennial crops after cutting and grazing ... c c integer nowcrp, sdate, iplane include 'pmxcrp.inc' include 'pmxcut.inc' include 'pmxgrz.inc' include 'pmxpln.inc' include 'pmxres.inc' include 'pmxtls.in...
{"hexsha": "8e83d0a3d2013596ffc326b3b9ea42e63c8fbf98", "size": 1318, "ext": "for", "lang": "FORTRAN", "max_stars_repo_path": "src/wepp2010.1/cutgrz.for", "max_stars_repo_name": "jarad/dep", "max_stars_repo_head_hexsha": "fe73982f4c70039e1a31b9e8e2d9aac31502f803", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1...
import numpy as np from scipy import stats from sklearn.metrics import pairwise_distances from sklearn.preprocessing import normalize from .DATE import DATESampling from .badge import init_centers from utils import timer_func class bATESampling(DATESampling): """ bATE strategy: Our proposed model for better explo...
{"hexsha": "d4614ba55b52e4e9c42affaa44a7e9b2fb4364b9", "size": 2046, "ext": "py", "lang": "Python", "max_stars_repo_path": "query_strategies/bATE.py", "max_stars_repo_name": "Seondong/Customs-Fraud-Detection", "max_stars_repo_head_hexsha": "eb9e4641a78cb32d73787de86dd72ebb09df1452", "max_stars_repo_licenses": ["MIT"], ...
# Swaggy Jenkins # # Jenkins API clients generated from Swagger / Open API specification # # OpenAPI spec version: 1.1.1 # Contact: blah@cliffano.com # Generated by: https://openapi-generator.tech #' BranchImpl Class #' #' @field _class #' @field displayName #' @field estimatedDurationInMillis #' @field fullDispla...
{"hexsha": "50d0828ecd5c9cd53ff06ebae76b72fa7bca673a", "size": 9503, "ext": "r", "lang": "R", "max_stars_repo_path": "clients/r/generated/R/BranchImpl.r", "max_stars_repo_name": "PankTrue/swaggy-jenkins", "max_stars_repo_head_hexsha": "aca35a7cca6e1fcc08bd399e05148942ac2f514b", "max_stars_repo_licenses": ["MIT"], "max_...
import pickle, os import numpy as np from pathlib import Path import skimage.external.tifffile as tiff from resources.conv_learner import * from typing import Union, List def dataset_source(source: Union[str, Path]) -> tuple: test_dirs , train_dirs = [], [] for ds_dir in source.iterdir(): if 'DS_Stor...
{"hexsha": "9acefa6bdc7947296ac57db90c2a2748c9b53ccf", "size": 2488, "ext": "py", "lang": "Python", "max_stars_repo_path": "YNet_dev/common/data_source.py", "max_stars_repo_name": "Leonard-Pernice/Test_dev", "max_stars_repo_head_hexsha": "0b18bd7a1342cc17664354df3282aed0c30f47d0", "max_stars_repo_licenses": ["Apache-2....
# nsgaii.py # Program to run NSGA-II on dynamic benchmark problems # Author: Kristina Spencer # g - generation index # i - bin index # j - item index # k - algorithm index # m - solution index # t - time index from __future__ import print_function import coolcookies import csv import ga import ...
{"hexsha": "d9327b40ec3447f7146d7ad664b27b3dce4f63e0", "size": 17462, "ext": "py", "lang": "Python", "max_stars_repo_path": "SampleScripts/nsgaii_dynamic.py", "max_stars_repo_name": "kyspencer/GAMMA-PC-A-Greedy-Memetic-Algorithm-for-Storing-Cooling-Objects", "max_stars_repo_head_hexsha": "3462ff8cc555ad646b59909c661ca5...
import numpy as np def levenshtein(seq1, seq2): size_x = len(seq1) + 1 size_y = len(seq2) + 1 matrix = np.zeros ((size_x, size_y)) #Llena las matrices conforme al tamaño de las palabras #Para las filas iniciando en 1 for x in range(size_x): matrix [x, 0] = x #Para las columnas f...
{"hexsha": "29ab6fb1bccd10d93fd448c443c19c65f6a61933", "size": 1077, "ext": "py", "lang": "Python", "max_stars_repo_path": "Tarea 2/levenshtein.py", "max_stars_repo_name": "JosueHernandezR/Evolutionary_Computing", "max_stars_repo_head_hexsha": "d53a4b50e7a259ff971e8a9474b385bd1f12a690", "max_stars_repo_licenses": ["MIT...
print.table(lapply(0:19, M)) print.table(lapply(0:19, F))
{"hexsha": "0ba5f4c4eaa729b4fa07944b1c40f22bfe2a9548", "size": 58, "ext": "r", "lang": "R", "max_stars_repo_path": "Task/Mutual-recursion/R/mutual-recursion-2.r", "max_stars_repo_name": "LaudateCorpus1/RosettaCodeData", "max_stars_repo_head_hexsha": "9ad63ea473a958506c041077f1d810c0c7c8c18d", "max_stars_repo_licenses":...
import numpy as np import pandas as pd from sklearn.base import BaseEstimator,TransformerMixin from sklearn.preprocessing import OneHotEncoder class Fuzzification(BaseEstimator,TransformerMixin): ''' Fuzzification module of a Fuzzy Inference System. This transformer class is responsible for fitting and ...
{"hexsha": "946bd93e0eb7d3afeef4385df6b72f65ed1da352", "size": 7738, "ext": "py", "lang": "Python", "max_stars_repo_path": "autofis/base/fuzzification.py", "max_stars_repo_name": "lucasthim/auto-fuzzy", "max_stars_repo_head_hexsha": "1aa8f246973ad95c326e785f41614db0cb99b71c", "max_stars_repo_licenses": ["BSD-2-Clause"]...
#include "ntl/scheduler.hpp" #include "ntl/link.hpp" #include <boost/preprocessor/iteration/local.hpp> #include <boost/preprocessor/repetition/enum_params.hpp> #include <boost/preprocessor/arithmetic/inc.hpp> typedef ntl::gateway_registers<int> gateway_registers; struct scheduler_cmd { int port; uint32_t qua...
{"hexsha": "f1574bee4f573a54d05e28da0e79fc2e101bd823", "size": 2453, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "evaluation/scheduler/schedulers.cpp", "max_stars_repo_name": "lastweek/ntl", "max_stars_repo_head_hexsha": "1f41c8ad6079bab1e63addd0249e937d65290f9b", "max_stars_repo_licenses": ["BSD-2-Clause"], "m...
import os, sys import inspect currentdir = os.path.dirname(os.path.abspath( inspect.getfile(inspect.currentframe()))) parentdir = os.path.dirname(currentdir) sys.path.insert(0, parentdir) import numpy as np import pytest import librosa import soundpy as sp test_dir = 'test_audio/' test_audiofile = '{}audio2chan...
{"hexsha": "60d7a85faa3c57cf6269b0f2d0e841f5c7053592", "size": 21228, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/dsp_test.py", "max_stars_repo_name": "a-n-rose/Python-Sound-Tool", "max_stars_repo_head_hexsha": "4cb9ab7b55da9808da8dec3bc33759a7615ad4ed", "max_stars_repo_licenses": ["RSA-MD"], "max_star...
[STATEMENT] lemma upds_simp[simp]: "TWu.upds upd_uinfo uinfo hfs = uinfo" [PROOF STATE] proof (prove) goal (1 subgoal): 1. upds_uinfo uinfo hfs = uinfo [PROOF STEP] by(induction hfs, auto simp add: upd_uinfo_def)
{"llama_tokens": 94, "file": "IsaNet_instances_SCION", "length": 1}
# 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": "0ae2e1a9f1e171852592827da97a4ef1c9682b45", "size": 1726, "ext": "py", "lang": "Python", "max_stars_repo_path": "official/audio/melgan/export.py", "max_stars_repo_name": "leelige/mindspore", "max_stars_repo_head_hexsha": "5199e05ba3888963473f2b07da3f7bca5b9ef6dc", "max_stars_repo_licenses": ["Apache-2.0"], "...
""" Worm Algorithm for 2D Ising model. By Christopher Wilson. Written in Python 2.7. Algorithm adapted from: http://www.sciencedirect.com/science/article/pii/S0550321308005609 Original Paper: http://journals.aps.org/prl/pdf/10.1103/PhysRevLett.87.160601 Other references: Slides - http://pitp.physics.ubc.ca/confs/s...
{"hexsha": "a2a1bdae1dce1f7c702e53d0e57ba390063cff5d", "size": 10820, "ext": "py", "lang": "Python", "max_stars_repo_path": "python/Potts2d/pottsWorm2d.py", "max_stars_repo_name": "metxchris/SpinSystems", "max_stars_repo_head_hexsha": "90d3808434c100f536c8362555c3b68ecd4b3de9", "max_stars_repo_licenses": ["MIT"], "max_...
#include <cstdlib> #include <iostream> #include <complex> #define BOOST_UBLAS_NO_ELEMENT_PROXIES #include <boost/numeric/ublas/matrix.hpp> #include <boost/numeric/ublas/matrix_proxy.hpp> #include <boost/numeric/ublas/triangular.hpp> #include <boost/numeric/bindings/ublas/matrix.hpp> #include <boost/numeric/bindings/bla...
{"hexsha": "a1ac4ead9203b943ffcea32803b39ed6f253b4b4", "size": 2593, "ext": "cc", "lang": "C++", "max_stars_repo_path": "examples/blas/trsm.cc", "max_stars_repo_name": "rabauke/numeric_bindings", "max_stars_repo_head_hexsha": "f4de93bd7a01a8b31c9367fad35c81d086768f99", "max_stars_repo_licenses": ["BSL-1.0"], "max_stars...
from __future__ import division from __future__ import print_function from future import standard_library standard_library.install_aliases() from builtins import range from past.utils import old_div import os, sys, glob, subprocess import numpy as np from scipy import loadtxt from matplotlib import pyplot def get_mm...
{"hexsha": "10ba67b21998f5c55315ed8eb05ea5e69a7d8425", "size": 3761, "ext": "py", "lang": "Python", "max_stars_repo_path": "studies/009_voelz_nspe/analysis/compare_before_after.py", "max_stars_repo_name": "bieniekmateusz/forcebalance", "max_stars_repo_head_hexsha": "593791866e622ab4eae23ce29a0bed27499a118d", "max_stars...
[STATEMENT] lemma quality_increases_refl [intro, simp]: "quality_increases \<xi> \<xi>" [PROOF STATE] proof (prove) goal (1 subgoal): 1. quality_increases \<xi> \<xi> [PROOF STEP] by rule simp_all
{"llama_tokens": 80, "file": "AODV_variants_c_gtobcast_C_Quality_Increases", "length": 1}
# # Copyright 2020 Antoine Sanner # 2020 Lars Pastewka # 2015-2016 Till Junge # # ### MIT license # # 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, in...
{"hexsha": "f737d559e8be3e1a63af2c0350c54df4358f479d", "size": 2718, "ext": "py", "lang": "Python", "max_stars_repo_path": "helpers/Testing_augmented_Lagrangian.py", "max_stars_repo_name": "ContactEngineering/Adhesion", "max_stars_repo_head_hexsha": "acc46ad9bfe49fec667cb9a116ebde426faa38c4", "max_stars_repo_licenses":...
@testset "Type Assertions in Ematcher" begin some_theory = @theory begin a * b => b * a a::$Number * b::$Number => matched(a,b) a::$Int64 * b::$Int64 => specific(a,b) a * (b * c) => (a * b) * c end G = EGraph(:(2*3)) display(G.M); println() @test true == areequal(G,...
{"hexsha": "146391485f76780cef4ff6aecac83547c140fb5d", "size": 1335, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/test_ematch_assertions.jl", "max_stars_repo_name": "jpfairbanks/Metatheory.jl", "max_stars_repo_head_hexsha": "c1dd8c92bf8da168cca5a6e5d050493c93e859cd", "max_stars_repo_licenses": ["MIT"], "m...
import numpy as np import getopt, sys, random from envs import make_env np.set_printoptions(precision=3) opts, args = getopt.getopt(sys.argv[1:], "vn:l:") opts = dict(opts) n_agents = int(opts.get("-n", 2)) do_render = "-v" in opts load_from = opts.get("-l") env = make_env(args[0], n_agents) actions_shape = env.Acti...
{"hexsha": "db117861bf92677c742d108b258346b2a0f798b8", "size": 853, "ext": "py", "lang": "Python", "max_stars_repo_path": "util/random_multiagent.py", "max_stars_repo_name": "imandr/RLpy", "max_stars_repo_head_hexsha": "f01cf7af47b6054e4e52d663ceafc463df6f6166", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_c...
from fastparquet import ParquetFile from fastparquet import write import pandas as pd import numpy as np s = pd.DataFrame({'test': np.random.randn(1_000_000)}) s[::2] = np.nan s.to_parquet('test.parquet', compression='gzip')
{"hexsha": "495797b56fc14e6d6a3f708dbc1b3827dfcadc07", "size": 225, "ext": "py", "lang": "Python", "max_stars_repo_path": "3rdparty/fastparquet/issue-304.py", "max_stars_repo_name": "ishepherd/parquet-dotnet", "max_stars_repo_head_hexsha": "8273012a55182cc4f1b05aa8803ddc84ff6657d3", "max_stars_repo_licenses": ["MIT"], ...
from numpy import median as med, mean class Temperature: def __init__(self, data=[0]): self.data = data self.highest = max(data) self.lowest = min(data) self.median = med(data) self.average = mean(data) for i in self.__dict__: call = self.__dict__[i]...
{"hexsha": "d675ebd3f90c92daebf25ac4f01e49cd928534b5", "size": 667, "ext": "py", "lang": "Python", "max_stars_repo_path": "Solutions/beta/beta_temperature_analysis_iii.py", "max_stars_repo_name": "citrok25/Codewars-1", "max_stars_repo_head_hexsha": "dc641c5079e2e8b5955eb027fd15427e5bdb2e26", "max_stars_repo_licenses": ...
#!/usr/local/bin/python # -*- coding: utf-8 -*- import csv import os import numpy as np from sklearn.cross_validation import train_test_split from sklearn.svm import SVC from sklearn.ensemble import RandomForestClassifier from sklearn.linear_model import LogisticRegression from sklearn.metrics import accuracy_score, c...
{"hexsha": "e201e0f7fe1c3aeadfc1692f7c1e9bfa52596d9a", "size": 5066, "ext": "py", "lang": "Python", "max_stars_repo_path": "classifier/bin/report.py", "max_stars_repo_name": "wellflat/cat-fancier", "max_stars_repo_head_hexsha": "da95bb6cc439af9b4cb3322689fc3b849c7b3970", "max_stars_repo_licenses": ["MIT"], "max_stars_c...
#!/usr/bin/env python # coding: utf-8 # In[ ]: # In[120]: from sklearn import svm import SimpleITK as sitk import numpy as np import random # reader= sitk.ImageFileReader() # reader.SetImageIO("TIFFImageIO") # reader.SetFileName("/home/penglab/Ding/18455_00127/new_startpoints/011_x_13600.6_y_7614.94_z_1344.m...
{"hexsha": "6bdaba0cea99b0756543b98fff9085478fefb30c", "size": 4057, "ext": "py", "lang": "Python", "max_stars_repo_path": "hackathon/ZhangcanDing/svm_test/svm_test.py", "max_stars_repo_name": "zzhmark/vaa3d_tools", "max_stars_repo_head_hexsha": "3ca418add85a59ac7e805d55a600b78330d7e53d", "max_stars_repo_licenses": ["M...
import numpy as np from ecommerce_data import get_binary_data import matplotlib.pyplot as plt Xtrain, Ytrain, Xtest, Ytest = get_binary_data() D = Xtrain.shape[1] Ntrain = Xtrain.shape[0] ones = np.array([[1]*Ntrain]).T Xtrain = np.concatenate((ones, Xtrain), axis=1) Ntest = Xtest.shape[0] ones = np.ar...
{"hexsha": "d64cfd17348439946c5cf126a52a9f5eee9260f0", "size": 1967, "ext": "py", "lang": "Python", "max_stars_repo_path": "udemy/lazyprogrammer/logistic-regression-python/ecommerce_logistic.py", "max_stars_repo_name": "balazssimon/ml-playground", "max_stars_repo_head_hexsha": "c2eba497bebc53e5a03807bdd8873c55f0ec73e1"...
/- Copyright (c) 2017 Gabriel Ebner. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Gabriel Ebner -/ import .clause .clause_ops import .prover_state .misc_preprocessing open expr list tactic monad decidable universe u namespace super meta def try_option {a : Type u}...
{"author": "leanprover", "repo": "super", "sha": "47b107b4cec8f3b41d72daba9cbda2f9d54025de", "save_path": "github-repos/lean/leanprover-super", "path": "github-repos/lean/leanprover-super/super-47b107b4cec8f3b41d72daba9cbda2f9d54025de/src/super/clausifier.lean"}
from PIL import Image import numpy as np #-- read pixels to ndarray im1 = np.array( Image.open('../images/img001.png').convert('RGB') ) im3 = np.empty_like(im1) #-- pixel operation r = im1[:, :, 0] g = im1[:, :, 1] b = im1[:, :, 2] im3[:, :, 0] = g im3[:, :, 1] = b im3[:, :, 2] = r #-- save to png Image.fromarr...
{"hexsha": "e779579c3691c3d1705ba90de82fb2b42920f122", "size": 346, "ext": "py", "lang": "Python", "max_stars_repo_path": "python_pillow_numpy/204.convert.swap.rgb.py", "max_stars_repo_name": "takenobu-hs/pixel-manipulation-examples", "max_stars_repo_head_hexsha": "ceaefefd2d7bcf1fcce98cc09118c527f2cde42d", "max_stars_...
import math import logging import numpy # CONSTANTS UP = 'up' DN = 'down' LT = 'left' RT = 'right' MOVE_DICT = { UP: (0, -1), DN: (0, 1), LT: (-1, 0), RT: (1, 0) } DIR_DICT = {val: key for key, val in MOVE_DICT.items()} CCW = 1 CW = -1 TURN_DICT = { (UP, UP): 0, (DN, D...
{"hexsha": "36adac229f306f1e420d2cf3659c205fbfb4443e", "size": 11304, "ext": "py", "lang": "Python", "max_stars_repo_path": "app/utils/arena.py", "max_stars_repo_name": "ASavageCabbage/starter-snake-python", "max_stars_repo_head_hexsha": "fa887c2c65f1ae0188a11c73599b1fb74c4d6454", "max_stars_repo_licenses": ["MIT"], "m...
"""Functions for getting casadi expressions for transformation matrices from joint type.""" import casadi as cs import numpy as np def prismatic(xyz, rpy, axis, qi): T = cs.SX.zeros(4, 4) # Origin rotation from RPY ZYX convention cr = cs.cos(rpy[0]) sr = cs.sin(rpy[0]) cp = cs.cos(rpy[1]) sp ...
{"hexsha": "48de9de9152549bc2c13fbad65605db4e497d4f3", "size": 4439, "ext": "py", "lang": "Python", "max_stars_repo_path": "urdf2casadi/geometry/transformation_matrix.py", "max_stars_repo_name": "maxspahn/urdf2casadi", "max_stars_repo_head_hexsha": "b00451e2897687a2758c32c9f5c8b5fde74600bc", "max_stars_repo_licenses": ...
[STATEMENT] lemma project_stable_project_set: "G \<in> stable C ==> project h C G \<in> stable (project_set h C)" [PROOF STATE] proof (prove) goal (1 subgoal): 1. G \<in> UNITY.stable C \<Longrightarrow> project h C G \<in> UNITY.stable (project_set h C) [PROOF STEP] by (simp add: stable_def project_constrains_pr...
{"llama_tokens": 120, "file": null, "length": 1}
""" Evaluator settings. """ import os import tensorflow as tf import numpy as np from obspy.signal.trigger import recursive_sta_lta from obspy.signal.trigger import ar_pick from seisnn.core import Instance from seisnn.model.attention import TransformerBlockE, TransformerBlockD, \ MultiHeadSelfAttention, ResBlock...
{"hexsha": "8bec72368bde0027f0a85a504aa05638f632bedf", "size": 5530, "ext": "py", "lang": "Python", "max_stars_repo_path": "misc/conventional_method.py", "max_stars_repo_name": "jimmy60504/seisnn", "max_stars_repo_head_hexsha": "de1d9db99c0b3dcdc0f4ffbedd0c25a023f495bf", "max_stars_repo_licenses": ["MIT"], "max_stars_c...
import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1.inset_locator import zoomed_inset_axes from mpl_toolkits.axes_grid1.inset_locator import inset_axes from mpl_toolkits.axes_grid1.inset_locator import mark_inset class PLTLIB: def __init__(self, j_inf_opt): self._colors = ["#00...
{"hexsha": "42eadbf3a070822581cc89ba4573ddf5c4abf749", "size": 6323, "ext": "py", "lang": "Python", "max_stars_repo_path": "lq/pltlib.py", "max_stars_repo_name": "FarnazAdib/Crash_course_on_RL", "max_stars_repo_head_hexsha": "e645594524130e060954f73ab7d59294346fdc9b", "max_stars_repo_licenses": ["MIT"], "max_stars_coun...
From pv Require Import library. Require Import String ZArith List. Open Scope Z_scope. From ReductionEffect Require Import PrintingEffect. Require Coq.extraction.Extraction. Extraction Language OCaml. (* Language *) Inductive ABinOp := | add | sub | mul | div. Inductive Aexp : Type := | var :...
{"author": "eapiova", "repo": "abstract-interpreter", "sha": "7654cd54c6db1179e841668435f029aed59841f0", "save_path": "github-repos/coq/eapiova-abstract-interpreter", "path": "github-repos/coq/eapiova-abstract-interpreter/abstract-interpreter-7654cd54c6db1179e841668435f029aed59841f0/abstract_interpreter.v"}
C @(#)kmpgd2.f 20.3 2/13/96 function kmpgd2 (m,n) C include 'ipfinc/parametr.inc' include 'ipfinc/bus.inc' include 'ipfinc/gendrp.inc' C kmpgd2 = gennum(m) - gennum(n) return end
{"hexsha": "12fefb5c5cbb2dcb060d5dc5cc81e4174cfd53cd", "size": 227, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "ipf/kmpgd2.f", "max_stars_repo_name": "mbheinen/bpa-ipf-tsp", "max_stars_repo_head_hexsha": "bf07dd456bb7d40046c37f06bcd36b7207fa6d90", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 14, "m...
#---------------------------------------------------------- import numpy as np import struct import time import usb.core import usb.util import warnings from oceanoptics.defines import OceanOpticsError as _OOError from oceanoptics.defines import OceanOpticsModelConfig as _OOModelConfig from oceanoptics.defines import ...
{"hexsha": "bdced50f68c0026202b58673b137551660dfcb46", "size": 16862, "ext": "py", "lang": "Python", "max_stars_repo_path": "oceanoptics/base.py", "max_stars_repo_name": "sdickreuter/python-oceanoptics", "max_stars_repo_head_hexsha": "3a917cf564a2c214620a829cab10c85befbab72b", "max_stars_repo_licenses": ["MIT"], "max_s...
import numpy as np import quaternion from typing import Any, List, Union def normalize(v): nor = np.linalg.norm(v) return v / (nor + 1e-32) class mmdpyIK: def __init__(self, bone: Any, next_bone: Any, iteration: int, child_bones: List): self.bone: Any = bone self.effect_bone: Any = next_...
{"hexsha": "707990ecea892ab52abe1ecb9f7c92242b335e5b", "size": 9852, "ext": "py", "lang": "Python", "max_stars_repo_path": "mmdpy/mmdpy_bone.py", "max_stars_repo_name": "shirobu2400/mmdpy", "max_stars_repo_head_hexsha": "4613fcb84df7eff58ce3f0f8b7a3a9c84c95b6c6", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1...
# from scipy.optimize import minimize # # #testing list of funcitons # # def sample(i, l): # return i*l # # class Samp(): # def __init__(self, i): # self.i = i # def __call__(self, l): # return l*self.i # # a = [Samp(i) for i in range(10)] # # for e in a: # print(e(3)) # # # def objecti...
{"hexsha": "e01bb00e044ef92a391e6ce3931729e57b5adb22", "size": 654, "ext": "py", "lang": "Python", "max_stars_repo_path": "ofspy/test.py", "max_stars_repo_name": "ehsanfar/ofspy_Lite", "max_stars_repo_head_hexsha": "88f0cabafa93b48c2e4e2b2968b378e0748d7318", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count":...
import sys import platform import skimage import vispy import scipy import numpy import dask from qtpy import QtCore, API_NAME, PYSIDE_VERSION, PYQT_VERSION from qtpy.QtCore import Qt from qtpy.QtWidgets import QVBoxLayout, QTextEdit, QDialog, QLabel import napari class QtAbout(QDialog): def __init__(self): ...
{"hexsha": "f4724d4892e29cc17fdf56c7b005eb839770e2c4", "size": 2627, "ext": "py", "lang": "Python", "max_stars_repo_path": "napari/_qt/qt_about.py", "max_stars_repo_name": "ctrueden/napari", "max_stars_repo_head_hexsha": "4096e71b7e1fa041a62f4ac2f6853fba60c93e52", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars...
from helpers import io_helper import numpy as np import re def punctuation(): return ['—', '-', '.', ',', ';', ':', '\'', '"', '{', '}', '(', ')', '[', ']'] def is_number(token): return re.match('^[\d]+[,]*.?\d*$', token) is not None def decode_predictions(labels, predictions, flatten = False): if len(predictions...
{"hexsha": "f0b91c9363f2db0230ed8f5abf332063218388f5", "size": 7359, "ext": "py", "lang": "Python", "max_stars_repo_path": "helpers/data_shaper.py", "max_stars_repo_name": "malteos/explirefit", "max_stars_repo_head_hexsha": "9c8653f2aef42489f3427fe641bd51d6f286cc00", "max_stars_repo_licenses": ["Apache-2.0"], "max_star...
module Sandbox.Pred where open import Data.Num open import Data.Num.Properties open import Data.Nat open import Data.Fin using (Fin; suc; zero; #_) open import Data.Vec open import Relation.Nullary.Decidable using (True; fromWitness) open import Relation.Binary.PropositionalEquality hiding ([_]) -- open import Relati...
{"hexsha": "622b3b8c74ebfff9a428ff71bd30d4204814fb7f", "size": 3952, "ext": "agda", "lang": "Agda", "max_stars_repo_path": "Sandbox/Pred.agda", "max_stars_repo_name": "banacorn/numeral", "max_stars_repo_head_hexsha": "aae093cc9bf21f11064e7f7b12049448cd6449f1", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, "...
# -*- coding: utf-8 -*- import sys sys.path.insert(0,'..') import tensorflow as tf tf.random.set_seed(42) import numpy as np np.random.seed(42) from sklearn.datasets import load_iris from sklearn.model_selection import train_test_split from sklearn.metrics import accuracy_score from scipy.optimize import minimize fr...
{"hexsha": "01f781daca06a2da444f1fd8436d85f207970541", "size": 7575, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/tfkeras/test_tfkeras_softmaxregression.py", "max_stars_repo_name": "andreArtelt/ceml", "max_stars_repo_head_hexsha": "364d4630d6a01592c2ab86f2d53dbb7feb682381", "max_stars_repo_licenses": ["...
import threading import multiprocessing import numpy as np import matplotlib.pyplot as plt import tensorflow as tf import tensorflow.contrib.slim as slim import scipy.signal import gym from random import choice from time import sleep from time import time # Copies one set of variables to another. # Used to set worker...
{"hexsha": "730ea8bedd5ed69a4f2e9a7cdd26bbc316ff08e0", "size": 10600, "ext": "py", "lang": "Python", "max_stars_repo_path": "A3C/helper.py", "max_stars_repo_name": "ryanwhiteley/Python-RL", "max_stars_repo_head_hexsha": "b542fb117d55f1c01926c5f2bd8bd281bd7300f6", "max_stars_repo_licenses": ["MIT"], "max_stars_count": n...
#!/usr/bin/env python from __future__ import print_function, division import bayesloop as bl import numpy as np import sympy.stats as stats class TestTwoParameterModel: def test_fit_1cp_1bp_2hp(self): # carry out fit S = bl.ChangepointStudy() S.loadData(np.array([1, 2, 3, 4, 5])) ...
{"hexsha": "6f6e86f430a14c5350094447e8d911702acfa449", "size": 4717, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_changepointstudy.py", "max_stars_repo_name": "vishalbelsare/bayesloop", "max_stars_repo_head_hexsha": "667db2dbd102629c16bd8675e2b8c4e365de9b28", "max_stars_repo_licenses": ["MIT"], "ma...
(*************************************************************) (* Copyright Dominique Larchey-Wendling [*] *) (* *) (* [*] Affiliation LORIA -- CNRS *) (************************************************************...
{"author": "uds-psl", "repo": "coq-synthetic-incompleteness", "sha": "cd7d8490f8542bfe85658c465bcb26b2ed163f53", "save_path": "github-repos/coq/uds-psl-coq-synthetic-incompleteness", "path": "github-repos/coq/uds-psl-coq-synthetic-incompleteness/coq-synthetic-incompleteness-cd7d8490f8542bfe85658c465bcb26b2ed163f53/theo...
# Importing stock libraries import json from typing import List import pickle import math import numpy as np import pandas as pd import torch from torch.cuda import device import torch.nn as nn from torch.nn import parallel import wandb # Importing the T5 modules from huggingface/transformers from transformers impor...
{"hexsha": "c96ad9073fe64477898d1e30e5f76de3b74e46ff", "size": 16442, "ext": "py", "lang": "Python", "max_stars_repo_path": "models/prompt_gpt2/main.py", "max_stars_repo_name": "Reflorescit/InferTextGen", "max_stars_repo_head_hexsha": "277626fb9e34088a76917b899651ea68a5952e35", "max_stars_repo_licenses": ["Apache-2.0"]...
import numpy import pandas df = pandas.read_csv('EURUSD_M1_201706_with_signal.csv') df.drop('datetime', axis=1) maxlen = 1440 # ひとつの時系列データの長さ(24時間) x = numpy.empty((0, 1440), float) y = numpy.empty((0, 1), int) df.drop('v', axis=1) signal = df['signal'] df.drop('signal', axis=1) # 1時間ごとにトレーニングデータを作る for i in range(...
{"hexsha": "e0ea22b80ac5aad7b7fef18a468abe3ca41567c7", "size": 763, "ext": "py", "lang": "Python", "max_stars_repo_path": "make_train_data.py", "max_stars_repo_name": "hide-tono/keras-fx", "max_stars_repo_head_hexsha": "4f621d0438f0694f1b2d16cb1a6bb542b3390e9f", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_cou...
[STATEMENT] lemma typ_of_Abs_body_typ: "typ_of1 Ts (Abs T t) = Some ty \<Longrightarrow> \<exists>rty. ty = (T \<rightarrow> rty)" [PROOF STATE] proof (prove) goal (1 subgoal): 1. typ_of1 Ts (Abs T t) = Some ty \<Longrightarrow> \<exists>rty. ty = T \<rightarrow> rty [PROOF STEP] by (metis (no_types, lifting) bind_eq_...
{"llama_tokens": 147, "file": "Metalogic_ProofChecker_Term", "length": 1}
#!/usr/bin/python3.6 """ Converts the data into a format, suitable for training. """ import multiprocessing, os, sys from functools import partial from glob import glob from typing import * import numpy as np, pandas as pd from tqdm import tqdm from metrics import mapk from scipy.optimize import minimize import torc...
{"hexsha": "fd00537239163c65c9b0914a8fbc8f9cdc1a1224", "size": 3177, "ext": "py", "lang": "Python", "max_stars_repo_path": "stacking/level2_01_optimize.py", "max_stars_repo_name": "artyompal/kaggle_quick_draw", "max_stars_repo_head_hexsha": "227e228295479cd5e1af8dcde773f5efdacd62b8", "max_stars_repo_licenses": ["Apache...
"""Regular mini-batch sampler. Author: Mengye Ren (mren@cs.toronto.edu) """ from __future__ import (absolute_import, division, print_function, unicode_literals) import numpy as np from fewshot.data.registry import RegisterSampler from fewshot.data.samplers.sampler import Sampler @RegisterSa...
{"hexsha": "278f940d15da42509ab0baf6c4a1301c0d954f04", "size": 1971, "ext": "py", "lang": "Python", "max_stars_repo_path": "fewshot/data/samplers/minibatch_sampler.py", "max_stars_repo_name": "sebamenabar/oc-fewshot-public", "max_stars_repo_head_hexsha": "2dad8c9f24cb1bfe72d8b13b33d28f6788d86ca8", "max_stars_repo_licen...
import os import pandas as pd import numpy as np import matplotlib.pyplot as plt def get_errors(file_path, target_FEs): try: data = pd.read_csv(file_path, index_col = False) except FileNotFoundError as e: print(e) errors = np.empty((len(target_FEs),2)) errors[:] = np.NAN ...
{"hexsha": "cee183f8bf0cf838c7a23ea3940ec10ce5b93442", "size": 6221, "ext": "py", "lang": "Python", "max_stars_repo_path": "pybandit/utils/statistics.py", "max_stars_repo_name": "chunjenpeng/pyBandit", "max_stars_repo_head_hexsha": "df14bf0cc263d8fa0ad0a539e94327ac35e33d1c", "max_stars_repo_licenses": ["MIT"], "max_sta...
#include "complexErf.hpp" #include <ql/math/comparison.hpp> #include <boost/math/special_functions/erf.hpp> namespace QuantLib { std::complex<double> erf(const std::complex<double>& z, const std::size_t order) { const double x = z.real(); const double y = z.imag(); double erfr = boost::math::erf(x); ...
{"hexsha": "1f4dc67750d4160f9876add59ca1697c8a0923b6", "size": 1179, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "ql/experimental/preexperimental/complexErf.cpp", "max_stars_repo_name": "universe1987/QuantLib", "max_stars_repo_head_hexsha": "bbb0145aff285853755b9f6ed013f53a41163acb", "max_stars_repo_licenses": ...
# -*- coding: utf-8 -*- """ Created on Thu Dec 22 22:14:39 2016 @author: morepoch Helper functions """ from .misc import loadmat import numpy as np import cv2 def draw_str(dst, target, s): x, y = target #cv2.putText(dst, s, (x+1, y+1), cv2.FONT_HERSHEY_PLAIN, 2.0, (0, 0, 0), thickness = 3) ...
{"hexsha": "694a9c3af0004be3d1b1ec5c1aa7dc55c58301ff", "size": 4760, "ext": "py", "lang": "Python", "max_stars_repo_path": "itracker/common/face_tracking/helpers.py", "max_stars_repo_name": "djpetti/isl-gazecapture", "max_stars_repo_head_hexsha": "de0d955d25640facc5d72099fa92a4391643b405", "max_stars_repo_licenses": ["...
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import gym import numpy as np class GenericMujocoEnv: """This class evaluates policy of OpenAI Gym environment. Parameters --...
{"hexsha": "76c1dae933a36791c8a036ce58c74b9a698b0a87", "size": 2677, "ext": "py", "lang": "Python", "max_stars_repo_path": "nevergrad/functions/control/mujoco.py", "max_stars_repo_name": "mathuvu/nevergrad", "max_stars_repo_head_hexsha": "8e116190a8a29c238e655d728fc4816f7b4e0415", "max_stars_repo_licenses": ["MIT"], "m...
cccform change format CHARACTER*2 SY,aop1,aop2,sys CHARACTER*1 AF character*80 a80 common/cireadf/ireadf c common/cidlb/idlb COMMON/BBOXC/IBOXA,IBOXB,IBOYA,IBOYB COMMON/ITYPE/ITYPE COMMON/SY/SY COMMON/CIOPEN31/IOPEN31 COMMON/CI...
{"hexsha": "295e0a901db541993c1bb58bd343ba1b47515fb0", "size": 261942, "ext": "for", "lang": "FORTRAN", "max_stars_repo_path": "wspot/cps.for", "max_stars_repo_name": "sandi298/bohr-weisskopf-correction", "max_stars_repo_head_hexsha": "037d9f47df09258b6285c9c8ee77f18c560a047f", "max_stars_repo_licenses": ["Unlicense"],...
import os import json import re import string import numpy as np from tqdm import tqdm import torch from torch.utils.data import Dataset, TensorDataset, DataLoader, RandomSampler, SequentialSampler from .utils import MyGroupedQADataset, MyGroupedDataLoader from .zsre_grouped import ZSREGroupedData from .zsre_relation...
{"hexsha": "7062903ff1eaaee39e971030aa770d89d9a3f427", "size": 7429, "ext": "py", "lang": "Python", "max_stars_repo_path": "my_datasets/zsre_with_description_grouped.py", "max_stars_repo_name": "INK-USC/hypter", "max_stars_repo_head_hexsha": "732551e1e717b66ad26ba538593ed184957ecdea", "max_stars_repo_licenses": ["MIT"]...
import logging import numpy as np import geometry_util as gu import matplotlib.pyplot as plt from h5files import GeometryFile from generate_cru_geometry_file import generate_cru_geometry_file def generate_arrays(infile="img/1_solid", ryr_frac=1.0, width=56, jsr_layers=3, subdivide=3, ttub_mode='convexhull', ttub_pad=1...
{"hexsha": "531388d4cb493f309dfd6eff6ddfa74b1904b5d3", "size": 2101, "ext": "py", "lang": "Python", "max_stars_repo_path": "code/geometry_scripts/reference_geometries/create_solid_varying_ryr.py", "max_stars_repo_name": "andossy/Spark", "max_stars_repo_head_hexsha": "48a1fbb49a7c5154b942558825e4e482fadc37a1", "max_star...
""" Plummer gas model generator This module contains a function used to create Plummer (1911) models consisting of (SPH) gas particles. Plummer models follow a spherically symmetric density profile of the form: rho = c * (1 + r**2)**(-5/2) """ import numpy from amuse.ext.evrard_test import uniform_unit_sphere from ...
{"hexsha": "63f1527590e78590499d47e907e2dd427fba71ea", "size": 3840, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/usagi/ic/gasplummer.py", "max_stars_repo_name": "rieder/usagi", "max_stars_repo_head_hexsha": "d4dc4ecf81d12f5a25b1fd0124f3ad3f36b77944", "max_stars_repo_licenses": ["0BSD"], "max_stars_count"...
# Copyright 2019 Xanadu Quantum Technologies Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agre...
{"hexsha": "d5576ad8853b47b90583438b2efa1213eedcce8f", "size": 8701, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/backend/test_state_preparations.py", "max_stars_repo_name": "corvust/strawberryfields", "max_stars_repo_head_hexsha": "fd1b1aa18f5f7309ced9ca494912b4169bd9d19d", "max_stars_repo_licenses": [...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ @title: Defending Graph Convolutional Networks against Dynamic Graph Perturbations via Bayesian Self-supervision @topic: Implement Nettack @authors: Jun Zhuang, Mohammad Al Hasan. @references: https://docs.dgl.ai/generated/dgl.DGLGraph.adjacency_matrix_scipy.html#d...
{"hexsha": "d099e002b1dcfdfc1c81e178025fac7ffbc00d7a", "size": 9551, "ext": "py", "lang": "Python", "max_stars_repo_path": "graphSS/attack.py", "max_stars_repo_name": "junzhuang-code/GraphSS", "max_stars_repo_head_hexsha": "91d50934bb04a964b4edcbcb495e665e2d8ec50e", "max_stars_repo_licenses": ["MIT"], "max_stars_count"...
C Copyright(C) 2008-2017 National Technology & Engineering Solutions of C Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with C NTESS, the U.S. Government retains certain rights in this software. C C Redistribution and use in source and binary forms, with or without C modification, ar...
{"hexsha": "023d1435970f6fed5d0c198627e3552fc2c982e6", "size": 4918, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "packages/seacas/applications/grope/gr_prqa.f", "max_stars_repo_name": "mathstuf/seacas", "max_stars_repo_head_hexsha": "49b3466e3bba12ec6597e364ce0f0f149f9ca909", "max_stars_repo_licenses": ["BSD-...
! This file created from f77/datatype/typenamef.f with f77tof90 ! -*- Mode: Fortran; -*- ! ! ! (C) 2003 by Argonne National Laboratory. ! See COPYRIGHT in top-level directory. ! program main use mpi character*(MPI_MAX_OBJECT_NAME) name integer namelen integer ierr, errs errs ...
{"hexsha": "40dc8508cb7903c9fb4e958c3ff8cd6c1f56b6b5", "size": 7425, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "mpich-3.3/test/mpi/f90/datatype/typenamef90.f90", "max_stars_repo_name": "ucd-plse/mpi-error-prop", "max_stars_repo_head_hexsha": "4367df88bcdc4d82c9a65b181d0e639d04962503", "max_stars_repo_lice...
#ifndef WILCOXONPARALLELTESTS_H #define WILCOXONPARALLELTESTS_H #include <fstream> #include <cmath> #include <iostream> #include <sstream> #include <cstdlib> #include <vector> #include <cstring> #include <gsl/gsl_cdf.h> using namespace std; struct approximatePosition { int x; double y; }; class WilcoxonTest ...
{"hexsha": "4533fc72b586c0b9bff88e59029dd69ef0c1a481", "size": 2000, "ext": "h", "lang": "C", "max_stars_repo_path": "WilcoxonTestLibrary/src/WilcoxonTest.h", "max_stars_repo_name": "stenver/wilcoxon-test", "max_stars_repo_head_hexsha": "2158ed417996e91b09a1eab0b7265f723e42681b", "max_stars_repo_licenses": ["MIT"], "ma...
[STATEMENT] lemma LatticeTriangle: "\<turnstile> (A \<leadsto> D \<or> B) \<and> (B \<leadsto> D) \<longrightarrow> (A \<leadsto> D)" [PROOF STATE] proof (prove) goal (1 subgoal): 1. \<turnstile> (A \<leadsto> D \<or> B) \<and> (B \<leadsto> D) \<longrightarrow> (A \<leadsto> D) [PROOF STEP] apply clarsimp [PROOF STAT...
{"llama_tokens": 809, "file": null, "length": 6}
# -*- coding: utf-8 -*- __author__ = 'ooo' __date__ = '2019/6/9 12:17' """ Multi-Resolution Net 2019-6-20 20:58 """ from collections import OrderedDict import math import torch from torch import nn from torch.nn import functional as F from xmodules.classifier import AdaPoolView, ReturnX import xtils from xtils impor...
{"hexsha": "a1e09f5c62d6fa587afe1193f484cd8c030805fd", "size": 29601, "ext": "py", "lang": "Python", "max_stars_repo_path": "xmodels/msnet-bk1.py", "max_stars_repo_name": "zhjpqq/scaledensenet", "max_stars_repo_head_hexsha": "5ae56786c7f628b8320b76d559ecaa6fa1d2ac0e", "max_stars_repo_licenses": ["MIT"], "max_stars_coun...
import numpy from dexp.processing.filters.kernels.gaussian import gaussian_kernel_nd from dexp.processing.filters.kernels.wiener import wiener_kernel from dexp.utils.backends import Backend, CupyBackend, NumpyBackend def demo_wiener_numpy(): with NumpyBackend(): _demo_wiener() def demo_wiener_cupy(): ...
{"hexsha": "65f6f7429deb69c4e5a2196ea4ef6c69a263b5e3", "size": 1262, "ext": "py", "lang": "Python", "max_stars_repo_path": "dexp/processing/filters/kernels/demo/demo_wiener.py", "max_stars_repo_name": "haesleinhuepf/dexp", "max_stars_repo_head_hexsha": "2ea84f3db323724588fac565fae56f0d522bc5ca", "max_stars_repo_license...
/- Copyright (c) 2019 Simon Hudon. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Simon Hudon -/ import control.traversable.derive import control.traversable.lemmas import data.dlist import tactic.monotonicity.basic variables {a b c p : Prop} namespace tactic.interac...
{"author": "Mel-TunaRoll", "repo": "Lean-Mordell-Weil-Mel-Branch", "sha": "4db36f86423976aacd2c2968c4e45787fcd86b97", "save_path": "github-repos/lean/Mel-TunaRoll-Lean-Mordell-Weil-Mel-Branch", "path": "github-repos/lean/Mel-TunaRoll-Lean-Mordell-Weil-Mel-Branch/Lean-Mordell-Weil-Mel-Branch-4db36f86423976aacd2c2968c4e4...