text stringlengths 0 1.25M | meta stringlengths 47 1.89k |
|---|---|
import os
import random
import numpy as np
# import h5py
import torch
from PIL import Image, ImageOps
from torch.utils import data
def correspondences_collate(batch):
r"""Puts each data field into a tensor with outer dimension batch size, except for correspondence points which will be a list of tensors"""
i... | {"hexsha": "953e8c173a1cf4d4385160072874c979730fc143", "size": 5161, "ext": "py", "lang": "Python", "max_stars_repo_path": "datasets/correspondences.py", "max_stars_repo_name": "Triocrossing/cross-season-segmentation", "max_stars_repo_head_hexsha": "9cb4ff95065533845c21f418bf5b701248c92b41", "max_stars_repo_licenses": ... |
[STATEMENT]
lemma less_dag_set_of: "x < y \<Longrightarrow> set_of x \<subseteq> set_of y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. x < y \<Longrightarrow> set_of x \<subseteq> set_of y
[PROOF STEP]
by (unfold less_dag_def, induct y, auto) | {"llama_tokens": 98, "file": "BDD_BinDag", "length": 1} |
// Copyright (c) 2016-2017 Hypha
#include <hypha/core/database/database.h>
#include <hypha/core/database/databasegenerator.h>
#include <hypha/core/database/userdatabase.h>
#include <hypha/core/exceptions/configfilenotfound.h>
#include <hypha/core/settings/configgenerator.h>
#include <hypha/core/settings/databasesettin... | {"hexsha": "920cddfaea4b1b943686b4a1d456b12b0ec14d9a", "size": 2027, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "source/tests/core-test/database_test.cpp", "max_stars_repo_name": "hyphaproject/hypha", "max_stars_repo_head_hexsha": "2ab878529e859928dce0515c742368ad30a48dab", "max_stars_repo_licenses": ["MIT"], ... |
""" Utilities for dealing with NRRD files. So far, this is mostly
a nifti library, so these will probably just be conversion
utilities. The existence of this library should imply the creation
of an array_util, as many of the functions in nifti_util are not
specific to niftis.
"""
import nibabel as nib
import numpy... | {"hexsha": "63c66732064eaa3a382cfefa12f6dfdc60fc268c", "size": 846, "ext": "py", "lang": "Python", "max_stars_repo_path": "qtim_tools/qtim_utilities/nrrd_util.py", "max_stars_repo_name": "QTIM-Lab/qtim_tools", "max_stars_repo_head_hexsha": "92bd15ec7a81c5eda70d11a015f74538f3c41e22", "max_stars_repo_licenses": ["Apache-... |
###############################################################################
#
# Update carbon and water fluxes
#
# TODO: work more to make this function more customized
#
###############################################################################
"""
layer_fluxes!(
node::SPACMono{FT};
... | {"hexsha": "04673b71e294ae07271feb160163dea6ab0491bc", "size": 4582, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/SoilPlantAirContinuum/layers/layer_fluxes.jl", "max_stars_repo_name": "bbuman/Land", "max_stars_repo_head_hexsha": "b0f3a390eb17330abbfe1a6ddffefdad2c7353ff", "max_stars_repo_licenses": ["Apach... |
'''
Created on Dec, 2016
@author: hugo
'''
from __future__ import absolute_import
import numpy as np
from keras.models import Sequential
from keras.layers import Dense
from keras.callbacks import EarlyStopping, ReduceLROnPlateau
from sklearn.metrics import f1_score, confusion_matrix, classification_report
def softma... | {"hexsha": "fea36004821c7a70c31a5887c7c1b97e8eb03a31", "size": 2761, "ext": "py", "lang": "Python", "max_stars_repo_path": "autoencoder/testing/classifier.py", "max_stars_repo_name": "qmeeus/KATE", "max_stars_repo_head_hexsha": "012a1c6b671b5eb4c26470d8bca4f277fff1ec74", "max_stars_repo_licenses": ["BSD-3-Clause"], "ma... |
[STATEMENT]
lemma sorted_augmentum [simp]: "0 \<notin> set ns \<Longrightarrow> sorted (augmentum ns)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. 0 \<notin> set ns \<Longrightarrow> sorted (augmentum ns)
[PROOF STEP]
by (induction ns) auto | {"llama_tokens": 88, "file": "Khovanskii_Theorem_Khovanskii", "length": 1} |
#!/usr/bin/env python
import sys
if sys.version_info[0] >= 3:
import PySimpleGUI as sg
else:
import PySimpleGUI27 as sg
import os
from sys import exit as exit
from PIL import Image
import io
import numpy as np
thumbnails = {}
ROWS = 8
COLUMNS = 8
sg.SetOptions(border_width=0)
# Get the folder containing th... | {"hexsha": "945f6ce32f019feccbeee952d59100f2da9feb82", "size": 4599, "ext": "py", "lang": "Python", "max_stars_repo_path": "legacy/Python Pipe Tuner/ImageViewer.py", "max_stars_repo_name": "Iarumas/BagPypeTuner", "max_stars_repo_head_hexsha": "7926ae63031e072fa61e8db845ed845348b7ea44", "max_stars_repo_licenses": ["MIT"... |
# pylint: disable=missing-docstring
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import numpy as np
from nose.plugins.skip import SkipTest
import torch
from cleverhans.devtools.checks import CleverHansTest
from cle... | {"hexsha": "d9c5eec89d9bfd30a520208a12d375cce1b21769", "size": 18989, "ext": "py", "lang": "Python", "max_stars_repo_path": "cleverhans/future/torch/tests/test_attacks.py", "max_stars_repo_name": "iamgroot42/cleverhans", "max_stars_repo_head_hexsha": "53da9cd6daf9d7457800831c3eaa75f729a39145", "max_stars_repo_licenses"... |
import numpy as np
import argparse
import imutils
import time
import cv2
import os
import torchvision
import torchvision.transforms as transforms
ap = argparse.ArgumentParser()
ap.add_argument("input", help="path to the input file")
ap.add_argument("output", help="path to output file")
# ap.add_argument("-o", "--outp... | {"hexsha": "c0f2ff9b233d221e6c22f5f3c5d91880b424be6a", "size": 3805, "ext": "py", "lang": "Python", "max_stars_repo_path": "Scripts/mask_rcnn_model.py", "max_stars_repo_name": "Hira63S/DeepLearningResearch", "max_stars_repo_head_hexsha": "b6e8298a88fbc81de06d8e202603a80af8bbdaa2", "max_stars_repo_licenses": ["MIT"], "m... |
from scipy.stats import wasserstein_distance, ks_2samp, energy_distance, anderson_ksamp
def frobenium_norm(data1, data2):
pass
def l2_norm(data1, data2):
pass
def frechet_inception_distance(data1, data2):
pass
def t_test(data1, data2):
pass
def energy_dist(data1, data2):
# data1 = data1.fla... | {"hexsha": "b64cc9800079938fc9ea71372855ab46b63c9385", "size": 2308, "ext": "py", "lang": "Python", "max_stars_repo_path": "EvaluationMetrics/General_Diseases/distance_calculator.py", "max_stars_repo_name": "vampypandya/HealthGAN-Pre", "max_stars_repo_head_hexsha": "94a1f5c5672849ad3bad5791efdba74b79252a5d", "max_stars... |
import os
import numpy as np
import theano
import theano.tensor as T
from lib.utils.theano_utils import *
from lib.utils.lasagne_utils import *
from lib.utils.data_utils import *
from lib.utils.dr_utils import *
from lib.utils.attack_utils import *
from lib.utils.plot_utils import *
from lib.utils.model_utils import *... | {"hexsha": "0c42784a1fd04988f873d760521827cf7d491a6d", "size": 1975, "ext": "py", "lang": "Python", "max_stars_repo_path": "dr_theory.py", "max_stars_repo_name": "inspire-group/ml_defense", "max_stars_repo_head_hexsha": "e7e8944d617885389a013061c320fa3553e779f0", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1... |
"""
Model contributed by: MITRE Corporation
Adapted from: https://github.com/craston/MARS
"""
import logging
from art.classifiers import PyTorchClassifier
import numpy as np
from PIL import Image
import torch
from torch import optim
from MARS.opts import parse_opts
from MARS.models.model import generate_model
from MA... | {"hexsha": "5ff974c582ad9053e19a0b57819b663fe2305df1", "size": 9716, "ext": "py", "lang": "Python", "max_stars_repo_path": "armory/baseline_models/pytorch/ucf101_mars.py", "max_stars_repo_name": "paperwhite/armory", "max_stars_repo_head_hexsha": "3868cf5dd86578b58105f5901139a2f0b939ab15", "max_stars_repo_licenses": ["M... |
# coding=utf-8
# Copyright 2022 The Google Research 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 applicab... | {"hexsha": "af672d05dbf769867965181cda5939a10a609ba9", "size": 21643, "ext": "py", "lang": "Python", "max_stars_repo_path": "symbolic_functionals/syfes/symbolic/mutators_test.py", "max_stars_repo_name": "gunpowder78/google-research", "max_stars_repo_head_hexsha": "d41bbaca1eb9bfd980ec2b3fd201c3ddb4d1f2e5", "max_stars_r... |
from scipy.spatial.distance import pdist, squareform
from scipy.linalg import eigh
import numpy as np
def rbf_kernel_pca(X, gamma, n_components):
"""
RBF kernel PCA implementation.
Parameters
------------
X: {NumPy ndarray}, shape = [n_examples, n_features]
gamma: float
Tuning param... | {"hexsha": "6409704c06d6fa38786fbce870795a14c77b468a", "size": 1462, "ext": "py", "lang": "Python", "max_stars_repo_path": "O5/_26_kernel_principal_component_analysis/kpca.py", "max_stars_repo_name": "ShAlireza/ML-Tries", "max_stars_repo_head_hexsha": "4516be7a3275c9bdedd7bd258800be384b6b34f0", "max_stars_repo_licenses... |
# Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved.
#
# 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 us... | {"hexsha": "cc017dfc8ec016634002286fc1dad5f251869203", "size": 4760, "ext": "py", "lang": "Python", "max_stars_repo_path": "built-in/TensorFlow/Research/reinforcement-learning/ModelZoo_PPO_TensorFlow/rl/xt/algorithm/gail/gail.py", "max_stars_repo_name": "Huawei-Ascend/modelzoo", "max_stars_repo_head_hexsha": "df51ed9c1... |
from scipy import ndimage
sobel_mode = "reflect"
def grad_x(image):
return ndimage.sobel(image, axis=1, mode=sobel_mode)
def grad_y(image):
return ndimage.sobel(image, axis=0, mode=sobel_mode)
| {"hexsha": "089adb04c337526b41ddbc78fc968b5daedb0f01", "size": 207, "ext": "py", "lang": "Python", "max_stars_repo_path": "tadataka/gradient.py", "max_stars_repo_name": "IshitaTakeshi/Tadataka", "max_stars_repo_head_hexsha": "852c7afb904503005e51884408e1492ef0be836f", "max_stars_repo_licenses": ["Apache-2.0"], "max_sta... |
import sys
from typing import TYPE_CHECKING, Any, List, Sequence, Tuple, Union, overload
# %% Taken from https://github.com/numpy/numpy/tree/master/numpy/typing
from numpy import dtype, ndarray
if sys.version_info >= (3, 8):
from typing import Protocol, TypedDict
HAVE_PROTOCOL = True
else:
try:
fr... | {"hexsha": "122e289c12a62ea665754fbb98de0fe3fee51ee6", "size": 1831, "ext": "py", "lang": "Python", "max_stars_repo_path": "5-assignment/mytypes.py", "max_stars_repo_name": "eirik-ff/TTK4250-Sensor-fusion", "max_stars_repo_head_hexsha": "9bba4d641c5b9bb17fa943b330b502c220b58c3a", "max_stars_repo_licenses": ["MIT"], "ma... |
#
# This file is part of CasADi.
#
# CasADi -- A symbolic framework for dynamic optimization.
# Copyright (C) 2010-2014 Joel Andersson, Joris Gillis, Moritz Diehl,
# K.U. Leuven. All rights reserved.
# Copyright (C) 2011-2014 Greg Horn
#
# CasADi is free software; you can... | {"hexsha": "58cce3778301b1c93546d1a9559f4f1907d8d93f", "size": 7399, "ext": "py", "lang": "Python", "max_stars_repo_path": "crane_controllers/external/casadi-3.4.5/test/python/complexity.py", "max_stars_repo_name": "tingelst/crane", "max_stars_repo_head_hexsha": "e14bca2bd4e2397dce09180029223832aad9b070", "max_stars_re... |
[STATEMENT]
lemma tt_in_keys:
assumes "p \<noteq> 0"
shows "tt p \<in> keys p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. tt p \<in> keys p
[PROOF STEP]
unfolding tt_alt[OF assms]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. ord_term_lin.Min (keys p) \<in> keys p
[PROOF STEP]
by (rule ord_term_lin.Min_i... | {"llama_tokens": 163, "file": "Polynomials_MPoly_Type_Class_Ordered", "length": 2} |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Nov 16 12:04:22 2016
@author: Tom
"""
import numpy as np
import aubio as aub
import sys
sys.path.append('../')
import math
from datagrabber import extractAndSave,extractAndSaveYoutubeData
IEMOCAP_LOCATION = "../../../../local"
YOUTUBE_LOCATION = "../... | {"hexsha": "ad47383e48e50709e67840cfc43551d8a1169d1f", "size": 2359, "ext": "py", "lang": "Python", "max_stars_repo_path": "EmotionCommotion/backend/featureExtractors/MFCC.py", "max_stars_repo_name": "hmajid2301/EmotionCommotion", "max_stars_repo_head_hexsha": "7f32c092e9cb461bacfa033fb1bbc9ef565ee79a", "max_stars_repo... |
# Benchmark between tinyscaler, OpenCV, Pillow, and skImage using bilinear filtering
import numpy as np
import tinyscaler
import cv2
import time
from PIL import Image
from skimage.transform import resize
# Disable multithreading and GPU support for OpenCV for a single-threaded CPU comparison
cv2.setNumThreads(1)
cv2.o... | {"hexsha": "07c46946710ebe8c7527405d84e57b806477e353", "size": 1765, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/benchmark_bilinear.py", "max_stars_repo_name": "Farama-Foundation/tinyscaler", "max_stars_repo_head_hexsha": "5a90c027a6e6a4a86c8315efcadc1a8fa4588fa9", "max_stars_repo_licenses": ["MIT"]... |
import LeanCodePrompts.Translate
import LeanCodePrompts.Utils
open Lean Meta Elab
def translateWithDataM (s: String)(numSim : Nat:= 10)(numKW: Nat := 1)(includeFixed: Bool := Bool.false)(queryNum: Nat := 5)(temp : JsonNumber := ⟨2, 1⟩)(scoreBound: Float := 0.2)(matchBound: Nat := 15) :
TermElabM ((Option (Expr × ... | {"author": "siddhartha-gadgil", "repo": "LeanAide", "sha": "7862af73ee2f0be08b20fd3e4148e20bf4a81054", "save_path": "github-repos/lean/siddhartha-gadgil-LeanAide", "path": "github-repos/lean/siddhartha-gadgil-LeanAide/LeanAide-7862af73ee2f0be08b20fd3e4148e20bf4a81054/LeanCodePrompts/BatchTranslate.lean"} |
This editor can edit this entry and tell us a bit about themselves by clicking the Edit icon.
20081004 09:19:50 nbsp Welcome to the Wiki. Please read Welcome to the Wiki/Business Owner; it will help explain how you can make the wiki a positive experience for you without clashing with established wiki social norms. F... | {"hexsha": "6ae14bae21041ad04ea2e0a273c9596b2d878e94", "size": 946, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "lab/davisWiki/sue.f", "max_stars_repo_name": "voflo/Search", "max_stars_repo_head_hexsha": "55088b2fe6a9d6c90590f090542e0c0e3c188c7d", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "... |
[STATEMENT]
lemma round_add_inv [rule_format]:
"index_less index key \<longrightarrow> bn_inv p q t \<longrightarrow> add_inv n t \<longrightarrow>
add_inv n (round index key p q r t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. index_less index key \<longrightarrow> bn_inv p q t \<longrightarrow> add_inv n ... | {"llama_tokens": 62701, "file": "Generalized_Counting_Sort_Algorithm", "length": 103} |
import json
import os
import numpy as np
class ModelConfig:
"""
Contains all necessary information to use the model for inference. May also include training metadata.
Model directory should contain config.json and this class can be directly initialized from a model dir with fromDir.
"""
def __in... | {"hexsha": "b3e7dda4151d11bf0a633c9752089ca97f28d6d5", "size": 1829, "ext": "py", "lang": "Python", "max_stars_repo_path": "training/model/model_config.py", "max_stars_repo_name": "jpjuvo/PANDA-challenge-raehmae", "max_stars_repo_head_hexsha": "5748cd23f18e2dd36d56918dcee495b822d2a5cd", "max_stars_repo_licenses": ["MIT... |
import sys
import os
import numpy as _np
sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../src/")
import finoptions as fo
def test_PlainVanillaPayoff():
S = 100
K = 100
t = 1 / 12
sigma = 0.4
r = 0.10
b = 0.1
dt = 1 / 360
eps = _np.genfromtxt(
"./pytest/s... | {"hexsha": "4e715b9c000e3dc03b5a5f359c368258f5af7e0b", "size": 2802, "ext": "py", "lang": "Python", "max_stars_repo_path": "pytest/test_mc_payoffs.py", "max_stars_repo_name": "bbcho/finoptions-dev", "max_stars_repo_head_hexsha": "81365b6d93693b0b546be92448db858ccce44d5a", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This version of the `moon` module calculates lunar phase angle for a geocentric
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
# Third-party
import numpy as np
from astropy.coordinates... | {"hexsha": "4818639e351cd6b3370dea4714eb317922ee0722", "size": 1732, "ext": "py", "lang": "Python", "max_stars_repo_path": "astroplan/moon.py", "max_stars_repo_name": "lordaniket06/astroplan", "max_stars_repo_head_hexsha": "cc28c3204cb1d8338f2a91e1609a95415aa9df71", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_sta... |
/*
* Copyright (c) 2011, Peter Thorson. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of cond... | {"hexsha": "e16a5f471736143f13cc5b20f8daaf3f3751a27d", "size": 5328, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "server/websocketpp/examples/chat_client/chat_client_handler.cpp", "max_stars_repo_name": "urbenlegend/WebStreamer", "max_stars_repo_head_hexsha": "562b16a4b8e10cce25c4088e38e83f93bc87e1ee", "max_sta... |
[STATEMENT]
lemma supp_subst: "supp (e[y::=x]) \<subseteq> (supp e - {atom y}) \<union> {atom x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. supp e[y::=x] \<subseteq> supp e - {atom y} \<union> {atom x}
[PROOF STEP]
using supp_subst_eq
[PROOF STATE]
proof (prove)
using this:
supp ?e[?y::=?x] = supp ?e - {atom ?y... | {"llama_tokens": 212, "file": "Launchbury_Substitution", "length": 2} |
#[T. Mueller et al. Phys. Rev. C 83, 054615 (2011).]
import numpy as np
a_U235 = dict(a1 = 3.217, a2 = -3.111, a3 = 1.395, a4 = -3.690e-1, a5 = 4.445e-2, a6 = -2.053e-3)
a_Pu239 = dict(a1 = 6.413, a2 = -7.432, a3 = 3.535, a4 = -8.820e-1, a5 = 1.025e-1, a6 = -4.550e-3)
a_U238 = dict(a1 = 4.833e-1, a2 = 1.927e-1, a3 = -... | {"hexsha": "6fe1a3aabea7cc3b833af910a706aa3b53f0cfb1", "size": 859, "ext": "py", "lang": "Python", "max_stars_repo_path": "pyreactors/mueller/mueller.py", "max_stars_repo_name": "michelemontuschi/pyreactors", "max_stars_repo_head_hexsha": "1b1f7edccb2ca7f9b1281385dbc9017d3791510d", "max_stars_repo_licenses": ["MIT"], "... |
import torch
from torch.nn import init
import numpy as np
import random
import math
import os
from matplotlib import pyplot as plt
from PIL import Image
import scipy.signal
from tqdm import tqdm
from torch.autograd import Variable
def weights_init_kaiming(m):
classname = m.__class__.__name__
if classname.find... | {"hexsha": "d1197d34b88f971b9ee394f83008dea52c262481", "size": 7284, "ext": "py", "lang": "Python", "max_stars_repo_path": "reid/utils/utils.py", "max_stars_repo_name": "sht1998/Tracking-PyTorch", "max_stars_repo_head_hexsha": "928c5b0e9e196da207a1eed086ce1c414d3de91e", "max_stars_repo_licenses": ["Apache-2.0"], "max_s... |
import cv2
import dlib
import numpy as np
import matplotlib.pyplot as plt
import imutils
from imutils import face_utils, translate, resize
from imutils.video import VideoStream, FPS, FileVideoStream
import time
from scipy.spatial import distance as dist
import math
from utils import *
from mask_image imp... | {"hexsha": "85d35826a88cd56761e11be78c7a492cc63fdfe9", "size": 8750, "ext": "py", "lang": "Python", "max_stars_repo_path": "mask_video.py", "max_stars_repo_name": "MariBax/Face-masking-with-CV", "max_stars_repo_head_hexsha": "e211afe8ebe82553ee4089e7dc288bc127c81107", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
SUBROUTINE SUB(X,Y,A,B)
C*******
C SUB WILL FORM Y = A*X - B*Y WHERE A AND B ARE SCALAR MULTIPLIERS
C FOR THE VECTORS X AND Y
C*******
DOUBLE PRECISION X(1) ,Y(1) ,A ,B
COMMON /INVPWX/ XX ,NCOL
DO 10 I = 1,NCOL
10 Y(I) = X(I)*A - Y(I)*B
RETU... | {"hexsha": "b681d70b691b11b89d955ee7b3e13673c5635c5a", "size": 335, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "mis/sub.f", "max_stars_repo_name": "ldallolio/NASTRAN-95", "max_stars_repo_head_hexsha": "6d2c175f5b53ebaec4ba2b5186f7926ef9d0ed47", "max_stars_repo_licenses": ["NASA-1.3"], "max_stars_count": 14, ... |
import pandas as pd
import numpy as np
import os, sys
#Extract the features and the predictors
data = pd.read_csv('parkinsons.data')
predictors = data.drop(['name'], axis = 1)
predictors = predictors.drop(['status'], axis = 1).as_matrix()
target = data['status']
from sklearn.preprocessing import MinMaxScaler
scaler... | {"hexsha": "5ccf2f2895b815c2d0ccd24442b0783c248103a4", "size": 1078, "ext": "py", "lang": "Python", "max_stars_repo_path": "fine_tune_KNN.py", "max_stars_repo_name": "cuuupid/parkinsons-AI", "max_stars_repo_head_hexsha": "276b2216d879155d6172e071eca1fb0984693116", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
'''Configure printing, plotting, logging options.'''
import numpy
numpy.set_printoptions(
edgeitems = 5,
threshold = 100,
formatter = {'float' : '{: 13.6e}'.format},
linewidth = 160)
import matplotlib
# matplotlib.use('TkAgg')
matplotlib.interactive(True)
import logging
logging.basicConfig(
level... | {"hexsha": "590f82c568e68ca350e888fce8f7e7460ae9efad", "size": 548, "ext": "py", "lang": "Python", "max_stars_repo_path": "config.py", "max_stars_repo_name": "danassutula/maximum_compliance", "max_stars_repo_head_hexsha": "f2407bd9c5f7e36fe43aa51690433fe8bfb2f748", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
import numpy as np
from math import ceil
from .. utils import logger, verbose
@verbose
def peak_finder(x0, thresh=None, extrema=1, verbose=None):
"""Noise-tolerant fast peak-finding algorithm.
Parameters
----------
x0 : 1d array
A real vector from the maxima will be found (required).
thr... | {"hexsha": "13e1441c608c18386c5c6da5502fe0d5dae1eb16", "size": 5645, "ext": "py", "lang": "Python", "max_stars_repo_path": "mne/preprocessing/peak_finder.py", "max_stars_repo_name": "faturita/mne-python", "max_stars_repo_head_hexsha": "2c8cac5cf618351503d8f39e23fee80a66892fee", "max_stars_repo_licenses": ["BSD-3-Clause... |
from __future__ import print_function
from __future__ import division
from past.utils import old_div
import numpy as np
from proteus import Domain
from proteus.mprans import SpatialTools as st
from proteus.mbd import CouplingFSI as fsi
import pychrono as chrono
from proteus.TwoPhaseFlow import TwoPhaseFlowProblem as tp... | {"hexsha": "ad616e58d630573958a2787edb7cc9b41b25850f", "size": 4673, "ext": "py", "lang": "Python", "max_stars_repo_path": "proteus/tests/AddedMass/addedmass3D.py", "max_stars_repo_name": "cekees/proteus", "max_stars_repo_head_hexsha": "11d8749e04f0950f090d1a406243539a868be642", "max_stars_repo_licenses": ["MIT"], "max... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Oct 19 14:21:10 2020
Copyright 2020 by Hadrien Montanelli.
"""
# %% Imports.
# Standard library imports:
import matplotlib.pyplot as plt
import numpy as np
# Learnpy imports:
from learnpy.misc import csv_to_array
from learnpy.timeseries import arp
# ... | {"hexsha": "90e4d58a7b0cd55609ba1ed1c9049850dabf310d", "size": 1035, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/timeseries/example_arp.py", "max_stars_repo_name": "Hadrien-Montanelli/learnpy", "max_stars_repo_head_hexsha": "b9fedb903cfe8c2fff8d7706667f17c51fb3a34f", "max_stars_repo_licenses": ["MIT... |
import re
import math
import numpy as np
from collections import defaultdict
from nltk.corpus import wordnet as wn
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.metrics.pairwise import cosine_similarity
THRESHOLD = 0.45
class Similarity:
"""
Document Similarity Measure class imp... | {"hexsha": "4789fe3e12941a90a39645bf28f91bec48efa1c0", "size": 8075, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/calculate_similarity.py", "max_stars_repo_name": "santels/twitter_topic_detection", "max_stars_repo_head_hexsha": "543673a610dd69ff98120dd3141f9d9a9f5364ad", "max_stars_repo_licenses": ["MIT"]... |
[STATEMENT]
lemma con_compI [intro]:
assumes "composable t u" and "w \\ t \<frown> u"
shows "w \<frown> t \<cdot> u" and "t \<cdot> u \<frown> w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. w \<frown> t \<cdot> u &&& t \<cdot> u \<frown> w
[PROOF STEP]
using assms con_comp_iff con_sym
[PROOF STATE]
proof ... | {"llama_tokens": 263, "file": "ResiduatedTransitionSystem_ResiduatedTransitionSystem", "length": 2} |
! def_collection_file.f90 --
! Use a hypothetical extension to the Fortran syntax to make using templates
! easier
!
! Some practical difficulties:
! - a flexible-length string: how to do that? Similarly for any "compound" basic type
! - using "implicit none" in a template
!
template collect... | {"hexsha": "4979a3d8718afafdf478299c93395c0912a64766", "size": 7097, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "experiments/generics/def_collection_file.f90", "max_stars_repo_name": "timcera/flibs_from_svn", "max_stars_repo_head_hexsha": "7790369ac1f0ff6e35ef43546446b32446dccc6b", "max_stars_repo_licenses... |
#coding:utf8
'''
将embedding.txt 转成numpy矩阵
'''
import word2vec
import numpy as np
def main(em_file, em_result):
'''
embedding ->numpy
'''
em = word2vec.load(em_file)
vec = (em.vectors)
word2id = em.vocab_hash
# d = dict(vector = vec, word2id = word2id)
# t.save(d,em_result)
np.sav... | {"hexsha": "797ec03737b6473300d221af45cfef214422759a", "size": 431, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/data_process/embedding2matrix.py", "max_stars_repo_name": "phasorhand/PyTorchText", "max_stars_repo_head_hexsha": "dcadcba44af0c3731b82d9db1c77f2968d4feac0", "max_stars_repo_licenses": ["MI... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 22 14:44:17 2019
@author: mavro
"""
#%%
import numpy as np
import matplotlib.pyplot as plt
#%%
np.random.seed(0)
ploty=np.linspace(0,719,num=720)
quadratic_coeff=3e-4
leftx=np.array([200+(y**2)*quadratic_coeff\
+np.random.randin... | {"hexsha": "8e70c7c8ef945788b0692bc29944851aeecb87d1", "size": 1340, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/fake_data.py", "max_stars_repo_name": "mavro10600/CarND-Advanced-Lane-Lines", "max_stars_repo_head_hexsha": "8713256075c0550974af6722187b0b6dec572f8c", "max_stars_repo_licenses": ["MIT"],... |
#include <boost/spirit/repository/home/qi/nonterminal/subrule.hpp>
| {"hexsha": "2c0e3f9b742df61cec1963e5b8c3aaa37b5042e5", "size": 67, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "src/boost_spirit_repository_home_qi_nonterminal_subrule.hpp", "max_stars_repo_name": "miathedev/BoostForArduino", "max_stars_repo_head_hexsha": "919621dcd0c157094bed4df752b583ba6ea6409e", "max_stars_r... |
/-
Copyright (c) 2019 Floris van Doorn. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Floris van Doorn
! This file was ported from Lean 3 source module data.real.cardinality
! leanprover-community/mathlib commit 7e7aaccf9b0182576cabdde36cf1b5ad3585b70d
! Please do no... | {"author": "leanprover-community", "repo": "mathlib3port", "sha": "62505aa236c58c8559783b16d33e30df3daa54f4", "save_path": "github-repos/lean/leanprover-community-mathlib3port", "path": "github-repos/lean/leanprover-community-mathlib3port/mathlib3port-62505aa236c58c8559783b16d33e30df3daa54f4/Mathbin/Data/Real/Cardinali... |
//---------------------------------------------------------------------------//
// Copyright (c) 2018-2020 Mikhail Komarov <nemo@nil.foundation>
//
// Distributed under the Boost Software License, Version 1.0
// See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt
//-----------------... | {"hexsha": "2ea16ea82ff1372d9df769936bd418e6918b2d4e", "size": 897, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "include/boost/crypto3/block/aes.hpp", "max_stars_repo_name": "NilFoundation/boost-crypto", "max_stars_repo_head_hexsha": "a3e599b780bbbbc063b7c8da0e498125769e08be", "max_stars_repo_licenses": ["BSL-1... |
import numpy as np
import nibabel as nib
import pandas as pd
import os
import tensorflow as tf
import math
from neuron.layers import SpatialTransformer
from multi_affine.datagenerators import indicator, give_index_atlas
from multi_affine.utils import load_multi_atlas
from pandas import ExcelWriter
def eval_affine(data... | {"hexsha": "fa0359d25a66b8abe356c2a96b8847d63149c7db", "size": 10369, "ext": "py", "lang": "Python", "max_stars_repo_path": "multi_affine/eval.py", "max_stars_repo_name": "wapbastiaansen/multi-atlas-seg-reg", "max_stars_repo_head_hexsha": "6d406fcabf24aa4393e602dc4bb947c670731da9", "max_stars_repo_licenses": ["Apache-2... |
// ------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License (MIT). See License.txt in the repo root for license information.
// ------------------------------------------------------------
#include "stdafx.h"
#include ... | {"hexsha": "bd7cc0f1ba0e4fa5ff8ff38c591a885cafb12f92", "size": 2813, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "src/prod/src/query/QueryAddress.Test.cpp", "max_stars_repo_name": "vishnuk007/service-fabric", "max_stars_repo_head_hexsha": "d0afdea185ae932cc3c9eacf179692e6fddbc630", "max_stars_repo_licenses": ["... |
function affordable_real(
irreducible_characters,
multiplicities=fill(1, length(irreducible_characters)),
)
irr_real = similar(irreducible_characters, 0)
mls_real = similar(multiplicities, 0)
for (i, χ) in pairs(irreducible_characters)
ι = Characters.frobenius_schur(χ)
if abs(ι) == 1... | {"hexsha": "8dc42f4ad09af5d632f249dfc0306cdc30b19acf", "size": 8420, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/sa_basis.jl", "max_stars_repo_name": "kalmarek/SymbolicWedderburn.jl", "max_stars_repo_head_hexsha": "9e23b8f8ccbee6a55e7afe952961f80cc1fbc124", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
function SynchronizedRandomGenerator(arg0::RandomGenerator)
return SynchronizedRandomGenerator((RandomGenerator,), arg0)
end
function next_boolean(obj::SynchronizedRandomGenerator)
return jcall(obj, "nextBoolean", jboolean, ())
end
function next_bytes(obj::SynchronizedRandomGenerator, arg0::Vector{jbyte})
... | {"hexsha": "cae7c839aab162a2def1936ed03dab2245f129af", "size": 1748, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "gen/HipparchusWrapper/RandomWrapper/synchronized_random_generator.jl", "max_stars_repo_name": "JuliaAstrodynamics/Orekit.jl", "max_stars_repo_head_hexsha": "e2dd3d8b2085dcbb1d2c75471dab42d6ddf52c99... |
"""
Test suite to verify the output integrity of VORONOI
TODO: check LaGriT output
"""
import subprocess
import unittest
import numpy as np
import os
import filecmp
import sys
import argparse
import h5py
# Test diagnostics on/off and all flag permutations
params = {
"voronoi_exe": "../../src/voronoi",
"us... | {"hexsha": "f28a5ed96af2d9cea68c1f756a5ff4150ca2c42a", "size": 13974, "ext": "py", "lang": "Python", "max_stars_repo_path": "test/sanity_check/run_tests.py", "max_stars_repo_name": "daniellivingston/voronoi", "max_stars_repo_head_hexsha": "1c109b38b2fcbfac601d635d105674533c2a4204", "max_stars_repo_licenses": ["BSD-3-Cl... |
import requests
from src.constants import ONCOKB_API_KEY, MAF_COLUMNS,THERAPEUTIC_COLUMNS,DEVELOPMENT_MODE
import pandas as pd
import types
import numpy as np
def ontology_classes(onto):
classes = []
for i in list(onto.classes()):
classes.append((str(i)[5:]))
for i in list(onto.individuals()):
classes.append((... | {"hexsha": "b43a887c76b8c47e0f0cd97c7b08c95877e627d6", "size": 12532, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/generate_data.py", "max_stars_repo_name": "jmichuda/bmi-214-final-project", "max_stars_repo_head_hexsha": "84e270c388f1f43939d3b0de51b370c7ce31277b", "max_stars_repo_licenses": ["MIT"], "max_... |
import sys
import types
import itertools
import numpy as np
import sympy as sp
from line_profiler import LineProfiler
profile = LineProfiler()
# _c_...: class attr must be set at class def
# _i_...: must be set at init
# _a_...: will be computed automatically and validated lazily and cached
abbreviations = {
... | {"hexsha": "d4fae792c6d20db9d4424b21acf65c1b8ff7d7dc", "size": 3433, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/responsibility/core.py", "max_stars_repo_name": "pik-gane/pyresponsibility", "max_stars_repo_head_hexsha": "e0f43be1a9712754832bb97b3797851cdb24842d", "max_stars_repo_licenses": ["BSD-2-Clause... |
module TestMOIwrapper
using CPLEX
using MathOptInterface
using Test
const MOI = MathOptInterface
const MOIT = MOI.Test
const MOIB = MOI.Bridges
const CONFIG = MOIT.TestConfig(basis = true)
const OPTIMIZER = CPLEX.Optimizer()
MOI.set(OPTIMIZER, MOI.Silent(), true)
# Turn off presolve reductions so CPLEX will genera... | {"hexsha": "84fc4c6dcc37160f8c30a434ac4fdfa18af73f80", "size": 29284, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/MathOptInterface/MOI_wrapper.jl", "max_stars_repo_name": "henriquebecker91/CPLEX.jl", "max_stars_repo_head_hexsha": "9f28588672c92b96b472653139c263246f0c2a01", "max_stars_repo_licenses": ["MI... |
[STATEMENT]
lemma lprefixes_chain:
"Complete_Partial_Order.chain (\<sqsubseteq>) {ys. lprefix ys xs}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. Complete_Partial_Order.chain (\<sqsubseteq>) {ys. ys \<sqsubseteq> xs}
[PROOF STEP]
by(rule chainI)(auto dest: lprefix_down_linear) | {"llama_tokens": 108, "file": "Coinductive_Coinductive_List", "length": 1} |
Require Import Fiat.BinEncoders.NoEnv.Specs
Fiat.BinEncoders.NoEnv.Libraries.BinCore.
Section BoolBinEncoder.
Definition Bool_encode_inner (b : bool) : bin_t := b :: nil.
Definition Bool_decode (b : bin_t) : bool * bin_t :=
match b with
| nil => (false, nil) (* bogus *)
| x :: xs => (x,... | {"author": "proofskiddie", "repo": "CoqStuff", "sha": "fc8ecdf8045bc835bb10b2e4791f041d82451b5d", "save_path": "github-repos/coq/proofskiddie-CoqStuff", "path": "github-repos/coq/proofskiddie-CoqStuff/CoqStuff-fc8ecdf8045bc835bb10b2e4791f041d82451b5d/idontevnkno/src/BinEncoders/NoEnv/Libraries/Bool.v"} |
from __future__ import print_function
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
class STN3d(nn.Module):
def __init__(self, num_points = 2048):
super(STN3d, self).__init__()
self.conv1 = nn.Conv1d(3, 64, 1)
self... | {"hexsha": "1996d3a42b6333c5a067cb6c125e21e265c853af", "size": 3241, "ext": "py", "lang": "Python", "max_stars_repo_path": "scene_seg/pointnet/models.py", "max_stars_repo_name": "scenenn/pointwise", "max_stars_repo_head_hexsha": "8ce1eeb73c3bfbd26e5a14d5c47fcdae163d4ed4", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
__author__ = 'Georgios Rizos (georgerizos@iti.gr)'
import argparse
import os
import numpy as np
from sklearn.multiclass import OneVsRestClassifier
from sklearn import svm
from reveal_user_classification.common import get_threads_number
from reveal_graph_embedding.datautil.score_rw_util import write_results
from revea... | {"hexsha": "9c7d90a83fac3f23883725607cdef972146ef892", "size": 10341, "ext": "py", "lang": "Python", "max_stars_repo_path": "reveal_user_classification/entry_points/prototype_user_network_profile_classifier.py", "max_stars_repo_name": "MKLab-ITI/reveal-user-classification", "max_stars_repo_head_hexsha": "4433e265ca6922... |
from __future__ import absolute_import
import pytest
import sagemaker
import os
from mock import (
Mock,
PropertyMock,
)
from sagemaker.processing import (
Processor,
ProcessingInput,
ScriptProcessor,
)
from botocore.exceptions import ValidationError
from sagemaker.network import NetworkConfig
... | {"hexsha": "5b6dab78ef455009a5297ae372a01e0753ba92e3", "size": 5730, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/unit/sagemaker/workflow/test_pipeline_validation.py", "max_stars_repo_name": "svia3/sagemaker-python-sdk", "max_stars_repo_head_hexsha": "5fec604481338511c5866422675b55439c72bf8f", "max_star... |
import pyzbar.pyzbar as pyzbar
import cv2
import numpy as np
import math
from shapely import geometry
import logging.config
from LabTable.TableOutputStream import TableOutputStream, TableOutputChannel
from LabTable.ExtentTracker import ExtentTracker
from LabTable.Model.Extent import Extent
from LabTable.Model.Board im... | {"hexsha": "26cd0d7994c9bee9daaabfe82adb1e08c3cc49fa", "size": 15710, "ext": "py", "lang": "Python", "max_stars_repo_path": "LabTable/BrickDetection/BoardDetector.py", "max_stars_repo_name": "boku-ilen/legoboard", "max_stars_repo_head_hexsha": "ec9bcd6467b83f7bc873639911480d65caf2f813", "max_stars_repo_licenses": ["MIT... |
/-
Copyright (c) 2020 Johan Commelin. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johan Commelin
-/
import topology.opens
import ring_theory.ideal.prod
import ring_theory.ideal.over
import linear_algebra.finsupp
import algebra.punit_instances
/-!
# Prime spectrum o... | {"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/algebraic_geometry/prime_spectrum/bas... |
module JungleHelperSwingCassetteBlock
using ..Ahorn, Maple
@mapdef Entity "JungleHelper/SwingCassetteBlock" SwingCassetteBlock(x::Integer, y::Integer, width::Integer=Maple.defaultBlockWidth, height::Integer=Maple.defaultBlockHeight, index::Integer=0, tempo::Number=1.0)
const colorNames = Dict{String, Int}(
... | {"hexsha": "c226034f4912c5088af4d5d65fabe63b9a177a52", "size": 5662, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "Ahorn/entities/swingCassetteBlock.jl", "max_stars_repo_name": "Jackal-Celeste/JungleHelper", "max_stars_repo_head_hexsha": "c98f58b78c2c1855556d556b86e0959199ab2db7", "max_stars_repo_licenses": ["M... |
[STATEMENT]
lemma Spy_see_priK [simp]:
"evs \<in> zg ==> (Key (priK A) \<in> parts (spies evs)) = (A \<in> bad)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. evs \<in> zg \<Longrightarrow> (Key (priEK A) \<in> parts (knows Spy evs)) = (A \<in> bad)
[PROOF STEP]
apply (erule zg.induct)
[PROOF STATE]
proof (pro... | {"llama_tokens": 1485, "file": null, "length": 3} |
"""
Tests on matrix multiply. As the underlying code is now playing with
the TRANSA TRANSB parameters to minimize copying, several tests are
needed to make sure that all cases are handled correctly as its logic
is rather complex.
"""
from __future__ import print_function
from unittest import TestCase, skipIf, skip
imp... | {"hexsha": "26949ac7866bc3a72d663493cae76ba3d58e59f2", "size": 21653, "ext": "py", "lang": "Python", "max_stars_repo_path": "gulinalg/tests/test_matrix_multiply.py", "max_stars_repo_name": "grlee77/gulinalg", "max_stars_repo_head_hexsha": "21c62eaa7d3777a3bf7fa58c66d084af7c4d5579", "max_stars_repo_licenses": ["BSD-2-Cl... |
#!/usr/bin/env python
#
# Copyright (c) 2014 10X Genomics, Inc. All rights reserved.
#
import os
# 10X chemistry types
GEMCODE = 'GemCode'
CHROMIUM = 'Chromium'
# Mass of 1 bp in nanograms
NG_PER_BP = 1.1454e-12
# Where the code sits
CODE_PATH=os.path.dirname(os.path.abspath(__file__)) + '/'
# Where barcode white... | {"hexsha": "d2f99762437f5c1e076e47c7ba3a173003bec799", "size": 55723, "ext": "py", "lang": "Python", "max_stars_repo_path": "emptydrops/constants.py", "max_stars_repo_name": "nh3/emptydrops", "max_stars_repo_head_hexsha": "02448048371ddc4e20a691b7a21b9222bcfac67d", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
import os, json
import config
import numpy as np
import pandas as pd
from datetime import datetime
from pathlib import Path
class Postor(config.Config):
"""
Create a new postor
"""
def __init__(self, hub_path):
super(Postor, self).__init__()
self.hub_path = hub_path
def merger(self, new_path, out_name = '... | {"hexsha": "9b7ad98e41280dacbdff14e258b300919af0cdc2", "size": 3748, "ext": "py", "lang": "Python", "max_stars_repo_path": "agrspy/envspy-histaqi/codes/postproc.py", "max_stars_repo_name": "soonyenju/agrspy", "max_stars_repo_head_hexsha": "1c5d11d48933f7392d2246fda487256d5cd5b239", "max_stars_repo_licenses": ["MIT"], "... |
"""STOCHASTIC ROSS plotting module.
This module returns graphs for each type of analyses in st_rotor_assembly.py.
"""
import bokeh.palettes as bp
import matplotlib.pyplot as plt
import numpy as np
from bokeh.layouts import gridplot
from bokeh.plotting import figure
from matplotlib import cm
# set bokeh palette of col... | {"hexsha": "addf19e8035d91bcec7e0a8a77c3e250a3fc9c28", "size": 41078, "ext": "py", "lang": "Python", "max_stars_repo_path": "ross/stochastic/st_results.py", "max_stars_repo_name": "PedroBernardino/ross", "max_stars_repo_head_hexsha": "d8b74aa97b0a02108e15c316b8202964b2f7a532", "max_stars_repo_licenses": ["MIT"], "max_s... |
import numpy as np
import requests
import pandas as pd
import os
from bs4 import BeautifulSoup as BS
def search(string,start="", end=""):
lstart=len(start)
lend=len(end)
startpoint=endpoint=0
for i in range(len(string)):
if string[i:i+lstart]==start:
startpoint=i+lstart
for i i... | {"hexsha": "fcc19fb875e14db97c576eac2c4a66f2cc91f346", "size": 3354, "ext": "py", "lang": "Python", "max_stars_repo_path": "Web2csv.py", "max_stars_repo_name": "aoaaceai/CompAssistant", "max_stars_repo_head_hexsha": "727833926a9cbae15a4def32d8731c7f23b5fdd7", "max_stars_repo_licenses": ["BSD-2-Clause"], "max_stars_coun... |
# Pytest customization
from __future__ import division, absolute_import, print_function
import os
import pytest
import warnings
from distutils.version import LooseVersion
from scipy._lib._fpumode import get_fpu_mode
from scipy._lib._testutils import FPUModeChangeWarning
def pytest_configure(config):
config.addi... | {"hexsha": "736e88aa38f5eb0336cd318cee7aac144c45731b", "size": 1407, "ext": "py", "lang": "Python", "max_stars_repo_path": "scipy/conftest.py", "max_stars_repo_name": "gitter-badger/scipy", "max_stars_repo_head_hexsha": "0d10fea581d5044bbecc8b4fbe8c11fc102f6592", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_... |
#!/usr/bin/env python
from __future__ import print_function
import jinja2
import argparse
import cv2
import os
import fnmatch
import numpy as np
import rospkg
import numpy as np
import pylab as pl
import scipy
from scipy import interpolate
if __name__ == "__main__":
parser = argparse.ArgumentParser()
# parse... | {"hexsha": "ce9d10280ddd9ca8c1f88cd1e5f999c3d327e2bc", "size": 2207, "ext": "py", "lang": "Python", "max_stars_repo_path": "models/stadium/stadium.sdf.py", "max_stars_repo_name": "dronecrew/gazebo_fla", "max_stars_repo_head_hexsha": "ae4310a62a52e013674895f89fbef3ca8d121e21", "max_stars_repo_licenses": ["BSD-3-Clause"]... |
\documentclass{beamer}
\usepackage{beamerthemevictor,comment,verbatim,graphicx,amssymb}
\usepackage[noeepic]{qtree}
\input{tutmacs}
\input{slidemacs}
\input idxmacs
\begin{document}
\title{Parsing}
\author{Victor Eijkhout}
\date{Notes for CS 594 -- Fall 2004}
\frame{\titlepage}
\section{Introduction}
\frame[cont... | {"hexsha": "9928d7a3543550607d11432c4008c5c0ee9c4018", "size": 38265, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "slides/parsing.tex", "max_stars_repo_name": "wvqusrai/the-science-of-tex-and-latex", "max_stars_repo_head_hexsha": "a96fd5cd0f7a6b9208675ba38ddcaec0264a9e31", "max_stars_repo_licenses": ["CC-BY-3.0... |
# 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 applica... | {"hexsha": "6a672a4e442f6e37b0dac6adb421f03934a13267", "size": 2044, "ext": "py", "lang": "Python", "max_stars_repo_path": "practice/courses/dlaicourse-master/TensorFlow Deployment/Course 2 - TensorFlow Lite/Week 4/Exercise/TFLite_Week4_Exercise_Answer.py", "max_stars_repo_name": "ItamarRocha/AI", "max_stars_repo_head_... |
*###[ ffxdb1:
subroutine ffxdb1(cdb1, p, m1, m2, ier)
***#[*comment:***********************************************************
* *
* DB1 function (derivative of B1) *
* *
* algorithm adapted from Ansgar Denner's bcanew.f *
* *
***#]*comment:***********************************************... | {"hexsha": "c7d68cb9b7a98a70e37a5f0b16fec2470ce03b63", "size": 5277, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "Tauola1_1_5/SANC/LoopTools-2.1/ff/ffxdb1.f", "max_stars_repo_name": "klendathu2k/StarGenerator", "max_stars_repo_head_hexsha": "7dd407c41d4eea059ca96ded80d30bda0bc014a4", "max_stars_repo_licenses"... |
push!(LOAD_PATH,"../src/")
using Documenter
using DocumenterCitations
using Plots
using HOODESolver
ENV["GKSwstype"] = "100"
bib = CitationBibliography(joinpath(@__DIR__, "references.bib"))
makedocs(
bib,
sitename = "HOODESolver.jl",
authors="Yves Mocquard",
format=Documenter.HTML(;
prettyur... | {"hexsha": "d9ff0819f47f608cfdfaf83007ccab6eda03f09c", "size": 1044, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "docs/make.jl", "max_stars_repo_name": "crouseilles/HOODESolver.jl", "max_stars_repo_head_hexsha": "c9087aaf35b7469839a47131c63489759e9da69e", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
#!/usr/bin/env python
import re
import numpy as np
import pandas as pd
from pd_validator.validator import *
def _fmt_inval_rpt(df, col, schema, invals):
"""
Format rpt rows for column values that violate
schema rules.
Parameters
----------
df : pd.DataFrame
col : str
pd.DataFrame... | {"hexsha": "28e5bedba534e0ed025e6add295511d760f7c276", "size": 4919, "ext": "py", "lang": "Python", "max_stars_repo_path": "pd_validator/report.py", "max_stars_repo_name": "nrbontha/df-validator", "max_stars_repo_head_hexsha": "3d9b09bbc7f83f65b486bb84b91164b22f715297", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
"""
The MIT License (MIT)
Copyright (c) 2021 NVIDIA
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, publi... | {"hexsha": "0adb617c4b707520ac14f7806f9b2da67b64c4cf", "size": 9007, "ext": "py", "lang": "Python", "max_stars_repo_path": "pt_framework/c17e3_multi_modal_multi_task.py", "max_stars_repo_name": "jpgacrama/DeepLearning", "max_stars_repo_head_hexsha": "db0f7edc918d28d330f4926ef1961dbd01ec9012", "max_stars_repo_licenses":... |
import pandas as pd
import seaborn as sns
import numpy as np
from indp import *
import os.path
import operator
import networkx as nx
from infrastructure import *
from indputils import *
import copy
from gurobipy import *
import itertools
import scipy
import sys
def run_judgment_call(params,layers,T=1,saveJC=True,print... | {"hexsha": "9f9bc12fdecde6bc96b659401d996e95a596ae5a", "size": 47129, "ext": "py", "lang": "Python", "max_stars_repo_path": "codes/Archive/Dindp_old_synthetic_nets.py", "max_stars_repo_name": "htalebiyan/Dec2py", "max_stars_repo_head_hexsha": "8c4181eb92d6e52aef8cc804c485865516cee200", "max_stars_repo_licenses": ["MIT"... |
import numpy as np
from sklearn.base import TransformerMixin, BaseEstimator, clone
from sklearn.linear_model import LogisticRegression
from mne.parallel import parallel_func
from nose.tools import assert_true
class _BaseEstimator(BaseEstimator, TransformerMixin):
def fit(self, X, y=None):
return self
... | {"hexsha": "b47764e575cf6c12e504f8ca0e52b1b67a83a41d", "size": 14857, "ext": "py", "lang": "Python", "max_stars_repo_path": "jr/gat/transformers.py", "max_stars_repo_name": "kingjr/jr-tools", "max_stars_repo_head_hexsha": "8a4c9c42a9e36e224279566945e798869904c4c8", "max_stars_repo_licenses": ["BSD-2-Clause"], "max_star... |
{-# OPTIONS --universe-polymorphism #-}
module Categories.Free where
open import Categories.Category
open import Categories.Free.Core
open import Categories.Free.Functor
open import Categories.Graphs.Underlying
open import Categories.Functor
using (Functor)
open import Graphs.Graph
open import Graphs.GraphMorphism
... | {"hexsha": "acd1abd5288a6e060bb1dd458367fb0ca822a1ba", "size": 2205, "ext": "agda", "lang": "Agda", "max_stars_repo_path": "Categories/Free.agda", "max_stars_repo_name": "copumpkin/categories", "max_stars_repo_head_hexsha": "36f4181d751e2ecb54db219911d8c69afe8ba892", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_st... |
//from: "c:\cpp\boost_1_68_0\boost/spirit/home/x3\support\traits\attribute_of.hpp"
/*=============================================================================
Copyright (c) 2001-2014 Joel de Guzman
Copyright (c) 2013 Agustin Berge
http://spirit.sourceforge.net/
Distributed under the Boost Softwar... | {"hexsha": "4165dada8ff1a84e318c9e89bcc71dfe1f1bc653", "size": 2583, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "x3/support/traits/attribute_of.hpp", "max_stars_repo_name": "lakeweb/bxlreader", "max_stars_repo_head_hexsha": "9b99d79f1bac3747a9e3bb51d0ffd0004ef32f73", "max_stars_repo_licenses": ["MIT"], "max_st... |
import numpy as np
import matplotlib.pyplot as plt
ar = 0.9
br = 0.04
cr = -2
dr = 1
au = 0.1
bu = 0.02
cu = 1
du = 1
av = 0.05
bv = -0.1
cv = 0.7
dv = 1.3
#av = 0.05
#bv = 0.1
#cv = 0.7
#dv = 1.3
#av = 0.1
#bv = 0.02
#cv = 1
#dv = 1
ap = 1
bp = 0.05
cp = 2
dp = -1
def rho_a(x, y):
return ar + br*np.sin(cr*x + dr... | {"hexsha": "3a433e25a62c519722f75d8d7a91cd620f35bb8f", "size": 2033, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/python/PlotUtils.py", "max_stars_repo_name": "Rob-Rau/EbbCFD", "max_stars_repo_head_hexsha": "093a562920039754f6f59c0966b4820329e6ad38", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
import os
import numpy as np
import tensorflow as tf
import scipy.io as sio
from open3d import *
import random
from tf_ops.nn_distance import tf_nndistance
import time
import pdb
if __name__ == '__main__':
os.environ['CUDA_VISIBLE_DEVICES'] = "0"
# view num
#view_num = 33
view_num = 40
# pa... | {"hexsha": "ea232457a01b2ddd7e03372a5998c06f8bc862d4", "size": 2196, "ext": "py", "lang": "Python", "max_stars_repo_path": "PC-NBV/Permutation_Outputs_synthetic_40.py", "max_stars_repo_name": "tamaslevente/trai", "max_stars_repo_head_hexsha": "4bf68463b941f305d9b25a9374b6c2a2d51a8046", "max_stars_repo_licenses": ["MIT"... |
import sys
import time
import numpy as np
import readers.utils as utils
from readers.Mention import Mention
from readers.config import Config
from readers.vocabloader import VocabLoader
import ccg_nlpy
from ccg_nlpy.core.text_annotation import TextAnnotation
start_word = "<s>"
end_word = "<eos>"
# Reader for Text Ann... | {"hexsha": "d2ed50c0fd3a69a8e92a72f4b1e7bc27c33602df", "size": 17058, "ext": "py", "lang": "Python", "max_stars_repo_path": "readers/textanno_test_reader.py", "max_stars_repo_name": "EntilZha/neural-el", "max_stars_repo_head_hexsha": "bab6659e1653909d911201cf33b340616cc59b99", "max_stars_repo_licenses": ["Apache-2.0"],... |
module SCF
#Julia Libraries/Modules
using Printf
using LinearAlgebra
#LearnHatreeFock.jl Modules
using TypesBasis,TypesParticles
using CoulombExchange
export runscf
@doc raw"""
function scf()
description: Self-consistent field soultion approach.
The Hatree-Fock operator for non-interacting electrons in an orthono... | {"hexsha": "6c7d53b2c54ab93cd890e17f06f0d382fedfc420", "size": 6057, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/SCF.jl", "max_stars_repo_name": "JuliaMatSci/LearnHartreeFock.jl", "max_stars_repo_head_hexsha": "ff91cff63d6ae4039b26b864f14fd86743ae6037", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
[STATEMENT]
lemma rec_unique:
"f \<circ> ctor1 = s1 \<circ> F1map id <id , f> <id , g> \<Longrightarrow>
g \<circ> ctor2 = s2 \<circ> F2map id <id , f> <id , g> \<Longrightarrow> f = rec1 s1 s2 \<and> g = rec2 s1 s2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<lbrakk>f \<circ> ctor1 = s1 \<circ> F1map id ... | {"llama_tokens": 1250, "file": "BNF_Operations_LFP", "length": 6} |
struct ScratchThermalGlobal{T}
ndim::T # model dimension
nvert::T # number of vertices per element
nnodel::T # number of nodes per element
nel::T # number of elements
nip::T # number of vertices per element
end
struct ShapeFunctionsThermal{T}
N::Vector{SMatrix{1,6,T,6}}
∇N::Vector{SMatrix{2... | {"hexsha": "3ca0b09e96f26dae869795fa99d034a0979d88f4", "size": 7420, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/Algebra/Quadrature.jl", "max_stars_repo_name": "albert-de-montserrat/Persephone", "max_stars_repo_head_hexsha": "ddd4a7029be0fa5d5cb9c9914023fe3a6fbb1907", "max_stars_repo_licenses": ["MIT"], "... |
#!/usr/bin/env python
# Copyright 2014 Open Connectome Project (http://openconnecto.me)
#
# 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
#
#... | {"hexsha": "a5bf09869c85b8594b0ba03dd551ace04cf62aec", "size": 2409, "ext": "py", "lang": "Python", "max_stars_repo_path": "MR-OCP/mrcap/atlas.py", "max_stars_repo_name": "justi/m2g", "max_stars_repo_head_hexsha": "09e8b889889ee8d8fb08b9b6fcd726fb3d901644", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count": ... |
"""
Copyright (c) 2004-2016 Zementis, Inc.
Copyright (c) 2016-2021 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or its
SPDX-License-Identifier: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with t... | {"hexsha": "97b8de4846494dc70b7b08b482794398094af344", "size": 9173, "ext": "py", "lang": "Python", "max_stars_repo_path": "nyoka/statsmodels/exponential_smoothing.py", "max_stars_repo_name": "vishalbelsare/nyoka", "max_stars_repo_head_hexsha": "c08e83db2863a963d586b5853b82ef9d8cf799b2", "max_stars_repo_licenses": ["Ap... |
clear all; close all; clc
n=100;
L=20; x=linspace(-L,L,n); y=x;
[X,Y]=meshgrid(x,y);
Xd=[];
for j=1:100
u=tanh(sqrt(X.^2+Y.^2)).*cos(angle(X+i*Y)-(sqrt(X.^2+Y.^2))+j/10);
f=exp(-0.01*(X.^2+Y.^2));
uf=u.*f;
Xd(:,j)=reshape(uf,n^2,1);
pcolor(x,y,uf), shading interp, colormap(hot), caxis([-1 1]), drawnow
end
%%
[U,S... | {"author": "dynamicslab", "repo": "databook_matlab", "sha": "d390d39d18489a4804ee87a143ae8db8a1f3010b", "save_path": "github-repos/MATLAB/dynamicslab-databook_matlab", "path": "github-repos/MATLAB/dynamicslab-databook_matlab/databook_matlab-d390d39d18489a4804ee87a143ae8db8a1f3010b/CH12/old_extra/POD_invariance.m"} |
[STATEMENT]
lemma all_irr_GIrrRep_repset :
assumes "of_nat (card G) \<noteq> (0::'f::field)"
shows "\<forall>U\<in>(GIrrRep_repset::('f,'g) aezfun set set).
IrrFinGroupRepresentation G (*) U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<forall>U\<in>GIrrRep_repset. IrrFinGroupRepresentation G (... | {"llama_tokens": 833, "file": "Rep_Fin_Groups_Rep_Fin_Groups", "length": 8} |
from pymoo.util.termination.max_eval import MaximumFunctionCallTermination
try:
from scipy.optimize import minimize as scipy_minimize, NonlinearConstraint, LinearConstraint
except:
raise Exception("Please install SciPy: pip install scipy")
import warnings
import numpy as np
from pymoo.algorithms.base.local ... | {"hexsha": "7c23c8019a70a632abe754a6f5867488f1fc7d55", "size": 6892, "ext": "py", "lang": "Python", "max_stars_repo_path": "pymoo/vendor/vendor_scipy.py", "max_stars_repo_name": "jarreguit/pymoo", "max_stars_repo_head_hexsha": "0496a3c6765826148d8bab21650736760517dd25", "max_stars_repo_licenses": ["Apache-2.0"], "max_s... |
using ClobberingReload
using Base.Test
cp("F1.jl", "F.jl", remove_destination=true)
push!(LOAD_PATH, dirname(Base.source_path()))
@ausing AA
@ausing DD
@ausing BB <: (AA, DD)
@test something == "happy"
@test likes == "happy banana cards"
cp("F2.jl", "F.jl", remove_destination=true)
# ... This is kinda silly, but:... | {"hexsha": "9ed8ca4630b3ddbdb026ec963a44d38c9e01c0f4", "size": 887, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/runtests.jl", "max_stars_repo_name": "UnofficialJuliaMirror/ClobberingReload.jl-0d51577d-51b9-51d5-9c9b-f56d3e616bfa", "max_stars_repo_head_hexsha": "c42b0d5462badae070bae3b22450b3d91b21adde", ... |
[GOAL]
V : Type u
G : SimpleGraph V
M✝ M : Subgraph G
h : IsMatching M
v w : V
hv : v ∈ M.verts
hvw : Adj M v w
⊢ toEdge h { val := v, property := hv } = { val := Quotient.mk (Sym2.Rel.setoid V) (v, w), property := hvw }
[PROOFSTEP]
simp only [IsMatching.toEdge, Subtype.mk_eq_mk]
[GOAL]
V : Type u
G : SimpleGraph V
M✝ ... | {"mathlib_filename": "Mathlib.Combinatorics.SimpleGraph.Matching", "llama_tokens": 2928} |
# coding=utf-8
# Copyright 2019 Gabriele Valvano
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | {"hexsha": "863130f8ae9986927406cce911625034bdce3e88", "size": 6391, "ext": "py", "lang": "Python", "max_stars_repo_path": "losses/general_adaptive_loss/utils.py", "max_stars_repo_name": "gvalvano/idas", "max_stars_repo_head_hexsha": "e1b112c8d0cd17b2b8486435dfe9de477bca2221", "max_stars_repo_licenses": ["Apache-2.0"],... |
# 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": "f4778468f3cbe18cb715785c3066204c533469c2", "size": 7025, "ext": "py", "lang": "Python", "max_stars_repo_path": "mindspore_rl/environment/gym_environment.py", "max_stars_repo_name": "mindspore-ai/reinforcement", "max_stars_repo_head_hexsha": "6a1c02f2f8dec0773dcd82ddb660856c6582cffb", "max_stars_repo_license... |
[STATEMENT]
lemma ta_nf_lang_complete:
assumes linear: "\<forall> l |\<in>| R. linear_term l"
and ground: "ground (t :: ('f, 'v) term)" and sig: "funas_term t \<subseteq> fset \<F>"
and nf: "\<And>C \<sigma> l. l |\<in>| R \<Longrightarrow> C\<langle>l\<cdot>\<sigma>\<rangle> \<noteq> t"
shows "t \<in... | {"llama_tokens": 1609, "file": "FO_Theory_Rewriting_Primitives_NF", "length": 12} |
#==============================================================================#
# ApplicationAutoScaling.jl
#
# This file is generated from:
# https://github.com/aws/aws-sdk-js/blob/master/apis/application-autoscaling-2016-02-06.normal.json
#=============================================================================... | {"hexsha": "77e2d0d66df14862c83a29a3e72ccc9dc8da652f", "size": 70702, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/ApplicationAutoScaling.jl", "max_stars_repo_name": "UnofficialJuliaMirror/AWSSDK.jl-0d499d91-6ae5-5d63-9313-12987b87d5ad", "max_stars_repo_head_hexsha": "85d61d0e02c66917795cc0f539ee7a8c76e2d1... |
#!python3
"""
Various utilities for working with Python and Matplotlib
"""
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import os
from math import ceil, sqrt
from skimage.io import imread
def show_images(images,titles=None):
"""Display a list of images"""
n_ims = len(images)
if ... | {"hexsha": "f14cf78130b63c45fa8968becbb0cd4d962abf9c", "size": 1892, "ext": "py", "lang": "Python", "max_stars_repo_path": "Python-Programming/utils_pyplot.py", "max_stars_repo_name": "clickok/Code-Snippets", "max_stars_repo_head_hexsha": "403796256a2ec1bd37b2deb4ce5052671a39048f", "max_stars_repo_licenses": ["MIT"], "... |
[STATEMENT]
lemma eadd_gfp_partial_function_mono [partial_function_mono]:
"\<lbrakk> monotone (fun_ord (\<ge>)) (\<ge>) f; monotone (fun_ord (\<ge>)) (\<ge>) g \<rbrakk>
\<Longrightarrow> monotone (fun_ord (\<ge>)) (\<ge>) (\<lambda>x. f x + g x :: enat)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<lbrakk>m... | {"llama_tokens": 265, "file": null, "length": 1} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.