text stringlengths 0 1.25M | meta stringlengths 47 1.89k |
|---|---|
section \<open>Well-Ordered Strategy\<close>
theory WellOrderedStrategy
imports
Main
Strategy
begin
text \<open>
Constructing a uniform strategy from a set of strategies on a set of nodes often works by
well-ordering the strategies and then choosing the minimal strategy on each node.
Then every path eventua... | {"author": "data61", "repo": "PSL", "sha": "2a71eac0db39ad490fe4921a5ce1e4344dc43b12", "save_path": "github-repos/isabelle/data61-PSL", "path": "github-repos/isabelle/data61-PSL/PSL-2a71eac0db39ad490fe4921a5ce1e4344dc43b12/SeLFiE/Example/afp-2020-05-16/thys/Parity_Game/WellOrderedStrategy.thy"} |
# -----------------------------------------------------------
# Class to create and handle Path-Signature-Feature Datasets.
#
# (C) 2020 Kevin Schlegel, Oxford, United Kingdom
# Released under Apache License, Version 2.0.
# email kevinschlegel@cantab.net
# -----------------------------------------------------------
imp... | {"hexsha": "8c607d4abf59bf6eaab7572520abec937f7ec9d7", "size": 10652, "ext": "py", "lang": "Python", "max_stars_repo_path": "psfdataset/psfdataset.py", "max_stars_repo_name": "WeixinYang/PSFDataset", "max_stars_repo_head_hexsha": "f29b37489c580ad3c677bb9385a721cc57da60e4", "max_stars_repo_licenses": ["Apache-2.0"], "ma... |
module MR1dCNN
using Base: include_package_for_output
const DIR = @__DIR__
const ARCH_PATH = DIR * "/../arch/arch.json"
using Pkg
Pkg.activate(DIR * "/..")
Pkg.status()
@info "Loading modules..."
using BSON
using CUDA
using Flux
using Flux: logitcrossentropy
using Flux.Data: DataLoader
using Flux: onehotbatch, onecol... | {"hexsha": "1207ad3eca064163085ba2cef50ca75108f66019", "size": 7068, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/MR1dCNN.jl", "max_stars_repo_name": "cjw199/OneDCNN.jl", "max_stars_repo_head_hexsha": "2bb43258287bf913344b6957026bd4ad24e00cd4", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- Convenient syntax for "equational reasoning" using a preorder
------------------------------------------------------------------------
-- I think that the idea behind this library is originally Ulf
-- Norell's. ... | {"hexsha": "2bd974aa8a2edbad2580f77405a21cd8a91c843b", "size": 1563, "ext": "agda", "lang": "Agda", "max_stars_repo_path": "agda-stdlib-0.9/src/Relation/Binary/PreorderReasoning.agda", "max_stars_repo_name": "qwe2/try-agda", "max_stars_repo_head_hexsha": "9d4c43b1609d3f085636376fdca73093481ab882", "max_stars_repo_licen... |
//==============================================================================
// Copyright 2003 - 2011 LASMEA UMR 6602 CNRS/Univ. Clermont II
// Copyright 2009 - 2011 LRI UMR 8623 CNRS/Univ Paris Sud XI
//
// Distributed under the Boost Software License, Version 1.0.
// Se... | {"hexsha": "f43f92997a154ce32dc39b0c86af202abc713776", "size": 3626, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "modules/boost/simd/base/include/boost/simd/swar/functions/simd/sse/sse2/split_multiplies.hpp", "max_stars_repo_name": "psiha/nt2", "max_stars_repo_head_hexsha": "5e829807f6b57b339ca1be918a6b60a2507c... |
# Copyright 2021 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | {"hexsha": "159ff0eb95ed4586a9341cd3606db6604ee1d0f6", "size": 22940, "ext": "py", "lang": "Python", "max_stars_repo_path": "tensorflow/compiler/plugin/poplar/tests/distributed_tf2_test.py", "max_stars_repo_name": "chenzhengda/tensorflow", "max_stars_repo_head_hexsha": "8debb698097670458b5f21d728bc6f734a7b5a53", "max_s... |
[STATEMENT]
lemma Invoke_correct:
fixes \<sigma>' :: jvm_state
assumes wtprog: "wf_jvm_prog\<^bsub>\<Phi>\<^esub> P"
assumes meth_C: "P \<turnstile> C sees M:Ts\<rightarrow>T=(mxs,mxl\<^sub>0,ins,xt) in C"
assumes ins: "ins ! pc = Invoke M' n"
assumes wti: "P,T,mxs,size ins,xt \<turnstile> ins!pc,pc ::... | {"llama_tokens": 13555, "file": "Jinja_BV_BVSpecTypeSafe", "length": 128} |
/* Copyright (C) 2014 InfiniDB, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; version 2 of
the License.
This program is distributed in the hope that it will be useful,
but W... | {"hexsha": "9131d9ea7dcff561ba49931f2d579888a1a69af3", "size": 32013, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "src/vendor/mariadb-10.6.7/storage/columnstore/columnstore/writeengine/bulk/we_colbufcompressed.cpp", "max_stars_repo_name": "zettadb/zettalib", "max_stars_repo_head_hexsha": "3d5f96dc9e3e4aa255f4e6... |
import numpy as np
def np_unique_int(array, return_counts=False):
"""
Fast variant of ``np.unique(array, return_counts=True)``
Only works with integer values.
Parameter
---------
array : np.ndarray
Input array. Has to be 1-D.
return_counts : bool, optional
Return the cou... | {"hexsha": "84ff63be2873d7fc762034ab3e4b5a778d6e44dc", "size": 1264, "ext": "py", "lang": "Python", "max_stars_repo_path": "numpy-extensions/fast_implementations.py", "max_stars_repo_name": "king-michael/numpy-extensions", "max_stars_repo_head_hexsha": "6cebe90b04248f70209e1a46bc57b5207ccd359a", "max_stars_repo_license... |
#include <boost/spirit/home/x3/directive.hpp>
| {"hexsha": "9df2423d71d6e3f03da75a5bbd8c81fc8eb2a56f", "size": 46, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "src/boost_spirit_home_x3_directive.hpp", "max_stars_repo_name": "miathedev/BoostForArduino", "max_stars_repo_head_hexsha": "919621dcd0c157094bed4df752b583ba6ea6409e", "max_stars_repo_licenses": ["BSL-... |
/-
Copyright (c) 2020 Bhavik Mehta. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Bhavik Mehta
! This file was ported from Lean 3 source module category_theory.adjunction.lifting
! leanprover-community/mathlib commit 9bc7dfa6e50f902fb0684c9670a680459ebaed68
! Please ... | {"author": "leanprover-community", "repo": "mathlib3port", "sha": "62505aa236c58c8559783b16d33e30df3daa54f4", "save_path": "github-repos/lean/leanprover-community-mathlib3port", "path": "github-repos/lean/leanprover-community-mathlib3port/mathlib3port-62505aa236c58c8559783b16d33e30df3daa54f4/Mathbin/CategoryTheory/Adju... |
"""
Test Policy class and its methods.
"""
# CODING-STYLE CHECKS:
# pycodestyle test_policy.py
# pylint --disable=locally-disabled test_policy.py
#
# pylint: disable=too-many-lines
import copy
import os
import json
import numpy as np
import pytest
import paramtools as pt
# pylint: disable=import-error
... | {"hexsha": "537e9a11efb6c9e9ea850dde99ab8c578c6c9194", "size": 52694, "ext": "py", "lang": "Python", "max_stars_repo_path": "Tax-Calculator-3.0.0/taxcalc/tests/test_policy.py", "max_stars_repo_name": "grantseiter/Tax-Benefits-Of-Parenthood", "max_stars_repo_head_hexsha": "5350e832e8b877b46c2a3cab070fc8262b914a52", "max... |
import numpy as np
# Create an array that contains only elements with values 1 with a shape of (3,5)
# Save it as an object named arr1
arr1 = np.ones((3,5))
arr1
# Save the dimension and size of `arr1` in objects
# named `arr1_dim` and `arr1_size` respectively
arr1_dim = arr1.ndim
arr1_size = arr1.size
| {"hexsha": "2d2646c604dc0195c0a7942e105540118661f9c2", "size": 312, "ext": "py", "lang": "Python", "max_stars_repo_path": "exercises/en/solution_08_09.py", "max_stars_repo_name": "Lavendulaa/programming-in-python-for-data-science", "max_stars_repo_head_hexsha": "bc41da8afacf4c180ae0ff9c6dc26a7e6292252f", "max_stars_rep... |
function dfupdatexlim(newminmax,updateplots)
%DFUPDATEXLIM Update the stored x axis min/max values
% $Revision: 1.1.6.5 $ $Date: 2004/01/24 09:36:03 $
% Copyright 2003-2004 The MathWorks, Inc.
minmax = []; % to become new x limits
oldminmax = dfgetset('xminmax'); % previous limits
ftype = dfg... | {"author": "zouchuhang", "repo": "LayoutNet", "sha": "95293bfb8ff787dd3b02c8a52a147a703024980f", "save_path": "github-repos/MATLAB/zouchuhang-LayoutNet", "path": "github-repos/MATLAB/zouchuhang-LayoutNet/LayoutNet-95293bfb8ff787dd3b02c8a52a147a703024980f/matlab/panoContext_code/Toolbox/SpatialLayout_shrink/spatiallayou... |
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 10 09:05:48 2017
@author: r.dewinter
"""
from simplexGauss import simplexGauss
from simplexKriging import simplexKriging
from predictorEGO import predictorEGO
from paretofrontFeasible import paretofrontFeasible
from optimizeSMSEGOcriterion import optimizeSMSEGOc... | {"hexsha": "2826e0770dd300b3b27a9122b9474472a5286f0f", "size": 10626, "ext": "py", "lang": "Python", "max_stars_repo_path": "CEGO/CEGOIteration.py", "max_stars_repo_name": "napa-jmm/CEGO", "max_stars_repo_head_hexsha": "172d511133a608ca5bf265d9ebd2937b8a171b3e", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 6,... |
import numpy as np
import nnet
import nnet.config
try:
import cupy
array_types = (np.ndarray, cupy.ndarray)
except ImportError:
array_types = (np.ndarray)
class Tensor:
__array_priority__ = 200
def __init__(self, data, name=None):
if data is not None:
if isinstance(data, arra... | {"hexsha": "be3942b2f1298a3429c695f2f4fd043c585120fe", "size": 5741, "ext": "py", "lang": "Python", "max_stars_repo_path": "nnet/tensor.py", "max_stars_repo_name": "trip2eee/nnet2", "max_stars_repo_head_hexsha": "2061cdf3c8e2ac3f0bdb9e077baa94c67803e99f", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "ma... |
from PIL import Image
import os
import cv2
import numpy as np
import torch
import torchvision.transforms as transforms
import torchvision.transforms.functional as F
import torch.nn.functional as functional
import torch.utils.data as data
import random
import time
import glob
import scipy.io as scio
import h5py
import m... | {"hexsha": "af5739e22c626522843eac0a6c95cc7df58b509b", "size": 11363, "ext": "py", "lang": "Python", "max_stars_repo_path": "Phase0_Train_WE_And_Test_WE_UCFCC/Dataset/DatasetConstructor.py", "max_stars_repo_name": "Zhaoyi-Yan/DCANet", "max_stars_repo_head_hexsha": "1d99481494f4ef3cfe5abf227fa49a51011364bf", "max_stars_... |
import numpy as np
class Ant:
"""
Class realizing single ant functionality
Attributes:
*** operational attributes ***
- number: oridnal number of an ant
- node_memory: current edge in form of list of two nodes
- src_node: start and first target node of an ant
-... | {"hexsha": "06b0eafe70d6017f03cb7cebffe652c6048d8980", "size": 8530, "ext": "py", "lang": "Python", "max_stars_repo_path": "ant.py", "max_stars_repo_name": "twardzikf/aco-in-urban-transport", "max_stars_repo_head_hexsha": "89228ced89b425400a240a455d9585d0f7ef1861", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
# -*- coding: utf-8 -*-
# File: __init__.py
# Author: Yuxin Wu <ppwwyyxx@gmail.com>
import numpy # avoid https://github.com/tensorflow/tensorflow/issues/2034
import cv2 # avoid https://github.com/tensorflow/tensorflow/issues/1924
from tensorpack.train import *
from tensorpack.models import *
from tensorpack.utils im... | {"hexsha": "71ed132f0484c4a518521413d1d240e66574f6cb", "size": 578, "ext": "py", "lang": "Python", "max_stars_repo_path": "tensorpack/__init__.py", "max_stars_repo_name": "yinglanma/AI-project", "max_stars_repo_head_hexsha": "db145c59f57f519177f3eedde14c3ce033b2a11d", "max_stars_repo_licenses": ["Apache-2.0"], "max_sta... |
"""
Copyright (C) 2018-2021 Intel Corporation
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 i... | {"hexsha": "f09178683a9f22ac33c51125b60db0a29a8585c5", "size": 3249, "ext": "py", "lang": "Python", "max_stars_repo_path": "model-optimizer/extensions/front/DropoutWithRandomUniformReplacer_test.py", "max_stars_repo_name": "calvinfeng/openvino", "max_stars_repo_head_hexsha": "11f591c16852637506b1b40d083b450e56d0c8ac", ... |
import numpy as np
import torch
from torch import nn
class MDense(nn.Module):
def __init__(self, input_features, output_features):
super(MDense, self).__init__()
self.weight1 = nn.Parameter(torch.randn(output_features, input_features), requires_grad=True)
nn.init.xavier_uniform_(self.wei... | {"hexsha": "af4f3396c6af0832ffe7863aade069bc56c0a7b3", "size": 6711, "ext": "py", "lang": "Python", "max_stars_repo_path": "training_torch/lpcnet_bunched.py", "max_stars_repo_name": "ishine/BunchedLPCnet", "max_stars_repo_head_hexsha": "5480ba83fc204e5d79477583ec6023f1057d7c37", "max_stars_repo_licenses": ["BSD-3-Claus... |
import os
import glob
import rasterio
from PIL import Image
import numpy as np
import click
from object_detection.utils.np_box_list import BoxList
from rv.utils import save_geojson, make_empty_dir
def png_to_geojson(geotiff_path, label_png_path, output_path, object_half_len):
"""Convert COWC PNG labels to GeoJ... | {"hexsha": "764ef197e5817173bc9e67eb08af6e1ac954b1b5", "size": 2637, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/cowc/data/prepare_potsdam.py", "max_stars_repo_name": "yoninachmany/raster-vision-examples", "max_stars_repo_head_hexsha": "ef4098cb46a42e19119b42084e3e59bb789110a2", "max_stars_repo_lice... |
from typing import Callable, List, Sequence
import numpy as np
from sklearn.svm import SVC
def onehot(x, nclass=2):
result = np.zeros((len(x), nclass))
result[np.arange(len(x)), x] = 1
return result
class lbp_model:
def __init__(self,
descriptor: Callable,
model: SV... | {"hexsha": "d4009fa651597127cd57588785e0e437b48ad417", "size": 2528, "ext": "py", "lang": "Python", "max_stars_repo_path": "clbp/lbp_model_utils.py", "max_stars_repo_name": "luizgh/adversarial_signatures", "max_stars_repo_head_hexsha": "01daa8050f64c70d75bb2b81b0dbcc0ece9860e5", "max_stars_repo_licenses": ["BSD-3-Claus... |
#####################################################################
# basic scrapping code (scrapes from basketball-reference.com) #
# utilizes beautiful soup framework & panda framework to quickly #
# and easily scrape all stats and stores stats in a excel db #
############################################... | {"hexsha": "47076d34bc4d9a977a3ed159508cff669a54f2a5", "size": 6215, "ext": "py", "lang": "Python", "max_stars_repo_path": "scrapeNBAGames.py", "max_stars_repo_name": "lparsons00/scrapeNBA", "max_stars_repo_head_hexsha": "00093e41ae92b4495f92fb617a63046278ed620f", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
from scripts.train_script import ModelTrainer
from rllab.misc.instrument import stub, run_experiment_lite
import itertools
from rllab import config
stub(globals())
from distutils.dir_util import copy_tree
import numpy as np
import os, shutil
srcmodeldirs = ['../train/strikebig/']
modeldir = 'model/'
if os.path.exist... | {"hexsha": "ffa25c8fe1b75385a46e6cbe2cd4deef7abc0a0b", "size": 1605, "ext": "py", "lang": "Python", "max_stars_repo_path": "sandbox/andrew/run_train_strike_inception.py", "max_stars_repo_name": "leopauly/Observation-Learning-Simulations", "max_stars_repo_head_hexsha": "462c04a87c45aae51537b8ea5b44646afa31d3a5", "max_st... |
from data import Data
from learning_machine import LearningMachine, LDA, Logistic_regression
import numpy as np
import pandas as pd
from pandas.plotting import scatter_matrix
import matplotlib.pyplot as plt
from sklearn.linear_model import LogisticRegression
if __name__ == "__main__":
#initializing data
data ... | {"hexsha": "f4d8f95a9f332a63b3c97e5fda763229a35c0173", "size": 1843, "ext": "py", "lang": "Python", "max_stars_repo_path": "main.py", "max_stars_repo_name": "sergi-andreu/MMSL", "max_stars_repo_head_hexsha": "1f15095000606733400b1c737906f983eca4f09b", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_st... |
from __future__ import print_function
import numpy as np
def delta(x, scale=1, center=0):
r""" Dirac Delta function
It is equal to zero except for the value of `x` closest to `center`.
Parameters
----------
x: list or :class:`~numpy:numpy.ndarray`
domain of the function
scale: float... | {"hexsha": "06578941a9c8a3c1b75b0920559fed0c85cc2ec6", "size": 2067, "ext": "py", "lang": "Python", "max_stars_repo_path": "QENSmodels/delta.py", "max_stars_repo_name": "celinedurniak/test_nbsphinx", "max_stars_repo_head_hexsha": "f4bf376b933d5958cb921965cfb1430926fb10a5", "max_stars_repo_licenses": ["MIT"], "max_stars... |
file_labels = Dict(
"free_convection" => "Free convection",
"strong_wind" => "Strong wind",
"strong_wind_no_coriolis" => "Strong wind, no rotation",
"weak_wind_strong_cooling" => "Weak wind, strong cooling",
"strong_wind_weak_cooling" => "Strong wind, weak cooling",
"strong_wind_weak_heating" =>... | {"hexsha": "d2cfc9d452078c6dfa49ee8c7fe32dfd944fe17c", "size": 1884, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "wind_mixing/src/animate_prediction.jl", "max_stars_repo_name": "CliMA/ClimateParameterizations.jl", "max_stars_repo_head_hexsha": "1263e2edefced4e03e925d6bfa60ba1f1940e8c3", "max_stars_repo_license... |
[STATEMENT]
lemma Ord_succ_vsusbset_Vfrom_succ:
assumes "Transset A" and "Ord a" and "a \<in>\<^sub>\<circ> Vfrom A i"
shows "succ a \<subseteq>\<^sub>\<circ> Vfrom A (succ i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. ZFC_in_HOL.succ a \<subseteq>\<^sub>\<circ> Vfrom A (ZFC_in_HOL.succ i)
[PROOF STEP]
pr... | {"llama_tokens": 2491, "file": "CZH_Foundations_czh_sets_ex_CZH_EX_Replacement", "length": 27} |
[STATEMENT]
lemma approximating_bigstep_fun_induct[case_names Empty Decision Nomatch Match] : "
(\<And>\<gamma> p s. P \<gamma> p [] s) \<Longrightarrow>
(\<And>\<gamma> p r rs X. P \<gamma> p (r # rs) (Decision X)) \<Longrightarrow>
(\<And>\<gamma> p m a rs.
\<not> matches \<gamma> m a p \<Longrightarrow> P \<gamm... | {"llama_tokens": 1609, "file": "Iptables_Semantics_Semantics_Ternary_Semantics_Ternary", "length": 3} |
import cvxpy as cvx
import gym
import energym
import numpy as np
import pandas as pd
import os
import logging
import datetime
class EmptyDataException(Exception):
def __init__(self):
super().__init__()
class OptimizationException(Exception):
def __init__(self):
super().__init__()
logging.g... | {"hexsha": "fe6a0a6dd5d4352c3035e65cdae6f64a2c87df0b", "size": 5871, "ext": "py", "lang": "Python", "max_stars_repo_path": "energym/envs/grid_scale/utils.py", "max_stars_repo_name": "mathildebadoual/energym", "max_stars_repo_head_hexsha": "bcdba783ea50a2c3adb9e6c86ecdfb1949bd59a5", "max_stars_repo_licenses": ["MIT"], "... |
__author__ = 'feurerm'
import copy
import unittest
import numpy as np
import sklearn.datasets
import sklearn.metrics
from autosklearn.pipeline.components.data_preprocessing.balancing.balancing \
import Balancing
from autosklearn.pipeline.classification import SimpleClassificationPipeline
from autosklearn.pipelin... | {"hexsha": "4c69804a03ebba980ae82324c095d91fea8cfbeb", "size": 8560, "ext": "py", "lang": "Python", "max_stars_repo_path": "test/test_pipeline/components/data_preprocessing/test_balancing.py", "max_stars_repo_name": "wsyjwps1983/autosklearn", "max_stars_repo_head_hexsha": "2e29ebaca6bc26fa838f7c3b8b13960c600884e4", "ma... |
import astropy.units as u
import json
import numpy as np
from astropy.coordinates import SkyCoord
from astropy.io import fits
from datetime import datetime as dt
from datetime import timedelta as tdelta
# Generate Fake Postange Stamp Cube (FITS cube)
sky_background = 1000.
sky_sigma = 5.
nx = 12
ny = 16
nt = 42
data_... | {"hexsha": "c99bd1a98389386321640743dbd3e16584b651a9", "size": 1968, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/generate_PSC.py", "max_stars_repo_name": "wtgee/panoptes-pipeline", "max_stars_repo_head_hexsha": "3e7398698d5ce97aa6b40a11aa7af4dc480eb3af", "max_stars_repo_licenses": ["MIT"], "max_stars... |
import tensorflow as tf
import numpy as np
import re
from utils.bert import bert_utils
try:
from .trf_gpt_noise import model_fn_builder as noise_dist
from .trf_ebm_bert import model_fn_builder as ebm_dist
from .trf_classifier import (get_ebm_loss,
get_residual_ebm_loss,
get_ebm_mlm_adv_loss,
... | {"hexsha": "5865b8711a83133f6583774bc499d78da52352a8", "size": 23050, "ext": "py", "lang": "Python", "max_stars_repo_path": "t2t_bert/pretrain_finetuning/trf_bert_ebm_residual_estimator.py", "max_stars_repo_name": "yyht/bert", "max_stars_repo_head_hexsha": "480c909e0835a455606e829310ff949c9dd23549", "max_stars_repo_lic... |
# -*- coding: utf-8 -*-
"""
@author: Adam Reinhold Von Fisher - https://www.linkedin.com/in/adamrvfisher/
"""
#This is part of a kth fold optimization tool
#pandas_datarader is deprecated, use YahooGrabber
#Import modules
import numpy as np
import pandas as pd
from pandas_datareader import data
#Reque... | {"hexsha": "b9df5b4766279baef32ac75a3cfa99aac5e27cc4", "size": 2951, "ext": "py", "lang": "Python", "max_stars_repo_path": "KthFold+RSII.py", "max_stars_repo_name": "adamrvfisher/TechnicalAnalysisLibrary", "max_stars_repo_head_hexsha": "38a22b2b2b5052623f81edb11b3c5460fc254e45", "max_stars_repo_licenses": ["Apache-2.0"... |
import numpy as np
from fnc_common import (get_unique_2d)
from fnc_data import (load_examined_coords)
def calculate_PCF(coords, r_max, eu_side):
# calculate Pair Correlation Function (PCF) for evidence units represented by their coordinates
"""
Compute the two-dimensional pair correlation function, also known
... | {"hexsha": "2ea38883a77057e70f16c9e975be53f9156170fb", "size": 8912, "ext": "py", "lang": "Python", "max_stars_repo_path": "fnc_pcf.py", "max_stars_repo_name": "demjanp/chrono_spatial_modelling", "max_stars_repo_head_hexsha": "14fde811ebdfaa156238ce0cb9da84274877496e", "max_stars_repo_licenses": ["MIT"], "max_stars_cou... |
import numpy as np
import pandas as pd
# manually creating dataframe
df = pd.DataFrame({
'Population': [35.467, 63.951, 80.94 , 60.665, 127.061, 64.511, 318.523],
'GDP': [
1785387,
2833687,
3874437,
2167744,
4602367,
2950039,
17348075
],
'Surface... | {"hexsha": "493da892ad2764ae69b6621cb17b84759aff4ed0", "size": 2043, "ext": "py", "lang": "Python", "max_stars_repo_path": "Pandas/pandas_dataframe.py", "max_stars_repo_name": "barnwalp/machine_learning", "max_stars_repo_head_hexsha": "d2ec23001a10b8f3bd70c821374fa1ab91a9f599", "max_stars_repo_licenses": ["MIT"], "max_... |
[STATEMENT]
lemma coeffs_poly_of_vec:
"coeffs (poly_of_vec v) = rev (dropWhile ((=) 0) (list_of_vec v))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. coeffs (poly_of_vec v) = rev (dropWhile ((=) (0::'a)) (list_of_vec v))
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
1. coeffs (poly_of_vec v)... | {"llama_tokens": 489, "file": "LLL_Basis_Reduction_Missing_Lemmas", "length": 6} |
import os
import logging
import numpy as np
def rename_dir(url,reverse=True):
""""
根据static的值进行文件夹自动重命名,命名规则
YYYYMMDDhhmmsss+3[001]
directory.ini
网->0
于->1
:param url:,文件夹地址,
:param static:给出的需要进是关于地址是否是相对地址
:param reverse:确定是行反向目录生成,还是正向目录生成
:return:
Ti... | {"hexsha": "7c69cb1afd8f5e1e920ab69147c283e6ac126cb9", "size": 1711, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/main/python/qxy/rename_test.py", "max_stars_repo_name": "gwdgithubnom/ox-patient", "max_stars_repo_head_hexsha": "cddf4fe381cb4506db8e0d62803dd2044cf7ad92", "max_stars_repo_licenses": ["MIT"],... |
[STATEMENT]
lemma CONSTRAINT_D:
assumes "CONSTRAINT (P::'a => bool) x"
shows "P x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. P x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
CONSTRAINT P x
goal (1 subgoal):
1. P x
[PROOF STEP]
unfolding CONSTRAINT_def
[PROOF STATE]
proof (prove)
using ... | {"llama_tokens": 177, "file": "Refine_Imperative_HOL_Sepref_Constraints", "length": 3} |
\subsection{Semirings}\label{subsec:semirings}
We will start by defining semirings, and to do that we will first motivate distributivity.
\begin{proposition}\label{thm:monoid_distributivity}
Fix an \hyperref[rem:additive_magma/multiplication]{additive} \hyperref[def:monoid]{monoid} \( (R, +, \cdot) \), where \( +: ... | {"hexsha": "cf077421fa1eea643df8b1425149891398a68944", "size": 27232, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "src/semirings.tex", "max_stars_repo_name": "v--/anthology", "max_stars_repo_head_hexsha": "89a91b5182f187bc1aa37a2054762dd0078a7b56", "max_stars_repo_licenses": ["CC0-1.0"], "max_stars_count": null... |
'Create a dual VAE-HMM model.'
import argparse
import logging
import pickle
import yaml
import numpy as np
import torch
import beer
logging.basicConfig(format='%(levelname)s: %(message)s')
encoder_normal_layer = {
'isotropic': beer.nnet.NormalIsotropicCovarianceLayer,
'diagonal': beer.nnet.NormalDiagonalCo... | {"hexsha": "41996795978e4d25427a60dc6faa64f7614ce763", "size": 3386, "ext": "py", "lang": "Python", "max_stars_repo_path": "recipes/timit_v2/utils/dual-vae-hmm-create.py", "max_stars_repo_name": "RobinAlgayres/beer", "max_stars_repo_head_hexsha": "15ad0dad5a49f98e658e948724e05df347ffe3b8", "max_stars_repo_licenses": ["... |
# The incredible pressures at this depth are starting to put a strain on your
# submarine. The submarine has polymerization equipment that would produce
# suitable materials to reinforce the submarine, and the nearby
# volcanically-active caves should even have the necessary input elements in
# sufficient quantities.
#... | {"hexsha": "00da95fa0150f7100ae81192ffb8819b7fdc6801", "size": 3484, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "day14/part1.jl", "max_stars_repo_name": "bmatcuk/adventofcode2021", "max_stars_repo_head_hexsha": "57b9297213acd271b73784fbbe38c5cc248d7c28", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
[STATEMENT]
lemma iso_char:
shows "iso \<mu> \<longleftrightarrow> arr \<mu> \<and> B.iso (Map \<mu>)"
and "iso \<mu> \<Longrightarrow> inv \<mu> = MkArr (Cod \<mu>) (Dom \<mu>) (B.inv (Map \<mu>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. local.iso \<mu> = (arr \<mu> \<and> B.iso (Map \<mu>)) &&& (loc... | {"llama_tokens": 8825, "file": "Bicategory_Strictness", "length": 84} |
"""
Process the data downloaded from original source
"""
import h5py
import os
import pickle
import numpy as np
from tqdm import tqdm
import matplotlib.pyplot as plt
import seaborn as sns
sns.set()
def process_data():
"""
Extracts the SBP and DBP values of 10 seconds long episodes
while taking new episodes 5 s... | {"hexsha": "3d374a5bc462d2cdcc518ddfbae9e6fd6075e1aa", "size": 11095, "ext": "py", "lang": "Python", "max_stars_repo_path": "codes/data_processing.py", "max_stars_repo_name": "nguyenngocsang1410/PPG2ABP", "max_stars_repo_head_hexsha": "6109d4d0c213655486a17dd25900675b746beabd", "max_stars_repo_licenses": ["MIT"], "max_... |
x = randn(16,5)
wt = wavelet(WT.haar)
xw = cat([wpd(x[:,i], wt) for i in axes(x,2)]..., dims=3)
xsw = cat([swpd(x[:,i], wt) for i in axes(x,2)]..., dims=3)
xacw = cat([acwpd(x[:,i], wt) for i in axes(x,2)]..., dims=3)
# bb
@test isvalidtree(x[:,1], bestbasistree(xw[:,:,1], BB()))
@test isvalidtree(x[:,1], bestbasistre... | {"hexsha": "5afb695eeaa71a8a7aa7f2452e93cf96f6631c9c", "size": 1360, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/bestbasis.jl", "max_stars_repo_name": "ShozenD/WaveletsExt.jl", "max_stars_repo_head_hexsha": "602c26c239c925b1de3f174c2a7b50aab991153a", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_star... |
import numpy as np
import cv2
# Define a function that applies Sobel x or y,
# then takes an absolute value and applies a threshold.
def abs_sobel_thresh(img, orient='x', sobel_kernel=3, thresh=(0, 255)):
# Apply the following steps to img
# 1) Convert to grayscale
# NOTE!!!:
# Use cv2.COLO... | {"hexsha": "976f3d5a0297dbac8dcf677039f922bda932b96d", "size": 3885, "ext": "py", "lang": "Python", "max_stars_repo_path": "HelperProjects/Gradients-and-Color-Spaces/thresholds.py", "max_stars_repo_name": "luk6xff/SelfDrivingCarND", "max_stars_repo_head_hexsha": "1ad0a203f3c1ebd8ee3c114d8efc0d0cf99ddc42", "max_stars_re... |
[STATEMENT]
lemma measure_space_measure_of_st_vec': "measure_space UNIV UNIV (measure_of_st_vec' x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. measure_space UNIV UNIV (measure_of_st_vec' x)
[PROOF STEP]
unfolding measure_space_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. sigma_algebra UNIV UNIV \<and> ... | {"llama_tokens": 6389, "file": "Stochastic_Matrices_Stochastic_Vector_PMF", "length": 56} |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''macf.py - Waqas Bhatti (wbhatti@astro.princeton.edu) - Oct 2017
This contains the ACF period-finding algorithm from McQuillan+ 2013a and
McQuillan+ 2014.
'''
#############
## LOGGING ##
#############
import logging
from datetime import datetime
from traceback import... | {"hexsha": "bcd27194ea87e848aff0c6d332fb70fc52371173", "size": 15206, "ext": "py", "lang": "Python", "max_stars_repo_path": "astrobase/periodbase/macf.py", "max_stars_repo_name": "adrn/astrobase", "max_stars_repo_head_hexsha": "7af71167deec58dffc8f668c0b34cb75ed44ae6a", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
import joblib
import numpy as np
from tqdm import tqdm
import torch
from torch.utils.data import TensorDataset, DataLoader
from torch import nn, optim
import matplotlib.pyplot as plt
X_train = joblib.load('ch08/X_train.joblib')
y_train = joblib.load('ch08/y_train.joblib')
X_train = torch.from_numpy(X_train.astype(np.... | {"hexsha": "f4c1da7a7651fcab65ce74b12790b7c67627aeda", "size": 2282, "ext": "py", "lang": "Python", "max_stars_repo_path": "ch08/ans78.py", "max_stars_repo_name": "upura/nlp100v2020", "max_stars_repo_head_hexsha": "37d4d208d5d527d163356793b630f36eb7595779", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 66, "ma... |
import numpy as np
import pandas as pd
from pathlib import Path
import libs.dirs as dirs
import libs.utils as utils
import libs.dataset_utils as dutils
from libs.index import IndexManager
''' Add FrameHash and FramePath to a interface-style... | {"hexsha": "891b02926e7d74cc4a12ba05108743e149510151", "size": 1373, "ext": "py", "lang": "Python", "max_stars_repo_path": "run/old_scripts/process_annotations_file.py", "max_stars_repo_name": "olavosamp/semiauto-video-annotation", "max_stars_repo_head_hexsha": "b1a46f9c0ad3bdcedab76b4cd730747ee2afd2fd", "max_stars_rep... |
import os
import collections
import yaml
import numpy as np
import torch
import gtn
from mathtools import utils, metrics, torchutils
from seqtools import fstutils_gtn as libfst
def sampleGT(transition_probs, initial_probs):
cur_state = np.random.choice(initial_probs.shape[0], p=initial_probs)
gt_seq = [cur_... | {"hexsha": "02b59eb8245537d9a79b84ff0d2bd0fbf1011328", "size": 8491, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_gtn.py", "max_stars_repo_name": "jd-jones/seqtools", "max_stars_repo_head_hexsha": "280e2fe1d8a925e03f436d73ff81ab638a4ce7b8", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, ... |
import copy
import os
from argparse import ArgumentParser
import xml.etree.ElementTree as ET
import numpy as np
from pycocotools.coco import COCO
from tqdm import tqdm
import matplotlib.pyplot as plt
from sklearn.cluster import KMeans
from mmdet.datasets.builder import build_dataset
from tqdm import tqdm
import mmcv
fr... | {"hexsha": "21265edf472462c5af3930f7ef0542a96023e28f", "size": 6951, "ext": "py", "lang": "Python", "max_stars_repo_path": "tools/analysis_tools/analyze_dataset.py", "max_stars_repo_name": "jiangwenj02/mmdetection", "max_stars_repo_head_hexsha": "cdc0b7937cd23ee3ab2eef50d002d6cac6956cac", "max_stars_repo_licenses": ["A... |
import numpy as np
import PIL
from PIL import Image
import os
from torch.utils.data import Dataset
from torchvision import transforms
import torchvision.transforms.functional as TF
def read_labeled_image_list(data_dir, data_list):
"""Reads txt file containing paths to images and ground truth masks.
Args:
... | {"hexsha": "3ddc882ddf68c547e0a77eb0bf1a8cb492269ace", "size": 5583, "ext": "py", "lang": "Python", "max_stars_repo_path": "data/nyud/NYUD.py", "max_stars_repo_name": "slyviacassell/Multi-taks-UNITE", "max_stars_repo_head_hexsha": "a010a92c94c0ee0f1ffed27df6d89da58d6d34c5", "max_stars_repo_licenses": ["MIT"], "max_star... |
'''Examples: comparing OLS and RLM
robust estimators and outliers
RLM is less influenced by outliers than OLS and has estimated slope
closer to true slope and not tilted like OLS.
Note: uncomment plt.show() to display graphs
'''
import numpy as np
#from scipy import stats
import statsmodels.api as sm
import matplot... | {"hexsha": "107ad720850224085b3096258a2a3c273861470e", "size": 1611, "ext": "py", "lang": "Python", "max_stars_repo_path": "statsmodels/examples/tut_ols_rlm_short.py", "max_stars_repo_name": "madhushree14/statsmodels", "max_stars_repo_head_hexsha": "04f00006a7aeb1c93d6894caa420698400da6c33", "max_stars_repo_licenses": ... |
#' @title get_day
#' @description This function provides the number of days in each month, given a year and month. This script was originally part of the date.picker() function, but was separated since it might be useful on its own
#' @note It accounts for leapyears from 1904-2096. Leapyears are not simply every 4 yea... | {"hexsha": "cacfc3bb953177dbcf9849a7ecd1f90851d616b5", "size": 882, "ext": "r", "lang": "R", "max_stars_repo_path": "R/get_day.r", "max_stars_repo_name": "AtlanticR/bio.utilities", "max_stars_repo_head_hexsha": "aaa52cf86afa4ee9e6f46c4516a48d27cc0bfed9", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max... |
[STATEMENT]
lemma le_multiset_empty_right[simp]: "\<not> M < {#}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<not> M < {#}
[PROOF STEP]
using subset_mset.le_zero_eq less_multiset_def multp_def less_multiset\<^sub>D\<^sub>M
[PROOF STATE]
proof (prove)
using this:
(?n \<subseteq># {#}) = (?n = {#})
(?M < ?N) = mu... | {"llama_tokens": 296, "file": null, "length": 2} |
using JuMP, EAGO
m = Model()
EAGO.register_eago_operators!(m)
@variable(m, -1 <= x[i=1:5] <= 1)
@variable(m, -6.148474362391325 <= q <= 10.677081718106185)
add_NL_constraint(m, :(gelu(-0.2518902526786948 + 0.98... | {"hexsha": "ebe7bac421c5b31d6389428baaa9fb92293fa6fe", "size": 6213, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "solver_benchmarking/MINLPLib.jl/instances/ANN_Env/06_gelu_5_3_3.jl", "max_stars_repo_name": "PSORLab/RSActivationFunctions", "max_stars_repo_head_hexsha": "0bf8b4500b21144c076ea958ce93dbdd19a53314"... |
__author__ = 'ferrard'
# ---------------------------------------------------------------
# Imports
# ---------------------------------------------------------------
import scipy as sp
import matplotlib.pyplot as plt
import math
# ---------------------------------------------------------------
# Class
# -------------... | {"hexsha": "f4d2fc354c457864e91ce2adb523f822e6c6ffba", "size": 7191, "ext": "py", "lang": "Python", "max_stars_repo_path": "s07_graph_plotter/solutions/sol_graph_plotter.py", "max_stars_repo_name": "silverfield/pythonsessions", "max_stars_repo_head_hexsha": "bf5d82dded7616a5d6998da4eb445708c728794f", "max_stars_repo_li... |
#pragma once
#define GIF_FRAME_LENGTH 33
#include "concurrentmap.hpp"
#include "emojis.hpp"
#include "messages/lazyloadedimage.hpp"
#include "signalvector.hpp"
#include "twitch/emotevalue.hpp"
#include <QMap>
#include <QMutex>
#include <QRegularExpression>
#include <QString>
#include <QTimer>
#include <boost/signals... | {"hexsha": "b64cbd85dc8ff48041ead5ec786eedbdad086af3", "size": 4207, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "src/emotemanager.hpp", "max_stars_repo_name": "chrisduerr/chatterino2", "max_stars_repo_head_hexsha": "6df531017123570c0f43127bbdc2517dde4071a3", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
import numpy as np
from LSTM_language_model.model import LSTM_language_model
from LSTM_language_model.utility import onehot, make_input_output
from pathlib import Path
from argparse import ArgumentParser
parser = ArgumentParser()
parser.add_argument("--model", type=Path, required=True)
parser.add_argument("--dataset"... | {"hexsha": "eb6c5951e7f6fa809b4b9fea6dc0cc1e6c50e650", "size": 1440, "ext": "py", "lang": "Python", "max_stars_repo_path": "sample/LSTMLM_train.py", "max_stars_repo_name": "RyoOzaki/LSTM_language_model", "max_stars_repo_head_hexsha": "7f4382783a317c52b9f9053cb2fe5bd1a64571a9", "max_stars_repo_licenses": ["MIT"], "max_s... |
[STATEMENT]
lemma (in encoding) indRelRPO_is_preorder:
shows "preorder indRelRPO"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. preorder indRelRPO
[PROOF STEP]
unfolding preorder_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. refl indRelRPO \<and> trans indRelRPO
[PROOF STEP]
proof
[PROOF STATE]
proof (... | {"llama_tokens": 1062, "file": "Encodability_Process_Calculi_SourceTargetRelation", "length": 14} |
"""Link functions related to log."""
# author: Benjamin Cross
# email: btcross26@yahoo.com
# created: 2019-08-26
import numpy as np
from .base_class import BaseLink
class LogLink(BaseLink):
"""Implementation of the log link function."""
def __init__(self, summand: float = 0.0):
"""
Class ... | {"hexsha": "1ec2aaeefece20082e40d4cca922b4ee10ebe21f", "size": 1747, "ext": "py", "lang": "Python", "max_stars_repo_path": "genestboost/link_functions/log_links.py", "max_stars_repo_name": "btcross26/forward_stagewise_regression", "max_stars_repo_head_hexsha": "be14503ea253cb8b72bb168608c581f238c57d50", "max_stars_repo... |
import numpy as np
import matplotlib.pyplot as plt
import keyboard as kb
from keras.models import Sequential
from keras.layers import Dense, Conv2D, MaxPooling2D, Activation, Flatten
from keras.optimizers import SGD, Adam
from keras.datasets import fashion_mnist
def load_data():
(XtrainMat, Ytrain), (XtestMat, Y... | {"hexsha": "53bffd00a10d0c23270720ac8d22585a1441ccbd", "size": 4509, "ext": "py", "lang": "Python", "max_stars_repo_path": "11.py", "max_stars_repo_name": "mifimigahna/ANN", "max_stars_repo_head_hexsha": "e4476ff29ff017ad0e49f99c4d428a0dd23cdc8a", "max_stars_repo_licenses": ["Unlicense"], "max_stars_count": null, "max_... |
# Copyright 2019 The dm_control 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 i... | {"hexsha": "84e111e8b3e373953b795b8a2eee184830c4abf5", "size": 3564, "ext": "py", "lang": "Python", "max_stars_repo_path": "custom_dmcontrol/dm_control/manipulation/shared/workspaces.py", "max_stars_repo_name": "haorang/285", "max_stars_repo_head_hexsha": "3b7369b8eb4433952c9cdf27d4feaa015a6c40e4", "max_stars_repo_lice... |
# XXX sets the objective function according to the arguments provided in obj_dic
"""
Set the objective of the model's underlying optimization problem.
```julia
setObjective!(obj_dic::Union{Dict{Symbol,Float64},Symbol},anyM::anyModel)
```
`obj_dic` is a key-word argument that specifies the respective objective. To enab... | {"hexsha": "71155d8e2832646800c8302508c49bfb21f03bcc", "size": 15865, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/optModel/objective.jl", "max_stars_repo_name": "wookay/AnyMOD.jl", "max_stars_repo_head_hexsha": "14fdae26d6c8dd88001b2b5e4aadb468a3856b42", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 19 14:18:39 2017
@author: mitchell
"""
import config
import PyQt5
import matplotlib
matplotlib.use('Qt5Agg')
import matplotlib.pyplot as plt
import numpy as np
from mpl_toolkits.axes_grid1.inset_locator import zoomed_inset_axes
from mpl_toolkits.ax... | {"hexsha": "d44e7d591e7d93379996e967c5dd5bb55cb95bb1", "size": 10263, "ext": "py", "lang": "Python", "max_stars_repo_path": "plotfuncs.py", "max_stars_repo_name": "mfkoerner/icarus", "max_stars_repo_head_hexsha": "eb480596be127f760d10531d27569290df3e8ff9", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 2, "max_... |
import numpy as np
import torch
import torch.nn as nn
import random
import os
# custom weights initialization called on netG and netD
def weights_init(m):
classname = m.__class__.__name__
if classname.find('Conv') != -1:
m.weight.data.normal_(0.0, 0.02)
elif classname.find('BatchNorm') != -1:
... | {"hexsha": "15953a38c337f0760edd43d8712fdfb2a739ae98", "size": 3640, "ext": "py", "lang": "Python", "max_stars_repo_path": "plat/interface/pytorchdcgan.py", "max_stars_repo_name": "dribnet/plat", "max_stars_repo_head_hexsha": "0963c75d460c153183c1d414b02d4b5dc0b2208f", "max_stars_repo_licenses": ["MIT"], "max_stars_cou... |
"""
Evaluating Video-QAP
Use eval metrics from Pycocoevalcap
Can be used standalone
Requires Bertscore
"""
from pathlib import Path
import fire
from yacs.config import CfgNode as CN
import yaml
import pickle
import numpy as np
from collections import namedtuple
import json
import bert_score as bs
import time
from col... | {"hexsha": "4bb1fa132ab391e7d67af18d685cd8c309f9fca5", "size": 21594, "ext": "py", "lang": "Python", "max_stars_repo_path": "vidqa_code/eval_fn_vidqap.py", "max_stars_repo_name": "TheShadow29/Video-QAP", "max_stars_repo_head_hexsha": "ffd60758c3426e593b04651c1071279bcb9912fb", "max_stars_repo_licenses": ["MIT"], "max_s... |
import numpy as np
import pytest
from frispy import Disc
def test_smoke():
d = Disc()
assert d is not None
def test_disc_has_properties():
d = Disc()
assert hasattr(d, "model")
assert hasattr(d, "environment")
assert hasattr(d, "eom")
def test_initial_conditions():
d = Disc()
for ... | {"hexsha": "be7aa22b761831df7a843d24a5709b90ccea355d", "size": 2333, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/disc_test.py", "max_stars_repo_name": "McCannDahl/FrisPy", "max_stars_repo_head_hexsha": "1583cf24dcf64eab2a4dfdbd79b7652a76b0c95f", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nu... |
#INCLUDE 'MR_H_ALIGN_PADDING.H'
!***********************************************************************************************************************************
! UNIT:
!
! (MODULE)
!
! PURPOSE:
!
!
!
! DEFINITION OF VARIABLES:
!
!
!
! RECORD OF REVISIONS:
!
! DATE | PROGRAMMER | DESCRIPTION OF... | {"hexsha": "f04b6c56047c84cdf0e38fe32e543680c18661f9", "size": 2675, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "__Sources/__POST_MOD_FILE_MANIPULATIONS/__POST_MOD_FILE_XMDF_MANIPULATIONS/MR_MOD_GET_DSET_UNIT.f90", "max_stars_repo_name": "zht9947/Mr_Reds", "max_stars_repo_head_hexsha": "e9ce791e855aa6caa12... |
#!/usr/bin/env python
#
# Author: Qiming Sun <osirpt.sun@gmail.com>
#
'''
XC functional, the interface to libxc
(http://www.tddft.org/programs/octopus/wiki/index.php/Libxc)
'''
import sys
import copy
import ctypes
import math
import numpy
import pyscf.lib
_itrf = pyscf.lib.load_library('libxc_itrf')
# xc_code from ... | {"hexsha": "45b991884195c67cbee554fb417654dfd352aa37", "size": 42660, "ext": "py", "lang": "Python", "max_stars_repo_path": "dft/libxc.py", "max_stars_repo_name": "gmwang18/pyscf", "max_stars_repo_head_hexsha": "fcd6877751661c8a9743c1c872a4a2b65f6dd7ac", "max_stars_repo_licenses": ["BSD-2-Clause"], "max_stars_count": n... |
```python
from __future__ import division
import numpy as np
import seaborn as sns
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
sns.set_style('whitegrid')
sns.set_palette('colorblind')
np.random.seed(40997)
```
```python
import datagenerators as dg
```
```python
observed_data_0 = dg.ge... | {"hexsha": "f9d0d2a366ef70a9c87f065f337f7a49f3f43ec4", "size": 315544, "ext": "ipynb", "lang": "Jupyter Notebook", "max_stars_repo_path": "framework/causal_note1.ipynb", "max_stars_repo_name": "mullachv/causal_notes", "max_stars_repo_head_hexsha": "509e1f5c9f793697949a3a6f6bfc53df85e7e9f6", "max_stars_repo_licenses": [... |
[STATEMENT]
lemma of_hypnat_0_le_iff [simp]: "\<And>n. 0 \<le> (of_hypnat n::'a::linordered_semidom star)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<And>n. 0 \<le> of_hypnat n
[PROOF STEP]
by transfer (rule of_nat_0_le_iff) | {"llama_tokens": 112, "file": null, "length": 1} |
module ProgressMeter
using Printf: @sprintf
using Distributed
export Progress, ProgressThresh, ProgressUnknown, BarGlyphs, next!, update!, cancel, finish!, @showprogress, progress_map, progress_pmap, ijulia_behavior
"""
`ProgressMeter` contains a suite of utilities for displaying progress
in long-running computation... | {"hexsha": "cfbdcbd92711a9e0c37a2552d674680fbafff73c", "size": 31578, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/ProgressMeter.jl", "max_stars_repo_name": "palday/ProgressMeter.jl", "max_stars_repo_head_hexsha": "e2b7ccdd681450474ca4a919b1e507701bc6de3e", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
import pandas as pd
from scipy.signal import periodogram
from .misc import get_equivalent_days
import re
#%% plotting functions
def adjust_bright(color, amount=1.2):
"""
Adjust color brightness in plots for use.
Inpu... | {"hexsha": "f0de38db6f8c1e7102498b6a065e194f2fb2e496", "size": 14729, "ext": "py", "lang": "Python", "max_stars_repo_path": "Utils/plot.py", "max_stars_repo_name": "wkCircle/myPythonLibrary", "max_stars_repo_head_hexsha": "3b37568c658ba237d3ca32d01c82fd3049b459f6", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
/*
* Copyright © 2014-2015 Klaus Reuter
* Copyright © 2014 Felix Höfling
* Copyright © 2014 Manuel Dibak
* All rights reserved.
*
* This file is part of h5xx — a C++ wrapper for the HDF5 library.
*
* This software may be modified and distributed under the terms of the
* 3-clause BSD license. See ... | {"hexsha": "ba2910a236288f1cf2a59d90d2b5dd658f596d1c", "size": 9171, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "h5xx/dataset/boost_multi_array.hpp", "max_stars_repo_name": "halmd-org/h5xx", "max_stars_repo_head_hexsha": "fedf38a0bc58ff5ff30c46819d64eb7b8c644c60", "max_stars_repo_licenses": ["BSD-3-Clause"], "... |
[STATEMENT]
lemma times_inf [simp]:
"x * y = x \<sqinter> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. x * y = x \<sqinter> y
[PROOF STEP]
by simp | {"llama_tokens": 71, "file": "Stone_Relation_Algebras_Relation_Algebras", "length": 1} |
#########################################################################
# File Name: test.py
# Author: Walker
# mail:qngskk@gmail.com
# Created Time: Thu Dec 9 11:25:59 2021
#########################################################################
# !/usr/bin/env python3
import numpy as np
import pandas as pd
impor... | {"hexsha": "bfc12a9d6ea671729f40df32ada9b93a53e70506", "size": 4273, "ext": "py", "lang": "Python", "max_stars_repo_path": "learn/1_weather/src/test.py", "max_stars_repo_name": "PuddingWalker/py_small_projects", "max_stars_repo_head_hexsha": "d039fec99b2d42ff577ada59a91e95d97d692214", "max_stars_repo_licenses": ["Unlic... |
import pickle
import os
import numpy as np
import viewer3d
from viewer3d import plot3d, inte_to_rgb, show_pillar_cuboid
from msic import get_corners_3d
from kitti import Object3d
car_th = 0.5
ped_th = 0.5
data_dir = '/data/Machine_Learning/ImageSet/KITTI/object/training/'
f = open('./results/car/step_296960/result... | {"hexsha": "e6d03a3461fffb36974c49e53220f2ab667d136c", "size": 2472, "ext": "py", "lang": "Python", "max_stars_repo_path": "display3d/display3d.py", "max_stars_repo_name": "leon-liangwu/PillarsRNN", "max_stars_repo_head_hexsha": "b6e7d64af4e2819098ae9a87a9dd676ee8288874", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
#
# Copyright (C) 2020 by The Board of Trustees of Stanford University
# This program is free software: you can redistribute it and/or modify it under
# the terms of the Modified BSD-3 License as published by the Open Source
# Initiative.
# If you use this program in your research, we request that you reference th... | {"hexsha": "dc7858a82a31268654fee296899a575f144a377d", "size": 8626, "ext": "py", "lang": "Python", "max_stars_repo_path": "illusion_testing/training/train_d2nn_Q2.py", "max_stars_repo_name": "robust-systems-group/illusion_system", "max_stars_repo_head_hexsha": "f142cc1dacb02312ad78b0ec613061fe84e6648c", "max_stars_rep... |
import numpy as np
from .utils import parallel_talismane, lemmatize
from .textometry import match_lexique_to_responses_texts
from .constant import *
WINDOW_SIZE = 4
import re
def get_data_from_texts(texts, batch_size=1000, lemmas_only=False):
def transform_and_return(df):
df.LEMMA = df.apply(lambda x: x.... | {"hexsha": "cf7fe62f0b1690bfbc664b653a9248b925539f4e", "size": 13283, "ext": "py", "lang": "Python", "max_stars_repo_path": "lib/cooc.py", "max_stars_repo_name": "Make-the-Debat-Great-Again/grand_debat_nlp", "max_stars_repo_head_hexsha": "6be7211492e10aae97a9d6e001f87af1d499de1e", "max_stars_repo_licenses": ["MIT"], "m... |
import h5py
import pandas as pd
import numpy as np
from tensorflow.keras.preprocessing.text import Tokenizer
from tensorflow.keras.preprocessing.sequence import pad_sequences
from tensorflow.keras.models import model_from_json
# The maximum number of words to be used. (most frequent)
max_top_words = 50000
# Max number... | {"hexsha": "9d9cccfb99ff887989bd417f101c9e68a411553d", "size": 1107, "ext": "py", "lang": "Python", "max_stars_repo_path": "tensorscript_RNN_ideology_recognition.py", "max_stars_repo_name": "Pijanes/Party_Mobilisation_Twitter", "max_stars_repo_head_hexsha": "59181b442fa16c7e96cbabfcd28798b473aad2c6", "max_stars_repo_li... |
import numpy as np
from collections.abc import Sequence, Iterable
from numbers import Number
from .type import str_to_dtype, is_arr, is_dict, is_seq_of, is_type, scalar_type, is_str
def astype(x, dtype):
if dtype is None:
return x
assert is_arr(x) and is_str(dtype), (type(x), type(dtype))
if is_ar... | {"hexsha": "1cc5bcf8ca8c4d233aac92bd258ca8f60bcc4dbe", "size": 4456, "ext": "py", "lang": "Python", "max_stars_repo_path": "mani_skill_learn/utils/data/converter.py", "max_stars_repo_name": "Zed-Wu/ManiSkill-Learn", "max_stars_repo_head_hexsha": "8056fe327752cd0863f8730672fe62bd85a0ec12", "max_stars_repo_licenses": ["A... |
import numpy as np
def sample(env,
controller,
num_paths=10,
horizon=1000,
render=False,
verbose=False):
"""
Samples paths in a environment with a provided controller
Each path can have elements for observations, next_observations, rewards, ret... | {"hexsha": "87c04a8ce6a62f9c34823f66d5fceb55cafa4720", "size": 1967, "ext": "py", "lang": "Python", "max_stars_repo_path": "sandbox/ours/model_based_rl/helpers.py", "max_stars_repo_name": "jackwilkinson255/mbmpo_master", "max_stars_repo_head_hexsha": "e9e0eaf542c7895764dcb0bfee28752818124ff2", "max_stars_repo_licenses"... |
from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt
import sys
from operator import sub
def get_aspect(ax):
# Total figure size
figW, figH = ax.get_figure().get_size_inches()
# Axis size on figure
_, _, w, h = ax.get_position().bounds
# Ratio of display units
... | {"hexsha": "c9439ff625dd23f69d19e671177d20262f52e3ba", "size": 1186, "ext": "py", "lang": "Python", "max_stars_repo_path": "PW/sch_03/plot_bandstructure.py", "max_stars_repo_name": "f-fathurrahman/ffr-ElectronicStructure.jl", "max_stars_repo_head_hexsha": "35dca9831bfc6a3e49bb0f3a5872558ffce4b211", "max_stars_repo_lice... |
import torch
import copy
from torch.utils.data import Dataset
import numpy as np
from pathlib import Path
class PPODataset(Dataset):
def __init__(self, batch_size, minibatch_size, is_discrete, is_rnn, device, seq_len):
self.is_rnn = is_rnn
self.seq_len = seq_len
self.batch_size = batch_siz... | {"hexsha": "c2251bf37c21b5ae2fabc77dc550f0a58129024c", "size": 7775, "ext": "py", "lang": "Python", "max_stars_repo_path": "rl_games/common/datasets.py", "max_stars_repo_name": "yzqin/rl_games", "max_stars_repo_head_hexsha": "6e09fec1e60d70c1dc1934ec65ed3265950a8c34", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
\chapter{Physical Interaction}\label{ch:interaction}
\index{interaction!physical}
As pointed out before, grounding an ontology and lexicon is supposed to be influenced for a great deal by agents' physical interaction with their environment. In this chapter several influences of these physical interaction are investiga... | {"hexsha": "17b801b47d28914d6a93080f37851ea83b074087", "size": 20858, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "physical/physical.tex", "max_stars_repo_name": "langsci/Vogt", "max_stars_repo_head_hexsha": "bbec105485e4641c61e0df6157f62dccf61d6f93", "max_stars_repo_licenses": ["CC-BY-4.0"], "max_stars_count":... |
# -*- coding: utf-8 -*-
#############################################################
# IMPORTS #
#############################################################
## --> GUI
from PySide6 import QtCore, QtGui, QtWidgets
from Order_data.ui_main import Ui_MainWindow
... | {"hexsha": "799301ef243cf11f3a91255ef92b57628e093589", "size": 26296, "ext": "pyw", "lang": "Python", "max_stars_repo_path": "COMMANDE/Order.pyw", "max_stars_repo_name": "PictorSomni/Image_manipulations", "max_stars_repo_head_hexsha": "7b91dd8514a2bb4383308c199e03e26539cef430", "max_stars_repo_licenses": ["MIT"], "max_... |
#Julia Gadfly Histogram
using Gadfly
plot(x=randn(113), Geom.histogram(bincount=10)) | {"hexsha": "f23f28b972bd916fbc0f32674e561ecf6d6b738d", "size": 88, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "Chapter04/B10526-04_julia_code/6-gadfly-histogram.jl", "max_stars_repo_name": "suwarnarajput/Learning-Jupyter-5-Second-Edition", "max_stars_repo_head_hexsha": "77f6e04f9cc86fb3490978e0b34a804c47965a6... |
# ---
# title: 1347. Minimum Number of Steps to Make Two Strings Anagram
# id: problem1347
# author: Tian Jun
# date: 2020-10-31
# difficulty: Medium
# categories: String
# link: <https://leetcode.com/problems/minimum-number-of-steps-to-make-two-strings-anagram/description/>
# hidden: true
# ---
#
# Given two equal-si... | {"hexsha": "ccff61583ac994677c9b965bf4610b8082e450d3", "size": 1625, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/unresolved/1347.minimum-number-of-steps-to-make-two-strings-anagram.jl", "max_stars_repo_name": "jmmshn/LeetCode.jl", "max_stars_repo_head_hexsha": "dd2f34af8d253b071e8a36823d390e52ad07ab2e", "... |
import cv2
import numpy as np
from base_camera import BaseCamera
def merge(left_image, right_image):
return np.concatenate((left_image, right_image), axis=1)
class Camera(BaseCamera):
video_source_1 = 1
video_source_2 = 2
@staticmethod
def set_video_sources(source_1, source_2):
Camera.vi... | {"hexsha": "163b68114d711f8dac5fb4c84823dbc8a793c20e", "size": 943, "ext": "py", "lang": "Python", "max_stars_repo_path": "camera_opencv_stereo.py", "max_stars_repo_name": "taraprasad73/flask-video-streaming", "max_stars_repo_head_hexsha": "bb123db41857f90224fa4025334c04f73fa52419", "max_stars_repo_licenses": ["MIT"], ... |
import numpy as np
import torchvision.datasets as datasets
from pathlib import Path
import libs.dirs as dirs
import libs.utils as utils
import libs.dataset_utils as dutils
import models.utils as mutils
import libs.commons as commons
from libs.vis_fun... | {"hexsha": "52469f8ecb67d529ba2fdbe487fcda4b777dab68", "size": 4168, "ext": "py", "lang": "Python", "max_stars_repo_path": "models/get_train_stats.py", "max_stars_repo_name": "olavosamp/semiauto-video-annotation", "max_stars_repo_head_hexsha": "b1a46f9c0ad3bdcedab76b4cd730747ee2afd2fd", "max_stars_repo_licenses": ["MIT... |
#define BOOST_TEST_MODULE Qt5Gui
#include "Qt5Gui.hpp"
#include <boost/test/unit_test.hpp>
#include "thread.hpp"
#include "stack.hpp"
#include "algorithm.hpp"
#include "load.hpp"
#include "reference.hpp"
#include "convert/string.hpp"
#include "convert/char.hpp"
#include "convert/callable.hpp"
#include "convert/numer... | {"hexsha": "f1529f84b935e10ab0f74885bbab4d70f8ed3cf5", "size": 1380, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "src/tests/Qt5Gui.cpp", "max_stars_repo_name": "dafrito/luacxx", "max_stars_repo_head_hexsha": "278bf8a7c6664536ea7f1dd1f59d35b6fb8d2dad", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 128.0... |
import math
from typing import Dict, List
import numpy as np
import pandas as pd
from data_manager.base_manager import DataManagerBase, DataParam
from proto.aiengine.v1 import aiengine_pb2
class TimeSeriesDataManager(DataManagerBase):
def __init__(self, param: DataParam, fields: Dict[str, aiengine_pb2.FieldData... | {"hexsha": "159074a9f55be420b0a971a1140ca55abf0fa6bc", "size": 6239, "ext": "py", "lang": "Python", "max_stars_repo_path": "ai/src/data_manager/time_series_manager.py", "max_stars_repo_name": "ScriptBox99/spiceai", "max_stars_repo_head_hexsha": "f8aa178fed5cc6d6d9397c123bdc869500c5135b", "max_stars_repo_licenses": ["Ap... |
#!/usr/local/bin/python3
from numpy import array, sum, savetxt, loadtxt, zeros, arange, vectorize
from datetime import datetime
from commonutils import construct_app_num, log_error
from casestatus import CaseStatus
from typing import Tuple, List
from functools import reduce
from os.path import basename
from itertools ... | {"hexsha": "cc9731d0fe3da6617b05c6d4a88794c855d88b33", "size": 4139, "ext": "py", "lang": "Python", "max_stars_repo_path": "datautils.py", "max_stars_repo_name": "rohgarg/uscis-scrape", "max_stars_repo_head_hexsha": "73b882566d0b6ed92a0a25d459c0e2bd637f266c", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count"... |
try:
import cv2
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import linregress
except ImportError as e:
from pip._internal import main as install
packages = ["numpy", "opencv-python", "matplotlib", "scipy"]
for package in packages:
install(["install", package... | {"hexsha": "bc1b98d38bd3c37bfc02ce248bd3180b93ebc5fd", "size": 1152, "ext": "py", "lang": "Python", "max_stars_repo_path": "beginner/Open-Computer-Vision-Chapter-1/mouse-event.py", "max_stars_repo_name": "CrispenGari/opencv-python", "max_stars_repo_head_hexsha": "cfa862fbf3b8b2c8899b76cee2774d6fb72ba00e", "max_stars_re... |
function [u, ind, baseDataTYPE] = getScanGroups(vw, baseDT, confirm)
% Group the scans within a dataTYPE into subgroups with identical annotations.
% The number of subgroups equals the number of scans with unique
% annotations.
%
% [u, ind, baseDataTYPE] = getScanGroups(vw, baseDT)
%
% Purpose:
% Return the list of ... | {"author": "vistalab", "repo": "vistasoft", "sha": "7f0102c696c091c858233340cc7e1ab02f064d4c", "save_path": "github-repos/MATLAB/vistalab-vistasoft", "path": "github-repos/MATLAB/vistalab-vistasoft/vistasoft-7f0102c696c091c858233340cc7e1ab02f064d4c/mrBOLD/Utilities/getScanGroups.m"} |
\section*{Acknowledgements}
We would like to thank Prof.~Idit Keidar for her expert advices about
the quorum systems. In fact, the idea of separating the KV quorum
system from the auth quorum system first appeared in her email
messages. Also, Dr.~Edward Bortnikov and Prof.~Juan A.~Garay helped us
move the project forwa... | {"hexsha": "2bd2bf7d6c2b0645c598867bd6406e93062b02b2", "size": 337, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "docs/tex/ack.tex", "max_stars_repo_name": "dmitris/bftkv", "max_stars_repo_head_hexsha": "8769a830c87436922a2568f967aed891baf0cd5b", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count": 31, ... |
"""SeqNN regression metrics."""
import pdb
import numpy as np
import tensorflow as tf
from tensorflow.python.keras import backend as K
from tensorflow.python.keras.utils import losses_utils
from tensorflow.python.keras.losses import LossFunctionWrapper
from tensorflow.python.keras.utils import metrics_utils
#########... | {"hexsha": "2a86e0bd2ae44cb8fddf454b967b65a350b4f614", "size": 14011, "ext": "py", "lang": "Python", "max_stars_repo_path": "basenji/metrics.py", "max_stars_repo_name": "prasathlab/basenji", "max_stars_repo_head_hexsha": "d61389dc553aa610544503a3e937c1b53906fe35", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.