text stringlengths 0 1.25M | meta stringlengths 47 1.89k |
|---|---|
import pathlib
import pandas as pd
from palmnet.visualization.utils import get_palminized_model_and_df, get_df
import matplotlib.pyplot as plt
import numpy as np
import logging
import plotly.graph_objects as go
import plotly.express as px
mpl_logger = logging.getLogger('matplotlib')
mpl_logger.setLevel(logging.ERROR)... | {"hexsha": "e5fc011c0d60d2849c8fd5593068e3b62d0ada2b", "size": 7722, "ext": "py", "lang": "Python", "max_stars_repo_path": "code/visualization/2020/02/8_9_finetune_palminized_analyze_matrices.py", "max_stars_repo_name": "lucgiffon/psm-nets", "max_stars_repo_head_hexsha": "dec43c26281febf6e5c8b8f42bfb78098ae7101d", "max... |
"""Use water polygons from openstreetmapdata.org to mask
seas and oceans, and `natural=water|wetland` polygons
from the OSM database.
"""
import os
import shutil
import requests
import fiona
import geopandas as gpd
import numpy as np
import psycopg2
import rasterio.features
from shapely.geometry import shape
from tqd... | {"hexsha": "1d7fb901184a4ae23cacc3722842274783867ee5", "size": 6230, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/land_masks.py", "max_stars_repo_name": "yannforget/landsat-sentinel-fusion", "max_stars_repo_head_hexsha": "13872d733f4b3958a479b6da9477a83dc6ab1369", "max_stars_repo_licenses": ["MIT"], "max_... |
from __future__ import division
import numpy as np
import pyopencl as cl
import loopy as lp
from pyopencl.tools import pytest_generate_tests_for_pyopencl \
as pytest_generate_tests
def test_laplacian_stiffness(ctx_factory):
dtype = np.float32
ctx = ctx_factory()
order = "C"
dim = 2 # (bak... | {"hexsha": "18f2a5bfabdd52abad9d78aacf4f1d5be53b5ac1", "size": 5193, "ext": "py", "lang": "Python", "max_stars_repo_path": "proto-tests/test_fem_assembly.py", "max_stars_repo_name": "danshapero/loopy", "max_stars_repo_head_hexsha": "d3ede00fa60680aa8df487d56fb0549d4582b976", "max_stars_repo_licenses": ["MIT"], "max_sta... |
import numpy as np
import input_data
class NearestNeighbor:
def __init__(self):
pass
def train(self, X, y):
""" X is N x D where each row is an example. Y is 1-dimension of size N """
# the nearest neighbor classifier simply remembers all the training data
self.Xtr = X
self.ytr = y
def pred... | {"hexsha": "ab2fac70c8a99c8150e752c730198232d20b9947", "size": 1609, "ext": "py", "lang": "Python", "max_stars_repo_path": "mnist/nearestNeighbour.py", "max_stars_repo_name": "andpol5/whaleDetector", "max_stars_repo_head_hexsha": "2dd0bb9eaa3ba0281a72b268a87a8f8a6c40d4bf", "max_stars_repo_licenses": ["MIT"], "max_stars... |
from sympy import oo
def wall_time(pos, vel, radius): return (1.0-radius-pos)/vel if vel>0.0 else (pos-radius)/abs(vel) if vel<0.0 else float(oo)
| {"hexsha": "3c3b1f75cf099592f20b9f3fb8aa02e9dab8062a", "size": 148, "ext": "py", "lang": "Python", "max_stars_repo_path": "Chapter 2/wall_time.py", "max_stars_repo_name": "indrag49/Computational-Stat-Mech", "max_stars_repo_head_hexsha": "0877f54a0245fce815f03478f4fb219fd6314951", "max_stars_repo_licenses": ["MIT"], "ma... |
# Copyright 2017 You8M team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | {"hexsha": "cc84c6f65a78d91b3b2f8d52cf0f0d4afa92c2b3", "size": 1714, "ext": "py", "lang": "Python", "max_stars_repo_path": "frame_level_code/splitutils.py", "max_stars_repo_name": "mpekalski/Y8M", "max_stars_repo_head_hexsha": "24b61107a0f482fdb36ab8b15b768cea24e5808a", "max_stars_repo_licenses": ["Apache-2.0"], "max_s... |
function [Population,FrontNo,DWeight] = EnvironmentalSelection(Population,N)
% The environmental selection of DWU
%------------------------------- Copyright --------------------------------
% Copyright (c) 2023 BIMK Group. You are free to use the PlatEMO for
% research purposes. All publications which use this platfor... | {"author": "BIMK", "repo": "PlatEMO", "sha": "c5b5b7c37a9bb42689a5ac2a0d638d9c4f5693d5", "save_path": "github-repos/MATLAB/BIMK-PlatEMO", "path": "github-repos/MATLAB/BIMK-PlatEMO/PlatEMO-c5b5b7c37a9bb42689a5ac2a0d638d9c4f5693d5/PlatEMO/Algorithms/Multi-objective optimization/DWU/EnvironmentalSelection.m"} |
# from skimage.io import imread
import datetime
import os
import pickle
import sys
import math
from os import mkdir
# from torchsummary import summary
from os.path import join
from time import time
from memory_profiler import profile
import cv2
import matplotlib.pyplot as plt
import numpy as np
from src.data.utils.uti... | {"hexsha": "a269cff06a1d6e7a93d07e6488f860a29aa2d6d6", "size": 13530, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/models/train_model.py", "max_stars_repo_name": "gummz/cell", "max_stars_repo_head_hexsha": "a741ca4900a11f1080b7572ac969f765e5ac2ffd", "max_stars_repo_licenses": ["MIT"], "max_stars_count": n... |
[STATEMENT]
lemma ntsmcf_0_NTMap_vsv[smc_cs_intros]: "vsv (ntsmcf_0 \<CC>\<lparr>NTMap\<rparr>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. vsv (ntsmcf_0 \<CC>\<lparr>NTMap\<rparr>)
[PROOF STEP]
unfolding ntsmcf_0_components
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. vsv []\<^sub>\<circ>
[PROOF STEP]
by s... | {"llama_tokens": 160, "file": "CZH_Foundations_czh_semicategories_CZH_SMC_Simple", "length": 2} |
#--------------------------------------------------------------------------#
# This function will create a list of csv files that contain the isolates in
# rows and loci in columns. This currently only works for unlabeled files,
# but what it will do is allow the user to specify an entire directory to
# analyze.
#
#... | {"hexsha": "9b8f4efcde1b7f1144c47342339e4c49e0378337", "size": 9321, "ext": "r", "lang": "R", "max_stars_repo_path": "the_horror/OLDmultilocusFunctions.r", "max_stars_repo_name": "zkamvar/PiG_Multitool", "max_stars_repo_head_hexsha": "81a0bf7bc7830fac8fab18e548e97a088fe341d6", "max_stars_repo_licenses": ["MIT"], "max_s... |
"""Stopping rules are a particular focus of TAR research.
"""
import numpy as np
from tarexp.component.base import Component
from tarexp.ledger import Ledger
from tarexp.util import getOneDimScores
# Note: not importing Workflow to avoid circular dependency
from scipy.stats import hypergeom
def _inferBatchsize(le... | {"hexsha": "453daf1dcb32b02983739f42c9b93fd1a787b0aa", "size": 7145, "ext": "py", "lang": "Python", "max_stars_repo_path": "tarexp/component/stopping.py", "max_stars_repo_name": "eugene-yang/tarexp", "max_stars_repo_head_hexsha": "3037462b41ea3a5aa3faf6afa71db0de5c14e88f", "max_stars_repo_licenses": ["Apache-2.0"], "ma... |
import os
import pathlib
import re
import time
from typing import List
import shutil
from absl import app, flags
import numpy as np
import matplotlib.pyplot as plt
import s3_util
from gui import GUI, AnnotatedImage, Category
IMAGE_DIR_NAME = "images"
ANNOTATION_DIR_NAME = "annotations"
MANIFEST_DIR_NAME = "manifests... | {"hexsha": "1494829d25f2271596f032d5fc07710a5df1c6d3", "size": 8459, "ext": "py", "lang": "Python", "max_stars_repo_path": "odlu/label.py", "max_stars_repo_name": "BrianOfrim/recyclops-od", "max_stars_repo_head_hexsha": "f2a95cf37e36cd884c2f6b96628d6ed2de4535a8", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1... |
[STATEMENT]
lemma le_multiset_empty_left[simp]: "M \<noteq> {#} \<Longrightarrow> {#} < M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. M \<noteq> {#} \<Longrightarrow> {#} < M
[PROOF STEP]
by (simp add: less_multiset\<^sub>H\<^sub>O) | {"llama_tokens": 104, "file": null, "length": 1} |
import networkx
import sys
import os
import silk
from subprocess import Popen
import string
import random
import sqlparse
from protocol_graph import ProtocolGraph
def id_generator(size=8, chars=string.ascii_letters):
"""
Generate random string.
size: size of the string to be generated.
chars: list of ... | {"hexsha": "124b9b08eda1de9885777c8d66e80eacb93cbcc7", "size": 6313, "ext": "py", "lang": "Python", "max_stars_repo_path": "netdata/importer/ipfix_connection.py", "max_stars_repo_name": "mincode/netdata", "max_stars_repo_head_hexsha": "4369a3bfb473509eff92083e03f214d5b75f6074", "max_stars_repo_licenses": ["ECL-2.0", "A... |
import os
import numpy as np
from tensorboardX import SummaryWriter
import copy
import post_process.calculations.calculation_utils as cutils
import post_process.visualization.visualization_utils as vutils
from post_process.calculations.mission_calcs import MissionCalcs
from post_process.calculations.overall_stat import... | {"hexsha": "60b5e080de82abb9bc4d2736dfd64fe705063ffc", "size": 32292, "ext": "py", "lang": "Python", "max_stars_repo_path": "post_process/applications/applications.py", "max_stars_repo_name": "rvalienter90/rl-agents", "max_stars_repo_head_hexsha": "ad6be08f9a7e2f0ec0daf6f557bd9f476bb9e4da", "max_stars_repo_licenses": [... |
import multiprocessing
import argparse
import os
import shutil
import numpy as np
import pandas as pd
import torch
from allennlp.common.params import Params
from allennlp.training.learning_rate_schedulers import LearningRateScheduler
from allennlp.training.optimizers import Optimizer
from torch.nn import Data... | {"hexsha": "6a74b91d80df770f6de05ff5b84f0002697dd6ac", "size": 10034, "ext": "py", "lang": "Python", "max_stars_repo_path": "models/crf_train.py", "max_stars_repo_name": "yangshao/vcr", "max_stars_repo_head_hexsha": "88513d6958d93bd7845d532d5b83744a678fc980", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null,... |
module Not-named-according-to-the-Haskell-lexical-syntax where
postulate
IO : Set -> Set
{-# BUILTIN IO IO #-}
{-# COMPILED_TYPE IO IO #-}
postulate
return : {A : Set} -> A -> IO A
{-# COMPILED return (\_ -> return :: a -> IO a) #-}
{-# COMPILED_EPIC return (u1 : Unit, a : Any) -> Any = ioreturn(a) #-}
data Un... | {"hexsha": "1e6f9021050f6c43f707e07aa9114e849856d993", "size": 383, "ext": "agda", "lang": "Agda", "max_stars_repo_path": "examples/compiler/Not-named-according-to-the-Haskell-lexical-syntax.agda", "max_stars_repo_name": "redfish64/autonomic-agda", "max_stars_repo_head_hexsha": "c0ae7d20728b15d7da4efff6ffadae6fe4590016... |
import numpy as np
from ddpg_agent.contrib.physics_sim import PhysicsSim
from ddpg_agent.quadcopter_environment import QuadcopterState
class Task():
"""Task (environment) that defines the goal and provides feedback to the agent."""
def __init__(self, init_pose=None, init_velocities=None,
init_angle_vel... | {"hexsha": "5ef9a21cb4cf93f0908907e647d50d0b1aea7c6a", "size": 3644, "ext": "py", "lang": "Python", "max_stars_repo_path": "task.py", "max_stars_repo_name": "samhiatt/ddpg_agent", "max_stars_repo_head_hexsha": "1b96c36d184c810e7188dcc41752fab3f3739d2f", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 2, "max_sta... |
C Simplified version of AXIAL, used to expose a bug in
C transformers_inter_full, most likely linked to bourdoncle
C restructuration.
SUBROUTINE UNSTRUC19
* ( DIRR, NUMIRR , NUMMAT , IBUR)
LOGICAL FINDMO
Real XIR (1)
2 FINDMO=.FALSE.
4 IF (FINDMO) THEN
... | {"hexsha": "9d08fc2200b96a03a22960ca8303c6b1c9a2b675", "size": 519, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "packages/PIPS/validation/Semantics/unstruc19.f", "max_stars_repo_name": "DVSR1966/par4all", "max_stars_repo_head_hexsha": "86b33ca9da736e832b568c5637a2381f360f1996", "max_stars_repo_licenses": ["MI... |
#!/usr/bin/env python
# for stage-4 world
from __future__ import print_function
from enum import IntEnum
import gym
from gym import error, spaces, utils
from gym.utils import seeding
import numpy as np
from scipy import ndimage, interpolate
import pdb
import glob
import os
import errno
import re
import time
import ra... | {"hexsha": "a06e8e9a115d28581c42cfe9dc2ed7479d3b75e3", "size": 40320, "ext": "py", "lang": "Python", "max_stars_repo_path": "gym_dal/envs/dal_env.py", "max_stars_repo_name": "montrealrobotics/dal", "max_stars_repo_head_hexsha": "4c83d3b118a1d61306f2f2ecc6d900f4be12bb7f", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
"""
===================================================================
Recognizing hand-written digits using Fastfood kernel approximation
===================================================================
This shows how the Fastfood kernel approximation compares to a dual and primal
support vector classifier. It is... | {"hexsha": "91ed389e9cb9f3fda673156c484286e7022e1cce", "size": 4153, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/plot_digits_classification_fastfood.py", "max_stars_repo_name": "zdog234/scikit-learn-extra", "max_stars_repo_head_hexsha": "edfa77fd5d684ffc98151c0e93c3c2bd117627cd", "max_stars_repo_lic... |
[STATEMENT]
lemma pairwise_disjnt_quadruple_sum:
"pairwise disjnt ((\<lambda> x. {(a, b, c, d) | a b c d. a \<in> A \<and> b \<in> A \<and> c \<in> A \<and> d \<in> A \<and> additive_quadruple a b c d \<and> a \<oplus> b = x \<and> c \<oplus> d = x}) ` (sumset A A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. ... | {"llama_tokens": 410, "file": "Balog_Szemeredi_Gowers_Additive_Combinatorics_Preliminaries", "length": 2} |
from torchvision import transforms, utils
from PIL import Image
from torch.utils.data import DataLoader
import numpy as np
import torch
import os, cv2
class SaliconDataset(DataLoader):
def __init__(self, img_dir, gt_dir, fix_dir, img_ids, exten='.png'):
self.img_dir = img_dir
self.gt_dir = gt_dir
... | {"hexsha": "e4c0e915aaed81b01b7b6ed9f809119631c08074", "size": 3975, "ext": "py", "lang": "Python", "max_stars_repo_path": "SimpleNet/dataloader.py", "max_stars_repo_name": "chhanganivarun/saliency", "max_stars_repo_head_hexsha": "a9edbd7d89d1e170bfb5056eb48e7a103d489995", "max_stars_repo_licenses": ["MIT"], "max_stars... |
__author__ = 'Alexendar Perez'
#####################
# #
# Introduction #
# #
#####################
"""CRISPR Specificity Correction
National Cancer Institute, National Institutes of Health, United States of America
Developer: Alexendar R. Perez M.D., Ph.D
Primary Investigato... | {"hexsha": "c072693be60323f39a9b914477adacc8222da9d8", "size": 15410, "ext": "py", "lang": "Python", "max_stars_repo_path": "csc_v2/csc_lite.py", "max_stars_repo_name": "xerezLA/CSC-crispr", "max_stars_repo_head_hexsha": "c45a4c1fded9bef81d3625cf6958491b181cf236", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
[STATEMENT]
lemma tab\<^sub>1_in_hom [intro]:
assumes "ide r"
shows "\<guillemotleft>tab\<^sub>1 r : src (tab\<^sub>0 r) \<rightarrow> trg r\<guillemotright>"
and "\<guillemotleft>tab\<^sub>1 r : tab\<^sub>1 r \<Rightarrow> tab\<^sub>1 r\<guillemotright>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<... | {"llama_tokens": 2280, "file": "Bicategory_BicategoryOfSpans", "length": 16} |
[STATEMENT]
lemma (in is_cat_limit) cat_lim_unique':
assumes "u' : r' <\<^sub>C\<^sub>F\<^sub>.\<^sub>l\<^sub>i\<^sub>m \<FF> : \<JJ> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>"
shows
"\<exists>!f'. f' : r' \<mapsto>\<^bsub>\<CC>\<^esub> r \<and> (\<forall>j\<in>\<^sub>\<circ>\<JJ>\<lparr>Obj\<rp... | {"llama_tokens": 378, "file": "CZH_Universal_Constructions_czh_ucategories_CZH_UCAT_Limit", "length": 1} |
#pragma once
#include <algorithm>
#include <limits>
#include <type_traits>
#include <unordered_map>
#include <vector>
#include <boost/optional.hpp>
#include <boost/range/algorithm/find_if.hpp>
#include <elle/Defaulted.hh>
#include <elle/Error.hh>
#include <elle/assert.hh>
#include <elle/find.hh>
#include <elle/log.h... | {"hexsha": "a3f41f3b90d8ca68d5a2f3b268a8737ff9ba8669", "size": 33839, "ext": "hh", "lang": "C++", "max_stars_repo_path": "src/elle/das/cli.hh", "max_stars_repo_name": "infinitio/elle", "max_stars_repo_head_hexsha": "d9bec976a1217137436db53db39cda99e7024ce4", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count":... |
/*
* File: cql_exponential_reconnection_policy_t.hpp
* Author: mc
*
* Created on September 26, 2013, 8:49 AM
*/
#ifndef CQL_EXPONENTIAL_RECONNECTION_POLICY_T_HPP_
#define CQL_EXPONENTIAL_RECONNECTION_POLICY_T_HPP_
#include <boost/date_time/posix_time/posix_time.hpp>
#include "cql/policies/cql_reconnection_pol... | {"hexsha": "4aad5f6ffa1c408f9c07905012aed687b4b27757", "size": 1866, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "include/cql/policies/cql_exponential_reconnection_policy_t.hpp", "max_stars_repo_name": "ncbi/cassandra-cpp-driver", "max_stars_repo_head_hexsha": "b2259e9b13849c98fc6b6485f2433c97c1fa4b9f", "max_st... |
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | {"hexsha": "540ed05f2a6039b362deedc6841ed2b6829093ea", "size": 4741, "ext": "py", "lang": "Python", "max_stars_repo_path": "jax_cfd/base/equations_test.py", "max_stars_repo_name": "dionhaefner/jax-cfd", "max_stars_repo_head_hexsha": "a387152efa580592134a98b50f95055882568447", "max_stars_repo_licenses": ["Apache-2.0"], ... |
# ------------------------------------
# set volume
# ------------------------------------
function set_volume(nodes, cellxmax, cellymax, volume)
for j in 1:cellymax
for i in 1:cellxmax
vec_r1x = nodes[i+1,j+1,1] - nodes[i,j,1]
vec_r1y = nodes[i+1,j+1,2] - nodes[i,j,2]
ve... | {"hexsha": "8fe9b356901010a814919584996bfa0ae5a697b0", "size": 10055, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src_muscl/value_setup.jl", "max_stars_repo_name": "hide-dog/general_2d_NS_LES", "max_stars_repo_head_hexsha": "571e4d3d63882ec0829ed5f56b33bec9b0eaf50e", "max_stars_repo_licenses": ["MIT"], "max_s... |
"""
_checked_rrule
like `rrule` but throws an error if the `rrule` is not defined.
Rather than returning `nothing`
"""
function _checked_rrule(f, args...; kwargs...)
r = rrule(f, args...; kwargs...)
r isa Nothing && _throw_checked_rrule_error(f, args...; kwargs...)
return r
end
@noinline function _th... | {"hexsha": "f5ea27d49417cc35092b3cf7098dd1ae7bdd102e", "size": 717, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/helper_functions.jl", "max_stars_repo_name": "freemin7/ChainRules.jl", "max_stars_repo_head_hexsha": "59f06bce6ebb21ed2d5f71769887d9b6523c9d61", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
import argparse
import numpy as np
import keras
from keras.preprocessing import sequence
from keras.models import Sequential
from keras.layers import Dense, Dropout, Embedding, LSTM, Bidirectional
| {"hexsha": "7dff4de995b677855c6aef2e0aa5307e06979f88", "size": 197, "ext": "py", "lang": "Python", "max_stars_repo_path": "references/ati_cnn/crnn_keras.py", "max_stars_repo_name": "busyyang/torch_ecg", "max_stars_repo_head_hexsha": "031d90a32b8a1e202364efe1e5a19a9ba1f0a726", "max_stars_repo_licenses": ["MIT"], "max_st... |
PROGRAM p17
IMPLICIT NONE
REAL a,b,c,x,y,z,f1
DATA c / 5./
f1(x,y) = a+b*x**2+c*y
a = 1
b = 2
z = f1(2.,2.0)
PRINT *, 'f1(2.,2.): ', z
z = f1(b,b)
PRINT *, 'f1(b,b): ', z
z = f2(2.,2.0)
PRINT *, 'f2(2.,2.): ', z
z = f2(b,b)
PRINT *, 'f2(b... | {"hexsha": "cd63c206a66a6c99e97176329ba3df518f202124", "size": 480, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "lab3/p17.f90", "max_stars_repo_name": "M1nified/UJ-Fortran", "max_stars_repo_head_hexsha": "3067d036e38a2bdf433bd63eb47498cc163dedaf", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null,... |
#pragma once
#include <algorithm>
#include <atomic>
#include <chrono>
#include <cmath>
#include <thread>
#include <boost/test/unit_test.hpp>
#include <boost/accumulators/accumulators.hpp>
#include <boost/accumulators/statistics.hpp>
#include "snapshot.hpp"
namespace bacc = boost::accumulators;
inline void test_snapsh... | {"hexsha": "c3638fafdc5f420ee10dc6f52f7a337f1508fef9", "size": 1525, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "test/common.hpp", "max_stars_repo_name": "andrew-murray/cpp-metrics", "max_stars_repo_head_hexsha": "9d126227b825c561fab5db79b01f267bd0ea9412", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_... |
using KernelFunctions
using AxisArrays
using Distances
using Documenter
using Kronecker: Kronecker
using LinearAlgebra
using LogExpFunctions
using PDMats
using Random
using SpecialFunctions
using Test
using Flux
using Zygote: Zygote
using ForwardDiff: ForwardDiff
using ReverseDiff: ReverseDiff
using FiniteDifferences: ... | {"hexsha": "51a72742b7dffffb466cf1ca05ee7685290362af", "size": 6620, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/runtests.jl", "max_stars_repo_name": "thomasgudjonwright/KernelFunctions.jl", "max_stars_repo_head_hexsha": "037cd74f525dc8fdac0fdaef37a0ee53a8cb2772", "max_stars_repo_licenses": ["MIT"], "max... |
import numpy as np
import torch
import matplotlib.pyplot as plt
from pathlib import Path
from matplotlib.backends.backend_pdf import PdfPages
import glob
import pandas as pd
import os
from itertools import compress
from results_utils import display_dataset_name, display_decoder_name, coef_variation, metrics, dict_mean,... | {"hexsha": "525d3184e202736c494c91d6725c35d89e42922f", "size": 25998, "ext": "py", "lang": "Python", "max_stars_repo_path": "code/make_results.py", "max_stars_repo_name": "bsouhaib/qf-tpp", "max_stars_repo_head_hexsha": "a5adf3f7203b920528c1c397329c4afd9039c3b4", "max_stars_repo_licenses": ["MIT"], "max_stars_count": n... |
# coding=utf-8
# Copyright 2022 The Reach ML 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 ... | {"hexsha": "90bdda2930dc7e186bf308f1f10a9b79d14ec33c", "size": 8888, "ext": "py", "lang": "Python", "max_stars_repo_path": "data/dataset_test.py", "max_stars_repo_name": "google-research/ibc", "max_stars_repo_head_hexsha": "c2f6775418c3d7b1ffd0e822fc0050c834030d15", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars... |
import gym
from gym import spaces, logger
from gym.utils import seeding
import numpy as np
from action_space import ActionSpace
from channel_space import ChannelSpace
from state_space import StateSpace
from mempool import Mempool, Transaction, Block
from gym.spaces import Discrete
class BlockchainNetworkingEnv(gym.En... | {"hexsha": "27d43766b4f7ebf477fcc21947fbbead64eabac7", "size": 7762, "ext": "py", "lang": "Python", "max_stars_repo_path": "blockchain_networking/blockchain_networking_env.py", "max_stars_repo_name": "TonnyTran/blockchain_networking_DRL", "max_stars_repo_head_hexsha": "3d3bbdfc0c12e2b770df1f6243578aa08b27d135", "max_st... |
#!/usr/bin/env python
#
# ----------------------------------------------------------------------
#
# Brad T. Aagaard, U.S. Geological Survey
# Charles A. Williams, GNS Science
# Matthew G. Knepley, University of Chicago
#
# This code was developed as part of the Computational Infrastructure
# for Geodynamics (http://ge... | {"hexsha": "a68d168c22f93a6f149a79f44b97d4a7fc9ef4a9", "size": 3802, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests_auto/2d/slipdir/genspatialdb.py", "max_stars_repo_name": "joegeisz/pylith", "max_stars_repo_head_hexsha": "f74060b7b19d7e90abf8597bbe9250c96593c0ad", "max_stars_repo_licenses": ["MIT"], "max... |
import numpy as np
import pytest
from gtd.ml.vocab import SimpleVocab, SimpleEmbeddings
@pytest.fixture
def vocab():
return SimpleVocab(['a', 'b', 'c'])
@pytest.fixture
def embeds(vocab):
array = np.eye(len(vocab))
return SimpleEmbeddings(array, vocab)
class TestSimpleVocab(object):
def test_save... | {"hexsha": "a8d0300a0b6e0e47c7b71eb05adc79b68a341fe9", "size": 494, "ext": "py", "lang": "Python", "max_stars_repo_path": "third-party/gtd/gtd/ml/tests/test_vocab.py", "max_stars_repo_name": "timpowellgit/phrasenode", "max_stars_repo_head_hexsha": "a4dc105a69785f289a4e7998d078d6727686b94d", "max_stars_repo_licenses": [... |
# LNS.py
# Contact: Jacob Schreiber
# jmschr@cs.washington.edu
'''
This is an implementation of Local Network Similarity (LNS), a metric
introduced by Yuanfang Guan et al in their 2013 paper "Comparative
gene expression between two yeast species".
'''
import pandas as pd
import numpy as np
from scipy.stats ... | {"hexsha": "a864cd81d99f00bb812c0a4d12c12903ed04be32", "size": 2092, "ext": "py", "lang": "Python", "max_stars_repo_path": "analysis/LNS.py", "max_stars_repo_name": "jmschrei/discern", "max_stars_repo_head_hexsha": "50b6f03d070604479c160569cca9ef7f031ff38d", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, "ma... |
#!/usr/bin/env python
# encoding=utf-8
# named sting because: if you're a cell,
# every breath you take, every step you make,
# we'll be watching you
# © tim smith 2014, tim.smith@uci.edu
# released under the terms of the wtfpl http://wtfpl.net
from __future__ import division
import argparse
import codecs
from Strin... | {"hexsha": "dbde60d919cf61305f72b77c5cf6dcd8521bd17f", "size": 13891, "ext": "py", "lang": "Python", "max_stars_repo_path": "sting/sting.py", "max_stars_repo_name": "tdsmith/migrationscripts", "max_stars_repo_head_hexsha": "42cc44f5b1a8058dd92f986152d908585f620498", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_sta... |
! { dg-do compile }
! Program to test ENUM parsing errors
program main
implicit none
integer :: i = 1
enum, bind (c)
enumerator :: red, black = i ! { dg-error "is a variable" }
enumerator :: blue = 1
end enum junk ! { dg-error "Syntax error" }
blue = 10 ! { dg-error " assign to a named consta... | {"hexsha": "b27aaf289c04517d02958363f2e651a04fd16035", "size": 371, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "llvm-gcc-4.2-2.9/gcc/testsuite/gfortran.dg/enum_5.f90", "max_stars_repo_name": "vidkidz/crossbridge", "max_stars_repo_head_hexsha": "ba0bf94aee0ce6cf7eb5be882382e52bc57ba396", "max_stars_repo_lic... |
From Coq Require Import List Bool FunInd.
From CoLoR Require Import weaved_relation closure term_spec terminaison.
From CoLoR Require equational_theory_spec closure_extension.
Module Make (Eqt:equational_theory_spec.EqTh).
Lemma one_step_list_same_length :
forall R l1 l2, one_step_list (Eqt.one_step R) l2 l1 -> l... | {"author": "fblanqui", "repo": "color", "sha": "f2ef98f7d13c5d71dd2a614ed2e6721703a34532", "save_path": "github-repos/coq/fblanqui-color", "path": "github-repos/coq/fblanqui-color/color-f2ef98f7d13c5d71dd2a614ed2e6721703a34532/Coccinelle/examples/cime_trace/equational_extension.v"} |
from sklearn import svm
from sklearn.model_selection import train_test_split
from sklearn.metrics import confusion_matrix
from sklearn.metrics import plot_confusion_matrix
from sklearn.metrics import accuracy_score
import matplotlib.pyplot as plt
import scipy.io as sio # 用于加载mat文件
import pickle
from sklearn.model_sel... | {"hexsha": "e3b62061d858392a2ad7a2a3831a7641ab187225", "size": 2566, "ext": "py", "lang": "Python", "max_stars_repo_path": "code/s3/svm/svm.py", "max_stars_repo_name": "little111cow/2021-D-", "max_stars_repo_head_hexsha": "db128ae39678581a28b974a6a91a3d8d7d119704", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_... |
import numpy as np
from scipy.stats import f
from statsmodels.stats.stattools import durbin_watson
class AR_model(object):
def __init__(self, X, Y, Q_L=1.6, Q_U=2.3, upper=True, basis_type='residual'):
self.Y = Y
self.X = X
self.n = X.shape[0]
self.p = X.shape[1]
self.Q_L =... | {"hexsha": "88dc63b99f077e3a7af4543ba9f32ba1c386087b", "size": 2870, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/blackbox_selectinf/usecase/AR_model.py", "max_stars_repo_name": "liusf15/blackbox_selectinf", "max_stars_repo_head_hexsha": "874c073ca56c042cbaaed606bf52d6b36ccebd59", "max_stars_repo_licenses... |
from data.fashionmnist import *
from examples.simple_cnn.model import *
from hyper.container import HyperContainer
from base_step_optimizer import *
from base_trainer import *
import torch.backends.cudnn as cudnn
import torch.nn.functional as F
import numpy as np
import torch.nn as nn
import argparse
import sys
impor... | {"hexsha": "2dd150a032dee5c6b3f6424adbea62b758348371", "size": 11052, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/simple_cnn/train.py", "max_stars_repo_name": "pomonam/Self-Tuning-Networks", "max_stars_repo_head_hexsha": "3fa949bb1da5beb2b4e7f1d07a26b819b42ad7f3", "max_stars_repo_licenses": ["MIT"],... |
"""
Notes:
- 1. For the conv layer we have H' = H since H' = H+2p-k+1 = H' for p=1, k=3. i.e. same as previous layer
- since stride=1 as default (so only moves by 1) since you want to see all the image for a conv.
- 2. For the avg pool layer we have H' = H/2 i.e. half of previous layer
- since stride=kernel_siz... | {"hexsha": "450c2061b4b62d73a82596d70bdbf5f196755e9f", "size": 7991, "ext": "py", "lang": "Python", "max_stars_repo_path": "ultimate-utils-proj-src/uutils/torch_uu/models/learner_from_opt_as_few_shot_paper.py", "max_stars_repo_name": "pestun/ultimate-utils", "max_stars_repo_head_hexsha": "676002e80422067256c43172a78825... |
# Should be run from EchelleCCFs/deps or EchelleCCFs/examples or EchelleCCFs/test
# Since this May be called before EchelleCCFs is installed, so this doesn't use pkgdir.
include("download.jl")
download_url = "https://zenodo.org/record/3753254/files/res-1000-1years_full_id1.h5?download=1"
download_filename = joinpath(... | {"hexsha": "1f3124c974aed22c6d98dc434cc774659850f290", "size": 568, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "deps/download_soap_example_from_gilbertson_etal_2020.jl", "max_stars_repo_name": "RvSpectML/EchelleCCFs", "max_stars_repo_head_hexsha": "a639217e24ebc59282d42e27d739d3aea1a032c6", "max_stars_repo_li... |
#include <a4/config.h>
#ifdef HAVE_ATOMIC
#include <atomic>
#endif
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <vector>
#include <stdexcept>
#include <boost/chrono.hpp>
namespace chrono = boost::chrono;
typedef chrono::duration<double> duration;
#include <boost/thread.hpp>
#... | {"hexsha": "ab3037aa9b9ea90c1f20b631d28593b764ceef8e", "size": 20518, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "a4process/src/application.cpp", "max_stars_repo_name": "a4/a4", "max_stars_repo_head_hexsha": "e1de89260cb3894908f1d01dfacea125abc79da9", "max_stars_repo_licenses": ["BSL-1.0"], "max_stars_count": ... |
[STATEMENT]
lemma PO_l3_inv5 [simp,intro!]: "reach l3 \<subseteq> l3_inv5"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. reach l3 \<subseteq> l3_inv5
[PROOF STEP]
using l3_inv5_derived PO_l3_inv2 PO_l3_inv3
[PROOF STATE]
proof (prove)
using this:
l3_inv2 \<inter> l3_inv3 \<subseteq> l3_inv5
reach l3 \<subseteq> l3_... | {"llama_tokens": 200, "file": "Key_Agreement_Strong_Adversaries_pfslvl3", "length": 2} |
import random
import logging
import numpy as np
from collections import OrderedDict
from paddle import DataParallel
from .ofa import OFA
from .layers_base import BaseBlock
from ...core import GraphWrapper, dygraph2program
from .get_sub_model import get_prune_params_config, prune_params, check_search_space
from ...c... | {"hexsha": "de183cd3c408f992283124a23c6e36559a30da10", "size": 6730, "ext": "py", "lang": "Python", "max_stars_repo_path": "paddleslim/nas/ofa/hwofa.py", "max_stars_repo_name": "xiteng01/CVPR_2022_Track1_demo", "max_stars_repo_head_hexsha": "fa470ffc44e4c727048c1cbdc3cc5e48ec24a5c7", "max_stars_repo_licenses": ["Apache... |
import numpy as np
class univariate_Linear_Regression:
# initialize slope and intercept
def __init__(self):
self.m = 0.0 # slope
self.b = 0.0 # intercept
# sum of square deviation for single variable
def ss_x(self, x):
return sum((x-np.mean(x))**2)
# sum of square deviation ... | {"hexsha": "792cd1b2751fad30f80d9eb79cd6d0207eb20918", "size": 1432, "ext": "py", "lang": "Python", "max_stars_repo_path": "Linear Regression/univariate_Linear_Regression.py", "max_stars_repo_name": "imskr/Machine-Learning-with-Maths", "max_stars_repo_head_hexsha": "ca8e7565bb01a2164fba1a1dc3de617b81c88116", "max_stars... |
# Copyright 2022 The Flax Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | {"hexsha": "82bf277e442181bdf5bbb7eda811adb1949bacd4", "size": 12345, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/linen/linen_test.py", "max_stars_repo_name": "melissatan/flax", "max_stars_repo_head_hexsha": "8ff7d702d989f4577d1166b9d90a19bebe0cce32", "max_stars_repo_licenses": ["Apache-2.0"], "max_sta... |
Gearhead Records
Gearhead has now split into two businesses; the label is run by Michelle Haunold in Woodland, Ca; Mike LaVella in Oakland, runs Gearhead Magazine.
Gearhead began as a magazine, and the first ten issues came with a 7inch. They made a decision in late 1999 to stop releasing the magazine with a 7inc... | {"hexsha": "ee3d5ba093dcd728a7523dacc8238c976f90bd8f", "size": 6227, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "lab/davisWiki/Gearhead_Records.f", "max_stars_repo_name": "voflo/Search", "max_stars_repo_head_hexsha": "55088b2fe6a9d6c90590f090542e0c0e3c188c7d", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
[STATEMENT]
lemma matchrel_rtrancl_matchers [simp]:
assumes "(x, y) \<in> matchrel\<^sup>*"
shows "matchers_map (snd x) \<inter> matchers (set_mset (fst x)) =
matchers_map (snd y) \<inter> matchers (set_mset (fst y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. matchers_map (snd x) \<inter> matchers (set_... | {"llama_tokens": 295, "file": "First_Order_Terms_Abstract_Matching", "length": 2} |
[GOAL]
V : Type u
inst✝ : Fintype V
⊢ Fintype (SimpleGraph V)
[PROOFSTEP]
classical exact Fintype.ofInjective SimpleGraph.Adj SimpleGraph.ext
[GOAL]
V : Type u
inst✝ : Fintype V
⊢ Fintype (SimpleGraph V)
[PROOFSTEP]
exact Fintype.ofInjective SimpleGraph.Adj SimpleGraph.ext
[GOAL]
V : Type u_1
W : Type u_2
⊢ Symmetric f... | {"mathlib_filename": "Mathlib.Combinatorics.SimpleGraph.Basic", "llama_tokens": 52048} |
# -*- coding: utf-8 -*-
#
# Lijun Zhu (ljzhu@gps.caltech.edu)
#
# (c) 2018-2019 all rights reserved
#
import numpy
import cuda
import gsl
def test():
"""
Test Cholesky/trmm/inverse/gemm
"""
samples = 10
parameters = 20
precision = 'float64'
m = gsl.matrix(shape=(samples, parameters))
... | {"hexsha": "d0fa089912a0a48b7565842eb7091ffd80e47748", "size": 948, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/cuda/copycols.py", "max_stars_repo_name": "lijun99/pyre", "max_stars_repo_head_hexsha": "004dfd4c06489b4ba5b32877338ca6440f2d523b", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_cou... |
from mushroom_rl.core import Core
from mushroom_rl.environments import GridWorld
from mushroom_rl.algorithms.value import SARSA
from mushroom_rl.policy import EpsGreedy
from mushroom_rl.utils.parameters import Parameter, ExponentialParameter
from mushroom_rl.utils.callbacks import *
import numpy as np
def test_collec... | {"hexsha": "6518b7c146c32fb2c13d47e0d7ec5289a23de5ce", "size": 2297, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/utils/test_callbacks.py", "max_stars_repo_name": "PuzeLiu/mushroom-rl", "max_stars_repo_head_hexsha": "99942b425e66b4ddcc26009d7105dde23841e95d", "max_stars_repo_licenses": ["MIT"], "max_sta... |
#include <boost/geometry/index/predicates.hpp>
| {"hexsha": "803b4c1ef0f7e8d98254880eff0fa0b2327bfdea", "size": 47, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "src/boost_geometry_index_predicates.hpp", "max_stars_repo_name": "miathedev/BoostForArduino", "max_stars_repo_head_hexsha": "919621dcd0c157094bed4df752b583ba6ea6409e", "max_stars_repo_licenses": ["BSL... |
""" An example highlighting the difference between TLS-DMD and DMD
TLS-DMD is a total least squares variant of DMD, which can produce
superior results when the data provided to the method are noisy.
This example is meant to highlight the difference between the two
methods on a simple problem where the ... | {"hexsha": "3ad0e560c70aadea9d8ef150b03dbe0c2cb64501", "size": 2465, "ext": "py", "lang": "Python", "max_stars_repo_path": "python/scripts/total_dmd_example.py", "max_stars_repo_name": "Zhengyu-Huang/dmdtools", "max_stars_repo_head_hexsha": "d63fecd069e895bf4a0e5a0a3aec59d59d555d17", "max_stars_repo_licenses": ["BSD-3-... |
import psycopg2, psycopg2.extras
import sys
import os
import glob
import csv
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import tensorflow as tf
from matplotlib import patches
from matplotlib.pyplot import figure
from datetime import timedelta, date
from sklearn.metrics import confusion_matr... | {"hexsha": "5d7742ad1dcf743a7b1c5ec87e7d80625740ba0f", "size": 7726, "ext": "py", "lang": "Python", "max_stars_repo_path": "experiment/past_experiment/ohlc/predict_day/pred_day.py", "max_stars_repo_name": "anakinanakin/neural-network-on-finance-data", "max_stars_repo_head_hexsha": "1842606294ca3d5dafa7387d6db95a1c21d32... |
import tensorflow as tf
import data_io.basepy as basepy
import random
import numpy as np
import os.path as osp
import copy
slim = tf.contrib.slim
def arg_scope(weight_decay=0.0005):
with slim.arg_scope([slim.conv2d, slim.fully_connected],
activation_fn=tf.nn.relu,
... | {"hexsha": "5e666d0f60e7e479faf5240a4fcd4ea23945b9a4", "size": 7027, "ext": "py", "lang": "Python", "max_stars_repo_path": "zc3d_npy_base.py", "max_stars_repo_name": "zbhoscar/submax", "max_stars_repo_head_hexsha": "725c4de09e182f9cd1c4afe93ad175464f5c7cea", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count":... |
import numpy as np
import nengo
import nengo_spinnaker
spinnaker = True
dimensions = 1
from nengo.utils.functions import whitenoise
model = nengo.Network()
with model:
config = nengo_spinnaker.Config()
inp = nengo.Node(whitenoise(0.1, 5, dimensions=dimensions), label = "inp")
config[inp].f_of_t =... | {"hexsha": "8eeba70738cde8cd8a311bfe463a0a72f4be5b03", "size": 1462, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/learn_communication_channel_1.py", "max_stars_repo_name": "ctn-archive/nengo_spinnaker_2014", "max_stars_repo_head_hexsha": "2dcfe9506fedd9c4aebb66f5e1ba745d2f027871", "max_stars_repo_lic... |
"""This pipeline is based on Orion https://github.com/orion-search/orion.
For bugs/issues, contact the Nesta team or myself at k.stathou@gmail.com.
"""
from metaflow import FlowSpec, step, Parameter
import pandas as pd
from sqlalchemy.sql import exists
from sqlalchemy import create_engine, and_
from sqlalchemy.orm imp... | {"hexsha": "cfd804493f80c70784d34733c23b3157b1e6de45", "size": 26074, "ext": "py", "lang": "Python", "max_stars_repo_path": "ci_mapping/run_pipeline.py", "max_stars_repo_name": "kstathou/ci_mapping", "max_stars_repo_head_hexsha": "73ba03a67d76bf5f37e4507674e60737ad3d37ab", "max_stars_repo_licenses": ["MIT"], "max_stars... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Created by Hao Luo at 1/25/21
"""paper_plot_fig3.py
:description : script
:param :
:returns:
:rtype:
"""
import os
import matplotlib
import numpy as np
import pandas as pd
matplotlib.rc('font', family="Arial")
matplotlib.rcParams["font.family"] = 'Arial' # 'sans-... | {"hexsha": "cebb1d3a9b51a418eac790c2125083775f36d59b", "size": 4556, "ext": "py", "lang": "Python", "max_stars_repo_path": "ComplementaryScripts/Step_04_Pan_Core_mode/paper_plot_fig3.py", "max_stars_repo_name": "HaoLuoChalmers/Lactobacillus_reuteri_MM41A_GEM", "max_stars_repo_head_hexsha": "9be6a48e7467e0c81b0b97418086... |
import sys, os
sys.path.append('../src/utils/')
sys.path.append('../exps/Models/')
import numpy as np
import matplotlib as plt
from polygonal_obstacles import PolygonalObstacle as PolyObs
from viz import *
from ISS import get_ISS_zones
lims_btm, lims_up = np.array([5.,-3.5, 3.]), np.array([13., 8.5, 6.5])
keepin_zo... | {"hexsha": "30c8026cb1105861bca88d912e2377885b25701d", "size": 904, "ext": "py", "lang": "Python", "max_stars_repo_path": "exps/ISS_script.py", "max_stars_repo_name": "StanfordASL/ccscp", "max_stars_repo_head_hexsha": "a727dfc10d4acc43248c9a525a37279a70cecd80", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 12,... |
[STATEMENT]
lemma V_imp_Nil: "V (trn # tr) = [] \<Longrightarrow> V tr = []"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. V (trn # tr) = [] \<Longrightarrow> V tr = []
[PROOF STEP]
by (cases "\<phi> trn") auto | {"llama_tokens": 89, "file": "Bounded_Deducibility_Security_BD_Security_TS", "length": 1} |
# DEPENDENCIES
from globals import *
# LIBRARIES
import cv2 as cv
import numpy as np
from urllib.request import urlopen
# IMAGE CONVERSION
def pathIsURL(imagePath):
if imagePath[:4] == "http":
return True
else:
return False
def imagePathIsValid(imagePath):
if pathIsURL(image... | {"hexsha": "a76a65c790891524b1ca9c1222875d8d35601c76", "size": 5549, "ext": "py", "lang": "Python", "max_stars_repo_path": "functions.py", "max_stars_repo_name": "418888967/AutoDrawer-1", "max_stars_repo_head_hexsha": "746dfacee3eff942a0f44d8c135463610e47fba6", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, ... |
// Copyright Louis Dionne 2013-2016
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
#include <boost/hana/type.hpp>
#include <type_traits>
namespace hana = boost::hana;
// Makes sure that `hana::type`s have a ne... | {"hexsha": "b1ef119832d59358e70cf72f8e6a05b7c5961b14", "size": 504, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "thirdparty-cpp/boost_1_62_0/libs/hana/test/type/nested_type.cpp", "max_stars_repo_name": "nxplatform/nx-mobile", "max_stars_repo_head_hexsha": "0dc174c893f2667377cb2ef7e5ffeb212fa8b3e5", "max_stars_r... |
import numpy as np
from scipy import integrate
from .utility import read_csv, atmo_model
import matplotlib.pyplot as mpl
from stabsim.rocket import Rocket
"""
Simulates a spin-stabilized launch profile
"""
class Profile:
def __init__(self, rocket, motor, init_spin, launch_altit=0, length=0, motor_pos=0, ... | {"hexsha": "de2242a61e076a0c6f732d3ebfb896e366c7a7e0", "size": 5501, "ext": "py", "lang": "Python", "max_stars_repo_path": "stabsim/profile.py", "max_stars_repo_name": "roguextech/Stanford-SSI-Spaceshot-Dynamics-Aero", "max_stars_repo_head_hexsha": "ef468a0507cbf1e7927fb889984a2fb4ad0c465b", "max_stars_repo_licenses": ... |
#organizando lo datos
datos<-read.csv("Hoja de Colegios - cop_simpl.csv",dec = ",")
#transformar tipo y valores religiosos a factor
#esto facilita algunos analisis
datos$Tipo<-as.factor(datos$Tipo)
datos$Rel<-as.factor(datos$Rel)
datos <- datos[order(datos$PUNT,decreasing = TRUE),]#de mayor a menor nota
datos
library(... | {"hexsha": "b6cde69572ad6395115d872aaca80547247585a0", "size": 3163, "ext": "r", "lang": "R", "max_stars_repo_path": "colegios vitoria-gasteiz a examen.r", "max_stars_repo_name": "norberello/vitoria-gasteiz-a-examen", "max_stars_repo_head_hexsha": "b0b8ef013d7e215aaeb8572e8a4863b5a99c12cf", "max_stars_repo_licenses": [... |
\<^marker>\<open>creator "Kevin Kappelmann"\<close>
subsubsection \<open>Basic Setup\<close>
theory Transport_Natural_Functors_Base
imports
HOL.BNF_Def
HOL_Basics.HOL_Alignment_Functions
Transport_Base
begin
paragraph \<open>Summary\<close>
text \<open>Basic setup for closure proofs and simple lemmas.\<c... | {"author": "kappelmann", "repo": "transport-isabelle", "sha": "b6d2cb56ea4abf6e496d1c258d5b3d2a816d75ff", "save_path": "github-repos/isabelle/kappelmann-transport-isabelle", "path": "github-repos/isabelle/kappelmann-transport-isabelle/transport-isabelle-b6d2cb56ea4abf6e496d1c258d5b3d2a816d75ff/Transport/Natural_Functor... |
import numpy as np
class RegionEverywhere:
def __call__(self,xyz):
return np.ones(xyz.shape[0],dtype='bool')
class RegionFunction:
def __init__(self,function):
self.function = function
def __call__(self,xyz):
return self.function(xyz) | {"hexsha": "45567e04a837654c17e3d455e9d0f3ceea5a02e7", "size": 272, "ext": "py", "lang": "Python", "max_stars_repo_path": "LoopStructural/utils/regions.py", "max_stars_repo_name": "wgorczyk/LoopStructural", "max_stars_repo_head_hexsha": "bedc7abd4c1868fdbd6ed659c8d72ef19f793875", "max_stars_repo_licenses": ["MIT"], "ma... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import torch
import json
import cv2
import os
import math
import time
from pycocotools import coco
from .utils.image import color_aug, get_affine_transform, affine_transform, gaussian_radius,... | {"hexsha": "28dcbed7116c62bc6a514f3ddc3c529696862b52", "size": 7445, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/dataset.py", "max_stars_repo_name": "idantony/centernet-visdrone", "max_stars_repo_head_hexsha": "fde315fd52b5dc3357f093675c561f1c1ea47ea3", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
import math
from typing import *
import os
import cv2
import argparse
import numpy as np
from utils import import_open_pose
import env_vars
_op = import_open_pose()
_op_wrapper = _op.WrapperPython()
params = {
"model_folder": env_vars.MODEL_LOC,
"model_pose": "COCO",
"number_people_max": 1,
"net_resol... | {"hexsha": "ee0e01681ebfc4f24eb7e2bce73edc3d72541fde", "size": 4524, "ext": "py", "lang": "Python", "max_stars_repo_path": "gesture_detection.py", "max_stars_repo_name": "ihear-io/gestures-preprocessing", "max_stars_repo_head_hexsha": "e0dcbe5cde479d526efaea353c04fd1c22a13244", "max_stars_repo_licenses": ["MIT"], "max_... |
import os
import shutil
import matplotlib
import numpy as np
from matplotlib import pyplot as plt
from tqdm import tqdm
def violin_plot_ax(
ax,
data,
time_point=0,
violin_axis_limit=None,
time_point_annotation=False,
arms_annotations=None,
vertical=True,
annotate_total_reward=False,
)... | {"hexsha": "4bf36397706d75bdbb4663d981933ebf1fb068e0", "size": 9764, "ext": "py", "lang": "Python", "max_stars_repo_path": "mab/visualize.py", "max_stars_repo_name": "SebastianoF/multi-armed-bandits-testbed", "max_stars_repo_head_hexsha": "36e35369676e1d73a3106745c24f81f7a777db22", "max_stars_repo_licenses": ["MIT"], "... |
import random
import gym
import numpy as np
mutation_chance = 0.01
env = gym.make("CartPole-v1")
goal_steps = 200
def create_individual():
# Create individual
# [OBS, MOVES]
training_data = []
#Score
score = 0
# moves specifically from this environment:
game_memory = []
# previous ob... | {"hexsha": "d04d74fa96ec5583465184d7815110110dbbee0d", "size": 2997, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/CartPole-v0/geneticJaime.py", "max_stars_repo_name": "AlwaysLearningDeeper/OpenAI_Challenges", "max_stars_repo_head_hexsha": "576732fd3f1fd24afc4bdfb4920c1da8caae12ea", "max_stars_repo_license... |
include("algorithms/matching.jl")
@enum State begin
used = 1
unused = 2
removed = 3
vital = 4
end
"""
AllDifferent(x::Array{<:AbstractIntVar}, trailer)
AllDifferent constraint, enforcing ∀ i ≠ j ∈ ⟦1, length(x)⟧, x[i] ≠ x[j].
The implementation of this contraint is inspired by:
https://www.rese... | {"hexsha": "4bba5ca5860c1a6563d72e551ded4b5319e57b17", "size": 11514, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/CP/constraints/alldifferent.jl", "max_stars_repo_name": "corail-research/SeaPearl.jl", "max_stars_repo_head_hexsha": "648b10873e1586dc4f416a31689df855e5395ac7", "max_stars_repo_licenses": ["BS... |
import numpy as np
class IonMobilityPeak:
def __init__(self, mz, intensity, ion_mobility):
self.mz_array = [mz, ]
self.mass_array = [[mz, ], ]
self.intensity_array = [[intensity, ]]
self.ion_mobility_array = [[ion_mobility, ]]
self.intensity_max = [intensity, ]
sel... | {"hexsha": "0463fe6de77c22a82fddac409706267a5e2d2997", "size": 2764, "ext": "py", "lang": "Python", "max_stars_repo_path": "biosaur_src/Classes/IonMobilityPeak.py", "max_stars_repo_name": "abdrakhimov1/DIA_Biosaur", "max_stars_repo_head_hexsha": "90d4929f7e664dd8b47295ecbb8b8d4c323f88ab", "max_stars_repo_licenses": ["A... |
#include <boost/math/special_functions/ellint_rj.hpp>
| {"hexsha": "55227ee43b163f35a0dd7ce1f4d386c928a80923", "size": 54, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "src/boost_math_special_functions_ellint_rj.hpp", "max_stars_repo_name": "miathedev/BoostForArduino", "max_stars_repo_head_hexsha": "919621dcd0c157094bed4df752b583ba6ea6409e", "max_stars_repo_licenses"... |
#!/usr/local/bin/python
"""
Node objective functions
Algorithms implemented:
1. naive_greedy_parallel - In each iteration pick 1 node greedily.
2. naive_greedy_heuristic - Pick all k nodes at once greedily.
3. smart_greedy_parallel - In each iteration pick 1 node smart greedily.
"""
from __future__ import... | {"hexsha": "f6d3971a20685b1cfb04756cef2d802290a31b13", "size": 9782, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/python/MarkovChain/node_objectives.py", "max_stars_repo_name": "chdhr-harshal/MCMonitor", "max_stars_repo_head_hexsha": "330fc1a8f8cf83620fd6b0e503707c91e97af16d", "max_stars_repo_licenses": [... |
import pytest
import numpy as np
import pandas as pd
from pandas.util.testing import assert_frame_equal
import numpy.testing as npt
from sklearn.datasets import load_iris
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_allclose
from Pipeline.DPA import DensityPeakAdvanced... | {"hexsha": "809e190333facb93571670dceacde1763c084a68", "size": 3036, "ext": "py", "lang": "Python", "max_stars_repo_path": "Pipeline/tests/test_DPA.py", "max_stars_repo_name": "giovannidoni/DPA", "max_stars_repo_head_hexsha": "ccfca1d60cd068d748dd0103417d9769dfa25a99", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_... |
"""
WMAP plotting with HEALPix
--------------------------
This example uses the :func:`astromL.datasets.fetch_wmap_temperatures`
functionality to download and plot the raw WMAP 7-year data. The
visualization requires the `healpy <https://github.com/healpy/healpy>`_
package to be installed.
"""
# Author: Jake VanderPla... | {"hexsha": "dc73cd22d85e56a7bfb4de19b1ab82ca88ca9b7a", "size": 1075, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/datasets/plot_wmap_raw.py", "max_stars_repo_name": "aragilar/astroML", "max_stars_repo_head_hexsha": "d3f6279eb632957662338761cb559a1dcd541fb0", "max_stars_repo_licenses": ["BSD-2-Clause"... |
import numpy as np
class TablePreprocessor(object):
def __init__(self, ranges, N=20):
self.ranges = ranges
self.state_dimension = ranges.shape[0]
self.N = N
self.num_states = self.N**self.state_dimension
def preprocess(self, s):
binned = (1.0... | {"hexsha": "2e38d361c3847ccb9418056a24269fab5bf1f03b", "size": 1110, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/preprocessor.py", "max_stars_repo_name": "gmaher/distributed_rl", "max_stars_repo_head_hexsha": "194238c523c65c149e64ac576ba92ef95764c20f", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[letterpaper, total={7.5in, 9in}]{geometry}
\usepackage{amsmath}
\usepackage{amsfonts}
\title{Applied Partial Differential Equations}
\author{Grant Smith}
\date{Spring 2022}
\begin{document}
\maketitle
\section{Classifying PDEs}
\begin{itemize}
\it... | {"hexsha": "9a4fcd06b8660cdb25abe81101cd12b70d2831ad", "size": 18943, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "main.tex", "max_stars_repo_name": "GSmithApps/PDEs", "max_stars_repo_head_hexsha": "0bdae742c082cbf7ac383523aef4379984ec801f", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_star... |
import cv2
import numpy as np
from chainer import cuda
import chainer
try:
import cupy
except:
pass
import os
def copy_to_cpu(imgs):
if type(imgs) == chainer.variable.Variable :
imgs = imgs.data
try:
if type(imgs) == cupy.core.core.ndarray:
imgs = cuda.to_cpu(imgs)
excep... | {"hexsha": "9da2eb81932f8818b7a2f0e0cb1f4c5f24dfd5b2", "size": 1470, "ext": "py", "lang": "Python", "max_stars_repo_path": "common/utils/save_images.py", "max_stars_repo_name": "Aixile/chainer-gan-experiments", "max_stars_repo_head_hexsha": "4371e8369d2805e8ace6d7aacc397aa6e62680a6", "max_stars_repo_licenses": ["MIT"],... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import h5py
import sys
import os
import logging
import logging.config
import yaml
import numpy as np
from scipy import sparse
import inspect
import yaml
from .hparams import HParams
import re
logger = log... | {"hexsha": "23356223b091ab7c7afb7bd4637653ee2c7fdf12", "size": 3469, "ext": "py", "lang": "Python", "max_stars_repo_path": "utils/generic_utils.py", "max_stars_repo_name": "igormq/asr-study", "max_stars_repo_head_hexsha": "302fa3087cc71aec4853360638dbe2f4a59b5726", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
/*
* The MIT License (MIT)
*
* IziEditor
* Copyright (c) 2015 Martin Newhouse
*
* 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
* ... | {"hexsha": "c7bab77fc29614bc8ebb83140f91a37fb55e49db", "size": 18574, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "src/components/track_loader.cpp", "max_stars_repo_name": "mnewhouse/izieditor", "max_stars_repo_head_hexsha": "0a7f300737de9ab5a2a9a02c1a8c786083e71054", "max_stars_repo_licenses": ["MIT"], "max_st... |
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import numpy as np
import pytest # noqa: F401
import torch
import theseus as th
from theseus.constants import EPS
from theseus.utils impor... | {"hexsha": "76c6b667be710aebd27c7f9bcefe6731ef585cef", "size": 10312, "ext": "py", "lang": "Python", "max_stars_repo_path": "theseus/geometry/tests/test_se3.py", "max_stars_repo_name": "jeffin07/theseus", "max_stars_repo_head_hexsha": "3498bbddf9cca740c2703d0c1aa3a78a7264cb15", "max_stars_repo_licenses": ["MIT"], "max_... |
# coding=utf-8
import numpy as np
import pickle
from json import loads
import csv
def get_config():
"""
Get info in the config.json file
and turn all data to SI units
"""
with open('./config.json', 'r', encoding='utf-8') as f:
config = loads(f.read())
assert config["unit"] == "mm" or c... | {"hexsha": "01efc3d36e8f316e3c765a5b7abec8577f3a55a6", "size": 3808, "ext": "py", "lang": "Python", "max_stars_repo_path": "MyEIT/utilities.py", "max_stars_repo_name": "zehao99/CEIT-segmentation", "max_stars_repo_head_hexsha": "19f48b126e2ea82cea68d9fd10ec609344fd7247", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
%\documentclass[twocolumn,superscriptaddress,aps,prb,floatfix]{revtex4-1}
\documentclass[11pt]{article}
\usepackage{amsmath,graphicx}
%\usepackage[cmex10]{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{geometry}
\usepackage{graphicx}
\usepackage{epstopdf}
\usepackage{hyperref}
% \usepackage[francais]{bab... | {"hexsha": "2bb73681426d9388a83621775fae7d0ebf1e3edb", "size": 24481, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "Writeup/nonconvex2.tex", "max_stars_repo_name": "danielfreeman11/convex-nets", "max_stars_repo_head_hexsha": "252a8230845fb2076221113ac8cabfade5152bfb", "max_stars_repo_licenses": ["MIT"], "max_sta... |
import cv2
import numpy as np
class Imageprocessor:
def __init__(self):
print ("Initializing image processor ..")
print ("Done ...")
def abs_sobel_threshold(self, image, orient='x', sobel_kernel=3, sobel_threshold=(0, 255)):
# Convert to grayscale
gray = cv2.c... | {"hexsha": "f50cb78bbb39c3b575376b50152ce2725fe998c4", "size": 5254, "ext": "py", "lang": "Python", "max_stars_repo_path": "imageprocessor/imageprocessor.py", "max_stars_repo_name": "nguyenbuiUCSD/Advanced-Lane-Finding", "max_stars_repo_head_hexsha": "f54c75100fa4d06cb4bbe439180056ca9928ff55", "max_stars_repo_licenses"... |
"""
Run this file to setup the tree system used for initial scoring.
Look at parameters.py before running!
What does this script do?
Before the program starts, an estimate of duration and disk space will be calculated.
This is fairly accurate except for the duration of the tree fase which is a guesstimate.
Then the ... | {"hexsha": "0df5104ce3fe523b96060f3608de90276d225d43", "size": 9372, "ext": "py", "lang": "Python", "max_stars_repo_path": "offline.py", "max_stars_repo_name": "DaanS8/ScalableRecognition", "max_stars_repo_head_hexsha": "f642f78d5e809b339ba0adad8aeb2e4e9031a5ca", "max_stars_repo_licenses": ["MIT"], "max_stars_count": n... |
import sys
sys.path.remove('/opt/ros/kinetic/lib/python2.7/dist-packages')
import cv2
import numpy as np
#定义窗口名称
winName='Colors of the rainbow'
#定义滑动条回调函数,此处pass用作占位语句保持程序结构的完整性
def nothing(x):
pass
img_original=cv2.imread('lane.png')
#颜色空间的转换
img_hsv=cv2.cvtColor(img_original,cv2.COLOR_BGR2HSV)
#新建窗口
cv2.namedWin... | {"hexsha": "35111b9e034b54352d024e5bf8dcb7ec672d33c6", "size": 1404, "ext": "py", "lang": "Python", "max_stars_repo_path": "sensing/lane_detection/hsv_adjust.py", "max_stars_repo_name": "lnexenl/XTDrone", "max_stars_repo_head_hexsha": "f0402d44ac3b9a8435cfc67aea769ef659892010", "max_stars_repo_licenses": ["MIT"], "max_... |
import sys
import glob
import os
import math
import numpy as np
import cv2
from cv2 import aruco
class GeometricCalibration:
def __init__(self, cam, projector, checker_pattern=(23, 7), checker_size=0.01, checker_pixels=60,
width_mirror=0.3556, height_mirror=0.254, marker_offset=0.005, dict_aruco=... | {"hexsha": "290dedde904ca1dd8263fc6149c619cee0e9bf97", "size": 11888, "ext": "py", "lang": "Python", "max_stars_repo_path": "Calibrations/.ipynb_checkpoints/GeometricCalibration-checkpoint.py", "max_stars_repo_name": "merlzbert/SkinScan", "max_stars_repo_head_hexsha": "684129c20b671db0a338ab832fa512c095f0cb60", "max_st... |
################ Define Asymmetric Symbolic Error-based Intervals ##############
struct AsymESIP{F<:AbstractPolytope}
equation
factors
errors
domain::F
end
function init_asym_esip(input::AbstractHyperrectangle)
n = dim(input)
equation = [I zeros(n)]
factors = zeros(n, 0)
errors = zer... | {"hexsha": "3b4197a496a267fd4bbead0abe07879e994fb176", "size": 958, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/reachability/AsymESIP/asym_esip.jl", "max_stars_repo_name": "phK3/NeuralVerification.jl", "max_stars_repo_head_hexsha": "6c71231279c9474908f6db08a573c4b2b8cf2f01", "max_stars_repo_licenses": ["M... |
import numpy as np
from .context import alma
def test_emit():
e = alma.image.Emit()
def test_list_models():
e = alma.image.Emit()
assert(isinstance(e.select(list_models=True),list))
def test_blackbody():
e = alma.image.Emit(model='blackbody')
assert(np.allclose(e.emit(1,[1,100],1000),
... | {"hexsha": "aa74fbc23fd788c87e3036a940f2a1ebc347069d", "size": 1169, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_emit.py", "max_stars_repo_name": "drgmk/alma", "max_stars_repo_head_hexsha": "85e0a1d4bca179af4889c1687edf9b066cdc07ca", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 3, "max_s... |
<h1>Table of Contents<span class="tocSkip"></span></h1>
<div class="toc"><ul class="toc-item"><li><span><a href="#Array-Creation-Function" data-toc-modified-id="Array-Creation-Function-1"><span class="toc-item-num">1 </span>Array Creation Function</a></span><ul class="toc-item"><li><span><a href="#Generate-a... | {"hexsha": "675c6811022394958e67a04c4dcc739b6a85aa71", "size": 8225, "ext": "py", "lang": "Python", "max_stars_repo_path": "book/_build/jupyter_execute/numpy/01-array _creation_function.py", "max_stars_repo_name": "hossainlab/dsnotes", "max_stars_repo_head_hexsha": "fee64e157f45724bba1f49ad1b186dcaaf1e6c02", "max_stars... |
'''## Multiple Linear Regression ##'''
'''## importing libraries ##'''
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
'''## importing dataset ##'''
dataset = pd.read_csv("50_Startups.csv")
'''### segragating the values ##'''
X = dataset.iloc[:,:-1].values
Y = dataset.iloc[:,4].values
'''... | {"hexsha": "fbedb8f59550635d6d28bb0e97209ec99f7dd824", "size": 1187, "ext": "py", "lang": "Python", "max_stars_repo_path": "Multiple_Linear_Regression/MLR.py", "max_stars_repo_name": "ranjankaul/Machine_Learning", "max_stars_repo_head_hexsha": "c64510e450ecbae2cd4b040093370fdd3b5a1f94", "max_stars_repo_licenses": ["MIT... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.