text stringlengths 0 1.25M | meta stringlengths 47 1.89k |
|---|---|
import numpy as np
from inspect import unwrap
from omas import *
from omas.omas_utils import printd
from omas.machine_mappings._common import *
__all__ = []
__regression_arguments__ = {'__all__': __all__}
# Reference information
east_divertor_corners = { # Upper, Lower, Outer, Inner
'uo': (1.70668, 1.16211),
... | {"hexsha": "aecf676eb9e34ab4b740ac4e25dcba64810cc8a5", "size": 9321, "ext": "py", "lang": "Python", "max_stars_repo_path": "omas/machine_mappings/east.py", "max_stars_repo_name": "gafusion/omas", "max_stars_repo_head_hexsha": "8e9b725483655db0ccbf9a4f7aa9eba7c6c04864", "max_stars_repo_licenses": ["MIT"], "max_stars_cou... |
import networkx as nx
import matplotlib.pyplot as plt
class NetTopology:
def __init__(self, nodes, links):
# 创建一个空图
self.G = nx.Graph()
# 图中包含节点和边
self.nodes = nodes
self.links = links
# 将节点列表和边列表添加到图中
def create_topo(self):
self.G.add_nodes_from(self.nodes... | {"hexsha": "3e23c9dfb62a9f3af0cb634b994fcca3f3cb6274", "size": 2211, "ext": "py", "lang": "Python", "max_stars_repo_path": "ryu/app/test.py", "max_stars_repo_name": "Yang-Jianlin/ryu", "max_stars_repo_head_hexsha": "9aa3e13d8abb5c71e3d8bfa35959653b62ab7b81", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count":... |
# -*- coding: utf-8 -*-
"""
Created on Thu Jul 25 19:04:06 2019
@author: malopez
"""
import numpy as np
def propagate(t, pos, vel, LX, LY, LZ):
# Free stream of particles
pos += t*vel
# This is to account for the periodic boundaries
pos[:,0] -= np.floor(pos[:,0]/LX)*LX
p... | {"hexsha": "67d470878b8d8a75ca61284ec2f8d685bd22168f", "size": 419, "ext": "py", "lang": "Python", "max_stars_repo_path": "propagation.py", "max_stars_repo_name": "Thefalas/dsmc-rough", "max_stars_repo_head_hexsha": "94ca12e86b87e117c69960335fd6a5fa846ee7c9", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null,... |
'''
Created on Feb 13, 2018
@author: dani
'''
import numpy as np
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
import timeit
import os
import sys
#sys.path.insert(0, '../src')
import run
from util import convert_database_to_files
from evaluation.evaluation import evaluation
from util import ... | {"hexsha": "e6d7fa7b32d54b8ed44d06deafa2c642411ccbc5", "size": 15762, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/dani_run_command_line.py", "max_stars_repo_name": "imagexdsearch/imagesearch", "max_stars_repo_head_hexsha": "7f4d18906d6ebd9f5d7b4e0db4bc6c7e675fbb1d", "max_stars_repo_licenses": ["BSD-2-Cla... |
import os
import glob
import torch
import numpy as np
import scipy.io
from PIL import Image
from torchvision.utils import make_grid
def pil_load_image(img_path):
return Image.open(img_path).convert('RGB')
def torch_to_pil_image(x):
x_out = make_grid(x, normalize=True, scale_each=True)
x_out = (x_out.num... | {"hexsha": "836e69c0eefc9222191050e4d71f1baca1410bbe", "size": 1944, "ext": "py", "lang": "Python", "max_stars_repo_path": "common/io.py", "max_stars_repo_name": "garyzhao/FRGAN", "max_stars_repo_head_hexsha": "8aeb064fc93b45d3d8e074c5253b4f7a287582f4", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count": 39, ... |
\lab{Correlation and Covariance}{Correlation and Covariance}
\label{lab:Stats1}
\objective{Explore applications of inner product spaces to topics in statistics.}
% Source of the datasets: http://people.sc.fsu.edu/~jburkardt/datasets/regression/regression.html
% under the GNU LGPL liscence
\section*{Shifting Data by ... | {"hexsha": "b866cef37e477c2d73e041c1c26e2196670fe9f9", "size": 23382, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "Labs/CorrelationCovariance/CorrCovariance.tex", "max_stars_repo_name": "jessicaleete/numerical_computing", "max_stars_repo_head_hexsha": "cc71f51f35ca74d00e617af3d1a0223e19fb9a68", "max_stars_repo_... |
import Aswing
# Read and input .asw file
inputasw = "hawk.asw"
asw = Aswing.readasw(inputasw)
Aswing.setgeom(asw)
# Read and input .pnt file
inputpnt = "hawk.pnt"
pnt = Aswing.readpnt(inputpnt)
Aswing.setpnt(pnt)
# Save .asw and .pnt files, can be used with original ASWING
outputasw = "out.asw"
Aswing.aswsav(outputa... | {"hexsha": "96a9991f2426ae871ae68d2e0d307d88f9fb22dd", "size": 1508, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "example/example.jl", "max_stars_repo_name": "byuflowlab/Aswing.jl", "max_stars_repo_head_hexsha": "5d50e8952b624836f4ba409bdd069d3b899b59fa", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
import cv2
import numpy as np
import argparse
from matplotlib import pyplot as plt
import glob
from skimage.measure import compare_ssim
ap = argparse.ArgumentParser()
ap.add_argument("-i", "--image", required=True,
help="Path to images where template will be matched")
ap.add_argument("-v", "--visualize", default=Tru... | {"hexsha": "7522991609a55022292388a336d9d22374717bb8", "size": 4321, "ext": "py", "lang": "Python", "max_stars_repo_path": "scratch_detect/sd.py", "max_stars_repo_name": "roger1993/classic_algorithm", "max_stars_repo_head_hexsha": "7b0cda39d6c48b76f2b12ad74a31ffb19776c0e7", "max_stars_repo_licenses": ["MIT"], "max_star... |
##############################################################################
# Copyright by The HDF Group. #
# All rights reserved. #
# #
# Th... | {"hexsha": "72c35de0ef0bf44c19dc6724ed318dd8f1de9a39", "size": 28806, "ext": "py", "lang": "Python", "max_stars_repo_path": "hsds/datanode_lib.py", "max_stars_repo_name": "jjaraalm/hsds", "max_stars_repo_head_hexsha": "936c9033fbbffcfe5093dd55c4f2992458ac2df5", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_coun... |
#!/usr/bin/env python
"""
Author: Manpreet Singh 2016
Headless mode for raspberry pi.
This program only returns the X and Y position of an object if it is found in the image
"""
import cv2 as cv
import numpy as np
from networktables import NetworkTable
from Template import Template
nt = NetworkTable.getTable("VISIO... | {"hexsha": "36ffc6de178090303ea8d6004a6fab482737cfdd", "size": 1200, "ext": "py", "lang": "Python", "max_stars_repo_path": "HeadlessChargerVision.py", "max_stars_repo_name": "ManOfPreet/ChargerVision", "max_stars_repo_head_hexsha": "3251696a44ec2fa5c79349ca3b0b0d373a362e0b", "max_stars_repo_licenses": ["MIT"], "max_sta... |
from __future__ import unicode_literals
import os, sys, re
from datetime import datetime
import numpy as np
from utility import database
class Usage_Year_Information:
year = ''
month = ''
cnt = ''
case_id = ''
def USAGEYEAR(configuration):
db = configuration.cursor
usage_history_list = []
... | {"hexsha": "84cee199b4a55742e75d6e45f8dbe63c4eaad410", "size": 1582, "ext": "py", "lang": "Python", "max_stars_repo_path": "advanced_modules/windows_usage_history/lv2_visualization_usage_year.py", "max_stars_repo_name": "dfrc-korea/carpe", "max_stars_repo_head_hexsha": "9afa8b624948fd462bb19c90cbc811228fd52c21", "max_s... |
#! /usr/bin/env python -*- coding: utf-8 -*-
"""
Name:
perspective_image.py
Desscription:
The main image class for Perspective
Version:
1 - Inital release
Author:
J.MacGrillen <macgrillen@gmail.com>
Copyright:
Copyright (c) John MacGrillen. All rights reserved... | {"hexsha": "7a875afa5c95aa7904f86437ef2c3be64a796541", "size": 1643, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/perspective_image.py", "max_stars_repo_name": "jmacgrillen/perspective", "max_stars_repo_head_hexsha": "6e6e833d8921c54c907dd6314d4bc02ba3a3c0b6", "max_stars_repo_licenses": ["MIT"], "max_star... |
using Test, ScientificTypes, ScientificTypesBase, Random
using Tables, CategoricalArrays, DataFrames
using ColorTypes
using Dates
# using CSV # dropped until julia release new LTS as issue for 1.0
import Distributions
const Arr = AbstractArray
const CArr = CategoricalArray
const Cat = CategoricalValue
const Vec = A... | {"hexsha": "bccd0b8214dea23608052d352a8ae5998a7565c9", "size": 515, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/runtests.jl", "max_stars_repo_name": "alan-turing-institute/ScientificTypes.jl", "max_stars_repo_head_hexsha": "cecd1eb3bc0c22c25e7777073ce1347cf20871ab", "max_stars_repo_licenses": ["MIT"], "m... |
function SparseGradient(e::E) where E
indexer = Dict{Int,Int}()
d = Gradient(e,indexer)
sparsity = Vector{Int}(undef,length(indexer))
set_sparsity!(sparsity,indexer)
return (d,sparsity)
end
SparseJacobian(s::Sink{Field}) = SparseJacobian(inner(s))
function SparseJacobian(f::Field1{G,I}) where {G,I}
... | {"hexsha": "940bc977828d3fa1e770f1d5059f6f72199d94b2", "size": 1594, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/sparse.jl", "max_stars_repo_name": "sshin23/SimpleNL.jl", "max_stars_repo_head_hexsha": "64f48121d2bc300a5832802fe8908d31adcd7690", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 2, "ma... |
from __future__ import print_function
import numpy as np
import mxnet
import d2lzh as d2l
from mxnet import nd,init
from mxnet.gluon import nn,data as gdata,rnn
from misc import render_block,gather
class BlockOuterNet(nn.Block):
"""
predict block-level programs and parameters
block-LSTM
"""
def _... | {"hexsha": "06e7f6153844dbaec41688159b38615b3ef48005", "size": 20230, "ext": "py", "lang": "Python", "max_stars_repo_path": "model.py", "max_stars_repo_name": "huzhouxiang/shape2gram-mxnet", "max_stars_repo_head_hexsha": "c7a45e5f60ccfc48debc1928988d586084ac6b7d", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
/*
* DIPlib 3.0
* This file contains the thin plate spline functionality
*
* (c)2019, Cris Luengo.
*
* 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/licen... | {"hexsha": "c065eb012bf9ac16c1775f9405bfa72f59de2a4a", "size": 4295, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "src/support/thin_plate_spline.cpp", "max_stars_repo_name": "KDAB/diplib", "max_stars_repo_head_hexsha": "e55d56fab4982dfaeb0cc080d68e199973fec0e1", "max_stars_repo_licenses": ["Apache-2.0"], "max_st... |
include("main.jl")
REWRITE_DATA = true
BUSES, LINES, GENERATORS, rPTDF = load_case_data()
ERROR_VARIANCES_TRUE, ERROR_VARIANCES_WC, ERROR_VARIANCES_SAMPLE = init_stochasticity()
# Test dependency on variance estimation confidence
casename = "out_of_sample_lindist"
case_path = "results/$(casename)"
if REWRITE_DATA &... | {"hexsha": "22ca83aa3819d296db756b1059745e2dfe09cd25", "size": 1397, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "unmaintained_cases/07_out_of_sample_lindist.jl", "max_stars_repo_name": "korpuskel91/distribution_grid_analysis2", "max_stars_repo_head_hexsha": "17f3d36847e050fda463ec1c2fd62fdc03a7d75f", "max_sta... |
import random
import numpy as np
from collections import deque
from agents.DeepAgent import DeepAgent
class DQN(DeepAgent):
def __init__(self, state_dim, valid_actions, model_lambda,
batch_size=32, epochs=1, memory_size=1000):
super().__init__(state_dim, valid_actions, model_lambda, bat... | {"hexsha": "888c703cca2af3182d9305db9cdf8137fc767b78", "size": 1706, "ext": "py", "lang": "Python", "max_stars_repo_path": "BayesianExploration/agents/DQN.py", "max_stars_repo_name": "mike-gimelfarb/bayesian-epsilon-greedy", "max_stars_repo_head_hexsha": "77ab3a7b8941a1e093ce91a75f3909e9a95a6f4c", "max_stars_repo_licen... |
function varargout = process_granger1( varargin )
% PROCESS_GRANGER1: Compute the Granger causality between one signal and all the others, in one file.
% @=============================================================================
% This function is part of the Brainstorm software:
% https://neuroimage.usc.edu/brain... | {"author": "brainstorm-tools", "repo": "brainstorm3", "sha": "a892cfaabde1eaa2f9a3ac015c05b73f3739433a", "save_path": "github-repos/MATLAB/brainstorm-tools-brainstorm3", "path": "github-repos/MATLAB/brainstorm-tools-brainstorm3/brainstorm3-a892cfaabde1eaa2f9a3ac015c05b73f3739433a/toolbox/process/functions/process_grang... |
#include <boost/winapi/system.hpp>
| {"hexsha": "424f963122b1eed12d2362365f50490965a73570", "size": 35, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "src/boost_winapi_system.hpp", "max_stars_repo_name": "miathedev/BoostForArduino", "max_stars_repo_head_hexsha": "919621dcd0c157094bed4df752b583ba6ea6409e", "max_stars_repo_licenses": ["BSL-1.0"], "max... |
[STATEMENT]
lemma closed_Collect_disj:
assumes "closed {x. P x}" "closed {x. Q x}"
shows "closed {x. P x \<or> Q x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. closed {x. P x \<or> Q x}
[PROOF STEP]
using closed_Un[OF assms]
[PROOF STATE]
proof (prove)
using this:
closed ({x. P x} \<union> {x. Q x})
goal (1... | {"llama_tokens": 178, "file": null, "length": 2} |
#! /usr/bin/env python3
#
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | {"hexsha": "25d7099290cdfe7b7c259067ae0a113ab3967a16", "size": 43792, "ext": "py", "lang": "Python", "max_stars_repo_path": "difflogic/dataset/graph/dataset.py", "max_stars_repo_name": "dair-iitd/1oML_workdir", "max_stars_repo_head_hexsha": "37117de4abf1774548786e9534c90977d67091d8", "max_stars_repo_licenses": ["Apache... |
import tensorflow as tf
from tensorflow.compat.v1.data import Dataset
config = tf.compat.v1.ConfigProto()
config.gpu_options.per_process_gpu_memory_fraction = 0.32
tf.compat.v1.keras.backend.set_session(tf.compat.v1.Session(config=config))
from tensorflow import keras
from tensorflow.keras.backend import clear_session
... | {"hexsha": "d91b3e1abad89eb8864ebb26da453726369be2cc", "size": 3116, "ext": "py", "lang": "Python", "max_stars_repo_path": "Source code/PaccMann/Regression/train_paccmann.py", "max_stars_repo_name": "VirginiaSabando/MolecularEmbeddings", "max_stars_repo_head_hexsha": "eafbbd9dfef768de820f42621ab68c3e452cf9d3", "max_sta... |
"""
a collection of functions for computing geometric things, right now it contains
rotation matrices
closest point to a line segment or line
"""
import numpy
from math import sin
from math import cos
from math import sqrt
from math import pi
import geometry.quaternion
import warnings
def r2d(angle=1.0):
"""
... | {"hexsha": "04f179012202513924687bad3033b8051477cbaa", "size": 4014, "ext": "py", "lang": "Python", "max_stars_repo_path": "pybots/src/geometry/conversions.py", "max_stars_repo_name": "aivian/robots", "max_stars_repo_head_hexsha": "6827886916e36432ce1d806f0a78edef6c9270d9", "max_stars_repo_licenses": ["MIT"], "max_star... |
\subsubsection{ZeroCouponFixed Leg Data}
\label{ss:zerolegdata}
A Zero Coupon Fixed leg contains a series of Zero Coupon payments, i.e $(1 + r)^t \,N$ for a compounded coupon. The uninflated notional $N$ can be subtracted from the payment , i.e $((1 + r)^t-1) \,N$, see \lstinline!SubtractNotional! below.
Listing \ref... | {"hexsha": "a4f96e5bf7887c5c54d3c88e53896a34cd407d60", "size": 2584, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "Docs/UserGuide/tradecomponents/zerocouponleg.tex", "max_stars_repo_name": "mrslezak/Engine", "max_stars_repo_head_hexsha": "c46ff278a2c5f4162db91a7ab500a0bb8cef7657", "max_stars_repo_licenses": ["BS... |
[STATEMENT]
lemma cycleI [intro]: "\<lbrakk> path xs; length xs > 2; last xs\<rightarrow>hd xs \<rbrakk> \<Longrightarrow> cycle xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<lbrakk>path xs; 2 < length xs; last xs \<rightarrow> hd xs\<rbrakk> \<Longrightarrow> cycle xs
[PROOF STEP]
unfolding cycle_def
[PROOF ... | {"llama_tokens": 201, "file": "Tree_Decomposition_Graph", "length": 2} |
# Use baremodule to shave off a few KB from the serialized `.ji` file
baremodule Libffi_jll
using Base
using Base: UUID
import JLLWrappers
JLLWrappers.@generate_main_file_header("Libffi")
JLLWrappers.@generate_main_file("Libffi", UUID("e9f186c6-92d2-5b65-8a66-fee21dc1b490"))
end # module Libffi_jll
| {"hexsha": "f1d317b3bdcb03bc0bf85cd4ac9bd1a6f074c043", "size": 302, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/Libffi_jll.jl", "max_stars_repo_name": "JuliaBinaryWrappers/Libffi_jll.jl", "max_stars_repo_head_hexsha": "0aabcfa7fecb7ffb23e54eb5cb60abc626cae3c0", "max_stars_repo_licenses": ["MIT"], "max_sta... |
# -*- coding: utf-8 -*-
"""
-------------------------------------------------
File Name: parser_funs
Description :
Author : shen zizhuo
date:
-------------------------------------------------
Change Activity:
2019/7/28:
-------------------------------------------------
"""
im... | {"hexsha": "3e36595517fada487acf473081942d19ae787290", "size": 2633, "ext": "py", "lang": "Python", "max_stars_repo_path": "utils/model/parser_funs.py", "max_stars_repo_name": "NLPInBLCU/BiaffineDependencyParsing", "max_stars_repo_head_hexsha": "40b133648c747957dacd59916add0403371fe680", "max_stars_repo_licenses": ["MI... |
[STATEMENT]
lemma Levellist_length: "Levellist hds p ll \<Longrightarrow> length ll = length hds"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. Levellist hds p ll \<Longrightarrow> length ll = length hds
[PROOF STEP]
by (auto simp add: Levellist_def) | {"llama_tokens": 92, "file": "BDD_LevellistProof", "length": 1} |
# For defining object class for imaging data
# that can be conveniently manipulated
import numpy as np
import smartload.smartload as smart
import tensortools as tt
import time
class ImagingData(object):
'''
Class for imaging data
'''
def __init__(self, rootpath, animal, expdate, trialsubset=None):
... | {"hexsha": "3854fee98543919e73def36f55d347836b8fa7d8", "size": 9574, "ext": "py", "lang": "Python", "max_stars_repo_path": "tensortools/custom/imaging_data.py", "max_stars_repo_name": "nhat-le/tensortools", "max_stars_repo_head_hexsha": "a5898ad657ef7c5d875fdc02b65354a6361256be", "max_stars_repo_licenses": ["MIT"], "ma... |
[STATEMENT]
lemma smc_Rel_composable_arrs_dg_Rel:
"composable_arrs (dg_Rel \<alpha>) = composable_arrs (smc_Rel \<alpha>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. composable_arrs (dg_Rel \<alpha>) = composable_arrs (smc_Rel \<alpha>)
[PROOF STEP]
unfolding composable_arrs_def smc_dg_smc_Rel[symmetric] slic... | {"llama_tokens": 326, "file": "CZH_Foundations_czh_semicategories_CZH_SMC_Rel", "length": 2} |
/******************************************************************************
* Copyright © 2020 Kévin Lesénéchal <kevin.lesenechal@gmail.com> *
* *
* This file is part of the GLARE project, published under the terms of the *
... | {"hexsha": "01b6f23e343ce03a83f99648b3cf0ba9c11ffead", "size": 2422, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "include/glare/freefly_camera_controller.hpp", "max_stars_repo_name": "kevin-lesenechal/glare", "max_stars_repo_head_hexsha": "774fb6bcd40349ac5a7b9155b97d1dd995b3b5d1", "max_stars_repo_licenses": ["... |
% Chapter 3 - Complex Iterative Maps.
% Program 3b - The Mandelbrot Set.
% Thanks to Steve Lord from The MathWorks for his help.
% Copyright Birkhauser 2013. Stephen Lynch.
% Vectorized program.
% Plot the Mandelbrot set in black and white (Figure 3.2).
Nmax = 50; scale = 0.005;
xmin = -2.4; xmax = 1.2;
ymin = -1.5; ... | {"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/2374-dynamical-systems-with-applications-usi... |
#!/usr/bin/env python3
"""
post-types.py: parse a JSONL file to create, update and post the
associated core/collection schema and data to a Solr instance
"""
import re
import argparse
import os.path as path
from os import getcwd
import pandas as pd
from pandas.api.types import is_list_like
import numpy as np
from app.f... | {"hexsha": "868a28a0773da1404ae416edfe4abcc364d2d4b6", "size": 10358, "ext": "py", "lang": "Python", "max_stars_repo_path": "bin/post-types.py", "max_stars_repo_name": "anisotropi4/wagtail", "max_stars_repo_head_hexsha": "557529d9ce02c50efef98269396130154e518a55", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
"""This module runs a distributed hyperparameter tuning job on Google Cloud AI Platform."""
from pathlib import Path
import numpy as np
import chillpill
from chillpill import packages, params, search
from chillpill_examples.cloud_hp_tuning_from_train_fn import train
if __name__ == '__main__':
# Create a Cloud A... | {"hexsha": "4703b8b3047a8ef94c23101c750894c129122120", "size": 1388, "ext": "py", "lang": "Python", "max_stars_repo_path": "chillpill_examples/cloud_hp_tuning_from_train_fn/run_hp_search.py", "max_stars_repo_name": "kevinbache/chillpill_examples", "max_stars_repo_head_hexsha": "d9c5fac9972f1afbf7bb4e6b6e5388b9f52c73c3"... |
Id₁ Id₂ Id₃ : {A B : Set} → (A → B) → A → B
Id₁ F = F
Id₂ = Id₁
Id₃ = Id₁
syntax Id₁ (λ X → B) = ƛ X ⟶ B
syntax Id₂ (λ X → B) = X ↦ B
syntax Id₃ (λ X → B) = X ↦ B •
postulate
A : Set
a : A
module One where
example₀ : (A → A) → A
example₀ = ƛ _ ⟶ a
example₁ : A → A
example₁ = ƛ !_! ⟶ (!_!)
example₂ :... | {"hexsha": "955aa3edd90be75b422334197fc5bf25ef35f78c", "size": 2750, "ext": "agda", "lang": "Agda", "max_stars_repo_path": "test/Succeed/Issue1951.agda", "max_stars_repo_name": "shlevy/agda", "max_stars_repo_head_hexsha": "ed8ac6f4062ea8a20fa0f62d5db82d4e68278338", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_star... |
import streamlit as st
from pathlib import Path
import sys
import datetime
import shutil
import json
import os
import base64
from PIL import Image
from typing import Optional
sys.path.append("./taming-transformers")
import imageio
import numpy as np
from diffusion_logic import CLIPGuidedDiffusion, DIFFUSION_METHODS_A... | {"hexsha": "a6de6c8cdaa5f225afabbfe37909f6c5e083d4b0", "size": 13576, "ext": "py", "lang": "Python", "max_stars_repo_path": "diffusion_app.py", "max_stars_repo_name": "marklr/vqgan-clip-app", "max_stars_repo_head_hexsha": "23edb7ae6234ab177a91865c02be160151fcf566", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
import math
import re
from prompt_toolkit.formatted_text import PygmentsTokens
import json
import random
from abc import abstractmethod
from copy import deepcopy
from functools import partial
from typing import Dict, List
import torch
import wandb
from nltk import Tree
import numpy as np
from torch.utils.data import... | {"hexsha": "8b7b24c2e41e6c87ab18481d9c385e98f3255f2c", "size": 49831, "ext": "py", "lang": "Python", "max_stars_repo_path": "parseq/scripts_insert/overnight_baseline.py", "max_stars_repo_name": "lukovnikov/parseq", "max_stars_repo_head_hexsha": "65a4a2444d78779c3255e70a7897f77e73cdcdda", "max_stars_repo_licenses": ["MI... |
import numpy as np
import sys
from vispy import app, visuals, scene
import src.objective as obj
# Adapted from https://github.com/vispy/vispy/blob/master/examples/basics/visuals/line_plot3d.py by Andy Zane
# build visuals
Plot3D = scene.visuals.create_visual_node(visuals.LinePlotVisual)
# build canvas
canvas = scene... | {"hexsha": "f32294886e264386ced3fb521000ae33e57a8364", "size": 1593, "ext": "py", "lang": "Python", "max_stars_repo_path": "vis_src/vis_smoothing.py", "max_stars_repo_name": "azane/chomp", "max_stars_repo_head_hexsha": "843ce07148389a63f46091daed12c83c8a3ac52c", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1,... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# strategies.py
# Copyright (c) 2017-2021, Richard Gerum
#
# This file is part of the cameratransform package.
#
# cameratransform is free software: you can redistribute it and/or modify
# it under the terms of the MIT licence.
#
# cameratransform is distributed in the hop... | {"hexsha": "acc50a43492cc3e56e8dba46f683523ab1c748d1", "size": 7602, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/strategies.py", "max_stars_repo_name": "rgerum/cameratransform", "max_stars_repo_head_hexsha": "1ff77ffcbe84f0e61b27f73f7357f756acdfbf99", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
%
% VBrowser
%
\chapter{Customization}
\label{chap:customization}
\section{Custom viewers/plugins}
The VBrowser supports two kind of extension or plugins. One is for protocol
implementations or 'VDrivers', The other are VBrowser Viewer extensions or
'Viewer Plugins'. The first are mapped to URI schemes like 'srm://... | {"hexsha": "8aa4354393ecd778ffee72d1f8228783c90ebbfc", "size": 9996, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "source/doc.userguide/tex/ch5_customization.tex", "max_stars_repo_name": "ptdeboer/vbrowser", "max_stars_repo_head_hexsha": "c278791bf04599dddbe264630230ba85f4593028", "max_stars_repo_licenses": ["Ap... |
# Homework #3 Programming Assignment
CSCI567, Spring 2019<br>Victor Adamchik<br>**Due: 11:59 pm, March 3rd 2019**
### Before you start:
On Vocareum, when you submit your homework, it takes around 5-6 minutes to run the grading scripts and evaluate your code. So, please be patient regarding the same.<br>
## Office ... | {"hexsha": "9f853b4b60831e4f8e8798da4d19cc9e0a945f5d", "size": 164351, "ext": "ipynb", "lang": "Jupyter Notebook", "max_stars_repo_path": "HW 3/PA3.ipynb", "max_stars_repo_name": "yatingupta10/CSCI-567", "max_stars_repo_head_hexsha": "f854bd85b1609ec55696fec1e36ae8b028e34b63", "max_stars_repo_licenses": ["MIT"], "max_s... |
import helper
import scipy.stats
from colour import Color
import numpy as np
import pandas as pd
import plotly as py
import plotly.graph_objs as go
import plotly.offline as offline_py
offline_py.init_notebook_mode(connected=True)
def _generate_stock_trace(prices):
return go.Scatter(
name='Index',
... | {"hexsha": "2e7fa19a087600384a4113e76984a8c710de5c85", "size": 10467, "ext": "py", "lang": "Python", "max_stars_repo_path": "project2/.Trash-0/files/project_helper.py", "max_stars_repo_name": "JingZhang918/AI-for-trading", "max_stars_repo_head_hexsha": "85ab93928b9b0cfba4b97b432d492e100362b538", "max_stars_repo_license... |
from __future__ import print_function
from builtins import str
from builtins import range
import matplotlib
#matplotlib.use('Agg') # prevents crashes if no X server present (clusters)
from yambopy import *
import matplotlib.pyplot as plt
import sys
import argparse
import numpy as np
import operator
"""
Study the conve... | {"hexsha": "6259af7f2f988973b7bab4c20a13ae9680094f4d", "size": 4597, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/analyse_gw.py", "max_stars_repo_name": "QU-XIAO/yambopy", "max_stars_repo_head_hexsha": "ff65a4f90c1bfefe642ebc61e490efe781709ff9", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_... |
import numpy as np
import json
import pathlib
from functools import reduce
from numpy import ndarray
from typing import Collection
from nltk.stem.snowball import SnowballStemmer
from typing import List, Tuple, Dict
from wordfreq import word_frequency
from commons.library_api import LibraryAPI, get_tokens_from_code, l... | {"hexsha": "4530ec9bf37c057dde3018180f16ecf1fa59dd23", "size": 16571, "ext": "py", "lang": "Python", "max_stars_repo_path": "mapping/representations.py", "max_stars_repo_name": "aidanby/SOAR", "max_stars_repo_head_hexsha": "c9bca57727a94b21bb667cc314482a2fbb0fd51a", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars... |
from __future__ import division
import os
import re
import time
import json
import torch
import random
import logging
import numpy as np
import torch.nn as nn
from pathlib import Path
from args import get_parser
from unidecode import unidecode
from collections import OrderedDict
from transformers import BertTokenizer
f... | {"hexsha": "c50102478370b538ffbe72b7f567460cb46d3f5b", "size": 21060, "ext": "py", "lang": "Python", "max_stars_repo_path": "utils.py", "max_stars_repo_name": "endrikacupaj/LASAGNE", "max_stars_repo_head_hexsha": "6321ab5161999905b357bd9b67906dcac04b8644", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 17, "max... |
"""
This calculates hypoxic volume.
"""
# imports
import os, sys
sys.path.append(os.path.abspath('../alpha'))
import Lfun
import zrfun
import zfun
import numpy as np
import netCDF4 as nc
import argparse
from datetime import datetime, timedelta
start_time = datetime.now()
# Command line arguments
def boolean_strin... | {"hexsha": "9cc6fad45911b98c9c1e189693539c8c95fa5f86", "size": 6034, "ext": "py", "lang": "Python", "max_stars_repo_path": "x_layer/hypoxic_volume.py", "max_stars_repo_name": "parkermac/LiveOcean", "max_stars_repo_head_hexsha": "bef3e1e729ada1069853dd4f57f79f452b54f4fa", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
#!/usr/bin/env julia
using Test
using SphericalFourierBesselDecompositions
SFB = SphericalFourierBesselDecompositions
using .SFB.SeparableArrays
## This might be quicker instead of loading the full SFB module:
#include("../src/SeparableArrays.jl")
#using .SeparableArrays
@testset "SeparableArrays" begin
@test... | {"hexsha": "43b7fa740b70fbb6104ab2acf11981e543303b0b", "size": 4391, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/test_separablearrays.jl", "max_stars_repo_name": "hsgg/SphericalFourierBesselDecompositions.jl", "max_stars_repo_head_hexsha": "46f5b46ce0a046cc9dcb0bc581095294e9e64b93", "max_stars_repo_licen... |
import numpy as np
import cv2
import dlib
# Create the video capture object for camera id '0'
video_capture = cv2.VideoCapture(0)
# Load the buil-in face dedector of Dlib
detector = dlib.get_frontal_face_detector()
while True:
# Capture frame-by-frame
ret, frame = video_capture.read()
if (ret):
... | {"hexsha": "c89928c3eb4af29870cddeb920899ecd9a2789df", "size": 1241, "ext": "py", "lang": "Python", "max_stars_repo_path": "Chapter 9/face_detection_video.py", "max_stars_repo_name": "Thimira/Build-Deeper", "max_stars_repo_head_hexsha": "7259ac8f4dbf2c5fc6c5b45449d286d53e121636", "max_stars_repo_licenses": ["MIT"], "ma... |
from sympy import (symbols, Symbol, nan, oo, zoo, I, sinh, sin, pi, atan,
acos, Rational, sqrt, asin, acot, coth, E, S, tan, tanh, cos,
cosh, atan2, exp, log, asinh, acoth, atanh, O, cancel, Matrix, re, im,
Float, Pow, gcd, sec, csc, cot, diff, simplify, Heaviside, arg,
conjugate, series... | {"hexsha": "0a67c63814b3a724c02651cda031e7fec080ea61", "size": 69866, "ext": "py", "lang": "Python", "max_stars_repo_path": "sympy/functions/elementary/tests/test_trigonometric.py", "max_stars_repo_name": "galbwe/sympy", "max_stars_repo_head_hexsha": "f7318dbfef2bf61e5ed8bc55f3e374880ec6ea67", "max_stars_repo_licenses"... |
include(Pkg.dir("FinancialAnalytics/src/helpers.jl"))
using MarketData
r = percentchange(cl)
facts("keyword checking is correct") do
context("simple returns selected") do
@fact sum(keyword_check(r,false,false).values) => -0.8392600357038683
end
context("lsum(og returns selected") do
@fact sum(keyw... | {"hexsha": "5337873fc8898bc9c43d8e338e5cf9132e69f667", "size": 676, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/helpers.jl", "max_stars_repo_name": "JuliaQuant/FinancialAnalytics.jl", "max_stars_repo_head_hexsha": "4c9c202d09af7e396d5c0350f1f67603aab26dab", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
import torch
from torch import optim
import gym
import numpy as np
from typing import Tuple
from utilities.Replay_Buffer import ReplayBuffer
from utilities.DQN_utilities.Prioritized_Replay_Buffer import PrioritizedReplayBuffer
from utilities.DQN_utilities.Replay_Buffer_NStep import ReplayBufferNStep
from utilities.DQN... | {"hexsha": "09917cd8874fb960dbbd03a7632338885da24772", "size": 5576, "ext": "py", "lang": "Python", "max_stars_repo_path": "agents/DQN/Base_agent_DQN.py", "max_stars_repo_name": "vincehass/Arctic-Deep-Reinforcement-Learning-Benchmark", "max_stars_repo_head_hexsha": "cecb937b861964c25a89e180fdfa07640b12baeb", "max_stars... |
import dask.array as da
import numpy as np
from sgkit.distance import metrics
from sgkit.typing import ArrayLike
def pairwise_distance(
x: ArrayLike,
metric: str = "euclidean",
) -> np.ndarray:
"""Calculates the pairwise distance between all pairs of row vectors in the
given two dimensional array x.
... | {"hexsha": "28cd660d217e10be137f086d7b3be21d1e9fddf8", "size": 3440, "ext": "py", "lang": "Python", "max_stars_repo_path": "sgkit/distance/api.py", "max_stars_repo_name": "eric-czech/sgkit", "max_stars_repo_head_hexsha": "9323b11ee9e982186f37f001f8047cadc02173c0", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_c... |
"""Tests of krotov.functionals"""
import copy
from itertools import product
import numpy as np
import pytest
import qutip
from qutip import ket
import krotov
try:
import qutip.qip.gates as qutip_gates
except ImportError:
import qutip.qip.operations.gates as qutip_gates
@pytest.fixture
def canonical_basis(... | {"hexsha": "a6b69c773a6783fc6a0fef59d91ad4d7d0b3efe9", "size": 11366, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_functionals.py", "max_stars_repo_name": "guruvamsi-policharla/noisy-krotov", "max_stars_repo_head_hexsha": "c5397d9dbde68d06f17e88620d6a6b2c74664841", "max_stars_repo_licenses": ["BSD-... |
# -*- coding: utf-8 -*-
import re
import copy
import bisect
from PIL import Image, ImageDraw, ImageFont
import numpy as np
import utils
import graphUtils
import mainParams as mp
import genre
from getWordCounts import loadWCData, wordPCAFitTransform
from groupWords import getWordGroupsRange
from calcSimilarity import ... | {"hexsha": "1961f86bd6e1f4e4ec874642639bbaf22dfe6017", "size": 36493, "ext": "py", "lang": "Python", "max_stars_repo_path": "makeBasicGraphs.py", "max_stars_repo_name": "twopis/twopis", "max_stars_repo_head_hexsha": "1f89d44c3e8481bb2da8e20187b5eeb63b96092e", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, "m... |
"""arbin res-type data files"""
import os
import sys
import tempfile
import shutil
import logging
import platform
import warnings
import time
import numpy as np
import pandas as pd
from cellpy.readers.core import (
FileID,
Cell,
check64bit,
humanize_bytes,
xldate_as_datetime,
)
from cellpy.paramet... | {"hexsha": "a4cd675d807aa6f23fb1b8cb35fd9e8434e33502", "size": 55259, "ext": "py", "lang": "Python", "max_stars_repo_path": "cellpy/readers/instruments/arbin_res.py", "max_stars_repo_name": "jepegit/cellpy", "max_stars_repo_head_hexsha": "b9ddb7afa3f7453bfb5f2f24a3268279bccf24c6", "max_stars_repo_licenses": ["MIT"], "m... |
# Copyright 2018 Max Shinn <maxwell.shinn@yale.edu>
# 2018 Norman Lam <norman.lam@yale.edu>
#
# This file is part of PyDDM, and is available under the MIT license.
# Please see LICENSE.txt in the root directory for more information.
from setuptools import setup, Extension
import numpy as np
with open("ddm/... | {"hexsha": "b10640ab137478c0cab750a49cdefb68534e8fcd", "size": 1693, "ext": "py", "lang": "Python", "max_stars_repo_path": "setup.py", "max_stars_repo_name": "murraylab/PyDDM", "max_stars_repo_head_hexsha": "a3318c955fbb4d467156d9f2e89d8f05b4ee3764", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 9, "max_stars_... |
#include <boost/phoenix/statement/do_while.hpp>
| {"hexsha": "d65d6cbd7d4c615fd9a73893acdfbd46a8ba2548", "size": 48, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "src/boost_phoenix_statement_do_while.hpp", "max_stars_repo_name": "miathedev/BoostForArduino", "max_stars_repo_head_hexsha": "919621dcd0c157094bed4df752b583ba6ea6409e", "max_stars_repo_licenses": ["BS... |
"""
Script for model evaluation using benchmark metrics.
"""
# Import necessary libraries
import json
import joblib
import pandas as pd
import numpy as np
from sklearn.model_selection import cross_val_predict, cross_val_score
from sklearn.metrics import accuracy_score, confusion_matrix
from sklearn.metrics import preci... | {"hexsha": "dcb8a37e959b22d5ac703674d04d3a73a5afbcd0", "size": 1848, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/evaluate_model.py", "max_stars_repo_name": "ahmed-gaal/ml-capstone", "max_stars_repo_head_hexsha": "ed4aed2c76f6ac975a50c8c35f162dbadac37c5e", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
"""
Module for the deterministic GP controller detailed in section 5 of:
"Gaussian Processes for Data-Efficient Learning in Robotics and Control"
https://ieeexplore.ieee.org/abstract/document/6654139
"""
import gpflow
from gpflow import Parameter, set_trainable, Module
from gpflow.utilities import positive, to_default... | {"hexsha": "f5fcda39915a148fd3fef251f6d2b182d5d2f6f7", "size": 9864, "ext": "py", "lang": "Python", "max_stars_repo_path": "pilco/controller/det_gp_controller.py", "max_stars_repo_name": "Ryan-Rhys/PILCO", "max_stars_repo_head_hexsha": "c92ad1df90b5dfec171321fcb10163f55d4eade4", "max_stars_repo_licenses": ["MIT"], "max... |
import numpy as np
from numpy import pi
from matplotlib import pyplot as plt
def make_VandermondeT(omega, time):
"""
Compute the transpose of the Vandermonde
matrix from the times and frequencies
Parameters
----------
omega: 1D numpy array of complex values
(r = truncation rank of the DM... | {"hexsha": "f4964a7e9de71976dc6f735208689458b7531907", "size": 3044, "ext": "py", "lang": "Python", "max_stars_repo_path": "dmd.py", "max_stars_repo_name": "akaptano/POD-Galerkin_MHD", "max_stars_repo_head_hexsha": "d6c72dc32e8345b81ad3c9d393e0edeefb23656a", "max_stars_repo_licenses": ["MIT", "Unlicense"], "max_stars_c... |
\chapter{Introduction}\label{chap:introduction}
A neural network, also known as an Artificial Neural Network (ANN), is an algorithm that mimics the way a human brain operates. It took millions of years of evolution for the human brain to achieve the level of intelligence we observe today. This intelligence helps us qu... | {"hexsha": "df073eee8512b2ecdaaaf394904183055cfb4224", "size": 9396, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "LaTeX/chapters/introduction.tex", "max_stars_repo_name": "harshildarji/Master-Thesis", "max_stars_repo_head_hexsha": "062bcba76bb2a7784b388a70a37d615589c13e72", "max_stars_repo_licenses": ["MIT"], "... |
#Copyright(c) 2018-2020 Gavin W. Wilson
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
#in the Software without restriction, including without limitation the rights
#to use, copy, modify, merge, publish, distr... | {"hexsha": "f92e71a6c37475dc75febd2e7278d5ef90608c3f", "size": 13464, "ext": "py", "lang": "Python", "max_stars_repo_path": "sctxpy/sctx/genotype.py", "max_stars_repo_name": "GWW/sctx", "max_stars_repo_head_hexsha": "797e56d3ac4bbb526d6de1f6e76f5db0d47e0e84", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null,... |
import numpy as np
import os
from skimage.util import view_as_windows
from . import hyper_params, logger
def pad_array(array):
pad_width = (
(hyper_params.context_length, hyper_params.context_length + 1),
(0, 0)
)
return np.pad(array, pad_width, mode='constant', constant_values=0)
def ge... | {"hexsha": "c193cdc4c6af2414cb33b197987668d6914117b6", "size": 1100, "ext": "py", "lang": "Python", "max_stars_repo_path": "osu_map_gen/util/utils.py", "max_stars_repo_name": "Syps/osu_beatmap_generator", "max_stars_repo_head_hexsha": "684b5356bbf79ba847b3ab20e2b6b3a73d7721ad", "max_stars_repo_licenses": ["MIT"], "max_... |
import os
import dgl
import numpy as np
import torch as th
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import dgl.multiprocessing as mp
import dgl.function as fn
import dgl.nn.pytorch as dglnn
import time
import argparse
from torch.nn.parallel import DistributedDataParallel
import ... | {"hexsha": "8159a608d8fa564c5379c385dba54f9e07f2cd60", "size": 11509, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/pytorch/graphsage/train_sampling_unsupervised.py", "max_stars_repo_name": "XiangwenNing/dgl", "max_stars_repo_head_hexsha": "5542b7654af326a84edb1d28d050febd06d3dbcd", "max_stars_repo_li... |
import pytest
import numpy as np
from examples.protocol import Protocol
from examples.tools import generate_sound, WindowConfiguration
@pytest.fixture
def prepare_sound():
def create_sound(sound_index, duration, sample_rate, data_type):
# generate sound
window_config = WindowConfiguration(left_du... | {"hexsha": "d86edff866cce35a0d9da45bd6f85030842f147e", "size": 9080, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_protocol.py", "max_stars_repo_name": "fchampalimaud/soundcard_server", "max_stars_repo_head_hexsha": "85ae99ae690729198a91f0fc67e46a019c18abc5", "max_stars_repo_licenses": ["MIT"], "max... |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | {"hexsha": "7ca50b02d9bf3203cbd460c8de13a16defd974a3", "size": 12523, "ext": "py", "lang": "Python", "max_stars_repo_path": "tensorflow/compiler/tests/ftrl_test.py", "max_stars_repo_name": "awan-10/tensorflow", "max_stars_repo_head_hexsha": "9d8b58a8074a5bdc152cd5a2a9260ccb72eaef90", "max_stars_repo_licenses": ["Apache... |
Address(Nevelson Court) is a residential Culdesacs culdesac in North Davis.
Intersecting Streets
North Davis Farms Road and across the intersection Southfield Court
| {"hexsha": "33b73b2a7d7ebacdc523c11a8c3a571ed4620463", "size": 172, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "lab/davisWiki/Northfield_Court.f", "max_stars_repo_name": "voflo/Search", "max_stars_repo_head_hexsha": "55088b2fe6a9d6c90590f090542e0c0e3c188c7d", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
/***************************************************************************
*
* Copyright (c) 2013 Baidu.com, Inc. All Rights Reserved
*
**************************************************************************/
/**
* @file UnixSocketConnection.cpp
*
* @author liuming03
* @date 2014-1-11
* @brief
*/... | {"hexsha": "57693c8d704977dd916cb8e7404d1426bf7c38be", "size": 8091, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "gko-src/src/UnixSocketConnection.cpp", "max_stars_repo_name": "JohnnyFang0515/gingko", "max_stars_repo_head_hexsha": "33f289b36d6d8176fa7be67275dda93d40efbfd7", "max_stars_repo_licenses": ["BSD-2-Cl... |
import numpy as np
from .escape_utility import sphere_vol_to_r, cube_vol_to_r, calculate_delta, calculate_opt_dt
from .escape_detection import in_sphere, in_cube, passthrough_pore, passthrough_flat_pore
def travel(delta, pa):
p = pa.copy()
xyz = np.random.random(p.shape)
xyz_sq_sum = np.sum(xyz**2)
xy... | {"hexsha": "f12f75a1fb429a43477a6ef5b0df7de4bb03c1be", "size": 3551, "ext": "py", "lang": "Python", "max_stars_repo_path": "narrow_escape/escape_plan.py", "max_stars_repo_name": "pdebuyl/NarrowEscapeSimulator", "max_stars_repo_head_hexsha": "09d2ced13ea767b6fc0abff549e91cced8e99f2c", "max_stars_repo_licenses": ["MIT"],... |
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | {"hexsha": "876a6b061e0b2821db22eb60a08c9527ee7669c9", "size": 1622, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/handbook3/part13/tfrecord.py", "max_stars_repo_name": "apurvmishra99/keras-idiomatic-programmer", "max_stars_repo_head_hexsha": "40ee5482615eadff0a74c349706ae1184c904c13", "max_stars_repo_lice... |
import yaml
import json
import numpy as np
from sklearn import metrics
import torch
from torch.utils.data import DataLoader, random_split
from datasets import LINEAR
from transforms_datasets import Compose, Normalize, ToTensor
from transforms_dataloader import Collate_and_transform, RandomPeriodFold, KernelInterpolati... | {"hexsha": "6d091a657f011062d04fc0b93fa9adf3283b80fa", "size": 1469, "ext": "py", "lang": "Python", "max_stars_repo_path": "experiments/periodogram/eval_periodogram.py", "max_stars_repo_name": "phuijse/MATIC", "max_stars_repo_head_hexsha": "9c09ab36fd64f927c4f70978396c9c95f3d2d2a0", "max_stars_repo_licenses": ["MIT"], ... |
module CellQuadraturesTests
using Test
using FillArrays
using Gridap.Helpers
using Gridap.Fields
using Gridap.ReferenceFEs
using Gridap.Arrays
using Gridap.CellData
using Gridap.TensorValues
using Gridap.Geometry
function test_old_constructor(trian::Triangulation,degree::Int)
cell_quad = CellQuadrature(trian,degree... | {"hexsha": "af54be95176afa41ffd5907eeb58130c7f3f27a8", "size": 3751, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/CellDataTests/CellQuadraturesTests.jl", "max_stars_repo_name": "aerappa/Gridap.jl", "max_stars_repo_head_hexsha": "1fb3dc9abf8c47685637901bd14a74e4355a9492", "max_stars_repo_licenses": ["MIT"]... |
import numpy as np
import h5py
import os
from matplotlib.image import imsave
from PIL import Image
def mkdir(path):
path = path.strip()
path = path.rstrip('/')
isExists = os.path.exists(path)
if not isExists:
os.makedirs(path)
return True
else:
return True
dir = '/home/kadn... | {"hexsha": "99e2987c234328d1436f722989537b4e67f5e38e", "size": 1298, "ext": "py", "lang": "Python", "max_stars_repo_path": "PythonClient/testfunction/h5rgbseg2voc.py", "max_stars_repo_name": "kadn/carla", "max_stars_repo_head_hexsha": "571e0be7c1815214d2fd39cba90a2cc31da8097c", "max_stars_repo_licenses": ["MIT"], "max_... |
#
# Copyright (c) 2022 salesforce.com, inc.
# All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
# For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
#
"""
The classic isolation forest model for anomaly detection.
"""
import logging
import numpy as np... | {"hexsha": "df78b18c457d33a69e129d431856aef8be5bd72e", "size": 2887, "ext": "py", "lang": "Python", "max_stars_repo_path": "merlion/models/anomaly/isolation_forest.py", "max_stars_repo_name": "mbignotti/Merlion", "max_stars_repo_head_hexsha": "195b6828d7c147c42fc62a59c97076b597bd590d", "max_stars_repo_licenses": ["BSD-... |
# Copyright (c) 2017, Kyle Lo
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import numpy as np
def sfill(x, max_chars=10, justify='>'):
"""Fill a string with empty characters"""
return '{}' \
... | {"hexsha": "3c616d6e0775095c612cfaa1cc2b2ab59be54017", "size": 1230, "ext": "py", "lang": "Python", "max_stars_repo_path": "util/sprint.py", "max_stars_repo_name": "kyleclo/tensorflow-mle", "max_stars_repo_head_hexsha": "efe00ba11841a1a448fff4166309fc23a713ba30", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_... |
[STATEMENT]
lemma alw_invs: "FullSpec s \<Longrightarrow> alw (holds all_invs) s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. FullSpec s \<Longrightarrow> alw (holds all_invs) s
[PROOF STEP]
apply (frule exch_alw_InvMsgInGlob)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<lbrakk>FullSpec s; alw (\<lambda>s.... | {"llama_tokens": 798, "file": "Progress_Tracking_Combined", "length": 7} |
[STATEMENT]
lemma lem_4_5:
assumes "finite X" and "U \<subseteq> X" and "t \<in> .[X]" and "F \<subseteq> P[X]"
and "ideal F \<div> monomial 1 t = ideal (monomial (1::'a) ` S)"
and "cone (monomial (1::'a::field) t', V) \<subseteq> cone (monomial 1 t, U) \<inter> normal_form F ` P[X]"
shows "V \<subseteq> U"... | {"llama_tokens": 6861, "file": "Groebner_Macaulay_Cone_Decomposition", "length": 77} |
[STATEMENT]
lemma minVertex_zero2: "minVertex (Face (rev [0..<Suc z]) Nonfinal) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. minVertex (Face (rev [0..<Suc z]) Nonfinal) = 0
[PROOF STEP]
apply (induct z)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
1. minVertex (Face (rev [0..<Suc 0]) Nonfinal) = 0
2. \<An... | {"llama_tokens": 312, "file": "Flyspeck-Tame_Invariants", "length": 3} |
import importlib
from keras.callbacks import ModelCheckpoint
import matplotlib.pyplot as plt
from sklearn.datasets import make_regression
from keras.models import Sequential
from sklearn.model_selection import RepeatedKFold
from keras.models import model_from_json
from keras.layers import Dense
import tensorflow as tf
... | {"hexsha": "d562aebb1b8b509d7e734d359bce7e29265410ac", "size": 3694, "ext": "py", "lang": "Python", "max_stars_repo_path": "2d_diffusion_deep_learning.py", "max_stars_repo_name": "zawang727/2D_Diffusion_Equation_DL", "max_stars_repo_head_hexsha": "dfd21f25ac60b49c0bb05d8dcbaa2cd2dbc748a6", "max_stars_repo_licenses": ["... |
(*
Author: Norbert Schirmer
Maintainer: Norbert Schirmer, norbert.schirmer at web de
License: LGPL
*)
(* Title: AlternativeSmallStep.thy
Author: Norbert Schirmer, TU Muenchen
Copyright (C) 2006-2008 Norbert Schirmer
Some rights reserved, TU Muenchen
This library is free software; ... | {"author": "isabelle-prover", "repo": "mirror-afp-devel", "sha": "c84055551f07621736c3eb6a1ef4fb7e8cc57dd1", "save_path": "github-repos/isabelle/isabelle-prover-mirror-afp-devel", "path": "github-repos/isabelle/isabelle-prover-mirror-afp-devel/mirror-afp-devel-c84055551f07621736c3eb6a1ef4fb7e8cc57dd1/thys/Simpl/Alterna... |
subroutine lumx(numberOfStarsInSample,
& thick_disk_age,
& halo_age)
C Determining what stars are WDs and calculating cooling time
C and luminosity for it
implicit none
integer, parameter :: MAX_STARS_COUNT = 6000000
C Mass of O... | {"hexsha": "5934fb74abd1613e4fce2efce1338bbb27962649", "size": 10030, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "test_project/code/luminosities/luminosities.f", "max_stars_repo_name": "wolvespack/alcor", "max_stars_repo_head_hexsha": "dcc6b029ab7e6eb96b65b7b996cf335c3b030649", "max_stars_repo_licenses": ["M... |
import unittest
import math
import numpy as np
from numpy.testing import assert_almost_equal, assert_equal
from scipy.interpolate import BPoly, PPoly
from being.spline import (
build_ppoly,
copy_spline,
sample_spline,
ppoly_coefficients_at,
ppoly_insert,
smoothing_spline,
spline_coefficien... | {"hexsha": "40d2c5cea963b49e25ddc26d02692efeba1932aa", "size": 7129, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_spline.py", "max_stars_repo_name": "andsteing/being", "max_stars_repo_head_hexsha": "0d0dca71edc512df47fe5ff3bea692e728f90924", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 2,... |
from acme import specs
import chex
import dm_env
import gym
import numpy as np
def inverted_pendulum_env_factory(seed: int, for_evaluation: bool = False) -> dm_env.Environment:
del seed
return InvertedPendulumEnv(for_evaluation=for_evaluation)
def reacher_env_factory(seed: int, for_evaluation: bool = False) ... | {"hexsha": "bd33974b987ee03448e770f145ab6650e6e338a0", "size": 2189, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/environments.py", "max_stars_repo_name": "arthurPignet/mva-drl-project", "max_stars_repo_head_hexsha": "4e73f04ab14aa47976ce47d5363a4e8e42e04001", "max_stars_repo_licenses": ["MIT"], "max_star... |
# This file is a part of JuliaFEM.
# License is MIT: see https://github.com/JuliaFEM/JuliaFEM.jl/blob/master/LICENSE.md
using JuliaFEM, Statistics, Test
tet4_meshfile = "test_problems_contact_3d/tet4.inp"
tet10_meshfile = "test_problems_contact_3d/tet10.inp"
function get_model(meshfile)
mesh = abaqus_read_mesh(m... | {"hexsha": "cc6c4ed557c2a2beabae32c094af5cfcd3c9e86c", "size": 5904, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/test_problems_contact_3d.jl", "max_stars_repo_name": "UnofficialJuliaMirrorSnapshots/JuliaFEM.jl-f80590ac-b429-510a-8a99-e7c46989f22d", "max_stars_repo_head_hexsha": "5f6008b05586ef723386b8d4c... |
SUBROUTINE bantmul(kb,loads,ans)
! Used in p810
! This subroutine multiplies an unsymmetrical band kb by the vector loads.
! Could be much improved for vector processors.
!
IMPLICIT NONE
INTEGER,PARAMETER::iwp=SELECTED_REAL_KIND(15)
REAL(iwp),INTENT(IN)::kb(:,:),loads(0:)
REAL(iwp),INTENT(OUT)::ans(0:)
INTEGER::i,... | {"hexsha": "e653fd1187fdff5975d85f72f40d5d4fc4f193ff", "size": 570, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "main/bantmul.f90", "max_stars_repo_name": "cunyizju/Programming-FEM-5th-Fortran", "max_stars_repo_head_hexsha": "7740d381c0871c7e860aee8a19c467bd97a4cf45", "max_stars_repo_licenses": ["MIT"], "ma... |
import numpy as np
import pandas as pd
# ------------------------PRE-PROCESSING CONCEPTIONS DATA-------------------------------
df1 = pd.read_stata("data/data_births_20110196.dta")
# df1 = pd.read_stata(r"../data/data_births_20110196.dta")
# Create month of birth variable, -1 = June '07, 0 = July '07, 1 = August '07... | {"hexsha": "26248e71b9bccdaf6413ec37cc780248e20fbf6b", "size": 15533, "ext": "py", "lang": "Python", "max_stars_repo_path": "auxiliary/pre_process_datasets.py", "max_stars_repo_name": "mchandra12/replication_gonzalez_2013", "max_stars_repo_head_hexsha": "ff8c342e1cd9af225ccb9a4e63069fef1e49431d", "max_stars_repo_licens... |
\documentclass[conference]{IEEEtran}
\usepackage{url}
\hyphenation{op-tical net-works semi-conduc-tor}
\usepackage{graphicx}
\begin{document}
\title{From Python to Pythonic}
\author{
\IEEEauthorblockN{José Javier Merchante}
\IEEEauthorblockA{
Universidad Rey Juan Carlos\\
Fuenlabrada, Madrid, Spain\\
Email: jj.merch... | {"hexsha": "c5ea0beabd2ee9663f4075e0512d438ef2ff4419", "size": 4929, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "MadSESE_March_2017/abstract.tex", "max_stars_repo_name": "jjmerchante/memoriaTFG-JoseJavierMerchantePicazo", "max_stars_repo_head_hexsha": "ebe9ad04ad6023ed49724b33c77cac8e882bbc60", "max_stars_repo... |
from operator import index
from utility import *
import numpy as np
import tqdm
from net import Network
import json
from joblib import Parallel, delayed
import numpy as np
import os
from collections import OrderedDict
import random
import itertools as it
# split a dataset into a train and validation set
def holdout_v... | {"hexsha": "c4c1169039d42157492207301dd1cc0ddaa56fb2", "size": 16018, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/model_selection.py", "max_stars_repo_name": "dilettagoglia/impl-NN-from-scratch", "max_stars_repo_head_hexsha": "b7a6aacd0823b78de5fa58bc0e1581f4cd40bb8f", "max_stars_repo_licenses": ["MIT"],... |
# get_ipython().magic('matplotlib inline')
import matplotlib
import numpy as np
import matplotlib.pyplot as plt
from sklearn import linear_model
import functools
from scipy.stats import poisson
# Generate training data for sales probability regression
def generate_train_data(B=100):
def rank(a, p):
return... | {"hexsha": "ced4407a6fbb217409862ba6820c456d6c51f8cd", "size": 3029, "ext": "py", "lang": "Python", "max_stars_repo_path": "bellman.py", "max_stars_repo_name": "normanrz/dynamic-prices", "max_stars_repo_head_hexsha": "caff25621d19f7743a196ca0cde9598bc7915994", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 57, ... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- The extensional sublist relation over setoid equality.
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
open import Relation.Binary
module Data.List.R... | {"hexsha": "9e2b5c2cd3ece4d6f50d9102723e61aae610a6a0", "size": 795, "ext": "agda", "lang": "Agda", "max_stars_repo_path": "test/asset/agda-stdlib-1.0/Data/List/Relation/Binary/Subset/Setoid.agda", "max_stars_repo_name": "omega12345/agda-mode", "max_stars_repo_head_hexsha": "0debb886eb5dbcd38dbeebd04b34cf9d9c5e0e71", "m... |
using ShipMMG
using Documenter
DocMeta.setdocmeta!(ShipMMG, :DocTestSetup, :(using ShipMMG); recursive = true)
makedocs(;
modules = [ShipMMG],
authors = "Taiga MITSUYUKI",
repo = "https://github.com/ShipMMG/ShipMMG.jl/blob/{commit}{path}#{line}",
sitename = "ShipMMG.jl",
format = Documenter.HTML(;... | {"hexsha": "fd0c775a19aeb536b9c750ce32bfeda935c16007", "size": 563, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "docs/make.jl", "max_stars_repo_name": "mitsuyukiLab/JuliaShipMMG", "max_stars_repo_head_hexsha": "f2dd72cacb5ba008489eeb8d739a2ef6e2fa4e75", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1,... |
import numpy as np
import pandas as pd
import lightgbm
from sklearn import model_selection
from sklearn.linear_model import LogisticRegression
#from sklearn.neighbors import KNeighborsClassifier
#from sklearn.naive_bayes import GaussianNB
from sklearn.ensemble import RandomForestClassifier
from mlxtend.classifier impo... | {"hexsha": "b85595e496c89620d8381a9ac73229e8fec2c8fd", "size": 4226, "ext": "py", "lang": "Python", "max_stars_repo_path": "get_sepsis_score.py", "max_stars_repo_name": "Samantha-fu/cinc_2019_v2", "max_stars_repo_head_hexsha": "6d2f6c811dc4a9709416db15b42759ee9225996d", "max_stars_repo_licenses": ["BSD-2-Clause"], "max... |
"""Defines the Standardizer class."""
import numpy as np
from .base import InvertibleDataTransformer
from ..utils import validate_bool
class Standardizer(InvertibleDataTransformer):
"""Standardize raw data to have mean 0 and variance 1."""
# Vector of means of the feature columns of the training data
_... | {"hexsha": "b3354cb3b24ae55cad445deb75afd56d60153b62", "size": 4861, "ext": "py", "lang": "Python", "max_stars_repo_path": "stattools/preprocessing/standardize.py", "max_stars_repo_name": "artemmavrin/SLTools", "max_stars_repo_head_hexsha": "04525b5d6777be3ccdc6ad44e4cbfe24a8875933", "max_stars_repo_licenses": ["MIT"],... |
# Copyright 2018-2021 Xanadu Quantum Technologies Inc.
# 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... | {"hexsha": "1c9568f7ffcf3d0ea216e4ebc8c3ec2648072252", "size": 42408, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/fourier/test_reconstruct.py", "max_stars_repo_name": "Qottmann/pennylane", "max_stars_repo_head_hexsha": "ba7cb0d27965bdb642d29648d70dd8246432eec0", "max_stars_repo_licenses": ["Apache-2.0"... |
#addprocs([("iriadmin@10.63.36.22", 1), ("iriadmin@10.63.36.23", 1)])
#addprocs(2)
#using DataStructures, DataArrays , DataFrames, StatsFuns, GLM , Distributions, MixedModels, StatsBase, JSON, StatLib
#@everywhere using DataStructures, DataArrays , DataFrames, StatsFuns, GLM , Distributions, MixedModel... | {"hexsha": "fad4eca4e06a732e94ccc97488e303fa7cceb37a", "size": 4606, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/RF/RnD1.jl", "max_stars_repo_name": "werbac/jlib", "max_stars_repo_head_hexsha": "550028b19c4c51a4ba6b27e3b2696ee5cef0a235", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_st... |
# Code authors: Bryce Haley, Laura G. Funderburk
# Model from Cycles, stochasticity and density dependence in pink salmon population dynamics (2011) by Krkosek et al. https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3107658/
# Last modified: Jan 6 2021
"""
This script contains code that implements a fish trap using an ad... | {"hexsha": "0f49802b9d5a18b997ec2ec39b8dbffdb8e1a769", "size": 7693, "ext": "py", "lang": "Python", "max_stars_repo_path": "cross-culture-with-python/scripts/rickers_adaptation.py", "max_stars_repo_name": "ganymede-io/presentations", "max_stars_repo_head_hexsha": "0f60b1451d9b3d61ecfa124a5d826d38d159a1f0", "max_stars_r... |
include("sec_6_2.jl")
using PyPlot
r = 3
M = 2r
ppI = 40
store = Store(α, r, M, ppI)
N = 3
t, U = FODEdG!(λ, tmax, f, u0, N, r, M, store)
figure(3)
tt = range(0, tmax, length=201)
exact_u = [ u(t, λ, u0, f, M, store) for t in tt ]
pcwise_t, pcwise_U = evaluate_pcwise_poly!(U, t, ppI, store)
line1 = plot(tt, exact_u... | {"hexsha": "d9329dfc7d24aaf0e5f37b0b847cf91d11ef94e4", "size": 554, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "examples/figure3.jl", "max_stars_repo_name": "billmclean/FractionalTimeDG.jl", "max_stars_repo_head_hexsha": "165bd96ac1355befaed4dff25172cc255e883768", "max_stars_repo_licenses": ["MIT"], "max_star... |
data_main = readRDS("data/river_queries/clean_senti_polatiry.rds")
data_main_1 = data_main[1:488728, ]
data_main_2 = data_main[488729:977457, ]
data_main_3 = data_main[977458:1466186, ]
data_main_4 = data_main[1466187:1954915, ]
data_main_5 = data_main[1954916:2443644, ]
data_main_6 = data_main[2443645:2932373, ]
data... | {"hexsha": "d9ca9ebc587df2f96d09d402c203a6171d0f53fa", "size": 2772, "ext": "r", "lang": "R", "max_stars_repo_path": "pot-mi/code/nounphrase.r", "max_stars_repo_name": "Digital-Water-Publics/Thames21-Socio-Ecological-Data", "max_stars_repo_head_hexsha": "4c6a1e9c252fe7c0dfc0b98063c0b9b80a40e91e", "max_stars_repo_licens... |
'''
main issue here was to global patforrec. youll probs forget.
'''
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.ticker as mticker
import matplotlib.dates as mdates
import numpy as np
from numpy import loadtxt
import time
totalStart = time.time()
date,bid,ask = np.loadtxt('GBPUSD1d.txt', u... | {"hexsha": "55ad14ce564689f6b291c263a70dc427919b294c", "size": 6225, "ext": "py", "lang": "Python", "max_stars_repo_path": "machFX9.py", "max_stars_repo_name": "abhaykhawas/Pattern-Recognition", "max_stars_repo_head_hexsha": "def2c089ddaa5c57ecdf4683f67536a4e71c153e", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.