text stringlengths 0 1.25M | meta stringlengths 47 1.89k |
|---|---|
import numpy as np
from pytest import fixture
import pyvista
from pyvista import examples
pyvista.OFF_SCREEN = True
@fixture(scope='session')
def set_mpl():
"""Avoid matplotlib windows popping up."""
try:
import matplotlib
except Exception:
pass
else:
matplotlib.use('agg', fo... | {"hexsha": "be29edfedecbea76344a05b0b003821dbeea01b1", "size": 1601, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/conftest.py", "max_stars_repo_name": "eino/pyvista", "max_stars_repo_head_hexsha": "b9c4e67d43491958f70b04cd2664965b938910ba", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, "max_... |
"""
Evaluate using simple graph convolution networks.
"""
from shutil import which
import numpy as np
from matplotlib import pyplot as plt
import pdb
import scipy as sp
from scipy.sparse.csgraph import laplacian
from scipy.sparse.linalg import eigsh
from scipy.sparse.linalg.eigen.arpack.arpack import eigs
from sklear... | {"hexsha": "1a067d6e559aa23cf5677fe414a083ddd715dbe2", "size": 4794, "ext": "py", "lang": "Python", "max_stars_repo_path": "Evaluate_GCN.py", "max_stars_repo_name": "ac20/EnsembleEdgeWeightsHSI", "max_stars_repo_head_hexsha": "cee9a1c4252a606e4748b8dec879d4603dd55d29", "max_stars_repo_licenses": ["MIT"], "max_stars_cou... |
#ifndef SHIFT_CORE_RINGBUFFER_HPP
#define SHIFT_CORE_RINGBUFFER_HPP
#include <utility>
#include <algorithm>
#include <cstring>
#include <shift/core/boost_disable_warnings.hpp>
#include <boost/call_traits.hpp>
#include <shift/core/boost_restore_warnings.hpp>
namespace shift::core
{
/// A ring buffer using a single lin... | {"hexsha": "f0583e8c44290a1c1ed21be5fe6bf2c22121ca16", "size": 11068, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "shift/core/public/shift/core/ring_buffer.hpp", "max_stars_repo_name": "cspanier/shift", "max_stars_repo_head_hexsha": "5b3b9be310155fbc57d165d06259b723a5728828", "max_stars_repo_licenses": ["Apache... |
import carla
import numpy as np
class Vehicle:
def __init__(self, controller, vehicle_id, auto_pilot=True, dashcam=True, third_camera=True, color=None):
self.controller = controller
self.world = self.controller.world
self.blueprint = self.controller.world.get_blueprint_library().find(vehic... | {"hexsha": "85afab026c98f6e97cba97c1c8bd83a1e2d24781", "size": 2104, "ext": "py", "lang": "Python", "max_stars_repo_path": "monitor/Vehicle.py", "max_stars_repo_name": "canyue1111/Alset-Autopilot-System", "max_stars_repo_head_hexsha": "c85764ecb6788f947aa97bcfc4e95a87e371fd7d", "max_stars_repo_licenses": ["Apache-2.0"]... |
from keras.models import Sequential
from keras.utils import np_utils
from keras import models
from keras import layers
from keras import optimizers
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
# Read data
train = pd.read_csv('../../source/train.csv')
labels = train.ix[:,0].values.astype('int3... | {"hexsha": "01307f570121e1b15ebffb21585901f512009476", "size": 2475, "ext": "py", "lang": "Python", "max_stars_repo_path": "digits/digits_convnet_kaggle2.py", "max_stars_repo_name": "MidSummersEveee/Chollet", "max_stars_repo_head_hexsha": "cd2b23c9a72d9a6dcc776adaef8acbb74e04e88b", "max_stars_repo_licenses": ["MIT"], "... |
"""
MIT License
Copyright (c) 2021 Libin Jiao
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, di... | {"hexsha": "046518765c4cf4eda8a571f5d9fef161c040110d", "size": 15052, "ext": "py", "lang": "Python", "max_stars_repo_path": "train.py", "max_stars_repo_name": "92xianshen/guided-pix2pix", "max_stars_repo_head_hexsha": "2929bb526db59e6eda25c8ac3c78266a15d4cd25", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nul... |
import tensorflow as tf
import numpy as np
import random
import cv2
PIXEL_MEANS = np.array([[[122.7717, 115.9465, 102.9801]]])
PIXEL_STDV = [[[0.229, 0.224, 0.2254]]]
def normlize(image, mean=PIXEL_MEANS):
image = (image - mean / 255.0) / PIXEL_STDV
return image
def flip_left_right(image, boxes, labels):
... | {"hexsha": "c70e17a51a2658207702d85d3414942bac2d2ba4", "size": 7594, "ext": "py", "lang": "Python", "max_stars_repo_path": "retinanet/utils/data_utils.py", "max_stars_repo_name": "bharatmahaur/ComparativeStudy", "max_stars_repo_head_hexsha": "2e3b6de882acc2a465e1b7c8bcd23cc9c8181d3d", "max_stars_repo_licenses": ["Apach... |
import torch
import torchvision.transforms as transforms
from torch.utils.data import DataLoader
import numpy as np
from numpy import *
import argparse
from PIL import Image
import imageio
import os
from tqdm import tqdm
from utils.metrices import *
from utils import render
from utils.saver import Saver
from utils.iou... | {"hexsha": "88107192d7eeb4ede62c763571679e37b48d54ef", "size": 10651, "ext": "py", "lang": "Python", "max_stars_repo_path": "philly_exp/ViT/imagenet_seg_eval_dino_gcr.py", "max_stars_repo_name": "ananyak100-dev/Transformer-Explainability", "max_stars_repo_head_hexsha": "75b5f34276f9a840f98df8a87c3387fa55147acf", "max_s... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on Jan 29, 2021
@file: transforms.py
@desc: Module containing all the transformations that can be done on a datasets.
@author: laugh12321
@contact: laugh12321@vip.qq.com
"""
import abc
import numpy as np
from typing import List, Dict
from src.model import enum... | {"hexsha": "733e32d1619bce7c68f4f16b9dc3650173130070", "size": 3022, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/utils/transforms.py", "max_stars_repo_name": "laugh12321/Hyperspectral-Unmixing", "max_stars_repo_head_hexsha": "a75b3b4d4ea2b39f6181848c12179b662e88e103", "max_stars_repo_licenses": ["MIT"], ... |
### Illustrates the piece-wise linear approximation of the cumulative distribution using constant size bins
fade = rgb(0,0,0,alpha=0.5)
dot.size = 0.7
n = 10000
set.seed(5)
pdf("linear-interpolation.pdf", width=6, height=2.7, pointsize=10)
layout(matrix(c(1,2),byrow=T, ncol=2), widths=c(1.1,1))
u = sort(runif(n))
x = ... | {"hexsha": "75153944fa59eae91a0e996dee12e356e532d0ef", "size": 2280, "ext": "r", "lang": "R", "max_stars_repo_path": "docs/t-digest-paper/linear-interpolation.r", "max_stars_repo_name": "ajwerner/t-digest", "max_stars_repo_head_hexsha": "fce13b0cee5daa1a98b84e8ca49cdf8f7ccff6b7", "max_stars_repo_licenses": ["Apache-2.0... |
[STATEMENT]
lemma eFreshInp_simp[simp]:
"igWlsInp MOD delta inp
\<Longrightarrow> eFreshInp MOD ys y (OKI inp) = igFreshInp MOD ys y inp"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. igWlsInp MOD delta inp \<Longrightarrow> eFreshInp MOD ys y (OKI inp) = igFreshInp MOD ys y inp
[PROOF STEP]
by (force simp: igFres... | {"llama_tokens": 176, "file": "Binding_Syntax_Theory_Iteration", "length": 1} |
import pandas as pd
import glob
import xml.etree.ElementTree as ET
from astropy import units as u
from astropy.coordinates import SkyCoord
def read_candidate_files(files, verbose=True):
# Reads candidates files and include the candidates in a single pandas DataFrame
#files = glob.glob(path + '*/overview.xml'... | {"hexsha": "310afc7f5967ec137b3e805c932f0d5f48b6c94d", "size": 3298, "ext": "py", "lang": "Python", "max_stars_repo_path": "candidate_filter/reading_cands.py", "max_stars_repo_name": "larskuenkel/candidate_filter", "max_stars_repo_head_hexsha": "8364491b05a614885156fd92ad2ea0ad9fb3c478", "max_stars_repo_licenses": ["MI... |
import sys
import numpy as np
from collections import OrderedDict
from ..utils.utils_def import FlopyBinaryData
class SwrFile(FlopyBinaryData):
"""
Read binary SWR output from MODFLOW SWR Process binary output files
The SwrFile class is the super class from which specific derived
classes are formed. ... | {"hexsha": "7c36c98edfe9a43cc9b720e00dcb16e02bab80b9", "size": 23925, "ext": "py", "lang": "Python", "max_stars_repo_path": "flopy/utils/swroutputfile.py", "max_stars_repo_name": "aleaf/flopy", "max_stars_repo_head_hexsha": "a5777a4d4a745e473110a167c69603ac4ad3106c", "max_stars_repo_licenses": ["CC0-1.0", "BSD-3-Clause... |
"""Checks module: gather utilities to perform routine checks. """
# Authors: Hamza Cherkaoui <hamza.cherkaoui@inria.fr>
# License: BSD (3-clause)
import numpy as np
from .convolution import adjconv_uH
from .atlas import get_indices_from_roi
class EarlyStopping(Exception):
""" Raised when the algorithm converged.... | {"hexsha": "0632e9ebfdc8e7ac70de03c04ef060e3d3ffb9ed", "size": 11692, "ext": "py", "lang": "Python", "max_stars_repo_path": "hemolearn/checks.py", "max_stars_repo_name": "hemolearn/hemolearn", "max_stars_repo_head_hexsha": "87db924a020497a236c410e828d5029c334032f5", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_sta... |
import numpy as np
import wave
import math
import os
def nextpow2(n):
return np.ceil(np.log2(np.abs(n))).astype("long")
def berouti(SNR):
if -5.0 <= SNR <= 20.0:
a = 4 - SNR * 3 / 20
else:
if SNR < -5.0:
a = 5
if SNR > 20:
a = 1
retur... | {"hexsha": "e9294175d00bdfe29423c677e210b7e6b131fc92", "size": 3870, "ext": "py", "lang": "Python", "max_stars_repo_path": "speaker_verification/denoise.py", "max_stars_repo_name": "jakerenzella/speaker-verification", "max_stars_repo_head_hexsha": "b40635a11295f5113d5d721001cfdaa105209bd8", "max_stars_repo_licenses": [... |
# Copyright (c) 2017, Lawrence Livermore National Security, LLC. Produced at
# the Lawrence Livermore National Laboratory. LLNL-CODE-734707. All Rights
# reserved. See files LICENSE and NOTICE for details.
#
# This file is part of CEED, a collection of benchmarks, miniapps, software
# libraries and APIs for efficient h... | {"hexsha": "95de43d5bf868045adfb851411e7c82b38c70b68", "size": 7367, "ext": "py", "lang": "Python", "max_stars_repo_path": "python/tests/test-2-elemrestriction.py", "max_stars_repo_name": "DiffeoInvariant/libCEED", "max_stars_repo_head_hexsha": "fef6d6185073a4ded914e81d25fd2b60cc92d311", "max_stars_repo_licenses": ["BS... |
import os
import numpy as np
from collections import OrderedDict
from ..utils import transform_utils as T
from ..models.grippers import gripper_factory
from ..controllers import controller_factory, load_controller_config
from .robot import Robot
class Bimanual(Robot):
"""Initializes a bimanual robot, as defined by... | {"hexsha": "2aaf842ca65ada7ff3f1e39944050d538360ee4b", "size": 21295, "ext": "py", "lang": "Python", "max_stars_repo_path": "robosuite/robots/bimanual.py", "max_stars_repo_name": "StanfordVL/Lasersuite", "max_stars_repo_head_hexsha": "8b78c3d202f2a4b8712c5f228feaf5fae61f16e9", "max_stars_repo_licenses": ["MIT"], "max_s... |
!-------------------------------------------------------------------------------
! The @header, @table_section, @table_subsection, @item and @end_table commands
! are custom defined commands in Doxygen.in. They are defined under ALIASES.
! For the page created here, the 80 column limit is exceeded. Arguments of
! a... | {"hexsha": "0bcb6d43d2a2e040aa8b134edd7528cf549ad8d6", "size": 14265, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "Sources/siesta_namelist.f90", "max_stars_repo_name": "ORNL-Fusion/SIESTA", "max_stars_repo_head_hexsha": "58934c964dfa5c7e052f112e4a8e1f274f028bc7", "max_stars_repo_licenses": ["MIT"], "max_sta... |
[STATEMENT]
lemma matchs_app[simp]:
assumes "length xs\<^sub>2 = length ys\<^sub>2"
shows "matchs (xs\<^sub>1 @ xs\<^sub>2) (ys\<^sub>1 @ ys\<^sub>2) =
matchs xs\<^sub>1 ys\<^sub>1 \<bind> (\<lambda>env\<^sub>1. matchs xs\<^sub>2 ys\<^sub>2 \<bind> (\<lambda>env\<^sub>2. Some (env\<^sub>1 ++\<^sub>f env\<... | {"llama_tokens": 454, "file": "Higher_Order_Terms_Term_Class", "length": 2} |
import argparse
from datetime import datetime
from os import makedirs, path
import numpy as np
from sklearn.metrics.pairwise import cosine_similarity
class Matcher:
def __init__(self, probe_path, gallery_path, dataset_name):
# lenght of ids to get from feature files
self.id_length = -1
se... | {"hexsha": "8741794b619850582a5f81786f27705df347c193", "size": 5394, "ext": "py", "lang": "Python", "max_stars_repo_path": "feature_match.py", "max_stars_repo_name": "abhatta1234/face_analysis_pytorch", "max_stars_repo_head_hexsha": "2abe930c0ca02a1fd819d4710fd9bff392f32f58", "max_stars_repo_licenses": ["MIT"], "max_st... |
import numpy as np
import math
class Dataset(object):
def __init__(self, dataset):
self._dataset = dataset
self.n_samples = dataset.n_samples
self._train = dataset.train
self._index_in_epoch = 0
self._epochs_complete = 0
self._perm = np.arange(self.n_samples)
... | {"hexsha": "8a9ddb5a2a393b08cde6c63f90c0857ea1709b7e", "size": 1163, "ext": "py", "lang": "Python", "max_stars_repo_path": "models/penet/input.py", "max_stars_repo_name": "firmamentqj/bodyemotion", "max_stars_repo_head_hexsha": "d1e83ee6043e1ff50a2e37b5d17c2dbccc4ca688", "max_stars_repo_licenses": ["Apache-2.0"], "max_... |
"""Basic drawing functions to generate a shape-based graphic."""
import types
import numpy as np
import cv2
import cv2.cv as cv
from lumos.util import KeyCode
import graphics
class Drawing(object):
window_name = "Drawing"
window_width, window_height = 640, 480
window_delay = 10 # ms; determines the window u... | {"hexsha": "aa0b6211e284d4d6a67480cfc5b190ad29b515ad", "size": 8590, "ext": "py", "lang": "Python", "max_stars_repo_path": "nap/util/drawing.py", "max_stars_repo_name": "napratin/nap", "max_stars_repo_head_hexsha": "a5735a2a2a0ad9a4da2d48671f3072ad60173b0c", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, "ma... |
"""
Data Class
"""
###########
# Imports #
###########
import os
import pdb
import sys
import pickle
from collections import namedtuple
import numpy as np
import torch
from torch.utils.data.dataset import Dataset
from torchvision import transforms
from torchvision import datasets
###########
# Globals #
##########... | {"hexsha": "f30bedbcb0488df2a7a89745b076646d7465f8a8", "size": 6765, "ext": "py", "lang": "Python", "max_stars_repo_path": "data.py", "max_stars_repo_name": "inzouzouwetrust/pytorch-cifar", "max_stars_repo_head_hexsha": "7bf35ac1a96a7ad67cabc2e6144b528d87756c1c", "max_stars_repo_licenses": ["MIT"], "max_stars_count": n... |
from os import path, pardir
from setuptools import setup, find_packages, Extension
import numpy as np
from Cython.Build import cythonize
CYTHON_DEBUG = False
if CYTHON_DEBUG:
from Cython.Compiler.Options import get_directive_defaults
directive_defaults = get_directive_defaults()
directive_defaults['linet... | {"hexsha": "b4e3c9ba008bdd2a0f060e0928339eaefea29060", "size": 2002, "ext": "py", "lang": "Python", "max_stars_repo_path": "setup.py", "max_stars_repo_name": "angelolab/mibi-bin-tools", "max_stars_repo_head_hexsha": "369f62dfb64af41966d25ca188e96dce676f5e38", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count"... |
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
from pyts.classification import KNeighborsClassifier
from sklearn.metrics import (
accuracy_score,
auc,
classification_report,
f1_score,
plot_confusion_matrix,
roc_auc_score,
roc_curve,
)
from sklearn.model_selection... | {"hexsha": "2ce38ee585df2eb61c5888acbdb98c45e552e0dd", "size": 4150, "ext": "py", "lang": "Python", "max_stars_repo_path": "ts_classification_5.py", "max_stars_repo_name": "Mariabba/DataMining2-project", "max_stars_repo_head_hexsha": "d12cf4d6605a16194f24b8410c332cff701d2b6d", "max_stars_repo_licenses": ["CC-BY-4.0", "... |
# -*- coding: utf-8 -*-
"""
this script computes the expected auroral power output for the
oi 5577 angstrom line for proxima b, given stellar wind conditions
for planet 'b' from cohen et al 2014
@author: mtilley [matt a. tilley, university of washington]
@email: mtilley (at) uw (dot) edu
"""
# imports
from __future_... | {"hexsha": "004697482942dad4b22eb7a23fb4b8f2c3a5ce88", "size": 16524, "ext": "py", "lang": "Python", "max_stars_repo_path": "signal/power_m2.py", "max_stars_repo_name": "rodluger/exoaurora", "max_stars_repo_head_hexsha": "0ec1c59c368ccbf0c9eb2450d52b7ec7897ce322", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
# Autogenerated wrapper script for WaveFD_jll for i686-linux-musl
export libillumination, libprop2DAcoIsoDenQ_DEO2_FDTD, libprop2DAcoTTIDenQ_DEO2_FDTD, libprop2DAcoVTIDenQ_DEO2_FDTD, libprop3DAcoIsoDenQ_DEO2_FDTD, libprop3DAcoTTIDenQ_DEO2_FDTD, libprop3DAcoVTIDenQ_DEO2_FDTD, libspacetime
using CompilerSupportLibraries... | {"hexsha": "043f4e679009b550f5f7878a623a2963f1fc6ca5", "size": 2595, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/wrappers/i686-linux-musl.jl", "max_stars_repo_name": "JuliaBinaryWrappers/WaveFD_jll.jl", "max_stars_repo_head_hexsha": "2a6c3695f9296062c62f83a22df5fc3a191e36f5", "max_stars_repo_licenses": ["... |
#!/usr/bin/env python
# coding: utf-8
# # Notebook for pulling account usage data on the IBM Cloud
# [IBM Cloud](https://cloud.ibm.com) is a platform of cloud services that help partners and clients solve a variety business problems.
#
# **NOTE:**
# This notebook was initially based upon a Python notebook provided by ... | {"hexsha": "4b27249dde45369f2a6caa715b95659b3e19f822", "size": 25085, "ext": "py", "lang": "Python", "max_stars_repo_path": "CSM_IBM_Cloud_Usage.py", "max_stars_repo_name": "dtoczala/IBMCloudBillingScript", "max_stars_repo_head_hexsha": "2d8674bc768fc060a9993fc30c63127bd6c7ff3a", "max_stars_repo_licenses": ["Apache-2.0... |
import os
import warnings
import numpy as np
import pandas as pd
from tqdm.auto import tqdm
from typing import Dict, List, Callable
from tensorflow.keras import Model
from tensorflow.keras.utils import Sequence
from .report_utils import cae_report, cnn_report, flat_report
from ..models import cae_200, cae_500, cae_10... | {"hexsha": "debf5e24693709a7dd00571939021e8d8f13c0c7", "size": 4557, "ext": "py", "lang": "Python", "max_stars_repo_path": "repairing_genomic_gaps/reports/build_reports.py", "max_stars_repo_name": "LucaCappelletti94/repairing_genomic_gaps", "max_stars_repo_head_hexsha": "38d43c732cbd092b52c1eaf0b33a9bd47a14ebd4", "max_... |
## ---------------- Bounded learning
"""
$(SIGNATURES)
For a single college (not a ModelObject).
Each college is endowed with `maxLearn`. Once a student has learned this much, learning productivity falls to 0 (or a constant).
`dh = exp(aScale * a) * studyTime ^ timeExp * A`
The functional form for `A` is gover... | {"hexsha": "e5bc2741dc04e590c7a8fbdc7f19816afd628b89", "size": 10167, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/hprod_bounded.jl", "max_stars_repo_name": "hendri54/CollegeStratCollege", "max_stars_repo_head_hexsha": "13d5032142751053d0341395353d379fa3d980a0", "max_stars_repo_licenses": ["MIT"], "max_sta... |
import numpy as np
def playerSkill(mu=None, sigma=None):
if (mu or sigma) == None:
return
assert(mu>0, "Player skill must be a positive real number")
else:
return np.random.normal(mu, sigma**2)
def playerPerformance(mu=None, beta=None):
assert(mu>0, "Player performance must be a posit... | {"hexsha": "e35943c248d8e2e0c1686c5bd45fe109675238aa", "size": 780, "ext": "py", "lang": "Python", "max_stars_repo_path": "2.Classic_TrueSkill/model.py", "max_stars_repo_name": "SkylakeXx/TrueSkill2", "max_stars_repo_head_hexsha": "ac9b29522c47882c6d9d55b1b934d6ce4c7e545a", "max_stars_repo_licenses": ["MIT"], "max_star... |
!---------------------------------------------------------------------!
! OWNER: Ithaca Combustion Enterprise, LLC !
! COPYRIGHT: © 2012, Ithaca Combustion Enterprise, LLC !
! LICENSE: BSD 3-Clause License (The complete text of the license can !
! be found in the `LICENSE-ICE.... | {"hexsha": "ad53ff87454fea203ccaf5ca396d4c130ce8b858", "size": 1888, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "src/isat/isatab_ser/isat_abort_ser.f90", "max_stars_repo_name": "xuhan425/isat_ffd", "max_stars_repo_head_hexsha": "3a5449f7e49b686c33fe0e97ca90ea8d92fc2f00", "max_stars_repo_licenses": ["MIT"],... |
# Copyright (c) 2020, Fabio Muratore, Honda Research Institute Europe GmbH, and
# Technical University of Darmstadt.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source ... | {"hexsha": "46c81409d7d74a91c17624885e1c01c5413cac43", "size": 20628, "ext": "py", "lang": "Python", "max_stars_repo_path": "Pyrado/pyrado/environments/pysim/quanser_ball_balancer.py", "max_stars_repo_name": "KhanhThiVo/SimuRLacra", "max_stars_repo_head_hexsha": "fdeaf2059c2ed80ea696f018c29290510b5c4cb9", "max_stars_re... |
"""
Vector mathematics functions.
"""
from numpy import array
SOUTH = [1, 0, 0]
WEST = [0, 1, 0]
UP = [0, 0, 1]
NORTH = [-1, 0, 0]
EAST = [0, -1, 0]
DOWN = [0, 0, -1]
def addVectors(v1, v2):
return list(array(v1) + array(v2))
def subtractVectors(v1, v2):
return list(array(v1) - array(v2))
def mu... | {"hexsha": "44da04db090ec492f4436f0bea12646cd9d91250", "size": 2071, "ext": "py", "lang": "Python", "max_stars_repo_path": "isomyr/util/vector.py", "max_stars_repo_name": "chrisonntag/Isomyr", "max_stars_repo_head_hexsha": "31eb90f0169a10d1079087ca689de76f600cc958", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_sta... |
# ---
# jupyter:
# jupytext:
# formats: ipynb,py:percent
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.5.2
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# %% [markdown]
# # A... | {"hexsha": "aca2f20d36c04e130b9c62a06d756323ded9a7f3", "size": 19311, "ext": "py", "lang": "Python", "max_stars_repo_path": "alternating_direction_implicit_method.py", "max_stars_repo_name": "smgill/Finite-Difference-Methods-for-PDEs", "max_stars_repo_head_hexsha": "51518d0073093f2d66459a1602184fb4dd82b844", "max_stars... |
\documentclass[openany]{./llncs2e/llncs}
\usepackage{graphicx}
\usepackage{multirow}
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{pifont}
\usepackage{pdflscape}
\usepackage{url}
\usepackage[table,xcdraw]{xcolor}
\usepackage{fixltx2e}
\usepackage{mathtools}
\usepackage{lmodern}
\usepackage{rotating}
\usepackag... | {"hexsha": "f18cf9de132955da7b1e86122dd07a783941ddcb", "size": 1999, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "report.tex", "max_stars_repo_name": "DiogoReisPinto/thesis-project", "max_stars_repo_head_hexsha": "7f706f0b1dbe467dd37e2d0984001e00fa6371e8", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
step = int((95900-88300+100)/100)
print (step)
a = list(range(88300, 95900, 77))
print (a[2])
a = [item / 100 for item in a]
print (a)
print (len(a))
import sys
sys.path.append("../")
from scipy.stats import linregress
from Whole_Movie_Check_Plots.Server_Movies_Paths import GetMovieFilesPaths
def Check100Percent(pe... | {"hexsha": "8ea6c267566ba0e4810c542251a550e78d8edb03", "size": 1316, "ext": "py", "lang": "Python", "max_stars_repo_path": "Biological_Questions/Cell_Density_Impacts/Check_100_Percent_Function.py", "max_stars_repo_name": "The-Kristina/CellComp", "max_stars_repo_head_hexsha": "29ec7690e0d9adb1a6214937ca41fd1dadce18c6", ... |
import numpy as np
import matplotlib.pyplot as plt
import random
import warnings
warnings.filterwarnings("ignore", category=FutureWarning)
# data
X = np.array([[15, 39], [15, 81], [16, 6], [16, 77], [17, 40], [17, 76], [18, 6], [18, 94], [19, 3], [19, 72], [19, 14], [19, 99], [20, 15], [20, 77], [20, 13], [20, 79], ... | {"hexsha": "b76aca1316c1f2a15586e525f6d10df812b27fc5", "size": 5434, "ext": "py", "lang": "Python", "max_stars_repo_path": "unsupervised_learning/clustering/mean_shift/sample_scratch.py", "max_stars_repo_name": "niektuytel/Machine_Learning", "max_stars_repo_head_hexsha": "0cd5656ca8076c383fd81c5e32a49969a20ad042", "max... |
import sys
import time
import numpy as np
import os
from pyspark import SparkContext
if __name__ == "__main__":
sc = SparkContext(appName="LR")
D = 10 # Number of dimensions
iterations = 20
N = 10
if len(sys.argv)>1:
N = int(sys.argv[1])
if len(sys.argv)>2:
iterations = int(s... | {"hexsha": "8887cc4f4a6b62ce54d5a230c115260588f07d92", "size": 1341, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/main/python/logistic_regression_gen.py", "max_stars_repo_name": "ehsantn/data-analytics-benchmarks", "max_stars_repo_head_hexsha": "db6ecf8c3e1d899a146ced47a8cc3e92b52fca69", "max_stars_repo_l... |
from typing import Union, Tuple, List
import numpy as np
import plotly.graph_objects as go
from garrus.core import BaseVisualization
class ReliabilityDiagram(BaseVisualization):
def __calc_statistics(
self, confidences: np.ndarray, accuracies: np.ndarray
) -> Tuple[List[float], List[float], List... | {"hexsha": "e32fd6b8b2fdc126dbc86bcb93d1fcee3572cbfe", "size": 2905, "ext": "py", "lang": "Python", "max_stars_repo_path": "garrus/visualizations/reliability_diagram.py", "max_stars_repo_name": "sleep3r/garrus", "max_stars_repo_head_hexsha": "28096ca0d6166117be23e740a68831396ba92a7e", "max_stars_repo_licenses": ["Apach... |
"""
aux_functions.py contains auxillary functions for tracking spatial provenance
"""
import numpy as np
import time
import os
import uuid
import random
# from numpy.core.numeric import allclose
def reset_array_prov(array, id = None):
if id == None:
id = uuid.uuid1()
for i in range(array.shape[0]):
... | {"hexsha": "6f63ded4edfd763ec5229bdbf4b7d2609bd444ac", "size": 772, "ext": "py", "lang": "Python", "max_stars_repo_path": "aux_functions.py", "max_stars_repo_name": "j2zhao/test-provenance", "max_stars_repo_head_hexsha": "321953e3a9854f004c3e450a57f0e7abe096e1f7", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_c... |
export solve_vf_all!
function solve_vf_all!(evs::dcdp_Emax, t::dcdp_tmpvars, p::dcdp_primitives, θt::AbstractVector, σ::Real, itype::Tuple, dograd::Bool; kwargs...)
solve_vf_terminal!(evs, p)
solve_vf_infill!( evs, t, p, θt, σ, dograd, itype; kwargs...)
learningUpdate!( evs, t, p, σ, dograd)
... | {"hexsha": "f05ae679d143c4d459acbc125d62b97cbf2c1e03", "size": 530, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/vf_solve_all.jl", "max_stars_repo_name": "magerton/ShaleDrillingModel.jl", "max_stars_repo_head_hexsha": "25c8845309603fafb19f406a7b065496078f01f4", "max_stars_repo_licenses": ["MIT"], "max_star... |
using FourierTools, BenchmarkTools
function main()
x = randn((133, 513, 33))
y = copy(x)
@btime $y .= real.(ifft(fft($x)));
@btime $y .= real.(ifft(ifftshift(fftshift(fft($x)))));
@btime $y .= real.(iffts(ffts($x)));
@btime $y .= real.(ift(ft($x)));
return
end
main()
| {"hexsha": "0a30a1604c28fb098eac54644c2b5ce5e944d480", "size": 299, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "examples/ft_helpers_benchmark.jl", "max_stars_repo_name": "bionanoimaging/FourierTools.jl", "max_stars_repo_head_hexsha": "c8a37c8f38b0b9897fac2be1bf3c1e109f844964", "max_stars_repo_licenses": ["MIT... |
import os
import numpy as np
import nltk
from nltk.corpus import stopwords
from collections import Counter
def extract_features_from(path, dictionary):
emails = [os.path.join(path, f) for f in os.listdir(path)]
features_matrix = np.zeros((len(emails), len(dictionary)))
labels = np.zeros(len(emails))
... | {"hexsha": "0680ef612185f99a377fab3930c67a529d0453e2", "size": 1447, "ext": "py", "lang": "Python", "max_stars_repo_path": "Enron/EnronSpam/ml_library.py", "max_stars_repo_name": "elliott-stroud/PySpam", "max_stars_repo_head_hexsha": "6ad477023628cf3781841dd541a22a5aa3b4c422", "max_stars_repo_licenses": ["Apache-2.0"],... |
"""
Module with reading functionalities of color and magnitude data from photometric and
spectral libraries.
"""
import os
import configparser
from typing import Optional, Tuple
import h5py
import numpy as np
from typeguard import typechecked
from species.core import box
from species.read import read_spectrum
from... | {"hexsha": "3b3ee1d6c082dc69b60bab96d107a86c451c72fd", "size": 12938, "ext": "py", "lang": "Python", "max_stars_repo_path": "species/read/read_color.py", "max_stars_repo_name": "vandalt/species", "max_stars_repo_head_hexsha": "527dd900a60c4d691bd490569cd3b2007f9beead", "max_stars_repo_licenses": ["MIT"], "max_stars_cou... |
\chapter{Guidelines on the preparation of theses} \label{ch-1}
These guidelines set out the organization and formatting requirements of the OIST PhD thesis, in order to assist students in the preparation of theses for submission. The academic requirements of the thesis are defined in the PRP in section 5.3.13, while ... | {"hexsha": "038994c3d2c010180e08b2dc6486146c39cfa4f4", "size": 13893, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "PhD Thesis/MainText/chapter1.tex", "max_stars_repo_name": "aisulu-maipas/LaTeX-templates", "max_stars_repo_head_hexsha": "f81a7bc2bcbd496d554b7cc6bc8ee30bb60b9254", "max_stars_repo_licenses": ["MIT... |
module OnlineEstimators
include("parameter_estimators.jl")
include("state_estimators.jl")
end | {"hexsha": "0dbfdf95f0a54f6c8cfb34f40a50d7e07ed5c31d", "size": 95, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/OnlineEstimators/OnlineEstimators.jl", "max_stars_repo_name": "jonniedie/ControlSimTools.jl", "max_stars_repo_head_hexsha": "6f9b390924dd23f2c905fc3735ed3177e01914f5", "max_stars_repo_licenses": ... |
#! /usr/bin/env python3
import click
import os
import shutil
import fileinput
import subprocess
import re
import numpy as np
from natsort import natsorted
import pandas as pd
from pandas import DataFrame
import csv
from pathlib import Path
def make_cutoff_folders(path_cutoff, einputs):
""" Make cutoff folders
... | {"hexsha": "ef4de2fa8db91bfc888a89e8f71f650addf79735", "size": 3202, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/convtest/conv_setup.py", "max_stars_repo_name": "warda-rahim/ConvTest", "max_stars_repo_head_hexsha": "5f999baa2c7781abf5d3be9f10bffa60b01e7c9c", "max_stars_repo_licenses": ["MIT"], "max_sta... |
using Printf
# @todo does Node need to be mutable?
mutable struct Node
visit_count::Int32
prior::Float32
value_sum::Float32
children::Dict{Int32,Node}
hidden_state::Union{Nothing,AbstractArray{Float32, 3}}
reward::Float32
info::String
state::AbstractEnvState # @todo - remove state altog... | {"hexsha": "889618873a01d267f850f3bcd73216b5c7f4db8e", "size": 4177, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/node.jl", "max_stars_repo_name": "JuliaRL/MuZero.jl", "max_stars_repo_head_hexsha": "2fcb23e8d5b49b6030987f2441f6b7157c3c7601", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, "max_st... |
from __future__ import print_function
import sys
import time
import numpy as np
from itertools import chain
from genomic_neuralnet.common.base_compare import try_predictor
from genomic_neuralnet.config import REQUIRED_MARKER_CALL_PROPORTION, \
REQUIRED_MARKERS_PER_SAMPLE_PROP
fr... | {"hexsha": "ab9a1761b38b228b7fe97918f1a7f9d87af74249", "size": 6342, "ext": "py", "lang": "Python", "max_stars_repo_path": "genomic_neuralnet/common/parallel_predictors.py", "max_stars_repo_name": "lambdaman/genomic-neuralnet", "max_stars_repo_head_hexsha": "67ed4f55dc8d5fefb1d9e3a9fc920a0b643fe9c9", "max_stars_repo_li... |
import numpy as np
from tqdm.auto import tqdm
import matplotlib.pyplot as plt
import pandas as pd
from argent.live_plot import LivePlot
class Sweep:
def __init__(self, client, x, start, stop, steps, averages=1, sweeps=1, plot=None, legend=None):
''' Run a sweep across one or more variables.
Arg... | {"hexsha": "aa93fd85d539f81b1633c85326d2ec802bdaeb39", "size": 2517, "ext": "py", "lang": "Python", "max_stars_repo_path": "argent/sweep.py", "max_stars_repo_name": "robertfasano/argent", "max_stars_repo_head_hexsha": "49a779e54063ad4f6432b78d1f8070d2f0a932a7", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nul... |
# coding=utf-8
'''
@ Summary: 获取wav音频数据
@ Update: 1.0.2 计算wav的mfcc数据
@ file: get_output_from_network.py
@ version: 2.0.0 获取cnn 网络的中间变量并输出
@ version: 2.0.1 代码重构
@ version: 2.0.2 保存每一个层输出的最大值和最小值
@ Date: 2020/05/27
需要对批量数据推理时的每一层的输出;
CNN好像出了点玄学问题,转到office_get_layers_output.py 继续更新
@ A... | {"hexsha": "fd852f576e6f4762bdab1e7b00e1c42a0b09e3ea", "size": 5887, "ext": "py", "lang": "Python", "max_stars_repo_path": "utils/get_output_from_network.py", "max_stars_repo_name": "Lebhoryi/ML-KWS-for-MCU", "max_stars_repo_head_hexsha": "47316dafb1cfbb8ead3e049cc846bdb45f3e7995", "max_stars_repo_licenses": ["Apache-2... |
import unittest
import numpy as np
from abcpy.backends import BackendDummy
from abcpy.continuousmodels import Normal
from abcpy.continuousmodels import Uniform
from abcpy.inferences import DrawFromPrior
from abcpy.output import Journal, GenerateFromJournal
class JournalTests(unittest.TestCase):
# def test_add_p... | {"hexsha": "347cad3bf89a0765a8f2dfca1b9c17bb64659d3e", "size": 18317, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/output_tests.py", "max_stars_repo_name": "vishalbelsare/abcpy", "max_stars_repo_head_hexsha": "72d0d31ae3fa531b69ea3fef39c96af6628ee76f", "max_stars_repo_licenses": ["BSD-3-Clause-Clear"], ... |
[STATEMENT]
lemma isolated_verts_app_iso[simp]:
"pre_digraph.isolated_verts (app_iso hom G) = iso_verts hom ` isolated_verts"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. pre_digraph.isolated_verts (app_iso hom G) = iso_verts hom ` isolated_verts
[PROOF STEP]
using hom
[PROOF STATE]
proof (prove)
using this:
d... | {"llama_tokens": 234, "file": "Planarity_Certificates_Planarity_Graph_Genus", "length": 2} |
[STATEMENT]
lemma disj_assoc:"(((P::'\<alpha> predicate) \<or> Q) \<or> S) = (P \<or> (Q \<or> S))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. ((P \<or> Q) \<or> S) = (P \<or> Q \<or> S)
[PROOF STEP]
by (rule ext) blast | {"llama_tokens": 109, "file": "Circus_Relations", "length": 1} |
import math
import numpy as np
import torch
from torch.utils.data.sampler import Sampler
__all__ = ["DistSequentialSampler"]
class DistSequentialSampler(Sampler):
def __init__(self, dataset, world_size, rank):
assert rank >= 0
assert dataset.num >= world_size, '{} vs {}'.format(dataset.size, wor... | {"hexsha": "543b89b041711163f2953935aac19256f6237f66", "size": 790, "ext": "py", "lang": "Python", "max_stars_repo_path": "datasets/sampler.py", "max_stars_repo_name": "ardihikaru/hfsoftmax", "max_stars_repo_head_hexsha": "55966f3a902c16df9b1ca93a77c5cd43efd47fd9", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
(*
Title: The pi-calculus
Author/Maintainer: Jesper Bengtson (jebe.dk), 2012
*)
theory Strong_Late_Expansion_Law
imports Strong_Late_Bisim_SC
begin
nominal_primrec summands :: "pi \<Rightarrow> pi set" where
"summands \<zero> = {}"
| "summands (\<tau>.(P)) = {\<tau>.(P)}"
| "x \<sharp> a \<Longrightarro... | {"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/Pi_Calculus/Strong_Late_Expansion_Law.thy"} |
(* In this file we explain how to do the "list examples" from the
Chapter on Separation Logic for Sequential Programs in the
Iris Lecture Notes *)
(* Contains definitions of the weakest precondition assertion, and its basic rules. *)
From iris.program_logic Require Export weakestpre.
(* Instantiation of Iris w... | {"author": "pavel-ivanov-rnd", "repo": "iris_tutorial", "sha": "da37eb4017e059abd357da1ebf8c0da440efefdc", "save_path": "github-repos/coq/pavel-ivanov-rnd-iris_tutorial", "path": "github-repos/coq/pavel-ivanov-rnd-iris_tutorial/iris_tutorial-da37eb4017e059abd357da1ebf8c0da440efefdc/Coq_examples/lists.v"} |
"""Match subregions within beat-chroma matrices.
2016-04-09 Dan Ellis dpwe@ee.columbia.edu
"""
"""
Plan:
- read in beat-chroma matrix
- break into 32 beat segments every ?8 beats
- take 2DFTM
- PCA down to ? 8 dimensions
- build (8752*100), 8 matrix = 28 MB of float32
- find closest match to query
"""
impor... | {"hexsha": "9a55cc657196764234575229537f31e356516c75", "size": 3808, "ext": "py", "lang": "Python", "max_stars_repo_path": "prac_matchchroma/match_chroma.py", "max_stars_repo_name": "dpwe/elene4896", "max_stars_repo_head_hexsha": "49e64315b7cd0da45449835d6e73f868e9b4268e", "max_stars_repo_licenses": ["MIT"], "max_stars... |
"""Temperature convertor between Celcius, Fahrenheit and Kelvin"""
# This code is part of a class assignment for ATMS 597, Spring 2020,
# at the University of Illinois at Urbana Champaign.
# Use this class function to convert temperature data from already
# known units to different units.
# It supports conversion to Ce... | {"hexsha": "ae7cc4df61a6796236c00ead33e9851eb57f0b17", "size": 8723, "ext": "py", "lang": "Python", "max_stars_repo_path": "ATMS-597-SP-2020-Project-1/modules/tempconvert.py", "max_stars_repo_name": "szymbor2/ATMS-597-SP-2020", "max_stars_repo_head_hexsha": "9d55e93d8c1ee0980181421d6b430a7876e0dcbb", "max_stars_repo_li... |
[STATEMENT]
lemma in_Def_valid_SDG_node:
"V \<in> Def\<^bsub>SDG\<^esub> n \<Longrightarrow> valid_SDG_node n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. V \<in> Def\<^bsub>SDG\<^esub> n \<Longrightarrow> valid_SDG_node n
[PROOF STEP]
by(induct rule:SDG_Def.induct,auto intro:valid_SDG_CFG_node) | {"llama_tokens": 133, "file": "HRB-Slicing_StaticInter_SDG", "length": 1} |
import tensorflow as tf
import numpy as np
# feature_map = feature_inference(image_tensor)
# rpn_loss_bbox_tensor = rpn_loss_bbox(feature_map, im_info_tensor, boxes_tensor)
# rpn_cls_loss()
# rpn_rois_tensor = rpn_rois()
# roi_pool_tensor = roi_pool(rpn_rois_tensor)
x = tf.placeholder(dtype=tf.float32)
p_op = tf.Pri... | {"hexsha": "fc660f29e41a5a24f7a26c8a3cdf2433c6f84b88", "size": 498, "ext": "py", "lang": "Python", "max_stars_repo_path": "image_interpreter/train.py", "max_stars_repo_name": "ThoughtWorksInc/tf-image-intepreter", "max_stars_repo_head_hexsha": "113fc808a081984c8be4814bc3403b908bb6b2c6", "max_stars_repo_licenses": ["MIT... |
"""
This is a demo of VQE through the forest stack. We will do the H2 binding from the Google paper using
OpenFermion to generate Hamiltonians and Forest to simulate the system
"""
import sys
import numpy as np
import matplotlib.pyplot as plt
from scipy.optimize import minimize # for real runs I recommend using ADA... | {"hexsha": "f3abd9f4854d9e5f301ab65f3b9dbf3a9686a1b7", "size": 5184, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/1.3_vqe_demo.py", "max_stars_repo_name": "kalzoo/pyquil", "max_stars_repo_head_hexsha": "f37d55acb906a02c0f3320ee3990e9051ee64145", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_c... |
#!/usr/bin/env python
import os, sys, glob
sys.path.append('../')
import scipy
from scipy.linalg import pinv
import numpy as np
import matplotlib
from pylab import *
from RateSpecClass import *
from RateSpecTools import *
from PlottingTools import *
# For nice plots :)
matplotlib.use('Agg')
import matplotlib.pypl... | {"hexsha": "b819c564f81230e4b0e588de5e7931b6d9ea9d3d", "size": 6415, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/Figure3/plotFigure3.py", "max_stars_repo_name": "vvoelz/ratespec", "max_stars_repo_head_hexsha": "fa76c867cf9485799c7075f69f3385d95eb0e797", "max_stars_repo_licenses": ["MIT"], "max_stars... |
import asyncio
import glob
import os
from os.path import join
import cv2
import numpy as np
import pydicom as pyd
import pyinotify
from keras.models import load_model
def make_predictition(image, model_path='/home/haimin/PycharmProjects/Tensorflow/ddsm_YaroslavNet_s10.h5'):
image = pyd.dcmread(image).pixel_array... | {"hexsha": "b2b8ee56c12943b17423191f6f988eb472df3422", "size": 6692, "ext": "py", "lang": "Python", "max_stars_repo_path": "mvp.py", "max_stars_repo_name": "Kazanova85/M-Project", "max_stars_repo_head_hexsha": "d4a26b96a9711c41d0892c3a562926c3694d2d62", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_... |
"""Geometry Module"""
import numpy as np
from geometry_msgs.msg import Point
from scipy import spatial
def norm_to_pixel(normalized_point, res_x, res_y):
"""Convert normalized point to point in pixel coordinates"""
if (
normalized_point.x > 1
or normalized_point.x < 0
or normalized_po... | {"hexsha": "db0dfa4ab64563fa70cd697c01c2c2443104a2a6", "size": 2680, "ext": "py", "lang": "Python", "max_stars_repo_path": "gaze_detector/src/gaze_detector/geometry.py", "max_stars_repo_name": "hofbi/driver-awareness", "max_stars_repo_head_hexsha": "c16edc6b1ed26c252959ab85bbc33fe4f5598424", "max_stars_repo_licenses": ... |
"""
Code to plot fancy-looking TS maps, used in pipeline
$Header: /nfs/slac/g/glast/ground/cvs/pointlike/python/uw/like/tsmap_plotter.py,v 1.4 2011/02/21 00:42:49 lande Exp $
"""
import math, os
import numpy as np
from uw.utilities import image
from uw.like import roi_localize, roi_managers
from skymaps import SkyDir... | {"hexsha": "c29452c676fe501d800bf926c0bb0f3b35581e87", "size": 5332, "ext": "py", "lang": "Python", "max_stars_repo_path": "python/uw/like/tsmap_plotter.py", "max_stars_repo_name": "tburnett/pointlike", "max_stars_repo_head_hexsha": "a556f07650c2f17d437c86fdafe9f9a33f59758e", "max_stars_repo_licenses": ["BSD-3-Clause"]... |
[STATEMENT]
lemma Koszul_syz_sigs_auxE:
assumes "v \<in> set (Koszul_syz_sigs_aux bs k)"
obtains i j where "i < j" and "j < length bs"
and "v = ord_term_lin.max (term_of_pair (punit.lt (bs ! i), k + j)) (term_of_pair (punit.lt (bs ! j), k + i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. (\<And>i j. \<lb... | {"llama_tokens": 7411, "file": "Signature_Groebner_Signature_Groebner", "length": 51} |
#!/usr/bin/python3
from gi.repository import Gtk
from matplotlib.figure import Figure
from numpy import sin, cos, pi, linspace
#Possibly this rendering backend is broken currently
#from matplotlib.backends.backend_gtk3agg import FigureCanvasGTK3Agg as FigureCanvas
from matplotlib.backends.backend_gtk3cairo import Fig... | {"hexsha": "6bd5183675173ed658b34a6ea5eb56fc0081d83d", "size": 1931, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/mpl-ntb-glade.py", "max_stars_repo_name": "tobias47n9e/GTK3-Matplotlib-Cookbook", "max_stars_repo_head_hexsha": "fea42a040e9e358740b3bda04c38ea164ff79b2d", "max_stars_repo_licenses": ["MI... |
import argparse
import os
import time
import datetime
import sys
import json
import yaml
import tensorflow as tf
import numpy as np
import src.core as core
import src.retina_net.experiments.validation_utils as val_utils
from src.retina_net import config_utils
from src.core import constants
from src.retina_net.builde... | {"hexsha": "955b7d601eb778fd55eb20e6f22c25cd04519991", "size": 12569, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/retina_net/experiments/run_validation.py", "max_stars_repo_name": "asharakeh/bayes-od-rc", "max_stars_repo_head_hexsha": "3f478e5c9a593ee03d7b63d533d46d87d739fc26", "max_stars_repo_licenses":... |
import numpy as np
import torch
from elegantrl.agents.net import ActorPPO, ActorDiscretePPO, CriticPPO, SharePPO
from elegantrl.agents.AgentBase import AgentBase
from typing import Tuple
"""[ElegantRL.2021.12.12](github.com/AI4Fiance-Foundation/ElegantRL)"""
class AgentPPO(AgentBase):
"""
Bases: ``AgentBase`... | {"hexsha": "8aa9474a202521cd624f9d52667321113a96d380", "size": 15217, "ext": "py", "lang": "Python", "max_stars_repo_path": "elegantrl/agents/AgentPPO.py", "max_stars_repo_name": "ihopethiswillfi/ElegantRL-1", "max_stars_repo_head_hexsha": "b81052a0bc6802443eb0f653c69158396b613b00", "max_stars_repo_licenses": ["Apache-... |
import os
import sys
import pathlib
sys.path.append(str(pathlib.Path(__file__).parent.absolute()) + "/../")
from animation.experiment1_animation import create_ani_expe_1a
from csv_modules.csv_combine import combine_files_exp_1
from fit.fit_map_chimeraX import fit_map_in_map
from reconstruction.semi_exact_cover import ... | {"hexsha": "0fdb21f31fdee54a1275766412bdeddf4155a277", "size": 22878, "ext": "py", "lang": "Python", "max_stars_repo_path": "reconstruction/main/main.py", "max_stars_repo_name": "tecdatalab/biostructure", "max_stars_repo_head_hexsha": "a30e907e83fa5bbfb934d951b7c663b622104fcc", "max_stars_repo_licenses": ["Apache-2.0"]... |
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Description
#
# Tests of colors.
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
@testset "Default color" begin
expected = """
┌────────┬────────┬────────┬────────┐
│\e[1m Col. 1 \e[0m│\e[1m Col... | {"hexsha": "cdf523eb884e715bdcf6881e245877fc16aad8ba", "size": 20124, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/text_backend/colors.jl", "max_stars_repo_name": "waldyrious/PrettyTables.jl", "max_stars_repo_head_hexsha": "5aea4f21b5a51ce8e160de88ffe7c12838a71f5f", "max_stars_repo_licenses": ["MIT"], "ma... |
[STATEMENT]
lemma akra_bazzi_term_floor_subtract [akra_bazzi_term_intros]:
assumes "(b::real) > 0" "b < 1" "real x\<^sub>0 \<le> b * real x\<^sub>1 - c" "0 < c + (1 - b) * real x\<^sub>1" "x\<^sub>1 > 0"
shows "akra_bazzi_term x\<^sub>0 x\<^sub>1 b (\<lambda>x. nat \<lfloor>b*real x - c\<rfloor>)"
[PROOF STATE]
p... | {"llama_tokens": 245, "file": "Akra_Bazzi_Akra_Bazzi", "length": 1} |
[STATEMENT]
lemma foldl_prs_aux:
assumes a: "Quotient3 R1 abs1 rep1"
and b: "Quotient3 R2 abs2 rep2"
shows "abs1 (foldl ((abs1 ---> abs2 ---> rep1) f) (rep1 e) (map rep2 l)) = foldl f e l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. abs1 (foldl ((abs1 ---> abs2 ---> rep1) f) (rep1 e) (map rep2 l)) = fol... | {"llama_tokens": 198, "file": null, "length": 1} |
""" The U.S. Standard Atmosphere 1966 depicts idealized middle-latitude
year-round mean conditions for the range of solar activity that occurs between
sunspot minimum and sunspot maximum.
+--------+---------+---------+-----------+---------------+---------------+
| Z (km) | H (km) | T (K) | p (mbar) | rho (kg / m3)... | {"hexsha": "1488b5937c8a774bb72f439e500c3695a1ac6bdd", "size": 9271, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/poliastro/atmosphere/coesa62.py", "max_stars_repo_name": "noc0lour/poliastro", "max_stars_repo_head_hexsha": "c3010318446a7b9efa22f01bd1ff603ccce53273", "max_stars_repo_licenses": ["MIT"], "ma... |
import numpy as np
import torch
import cv2
def reshape_patch(img_tensor, patch_size):
assert 4 == img_tensor.ndim
seq_length = np.shape(img_tensor)[0]
img_height = np.shape(img_tensor)[1]
img_width = np.shape(img_tensor)[2]
num_channels = np.shape(img_tensor)[3]
a = np.reshape(img_tensor, [seq... | {"hexsha": "760373c5f01dba53f8ba3e4e859e9a5349091d28", "size": 3520, "ext": "py", "lang": "Python", "max_stars_repo_path": "core/utils/preprocess.py", "max_stars_repo_name": "ZhengChang467/MAU", "max_stars_repo_head_hexsha": "9e5461cfbacf20cc4323839730f06a9c09d98187", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
/-
Copyright (c) 2017 Johannes Hölzl. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johannes Hölzl
! This file was ported from Lean 3 source module algebra.big_operators.basic
! leanprover-community/mathlib commit c227d107bbada5d0d9d20287e3282c0a7f1651a0
! Please do ... | {"author": "leanprover-community", "repo": "mathlib4", "sha": "b9a0a30342ca06e9817e22dbe46e75fc7f435500", "save_path": "github-repos/lean/leanprover-community-mathlib4", "path": "github-repos/lean/leanprover-community-mathlib4/mathlib4-b9a0a30342ca06e9817e22dbe46e75fc7f435500/Mathlib/Algebra/BigOperators/Basic.lean"} |
# Autogenerated wrapper script for LCIO_Julia_Wrapper_jll for i686-linux-gnu-cxx11-julia_version+1.6.0
export lciowrap
using libcxxwrap_julia_jll
using LCIO_jll
JLLWrappers.@generate_wrapper_header("LCIO_Julia_Wrapper")
JLLWrappers.@declare_library_product(lciowrap, "liblciowrap.so")
function __init__()
JLLWrapper... | {"hexsha": "9019b3b726c89a44ee38d21226605e7cf18d4198", "size": 563, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/wrappers/i686-linux-gnu-cxx11-julia_version+1.6.0.jl", "max_stars_repo_name": "JuliaBinaryWrappers/LCIO_Julia_Wrapper_jll.jl", "max_stars_repo_head_hexsha": "150ae6aceec2508c9ded41f0221e3df7622b... |
#' Metabolite set enrichment analysis (MSEA) using pathway knowledge curated by Metabolon
#'
#' A function that returns the pathway enrichment score for all perturbed metabolites in a patient's full metabolomic profile.
#' @param abs_filename_dataset - Relative or absolute path to relevant .gct file.
#' ... | {"hexsha": "00d94b9c943192dc2b4bf36eed035e3158e60af1", "size": 66659, "ext": "r", "lang": "R", "max_stars_repo_path": "R/stats.getMSEA_Metabolon.r", "max_stars_repo_name": "areyoujokingme/CTD", "max_stars_repo_head_hexsha": "de702c01f5f69cce287f201fe5f233a30f4d7aae", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
Horner <- function(Coef_Polinomio, x0) {
# Creación de la función,
#recibe los coeficientes del polinomio
#y el punto a evaluar.
TerminoInd <- Coef_Polinomio[1]
Coef_Polinomio <- Coef_Polinomio[-1]
#Guarda el término de independiente en una
#variable aparte de los coeficientes que
#acompañan algún v... | {"hexsha": "1d49cbbb7116c9f493ee084b7523b866154a4a19", "size": 7487, "ext": "r", "lang": "R", "max_stars_repo_path": "Reto_1_Analisis.R.r", "max_stars_repo_name": "juanmendezp/Analisis-Numerico", "max_stars_repo_head_hexsha": "800851f1cfe8ce84945be8eb8ebad297f317cd6b", "max_stars_repo_licenses": ["CC0-1.0"], "max_stars... |
[STATEMENT]
lemma (in aGroup) nt_mult_assoc:"sfg A a \<Longrightarrow> m\<triangleright>n\<triangleright>a\<^bsub>A\<^esub>\<^bsub>A\<^esub> = (m * n)\<triangleright>a\<^bsub>A\<^esub>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. sfg A a \<Longrightarrow> m\<triangleright>n\<triangleright>a\<^bsub>A\<^esub>\<^bsu... | {"llama_tokens": 468, "file": "Group-Ring-Module_Algebra9", "length": 4} |
\documentclass[a4paper,titlepage,openany]{article}
\usepackage{epsfig,amsmath,pifont,moreverb,multirow,multicol}
%\usepackage[scaled=.92]{helvet}
%\usepackage{newcent}
%\usepackage{bookman}
%\usepackage{utopia}
%\usepackage{avant}
%\usepackage{charter}
%\usepackage{mathpazo}
\renewcommand{\familydefault}{\sfdefault}
... | {"hexsha": "260df331f3dcc406981b0bdb9623d7d522b4d4ef", "size": 29370, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "thirdparty/spm12/man/ReleaseNotes.tex", "max_stars_repo_name": "spunt/bspm", "max_stars_repo_head_hexsha": "4a1b6510cb32db6e2e4dff57bb81e6ece993f9db", "max_stars_repo_licenses": ["MIT"], "max_stars... |
\section{Tables, Figures, and Code listlings}
\subsection{Tables}
\begin{frame}{An example table}
\begin{table}[t]
\begin{tabular}{ccr}
\toprule
First Name & Last Name & Date of Birth \\
\midrule
John & Doe & 3/12/1920 \\
Peter & Smith & 6/5/1967 \\
J... | {"hexsha": "f78c52f4152a15b9b4f1df8e2c72e2154795136b", "size": 1254, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "contents/floats-listlings.tex", "max_stars_repo_name": "elsa-lab/ELSAbeamer", "max_stars_repo_head_hexsha": "e10cc73a4945fd302afcb422b874159c173fdaff", "max_stars_repo_licenses": ["MIT"], "max_stars... |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
# Copyright 2021 Giovanni Dispoto
#
# 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
... | {"hexsha": "53a41ecbc9b1119d430ec5ac99af71a6106f3592", "size": 8804, "ext": "py", "lang": "Python", "max_stars_repo_path": "apps/tf/slim/datasets/download_and_convert_vqa.py", "max_stars_repo_name": "giovannidispoto/a-GPUBench", "max_stars_repo_head_hexsha": "2332fb68247cad347f889c006028385fed4c5c93", "max_stars_repo_l... |
import cv2
import os
import numpy as np
import time
import sys
from argos_common import ARGOS_CONFIG, ARGOS_HOME, load_config
if __name__ == "__main__":
feed = cv2.VideoCapture(0)
config = load_config(ARGOS_CONFIG, "embeddingsExtractor")
if len(sys.argv) > 1:
label = sys.argv[1]
else:
l... | {"hexsha": "226c0438d42da9ec274571d53c186ba6209fc7be", "size": 1938, "ext": "py", "lang": "Python", "max_stars_repo_path": "Source/argos_utils/take_user_photos.py", "max_stars_repo_name": "Toasthat/Argos", "max_stars_repo_head_hexsha": "3277afb5337224e376cf640a5c94baa0d813b9bb", "max_stars_repo_licenses": ["Apache-2.0"... |
import matplotlib.pyplot as plt
import numpy as np
from sklearn import datasets
from util_plot import AddPlot
is_3d = True
ax, point_dim = AddPlot(is_3d).returns
# import some data to play with
iris = datasets.load_iris()
X = iris.data[:, :point_dim] # we only take the first point_dim features.
y = iris.target
if i... | {"hexsha": "1baa0139bdee8568727a3d3445decb206c9c854b", "size": 1443, "ext": "py", "lang": "Python", "max_stars_repo_path": "iris_knn.py", "max_stars_repo_name": "culdo/NPTU_AI_course", "max_stars_repo_head_hexsha": "43cc227cbf85b442d4865fdf6985fe9f675fe476", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, ... |
#' WARC-ify an httr::GET request
#'
#' Automagically writes out the result of an `httr::GET` request to an open
#' WARC file connection enabling seamless recording/caching of the response
#' for later re-use.
#'
#' @md
#' @param wobj WARC file object
#' @param url the url of the page to retrieve
#' @param ... Further n... | {"hexsha": "12b89f5d31643e0e0ce682b3ddb8aa78598419ed", "size": 4481, "ext": "r", "lang": "R", "max_stars_repo_path": "R/warc-wrappers.r", "max_stars_repo_name": "hrbrmstr/jwatr", "max_stars_repo_head_hexsha": "2acf0082d8f4bc40ea335f0ed6dfffa3d24640ce", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count": 7, "m... |
import unittest
import numpy.testing as testing
import numpy as np
import healpy as hp
import tempfile
import shutil
import os
import pytest
import healsparse
class HealSparseCoverageTestCase(unittest.TestCase):
def test_read_fits_coverage(self):
"""
Test reading healSparseCoverage from a fits fi... | {"hexsha": "f5919683997ae7e80fffb7afa15957fe669f51ee", "size": 3735, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_healSparseCoverage.py", "max_stars_repo_name": "LSSTDESC/healsparse", "max_stars_repo_head_hexsha": "f6b15f570ab6335328e34006f69c3919d9fcf1c8", "max_stars_repo_licenses": ["BSD-3-Clause... |
import os
import numpy as np
import pandas as pd
from multiprocessing import Pool
from matplotlib.dates import num2date, date2num
import datetime as dt
import sys
sys.path.append("./")
sys.path.append("create_plots/")
import utils
def to_probability(row, o=pd.DataFrame(), region_map=[]):
e = np.rint(row["elv"])... | {"hexsha": "a5ba39e5cb4c8ed99e365d525620ca819c1b05d0", "size": 5193, "ext": "py", "lang": "Python", "max_stars_repo_path": "analysis/create_plots/simple_elev_range_model.py", "max_stars_repo_name": "shibaji7/clustering_superdarn_data", "max_stars_repo_head_hexsha": "02bc31dd85f66319bb46b632e0e7ac51ed98c432", "max_stars... |
# Copyright (c) 2013 Jasper den Ouden, under the MIT license,
# see doc/mit.txt from the project directory.
using Treekenize
#Generates a random tree into stdout and returns the same list for later comparison.
function rnd_tree(to_stream::IOStream, p::Number, depth::Integer,max_len::Integer, begin_end)
list = {... | {"hexsha": "a099530d7d8a8b38a6a3f7793f1999c6ad653431", "size": 2769, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/test/treekenize.jl", "max_stars_repo_name": "o-jasper/Treekenize.jl", "max_stars_repo_head_hexsha": "d8521c7faaeaf5684dba3453859068c5f66896aa", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
#' Oggetto sf della regione sicilia
#'
"sicilia" | {"hexsha": "78cadece86a00e82f3e32a8639a38e7e91d2163b", "size": 48, "ext": "r", "lang": "R", "max_stars_repo_path": "R/sicilia.r", "max_stars_repo_name": "guidofioravanti/regioniItalia", "max_stars_repo_head_hexsha": "5607ce1334f1dffa4e30e3ee9721dbde01d86477", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null,... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os, sys
import glob
import random
import time
import pdb
# import imgaug
# from imgaug import augmenters as iaa
from PIL import Image
from tqdm import tqdm
import numpy as np
from six.moves import range... | {"hexsha": "968a0083121a38f64e03d68511a6d57e12ae755c", "size": 8093, "ext": "py", "lang": "Python", "max_stars_repo_path": "maskrcnn_benchmark/data/datasets/train_loader.py", "max_stars_repo_name": "Sreehari-S/mask-rcnn-benchmark", "max_stars_repo_head_hexsha": "b4434c39fccda80575276308da86b6e944540445", "max_stars_rep... |
# -*- coding: utf-8 -*-
""" Binary data class for crowdsourced training data.
"""
# metadata variables
__author__ = "Hiroshi KAJINO <hiroshi.kajino.1989@gmail.com>"
__date__ = "2013/12/15"
__version__ = "1.0"
__copyright__ = "Copyright (c) 2013 Hiroshi Kajino all rights reserved."
__docformat__ = "restructuredtext en"... | {"hexsha": "c409e41e280920f324a6359ef9ffe8edb40c7f41", "size": 3005, "ext": "py", "lang": "Python", "max_stars_repo_path": "post_process_for_instance_clipping_protocol/crowd_data.py", "max_stars_repo_name": "kanojikajino/instance_privacy", "max_stars_repo_head_hexsha": "6b48f989b53631d35179afe04a7e38d59d767421", "max_s... |
import numpy as np
import cv2
import sys
# Update path to the Haar cascades file if necessary, e.g. if OpenCV version is different
faceCascadeFile = '/usr/local/opt/opencv/share/opencv4/haarcascades/haarcascade_frontalface_default.xml'
faceCascade = cv2.CascadeClassifier(faceCascadeFile)
if faceCascade.empty(): raise ... | {"hexsha": "5eab3304538aacedbd4bff24ccc509bb083ef015", "size": 873, "ext": "py", "lang": "Python", "max_stars_repo_path": "detection.py", "max_stars_repo_name": "estherjk/pyenv-opencv", "max_stars_repo_head_hexsha": "61d4202332ca58ce199daa54d2835d8a078cc592", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 5, "m... |
import numpy as np
if __name__ == "__main__":
w_oI = np.array([0, 0, (np.pi / 180) / (24 * 60**2)]).reshape((3, 1))
w_hB = np.array([0])
| {"hexsha": "bc7c0db063bb4d8a87bf3e29080f79a6283d4205", "size": 148, "ext": "py", "lang": "Python", "max_stars_repo_path": "python/rotations.py", "max_stars_repo_name": "msc5/attitudes", "max_stars_repo_head_hexsha": "89a3ab7aaf98e4985f1e0e6ac7e353a0798d677f", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null,... |
using CoordinateTransformations, Rotations, StaticArrays
using RoboLib.Geom: Pose2D
export AckerParams, AckerData
struct AckerParams{SCALAR<:AbstractFloat} <: MotionParams
car_length::SCALAR
end
mutable struct AckerData{T} <: MotionData
pose::Pose2D{T}
ctrl::SVector{2, T}
# TODO(cxs): special case
... | {"hexsha": "cd1bb10cd7bf0d0b646f81c49590ac96a6c2d71b", "size": 1916, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/MotionModels/ackermann.jl", "max_stars_repo_name": "prl-mushr/mushr_pf.jl", "max_stars_repo_head_hexsha": "e8837cd8d58875ecab11fe76bc707a31dd57a39b", "max_stars_repo_licenses": ["BSD-3-Clause"]... |
import os, sys, random
import numpy as np
import PIL
from PIL import Image
def get_lbl_from_name(fname):
lbl = int(fname.split('.png')[0][-1])
return lbl | {"hexsha": "0fa5aac468bfd039363a69751752339ce9378a9d", "size": 162, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/gen_utils.py", "max_stars_repo_name": "Abhishekq10/TB-detection", "max_stars_repo_head_hexsha": "83c14223bbf7f07448fd10e3e5531fec7d2a7d44", "max_stars_repo_licenses": ["MIT"], "max_stars_count"... |
[STATEMENT]
lemma AbsNat_zero [simp]: "AbsNat 0 + i = i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. AbsNat 0 + i = i
[PROOF STEP]
by (simp add: plus_Nat_def) | {"llama_tokens": 80, "file": "RefinementReactive_Temporal", "length": 1} |
import os
import os.path as op
import re
from setuptools import setup
import numpy as np
cmdclass = { }
ext_modules = [ ]
# Find the version.
curdir = op.dirname(op.realpath(__file__))
filename = op.join(curdir, 'klustaviewa/__init__.py')
with open(filename, 'r') as f:
version = re.search(r"__ver... | {"hexsha": "82b46ffef870cb57dc6fa5e4ad0cbad79f5817bf", "size": 1908, "ext": "py", "lang": "Python", "max_stars_repo_path": "setup.py", "max_stars_repo_name": "adehad/klustaviewa", "max_stars_repo_head_hexsha": "d1cf3ddb341f5cc6273771a20f40e1f4cc9b31d1", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_count": 20... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.