text stringlengths 0 1.25M | meta stringlengths 47 1.89k |
|---|---|
#partition_compare.py
"""
Generate specific problem and generate
partitions using my own partition_suggestion.py
functions as well as using pymetis.
Try to see why one might be better than the other.
"""
import math
#import argparse
import numpy as np
NO_PYMETIS=0
try:
from pymetis import part_graph
except Imp... | {"hexsha": "db1bb17d5480c9bb972382576ba2cba244f50a43", "size": 7587, "ext": "py", "lang": "Python", "max_stars_repo_path": "python/partition_compare.py", "max_stars_repo_name": "stu314159/af_NFC", "max_stars_repo_head_hexsha": "c065a5abe3f4d7d56165112378e57300da4bb53c", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
using BinaryBuilder
include("../common.jl")
# Collection of sources required to build OpenBLAS
name = "OpenBLAS"
version = v"0.3.10"
sources = openblas_sources(version)
script = openblas_script()
platforms = openblas_platforms(;experimental=true)
products = openblas_products()
dependencies = openblas_dependencies()
... | {"hexsha": "c2eb758594e2e0310afee06196f43152de13907d", "size": 488, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "O/OpenBLAS/OpenBLAS@0.3.10/build_tarballs.jl", "max_stars_repo_name": "c42f/Yggdrasil", "max_stars_repo_head_hexsha": "56c7b2d5863178463166c33f08944391cdac0765", "max_stars_repo_licenses": ["MIT"], ... |
/-
Copyright (c) 2021 Eric Wieser. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Eric Wieser
-/
import algebra.triv_sq_zero_ext
/-!
# Dual numbers
> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
> Any changes to this file require a corresponding PR to mathlib4.
The dua... | {"author": "leanprover-community", "repo": "mathlib", "sha": "5e526d18cea33550268dcbbddcb822d5cde40654", "save_path": "github-repos/lean/leanprover-community-mathlib", "path": "github-repos/lean/leanprover-community-mathlib/mathlib-5e526d18cea33550268dcbbddcb822d5cde40654/src/algebra/dual_number.lean"} |
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from sklearn.metrics import average_precision_score
import sys
sys.path.append('..')
from models import r2plus1d18KeepTemp
from utils import torch_utils
class VideoOnsetNet(nn.Module):
# Video Onset detection network
def __in... | {"hexsha": "3f038e4567a1306cde09fc872eb58b1ad3a46a90", "size": 2354, "ext": "py", "lang": "Python", "max_stars_repo_path": "specvqgan/onset_baseline/models/video_onset_net.py", "max_stars_repo_name": "XYPB/SpecVQGAN", "max_stars_repo_head_hexsha": "ed3c0f86c41bc408824979305d9c4f6df0877973", "max_stars_repo_licenses": [... |
#Takes fasta file of sequences and makes histogram of GC contents
#Usage: python plotGC <sequences1.fasta> <sequences2.fasta>
import sys
from Bio import SeqIO
from Bio.SeqUtils import GC
import matplotlib.pyplot as plt
import numpy as np
def plotmultipleLength(fasta1, fasta2):
fasta1lengths = []
fasta2length... | {"hexsha": "e407ab0908f367789d1446ab752270f4eb888852", "size": 1365, "ext": "py", "lang": "Python", "max_stars_repo_path": "plotmultipleFastaLength.py", "max_stars_repo_name": "TaliaferroLab/AnalysisScripts", "max_stars_repo_head_hexsha": "3df37d2f8fca9bc402afe5ea870c42200fca1ed3", "max_stars_repo_licenses": ["MIT"], "... |
import torch
import random
import numpy as np
from tqdm import trange, tqdm
from torch_sparse import spmm
from texttable import Texttable
from appnp_layer import APPNPModel
class APPNPTrainer(object):
"""
Method to train PPNP/APPNP model.
"""
def __init__(self, args, graph, features, target):
"... | {"hexsha": "af4e202ad1e07aaf361d1c4b611594c49bdb560b", "size": 5286, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/appnp.py", "max_stars_repo_name": "thefr33radical/APPNP", "max_stars_repo_head_hexsha": "15ec5d0171137ad25069d81fd77c5a22a02d19c3", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null,... |
##############################################################################
#
# Unit tests for squeezing operation
# Convention: The squeezing unitary is fixed to be
# U(z) = \exp(0.5 (z^* \hat{a}^2 - z (\hat{a^\dagger}^2)))
# where \hat{a} is the photon annihilation operator.
#
#####################################... | {"hexsha": "685adbfb972c7f46da7e054787d43584a0de9965", "size": 5333, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_squeeze_operation.py", "max_stars_repo_name": "cgogolin/strawberryfields", "max_stars_repo_head_hexsha": "d7af185cad87b18fda4ba7c70f9af37796482c93", "max_stars_repo_licenses": ["Apache-... |
C Copyright(C) 2011-2017 National Technology & Engineering Solutions
C of 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, are permitted provid... | {"hexsha": "31a3cb5534f95ef3adaa1d35b616631751048761", "size": 7984, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "packages/seacas/applications/gen3d/g3_newxyz.f", "max_stars_repo_name": "mathstuf/seacas", "max_stars_repo_head_hexsha": "49b3466e3bba12ec6597e364ce0f0f149f9ca909", "max_stars_repo_licenses": ["BS... |
import torch
import numpy as np
# import h5py
from scipy.ndimage.interpolation import rotate
from pathlib import Path
import matplotlib.pyplot as plt
import cv2
import random
class CMPLoad(object):
def __init__(self, ori_path, crop_size=(256, 256)):
self.ori_paths = ori_path
self.crop_size = crop... | {"hexsha": "92b9374ce0ddd741aeecaf20a46e0a437e800591", "size": 3174, "ext": "py", "lang": "Python", "max_stars_repo_path": "utils/load_for_CMP.py", "max_stars_repo_name": "naivete5656/BFP", "max_stars_repo_head_hexsha": "74c5604a9ba4eaa3ec3e2c76ef5e1282d7d10f18", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 8... |
[STATEMENT]
lemma i_Exec_Stream_Acc_Output_drop: "
0 < k \<Longrightarrow>
i_Exec_Comp_Stream_Acc_Output k output_fun trans_fun input c \<Up> n =
i_Exec_Comp_Stream_Acc_Output k output_fun trans_fun (input \<Up> n) (
f_Exec_Comp trans_fun (input \<Down> n \<odot>\<^sub>f k) c)"
[PROOF STATE]
proof (prove)
goa... | {"llama_tokens": 260, "file": "AutoFocus-Stream_AF_Stream_Exec", "length": 1} |
-- This contains material which used to be in the Sane module, but is no
-- longer used. It is not junk, so it is kept here, as we may need to
-- resurrect it.
module Obsolete where
import Data.Fin as F
--
open import Data.Empty
open import Data.Unit
open import Data.Unit.Core
open import Data.Nat renaming (_⊔_ to _... | {"hexsha": "abc1fa9ad4c6b1fb3f374b9d446062292706775c", "size": 7445, "ext": "agda", "lang": "Agda", "max_stars_repo_path": "Univalence/OldUnivalence/Obsolete.agda", "max_stars_repo_name": "JacquesCarette/pi-dual", "max_stars_repo_head_hexsha": "003835484facfde0b770bc2b3d781b42b76184c1", "max_stars_repo_licenses": ["BSD... |
import numpy as np
import pandas as pd
from pandas_datareader import data
import tensorflow as tf
import matplotlib.pyplot as plt
import keras
from keras.layers import Input, Dense, Dropout, BatchNormalization
from keras.models import Model
from keras.callbacks import History, CSVLogger
"""
Created by Mohsen Nag... | {"hexsha": "f7210a7be7a7a9686e849af8805af4b5236ca87c", "size": 1558, "ext": "py", "lang": "Python", "max_stars_repo_path": "Code/finance.py", "max_stars_repo_name": "Naghipourfar/TraderBot", "max_stars_repo_head_hexsha": "2604c9df7af7394dfab6a54ea9a65a1b0df6a0ce", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
File = 'heatmap_data.txt'
DataW = 512
DataH = 512
SmoothWindowSize = 10
import matplotlib.pyplot as plt
import numpy as np
f = open(File, 'r')
data = [[0 for i in range(DataW)] for j in range(DataH)]
color = [[0 for i in range(DataW)] for j in range(DataH)]
for line in f:
point = line.split()
if len(point) == 4:
... | {"hexsha": "8ea227ea56460704ab36f3d75b288b029e933fea", "size": 695, "ext": "py", "lang": "Python", "max_stars_repo_path": "Viewer/HeatmapViewer.py", "max_stars_repo_name": "mrfreire/heatmap", "max_stars_repo_head_hexsha": "131decc091dc7c78a683078629fb3b7dbfb1d7b7", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
# author:charles
# datetime:18-10-11 下午8:28
# software:PyCharm
import component as ct
import numpy as np
import os
NUM_CLASS = 8
def static_data(dir):
tool = ct.InputData()
names = tool.load_subnames(dir)
for file_name in names:
file_pat... | {"hexsha": "44281065ef73856e324abf61b994b7b19e1feb15", "size": 1215, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/tools/statistic.py", "max_stars_repo_name": "zhearing/SqueezeSeg", "max_stars_repo_head_hexsha": "1c716bb536ed822e4574a249f55831ec37cfe881", "max_stars_repo_licenses": ["BSD-2-Clause"], "max_s... |
# -*- coding: utf-8 -*-
"""
Created on Sat Feb 29 01:27:06 2020
@author: Xavier de Labriolle, Antoine Bendimerad
Last edit : 29/02/2020
==============================================================================
Information :
This python script uses the spherical coordinates system :
r = ra... | {"hexsha": "fe3f6634c1bf98b71dfdba585b861d780fc77ba4", "size": 3666, "ext": "py", "lang": "Python", "max_stars_repo_path": "source/GH_display.py", "max_stars_repo_name": "TOLOSAT/gravimetry-payload", "max_stars_repo_head_hexsha": "0d8a24af1015a9e9bdc5231b51636152d2cc3dd6", "max_stars_repo_licenses": ["MIT"], "max_stars... |
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
import os
import datetime as dt
import numpy as np
import pandas as pd
import pytz
from netCDF4 import Dataset
from timezonefinder import TimezoneFinder
import aacgmv2
import traceback
import sys
sys.path.append(... | {"hexsha": "134c29e64b5827addb885302f9066d3c9ccc8d9e", "size": 15427, "ext": "py", "lang": "Python", "max_stars_repo_path": "code_rt_sd/expFlayer.py", "max_stars_repo_name": "shibaji7/Collaboration_NCAR", "max_stars_repo_head_hexsha": "c27e0ad8a1f0c6b2e66fa07e6cf57f98c4389899", "max_stars_repo_licenses": ["Apache-2.0"]... |
# Import the version
from version import __version__
#
#
import os
if os.environ.get("ASTROMODELS_DEBUG", None) is None:
from .sources.point_source import PointSource
from .sources.extended_source import ExtendedSource
from .sources.particle_source import ParticleSource
from .core.parameter import Pa... | {"hexsha": "d37e2b3502126137a4f6f4ddeef9c3d9529edae2", "size": 1167, "ext": "py", "lang": "Python", "max_stars_repo_path": "astromodels/__init__.py", "max_stars_repo_name": "BjoernBiltzinger/astromodels", "max_stars_repo_head_hexsha": "d94a3d3bc607def2b5e3cd145c3922e0a00a7b15", "max_stars_repo_licenses": ["BSD-3-Clause... |
SUBROUTINE LA_TEST_SSPEVD( JOBS, UPLO, N, AP, W, Z, LDZ, WORK, LWORK, IWORK, LIWORK, INFO )
!
! -- LAPACK95 interface driver routine (version 1.1) --
! UNI-C, Denmark;
! May 25, 1999
!
! .. Use Statements ..
USE LA_PRECISION, ONLY: WP => SP
USE F95_LAPACK, ONLY: LA_SPEVD
! .. Implicit Statement ..
I... | {"hexsha": "86e801c25209a88c388a2989012df22f6264d507", "size": 1725, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "TESTING/la_test_sspevd.f90", "max_stars_repo_name": "MattBurn/LAPACK95", "max_stars_repo_head_hexsha": "bcd9d4b706f4213a6a4c0ebb4521754ffeff3752", "max_stars_repo_licenses": ["BSD-3-Clause"], "m... |
import numpy as np
import torch
from sklearn.metrics import roc_auc_score, auc, precision_recall_curve
class Metric:
r"""
Base class for all metrics.
Metrics measure the performance during the training and evaluation.
Args:
target (str): name of target property
model_output (int, str... | {"hexsha": "765ad11eec6ef23132fa9958b1a1bd1879b1044e", "size": 12221, "ext": "py", "lang": "Python", "max_stars_repo_path": "nff/train/metrics.py", "max_stars_repo_name": "jkaraguesian/NeuralForceField", "max_stars_repo_head_hexsha": "4ca4f4c7edc0ed1f70952db9e42d8ef9bbe109d8", "max_stars_repo_licenses": ["MIT"], "max_s... |
"""
Copyright 2019 Anqi Fu, Junzi Zhang
This file is part of A2DR.
A2DR is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
A2DR is distribute... | {"hexsha": "31f16b18befa5ef555d5afae200c3f69ce94d9b2", "size": 3718, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/paper_examples/sparse_inv_cov_est.py", "max_stars_repo_name": "anqif/a2dr", "max_stars_repo_head_hexsha": "b101b13c17448f43c5c9bb3ec6bcdf18aca73a66", "max_stars_repo_licenses": ["Apache-2... |
'''
Created on May 12, 2019
@author: cef
'''
#===============================================================================
# IMPORT STANDARD MODS -------------------------------------------------------
#===============================================================================
import logging, os, time, re, ... | {"hexsha": "a0896b54518780f386e89004c184f10ae5a3e16b", "size": 71009, "ext": "py", "lang": "Python", "max_stars_repo_path": "canflood/model/sofda/fdmg/house.py", "max_stars_repo_name": "jdngibson/CanFlood", "max_stars_repo_head_hexsha": "37f738be6944ea6b68dfcffeee6b6ac6ff7eb8a0", "max_stars_repo_licenses": ["MIT"], "ma... |
# Copyright 2021 The Cirq Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | {"hexsha": "60a314189f207d1b65bdf8617fe44774e9c15279", "size": 4746, "ext": "py", "lang": "Python", "max_stars_repo_path": "cirq-core/cirq/ops/pauli_sum_exponential.py", "max_stars_repo_name": "LLcat1217/Cirq", "max_stars_repo_head_hexsha": "b88069f7b01457e592ad69d6b413642ef11a56b8", "max_stars_repo_licenses": ["Apache... |
#!/usr/bin/env python
"""Mixture of Gaussians, with block Gibbs for inference.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from time import time
import edward as ed
import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
from edw... | {"hexsha": "f31e6cb0ac11a8400970bf832983575873533b17", "size": 2705, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/mixture_gaussian_gibbs.py", "max_stars_repo_name": "xiangze/edward", "max_stars_repo_head_hexsha": "6419751d1d849c84c502e5ff3f7249b9bbc7b3aa", "max_stars_repo_licenses": ["Apache-2.0"], "... |
import pickle
import cv2
import numpy as np
from sklearn.cluster import KMeans
from Board import Board
from util import *
from copy import deepcopy
def preprocess_frame (frame):
return frame [(frame.shape[0]/2):, :]
def annotate_image (image, km):
km_image = np.zeros (image.shape)
print km_image.shape
for i in ra... | {"hexsha": "a5eee1a80d3b14dc016b2d738eb5309fe5f3b7f1", "size": 2303, "ext": "py", "lang": "Python", "max_stars_repo_path": "perception/Old/CVChess-master/src/kmeans_test.py", "max_stars_repo_name": "gabrieledamone/DE3-ROB1-CHESS", "max_stars_repo_head_hexsha": "19ec74f10317d27683817989e729cacd6fe55a3f", "max_stars_repo... |
# !-*- coding: utf-8 -*-
# SimBERT 相似度任务测试
# 基于LCQMC语料
import numpy as np
from collections import Counter
from bert4keras.backend import keras, K
from bert4keras.models import build_transformer_model
from bert4keras.tokenizers import Tokenizer
from bert4keras.snippets import sequence_padding
from bert4keras.snippets i... | {"hexsha": "0a04e9eeb8388b07e22e9255d9c6c9d8d180502e", "size": 5066, "ext": "py", "lang": "Python", "max_stars_repo_path": "my_retrieval_test_03.py", "max_stars_repo_name": "DaiJitao/simbert", "max_stars_repo_head_hexsha": "6b562985db4004768613833c08d664a69a8a5294", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars... |
import numpy as np
rng = np.random.default_rng()
k = 3
mu = 1
sigma = 1
arr = rng.normal(mu, sigma, 10)
target = 0
distances = abs(arr - target)
indices = np.argpartition(distances, k)
partitioned_by_distance = arr[indices]
k_nearest = partitioned_by_distance[:k]
if __name__ == '__main__':
print('Data:\n', arr)
... | {"hexsha": "170c676d63d8d7d6bfe53d9ba8f9ba24a3211c72", "size": 544, "ext": "py", "lang": "Python", "max_stars_repo_path": "NumPy/Transposing Sorting Concatenating/Partial Sort/task.py", "max_stars_repo_name": "jetbrains-academy/Python-Libraries-NumPy", "max_stars_repo_head_hexsha": "7ce0f2d08f87502d5d97bbc6921f0566184d... |
!> \file radlw_main.f
!! This file contains NCEP's modifications of the rrtmg-lw radiation
!! code from AER.
!!!!! ============================================================== !!!!!
!!!!! lw-rrtm3 radiation package description !!!!!
!!!!! ==============================================... | {"hexsha": "7b029f8b0dfc01228eb45e2af75d56ef04bd8f56", "size": 277583, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "physics/radlw_main.f", "max_stars_repo_name": "tsupinie/ccpp-physics", "max_stars_repo_head_hexsha": "a1b957c9a8cea499121a1356ac0a826f692a30d8", "max_stars_repo_licenses": ["Apache-2.0"], "max_s... |
! Implicit FTSC FDM Solver using TDMA algorithm and ADI method for parabolic 2D heat transfer equation
!-------------------------------------------------------------
!------------------By Arthur Rostami -------------------------
!-------------------------------------------------------... | {"hexsha": "4fc378ce830fe8609f3a3469a5dae49b36c96fa4", "size": 8703, "ext": "f95", "lang": "FORTRAN", "max_stars_repo_path": "Implicit FTSC FDM Parabolic.f95", "max_stars_repo_name": "r2rro/CFD", "max_stars_repo_head_hexsha": "3151751423f68036c32004eea1350ee69ce959ad", "max_stars_repo_licenses": ["MIT"], "max_stars_cou... |
!------------------------------------------------------------------------------
!P+
! NAME:
! Test_MWSE
!
! PURPOSE:
! Program to test the microwave surface emissivity routines for
! benchmarking and refactoring.
!
! CATEGORY:
! CRTM : User Code : NESDIS Emissivity
!
! LANGUAGE:
! Fortran-... | {"hexsha": "5fa47ba169df7b4717e63528256efc18fbff3239", "size": 10371, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "src/User_Code/NESDIS_Emissivity/Test_MWSE/Test_MWSE.f90", "max_stars_repo_name": "hsbadr/crtm", "max_stars_repo_head_hexsha": "bfeb9955637f361fc69fa0b7af0e8d92d40718b1", "max_stars_repo_license... |
------------------------------------------------------------------------
-- A terminating parser data type and the accompanying interpreter
------------------------------------------------------------------------
module RecursiveDescent.Coinductive.Internal where
open import RecursiveDescent.Index
open import Data.Bo... | {"hexsha": "7254776f934f2269f74941fd45e84fb4aa45a481", "size": 3803, "ext": "agda", "lang": "Agda", "max_stars_repo_path": "misc/RecursiveDescent/Coinductive/Internal.agda", "max_stars_repo_name": "yurrriq/parser-combinators", "max_stars_repo_head_hexsha": "b396d35cc2cb7e8aea50b982429ee385f001aa88", "max_stars_repo_lic... |
#!/usr/bin/env python
import os
import json
import argparse
import requests
import numpy as np
from PIL import Image
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
def pred_to_fig(pred, alpha=0.9, color_min=0.3, color_max=0.7):
name = os.path.split(pred['uri'])[-1]
print(... | {"hexsha": "771268962b8dd22cd7a6d91d1dc36e1f8664b2c9", "size": 2463, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/caffe2/detectron/plot_masks.py", "max_stars_repo_name": "dgtlmoon/deepdetect", "max_stars_repo_head_hexsha": "0b2f20be8211a95b1fea3a600f0d5ba17b8d339f", "max_stars_repo_licenses": ["Apach... |
from __future__ import print_function
import os
import argparse
import numpy
import h5py
import irlib
import scipy.integrate as integrate
from mpmath import *
class BasisSet(object):
def __init__(self, h5file, prefix_name):
self._h5file = h5file
self._prefix_name = prefix_name
def _... | {"hexsha": "cea7bf2a4f059e20e6a42d7b9851bbc625ee69d4", "size": 7509, "ext": "py", "lang": "Python", "max_stars_repo_path": "database/make_h5.py", "max_stars_repo_name": "SpM-lab/irbasis", "max_stars_repo_head_hexsha": "5beb5cbe3c0ba0fb42c32e262f04d1f3359d6045", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 17,... |
import xml.dom.minidom as MD
import math
import csv
# import pandas
import random
import torch
import torch.nn as nn
from torch.autograd import Variable
import torch.nn.functional as F
import numpy as np
import torchvision.transforms as T
from PIL import Image
from collections import namedtuple
Batch_Size = 128
LR =... | {"hexsha": "98f1bba0291bba26a23fb1e69739e5fcf1aabceb", "size": 3609, "ext": "py", "lang": "Python", "max_stars_repo_path": "GeneralAgent/dqn_pix.py", "max_stars_repo_name": "shaw-wong/Malmo", "max_stars_repo_head_hexsha": "2683891206e8ab7f015d5d0feb6b5a967f02c94f", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
__precompile__()
module FLAC
using FileIO
# This `using` is literally only just so that `Ogg.__init__()` gets run. This
# ensures that `libogg` is loaded into the Julia namcespace, which is necessary
# for `libFLAC` to load properly. This will not be necessary in the future,
# once https://github.com/JuliaPackagin... | {"hexsha": "262278eae13d07910b2bc785c90939b7d3a97971", "size": 1110, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/FLAC.jl", "max_stars_repo_name": "UnofficialJuliaMirrorSnapshots/FLAC.jl-05003743-e4a8-526e-8961-a30f3f368c99", "max_stars_repo_head_hexsha": "10e1fbaf446cc3c5db9b839d6b26047d668fdf95", "max_st... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Nov 20 15:03:54 2020
@author: franciscodeborjaponz
"""
#Resets ALL (Careful This is a "magic" function then it doesn't run as script)
#reset -f
#load basiclibraries
import os
import numpy as np
import pandas as pd
from pandas.api.types import Categ... | {"hexsha": "679ebbe5006b9fd122d41551fc16134009c22839", "size": 2433, "ext": "py", "lang": "Python", "max_stars_repo_path": "sesiones/sesion10.py", "max_stars_repo_name": "fbponz/EstadisticaEnPython", "max_stars_repo_head_hexsha": "9a2a6db07bfa68c70e59b16223474fa7e5b670fd", "max_stars_repo_licenses": ["MIT"], "max_stars... |
import numpy as np
from gekko import GEKKO
from scipy.signal import tf2ss
import collections
import math
import time
from dataclasses import dataclass
ATSETTLINGTIME=100
ZEROCROSSINGTOL=0.001
METHODFACTORS=[[0.5,0,0],[1/2.2,1/1.2,0],[1/1.7,1/2,1/8],[1/3.2,2.2,0],[1/2.2,2.2,6.3]]
@dataclass
class MethodList:
ZN_P... | {"hexsha": "97856906c10079c7baea9b0fbd295263cf075983", "size": 11233, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/InstPyr/Control/PID.py", "max_stars_repo_name": "soodsidd/instpyr", "max_stars_repo_head_hexsha": "138d0a8164dc388187fde58329b9ff770af77af4", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
{-
Product of structures S and T: X ↦ S X × T X
-}
{-# OPTIONS --cubical --no-import-sorts --safe #-}
module Cubical.Structures.Relational.Product where
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.Equiv
open import Cubical.Foundations.Function
open import Cubical.Foundations.HLevels
open ... | {"hexsha": "df3b2ba8abfb7618fd1ae36a0aa713e382e997a1", "size": 5998, "ext": "agda", "lang": "Agda", "max_stars_repo_path": "Cubical/Structures/Relational/Product.agda", "max_stars_repo_name": "dan-iel-lee/cubical", "max_stars_repo_head_hexsha": "fd8059ec3eed03f8280b4233753d00ad123ffce8", "max_stars_repo_licenses": ["MI... |
'''
The main run file for training TM-Glow for both the backwards step
and cylinder array test cases which can be controlled through the
arguments.
=====
Distributed by: Notre Dame SCAI Lab (MIT Liscense)
- Associated publication:
url: http://aimsciences.org//article/id/3a9f3d14-3421-4947-a45f-a9cc74edd097
doi: https:... | {"hexsha": "6d0a76afb1c6adc2764513f6a12703c3ba0e4839", "size": 4948, "ext": "py", "lang": "Python", "max_stars_repo_path": "tmglow/main.py", "max_stars_repo_name": "zabaras/deep-turbulence", "max_stars_repo_head_hexsha": "0daca5daada449d4ba16bce37b703e20b444b6bc", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
[STATEMENT]
lemma node_step_no_change_on_send_or_receive:
assumes "((\<sigma>, NodeS i P R), a, (\<sigma>', NodeS i' P' R')) \<in> onode_sos
(oparp_sos i (oseqp_sos \<Gamma>\<^sub>A\<^sub>O\<^sub>D\<^sub>V i) (seqp_sos \<Gamma>\<^sub>Q\<^sub>M\<^sub>S\<^sub>G))"
and "a \<no... | {"llama_tokens": 369, "file": "AODV_variants_b_fwdrreps_B_Aodv_Loop_Freedom", "length": 2} |
import numpy as np
class NeuralNetwork:
def __init__(self, layer_sizes):
weight_shapes = [(a,b) for a,b in zip(layer_sizes[1:],layer_sizes[:-1])]
self.weights = [np.random.standard_normal(s)/s[1]**.5 for s in weight_shapes]
self.biases = [np.zeros((s,1)) for s in layer_sizes[1:]]
def predict(sel... | {"hexsha": "a121bc9107e71bffcdaf63acf122534f52e94d2b", "size": 764, "ext": "py", "lang": "Python", "max_stars_repo_path": "NeuralNetwork.py", "max_stars_repo_name": "AminAbdelmlak/Number-Guesser-NeuralNet", "max_stars_repo_head_hexsha": "fae1bf4a9871ae8501399d7424705206564543f9", "max_stars_repo_licenses": ["MIT"], "ma... |
// Copyright (c) 2010 Satoshi Nakamoto
// Copyright (c) 2009-2014 The Bitcoin developers
// Copyright (c) 2014-2015 The Dash developers
// Copyright (c) 2015-2020 The PIVX developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php... | {"hexsha": "789a5c868f0c82ad55734db4fc8e749f7fc46f79", "size": 10996, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "src/rpc/multimining.cpp", "max_stars_repo_name": "QRAX-LABS/QRAX", "max_stars_repo_head_hexsha": "951ed45d473b7ab8c74bf35ff794e97169736d0c", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 2... |
import numpy as np
from keras.applications.vgg19 import VGG19
from keras.applications.vgg19 import preprocess_input
import os
import keras
import sys
from datautils import get_data,get_model,data_proprecessing
def cos_distribution(cos_array):
cos_distribute = [0 for i in range(10)]
for i in cos_array:
... | {"hexsha": "298fc4e70c0bacbe39bbe980e8359763db35b528", "size": 5242, "ext": "py", "lang": "Python", "max_stars_repo_path": "prioritzation/feature_extraction.py", "max_stars_repo_name": "sail-repos/PRIMA", "max_stars_repo_head_hexsha": "21993e34484a8659e5988d8037f4430839dd3eb3", "max_stars_repo_licenses": ["Apache-2.0"]... |
# -*- coding: utf-8 -*-
import os
import sys
import math
sys.dont_write_bytecode = True
import caffe
from caffe import layers as L
from caffe import params as P
from caffe.proto import caffe_pb2
sys.path.append('../')
from PyLib.LayerParam.MultiBoxLossLayerParam import *
from PyLib.NetLib.ConvBNLayer import *
from PyLi... | {"hexsha": "5f774652d37b877772d6f10153a4fdfbda7c365c", "size": 17184, "ext": "py", "lang": "Python", "max_stars_repo_path": "remodet_repository_wdh_part/Projects/DAP_Minihand/FaceBoxFPNNet.py", "max_stars_repo_name": "UrwLee/Remo_experience", "max_stars_repo_head_hexsha": "a59d5b9d6d009524672e415c77d056bc9dd88c72", "ma... |
import tensorflow as tf
import numpy as np
import os,glob,cv2
import sys,argparse
dir_path = os.path.dirname(os.path.realpath(__file__))
image_path=sys.argv[1]
filename = image_path
print(filename)
image_size=300
num_channels=3
images = []
image = cv2.imread(filename)
image = cv2.resize(image, (image_size, image_siz... | {"hexsha": "afde95e461ac20b32d5125bc26dd55bd84018cd9", "size": 1166, "ext": "py", "lang": "Python", "max_stars_repo_path": "django-webapp/kanjoos/myapp/src/runner/test.py", "max_stars_repo_name": "gokkulasudanr92/Kanjoos-HackGT", "max_stars_repo_head_hexsha": "a3dfb98cf98113b214a34e6cd3eaf338066315ff", "max_stars_repo_... |
import numpy as np
x = np.ones((10, 10))
x[1:-1, 1:-1] = 0
print(x) | {"hexsha": "af4c58b2c05a779deaf70c40b77a2bc7cc0ed5de", "size": 67, "ext": "py", "lang": "Python", "max_stars_repo_path": "semester-6/Python Practice/numpyPractice/program28.py", "max_stars_repo_name": "saranshbht/bsc-codes", "max_stars_repo_head_hexsha": "7386c09cc986de9c84947f7dea7db3dc42219a35", "max_stars_repo_licen... |
# Store network information
# TODO: echenolize model
struct MetNet
## LP (original)
S::Matrix{Float64}
b::Vector{Float64}
lb::Vector{Float64}
ub::Vector{Float64}
c::Vector{Float64}
rxns::Vector{String}
mets::Vector{String}
end
MetNet(;S, b, lb, ub, c, rxns, mets) = MetNet(S, b, lb, ... | {"hexsha": "43fe19db2e5c3cfc64ae0c3a596fa93f87d89ee8", "size": 7543, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/Dynamic/MetNets.jl", "max_stars_repo_name": "josePereiro/Chemostat_InSilico.jl", "max_stars_repo_head_hexsha": "794293c33ea3f346ffdd8275498eaa3ee6f81d8b", "max_stars_repo_licenses": ["MIT"], "m... |
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 25 11:01:12 2018
@author: Yilin Liu
Reference: Yang, S., Wang, J., Fan, W., Zhang, X., Wonka, P. & Ye, J.
An Efficient ADMM Algorithm for Multidimensional Anisotropic
Total Variation Regularization Problems.
Proceedings of the 19th ACM... | {"hexsha": "c9be20b02b917dd1369f6c5917111e64aefb3ba9", "size": 1931, "ext": "py", "lang": "Python", "max_stars_repo_path": "tv2d.py", "max_stars_repo_name": "MrCredulous/2D-MCTV-Denoising", "max_stars_repo_head_hexsha": "e261364802e5740780ad4278bf2bd4aba960a2c6", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1... |
# -*- coding: utf-8 -*-
# @Time : 2021/4/4 7:48 下午
# @Author : Yushuo Wang
# @FileName: Random_Forest.py
# @Software: PyCharm
# @Blog :https://lesliewongcv.github.io/
import pandas as pd
import numpy as np
import random
import math
import collections
from joblib import Parallel, delayed
from scipy.io import loa... | {"hexsha": "e607b7ae24e6b0aa944353ecfeda5cba39ea2c5f", "size": 13015, "ext": "py", "lang": "Python", "max_stars_repo_path": "Random_Forest.py", "max_stars_repo_name": "LeslieWongCV/RF", "max_stars_repo_head_hexsha": "40ffca61ed6b474d5d991d9db48dd7b7bff04b30", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, "m... |
import logging
import unittest
from pathlib import Path
import numpy as np
import alf.io
from ibllib.io import raw_data_loaders as raw
import ibllib.io.extractors
class TestExtractTrialData(unittest.TestCase):
def setUp(self):
self.main_path = Path(__file__).parent
self.training_lt5 = {'path': ... | {"hexsha": "f5d055f30bd35185847499b42d44011470384609", "size": 28345, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/ibllib/extractors/test_extractors.py", "max_stars_repo_name": "ekellbuch/ibllib", "max_stars_repo_head_hexsha": "6948f86c3f426cbebb39cc693f612d25079d7ef2", "max_stars_repo_licenses": ["MIT"... |
module Main
import Data.Vect
-- let .. in defines local variables
-- where .. allows for local function definitions
-- Nat is a natural number type, non-negative integers.
-- ++ is for appending Strings or Lists to each other.
-- words : String -> List String -- splits on a space
average : (str : String) -> Double
a... | {"hexsha": "4ea6424c7ed08f451c6346ddfe3b7e8ce0f8aa3e", "size": 3920, "ext": "idr", "lang": "Idris", "max_stars_repo_path": "tdd/Chapter2.idr", "max_stars_repo_name": "rickyclarkson/idris-playground", "max_stars_repo_head_hexsha": "3bd9b5fd76df4b2a6c0cf40fa537624e7b692e21", "max_stars_repo_licenses": ["MIT"], "max_stars... |
import unidip.dip as dip
import numpy as np
"""
File contains three methods to quantify the polarization within the population.
1. Hartigan's D test (which is increasing when the distribution is less similar to unimodal distribution)
2. Fraction of the population holding a view in accordance with the minority.
3. Mea... | {"hexsha": "b65d8b77b00912e5adc864a762610fdd1fa1657a", "size": 2747, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/stats.py", "max_stars_repo_name": "mahetoodang/hiom", "max_stars_repo_head_hexsha": "72628173086fe8f5edb36c3a88d1119ded4d7854", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "ma... |
[STATEMENT]
lemma flow_usolves_ode:
assumes iv_defined: "t0 \<in> T" "x0 \<in> X"
shows "(flow t0 x0 usolves_ode f from t0) (existence_ivl t0 x0) X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. (flow t0 x0 usolves_ode f from t0) (existence_ivl t0 x0) X
[PROOF STEP]
proof (rule usolves_odeI)
[PROOF STATE]
proof... | {"llama_tokens": 12308, "file": "Ordinary_Differential_Equations_IVP_Picard_Lindeloef_Qualitative", "length": 85} |
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
...
@author: fertesta, ucaiado
Created on 01/05/2018
'''
from enum import Enum
import datetime
import random
from collections import namedtuple
import numpy as np
ENV = None
BOVESPA = False
CALLBACKS = {}
class NoneObjectError(Exception):
"""
NoneObjectError i... | {"hexsha": "80c015eec65cf1c3d27657eb3413566b9439ac26", "size": 83599, "ext": "py", "lang": "Python", "max_stars_repo_path": "gymV02/neutrino.py", "max_stars_repo_name": "onesoftsa/neutrino-lab", "max_stars_repo_head_hexsha": "2d52bdc46895e5659f4ffbc6ffa2629392ed4f9a", "max_stars_repo_licenses": ["Apache-2.0"], "max_sta... |
#include <boost/polygon/interval_data.hpp>
| {"hexsha": "49883068c47797ea37f36e196004f10da02d3073", "size": 43, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "src/boost_polygon_interval_data.hpp", "max_stars_repo_name": "miathedev/BoostForArduino", "max_stars_repo_head_hexsha": "919621dcd0c157094bed4df752b583ba6ea6409e", "max_stars_repo_licenses": ["BSL-1.0... |
/**/
#ifndef PoseSensorSIProxy_HPP_
#define PoseSensorSIProxy_HPP_
#include <rw/common/Ptr.hpp>
#include <rw/math.hpp>
#include <rw/trajectory/Path.hpp>
#include <boost/thread.hpp>
#include <ros/ros.h>
#include <caros_sensor_msgs/PoseSensorState.h>
#include <queue>
namespace caros {
/**
* @brief this class impleme... | {"hexsha": "3c1549e993df1c1d6df78456e06172f6d3ef3bc0", "size": 1212, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "src/interfaces/caros_sensor/include/caros/PoseSensorSIProxy.hpp", "max_stars_repo_name": "tlund80/MARVIN", "max_stars_repo_head_hexsha": "9fddfd4c8e298850fc8ce49c02ff437f139309d0", "max_stars_repo_l... |
# %% Import
import geopandas as gpd
import pandas as pd
import numpy as np
import os
"""
Takes the converted geojson file and returns columns of interest
- Subzone
- Planning area
- Region
- Geometry data (important for choropleths)
"""
# %% Functions
def getArea(file):
gdf = gpd.read_file(file)
cols = [
... | {"hexsha": "06515d100e83ba4b58ff9437021aae9ae29a54c4", "size": 1939, "ext": "py", "lang": "Python", "max_stars_repo_path": "data/r2_cleanboundary.py", "max_stars_repo_name": "ljunhui/Koufu_SG_Map", "max_stars_repo_head_hexsha": "8d440605cc90c49c6635f4d5202bd262e30b0efb", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
"""Tests suite for Period handling.
Parts derived from scikits.timeseries code, original authors:
- Pierre Gerard-Marchant & Matt Knox
- pierregm_at_uga_dot_edu - mattknow_ca_at_hotmail_dot_com
"""
from unittest import TestCase
from datetime import datetime, timedelta
from numpy.ma.testutils import assert_equal
fr... | {"hexsha": "49f7e1734ba5c01d6a7027e186ec834c39f42e70", "size": 51443, "ext": "py", "lang": "Python", "max_stars_repo_path": "pandas/tseries/tests/test_period.py", "max_stars_repo_name": "takluyver/pandas", "max_stars_repo_head_hexsha": "6c820b4b1a3b945d52cffbd9a4d40a582c077b5d", "max_stars_repo_licenses": ["BSD-3-Claus... |
from __future__ import absolute_import, print_function
from collections import defaultdict
import pytest
from sage.all import prod, factorial, QQ, vector, Permutation, Permutations
from moment_polytopes import *
def test_rect_tableaux_22():
tableaux = list(rect_tableaux(2, 2))
assert len(tableaux) == 2
as... | {"hexsha": "73f3ae3f820a941c047da00a6b62557309b41f15", "size": 10211, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_combinat.py", "max_stars_repo_name": "amsqi/moment_polytopes", "max_stars_repo_head_hexsha": "641f3c0ebeb0daaea6e9664acb01f95c3686382e", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
import inspect
import io
import logging
import os
import time
import warnings
from collections import namedtuple
from functools import wraps
from typing import (
Any,
Callable,
Dict,
Iterable,
Iterator,
List,
Optional,
Sequence,
Set,
Tuple,
Union,
cast,
)
import numpy as... | {"hexsha": "b9adad9dc70fc33c5ef85850766085898cf452a8", "size": 50745, "ext": "py", "lang": "Python", "max_stars_repo_path": "plateau/io_components/metapartition.py", "max_stars_repo_name": "data-engineering-collective/plateau", "max_stars_repo_head_hexsha": "ab87282a2f66c4f847654f28f8a2b0df33cb4d62", "max_stars_repo_li... |
# -*- coding: utf-8 -*-
""" This example shows how to compute the atmospheric attenuation exceeded
for 0.1 % of the time for multiple ground stations.
It is assumed that the satellite is located in geostationary orbit, at the
77 W slot, and the link operates at 22.5 GHz with receiver-dishes of 1.2 m
diameter.
Finally... | {"hexsha": "38d7d6d7ec702bdc0e4b3c3ef19a2ae17a697408", "size": 2349, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/multiple_location.py", "max_stars_repo_name": "the-aerospace-corporation/ITU-Rpy", "max_stars_repo_head_hexsha": "4456da2db9f28453d5a08339c84fe5bf25b999d8", "max_stars_repo_licenses": ["M... |
Require Import oeuf.Common oeuf.Monads.
Require Import oeuf.Metadata.
Require String.
Require oeuf.LocalsOnly oeuf.FlatSwitch.
Require Import oeuf.ListLemmas.
Require Import oeuf.HigherValue.
Require Import oeuf.StepLib.
Require Import Psatz.
Module A := LocalsOnly.
Module B := FlatSwitch.
Add Printing Constructor A... | {"author": "uwplse", "repo": "oeuf", "sha": "f3e4d236465ba872d1f1b8229548fa0edf8f7a3f", "save_path": "github-repos/coq/uwplse-oeuf", "path": "github-repos/coq/uwplse-oeuf/oeuf-f3e4d236465ba872d1f1b8229548fa0edf8f7a3f/src/FlatSwitchComp.v"} |
[STATEMENT]
lemma preserves_quasi_inverse:
assumes "C.equivalence_map f"
shows "D.isomorphic (F (C.some_quasi_inverse f)) (D.some_quasi_inverse (F f))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. D.isomorphic (F (C.some_quasi_inverse f)) (D.some_quasi_inverse (F f))
[PROOF STEP]
using assms preserves_quas... | {"llama_tokens": 529, "file": "Bicategory_Pseudofunctor", "length": 2} |
from datetime import datetime
import numpy as np
import pandas as pd
from sklearn.ensemble import RandomForestRegressor
import tensorflow as tf
import utils
class MatplotlibTimeSeriesVisualization(utils.MatplotlibTimeSeriesVisualization):
@staticmethod
def time_query(dataset, date_attr, group_attr, attribut... | {"hexsha": "b7ae9ec92e3f20c0dc6e2dd66861d2d5124b3c2a", "size": 8751, "ext": "py", "lang": "Python", "max_stars_repo_path": "nyc_accidents.py", "max_stars_repo_name": "ZhengLiCS/project", "max_stars_repo_head_hexsha": "ffaa8630bbf77bd29ab8d2439ebbc9544535eece", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count... |
[STATEMENT]
lemma C_subset : "C M2 M1 \<Omega> V m i \<subseteq> TS M2 M1 \<Omega> V m i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. C M2 M1 \<Omega> V m i \<subseteq> TS M2 M1 \<Omega> V m i
[PROOF STEP]
by (simp add: TS_union) | {"llama_tokens": 107, "file": "Adaptive_State_Counting_ASC_ASC_Suite", "length": 1} |
[STATEMENT]
lemma natural_of_integer_of_natural [simp]:
"natural_of_integer (integer_of_natural n) = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. natural_of_integer (integer_of_natural n) = n
[PROOF STEP]
by transfer simp | {"llama_tokens": 88, "file": null, "length": 1} |
## --- Grid ---
# TODO: generalize for arbitrary rectangular grids
"""Two-dimensional grid."""
struct Grid
x::Vector{Int}
y::Vector{Int}
n::Tuple{Int,Int}
end
Base.length(grid::Grid) = prod(grid.n)
function Grid(n::Tuple{Int,Int})
x = [i for i = 1:n[1] for _ = 1:n[2]]
y = [j for _ = 1:n[1] for j... | {"hexsha": "1c4304fff4b18eb12cee05f6d0975a754480153d", "size": 4144, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/functions.jl", "max_stars_repo_name": "jaantollander/LockPatternComplexity.jl", "max_stars_repo_head_hexsha": "25ec93f855c47d4bb44a9f8e3839d48a0fcd5020", "max_stars_repo_licenses": ["MIT"], "ma... |
import pandas as pd
import numpy as np
# from copy import deepcopy
from sklearn.utils.metaestimators import _BaseComposition
from sklearn.preprocessing import LabelEncoder
from sklearn.externals.joblib import Parallel, delayed
from gravity_learn.utils import (force_array,
check_is_fitte... | {"hexsha": "81b821747799af8cccd43765a9a386075efa2f23", "size": 6669, "ext": "py", "lang": "Python", "max_stars_repo_path": "klearn/ensemble/dispatch.py", "max_stars_repo_name": "KevinLiao159/klearn", "max_stars_repo_head_hexsha": "ffc0cb6b69cd21f2aac8934af55ac6e32c4db689", "max_stars_repo_licenses": ["MIT"], "max_stars... |
'''
There are in total five algorithms: MLP, SVM, Bag, AdaBoost and GB
'''
from sklearn.neural_network import MLPClassifier
from sklearn.svm import SVC
from sklearn.ensemble import BaggingClassifier
from sklearn.ensemble import AdaBoostClassifier
from sklearn.ensemble import GradientBoostingClassifier
i... | {"hexsha": "06422d7ffac3545579bd79ef0ae80fa47479ab43", "size": 2885, "ext": "py", "lang": "Python", "max_stars_repo_path": "GAN_Models/Ensemble_Classifiers.py", "max_stars_repo_name": "Wapiti08/Analysis_Ransome_with_GAN", "max_stars_repo_head_hexsha": "f908ec77b4df1029b10fd4f8a9e94daf1b4bbf7b", "max_stars_repo_licenses... |
import numpy as np
from sklearn.linear_model import Lasso
from sklearn.linear_model import Ridge
from sklearn.linear_model import ElasticNet
from sklearn.linear_model import LinearRegression
def linear_factor_mod(y, x, p = None, regularize = None, return_alpha = False):
t_, n_ = y.shape
#set uniform weights i... | {"hexsha": "66512e8e3f2bbb01ac6ba1bab1afc9dc1928ef37", "size": 1082, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/factor_models.py", "max_stars_repo_name": "matus-jan-lavko/ReinforcementLearning-vs-EW", "max_stars_repo_head_hexsha": "48f8f9285e08bf05f79173c6a0c57cb05a3a8dfb", "max_stars_repo_licenses": ["... |
import sys
import os
import cv2
import numpy as np
import copy
import matplotlib.pyplot as plt
from cto.utility.logging_extension import logger
from VTKInterface.Interfaces.Render_Interface import RenderInterface
from cto.rendering.rendering_utility import build_render_compatible_focal_length
from cto.rendering.rende... | {"hexsha": "ac18314611780e08881746b5a3ed0a453b5ecf65", "size": 5074, "ext": "py", "lang": "Python", "max_stars_repo_path": "cto/rendering/vtk_rendering_utility.py", "max_stars_repo_name": "SBCV/ColmapTexturingWithOpen3D", "max_stars_repo_head_hexsha": "d45f10331c563ca874b618d5fee38d311de9437e", "max_stars_repo_licenses... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Beamer Presentation
% LaTeX Template
% Version 1.0 (10/11/12)
%
% This template has been downloaded from:
% http://www.LaTeXTemplates.com
%
% License:
% CC BY-NC-SA 3.0 (http://creativecommons.org/licenses/by-nc-sa/3.0/)
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%---------... | {"hexsha": "c517ee1a3ab673a818fcaeac2fbf240f4865e2c1", "size": 29637, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "sum-divergent-series/presentation.tex", "max_stars_repo_name": "Haoen-Cui/talks", "max_stars_repo_head_hexsha": "133d85d70cd467e5a0df19cc5bec2454e9388898", "max_stars_repo_licenses": ["BSD-3-Clause... |
# date_heatmap and date_heatmap_demo are from an answer on stackoverflow
# here: https://stackoverflow.com/questions/32485907/matplotlib-and-numpy-create-a-calendar-heatmap/51977000#51977000
# by user cbarrick
# we updated it slightly to work with the most current pandas version and changed some of the parameters ar... | {"hexsha": "2a9ea095e88cb990526afa5e7627e938cd0b1af8", "size": 8930, "ext": "py", "lang": "Python", "max_stars_repo_path": "stocktonesportsbot/classes/Metrics.py", "max_stars_repo_name": "Dual-Exhaust/Stockton-Esports-Bot", "max_stars_repo_head_hexsha": "2ff02d210236f0436a28d0815a5321c4ee280e11", "max_stars_repo_licens... |
[STATEMENT]
lemma vcg_wp_conseq:
assumes "HT_mods \<pi> mods P c Q"
assumes "P s"
assumes "\<And>s'. \<lbrakk>modifies mods s' s; Q s s'\<rbrakk> \<Longrightarrow> Q' s'"
shows "wp \<pi> c Q' s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. wp \<pi> c Q' s
[PROOF STEP]
using assms
[PROOF STATE]
proo... | {"llama_tokens": 393, "file": "IMP2_automation_IMP2_Program_Analysis", "length": 3} |
#!/usr/bin/env python
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import re
gis_file = 'Annual_Average_Daily_Traffic__AADT___Beginning_1977.csv'
df = pd.read_csv(gis_file)
print(df.head())
# remove spaces from column names
cols = df.columns
cols = cols.map(lambda x: x.replace(' ', '_') i... | {"hexsha": "565fab35501b38d695024467dca8c7914da11937", "size": 1548, "ext": "py", "lang": "Python", "max_stars_repo_path": "course-2/session-7/pandas/process_traffic.py", "max_stars_repo_name": "robmarano/nyu-python", "max_stars_repo_head_hexsha": "4406f157e6d6a63e512ed1595f56dcb65c5d8526", "max_stars_repo_licenses": [... |
(*
Copyright © 2006 Russell O’Connor
Permission is hereby granted, free of charge, to any person obtaining a copy of
this proof and associated documentation files (the "Proof"), to deal in
the Proof without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicens... | {"author": "coq-community", "repo": "corn", "sha": "cfbf6b297643935f0fe7e22d2b14b462bf7e3095", "save_path": "github-repos/coq/coq-community-corn", "path": "github-repos/coq/coq-community-corn/corn-cfbf6b297643935f0fe7e22d2b14b462bf7e3095/reals/fast/CRtrans.v"} |
'''@file trainer.py
neural network trainer environment'''
from abc import ABCMeta, abstractmethod
import tensorflow as tf
import numpy as np
from classifiers import seq_convertors
class Trainer(object):
'''General class for the training environment for a neural net graph'''
__metaclass__ = ABCMeta
def __... | {"hexsha": "6662892ce7a9ded09a98df5fa6006570dd7f3869", "size": 18639, "ext": "py", "lang": "Python", "max_stars_repo_path": "neuralNetworks/trainer.py", "max_stars_repo_name": "waterxt/tensorflowkaldi", "max_stars_repo_head_hexsha": "981cfb2bb0a8adec45379cee2410ef166c24b7e6", "max_stars_repo_licenses": ["MIT"], "max_st... |
import pysam,sys
import numpy as np
from collections import Counter
from resources.extract import extractRegion,fqRec,rc
MINCLUSTERSIZE=5
def main(parser):
args = parser.parse_args()
if args.inBAM and args.inFastq:
raise SampleReads_Exception('Only one input, either -b or -q')
if args.inBAM:
... | {"hexsha": "78cee05a631527a668fe7ba0fadea5fd250c1d15", "size": 5217, "ext": "py", "lang": "Python", "max_stars_repo_path": "RepeatAnalysisTools/sampleReads.py", "max_stars_repo_name": "PacificBiosciences/apps-scripts", "max_stars_repo_head_hexsha": "dd741d72f6b5483eb6d1f9a7f33cd42f9b56b5a7", "max_stars_repo_licenses": ... |
"""
Usage: main.py lookup <image>...
main.py insert <image>...
"""
import sys
import multiprocessing
from collections import Counter
from os import cpu_count
import cv2
import redis
import numpy as np
from .keypoints import compute_keypoints
from .phash import triangles_from_keypoints, hash_triangles
def pha... | {"hexsha": "84d20978c0d3107f8a1ca57aef72197febd6a1f8", "size": 2284, "ext": "py", "lang": "Python", "max_stars_repo_path": "transformation_invariant_image_search/main.py", "max_stars_repo_name": "xeddmc/transformationInvariantImageSearch", "max_stars_repo_head_hexsha": "10800ace74441382a41be1a48fe2e01cd8e89a9f", "max_s... |
#include <boost/thread/thread.hpp>
#include <boost/lockfree/spsc_queue.hpp>
#include <iostream>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <cctype>
#include <string>
#include <boost/atomic.hpp>
#define PORT 6070
#define TILE (1 << 20)
boost::lockfree::spsc_queue<char*, boost::lock... | {"hexsha": "ef7c663311f7670c367705860e4750ae298d26ab", "size": 3635, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "aes/cpp/aesserver.cpp", "max_stars_repo_name": "peterpengwei/pipeline", "max_stars_repo_head_hexsha": "d1dc6534c92c2f377d9c0719347cc1d254d78f6c", "max_stars_repo_licenses": ["Apache-2.0"], "max_star... |
(** Generated by coq-of-ocaml *)
Require Import OCaml.OCaml.
Local Set Primitive Projections.
Local Open Scope string_scope.
Local Open Scope Z_scope.
Local Open Scope type_scope.
Import ListNotations.
Unset Positivity Checking.
Unset Guard Checking.
Inductive nat : Set :=
| O : nat
| S : nat -> nat.
Inductive natu... | {"author": "yalhessi", "repo": "lemmaranker", "sha": "53bc2ad63ad7faba0d7fc9af4e1e34216173574a", "save_path": "github-repos/coq/yalhessi-lemmaranker", "path": "github-repos/coq/yalhessi-lemmaranker/lemmaranker-53bc2ad63ad7faba0d7fc9af4e1e34216173574a/benchmark/clam/_lfind_clam_lf_goal33_mult_succ_82_plus_assoc/goal33co... |
/-
Copyright (c) 2022 Julian Kuelshammer. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Author : Julian Kuelshammer
-/
import easy_mode.sheet01
/-! Two-by-two matrices
This file defines two-by-two matrices and shows that they form a vector space.
-/
/- What do you want to ... | {"author": "Julian-Kuelshammer", "repo": "summer_maths_it_camp", "sha": "09b17b78de1c4cb3536649a6030fc14b60b08d24", "save_path": "github-repos/lean/Julian-Kuelshammer-summer_maths_it_camp", "path": "github-repos/lean/Julian-Kuelshammer-summer_maths_it_camp/summer_maths_it_camp-09b17b78de1c4cb3536649a6030fc14b60b08d24/s... |
///////////////////////////////////////////////////////////////////////////////
// calculator.hpp
//
// Copyright 2008 Eric Niebler. 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)
#include <boost/proto/c... | {"hexsha": "a69480c9e5b51ac6ece9ff99f177734566965111", "size": 2955, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "libs/proto/test/calculator.cpp", "max_stars_repo_name": "zyiacas/boost-doc-zh", "max_stars_repo_head_hexsha": "689e5a3a0a4dbead1a960f7b039e3decda54aa2c", "max_stars_repo_licenses": ["BSL-1.0"], "max... |
[STATEMENT]
lemma mk_minsky_add1:
assumes "v \<noteq> w"
shows "mk_minsky (\<lambda>vs vs'. vs' = (\<lambda>x. if x = v then 0 else if x = w then vs v + vs w else vs x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. mk_minsky (\<lambda>vs vs'. vs' = (\<lambda>x. if x = v then 0 else if x = w then vs v + vs w e... | {"llama_tokens": 294, "file": "Minsky_Machines_Minsky", "length": 2} |
#ifndef INCLUDE_ASLAM_BACKEND_COMMON_HPP_
#define INCLUDE_ASLAM_BACKEND_COMMON_HPP_
#include <Eigen/Core>
#include <sm/timing/Timer.hpp>
#if !defined(LIKELY) || !defined(UNLIKELY)
#if defined(__GNUC__) || defined(__GNUG__) /* GNU GCC/G++ */
#define LIKELY(x) __builtin_expect (!!(x), 1)
#define UNLIKELY... | {"hexsha": "3a553ee9b16a440bece880503b935a0517b543d0", "size": 782, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "aslam_backend/include/aslam/backend/util/CommonDefinitions.hpp", "max_stars_repo_name": "ethz-asl/aslam_optimizer", "max_stars_repo_head_hexsha": "8e9dd18f9f0d8af461e88e108a3beda2003daf11", "max_star... |
#coding=utf-8
import pandas as pd
from sklearn.metrics import log_loss, roc_auc_score
from sklearn .model_selection import train_test_split
from sklearn.preprocessing import LabelEncoder, MinMaxScaler, OneHotEncoder,LabelBinarizer
import warnings
from deepctr.models import DeepFM,DeepFMMTL
from deepctr.inputs import... | {"hexsha": "4f88c9bad92bc8b0f91942e6ffaa18747440fd18", "size": 7408, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/run_duorenwu_Deepfm.py", "max_stars_repo_name": "lora-chen/Deepfm", "max_stars_repo_head_hexsha": "5ccb93ec918d1b14fffba316c428fb8d23e6228e", "max_stars_repo_licenses": ["Apache-2.0"], "m... |
(* Title: Nominal2_Base
Authors: Christian Urban, Brian Huffman, Cezary Kaliszyk
Basic definitions and lemma infrastructure for
Nominal Isabelle.
*)
theory Nominal2_Base
imports Main
"~~/src/HOL/Library/Infinite_Set"
"~~/src/HOL/Quotient_Examples/FSet"
"GPerm"
"~~/src/... | {"author": "goodlyrottenapple", "repo": "Nominal2-Isabelle", "sha": "214274ed6db74c19b8694fc5c8dd9cafa13b056a", "save_path": "github-repos/isabelle/goodlyrottenapple-Nominal2-Isabelle", "path": "github-repos/isabelle/goodlyrottenapple-Nominal2-Isabelle/Nominal2-Isabelle-214274ed6db74c19b8694fc5c8dd9cafa13b056a/Nominal/... |
\subsection{Write Math}
\begin{frame}{write-math.com}
\begin{itemize}
\item a website where users can add labeled training data
\item works with desktop computers and touch devices
\item symbol recognition can be done by multiple classifiers
\item users can contribute formulas
... | {"hexsha": "2cd43122b4982cb212791c16906ba10e785b7d93", "size": 2028, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "presentations/Bachelor-Short/LaTeX/work-done.tex", "max_stars_repo_name": "tungel/LaTeX-examples", "max_stars_repo_head_hexsha": "9558d8b3c19776cb068b9753dcd3f88645dd7134", "max_stars_repo_licenses"... |
[STATEMENT]
theorem quot_rep: "\<exists>a. A = \<lfloor>a\<rfloor>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<exists>a. A = \<lfloor>a\<rfloor>
[PROOF STEP]
proof (cases A)
[PROOF STATE]
proof (state)
goal (1 subgoal):
1. \<And>y. \<lbrakk>A = Abs_quot y; y \<in> quot\<rbrakk> \<Longrightarrow> \<exists>a. A... | {"llama_tokens": 1094, "file": null, "length": 14} |
# -*- coding: utf-8 -*-
## all SI units
########################################################################################
## Plot the membrane potential for a leaky integrate and fire neuron with current injection
## Author: Aditya Gilra
## Creation Date: 2012-06-08
## Modification Date: 2012-06-08
#############... | {"hexsha": "aed0ef29b58286a4c03737530955c3dcd0917be1", "size": 3082, "ext": "py", "lang": "Python", "max_stars_repo_path": "tutorials/chemical switches/moose/neuroml/LIF/twoLIFxml_firing.py", "max_stars_repo_name": "h-mayorquin/camp_india_2016", "max_stars_repo_head_hexsha": "a8bf8db7778c39c7ca959a7f876c1aa85f2cae8b", ... |
import unittest
import random
import numpy as np
from src.data_arrays import DataArrays
from collections import Counter
class TestDataArrays(unittest.TestCase):
data_arrays: DataArrays
def setUp(self):
self.data_arrays = DataArrays()
def test_remove_duplicates(self):
a = np.random.randin... | {"hexsha": "75a51ffda84d039411028367487a0947265e74ee", "size": 911, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/test_data_arrays.py", "max_stars_repo_name": "marciojustino/data-arrays-lib", "max_stars_repo_head_hexsha": "d2495eb9d00d5ee3a885d6f215d9c28eba9fab66", "max_stars_repo_licenses": ["MIT"], "max_... |
#This script normalizes reactivity (theta) values from a reactivities.out file produced by spats v 0.8.0.
#It does so following the method outlined in Lucks et al PNAS (2011).
#The top 2% of thetas are excluded.
#Then the 3-10th percentiles of thetas are averaged and all theta values are then normalized by this value.
... | {"hexsha": "67ba85a5c2747423056da798897ef6bf54941a40", "size": 7986, "ext": "py", "lang": "Python", "max_stars_repo_path": "shape_normalizereactivities.py", "max_stars_repo_name": "TaliaferroLab/AnalysisScripts", "max_stars_repo_head_hexsha": "3df37d2f8fca9bc402afe5ea870c42200fca1ed3", "max_stars_repo_licenses": ["MIT"... |
classdef CEC2008_F4 < PROBLEM
% <single> <real> <large/none> <expensive/none>
% Shifted Rastrign's function
%------------------------------- Reference --------------------------------
% K. Tang, X. Yao, P. N. Suganthan, C. MacNish, Y.-P. Chen, C.-M. Chen, and
% Z. Yang, Benchmark functions for the CEC'2008 special ses... | {"author": "BIMK", "repo": "PlatEMO", "sha": "c5b5b7c37a9bb42689a5ac2a0d638d9c4f5693d5", "save_path": "github-repos/MATLAB/BIMK-PlatEMO", "path": "github-repos/MATLAB/BIMK-PlatEMO/PlatEMO-c5b5b7c37a9bb42689a5ac2a0d638d9c4f5693d5/PlatEMO/Problems/Single-objective optimization/CEC 2008/CEC2008_F4.m"} |
#include "engine/oblique_engine.hpp"
#include <boost/scoped_array.hpp>
void oblique_engine::render(level_ptr level, boost::shared_ptr<image_operations> oper)
{
Cube part_c(mc::MapX + 1, mc::MapY + 1, mc::MapZ + 1);
pos_t iw, ih;
part_c.get_oblique_limits(iw, ih);
BlockRotation b_r(s, level->get_blocks()... | {"hexsha": "4d160c84858d3f9dae76da3ca7f1c481e4da5271", "size": 2263, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "src/engine/oblique_engine.cpp", "max_stars_repo_name": "eisbehr/c10t", "max_stars_repo_head_hexsha": "c30e55613fa0203cba84cb153392a55391279551", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_sta... |
# preprocess.r
# 20190319
message('Preprocessing: initial cleanup.')
# Remove columns that are unnecessary and/or artifacts of the merge process
abcd_frame <- abcd_frame %>%
select(
-contains('eventname'),
-contains('collection_id'),
-contains('collection_title'),
-contains('study_cohort_name'), ... | {"hexsha": "efe5bf1e326efb5775080d1314d507afec1003ab", "size": 14811, "ext": "r", "lang": "R", "max_stars_repo_path": "r/2_preprocess.r", "max_stars_repo_name": "amandeepjutla/2019-abcd-asd", "max_stars_repo_head_hexsha": "06860acbc83af4ccccb41b8ba6bb3d0678a39a3b", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
function [ c, seed ] = c8vec_uniform_01 ( n, seed )
%*****************************************************************************80
%
%% C8VEC_UNIFORM_01 returns a unit pseudorandom C8VEC.
%
% Discussion:
%
% The angles should be uniformly distributed between 0 and 2 * PI,
% the square roots of the radius unif... | {"author": "johannesgerer", "repo": "jburkardt-m", "sha": "1726deb4a34dd08a49c26359d44ef47253f006c1", "save_path": "github-repos/MATLAB/johannesgerer-jburkardt-m", "path": "github-repos/MATLAB/johannesgerer-jburkardt-m/jburkardt-m-1726deb4a34dd08a49c26359d44ef47253f006c1/uniform/c8vec_uniform_01.m"} |
from __future__ import division
import numpy
from chainer.dataset import iterator
from chainer.iterators.order_samplers import ShuffleOrderSampler
class SerialIterator(iterator.Iterator):
"""Dataset iterator that serially reads the examples.
This is a simple implementation of :class:`~chainer.dataset.Iter... | {"hexsha": "ceb7b2c147a398386528d52e3ce53e77a4340137", "size": 6119, "ext": "py", "lang": "Python", "max_stars_repo_path": "chainer/iterators/serial_iterator.py", "max_stars_repo_name": "maomran/chainer", "max_stars_repo_head_hexsha": "a69103a4aa59d5b318f39b01dbcb858d465b89cf", "max_stars_repo_licenses": ["MIT"], "max_... |
import pandas as pd
import numpy as np
import visualml as vml
from sklearn.datasets import make_classification
from sklearn.svm import SVC
from sklearn.ensemble import RandomForestClassifier as RF
from sklearn.neighbors import KNeighborsClassifier as KNN
import matplotlib.pyplot as plt
import matplotlib
matplotlib.use(... | {"hexsha": "6199eca75213e786622562b8a2b86e6f8b0d5f25", "size": 3740, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_visualml.py", "max_stars_repo_name": "WittmannF/visual-ml", "max_stars_repo_head_hexsha": "f2e967688d2d2fe22c275eeee46d9f7132311fd5", "max_stars_repo_licenses": ["BSD-4-Clause"], "max_s... |
#!/usr/bin/env python3
import sys
sys.path.append('../helper_utils')
sys.path.append('/home/kkalyan3/code/helper_utils')
import time
from sklearn.utils import shuffle
from utils import load_array, max_model, max_transform
from sklearn.svm import SVC
import logging
import numpy as np
from sklearn.metrics import accurac... | {"hexsha": "e1d8504123824e81db586d5018b704ec573d37ba", "size": 3594, "ext": "py", "lang": "Python", "max_stars_repo_path": "code/forest/uniform_seq.py", "max_stars_repo_name": "krishnakalyan3/MixtureOfExperts", "max_stars_repo_head_hexsha": "ec43e312b3b3abddf0bd7281535842e73268b771", "max_stars_repo_licenses": ["MIT"],... |
[STATEMENT]
lemma sorted_inorder_induct_last: "sorted_less (inorder (Node ts t)) \<Longrightarrow> sorted_less (inorder t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. sorted_less (inorder (Node ts t)) \<Longrightarrow> sorted_less (inorder t)
[PROOF STEP]
by (simp add: sorted_wrt_append) | {"llama_tokens": 106, "file": "BTree_BPlusTree", "length": 1} |
'''Backtest Moving Average (MA) crossover strategies
'''
import math
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from MA import MABacktester
class MADelayBacktester(MABacktester):
'''Backtest a Moving Average (MA) crossover strategy
When you get a signal you wa... | {"hexsha": "a912a45e345dd86e2ba818df1607fce8ad09db1a", "size": 1485, "ext": "py", "lang": "Python", "max_stars_repo_path": "backtesters/MA_delay.py", "max_stars_repo_name": "learn-crypto-trading/crypto-price-analysis", "max_stars_repo_head_hexsha": "70618ecf296e40404f3ebaa2e640c90097c227cb", "max_stars_repo_licenses": ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.