text stringlengths 0 1.25M | meta stringlengths 47 1.89k |
|---|---|
from data_analysis import DataManager
from vectorizer import Vectorizer
import numpy as np
import pickle
from tempfile import TemporaryFile
dm = DataManager('./data/spam.csv')
dm.most_frequent_character_in_spam()
dm.most_frequent_character_in_legit()
dm.most_frequent_characters()
dm.average_text_length()
sentences, ... | {"hexsha": "520e00d2aba3a3cab029f1bd9b0af7c8cfd51054", "size": 1003, "ext": "py", "lang": "Python", "max_stars_repo_path": "Dataset Exploration/SMS Spam Collection Dataset/features_extraction.py", "max_stars_repo_name": "AhmedHani/Kaggle-Machine-Learning-Competitions", "max_stars_repo_head_hexsha": "b306816463affb05956... |
import netCDF4
import numpy as np
from keras.models import load_model
from utils.evaluation.reconstruction_models_evaluator import evaluate_single_case
from matplotlib import pyplot as plt
import cmocean
def myround(x, base=5):
return base * round(x/base)
plt.rcParams.update({'font.size': 14})
model_path = r'C:... | {"hexsha": "29c0a68a315765fa7e5442077722e2054dabe04d", "size": 4425, "ext": "py", "lang": "Python", "max_stars_repo_path": "utils/visualization/raw_data_reader.py", "max_stars_repo_name": "mahmoud-al-najar/bathymetry_estimation", "max_stars_repo_head_hexsha": "ec8e0c62a574bc3cd007e55d5ab2d74d44c194c9", "max_stars_repo_... |
#!/usr/bin/env python3
import numpy as np
import unittest
import scipy.stats
from lines.Lines import Lines
from lines.Point import Point
import matplotlib.pyplot as plt
# example of two lines
# First import sample data generated from two lines
data = np.loadtxt("data/xys_2lines.txt", delimiter=",")
# visualize the d... | {"hexsha": "385ffd680f34f95575fc43028858becffa0790cc", "size": 1374, "ext": "py", "lang": "Python", "max_stars_repo_path": "example1.py", "max_stars_repo_name": "AlexTaguchi/lines", "max_stars_repo_head_hexsha": "d091d52350d0bedc3c8af0aa5438b6a1da95151d", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "ma... |
#define CATCH_CONFIG_MAIN
#include "catch.hpp"
#include <Eigen/Dense>
#include <Eigen/Sparse>
#include <Eigen/Eigenvalues>
#include <unsupported/Eigen/KroneckerProduct>
#include <Spectra/MatOp/SparseSymMatProd.h>
#include <Spectra/SymEigsSolver.h>
#include <iostream>
#include <cassert>
#include <random>
#include ... | {"hexsha": "8ae4001ff4ed3c2d405ed8986ead1ce9fe79b23d", "size": 5357, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "tests/test_xxz_gs.cpp", "max_stars_repo_name": "chaeyeunpark/ExactDiagonalization", "max_stars_repo_head_hexsha": "c93754e724486cc68453399c5dda6a2dadf45cb8", "max_stars_repo_licenses": ["MIT"], "max... |
from ConfigSpace.configuration_space import ConfigurationSpace
from ConfigSpace.conditions import EqualsCondition, InCondition
from ConfigSpace.hyperparameters import UniformFloatHyperparameter, \
UniformIntegerHyperparameter, CategoricalHyperparameter, \
UnParametrizedHyperparameter
import numpy as np
from au... | {"hexsha": "07b1e95ec0c25474c435d570d2d8287dffdc4ad4", "size": 6225, "ext": "py", "lang": "Python", "max_stars_repo_path": "autodc/components/models/regression/libsvm_svr.py", "max_stars_repo_name": "dingdian110/AutoDC", "max_stars_repo_head_hexsha": "f5ccca6bea993bcff3e804fb859e8b25ae020b5c", "max_stars_repo_licenses"... |
import numpy as np
import scipy.io as sio
import torch
from skimage.data import shepp_logan_phantom
from skimage.transform import resize
from torchkbnufft import AdjMriSenseNufft, MriSenseNufft
from torchkbnufft.mri.mrisensesim import mrisensesim
def main():
dtype = torch.double
spokelength = 512
targ_siz... | {"hexsha": "f5eed1e0f98e78680c0f6e06a09ea3e0c23eb7e4", "size": 2519, "ext": "py", "lang": "Python", "max_stars_repo_path": "generate_data.py", "max_stars_repo_name": "mmuckley/torchkbnufft_demo", "max_stars_repo_head_hexsha": "bd19612c1cdfd9597732b74947a79bd2c9689267", "max_stars_repo_licenses": ["MIT"], "max_stars_cou... |
[STATEMENT]
lemma fps_one_code [code]: "1 = fps_of_ratfps 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. 1 = fps_of_ratfps 1
[PROOF STEP]
by simp | {"llama_tokens": 77, "file": "Linear_Recurrences_RatFPS", "length": 1} |
module Ch05.Exercise_5_2_7
import Ch05.LambdaCalculus
import Ch05.Exercise_5_2_5
%default total
||| `le m n` tests whether `m` is less than or equal to `n`
le : Term
le = let m = Var 0
n = Var 1 in
Abs 0 (Abs 1 (iszro . (sub . m . n)))
||| Test whether two Church numerals are equal
equal : Term
eq... | {"hexsha": "5923c7300ea289f5689e453868ea1390ed18fba4", "size": 479, "ext": "idr", "lang": "Idris", "max_stars_repo_path": "Ch05/Exercise_5_2_7.idr", "max_stars_repo_name": "mr-infty/tapl", "max_stars_repo_head_hexsha": "3934bfe42b93f84c1bf35b7b34cf30b3a7fd7399", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 6,... |
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | {"hexsha": "62b01902cc27b3cb079eb73d5e0dda882f71edd4", "size": 8914, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_reverse_mode.py", "max_stars_repo_name": "Patil2099/tangent", "max_stars_repo_head_hexsha": "e38245dfceb715a0300479171b2ccd1229d46346", "max_stars_repo_licenses": ["Apache-2.0"], "max_s... |
#include "OcropusLlocsPageParser.hpp"
#include "OcropusLlocsParserLine.hpp"
#include "OcropusLlocsParserPage.hpp"
#include "ParserPage.hpp"
#include "core/Box.hpp"
#include "core/Line.hpp"
#include "core/Page.hpp"
#include "core/util.hpp"
#include "llocs.hpp"
#include "utils/Error.hpp"
#include <boost/filesystem/operat... | {"hexsha": "7eb7f878fe8380151581013d160fdd425ba602be", "size": 2505, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "rest/src/parser/OcropusLlocsPageParser.cpp", "max_stars_repo_name": "cisocrgroup/pocoweb", "max_stars_repo_head_hexsha": "93546d026321744602f6ee90fd82503da56da3b7", "max_stars_repo_licenses": ["Apac... |
import unittest
import numpy as np
import torch
from qmctorch.scf import Molecule
from qmctorch.wavefunction import SlaterJastrow
from ...path_utils import PATH_TEST
from .second_derivative import second_derivative
import matplotlib.pyplot as plt
class TestRadialSlater(unittest.TestCase):
def setUp(self):
... | {"hexsha": "8aacaa004902cf72fbc196759b5416aa6f6f9b9b", "size": 5918, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/wavefunction/orbitals/test_radial_sto.py", "max_stars_repo_name": "NLESC-JCER/QMCTorch", "max_stars_repo_head_hexsha": "c56472cd3e9cc59f2e01a880e674b7270d2cdc2b", "max_stars_repo_licenses": ... |
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | {"hexsha": "b145aa3afb27358594910cd1a0b6f0bd929dbdf2", "size": 7828, "ext": "py", "lang": "Python", "max_stars_repo_path": "evaluate_video.py", "max_stars_repo_name": "xinli94/kinetics-i3d", "max_stars_repo_head_hexsha": "982ddd31ae8de95847d470d8acfa54f9817c8a08", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_c... |
import librosa
import numpy as np
from mcd.mcd_computation import (get_mcd_between_mel_spectograms,
get_mcd_between_wav_files)
# region use_dtw=True
def test_len_of_output():
res_similar = get_mcd_between_wav_files(
"examples/similar_audios/original.wav", "examples/similar_audi... | {"hexsha": "7ec1fc2efeb827c3c08f5f3721c91350ba9852e6", "size": 9102, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_mcd_computation.py", "max_stars_repo_name": "nikbat56/mel_cepstral_distance", "max_stars_repo_head_hexsha": "d391416750882ddedfdecc40c4e90c3946d4f187", "max_stars_repo_licenses": ["MIT"... |
/**
* Facebook Internet Explorer Toolbar Software License
* Copyright (c) 2009 Facebook, Inc.
*
* Permission is hereby granted, free of charge, to any person or organization
* obtaining a copy of the software and accompanying documentation covered by
* this license (which, together with any graphical images included ... | {"hexsha": "aff6c32e18c6b34dd2a6cd5abef06a60e5440613", "size": 4903, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "Sources/util/JavaScriptUtils.cpp", "max_stars_repo_name": "facebookarchive/ie-toolbar", "max_stars_repo_head_hexsha": "cfcc1a8ffd6d6c7d8b1e12c8317ff728d2173cac", "max_stars_repo_licenses": ["Apache-... |
integer function foo(i)
integer, intent(in) :: i
foo = i + 3
end function
program main
integer :: foo
integer :: d = 2
integer :: e
e = foo(d)
end program
| {"hexsha": "27105cd1ab362066c9e4e170fcbfd2a6b716c871", "size": 174, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "tests/nonsmoke/functional/CompileTests/experimental_fortran_tests/function_4.f90", "max_stars_repo_name": "ouankou/rose", "max_stars_repo_head_hexsha": "76f2a004bd6d8036bc24be2c566a14e33ba4f825",... |
#include <glad/glad.h>
#include <GLFW/glfw3.h>
#include <Eigen/Dense>
#include <stdio.h>
#include <iostream>
#include <fstream>
#include <string>
#include <cmath>
#include "matutils.hpp"
#include "shader.hpp"
#define STB_IMAGE_IMPLEMENTATION
#include "stb_image.h"
#define RES_PATH(FILE) (std::string(RES_DIR)+std::st... | {"hexsha": "5fa7064c4500d6bfa17e8c0c1b02e21bdfbdcd5a", "size": 7593, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "glfw-test/main.cpp", "max_stars_repo_name": "Hyrtsi/glxblt", "max_stars_repo_head_hexsha": "3ca54a5b83e69e4d429ef22226d258296df14c23", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "m... |
import QL.FOL.completeness.skolem QL.FOL.completeness.herbrand
universes u
open_locale logic_symbol aclogic
variables {L : fol.language.{u}}
namespace pl
variables {T : Theory (fol.herbrand_basis L)}
namespace provable
lemma to_fol {p : formula (fol.herbrand_basis L)} (h : equal_axioms L ⊢ p) : ⬝⊢ p.to_fol :=
begi... | {"author": "iehality", "repo": "lean-logic", "sha": "201cef2500203f7de83deb7fa8287934e2e142b2", "save_path": "github-repos/lean/iehality-lean-logic", "path": "github-repos/lean/iehality-lean-logic/lean-logic-201cef2500203f7de83deb7fa8287934e2e142b2/src/QL/FOL/completeness/completeness.lean"} |
[STATEMENT]
lemma has_real_derivative_powr:
assumes "z > 0"
shows "((\<lambda>z. z powr r) has_real_derivative r * z powr (r - 1)) (at z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. ((\<lambda>z. z powr r) has_real_derivative r * z powr (r - 1)) (at z)
[PROOF STEP]
proof (subst DERIV_cong_ev[OF refl _ refl])... | {"llama_tokens": 1091, "file": null, "length": 12} |
import torch.nn as nn
import torch
import numpy as np
def train(net, hp, train_loader, optimizer, lr_scheduler, gpu, task_id_flag=False, verbose=False):
device = torch.device(gpu if torch.cuda.is_available() else 'cpu')
net.to(device)
for epoch in range(hp['epochs']):
train_loss = 0.0
train_acc = 0.0
... | {"hexsha": "0fb504f053c54ecc584ace58597f80828df58c13", "size": 2686, "ext": "py", "lang": "Python", "max_stars_repo_path": "utils/run_net.py", "max_stars_repo_name": "neurodata/ood-tl", "max_stars_repo_head_hexsha": "36fd1a67187bd19ead2ed84757ec04ed4839db57", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 2, "m... |
from numpy import zeros
from InitNgN import InitNgN
from InitNgN import InitNgN_f
from gwlfe.Memoization import memoize
def NGAppManN(NGPctManApp, GrazingAnimal_0, NumAnimals, AvgAnimalWt, AnimalDailyN):
result = zeros((12,))
init_ng_n = InitNgN(GrazingAnimal_0, NumAnimals, AvgAnimalWt, AnimalDailyN)
for... | {"hexsha": "1c5913d300765b75371d0a942902638e9b7262b8", "size": 590, "ext": "py", "lang": "Python", "max_stars_repo_path": "gwlfe/AFOS/nonGrazingAnimals/Loads/NGAppManN.py", "max_stars_repo_name": "mudkipmaster/gwlf-e", "max_stars_repo_head_hexsha": "9e058445537dd32d1916f76c4b73ca64261771cd", "max_stars_repo_licenses": ... |
using Test, TreesHeaps
import TreesHeaps: link!, cut!, getdir, opposite
test_show(x) = show(IOBuffer(), x)
test_showmime(x) = show(IOBuffer(), MIME{Symbol("text/plain")}(), x)
@testset "Constructors" begin
@test SBN(1) == SBN(Int, 1.0)
@test HBN(1) == HBN(Int, 1.0)
@test RBN(1) == RBN(Int, 1.0)
@test ... | {"hexsha": "4625a94a76b2a007e14752673ed62474c0fda463", "size": 6970, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/runtests.jl", "max_stars_repo_name": "Jejulia/DSTrees.jl", "max_stars_repo_head_hexsha": "e93e6b321192c3e059ebba5b24d7bc00af3a652b", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, "... |
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 10 14:53:32 2018
@author: zyv57124
"""
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 10 13:03:08 2018
@author: zyv57124
"""
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.colors as colors
from sklearn.naive_bayes import GaussianNB #Scikit lea... | {"hexsha": "0935f441f7d59c99020a020d38a4a43fa7903f8d", "size": 1585, "ext": "py", "lang": "Python", "max_stars_repo_path": "AstroMl/Chapter9/9.3.3 final.py", "max_stars_repo_name": "vais-ral/CCPi-ML", "max_stars_repo_head_hexsha": "ca9baeb0dd5db3a97ac8ab9e33e03aeae42ebfa4", "max_stars_repo_licenses": ["Apache-2.0"], "m... |
import numpy as np
import torch
from torch import nn
import torch.nn.functional as F
def get_args(parser):
"""Add texture model specific options to the parser"""
parser.add_argument(
'--texture_size', default=256, type=int,
help='texture size')
parser.add_argument('--texture_path', type=... | {"hexsha": "dcf147212857f2f5bc10698e2d3d52d426e3ebb2", "size": 3287, "ext": "py", "lang": "Python", "max_stars_repo_path": "models/texture_model.py", "max_stars_repo_name": "saic-violet/textured_avatars", "max_stars_repo_head_hexsha": "114e94e92ee0a84e2757a4223edfe8b2b4de3ec5", "max_stars_repo_licenses": ["MIT"], "max_... |
import collections
import re
import numpy as np
from guesswhat.statistics.abstract_plotter import *
import pandas as pd
import seaborn as sns
stopwords = ["a", "an", "is", "it", "the", "does", "do", "are", "you", "that",
"they", "doe", "this", "there", "hi", "his", "her", "its", "picture", "can", "he",... | {"hexsha": "6359e4ce1fa477a33e9f7769757d73d879784b57", "size": 1685, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/guesswhat/statistics/word_stats.py", "max_stars_repo_name": "devineproject/guesswhat", "max_stars_repo_head_hexsha": "512e136c868ceccf047cdba243cf46037d4037fe", "max_stars_repo_licenses": ["Ap... |
import cv2
import numpy as np
def resize_image(img, new_width, new_height):
"""Resize image to a ``new_width`` and ``new_height``.
Args:
img (np.array): An image.
new_width (int): New width.
new_height (int): New height.
Returns:
np.array: A resized image.
... | {"hexsha": "1253d4e606b4c4da5641639ba32ecf41868dcf58", "size": 6536, "ext": "py", "lang": "Python", "max_stars_repo_path": "image_base/opencv_transformation.py", "max_stars_repo_name": "miguelgfierro/pybase", "max_stars_repo_head_hexsha": "de8e4f11ed5c655e748178e65195c7e70a9c98af", "max_stars_repo_licenses": ["BSD-3-Cl... |
//==================================================================================================
/*!
Copyright 2015 NumScale SAS
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
*/
//====================================... | {"hexsha": "84a5cdf4c0dd49a2773648467266bac07dd2456d", "size": 2666, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "test/function/scalar/bitwise_xor.cpp", "max_stars_repo_name": "yaeldarmon/boost.simd", "max_stars_repo_head_hexsha": "561316cc54bdc6353ca78f3b6d7e9120acd11144", "max_stars_repo_licenses": ["BSL-1.0"... |
import scipy.io as sio
import numpy as np
from tensorflow.keras.models import Model
from tensorflow.keras.layers import Dense, Activation, Permute, Dropout, Concatenate, Average, Reshape, Multiply
from tensorflow.keras.layers import Conv2D, MaxPooling2D, AveragePooling2D, AveragePooling1D, Conv1D, MaxPooling1D
f... | {"hexsha": "d4c20bd397dd86bccb1e784c4aa26ce57c31cd09", "size": 8910, "ext": "py", "lang": "Python", "max_stars_repo_path": "An example final/Temporal_Spatial_filters_save.py", "max_stars_repo_name": "snasiri-mgh/deep-Multi-View-Attention-based-Networks-Seizure-Detection", "max_stars_repo_head_hexsha": "db80912af1e27924... |
# -*- coding: utf-8 -*-
'''
Created on Fri Mar 8 10:10:57 2019
@author:
Visa Suomi
Turku University Hospital
February 2019
@description:
This code is used for feature selection for different regression models
'''
#%% clear variables
%reset -f
%clear
#%% import necessary librarie... | {"hexsha": "472ff187f9740833a6957e499b24730f3d8e85b2", "size": 33491, "ext": "py", "lang": "Python", "max_stars_repo_path": "feature_selection.py", "max_stars_repo_name": "vsuomi/radiation-dose", "max_stars_repo_head_hexsha": "6a97e282b7b8a06cde7973ceeebb14ea3ef60f70", "max_stars_repo_licenses": ["MIT"], "max_stars_cou... |
import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(1, 100, 100)
y1 = np.log(x)
y2 = np.log2(x)
plt.plot(x, y1)
plt.plot(x, y2)
plt.grid(True)
plt.savefig('../../img/question_4_plots/c.png')
| {"hexsha": "2bd10e49da2080329e628c6632f3873c66d659cf", "size": 209, "ext": "py", "lang": "Python", "max_stars_repo_path": "week1/plots/question_4/c.py", "max_stars_repo_name": "ammiranda/CS325", "max_stars_repo_head_hexsha": "f40b6cc0f62186f6be60e6f017f070790e442e76", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
import numpy as np
import chainer
from chainer.backends import cuda
from chainer import Function, gradient_check, report, training, utils, Variable
from chainer import datasets, iterators, optimizers, serializers
from chainer import Link, Chain, ChainList
import chainer.functions as F
import chainer.links as L
from cha... | {"hexsha": "b6494499f7fc9413f5c58d3640e54c9719ba433d", "size": 4768, "ext": "py", "lang": "Python", "max_stars_repo_path": "auto_encoder_tests.py", "max_stars_repo_name": "yuishihara/AutoEncoders", "max_stars_repo_head_hexsha": "96786d7d367021498a68afe3cb8f0f383d2af941", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
#############"
# Building App
#############
# Core pkgs
import streamlit as st
import altair as alt
## EDA Pkgs
import pandas as pd
import numpy as np
## Utils
import joblib
## Load Emotion model
pipe_lr = joblib.load('../models/emotion_classification_pipe_lr06.pkl')
## Fxn
def predict_emotion(docx):
... | {"hexsha": "971c7b0a04218a075f5111119ea96c18ec4db212", "size": 2453, "ext": "py", "lang": "Python", "max_stars_repo_path": "App/app.py", "max_stars_repo_name": "rdius/end-to-end-streamlit-project", "max_stars_repo_head_hexsha": "cf4fc5b687d665991c57cc457eb0bcb42f70ad7f", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
import json
import yaml
import pandas as pd
import numpy as np
def testNanInList(test_list : list):
'''
test code for lists to check Nans
'''
if np.nan in test_list:
print('list contains nans,cant process\nplease update the config')
return
else:
print('Nan tes... | {"hexsha": "625469eb95f9012aae76748f04eab248eb1ee0f9", "size": 2086, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_code.py", "max_stars_repo_name": "sairamdeep/code_04032022-sairamreddymaddireddy", "max_stars_repo_head_hexsha": "7150c281ef0f189cca6700b42bcd4701da9a0058", "max_stars_repo_licenses": [... |
[STATEMENT]
lemma map_add_upds[simp]: "m1 ++ (m2(xs[\<mapsto>]ys)) = (m1++m2)(xs[\<mapsto>]ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. m1 ++ m2(xs [\<mapsto>] ys) = (m1 ++ m2)(xs [\<mapsto>] ys)
[PROOF STEP]
by (simp add: map_upds_def) | {"llama_tokens": 124, "file": null, "length": 1} |
import sys
import pdb
import time
import numpy as np
import pyaudio, audioop
import ggplot
import pandas as pd
import utils
REFRESH_RATE = .001
CHUNK_SIZE = 1024
FORMAT = pyaudio.paInt16
CHANNELS = 1
SAMPLE_RATE = 44100
def main(log):
log.debug('initializing app')
p = pyaudio.PyAudio()
# Open audio in... | {"hexsha": "c6773206f2fa40987d631948399c18b163d58644", "size": 1624, "ext": "py", "lang": "Python", "max_stars_repo_path": "app.py", "max_stars_repo_name": "ekalosak/audio-in", "max_stars_repo_head_hexsha": "ab4ffbcd71c3f5578aa178ee6794ddeae55facb3", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_sta... |
#!/usr/bin/env python
from matplotlib import pyplot as plt
from matplotlib import cm
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
colorList=['k','g', 'b', 'y', 'm' ,'c' ,'r' ]
shapelist=['*','^','s','o']
def draw(points,group,vector,dimension):
fig = plt.figure()
if dimension==2:
ax=fig.add_subplot... | {"hexsha": "ecb0ede6674285f4d7f84a1727bb26fe849f7ce9", "size": 1905, "ext": "py", "lang": "Python", "max_stars_repo_path": "project1/drawPlat.py", "max_stars_repo_name": "yo-ga/Neural-network", "max_stars_repo_head_hexsha": "e4e87ce9db56d1fe84fab4d8ce91b82716f2523a", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
import glob
import math
import os
os.environ["CUDA_VISIBLE_DEVICES"] = "-1"
from pathlib import Path
import cv2
import numpy
import sys
# sys.path.append('.')
from kaggle_ndsb2017 import helpers
from kaggle_ndsb2017 import settings
from kaggle_ndsb2017 import step2_train_nodule_detector
from kaggle_ndsb2017.step1_pr... | {"hexsha": "c65c62eabaaddc68ad7c2b488ecb9d2a980f5483", "size": 8535, "ext": "py", "lang": "Python", "max_stars_repo_path": "kaggle_ndsb2017/inference.py", "max_stars_repo_name": "cbd-nslc/LungCancerDetector", "max_stars_repo_head_hexsha": "50b2517814c68368a86752162d70b00115f9bd4a", "max_stars_repo_licenses": ["Apache-2... |
// Copyright 2020-2022 The Defold Foundation
// Copyright 2014-2020 King
// Copyright 2009-2014 Ragnar Svensson, Christian Murray
// Licensed under the Defold License version 1.0 (the "License"); you may not use
// this file except in compliance with the License.
//
// You may obtain a copy of the License, together wi... | {"hexsha": "b3b1a5321fe64d258a7c9773f2946143556c34de", "size": 12506, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "engine/texc/src/texc_enc_basis.cpp", "max_stars_repo_name": "cmarincia/defold", "max_stars_repo_head_hexsha": "2bf9ec3dfa2f59a9e1808f4768ff9a1fbaac61b4", "max_stars_repo_licenses": ["ECL-2.0", "Apa... |
"""
Integrates MODIS images for a new date to an existing worldgrid
Example invocation::
python rastercube/scripts/complete_ndvi_worldgrid.py
--tile=h10v09
--worldgrid=hdfs:///user/terrai/worldgrid
--dates_csv=$RASTERCUBE_TEST_DATA/1_manual/ndvi_dates.3.csv
"""
from __future__ import divis... | {"hexsha": "96fb82eac19b8d1613fd0acb601d63b7d5cc2358", "size": 8773, "ext": "py", "lang": "Python", "max_stars_repo_path": "rastercube/scripts/complete_ndvi_worldgrid.py", "max_stars_repo_name": "terrai/rastercube", "max_stars_repo_head_hexsha": "c8c6214fd682f72e94df4979f5d737cea4778617", "max_stars_repo_licenses": ["M... |
from pathlib import Path
import numpy as np
import pandas as pd
import pickle
from sim.simulate import fill_dataf, predict
from estimation.standard import getdf
dir = Path.cwd().resolve().parent
input_path = dir / "input"
output_path = dir / "output"
#################################################################... | {"hexsha": "95808db9c5aac02dbb1ebcbb79628b328e28046f", "size": 801, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/run.py", "max_stars_repo_name": "christianhilscher/dynasim", "max_stars_repo_head_hexsha": "881cfd3bd9d4b9291d289d703ec7da4a617a479a", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nul... |
[STATEMENT]
lemma small_all_tiny_ntsmcfs[simp]:
"small {\<NN>. \<exists>\<FF> \<GG> \<AA> \<BB>. \<NN> : \<FF> \<mapsto>\<^sub>S\<^sub>M\<^sub>C\<^sub>F\<^sub>.\<^sub>t\<^sub>i\<^sub>n\<^sub>y \<GG> : \<AA> \<mapsto>\<mapsto>\<^sub>S\<^sub>M\<^sub>C\<^sub>.\<^sub>t\<^sub>i\<^sub>n\<^sub>y\<^bsub>\<alpha>\<^esub> \<B... | {"llama_tokens": 4313, "file": "CZH_Foundations_czh_semicategories_CZH_SMC_Small_NTSMCF", "length": 18} |
# ====================================================================================== #
# Plotting helper functions.
# Author: Eddie Lee, edlee@csh.ac.at
# ====================================================================================== #
import numpy as np
from scipy.optimize import minimize
import matplotlib... | {"hexsha": "6edf01af910858331fdb7c870413b5261de6f5db", "size": 6936, "ext": "py", "lang": "Python", "max_stars_repo_path": "pyutils/plot.py", "max_stars_repo_name": "eltrompetero/innovation", "max_stars_repo_head_hexsha": "b59617f5f1486d7f4caf620192d5e8d95cf30f7f", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
module Path
import public Path.Parse
%access export
public export
data Absity = Abs | Rel
public export
data Fility = Dir | File
-- TODO: Maybe have it take a Fility too?
||| A valid part of a path. No slashes, no control characters.
data Part = RawPart String
Show Part where
show (RawPart s) = s
part : Stri... | {"hexsha": "050f248dbe52902e1dbe39a859ff1dec839b0e89", "size": 1448, "ext": "idr", "lang": "Idris", "max_stars_repo_path": "src/Path.idr", "max_stars_repo_name": "elba/path", "max_stars_repo_head_hexsha": "0b709249c6cc1ed012c140aa86d8209adffef703", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, "max_stars_re... |
import tensorflow as tf
import numpy as np
class StochasticPolicyGradientAgent():
"""
A Gaussian Policy Gradient based agent implementation
"""
def __init__(self, env, learning_rate = 0.001, discount_rate = 0.99, batch_size = 1, quiet = True):
self._optimizer = tf.train.AdamOptimizer(l... | {"hexsha": "ee5bca970caa5355052e68132d779625b5243c72", "size": 5917, "ext": "py", "lang": "Python", "max_stars_repo_path": "agent/stochastic_policy_gradient_agent.py", "max_stars_repo_name": "joshualee155/ml-stock-prediction", "max_stars_repo_head_hexsha": "15e33d7be8e4989902c7b68b1004e940b8baa942", "max_stars_repo_lic... |
import numpy as np
import matplotlib.pyplot as plt
import cv2
fig,ax = plt.subplots()
x,y = np.loadtxt('resultcv.csv', delimiter=',', unpack=True)
x2,y2 = np.loadtxt('result.csv', delimiter=',', unpack=True)
cap = cv2.VideoCapture('../input/inputVideo.avi')
i = 0
while(cap.isOpened()):
_,frame = cap.read()
... | {"hexsha": "29d1102ee474a8946ab401325df462a4e3a45455", "size": 565, "ext": "py", "lang": "Python", "max_stars_repo_path": "code/plot1.py", "max_stars_repo_name": "Eashwar-S/Visual_Odometry", "max_stars_repo_head_hexsha": "b7be7117d93797f1afa54e88ca4ce1f9e5747fe1", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
## Use Python to run Deep Autoencoder (feature selection)
## path - is a string to desired path location.
from typing import Union
import pandas as pd
import numpy as np
import torch
from numpy import ndarray
from torchvision import transforms
from torch import nn
import torch.nn.functional as F
from torch.autograd im... | {"hexsha": "7c37afeadc56346a3e91c4bbf8ee9c3512f1035e", "size": 5981, "ext": "py", "lang": "Python", "max_stars_repo_path": "example/1. Autoencoder.py", "max_stars_repo_name": "alby1976/Explainable-Deep-Autoencoder", "max_stars_repo_head_hexsha": "61e5dec988e07b197d470cbf749895dc58838b49", "max_stars_repo_licenses": ["M... |
#!/usr/bin/env python3
import matplotlib.pyplot as plt
import numpy as np
lib = np.load('../data/MNIST.npz')
print(lib.files)
X_train_3D = lib['X_train']
Y_train = lib['Y_train']
fig = plt.figure(figsize=(10, 10))
for i in range(100):
fig.add_subplot(10, 10, i + 1)
plt.imshow(X_train_3D[i])
plt.title(str... | {"hexsha": "757de8c11ecf5136e760d709dcf41eb93e9b5628", "size": 384, "ext": "py", "lang": "Python", "max_stars_repo_path": "supervised_learning/0x01-classification/show_multi_data.py", "max_stars_repo_name": "sebaslherrera/holbertonschool-machine_learning", "max_stars_repo_head_hexsha": "a4c09230688700aee199f4099de32261... |
[STATEMENT]
lemma remdups_adj_Cons':
"remdups_adj (x # xs) = x # remdups_adj (dropWhile (\<lambda>y. y = x) xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. remdups_adj (x # xs) = x # remdups_adj (dropWhile (\<lambda>y. y = x) xs)
[PROOF STEP]
by (induction xs) auto | {"llama_tokens": 123, "file": null, "length": 1} |
export
Path,
samplepath,
quadpathpoly,
pathmean,
esspath
"""
AllowedTimeType
Syntactic sugar for union type of Vector{Real} and LinSpace{Real} (types
accepted for the `samplelocalpath` function).
"""
const AllowedTimeType = Union{Vector{<:Real}, AbstractRange{<:Real}}
"""
Path
Type to st... | {"hexsha": "30847886e04726087090431caffa10516d3dd65c", "size": 5306, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/path.jl", "max_stars_repo_name": "UnofficialJuliaMirrorSnapshots/PDSampler.jl-f9d848e4-75a0-5321-a43a-fbaa97166838", "max_stars_repo_head_hexsha": "22bb24cc13cbba64f2f6ec3c1513773c5b8215ca", "m... |
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
import matplotlib.colors as colors
def truncate_colormap(cmap, minval=0.0, maxval=1.0, n=100):
new_cmap = colors.LinearSegmentedColormap.from_list(
'trunc({n},{a:.2f},{b:.2f})'.format(n=cmap.name, a=minval, b=maxval),
cmap(np.... | {"hexsha": "465595ea8fac7db78660462cdc22717b901158f3", "size": 3953, "ext": "py", "lang": "Python", "max_stars_repo_path": "visualization/modules/plot_heatmap.py", "max_stars_repo_name": "dieumynguyen/ZarrOptimalStorage", "max_stars_repo_head_hexsha": "b926f62416218aca427d93bc475cbf1c0fa76be1", "max_stars_repo_licenses... |
#!/usr/bin/env python
# coding=utf-8
import os
import logging
import time
import datetime
import numpy as np
from numba import jit, njit, prange
logging.getLogger('numba').setLevel(logging.WARNING)
logger = logging.getLogger("model")
from .utils import timer
def get_rng(seed=None):
"""
Get a new random nu... | {"hexsha": "fded56977ed64fdc525ba6913cad7d5f2ba35d99", "size": 13934, "ext": "py", "lang": "Python", "max_stars_repo_path": "oasishurricane/simulator.py", "max_stars_repo_name": "mtazzari/OasisHurricane", "max_stars_repo_head_hexsha": "e8f437bc894daf697dcf8981c81ee25bfb5900f9", "max_stars_repo_licenses": ["BSD-3-Clause... |
import os
from pathlib import Path
import librosa
import numpy as np
import soundfile
from tqdm import tqdm
###
noisy_dir = Path("~/Datasets/simulation_array26cm_20210119_shuf100/noisy").expanduser().absolute()
clean_dir = Path("~/Datasets/simulation_array26cm_20210119_shuf100/clean").expanduser().absolute()
text_dir... | {"hexsha": "b1fd17e2928be0392ed96b5e5d5742b97df0385b", "size": 2112, "ext": "py", "lang": "Python", "max_stars_repo_path": "tools/delete_slience.py", "max_stars_repo_name": "ShkarupaDC/FullSubNet", "max_stars_repo_head_hexsha": "2aef8b656376a42fbf519e0020636a893b56c4f8", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
# Copyright (c) 2018 PaddlePaddle 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 app... | {"hexsha": "89a9d70935b1470b8f752ccbbed02bf95b03b8fb", "size": 10662, "ext": "py", "lang": "Python", "max_stars_repo_path": "ernie-gram/finetune_mrc.py", "max_stars_repo_name": "JZZ-NOTE/ERNIE", "max_stars_repo_head_hexsha": "ff89c2a6baef9fd662a5b847224ca39e67d6ad11", "max_stars_repo_licenses": ["Apache-2.0"], "max_sta... |
import requests
import json
import pandas as pd
import numpy as np
import datetime
from django.shortcuts import render
from django.core.cache import cache
from .forms import UserForm
from statsmodels.tsa.arima_model import ARIMA as ai
# Create your views here.
def home(request):
if request.method... | {"hexsha": "cec7a15891258a5bfc6253f4d7acb511a84081de", "size": 6479, "ext": "py", "lang": "Python", "max_stars_repo_path": "forecaster/views.py", "max_stars_repo_name": "vishrutkmr7/ForexAI-Forecast", "max_stars_repo_head_hexsha": "16611bf1038be10d21c4105d0e26898dde24237a", "max_stars_repo_licenses": ["Apache-2.0"], "m... |
/*
* @file
* @author University of Warwick
* @version 1.0
*
* @section LICENSE
*
* @section DESCRIPTION
*
* Tests for the MeshSourceStructGenConfigJSON class
*/
#define BOOST_TEST_MODULE MeshSourceStructGenConfigJSON
#include <boost/test/unit_test.hpp>
#include <boost/test/output_test_stream.hpp>
#include <s... | {"hexsha": "e320a802eab4724874b646edd05257dbc4ef6cf1", "size": 7788, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "tests/geometry/mesh/implementation/source/MeshSourceStructGenConfigJSONTests.cpp", "max_stars_repo_name": "thorbenlouw/CUP-CFD", "max_stars_repo_head_hexsha": "d06f7673a1ed12bef24de4f1b828ef864fa459... |
# This file is part of astro_metadata_translator.
#
# Developed for the LSST Data Management System.
# This product includes software developed by the LSST Project
# (http://www.lsst.org).
# See the LICENSE file at the top-level directory of this distribution
# for details of code ownership.
#
# Use of this source code... | {"hexsha": "dfcd66991f244acc9ea510dab547aa68b135cfc6", "size": 9166, "ext": "py", "lang": "Python", "max_stars_repo_path": "python/astro_metadata_translator/file_helpers.py", "max_stars_repo_name": "lsst/astro_metadata_translator", "max_stars_repo_head_hexsha": "c2dde510d9bb45d1e60ff7412c1e651dcfeb32fe", "max_stars_rep... |
import numpy as np
def bound_nonuniform_sampler(*args):
x = np.random.randn(*args)*0.1 + 0.5
x[x < 0] = -x[x < 0]
x[x > 1] = x[x > 1] - 1
x[x < 0] = -x[x < 0]
return x
def uniform_sampler(*args):
x = np.random.rand(*args)
x = (x - 0.5) * 3
return x | {"hexsha": "f5314beeba197778415f8dd779bd309bc99bfcd1", "size": 282, "ext": "py", "lang": "Python", "max_stars_repo_path": "geomle/utils.py", "max_stars_repo_name": "stat-ml/GeoMLE", "max_stars_repo_head_hexsha": "89a33a4eba3f38151f2f2d159b5410b8b2a84291", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 7, "max_s... |
using MBL_ED
using Test
using JLD
@testset "MBL_ED.jl" begin
tasks = give_tasks( tol_n = 10
, up = 5
, J = 1.0
, Jp = 1.0
, Jz = 1.0
, W = 0.5:0.5:8.0
, k = (sqrt(5) - 1)/2
, samples = 10
)
t_data = load("./test_data.jld")
r1_t = cal_one_task(t_data["task"])
r2_t = primi... | {"hexsha": "01feb6d8c71671a0c2984edb290e79a412a8bcf5", "size": 731, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/runtests.jl", "max_stars_repo_name": "WeiMXi/MBL_ED.jl", "max_stars_repo_head_hexsha": "ab697d590195e2adde3148971f214e053fa5ed86", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, "max... |
[STATEMENT]
lemma run_poss_eq: "run \<A> s t \<Longrightarrow> gposs s = gposs t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. run \<A> s t \<Longrightarrow> gposs s = gposs t
[PROOF STEP]
by (induct rule: run.induct) auto | {"llama_tokens": 91, "file": "Regular_Tree_Relations_Tree_Automata_Tree_Automata", "length": 1} |
import datetime
import numpy as np
import matplotlib.pyplot as plt
from hmmlearn.hmm import GaussianHMM
from convert_to_timeseries import convert_data_to_timeseries
# Load data from input file
input_file = 'data_hmm.txt'
data = np.loadtxt(input_file, delimiter=',')
# Arrange data for training
X = np.column_stack([d... | {"hexsha": "8a315d021f714ba9e467d0a0a3e2cb3fde5a928f", "size": 1029, "ext": "py", "lang": "Python", "max_stars_repo_path": "Section_08_code/hmm.py", "max_stars_repo_name": "PacktPublishing/Python-Machine-Learning-Solutions-V-", "max_stars_repo_head_hexsha": "8bb80a43a7c64032c25c1023faaa29bbfbd39d45", "max_stars_repo_li... |
# -*- coding: utf-8 -*-
"""
This is the find module.
The find module supplies one function,
partial_autocorrelation()
"""
from statsmodels.tsa.stattools import pacf
import pandas as pd
def partial_autocorrelation(
data_frame: pd.DataFrame,
nlags: int = 40,
method: str = "ywunbiased",
alpha: float... | {"hexsha": "b6f6f187e873bcb893ebd4f56bc5aebe6a6a10ad", "size": 3197, "ext": "py", "lang": "Python", "max_stars_repo_path": "analytics_utils/partial_autocorrelation.py", "max_stars_repo_name": "patricksferraz/analytics-utils", "max_stars_repo_head_hexsha": "3b083e1d5eec9825bddf536d1f05db0643b2a710", "max_stars_repo_lice... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = "Christian Heider Nielsen"
__doc__ = r"""
Created on 06/04/2020
"""
from pathlib import Path
import numpy
from matplotlib import pyplot
from scipy.io import wavfile
from draugr.drawers import FastFourierTransformPlot, FastFourierTran... | {"hexsha": "66e2e40c49e7cca1d29e21ec919e51f7ed5369b7", "size": 2578, "ext": "py", "lang": "Python", "max_stars_repo_path": "samples/drawers/audio_spectrogram_plot.py", "max_stars_repo_name": "cnHeider/draugr", "max_stars_repo_head_hexsha": "b95e0bb1fa5efa581bfb28ff604f296ed2e6b7d6", "max_stars_repo_licenses": ["Apache-... |
[STATEMENT]
lemma mk_trace_thm:
"(mk_trace A s n = None) =
(s(n)=None | (\<exists>a. s(n)=Some(a) \<and> a \<notin> externals(asig_of(A))))
&
(mk_trace A s n = Some(a)) =
(s(n)=Some(a) \<and> a \<in> externals(asig_of(A)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. (mk_trace A s n = None) = (s n = ... | {"llama_tokens": 796, "file": null, "length": 4} |
import pandas as pd
import numpy as np
from itertools import chain
def reset_df_index(data_frame):
"""
Resets pandas data frame index, dropping current index and replacing it
with a "clean" index in place. Useful after data frame filtering and multi-
value column splitting.
:param data_frame: pan... | {"hexsha": "d52e609809748d6bf3e2e549aa677800e87ab921", "size": 3339, "ext": "py", "lang": "Python", "max_stars_repo_path": "data_import_scripts/df_editing.py", "max_stars_repo_name": "anapenedos/PhosQuest", "max_stars_repo_head_hexsha": "5a0b363b55850b25f67382b3fa4d227b3ec1c2df", "max_stars_repo_licenses": ["Apache-2.0... |
from datetime import datetime
import numpy as np
import pandas as pd
from pytest import raises
from featuretools.primitives.standard.datetime_transform_primitives import (
IsFederalHoliday,
)
def test_regular():
primitive_instance = IsFederalHoliday()
primitive_func = primitive_instance.get_function()
... | {"hexsha": "2db5e5de47c570b0a0c007c1b383f5848dfd9588", "size": 3004, "ext": "py", "lang": "Python", "max_stars_repo_path": "featuretools/tests/primitive_tests/test_is_federal_holiday.py", "max_stars_repo_name": "Featuretools/featuretools", "max_stars_repo_head_hexsha": "365abd9519d2eec8eec75936644a7b865d4ef40a", "max_s... |
import numpy as np
from infiniteremixer.data.aggregation.aggregator import Aggregator
class MeanAggregator(Aggregator):
"""MeanAggregator is responsible for aggregating a array using mean
across a specified axis.
"""
def __init__(self, aggregation_axis: int) -> None:
super().__init__("mean")... | {"hexsha": "ca169fbc0143f3612455ae915a7ea106e9cbf303", "size": 635, "ext": "py", "lang": "Python", "max_stars_repo_path": "infiniteremixer/data/aggregation/meanaggregator.py", "max_stars_repo_name": "nroldanf/infiniteremixer", "max_stars_repo_head_hexsha": "5ffc2fc85e9cbebf6196d5baa374ba4630f2e3c0", "max_stars_repo_lic... |
#include <cctbx/boost_python/flex_fwd.h>
#include <cctbx/sgtbx/space_group_type.h>
#include <cctbx/sgtbx/space_group_hash.h>
#include <boost/python/tuple.hpp>
#include <boost/python/class.hpp>
#include <boost/python/args.hpp>
#include <boost/python/return_arg.hpp>
#include <scitbx/boost_python/utils.h>
#include <boost... | {"hexsha": "af9de80953731ee3eb78f88d8c901bbaf34d858e", "size": 8347, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "cctbx/sgtbx/boost_python/space_group.cpp", "max_stars_repo_name": "rimmartin/cctbx_project", "max_stars_repo_head_hexsha": "644090f9432d9afc22cfb542fc3ab78ca8e15e5d", "max_stars_repo_licenses": ["BS... |
""" Copyright (C) 2019 Electronic Arts Inc. All rights reserved.
The module demonstrates interactively trainable Mountain Car agent based on Markov Ensemble."""
import gym
import numpy as np
import sys
sys.path.append('../../')
from common.action_info_types import ActionInfoType
from common.box_quantizer import BoxQu... | {"hexsha": "124455bbed2da1dc2259f67a18fed4be3ea306b4", "size": 2075, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/mountain_car/interactively_trainable_agent.py", "max_stars_repo_name": "electronicarts/interactive_training", "max_stars_repo_head_hexsha": "6a434bf1ebd97492cd0807803ee7d1451408534f", "ma... |
[STATEMENT]
lemma dom_const_map:
"dom (const_map v S) = S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. dom (const_map v S) = S
[PROOF STEP]
by(auto simp add: const_map_def) | {"llama_tokens": 81, "file": "Consensus_Refined_Consensus_Misc", "length": 1} |
!=========================================================================================
!Copyright (c) 2009-2019, The Regents of the University of Massachusetts, Amherst.
!E. Polizzi research lab
!All rights reserved.
!
!Redistribution and use in source and binary forms, with or without modification,
!are permitted... | {"hexsha": "0fb4d3ba99b49e3ccc7adc1d62ee553879639ad3", "size": 267793, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "applications/LinearSolversApplication/external_libraries/FEAST/4.0/src/kernel/dzfeast.f90", "max_stars_repo_name": "lkusch/Kratos", "max_stars_repo_head_hexsha": "e8072d8e24ab6f312765185b19d43... |
import cv2
import numpy as np
import matplotlib.pyplot as plt
#DATASET TRAINING
data= np.loadtxt('/home/alphabat69/OpenCV/samples/data/letter-recognition.data', dtype= 'float32', delimiter = ',', converters= {0: lambda ch: ord(ch)-ord('A')})
train, test = np.vsplit(data,2)
#train = np.vsplit(data,1)
responses, trainDa... | {"hexsha": "c5d263a6da981f1e13c9fcd622fa4da1475eacdb", "size": 1297, "ext": "py", "lang": "Python", "max_stars_repo_path": "KNearestNeighbour/knn.py", "max_stars_repo_name": "AlphaBAT69/OpticalCharacterRecognition", "max_stars_repo_head_hexsha": "a4d4845eaf8d4c081ef5a76a9dbefb43dbf1e330", "max_stars_repo_licenses": ["M... |
// Purpose: Gate base implement
// Created: 2018.11.14
// By: CasinoHe
#include "network/gate_base.h"
#include <boost/asio.hpp>
namespace simple_server {
boost::asio::io_context io_context;
CGateBase::CGateBase(int proto):
m_proto(proto) {
}
void CGateBase::initialize(const std::string &ip, const unsigned sh... | {"hexsha": "61e40154e4f7727b0c15b5a756debf9bbb643951", "size": 367, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "network/gate_base.cpp", "max_stars_repo_name": "CasinoHe/SimpleGameServer", "max_stars_repo_head_hexsha": "ad744e716135881485e7c9f5ac534a924ce85c5b", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# PROGRAMMER: Shankary Ravichelvam
# DATE CREATED: 10/03/2022
# REVISED DATE:
# PURPOSE: To retrieve command line inputs from user to train model
# All necessary imports of packages to be used
import argparse
import sys
import torch
from torchvision import datasets, t... | {"hexsha": "eeb88b1cb5d31d16d89b03b4e4cdea513859806f", "size": 8595, "ext": "py", "lang": "Python", "max_stars_repo_path": "train_final.py", "max_stars_repo_name": "ShankaryRavi/AIPND", "max_stars_repo_head_hexsha": "f32ac2edbde60492a6ea7a28f716e3d233fbef6a", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null,... |
[STATEMENT]
lemma tendsto_at_topI_sequentially_real:
fixes f :: "real \<Rightarrow> real"
assumes mono: "mono f"
and limseq: "(\<lambda>n. f (real n)) \<longlonglongrightarrow> y"
shows "(f \<longlongrightarrow> y) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. (f \<longlongrightarrow> y) at_top
[P... | {"llama_tokens": 2552, "file": null, "length": 36} |
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt
import subspacemethods.music as music
import subspacemethods.greedy as sgreedy
import cs_algorithms.greedy.iht as iht
import h5py
def gaussian_matrix(m, n, mean=0, stdev=1, seed=2, orthogonalize=False):
# Generate Gaussian sensing matrix
prn... | {"hexsha": "73fbecb2695bfb4be2b47076061f7e3ce2891a69", "size": 10299, "ext": "py", "lang": "Python", "max_stars_repo_path": "utils.py", "max_stars_repo_name": "AdriBesson/spl2018_joint_sparse", "max_stars_repo_head_hexsha": "bc52b31a9361c73f07ee52b4d5f36a58fb231c96", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
#pragma once
#include <string>
#include <boost/uuid/uuid.hpp>
#include <memory>
#include <chrono>
//TODO: Consider changing to base class instead of interface, as all types share some similar methods to return
//e.g. id, owner and so on.
namespace common::scheduler
{
class Task
{
public:
using Id_t = boost::uuids... | {"hexsha": "73dc1eac728c5ae50d9f8ad90dd38a226f576ec5", "size": 782, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "src/common/scheduler/task.hpp", "max_stars_repo_name": "pblxptr/hhctrl-management", "max_stars_repo_head_hexsha": "0f28031167b89bc2f9fc217eeddaa9d0909a1c50", "max_stars_repo_licenses": ["MIT"], "max_... |
import struct
import numpy as np
from readice import get_geo_coords
from netCDF4 import Dataset
def concentration(file_location, hemisphere, with_coords=False):
""" Reads Nasa Team sea ice concentration data.
Reads data from the NSIDC dataset "Sea Ice Concentrations from Nimbus-7 SMMR and DMSP SSM/I-SSMIS Pa... | {"hexsha": "4f15a495b56460c4cd2147a2410bb43aa5b2cdfd", "size": 10432, "ext": "py", "lang": "Python", "max_stars_repo_path": "readice/read_file.py", "max_stars_repo_name": "robbiemallett/read_ice", "max_stars_repo_head_hexsha": "e4b8adfe8ce7626fa8bee71138b04943c4df15bf", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
import pytest
import numpy as np
from digirock._base import (
Element,
_element_check,
_volume_sum_check,
_get_complement,
Switch,
Blend,
Transform,
)
@pytest.fixture(scope="module", params=[{"name": None}, {"name": "test"}])
def mock_Element(request):
name = request... | {"hexsha": "c35c0f247e26ed5f68ba2be3fc32b855e596ab76", "size": 9909, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_base.py", "max_stars_repo_name": "trhallam/digirock", "max_stars_repo_head_hexsha": "05b1199d741a384345a4930605be97369c9ec270", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nu... |
import GLWindow
import moderngl
from PIL import Image, ImageDraw, ImageFont
import numpy as np
wnd = GLWindow.create_window()
ctx = moderngl.create_context()
prog = ctx.program(
vertex_shader='''
#version 330
in vec2 in_vert;
in vec3 in_text;
out vec3 v_text;
void main()... | {"hexsha": "c7e0aa6c16c14fd8e622fd974c2ea3031735957e", "size": 1261, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/old-examples/texture_array.py", "max_stars_repo_name": "asnt/moderngl", "max_stars_repo_head_hexsha": "b39cedd8cf216c34e43371b4aec822f6084f0f79", "max_stars_repo_licenses": ["MIT"], "max_... |
import argparse
import collections
import concurrent.futures
import csv
import logging
import os
import pickle
import sys
import shutil
import subprocess32 as subprocess
import numpy as np
import sexpdata
import scipy.sparse
import inlining_tree
import py_common
def iterate_rundirs(rundirs):
for rundir in rundi... | {"hexsha": "db753705c3e78a554203eb37485ccdc897fc5900", "size": 11198, "ext": "py", "lang": "Python", "max_stars_repo_path": "analysis/extract_data_from_experiments.py", "max_stars_repo_name": "fyquah95/fyp-worker-dispatcher", "max_stars_repo_head_hexsha": "1ebf764e41202d18ccd1013ec2270caa6c44565a", "max_stars_repo_lice... |
"""
Known facts in assumptions module.
This module defines the facts in ``get_known_facts()``, and supports functions
to generate the contents in ``sympy.assumptions.ask_generated`` file.
"""
from sympy.core.cache import cacheit
from sympy.assumptions import Q
from sympy.assumptions.cnf import CNF
from sympy.logic.bo... | {"hexsha": "82f0f0cafe71a234e4687d8b64b4aff8cd11b72b", "size": 7348, "ext": "py", "lang": "Python", "max_stars_repo_path": "sympy/assumptions/facts.py", "max_stars_repo_name": "nihirag/sympy", "max_stars_repo_head_hexsha": "0a2f378e73f6e1f1f992aab63b2516b12439b728", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_sta... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Han Xiao <artex.xh@gmail.com> <https://hanxiao.github.io>
# NOTE: First install bert-as-service via
# $
# $ pip install bert-serving-server
# $ pip install bert-serving-client
# $
# simple similarity search on FAQ
import numpy as np
from bert_serving.client import Bert... | {"hexsha": "807d2a20f905f5f73392a23da177566aea3a2a0a", "size": 2878, "ext": "py", "lang": "Python", "max_stars_repo_path": "example/.example8 (copy).py", "max_stars_repo_name": "ahamdy96/servatic-ml", "max_stars_repo_head_hexsha": "8650fa1b3a702697356ee5c25b775403ccb4bda3", "max_stars_repo_licenses": ["MIT"], "max_star... |
"""This expert maximizes the Sharpe ratio of a portfolio."""
import time
import logging
from typing import Optional
from concurrent.futures.thread import ThreadPoolExecutor
import pandas as pd
import numpy as np
from scipy.optimize import minimize
from modules.instruments import Portfolio, Stock
from modules.server ... | {"hexsha": "3ffdaf334ed5e51836e0b09a2b35edf1cece2c8f", "size": 3844, "ext": "py", "lang": "Python", "max_stars_repo_path": "modules/experts/Sharpe.py", "max_stars_repo_name": "Sager611/ibkr-algotrading", "max_stars_repo_head_hexsha": "c3f177885efd06ddd9bd13deef5e372161db5b12", "max_stars_repo_licenses": ["Apache-2.0"],... |
import var_ranking_helper as helper
import pandas as pd
import numpy as np
def _validate_traintest_months(df, train_months, test_months):
# Make sure date format is as expected
for mm in train_months + test_months:
assert mm[:4] in ["2019", "2020", "2021"], mm
# All training months are before the... | {"hexsha": "350401fa3681c422536b7e38f21590e3e1206106", "size": 5397, "ext": "py", "lang": "Python", "max_stars_repo_path": "var_classification_helper.py", "max_stars_repo_name": "cyrusmaher/EpiScore", "max_stars_repo_head_hexsha": "4dfcc856cfb92f70f4389d09d54eb0ef9e3ab4e1", "max_stars_repo_licenses": ["MIT"], "max_star... |
import ClimaCore:
Fields,
Domains,
Topologies,
Meshes,
DataLayouts,
Operators,
Geometry,
Spaces
using OrdinaryDiffEq: ODEProblem, solve, SSPRK33
import Logging
import TerminalLoggers
Logging.global_logger(TerminalLoggers.TerminalLogger())
const FT = Float64
a = FT(0.0)
b = FT(4pi)
n =... | {"hexsha": "7d6145dbd0a213caa5db7c33dc0399db59cb0107", "size": 5432, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "examples/column/advect.jl", "max_stars_repo_name": "CliMA/ClimaCore.jl", "max_stars_repo_head_hexsha": "e28309249a4c0dea0e8bb897b4dc9ebc376fa94e", "max_stars_repo_licenses": ["Apache-2.0"], "max_st... |
# -*- coding: utf-8 -*-
"""
Created on Sat Nov 27 11:03:45 2021
@author: dariu
"""
import numpy as np
import pandas as pd
import os
from tqdm import tqdm
import pacmap
import matplotlib.pyplot as plt
from sklearn.manifold import TSNE
import umap
from sklearn.cluster import KMeans
from sklearn.cluster import DBSCAN
#... | {"hexsha": "5adefb5f52a14c3c45982db255fa607d2b163803", "size": 5471, "ext": "py", "lang": "Python", "max_stars_repo_path": "otherCodeTaskSnippets/26.11.2021.py", "max_stars_repo_name": "s2812135/Data_Challenges_WiSe2122", "max_stars_repo_head_hexsha": "a55372f444e7344af4e2e1f04e4244fb8cefeefe", "max_stars_repo_licenses... |
import os
import random
import numpy as np
import time
from tqdm import tqdm
os.system("sudo ./refresh.sh")
os.system("mpiexec -n 1 src/C/IOR -f read_8n_3g")
os.system("sudo ./refresh.sh")
os.system("mpiexec -n 1 src/C/IOR -f read_8n_3g_ec") | {"hexsha": "19c5ba9710ea0e1f11b1849c5b20629b505b63f7", "size": 242, "ext": "py", "lang": "Python", "max_stars_repo_path": "improvement.py", "max_stars_repo_name": "LargerPanda/IOR-ec", "max_stars_repo_head_hexsha": "b5f03cdb6a70a491dc7ecbd314f107ac12717ebd", "max_stars_repo_licenses": ["BSD-4-Clause-UC"], "max_stars_co... |
[STATEMENT]
lemma one_right_assertion [simp]: "x \<in> assertion \<Longrightarrow> x * 1 = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. x \<in> assertion \<Longrightarrow> x * (1::'a) = x
[PROOF STEP]
apply (drule assertion_prop)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. x * \<top> \<sqinter> (1::'a) = ... | {"llama_tokens": 1217, "file": "MonoBoolTranAlgebra_Mono_Bool_Tran_Algebra", "length": 15} |
\section*{Executive Summary to Volume I}
\label{sec:executive-1}
\addcontentsline{toc}{section}{\nameref{sec:executive-1}}
\markboth{Executive Summary to Volume I}{Executive Summary to Volume I}
\subsection*{Russian Social Media Campaign}
The Internet Research Agency (IRA) carried out the earliest Russian interferenc... | {"hexsha": "e89ec24192e328fe37713096d348bcb87e30db96", "size": 23857, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "src/volume-1/executive-summary.tex", "max_stars_repo_name": "ascherer/mueller-report", "max_stars_repo_head_hexsha": "3aa16a20104f48623ce8e12c8502ecb1867a40f8", "max_stars_repo_licenses": ["CC-BY-3... |
# -*- coding: utf-8 -*-
"""
Created on Sat Aug 31 17:16:57 2019
This code works with 'kalman_full.ino'
> Connect your arduino to Serial port
> Upload the 'kalman_full.ino' to your arduino
> Eventually modify the port name "COM7" below to match yours
> Run this code while your arduino transmits data
To run thi... | {"hexsha": "b01d22b840bf028492696cac82963cebabb11121", "size": 2878, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/kalman_full/kalman_full_matplotlib.py", "max_stars_repo_name": "rfetick/Kalman", "max_stars_repo_head_hexsha": "fead3b06d221090f1c46897773b4a659b9e51ffe", "max_stars_repo_licenses": ["MIT... |
import numpy as np
import mbuild as mb
class Ester(mb.Compound):
"""A ester group -C(=O)O-. """
def __init__(self):
super(Ester, self).__init__()
mb.load('ester.pdb', compound=self, relative_to_module=self.__module__,
infer_hierarchy=False)
self.translate(-self[0].pos... | {"hexsha": "78f7af8a14cd73241c15199db246ede5056109d9", "size": 713, "ext": "py", "lang": "Python", "max_stars_repo_path": "mbuild/lib/moieties/ester.py", "max_stars_repo_name": "chrisiacovella/mbuild", "max_stars_repo_head_hexsha": "f4b880e0605c03f0612e087712df4836c47bb29e", "max_stars_repo_licenses": ["MIT"], "max_sta... |
import os
import tqdm
from pprint import pprint as pp
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import numpy as np
import fire
from prepare_dataset import get_epoch, normalise, denormalise, npmse
from model import IN, IN_ODE
TIMESTEP_TYPES = ["s", "e"] # start... | {"hexsha": "4839eb359a0a938d34ed90018fdca2b62625a5a6", "size": 15954, "ext": "py", "lang": "Python", "max_stars_repo_path": "prototypes/orbit/train_IN.py", "max_stars_repo_name": "phcavelar/graph-odenet", "max_stars_repo_head_hexsha": "cba1224c041e53ea221e31bf9103ef950b8bd460", "max_stars_repo_licenses": ["MIT"], "max_... |
import sys, os, csv, socket, shutil, pickle, subprocess
from matplotlib import rcParams
import traceback
import matplotlib.pyplot as plt
from scipy import sparse
import numpy as np
from pprint import pprint
from datetime import datetime
import win32com.client
from datetime import datetime, date, timedelta
from dateutil... | {"hexsha": "c752e11e5d47f5dc4f91347c0dc42d44ba102264", "size": 24323, "ext": "py", "lang": "Python", "max_stars_repo_path": "eom_utils.py", "max_stars_repo_name": "deakinmt/entsoe_outage_models", "max_stars_repo_head_hexsha": "dc7544f579edf650a27f29f15a031ea8d5988b59", "max_stars_repo_licenses": ["MIT"], "max_stars_cou... |
import os
import collections
import subprocess
import sys
import time
import warnings
from copy import deepcopy
from distutils import dir_util
from multiprocessing import Process
import numpy as np
import avod
import avod.builders.config_builder_util as config_builder
from avod.builders.dataset_builder import DatasetB... | {"hexsha": "de076707ccd99fbc9df252911ddfe65675d51a43", "size": 22977, "ext": "py", "lang": "Python", "max_stars_repo_path": "avod/experiments/video_detection_iou.py", "max_stars_repo_name": "Guoxs/DODT", "max_stars_repo_head_hexsha": "f354cda6ef08465018fdeec1a8b4be4002e6a71f", "max_stars_repo_licenses": ["MIT"], "max_s... |
import Html
import numpy as np
class MMHtml:
def __init__(self):
return
# TODO: Make another table for the system Ax=b
# WriteHtml should be rewritten to just do dispatch, make a new top-level
# The top level should take an array or dictionary of MM objects
# and figure out wha... | {"hexsha": "7f7b9ada906e567f22246ea66d36fe4d1c933092", "size": 2443, "ext": "py", "lang": "Python", "max_stars_repo_path": "MMHtml.py", "max_stars_repo_name": "tomacorp/thermapythia", "max_stars_repo_head_hexsha": "d6392a9e9eb9a5123ae3031812a0b4f8324d7211", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_count"... |
[STATEMENT]
lemma l2:
"-bot = top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. - bot = top
[PROOF STEP]
by (metis l1 a_stone il_unit_bot) | {"llama_tokens": 68, "file": "Subset_Boolean_Algebras_Subset_Boolean_Algebras", "length": 1} |
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import rc
import os
from scipy.interpolate import interp1d
rc('text', usetex=True)
rc('font', size=20)
import sys
sys.path.append('../')
import dirs
import mass_function
def sciformat_1(x):
n = np.floor(np.log10(x))
m = x*(10.0**(-n))
... | {"hexsha": "d03208be35898c9a247dd137c9eaf85467075990", "size": 5658, "ext": "py", "lang": "Python", "max_stars_repo_path": "code/plotting/PlotNFWtests.py", "max_stars_repo_name": "LBJ-Wade/axion-miniclusters", "max_stars_repo_head_hexsha": "14f742f6f524f7b1c817ef5cf6ab811eb38dd034", "max_stars_repo_licenses": ["MIT"], ... |
\chapter{Ampliative judgements}\label{ch:2_chapter}
\epigraphhead[0]{\epigraph{\textit{I know a bank where the wild thyme blows.}\qquad\phantom{}}{--- \textup{Leia Organa Solo}, \textsc{The Real Housewives of D.C.}}}
References are grouped:~\cite{Heidegger:1410,Nietzsche:2014,Adorno:2014,Schumpeter:2015,Schopenhauer:... | {"hexsha": "d9ea4a41a1a197f30775b67f924b92ac40c3a448", "size": 749, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "mainmatter/project_2.tex", "max_stars_repo_name": "mfweber/kant-thesis", "max_stars_repo_head_hexsha": "ddb69eede52dc60760c01878288323d0fab71683", "max_stars_repo_licenses": ["BSD-2-Clause"], "max_st... |
using DiffEqFlux, OrdinaryDiffEq, Optim, Flux, Zygote, Test
u0 = Float32[2.; 0.]
datasize = 30
tspan = (0.0f0,1.5f0)
function trueODEfunc(du,u,p,t)
true_A = [-0.1 2.0; -2.0 -0.1]
du .= ((u.^3)'true_A)'
end
t = range(tspan[1],tspan[2],length=datasize)
prob = ODEProblem(trueODEfunc,u0,tspan)
ode_dat... | {"hexsha": "f32604aebc4d3ec1b3b5047fbcfadeca0c5c8f50", "size": 2060, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/fast_neural_ode.jl", "max_stars_repo_name": "abhigupta768/DiffEqFlux.jl", "max_stars_repo_head_hexsha": "06cf2205eff8b70bdfe72b20cd677b166765ba1e", "max_stars_repo_licenses": ["MIT"], "max_sta... |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Function list}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
The section lists the functions provided to the M3D-C1 Fortran driver by SCOREC.The functions are declared in the file m3dc1$\_$scorec.h.
Throughout this section, unless specified, mesh entities and DOF's are specified by a local I... | {"hexsha": "c89ae9acafce258d347c5cc97a8d55ae1d046ce2", "size": 28278, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "doc/m3dc1-scorec-api.tex", "max_stars_repo_name": "SCOREC/m3dc1_scorec", "max_stars_repo_head_hexsha": "70e812b27e873c75edc4d5d2e7802a7d67e21fbe", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_... |
[STATEMENT]
lemma DE_valid:"valid DEaxiom"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. valid DEaxiom
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
1. valid DEaxiom
[PROOF STEP]
have dsafe:"dsafe ($f fid1 (singleton (trm.Var vid1)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. dsafe ($f... | {"llama_tokens": 25366, "file": "Differential_Dynamic_Logic_Differential_Axioms", "length": 58} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.