text stringlengths 0 1.25M | meta stringlengths 47 1.89k |
|---|---|
#encoding:utf-8
import cv2
import numpy as np
class Process:
def __init__(self,img,C):
self.img = img
self.C = C
# 短边缩放到img_min_side=600,长边等比例缩放
def format_img_size(self,):
img_min_side = float(self.C.im_size)
(height,width,_) = self.img.shape
... | {"hexsha": "4e3b64037cb00515bacbd0b9b8e71e28d74fc8aa", "size": 1502, "ext": "py", "lang": "Python", "max_stars_repo_path": "keras_frcnn/data_process.py", "max_stars_repo_name": "CVBase-Bupt/Faster-R-CNN-keras", "max_stars_repo_head_hexsha": "c56db76d1dccbaa2ee1042f51a284829989f568e", "max_stars_repo_licenses": ["Apache... |
#This code is modified from https://github.com/JiaFong/cvprw2020-cross-domain-few-shot-learning-challenge/methods/protonet.py
import methods.backbone
import torch
import torch.nn as nn
from torch.autograd import Variable
import numpy as np
import torch.nn.functional as F
import torch.nn as nn
from methods.meta_template... | {"hexsha": "ba7624efeca3a7c954f435a7d16e487f8dc677a0", "size": 3409, "ext": "py", "lang": "Python", "max_stars_repo_path": "final/methods/myMethod.py", "max_stars_repo_name": "annahung31/Advance_MM_homeworks", "max_stars_repo_head_hexsha": "f6b2d600220442a73d25d478d08898ee796457b6", "max_stars_repo_licenses": ["MIT"], ... |
import numpy as np
import air_hockey.vector as V
class Collision(object):
@staticmethod
def _resolve_circle_circle_velocity(bodies, normal, restitution):
velocity_0 = bodies[0].get_velocity()
velocity_1 = bodies[1].get_velocity()
inverse_mass_0 = bodies[0].get_inverse_mass()
in... | {"hexsha": "6239c7dee18a5c78342492bcd264fba104613bce", "size": 3774, "ext": "py", "lang": "Python", "max_stars_repo_path": "air_hockey/collision.py", "max_stars_repo_name": "arakhmati/air-hockey", "max_stars_repo_head_hexsha": "48dc2595107efd99eb2fe6d75819bcabc3dd8a7e", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
from __future__ import annotations
import numpy as np
import pandas as pd
import pytest
from pywaterflood.multiwellproductivity import ( # calc_gains_homogeneous,; translate_locations,
calc_A_ij,
)
raw_locs = pd.DataFrame()
def test_Aij():
"From the worked example by Kaviani and Valkó"
m = 1 + np.aran... | {"hexsha": "224217fc905cce2dab70221c68acb94b893680ee", "size": 464, "ext": "py", "lang": "Python", "max_stars_repo_path": "testing/test_mpi.py", "max_stars_repo_name": "frank1010111/pywaterflood", "max_stars_repo_head_hexsha": "70c6d39e1a979548db0835296d54b7bb392870f0", "max_stars_repo_licenses": ["BSD-2-Clause"], "max... |
[STATEMENT]
lemma ok_imp_VarB_closed_in:
assumes ok: "\<turnstile> \<Gamma> ok"
shows "VarB x T \<in> set \<Gamma> \<Longrightarrow> T closed_in \<Gamma>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. VarB x T \<in> set \<Gamma> \<Longrightarrow> T closed_in \<Gamma>
[PROOF STEP]
using ok
[PROOF STATE]
proof (p... | {"llama_tokens": 198, "file": null, "length": 2} |
# group individual replicas into sequences of 3-replicas
# Zilin Song, 22 AUG 2021
#
from re import X
import numpy, iomisc
nrep = 50
npath = 200
seqlen = 3
nseq_per_path = nrep - seqlen + 1
test_seed=[]
for p in range(npath):
seed = numpy.asarray(numpy.random.choice(50, 5, replace=False))
test_seed.appen... | {"hexsha": "d1773d350e14be62555e91bdf906f48d07066fa6", "size": 2818, "ext": "py", "lang": "Python", "max_stars_repo_path": "2.datasets/5.train_test_split/ds_split.py", "max_stars_repo_name": "smutaogroup/bcig_toho", "max_stars_repo_head_hexsha": "ef769ecc0c9249c0596141c2aa1d4e409d45cf62", "max_stars_repo_licenses": ["M... |
"""
Convert a HAWC2 blade data to BeamDyn
"""
import os
import numpy as np
import pandas as pd
import welib.fast.beamdyn as bd
import matplotlib.pyplot as plt
#import pyFAST.case_geneneration.case_gen as case_gen
#import pyFAST.case_geneneration.runner as case_gen
#import pyFAST.input_output.postpro as postpro
#impor... | {"hexsha": "91904d0c1698144623c2ff42fac407ee1cc3dadb", "size": 2055, "ext": "py", "lang": "Python", "max_stars_repo_path": "welib/fast/examples/Example_Hawc2ToBeamDyn.py", "max_stars_repo_name": "moonieann/welib", "max_stars_repo_head_hexsha": "0e430ad3ca034d0d2d60bdb7bbe06c947ce08f52", "max_stars_repo_licenses": ["MIT... |
from beluga.visualization.renderers import BaseRenderer
from matplotlib.pyplot import *
import matplotlib.colors as colors
import matplotlib.cm as cmx
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
class MatPlotLib(BaseRenderer):
"""
A renderer class that implements ... | {"hexsha": "64e5114e19b3ab82f48bf38aabfae4f248412580", "size": 5290, "ext": "py", "lang": "Python", "max_stars_repo_path": "beluga/visualization/renderers/MatPlotLib.py", "max_stars_repo_name": "thomasantony/beluga", "max_stars_repo_head_hexsha": "070c39476e07a6d5e900a2f9b3cd21c0ae7f9fe7", "max_stars_repo_licenses": ["... |
from typing import List, Dict, Any
from tqdm import tqdm
import pandas as pd
import numpy as np
import ast
from typing import List, Union, Dict, Tuple
from multiprocessing.pool import Pool
import os
import scipy
def parallel_literal_eval(
series: Union[pd.Series, np.ndarray], pool: Pool = None, use_tqdm: bool = T... | {"hexsha": "9f3a3a0fc0d343d21c61d8ebc3d7c7154f85f218", "size": 1203, "ext": "py", "lang": "Python", "max_stars_repo_path": "recsys_fair_metrics/util/util.py", "max_stars_repo_name": "marlesson/recsys-fair-metrics", "max_stars_repo_head_hexsha": "82c0a18486455718558fbd783e0bd3bf14d8bc67", "max_stars_repo_licenses": ["MI... |
import numpy as np
def numerical(x, t, path):
| {"hexsha": "0ab980dcc3611c4286777b80bde5ab0f5f1a3fb4", "size": 48, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/phimal_utilities/data/numerical/numerical.py", "max_stars_repo_name": "PhIMaL/phimal_utilities", "max_stars_repo_head_hexsha": "3d5c101e1a024ac29e7ed47823d7a15e9085dbd7", "max_stars_repo_license... |
using Test
using Unfold
firbase = firbasis((-1, 1), 10)
# test optional call
@test Unfold.kernel(firbase) == Unfold.kernel(firbasis((-1, 1), 10))
@test typeof(Unfold.name(firbase)) <: String
# test basics of basisfunction
@test length(collect(Unfold.colnames(firbase))) == 21
@test unique(Unfold.kernel(firbase)(1)) =... | {"hexsha": "a67c6391f26ea6ab6afef918c1329eb8ddb65592", "size": 915, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/basisfunctions.jl", "max_stars_repo_name": "unfoldtoolbox/Unfold.jl", "max_stars_repo_head_hexsha": "63587c0eef24b69dad6266a97aa8657b7bef9dd6", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# **************************************
# @Time : 2018/9/7 23:05
# @Author : Xiang Ling
# @Lab : nesa.zju.edu.cn
# @File : AttackUtils.py
# **************************************
import matplotlib.pyplot as plt
import numpy as np
import torch
from torch.autog... | {"hexsha": "08d5137acaff1a26489afed7d434ee1c4eac4b1e", "size": 959, "ext": "py", "lang": "Python", "max_stars_repo_path": "Attacks/AttackMethods/AttackUtils.py", "max_stars_repo_name": "jiannanWang/DEEPSEC", "max_stars_repo_head_hexsha": "2c67afac0ae966767b6712a51db85f04f4f5c565", "max_stars_repo_licenses": ["MIT"], "m... |
#!/usr/bin/env python
import matplotlib.pyplot as plt
import numpy as np
import imgviz
def nchannel2rgb():
data = imgviz.data.arc2017()
np.random.seed(1234) # for PCA
nchannel_viz = imgviz.nchannel2rgb(data["res4"], dtype=np.float32)
H, W = data["rgb"].shape[:2]
nchannel_viz = imgviz.resize(n... | {"hexsha": "0c4a46e228ce863171329e164877ed9e696693cf", "size": 883, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/nchannel2rgb.py", "max_stars_repo_name": "penguinflys/imgviz", "max_stars_repo_head_hexsha": "3deadced1fcce8ca51716c705d07a058b1839514", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Feb 2 18:17:08 2022
@author: bennett
"""
import numpy as np
from .functions import normPn
class make_output:
def __init__(self, t, N_ang, ws, xs, u, M, edges, uncollided):
self.N_ang = N_ang
self.ws = ws
self.xs = xs
... | {"hexsha": "bc23421ae24bdad22759b98cd4ee7b2072be318d", "size": 1259, "ext": "py", "lang": "Python", "max_stars_repo_path": "moving_mesh_transport/solver_classes/make_phi.py", "max_stars_repo_name": "SoftwareDevEngResearch/moving_mesh_radiative_transfer", "max_stars_repo_head_hexsha": "5416a4a2c5e2b11099a5adbda7959ee01e... |
// Author: Michael Kaufmann <kau@zurich.ibm.com>
//
// Copyright (c) 2018, IBM Corporation, All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found
// in the LICENSE file.
#include "scheduler/oracle.h"
#include "app/app.h"
#include "app/io.h"
#include "app/task.h"
#inclu... | {"hexsha": "42503d11adf609d2566d4148645e80b10f4b0140", "size": 13934, "ext": "cc", "lang": "C++", "max_stars_repo_path": "src/scheduler/oracle.cc", "max_stars_repo_name": "zrlkau/hcs", "max_stars_repo_head_hexsha": "f7951401ded00e5f8681803d3b4c3eae54aef5b0", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_count... |
import numpy as np
np.testing.bob # E: Module has no attribute
np.bob # E: Module has no attribute
# Stdlib modules in the namespace by accident
np.warnings # E: Module has no attribute
np.sys # E: Module has no attribute
np.os # E: Module has no attribute
np.math # E: Module has no attribute
# Publ... | {"hexsha": "c541b93b2efb23282e1a29589348f951cfa860e6", "size": 716, "ext": "py", "lang": "Python", "max_stars_repo_path": "runtime/python/Lib/site-packages/numpy/typing/tests/data/fail/modules.py", "max_stars_repo_name": "hwaipy/InteractionFreeNode", "max_stars_repo_head_hexsha": "88642b68430f57b028fd0f276a5709f89279e3... |
//
// Copyright © 2017 Arm Ltd. All rights reserved.
// SPDX-License-Identifier: MIT
//
#include "FullyConnected.hpp"
#include <boost/assert.hpp>
namespace armnn
{
void FullyConnected(const float* inputData,
float* outputData,
const TensorInfo& inputTensorInf... | {"hexsha": "bf5814d2ad4bf7896d0f9ab7e4cbbea446a3eb59", "size": 1783, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "src/backends/reference/workloads/FullyConnected.cpp", "max_stars_repo_name": "jnorwood/armnn", "max_stars_repo_head_hexsha": "774f6f1d7c862fc2b8e1783abef9a0bccdaf9d0c", "max_stars_repo_licenses": ["... |
import logging
logger = logging.getLogger(__name__)
import os
import glob
import pickle
from chainer.dataset import DatasetMixin
import numpy as np
import pandas as pd
from detector.hand_dataset.bbox_dataset import HandBBoxDataset as HandDataset
from detector.graphics import camera
from detector.hand_dataset.common... | {"hexsha": "9f59640f2ba837eca27567c55e5494507c72ce6e", "size": 7138, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/detector/hand_dataset/multiview_dataset.py", "max_stars_repo_name": "Idein/chainer-hand-pose", "max_stars_repo_head_hexsha": "45c7b629a74bf13da8cc9b47d0ded7099c139e9b", "max_stars_repo_license... |
import os
import numpy as np
import pandas as pd
import pytest
import yaml
from xirt import predictor as xr
from xirt import xirtnet as xnet
fixtures_loc = os.path.join(os.path.dirname(__file__), 'fixtures')
def test_preprocessing_crosslinks():
psms_df = pd.read_csv(os.path.join(fixtures_loc, "DSS_xisearch_fdr... | {"hexsha": "e6c0a0074546df95d96d905d5909b73763f1ca4c", "size": 8954, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_predictor.py", "max_stars_repo_name": "ludsinn/xiRT", "max_stars_repo_head_hexsha": "76ac2918fc4ae7b440cbbd2b4b4960660a48d131", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_cou... |
#include <facter/facts/linux/processor_resolver.hpp>
#include <facter/facts/collection.hpp>
#include <facter/facts/fact.hpp>
#include <facter/facts/os.hpp>
#include <facter/facts/scalar_value.hpp>
#include <facter/util/file.hpp>
#include <facter/util/directory.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/... | {"hexsha": "ba0e24c910fcb1722a29c6b66e291cfaace18c69", "size": 2826, "ext": "cc", "lang": "C++", "max_stars_repo_path": "lib/src/facts/linux/processor_resolver.cc", "max_stars_repo_name": "whopper/cfacter", "max_stars_repo_head_hexsha": "f489f62e19a161e2d909199aebd896e323dac0e8", "max_stars_repo_licenses": ["Apache-2.0... |
[STATEMENT]
lemma VSigma_iff [simp]: "\<langle>a,b\<rangle> \<in> elts (VSigma A B) \<longleftrightarrow> a \<in> elts A \<and> b \<in> elts (B a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. (\<langle>a, b\<rangle> \<in> elts (VSigma A B)) = (a \<in> elts A \<and> b \<in> elts (B a))
[PROOF STEP]
by (auto simp: ... | {"llama_tokens": 151, "file": "ZFC_in_HOL_ZFC_Cardinals", "length": 1} |
import matplotlib.pyplot as plt
import numpy as np
from scipy.stats import binom
from crypto_quandl_loader import load_data
import price_changes
import grid_approx
data = load_data('BTER/VTCBTC')
diffs = np.linspace(0.1, 1., 10)
legends = []
for diff in diffs:
up_down = price_changes.compute_with_difference(dif... | {"hexsha": "170593cf476a1fddb47b23eb34066242b384beff", "size": 751, "ext": "py", "lang": "Python", "max_stars_repo_path": "bayes_distribution_crypto.py", "max_stars_repo_name": "xSakix/bayesian_analyses", "max_stars_repo_head_hexsha": "14042e193507bae6d69caeb4035ac45ef9044176", "max_stars_repo_licenses": ["Apache-2.0"]... |
"""Author: Brandon Trabucco, Copyright 2019"""
import numpy as np
import mineral as ml
from gym import Env
from gym.spaces import Box, Dict
from mineral.core.cloneable import Cloneable
class ProxyEnv(Env, Cloneable):
def __init__(
self,
wrapped_env,
*wrapped_env_args,
reward_sca... | {"hexsha": "d8a917e43abb647a8959ecba294238f1aa076fc7", "size": 2630, "ext": "py", "lang": "Python", "max_stars_repo_path": "mineral/core/envs/proxy_env.py", "max_stars_repo_name": "brandontrabucco/jetpack", "max_stars_repo_head_hexsha": "aa60488788b2e6fe1d09727943be043158a7af09", "max_stars_repo_licenses": ["MIT"], "ma... |
is_flu_outlier() = nothing
# Flu specific
const lineages = ["h3n2" , "h1n1pdm", "vic", "yam"]
# From genebank file of strain A/Beijing/32/1992
const CDS = Dict(("h3n2","na") => [(4,1410)],
("h3n2","ha") => [(1,48),(49,1035),(1036,1698)],
("h1n1pdm", "na") => [(9,1418)],
("h1n1pdm", "ha") => [(21,71), (72,1052), (1... | {"hexsha": "8e33f818c22674a2907597d40c626de7b25595e7", "size": 2751, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/global.jl", "max_stars_repo_name": "PierreBarrat/FluPredictibility", "max_stars_repo_head_hexsha": "2325bc3eba688e9d882622704bf4a9713c36fbc4", "max_stars_repo_licenses": ["MIT"], "max_stars_cou... |
# -*- coding: utf-8 -*-
"""
Created on Sat Dec 21 18:54:10 2019
"""
import os
import sys
from model import unet
import numpy as np
import skimage
from skimage import io
import skimage.transform as trans
if getattr(sys, 'frozen', False):
path_weights = os.path.join(sys._MEIPASS, 'unet/')
else:
... | {"hexsha": "6854b42f047c4ae3790408e9615752558628d73b", "size": 2267, "ext": "py", "lang": "Python", "max_stars_repo_path": "unet/neural_network.py", "max_stars_repo_name": "berkyalcinkaya/YeastPed", "max_stars_repo_head_hexsha": "ecee25cb6811c804b2f351d351f680f66bdd2e8e", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
#!/usr/bin/env python
'''
extract ISBH and ISBD messages from AP_Logging files into a csv file
'''
from __future__ import print_function
import numpy
import os
import sys
import time
from argparse import ArgumentParser
parser = ArgumentParser(description=__doc__)
parser.add_argument("--condition", default=None, help... | {"hexsha": "8b1bc4b2357c540ea651b205dbee4a2f93f6dbd4", "size": 4047, "ext": "py", "lang": "Python", "max_stars_repo_path": "PX4-Autopilot/src/modules/mavlink/mavlink/pymavlink/tools/isb_extract.py", "max_stars_repo_name": "JinRIIS/Custom-PX4", "max_stars_repo_head_hexsha": "1d11a5c944ae02d9b8f14cb42b1f99e0ab2916a8", "m... |
"""
Tests module analysis.connections.
Note: The pickles used here (segmentations/*.pkl) are real, except that
large (image) arrays that are not needed in tests were removed in
order to fit the GutHub size limit.
# Author: Vladan Lucic
# $Id$
"""
from __future__ import unicode_literals
__version__ = "$Revision$"
... | {"hexsha": "897b35aa81ff1b2697ae84b02242a6ec440bc9bd", "size": 14537, "ext": "py", "lang": "Python", "max_stars_repo_path": "code/pyto/analysis/test/test_connections.py", "max_stars_repo_name": "anmartinezs/pyseg_system", "max_stars_repo_head_hexsha": "5bb07c7901062452a34b73f376057cabc15a13c3", "max_stars_repo_licenses... |
"""
PLEASE NOTE THAT THIS CODE IS ADOPTED AND REVISED FROM: http://math.colgate.edu/math329/exampleode.py
THE CODE WAS NOT ORIGINALLY WRITTEN BY HANFENG ZHAI
"""
"""
exampleode.py
=============
The example code helps demonstrate how to use one ODE solver
from the SCIPY package: scipy.integrate.odeint()
There is a more... | {"hexsha": "27f3ee6ca6f93665f6e5214b926c16ecf5463f6f", "size": 1768, "ext": "py", "lang": "Python", "max_stars_repo_path": "vanderPol/data_generation.py", "max_stars_repo_name": "hanfengzhai/PINC", "max_stars_repo_head_hexsha": "7535e4447cd74177947bee937348f16ea3a98f91", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
report_this_filefun(mfilename('fullpath'));
ax = findobj('Tag','main_map_ax');
[x,y, mouse_points_overlay] = select_polygon(ax);
figure_w_normalized_uicontrolunits(map)
plos2 = plot(x,y,'k-','Linewidth',2); % plot outline
sum3 = 0.;
pause(0.3)
do = [' s' num2str(k) ' = [ x(1) y(1) ; x(2) y(2) ; x(4) y(4) ; x(... | {"author": "CelsoReyes", "repo": "zmap7", "sha": "3895fcb3ca3073608abe22ca71960eb082fd0d9a", "save_path": "github-repos/MATLAB/CelsoReyes-zmap7", "path": "github-repos/MATLAB/CelsoReyes-zmap7/zmap7-3895fcb3ca3073608abe22ca71960eb082fd0d9a/zmap_deprecated/orphaned/src/defzones.m"} |
import json
import argparse
import glob
import cv2
import os
import numpy as np
import time
from PIL import Image
from scipy.stats import norm, chi2
COLORMAP = {i: (np.random.randint(0, 255),
np.random.randint(0, 255),
np.random.randint(0, 255))
for i in range(1,1000)}
def plot... | {"hexsha": "4a206836acc2080c7ec97e4e97e35cc7968730e5", "size": 9517, "ext": "py", "lang": "Python", "max_stars_repo_path": "detecting-invisible-people/tools/convert_sort_output_to_topk_format.py", "max_stars_repo_name": "lv1turtle/Occlusion-object-tracking", "max_stars_repo_head_hexsha": "bda349332ce904f5f08b694ea25e3e... |
[STATEMENT]
lemma in_set_real_minus_swapI: "e i \<in>\<^sub>r I ! i - a ! i"
if "x - e i \<in>\<^sub>r a ! i" "x \<in>\<^sub>r I ! i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. e i \<in>\<^sub>r I ! i - a ! i
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
x - e i \<in>\<^sub>r a ! i
x \<in>\<^... | {"llama_tokens": 203, "file": "Taylor_Models_Taylor_Models", "length": 2} |
module SerialManipulators
# robot arm kinematics and dynamics; dh params, fk and ik, plots, robot definitions ...
end # (sub)module SerialManipulators
| {"hexsha": "8e51eecb66d0898c6b4b58ef7af48a73e958745d", "size": 153, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/SerialManipulators.jl", "max_stars_repo_name": "pranshumalik14/RoboticsToolkit.jl", "max_stars_repo_head_hexsha": "652daaafc8f5ab27e2817252007a28ff3427a311", "max_stars_repo_licenses": ["MIT"], ... |
"""`Nanduri2012Model`, `Nanduri2012Spatial`, `Nanduri2012Temporal`
[Nanduri2012]_"""
import numpy as np
from .base import Model, SpatialModel, TemporalModel
from ._nanduri2012 import spatial_fast, temporal_fast
from ..implants import ElectrodeArray, DiskElectrode
from ..stimuli import Stimulus
from ..utils import Cu... | {"hexsha": "9c37bd28f61abfb84278f9a7e766252b118ac3ba", "size": 9636, "ext": "py", "lang": "Python", "max_stars_repo_path": "pulse2percept/models/nanduri2012.py", "max_stars_repo_name": "tanyabhatia/pulse2percept", "max_stars_repo_head_hexsha": "b322c7daf22154d60f7abd8adb039c5982824a7c", "max_stars_repo_licenses": ["BSD... |
from typing import Optional, List, Any
import numpy as np
from nptyping import NDArray
from ..constants import CATEGORICAL
from .collator import Stack, Tuple
class CategoricalProcessor:
"""
Prepare categorical data for the model specified by "prefix".
For multiple models requiring categorical data, we nee... | {"hexsha": "89f5ebceb3a7fb192d25bb647c3178ce26437e08", "size": 2836, "ext": "py", "lang": "Python", "max_stars_repo_path": "text/src/autogluon/text/automm/data/process_categorical.py", "max_stars_repo_name": "willsmithorg/autogluon", "max_stars_repo_head_hexsha": "1e8c6a2f30fcc473411bf393c9827eb4713dcef6", "max_stars_r... |
# Token required to use the private constructor.
_PAIR_OF_EIGENSYSTEMS__CAN_BREAK_MY_CODE = object()
from collections import defaultdict
import numpy as np
import warnings
from . import _private
def _get_angy_about_private_constructor(klass):
return TypeError(
'The constructor of {} is private. Please c... | {"hexsha": "f91891bc39a5f7a69e718b82bcd9f05fd0a3e6d5", "size": 5545, "ext": "py", "lang": "Python", "max_stars_repo_path": "band_dot/__init__.py", "max_stars_repo_name": "ExpHP/band-dot", "max_stars_repo_head_hexsha": "aeea831b1e286b0f7fd3410c9ced57b571a79736", "max_stars_repo_licenses": ["Unlicense"], "max_stars_count... |
(****************************************************************************)
(* Copyright 2021 The Project Oak Authors *)
(* *)
(* Licensed under the Apache License, Version 2.0 (the "License") *)
(* y... | {"author": "project-oak", "repo": "silveroak", "sha": "cccfdb4e19c5906256d2ed4487bf1a0aa2fab99e", "save_path": "github-repos/coq/project-oak-silveroak", "path": "github-repos/coq/project-oak-silveroak/silveroak-cccfdb4e19c5906256d2ed4487bf1a0aa2fab99e/investigations/ast/AST2.v"} |
import numpy as np
class Complex:
def __init__(self, a, b):
self.a = a
self.b = b
def display(self):
if self.b>=0:
print('{}+{}i'.format(self.a,self.b))
if self.b<0:
print('{}{}i'.format(self.a,self.b))
def add(self,obj):
return Complex(self.a+obj.a,self.b+obj.b)
def subtract... | {"hexsha": "00d27fbef1d750bb2137755888241d77e2b64a55", "size": 730, "ext": "py", "lang": "Python", "max_stars_repo_path": "Python/question3.py", "max_stars_repo_name": "arubittu/Autumn-of-Automation", "max_stars_repo_head_hexsha": "45724d8d9b3556e7f80182a7e38e770c15291a46", "max_stars_repo_licenses": ["MIT"], "max_star... |
import numpy as np
def calculate_psi(expected, actual, buckettype="bins", buckets=10, axis=0):
"""Calculate the PSI (population stability index) across all variables
Args:
expected: numpy matrix of original values
actual: numpy matrix of new values, same size as expected
buckettype: type... | {"hexsha": "ad24acbe323fe2e105cc4290fcd094350f518224", "size": 3021, "ext": "py", "lang": "Python", "max_stars_repo_path": "cv_validator/utils/psi.py", "max_stars_repo_name": "ningeen/cv-validator", "max_stars_repo_head_hexsha": "477e41f663da8ac5fda41fa703b65a8faec79f1c", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
import os
import pytest
import boto3
import pandas as pd
import numpy as np
from faker import Faker
from lambda_app.app import DEFAULT_SEP
@pytest.fixture
def bucket_name():
return os.environ['BUCKET_NAME']
@pytest.fixture
def bucket(bucket_name):
s3 = boto3.resource('s3')
bucket = s3.Bucket(bucket_name... | {"hexsha": "e87e27179ac19d1a29129287e05d81274e760c7c", "size": 2787, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/conftest.py", "max_stars_repo_name": "smomni/aws-sam-csv-to-parquet", "max_stars_repo_head_hexsha": "f255634104450b6f35d26f369d0d8f77ab26e3bf", "max_stars_repo_licenses": ["MIT"], "max_stars... |
"""Factory that loads IAGA2002 Files."""
from __future__ import absolute_import
import numpy
from .. import ChannelConverter
from ..TimeseriesFactory import TimeseriesFactory
from .IMFV283Parser import IMFV283Parser
from ..ObservatoryMetadata import ObservatoryMetadata
class IMFV283Factory(TimeseriesFactory):
""... | {"hexsha": "f2c9d2effb77bfe4b00cc459d55004e43f42364a", "size": 3165, "ext": "py", "lang": "Python", "max_stars_repo_path": "geomagio/imfv283/IMFV283Factory.py", "max_stars_repo_name": "usgs/geomag-algorithms", "max_stars_repo_head_hexsha": "a83a0e36bed9307828e37b9130c25dbc26dd1bc9", "max_stars_repo_licenses": ["CC0-1.0... |
import numpy as np
from sklearn import datasets
from sklearn.decomposition import PCA
def my_pca(x,k):
#step1 所有样本区中心化
avg = np.average(x,axis=0)
x = x - avg
#step2 计算x的协方差矩阵
mat = np.cov(x.T)
print(mat.shape)
#step3 计算协方差矩阵的特征值和特征向量,并选取前k个特征向量
a,b = np.linalg.eig(mat)
np.linalg.eig(b)
index = np.argsort(-a)... | {"hexsha": "326a04c9902919a944e32bbcaa35d4db4db6e0a4", "size": 564, "ext": "py", "lang": "Python", "max_stars_repo_path": "PCA/pca.py", "max_stars_repo_name": "QYHcrossover/ML-numpy", "max_stars_repo_head_hexsha": "863cc651ac38bc421e3b6e99f36a51267f0de0f9", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 12, "ma... |
include("test_suite.jl")
| {"hexsha": "c19471246f15ff419caea425031afc2e9d2a06e1", "size": 25, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/runtests.jl", "max_stars_repo_name": "daanhb/IntegralEquations2D.jl", "max_stars_repo_head_hexsha": "644cc7d1f6494504cfa660542d3e3c7f153d7ef3", "max_stars_repo_licenses": ["MIT"], "max_stars_cou... |
import os
import re
from time import sleep
from PIL import ImageGrab
from aip import AipOcr
import cv2 as cv
import numpy as np
import win32api
import win32clipboard as wc
import win32con
import win32gui
def grab_im():
"""
选择区域截图,返回截取的PIL图片
"""
while True:
cursor_current_x, cursor_current_y =... | {"hexsha": "41e844f4c3cd3cf159490c879a906b2c9990284b", "size": 4382, "ext": "py", "lang": "Python", "max_stars_repo_path": "py_ocr_via_baidu_api.py", "max_stars_repo_name": "xuchengj031/py_ocr_via_baidu_api", "max_stars_repo_head_hexsha": "4a4364bb477c23815bcd6e565944829adc84c8fe", "max_stars_repo_licenses": ["MIT"], "... |
[STATEMENT]
lemma sscanl_lfp_fusion:
assumes "g\<cdot>\<bottom> = \<bottom>"
assumes *: "\<And>acc x. x \<noteq> \<bottom> \<Longrightarrow> g\<cdot>(f\<cdot>acc\<cdot>x) = f'\<cdot>(g\<cdot>acc)\<cdot>x"
shows "smap\<cdot>g oo sscanl\<cdot>f\<cdot>z = sscanl\<cdot>f'\<cdot>(g\<cdot>z)"
[PROOF STATE]
proof (prove... | {"llama_tokens": 353, "file": "BirdKMP_Theory_Of_Lists", "length": 2} |
#io_utilities
import numpy as np
class Student():
def __init__(self,name,lastName,major):
self.name = name
self.lastName = lastName
self.major = major
self.grades = []
def addGrade(self,grade):
self.grades.append(grade)
print("A grade of {} was added to the student {} {}".format(grade,self.lastName,self.... | {"hexsha": "d3e78f669c41a948af992623d4b3e3757e7cbda2", "size": 672, "ext": "py", "lang": "Python", "max_stars_repo_path": "io_utilities.py", "max_stars_repo_name": "LordFritos/TC1002s-2", "max_stars_repo_head_hexsha": "ac64a8cb7f434d9d5809e62cef04a73ca07b127b", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, ... |
/***************************************************************************
Copyright 2015 Ufora 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/licen... | {"hexsha": "3f11e439311cb3ec8806f16504bbe35d691a458f", "size": 4578, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "ufora/core/containers/MapWithIndex.py.hpp", "max_stars_repo_name": "ufora/ufora", "max_stars_repo_head_hexsha": "04db96ab049b8499d6d6526445f4f9857f1b6c7e", "max_stars_repo_licenses": ["Apache-2.0", ... |
from pyomo.environ import *
import datetime
import os
from .Block_Processing import searchTechnologies
from .Block_Processing import searchEnergyExchange
from .Block_Processing import writeFormatting
def write_Case(ModelInformation, Resultspath, Inputpath, case_time):
run_time = ModelInformation['Run ... | {"hexsha": "08a9481c82eb24c1f3d79dee675c355c32fbd7aa", "size": 8434, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/outdoor/outdoor_core/Block_DataSaving.py", "max_stars_repo_name": "PKenkel/OUTDOOR", "max_stars_repo_head_hexsha": "b88c2efd28a71f4a413f154659363b5db95ad349", "max_stars_repo_licenses": ["MIT"... |
SUBROUTINE psdes(lword,irword)
INTEGER irword,lword,NITER
PARAMETER (NITER=4)
INTEGER i,ia,ib,iswap,itmph,itmpl,c1(4),c2(4)
SAVE c1,c2
DATA c1 /16#BAA96887,16#1E17D32C,16#03BCDC3C,16#0F33D1B2/, c2
*/16#4B0F3B58,16#E874F0C3,16#6955C5A6, 16#55A7CA46/
do 11 i=1,NITER
... | {"hexsha": "537d3c2eb9b368f338463d19b077e62fe7f984cc", "size": 653, "ext": "for", "lang": "FORTRAN", "max_stars_repo_path": "NR-Functions/Numerical Recipes- Example & Functions/Functions/psdes.for", "max_stars_repo_name": "DingdingLuan/nrfunctions_fortran", "max_stars_repo_head_hexsha": "37e376dab8d6b99e63f6f1398d0c33d... |
function y = objfun(x)
y = (1/3)*x(1)^2+(1/2)*x(2)^2; | {"author": "QiangLong2017", "repo": "Optimization-Theory-and-Algorithm", "sha": "13becd67be377356c221367ffbc7c90a1aabd917", "save_path": "github-repos/MATLAB/QiangLong2017-Optimization-Theory-and-Algorithm", "path": "github-repos/MATLAB/QiangLong2017-Optimization-Theory-and-Algorithm/Optimization-Theory-and-Algorithm-1... |
# Copyright 2022 The Flax Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | {"hexsha": "fe78123384f6a71a01bbc762f502bb7f92ca2734", "size": 1590, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/linen/linen_dtypes_test.py", "max_stars_repo_name": "tttc3/flax", "max_stars_repo_head_hexsha": "0a5a187e63f9e5287444b1686494eb3875c38743", "max_stars_repo_licenses": ["Apache-2.0"], "max_st... |
import scipy as sp
import numpy as np
import mango.mpi as mpi
import math
logger, rootLogger = mpi.getLoggers(__name__)
def rotation_matrix(angle, axis, dim=3, dtype="float64"):
"""
Returns rotation matrix for specified degree angle and
coordinate axis of rotation.
:type angle: :obj:`float`
... | {"hexsha": "a317d753562df0229d556016a957fba9785d3093", "size": 4595, "ext": "py", "lang": "Python", "max_stars_repo_path": "misc/python/mango/math/_rotation.py", "max_stars_repo_name": "pymango/pymango", "max_stars_repo_head_hexsha": "b55f831f0194b214e746b2dfb4d9c6671a1abc38", "max_stars_repo_licenses": ["BSD-2-Clause"... |
\section{Data Flow Experiments: Supplementary Details}
This section provides additional details for the experiments presented in
Section~5.
\subsection{Models}
\paragraph{(I) Sequential Model} The inst2vec model consists of 619,650
trainable parameters in the configuration outlined in
Figure~\ref{figure:lstm_node_l... | {"hexsha": "15425212076b2ea3d59aed3efaec40155121cdec", "size": 3190, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "Documentation/icml-2021/tex/appendix/experimental_setup.tex", "max_stars_repo_name": "NaderAlAwar/ProGraML", "max_stars_repo_head_hexsha": "e4acad3819e477d3000d175b4166b75e1d770141", "max_stars_repo... |
[STATEMENT]
lemma trans_knights_path:
assumes "knights_path b ps"
shows "knights_path (trans_board (k\<^sub>1,k\<^sub>2) b) (trans_path (k\<^sub>1,k\<^sub>2) ps)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. knights_path (trans_board (k\<^sub>1, k\<^sub>2) b) (trans_path (k\<^sub>1, k\<^sub>2) ps)
[PROOF STEP]... | {"llama_tokens": 7263, "file": "Knights_Tour_KnightsTour", "length": 26} |
################
# Secrets Type #
################
@ghdef mutable struct Secret
name::Union{String, Nothing}
created_at::Union{Dates.DateTime, Nothing}
updated_at::Union{Dates.DateTime, Nothing}
end
Secret(name::AbstractString) = Secret(Dict("name" => name))
namefield(secret::Secret) = secret.name
#####... | {"hexsha": "dcb1c65c4cfa39573158b43873de1cd6cc390283", "size": 2424, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/repositories/secrets.jl", "max_stars_repo_name": "wildart/GitHub.jl", "max_stars_repo_head_hexsha": "5d6f315a14b1b10510bea0e5cf474e46dc201c46", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
//------------------------------------------------------------------------------
/// \file SingleNode_tests.cpp
//------------------------------------------------------------------------------
#include "DataStructures/Lists/SingleNode.h"
#include <boost/test/unit_test.hpp>
using DataStructures::Lists::Nodes::SingleNo... | {"hexsha": "a4687e46e0b669fd763c3bf4722e0b1512884f86", "size": 1372, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "Voltron/Source/UnitTests/DataStructures/Lists/SingleNode_tests.cpp", "max_stars_repo_name": "ernestyalumni/HrdwCCppCUDA", "max_stars_repo_head_hexsha": "17ed937dea06431a4d5ca103f993ea69a6918734", "m... |
[STATEMENT]
lemma [autoref_itype]: "op_set_enumerate ::\<^sub>i \<langle>A\<rangle>\<^sub>i i_set \<rightarrow>\<^sub>i \<langle>\<langle>A, i_nat\<rangle>\<^sub>i i_map\<rangle>\<^sub>i i_nres"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. op_set_enumerate ::\<^sub>i \<langle>A\<rangle>\<^sub>ii_set \<rightarrow>\... | {"llama_tokens": 167, "file": "Transition_Systems_and_Automata_Basic_Implement", "length": 1} |
#!/usr/bin/env python
# encoding: UTF-8
# date: March 4, 2020
# author: Yuxiang Dai
# description: Tello ROS interface using Tello-Python official DJI SDK
# import math
# import numpy as np
import rospy
from std_msgs.msg import Int8, String
from geometry_msgs.msg import Twist
from sensor_msgs.msg import Image
from te... | {"hexsha": "c4c88c0226283a3a8a263c64b6e501f925c82384", "size": 9845, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/ros_tello.py", "max_stars_repo_name": "yuxiangdai/ROS_Tello_Bridge", "max_stars_repo_head_hexsha": "978c3a0b539b804733da481670b771bdb093766a", "max_stars_repo_licenses": ["Apache-2.0"], "m... |
# SNOPSIS
# runs k-means cluster analysis
# AUTHOR Isaak Y Tecle (iyt2@cornell.edu)
options(echo = FALSE)
library(randomForest)
library(data.table)
library(genoDataFilter)
library(tibble)
library(dplyr)
library(fpc)
library(cluster)
library(ggfortify)
library(tibble)
library(stringi)
library(phenoAnalysis)
library... | {"hexsha": "92feb9abc202a25cda37785afa7004dbc8611d59", "size": 9827, "ext": "r", "lang": "R", "max_stars_repo_path": "R/solGS/kclustering.r", "max_stars_repo_name": "dwaring87/sgn", "max_stars_repo_head_hexsha": "1d7b7de9c4fdb1f3b22a1fcff070f2c3846e4fd0", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "ma... |
////============================================================================
//// Name :
//// Author : Avi
//// Revision : $Revision: #8 $
////
//// Copyright 2009-2020 ECMWF.
//// This software is licensed under the terms of the Apache Licence version 2.0
//// which can be obtained at http://www.a... | {"hexsha": "3d6d74cf63258c835ba576c1c4acdd67f192943b", "size": 2715, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "ACore/test/TestStackTrace.cpp", "max_stars_repo_name": "ecmwf/ecflow", "max_stars_repo_head_hexsha": "2498d0401d3d1133613d600d5c0e0a8a30b7b8eb", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars... |
theory nat_pow_one
imports Main
"$HIPSTER_HOME/IsaHipster"
begin
datatype Nat = Z | S "Nat"
fun plus :: "Nat => Nat => Nat" where
"plus (Z) y = y"
| "plus (S n) y = S (plus n y)"
fun mult :: "Nat => Nat => Nat" where
"mult (Z) y = Z"
| "mult (S n) y = plus y (mult n y)"
fun pow :: "Nat => Nat => Nat" where
... | {"author": "moajohansson", "repo": "IsaHipster", "sha": "91f6ea3f1166a9de547722ece6445fe843ad89b4", "save_path": "github-repos/isabelle/moajohansson-IsaHipster", "path": "github-repos/isabelle/moajohansson-IsaHipster/IsaHipster-91f6ea3f1166a9de547722ece6445fe843ad89b4/benchmark/tip2015/nat_pow_one.thy"} |
import torch, pdb
import pandas as pd
import numpy as np
from torch.utils.data import Dataset, DataLoader
from torch.utils.data.sampler import SubsetRandomSampler
class PylayersDataset(Dataset):
def __init__(self, csv_path = "assets/data/train.csv", transform = None):
# import csv file
self.csv = p... | {"hexsha": "9439a8117129fd3ab283180a7774cdd440c90224", "size": 2457, "ext": "py", "lang": "Python", "max_stars_repo_path": "include/dataLoader.py", "max_stars_repo_name": "sahibdhanjal/DeepLocNet", "max_stars_repo_head_hexsha": "a3a5973a0cb549d0a16f17b96a9c78c200cf0c7e", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
from tensorflow.keras.preprocessing.image import ImageDataGenerator
from tensorflow.keras.applications import VGG16
from tensorflow.keras.layers import AveragePooling2D, AveragePooling3D
from tensorflow.keras.layers import Dropout
from tensorflow.keras.layers import Flatten
from tensorflow.keras.layers import Dense
fro... | {"hexsha": "42b2a3c659d161660996be6f6d20e30f2eadabf8", "size": 8104, "ext": "py", "lang": "Python", "max_stars_repo_path": "apps/healthcare/covid/onprem/pipelines/chest-xray/components/v2/tf-model-train/chest-xray-model/src/covid-xray-model.py", "max_stars_repo_name": "Karthik-Git-Sudo786/cisco-kubeflow-starter-pack", ... |
SUBROUTINE LC_SBND ( rltln, iret )
C************************************************************************
C* LC_SBND *
C* *
C* This subroutine sets the latitude/longitude bounds of a geographic *
C* area. Once this subroutine has been called, the subroutine LC_INBN *
C* may be called to check wheth... | {"hexsha": "10c17958475203b744ac67ee4f67d61a095844ff", "size": 1015, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "gempak/source/gemlib/lc/lcsbnd.f", "max_stars_repo_name": "oxelson/gempak", "max_stars_repo_head_hexsha": "e7c477814d7084c87d3313c94e192d13d8341fa1", "max_stars_repo_licenses": ["BSD-3-Clause"], "... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Dec 19 14:34:01 2018
@author: Harry
Creates "segment level d vector embeddings" compatible with
https://github.com/google/uis-rnn
"""
import glob
import librosa
import numpy as np
import os
import torch
from hparam import hparam as hp
from speech_embed... | {"hexsha": "021b8c8dfb2c8b2f27cbcedb4e112a8b06f815e9", "size": 3642, "ext": "py", "lang": "Python", "max_stars_repo_path": "sequence_testid.py", "max_stars_repo_name": "Aurora11111/voiceprint", "max_stars_repo_head_hexsha": "6c29164bee14bf41d2c9d3c7857a05a9b4fa3276", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_st... |
using GTrends
using Test
@testset "GTrends.jl" begin
# Write your tests here.
end
| {"hexsha": "88fb707bbaa37bfaede1903fc47ae66ffd970b34", "size": 87, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/runtests.jl", "max_stars_repo_name": "joshday/GTrends.jl", "max_stars_repo_head_hexsha": "c0c850cb4f6681bcfff1fdb870dbc0a6079a9174", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, "ma... |
"""
This is an empty module.
Run the script MarketBigPictureWatch_run.jl instead.
"""
module MarketBigPictureWatch
end | {"hexsha": "2403ac2232b2c551f1ddb97dffde30e2eef7a1c4", "size": 119, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/MarketBigPictureWatch.jl", "max_stars_repo_name": "zhopan77/MarketBigPictureWatch", "max_stars_repo_head_hexsha": "f6a7ae42e009764e02302a52adc8493c0cde2839", "max_stars_repo_licenses": ["MIT"], ... |
[STATEMENT]
lemma harm_remainder_bigo:
assumes "N > 0"
shows "harm_remainder N \<in> O(\<lambda>n. 1 / real n ^ (2 * N + 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. harm_remainder N \<in> O(\<lambda>n. 1 / real n ^ (2 * N + 1))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
1. harm... | {"llama_tokens": 744, "file": "Euler_MacLaurin_Euler_MacLaurin_Landau", "length": 7} |
import os
import torch as th
import numpy as np
import gym
from torch.distributions import MultivariateNormal
from algorithms.utils.networks import MLP
from algorithms.utils.torch import change_optim_lr
class Reinforce:
# On-policy version
def __init__(self, env: gym.Env, device="cpu"):
self.env = ... | {"hexsha": "49ecf0455b40595939f427e13c6711408b126f0f", "size": 3749, "ext": "py", "lang": "Python", "max_stars_repo_path": "algorithms/reinforce.py", "max_stars_repo_name": "ZikangXiong/ToyRLAlgorithms", "max_stars_repo_head_hexsha": "6b54a3a845fdc227b1fb619f4a682859a36060fc", "max_stars_repo_licenses": ["MIT"], "max_s... |
import numpy as np
r = int(input())
lst = [float(x) for x in input().split()]
arr_ABD = np.array(lst)
arr_ABD = arr_ABD.reshape(r,int(len(lst)/r))
print(arr_ABD.round(2)) | {"hexsha": "fbd9875111653ef694ea61257cbed961bad9fa12", "size": 178, "ext": "py", "lang": "Python", "max_stars_repo_path": "curso33.py", "max_stars_repo_name": "ralabarta/educationar_python_repo", "max_stars_repo_head_hexsha": "f89ddb0bb19b039459e42472e0f52f31c69a3853", "max_stars_repo_licenses": ["MIT"], "max_stars_cou... |
#!/bin/env python
"""
Extrapolation nowcast
=====================
This tutorial shows how to compute and plot an extrapolation nowcast using
Finnish radar data.
"""
from datetime import datetime
import matplotlib.pyplot as plt
import numpy as np
from pprint import pprint
from pysteps import io, motion, nowcasts, rc... | {"hexsha": "6b317143d1b761b34ece84e8166bf929f0c5053f", "size": 4426, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/plot_extrapolation_nowcast.py", "max_stars_repo_name": "mattiabalestra/pysteps", "max_stars_repo_head_hexsha": "fccbf1275b6ab7adfe41a2e4f388f7701d038aa3", "max_stars_repo_licenses": ["BSD... |
import sys
import os
sys.path.append('../../') #get rid of this at some point with central test script or when package is built
os.chdir('../../')
import numpy as np
import MSI.simulations.instruments.shock_tube as st
import MSI.cti_core.cti_processor as pr
import cantera as ct
import pandas as pd
import matplotlib.py... | {"hexsha": "b2e4fb163f5db26b06ca73f4f9133e628212997d", "size": 13412, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/comparing_sensitivity_cheby.py", "max_stars_repo_name": "carlylagrotta/MSI", "max_stars_repo_head_hexsha": "e958beb5df2a2d1018bbb2f96382b5c99b08c3ef", "max_stars_repo_licenses": ["MIT"], "m... |
(* Title: HOL/Library/Quotient_Type.thy
Author: Markus Wenzel, TU Muenchen
*)
section \<open>Quotient types\<close>
theory Quotient_Type
imports Main
begin
text \<open>We introduce the notion of quotient types over equivalence relations
via type classes.\<close>
subsection \<open>Equivalence relati... | {"author": "SEL4PROJ", "repo": "jormungand", "sha": "bad97f9817b4034cd705cd295a1f86af880a7631", "save_path": "github-repos/isabelle/SEL4PROJ-jormungand", "path": "github-repos/isabelle/SEL4PROJ-jormungand/jormungand-bad97f9817b4034cd705cd295a1f86af880a7631/case_study/isabelle/src/HOL/Library/Quotient_Type.thy"} |
// Copyright Gavin Band 2008 - 2012.
// 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 <iostream>
#include <vector>
#include <utility>
#include <boost/iterator/counting_iterator.hpp>... | {"hexsha": "189edfcf86377713cfaefb876911ed6004afef5e", "size": 439, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "snptest/src/case_control/AlternativeModelLogLikelihood.cpp", "max_stars_repo_name": "gavinband/bingwa", "max_stars_repo_head_hexsha": "d52e166b3bb6bc32cd32ba63bf8a4a147275eca1", "max_stars_repo_licen... |
[STATEMENT]
lemma can_coherence:
assumes "par f g" and "can f" and "can g"
shows "f = g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. f = g
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
1. f = g
[PROOF STEP]
have "\<^bold>\<lfloor>rep f\<^bold>\<rfloor> = \<^bold>\<lfloor>rep g\<^bold... | {"llama_tokens": 2595, "file": "MonoidalCategory_FreeMonoidalCategory", "length": 25} |
"""
MixturePanel <: GMMModel
A `MixturePanel` model consists of outcomes, `y`, regressors, `x`, and
a number of types, `ntypes`. Each observation `i` is one of `ntypes`
types with probability `p[i]`. Conditional on type,`y` is given by
` y[i,t] = x[i,t,:]*β[:,type[i]] + ϵ[i,t] `
It is assumed that `ϵ` is uncorr... | {"hexsha": "d455ce36a2884be88eb494aefefc1f7c590e9985", "size": 2494, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/models/mixturepanel.jl", "max_stars_repo_name": "mayupei/GMMInference.jl", "max_stars_repo_head_hexsha": "002ea5ce3edc6efd8dc623ac09f15297c91d7fee", "max_stars_repo_licenses": ["MIT"], "max_sta... |
import numpy as np
from relazioni import associations
import unittest
class TestAssociations(unittest.TestCase):
def test_theils_u(self):
v1, v2, v3 = np.array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0.1]), \
np.array([-3, 3, -3, 3, -3, 3, -3, 3, -3, 3]), \
np.array([-1, 1, -1, 1, -1, 1, -1... | {"hexsha": "db01f452239f2a9f5070ba035b1a0ffd9ce85318", "size": 4063, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/associations.py", "max_stars_repo_name": "chicodelarosa/relationships", "max_stars_repo_head_hexsha": "4dd92d4a974bf6d5fab8a75d760dbad4dfc5f0bf", "max_stars_repo_licenses": ["MIT"], "max_sta... |
"""
==================================
Bayesian optimization with `skopt`
==================================
Gilles Louppe, Manoj Kumar July 2016.
Reformatted by Holger Nahrstaedt 2020
.. currentmodule:: skopt
Problem statement
-----------------
We are interested in solving
.. math::
x^* = arg \min_x f(x)
und... | {"hexsha": "4091b31373fc2e9eb97c5abf142d902affd241d4", "size": 9318, "ext": "py", "lang": "Python", "max_stars_repo_path": "dev/_downloads/24c01b5b5c8f94d201d7d4450e24f830/bayesian-optimization.py", "max_stars_repo_name": "holgern/scikit-optimize.github.io", "max_stars_repo_head_hexsha": "7555aed01ae52c4d54d83771a6bc43... |
[STATEMENT]
lemma col_permutation_2:
assumes "Col A B C"
shows "Col C A B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. Col C A B
[PROOF STEP]
using assms(1) col_permutation_1
[PROOF STATE]
proof (prove)
using this:
Col A B C
Col ?A ?B ?C \<Longrightarrow> Col ?B ?C ?A
goal (1 subgoal):
1. Col C A B
[PROOF S... | {"llama_tokens": 150, "file": "IsaGeoCoq_Tarski_Neutral", "length": 2} |
# -*- coding: utf-8 -*-
"""
Created on Mon Jan 20 07:42:46 2014
@author: naspert
"""
import numpy
import struct
import sys
"""
Bin files I/O
=============
Koala uses two different file formats having the same '.bin' extension. One is
for storing (real) floating-point data (e.g. phase) and the other is for storing
co... | {"hexsha": "d566f6e8daad342a893871f27ab231e35f71a6c4", "size": 8852, "ext": "py", "lang": "Python", "max_stars_repo_path": "pyKoalaUtils/binkoala.py", "max_stars_repo_name": "jejmule/pyKoalaUtils", "max_stars_repo_head_hexsha": "b15ad1eec5e75c7daa2fd1ccc676f08e435b690b", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
#! /usr/bin/env python
# This script creates faucet accounts for testnets.
# Generation is deterministic based on the seed passed.
# This allows deployment of faucet infrastructure without moving
# large json commitment files around.
import sys
import os
import json
import bitcoin
import binascii
import numpy as np
im... | {"hexsha": "b8e67c1defe55e8700a62015873de0a1901c7aa3", "size": 3677, "ext": "py", "lang": "Python", "max_stars_repo_path": "utils/faucet-gen.py", "max_stars_repo_name": "chapeltech/tezos-k8s", "max_stars_repo_head_hexsha": "161189dd0968498032ce4b17a2a5122fc7e6cfdb", "max_stars_repo_licenses": ["MIT"], "max_stars_count"... |
# Licensed to Modin Development Team under one or more contributor license agreements.
# See the NOTICE file distributed with this work for additional information regarding
# copyright ownership. The Modin Development Team licenses this file to you under the
# Apache License, Version 2.0 (the "License"); you may not u... | {"hexsha": "7385689ac9fc967229372b8e67ce1024fb360dd6", "size": 3218, "ext": "py", "lang": "Python", "max_stars_repo_path": "modin/core/storage_formats/cudf/query_compiler.py", "max_stars_repo_name": "Rubtsowa/modin", "max_stars_repo_head_hexsha": "6550939753c76e896ef2bfd65bb9468d6ad161d7", "max_stars_repo_licenses": ["... |
#! /usr/bin/env python
import rospy
import math
import numpy as np
import pandas as pd
import cv2
from sensor_msgs.msg import LaserScan
from ackermann_msgs.msg import AckermannDriveStamped
from nav_msgs.msg import Odometry
from collections import defaultdict
from tf import transformations
import time
class PID(object... | {"hexsha": "98fe69991e67076b9966f8c1b2ba92f1626335b1", "size": 14023, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/A_Star_purePursuit.py", "max_stars_repo_name": "robertonali/ROS_path_planning", "max_stars_repo_head_hexsha": "8c96293a172a28315adf4c54464ae7f7bef127b9", "max_stars_repo_licenses": ["MIT"... |
#!/usr/bin/python3
import sys
sys.path.append('..')
from utils import *
# from bitarray import bitarray
import numpy as np
class DuplicateChecker:
def __init__(self, total_images):
self.previous_tags = set("this_tag_will_never_occur")
# self.all_duplicates = bitarray(total_images)
... | {"hexsha": "61876bb4a0221279d938108b9fd02a3d2a2e4ea1", "size": 1395, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/preprocess/duplicate_checker.py", "max_stars_repo_name": "AlexLamson/safebooru-predict", "max_stars_repo_head_hexsha": "f9443ffc17ead0d1ae0e5e405aeb48329212788c", "max_stars_repo_licenses": ["... |
# Autogenerated wrapper script for seatd_jll for i686-linux-gnu
export libseat, seatd
JLLWrappers.@generate_wrapper_header("seatd")
JLLWrappers.@declare_library_product(libseat, "libseat.so.1")
JLLWrappers.@declare_executable_product(seatd)
function __init__()
JLLWrappers.@generate_init_header()
JLLWrappers.@i... | {"hexsha": "b43a2bbefa82848b1308b63c7465a561f9253d04", "size": 569, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/wrappers/i686-linux-gnu.jl", "max_stars_repo_name": "JuliaBinaryWrappers/seatd_jll.jl", "max_stars_repo_head_hexsha": "77cadb1975c856a9a57a27b955209434fc485f96", "max_stars_repo_licenses": ["MIT... |
import csv, shutil, sys, os, copy, glob
import random, math
import numpy as np
frameDirectory = ""#"./AdamLevels-Processed/GameplayVideo3Source/AllFrameDescriptions"
playerFrames = "./Longplay3/megaman.csv"#"marioFramesAll.csv"
spriteFrames = "./Longplay3/spriteDescripts.csv"#"frameDescriptionColorAll.csv"
playerVelo... | {"hexsha": "83d9b1275a8ddbec32c44a49ab4181abd4fb0dfc", "size": 22986, "ext": "py", "lang": "Python", "max_stars_repo_path": "findChanges.py", "max_stars_repo_name": "mguzdial3/VideoGameEngineLearning", "max_stars_repo_head_hexsha": "4a849df7a5a53f97d604c47594fc34874bef2982", "max_stars_repo_licenses": ["MIT"], "max_sta... |
#=
The BUGS Book
Example 2.7.1 Surgery (continued): prediction
Cf ~/jags/bugs_book_2_7_1.R
"""
model {
theta ~ dbeta(3, 27) # prior distribution
Y ~ dbin(theta, 20) # sampling distribution
P6 <- step(Y - 5.5) # =1 if y >= 6, 0 otherwise
}
Summary Statistics
parameters mean std ... | {"hexsha": "1bcff10e9011021441ad2c844d83b92d2c2acf4a", "size": 2279, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "julia/turing/bugs_book_2_7_1.jl", "max_stars_repo_name": "tias/hakank", "max_stars_repo_head_hexsha": "87b7f180c9393afce440864eb9e5fb119bdec1a4", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <iterator>
#include <bits/stdc++.h>
#include <algorithm>
#include <boost/algorithm/string.hpp>
#include <glob.h>
#include "../stem/stemming/english_stem.h"
#include <fstream>
#include <dirent.h>
#include <sys/types.h>
using ... | {"hexsha": "ea3dc09dbd4123bf949a7a64716be920331a6526", "size": 12800, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "Phrase Search/phraseQuery.cpp", "max_stars_repo_name": "ankit-1517/Information-Retrieval", "max_stars_repo_head_hexsha": "ce08531f8505d5263b34b16805dbf085b1b6d0a6", "max_stars_repo_licenses": ["MIT... |
import os
import random
import numpy as np
from scipy.spatial.distance import cdist
import cv2
import time
import torch
import torch.distributed as dist
import torch.nn as nn
import torch.nn.functional as F
# import torch.multiprocessing as mp
from torch.utils.data import DataLoader
from torch.optim import Adam
# fro... | {"hexsha": "f54ea91423a60dfed2d96284ae4556741e29689a", "size": 10751, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/main_san.py", "max_stars_repo_name": "Jiangtong-Li/ZHSIR", "max_stars_repo_head_hexsha": "fd2c0a7e79f22cbf565ccd5e13342f1b317ac9b7", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_coun... |
# -*- coding: utf-8 -*-
"""ImageProcessing.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1p32u78fh3vzTuK3TgaF9Aj9NXw5ztAnC
"""
from scipy import ndimage
import numpy as np
"""###Opening and writing to image files"""
from scipy import misc
imp... | {"hexsha": "08876f6ab2567d8b2cfc5c2b85d62c7ba15ecb43", "size": 4053, "ext": "py", "lang": "Python", "max_stars_repo_path": "Image Processing/imageprocessing.py", "max_stars_repo_name": "subhayuroy/Advanced_ImageProcessing", "max_stars_repo_head_hexsha": "52ab4e52317ec022de42b8927554ba00b4b2a405", "max_stars_repo_licens... |
# Author: Markus Stabrin 2020 (markus.stabrin@mpi-dortmund.mpg.de)
# Author: Adnan Ali 2020 (adnan.ali@mpi-dortmund.mpg.de)
# Author: Thorsten Wagner 2020 (thorsten.wagner@mpi-dortmund.mpg.de)
# Author: Tapu Shaikh 2020 (tapu.shaikh@mpi-dortmund.mpg.de)
# Copyright (c) 2020- Max Planck Institute of Molecular Physiolog... | {"hexsha": "5e70c0947448bc61c3409f1350cefd92f8de7039", "size": 22982, "ext": "py", "lang": "Python", "max_stars_repo_path": "pyStarDB/sp_pystardb.py", "max_stars_repo_name": "MPI-Dortmund/pyStarDB", "max_stars_repo_head_hexsha": "0cfe9010fc8673792f061b85483221e413b80a61", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
# ---
# title: 849. Maximize Distance to Closest Person
# id: problem849
# author: Tian Jun
# date: 2020-10-31
# difficulty: Medium
# categories: Array
# link: <https://leetcode.com/problems/maximize-distance-to-closest-person/description/>
# hidden: true
# ---
#
# You are given an array representing a row of `seats` ... | {"hexsha": "6a8c7a730377c28e8c0c54aad80a6c78669aee7b", "size": 1755, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/unresolved/849.maximize-distance-to-closest-person.jl", "max_stars_repo_name": "jmmshn/LeetCode.jl", "max_stars_repo_head_hexsha": "dd2f34af8d253b071e8a36823d390e52ad07ab2e", "max_stars_repo_li... |
"""This code creates 10 different partitions of each datasets."""
import os
import sys
import numpy as np
from PIL import Image # type: ignore
from torch.utils.data import Dataset
base_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(base_path)
class DigitsDataset(Dataset):
""... | {"hexsha": "6f9e0497cb9f70d45f4736c5e9f45c985bc403c9", "size": 2988, "ext": "py", "lang": "Python", "max_stars_repo_path": "baselines/flwr_baselines/publications/fedbn/convergence_rate/utils/data_utils.py", "max_stars_repo_name": "andreea-zaharia/flower", "max_stars_repo_head_hexsha": "c576f0118e5c3d7a7d774dc156fb4b6db... |
"""
This is the main class for block ciphers.
"""
"""
Cipher
A cipher is an algorithm used to translate plaintext into ciphertext.
# Attack models
Attack model - assumptions about what the attacker can and cannot do.
1. Ciphertext-only attackers (COA) observe ciphertexts but don't know
the associated plaintext... | {"hexsha": "1ab6a14ea39daabd9449d11e098b7fab7c4cfc69", "size": 13312, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/BlockCipher.jl", "max_stars_repo_name": "Maelstrom6/CryptoTools.jl", "max_stars_repo_head_hexsha": "2a13daddd2342e16cfd65ad4bab83156e0ef0ceb", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
theory T165
imports Main
begin
lemma "(
(\<forall> x::nat. \<forall> y::nat. meet(x, y) = meet(y, x)) &
(\<forall> x::nat. \<forall> y::nat. join(x, y) = join(y, x)) &
(\<forall> x::nat. \<forall> y::nat. \<forall> z::nat. meet(x, meet(y, z)) = meet(meet(x, y), z)) &
(\<forall> x::nat. \<forall> y::nat. \<forall> z::na... | {"author": "inpefess", "repo": "residuated-binars", "sha": "330aaa51b6dbcaa06f8a6d15fe17c1ce58ae2a59", "save_path": "github-repos/isabelle/inpefess-residuated-binars", "path": "github-repos/isabelle/inpefess-residuated-binars/residuated-binars-330aaa51b6dbcaa06f8a6d15fe17c1ce58ae2a59/involution/task4/T165.thy"} |
# coding=utf-8
from __future__ import division, print_function
import numpy as np
import pandas as pd
import pyspark
from loguru import logger
from pyspark.sql import SparkSession, DataFrame
from pyspark.sql import functions as F
from pyspark.sql import types as T
from scipy.stats import variation
import sympy as sp
... | {"hexsha": "de894a307290fa37729b008973561352d3431980", "size": 21372, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/main/anovos/drift/detector.py", "max_stars_repo_name": "dattranm/anovos", "max_stars_repo_head_hexsha": "817378c810b2260e85794ef473c3080efabc34ca", "max_stars_repo_licenses": ["Apache-2.0"], ... |
% [PYR, INDICES, STEERMTX, HARMONICS] = buildSpyr(IM, HEIGHT, FILTFILE, EDGES)
%
% Construct a steerable pyramid on matrix IM. Convolutions are
% done with spatial filters.
%
% HEIGHT (optional) specifies the number of pyramid levels to build. Default
% is maxPyrHt(size(IM),size(FILT)).
% You can also specify 'auto' ... | {"author": "jbhuang0604", "repo": "SelfExSR", "sha": "8f6dd8c1d20cb7e8792a7177b4f6fd677633f598", "save_path": "github-repos/MATLAB/jbhuang0604-SelfExSR", "path": "github-repos/MATLAB/jbhuang0604-SelfExSR/SelfExSR-8f6dd8c1d20cb7e8792a7177b4f6fd677633f598/quant_eval/ifcvec_release/matlabPyrTools/buildSpyr.m"} |
### File created by preshma
import math
import os
import pickle
import h5py
import matplotlib.pyplot as plt
import numpy as np
from extract_from_aedat import extract_from_aedat
from normalizeImage3Sigma import normalizeImage3Sigma
from subsample import subsample
def ExtractEventsToVoxel(
fileID, # log fil... | {"hexsha": "1dfc3ff12b8b2640f7c83e38bd214dd6dbc2b0fc", "size": 5597, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/dhp19/generate_DHP19/Python_Files/ExtractEventsToVoxel.py", "max_stars_repo_name": "preshmalinetpereira/lifting_events_to_3d_hpe", "max_stars_repo_head_hexsha": "2d7b196dc6ab85e10ae0746665... |
println("What is your name?")
name = readline()
println("Hello $name") #string interpolation sytax
| {"hexsha": "ed65b4a1265aab81ef40797c0020709c27668bb2", "size": 101, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "Modules/Module2/src/hello-world/julia/hello-input.jl", "max_stars_repo_name": "j-hayes/intro-to-computing-sci-eng", "max_stars_repo_head_hexsha": "d4ee4ea6ba8d4c46a33eac5b4e12a29bf3cc29e1", "max_sta... |
#pragma once
#include <ros/ros.h>
#include <iostream>
#include <cav_msgs/MobilityOperation.h>
#include <cav_msgs/MobilityRequest.h>
#include <cav_msgs/MobilityResponse.h>
#include <cav_srvs/PlanManeuvers.h>
#include <cav_msgs/PlanType.h>
#include <mutex>
#include <boost/format.hpp>
#include <boost/algorithm/string.hpp... | {"hexsha": "bbc7819c5ca768f2acf1a7ff901a97138b2338ed", "size": 4960, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "platooning_strategic/include/state_machine.hpp", "max_stars_repo_name": "harderthan/carma-platform", "max_stars_repo_head_hexsha": "29921896a761a866db9cfee473f02a481d8bb9c9", "max_stars_repo_license... |
#bu dosyayı topk skorları yazdırırken yaptığım bir hatayı düzeltmek için oluşturdum
#evaluateCrops.py top1, top2 skorlarını doğru yazdırdı eğer top1 skoru doğru eşleşmeyi veriyorsa
#ancak yanlış eşleşme durumunda top2 yerine topk yazılacak idi. Ben yerine sıfır yazdırdım.
#bu hatayı düzeltmek için üretilmiş topScores.t... | {"hexsha": "825ec9034d29fbf14a1263bd357cefb542224860", "size": 1296, "ext": "py", "lang": "Python", "max_stars_repo_path": "deep_sort/deep/fixTopScores.py", "max_stars_repo_name": "h-enes-simsek/deep_sort_pytorch", "max_stars_repo_head_hexsha": "0a9ede55e53355c19455197cc8daa60336c652bb", "max_stars_repo_licenses": ["MI... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.