text stringlengths 0 1.25M | meta stringlengths 47 1.89k |
|---|---|
import ismore.invasive.bmi_ismoretasks as bmi_ismoretasks
from riglib import experiment
from features.hdf_features import SaveHDF
from ismore.brainamp_features import SimBrainAmpData
import datetime
import numpy as np
import matplotlib.pyplot as plt
from ismore.ismore_tests import test_clda
import tables
import pickle
... | {"hexsha": "dc976165435915a33aafba9f370fee44d7b6db24", "size": 4566, "ext": "py", "lang": "Python", "max_stars_repo_path": "ismore/ismore_tests/test_clda_tasks.py", "max_stars_repo_name": "DerekYJC/bmi_python", "max_stars_repo_head_hexsha": "7b9cf3f294a33688db24b0863c1035e9cc6999ea", "max_stars_repo_licenses": ["Apache... |
from typing import Dict
import math
import torch
from torch import nn, Tensor
from scipy.sparse.linalg import eigs, LinearOperator, eigsh, lobpcg
from ..data import cat, unbind
from .. import properties as p
from ..utils import grad
def normalize(x: Tensor):
return x / x.flatten(1).norm(p=2, dim=1)[:, None, None]... | {"hexsha": "9421084db396759d93ef91103ce52ede391fe3e7", "size": 3876, "ext": "py", "lang": "Python", "max_stars_repo_path": "torchfes/ts/dimer.py", "max_stars_repo_name": "AkihideHayashi/torchfes1", "max_stars_repo_head_hexsha": "83f01525e6071ffd7a884c8e108f9c25ba2b009b", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
from collections import OrderedDict
import cv2
import logging
import numpy as np
import gym
from typing import Any, List
from ray.rllib.utils.annotations import override, PublicAPI
from ray.rllib.models.preprocessors import Preprocessor, get_preprocessor
from ray.rllib.utils.spaces.repeated import Repeated
from ray.rl... | {"hexsha": "32c3034af7f322dc867d349f4bdf52d26b2c34d5", "size": 1885, "ext": "py", "lang": "Python", "max_stars_repo_path": "preprocessor/two_input_preprocessor.py", "max_stars_repo_name": "michal-choinski/sequential_moral_dilemmas", "max_stars_repo_head_hexsha": "c6364672b996f04e4c791e20fd8b96eb5cf15b91", "max_stars_re... |
import numpy as np
from yt.testing import \
fake_random_ds, \
assert_equal, \
assert_almost_equal
def setup():
from yt.config import ytcfg
ytcfg["yt","__withintesting"] = "True"
def test_cut_region():
# We decompose in different ways
for nprocs in [1, 2, 4, 8]:
ds = fake_random_d... | {"hexsha": "6ad93ab6738e3e1325924a415186e0c34b1631f0", "size": 2149, "ext": "py", "lang": "Python", "max_stars_repo_path": "yt/data_objects/tests/test_extract_regions.py", "max_stars_repo_name": "bkhamesra/yt-EinsteinToolkit", "max_stars_repo_head_hexsha": "576bf88b5cd706fd577c513c23b1db07ec5f4cd2", "max_stars_repo_lic... |
import ROOT
import pandas as pd
import numpy as np
import root_pandas
from root_numpy import fill_hist
import object_selection
import uproot_methods
#import selection
def runs_40(evt):
pass_run_selection = ( evt["run"] < 165970 ) | ((evt["run"] > 166782) & (evt["run"]<171050))
return pass_run_selection
def ... | {"hexsha": "7cdd37b2d14bc60369ae27705a16818dbed87df3", "size": 17214, "ext": "py", "lang": "Python", "max_stars_repo_path": "analysis/selection/trigger_eff.py", "max_stars_repo_name": "llayer/cmsopen", "max_stars_repo_head_hexsha": "876e35eb4dfdf727ae91be5c2db29fc087325db7", "max_stars_repo_licenses": ["Apache-2.0"], "... |
import torch
import torchvision
from torch.utils import data
import numpy as np
from PIL import Image
import os
import csv
import sys
import cv2
class SequenceDataset(data.Dataset):
def __init__(self, sequence_dirs, training_dir, transform):
self._sequence_dirs = sequence_dirs
self._training_dir =... | {"hexsha": "48a9d5a534d27e31d2566d019b2f89adafa14a79", "size": 2842, "ext": "py", "lang": "Python", "max_stars_repo_path": "dataset.py", "max_stars_repo_name": "Vaderico/LSTM-Camera-Game", "max_stars_repo_head_hexsha": "3ccc05f2f6ea5c06eb36f4e5a755dca51d913bcc", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nu... |
[STATEMENT]
lemma Re_Ln [simp]: "z \<noteq> 0 \<Longrightarrow> Re(Ln z) = ln(norm z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. z \<noteq> 0 \<Longrightarrow> Re (Ln z) = ln (cmod z)
[PROOF STEP]
by (metis exp_Ln ln_exp norm_exp_eq_Re) | {"llama_tokens": 114, "file": null, "length": 1} |
import numpy as np
np.random.seed(1234567)
import tensorflow as tf
tf.random.set_seed(1234567)
import random
random.seed(1234567)
import re, os, csv, math, operator
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, LeakyReLU
from tensorflow.keras.models import Model
from tensorf... | {"hexsha": "495563e7c7ad75801dda0c0016c57d7e7e2967b3", "size": 3728, "ext": "py", "lang": "Python", "max_stars_repo_path": "brnet/BRNet.py", "max_stars_repo_name": "GuptaVishu2002/BRNet", "max_stars_repo_head_hexsha": "2f121887504d151ff1116bfd3d935cc2ccb5fdbe", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nul... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Oct 20 20:36:30 2021
@author: ml
"""
from code.feature_extraction.has_most_common_words import HasMostCommonWords
import pandas as pd
import numpy as np
import unittest
class HasMostCommonWordsTest(unittest.TestCase):
def setUp(self):
... | {"hexsha": "bef638ad00a37701f72281d67b116026cd0d8c12", "size": 1347, "ext": "py", "lang": "Python", "max_stars_repo_path": "test/feature_extraction/test_most_common_words.py", "max_stars_repo_name": "zqirui/MLinPractice", "max_stars_repo_head_hexsha": "70c054903a5238725e802fa887862c35a8253cc3", "max_stars_repo_licenses... |
# -*- coding: utf-8 -*-
import unittest
import numpy as np
import pandas as pd
from . import DATADIR
from os.path import join
from ridge.models import ConditionalLogit
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import train_test_split
"""
Horse Racing Dataset
JRAにより2010年から2016年にかけて... | {"hexsha": "5abb53125da33df3ca553b452ded0113aa269dea", "size": 2659, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_conditional_logit.py", "max_stars_repo_name": "moriaki3193/ridge", "max_stars_repo_head_hexsha": "8fbcf1cd72d6b56786170f1ac4af3d8b8a9d1986", "max_stars_repo_licenses": ["MIT"], "max_sta... |
import copy
import logging
import random
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from .... import extensions as E
from ..utils.assigner import map_rois_to_level
logger = logging.getLogger('global')
def build_ibconv(inplanes, pool_size, cfg):
method = cfg['predict_k... | {"hexsha": "d6d5076a896aed45c38fb511e3b21b05d8f0422d", "size": 5934, "ext": "py", "lang": "Python", "max_stars_repo_path": "unn/models/heads/pair_head_group/ibconv.py", "max_stars_repo_name": "zongdaoming/TinyTransformer", "max_stars_repo_head_hexsha": "8e64f8816117048c388b4b20e3a56760ce149fe3", "max_stars_repo_license... |
# -*- coding: utf8
from collections import defaultdict
from graphviz import Graph
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
def mplot(df, labels=None):
M = df.values.copy()
if labels is not None:
M = M[np.argsort(labels)]
M = M[:, np.argsort(labels)]
plt.mats... | {"hexsha": "ff5631930b6375a92db30a1eb475a9ae9dc29997", "size": 3146, "ext": "py", "lang": "Python", "max_stars_repo_path": "myfsm.py", "max_stars_repo_name": "flaviovdf/playlist-analysis", "max_stars_repo_head_hexsha": "b9f05ab3b9a729aef2105dcd9365e65b0d84f10a", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_c... |
__author__ = 'Georgios Rizos (georgerizos@iti.gr)'
import numpy as np
def update_randic_index(randic_graph):
"""
Calculates the Randic index for a graph.
We maintain a graph/tree that has the same edges as the original tree.
The edge values however are the Randic values for each edge.
Input: -... | {"hexsha": "a803cfcbeb99324ff8cdd64824901eeae5a8205a", "size": 3022, "ext": "py", "lang": "Python", "max_stars_repo_path": "news_popularity_prediction/features/branching.py", "max_stars_repo_name": "MKLab-ITI/news-popularity-prediction", "max_stars_repo_head_hexsha": "5f66982c659de017665116297bb4fd29ca13f835", "max_sta... |
[GOAL]
R : Type u_1
inst✝ : Semiring R
r✝ : R
f✝ : R[X]
r c : R
f : R[X]
⊢ AddHom.toFun
{ toFun := fun f => comp f (X + ↑C r),
map_add' := (_ : ∀ (f g : R[X]), comp (f + g) (X + ↑C r) = comp f (X + ↑C r) + comp g (X + ↑C r)) }
(c • f) =
↑(RingHom.id R) c •
AddHom.toFun
{ toFun := f... | {"mathlib_filename": "Mathlib.Data.Polynomial.Taylor", "llama_tokens": 4170} |
/*
@copyright Louis Dionne 2015
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.hpp>
#include <boost/hana/assert.hpp>
#include <boost/hana/concept/group.hpp>
#include <boost/hana/tuple.hpp>
#include <la... | {"hexsha": "a1f66a6a8970ca3344f54b493df6f3cc174a77ab", "size": 613, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "test/group.cpp", "max_stars_repo_name": "qicosmos/hana", "max_stars_repo_head_hexsha": "b0f8cf2bf19d491b7b739dcb7b8d7497b0e5829f", "max_stars_repo_licenses": ["BSL-1.0"], "max_stars_count": 2.0, "max... |
[STATEMENT]
lemma paths_edge_finite: "finite (\<Union>(edges_of_walk ` paths))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. finite (\<Union> (edges_of_walk ` paths))
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
1. finite (\<Union> (edges_of_walk ` paths))
[PROOF STEP]
have "\<Union>(edges_of... | {"llama_tokens": 553, "file": "Menger_DisjointPaths", "length": 8} |
# Define the theoretic model
################### Assemble matrix and vector #####################
# Weak form of the Helmholtz equation :
# Hz: a(p,u,v)=Λ⋅∇v⋅ξ(p)Λ⋅∇u-k²μv⋅u
# Material distribution
#ξ0(x,ϵ1,ϵ2) = x[2]>0 ? 1/ϵ1 : 1/ϵ2
#ξd(p,ϵmin,ϵmax)= 1/(ϵmin + (ϵmax-ϵmin)*p) - 1/ϵmin # in the design region
#a0(u,v,ϵ1... | {"hexsha": "82ced258c5945099221675b5430888a8c90dcba6", "size": 1348, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "FEM/Module/Model.jl", "max_stars_repo_name": "Tiamat-Tech/hpinn", "max_stars_repo_head_hexsha": "1a59c28dc52af26d719b6a6b2adf1f12f552fae4", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_cou... |
#!/usr/bin/env python
import os
import sys
import numpy as np
if len(sys.argv) < 3:
print('Usage: gen_input.py <sms_grd_file> <nobc>')
sys.exit(0)
sms_grd_file = sys.argv[1]
nobc = int(sys.argv[2])
# read grid and depth from sms .grd file
fl = open(sms_grd_file, 'r')
# read head info
fl.readline()
header = fl.r... | {"hexsha": "9098361f3cde19058d6bc10fe2755571827f2eef", "size": 2400, "ext": "py", "lang": "Python", "max_stars_repo_path": "preprocess/gen_input.py", "max_stars_repo_name": "wangrenz/fvcom_pytools", "max_stars_repo_head_hexsha": "b5929a674fab3b42cf82767392960e4e6ee6cd3a", "max_stars_repo_licenses": ["BSD-3-Clause"], "m... |
import pathlib
import argparse
import random
import re
import sys
import numpy as np
import scipy
from matplotlib import pyplot as plt
from pandas import read_csv
import sklearn
from sklearn.datasets import load_breast_cancer
from sklearn import clone
from sklearn.metrics import make_scorer, matthews_corrcoef
from skle... | {"hexsha": "a8d3b237fe4759ce43026375045c20f0077b7bd6", "size": 21528, "ext": "py", "lang": "Python", "max_stars_repo_path": "experiments/case_studies.py", "max_stars_repo_name": "lblum95/Box-Cox-for-machine-learning", "max_stars_repo_head_hexsha": "e66f2e43b7fcb99a5802d944ff90454dd964bba2", "max_stars_repo_licenses": [... |
# simd version is defined in simd.jl
@generated function _map(f, xs::Vararg{AbstractTensor, N}) where {N}
S = promote_space(map(Space, xs)...)
exps = map(indices(S)) do i
vals = [:(xs[$j][$i]) for j in 1:N]
:(f($(vals...)))
end
TT = tensortype(S)
return quote
@_inline_meta
... | {"hexsha": "f202d6831bf2a9d8cdfb054d7f850ce4bb9209a5", "size": 21878, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/ops.jl", "max_stars_repo_name": "KeitaNakamura/Tensorial.jl", "max_stars_repo_head_hexsha": "cce423c30ab57c3ed3a5f03b499dc53b66aa23fd", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 2... |
import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
import warnings
import numpy as np
import re
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.base import BaseEstimator, TransformerMixin
import json
import pandas as pd
from scipy.spatial.distanc... | {"hexsha": "ab5cabcdb897271b181862467dae1dc5ec0ad174", "size": 41166, "ext": "py", "lang": "Python", "max_stars_repo_path": "Packs/Base/Scripts/DBotFindSimilarIncidents/DBotFindSimilarIncidents.py", "max_stars_repo_name": "cbrake1/content", "max_stars_repo_head_hexsha": "5b031129f98935c492056675eeee0fefcacbd87b", "max_... |
'''
Python script to analyse DNA single-stranded tile sequences. Run with --help for options. Python2 and python3 compatible.
Shipped with DNA single-stranded tile (SST) sequence designer used in the following publication.
"Diverse and robust molecular algorithms using reprogrammable DNA self-assembly"
Woods*, Doty*... | {"hexsha": "ce24e36744f1b0185b044153fb50a7c6214d7295", "size": 83443, "ext": "py", "lang": "Python", "max_stars_repo_path": "analyse_seqs.py", "max_stars_repo_name": "DNA-and-Natural-Algorithms-Group/SST-sequence-designer", "max_stars_repo_head_hexsha": "7232cd667ac4fcef08c6470b301b4b71ff4cf0c9", "max_stars_repo_licens... |
import os.path
import scipy.io as sio
import numpy as np # for algebraic operations, matrices
import keras.models
from keras.models import Sequential
from keras.layers.core import Dense, Activation, Flatten, Dropout # , Layer, Flatten
# from keras.layers import containers
from keras.models import model_from_json,Mode... | {"hexsha": "2109cd83cd9e5d9e5a9ceb4961c452b330afafb7", "size": 9888, "ext": "py", "lang": "Python", "max_stars_repo_path": "networks/multiclass/CNN2D/InceptionNet/multiclass_InceptionNet.py", "max_stars_repo_name": "so2liu/CNNArt", "max_stars_repo_head_hexsha": "9d91bf08a044e7d5068f8446663726411d2236dd", "max_stars_rep... |
[STATEMENT]
lemma clock_simVal:
"sim_val Clock.MC clock_simMC clock_sim"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. sim_val Clock.MC clock_simMC clock_sim
[PROOF STEP]
by (rule sim_valI) (simp add: clock_simVal_def clock_sim_def) | {"llama_tokens": 100, "file": "KBPs_ClockView", "length": 1} |
interface draw_circle
module procedure draw_circle_sc, draw_circle_rgb
end interface
private :: plot, draw_circle_toch
| {"hexsha": "6343a5c48a91d87edd89b551f73984e8501d9ed0", "size": 123, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "Task/Bitmap-Midpoint-circle-algorithm/Fortran/bitmap-midpoint-circle-algorithm-1.f", "max_stars_repo_name": "LaudateCorpus1/RosettaCodeData", "max_stars_repo_head_hexsha": "9ad63ea473a958506c041077... |
import warnings
import numpy as np
with warnings.catch_warnings():
warnings.simplefilter(action='ignore', category=FutureWarning)
import xgboost as xgb
class XGBoost:
def __init__(self, max_depth=5):
self.bst = None
self.max_depth = max_depth
def fit(self, x, y, param=None, feature... | {"hexsha": "19eb6ee89a1e1908f1ca0b4950a1084031d1c974", "size": 780, "ext": "py", "lang": "Python", "max_stars_repo_path": "cacp_examples/example_custom_classifiers/xgboost.py", "max_stars_repo_name": "sylwekczmil/cacp", "max_stars_repo_head_hexsha": "7322f104547582939c75b8ae8ad59ac1fe0298aa", "max_stars_repo_licenses":... |
#!/usr/bin/env python
"""
Create generic LPU and simple pulse input signal.
"""
from itertools import product
import sys
import numpy as np
import h5py
import networkx as nx
def create_lpu_graph(lpu_name, N_sensory, N_local, N_proj):
"""
Create a generic LPU graph.
Creates a graph containing the neuro... | {"hexsha": "d958819b8f22022f5383af24f25348c35f17244b", "size": 13333, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/generic/data/gen_generic_lpu.py", "max_stars_repo_name": "MangoHaha/neurodriver", "max_stars_repo_head_hexsha": "9f5be070f1ebece8b807c96ff149cb12f49a0a49", "max_stars_repo_licenses": ["B... |
#!/usr/bin/python3
"""
_ _
(_) | |
_ __ _ __ __ ___ | |
| '__| | | \ \/ / / _ \ | |
| | | | > < | __/ | |
|_| |_| /_/\_\ \___| |_|
PyTessy
=======
Tesseract-OCR, faster!
This module allows faster access to Tesseract-OCR from Python scripts.
This mod... | {"hexsha": "0de1e70b9a079e4d75f69568e200252d5fac9939", "size": 23733, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/pytessy.py", "max_stars_repo_name": "jevgienij/pytessy", "max_stars_repo_head_hexsha": "cd262180d2ff09c866a69c9710909b86162421db", "max_stars_repo_licenses": ["BSL-1.0"], "max_stars_count": n... |
#!/usr/bin/env python3
"""Plot the live microphone signal(s) with matplotlib.
Matplotlib and NumPy have to be installed.
"""
import math
from matplotlib.animation import FuncAnimation
import matplotlib.pyplot as plt
import numpy as np
import rtmixer
import sounddevice as sd
window = 200 # ms
interval = 30 # ms
bl... | {"hexsha": "b39bedb8a304c3ed922fcc7b553bfd8bcf5315c8", "size": 2484, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/plot_input.py", "max_stars_repo_name": "larsoner/python-rtmixer", "max_stars_repo_head_hexsha": "d7095f228f58d08fa69916d3657e4996526144cd", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
movies = ["Annie Hall", "Ben-Hur", "Casablanca", "Gandhi", "West Side Story"]
xs = [i + 0.1 for i, _ in enumerate(movies)]
print (xs)
print 15.0 / 100
print 15.0 // 100
grades = [83, 95, 91, 87, 70, 0, 85, 82, 100, 67, 73, 77, 0]
decile = lambda grade: grade // 10 * 10
print [decile(grade) for grade in grades]
i... | {"hexsha": "7f5b6497eae166a736abcf52f70f9ce71fdb571e", "size": 363, "ext": "py", "lang": "Python", "max_stars_repo_path": "hadoopcourse/Test.py", "max_stars_repo_name": "arunma/Python_DataScience", "max_stars_repo_head_hexsha": "2f23de4517a761f373ef3cd3e708e46e84c62719", "max_stars_repo_licenses": ["Apache-2.0"], "max_... |
\documentclass{IEEEtran}
\usepackage{graphicx}
\usepackage{hyperref}
\title{A mutual information based medical image registration methodology based on JVHW entropy estimator}
\author{Sihan Li, Tsinghua University}
\begin{document}
\maketitle
\begin{abstract}
Mutual information (MI) based medical image regis... | {"hexsha": "6b6665a5524416d27a409f4425ad47aa21ef2251", "size": 13456, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "week4/reoport/task4.tex", "max_stars_repo_name": "ThomasLee969/stanford-project", "max_stars_repo_head_hexsha": "ab1e576446d417710e4a5a993be6b7216ce0853a", "max_stars_repo_licenses": ["MIT"], "max_... |
# In[1]:
# !pwd
import numpy as np
import time
import sys
import matplotlib.pyplot as plt
from IPython.display import display, Markdown
import cat_utils
train_set_x, train_set_x_orig, train_set_y, test_set_x, test_set_x_orig, test_set_y, classes = cat_utils.load_normalized_dataset()
print(train_set_x.shape)
# ## ... | {"hexsha": "b820c738aabfffcea45d9b99e25eafa17957dc0b", "size": 12178, "ext": "py", "lang": "Python", "max_stars_repo_path": "notebooks/Supervised-Learning-Explained-3-n-layers.py", "max_stars_repo_name": "knockdata/knockdata.github.io", "max_stars_repo_head_hexsha": "3a9f7d29c7706143e3710352fa00f7144e1a366d", "max_star... |
import argparse
import logging
import time
import cv2, time
from ptz_api import *
import numpy as np
from tf_pose.estimator import TfPoseEstimator
from tf_pose.networks import get_graph_path, model_wh
logger = logging.getLogger('TfPoseEstimator-WebCam')
logger.setLevel(logging.DEBUG)
ch = logging.StreamHandler()
ch.... | {"hexsha": "0da0d94372cb16e9e2f9210b01e918a3ac6943c7", "size": 5321, "ext": "py", "lang": "Python", "max_stars_repo_path": "pose_estimation.py", "max_stars_repo_name": "msun98/open_pose", "max_stars_repo_head_hexsha": "f7ddc8d862fd1afcd4946d104f393f613e8fd1d1", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_coun... |
#!/usr/bin/env python
"""model_sensitivity.py: Sensitivity test experiments python program for Doppler shift"""
__author__ = "Chakraborty, S."
__copyright__ = "Copyright 2020, SuperDARN@VT"
__credits__ = []
__license__ = "MIT"
__version__ = "1.0."
__maintainer__ = "Chakraborty, S."
__email__ = "shibaji7@vt.edu"
__sta... | {"hexsha": "29d97da9ca96549c56766b1a4531bae716911900", "size": 5345, "ext": "py", "lang": "Python", "max_stars_repo_path": "code_rt_sd/config/model_sensitivity.py", "max_stars_repo_name": "shibaji7/Collaboration_NCAR", "max_stars_repo_head_hexsha": "c27e0ad8a1f0c6b2e66fa07e6cf57f98c4389899", "max_stars_repo_licenses": ... |
from ._Reduction import _Reduction
from ..DataPreparation import DataPreparation
import numpy as np
from sklearn.neighbors import KNeighborsClassifier
from time import process_time
from ._NNGraph import _NNGraph
from sklearn.preprocessing import Normalizer
class DROP1(_Reduction):
"""
Class applying Decrementa... | {"hexsha": "4c788ab6c190181dd3c187ac5522f08e6a729836", "size": 5256, "ext": "py", "lang": "Python", "max_stars_repo_path": "InstanceReduction/Reduction/DROP1.py", "max_stars_repo_name": "paultro708/DataReduction", "max_stars_repo_head_hexsha": "ef63b74f3c93e7eb7887c8bc2f25ce0200460d3d", "max_stars_repo_licenses": ["MIT... |
module SmallFixedSizeSets
export Set0, Set1, Set2, Set3, Set4, Set5, SmallFixedSizeSet
export SFSSFromOrderedVec, SFSSFromVec, SFSSFromSet
export SFSS_issubset, SFSS_intersect, SFSS_setdiff, SFSS_union
const Set0 = NTuple{0,Int32}
const Set1 = NTuple{1,Int32}
const Set2 = NTuple{2,Int32}
const Set3 = NTuple{3,Int32}
... | {"hexsha": "dbc6c2d9b0f202500286dda1c5a6a1cfe8020924", "size": 3958, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/SmallFixedSizeSets.jl", "max_stars_repo_name": "arbenson/SmallFixedSizeSets.jl", "max_stars_repo_head_hexsha": "7ed5f39b57603b10aff725764aa2df6dba92da98", "max_stars_repo_licenses": ["MIT"], "m... |
# ใช้ตัดคำภาษาไทย
import deepcut
# ใช้งาน regex
import re
# จัดการเกี่ยวกับ array
import numpy as np
# สำหรับทำ classify และทดสอบโมเดล
from nltk import FreqDist, precision, recall, f_measure, NaiveBayesClassifier
from nltk.classify import apply_features
from nltk.classify import util
# สำหรับสร้างชุดข้อมูลสำหรับ train ... | {"hexsha": "9e03bbacc94eb0ddb2b7b21b091d60a10d5089b4", "size": 748, "ext": "py", "lang": "Python", "max_stars_repo_path": "tagging/Sentimen.py", "max_stars_repo_name": "punch872/EyeWarnYou", "max_stars_repo_head_hexsha": "71ea21a8b3f1ae213478d735a10a240524b89702", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
from ..solution import Solution
from ..mat import each_index
from heapq import heappush, nlargest, nsmallest
from math import inf
import numpy as np
from numpy.typing import NDArray
def numbers(line: str) -> tuple[dict, dict]:
num2pos: dict = {}
turn2num: dict = {}
numbers = [int(digit) for digit in line... | {"hexsha": "432ec677abf66ef110ece93328f7c0e917129234", "size": 2286, "ext": "py", "lang": "Python", "max_stars_repo_path": "advent/y2021/d4.py", "max_stars_repo_name": "ljk233/Advent.py", "max_stars_repo_head_hexsha": "f21c9ffc1ae5e490c35ca8c63e5000892b9dc5f2", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nul... |
# interoperability with Distributions
import Distributions: Distribution,Univariate,Continuous,Triweight,AbstractMixtureModel,
cdf,pdf,quantile,logcdf,logpdf,ccdf,cquantile,invlogcdf,invlogccdf
typealias TriDist Triweight
typealias MixDist AbstractMixtureModel{Univariate,Continuous}
typealias Un... | {"hexsha": "fa554529b75c5e92c9b8e44fdbe3d0de47c5eaf2", "size": 1458, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/interop/Distributions.jl", "max_stars_repo_name": "J-Sarnoff/FLOAT65.jl", "max_stars_repo_head_hexsha": "f88c9a5ae969b6169087fa36d80fcac22ea62e0d", "max_stars_repo_licenses": ["MIT"], "max_star... |
#
# Copyright (c) 2009-2021, Scott D. Peckham
#
# Started from "model_tests.py" on 3/14/13 to create
# a BMI-compliant version for a hands-on example.
#
# Show how to inherit BMI functions from BMI_base.py.
# Previous version info.
# July 5-7, 2008
# Modified: July 23, 2008 (S. Peckham)
# v = sqrt... | {"hexsha": "93de49e10762a7b3245e12b3ce4974c002f01925", "size": 25170, "ext": "py", "lang": "Python", "max_stars_repo_path": "code/water_tank_bmi_2021.py", "max_stars_repo_name": "peckhams/water_tank_bmi", "max_stars_repo_head_hexsha": "d24a9a80cd3d34c3b0b5fcafa5c431a51655a6ba", "max_stars_repo_licenses": ["MIT"], "max_... |
+incdir+${VMON}/src/client/sv
${VMON}/src/client/sv/vmon_client_uvm_pkg.sv
| {"hexsha": "3ffc8b941afc03306f5c6b13a0bf4cc2470c1f54", "size": 77, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "src/client/sv/vmon_sv_client_uvm.f", "max_stars_repo_name": "mballance/vmon", "max_stars_repo_head_hexsha": "e26df3e2aad13af27e835ffc564fb2671d3bd671", "max_stars_repo_licenses": ["Apache-2.0"], "ma... |
from os.path import join
import numpy as np
from numpy.testing import assert_almost_equal
import pytest
from SciDataTool.Functions.Plot.plot_2D import plot_2D
from SciDataTool.Functions.Plot.plot_3D import plot_3D
from pyleecan.Classes.ImportGenPWM import ImportGenPWM
from pyleecan.Classes.InputVoltage import Input... | {"hexsha": "586cb6bddceaf515f8c91c789340b8bdee361453", "size": 13250, "ext": "py", "lang": "Python", "max_stars_repo_path": "Tests/Validation/Electrical/test_EEC_ELUT_PMSM.py", "max_stars_repo_name": "thalesmaoa/pyleecan", "max_stars_repo_head_hexsha": "c4fdc6362fdeba3d0766d5d1df3ff9c97c3f9fa3", "max_stars_repo_license... |
"""
Nautilus version 2
"""
from typing import Dict, List, Optional, Union, Callable
import numpy as np
from desdeo_problem.Variable import variable_builder
from desdeo_problem.Objective import VectorObjective, _ScalarObjective
from desdeo_problem.Problem import MOProblem
from desdeo_tools.interaction.request import B... | {"hexsha": "7c7ccaf258b5d52db8484c0cca6daea063f90e8c", "size": 50556, "ext": "py", "lang": "Python", "max_stars_repo_path": "desdeo_mcdm/interactive/NautilusV2.py", "max_stars_repo_name": "giomara-larraga/desdeo-mcdm", "max_stars_repo_head_hexsha": "26901b782912294ac6f29114acf95569a35a796f", "max_stars_repo_licenses": ... |
import numpy as np
from ghx.base_properties import BasePropertiesClass
from ghx.my_print import PrintClass
from ghx.pipe import PipeClass
from ghx.soil import SoilClass
class BoreholeClass:
def __init__(self, json_data, print_output):
try:
self.name = json_data['Name']
e... | {"hexsha": "0711a2c631b73f1a0983c6aaf121ff5cfcdb816e", "size": 7111, "ext": "py", "lang": "Python", "max_stars_repo_path": "ghx/borehole.py", "max_stars_repo_name": "mitchute/Open-GHX", "max_stars_repo_head_hexsha": "7a88872c36200c620cfd07994119cfb243a998c9", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 4, "m... |
[STATEMENT]
lemma append_code [code]:
"append xq yq = Lazy_Sequence (\<lambda>_. case yield xq of
None \<Rightarrow> yield yq
| Some (x, xq') \<Rightarrow> Some (x, append xq' yq))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. Lazy_Sequence.append xq yq = Lazy_Sequence (\<lambda>_. case yield xq of None \<... | {"llama_tokens": 180, "file": null, "length": 1} |
using Plots
pyplot()
function plot_forecast(output, predictions, ix_trn, ix_val; tt=1, posterior=false)
T = length(output)
# Limits
ylims = [minimum(output[ix_trn[1]:end]), maximum(output[ix_trn[1]:end])]
# Plot training output
plot(ix_trn[1:tt:end], output[ix_trn[1:tt:end]], color="blue", ylim... | {"hexsha": "accd9cdf237082865b18b66df92b8ac70560b822", "size": 1193, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "experiments/visualisation.jl", "max_stars_repo_name": "biaslab/CDC2021-vmpNARMAX", "max_stars_repo_head_hexsha": "dcc640c21aef37cedbd625c8a380c747c0fb9fe5", "max_stars_repo_licenses": ["MIT"], "max... |
import numpy as np
__ORDERED__ = 0
__FELINESEG__ = 1
__FETRIANGLE__ = 2
__FEQUADRILATERAL__ = 3
__FETETRAHEDRON__ = 4
__FEBRICK__ = 5
__FEPOLYGON__ = 6
__FEPOLYHEDRON__ = 7
__NO_SHARE_CONNECTIVITY__ = -1
__TEC_FLOAT__ = 1
... | {"hexsha": "bb7e410337384b10918094d18458a1e347abdd40", "size": 10405, "ext": "py", "lang": "Python", "max_stars_repo_path": "pyvt/myio/binarytecplot/tecplot/zone/Zone.py", "max_stars_repo_name": "lvyu-imech/PyVT", "max_stars_repo_head_hexsha": "46a7de059de80b6873df51c375427ebca19cb4bd", "max_stars_repo_licenses": ["MIT... |
#include "InstructionFactory.h"
#include "InstructionOptions.h"
#include "../animations/Animation.h"
#include "../objects/Line.h"
#include "../objects/Circle.h"
#include "../objects/Rectangle.h"
#include "../objects/Spiral.h"
#include "../objects/CompositeObject.h"
#include <chrono>
#include <cmath>
#include <cassert... | {"hexsha": "e54c8d8da5c807c4b534d3b33e01e3d2189b045a", "size": 23141, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "src/holodeck/InstructionFactory.cpp", "max_stars_repo_name": "Chaostreff-Potsdam/laser_control", "max_stars_repo_head_hexsha": "8f4f2adea7fe36fec85c64811a81e37057519a06", "max_stars_repo_licenses":... |
from __future__ import print_function
from __future__ import division
import math
import sys
import timeit
import numpy as np
import falconn
def run_experiment(query_obj, queries, true_nns):
average_query_time_outside = 0.0
num_correct = 0
for query, true_nn in zip(queries, true_nns):
start = ... | {"hexsha": "15d3e2c277bbcee34ee298f2f7b16f872f336288", "size": 6616, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/python/benchmark/random_benchmark.py", "max_stars_repo_name": "1flei/FALCONN", "max_stars_repo_head_hexsha": "abe6996fa7f7c2debbd04e41e2acb564f71f370f", "max_stars_repo_licenses": ["MIT"], "ma... |
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 2 14:32:34 2017
@author: yume
"""
import numpy as np
import matplotlib.pyplot as plt
import unittest
import factors
class TestVelocity(unittest.TestCase):
def setUp(self):
self.factor = factors.Velocity(a=0.30, b=1.60, c=0.03, d_t=0.1)
def check_m_v(s... | {"hexsha": "1ac099ababebc1e5f69f68f58a6b3d2ca0538ff9", "size": 861, "ext": "py", "lang": "Python", "max_stars_repo_path": "test_velocity.py", "max_stars_repo_name": "is0280fp/Side-by-Side-Walking-Model", "max_stars_repo_head_hexsha": "c1bbed8c4ebd74f09729e77d1cbdf8772c038f36", "max_stars_repo_licenses": ["MIT"], "max_s... |
# View more python tutorial on my Youtube and Youku channel!!!
# Youtube video tutorial: https://www.youtube.com/channel/UCdyjiB5H8Pu7aDTNVXTTpcg
# Youku video tutorial: http://i.youku.com/pythontutorial
"""
Please note, this code is only for python 3+. If you are using python 2+, please modify the code accordingly.
... | {"hexsha": "6b1a9eed790b67ab0272e8353b3b3e8edc23b732", "size": 1263, "ext": "py", "lang": "Python", "max_stars_repo_path": "tensorflowTUT/tf5_example2/full_code.py", "max_stars_repo_name": "subshine/tutorials", "max_stars_repo_head_hexsha": "717320cbec72e3e68acefad9c367fc6c5ffb37b1", "max_stars_repo_licenses": ["MIT"],... |
from numba import njit
import numpy as np
def mirror_image(img_obj, pixels=1):
img_obj = np.vstack([img_obj, img_obj[-pixels:][:]])
img_obj = np.vstack([img_obj[:pixels][:], img_obj])
img_obj = np.hstack([img_obj[:][:pixels], img_obj])
img_obj = np.hstack([img_obj, img_obj[:][-pixels:]])
re... | {"hexsha": "ccc1c6c25b2899e74dbcb9e5e1ad6a12f5b46ad6", "size": 621, "ext": "py", "lang": "Python", "max_stars_repo_path": "nonlinear_diffusion.py", "max_stars_repo_name": "Erfi/CV1UniFreiburg", "max_stars_repo_head_hexsha": "272e4cd0cb0b8babf8f9eddfaefe9babd584c48c", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
from pybit import HTTP
from pybit.exceptions import InvalidRequestError
from datetime import datetime as dt
import numpy as np
import time
import config
def _print(message, level='info'):
"""
Just a custom print function. Better than logging.
"""
if level == 'position':
print(f'{dt.utcnow()}... | {"hexsha": "2b7514823fb43c56d163ab4ff9e1a0ce9786d0d4", "size": 12298, "ext": "py", "lang": "Python", "max_stars_repo_path": "run.py", "max_stars_repo_name": "xbrandonx/bybit-market-maker", "max_stars_repo_head_hexsha": "1b73210080b9dad7df0f40ce4ab86f5f4d76cd0d", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nu... |
SUBROUTINE slECEQ (DL, DB, DATE, DR, DD)
*+
* - - - - - -
* E C E Q
* - - - - - -
*
* Transformation from ecliptic coordinates to
* J2000.0 equatorial coordinates (double precision)
*
* Given:
* DL,DB dp ecliptic longitude and latitude
* (mean of date, IAU ... | {"hexsha": "9c7d8ed3ec79d1f03582609d698e7d84a2104033", "size": 2122, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "iraf.v2161/math/slalib/ecleq.f", "max_stars_repo_name": "ysBach/irafdocgen", "max_stars_repo_head_hexsha": "b11fcd75cc44b01ae69c9c399e650ec100167a54", "max_stars_repo_licenses": ["MIT"], "max_star... |
"""Framework for removing observations from a Dataset
Description:
------------
Observations that should be discarded can be identified by implementing rejectors. The rejectors can be applied
independently to the Dataset or they can be applied sequentially. In the sequential case the order of the rejectors
matter sin... | {"hexsha": "62ab524328d7001f6abcdee454f8df60d7ed8ac7", "size": 2813, "ext": "py", "lang": "Python", "max_stars_repo_path": "where/estimation/rejectors/__init__.py", "max_stars_repo_name": "ingridfausk/where", "max_stars_repo_head_hexsha": "b65398911075b7ddef3a3a1146efa428eae498fe", "max_stars_repo_licenses": ["MIT"], "... |
# -*- coding: utf-8 -*-
"""
Created on Mon Mar 7 06:41:33 2022
@author: user
"""
from collections import deque
from threading import Lock
from datetime import datetime
import matplotlib.pyplot as plt
import myo
import time
import psutil
import os
import sys
import csv
import numpy as np
from skle... | {"hexsha": "5d970998c4246e40cc1136b0170e7983b9d3b306", "size": 6868, "ext": "py", "lang": "Python", "max_stars_repo_path": "process_raw_emg_data.py", "max_stars_repo_name": "FluffyCherub/semg-classifier", "max_stars_repo_head_hexsha": "3b3ea10114c58932bf3d4bcec9f37f29a9369f51", "max_stars_repo_licenses": ["MIT"], "max_... |
import tensorflow as tf
import dirt
import dirt.matrices as matrices
import dirt.lighting as lighting
import sys,os
import numpy as np
from tensorflow.keras.layers import Layer
def build_projection(cam, w=640, h=480, x0=0, y0=0, nc=0.1, fc=10.0):
q = -(fc + nc) / float(fc - nc)
qn = -2 * (fc * nc) / float(fc... | {"hexsha": "4683916a11965a686a7d88b3ee54fef39f701993", "size": 11876, "ext": "py", "lang": "Python", "max_stars_repo_path": "NOL_model/diff_renderer.py", "max_stars_repo_name": "kyuhyoung/NOL", "max_stars_repo_head_hexsha": "e34bfffc3c630316aaae2dfc1de689390e515bb8", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
import numpy
import tensorflow
from tensorflow.keras.layers import Activation, Input, Conv1D, Conv2D, Dense, ZeroPadding1D, \
ZeroPadding2D, Flatten, Lambda
from tensorflow.keras.layers import Concatenate
from tensorflow.keras.models import Model
from flowket.deepar.layers import ExpandInputDim, PeriodicPadding
fr... | {"hexsha": "28ae4fefb065e1a5a23682bfcc49109b5c3a97bd", "size": 4472, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/simple_models.py", "max_stars_repo_name": "vigsterkr/FlowKet", "max_stars_repo_head_hexsha": "0d8f301b5f51a1bab83021f10f65cfb5f2751079", "max_stars_repo_licenses": ["MIT"], "max_stars_count"... |
from ._stopping_criterion import StoppingCriterion
from ..accumulate_data.ld_transform_bayes_data import LDTransformBayesData
from ..discrete_distribution import Lattice
from ..true_measure import Gaussian
from ..integrand import Keister
from ..util import MaxSamplesWarning, ParameterError, ParameterWarning
from numpy ... | {"hexsha": "48e68abf180d1ab539140982c889b947f242cb43", "size": 14540, "ext": "py", "lang": "Python", "max_stars_repo_path": "qmcpy/stopping_criterion/cub_qmc_bayes_lattice_g.py", "max_stars_repo_name": "kachiann/QMCSoftware", "max_stars_repo_head_hexsha": "0ed9da2f10b9ac0004c993c01392b4c86002954c", "max_stars_repo_lice... |
############################################################
# -*- coding: utf-8 -*-
#
# # # # # # #
# ## ## # ## # #
# # # # # # # # # # #
# # ## # ## ## ######
# # # # # # #
#
# Python-based Tool for interaction with the 10micron mounts
# GUI with PyQT5 fo... | {"hexsha": "57454e168f7a09306322a555c15b762a834c9132", "size": 16923, "ext": "py", "lang": "Python", "max_stars_repo_path": "mw4/gui/mainWmixin/tabSatellite.py", "max_stars_repo_name": "Raddock/MountWizzard4", "max_stars_repo_head_hexsha": "15efed77c1634461184e90a7cf6419eec0dec909", "max_stars_repo_licenses": ["Apache-... |
import cv2
import numpy as np
from epoxy import find_epoxy
import files
from epoxy import find_epoxy
from tube_analysis import get_bound_circ
# defines a red image used to make a nice output later on
def person_output(img, epoxy_mask, circle):
"""Takes in the raw image, base color, epoxy mask, and circle to ma... | {"hexsha": "d073b03a09fd1ea9dda6bf7072b065953ea0ea11", "size": 1302, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/image_output.py", "max_stars_repo_name": "StevenBenBooth/FPIX-XRay-Analysis", "max_stars_repo_head_hexsha": "5ebdb13616a87f492e1700a9648410625d0214bb", "max_stars_repo_licenses": ["MIT"], "max... |
""" SymPy (N-Ary) Expression Tree
The following script will extend the expression tree from SymPy,
allowing direct node manipulation for subexpression replacement.
The expression tree structure within SymPy expressions stores
subexpressions inside immutable tuples, preventing the client from
modify... | {"hexsha": "17baec4c70fb91f84d6a29265072f386bf3d3ca4", "size": 5026, "ext": "py", "lang": "Python", "max_stars_repo_path": "SIMDExprTree.py", "max_stars_repo_name": "goncalo-andrade/nrpytutorial", "max_stars_repo_head_hexsha": "4fbcb51c936864b442daefd176bd6a5277c00116", "max_stars_repo_licenses": ["BSD-2-Clause"], "max... |
#include <iostream>
#include "crypto/secure_string.h"
#include "mess/game/Game.h"
#include "mess/game/Python.h"
#include <boost/filesystem.hpp>
#include <boost/program_options.hpp>
#include <unistd.h> // getpass
enum MainFunctionReturnValues {
Success,
InvalidArgument,
PythonException,
StdException,
Unkno... | {"hexsha": "0a8faef2dbace33b86c538b2604273474c949326", "size": 2729, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "source/mess/server/main.cpp", "max_stars_repo_name": "nsubiron/mess-engine", "max_stars_repo_head_hexsha": "278580cca2b48ca7700a3c92525d34b5a72a545a", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
"""Model fitting engines
.. autosummary::
:toctree:
bayespy
numpy
"""
from . import bayespy
from . import numpy
| {"hexsha": "698e0a274096a1e05dc24af467125ed8e1187188", "size": 125, "ext": "py", "lang": "Python", "max_stars_repo_path": "gammy/models/__init__.py", "max_stars_repo_name": "malmgrek/gammy", "max_stars_repo_head_hexsha": "20ca24b45fa81ad29453123a13e19b3ff7ae33ab", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
subroutine test_advpert
use constants, only: zero
use mpimod, only: mype
use gsi_4dvar, only: nsubwin
use gridmod, only: nlon,nlat,lon2,lat2
use state_vectors, only: allocate_state,deallocate_state
use gsi_bundlemod, only: gsi_bundle
use gsi_4dcouplermod, only: gsi_4dcoupler_getpert_set
use gsi_4dcouplermod, only: gsi... | {"hexsha": "777a34e4d18ad598c1c1edb61b8a80aef9c417a6", "size": 1514, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "GEOSaana_GridComp/GSI_GridComp/test_advpert.f90", "max_stars_repo_name": "GEOS-ESM/GEOSana_GridComp", "max_stars_repo_head_hexsha": "cf33607613754313a2383bb7e7b3d29c856b9daf", "max_stars_repo_li... |
"""
Training functions.
"""
"""
Custom training loop to save and plot losses.
"""
function logging_train!(loss, ps, data, opt, losses)
for (i,d) in enumerate(data)
# back is a method that computes the product of the gradient so far with its argument.
train_loss, back = Zygote.pullback(() -> loss(d... | {"hexsha": "ce26273b77a3f7d7e986802186fdadf965962d55", "size": 3416, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/train.jl", "max_stars_repo_name": "bhc1010/PolySci", "max_stars_repo_head_hexsha": "a19cc214bc81f9d788f657cde174b37e23d33898", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_... |
# Copyright 2020 DeepMind Technologies Limited.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | {"hexsha": "7386f8869cb853ad9a6f9b4f94c235de488d9e21", "size": 9499, "ext": "py", "lang": "Python", "max_stars_repo_path": "byol/utils/dataset.py", "max_stars_repo_name": "mitchchristow/deepmind-research", "max_stars_repo_head_hexsha": "49c7ebe6acc48dd276ca09eca6924ba6cb5ec3a3", "max_stars_repo_licenses": ["Apache-2.0"... |
#!/usr/bin/env python3
from shape_synthesis import *
from border import *
import numpy as np
from scipy.ndimage import imread
from scipy.misc import imsave
from PIL import Image
import cv2
import math
from collections import Counter, defaultdict
def resize(image, ratio):
new_shape = (int(image.shape[1]*ratio), i... | {"hexsha": "776265184edfaf27aceaff8085082abad716fcc0", "size": 7784, "ext": "py", "lang": "Python", "max_stars_repo_path": "tree_bark_synthesis/ShapeOptimization/control_map.py", "max_stars_repo_name": "laitoch/tree-bark-synthesis", "max_stars_repo_head_hexsha": "0bd43d6699d2e05f62d144f310874f986bbd91d2", "max_stars_re... |
#!/usr/bin/env python
# coding=utf-8
# Copyright 2021 Alan Zhao. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Un... | {"hexsha": "d8bd3a684210ca89a72afc205c4860f041a0e94e", "size": 23214, "ext": "py", "lang": "Python", "max_stars_repo_path": "train_middle_transformer.py", "max_stars_repo_name": "Yuran-Zhao/Hierarchical-Transformer", "max_stars_repo_head_hexsha": "64ee603ce7e211b1f24a948f13aea101f8008db0", "max_stars_repo_licenses": ["... |
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you m... | {"hexsha": "f6e3b6c289dd3f4ddb9d16c5c0a5e5f70116aee7", "size": 6319, "ext": "py", "lang": "Python", "max_stars_repo_path": "kglib/utils/graph/thing/queries_to_graph_test.py", "max_stars_repo_name": "syyunn/kglib", "max_stars_repo_head_hexsha": "2e85dcc98c602ebf641bc0651da7df97212b492e", "max_stars_repo_licenses": ["Apa... |
# Copyright 2020 Erik Härkönen. All rights reserved.
# This file is licensed to you under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. You may obtain a copy
# of the License at http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applica... | {"hexsha": "fbe1ef1cc35c2590b0a5976254af3f146de4d9b3", "size": 7485, "ext": "py", "lang": "Python", "max_stars_repo_path": "TkTorchWindow.py", "max_stars_repo_name": "mcartagenah/ganspace", "max_stars_repo_head_hexsha": "f297c090257939dce1eef0eb87e6d9c4c19928a8", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_co... |
from re import sub
from typing import List, TYPE_CHECKING
import collections
import numpy as np
from rlcard.games.tienlen.action_event import ActionEvent, Chain10Action, Chain11Action, Chain12Action, Chain3Action, Chain4Action, Chain5Action, Chain6Action, Chain7Action, Chain8Action, Chain9Action, FourOfAKindAction, Cha... | {"hexsha": "c8cf191fc3ab2693afb316435c5e0f3bab2e665d", "size": 22736, "ext": "py", "lang": "Python", "max_stars_repo_path": "rlcard/games/tienlen/judger.py", "max_stars_repo_name": "xiviu123/rlcard", "max_stars_repo_head_hexsha": "2a5273dff6c9dd49a3d4ab84a952fed9a387955b", "max_stars_repo_licenses": ["MIT"], "max_stars... |
\SetAPI{J-C}
\section{database.field.prefix}
\label{configuration:DatabaseFieldPrefix}
\ClearAPI
The prefix for a database field to be recognized as the corresponding database part for a property in an entity. E.g. the prefix is "PREFIX\_" and the java property is "field1" the database field "PREFIX\_FIELD1" would auto... | {"hexsha": "49edc06869275fcea9c3bfdf1929f14abc54662b", "size": 1012, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "doc/reference-manual/tex/configuration/DatabaseFieldPrefix.tex", "max_stars_repo_name": "Dennis-Koch/ambeth", "max_stars_repo_head_hexsha": "8552b210b8b37d3d8f66bdac2e094bf23c8b5fda", "max_stars_rep... |
import numpy as np
import tensorflow.keras.backend as K
from keras_fcn.losses import mean_categorical_crossentropy
def test_categorical_crossentropy():
y_true = np.reshape([1, 1, 0, 0], [1, 2, 2]).astype('int')
y_true = np.eye(2)[y_true]
y_pred = np.ones((1, 2, 2, 2)) * 0.5
y_true, y_pred = K.variab... | {"hexsha": "94b9597876b8105c09fff7032787ee499ffc98c8", "size": 474, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_losses.py", "max_stars_repo_name": "psmaAaron/keras-fcn", "max_stars_repo_head_hexsha": "90843ef7465e0ce289f0a45a62d2d176a932e7ab", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
/**
* Copyright 2018 Woods Hole Oceanographic Institution
*
* 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 code must retain the above copyright notice,
* this list of conditions and th... | {"hexsha": "8454dec3a1f950a2c84c7296b971fed3f24d486a", "size": 4139, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "ds_nmea_parsers/src/ds_nmea_parsers/Gll.cpp", "max_stars_repo_name": "Field-Robotics-Lab/ds_msgs", "max_stars_repo_head_hexsha": "179631d46871b31fad28a21f81d865e3c73446d3", "max_stars_repo_licenses"... |
# -*- coding: utf-8 -*-
""" This file is only an example approach for evaluating the classification
performance in Ocular Disease Intelligent Recognition (ODIR-2019).
To run this file, sklearn and numpy packages are required
in a Python 3.0+ environment.
Author: Shanggong Medical Tec... | {"hexsha": "f934be6861708fdc3930e6265e3433b50fd4a01d", "size": 3343, "ext": "py", "lang": "Python", "max_stars_repo_path": "exps/ODIR_evaluation.py", "max_stars_repo_name": "jdnascim/mo434-ODIR-5K", "max_stars_repo_head_hexsha": "722c31ddc12b07dce4a8c08af4078cf9ab7ffb6a", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
''' Classes for performing image clustering '''
import sys
import numpy as np
from keras.applications import inception_v3
from sklearn.cluster import DBSCAN
from sklearn.decomposition import PCA
from sklearn.preprocessing import StandardScaler
from .image_utils import image_array_from_path, image_array_from_url
cl... | {"hexsha": "c6caf95312242fac4a638e89a6532599fa230558", "size": 5250, "ext": "py", "lang": "Python", "max_stars_repo_path": "nk_unicorn/unicorn.py", "max_stars_repo_name": "NewKnowledge/__nk_unicorn", "max_stars_repo_head_hexsha": "4b9753723504b0b225faadcda9a3de888c4183cf", "max_stars_repo_licenses": ["MIT"], "max_stars... |
c
c This function determines the trough density in the equatorial
c plane in particles/cm^3.
c
c written dlg 07/14/99
c modified dlg 1/6/2009 to include solar cycle and seasonal variations
c in inner plasmasphere density from C&A 1992
c
c INPUT:
c al = L-shell (real*4)
c amlt = solar magn... | {"hexsha": "06a92e427275935cec9d3348f407ee54b0154ebe", "size": 8063, "ext": "for", "lang": "FORTRAN", "max_stars_repo_path": "PyGCPM/__data/libgcpm/gcpm/ne_inner_ps_trough.for", "max_stars_repo_name": "mattkjames7/PyGCPM", "max_stars_repo_head_hexsha": "90d1c29b82b7b286f570eb49f7bf7618ddc4717b", "max_stars_repo_license... |
# coding: utf-8
# In[10]:
import cv2
from scipy import interpolate
import matplotlib.pyplot as plt
import FileManager
import Image_preperation as prep
import numpy as np
def intensity_prob(I, max_I, c=1):
return c*(1-I/max_I)
def position_prob(Y, Yest, Sigma):
t = (Y - Yest)**2 / (Sigma**2)
return ( 1... | {"hexsha": "5bba93f737dca621b7eef581a8a97b4e95454980", "size": 4528, "ext": "py", "lang": "Python", "max_stars_repo_path": "Initial_pose_estimator.py", "max_stars_repo_name": "YashGunjal/Active-shape-model-for-tooth-Segmentation", "max_stars_repo_head_hexsha": "8e22e1489fd84c221c8ed12c1ff1b6c78501c1c6", "max_stars_repo... |
"""
Created on Sat Oct 20 2018
Modules for extracting data from the Chronos database
@author: T.J. Heimovaara
"""
import numpy as np
import scipy as sp
import scipy.stats as stats
import pandas as pd
from context import dbl
# import DataBaseLibrary as dbl
#from pydream.core import run_dream
from pydream.parameters i... | {"hexsha": "2aeeac76943b8cc1cfed7ee17b1db600a54725c8", "size": 7061, "ext": "py", "lang": "Python", "max_stars_repo_path": "BB12_noExchange/Initialize_BB12_DREAM01.py", "max_stars_repo_name": "theim101/LandfillEmissionModelling", "max_stars_repo_head_hexsha": "fb14233cca1c1f98e7a8414c6579ebd7f4ef6462", "max_stars_repo_... |
"""Defines functions and observers analysing the local structure.
The following FUNCTIONS are defined. They operate on the atoms, and
return an array with the resulting data. They do not modify the
atoms, but may trigger neighbor list updates in the attached
potential.
CNA: Simple CNA analysis, finds atoms with loc... | {"hexsha": "26ea185d11f250b5a2b40d9f6d97ee697573a6a0", "size": 10877, "ext": "py", "lang": "Python", "max_stars_repo_path": "Asap-3.8.4/Python/asap3/analysis/localstructure.py", "max_stars_repo_name": "auag92/n2dm", "max_stars_repo_head_hexsha": "03403ef8da303b79478580ae76466e374ec9da60", "max_stars_repo_licenses": ["M... |
from typing import Dict, Union, Tuple, Any, Optional, \
Mapping, Sequence, Hashable
import dask.array as da
import numpy as np
import pandas as pd
import xarray as xr
from xcube.core.verify import assert_cube
DEFAULT_INDEX_NAME_PATTERN = '{name}_index'
DEFAULT_REF_NAME_PATTERN = '{name}_ref'
INDEX_DIM_NAME = "id... | {"hexsha": "3018cdbc28e85acc61fbd8475997150fe5b341b2", "size": 18963, "ext": "py", "lang": "Python", "max_stars_repo_path": "xcube/core/extract.py", "max_stars_repo_name": "bcdev/xcube", "max_stars_repo_head_hexsha": "9d275ef3baef8fbcea5c1fbbfb84c3d0164aecd3", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 97, ... |
# Driver functions for the integrators.
struct MolecularDynamicsParameters
"Centroid friction (1 / ps)."
gamma0::Float64
"Time step (ps)."
dt::Float64
"Total duration (ps)."
duration::Float64
end
"""
num_steps(mdp::MolecularDynamicsParameters)
Number of molecular dynamics steps for `mdp`.... | {"hexsha": "5dac06872f6714d49802a8dd6d2c70aa7a412019", "size": 7527, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/run.jl", "max_stars_repo_name": "0/WaterMeanMeanForce.jl", "max_stars_repo_head_hexsha": "a10068ecce6456bc57215cce8e60cd6976cae608", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null,... |
"""Rounds numbers to 1, 2 or 3 decimals"""
from h2oaicore.transformer_utils import CustomTransformer
import datatable as dt
import numpy as np
class MyRoundTransformer(CustomTransformer):
_testing_can_skip_failure = False # ensure tested as if shouldn't fail
@staticmethod
def get_parameter_choices():
... | {"hexsha": "a6a14735aa3d74a01ef241e81b601ef27f2fd7fb", "size": 761, "ext": "py", "lang": "Python", "max_stars_repo_path": "transformers/numeric/round_transformer.py", "max_stars_repo_name": "james94/driverlessai-recipes", "max_stars_repo_head_hexsha": "87c35460db59ffda8dc18ad82cb3a9b8291410e4", "max_stars_repo_licenses... |
# -*- coding: utf-8 -*-
# ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.4'
# jupytext_version: 1.2.1
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
import sys
print(sys.path)
sys.... | {"hexsha": "790c5ceee140cc410ea703f768529c4f172a1fea", "size": 2260, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/Boyd_lqr.py", "max_stars_repo_name": "msakai/chainer-differentiable-mpc", "max_stars_repo_head_hexsha": "dba5712f42a684748515d9ad5e2ff2823516c88e", "max_stars_repo_licenses": ["MIT"], "ma... |
\subsection{Spherical coordinate system}
A sphere with center $O=(x_0,y_0,z_0)$ and radius $r$ is the set of points at distance exactly $r$ from $O$.
We can describe it this by equation
\[(x-x_0)^2+(y-y_0)^2+(z-z_0)^2 = r^2\]
\centerFig{sph-0}
To describe a point on a sphere, we can either directly give its coordinat... | {"hexsha": "2677977db82f71a15ba3d001b433cef3e84f545e", "size": 2195, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "archives/codelibraries/cp-geo-master/3d/sph/sph-basics.tex", "max_stars_repo_name": "cbarnson/UVa", "max_stars_repo_head_hexsha": "0dd73fae656613e28b5aaf5880c5dad529316270", "max_stars_repo_licenses... |
(** The conditional probabilistic guarded command language (cpGCL). *)
Require Import Coq.Program.Basics.
Require Import Coq.QArith.QArith.
Require Import order.
(** For now we support only boolean values. *)
Definition val := bool.
(** A program state is a map from identifiers (nat) to values. *)
Definition St : T... | {"author": "OUPL", "repo": "Zar", "sha": "9243f9d77d0c8af99afa4f536156a3e23b1c40e1", "save_path": "github-repos/coq/OUPL-Zar", "path": "github-repos/coq/OUPL-Zar/Zar-9243f9d77d0c8af99afa4f536156a3e23b1c40e1/theory/cwp/cpGCL.v"} |
# Copyright (C) 2022. Huawei Technologies Co., Ltd. All rights reserved.
# 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, co... | {"hexsha": "f8f7a5ca5fcb92b1144dd2a62bf26e9845e739d9", "size": 2124, "ext": "py", "lang": "Python", "max_stars_repo_path": "training/src/tests/tests/python/self-attention.py", "max_stars_repo_name": "steelONIONknight/bolt", "max_stars_repo_head_hexsha": "9bd3d08f2abb14435ca3ad0179889e48fa7e9b47", "max_stars_repo_licens... |
"""
The code does three things:
1) Takes in the source of samples (e.g., superformular variables or glassware images)
2) Uses B-spline curves to fit their contours
3) Gets the xy coordinates of their B-spline control points
data : geometric representation of sample shapes (xy coordinates of the B-spline control points... | {"hexsha": "e01f87e0f24766301ce63d59896160f9453ca0da", "size": 11414, "ext": "py", "lang": "Python", "max_stars_repo_path": "parametric_space.py", "max_stars_repo_name": "IDEALLab/design_embeddings_idetc_2016", "max_stars_repo_head_hexsha": "f1a8d2b637707d8e76d3189e970310bf34755058", "max_stars_repo_licenses": ["MIT"],... |
#%%
import random
from shared import bootstrap_accuracy, simple_boxplot
import numpy as np
from sklearn.ensemble import RandomForestClassifier
from sklearn.linear_model import LogisticRegression, SGDClassifier
import typing as T
from dataclasses import dataclass
import random
#%%
# start off by seeding random number ... | {"hexsha": "f22938561955f4e0380330a14b428bd9a22ae617", "size": 3081, "ext": "py", "lang": "Python", "max_stars_repo_path": "p15-kernels.py", "max_stars_repo_name": "DingPang/cs451-practicals", "max_stars_repo_head_hexsha": "f5545fbc9f6dfc9e6d6e3b32615af265e483b801", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_sta... |
from functions.my_LLE import My_LLE
from functions.my_GLLE import My_GLLE
from functions.my_GLLE_DirectSampling import My_GLLE_DirectSampling
import functions.load_datasets as load_datasets
import functions.utils as utils
from sklearn import manifold, datasets
import numpy as np
from sklearn.preprocessing import Standa... | {"hexsha": "205e987f4c46c7a8a0eb6bb0433cd90eb7418db0", "size": 12418, "ext": "py", "lang": "Python", "max_stars_repo_path": "main.py", "max_stars_repo_name": "bghojogh/Generative-LLE", "max_stars_repo_head_hexsha": "e05631cdf0e1969cd2af48dd5fcc1a907e694da2", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 4, "ma... |
#!/usr/bin/env python
# coding: utf-8
# ## 3- Modelos Geocêntricos
#
# ## Distribuição Normal
# <img src="./images/Gauss.jpg" alt="gauss" />
#
#
# fonte: [wikipedia](https://pt.wikipedia.org/wiki/Marco_alem%C3%A3o)
#
#
# fonte: [Distribuição Gausiana](https://www.bis-ans-ende-der-welt.net/Deutschland-B.htm)
# ... | {"hexsha": "739799228d098df07b6bfadd359e3cdff77a36c0", "size": 50727, "ext": "py", "lang": "Python", "max_stars_repo_path": "_build/jupyter_execute/parte_3.py", "max_stars_repo_name": "rodolphomacedo/statistical_rethinking_pt_BR", "max_stars_repo_head_hexsha": "798829cb27a62a25faddf3f27c587d7f29ad9240", "max_stars_repo... |
From Rela Require Import Loc.
From Rela Require Import Aexp.
Import AexpNotations.
From Rela Require Import Bexp.
Import BexpNotations.
From Rela Require Import Proc.
From Rela Require Import Sigma.
From Coq Require Import Lia.
From Coq Require Import Lists.List.
Import ListNotations.
(** Definition of assertion **)
... | {"author": "lyonel2017", "repo": "Relational-Spec", "sha": "65becee4d22150286e1e1a6f654ac02e9b457bf6", "save_path": "github-repos/coq/lyonel2017-Relational-Spec", "path": "github-repos/coq/lyonel2017-Relational-Spec/Relational-Spec-65becee4d22150286e1e1a6f654ac02e9b457bf6/Com.v"} |
//| Copyright Inria May 2015
//| This project has received funding from the European Research Council (ERC) under
//| the European Union's Horizon 2020 research and innovation programme (grant
//| agreement No 637972) - see http://www.resibots.eu
//|
//| Contributor(s):
//| - Jean-Baptiste Mouret (jean-baptiste.moure... | {"hexsha": "4595846b926ddd180fb3fc17a4e54ca7003ee23b", "size": 7678, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "limbo/src/tests/test_init_functions.cpp", "max_stars_repo_name": "yjjuan/automl_cplusplus", "max_stars_repo_head_hexsha": "7c427584ed94915b549d31a2097f952c3cfdef36", "max_stars_repo_licenses": ["Apa... |
# Copyright 2021 Huawei Technologies Co., Ltd
#
# 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... | {"hexsha": "f152644e43943655cc63372d1b78b28ddd818317", "size": 2066, "ext": "py", "lang": "Python", "max_stars_repo_path": "research/nlp/skipgram/preprocess.py", "max_stars_repo_name": "leelige/mindspore", "max_stars_repo_head_hexsha": "5199e05ba3888963473f2b07da3f7bca5b9ef6dc", "max_stars_repo_licenses": ["Apache-2.0"... |
import numpy as np
arr = np.array([1, 3, 5, 7])
x = np.searchsorted(arr, [2, 4, 6])
print(x)
| {"hexsha": "a7571df3e3124ac63dcc4f80cb599964ea6697bd", "size": 96, "ext": "py", "lang": "Python", "max_stars_repo_path": "WEEKS/CD_Sata-Structures/_RESOURCES/python-prac/mini-scripts/python_Searching_Arrays_multple_values.txt.py", "max_stars_repo_name": "webdevhub42/Lambda", "max_stars_repo_head_hexsha": "b04b84fb5b82f... |
#pragma push_macro("S1")
#undef S1
#include <boost/container/small_vector.hpp>
#pragma pop_macro("S1")
| {"hexsha": "782a0f1078fe8a00b444e67ee09c2003bd98d5b5", "size": 104, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "stf-inc/boost_small_vector.hpp", "max_stars_repo_name": "sparcians/stf_lib", "max_stars_repo_head_hexsha": "9e4933bff0c956dba464ced72e311e73507342dc", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
import pandas as pd
import numpy as np
def movement(df: pd.DataFrame) -> pd.Series:
dx = df.longitudeE7.diff()
dy = df.latitudeE7.diff()
return np.sqrt(dx * dx + dy * dy)
| {"hexsha": "428d18f035022d8b97188df675bb14b7f43a5107", "size": 185, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/tools/movement.py", "max_stars_repo_name": "BLannoo/LocationAnalysis", "max_stars_repo_head_hexsha": "9eddc36b659311e3e6312125f7e91dc719eead4f", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
# Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | {"hexsha": "eb54ae09cc2ef4918a76a9720c54387f15cd6f3f", "size": 20914, "ext": "py", "lang": "Python", "max_stars_repo_path": "nemo/collections/nlp/data/language_modeling/megatron/indexed_retrieval_dataset.py", "max_stars_repo_name": "jubick1337/NeMo", "max_stars_repo_head_hexsha": "9d50733ba0e698b98d0019e9e697686e0a24b9... |
/-
Copyright (c) 2021 Yakov Pechersky. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Yakov Pechersky
-/
import algebra.tropical.lattice
import algebra.big_operators.basic
import data.list.min_max
/-!
# Tropicalization of finitary operations
This file provides the "... | {"author": "Mel-TunaRoll", "repo": "Lean-Mordell-Weil-Mel-Branch", "sha": "4db36f86423976aacd2c2968c4e45787fcd86b97", "save_path": "github-repos/lean/Mel-TunaRoll-Lean-Mordell-Weil-Mel-Branch", "path": "github-repos/lean/Mel-TunaRoll-Lean-Mordell-Weil-Mel-Branch/Lean-Mordell-Weil-Mel-Branch-4db36f86423976aacd2c2968c4e4... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.