text stringlengths 0 1.25M | meta stringlengths 47 1.89k |
|---|---|
//
// Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com)
//
// 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)
//
// Official repository: https://github.com/boostorg/beast
//
#ifndef BOOST_BEAST_... | {"hexsha": "badc547ca4e713753e6939bc0727427f8033c92b", "size": 907, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "include/boost/beast/core/detail/async_op_base.hpp", "max_stars_repo_name": "DokuEnterprise/boost", "max_stars_repo_head_hexsha": "f2dc8be896eabd5f5da18d3b78abec2f5a04d4e5", "max_stars_repo_licenses":... |
import pandas as pd
import numpy as np
class Treefile(object):
"""Tools for working with a treefile (.tree)"""
def __init__(self,
fname=None,
comment_char="#",
field_sep=" ",
cluster_sep=":"):
"""
:fname: filename for the treefil... | {"hexsha": "a19b600772505717507948b0439ae49dd01a49b7", "size": 3555, "ext": "py", "lang": "Python", "max_stars_repo_path": "h1theswan_utils/treefiles/treefile_utils.py", "max_stars_repo_name": "h1-the-swan/h1theswan_utils", "max_stars_repo_head_hexsha": "2b6d7fb3ab9cf23077d10d9d67ab0b7ed2f10560", "max_stars_repo_licens... |
"""
Created on March 30, 2018
@author: Alejandro Molina
"""
from os.path import dirname
import numpy as np
import os
import arff
from scipy.io.arff import loadarff
import pandas as pd
import xml.etree.ElementTree as ET
import logging
logger = logging.getLogger(__name__)
path = dirname(__file__) + "/"
def one_hot... | {"hexsha": "b75c41de23ac8855ac63360b4cd3650f331b58d7", "size": 5405, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/spn/data/datasets.py", "max_stars_repo_name": "tkrons/SPFlow_topdownrules", "max_stars_repo_head_hexsha": "6227fc973f4f36da7fbe25fa500d656eb7273033", "max_stars_repo_licenses": ["Apache-2.0"],... |
'''
Script to generate the tables to display the explanation radar plots of all observed mutations in EGFR across GBM and LUAD
Input, raw Source data:
-- {gene}.{ttype}.prediction.tsv.gz: Saturation prediction of all mutations in gene == EGFR across ttype == GBM and LUAD
-- cohorts.tsv: IntOGen derived information ab... | {"hexsha": "96501171aac55ae38d7d5339f0ff0a3b4bcac9c7", "size": 1894, "ext": "py", "lang": "Python", "max_stars_repo_path": "Figure2/scripts/prepare_tables_all_mutations.py", "max_stars_repo_name": "bbglab/boostdm-analyses", "max_stars_repo_head_hexsha": "9e520b0231810bed0142b84997276419fd04e120", "max_stars_repo_licens... |
"""Largest error for regression problems. Highly sensitive to outliers."""
import typing
import numpy as np
from h2oaicore.metrics import CustomScorer
class MyLargestErrorScorer(CustomScorer):
_description = "My Largest Error Scorer for Regression."
_regression = True
_maximize = False
_perfect_score ... | {"hexsha": "16257fdd6af8855194d7c7c683b4cd42559ad8fd", "size": 765, "ext": "py", "lang": "Python", "max_stars_repo_path": "scorers/regression/largest_error.py", "max_stars_repo_name": "james94/driverlessai-recipes", "max_stars_repo_head_hexsha": "87c35460db59ffda8dc18ad82cb3a9b8291410e4", "max_stars_repo_licenses": ["A... |
#! /usr/bin/env python
"""
This script tests the result of the Galilen method in WarpX.
It compares the energy of the electric field calculated using Galilean method with
'v_galiean = (0.,0., 0.99498743710662)' versus standard PSATD (v_galiean = (0.,0.,0.)):
* if 'v_galilean == 0': simulation is unstable because of... | {"hexsha": "1369142374d500c9459986fe4e452a47196518a2", "size": 2076, "ext": "py", "lang": "Python", "max_stars_repo_path": "Examples/Tests/galilean/analysis_2d.py", "max_stars_repo_name": "danielbelkin/WarpX", "max_stars_repo_head_hexsha": "01779153affdbdd12ea31e1a74e65e6953c42596", "max_stars_repo_licenses": ["BSD-3-C... |
#ifndef STAN_MATH_PRIM_SCAL_PROB_PARETO_TYPE_2_RNG_HPP
#define STAN_MATH_PRIM_SCAL_PROB_PARETO_TYPE_2_RNG_HPP
#include <boost/random/variate_generator.hpp>
#include <stan/math/prim/scal/err/check_consistent_sizes.hpp>
#include <stan/math/prim/scal/err/check_finite.hpp>
#include <stan/math/prim/scal/err/check_greater_o... | {"hexsha": "088d0ee1fee3eb093084bd7ef6ae0e64748dd82d", "size": 1186, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "cmdstan/stan/lib/stan_math/stan/math/prim/scal/prob/pareto_type_2_rng.hpp", "max_stars_repo_name": "yizhang-cae/torsten", "max_stars_repo_head_hexsha": "dc82080ca032325040844cbabe81c9a2b5e046f9", "m... |
subroutine cg (suba,subat,subql,subqlt,subqr,subqrt,subadp,
a coef,jcoef,n,u,ubar,rhs,wksp,iwksp,
a iparm,rparm,ier)
implicit double precision (a-h, o-z)
external suba, subat, subql, subqlt, subqr, subqrt, subadp
integer iparm(30), jcoef(2), iwksp(1)
... | {"hexsha": "4c7e403b34673e46fb94b8b416dfca1e8eca32b2", "size": 219882, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "svSolver-master/Code/ThirdParty/nspcg/simvascular_nspcg/nspcg2.f", "max_stars_repo_name": "mccsssk2/SimVascularPM3_March2020", "max_stars_repo_head_hexsha": "3cce6cc7be66545bea5dc3915a2db50a3892... |
import argparse
import glob
import logging
import os
import librosa
import numpy as np
import pyworld as pw
import soundfile as sf
from functools import partial
from multiprocessing import Pool
from tqdm import tqdm
from tensorflow_tts.utils import remove_outlier
def generate(data):
tid = dat... | {"hexsha": "c63cddf56b38609d424978fc5604c05dd396d488", "size": 4082, "ext": "py", "lang": "Python", "max_stars_repo_path": "bin/dump_f0_energy.py", "max_stars_repo_name": "nkari82/LPCNet", "max_stars_repo_head_hexsha": "f0f2e943bbb049b21ce91016726aab0b71960e5e", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_c... |
"""Module for handling GPAW input and output.
This module requires GPAW (https://wiki.fysik.dtu.dk/gpaw/) to run the read
function but is importable without it for use with ase. However it will not
show as an available filetype unless installed.
"""
import numpy as np
from .cube import write
try:
from gpaw impor... | {"hexsha": "3ce1454e75c9ab73faead48be5195814a24dc19e", "size": 2498, "ext": "py", "lang": "Python", "max_stars_repo_path": "pybader/io/gpaw.py", "max_stars_repo_name": "adam-kerrigan/pybader", "max_stars_repo_head_hexsha": "1d675ae69ab64fe336b936b00990681e01258031", "max_stars_repo_licenses": ["MIT"], "max_stars_count"... |
"""
Functions related to computation of the log-likelihood.
"""
#***************************************************************************************************
# Copyright 2015, 2019 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
# Under the terms of Contract DE-NA0003525 with NTESS, the U.S. ... | {"hexsha": "4c03de6ee40ac99783d852b9e5c86f24b03192d2", "size": 50576, "ext": "py", "lang": "Python", "max_stars_repo_path": "pygsti/tools/likelihoodfns.py", "max_stars_repo_name": "colibri-coruscans/pyGSTi", "max_stars_repo_head_hexsha": "da54f4abf668a28476030528f81afa46a1fbba33", "max_stars_repo_licenses": ["Apache-2.... |
import numpy as np
import math as m
def Rx(theta):
return np.matrix([[ 1, 0 , 0 ],
[ 0, m.cos(theta),-m.sin(theta)],
[ 0, m.sin(theta), m.cos(theta)]])
def Ry(theta):
return np.matrix([[ m.cos(theta), 0, m.sin(theta)],
[ 0 ... | {"hexsha": "017f8affe5c5a434f83050e5df4aea8d89237bb0", "size": 698, "ext": "py", "lang": "Python", "max_stars_repo_path": "scr/mat_con.py", "max_stars_repo_name": "ramune0144/project_3d_recon", "max_stars_repo_head_hexsha": "d732178c01ef7dfa245111831e89107d1f3b07c6", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
# -*- coding: utf-8 -*-
#
"""
This script takes a continuation file and a solution file and plots the states
next to a continuation diagram. All frames are written to PNG files which can
later be concatenated into a movie.
"""
import os.path
import numpy as np
import paraview.simple as pv
import matplotlib.pyplot as ... | {"hexsha": "0fbeaca1d5e71a7e08a05d482e2160c390d23855", "size": 12173, "ext": "py", "lang": "Python", "max_stars_repo_path": "tools/visualize.py", "max_stars_repo_name": "nschloe/pynosh", "max_stars_repo_head_hexsha": "331454b29246e6c009878589aad2dccb9fda6c30", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 8, "... |
import cv2
import numpy as np
IMAGE_W = 64
IMAGE_H = 64
IMAGE_D = 3
dataset_root = '../imagenet-tiny'
def read_train_data():
data_size = 100000
imgset = np.array(np.zeros(data_size * IMAGE_H * IMAGE_W * IMAGE_D, dtype=np.float32)).reshape([data_size, IMAGE_H, IMAGE_W, IMAGE_D])
labset = np.array(np.zeros... | {"hexsha": "c0c1a70e3710cb473292c2fefa44dc832c7982d5", "size": 2885, "ext": "py", "lang": "Python", "max_stars_repo_path": "TINY_input.py", "max_stars_repo_name": "rllab-snu/Deep-Elastic-Network", "max_stars_repo_head_hexsha": "c6c66249b67172e144dfb141262a5b6fec2b7ae8", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
#! -*- coding: utf-8 -*-
from flexible_clustering_tree.base_clustering import RecursiveClustering
from flexible_clustering_tree.models import ClusteringOperator, MultiClusteringOperator, MultiFeatureMatrixObject, FeatureMatrixObject, ClusterTreeObject
import unittest
# clustering algorithm
from sklearn.cluster import K... | {"hexsha": "d46fa585d2c09bf2dfb3eb49ebfa94a8062bf684", "size": 4587, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_base_clustering.py", "max_stars_repo_name": "Kensuke-Mitsuzawa/flexible_clustering_tree", "max_stars_repo_head_hexsha": "026752372e75075027d4fbe25f1cb6375fe0e175", "max_stars_repo_licen... |
import numpy as np
from finitewave.core.stimulation import Stim
class StimCurrentCoord3D(Stim):
def __init__(self, time, current, duration, x1, x2, y1, y2, z1, z2):
Stim.__init__(self, time, current=current, duration=duration)
x = np.arange(x1, x2)
y = np.arange(y1, y2)
z = np.ara... | {"hexsha": "8ec9feff41b0fb1df0f956ab75f7044d11b52ac7", "size": 535, "ext": "py", "lang": "Python", "max_stars_repo_path": "finitewave/cpuwave3D/stimulation/stim_current_coord_3d.py", "max_stars_repo_name": "ArsOkenov/Finitewave", "max_stars_repo_head_hexsha": "14274d74be824a395b47a5c53ba18188798ab70d", "max_stars_repo_... |
/*
* Copyright (c) 2019 Opticks Team. All Rights Reserved.
*
* This file is part of Opticks
* (see https://bitbucket.org/simoncblyth/opticks).
*
* 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 ... | {"hexsha": "6e47b5ab77483ea4dabbad2f517e2ca1237d5a18", "size": 26137, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "npy/NPYBase.cpp", "max_stars_repo_name": "hanswenzel/opticks", "max_stars_repo_head_hexsha": "b75b5929b6cf36a5eedeffb3031af2920f75f9f0", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count"... |
# =============================================================================
# Standard imports
# =============================================================================
import os
import logging
import datetime
# =============================================================================
# External imports ... | {"hexsha": "715570ecb35737dbe5c653372ea5ec3b721dd460", "size": 8625, "ext": "py", "lang": "Python", "max_stars_repo_path": "03 scripts/00 Superceded/04 Model SGD vanilla r00.py", "max_stars_repo_name": "bmj-hackathon/hack_sfpd2", "max_stars_repo_head_hexsha": "23fcce244c3f430413811e388a293e87b95a8df2", "max_stars_repo_... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from sklearn.metrics import roc_curve
from scipy.optimize import brentq
from scipy.interpolate import interp1d
import numpy as np
class GE2ELoss(nn.Module):
def __init__(self, init_w=10.0, init_b=-5.0, loss_method='softmax'):
'''
... | {"hexsha": "0a331f3bfcb2509ed183f9233a22a1b8acd3a5ea", "size": 5214, "ext": "py", "lang": "Python", "max_stars_repo_path": "encoder/loss.py", "max_stars_repo_name": "shaojinding/Real-Time-Voice-Cloning", "max_stars_repo_head_hexsha": "ff34ff13047d4780b857fe1572b0e94936a85a89", "max_stars_repo_licenses": ["MIT"], "max_s... |
# 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": "e865002e779d96f7483f87d531fad23a681aec4a", "size": 9383, "ext": "py", "lang": "Python", "max_stars_repo_path": "tangent/grads.py", "max_stars_repo_name": "Patil2099/tangent", "max_stars_repo_head_hexsha": "e38245dfceb715a0300479171b2ccd1229d46346", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count... |
import tensorflow as tf
import numpy as np
from abc import ABCMeta, abstractmethod
from typing import List
class BaseDataset(metaclass=ABCMeta):
@abstractmethod
def __init__(self, filenames, batch_size, training, num_parallel_calls):
self.filenames = filenames
self.batch_size = batch_size
... | {"hexsha": "b11133fa0fa1d09bc6c023e70ca89f9a16498bc3", "size": 4079, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/base_classes/datasets.py", "max_stars_repo_name": "ssmehta/GCN-retention-time-predictions", "max_stars_repo_head_hexsha": "0ed17afa70d363033025cb4cc7b940ff3cb9ed8d", "max_stars_repo_licenses":... |
/-
Copyright (c) 2021 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen
-/
import data.fun_like.basic
/-!
# Typeclass for a type `F` with an injective map to `A ↪ B`
This typeclass is primarily for use by embeddings such as `rel_embedding`.
##... | {"author": "Mel-TunaRoll", "repo": "Lean-Mordell-Weil-Mel-Branch", "sha": "4db36f86423976aacd2c2968c4e45787fcd86b97", "save_path": "github-repos/lean/Mel-TunaRoll-Lean-Mordell-Weil-Mel-Branch", "path": "github-repos/lean/Mel-TunaRoll-Lean-Mordell-Weil-Mel-Branch/Lean-Mordell-Weil-Mel-Branch-4db36f86423976aacd2c2968c4e4... |
import numpy as np
import tensorflow as tf
import DeepSparseCoding.tf1x.utils.plot_functions as pf
import DeepSparseCoding.tf1x.utils.data_processing as dp
from DeepSparseCoding.tf1x.models.base_model import Model
from DeepSparseCoding.tf1x.modules.mlp_module import MlpModule
from DeepSparseCoding.tf1x.modules.class_a... | {"hexsha": "f9d0f42e731f40e3731fb5db8c282301e7218e5f", "size": 12712, "ext": "py", "lang": "Python", "max_stars_repo_path": "tf1x/models/mlp_model.py", "max_stars_repo_name": "dpaiton/DeepSparseCoding", "max_stars_repo_head_hexsha": "5ea01fa8770794df5e13743aa3f2d85297c27eb1", "max_stars_repo_licenses": ["MIT"], "max_st... |
import pandas as pd
import numpy as np
columns = ['hair', 'identity', 'hair_dist', 'identity_dist', 'dist']
df_512 = pd.read_csv('dist_data_512.csv', names=columns)
df_18x512 = pd.read_csv('dist_data_18x512.csv', names=columns)
df_proj_512 = pd.read_csv('dist_data_projections_512.csv', names=columns)
df_proj_18x512 = ... | {"hexsha": "de3fdfdfde0772ceb85840657f422781851d3296", "size": 1490, "ext": "py", "lang": "Python", "max_stars_repo_path": "fid_and_dist_eval/get_mean_distances_from_data.py", "max_stars_repo_name": "OvidiuSabau/stylegan2-ada-pytorch", "max_stars_repo_head_hexsha": "60d942a799ca4fe203b6ca136ed4f6147ab174ab", "max_stars... |
"""Audio signal processing"""
import numpy as np
def smoothed_power(
data: np.ndarray, window_size: int, mode: str = "valid"
) -> np.ndarray:
"""Calculate moving time window RMS power for a signal
Produce amplitude envelope, which reperesents signal power over time.
Power is calculated as RMS (root ... | {"hexsha": "3a4d77403784822b45ccecf214101e78e5783c3d", "size": 2122, "ext": "py", "lang": "Python", "max_stars_repo_path": "morse_audio_decoder/processing.py", "max_stars_repo_name": "mkouhia/wundernut_11", "max_stars_repo_head_hexsha": "ed9894f6718b85fbc3025edf94720d814482ab21", "max_stars_repo_licenses": ["MIT"], "ma... |
// Copyright (c) 2015-2020 Daniel Cooke
// Use of this source code is governed by the MIT license that can be found in the LICENSE file.
#ifndef mappable_ranges_hpp
#define mappable_ranges_hpp
#include <iterator>
#include <type_traits>
#include <cstddef>
#include <boost/iterator/filter_iterator.hpp>
#include <boost/... | {"hexsha": "fe0ee96362681de878d93b555bd2090a91d31455", "size": 7897, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "src/concepts/mappable_range.hpp", "max_stars_repo_name": "roryk/octopus", "max_stars_repo_head_hexsha": "0ec2839c33b846107278696ee04ce6d7d0f69a54", "max_stars_repo_licenses": ["MIT"], "max_stars_cou... |
import argparse
from baselines.common import plot_util as pu
parser = argparse.ArgumentParser()
parser.add_argument('path', help='an integer for the accumulator')
args = parser.parse_args()
exp_prefix = '/home/murtaza/research/baselines/logs/'
results = pu.load_results(exp_prefix + args.path)
import matplotlib.pyplot ... | {"hexsha": "57a67bf12fb28573d0d5282db5e670f8cd1d7921", "size": 432, "ext": "py", "lang": "Python", "max_stars_repo_path": "plot.py", "max_stars_repo_name": "stevenlin1111/baselines", "max_stars_repo_head_hexsha": "8c5aa663056c031a54b039c52c981c2a07dd9e4e", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "m... |
""" Dias de vida
# Leia a idade de uma pessoa expressa em anos, meses e dias
# e escreva a idade dessa pessoa expressa apenas em dias.
# Considerar ano com 365 dias e mês com 30 dias.
"""
println("informe sua idade")
days = ( parse(UInt8, readline()) * 365 )
println("informar quantos meses de vida ")
days += ( parse... | {"hexsha": "f551cef2cc328e11c546677fbc134cf5893bb57d", "size": 461, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/julia/input/dias-vida.jl", "max_stars_repo_name": "codinginbrazil/functional-programming", "max_stars_repo_head_hexsha": "43ce604bd21d82ad16774709cb939d3a2bd86f49", "max_stars_repo_licenses": ["... |
import networkx as nx
def create_schoolyear_class_network(siblings_df, initial_network):
"""
Creates the net of classes, where edges are siblings.
Returns
-------
network
Net of schoolYear-class.
"""
initial = initial_network
df_siblings = siblings_df
siblings = df_siblings.values
schoolyear_class = nx.G... | {"hexsha": "6cfc99ced56420551e94361e405101181b53130d", "size": 2240, "ext": "py", "lang": "Python", "max_stars_repo_path": "Environment/sire/fileNetCreation.py", "max_stars_repo_name": "Mariaojruiz/Sibling-Rewiring", "max_stars_repo_head_hexsha": "d70b96c33766d6177407e64bd733a004044351e1", "max_stars_repo_licenses": ["... |
#pragma once
#include <memory>
#include <boost/asio.hpp>
#include <vector>
#include <string>
#include "IncomingMessage.hpp"
#include "ServerResponse.hpp"
namespace WebForge {
namespace http {
class Connection;
using ConnectionPtr = std::shared_ptr<Connection>;
class Connection : public std::enable_shared_from_this... | {"hexsha": "4c69466b422c424b3124de95b4746332d3a7cfae", "size": 1152, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "src/Core/Connection.hpp", "max_stars_repo_name": "kefaise/WebForge", "max_stars_repo_head_hexsha": "c0a7ce197509da27d2ba8c4467861cbdccad22be", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
import numpy as np
from matplotlib import pyplot as plt
import cv2 as cv
import math
def __ninePartitions(image):
linhas = len(image)
colunas = len(image[0])
xPart = np.linspace(0, linhas, num=4, dtype=int)
yPart = np.linspace(0, colunas, num=4, dtype=int)
return xPart, yPart
def borderDetection... | {"hexsha": "a15185708092816d3b00a269aaf57482612a027e", "size": 10616, "ext": "py", "lang": "Python", "max_stars_repo_path": "TP1/globalHistogram.py", "max_stars_repo_name": "taigosant/Ebagens", "max_stars_repo_head_hexsha": "a01b0e21480f75b525cbeaaeb9aeea13948ee2e4", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
"""
Combine metric_generator and attract_repel_clusterer to derive a low dimensional layout
"""
from . import local_files
import numpy as np
import jp_proxy_widget
from jp_doodle.data_tables import widen_notebook
from jp_doodle import dual_canvas
from IPython.display import display
required_javascript_modules = [
... | {"hexsha": "3e7cbfcd9cdfb8f5fb9ba1dac2083dbc8a9368db", "size": 11272, "ext": "py", "lang": "Python", "max_stars_repo_path": "feedWebGL2/push_pull_vectors.py", "max_stars_repo_name": "flatironinstitute/feedWebGL2", "max_stars_repo_head_hexsha": "5d024375ab54b35a19b114126b4ce789a41c46fa", "max_stars_repo_licenses": ["BSD... |
# import zmq
import vtk
# import csv
# from datetime import datetime
import numpy as np
import pdb
class AnimatorCSV(object):
def __init__(self, Skeleton, jointsFile, saveFolder):
#self.context = zmq.Context()
#self.subscriber = self.context.socket(zmq.SUB)
#self.subscriber.connect(Connecti... | {"hexsha": "c0ca36e94e72d124354249dbeb707bf28826a621", "size": 12169, "ext": "py", "lang": "Python", "max_stars_repo_path": "visualize/MultiPersonVisualizer/AnimatorTemporal.py", "max_stars_repo_name": "ys1998/motion-forecast", "max_stars_repo_head_hexsha": "ef8fa9d597906a756f28952a731f6bc8d178f2bf", "max_stars_repo_li... |
//
// Created by yche on 12/13/17.
//
#include <iostream>
#include <boost/program_options.hpp>
#include "simrank.h"
int main(int argc, char *argv[]) {
string data_name = argv[1];
int a = atoi(argv[2]);
int b = atoi(argv[3]);
DirectedG g;
load_graph("./datasets/edge_list/" + data_name + ".txt", g... | {"hexsha": "7e860ca37593fc0ced3eb79a728c0cf7d47c7ef2", "size": 433, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "APS/main_ground_truth.cpp", "max_stars_repo_name": "RapidsAtHKUST/SimRank", "max_stars_repo_head_hexsha": "3a601b08f9a3c281e2b36b914e06aba3a3a36118", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
module DiffEqWrappers
using Test
using GridapODEs.TransientFETools: TransientFEOperator
using GridapODEs.ODETools: allocate_cache
using GridapODEs.ODETools: update_cache!
using GridapODEs.ODETools: residual!
using GridapODEs.ODETools: jacobian_and_jacobian_t!
using GridapODEs.ODETools: jacobian!
using GridapODEs.ODE... | {"hexsha": "580a7780f24003169718484c500649a19287f0e8", "size": 2797, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/DiffEqsWrappers/DiffEqsWrappers.jl", "max_stars_repo_name": "sjoerdvanhoof/GridapODEs.jl", "max_stars_repo_head_hexsha": "24beb434ad6c0b315f06b65cc1c9c791c44d4317", "max_stars_repo_licenses": [... |
import numpy as np
from openff.toolkit.topology import Molecule, Topology
from simtk import unit
from openff.system.exceptions import InterMolEnergyComparisonError
def top_from_smiles(
smiles: str,
n_molecules: int = 1,
) -> Topology:
"""Create a gas phase OpenFF Topology from a single-molecule SMILES
... | {"hexsha": "f57471725d742329ac6b665170cc77033792b094", "size": 1734, "ext": "py", "lang": "Python", "max_stars_repo_path": "openff/system/tests/utils.py", "max_stars_repo_name": "mattwthompson/openff-system", "max_stars_repo_head_hexsha": "3cb43d3236304ebc0304c4e691d9101dc1773f22", "max_stars_repo_licenses": ["MIT"], "... |
!++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
! Futility Development Group !
! All rights reserved. !
! ... | {"hexsha": "44d385e982e7f1a6fd3a45efec2ce2d5ae9bea0a", "size": 12908, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "unit_tests/testSearch/testSearch.f90", "max_stars_repo_name": "picmc/Futility", "max_stars_repo_head_hexsha": "158950c2c3aceffedf547ed4ea777e023035ca6e", "max_stars_repo_licenses": ["Apache-2.0... |
SUBROUTINE GETTAGPR ( LUNIT, TAGCH, NTAGCH, TAGPR, IRET )
C$$$ SUBPROGRAM DOCUMENTATION BLOCK
C
C SUBPROGRAM: GETTAGPR
C PRGMMR: J. ATOR ORG: NP12 DATE: 2012-09-12
C
C ABSTRACT: GIVEN A MNEMONIC CORRESPONDING TO A CHILD DESCRIPTOR
C WITHIN A PARENT SEQUENCE, THIS SUBROUTINE RETURNS THE MNEMONI... | {"hexsha": "9f94e70865eb736ace8a6a5f89dc78d2a0f973ec", "size": 3207, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "var/external/bufr/gettagpr.f", "max_stars_repo_name": "matzegoebel/WRF-fluxavg", "max_stars_repo_head_hexsha": "686ae53053bf7cb55d6f078916d0de50f819fc62", "max_stars_repo_licenses": ["BSD-2-Clause... |
# -- PRIVATE FUNCTIONS NOT EXPORTED -------------------------------------------------------------- #
function _reorder_logic_with_callback(symbol_array::Array{String,1}; callback::Union{Function,Nothing} = nothing)
# if there is callback logic -> use it ...
if (isnothing(callback) == false)
return call... | {"hexsha": "858e6236fdedccb8d7928c0005781c17dcf622c0", "size": 2197, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/base/Callbacks.jl", "max_stars_repo_name": "varnerlab/CellFreeModelGenerationKit", "max_stars_repo_head_hexsha": "7106243229a4df170887202d695fe3db87bc9aa2", "max_stars_repo_licenses": ["MIT"], ... |
"""Defines the most commonly used kernels."""
import math
from scipy import stats
import numpy as np
__author__ = "Miguel Carbajo Berrocal"
__email__ = "miguel.carbajo@estudiante.uam.es"
def normal(u):
r"""Evaluate a normal kernel.
.. math::
K(x) = \frac{1}{\sqrt{2\pi}}e^{-\frac{x^2}{2}}
"""
... | {"hexsha": "9895c3b489ecec1239bb08a0522f292e15acfc44", "size": 2597, "ext": "py", "lang": "Python", "max_stars_repo_path": "skfda/misc/kernels.py", "max_stars_repo_name": "jiduque/scikit-fda", "max_stars_repo_head_hexsha": "5ea71e78854801b259aa3a01eb6b154aa63bf54b", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_sta... |
import logging
import threading
import time
import numpy as np
from pyfmi.fmi import load_fmu
LOGGER = logging.getLogger(__name__)
Ws2kWh = 0.0000002777778 # 1 watt-second = 2.777778e-7 kilowatt-hour
class DeviceSimulator:
"""This class provides a simulation of a physical electric device"""
running_simu... | {"hexsha": "bf6089b482254963e7f7b2f590be5ca45633e824", "size": 12016, "ext": "py", "lang": "Python", "max_stars_repo_path": "app/simulator/device_simulator.py", "max_stars_repo_name": "aau-daisy/flexibleloadsimulator", "max_stars_repo_head_hexsha": "5f1b37169511ffe2293dc28ce21cf2238a451123", "max_stars_repo_licenses": ... |
from tqdm import tqdm
import glob
import numpy as np
import cv2
import shutil
from imgaug import augmenters as iaa
seq = iaa.Sequential([iaa.Flipud(0.5)])
loc = "C:\\Users\\parth\\test_pp"
new_loc = "C:\\Users\\parth\\test_pp\\"
imglist = []
print('reading')
for file in tqdm(glob.glob(loc+"\\"+"*.jpeg")):
img = c... | {"hexsha": "ada981db98fcaefac669aa8403f717c2177cc304", "size": 529, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/miscellaneous scripts/Parths_script/DR_scripts/exprement.py", "max_stars_repo_name": "Tirth27/Detecting-diabetic-retinopathy", "max_stars_repo_head_hexsha": "86ba4fe616e15f72f509f1ed17a5b2dae8c... |
import os
import numpy
ROOT = '/home/lorenzp/adversialml/src/src/submodules/adversarial-detection/expts'
DATA_PATH = os.path.join(ROOT, 'data')
NUMPY_DATA_PATH = os.path.join(ROOT, 'numpy_data')
MODEL_PATH = os.path.join(ROOT, 'models')
OUTPUT_PATH = os.path.join(ROOT, 'outputs')
# Normalization constants for the dif... | {"hexsha": "8ae7bbfd4e281094b6ece3ecf7d6de0878e8e55b", "size": 4059, "ext": "py", "lang": "Python", "max_stars_repo_path": "expts/helpers/constants.py", "max_stars_repo_name": "adverML/adversarial-detection", "max_stars_repo_head_hexsha": "0173b19a7352a2ec769f24a89d4e2cf8f4423514", "max_stars_repo_licenses": ["MIT"], "... |
import matplotlib.pyplot as plt
from dumps import store, load
import networkx as nx
from sys import argv
tooMany = 100 # surpress the labels for large graphs
plt.rcParams['figure.figsize'] = 40, 40
verbose = False # print out the edge list
filename = argv[1]
print('Loading graph data from', filename)
G = load(filename... | {"hexsha": "0132077d02ab016dfe0205a0c379662f5640574b", "size": 1295, "ext": "py", "lang": "Python", "max_stars_repo_path": "vis.py", "max_stars_repo_name": "satuelisa/BBICA", "max_stars_repo_head_hexsha": "0ecaffa20bfa0e4d552fecf00d8ce718ca88491c", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_stars... |
import numpy as np
class Value_Iteration:
def __init__(self, env, gamma):
self.env = env
# discount rate
self.gamma = gamma
self.n_states = self.env.get_n_states()
self.n_actions = self.env.get_n_actions()
self.terminal_states = self.env.get_terminal_states()
... | {"hexsha": "f372d0ba167073eb9fdadcd65e5d7b6b9c0ae7c0", "size": 3497, "ext": "py", "lang": "Python", "max_stars_repo_path": "rl_main/algorithms_dp/DP_Value_Iteration.py", "max_stars_repo_name": "link-kut/distributed_transfer_rl", "max_stars_repo_head_hexsha": "cdfc10730fdaaefdf3b213b1edc9234cfd80ceef", "max_stars_repo_l... |
"""
Continuous interactions
=======================
"""
import numpy as np
import pandas as pd
import seaborn as sns
sns.set(style="darkgrid")
rs = np.random.RandomState(11)
n = 80
x1 = rs.randn(n)
x2 = x1 / 5 + rs.randn(n)
b0, b1, b2, b3 = .5, .25, -1, 2
y = b0 + b1 * x1 + b2 * x2 + b3 * x1 * x2 + rs.randn(n)
df ... | {"hexsha": "ead6ed3b84f38e6a1a8513b0493b45ce6791d250", "size": 419, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/interactplot.py", "max_stars_repo_name": "yarikoptic/seaborn", "max_stars_repo_head_hexsha": "ed4baa32267cc4a44abb40dc243ae75a1d180e85", "max_stars_repo_licenses": ["MIT", "BSD-3-Clause"],... |
"""
scattering_field(args)
Returns a function which gives the average scattering coefficients for any vector `x` inside the material. This field is defined by Equation (3.13) in [AL Gower and G Kristensson, "Effective waves for random three-dimensional particulate materials", (2021)](https://arxiv.org/pdf/2010.00... | {"hexsha": "e7483f33133298e6b917f27ea1a0c43c57595d9d", "size": 7088, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/effective_wave/wavemode.jl", "max_stars_repo_name": "arturgower/EffectiveWaves", "max_stars_repo_head_hexsha": "3c05bc151ce7a5074cdfb9b677383c5073c80cd3", "max_stars_repo_licenses": ["MIT"], "m... |
\chapter{Conclusion}
\emph{Start with some text describing the content of the chapter.}\\
\noindent The report ends with a conclusion and finally suggestions for further research. This can be written in a separate chapter or at the end of the discussion. The finish can be read independently and it is thus preferable t... | {"hexsha": "3d222194e3760b51b3c1a8a4730b8e888661e0d9", "size": 1561, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "report/conclusion.tex", "max_stars_repo_name": "maryokhin/lnu-thesis-template", "max_stars_repo_head_hexsha": "2511bc960aa861d02ca7b74ed46c0b37314e5ca4", "max_stars_repo_licenses": ["MIT"], "max_sta... |
[STATEMENT]
lemma results_gpv_catch_gpv:
"results_gpv \<I> (catch_gpv gpv) = Some ` results_gpv \<I> gpv \<union> (if colossless_gpv \<I> gpv then {} else {None})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. results_gpv \<I> (catch_gpv gpv) = Some ` results_gpv \<I> gpv \<union> (if colossless_gpv \<I> gpv then... | {"llama_tokens": 180, "file": "CryptHOL_Generative_Probabilistic_Value", "length": 1} |
import unittest
import numpy as np
from functools import partial
from scipy import stats
import sympy as sp
from pyapprox.univariate_polynomials.quadrature import \
gauss_jacobi_pts_wts_1D, gauss_hermite_pts_wts_1D, \
clenshaw_curtis_pts_wts_1D, leja_growth_rule, \
constant_increment_growth_rule
from pyapp... | {"hexsha": "8c05e1ef4b5ab09afc5ecf73dbe997aa1a5de18a", "size": 9079, "ext": "py", "lang": "Python", "max_stars_repo_path": "pyapprox/univariate_polynomials/tests/test_quadrature.py", "max_stars_repo_name": "ConnectedSystems/pyapprox", "max_stars_repo_head_hexsha": "4f405654c707cba83d211f327c0f0fdbc95efa29", "max_stars_... |
import argparse
import datetime
import math
import os
import pdb
import random
import sys
import time
import numpy as np
import torch
from torch.utils.data import DataLoader
import sys
sys.path.append('.')
from config import TrainConfig
from tools.simmc_dataset import SIMMCDatasetForActionPrediction
class Collate... | {"hexsha": "a2471120c6ef68ff0f959cf313b5d9d37291e0b9", "size": 8706, "ext": "py", "lang": "Python", "max_stars_repo_path": "mm_action_prediction/preprocessing.py", "max_stars_repo_name": "seo-95/dstc9-SIMMC", "max_stars_repo_head_hexsha": "0f967f874e360ea00ac4629b0ac9f3d9c25a833a", "max_stars_repo_licenses": ["MIT"], "... |
'''
use Approximate Nearest Neighbours to see whether the doc vectors work
requires the Spotify Annoy package
depends on previous creation of two data frames from 02_dgi_embeddings.py:
- embeddings_use_large_2000_df.csv
- text_use_large_2000_df.csv
or whatever you have chosen to call them in the previous step of creati... | {"hexsha": "b82e34e467907233aa89b489fbf64e342e98032e", "size": 5436, "ext": "py", "lang": "Python", "max_stars_repo_path": "notebooks/recommend-content-dgi/04_annoy_recommend_content.py", "max_stars_repo_name": "alphagov-mirror/govuk-entity-personalisation", "max_stars_repo_head_hexsha": "a674bca4c15691fe2c4e32ea213dfc... |
[STATEMENT]
lemma ctx_dcl_mem_path:
"find_path_f P ctx (cl_fqn (fqn_def dcl)) = Some path \<Longrightarrow> (ctx, dcl) \<in> (\<lambda>(ctx, cld). (ctx, class_name_f cld)) ` set path"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. find_path_f P ctx (cl_fqn (fqn_def dcl)) = Some path \<Longrightarrow> (ctx, dcl) \<... | {"llama_tokens": 1264, "file": "LightweightJava_Lightweight_Java_Equivalence", "length": 8} |
import cv2
import glob
import random
import sys
import os
import numpy as np
emotions = ["anger", "happy", "sadness"]
fishface = cv2.createFisherFaceRecognizer()
data = {}
def run_recognizer():
fishface.load("trained_emoclassifier.xml")
prediction_data1 = []
files = glob.glob("face_cut\\try\\*")
pre... | {"hexsha": "92eceaeb8c96cbec6a3575e795da7b365aa89979", "size": 647, "ext": "py", "lang": "Python", "max_stars_repo_path": "Server/firts.py", "max_stars_repo_name": "auro5/EMP3", "max_stars_repo_head_hexsha": "b0f711e44e2a8adfdb11effad33229aeeb31f21d", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_st... |
# from __future__ import print_function, division
import torch
import numpy as np
from sklearn.preprocessing import StandardScaler
import random
from PIL import Image
import torch.utils.data as data
import os
import os.path
class TextData():
def __init__(self, text_file, label_file, source_batch_size=64, target_... | {"hexsha": "ed13a6eca06f5af1e3b0ad49c2a31dd9da5c0a87", "size": 8119, "ext": "py", "lang": "Python", "max_stars_repo_path": "code/data_list.py", "max_stars_repo_name": "haibinzheng/KekeHu_DTLDP", "max_stars_repo_head_hexsha": "3976e0e3f7f08fc9d9cce3702b9d6e3ac988dad7", "max_stars_repo_licenses": ["Apache-2.0"], "max_sta... |
import numpy
import pandas as pd
from application.preprocessing import \
pipeline_input, \
tokenize_corpora, \
tokenize_corpora_into_dict
from application.extractors import \
extract_corpora_from_dir, \
extract_corpora_from_file
from application.helpers.dir import dir_files_by_extension
def build... | {"hexsha": "fab760237d3631b72025254f24904aff850480f1", "size": 6712, "ext": "py", "lang": "Python", "max_stars_repo_path": "application/index/coordinate/utils/__init__.py", "max_stars_repo_name": "danorel/CD-Inverted-Index", "max_stars_repo_head_hexsha": "88a4eee855fe32fdb41602112ded24a66618431a", "max_stars_repo_licen... |
# RUN: %PYTHON %s
# Copyright 2021 Google LLC
#
# 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 agre... | {"hexsha": "4f6d9270feaf18c94a01f365170377aa65f08c27", "size": 1741, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/program/duplicate_helper.py", "max_stars_repo_name": "rsuderman/iree-jax", "max_stars_repo_head_hexsha": "086a0136ca88c60badf95b429ba27ec446f40ce5", "max_stars_repo_licenses": ["Apache-2.0"]... |
"""Unit tests for LEAP's suite of real-valued fitness functions."""
import numpy as np
from pytest import approx
from leap_ec.real_rep import problems
########################
# Tests for GriewankProblem
########################
def test_GriewankProblem_eval():
"""The value of a test point should be what we expe... | {"hexsha": "1a66725e343b6cebf79a5bd42a34c369eb43d66b", "size": 976, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/real_rep/test_problems.py", "max_stars_repo_name": "kexinchenn/LEAP", "max_stars_repo_head_hexsha": "97ba277dae29f1111c03dce6484d4104a575ea21", "max_stars_repo_licenses": ["AFL-3.0"], "max_st... |
[STATEMENT]
lemma (in Ring) npeSum2_sub_muly:
"\<lbrakk> x \<in> carrier R; y \<in> carrier R \<rbrakk> \<Longrightarrow>
y \<cdot>\<^sub>r(nsum R (\<lambda>i. nscal R ((npow R x (n-i)) \<cdot>\<^sub>r (npow R y i))
(n choose i)) n)
= nsum R (\<lambda>i. nscal R ((npow ... | {"llama_tokens": 4072, "file": "Group-Ring-Module_Algebra4", "length": 15} |
import sys
import numpy as np
import cv2
cap = cv2.VideoCapture('vtest.avi')
if not cap.isOpened():
print('Camera open failed!')
sys.exit()
ret, frame1 = cap.read()
if not ret:
print('frame read failed!')
sys.exit()
gray1 = cv2.cvtColor(frame1, cv2.COLOR_BGR2GRAY)
hsv = np.zeros_like(frame1)
hsv[.... | {"hexsha": "ad2a964febaf67fd4b710b55e7e3f9ebcd40e9ab", "size": 948, "ext": "py", "lang": "Python", "max_stars_repo_path": "TIL/dense_op1.py", "max_stars_repo_name": "FLY-CODE77/opencv", "max_stars_repo_head_hexsha": "5644e6c1ef43d81efb54ccde6c06f1adf000fb96", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, "m... |
import glob
import os
import numpy as np
import torch
import torch.utils.data as data
from data import common, srdata
class EvaluationDataset(srdata.SRData):
def __init__(self, args, name='', train=False, benchmark=True):
super(EvaluationDataset, self).__init__(
args, name=name, train=train,... | {"hexsha": "510229825a03c44ad1834b3c9351a45ab44ba61f", "size": 851, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/data/evaluation_dataset.py", "max_stars_repo_name": "MartinBuessemeyer/Efficient-Image-Super-Resolution", "max_stars_repo_head_hexsha": "3a9fb314fecc51d1028bbf1e6b571922b19175d3", "max_stars_re... |
import tempfile
import os
import os.path as op
import logging
import numpy as np
import IPython.display as display
import AFQ.viz.utils as vut
try:
from dipy.viz import window, actor, ui
from fury.colormap import line_colors
except ImportError:
raise ImportError(vut.viz_import_msg_error("fury"))
viz_log... | {"hexsha": "1c95529d869d2ab19363e0e750bf471a51477d74", "size": 14021, "ext": "py", "lang": "Python", "max_stars_repo_path": "AFQ/viz/fury_backend.py", "max_stars_repo_name": "grotheer/pyAFQ", "max_stars_repo_head_hexsha": "3a531b5bdc3d53f4a76d5d604a26fde488e1aaf6", "max_stars_repo_licenses": ["BSD-2-Clause"], "max_star... |
function [X,Y,T,options,A,R2_pca,pca_opt,features] = preproc4hmm(X,Y,T,options)
% Prepare data to run TUDA
% 1. check parameters, including the type of classifier (regression is default)
% 2. Format X and Y accordingly to the classifier
% 3. Sets up state to be sequential , if asked
% 4. Preprocesses the data, includin... | {"author": "OHBA-analysis", "repo": "HMM-MAR", "sha": "bb0433b75482e473980791a2b30afe2012cf6578", "save_path": "github-repos/MATLAB/OHBA-analysis-HMM-MAR", "path": "github-repos/MATLAB/OHBA-analysis-HMM-MAR/HMM-MAR-bb0433b75482e473980791a2b30afe2012cf6578/task/utils/preproc4hmm.m"} |
#==============================================================================#
# SNS.jl
#
# This file is generated from:
# https://github.com/aws/aws-sdk-js/blob/master/apis/sns-2010-03-31.normal.json
#==============================================================================#
__precompile__()
module SNS
using... | {"hexsha": "12adf57798a4d223444c2afe5c4292c6189e5a72", "size": 60305, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/SNS.jl", "max_stars_repo_name": "UnofficialJuliaMirror/AWSSDK.jl-0d499d91-6ae5-5d63-9313-12987b87d5ad", "max_stars_repo_head_hexsha": "85d61d0e02c66917795cc0f539ee7a8c76e2d1fc", "max_stars_rep... |
# -*- coding: utf-8 -*-
import logging
from abc import abstractmethod
from typing import Mapping, List, Sequence
import numpy as np
from jack.core.tensorport import TensorPort
logger = logging.getLogger(__name__)
class ModelModule:
"""A model module defines the actual reader model by processing input tensors a... | {"hexsha": "c47fad8911fe5473d29a06fc30dd0850d2a28288", "size": 2609, "ext": "py", "lang": "Python", "max_stars_repo_path": "jack/core/model_module.py", "max_stars_repo_name": "SwapneelM/Protobot", "max_stars_repo_head_hexsha": "f6637977e4a9bd5bdd0efcbcf93620f2c11c83e0", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
! This source file is part of the Limited-area GAME version (L-GAME), which is released under the MIT license.
! Github repository: https://github.com/OpenNWP/L-GAME
module multiplications
! This module is a collection of various multiplications of vector and/or scalar fields.
use definitions, only: t_grid,wp
... | {"hexsha": "2c92fdb6c256b4d793de8ecf69a2eea230e53dc4", "size": 6184, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "src/spatial_operators/multiplications.f90", "max_stars_repo_name": "OpenNWP/L-GAME", "max_stars_repo_head_hexsha": "4017f3d8d25e10e1b5f3f38664238ad208ba486c", "max_stars_repo_licenses": ["MIT"],... |
import sys
import .tools_matrix as tools
import cv2
import numpy as np
def detectFace(img, threshold=[0.6, 0.6, 0.7]):
caffe_img = (img.copy() - 127.5) / 127.5
origin_h, origin_w, ch = caffe_img.shape
scales = tools.calculateScales(img)
out = []
for scale in scales:
hs = int(origin_h * sc... | {"hexsha": "fe2b50307c6e99e9463a9bc14deb5a48e88f3680", "size": 2975, "ext": "py", "lang": "Python", "max_stars_repo_path": "mtcnn_keras.py", "max_stars_repo_name": "Qwinpin/keras-mtcnn", "max_stars_repo_head_hexsha": "36900832c77526cbc713229bc8f4a75b58d2448e", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null... |
from numpy.random import uniform
from agents.base_agent import BaseAgent
from estimators import get_estimator as get_model
from policy_evaluation import DeterministicPolicy as DQNEvaluation
from policy_evaluation import get_schedule as get_epsilon_schedule
from policy_improvement import DQNPolicyImprovement as DQNImpro... | {"hexsha": "efe3de739f4e37b4ec0e6c431c70260e53d535a9", "size": 2660, "ext": "py", "lang": "Python", "max_stars_repo_path": "agents/dqn_agent.py", "max_stars_repo_name": "floringogianu/categorical-dqn", "max_stars_repo_head_hexsha": "eb939785e0e2eea60bbd67abeaedf4a9990fb5ce", "max_stars_repo_licenses": ["MIT"], "max_sta... |
[STATEMENT]
lemma inv_gorder_inv:
"inv_gorder (inv_gorder L) = L"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. inv_gorder (inv_gorder L) = L
[PROOF STEP]
by simp | {"llama_tokens": 78, "file": null, "length": 1} |
[STATEMENT]
lemma bigo_plus_subset2 [intro]: "A \<subseteq> O(f) \<Longrightarrow> B \<subseteq> O(f) \<Longrightarrow> A + B \<subseteq> O(f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<lbrakk>A \<subseteq> O(f); B \<subseteq> O(f)\<rbrakk> \<Longrightarrow> A + B \<subseteq> O(f)
[PROOF STEP]
apply (subgoal_... | {"llama_tokens": 543, "file": null, "length": 5} |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 11 15:23:35 2017
@author: mmrosek
"""
from skimage.filters import threshold_otsu, rank, threshold_local
import imageio
import skimage.filters as filters
import skimage.morphology as morphology
import matplotlib.pyplot as plt
import numpy as np
impor... | {"hexsha": "a345afdde5670e446b3f080bc429a823f3626bf4", "size": 23571, "ext": "py", "lang": "Python", "max_stars_repo_path": "Cell Segmentation/3_23_seg_full_7_22.py", "max_stars_repo_name": "mmrosek/Listeria-Mitochondria-Fragmentation", "max_stars_repo_head_hexsha": "d0702f202bf4abe90aa8d3b5b7fd66bf71d3ae7b", "max_star... |
# -*- coding: utf-8 -*-
"""
Created on Sat Feb 6 11:14:44 2021
@author: gregoryvanbeek
Create a scatterplot for all genes and all essential genes.
"""
import os, sys
import re
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
file_dirname = os.path.dirname(os.path.abspath... | {"hexsha": "868e17ee1eddadd1c38dc3a122d85a04407a70a6", "size": 5891, "ext": "py", "lang": "Python", "max_stars_repo_path": "python_scripts/scatterplot_genes.py", "max_stars_repo_name": "Gregory94/LaanLab-SATAY-DataAnalysis", "max_stars_repo_head_hexsha": "276cb96d42dfcf4bed16aaaf0786519d96831ed0", "max_stars_repo_licen... |
import numpy as np
from pnc.state_machine import StateMachine
from pnc.draco_manipulation_pnc.draco_manipulation_state_provider import DracoManipulationStateProvider
from config.draco_manipulation_config import ManipulationConfig, LocomanipulationState
from util import util
class DoubleSupportHandReach(StateMachine)... | {"hexsha": "0f90b4fd5eb2437128d54b80ac9aef91cb02b2e6", "size": 3672, "ext": "py", "lang": "Python", "max_stars_repo_path": "pnc/draco_manipulation_pnc/draco_manipulation_state_machine/double_support_hand_reaching.py", "max_stars_repo_name": "junhyeokahn/PyPnC", "max_stars_repo_head_hexsha": "1a038ac282e0e8cf19a7af04928... |
from __future__ import division
from keras import backend as K
import numpy as np
import tensorflow as tf
from keras.losses import binary_crossentropy
def dice_coef(y_true, y_pred):
smooth = 1.
y_true_f = K.flatten(y_true)
y_pred_f = K.flatten(y_pred)
intersection = K.sum(y_true_f * y_pred_f)
retur... | {"hexsha": "29ee8813b240e229865e9a6760ae54b0084d2799", "size": 1248, "ext": "py", "lang": "Python", "max_stars_repo_path": "tnseg/loss.py", "max_stars_repo_name": "suryatejadev/thyroid_segmentation", "max_stars_repo_head_hexsha": "09c291a16f33490757f195057a64acd1ea17bd83", "max_stars_repo_licenses": ["MIT"], "max_stars... |
# WT operating under yaw misalignment
In case the wind turbine rotor is not perpendicular to the inflow, its operation and effects on the flow field will be different. In general it is a quite complicated process. In PyWake the effects are divided into four subeffects that are handled invididually:
1. Change of opera... | {"hexsha": "d62c1d408f7a054785de063556422f6b3f0ea983", "size": 352553, "ext": "ipynb", "lang": "Jupyter Notebook", "max_stars_repo_path": "docs/notebooks/YawMisalignment.ipynb", "max_stars_repo_name": "aemoser/PyWake", "max_stars_repo_head_hexsha": "889a2c10882195af21339e9bcf2ede0db9b58319", "max_stars_repo_licenses": ... |
import networkx as nx
from django.db import connection
from api.models import Person
def build_social_graph(user):
query = """
with face as (
select photo_id, person_id, name
from api_face join api_person on api_person.id = person_id
where person_label_is_inferred = false
... | {"hexsha": "f4126902391920aabfc7cb9b8543cf69e4c0d58a", "size": 1546, "ext": "py", "lang": "Python", "max_stars_repo_path": "api/social_graph.py", "max_stars_repo_name": "rootkie/librephotos", "max_stars_repo_head_hexsha": "73a7032a18d25cc7f0e6f4ea7da18c9d50d8e09a", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
#===================================
# Chengwen Liu #
# liuchw2010@gmail.com #
# University of Texas at Austin #
#===================================
import argparse
import numpy as np
# color
RED = '\033[91m'
GREEN = '\033[92m'
ENDC = '\033[0m'
def main():
#===>>>
parser = a... | {"hexsha": "48fba621beace412985f3e162879b946ade3477e", "size": 3249, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/lcalculator.py", "max_stars_repo_name": "leucinw/leucinwChemTools", "max_stars_repo_head_hexsha": "fff640e5619f0f2f7844b71c059e37f183dfdf32", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_... |
[STATEMENT]
lemma of_int_mask_eq:
\<open>of_int (mask n) = mask n\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. of_int (mask n) = mask n
[PROOF STEP]
by (induction n) (simp_all add: mask_Suc_double Bit_Operations.mask_Suc_double of_int_or_eq) | {"llama_tokens": 112, "file": null, "length": 1} |
// Copyright (c) 2005 - 2014 Marc de Kamps
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice, this list of conditio... | {"hexsha": "8249a32be0805723a852fba532ab36d7d7221f7d", "size": 8115, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "apps/UnitGeomLib/LeakingOdeSystemTest.cpp", "max_stars_repo_name": "dekamps/miind", "max_stars_repo_head_hexsha": "4b321c62c2bd27eb0d5d8336a16a9e840ba63856", "max_stars_repo_licenses": ["MIT"], "max... |
# Copyright (c) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE.md file in the project root
# for full license information.
# ==============================================================================
"""
Unit tests for kernel operations, tested for the forward and the backward pass
... | {"hexsha": "4df68f968bf0e1ef7e374bf35fca1e83663ef07b", "size": 5155, "ext": "py", "lang": "Python", "max_stars_repo_path": "bindings/python/cntk/ops/tests/kernel_test.py", "max_stars_repo_name": "oplatek/CNTK", "max_stars_repo_head_hexsha": "35f05cbf7b14bf10e1b4207eaf1cfd4cc7e252b4", "max_stars_repo_licenses": ["RSA-MD... |
/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
Copyright (C) 2004 StatPro Italia srl
This file is part of QuantLib, a free-software/open-source library
for financial quantitative analysts and developers - http://quantlib.org/
QuantLib is free software: you can redistribute it ... | {"hexsha": "b470de13c3ed2d35538d63348812be3c694a6af3", "size": 2416, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "rp/singleton.hpp", "max_stars_repo_name": "eehlers/reposit", "max_stars_repo_head_hexsha": "b14c56e9985424d2a8f52c6da68e4efcdfeb401d", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_count":... |
#define BOOST_TEST_MODULE Client test
#include "Date.h"
#include "Client.h"
#include "Account.h"
#include "ChequingAccount.h"
#include "SavingsAccount.h"
#include <boost/test/unit_test.hpp>
#include <boost/archive/binary_iarchive.hpp>
#include <boost/archive/binary_oarchive.hpp>
#include <boost/serialization/serializat... | {"hexsha": "8a371b94644b3ecd2b137bfb63f7d531b190ea87", "size": 7087, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "test/testClient.cpp", "max_stars_repo_name": "skp17/BankingSystem", "max_stars_repo_head_hexsha": "dcafff16f708c5011c4b1ec804c3e0658b99a0b8", "max_stars_repo_licenses": ["MIT"], "max_stars_count": n... |
[STATEMENT]
lemma region_compatible_suntil:
assumes "pred_stream (\<lambda> s. \<phi> (reps (abss s)) \<longleftrightarrow> \<phi> s) x"
and "pred_stream (\<lambda> s. \<psi> (reps (abss s)) \<longleftrightarrow> \<psi> s) x"
shows "(holds (\<lambda>x. \<phi> (reps x)) suntil holds (\<lambda>x. \<psi> (reps x... | {"llama_tokens": 1331, "file": "Probabilistic_Timed_Automata_PTA", "length": 4} |
using Documenter
using BioGraph
makedocs(
sitename="BioGraph",
format=Documenter.HTML(),
modules=[BioGraph],
pages=[
"Home" => "index.md",
"Function" => "function.md"
],
authors="Nguyet Dang, Tuan Do, Francois Sabot and other contributors."
)
deploydocs(
repo="github.com/ng... | {"hexsha": "3f903ece2bdf8fa2ad7c1a762795d3a219c266e6", "size": 392, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "docs/make.jl", "max_stars_repo_name": "brettChapman/BioGraph.jl", "max_stars_repo_head_hexsha": "bc9304259273b5402da75a6fb97570c2ae8b7ce6", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 10,... |
import cv2
import numpy as np
# Load image, grayscale, Otsu's threshold
image = cv2.imread('1.png')
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
thresh = cv2.threshold(gray, 0, 255, cv2.THRESH_BINARY_INV + cv2.THRESH_OTSU)[1]
# Filter using contour hierarchy
cnts, hierarchy = cv2.findContours(thresh, cv2.RETR_TREE,... | {"hexsha": "c48dde5d97a31ebe67f7fec56d98b53e1ff98b4a", "size": 918, "ext": "py", "lang": "Python", "max_stars_repo_path": "60095520-contour-hierarchy/contour_hierarchy.py", "max_stars_repo_name": "nathancy/stackoverflow", "max_stars_repo_head_hexsha": "e9e2e2b8fba61e41526638a13ac7ada6de2d7560", "max_stars_repo_licenses... |
[STATEMENT]
lemma inverse_closed': "inverse ` U \<subseteq> U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. inverse ` U \<subseteq> U
[PROOF STEP]
by auto | {"llama_tokens": 62, "file": "Types_To_Sets_Extension_Examples_SML_Relativization_Algebra_SML_Groups", "length": 1} |
# Python Tkinter Matplolib Charts
# numpy
from tkinter import *
from PIL import ImageTk, Image
import numpy as np
import matplotlib.pyplot as plt
root = Tk()
root.title('Python Tkinter Matplolib Charts')
root.iconbitmap('Python Tkinter Matplolib Charts/check.ico')
root.geometry("400x200")
def graph():
house_pr... | {"hexsha": "bd769ec4413e85810f2aab52967911ca437caa4d", "size": 596, "ext": "py", "lang": "Python", "max_stars_repo_path": "Python Tkinter Matplolib Charts/MatplolibCharts.py", "max_stars_repo_name": "BrianMarquez3/Python-Course", "max_stars_repo_head_hexsha": "2622b4ddfd687505becfd246e82a2ed0cb9b76f3", "max_stars_repo_... |
"""
Compact Python wrapper library for commonly used R-style functions
============================================================================
Basic functional programming nature of R provides users with extremely simple and compact interface for quick calculations of probabilities and essential descriptive/infer... | {"hexsha": "ed31261cbae1dc13887629e2b199c005e1d982ca", "size": 12498, "ext": "py", "lang": "Python", "max_stars_repo_path": "R_Functions.py", "max_stars_repo_name": "NunoEdgarGFlowHub/Stats-Maths-with-Python", "max_stars_repo_head_hexsha": "ccf56f14301d1d358216498943ddef8bf0992027", "max_stars_repo_licenses": ["MIT"], ... |
import numpy
import os
from cctbx import sgtbx
from cctbx import crystal
from cctbx.crystal import reindex
from yamtbx.dataproc.xds import xparm
from yamtbx.dataproc.xds import xds_ascii
from yamtbx.util.xtal import abc_convert_real_reciprocal
from yamtbx.util import read_path_list
import iotbx.phil
import matplotlib
m... | {"hexsha": "de8893d10ebe5c7f294af352dcc59246c3595dfb", "size": 6945, "ext": "py", "lang": "Python", "max_stars_repo_path": "yamtbx/dataproc/command_line/beam_direction_plot.py", "max_stars_repo_name": "7l2icj/kamo_clone", "max_stars_repo_head_hexsha": "5f4a5eed3cd9d91a021d805e46125c19cc2ed1b6", "max_stars_repo_licenses... |
import numpy as np
import matplotlib.pyplot as plt
import random
from torch.utils.data import Dataset,sampler,DataLoader
import torch
import torch.nn as nn
import pandas as pd
from tqdm import tqdm
class holt_winters_no_trend(torch.nn.Module):
def __init__(self,init_a=0.1,init_g=0.1,slen=12):
... | {"hexsha": "865b1d59f9d5980aa8316c0c06ed87ff1c95f490", "size": 5171, "ext": "py", "lang": "Python", "max_stars_repo_path": "MODEL_PREDIC_BENCHMARK/models.py", "max_stars_repo_name": "pixel-ports/PV_prod_predic", "max_stars_repo_head_hexsha": "2ceb4cf8218f43f3ea94c5520b1904663cfb0de1", "max_stars_repo_licenses": ["Apach... |
using SafeTestsets
@safetestset "Day02" begin
using AdventOfCode.TestUtils
using AdventOfCode.Day02
@testset "run_program!" begin
using AdventOfCode.Day02: run_program!
@test run_program!([1,9,10,3,2,3,11,0,99,30,40,50]).mem.vect == [
3500,9,10,70,
2,3,11,0,
... | {"hexsha": "8d4e20d1dbba9f30d9fdcb3907678a0db5aea13e", "size": 779, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/day02.jl", "max_stars_repo_name": "ffevotte/adventofcode2019.jl", "max_stars_repo_head_hexsha": "15290606f6a1f9df7c51e9c394219a1ac6865f14", "max_stars_repo_licenses": ["MIT"], "max_stars_count"... |
import numpy as np
from dpipe.dataset import CSV
from dicom_csv import load_series
from dpipe.io import PathLike
class DICOMDataset(CSV):
"""
A loader for DICOM series.
All the metadata is stored at ``filename`` and the DICOM files are located relative to ``path``.
Parameters
----------
path... | {"hexsha": "2a2f60b4b1186245d08be22a7fd59dd659b12514", "size": 904, "ext": "py", "lang": "Python", "max_stars_repo_path": "dpipe/dataset/dicom.py", "max_stars_repo_name": "samokhinv/deep_pipe", "max_stars_repo_head_hexsha": "9461b02f5f32c3e9f24490619ebccf417979cffc", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
%!TEX TS-program = lualatex
%!TEX encoding = UTF-8 Unicode
\documentclass[letterpaper]{tufte-handout}
%\geometry{showframe} % display margins for debugging page layout
\usepackage{fontspec}
\def\mainfont{Linux Libertine O}
\setmainfont[Ligatures={Common,TeX}, Contextuals={NoAlternate}, BoldFont={* Bold}, ItalicFont=... | {"hexsha": "2b5381661cd3f82c9c0a13f065dd19d36b738eb5", "size": 3711, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "study_guides/163_study_guide20.tex", "max_stars_repo_name": "mtaylor-semo/163", "max_stars_repo_head_hexsha": "670db734c68195edb7af76a2feee7bcb166fdffc", "max_stars_repo_licenses": ["MIT"], "max_sta... |
# -*- coding: utf-8 -*-
"""
Functions to make a kNN classifier.
Group 2
"""
import numpy as np
# Normalize data
def norm(data):
data_normalized = np.zeros(data.shape)
for col in range(data.shape[1]):
x = data[:,col]
# formula to derive normalized values of each feature
data_normalized... | {"hexsha": "f2125875399ecaabb939a1833e5aaaed88ea9cde", "size": 1623, "ext": "py", "lang": "Python", "max_stars_repo_path": "practicals/Originals/code/kNN.py", "max_stars_repo_name": "florisverheijen/8dm50-machine-learning", "max_stars_repo_head_hexsha": "74830aada9d642cc3c86a32354fa3a6708f9eb80", "max_stars_repo_licens... |
#!/usr/bin/env python
import numpy as np
import os
import unittest
import h5py
from psgeom import moveable
from psgeom import sensors
from psgeom import translate
from psgeom import camera
from psgeom import basisgrid
from psgeom import fitting
from psgeom import reciprocal
from psgeom import gain
import warnings
#c... | {"hexsha": "b71305b9a399eb8b6659b5dcd0fd64fb8501b12e", "size": 32218, "ext": "py", "lang": "Python", "max_stars_repo_path": "test.py", "max_stars_repo_name": "chuckie82/psgeom", "max_stars_repo_head_hexsha": "4e59ef07a1749b2dff63dccaf00d11bb34c36b8b", "max_stars_repo_licenses": ["BSD-3-Clause-LBNL"], "max_stars_count":... |
[STATEMENT]
lemma compatible_comp_right[simp]: "compatible F G \<Longrightarrow> register H \<Longrightarrow> compatible F (G \<circ> H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<lbrakk>compatible F G; register H\<rbrakk> \<Longrightarrow> compatible F (G \<circ> H)
[PROOF STEP]
by (simp add: compatible_def) | {"llama_tokens": 105, "file": "Registers_Laws", "length": 1} |
True : Prop
True = {P : Prop} → P → P
| {"hexsha": "a87e9164bb532439488fa9fe842954046f53f0b0", "size": 39, "ext": "agda", "lang": "Agda", "max_stars_repo_path": "test/Fail/Prop-NoImpredicativity.agda", "max_stars_repo_name": "alhassy/agda", "max_stars_repo_head_hexsha": "6043e77e4a72518711f5f808fb4eb593cbf0bb7c", "max_stars_repo_licenses": ["BSD-3-Clause"], ... |
[STATEMENT]
lemma steps_z_norm_complete:
assumes "A \<turnstile> \<langle>l, u\<rangle> \<rightarrow>* \<langle>l', u'\<rangle>" "u \<in> [D]\<^bsub>v,n\<^esub>"
and "global_clock_numbering A v n" "valid_abstraction A X k" "valid_dbm D"
shows "\<exists> D'. A \<turnstile> \<langle>l, D\<rangle> \<leadsto>\<^s... | {"llama_tokens": 564, "file": "Timed_Automata_Normalized_Zone_Semantics", "length": 2} |
[STATEMENT]
lemma vsubsetI:
assumes "\<And>x. x \<in>\<^sub>\<circ> A \<Longrightarrow> x \<in>\<^sub>\<circ> B"
shows "A \<subseteq>\<^sub>\<circ> B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. A \<subseteq>\<^sub>\<circ> B
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?x \<in>\<^sub>\<cir... | {"llama_tokens": 172, "file": "CZH_Foundations_czh_sets_CZH_Sets_Sets", "length": 2} |
[STATEMENT]
lemma lang_subset_lists:
"atoms r \<subseteq> A \<Longrightarrow> lang r \<subseteq> lists A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. atoms r \<subseteq> A \<Longrightarrow> lang r \<subseteq> lists A
[PROOF STEP]
apply(induction r)
[PROOF STATE]
proof (prove)
goal (9 subgoals):
1. atoms Zero ... | {"llama_tokens": 965, "file": "Posix-Lexing_Extensions_Regular_Exps3", "length": 4} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.