text stringlengths 0 1.25M | meta stringlengths 47 1.89k |
|---|---|
'''
SMART HMI magnetgram .fits processing code
=========================================
Written by Sophie A. Murray, code originally developed by Paul Higgins (ar_processmag.pro).
Developed under Python 3 and Sunpy 0.8.3
- Python 3.6.1 |Anaconda custom (x86_64)| (default, May 11 2017, 13:04:09)
... | {"hexsha": "9f82f29a90650d93a74696a90ee59a8a7b7242ef", "size": 7774, "ext": "py", "lang": "Python", "max_stars_repo_path": "process_magnetogram.py", "max_stars_repo_name": "mo-sb/smart_python", "max_stars_repo_head_hexsha": "e754c4e382e81c9658d9d5accea39b64c5e95c17", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
The program provides neural networks for recommendation
or modification of cryptographically random numbers.
"""
from argparse import ArgumentParser
from os import path
import matplotlib.pyplot as plt
import numpy as np
from models import Limiter, Modifier, Recommend... | {"hexsha": "7363dffc6b8afda0ce048cdcbc0ab154228352fb", "size": 3330, "ext": "py", "lang": "Python", "max_stars_repo_path": "main.py", "max_stars_repo_name": "SemyonMakhaev/personal-auth", "max_stars_repo_head_hexsha": "32fe00db7c6acc16e49b20178c08a6d2364307d1", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nul... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Sep 30 08:42:40 2020
@author: ibarlow
Script to fill the 96WPs with 3 doses of each drug from the Prestwick C elegans
library that contains 240 drugs
"""
import pandas as pd
from pathlib import Path
import numpy as np
import itertools
import math
imp... | {"hexsha": "57dfcd1d4d8eadc8c866a5950a4ce906ccb9334b", "size": 4937, "ext": "py", "lang": "Python", "max_stars_repo_path": "druglibrary/Prestwick_library_plates.py", "max_stars_repo_name": "ilbarlow/PrestwickScreen", "max_stars_repo_head_hexsha": "b1c7f045aba600746a8de133d25582135f789d75", "max_stars_repo_licenses": ["... |
#!/usr/bin/env python3
import os, json, argparse
from threading import Thread
from queue import Queue
import numpy as np
from scipy.misc import imread, imresize
import h5py
from random import shuffle
import sys
"""
Create an HDF5 file of video frames, optical flow and certainty masks for training a feedforward video ... | {"hexsha": "2b8d40bf8da855b6a754ae35ddd72922f647ac72", "size": 5945, "ext": "py", "lang": "Python", "max_stars_repo_path": "video_dataset/make_video_dataset.py", "max_stars_repo_name": "deform-lab/fast-artistic-videos", "max_stars_repo_head_hexsha": "47ed2a9934c6d91a6d000c050ac3f327897a972f", "max_stars_repo_licenses":... |
import os
import cv2
import numpy as np
import pandas as pd
from torchvision.transforms import transforms
from torch.utils.data import Dataset
from datasets.base_dataset import BaseDataset
from utils.augmenters.augment import seg
EMOTION_DICT = {
0: "angry",
1: "disgust",
2: "fear",
3: "happy",
4... | {"hexsha": "30619d8623e9b1800612cc2c7706faf432bdab9b", "size": 2409, "ext": "py", "lang": "Python", "max_stars_repo_path": "datasets/FER2013_dataset.py", "max_stars_repo_name": "And1210/FER_SSL", "max_stars_repo_head_hexsha": "6cad839261667dce30a8b9db9638ef7334953063", "max_stars_repo_licenses": ["MIT"], "max_stars_cou... |
import os
import time
import pickle
import numpy as np
from timecast.learners import AR, PredictLast, PredictConstant
from timecast.utils.losses import MeanSquareError
from timecast import load_learner
from fusion_data import FusionData
from utils import experiment
ex = experiment("baseline")
@ex.config
def config... | {"hexsha": "548260f2eeda1c75b3c1376111d75b1c28aa92c6", "size": 3744, "ext": "py", "lang": "Python", "max_stars_repo_path": "skgaip/fusion/main.py", "max_stars_repo_name": "danielsuo/toy_flood", "max_stars_repo_head_hexsha": "471d3c4091d86d4a00fbf910937d4e60fdaf79a1", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
import os
import gzip
import numpy as np
import struct
import urllib
from urllib import request
# load compressed MNIST gz files and return numpy arrays
def load_data(filename, label = False):
with gzip.open(filename) as gz:
magic_number = struct.unpack('I', gz.read(4))
n_items = struct.unpack('>I... | {"hexsha": "3e9376ebd6191f7cd387d92cdd3a8fb347e5e7cf", "size": 2445, "ext": "py", "lang": "Python", "max_stars_repo_path": "mnist-vscode-docs-sample/utils.py", "max_stars_repo_name": "luisquintanilla/vscode-tools-for-ai", "max_stars_repo_head_hexsha": "45ce66e84c854a544554cc8e42ddc00922cda195", "max_stars_repo_licenses... |
import sys
import os
if __name__ == "__main__":
sys.path.append("../pyscatwave")
from itertools import product
import math
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.cud... | {"hexsha": "ae5038f880423f1a3060320eaca011cbd4bca588", "size": 19224, "ext": "py", "lang": "Python", "max_stars_repo_path": "kymatio/phaseexp1d/phaseexp/make_figs.py", "max_stars_repo_name": "sixin-zh/kymatio_wph", "max_stars_repo_head_hexsha": "237c0d2009766cf83b2145420a14d3c6e90dc983", "max_stars_repo_licenses": ["BS... |
# ==================================================================================================
# A toy code example that tests extracting the TSDF voxel centers from a TSDF
#
# Please run script from repository root, i.e.:
# python3 ./tsdf_management/extract_voxel_centers_test.py
#
# Copyright 2021 Gregory Kramid... | {"hexsha": "c88d051cdb09df0dc56d169c0f817840c2bf3d9b", "size": 4437, "ext": "py", "lang": "Python", "max_stars_repo_path": "subprocedure_examples/extract_voxel_centers_test.py", "max_stars_repo_name": "Algomorph/NeuralTracking", "max_stars_repo_head_hexsha": "6312be8e18828344c65e25a423c239efcd3428dd", "max_stars_repo_l... |
#!/usr/bin/env python
# coding: utf-8
import numpy as np
import matplotlib.pyplot as plt
def plot_eis(frequencies, impedance, title=None, cmap='tab10'):
""" Creates a single figure w/ both Bode and Nyquist plots of a single EIS spectrum.
Plots the results of a simulated circuit as well if provided
Args:
... | {"hexsha": "d4c5bad7bdda1b3c8ca476c369ffd192481a2eb6", "size": 2094, "ext": "py", "lang": "Python", "max_stars_repo_path": "predict_capacity_from_eis/eisplot.py", "max_stars_repo_name": "battery-data-commons/mrs-sp22-tutorial", "max_stars_repo_head_hexsha": "64b420d2365f2ff26b6ea50617923db3a80c819b", "max_stars_repo_li... |
# Standard imports
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
# Evaluation
from sklearn import metrics
from sklearn.model_selection import train_test_split
# Scale
from sklearn.preprocessing import StandardScaler
# Models
import statsmodels.api as sm
from sklearn import linear_model
from ... | {"hexsha": "c9a620f12a5768af92114e13d7ec247f1a168285", "size": 7133, "ext": "py", "lang": "Python", "max_stars_repo_path": "Regressors.py", "max_stars_repo_name": "agmoss/rental_regression_analysis", "max_stars_repo_head_hexsha": "1b6aeba571ba70ccc6fed02ab2290b14425cc92f", "max_stars_repo_licenses": ["MIT"], "max_stars... |
from distutils.core import setup
from setuptools import find_packages
from Cython.Build import cythonize
from distutils.extension import Extension
import numpy
# details on installing python packages can be found here
# https://docs.python.org/3.7/install/
ext_modules = [
Extension("MAS_library.MAS_library", ["MA... | {"hexsha": "70997e5451638a27b37d9369171c916b2ffb7550", "size": 3288, "ext": "py", "lang": "Python", "max_stars_repo_path": "library/setup.py", "max_stars_repo_name": "GabrieleParimbelli/Pylians3", "max_stars_repo_head_hexsha": "03b6f497c084c6a1c795e8b8f8d1e9c71c5e80cd", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
#define _FILE_OFFSET_BITS 64
#include <iostream>
#include <fstream>
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <expat.h>
#include <boost/regex.hpp>
#include <boost/tokenizer.hpp>
#include <boost/foreach.hpp>
#include "wiki_scanner.h"
using namespace std;
using namespace bo... | {"hexsha": "8e061c2219c4f908bcd0626ff8c7a7e2a3b6d2fa", "size": 3617, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "c/wikipedia/article_xml_converter.cpp", "max_stars_repo_name": "mmonto7/small-world-graph", "max_stars_repo_head_hexsha": "8ea1015c24065cb71875620b28c66ffb8348dcae", "max_stars_repo_licenses": ["MIT... |
#!usr/bin/env python
#-*- coding:utf-8 _*-
"""
@author:yaoli
@file: 05_back_propagation.py 反向传播
@time: 2018/12/06
"""
import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
from tensorflow.python.framework import ops
ops.reset_default_graph()
sess = tf.Session()
# 一个回归的例子。输入数据是100个随机数,平均值是1... | {"hexsha": "e55d476a1b1c70983c74beef0bef4faa854f2a0a", "size": 1370, "ext": "py", "lang": "Python", "max_stars_repo_path": "02_TensorFlow_Way/05_back_propagation.py", "max_stars_repo_name": "GeneralLi95/TensorFlow_cookbook", "max_stars_repo_head_hexsha": "f1102cc0cd0b2f641346664d601e01f315a8b437", "max_stars_repo_licen... |
[STATEMENT]
lemma maximum_fst_prefixes_are_prefixes :
assumes "xys \<in> list.set (maximum_fst_prefixes t xs ys)"
shows "map fst xys = take (length xys) xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. map fst xys = take (length xys) xs
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
xys \<in>... | {"llama_tokens": 5203, "file": "FSM_Tests_Prefix_Tree", "length": 39} |
Require Import Crypto.Arithmetic.PrimeFieldTheorems.
Require Import Crypto.Specific.montgomery64_2e130m5_3limbs.Synthesis.
(* TODO : change this to field once field isomorphism happens *)
Definition mul :
{ mul : feBW_small -> feBW_small -> feBW_small
| forall a b, phiM_small (mul a b) = F.mul (phiM_small a) (phiM... | {"author": "anonymous-code-submission-01", "repo": "sp2019-54-code", "sha": "8867f5bed0821415ec99f593b1d61f715ed4f789", "save_path": "github-repos/coq/anonymous-code-submission-01-sp2019-54-code", "path": "github-repos/coq/anonymous-code-submission-01-sp2019-54-code/sp2019-54-code-8867f5bed0821415ec99f593b1d61f715ed4f7... |
#!/usr/bin/env python3
# a timing script for FFTs and convolutions using OpenMP
import sys, getopt
import numpy as np
from math import *
import subprocess
import os
import re # regexp package
import shutil
import tempfile
usage = '''A timing script for rocfft
Usage:
\ttiming.py
\t\t-w <string> set working directory... | {"hexsha": "4ae879ec47bcef304eba83e5846fc8c88e32e57f", "size": 9839, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/perf/timing.py", "max_stars_repo_name": "mhbliao/rocFFT", "max_stars_repo_head_hexsha": "f10ee7d8baba4bc2b87a6136cfebfe0f01e1535a", "max_stars_repo_licenses": ["MIT"], "max_stars_count": n... |
[STATEMENT]
lemma "minit \<phi>\<^sub>e\<^sub>x = \<lparr>
mstate_i = 0,
mstate_m =
MAnd (MPred ''A'' [MFOTL.Var 0]) False
(MUntil True (MRel {[None]}) (interval 1 2) (MExists (MPred ''B'' [MFOTL.Var 1, MFOTL.Var 0]))
([], []) [] [])
([], []),
mstate_n = 1\<rparr>"
[PROOF STATE]
proof (prove)... | {"llama_tokens": 292, "file": "MFOTL_Monitor_Examples", "length": 1} |
from abc import ABC, abstractmethod
import numpy as np
class Model (ABC):
@abstractmethod
def __init__(self):
...
@abstractmethod
def train(self, pos_triples:np.array, neg_triples:np.array):
...
@abstractmethod
def get_ranked_and_sorted_predictions(self, examples):
.... | {"hexsha": "90abfe429b7843561129d4c93f56596bb3eb86e4", "size": 586, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/openbiolink/evaluation/models/model.py", "max_stars_repo_name": "cthoyt/OpenBioLink", "max_stars_repo_head_hexsha": "c5f85b99f9104f70493136c343e4554261e990a5", "max_stars_repo_licenses": ["MIT"... |
function module_dir()
return joinpath(@__DIR__, "..")
end
| {"hexsha": "db8e8ec15074dcff695b9274c86ea02b80867872", "size": 59, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/utils.jl", "max_stars_repo_name": "simon-lc/AlgamesPlots.jl", "max_stars_repo_head_hexsha": "18851ea53168bbd1ab5c1c7f1116f8194d2c3091", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 6, "... |
import mathutils
import bpy
import numpy as np
class RegionManager():
""" Controls a single material
"""
def __init__(self, storage_pointer, context=None):
self.context = bpy.context if context is None else context
self.material_index = 0
self.bsp = storage_pointer
# Set co... | {"hexsha": "fb5a88823a513e2a997c506c9d9dcc11fa1623c4", "size": 4536, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/MaterialManagers/RegionManager.py", "max_stars_repo_name": "paigeco/VirtualGoniometer", "max_stars_repo_head_hexsha": "536e7e77fbb036ad8d777b42e751a0f3e80b8242", "max_stars_repo_licenses": ["C... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Convert an osc file to multiple csv files.
Accepts file.osc with contents:
____________________________________________________________________________________________________
osc_time |path |types |packets ... | {"hexsha": "ed82b20338bee752a8292e403159f5df02808018", "size": 2452, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/osc_to_csv.py", "max_stars_repo_name": "oishefarhan/OSC-recorder", "max_stars_repo_head_hexsha": "7379912b68f4e9e96edabe953e9090e0f00e14a4", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
#include <boost/atomic.hpp>
#include <iostream>
int main()
{
std::cout.setf(std::ios::boolalpha);
boost::atomic<short> s;
std::cout << s.is_lock_free() << '\n';
boost::atomic<int> i;
std::cout << i.is_lock_free() << '\n';
boost::atomic<long> l;
std::cout << l.is_lock_free() << '\n';
} | {"hexsha": "f3de02ff07a030ec5cbddcd83cef0373c36eec44", "size": 303, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "Example/atomic_02/main.cpp", "max_stars_repo_name": "KwangjoJeong/Boost", "max_stars_repo_head_hexsha": "29c4e2422feded66a689e3aef73086c5cf95b6fe", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
#!/usr/bin/env python
import rospy
from acl_msgs.msg import ViconState
from gazebo_msgs.msg import ModelStates
from geometry_msgs.msg import PointStamped
from acl_msgs.msg import FloatStamped
import numpy as np
IN_PROGRESS = 0
SUCCESS = 1
FAIL = 2
class collisionDetector:
def __init__(self):
self.init =... | {"hexsha": "bf13ee6a8373280e560a608bb881644671881c1e", "size": 2485, "ext": "py", "lang": "Python", "max_stars_repo_path": "acl_sim/scripts/flightStatus.py", "max_stars_repo_name": "betaBison/acl-gazebo", "max_stars_repo_head_hexsha": "d21792505bdaabc6d17a1eeb9da4134df7297b0f", "max_stars_repo_licenses": ["BSD-3-Clause... |
[STATEMENT]
lemma list_case_refine[refine]:
assumes "(li,l)\<in>\<langle>S\<rangle>list_rel"
assumes "fni \<le>\<Down>R fn"
assumes "\<And>xi x xsi xs. \<lbrakk> (xi,x)\<in>S; (xsi,xs)\<in>\<langle>S\<rangle>list_rel; li=xi#xsi; l=x#xs \<rbrakk> \<Longrightarrow> fci xi xsi \<le>\<Down>R (fc x xs)"
shows "... | {"llama_tokens": 498, "file": "Refine_Monadic_Refine_Basic", "length": 2} |
export sortpermFast
function sortpermFast(A::Vector)
n = length(A)
ii = collect(1:n)
B = copy(A)
quicksort!(B,ii, 1,n)
return ii, B # B = A[ii]
end # function sortpermFast
#----------------------------------------------------
function sortpermFast(A::Vector, D::Vector)
# Sort A and permute D ... | {"hexsha": "da4cce6990677c7a00052e6121dfd7611f065eec", "size": 2670, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/Utils/sortpermFast.jl", "max_stars_repo_name": "UnofficialJuliaMirrorSnapshots/jInv.jl-3dacf901-f8cd-5544-86ed-7a705f85c244", "max_stars_repo_head_hexsha": "2e7305f231a29bd8e1e803b82cc2bc8e9b7a... |
#!/usr/bin/env python
import numpy as num
from e2rh import e2rh
from e2mr import e2mr
from e2dp import e2dp
from rh2mr import rh2mr
from rh2dp import rh2dp
from rh2e import rh2e
from mr2dp import mr2dp
from mr2e import mr2e
from mr2rh import mr2rh
from dp2e import dp2e
from dp2rh import dp2rh
from dp2mr im... | {"hexsha": "99b768b461d762040ad8540cb619aeeef2b19754", "size": 2987, "ext": "py", "lang": "Python", "max_stars_repo_path": "pyuwphysret/common/pyfiles/atmos/testing123.py", "max_stars_repo_name": "graziano-giuliani/pythoncode", "max_stars_repo_head_hexsha": "4e505af5be3e32519cf4e62b85c101a63c885f77", "max_stars_repo_li... |
import csv
import numpy as np
def getDataSource(data_path):
marksInPercentage = []
days_present = []
with open(data_path) as csv_file:
csv_reader = csv.DictReader(csv_file)
for row in csv_reader:
marksInPercentage.append(float(row["Marks In Percentage"]))
d... | {"hexsha": "d9caadbda896bf351bd26159211f07cd539636c0", "size": 760, "ext": "py", "lang": "Python", "max_stars_repo_path": "class1.py", "max_stars_repo_name": "khushmax/corelation", "max_stars_repo_head_hexsha": "40f89c6736d9b6cb93a6aa12931ed3b9d8d7715f", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max... |
import cv2 as cv
import numpy as np
def grid(base, dimensions, images, scale=0.5):
# 1. SCALE IMAGE
base = cv.resize(base, (0, 0), fx=scale, fy=scale)
images = [cv.resize(image, (0, 0), fx=scale, fy=scale) for image in images]
# 2. COMPLETE DIMENTIONS IF MISSING
for i, image in enumerate(images):
if len(image.s... | {"hexsha": "a76af3d89a37bee8ff9ecea615c843fbd67e9755", "size": 1775, "ext": "py", "lang": "Python", "max_stars_repo_path": "cv_recon/cv_tools.py", "max_stars_repo_name": "AguilarLagunasArturo/cam-recon-tools", "max_stars_repo_head_hexsha": "32866dddf855658833b8aded2288613f31ce0d98", "max_stars_repo_licenses": ["MIT"], ... |
(*
Copyright 2014 Cornell University
Copyright 2015 Cornell University
Copyright 2016 Cornell University
Copyright 2017 Cornell University
This file is part of VPrl (the Verified Nuprl project).
VPrl is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public Li... | {"author": "vrahli", "repo": "NuprlInCoq", "sha": "0c3d7723836d3f615ea47f56e58b2ea6173e7d98", "save_path": "github-repos/coq/vrahli-NuprlInCoq", "path": "github-repos/coq/vrahli-NuprlInCoq/NuprlInCoq-0c3d7723836d3f615ea47f56e58b2ea6173e7d98/rules/rules_equality3.v"} |
% !TEX root = frideswide.tex
\chapter{Introduction}
| {"hexsha": "1e2c770c51b571eeb8cc9e0f057ce418585d5e3e", "size": 53, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "introduction.tex", "max_stars_repo_name": "OpenBookPublishers/dunning-2pp-book", "max_stars_repo_head_hexsha": "ada7a8b62343b9f72ec0e2ef4493508cc4916989", "max_stars_repo_licenses": ["CC-BY-4.0"], "ma... |
# Coder: Wenxin Xu
# Github: https://github.com/wenxinxu/resnet_in_tensorflow
# ==============================================================================
# This code was modified from the code in the link above.
#from __future__ import absolute_import
from __future__ import division
from __future__ import print_f... | {"hexsha": "c186e152f928db599685cfee374b629a9a32ae11", "size": 1895, "ext": "py", "lang": "Python", "max_stars_repo_path": "preprocessing.py", "max_stars_repo_name": "MinhyungCho/riemannian-batch-normalization", "max_stars_repo_head_hexsha": "d1ac938ca5af8af1b7c1d4f708c1aacd2d8cbab9", "max_stars_repo_licenses": ["MIT"]... |
import numpy as np
class GridMap:
'''
Mapping of variables from ranges defined by min-max and scale to a
0-1 unit hypercube.
'''
def __init__(self, variables):
self.cardinality = 0
# Count the total number of dimensions and roll into new format.
for variable in variables... | {"hexsha": "bd53657c72425d9ecd5d6857d141bf7f627187f1", "size": 1772, "ext": "py", "lang": "Python", "max_stars_repo_path": "gp_families/grid.py", "max_stars_repo_name": "jclevesque/gp_families", "max_stars_repo_head_hexsha": "3c24b0ec60231c6110e0060d6e2471683718615e", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
import os
import torch
import argparse
import pytorch_lightning as pl
from utils import read_config, get_early_stopper, get_checkpoint_callback, final_logs, print_dict
from train import Model
from dataset import DatasetModule
import numpy as np
from models.model import pDNN
parser = argparse.ArgumentParser()
parser.ad... | {"hexsha": "e92af6d21ff2011bb245da0ed7c218dbc4b3ae8b", "size": 8913, "ext": "py", "lang": "Python", "max_stars_repo_path": "main.py", "max_stars_repo_name": "sriyash421/pDNN", "max_stars_repo_head_hexsha": "80276e046dfa21567a380502d187b928ec01147b", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_star... |
import helpers
import re
import numpy as np
'''
Possible types:
header/footer
- has_words
- is_top_or_bottom
- small_text?
- n_lines <= 3
body
- has_words
- normal_word_separation
- normal_word_coverage
- !overlaps
- !small_text
-... | {"hexsha": "c567961d10467e8733e02ed32ee6a0169082d65d", "size": 9407, "ext": "py", "lang": "Python", "max_stars_repo_path": "heuristics.py", "max_stars_repo_name": "iross/blackstack", "max_stars_repo_head_hexsha": "4e44679f889d86626cd7cd263a0b770e1d5e9e64", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 2, "max_... |
import sys
from scipy.stats import hypergeom
gene_file = sys.argv[1]
output = ""
try:
fgene = open(gene_file, "r")
for gline in fgene:
gline = gline.rstrip()
geneids = gline.split(",")
output += "\"" + geneids[0] + "\","
print(output)
except IOError:
print ('cannot open', gene_fi... | {"hexsha": "308f97ab00c0ab5c54e2292fd64be0dfb20e5810", "size": 347, "ext": "py", "lang": "Python", "max_stars_repo_path": "data/167/format.py", "max_stars_repo_name": "kbasecollaborations/GeneSet_Enrichment", "max_stars_repo_head_hexsha": "14a5e409019457bfbe985236ff103edb2e8896c7", "max_stars_repo_licenses": ["MIT"], "... |
import pickle
# Our numerical workhorses
import numpy as np
import pandas as pd
# Import matplotlib stuff for plotting
import matplotlib.pyplot as plt
import matplotlib.cm as cm
# Seaborn, useful for graphics
import seaborn as sns
# Import the utils for this project
import ccutils
# Define mRNA rate
# gm = 0.00284 ... | {"hexsha": "76a41b6ac26a0b5b24f85bacc5004a2ef1d5c340", "size": 6555, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/theory/compute_parameters.py", "max_stars_repo_name": "RPGroup-PBoC/chann_cap", "max_stars_repo_head_hexsha": "f2a826166fc2d47c424951c616c46d497ed74b39", "max_stars_repo_licenses": ["MIT"], "m... |
import numpy as np
def lt_bpdecoder(signal, n, raw, max_iter = 1):
# 1. get vi and cj
# vi:the neighbor of the variable node i
# cj: the neighbor of the check node j
m = len(raw)
cji = [raw[i] for i in range(m)]
vij = []
for i in range(n):
temp = []
for j in range(m):
... | {"hexsha": "3592faa346a1b1927837fbe0eeb55766fbaeadbc", "size": 1680, "ext": "py", "lang": "Python", "max_stars_repo_path": "lt_bpdecoder.py", "max_stars_repo_name": "newlyj/LT", "max_stars_repo_head_hexsha": "d901eee99602c6c624826e33a30496262a6ac14c", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_st... |
export Berlage,
Ormsby,
Ricker
include("Berlage.jl")
include("Ormsby.jl")
include("Ricker.jl")
| {"hexsha": "e64ef5a67658242da64580b0ef61cdd8569db833", "size": 96, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/Wavelets/Wavelets.jl", "max_stars_repo_name": "fercarozzi/myseismicjulia", "max_stars_repo_head_hexsha": "a8b184af2dca29f36176e78128503d27411f2c28", "max_stars_repo_licenses": ["MIT"], "max_stars... |
# Copyright 2018 Jörg Franke
#
# 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, s... | {"hexsha": "848a1cf650f9fdf06ab92329c906a7754865d549", "size": 5777, "ext": "py", "lang": "Python", "max_stars_repo_path": "adnc/model/utils/word_embedding.py", "max_stars_repo_name": "carusyte/ADNC", "max_stars_repo_head_hexsha": "4a5dfa5be1aca9f815794c2c276ec220a1eb591d", "max_stars_repo_licenses": ["Apache-2.0"], "m... |
module futils
use m_str, only: str
use m_vector, only: dot, &
cross, &
normalize, &
normalized, &
perp_vec, &
rot3d_x, &
rot3d_y, &
rot3d_z
use m_get_default, o... | {"hexsha": "3f552ac5302f03040a66dc9dbceb57810e94b098", "size": 382, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "src/futils.f90", "max_stars_repo_name": "Nkzono99/futils", "max_stars_repo_head_hexsha": "a5f0b2a587452e0b3f4b01feb54093a57546ed43", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "... |
"""
Basic dataset classes for storing image bases for OCR
Datasets return dict {"image": image, "string": string}
"""
import random
import six
import lmdb
from torch.utils.data import Dataset, ConcatDataset, Subset
from torch.nn import functional as F
from PIL import Image
import numpy as np
class DataItemKeys:
"... | {"hexsha": "46b6eab905f28ab2e717ad559b00cd0c1fe310da", "size": 3850, "ext": "py", "lang": "Python", "max_stars_repo_path": "recognition/src/data/dataset.py", "max_stars_repo_name": "AlexeyZhuravlev/OCR-experiments", "max_stars_repo_head_hexsha": "8493045054678a2e13cafce6d9e85c7581086c7a", "max_stars_repo_licenses": ["M... |
(*|
##########################################################
Proving decidability for a datatype that includes a vector
##########################################################
:Link: https://stackoverflow.com/q/55335098
|*)
(*|
Question
********
I'm trying to work with a datatype that represents expressions in ... | {"author": "vonavi", "repo": "coq-examples", "sha": "5e76634f5a069db118df57cb869235a9e0b5c30a", "save_path": "github-repos/coq/vonavi-coq-examples", "path": "github-repos/coq/vonavi-coq-examples/coq-examples-5e76634f5a069db118df57cb869235a9e0b5c30a/examples/proving-decidability-for-a-datatype-that-includes-a-vector.v"} |
""" This module generates notes for a midi file using the
trained neural network """
import pickle
import numpy
from music21 import instrument, note, stream, chord
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import Dropout
from keras.layers import LSTM
from keras.layers impo... | {"hexsha": "8a61687b7f6503c949d63737a2503b73b288bebf", "size": 4884, "ext": "py", "lang": "Python", "max_stars_repo_path": "predict.py", "max_stars_repo_name": "NehaPendem/Mozart", "max_stars_repo_head_hexsha": "e16620ad0ec05f666b5e8a7255eee10cbea3c2dd", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max... |
import chainer
import chainer.links as L
import chainer.functions as F
import random
#import cupy as np#if gpu is used
import numpy as np
import codecs
from chainer.training import extensions,triggers
import pickle
import optuna
from pathlib import Path
import glob
import os
import time
import collections
import argp... | {"hexsha": "65ba142a104b78ad64785890cc0c0076836853e7", "size": 25716, "ext": "py", "lang": "Python", "max_stars_repo_path": "LSTM_subtree/src/LSTM_subtree_model.py", "max_stars_repo_name": "funalab/SymbolicIntegrator", "max_stars_repo_head_hexsha": "d5bc4acbe2a9d7e1b14d72bd976ec9b3e2bab653", "max_stars_repo_licenses": ... |
# Copyright (c) Facebook, Inc. and its affiliates.
import copy
from functools import lru_cache
import math
import os
import yaml
import numpy as np
import torch
import torch.nn.functional as Fu
from pytorch3d.renderer import cameras
from pytorch3d.transforms import so3
from visdom import Visdom
import c3dpo
from h... | {"hexsha": "ef0ba35209f98f4c695ff41d775fcc14b0a01911", "size": 44961, "ext": "py", "lang": "Python", "max_stars_repo_path": "c3dm/model.py", "max_stars_repo_name": "facebookresearch/c3dm", "max_stars_repo_head_hexsha": "cac38418e41f75f1395422200b8d7bdf6725aa43", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 15... |
import numpy as np
from datetime import datetime
import cv2
from pathlib import Path
from skimage.filters import threshold_otsu
from skimage import filters
from scipy import ndimage
def segment_worms(g, well, well_paths):
'''
Segments worms to use for downstream normalization.
'''
# create a disk mas... | {"hexsha": "949306e9e20a43d2057fe9dcf0005d3f438610fd", "size": 3742, "ext": "py", "lang": "Python", "max_stars_repo_path": "modules/segment_worms.py", "max_stars_repo_name": "zamanianlab/wrmXpress", "max_stars_repo_head_hexsha": "a40b3e7d66c3ca4e319ad268fd5c0bf0de036d16", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
import pj2_clfs_zhihu.config as conf
import numpy as np
import word2vec
def emb2npz(emb_file_path, emb_dict_path):
"""将txt格式的embedding转为字典格式, 并将<PAD>和<UNK>加入"""
emb = word2vec.load(emb_file_path)
vec = emb.vectors
word2id = emb.vocab_hash
word2id['<PAD>'] = len(word2id)
pad_row = [0] * vec.sh... | {"hexsha": "20650ef8aa475d95536781b392b7d79920ea5615", "size": 2175, "ext": "py", "lang": "Python", "max_stars_repo_path": "pj2_clfs_zhihu/pre_data.py", "max_stars_repo_name": "AidenLong/PJ_NLP", "max_stars_repo_head_hexsha": "527e37806011235d86d4f86e3ee424f97ffffbdb", "max_stars_repo_licenses": ["Apache-2.0"], "max_st... |
# Yılan duvarın içine geçiyor kendi üzerinde yem oluşuyor .
# batch_size 500 dene
# her ilk hareket random
# Highscore grafiği
# Her Skorda kaç adım atmış pie grafiği ya da heatmap grafiği dot grafiğin alternatifi
# Keras plot model loss (https://machinelearningmastery.com/display-deep-learning-model-training-hist... | {"hexsha": "1b484da23ac3ee1c8a0412bb439eeafb3414b3c3", "size": 41834, "ext": "py", "lang": "Python", "max_stars_repo_path": "snake_agent.py", "max_stars_repo_name": "smlblr/Snake-Game-with-DDQN", "max_stars_repo_head_hexsha": "1b79a0d34cc07c43b121460f560bc2b8f99e591d", "max_stars_repo_licenses": ["MIT"], "max_stars_cou... |
import os
import logging
import tempfile
import nibabel
import numpy
import shutil
import dicom2nifti.image_reorientation as image_reorientation
from dicom2nifti.common import get_nifti_data
def ground_thruth_filenames(input_dir):
nifti_file = input_dir + '_ground_truth.nii.gz'
reoriented_nifti_file = input... | {"hexsha": "ea91357ffeb4b78417d2cd55cfbe18b59e1a66bf", "size": 2861, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_tools.py", "max_stars_repo_name": "JuanPabloMontoya271/dicom2nifti", "max_stars_repo_head_hexsha": "dfea030fbc47ed9c43d7bb1c8a468c2be963a043", "max_stars_repo_licenses": ["MIT"], "max_s... |
import os
import sys
sys.path.append("..")
import numpy as np
import tensorflow as tf
# from octrees import *
from libs import *
class OctreeConvTest(tf.test.TestCase):
def forward_and_backward(self, kernel_size, stride, idx=0):
depth = 4
channel= 3
height = 152
num_outputs = 5
# octree = octr... | {"hexsha": "1dc2b9a1620c0b0a17b4d280807d242d5859adc0", "size": 1837, "ext": "py", "lang": "Python", "max_stars_repo_path": "tensorflow/test/test_octree_conv.py", "max_stars_repo_name": "pauldinh/O-CNN", "max_stars_repo_head_hexsha": "fecefd92b559bdfe94a3983b2b010645167c41a1", "max_stars_repo_licenses": ["MIT"], "max_st... |
%
% y = nnormn(x,dim,p)
%
% NNORMN normalizes an array x by its p-vector norms along dimension <dim>.
%
% dim: dimension along which to calculate norm. Default first nonsingleton
% p: norm-type. Default is 2.
%
% Equivalence: normc(x) == nnormn(x,1,2), normr(x) == nnormn(x,2,2)
%
% See also NORMC, NORMR, NNORM
% C... | {"author": "Sable", "repo": "mcbench-benchmarks", "sha": "ba13b2f0296ef49491b95e3f984c7c41fccdb6d8", "save_path": "github-repos/MATLAB/Sable-mcbench-benchmarks", "path": "github-repos/MATLAB/Sable-mcbench-benchmarks/mcbench-benchmarks-ba13b2f0296ef49491b95e3f984c7c41fccdb6d8/11139-array-tool-set/array/nnormn.m"} |
[STATEMENT]
lemma long_pow_exp: "r \<noteq> \<epsilon> \<Longrightarrow> m \<le> \<^bold>|r\<^sup>@m\<^bold>|"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. r \<noteq> \<epsilon> \<Longrightarrow> m \<le> \<^bold>|r \<^sup>@ m\<^bold>|
[PROOF STEP]
unfolding pow_len[of r m]
[PROOF STATE]
proof (prove)
goal (1 subgo... | {"llama_tokens": 284, "file": "Combinatorics_Words_CoWBasic", "length": 3} |
# -*- coding: utf-8 -*-
"""Copyright 2019 DScribe developers
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 agr... | {"hexsha": "ea5d6c32afd2e89b25fb28c9b3e9419b1ebf438b", "size": 7264, "ext": "py", "lang": "Python", "max_stars_repo_path": "dscribe/kernels/localsimilaritykernel.py", "max_stars_repo_name": "Iximiel/dscribe", "max_stars_repo_head_hexsha": "1dd845cb918a244714f835023bdc82d95719eef1", "max_stars_repo_licenses": ["Apache-2... |
import numpy as np
import pandas as pd
import psycopg2
from io import StringIO
from sklearn.model_selection import train_test_split
from db import db_engine
create_table_sql = """
CREATE TABLE IF NOT EXISTS marketing (
id serial PRIMARY KEY,
age integer,
job varchar(128),
marital varchar(128),
ed... | {"hexsha": "469b28808b788585e00c01d5d81a2bd89b08bffc", "size": 1596, "ext": "py", "lang": "Python", "max_stars_repo_path": "PostgreSQL_AutoML/init_db.py", "max_stars_repo_name": "mljar/integrations", "max_stars_repo_head_hexsha": "147154dd33daa7bd478fec912e034c7e28dbc53a", "max_stars_repo_licenses": ["MIT"], "max_stars... |
/* $Id$
*
* Copyright 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com)
*
* This file is part of OpenCAMlib.
*
* OpenCAMlib is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3... | {"hexsha": "16be29c7c62f8d79bc07f44dddd0c75638db953b", "size": 20359, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "opencamlib/src/attic/octree.cpp", "max_stars_repo_name": "JohnyEngine/CNC", "max_stars_repo_head_hexsha": "e4c77250ab2b749d3014022cbb5eb9924e939993", "max_stars_repo_licenses": ["Apache-2.0"], "max... |
# This Python file uses the following encoding: utf-8
import numpy as np
from plotly.subplots import make_subplots
import plotly.graph_objects as go
import matplotlib.cm as cm
from .colors import colorscale
class Brain:
def __init__(self, df1, order, coords_2d, df2=None):
"""
Brain Constructor.
... | {"hexsha": "86c1ff3c36b8d012712e11ac57d681ff245d01d9", "size": 7949, "ext": "py", "lang": "Python", "max_stars_repo_path": "nidmd/plotting/brain.py", "max_stars_repo_name": "arnauddhaene/nidmd", "max_stars_repo_head_hexsha": "e163aed0c3e80838ac37fa105b8026e535af2e5b", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
#!/usr/bin/env python
import numpy as np
import pickle
import random
from random import shuffle
from training.util import adjust_learning_rate, clip_model_grad, create_opt, load_dynamic_config
from util.evaluate import evaluate, count_overlap, evaluate_detail
from model.SemiMention import SemiMention
from config import... | {"hexsha": "e878ef558f8cb6297812bcf04465739b0f4aad1b", "size": 5588, "ext": "py", "lang": "Python", "max_stars_repo_path": "train.py", "max_stars_repo_name": "berlino/overlapping-ner-em18", "max_stars_repo_head_hexsha": "c2db301cfd88c4ab51694d816fce6c2dcb75c5b9", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 2... |
"""
转换pytorch版本OCR到keras
暂时只支持dense ocr ,lstm层不支持
"""
import os
import io
import argparse
import configparser
import numpy as np
def parser():
parser = argparse.ArgumentParser(description="pytorch dense ocr to keras ocr")
parser.add_argument('-weights_path',help='models/ocr-dense.pth')
parser.add_argument... | {"hexsha": "e202fdddfd7cdc608deb718008e2359f9c2e0243", "size": 3525, "ext": "py", "lang": "Python", "max_stars_repo_path": "tools/pytorch_to_keras.py", "max_stars_repo_name": "liqinnetgain/redenv", "max_stars_repo_head_hexsha": "9feb19646495b3aae2bfb5b01a7991b2b6372566", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
def init_module(model_name='model'):
import os
# I tried, but it doesn't work...
# os.environ['THEANO_FLAGS'] = 'base_compiledir=~/.theano/' + model_name + str(os.getppid())
# print(os.environ['THEANO_FLAGS'])
from importlib import reload
global pm
import pymc3 as pm
pm = reload(pm... | {"hexsha": "cf61932ae5406980641c91eb32080557d203cbfe", "size": 17065, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/pymc3_models.py", "max_stars_repo_name": "KastnerRG/sherlock", "max_stars_repo_head_hexsha": "ba3e8a81e08315df169bb5dd76d9fdd8f2660583", "max_stars_repo_licenses": ["CC-BY-4.0"], "max_stars_c... |
# -*- coding: utf-8 -*-
"""
The program performs classification on datasets generated using sklearn as well as a image dataset provided via kaggle through a neural network.
The user can define the layers of the neural network with respect to various activations and layer sizes.
@author: Randeep
"""
import numpy as n... | {"hexsha": "62c2dae24f04d3ef6ecf32e0fdb29f12634e8885", "size": 12612, "ext": "py", "lang": "Python", "max_stars_repo_path": "NeuralNet.py", "max_stars_repo_name": "monkeysforever/Neural-Net", "max_stars_repo_head_hexsha": "3bb50d97451691b21c4ade14b726cf254a135649", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
"""
Interface to libpq - which interfaces with PostgreSQL's backend server
All functions should be considered unsafe (will segfault with bad pointers.)
Also, pointers's need their memory freed by calling the right PQ* functions.
"""
macro c(ret_type, func, arg_types, lib)
local args_in = Any[ symbol(string('a',x)... | {"hexsha": "39fbce66a0bfcec48130aac92f92d26787d9edf1", "size": 7895, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/libpq.jl", "max_stars_repo_name": "NCarson/Postgres", "max_stars_repo_head_hexsha": "5e263421df530a9d064451eb1ec6690b8f6c5985", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 12, "max_s... |
version = v"6.2.1"
include("../common.jl")
# Build the tarballs
build_tarballs(ARGS, configure(version)...;
preferred_gcc_version=v"6", julia_compat="1.7")
| {"hexsha": "adba59203bb9d9dd3fd1a9147251a32462125853", "size": 174, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "G/GMP/GMP@6.2.1/build_tarballs.jl", "max_stars_repo_name": "waralex/Yggdrasil", "max_stars_repo_head_hexsha": "bba5443f75b221c6973d479e2c6727cf0ae3a0b3", "max_stars_repo_licenses": ["MIT"], "max_sta... |
import numpy as np
import torch
import torch.nn as nn
import torchvision
import os, sys
import copy
import time
import random
import ipdb
from tqdm import tqdm
import argparse
import network
sys.path.insert(0, "..")
from gflownet import get_GFlowNet
import utils_data
def makedirs(path):
if not os.path.exists(pat... | {"hexsha": "1e7ca752417e23afc4023665610f6b01aa0ea05a", "size": 9970, "ext": "py", "lang": "Python", "max_stars_repo_path": "deepebm/ebm.py", "max_stars_repo_name": "mlaugharn/EB_GFN", "max_stars_repo_head_hexsha": "2d20b5d37edb9c50e0bc0fb7feedbc390ddfefd7", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "... |
import numpy as np
class GeneratedImageHook:
# Pytorch forward pass module hook.
def __init__(self, module, every_n=10):
self.generated_images = []
self.count = 1
self.every_n = every_n
self.last_image = None
self.hook = module.register_forward_hook(self.save_generated... | {"hexsha": "ce6e3367bed5cb42337180dc0c70c8694fd6a73a", "size": 725, "ext": "py", "lang": "Python", "max_stars_repo_path": "pytorch_stylegan_encoder/utilities/hooks.py", "max_stars_repo_name": "CSID-DGU/-2020-1-OSSP1-ninetynine-2", "max_stars_repo_head_hexsha": "b1824254882eeea0ee44e4e60896b72c51ef1d2c", "max_stars_repo... |
# -*- coding: utf-8 -*-
"""
Spyder Editor
This is a temporary script file.
"""
import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(0,2*np.pi,1000)
f, ax = plt.subplots()
ax.plot(x,x)
ax.set_xlabel('x')
ax.set_ylabel('y')
| {"hexsha": "0fce85554b859a904edc68207169f7370f54cf3e", "size": 239, "ext": "py", "lang": "Python", "max_stars_repo_path": "python_plot.py", "max_stars_repo_name": "njhung/NU_REU_git_njh", "max_stars_repo_head_hexsha": "8327746797a05bdecc052d1d825f0cc903149025", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nul... |
import numpy as np
from pathlib import Path
import pickle
from cytoolz import identity
from .predictors import common
from ..log import logger
class Predictor(object):
"""
Abstract predictor class which can manage scoring estimation via cross validation.
Attributes:
predictor (predictor object)... | {"hexsha": "65f712b7406e2a6a82f05ed5c7dc67fa89a41e54", "size": 5403, "ext": "py", "lang": "Python", "max_stars_repo_path": "representation_learning_for_transcriptomics/supervised/predictor.py", "max_stars_repo_name": "unlearnai/representation_learning_for_transcriptomics", "max_stars_repo_head_hexsha": "66e7a31471ca3de... |
import cv2
import torch
import numpy as np
from ..base_internode import BaseInternode
from torch.nn.functional import interpolate
from utils.heatmap_tools import calc_gaussian_2d, heatmap2quad
__all__ = ['CalcAffinityQuad', 'CalcHeatmapByQuad', 'RandomCropSequence']
class CalcAffinityQuad(BaseInternode):
def __... | {"hexsha": "e84e92b35a3aefd75116acaf3b715ca838b8624b", "size": 6738, "ext": "py", "lang": "Python", "max_stars_repo_path": "datasetsnx/bamboo/misc/craft.py", "max_stars_repo_name": "ckxy/part-of-hitogata", "max_stars_repo_head_hexsha": "76402d48a336fcd964d0e64bb01d959e8f07f296", "max_stars_repo_licenses": ["MIT"], "max... |
import os.path as osp
from functools import partial
import mmcv
import numpy as np
import pytest
import torch
from mmdet import digit_version
from mmdet.models.dense_heads import RetinaHead, YOLOV3Head
from .utils import (WrapFunction, convert_result_list, ort_validate,
verify_model)
data_path = ... | {"hexsha": "ed6888f5bced4c69f030fd48fa800f1183f78548", "size": 6848, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_onnx/test_head.py", "max_stars_repo_name": "likelyzhao/Swin-Transformer-Object-Detection", "max_stars_repo_head_hexsha": "4003ea497e32be85b657a928e6b7d8f782e578ff", "max_stars_repo_lice... |
"""Conversion code from CSV to NetCDF files
:author: Chris R. Vernon
:email: chris.vernon@pnnl.gov
License: BSD 2-Clause, see LICENSE and DISCLAIMER files
"""
import os
import numpy as np
import pandas as pd
class DataToArray:
"""Convert Xanthos outputs from CSV to a 3D NumPy array having a data value ... | {"hexsha": "041618b91d540f9973ef4b5d8c339fcc3b7e23e0", "size": 7559, "ext": "py", "lang": "Python", "max_stars_repo_path": "xnetcdf/convert.py", "max_stars_repo_name": "crvernon/xnetcdf", "max_stars_repo_head_hexsha": "12aa0788888a11d03c7fd346795a0dbff3a102d5", "max_stars_repo_licenses": ["BSD-2-Clause"], "max_stars_co... |
#!/bin/env python
#
# Advent of Code Day 2020
# Day 02
#
# author: Daniel Joseph Antrim
# e-mail: dantrim1023 AT gmail DOT com
#
import sys
from argparse import ArgumentParser
from pathlib import Path
import numpy as np
def unpack_db_entry(db_entry):
"""
Takes a DB entry and returns the password itself,
... | {"hexsha": "c56aa31aff782f1765d4593eca3b695eccca34ef", "size": 4139, "ext": "py", "lang": "Python", "max_stars_repo_path": "2020/python/day_02/day_02.py", "max_stars_repo_name": "dantrim/danny_advents_of_code", "max_stars_repo_head_hexsha": "57bfe4da81db5aa34c83604eab765552a688b144", "max_stars_repo_licenses": ["MIT"],... |
#Ref: Microscopists
# Image smoothing, denoising
# Averaging, gaussian blurring, median, bilateral filtering
#OpenCV has a function cv2.filter2D(), which convolves whatever kernel we define with the image.
import cv2
import numpy as np
from matplotlib import pyplot as plt
img = cv2.imread('images/BSE_Google_noisy.jp... | {"hexsha": "eb4880f354085848f6fa8167eef61df23d9cbf86", "size": 1483, "ext": "py", "lang": "Python", "max_stars_repo_path": "10_image_processing_in_openCV_intro1-preprocessing.py", "max_stars_repo_name": "Data-Laboratory/WorkExamples", "max_stars_repo_head_hexsha": "27e58207e664da7813673e6792c0c30c0a5bf74c", "max_stars_... |
# -*-coding:utf-8-*-
from facenet_pytorch import MTCNN, RNet
from PIL import Image, ImageDraw
import torch, mmcv, cv2, time, json, os
import numpy as np
from torch.nn.functional import interpolate
def test_mtcnn_img():
mtcnn = MTCNN(image_size=640, thresholds=[0.8, 0.8, 0.6], min_face_size=40)
img = Image.open... | {"hexsha": "07031bd156241c033e55cbecd8c480df5ceb9403", "size": 15323, "ext": "py", "lang": "Python", "max_stars_repo_path": "cof_main.py", "max_stars_repo_name": "HandsomeHans/Face-Tracking-Using-Optical-Flow-and-CNN-Pytorch", "max_stars_repo_head_hexsha": "b12cb26cd4d038d9763a9be0910154be2ec91d9a", "max_stars_repo_lic... |
Endpoint("/examples") do request::HTTP.Request
readstring(joinpath(dirname(@__FILE__),"examples.html"))
end
Endpoint("/examples/pages") do request::HTTP.Request
readstring(joinpath(dirname(@__FILE__),"pages.html"))
end
include("plotly.jl")
include("requests.jl")
# include("mwe.jl")
function examples()
@asyn... | {"hexsha": "ecdb8aa2dd6867953e901913d064d69689ae69af", "size": 408, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "examples/examples.jl", "max_stars_repo_name": "minggu24/Pages.jl", "max_stars_repo_head_hexsha": "6b187312a3bc3b19108a500032fe5a0ecda613a5", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nu... |
from __future__ import annotations
from typing import Callable
import numpy as np
from numpy.typing import ArrayLike
from ._helpers import (
Info,
LinearOperator,
asrlinearoperator,
clip_imag,
get_default_inner,
wrap_inner,
)
def cgls(
A: LinearOperator,
b: ArrayLike,
inner: Cal... | {"hexsha": "51c15c1d35b49a86250534db00334e475c3436f8", "size": 2466, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/krylov/cgls.py", "max_stars_repo_name": "nschloe/krylov", "max_stars_repo_head_hexsha": "58813233ff732111aa56f7b1d71908fda78080be", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 36, "... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Feb 18 10:05:47 2020
@author: heiko
"""
import numpy as np
from pyrsa.util.inference_util import pool_rdm
from pyrsa.rdm import compare
from .crossvalsets import sets_leave_one_out_rdm
def cv_noise_ceiling(rdms, ceil_set, test_set, method='cosine',
... | {"hexsha": "5db153ccefc17827aeb7cd9c98bf026c9b698e8d", "size": 2909, "ext": "py", "lang": "Python", "max_stars_repo_path": "pyrsa/inference/noise_ceiling.py", "max_stars_repo_name": "Brandon-YuHu/pyrsa", "max_stars_repo_head_hexsha": "074213cc22e79f702ebbb4f154235f8df8c111cc", "max_stars_repo_licenses": ["MIT"], "max_s... |
// Copyright 2020 The "Oko" project authors. All rights reserved.
// Use of this source code is governed by a MIT license that can be
// found in the LICENSE file.
#include "viewer/ui/log_files_window.h"
#include <algorithm>
#include <array>
#include <boost/algorithm/string/replace.hpp>
#include <boost/format.hpp>
#i... | {"hexsha": "1a551a7403ecdde811c2b54aec2c774586436a62", "size": 8165, "ext": "cc", "lang": "C++", "max_stars_repo_path": "viewer/ui/log_files_window.cc", "max_stars_repo_name": "vchigrin/oko", "max_stars_repo_head_hexsha": "2167ae07f450b623d23b9b5a07ff5bac49347e09", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
#define CATCH_CONFIG_MAIN
#include <catch2/catch.hpp>
#include <mitama/result/result.hpp>
#include <mitama/maybe/maybe.hpp>
#include <boost/xpressive/xpressive.hpp>
#include <string>
using namespace mitama;
using namespace std::string_literals;
TEST_CASE("is_just()", "[maybe][is_just]"){
maybe<int> x = just(2);
... | {"hexsha": "f7a1139d9d126cd5a0a6c6fd061cfddeffaafbf1", "size": 9163, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "test/Maybe_Test.cpp", "max_stars_repo_name": "agate-pris/mitama-cpp-result", "max_stars_repo_head_hexsha": "9d94f3c9b5722892496ee7c63833fe5f12392b89", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
%!TEX root = ..\..\dissertation.tex
\chapter{A Platform Framework}\label{chp:pltfFramework}
\section{Supporting Production Platform Development \& Documentation}
\section{Utilisation of Platforms through Derivative System} | {"hexsha": "ab9db132675ab82e24c5edfb0f6913793210f71b", "size": 224, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "mainmatter/researchResults/pltfFramework.tex", "max_stars_repo_name": "Firebrazer/DevelopingManufacturingSystemPlatforms", "max_stars_repo_head_hexsha": "7b8b71e6dfbe16da3298dce0e03b62e59d3d7ae8", "m... |
#%%
from sklearn.naive_bayes import MultinomialNB
from sklearn.naive_bayes import BernoulliNB
from sklearn.model_selection import KFold
from sklearn.metrics import confusion_matrix, f1_score, accuracy_score
import numpy as np
import pprint as pprint
import math
import pandas as pd
from sklearn.metrics import roc_curve
... | {"hexsha": "b6a9512cc9fd4e1326f5a0a500336ff304d3d4c2", "size": 6332, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/models.py", "max_stars_repo_name": "dapluggg/politicalParty-classifier", "max_stars_repo_head_hexsha": "53f38ac5783305adbba815ab1739aab448565ee0", "max_stars_repo_licenses": ["MIT"], "max_... |
// Software License for MTL
//
// Copyright (c) 2007 The Trustees of Indiana University.
// 2008 Dresden University of Technology and the Trustees of Indiana University.
// 2010 SimuNova UG (haftungsbeschränkt), www.simunova.com.
// All rights reserved.
// Authors: Peter Gottschling and And... | {"hexsha": "39001db3bcf89a210f1417ca77316d7a0273ea0a", "size": 4518, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "libs/numeric/mtl/experimental/portfolio_test.cpp", "max_stars_repo_name": "lit-uriy/mtl4-mirror", "max_stars_repo_head_hexsha": "37cf7c2847165d3537cbc3400cb5fde6f80e3d8b", "max_stars_repo_licenses":... |
# -*- coding: utf-8 -*-
"""
Created on Sun Aug 25 19:14:27 2019
@author: Browsing
"""
import numpy as np
import matplotlib.pyplot as plt
def f(x, y):
return (x+20.0*y)*np.sin(x*y)
# return 3*x
def RK2(startX , startY , endX , h , a2):
a1 = 1.0- a2
p1 = 0.5/a2
q11 = 0.5/a2
x = list()
y = ... | {"hexsha": "55434b29326da2edfd6daced5c8e6d6f4efdab60", "size": 3395, "ext": "py", "lang": "Python", "max_stars_repo_path": "Numerical/Offline 5 on ODE/Numerical Offline RK method.py", "max_stars_repo_name": "mahdihasnat/2-1-kodes", "max_stars_repo_head_hexsha": "1526de08f1bce66dbe428a8b27fedaca1ec75004", "max_stars_rep... |
"""Testing for Bag-of-Words."""
import numpy as np
import pytest
import re
from pyts.bag_of_words import BagOfWords
X = [['a', 'a', 'a', 'b', 'a'],
['a', 'a', 'b', 'b', 'a'],
['b', 'b', 'b', 'b', 'a']]
@pytest.mark.parametrize(
'params, error, err_msg',
[({'window_size': '4'}, TypeError,
"'... | {"hexsha": "be08499fe417c76f9f4780eda94b39ea1baa8216", "size": 2463, "ext": "py", "lang": "Python", "max_stars_repo_path": "pyts/bag_of_words/tests/test_bow.py", "max_stars_repo_name": "martanto/pyts", "max_stars_repo_head_hexsha": "1c0b0c9628068afaa57e036bd157fcb4ecdddee6", "max_stars_repo_licenses": ["BSD-3-Clause"],... |
import tables
import pandas as pd
import numpy as np
from scipy.interpolate import interp1d
import os
import pickle
import time
from ismore import brainamp_channel_lists
from ismore.invasive import discrete_movs_emg_classification
from ismore.noninvasive.emg_feature_extraction import EMGMultiFeatureExtractor
from is... | {"hexsha": "91d6a57737d43be3b58435ee562602b339b52692", "size": 13103, "ext": "py", "lang": "Python", "max_stars_repo_path": "ismore/invasive/train_movs_emg_classifier.py", "max_stars_repo_name": "DerekYJC/bmi_python", "max_stars_repo_head_hexsha": "7b9cf3f294a33688db24b0863c1035e9cc6999ea", "max_stars_repo_licenses": [... |
from sklearn.model_selection import train_test_split
import pandas as pd
import numpy as np
import time
import pickle
np.random.seed(32113)
def data_preparer_ensemble(df1,df2,df3,df4, lbl = 'word', countries=['US','BR','RU','KR'],\
words=['cat','tiger','lion','dog'],sample=30000, limit = 5000):
... | {"hexsha": "1469c10d6ed151344546e73b2489c5514241c80e", "size": 6424, "ext": "py", "lang": "Python", "max_stars_repo_path": "model/quickdraw_dis_builder/python/ensemble_method_func.py", "max_stars_repo_name": "obastani/verifair", "max_stars_repo_head_hexsha": "1d5efea041330fa9fe8d59d976bdd3ef97aff417", "max_stars_repo_l... |
# import h5pyprovider
import numpy as np
import pickle
import os
import sys
from pointTriangleDistance import pointTriangleDistance
BASE_DIR = os.path.abspath(__file__+"/../")
ROOT_DIR = os.path.dirname(os.path.dirname(BASE_DIR))
sys.path.append(BASE_DIR) # model
sys.path.append(os.path.dirname(BASE_DIR)) # model
sy... | {"hexsha": "e1e92e60caab274e04699213e8464345dd4d7ea1", "size": 13350, "ext": "py", "lang": "Python", "max_stars_repo_path": "primative_seg/pre_process/generate_primative.py", "max_stars_repo_name": "Xharlie/core3d_point_net", "max_stars_repo_head_hexsha": "d1e520ddbcda4539a90f3cc51ebdc9660a79c78f", "max_stars_repo_lice... |
#!/usr/bin/env python
"""
xvg_plot.py
Python script to plot XVG line charts produced by GROMACS analysis tools.
Requires:
* python2.7+
* matplotlib
* numpy
"""
from __future__ import print_function, division
__author__ = 'Joao Rodrigues'
__email__ = 'j.p.g.l.m.rodrigues@gmail.com'
import os
import re... | {"hexsha": "e070423d0c7d1b9072930d8531b4fb8663cfdf0a", "size": 7013, "ext": "py", "lang": "Python", "max_stars_repo_path": "xvg_plot.py", "max_stars_repo_name": "JoaoRodrigues/gmx-tools", "max_stars_repo_head_hexsha": "3bf12e447bd1efa5f02a4eb88753075fd92ad60b", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 6, ... |
import os
import pprint
import random
import warnings
import torch
import numpy as np
from trainer import Trainer, Tester
from inference import Inference
from config import getConfig
warnings.filterwarnings('ignore')
args = getConfig()
def main(args):
print('<---- Training Params ---->')
ppri... | {"hexsha": "6c3b6d26c5caba7e7492da7403dfd0a3175841d9", "size": 1753, "ext": "py", "lang": "Python", "max_stars_repo_path": "main.py", "max_stars_repo_name": "Karel911/TRACER", "max_stars_repo_head_hexsha": "bedc653c3b725cb7e2dd6736f55911b4d24fb246", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count": 55, "max... |
import numpy as np
import pandas as pd
import sklearn.decomposition
import sklearn.impute
import time
import torch
import kernels
import gaussian_process_latent_variable_model
from utils import transform_forward, transform_backward
import bayesian_optimization
torch.set_default_tensor_type(torch.FloatTensor)
fn_data ... | {"hexsha": "930ace36f715d3683d8e3ccc99d35a60c5b9bad5", "size": 9210, "ext": "py", "lang": "Python", "max_stars_repo_path": "run.py", "max_stars_repo_name": "romanlutz/pmf-automl", "max_stars_repo_head_hexsha": "2600cf484658803ecd08b3c03d77eb83f675fa95", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_count": nu... |
import chainer
import numpy
import pytest
import torch
from espnet.scheduler import scheduler
from espnet.scheduler.chainer import ChainerScheduler
from espnet.scheduler.pytorch import PyTorchScheduler
@pytest.mark.parametrize("name", scheduler.SCHEDULER_DICT.keys())
def test_scheduler(name):
s = scheduler.dynam... | {"hexsha": "fadbfb94bc8adf57d2bd35bf803171e11efa2e9b", "size": 1247, "ext": "py", "lang": "Python", "max_stars_repo_path": "test/test_scheduler.py", "max_stars_repo_name": "roshansh-cmu/espnet", "max_stars_repo_head_hexsha": "5fa6dcc4e649dc66397c629d0030d09ecef36b80", "max_stars_repo_licenses": ["Apache-2.0"], "max_sta... |
#include "apriltag_ros/apriltag_detector.h"
#include <boost/make_shared.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <ros/ros.h>
namespace apriltag_ros {
namespace mit = apriltag_mit;
namespace umich = apriltag_umich3;
/// ================
/// ApriltagDetector
/// ====... | {"hexsha": "9ad16191fab379f013663b0b190b0cf08bf03ee5", "size": 10230, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "apriltag_ros/src/apriltag_detector.cpp", "max_stars_repo_name": "versatran01/sv_fiducial", "max_stars_repo_head_hexsha": "7e054d975f4da423d1e230ec699512e6c83e3261", "max_stars_repo_licenses": ["Apa... |
import numpy as np
import pandas as pd
from scipy.stats import wilcoxon, binomtest, f
import statsmodels.formula.api as smf
import statsmodels.api as sm
import statsmodels.tools.sm_exceptions as sme
from scipy.special import digamma,polygamma
from scipy.stats import nbinom
libmtspec = True
try:
from mtspec impo... | {"hexsha": "aeb67be00d54c264e2412a5183418be1ae77f9e1", "size": 8490, "ext": "py", "lang": "Python", "max_stars_repo_path": "ribofy/stats.py", "max_stars_repo_name": "ncrnalab/ribofy", "max_stars_repo_head_hexsha": "f0140018f322d60b87a44796358e179e52d6f837", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, "max... |
# Copyright (C) 2020 NumS Development 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 ... | {"hexsha": "f21b140ab0fb79e316d472e3071987f6446c72fc", "size": 20690, "ext": "py", "lang": "Python", "max_stars_repo_path": "nums/core/array/view.py", "max_stars_repo_name": "UsernameChun/nums", "max_stars_repo_head_hexsha": "3a10598cc32b9763f1f2733e9e1089399d48ef3c", "max_stars_repo_licenses": ["Apache-2.0"], "max_sta... |
import random
import numpy as np
import torch
class game:
def __init__(self, size, nConnect):
self.size = size
self.nConnect = nConnect
def reset(self):
self.state = torch.zeros((self.size, self.size))
return self.state, False
def show_state(self):
print("Current ... | {"hexsha": "a175695c55ef4a6d2d81d6889bc14cc0f0a6b55f", "size": 2200, "ext": "py", "lang": "Python", "max_stars_repo_path": "game.py", "max_stars_repo_name": "lbarazza/sedano", "max_stars_repo_head_hexsha": "f45ed2fe40c81904871e0ec72ad980c1bc20e3d6", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_star... |
[STATEMENT]
lemma encode_complete:
"encode h prob = Inr err \<Longrightarrow>
\<not>(ast_problem.well_formed prob \<and> (\<forall>op \<in> set (ast_problem.ast\<delta> prob). consistent_pres_op op) \<and>
(\<forall>op \<in> set (ast_problem.ast\<delta> prob). is_standard_operator op))"
[PROOF STATE]
proof... | {"llama_tokens": 482, "file": "Verified_SAT_Based_AI_Planning_Solve_SASP", "length": 2} |
#!/usr/bin/env python
#This script plots drag around an inline oscillating cylinder for re 200 kc 10 against dutsch et als work at cycle 14
import argparse
import os
import os.path
import sys
import csv
import matplotlib
from matplotlib import pyplot as plt
import numpy
cuibmFolder = os.path.expandvars("/scratch/src/c... | {"hexsha": "ccbc293e44f9e193c1aa8b2cc6e9c264d0cadafc", "size": 1972, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/validation/osc_Re200_KC10.py", "max_stars_repo_name": "Niemeyer-Research-Group/cuIBM", "max_stars_repo_head_hexsha": "0fa913a465e4f0f3432e0dbd4d3df9bc47905406", "max_stars_repo_licenses": ... |
# Copyright (c) 2020 Graphcore Ltd. 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 applicable l... | {"hexsha": "5c33aa6f44991335d31e27b7b270c61509e0ce3f", "size": 6808, "ext": "py", "lang": "Python", "max_stars_repo_path": "applications/popart/bert/phased_execution/weight_mapping.py", "max_stars_repo_name": "kew96/GraphcoreExamples", "max_stars_repo_head_hexsha": "22dc0d7e3755b0a7f16cdf694c6d10c0f91ee8eb", "max_stars... |
import time
import cv2
from gym.envs.atari.atari_env import AtariEnv
import numpy as np
def run_experiment(dataset, preprocess_fn):
times = []
for x in dataset:
start = time.time()
y = preprocess_fn(x)
end = time.time()
times.append(end - start)
times = 1e6 * np.asarray(t... | {"hexsha": "3deed484f53ecfab3feeb86bc14f452bcbde7a4a", "size": 1551, "ext": "py", "lang": "Python", "max_stars_repo_path": "experiments/image_preprocessing.py", "max_stars_repo_name": "brett-daley/fast-dqn", "max_stars_repo_head_hexsha": "acf21e8bb193e52d73aa8e2d4e355957095bbd36", "max_stars_repo_licenses": ["MIT"], "m... |
import os
import time
import numpy as np
from sklearn.utils.random import check_random_state
from ilp.experiments.base import BaseExperiment
from ilp.helpers.data_fetcher import fetch_load_data, IS_DATASET_STREAM
from ilp.helpers.params_parse import parse_yaml, experiment_arg_parser
from ilp.constants import CONFIG_DI... | {"hexsha": "26f82cff850f7768ca3c6c2db5cc17e90037edc9", "size": 5475, "ext": "py", "lang": "Python", "max_stars_repo_path": "ilp/experiments/var_n_labeled.py", "max_stars_repo_name": "johny-c/incremental-label-propagation", "max_stars_repo_head_hexsha": "29c413dba023694b99e2c2708c0aa98d891d234d", "max_stars_repo_license... |
"""
This module provides utility functions for the reduction pipeline.
"""
import astropy.io.fits as pyfits
import numpy as np
def find_angle(loc1, loc2):
"""
Calculated the angle between two locations on a grid.
Inputs:
:loc1: (tuple) first location.
:relative: (tuple) second location.
... | {"hexsha": "107b888d54f03b798c0c297333a84764b2aeaec7", "size": 4681, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/simmer/utils.py", "max_stars_repo_name": "arjunsavel/SImMer", "max_stars_repo_head_hexsha": "71d9bf0bf329f597426ebcd71dd0cda731592ec6", "max_stars_repo_licenses": ["MIT"], "max_stars_count": n... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.