text stringlengths 0 1.25M | meta stringlengths 47 1.89k |
|---|---|
"""
statistical_moments(results, n; field_apply=real)::Vector{Matrix}
Calculate moments up to `n` of results at each position and wavenumber/time, after applying `field_apply`.
"""
function statistical_moments(results::AbstractVector{SimRes}, num_moments::Int; field_apply=real) where {T,SimRes<:SimulationResult{T}... | {"hexsha": "0484d26e51f6fbcccc9366155af8459dd1348379", "size": 992, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/random/moments.jl", "max_stars_repo_name": "andyDoucette/MultipleScattering.jl", "max_stars_repo_head_hexsha": "5f076c1049dddaa7c1c7d73ab8f18b4090eab350", "max_stars_repo_licenses": ["MIT"], "ma... |
'''
This program lets you parse through a user-downloaded .json file from the Open Supernova Archive
Keep track of what directories you download the .json files in
This program then pulls the photometry and spectra data and places them into arrays and lists
numpy is needed to run this code
Update 1.1: Program can now... | {"hexsha": "1341ffd5fac4a31fb58ffa8563556d17eee2ffb3", "size": 19190, "ext": "py", "lang": "Python", "max_stars_repo_path": "old/jsonread2.py", "max_stars_repo_name": "pbrown801/aggienova-templates", "max_stars_repo_head_hexsha": "24f1269bf26ab8026a27df87358f80ea8ad04933", "max_stars_repo_licenses": ["MIT"], "max_stars... |
# Copyright (c) OpenMMLab. All rights reserved.
import copy
import numpy as np
import pytest
import torch
from mmgen.datasets.pipelines import (CenterCropLongEdge, Flip, NumpyPad,
RandomCropLongEdge, RandomImgNoise,
Resize)
class TestAugmen... | {"hexsha": "7193ee425871cbe94e297c6dd1f52931994ad5b5", "size": 11598, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_datasets/test_pipelines/test_augmentation.py", "max_stars_repo_name": "liuhd073/mmgeneration", "max_stars_repo_head_hexsha": "2e09a6b63c5f0ddee850d429c5b739ae1e0cc76d", "max_stars_repo... |
# Import homelessness counts for 2017-2019 by census tract
# Assemble and clip to City of LA
import numpy as np
import pandas as pd
import geopandas as gpd
import intake
catalog = intake.open_catalog('./catalogs/*.yml')
bucket_name = 's3://public-health-dashboard/'
y2017 = catalog.homeless_2017.read().t... | {"hexsha": "5eab92047578b2bdac0d880021244ebcbec9d646", "size": 2127, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/clean-homelessness.py", "max_stars_repo_name": "akoebs/public-health-prototype", "max_stars_repo_head_hexsha": "f75c16da3ee031a14db9be9ce51706db74a939bd", "max_stars_repo_licenses": ["Apache-2... |
! { dg-do run }
! { dg-options "-Warray-temporaries" }
! PR fortran/56937 - unnecessary temporaries with vector indices
program main
integer, dimension(3) :: i1, i2
real :: a(3,2)
data a / 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 /
i1 = [ 1, 2, 3 ]
i2 = [ 3, 2, 1 ]
a (i1,1) = a (i2,2)
if (a(1,1) /= 6.0 .or. a(2,1) /... | {"hexsha": "e5d1887ea4c4116ae49417bb6e3f235b50451273", "size": 436, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "validation_tests/llvm/f18/gfortran.dg/dependency_43.f90", "max_stars_repo_name": "brugger1/testsuite", "max_stars_repo_head_hexsha": "9b504db668cdeaf7c561f15b76c95d05bfdd1517", "max_stars_repo_li... |
# Note that this script can accept some limited command-line arguments, run
# `julia build_tarballs.jl --help` to see a usage message.
using BinaryBuilder
commit_hash = "475890c3a760300f5b088c0c308d2b3b95b2acbb"
# sha256sum of the zip file
sha256_sum = "42e25b9ddd245fc2c09318269dda67c55bba77b0c5304a7f11c13d5715ae7b4f"... | {"hexsha": "498d382a6226c94a068a83421f9333f308628d1a", "size": 1605, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "build_tarballs.jl", "max_stars_repo_name": "UnofficialJuliaMirrorSnapshots/benlorenz-cddlibBuilder", "max_stars_repo_head_hexsha": "43428e718ebd99126832f0763733cd6cf66788f7", "max_stars_repo_licens... |
abstract type NPlayerNavigationCost <: PlayerCost end
"Returns an the input cost object, e.g. ::QuadCost"
function inputcost end
"Returns an iterable of `::SoftConstr` for the inputs."
function inputconstr end
"Returns a `::QuadCost`."
function statecost end
"Returns an interable of `::SoftConstr` for the states."
fu... | {"hexsha": "b0e32c5dfa5fd360a3128fc2cd2907c46bbd7d84", "size": 3438, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/n_player_navigation_game.jl", "max_stars_repo_name": "lxjlu/iLQGames.jl", "max_stars_repo_head_hexsha": "9835487abaa544ed377271ea0e9bfbb74e879854", "max_stars_repo_licenses": ["BSD-3-Clause"], ... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import glob
import os
import os.path as osp
import pickle
import re
import matplotlib.pyplot as plt
import numpy as np
import plyvel
import scipy.ndimage as ndi
from skimage.color import label2rgb
import skima... | {"hexsha": "b5ba10491c6bc2e5268079b47625641691ac17aa", "size": 7861, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/apc2016/apc2016.py", "max_stars_repo_name": "knorth55/fcn", "max_stars_repo_head_hexsha": "3441527132294048e166d274f535bd48a4215b65", "max_stars_repo_licenses": ["MIT"], "max_stars_count"... |
import bot_core
import numpy as np
import time
import re
from director import drcargs
from director import transformUtils
_robotStateToDrakePoseJointMap = None
_drakePoseToRobotStateJointMap = None
_drakePoseJointNames = None
_robotStateJointNames = None
_numPositions = None
def getRollPitchYawFromRobotState(robotSt... | {"hexsha": "59efca7470102b23ca094df4878e8440ae044041", "size": 5640, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/python/director/robotstate.py", "max_stars_repo_name": "EulerWong/director", "max_stars_repo_head_hexsha": "e30a56ba3a3bac82216adb0f8cc29d1fae8cb74b", "max_stars_repo_licenses": ["BSD-3-Clause... |
from typing import Dict, Iterable, Union
from collections import defaultdict
import contextlib
from copy import deepcopy
import io
import numpy as np
import pandas as pd
from pycocotools.coco import COCO
from pycocotools.cocoeval import COCOeval
class KeypointHandler:
"""Keypoint evaluation utility.
For k... | {"hexsha": "6768bd31cfdac7645a47c2e40f8618d9c2910ada", "size": 8932, "ext": "py", "lang": "Python", "max_stars_repo_path": "MULTITASK_FILES/KEYPOINTS_FILES/surgery-hand-detection-new/mask-rcnn/lib/util.py", "max_stars_repo_name": "egoodman92/semi-supervised-surgery", "max_stars_repo_head_hexsha": "42f7af7e707e71ecd64b9... |
/*
* The MIT License (MIT)
*
* Copyright (c) 2018 Sylko Olzscher
*
*/
#include "session.h"
#include <cyng/vm/domain/log_domain.h>
#include <cyng/io/serializer.h>
#include <cyng/tuple_cast.hpp>
#include <boost/uuid/random_generator.hpp>
#include <boost/uuid/nil_generator.hpp>
namespace node
{
namespace sml
{
... | {"hexsha": "4c68e0adc2b91b2e56bcce0416566127373f0715", "size": 2688, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "nodes/ipt/gateway/src/session.cpp", "max_stars_repo_name": "solosTec/node", "max_stars_repo_head_hexsha": "e35e127867a4f66129477b780cbd09c5231fc7da", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
import numpy as np
from scipy import stats
from matplotlib import pyplot as plt
from random import randint
if __name__ == "__main__":
# Create a list of the number of coin tosses ("Bernoulli trials")
numbers = [0, 2, 10, 20, 50, 500] # trials
# Random variates: "prior" | fairness
data = stats.berno... | {"hexsha": "371052f3b7f60911fc4c567da2944a336fe82c68", "size": 1164, "ext": "py", "lang": "Python", "max_stars_repo_path": "algorithmic_trading/samples/c2_beta_binomial.py", "max_stars_repo_name": "spideynolove/Other-repo", "max_stars_repo_head_hexsha": "34066f177994415d031183ab9dd219d787e6e13a", "max_stars_repo_licens... |
from h5py import File
import numpy
from pyscf.pbc import gto, tools
from pyscf.pbc.dft import numint
from pyscf import gto as molgto
import os
import sys
import numpy
from mpi4py import MPI
from afqmctools.utils.gto_basis_utils import extend_gto_id
try:
from pyscf_driver import (pyscf_driver_init, pyscf_driver_get_... | {"hexsha": "72af3a8477a5fc29d73829532c95f848786eef39", "size": 20795, "ext": "py", "lang": "Python", "max_stars_repo_path": "utils/afqmctools/afqmctools/utils/qe_driver.py", "max_stars_repo_name": "djstaros/qmcpack", "max_stars_repo_head_hexsha": "280f67e638bae280448b47fa618f05b848c530d2", "max_stars_repo_licenses": ["... |
\section{Statement of Problem}\label{sec:statement_of_problem}
With some background exploration on what a formalism of responsibility might entail, and an overview of its scope and utility, we can see that some formalism of responsibility has genuine utility. However, assessing how it might apply to artificial agents ... | {"hexsha": "49293502078776c114b0ff25091cd9b3797c5302", "size": 10182, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "sections/problem_statement.tex", "max_stars_repo_name": "probablytom/MSci-dissertation", "max_stars_repo_head_hexsha": "bf80b7cbb4b1864f6ea68215951097d7be4f530f", "max_stars_repo_licenses": ["MIT"]... |
import onnxruntime as rt
import numpy as np
import cv2
sess = rt.InferenceSession("./1.onnx")
img = cv2.imread("1.jpg")
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
input_name = sess.get_inputs()[0].name
label_name = sess.get_outputs()[0].name
result = sess.run([label_name], {input_name:img.astype(np.float32)})[0]
... | {"hexsha": "a7c15fd65e4f514bbdb65274a68f63e2e241410b", "size": 361, "ext": "py", "lang": "Python", "max_stars_repo_path": "onnx/onnxruntime_img.py", "max_stars_repo_name": "fdh0/Glove_Class_Train", "max_stars_repo_head_hexsha": "7904f19ed753810deb29dabf69dc92af709acc23", "max_stars_repo_licenses": ["BSL-1.0"], "max_sta... |
@testset "Integral Data Generation (Univariate)" begin
m = InfiniteModel();
@infinite_parameter(m, t in [-Inf, Inf], supports = [0, .5, 1])
@infinite_parameter(m, x[1:2] in [-Inf, Inf])
# test _trapezoid_coeff
@testset "_trapezoid_coeff" begin
@test InfiniteOpt.MeasureToolbox._trapezoid_coef... | {"hexsha": "358514168c339bbeb9d1316babe1459cb44b4bd8", "size": 16026, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/MeasureToolbox/integrals.jl", "max_stars_repo_name": "bdaves12/InfiniteOpt.jl", "max_stars_repo_head_hexsha": "85e170ac1c749d9e3e21b2f9c9db32ccf99cc5ed", "max_stars_repo_licenses": ["MIT"], "... |
# -*- coding: utf-8 -*-
"""Fit a potential to data with :mod:`~agama`."""
__all__ = [
"AGAMAPotentialFitter",
"AGAMAMultipolePotentialFitter",
]
##############################################################################
# IMPORTS
# BUILT-IN
import typing as T
from types import MappingProxyType
# THIRD... | {"hexsha": "1499663638282529540b3825f4c6e1b481e384ef", "size": 7334, "ext": "py", "lang": "Python", "max_stars_repo_path": "discO/plugin/agama/fitter.py", "max_stars_repo_name": "GalOrrery/discO", "max_stars_repo_head_hexsha": "3b17b6ead65908c053b09a1a967e8a1819a06209", "max_stars_repo_licenses": ["BSD-3-Clause"], "max... |
Require Import CSet Util LengthEq Take MoreList Filter OUnion AllInRel.
Require Import IL Annotation LabelsDefined Sawtooth InRel.
Require Import Liveness.Liveness TrueLiveness Reachability.
Require Import Sim SimTactics.
Require SimI SimF.
Set Implicit Arguments.
Unset Printing Records.
(** * Unreachable Code Elimin... | {"author": "sigurdschneider", "repo": "lvc", "sha": "be41194f16495d283fe7bbc982c3393ac554dd5b", "save_path": "github-repos/coq/sigurdschneider-lvc", "path": "github-repos/coq/sigurdschneider-lvc/lvc-be41194f16495d283fe7bbc982c3393ac554dd5b/theories/DeadCodeElimination/UCE.v"} |
function [model, removedMets, removedRxns] = removeDeadEnds(model)
% Removes all dead end metabolites and reactions from the
% model
%
% USAGE:
%
% [model, removedMets, removedRxns] = removeDeadEnds(model)
%
% INPUT:
% model: COBRA model structure
%
% OUTPUTS:
% model: COBRA model structure ... | {"author": "opencobra", "repo": "cobratoolbox", "sha": "e60274d127f65d518535fd0814d20c53dc530f73", "save_path": "github-repos/MATLAB/opencobra-cobratoolbox", "path": "github-repos/MATLAB/opencobra-cobratoolbox/cobratoolbox-e60274d127f65d518535fd0814d20c53dc530f73/src/reconstruction/modelGeneration/removeDeadEnds.m"} |
import torch as ch
import torch.nn.functional as F
import torch.optim as optim # Optimizers
import sys
from torchvision import transforms
from attacks import pgd_l2, pgd_linf, opmaxmin, ce
from argparse import ArgumentParser
from models import resnet
import numpy as np
from YellowFin_Pytorch.tuner_utils.yellowfin impor... | {"hexsha": "2ce55005ee5b4320e9d656fd4267fbeb0589611b", "size": 9369, "ext": "py", "lang": "Python", "max_stars_repo_path": "adv-mnist/adv_train.py", "max_stars_repo_name": "ajiljalal/manifold-defense", "max_stars_repo_head_hexsha": "2e77f1cd2f69277e224b3df4717bf8b33e97dab0", "max_stars_repo_licenses": ["MIT"], "max_sta... |
using Test, YaoArrayRegister, YaoBase
@testset "select" begin
reg = product_state(4, 6; nbatch = 2)
# println(focus!(reg, [1,3]))
r1 = select!(focus!(copy(reg), [2, 3]), 0b11) |> relax!(to_nactive = 2)
r2 = select(focus!(copy(reg), [2, 3]), 0b11) |> relax!(to_nactive = 2)
r3 = copy(reg) |> focus!(2... | {"hexsha": "9ec8cfadc5e5c000072ba7b8cc83dfa39f446b0e", "size": 1136, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/measure.jl", "max_stars_repo_name": "UnofficialJuliaMirror/YaoArrayRegister.jl-e600142f-9330-5003-8abb-0ebd767abc51", "max_stars_repo_head_hexsha": "eeda6ebd066b6c79809adc3eb53727a5aaa602af", ... |
alpha = 0.85
accuracy = 0.00001
edgelist = "test/fixtures/gaps.adj"
rank = Rank{Float64,Int64}(alpha, accuracy, edgelist)
r = stationary_distribution(rank)
count = length(r)
iexpected = [1, 8, 3, 5, 7, 9]
expected = [0.245344, 0.245344, 0.208173, 0.176404, 0.087356, 0.037375]
precision = 5
@assert isequal(floor(exp... | {"hexsha": "d11b908eb82dc5137af12b7cf4f231c8730b7544", "size": 372, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/rank/gaps.jl", "max_stars_repo_name": "purzelrakete/Pagerank.jl", "max_stars_repo_head_hexsha": "070a193826f6ff7c2fe11fb5556f21d039b82e26", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_sta... |
[STATEMENT]
lemma quasinorm_sum_limit:
"\<exists>f1 f2. (\<forall>n. f = f1 n + f2 n) \<and> (\<lambda>n. eNorm N1 (f1 n) + eNorm N2 (f2 n)) \<longlonglongrightarrow> eNorm (N1 +\<^sub>N N2) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<exists>f1 f2. (\<forall>n. f = f1 n + f2 n) \<and> (\<lambda>n. eNorm N1... | {"llama_tokens": 3469, "file": "Lp_Functional_Spaces", "length": 22} |
import os
import numpy as np
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
import torch
from torch.utils.data import DataLoader
from tqdm import tqdm
import argparse
import cv2
import config
from utils import Mesh
from models import CMR
from models.smpl_from_lib import SMPL
from utils.pose_ut... | {"hexsha": "42f3f0601cedabdaeaa89176e833a93d39b4aada", "size": 10242, "ext": "py", "lang": "Python", "max_stars_repo_path": "evaluate_movi_shape.py", "max_stars_repo_name": "akashsengupta1997/GraphCMR", "max_stars_repo_head_hexsha": "0b8b05be4f711995ba50e414effbde98b6b11c5b", "max_stars_repo_licenses": ["BSD-3-Clause"]... |
\section{Type checking and other semantic analyses}
\subsection*{Type checking}
Assigning a type t to a variable x is, in essence, an invariant. Because languages are turing complete undecidable. Conservative if static, applies inference rules to deduce types of expression (without caring about reachability). We can us... | {"hexsha": "31a4d6f393c70ed1cf4f9bc9c5d7c8c9540d45d1", "size": 1930, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "src/type_checking_extra.tex", "max_stars_repo_name": "BasilRommens/compilers-cheatsheet", "max_stars_repo_head_hexsha": "a8336115c175db4cbe0c5bb6f960dd1e5bcf87bb", "max_stars_repo_licenses": ["MIT"]... |
# -*- coding: UTF-8 -*-
import sys
import yaml
from datetime import datetime, timedelta
import numpy as np
import pandas as pd
from pyspark.sql import SparkSession, SQLContext
import pyspark.sql.functions as F
import socket
def getHostIP():
try:
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
... | {"hexsha": "ee78ee18ed55ab83c654aa005b2025f799a5ad3b", "size": 18400, "ext": "py", "lang": "Python", "max_stars_repo_path": "retentionrate/app.py", "max_stars_repo_name": "zhs007/pyspark.demo", "max_stars_repo_head_hexsha": "5fb148912a66504569e9240fc4f488e6b88c139f", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
import gzip
import sys
import argparse
import csv
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import scipy.stats as stats
from sklearn.linear_model import LinearRegression
def parse_arguments():
parser = argparse.ArgumentParser(description="Plot bulk means against s... | {"hexsha": "b261dd3e07e24a4841518d257ddc38695e1e436c", "size": 3019, "ext": "py", "lang": "Python", "max_stars_repo_path": "castools/plot_bulk_sc.py", "max_stars_repo_name": "barakcohenlab/castools", "max_stars_repo_head_hexsha": "c03b40d6858bca499ded3f32877aed5425527932", "max_stars_repo_licenses": ["MIT"], "max_stars... |
#!/usr/bin/env python
import sys
import numpy as np
def main(asciifile, outcube, datacol):
"""
"""
data = np.loadtxt(logfile)
te = np.unique(data[:,0])
ne = np.unique(data[:,1])
tr = np.unique(data[:,2])
cube = np.empty((len(tr), len(ne), len(te), 4))
for i in rang... | {"hexsha": "cc784b3540165d661aff16004daba45479c731a9", "size": 1250, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/table2cube.py", "max_stars_repo_name": "kimager/CRRLpy", "max_stars_repo_head_hexsha": "7209f18f7b2d25c85ea1938e5ae8474511823d6b", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 2,... |
# -*- coding: utf-8 -*-
'''
Created on 2020年4月26日
@author: wape2
'''
import os
import sys
import warnings
import matplotlib.pyplot as plt
import numpy as np
import yaml
from pyhdf.SD import SD
from pylab import axis
from cartopy.mpl.ticker import LongitudeFormatter, LatitudeFormatter
import matplotlib.patches as mpa... | {"hexsha": "ab25c96b2c5f85290a5820d950686ee143003014", "size": 7963, "ext": "py", "lang": "Python", "max_stars_repo_path": "ndsi_p02_modis_daily_map.py", "max_stars_repo_name": "NingAnMe/snow_cover_of_remote_sensing", "max_stars_repo_head_hexsha": "aabd0f4754eb5200203fc8a90f06b603dcd260a8", "max_stars_repo_licenses": [... |
'''
Author: Naiyuan liu
Github: https://github.com/NNNNAI
Date: 2021-11-23 17:03:58
LastEditors: Naiyuan liu
LastEditTime: 2021-11-24 19:19:47
Description:
'''
import cv2
import torch
import fractions
import numpy as np
from PIL import Image
import torch.nn.functional as F
from torchvision import transforms
from mode... | {"hexsha": "b9167f8d387e20d00441a6dc2bcdb1c25b48242d", "size": 5273, "ext": "py", "lang": "Python", "max_stars_repo_path": "test_wholeimage_swapspecific.py", "max_stars_repo_name": "slowy07/clifter_face", "max_stars_repo_head_hexsha": "aecdb2f472434358b35f3c196e98cde16f8437a3", "max_stars_repo_licenses": ["MIT"], "max_... |
/*
* ext.cc
*
* Copyright (C) 2013 Diamond Light Source
*
* Author: James Parkhurst
*
* This code is distributed under the BSD license, a copy of which is
* included in the root directory of this package.
*/
#include <boost/python.hpp>
#include <boost/python/def.hpp>
#include <dials/algorithms/background/m... | {"hexsha": "525442b00f52a85236a693e93a81be5c679c2d94", "size": 681, "ext": "cc", "lang": "C++", "max_stars_repo_path": "algorithms/background/median/boost_python/ext.cc", "max_stars_repo_name": "TiankunZhou/dials", "max_stars_repo_head_hexsha": "bd5c95b73c442cceb1c61b1690fd4562acf4e337", "max_stars_repo_licenses": ["BS... |
#!/usr/bin/env python3
from __future__ import annotations
from datetime import datetime
from typing import Optional
import time
from zmq.decorators import context, socket
import numpy as np
import zmq
from processor.config import config
from processor.display_settings import CurrentSetting, CO2Setting
from processor... | {"hexsha": "4583bbed50a53201a41e3f49ed37da503036fb0a", "size": 8395, "ext": "py", "lang": "Python", "max_stars_repo_path": "processor/collector.py", "max_stars_repo_name": "Princeton-Penn-Vents/princeton-penn-flowmeter", "max_stars_repo_head_hexsha": "85a5ca8357ca34e0b543fa1489d48ecbc8023294", "max_stars_repo_licenses"... |
import numpy as np
import cv2
img = np.zeros((512,512,3),np.uint8)
arr = np.array([[100,50],[500,200],[200,300],[500,100]],np.int32)
arr = arr.reshape(-1,1,2)
cv2.polylines(img,[arr],True,(255,255,0))
cv2.imshow("Frame",img)
cv2.waitKey(0)
| {"hexsha": "6d97ccb717a7daa58cc29e1c571b7aaef43d56f3", "size": 248, "ext": "py", "lang": "Python", "max_stars_repo_path": "GUI Features/Drawing Shapes/Polygon.py", "max_stars_repo_name": "hardy8059/OpenCV_Examples", "max_stars_repo_head_hexsha": "8cdba1a72374b4cb9f8aa293a4b88edc7d1f341d", "max_stars_repo_licenses": ["M... |
# -*- coding: utf-8 -*-
"""
Created on Thu Jul 06 11:33:45 2017
A Python version for Sumitha's receptive field generation code from the file
wilsonretina5fine_8192s.m
@author: Piotr Ozimek
"""
import numpy as np
from scipy.spatial import distance
#Gauss(sigma,x,y) function, 1D
def gauss(sigma,x,y,mean=0):
d = np... | {"hexsha": "ac07d590f40d72ad8b24265d63dd9fe991fe5256", "size": 9258, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/retinavision/rf_generation.py", "max_stars_repo_name": "hanl00/cythonised-retina", "max_stars_repo_head_hexsha": "39dc72d54ca1f5dc6569831b0f1052839cb6feb2", "max_stars_repo_licenses": ["MIT"],... |
import time
import numpy as np
def get_svd(M, energy=1):
"""
Performs singular value decomposition
Parameters
----------
M: numpy.ndarray
The matrix that needs to be decomposed.
energy: float, optional
The energy threshold for performing dimensionality
reduction.
Returns
... | {"hexsha": "7da76e4027503f2b78dec2cc2181e31e21e50ba4", "size": 2282, "ext": "py", "lang": "Python", "max_stars_repo_path": "svd.py", "max_stars_repo_name": "RikilG/Recommender_Systems", "max_stars_repo_head_hexsha": "626ebd4f69f7dbd69b4dce4329bdb42b531599ca", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null,... |
# What is it?
spyIVP is in principle YET ANOTHER(!!) a general(ish)-purpose nnumerical IVP solver with some symbollic elements. It has a lot of overlap with Mathematica's NDSolve- NDSolve obviously is way more powerful for solving general equations (including PDEs). But symODE is good for a range of useful problems, a... | {"hexsha": "83ac4906dd554600596a5f077dc3f1709d4dc985", "size": 170090, "ext": "ipynb", "lang": "Jupyter Notebook", "max_stars_repo_path": "examples/pyIVPusage.ipynb", "max_stars_repo_name": "morgatron/spylind", "max_stars_repo_head_hexsha": "27a201cebf111cc36765077028a3211ec386ddc2", "max_stars_repo_licenses": ["BSD-3-... |
"""
Import ZDF point cloud without Zivid Software.
Note: ZIVID_DATA needs to be set to the location of Zivid Sample Data files.
"""
from pathlib import Path
import os
from netCDF4 import Dataset
from matplotlib import pyplot as plt
import numpy as np
def _main():
filename_zdf = Path() / f"{str(os.environ['ZIVID... | {"hexsha": "483b6f93ded39af396701760f477df22857753d4", "size": 1085, "ext": "py", "lang": "Python", "max_stars_repo_path": "source/applications/basic/file_formats/read_zdf_without_zivid.py", "max_stars_repo_name": "ebruun/python-samples", "max_stars_repo_head_hexsha": "746e5090f45659c60f01bf831a0308966d713b21", "max_st... |
import sys
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
from constants import *
from coviddata import *
from region import Region
if '--download' in sys.argv:
download()
PLOT_DEATHS = '--deaths' in sys.argv
PLOT_DAILY = '--daily' in sys.argv
regions = ... | {"hexsha": "04fdc2e0f5dbbf5a927aed78c5df563e3fcf6408", "size": 3090, "ext": "py", "lang": "Python", "max_stars_repo_path": "main.py", "max_stars_repo_name": "OneMoarDevs/covid19", "max_stars_repo_head_hexsha": "c678b7201cc85c1c33f7378a58bc9c387eb55668", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, "max_sta... |
# -*- coding: utf-8 -*-
"""Detect Morocco Plate Licence-Flow Normalizing (Part 3).ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1sqivJ-YoEcshb3UJmnqTc0VTozTKgE_s
 -> BytesIO:
"""
Saves a pillow image to a bytes buffer.
:param im... | {"hexsha": "704f6a5b796050588e0943174c406af156b76ea9", "size": 4742, "ext": "py", "lang": "Python", "max_stars_repo_path": "sixx/plugins/utils/pillow.py", "max_stars_repo_name": "TildeBeta/6X", "max_stars_repo_head_hexsha": "1814eb8f394b7c25b49decdd7d7249567c85f30f", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
import numpy as np
import matplotlib.pyplot as plt
def plot_contours(ax, data, model, limit=4, n_points=1000, alpha=1.0):
"""visualize the different distributions over the data as a contour plot
Inputs
ax : Axis on which to plot
model : The trained tf.keras.model
... | {"hexsha": "e47cb0041bf8d4ca7f72104c985f69023074f32c", "size": 2175, "ext": "py", "lang": "Python", "max_stars_repo_path": "utils/plotting.py", "max_stars_repo_name": "simonamtoft/tfde-tfp", "max_stars_repo_head_hexsha": "cd8c7a6fe9d09870df6359957a95c99a6c5f762a", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
module JungleHelperUnrandomizedCrumblePlatform
using ..Ahorn, Maple
@mapdef Entity "JungleHelper/UnrandomizedCrumblePlatform" UnrandomizedCrumblePlatform(x::Integer, y::Integer, width::Integer=Maple.defaultBlockWidth, texture::String="default")
# Drop all crumble block textures that need "unrandomized respawns... | {"hexsha": "3cba14fa26b2a47a9332eddf7e510a6970278cbe", "size": 1731, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "Ahorn/entities/crumbleBlockMosaic.jl", "max_stars_repo_name": "Jackal-Celeste/JungleHelper", "max_stars_repo_head_hexsha": "c98f58b78c2c1855556d556b86e0959199ab2db7", "max_stars_repo_licenses": ["M... |
import os
from shutil import copyfile
import numpy as np
from keras.callbacks import Callback
from utility.constants import ENS_GT, FLAG, GT, NPY, IMGS, ALPHA
from utility.utils import makedir, shall_save, get_array, save_array
class TemporalCallback(Callback):
def __init__(self, dim, data_path, temp_path, sav... | {"hexsha": "43d0030fbd9df7cf2a3628d3c34849581126c115", "size": 8538, "ext": "py", "lang": "Python", "max_stars_repo_path": "utility/callbacks/uats_softmax.py", "max_stars_repo_name": "suhitaghosh10/UATS", "max_stars_repo_head_hexsha": "fe295ca2e16e1b7404398b3b62e404778900d958", "max_stars_repo_licenses": ["MIT"], "max_... |
[STATEMENT]
lemma aligned_split_left: "aligned l (Node (ls@(sub,sep)#rs) t) u \<Longrightarrow> aligned l (Node ls sub) sep"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. aligned l (Node (ls @ (sub, sep) # rs) t) u \<Longrightarrow> aligned l (Node ls sub) sep
[PROOF STEP]
apply(induction ls arbitrary: l)
[PROOF ST... | {"llama_tokens": 307, "file": "BTree_BPlusTree", "length": 3} |
#!/usr/bin/env python36
# -*- coding: utf-8 -*-
"""
Created on 23/03/2018 10:15 AM
@author: Tangrizzly
"""
from __future__ import print_function
from theano.tensor.nnet import sigmoid
import time
import numpy as np
from numpy.random import uniform
import theano
import theano.tensor as T
from theano.sandbox.rng_mrg ... | {"hexsha": "80258f190a5ed41c54fb44f793770e4a505eef8b", "size": 9583, "ext": "py", "lang": "Python", "max_stars_repo_path": "public/POI2Vec.py", "max_stars_repo_name": "SamanthaHua/Point-of-Interest-Recommendation", "max_stars_repo_head_hexsha": "3ccc8def18b8e2b269a37d0fb24afa7f7ffabf00", "max_stars_repo_licenses": ["MI... |
[STATEMENT]
lemma lemSpace2Sym:
shows "space2 x y = space2 y x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. space2 x y = space2 y x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
1. space2 x y = space2 y x
[PROOF STEP]
define xsep where "xsep = xval x - xval y"
[PROOF STATE]
proof (state... | {"llama_tokens": 844, "file": "No_FTL_observers_SpaceTime", "length": 11} |
c -------------------------------------------------------------------
c Python wrapper to the DISORT radiative transfer solver
c
c Author: Sebastian Gimeno Garcia
c
c
c License:
c
c Do whatever you want with this piece of code. Enjoy it. If you
c find it helpful, think about the authors of DISOR... | {"hexsha": "5998fbd38d0f33bc8a5205dbe848e91952412b5a", "size": 6737, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "pyDISORT-master/src/disort/Driver.f", "max_stars_repo_name": "ddbkoll/PyRADS-shortwave", "max_stars_repo_head_hexsha": "9d86f7dc07bef37f832949a584f0abe2fd3b72c4", "max_stars_repo_licenses": ["MIT"... |
import numpy as np
import pandas as pd
import trading_env
from datetime import datetime
st = datetime.now()
## need to refactor the testcase
# df = pd.read_csv('trading_env/test/data/SGXTWsample.csv', index_col=0, parse_dates=['datetime'])
df = pd.read_hdf('D:\[AIA]\TradingGym\dataset\SGXTWsample.h5', 'STW')
env = t... | {"hexsha": "f7671e607fb1486f8e17f7ae0f8a4eee3f7dda90", "size": 1037, "ext": "py", "lang": "Python", "max_stars_repo_path": "__main__.py", "max_stars_repo_name": "live4dao/RLtrading", "max_stars_repo_head_hexsha": "c1655a7bfe1220c1d7ae5c0d46814bf3884e6cdb", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "m... |
#include <iostream>
#include "turn_cost_grid_dijkstra.h"
#include "DFieldId.h"
#include <fstream>
#include <boost/algorithm/string.hpp>
int
main()
{
using namespace turncostgrid;
std::vector<GridCoordinate> coords;
std::string filename{
"/home/doms/Repositories/IBR-SVN/thesis-alg-2015-krupke-ma-robots/... | {"hexsha": "ae5e3b1efc8b1f10fd5f2b71808614146e2a32a1", "size": 1425, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "code/shortest_path/main.cpp", "max_stars_repo_name": "d-krupke/turncost", "max_stars_repo_head_hexsha": "2bbe1f1b31eddca5c6e686988e715be7d76c37a3", "max_stars_repo_licenses": ["MIT"], "max_stars_cou... |
# Copyright (c) Meta Platforms, Inc. and affiliates.
# 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 itertools
import logging
import statistics
import time
from typing import Callable, List, Optional, Tuple
... | {"hexsha": "1c974cac67538e05ead30512a910015bda06e40d", "size": 14677, "ext": "py", "lang": "Python", "max_stars_repo_path": "fbgemm_gpu/bench/bench_utils.py", "max_stars_repo_name": "jiecaoyu/FBGEMM", "max_stars_repo_head_hexsha": "2c547924deafa1839483d31096de800078c35711", "max_stars_repo_licenses": ["BSD-3-Clause"], ... |
import numpy as np
import logging
import pathlib
import xml.etree.ElementTree as ET
import cv2
import os
class VOCDataset:
def __init__(self, root, transform=None, target_transform=None, is_test=False, keep_difficult=False, label_file=None):
"""Dataset for VOC data.
Args:
root: the ro... | {"hexsha": "53cbc6b9e70380da3973de2f2d11eba75dc7c462", "size": 7154, "ext": "py", "lang": "Python", "max_stars_repo_path": "vision/datasets/voc_dataset.py", "max_stars_repo_name": "amazingproducer/pytorch-ssd", "max_stars_repo_head_hexsha": "3d6f3f4de97571ea6f597e31832f0d7a0b88b5cf", "max_stars_repo_licenses": ["MIT"],... |
\documentclass[11pt, oneside]{article}
\usepackage[margin=.9in]{geometry}
\usepackage{pgfplots}
\pgfplotsset{compat=default}
\newcommand{\cuckoo}{{\rm cuckoo}}
\newcommand{\hash}{{\rm siphash}}
\usepackage{hyperref}
\usepackage{listings}
\title{Cuckoo Cycle: \protect\\ a memory bound graph-theoretic proof-of-wo... | {"hexsha": "08d7b6ab274089649ab625ea4a5cc878d43e5903", "size": 46032, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "library/cuckoo/doc/cuckoo.tex", "max_stars_repo_name": "reliefs/brominer", "max_stars_repo_head_hexsha": "b37b7131de16ab199fb4bb56a578cef43f9afc30", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
import heterocl as hcl
import numpy as np
from lenet_main import *
batch_size = 50
# f = build_lenet_inf(batch_size, 'vhls_csim')
f = build_lenet_inf(batch_size, 'sdaccel_sw_emu')
mnist = mx.test_utils.get_mnist()
correct_sum = 0
for i in range(50 // batch_size):
label = mnist['test_label'][i*batch_size:(i+1)*b... | {"hexsha": "917b2b62503f2a460c28a80ba125acadfb1d3922", "size": 865, "ext": "py", "lang": "Python", "max_stars_repo_path": "samples/lenet/lenet_sdaccel.py", "max_stars_repo_name": "pasqoc/heterocl", "max_stars_repo_head_hexsha": "bdb87b01cbdf613fe746d25dd949e18cd4942ecf", "max_stars_repo_licenses": ["Apache-2.0"], "max_... |
#!/usr/bin/python3
def plot_function(x, y):
hor_function = lambda x : 1
plt.title("The function is less than 1 below \nthe horizontal black dashed line")
plt.xlabel("horizontal axis")
plt.ylabel("vertical axis")
plt.plot(x, y, 'r-', lw=5)
plt.plot(0, 1, 'mo', lw=5)
plt.axhline(y=1.0, xmin=-0... | {"hexsha": "134fa04df4901892b25b0fb6d7156f5eeddb2af3", "size": 846, "ext": "py", "lang": "Python", "max_stars_repo_path": "assignment_06/src/question04.py", "max_stars_repo_name": "BhekimpiloNdhlela/TW324NumericalMethods", "max_stars_repo_head_hexsha": "face751cdd3ac9566ccae554e54ac15e951d2f7c", "max_stars_repo_license... |
from pytest import raises
import numpy as np
import numpy.testing as npt
from scipy.spatial.transform import Rotation
from pyfar import Orientations
from pyfar import Coordinates
def test_orientations_init():
"""Init `Orientations` without optional parameters."""
orient = Orientations()
assert isinstanc... | {"hexsha": "2c6e7c1e13a91cb4df7af62155ef9fd82254b69e", "size": 8667, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_orientations.py", "max_stars_repo_name": "pyfar/pyfar", "max_stars_repo_head_hexsha": "984e61c9b90335f774f16699c9bcc18e422e7ecf", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
"""
Scattergram inspector tool
Allows the user to highlight and/or select individual points of a scattergram.
When the mouse hovers over a scatter point, it changes temporarily. If you click
on a point, you select and mark (or unselect and unmark) the point.
"""
# Major library imports
from numpy import random
# En... | {"hexsha": "394b6b37a0d321ffd7fb0a0c5291cc8760ae745f", "size": 2927, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/demo/basic/scatter_inspector.py", "max_stars_repo_name": "martinRenou/chaco", "max_stars_repo_head_hexsha": "1888da3ecee89f9b2d11900cda9333b32fc5e89a", "max_stars_repo_licenses": ["BSD-3-... |
'''
This module contains functions for generating individual plots for the smartmove
paper, as well as a function to load the necessary data and call them all
'''
from os.path import join as _join
_linewidth = 0.5
def plot_sgls_tmbd(exps_all, path_plot=None, dpi=300):
'''Plot percentage of sgls during descent and ... | {"hexsha": "fb3fef2c882901615e21001df528c72828168fbc", "size": 27122, "ext": "py", "lang": "Python", "max_stars_repo_path": "smartmove/visuals/figures.py", "max_stars_repo_name": "ryanjdillon/smartmove", "max_stars_repo_head_hexsha": "fb0bf9a309939519e076ea7cbb5aadcd900f9301", "max_stars_repo_licenses": ["MIT"], "max_s... |
#title: Training Set Creation for Random Forest Classification
#author: Nick Wright
#Inspired by: Justin Chen
#purpose: Creates a GUI for a user to identify watershed superpixels of an image as
# melt ponds, sea ice, or open water to use as a training data set for a
# Random Forest Classification method... | {"hexsha": "6dd84e1c7312fcb6a3c46b533f890f303123c575", "size": 43800, "ext": "py", "lang": "Python", "max_stars_repo_path": "training_gui.py", "max_stars_repo_name": "tnelsen16/OSSP", "max_stars_repo_head_hexsha": "f4178f0120e21489b87a3a353afaf1dd33f1dee1", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "... |
/*
* Copyright (c) 2012 Evgeny Proydakov <lord.tiran@gmail.com>
*
* 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 ... | {"hexsha": "ca57dd57c92e8a33e1488158e656f8425a7deda9", "size": 3183, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "boost-thread/jni/main.cpp", "max_stars_repo_name": "proydakov/androidzone", "max_stars_repo_head_hexsha": "a32fb60ea121c7bb6dc6202e04dce08f139d4762", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
using DataConvenience
using DataFrames
df = DataFrame(col = rand(1_000_000), col1 = rand(1_000_000), col2 = rand(1_000_000))
fsort(df, :col) # sort by `:col`
fsort(df, [:col1, :col2]) # sort by `:col1` and `:col2`
fsort!(df, :col) # sort by `:col` # sort in-place by `:col`
fsort!(df, [:col1, :col2]) # sort in-place by... | {"hexsha": "45cb20e573650161f541579c49a596acca3a2e2e", "size": 1727, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "README.jl", "max_stars_repo_name": "xiaodaigh/DataConvenience", "max_stars_repo_head_hexsha": "e16049bf47357fcf4bb4f9d0dba271826884de02", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 20, ... |
[STATEMENT]
lemma prime_power_eq_imp_eq:
fixes p q :: "'a :: factorial_semiring"
assumes "prime p" "prime q" "m > 0"
assumes "p ^ m = q ^ n"
shows "p = q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. p = q
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
1. p \<noteq> q \<L... | {"llama_tokens": 987, "file": null, "length": 16} |
#-----------------------------------------------------------------------
# Skeleton 3D Electromagnetic MPI PIC code
# written by Viktor K. Decyk, Adam Tableman, and Qiyang Hu, UCLA
import math
import numpy
from fppush3 import *
from dtimer import *
int_type = numpy.int32
double_type = numpy.float64
float_type = numpy.... | {"hexsha": "815b09e44367bb6c25a5900cef4e0155f67a924a", "size": 12712, "ext": "py", "lang": "Python", "max_stars_repo_path": "mpi/ppic3/ppic3_py/fppic3.py", "max_stars_repo_name": "gcasabona/cuda", "max_stars_repo_head_hexsha": "064cfa02398e2402c113d45153d7ba36ae930f7e", "max_stars_repo_licenses": ["W3C"], "max_stars_co... |
import numpy as np
def eucl_dist(sim, obs):
if sim == -15:
print("timeout")
return np.inf
total = 0
for key in sim:
if key in ('loc', "condition1__time", "condition1__cell.id", "condition1__Tension"):
continue
x = np.array(sim[key])
y = np.array(obs[ke... | {"hexsha": "d6cc7cfe3bf49393b68159a88f0a209779a6e8f0", "size": 771, "ext": "py", "lang": "Python", "max_stars_repo_path": "PEtab_problems/Liver_regeneration/Objective_function.py", "max_stars_repo_name": "EmadAlamoudi/FMC_paper", "max_stars_repo_head_hexsha": "fc318407dfee11f373f766222dd37879500d90ce", "max_stars_repo_... |
# -*- coding: utf-8 -*-
from pathlib import Path
from collections import defaultdict
import numpy as np
import attr
import matplotlib
import Bio.PDB as PDB
from typing import Optional, Tuple, Dict, Set
Residue = PDB.Residue
from Bio.PDB.vectors import Vector
from geometry import project_on_plane
class PDBFile:
d... | {"hexsha": "4e4d2c68852711936f084ac66b7a84af506349b1", "size": 10133, "ext": "py", "lang": "Python", "max_stars_repo_path": "vibtdm/vibtdm.py", "max_stars_repo_name": "Tillsten/vibtdm", "max_stars_repo_head_hexsha": "995a36c93725859f4054ab1b4246f6b11e74c9c2", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_coun... |
import csv
import numpy as np
from scipy import signal
import copy
def getCsv(txtFileName='eighteenth.txt'):
with open(txtFileName) as csv_file:
csv_reader = csv.reader(csv_file)
return list(csv_reader)
def solveEquationSimple(row):
level = 0
charList = list(row)
result = [None]
... | {"hexsha": "e1d25d785652fda835974ba7d54915a9571aaedc", "size": 3774, "ext": "py", "lang": "Python", "max_stars_repo_path": "eighteenth.py", "max_stars_repo_name": "MSQFuersti/aoc2020", "max_stars_repo_head_hexsha": "f5e163c426a6c481d645ace2cc8af7c493306291", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, ... |
import robotoc
import numpy as np
import math
path_to_urdf = "../iiwa_description/urdf/iiwa14.urdf"
robot = robotoc.Robot(path_to_urdf)
# Change the limits from the default parameters.
robot.set_joint_effort_limit(np.full(robot.dimu(), 50))
robot.set_joint_velocity_limit(np.full(robot.dimv(), 0.5*math.pi))
# Create... | {"hexsha": "240595ebb91f2f7cf36c889a9343863a9fee0783", "size": 3497, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/iiwa14/python/config_space_ocp.py", "max_stars_repo_name": "mcx/robotoc", "max_stars_repo_head_hexsha": "4a1d2f522ecc8f9aa8dea17330b97148a2085270", "max_stars_repo_licenses": ["BSD-3-Clau... |
from abc import ABCMeta, abstractmethod
import sys
import numpy as np
from scipy import linalg
from scipy import stats
import pandas as pd
from vmaf.core.mixin import TypeVersionEnabled
from vmaf.tools.misc import import_python_file, indices
from vmaf.mos.dataset_reader import RawDatasetReader
__copyright__ = "Copyr... | {"hexsha": "1ad340225452a636b0710417cdc73209bdacdaf7", "size": 40487, "ext": "py", "lang": "Python", "max_stars_repo_path": "python/src/vmaf/mos/subjective_model.py", "max_stars_repo_name": "christosbampis/vmaf", "max_stars_repo_head_hexsha": "33e8dc675ace44dd1412b318c31eb3378612744c", "max_stars_repo_licenses": ["Apac... |
"""Example, in order to run you must place a pseudopotential 'Na.psf' in
the folder"""
from ase.units import Ry, eV, Ha
from ase.calculators.siesta import Siesta
from ase.calculators.siesta.siesta_raman import SiestaRaman
from ase import Atoms
import numpy as np
# Define the systems
# example of Raman calculation for... | {"hexsha": "029b8f612e3371239de3a57b634c980680ef0bfc", "size": 1463, "ext": "py", "lang": "Python", "max_stars_repo_path": "doc/source/nao/examples/script_raman_pyscf.py", "max_stars_repo_name": "robert-anderson/pyscf", "max_stars_repo_head_hexsha": "cdc56e168cb15f47e8cdc791a92d689fa9b655af", "max_stars_repo_licenses":... |
# Copyright (c) 2016 MetPy Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
"""Tools and calculations for assigning values to a grid."""
from __future__ import division
import numpy as np
from scipy.interpolate import griddata, Rbf
from scipy.spatial.dista... | {"hexsha": "6b0107a2aa0dabf6740fe79afce9e52dd8905609", "size": 6689, "ext": "py", "lang": "Python", "max_stars_repo_path": "metpy/gridding/gridding_functions.py", "max_stars_repo_name": "TechStrix/MetPy", "max_stars_repo_head_hexsha": "d97596efc8d70f619b77a80451ce0aeae2ba4ffe", "max_stars_repo_licenses": ["BSD-3-Clause... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
This example illustrates how caching of both results, code and binaries
can be achieved using joblib and pycompilation. The cachedir location
is chosen using appdirs package.
"""
from __future__ import (absolute_import, division, print_function)
import argh
import ... | {"hexsha": "d3edfc8b4ca4f2b21459d3ea60467cc9f8fe50f9", "size": 1276, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/cached_code_main.py", "max_stars_repo_name": "bjodah/pycompilation", "max_stars_repo_head_hexsha": "1fab6039a30a604c9e894f19969ea138e43fd464", "max_stars_repo_licenses": ["BSD-2-Clause"],... |
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.ticker import LogFormatterMathtext
import seaborn as sns
import joypy as jp
import pickle
community_mass = 200
with open("../results/tradeoff.pickle", "rb") as pick:
solutions = pickle.load(pick)
def get_members(sol):
ret... | {"hexsha": "704614f6d63561690c38e192944fb392adfc9a83", "size": 3181, "ext": "py", "lang": "Python", "max_stars_repo_path": "figures/growth_rates.py", "max_stars_repo_name": "resendislab/micom_study", "max_stars_repo_head_hexsha": "1633c31d157db136a94145833cfb717309a50058", "max_stars_repo_licenses": ["Apache-2.0"], "ma... |
[STATEMENT]
lemma invFG: "(F \<squnion> G) \<in> Always invFG"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. F \<squnion> G \<in> Always invFG
[PROOF STEP]
apply (rule AlwaysI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
1. Init (F \<squnion> G) \<subseteq> invFG
2. F \<squnion> G \<in> Stable invFG
[PROOF STE... | {"llama_tokens": 425, "file": null, "length": 7} |
def warn(*args, **kwargs):
pass
import warnings
warnings.warn = warn
import torch
import torch.nn as nn
from torchvision import transforms
import sys
sys.path.append('/opt/cocoapi/PythonAPI')
from pycocotools.coco import COCO
from data_loader import get_loader
from data_loader_val import get_loader_val
from model ... | {"hexsha": "c6c4faffc329f7339fdd5638731968262102c60f", "size": 13330, "ext": "py", "lang": "Python", "max_stars_repo_path": "train.py", "max_stars_repo_name": "vittorio-nardone/Image-Captioning-Project", "max_stars_repo_head_hexsha": "fdbcc972e8ff96ff987893f78cf483dd0f32d4b2", "max_stars_repo_licenses": ["MIT"], "max_s... |
theory ASC_Suite
imports ASC_LB
begin
section \<open> Test suite generated by the Adaptive State Counting Algorithm \<close>
subsection \<open> Maximum length contained prefix \<close>
fun mcp :: "'a list \<Rightarrow> 'a list set \<Rightarrow> 'a list \<Rightarrow> bool" where
"mcp z W p = (prefix p z \<and> p \... | {"author": "data61", "repo": "PSL", "sha": "2a71eac0db39ad490fe4921a5ce1e4344dc43b12", "save_path": "github-repos/isabelle/data61-PSL", "path": "github-repos/isabelle/data61-PSL/PSL-2a71eac0db39ad490fe4921a5ce1e4344dc43b12/SeLFiE/Example/afp-2020-05-16/thys/Adaptive_State_Counting/ASC/ASC_Suite.thy"} |
C *********************************************************
C * *
C * TEST NUMBER: 09.02.05/01 *
C * TEST TITLE : Error indicator = 201 *
C * *
C * PHIGS V... | {"hexsha": "328d63f74488239b8a1787664702445a856bff16", "size": 3099, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "third_party/Phigs/PVT/PVT_fort/09/02/05/p01.f", "max_stars_repo_name": "n1ckfg/Telidon", "max_stars_repo_head_hexsha": "f4e2c693ec7d67245974b73a602d5d40df6a6d69", "max_stars_repo_licenses": ["MIT"... |
from tetris_mino import tetrimino
from tetris_utils import fire
from network_config import *
from tetris_data import *
import pygame as pg
import random
import torch
import numpy as np
import time
import copy
import asyncio
class controller:
I_mino = tetrimino(1, I_layout, i_srs, i_spawn)
J_mino = tetrimino(2... | {"hexsha": "e42a3d5474ed4ddf3d0f78e99304c8ad39cb1c33", "size": 21845, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/tetris_ctl.py", "max_stars_repo_name": "froprintoai/Tetris", "max_stars_repo_head_hexsha": "ad6b9496190e36f52f8584cdd81b3c9cfd8d89bd", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 2... |
from orbit_propagation.orbit_prop_py import orbit
import numpy as np
# from orbit_prop_py.orbit import *
import pytest
@pytest.mark.skip(reason="no way of currently testing this")
def test_get_orbit_pos():
# test epoch
epoch = '2013-12-14T14:18:37.00'
t_past_epoch = 0.0
# test TLE
line1 = ('1... | {"hexsha": "c53d0789417d9e3d6f2479e245a31bce0d0ce272", "size": 1940, "ext": "py", "lang": "Python", "max_stars_repo_path": "orbit_propagation/test/test_orbit.py", "max_stars_repo_name": "PyCubed-Mini/GNC", "max_stars_repo_head_hexsha": "c111e19387be8e593a4e8a6e101fc1c827da23cd", "max_stars_repo_licenses": ["MIT"], "max... |
%!TEX root = ../../report.tex
Building Envelopes
\subsection{Building Envelopes [NOT DONE]} % (fold)
\label{sub:building_envelopes}
Sabri Gokmen in \cite{Gokmen2013} presents a way to create envelope systems for buildings. In this case he had a approach that was inspired in Gotheam morphology and leaf venetian patter... | {"hexsha": "d3ea8e8af875f3a8680dcf8ed6412837f46540a3", "size": 2971, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "sections/Works/8-Building_Envelopes.tex", "max_stars_repo_name": "arturalkaim/ProceduralGeneration", "max_stars_repo_head_hexsha": "736fcb8a15291ede1db069ad968527508bc081c4", "max_stars_repo_license... |
import os
import pickle as pkl
import argparse
import numpy as np
import math
import torch
import torch.nn as nn
import torch.optim as optim
from derivable_models.derivable_generator import get_derivable_generator
from utils.file_utils import create_transformer_experiments_directory, get_generator_info, prepare_test_z... | {"hexsha": "5aecedf865dde8ea1a8a2251fb5885cf607dbd73", "size": 8930, "ext": "py", "lang": "Python", "max_stars_repo_path": "maximum_traverse_for_BigGAN_sefa.py", "max_stars_repo_name": "guanyuelee/DP-LaSE", "max_stars_repo_head_hexsha": "55f83dc04a84aa3d855939626ff165569a60d178", "max_stars_repo_licenses": ["MIT"], "ma... |
#!/usr/bin/env python3
# ----------------------------------------------------------------------------
# Copyright (c) 2018-, California Institute of Technology ("Caltech").
# U.S. Government sponsorship acknowledged.
# All rights reserved.
#
# Author(s): Heresh Fattahi
# ----------------------------------------------... | {"hexsha": "029557d90ac854ef2a592ced11c2560c2967a3fb", "size": 4387, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/fit/fit_timeseries.py", "max_stars_repo_name": "piyushrpt/fringe", "max_stars_repo_head_hexsha": "63388b96b98940d84f981899f955cdb4382a2c71", "max_stars_repo_licenses": ["Apache-2.0"], "max_sta... |
#import modules
from __future__ import print_function
from geopandas import GeoDataFrame
import pandas as pd
import numpy as np
from sys import platform, stdout
# import plotting tools and set the back end for running on server
import matplotlib
matplotlib.use('Agg')
from matplotlib import rcParams, ticker, gridspec,... | {"hexsha": "d830a48c5ee7459d54d6c7014cbc92d7079fd91d", "size": 2951, "ext": "py", "lang": "Python", "max_stars_repo_path": "plot_hillslope_traces.py", "max_stars_repo_name": "simon-m-mudd/LSDMappingTools", "max_stars_repo_head_hexsha": "d9137710ea18e54f3dc5b6782c5696cafdd2999f", "max_stars_repo_licenses": ["MIT"], "max... |
[STATEMENT]
lemma iprev_singleton_cut_less_empty_iff: "
({iprev t0 I} \<down>< t0 = {}) = (I \<down>< t0 = {} \<or> t0 \<notin> I)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. ({iprev t0 I} \<down>< t0 = {}) = (I \<down>< t0 = {} \<or> t0 \<notin> I)
[PROOF STEP]
apply (subst Not_eq_iff[symmetric])
[PROOF STATE... | {"llama_tokens": 265, "file": "Nat-Interval-Logic_IL_TemporalOperators", "length": 3} |
"""
Copyright (c) 2018-2019 Intel Corporation
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 i... | {"hexsha": "8738d44339ddf20b98cd6f73664b0d201113fc22", "size": 1570, "ext": "py", "lang": "Python", "max_stars_repo_path": "model-optimizer/mo/front/caffe/extractors/reshape_test.py", "max_stars_repo_name": "zhoub/dldt", "max_stars_repo_head_hexsha": "e42c01cf6e1d3aefa55e2c5df91f1054daddc575", "max_stars_repo_licenses"... |
\documentclass[english]{../thermomemo/thermomemo}
\usepackage{amsmath, amsthm, amssymb}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{mathtools}
\usepackage[utf8]{inputenc}
\usepackage{hyperref}
\usepackage{cleveref}
\usepackage{pgf}
\usepackage{tikz}
\usepackage{url}
\usepackage{enumerate}
\usepackage[fo... | {"hexsha": "9f639ebe8c528693a5719ce06923fe21a924f8dd", "size": 49526, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "doc/memo/PC-SAFT/pc_saft.tex", "max_stars_repo_name": "SINTEF/Thermopack", "max_stars_repo_head_hexsha": "63c0dc82fe6f88dd5612c53a35f7fbf405b4f3f6", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
Base.@deprecate(
DemuxLogger(loggers::Vararg{AbstractLogger}; include_current_global=true),
include_current_global ? TeeLogger(global_logger(), loggers...) : TeeLogger(loggers...)
)
| {"hexsha": "75a56c581b2196bfba3efe7562937ef77fab08f8", "size": 191, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/deprecated.jl", "max_stars_repo_name": "CTUAvastLab/LoggingExtras.jl", "max_stars_repo_head_hexsha": "90d9d148a3440c950a8f26339abad5a31557e1d9", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
'''
This code is based on https://github.com/ekwebb/fNRI which in turn is based on https://github.com/ethanfetaya/NRI
(MIT licence)
'''
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
from matplotlib.colors import ListedColormap
import matplotlib.collections as mcoll
import torch as torch
from matp... | {"hexsha": "76bee1cabc2dbed8cae9f445933a48f3312cb2e8", "size": 22301, "ext": "py", "lang": "Python", "max_stars_repo_path": "trajectory_plot.py", "max_stars_repo_name": "vassilis-karavias/fNRI-mastersigma", "max_stars_repo_head_hexsha": "d3f4fecf9d28a9bc6e6150994824ca7674006ed3", "max_stars_repo_licenses": ["MIT"], "ma... |
# coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | {"hexsha": "0efc597264b92603c8981bff8bf3db7c4e9f30ec", "size": 10803, "ext": "py", "lang": "Python", "max_stars_repo_path": "cluster_gcn/train.py", "max_stars_repo_name": "shaun95/google-research", "max_stars_repo_head_hexsha": "d41bbaca1eb9bfd980ec2b3fd201c3ddb4d1f2e5", "max_stars_repo_licenses": ["Apache-2.0"], "max_... |
#!/usr/bin/env python
# pipescaler/splitter/alpha_splitter.py
#
# Copyright (C) 2020-2021 Karl T Debiec
# All rights reserved.
#
# This software may be modified and distributed under the terms of the
# BSD license.
from __future__ import annotations
from logging import info
from typing import Any, Dict
impo... | {"hexsha": "5b5faf6414732d1ba9ab70a7f60c99d40cb65fc4", "size": 1499, "ext": "py", "lang": "Python", "max_stars_repo_path": "pipescaler/splitters/alpha_splitter.py", "max_stars_repo_name": "KarlTDebiec/PipeScaler", "max_stars_repo_head_hexsha": "b990ece8f3dd2c3506c226ed871871997fc57beb", "max_stars_repo_licenses": ["BSD... |
__author__ = "James Large"
import gc
import os
from pathlib import Path
import numpy as np
import pandas as pd
from sklearn.base import clone
from sklearn.utils.multiclass import class_distribution
from sktime.classification.base import BaseClassifier
from sktime.utils.validation.forecasting import check_X
from tenso... | {"hexsha": "8c661be4b05254e5ee0e71bf9e5a194a0f14018c", "size": 10755, "ext": "py", "lang": "Python", "max_stars_repo_path": "sktime_dl/meta/_dlensemble.py", "max_stars_repo_name": "Gjacquenot/sktime-dl", "max_stars_repo_head_hexsha": "e519bf5983f9ed60b04b0d14f4fe3fa049a82f04", "max_stars_repo_licenses": ["BSD-3-Clause"... |
import numpy as np
import re
from matplotlib import pyplot as plt
from pathlib import Path
from spinup.utils.test_policy import load_policy_and_env
from spinup.utils.logx import colorize
from seq2seq.utils import misc
# Disable GPU
import os
os.environ['CUDA_VISIBLE_DEVICES'] = '-1'
# Load saved environment and trai... | {"hexsha": "d09aaace0928644f619b16c656b1b5d11109c8d9", "size": 12372, "ext": "py", "lang": "Python", "max_stars_repo_path": "spinup/algos/tf1/ddpg/cc_run_policy_vs_uncontrolled.py", "max_stars_repo_name": "supergus/spinningup_clean", "max_stars_repo_head_hexsha": "2b41ded7a1b0b28f9828c53c39829c826dc7918e", "max_stars_r... |
% Updates the log of the scaling parameter for mcmc algorithms
%
% ::
%
% log_c=update_scaling(log_c,accept_ratio,alpha_range,fixed_scaling,n,xi3)
% log_c=update_scaling(log_c,accept_ratio,alpha_range,fixed_scaling,n,xi3,c3)
% log_c=update_scaling(log_c,accept_ratio,alpha_range,fixed_scaling,n,xi3,c3,c_ran... | {"author": "jmaih", "repo": "RISE_toolbox", "sha": "1b2edfa27830c6d522f9d7d2335d33c3e4d84285", "save_path": "github-repos/MATLAB/jmaih-RISE_toolbox", "path": "github-repos/MATLAB/jmaih-RISE_toolbox/RISE_toolbox-1b2edfa27830c6d522f9d7d2335d33c3e4d84285/m/+utils/+mcmc/update_scaling.m"} |
import os
import spacy
import keras
import pickle
import codecs
import numpy as np
from keras.models import Model
from keras.models import load_model
from keras_contrib.layers import CRF
from keras.utils import to_categorical
from keras.layers import Dense, Input, LSTM, TimeDistributed, Dropout, Bidirectional
def tra... | {"hexsha": "235e6e641394bcfdb2c76b9830f120a217c1e7cf", "size": 6722, "ext": "py", "lang": "Python", "max_stars_repo_path": "entity_extraction.py", "max_stars_repo_name": "nramrakhiyani/experiment_transformers", "max_stars_repo_head_hexsha": "66fbe28a06922721f73f53aa19bb3b15c289ca20", "max_stars_repo_licenses": ["MIT"],... |
#!/usr/bin/python3
# number of output figures = 8
# dependencies = SG++, cpp/applyBiomech2
import numpy as np
from helper.figure import Figure
import helper.grid
import helper.plot
import helperBiomech2
def main():
action = "evaluateForces"
basisTypes = ["modifiedBSpline", "modifiedClenshawCurtisBSpline"]
p... | {"hexsha": "f3b998d12c611a9882fc5c1d3f931abb90b7b873", "size": 6738, "ext": "py", "lang": "Python", "max_stars_repo_path": "gfx/py/biomech2ErrorForce.py", "max_stars_repo_name": "valentjn/thesis", "max_stars_repo_head_hexsha": "65a0eb7d5f7488aac93882959e81ac6b115a9ea8", "max_stars_repo_licenses": ["CC0-1.0"], "max_star... |
# ---
# jupyter:
# jupytext:
# formats: ipynb,py:light
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.4'
# jupytext_version: 1.1.7
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# +
#v3.classification
#1... | {"hexsha": "e0e35f4006ab65df65e0bece528613d14b63b96c", "size": 12516, "ext": "py", "lang": "Python", "max_stars_repo_path": "classification_lymphoma_densenet/train_densenet_albumentations.py", "max_stars_repo_name": "tasvora/PytorchDigitalPathology", "max_stars_repo_head_hexsha": "7a0122143663a52d078d53cf2bb7f5b1763e00... |
# -*- coding: utf-8 -*-
"""
Created on Mon Mar 16 03:01:18 2020
@author: RezaKakooee
"""
#%%
import numpy as np
from agents import QAgent
from gridworld_environment import Environment
#%%
def test(env, agent, n_episodes=2, render=True):
total_reward = []
n_episodes = 2
for ep in range(n_episodes):
... | {"hexsha": "88fba1c5f288b423ea0eead67e0f56187f34b929", "size": 1373, "ext": "py", "lang": "Python", "max_stars_repo_path": "QLearning_for_Grid_World_Envs/test_QAgent.py", "max_stars_repo_name": "RezaKakooee/my_DRLs_from_scratch", "max_stars_repo_head_hexsha": "ad234dad6c9a78db117e7749249b7eecd333433d", "max_stars_repo_... |
import numpy as np
from typing import List
import math
class OcclusionLine:
"""
Class that defines a straight line used in the occlusion detection algorithm.
It is defined by 2 endpoints.
"""
def __init__(self, p1: np.array, p2: np.array):
if isinstance(p1, List):
p1 = np.arr... | {"hexsha": "498b444b6c6a1c2719fbc2e965af1ccb6b853f44", "size": 2476, "ext": "py", "lang": "Python", "max_stars_repo_path": "grit/occlusion_detection/occlusion_line.py", "max_stars_repo_name": "cbrewitt/GRIT-OpenDrive", "max_stars_repo_head_hexsha": "d8f8898e8fc360f4247aebcc91a855cd2659325f", "max_stars_repo_licenses": ... |
from random import randrange
import pandas as pd
import urllib.request
import os
os.environ["HDF5_USE_FILE_LOCKING"]='FALSE'
import sys
import h5py
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
from random import randrange
from geopy.geocoders import Nominatim
import boto3
from botocore.han... | {"hexsha": "7f69837c368977aceb8d41b584117fa6c718dbf6", "size": 7589, "ext": "py", "lang": "Python", "max_stars_repo_path": "Assignment_4/src/assignment3.py", "max_stars_repo_name": "Prasanth-Dwadasi/BDS_IA_Assignment1.github.io", "max_stars_repo_head_hexsha": "7e625024fb10080633cca6458baed6c957b6eff4", "max_stars_repo_... |
import igraph
import numpy as np
import pandas as pd
import geopandas
from shapely.geometry import LineString
from skimage.graph import MCP_Geometric, MCP
from skimage import graph
from pyproj import Transformer
from scipy import stats
def cost_tobler_hiking_function(S,symmetric=True):
"""
Applies Tobler's Hik... | {"hexsha": "d78cc3f53147bb9b58b6c854ef55a7e265c64ad1", "size": 15636, "ext": "py", "lang": "Python", "max_stars_repo_path": "lcp/lcp.py", "max_stars_repo_name": "thomaspingel/lcpy", "max_stars_repo_head_hexsha": "6bf2893010d1dad5ad783d7c4f0351166425a1a7", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "ma... |
import operator
import os
import re
import sys
import numpy as np
def read_input():
# Read lines input
# return two lists with points - starting and ending
# each point is dict with keys "x" and "y"
start_points = list()
end_points = list()
for line in sys.stdin:
# "424,924 -> 206,70... | {"hexsha": "578477afa223c6f487cc6227b4171bf6ac02ce47", "size": 8354, "ext": "py", "lang": "Python", "max_stars_repo_path": "tasks/day_05.py", "max_stars_repo_name": "scyberboy/adventofcode_2021", "max_stars_repo_head_hexsha": "5bce8a85fa80efdc4b73e5f437acb1845051674a", "max_stars_repo_licenses": ["BSD-2-Clause"], "max_... |
# from __future__ import print_function
# import torch.utils.data as data
# from PIL import Image
# import os
# import os.path
# import errno
# import numpy as np
# import sys
# if sys.version_info[0] == 2:
# import cPickle as pickle
# else:
# import pickle
# class CIFAR10(data.Dataset):
# base_folder = ... | {"hexsha": "6eeced0decc3915787286adb915b065d53f34b7f", "size": 13477, "ext": "py", "lang": "Python", "max_stars_repo_path": "cifar_own.py", "max_stars_repo_name": "goel96vibhor/semisup-adv", "max_stars_repo_head_hexsha": "30576066663e999d6ae9cc06fd5016d5886dd0b2", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.