text stringlengths 0 1.25M | meta stringlengths 47 1.89k |
|---|---|
#!/usr/bin/env python
# encoding: utf-8
import numpy as np
from copy import copy
cos=np.cos; sin=np.sin; pi=np.pi
def dh(d, theta, a, alpha):
"""
Calcular la matriz de transformacion homogenea asociada con los parametros
de Denavit-Hartenberg.
Los valores d, theta, a, alpha son escalares.
"""
... | {"hexsha": "83885ee19566b959f77b275b0eb7a519aae08828", "size": 1725, "ext": "py", "lang": "Python", "max_stars_repo_path": "lab4/src/lab4functions.py", "max_stars_repo_name": "andresperez86/LabRobotica20211", "max_stars_repo_head_hexsha": "3ba1e124f20ccb7e7de53c0742da5310d5013f64", "max_stars_repo_licenses": ["MIT"], "... |
/*
* Copyright (c) 2017-2018 Nicholas Corgan (n.corgan@gmail.com)
*
* Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt
* or copy at http://opensource.org/licenses/MIT)
*/
#include "env.hpp"
#include "swig/cpp_wrappers/attribute_maps.hpp"
#include "swig/cpp_wrappers/breeding.hpp"
#includ... | {"hexsha": "d1efe057ad71ca47d29d27bdbbc6c3d45e2a9db2", "size": 28283, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "testing/unit-tests/cpp/cpp_swig_wrapper_test.cpp", "max_stars_repo_name": "ncorgan/libpkmn", "max_stars_repo_head_hexsha": "c683bf8b85b03eef74a132b5cfdce9be0969d523", "max_stars_repo_licenses": ["M... |
# Extended Kalman filter
This is an implementation of the example Kalman filter: [ExEKF.m](https://github.com/cybergalactic/MSS/blob/master/mssExamples/ExEKF.m).
ExEKF Discrete-time extended Kalman filter (EKF) implementation demonstrating
how the "predictor-corrector representation" can be applied to the
nonlinear mo... | {"hexsha": "f1844f47136022c27405cbaee5ee49da2325171b", "size": 12738, "ext": "ipynb", "lang": "Jupyter Notebook", "max_stars_repo_path": "notebooks/15.31_EKF_fossen.ipynb", "max_stars_repo_name": "martinlarsalbert/wPCC", "max_stars_repo_head_hexsha": "16e0d4cc850d503247916c9f5bd9f0ddb07f8930", "max_stars_repo_licenses"... |
import numpy as np
import xeno
try:
from sklearn.datasets import load_digits
except:
print("your sklearn library needs to be install with whl of numpy+MKL :(\n")
# prepare
xeno.utils.random.set_seed(1234)
# data
digits = load_digits()
X_train = digits.data
X_train /= np.max(X_train)
Y_train = digits.target
n... | {"hexsha": "b65017cd98adc5bb77092a0b7383197718e2d0b6", "size": 742, "ext": "py", "lang": "Python", "max_stars_repo_path": "Machine Learning Projects/Xeno-Deep Learning library from scratch/test.py", "max_stars_repo_name": "TeacherManoj0131/HacktoberFest2020-Contributions", "max_stars_repo_head_hexsha": "c7119202fdf211b... |
"""
Example for Anthropomorphic Arm.
"""
# Funções das Bibliotecas Utilizadas
from sympy import symbols, trigsimp, pprint
from sympy.physics.mechanics import dynamicsymbols
from sympy.physics.vector import ReferenceFrame, Vector
from sympy.physics.vector import time_derivative
# Variáveis Simbólicas
THETA_1, THETA_2, ... | {"hexsha": "25b95e3e59e4e21a2d9e4aa753aabedeb1b2e14e", "size": 1981, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/antropomorphic_robot/script_kinematics_3dof_anthropomorphic.py", "max_stars_repo_name": "abhikamath/pydy", "max_stars_repo_head_hexsha": "0d11df897c40178bb0ffd9caa9e25bccd1d8392a", "max_s... |
"""
Client side code to perform a single API call to a tensorflow model up and running.
"""
import argparse
import json
import numpy as np
import requests
from object_detection.utils import visualization_utils as vis_util
from object_detection.utils import plot_util
from object_detection.utils import label_map_util
im... | {"hexsha": "6dd015a1af21731612341548f3a7f592c8f427a9", "size": 9872, "ext": "py", "lang": "Python", "max_stars_repo_path": "app.py", "max_stars_repo_name": "fakhrul/xray_detection_client", "max_stars_repo_head_hexsha": "802606023d97f747e593bf93510124fc2d829106", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nu... |
Base.write(io::IO, ::MIME"text/plain", ::Void) = nothing
function Base.read(io::IO, ::MIME"text/plain", ::Type{Void})
readline(io)
return nothing
end
Base.write(io::IO, ::MIME"text/plain", i::Integer) = print(io, i)
Base.read{I<:Integer}(io::IO, ::MIME"text/plain", ::Type{I}) = parse(I, readline(io))
| {"hexsha": "dbb78611e6a5299a4715b3fb20af14ed715e75a6", "size": 314, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/common.jl", "max_stars_repo_name": "corydoras69dev/Records.jl", "max_stars_repo_head_hexsha": "84853787eeba3aefcdfca1316a18f87d20af9790", "max_stars_repo_licenses": ["MIT"], "max_stars_count": n... |
using BinDeps
@BinDeps.setup
world = library_dependency("libworld", aliases=["libworld", "world-0"])
const version = "0.3.1"
# TODO
if Sys.iswindows() && Sys.WORD_SIZE == 32
error("Your platform isn't supported yet.")
end
github_root = "https://github.com/r9y9/World-cmake"
arch = Sys.WORD_SIZE == 64 ? "x86_64"... | {"hexsha": "1a4a4ef38e1d71f49ca23012a143348ad0ab31aa", "size": 1271, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "deps/build.jl", "max_stars_repo_name": "giordano/WORLD.jl", "max_stars_repo_head_hexsha": "bf927a5213f76222e4abae19dc3975f659ebdb2f", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 25, "max... |
/*
* Copyright (c) 2009 Carnegie Mellon University.
* 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
... | {"hexsha": "b82ed5dd370aa2360539f0b427444a32480c20e1", "size": 22556, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "graphlab_toolkit_ports/lda/cgs_lda_vertexprogram.hpp", "max_stars_repo_name": "libingzheren/GraphChi", "max_stars_repo_head_hexsha": "cd960212ebc171bacbd3169e4c9bcd44e680aadb", "max_stars_repo_lice... |
import numpy as np
import tensorflow as tf
from tensorflow.keras import models, layers
import matplotlib.pyplot as plt
from PIL import Image
image_data = np.load('../preprocessing/ImageData.npy')
labels = np.load('../preprocessing/labels.npy')
flipped_image_data = np.load('../imageAugmentation/flipped_ImageData.npy')... | {"hexsha": "7f7808a02cb3d2170930b276415df134f6089679", "size": 4277, "ext": "py", "lang": "Python", "max_stars_repo_path": "models/convNN.py", "max_stars_repo_name": "PranavPusarla/intoxication-identifier", "max_stars_repo_head_hexsha": "72091955440791e23673267ab0cc9e0eeb714cbe", "max_stars_repo_licenses": ["MIT"], "ma... |
# -*- coding: utf-8 -*-
# Portions Copyright 2021 Huawei Technologies Co., Ltd
# Portions Copyright 2017 The OpenFermion Developers.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://w... | {"hexsha": "9b8e00dc7b8db30dc6a71c87c54fdf77db1c7f01", "size": 18707, "ext": "py", "lang": "Python", "max_stars_repo_path": "mindquantum/core/operators/fermion_operator.py", "max_stars_repo_name": "Takishima/mindquantum", "max_stars_repo_head_hexsha": "e90dfe474b759023d7ae18281b9a87cb8d223d04", "max_stars_repo_licenses... |
from omnibelt import unspecified_argument
import numpy as np
import torch
from torch import nn
from torch.nn import functional as F
import timm
# from ..framework import util
from ..framework import Extractor, Rooted, Device
from . import spaces
# class Extractor(nn.Module):
# def get_encoder_fingerprint(self):
# ... | {"hexsha": "63516503c11ae6150fd9a1020598695ab68c7fbf", "size": 3717, "ext": "py", "lang": "Python", "max_stars_repo_path": "plethora/framework/extractors.py", "max_stars_repo_name": "felixludos/plethora", "max_stars_repo_head_hexsha": "ceaf13065a182923ef2721d3060a39f42bbea594", "max_stars_repo_licenses": ["MIT"], "max_... |
import os
from others.amdegroot.data.coco import COCO_ROOT, COCODetection
from others.amdegroot.data.voc0712 import VOC_ROOT, VOCDetection
from others.amdegroot.data.uad import UAD_ROOT, UADDetection
from others.amdegroot.utils.augmentations import SSDAugmentation
from others.amdegroot.data.config import *
from loader... | {"hexsha": "312e765af5435718b8bc33dc433de2d61776e456", "size": 7830, "ext": "py", "lang": "Python", "max_stars_repo_path": "others/amdegroot/data/create_dataset_wrapper.py", "max_stars_repo_name": "jaehobang/Eva", "max_stars_repo_head_hexsha": "e7f649990b8bca3bc29b3832c0ecf32efb402647", "max_stars_repo_licenses": ["Apa... |
__author__ = ['gleicher', 'cbodden']
"""
an attempt to define spacetime problems
at one level, all a spacetime problem is is a function that given a vector
(the KeyVariables - see states.py) returns the value of the objective function,
and the vector of constraint values (well, two - one for eqs, one for ineqs)
to do... | {"hexsha": "999567180b6525386c5653526329ea8170d4b7a2", "size": 14850, "ext": "py", "lang": "Python", "max_stars_repo_path": "trajopt/spacetime/spacetime.py", "max_stars_repo_name": "uwgraphics/trajectoryoptimizer-public", "max_stars_repo_head_hexsha": "51a5f7c183184c033f2f12964e7dd935532331ff", "max_stars_repo_licenses... |
# -*- coding: utf-8 -*-
"""
Created on Sat Feb 25 12:30:44 2017
@author: Big Pigeon
"""
import pdb
import os
import keras
import h5py
from keras.models import Sequential
from keras.layers import Input, Dense, Dropout, Activation, Flatten
from keras.layers import Convolution2D, MaxPooling2D, ZeroPadding2D... | {"hexsha": "3f7b313f1816154beee3599a30ff74cc240ff6da", "size": 10482, "ext": "py", "lang": "Python", "max_stars_repo_path": "model.py", "max_stars_repo_name": "hprovyn/keras-experiments", "max_stars_repo_head_hexsha": "630d6edcc4662e11e23321e6a498d8430cc4a8b3", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nul... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.4'
# jupytext_version: 1.1.4
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# # s_to... | {"hexsha": "2392d1a0f5b1b64ec550e0ec2507c683b0b5d27c", "size": 3787, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/sources/s_toeplitz_spectral.py", "max_stars_repo_name": "dpopadic/arpmRes", "max_stars_repo_head_hexsha": "ddcc4de713b46e3e9dcb77cc08c502ce4df54f76", "max_stars_repo_licenses": ["MIT"], "m... |
import sys
import random
from collections import deque
import time
import numpy as np
import torch
from flatland.envs.rail_generators import sparse_rail_generator
from flatland.envs.observations import TreeObsForRailEnv
from flatland.envs.predictions import ShortestPathPredictorForRailEnv
from flatland.envs.rail_env i... | {"hexsha": "b77bacd88de5c4aefce4d7520d82ac38cbd7c61f", "size": 6180, "ext": "py", "lang": "Python", "max_stars_repo_path": "fc_treeobs/inference_2ts.py", "max_stars_repo_name": "giulic3/flatland-challenge-marl", "max_stars_repo_head_hexsha": "391197188c9ddf56cfac7a03f48bb3bbf8e53dd5", "max_stars_repo_licenses": ["MIT"]... |
[STATEMENT]
lemma Ri_effective:
assumes
in_\<gamma>: "\<gamma> \<in> \<Gamma>" and
concl_of_in_n_un_rf_n: "concl_of \<gamma> \<in> N \<union> Rf N"
shows "\<gamma> \<in> Ri N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<gamma> \<in> Ri N
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgo... | {"llama_tokens": 4162, "file": "Ordered_Resolution_Prover_Standard_Redundancy", "length": 44} |
[STATEMENT]
lemma card_Mi_le_floor_div_2_Vi:
assumes "OSC L E \<and> matching V E M \<and> i > 1"
shows "card (matching_i i V E M L) \<le> (card (V_i i V E M L)) div 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. card (matching_i i V E M L) \<le> card (V_i i V E M L) div 2
[PROOF STEP]
using card_Mi_twice_car... | {"llama_tokens": 257, "file": "Max-Card-Matching_Matching", "length": 2} |
# Aims to provide functions for fast periodic daubechies transforms (forward and inverse) in 2D
# https://github.com/amitgroup/amitgroup/tree/master/amitgroup/util/wavelet
import numpy as np
import scipy
import scipy.sparse
SPARSITY_THRESHOLD = 256
def _populate(W, filtr, yoffset):
N = len(filtr)
for i in ra... | {"hexsha": "eaf47ba0f80a5fd970e220861856bd4f3effceff", "size": 25382, "ext": "py", "lang": "Python", "max_stars_repo_path": "pyiacsun/sparse/wavelet.py", "max_stars_repo_name": "aasensio/pyiacsun", "max_stars_repo_head_hexsha": "56bdaca98461be7b927f8d5fbbc9e64517c889fb", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
libc.so.6`strdup
| {"hexsha": "9b09daa0c12b4b98c50c3a5242077934139ad92e", "size": 53, "ext": "r", "lang": "R", "max_stars_repo_path": "test/unittest/vars/tst.ucaller.r", "max_stars_repo_name": "alan-maguire/dtrace-utils", "max_stars_repo_head_hexsha": "53b33a89ef7eaeba5ce06d50a4c73fe91c1fa99e", "max_stars_repo_licenses": ["UPL-1.0"], "ma... |
# Developed for the LSST System Integration, Test and Commissioning Team.
# This product includes software developed by the LSST Project
# (http://www.lsst.org).
# See the LICENSE file at the top-level directory of this distribution
# for details of code ownership.
#
# Use of this source code is governed by a 3-clause ... | {"hexsha": "ae15b8f05b3deba37910594df49a0003999ddedb", "size": 4317, "ext": "py", "lang": "Python", "max_stars_repo_path": "python/lsst/integration_test_reporting/bin/offlinereport.py", "max_stars_repo_name": "lsst-sitcom/integration_test_reporting", "max_stars_repo_head_hexsha": "1d8790d03e87c0f1a3824116170ad389bb6944... |
#
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
#
from rlstructures.env_wrappers import GymEnv
from rlalgos.tools import weight_init
import torch.nn as nn
import copy
import torch
import ... | {"hexsha": "3e80bc9cb0e987045062da00cc260c1212eac4f2", "size": 2865, "ext": "py", "lang": "Python", "max_stars_repo_path": "rlalgos/reinforce_diayn/run_diayn.py", "max_stars_repo_name": "Purple-PI/rlstructures", "max_stars_repo_head_hexsha": "9b201b083715bbda2f3534b010c84e11dfc0a1c7", "max_stars_repo_licenses": ["MIT"]... |
import re
import json
import datetime
from datetime import datetime
from datetime import timedelta
import pandas as pd
from pandas.io.json import json_normalize
import numpy as np
from nltk.sentiment.vader import SentimentIntensityAnalyzer
import argparse
import os
import csv
class ProcessTweets(object):
def __in... | {"hexsha": "815601f799cb4e0c512db183200d6102c4717299", "size": 3396, "ext": "py", "lang": "Python", "max_stars_repo_path": "hisa/learn/sentiment/sentiment.py", "max_stars_repo_name": "rittikaadhikari/stock-recommendation", "max_stars_repo_head_hexsha": "1f14276a955301b1c6fa1c00bd88b00cf5668d8c", "max_stars_repo_license... |
#ifndef MPLLIBS_METAMONAD_V1_IF__HPP
#define MPLLIBS_METAMONAD_V1_IF__HPP
// Copyright Abel Sinkovics (abel@sinkovics.hu) 2013.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#include <mpllibs/met... | {"hexsha": "f7b7b727cf59be2f5164fcea12635cf02241e023", "size": 625, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "mpllibs/metamonad/v1/if_.hpp", "max_stars_repo_name": "sabel83/mpllibs", "max_stars_repo_head_hexsha": "8e245aedcf658fe77bb29537aeba1d4e1a619a19", "max_stars_repo_licenses": ["BSL-1.0"], "max_stars_c... |
def n: ℕ := 1
lemma p: 0 = 0 := eq.refl 0
lemma s: "Hello Lean!" = "Hello Lean!" := eq.refl "Hello Lean!"
lemma s1: tt = tt := eq.refl tt
/-def p' : 0 = 0 := eq.refl 1-/
theorem s' : 0 = 0 := eq.refl 0
lemma oeqo : 1 = 1 := eq.refl 1
lemma teqt: 2 = 1 + 1 := eq.refl (1+1)
lemma h : "Hello" = "He" ++ "llo" := rfl... | {"author": "hanzhi713", "repo": "lean-proofs", "sha": "4d8356a878645b9ba7cb036f87737f3f1e68ede5", "save_path": "github-repos/lean/hanzhi713-lean-proofs", "path": "github-repos/lean/hanzhi713-lean-proofs/lean-proofs-4d8356a878645b9ba7cb036f87737f3f1e68ede5/src/lessons/lesson1.lean"} |
jrz may add some information about himself or herself here.
20091203 23:14:18 nbsp Hello, I fixed your comment on the Starbucks page. In order to add a link you have to use the square brackets . You put the URL, a space, and then the text you want after the space. Users/hankim
20091203 23:29:54 nbsp Great, Thanks h... | {"hexsha": "feb85484d410a83bc967179457eee0abfc8fd0f5", "size": 337, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "lab/davisWiki/jrz.f", "max_stars_repo_name": "voflo/Search", "max_stars_repo_head_hexsha": "55088b2fe6a9d6c90590f090542e0c0e3c188c7d", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "... |
import torch
import numpy as np
import torch.nn as nn
from torch.autograd import Variable as V
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
def cuda(x):
if torch.cuda.is_available():
return x.cuda()
else :
return x
class LossMulti... | {"hexsha": "f68283674565491976e39c5d0d339d1bdf371962", "size": 1365, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/losses.py", "max_stars_repo_name": "bharat3012/Attention_LadderNet", "max_stars_repo_head_hexsha": "66d9bc2b389540fc297d22e7a35e200480b63764", "max_stars_repo_licenses": ["Apache-2.0"], "max_s... |
#include <boost/hana/fwd/concept/sequence.hpp>
| {"hexsha": "4dbd302f55e3a3f524f0214dfde5ea7b6d1107e6", "size": 47, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "src/boost_hana_fwd_concept_sequence.hpp", "max_stars_repo_name": "miathedev/BoostForArduino", "max_stars_repo_head_hexsha": "919621dcd0c157094bed4df752b583ba6ea6409e", "max_stars_repo_licenses": ["BSL... |
[STATEMENT]
lemma PD7: "Der_1 \<phi> \<Longrightarrow> Der_2 \<phi> \<Longrightarrow> \<forall>A. \<phi>(\<phi>\<^sup>d A) \<^bold>\<preceq> \<phi>(\<phi> A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<lbrakk>Der_1 \<phi>; Der_2 \<phi>\<rbrakk> \<Longrightarrow> \<forall>A. contains (\<phi> (\<phi> A)) (\<phi>... | {"llama_tokens": 167, "file": "Topological_Semantics_topo_operators_derivative", "length": 1} |
import os
import matplotlib.pyplot as plt
import numpy as np
class Logger(object):
def __init__(self, result_dir, model) -> None:
self.result_dir = result_dir
self.model = model
self.prepare_log_file()
def prepare_log_file(self):
log_path = self.result_dir / "log.csv"
... | {"hexsha": "68105a08bec83b1bc774e67f8a57787aef04eb23", "size": 3443, "ext": "py", "lang": "Python", "max_stars_repo_path": "quantum_keymap/logger.py", "max_stars_repo_name": "aoirohn/quantum_keymap", "max_stars_repo_head_hexsha": "61a7c817c81d75b4fc4ccf4ed55573f4f38b18f4", "max_stars_repo_licenses": ["MIT"], "max_stars... |
"""
Mock / synthetic data objects for use in testing.
"""
import numpy as np
from sourcefinder.accessors.dataaccessor import DataAccessor
from sourcefinder.utility.coordinates import WCS
import datetime
class Mock(object):
def __init__(self, returnvalue=None):
self.callcount = 0
self.callvalues = [... | {"hexsha": "6a6426a093b4297828d8843b82a78d7e2d576a83", "size": 3645, "ext": "py", "lang": "Python", "max_stars_repo_path": "sourcefinder/testutil/mock.py", "max_stars_repo_name": "transientskp/PySE", "max_stars_repo_head_hexsha": "9a59e2f5b4ec50ff5b0d735cfe76c6b9eeaa88ae", "max_stars_repo_licenses": ["BSD-2-Clause"], "... |
[STATEMENT]
lemma ru_t_event: "reaches_on ru_t t ts t' \<Longrightarrow> t = l_t0 \<Longrightarrow> ru_t t' = Some (t'', x) \<Longrightarrow>
\<exists>rho e tt. t' = Some (e, tt) \<and> reaches_on run_hd init_hd rho e \<and> length rho = Suc (length ts) \<and>
x = \<tau> \<sigma> (length ts)"
[PROOF STATE]
proof (p... | {"llama_tokens": 3679, "file": "VYDRA_MDL_Monitor", "length": 15} |
# -*- coding: utf-8 -*-
import numpy as np
import talib # pylint: skip-file
import config
from app.ta.helpers import indicator, nan_to_null
Config = config.BaseConfig()
# Elliott Wave Oscillator:
@indicator("EWO", ["ewo"])
def EWO(data, limit, fast=5, slow=35):
start = Config.MAGIC_LIMIT
close = data.close... | {"hexsha": "06102507c0d4395bf8ac96405a0106eebb916074", "size": 3458, "ext": "py", "lang": "Python", "max_stars_repo_path": "core/app/ta/indicators/custom.py", "max_stars_repo_name": "bitreport-org/Bitreport", "max_stars_repo_head_hexsha": "f480c410d340e57645a9a23d12fe2a2d3d2add39", "max_stars_repo_licenses": ["MIT"], "... |
import argparse
import pickle
from collections import namedtuple
import os
import numpy as np
import matplotlib.pyplot as plt
import torch
def discount(sequence, Gamma = 0.99):
R = 0
reward = []
for r in sequence[::-1]:
R = r + Gamma * R
reward.insert(0, R)
return reward
def makedir... | {"hexsha": "bba9404ae01e04d5767f565bfe5cfafc3f879eb6", "size": 571, "ext": "py", "lang": "Python", "max_stars_repo_path": "Char6 AlphaGo/utils.py", "max_stars_repo_name": "rh01/Deep-reinforcement-learning-with-pytorch", "max_stars_repo_head_hexsha": "fd1853495b885514927c82834f562d2a4df06b28", "max_stars_repo_licenses":... |
import copy
import time
import torch
import numpy as np
import matplotlib.pyplot as plt
from models.test import test_img
from models.CNN import CNN_mnist, CNN_cifar
from models.MLP import MLP
from utilities.arguments import parser
from utilities.grouping import mnist_iid, mnist_noniid, cifar_iid
from torchvision imp... | {"hexsha": "9432d43d9c59fb6f1fd81d9e700b0952bccb455b", "size": 3754, "ext": "py", "lang": "Python", "max_stars_repo_path": "main_fed.py", "max_stars_repo_name": "DimensionPrism/Federated-Learning", "max_stars_repo_head_hexsha": "e5c7c7c0d3a08c2f8fea83ff26cd701c6349750f", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
SUBROUTINE SFHSTAT(pos,model,ssfr6,ssfr7,ssfr8,ave_age)
!compute basic statistics given a parameterized star formation history.
!required inputs are the parameter set and a single element output
!structure from compsp
USE sps_vars
IMPLICIT NONE
TYPE(PARAMS), INTENT(in) :: pos
TYPE(COMPSPOUT), INTE... | {"hexsha": "936e134e352c01eb9957796c9efd7ac56a6bf66d", "size": 2732, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "src/sfhstat.f90", "max_stars_repo_name": "christopherlovell/fsps", "max_stars_repo_head_hexsha": "1c09a47d7b0fb15a7f245ee3e9b2a7c54122ffdf", "max_stars_repo_licenses": ["MIT"], "max_stars_count"... |
import numpy as np
import torch
import torch.nn as nn
from torch.nn.parameter import Parameter
import cirtorch.layers.functional as LF
from cirtorch.layers.normalization import L2N
# --------------------------------------
# Pooling layers
# --------------------------------------
class Flatten(nn.Module):
def _... | {"hexsha": "88fc178a9ca611cc2bfb1a09757a8a7481f80b7d", "size": 7966, "ext": "py", "lang": "Python", "max_stars_repo_path": "cirtorch/layers/pooling.py", "max_stars_repo_name": "smly/Landmark2019-1st-and-3rd-Place-Solution", "max_stars_repo_head_hexsha": "9839c9cbc6bec15e69e91d1d7c8be144531d5a33", "max_stars_repo_licens... |
#!/usr/bin/env python3
import numpy as np
import sklearn.decomposition as sd
def subtract_mean_vec(vectors):
return vectors - vectors.mean(axis=0)
def subtract_top_components(vectors, d=None):
"""Subtract d top PCA components."""
pca = sd.PCA().fit(vectors)
for cn in range(d):
component = ... | {"hexsha": "b7311333b193d4a404f889817367d352623ce26a", "size": 966, "ext": "py", "lang": "Python", "max_stars_repo_path": "snaut-english/utils/space_utils.py", "max_stars_repo_name": "porcelluscavia/vectors-webtool", "max_stars_repo_head_hexsha": "4dfcd0ce72685900ebfc4be4f08fe9fbdb01581e", "max_stars_repo_licenses": ["... |
/-
Copyright (c) 2022 Jujian Zhang. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Jujian Zhang
! This file was ported from Lean 3 source module algebra.module.graded_module
! leanprover-community/mathlib commit 59cdeb0da2480abbc235b7e611ccd9a7e5603d7c
! Please do not... | {"author": "leanprover-community", "repo": "mathlib3port", "sha": "62505aa236c58c8559783b16d33e30df3daa54f4", "save_path": "github-repos/lean/leanprover-community-mathlib3port", "path": "github-repos/lean/leanprover-community-mathlib3port/mathlib3port-62505aa236c58c8559783b16d33e30df3daa54f4/Mathbin/Algebra/Module/Grad... |
# -*- coding: utf-8 -*-
# Copyright 2018 The Blueoil 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
#
# Unles... | {"hexsha": "163d251242df574beabbdd500762ee3e266eefb1", "size": 5555, "ext": "py", "lang": "Python", "max_stars_repo_path": "lmnet/lmnet/datasets/image_folder.py", "max_stars_repo_name": "toohsk/blueoil", "max_stars_repo_head_hexsha": "596922caa939db9c5ecbac3286fbf6f703865ee6", "max_stars_repo_licenses": ["Apache-2.0"],... |
# coding=utf-8
# Copyright (C) 2019 ATHENA AUTHORS; Ruixiong Zhang; Lan Yu;
# 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/licens... | {"hexsha": "c3153d84d785d15325d09bfee4ea75152b71114c", "size": 4569, "ext": "py", "lang": "Python", "max_stars_repo_path": "athena/tools/vocoder.py", "max_stars_repo_name": "leixiaoning/Athena-Giga", "max_stars_repo_head_hexsha": "d599cee4027126fc4efd27cefd69ce89b77530e0", "max_stars_repo_licenses": ["Apache-2.0"], "ma... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import struct
import numpy as np
def f64_to_bytes( value, endianess="<" ):
return bytes( struct.pack( f"{endianess}d", np.float64( value ) ) )
| {"hexsha": "cfd2739622141433a939cdc29732899440a988ff", "size": 196, "ext": "py", "lang": "Python", "max_stars_repo_path": "converters/helpers.py", "max_stars_repo_name": "martinschwinzerl/sixtracklib_testdata", "max_stars_repo_head_hexsha": "3e74369844fa357d00e422f07d54f460a362e3b9", "max_stars_repo_licenses": ["Apache... |
[STATEMENT]
lemma box_an_bot:
"|an(x)]bot = n(x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. | an x ] bot = n x
[PROOF STEP]
by (simp add: box_x_bot n_an_def) | {"llama_tokens": 83, "file": "Correctness_Algebras_N_Semirings_Modal", "length": 1} |
[STATEMENT]
lemma timpls_transformable_to_refl:
"timpls_transformable_to TI t t" (is ?A)
"timpls_transformable_to' TI t t" (is ?B)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. timpls_transformable_to TI t t &&& timpls_transformable_to' TI t t
[PROOF STEP]
by (induct t) (auto simp add: list_all2_conv_all_nth) | {"llama_tokens": 143, "file": "Automated_Stateful_Protocol_Verification_Term_Implication", "length": 1} |
# Bond Helpers
type FixedRateBondHelper <: BondHelper
price::Quote
bond::FixedRateBond
end
value(b::FixedRateBondHelper) = b.price.value
maturity_date(b::FixedRateBondHelper) = maturity_date(b.bond)
# bond helper functions
function implied_quote{B <: BondHelper}(bond_h::B, clean::Bool = true)
bond = bond_h.bond
... | {"hexsha": "df6e7b1c4b704f56d0a31773857df5c7736ce9cb", "size": 949, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/termstructures/yield/bond_helpers.jl", "max_stars_repo_name": "JuliaQuant/QuantLib.jl", "max_stars_repo_head_hexsha": "b1a806daa3b15b1f3705e36f716e66cc24c1dd5f", "max_stars_repo_licenses": ["MIT... |
import os
import argparse
import numpy as np
import scipy
from scipy.sparse import csr_matrix
from scipy.sparse import lil_matrix
import pandas as pd
import matplotlib
from matplotlib import pyplot
from PIL import Image
import cv2
import numba
import deap
from deap import base
from deap import creator
from deap imp... | {"hexsha": "b63192753c617412bf7ac5e40637c233b53e69d2", "size": 6144, "ext": "py", "lang": "Python", "max_stars_repo_path": "mock_segmentation.py", "max_stars_repo_name": "shirakawas/mock-segmentation", "max_stars_repo_head_hexsha": "dd6806687642716698c2fa267c5938f695fae504", "max_stars_repo_licenses": ["MIT"], "max_sta... |
import math
import numpy as np
import matplotlib.pyplot as plt
from nclt2ros.visualizer.plotter import Plotter
from nclt2ros.transformer.coordinate_frame import CoordinateFrame
class GPS_RTK(Plotter):
"""Class to visualize the GPS RTK data as a kml and png file
USAGE:
GPS_RTK(date='2013-01-10', ... | {"hexsha": "1a72e843d703c793ac473cbb0fc6ca834940eff7", "size": 3174, "ext": "py", "lang": "Python", "max_stars_repo_path": "nclt2ros/visualizer/gps_rtk.py", "max_stars_repo_name": "bierschi/nclt2ros", "max_stars_repo_head_hexsha": "77b30ca6750d4b0cd82ccb6660f2fd0946581091", "max_stars_repo_licenses": ["MIT"], "max_star... |
import sys
import numpy as np
def nn_opt(x0, grd, opt_itrs=1000, step_sched=lambda i: 1. / (i + 1), b1=0.9, b2=0.99, eps=1e-8, verbose=False):
x = x0.copy()
m1 = np.zeros(x.shape[0])
m2 = np.zeros(x.shape[0])
for i in range(opt_itrs):
g = grd(x)
if verbose:
sys.stdout.writ... | {"hexsha": "f56c20c2f8182da4a1fa39318af3cdb949f47431", "size": 858, "ext": "py", "lang": "Python", "max_stars_repo_path": "experiments/bayesiancoresets/util/opt.py", "max_stars_repo_name": "DominicBroadbentCompass/bayesian-coresets-optimization", "max_stars_repo_head_hexsha": "3657f2ebfc4f0e6b36f5c651b0651f06d7e3d6b1",... |
module Included
using Hijack, Test
@testset "included testset" for _=1:1
@test true
push!(Hijack.RUN, 2)
# test that `testset=true` is forwarded
include("included_testset2.jl")
end
end
| {"hexsha": "84fc89c832e4ae0787b8c8cd71f2fb32d701b927", "size": 202, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/Hijack/test/included_testset.jl", "max_stars_repo_name": "danielsoutar/ReTest.jl", "max_stars_repo_head_hexsha": "4831b0fc23f2897bbeb999de9bdd14e968653199", "max_stars_repo_licenses": ["MIT"], ... |
# I need to better understand the general case before designing a nice dispatch system...
"""
An abstract types which dictates the problem to be solved. For example, all problem with two spatial dimensions, all of which use 2D effective wavenumbers, we have the type TwoDimensions{T} <: PhysicalSetup{T}. In particular,... | {"hexsha": "eea41c77134565e148adbbd5f18fd78a7472b022", "size": 1723, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/problem_setup.jl", "max_stars_repo_name": "UnofficialJuliaMirror/EffectiveWaves.jl-37e8709b-1ed2-53db-b26a-3571262b3cb4", "max_stars_repo_head_hexsha": "ec9829c42554ae993fe52f93a05c00b4c86105be... |
import os
import numpy as np
import cv2
class VideoRazor:
"""
Slices videos into N sections.
"""
def __init__(self, input_path, output_path, splits):
self.input_path = input_path
if not isinstance(self.input_path, str):
raise TypeError("Output must be a string")
se... | {"hexsha": "955bc357ff1491f08efa29611a968ba5c3de48f0", "size": 5576, "ext": "py", "lang": "Python", "max_stars_repo_path": "video_razor/razor.py", "max_stars_repo_name": "5starkarma/video-razor", "max_stars_repo_head_hexsha": "2a3aa4825ba91ad4bd50ca51aae257b74ac2cf7b", "max_stars_repo_licenses": ["MIT"], "max_stars_cou... |
struct ConstrainedTimeInvariantLQR{T <: Number}
"""
The predicted system
"""
sys::AbstractStateSpace
"""
The horizon length
"""
N::Integer
"""
The state weight matrix
"""
Q::AbstractMatrix{T}
"""
The Q weighting matrix taking into account the prestabilizing co... | {"hexsha": "30da13cf2bc53942449505e194f3b495e1ec5cb4", "size": 17025, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/types/clqr.jl", "max_stars_repo_name": "imciner2/PredictiveControl.jl", "max_stars_repo_head_hexsha": "05c12f853e3a2d273003afe1354b6cdb2714b478", "max_stars_repo_licenses": ["MIT"], "max_stars... |
(* Title: HOL/Auth/Guard/List_Msg.thy
Author: Frederic Blanqui, University of Cambridge Computer Laboratory
Copyright 2001 University of Cambridge
*)
section{*Lists of Messages and Lists of Agents*}
theory List_Msg imports Extensions begin
subsection{*Implementation of Lists by Messages*}
subsu... | {"author": "Josh-Tilles", "repo": "isabelle", "sha": "990accf749b8a6e037d25012258ecae20d59ca62", "save_path": "github-repos/isabelle/Josh-Tilles-isabelle", "path": "github-repos/isabelle/Josh-Tilles-isabelle/isabelle-990accf749b8a6e037d25012258ecae20d59ca62/src/HOL/Auth/Guard/List_Msg.thy"} |
import glob
import os
import random
import cv2
import numpy as np
from numpy.core.fromnumeric import sort
import torch
from torch.utils.data import Dataset, DataLoader
from utils import load_dicom
class RsnaDataset:
"""
paths: Subject IDs from the dataset
targets: MGMT_values for the respective subjec... | {"hexsha": "4f6c4b900c8944559b0c056fabf08728b67cb522", "size": 3722, "ext": "py", "lang": "Python", "max_stars_repo_path": "code/dataset.py", "max_stars_repo_name": "asheeshcric/kaggle-rsna-miccai", "max_stars_repo_head_hexsha": "8afd184572029e60618595ae154a92d13a1dae6b", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
"""
Tests of Tax-Calculator utility functions.
"""
# CODING-STYLE CHECKS:
# pycodestyle test_utils.py
# pylint --disable=locally-disabled test_utils.py
#
# pylint: disable=missing-docstring
import os
import math
import random
import numpy as np
import pandas as pd
import pytest
# pylint: disable=import-error
from taxc... | {"hexsha": "f4227bf8e35e45b23943bfd7f0c7f1976154f5d2", "size": 28679, "ext": "py", "lang": "Python", "max_stars_repo_path": "Tax-Calculator-2.9.0/taxcalc/tests/test_utils.py", "max_stars_repo_name": "grantseiter/Biden-Tax-Proposals", "max_stars_repo_head_hexsha": "c215ff845264f3fce9281c7fbb343ed10758a4b6", "max_stars_r... |
""" KL-Divergence estimation through K-Nearest Neighbours
This module provides four implementations of the K-NN divergence estimator of
Qing Wang, Sanjeev R. Kulkarni, and Sergio Verdú.
"Divergence estimation for multidimensional densities via
k-nearest-neighbor distances." Information Theo... | {"hexsha": "f3136cae290fc3bec8634e6311ca3b24b12870d6", "size": 4798, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/knn_divergence.py", "max_stars_repo_name": "LoryPack/KL-divergence-estimators", "max_stars_repo_head_hexsha": "051415977d324d3d5d735a7a25be8099ad3781c4", "max_stars_repo_licenses": ["MIT"], "m... |
#!/usr/bin/env python
import argparse
import numpy as np
import tensorflow as tf
import os.path as osp
import models
import dataset
def display_results(image_paths, probs):
'''Displays the classification results given the class probability for each image'''
# Get a list of ImageNet class labels
with open... | {"hexsha": "fa4b030300badbe29a5436afb3d4244930c987dd", "size": 2831, "ext": "py", "lang": "Python", "max_stars_repo_path": "caffe-tensorflow/examples/imagenet/classify.py", "max_stars_repo_name": "petercheng00/PSPNet-Keras-tensorflow", "max_stars_repo_head_hexsha": "d50583786a3e8782dd1b735d268e57392cd8c646", "max_stars... |
import pyaudio
import os
import struct
import numpy as np
import matplotlib.pyplot as plt
from scipy.fftpack import fft
import time
from tkinter import TclError
# constants
CHUNK = 1024 * 2 # samples per frame
FORMAT = pyaudio.paInt16 # audio format (bytes per sample?)
CHANNELS = 1 ... | {"hexsha": "9ab1ef5a0ba6461666f8b4f554f11b5f68f2ad7e", "size": 2239, "ext": "py", "lang": "Python", "max_stars_repo_path": "audio_detectionPlot.py", "max_stars_repo_name": "kubs0ne/Emergency-Vehicle-Detector", "max_stars_repo_head_hexsha": "6dcdc574614ed268ed02ceef971b6abbcb71d59d", "max_stars_repo_licenses": ["MIT"], ... |
"""
File: deep-fus/src/models.py
Author: Tommaso Di Ianni (todiian@stanford.edu)
Copyright 2021 Tommaso Di Ianni
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/lic... | {"hexsha": "2ecaad7820a61b92379be65155cd5b6726f339f8", "size": 16682, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/models.py", "max_stars_repo_name": "todiian/deep-fus", "max_stars_repo_head_hexsha": "c403cf306ef70640ff2fb9376362b1b614806f30", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count": ... |
function main(r::Robot)
path = go_to_west_south_corner_and_return_path!(r; go_around_barriers = true)
for i ∈ (North, East, South, West)
go_to_border_and_return_path!(r, i; markers = true)
end
go_by_path!(r, path)
end
| {"hexsha": "d4b5b56898237ce595dd92c873887471bd2410cb", "size": 248, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "15.jl", "max_stars_repo_name": "Savko-fokin/mirea-progs", "max_stars_repo_head_hexsha": "796428c41bd106a5364d2092f7af9b1e0af09d93", "max_stars_repo_licenses": ["BSD-2-Clause"], "max_stars_count": nu... |
# 状態方程式の導出
```julia
using Symbolics
using Latexify
```
```julia
@variables t M m l g D_θ D_x u
@variables x(t) θ(t)
Dt = Differential(t)
v = Dt(x)
ω = Dt(θ)
Dx = Differential(x)
Dv = Differential(v)
Dθ = Differential(θ)
Dω = Differential(ω)
```
(::Differential) (generic function with 2 methods)
## エネルギー... | {"hexsha": "e5033f0ce6419c88f5f8a49e43fb6b85a6916b1d", "size": 26209, "ext": "ipynb", "lang": "Jupyter Notebook", "max_stars_repo_path": "excercise/julia_src/derivation.ipynb", "max_stars_repo_name": "YoshimitsuMatsutaIe/abc_2022", "max_stars_repo_head_hexsha": "9c6fb487c7ec22fdc57cc1eb0abec4c9786ad995", "max_stars_rep... |
// Copyright (c) 2010 Satoshi Nakamoteed
// Copyright (c) 2009-2012 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "assert.h"
#include "chainparams.h"
#include "main.h"
#include "util.h"
#... | {"hexsha": "9594a996f09f0d84c6c2d15e86ba6e72d75e6b99", "size": 21261, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "src/chainparams.cpp", "max_stars_repo_name": "btcdraft/draftcoin", "max_stars_repo_head_hexsha": "31cb050d3706b57c1340da38a0652d4b098bdddc", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 4... |
@testset "BSpline" begin
include("constant.jl")
include("linear.jl")
include("quadratic.jl")
include("cubic.jl")
include("mixed.jl")
include("multivalued.jl")
include("non1.jl")
include("regularization.jl")
@test eltype(@inferred(interpolate(rand(Float16, 3, 3), BSpline(Linear()))))... | {"hexsha": "f7c8a3ff9609ac8937d59049312fdaddd0900115", "size": 349, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/b-splines/runtests.jl", "max_stars_repo_name": "tiagopereira/Interpolations.jl", "max_stars_repo_head_hexsha": "7c7e11c1204694f4d57cd0d1a30c353f563af461", "max_stars_repo_licenses": ["MIT"], "m... |
from mpi4py import MPI
import numpy
arquivo = open("etapa4-2.txt","a")
def mpiPI(nroProcesso, rank):#funcao que calcula o valor aprox de pi
N = 840
i = int(1 + (N/nroProcesso)*rank)
k = int((N/nroProcesso)*(rank+1))
somatorio = 0
for j in range(i,k+1):
somatorio += 1/(1+((j-0.5)... | {"hexsha": "d8d44cfe9ce9856b57d2396ea4f226c60961d8ca", "size": 1965, "ext": "py", "lang": "Python", "max_stars_repo_path": "cloud/MPI4-2.py", "max_stars_repo_name": "joaomota59/messagePassingInterface-MPI", "max_stars_repo_head_hexsha": "8e1515dbbc96d28248ac61e9c7b390c1cbded4b3", "max_stars_repo_licenses": ["MIT"], "ma... |
import numpy as np
#######################################
# AND, OR, NAND, XOR using PERCEPTRON #
#######################################
def step_function(x):
y = x > 0
return y.astype(np.int)
def AND(x1, x2):
x = np.array([x1, x2])
w = np.array([0.5, 0.5])
b = -0.7
tmp = np.sum(w * x) + ... | {"hexsha": "512d46351a8d3a2708e17988af5997083f644cda", "size": 1732, "ext": "py", "lang": "Python", "max_stars_repo_path": "week1/JY/perceptron.py", "max_stars_repo_name": "maybedy/MLDLStudy", "max_stars_repo_head_hexsha": "abe121bc73c1958f1cd2d30fd30384137140187b", "max_stars_repo_licenses": ["MIT"], "max_stars_count"... |
#
# General-purpose Photovoltaic Device Model - a drift diffusion base/Shockley-Read-Hall
# model for 1st, 2nd and 3rd generation solar cells.
# Copyright (C) 2008-2022 Roderick C. I. MacKenzie r.c.i.mackenzie at googlemail.com
#
# https://www.gpvdm.com
#
# This program is free software; you can redist... | {"hexsha": "a092eeaa645af2411eea9221ac675e228a5235f8", "size": 6443, "ext": "py", "lang": "Python", "max_stars_repo_path": "gpvdm_gui/gui/band_graph2.py", "max_stars_repo_name": "roderickmackenzie/gpvdm", "max_stars_repo_head_hexsha": "914fd2ee93e7202339853acaec1d61d59b789987", "max_stars_repo_licenses": ["BSD-3-Clause... |
Describe Users/BeachBabe here.
20090212 13:04:54 nbsp Howdy! It finally looks like its been toned down enough that the advert flag can be taken off. The use of phrases like best in merchandise and prices and so on sounded like it was written by the owner. I put the other flag, for a photo request, back up, since its ... | {"hexsha": "e0bed39f4c643b860bda8322389036d58f5ea6ee", "size": 670, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "lab/davisWiki/BeachBabe.f", "max_stars_repo_name": "voflo/Search", "max_stars_repo_head_hexsha": "55088b2fe6a9d6c90590f090542e0c0e3c188c7d", "max_stars_repo_licenses": ["MIT"], "max_stars_count": n... |
#pragma once
#include <boost/filesystem.hpp>
namespace configure
{
class TemporaryDirectory
{
private:
boost::filesystem::path _dir;
public:
TemporaryDirectory();
~TemporaryDirectory();
public:
boost::filesystem::path const& path() const;
};
}
| {"hexsha": "98b9669bdfd7c2a0e270a364429114f68cef9017", "size": 262, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "src/configure/TemporaryDirectory.hpp", "max_stars_repo_name": "hotgloupi/configure", "max_stars_repo_head_hexsha": "888cf725c93df5a1cf01794cc0a581586a82855c", "max_stars_repo_licenses": ["BSD-3-Claus... |
\documentclass{ut-thesis}
\usepackage{amsmath}
\usepackage[mathletters]{ucs}
\usepackage[utf8x]{inputenc}
\usepackage{array}
\usepackage[normalem]{ulem}
\newcommand{\textsubscr}[1]{\ensuremath{_{\scriptsize\textrm{#1}}}}
\usepackage[breaklinks=true,linktocpage,colorlinks]{hyperref}
\usepackage{url}
\usepackage{graph... | {"hexsha": "a12a1d9bf08470d1d978f2b3a0d0a0f2a503a8bc", "size": 3786, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "report/default.tex", "max_stars_repo_name": "blorente/Starcraft-II-Replay-Analysis", "max_stars_repo_head_hexsha": "6fc195aae83ee89c1e6c7732782d6c2fb1905e6f", "max_stars_repo_licenses": ["MIT"], "ma... |
[STATEMENT]
lemma transitionE:
fixes P :: pi
and \<alpha> :: freeRes
and P' :: pi
and P'' :: pi
and a :: name
and u :: name
and x :: name
shows "P \<Longrightarrow>\<^sub>l\<alpha> \<prec> P' \<Longrightarrow> \<exists>P'' P'''. P \<Longrightarrow>\<^sub>\<tau> P'' \<and> P'' \<lon... | {"llama_tokens": 6432, "file": "Pi_Calculus_Weak_Late_Step_Semantics", "length": 24} |
// ------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License (MIT). See License.txt in the repo root for license information.
// ------------------------------------------------------------
#include "stdafx.h"
#include... | {"hexsha": "e340bfefd03dc2b3241193f9a2a1ba13252f7a96", "size": 9563, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "src/prod/src/Naming/RouterTestHelper.cpp", "max_stars_repo_name": "AnthonyM/service-fabric", "max_stars_repo_head_hexsha": "c396ea918714ea52eab9c94fd62e018cc2e09a68", "max_stars_repo_licenses": ["MI... |
# Copyright 2021 Amazon.com, Inc. or its affiliates. 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.
# A copy of the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license... | {"hexsha": "ab18d75b69dfde159b21206510e6a6d12e78d1b7", "size": 6047, "ext": "py", "lang": "Python", "max_stars_repo_path": "syne_tune/util.py", "max_stars_repo_name": "awslabs/syne-tune", "max_stars_repo_head_hexsha": "1dd8e157477b86db01047a9a7821780ea04389bc", "max_stars_repo_licenses": ["ECL-2.0", "Apache-2.0"], "max... |
subroutine zero2
!! ~ ~ ~ PURPOSE ~ ~ ~
!! this subroutine zeros all array values
use hru_module, only : clayld, &
hru,lagyld,ndeat,ovrlnd,par,sagyld,sanyld, &
sedyld,silyld,smx,snotmp,surf_bs,twash,wrt
implicit none
real :: cklsp ! |
... | {"hexsha": "097518925b0af9f962c25247b186194968eda2ad", "size": 666, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "tests/data/program_analysis/multifile_multimod/mfmm_02/zero2.f90", "max_stars_repo_name": "mikiec84/delphi", "max_stars_repo_head_hexsha": "2e517f21e76e334c7dfb14325d25879ddf26d10d", "max_stars_r... |
# for python3
# qiML (quantum-inspired Machine Learning)
import numpy as np
def center_scale(A):
A_mean = np.mean(A)
A_std = np.std(A)
A_nrm = A
A_nrm -= A_mean
A_nrm /= A_std
return A_nrm, A_mean, A_std
'''
--------------------------
qiSVD
--------------------------
'''
def ve... | {"hexsha": "810dd713bae3a541f308689c700fa4a39e41b567", "size": 13116, "ext": "py", "lang": "Python", "max_stars_repo_path": "qiML.py", "max_stars_repo_name": "nkmjm/qiML", "max_stars_repo_head_hexsha": "677811b0a877e66e8edbcd3fa99d9a9cf164b6f5", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 11, "max_stars_repo... |
# -*- coding: utf-8 -*-
import sys
sys.path.insert(0,".")
import unittest
import neuroml
import neuroml.writers as writers
import PyOpenWorm
from PyOpenWorm import *
import networkx
import rdflib
import rdflib as R
import pint as Q
import os
import subprocess as SP
import subprocess
import tempfile
import doctest
fro... | {"hexsha": "b7858693f4c61650069d977fd0f56a5df9abeb64", "size": 30480, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test.py", "max_stars_repo_name": "nheffelman/pyopdata", "max_stars_repo_head_hexsha": "5cc3042b004f167dbf18acc119474ea48b47810d", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null... |
/**
* @file run_set_visitor.hpp
* @author Saksham Bansal
*
* This file provides an abstraction for the Run() function for
* different layers and automatically directs any parameter to the right layer
* type.
*
* mlpack is free software; you may redistribute it and/or modify it under the
* terms of the 3-clause... | {"hexsha": "a7aaa065af9e2a2536a981ae476d1406af3e2b2d", "size": 2339, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "src/mlpack/methods/ann/visitor/run_set_visitor.hpp", "max_stars_repo_name": "tomjpsun/mlpack", "max_stars_repo_head_hexsha": "39b9a852c58b648ddb9b87a3d87aa3db2bacbf0a", "max_stars_repo_licenses": ["... |
"""Time-lagged independent component analysis-based CV"""
__all__ = ["TICA_CV"]
import numpy as np
import pandas as pd
import torch
from .tica import TICA
from ..models import LinearCV
from ..utils.data import find_time_lagged_configurations
class TICA_CV(LinearCV):
""" Linear TICA CV.
Attributes
----... | {"hexsha": "0bde1a5d5bb40f1bf4399da0a2066be5a0a1e490", "size": 4926, "ext": "py", "lang": "Python", "max_stars_repo_path": "mlcvs/tica/linear_tica.py", "max_stars_repo_name": "luigibonati/mlcvs", "max_stars_repo_head_hexsha": "6567fb0774dc354f9cf3472dc356fdcf10aba6f2", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_... |
{-# OPTIONS --without-K --safe #-}
module Categories.NaturalTransformation where
-- all the important stuff about NaturalTransformation are defined in .Core
open import Categories.NaturalTransformation.Core public
| {"hexsha": "be992cc5eb48eb6dff59088d5d59effe7eb59ad5", "size": 216, "ext": "agda", "lang": "Agda", "max_stars_repo_path": "src/Categories/NaturalTransformation.agda", "max_stars_repo_name": "Trebor-Huang/agda-categories", "max_stars_repo_head_hexsha": "d9e4f578b126313058d105c61707d8c8ae987fa8", "max_stars_repo_licenses... |
[STATEMENT]
lemma Raise_Subst':
assumes "t \<noteq> \<^bold>\<sharp>"
shows "\<lbrakk>v \<noteq> \<^bold>\<sharp>; k \<le> n\<rbrakk> \<Longrightarrow> Raise k p (Subst n v t) = Subst (p + n) v (Raise k p t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<lbrakk>v \<noteq> \<^bold>\<sharp>; k \<le> n\<rbra... | {"llama_tokens": 4811, "file": "ResiduatedTransitionSystem_LambdaCalculus", "length": 7} |
import skrf
import tkinter as tk
from matplotlib.figure import Figure
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
import numpy as np
import CircuitFig
from PIL import ImageTk, Image, ImageDraw
import io
import MatchCal
l2z = lambda l: l[0] + 1j * l[1]
s4cmp = lambda sf: 'nH' if sf == 'l' else 'pF'... | {"hexsha": "7792dcc7dbc4922ec1444b4df1c835939f82135a", "size": 10328, "ext": "py", "lang": "Python", "max_stars_repo_path": "code/TkGui.py", "max_stars_repo_name": "briansune/python-smith-chart-antenna-matching", "max_stars_repo_head_hexsha": "e21dccfb4fbddb7a4fabdd89854dbaf1bd93ea31", "max_stars_repo_licenses": ["MIT"... |
const ASSET_FINGERPRINT = "8d9151df5a4a5fafb268" | {"hexsha": "0a160538e62cde72eba61b47dc7ce880229f319b", "size": 48, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "config/initializers/fingerprint.jl", "max_stars_repo_name": "essenciary/chirper", "max_stars_repo_head_hexsha": "5e809216b3bbe517c65156328717d8c110a8d934", "max_stars_repo_licenses": ["MIT"], "max_st... |
/*
* Copyright 2021 Oleg Zharkov
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* or in the "license" file accompanying ... | {"hexsha": "ed30a8de2f9e6e67ea571e6e95d08b8a3febcfc5", "size": 30939, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "src/updates.cpp", "max_stars_repo_name": "olegzhr/altprobe", "max_stars_repo_head_hexsha": "da9597efcf0463f31ea38bf715ed8d5453dfc0e5", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count": ... |
[STATEMENT]
lemma in_MPLS_leq_2_pow_n:
fixes PROB :: "'a problem" and x
assumes "finite PROB" "(x \<in> MPLS PROB)"
shows "(x \<le> 2 ^ card (prob_dom PROB) - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. x \<le> 2 ^ card (prob_dom PROB) - 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoa... | {"llama_tokens": 5047, "file": "Factored_Transition_System_Bounding_TopologicalProps", "length": 39} |
# example of combination image augmentation
from numpy import expand_dims
from keras.preprocessing.image import load_img
from keras.preprocessing.image import img_to_array
from keras.preprocessing.image import ImageDataGenerator
from matplotlib import pyplot
# import matplotlib
import os, shutil
deck = 'dobble_deck0... | {"hexsha": "2a8c535e30c743cb70de0b775a58367dadda3c7e", "size": 1975, "ext": "py", "lang": "Python", "max_stars_repo_path": "save_augmented_images.py", "max_stars_repo_name": "maxpark/dobble_buddy", "max_stars_repo_head_hexsha": "52109de1275f96af79fb77f1a5f5fb8fe00e96d2", "max_stars_repo_licenses": ["Apache-2.0"], "max_... |
export Car
mutable struct Car <: Robot
btCollisionObject
end
Car() = Car(BulletCollision.convex_hull([zeros(3)]))
| {"hexsha": "61bf2953177c5632d13c271587181d42d32ce49a", "size": 118, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/robot/car.jl", "max_stars_repo_name": "schoelst/GuSTO.jl", "max_stars_repo_head_hexsha": "b5753959c2e232c4e91be3e73ec4a81470c703b1", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 39, "m... |
"""
IGRound
Abstract base type for dispatched InstaRound rounds.
"""
abstract type IGRound end
units = [
"K", "M", "B", "t", "q", "Q", "s", "S", "o",
"n", "d", "U", "D", "T", "Qt", "Qd", "Sd", "St",
"O", "N", "v", "c"
]
unit_names = [
"Thousand",
"Million",
"Billion",
"Trillion",
... | {"hexsha": "804ae37504819d6a05a4d8cd1237981ce4cadfdf", "size": 677, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/custom.jl", "max_stars_repo_name": "PyDataBlog/InstaRound.jl", "max_stars_repo_head_hexsha": "3eb3f6de229a82819415856b0f851fb8899492b0", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 5,... |
module animal_herd_module
implicit none
type animals
character(len=16) :: name ! |animal name (cattle, sheep, goats, etc)
real :: phyp = 0. ! |
real :: pthd = 0. ! |
real :: pthu = 0. ! |
... | {"hexsha": "cf12c99517d3f86f5f9dc76ca76fd5fd68aa16fb", "size": 926, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "source_codes_60.5/animal_herd_module.f90", "max_stars_repo_name": "ankwasa/wetlands_swatplus", "max_stars_repo_head_hexsha": "3cdf83cc6a4dc68ce4f53ce1d0ebacd7695b54cf", "max_stars_repo_licenses":... |
Sunflowers can be found in both Town Flora personal gardens and farmers fields Outskirts just outside of town. They are grown locally for seed production. The seeds harvested will be planted throughout the world for confection, oil, or ornamental markets. Sunflower seeds are one of Yolo Countys top grossing agricult... | {"hexsha": "051e08349660b1054b2c687778ea3a1f9a3c29f0", "size": 532, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "lab/davisWiki/Sunflowers.f", "max_stars_repo_name": "voflo/Search", "max_stars_repo_head_hexsha": "55088b2fe6a9d6c90590f090542e0c0e3c188c7d", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
"""
Created by Hamid Eghbal-zadeh at 22.03.21
Johannes Kepler University of Linz
"""
import torch
from torch import optim
from tqdm import tqdm
import numpy as np
import os
from datetime import datetime
import argparse
import pickle
import matplotlib.pyplot as plt
import json
from datasets.utils import get_disentangl... | {"hexsha": "48e5cb08457ba86b31c0b311e39d9a118e4c6fb8", "size": 8989, "ext": "py", "lang": "Python", "max_stars_repo_path": "VAE/disentangle_eval.py", "max_stars_repo_name": "sebzap/CarlaRL", "max_stars_repo_head_hexsha": "5283d15dee9e8dc5e728314d56875b4fbca3acb2", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
#include "run_test_file.hpp"
#include <signal.h>
#include <sys/resource.h>
#include <sys/wait.h>
#include <cstdint>
#include <sstream>
#include <boost/iostreams/device/file_descriptor.hpp>
#include <boost/iostreams/stream.hpp>
#include <mettle/driver/exit_code.hpp>
#include <mettle/driver/posix/scoped_pipe.hpp>
#i... | {"hexsha": "11d5f8e6aace2c3b412fe305696b2fbe405fc13c", "size": 3703, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "src/mettle/posix/run_test_file.cpp", "max_stars_repo_name": "jimporter/mettle", "max_stars_repo_head_hexsha": "c65aa75b04a08b550b3572f4c080c68e26ad86fa", "max_stars_repo_licenses": ["BSD-3-Clause"],... |
"""
.. codeauthor:: David Zwicker <david.zwicker@ds.mpg.de>
"""
import numpy as np
import pytest
from numpy.lib.recfunctions import structured_to_unstructured
from pde import ScalarField
from pde.grids import (
CartesianGrid,
CylindricalSymGrid,
PolarSymGrid,
SphericalSymGrid,
UnitGrid,
)
from dr... | {"hexsha": "55a623ceeb97b341de83d6de2b1f91352fe09f0f", "size": 9791, "ext": "py", "lang": "Python", "max_stars_repo_path": "droplets/tests/test_image_analysis.py", "max_stars_repo_name": "tefavidal/py-droplets", "max_stars_repo_head_hexsha": "633f0cff75eecd9d1a375cfaebfad326cb9a7bf0", "max_stars_repo_licenses": ["MIT"]... |
from __future__ import print_function
from tensorflow.python.keras.models import Sequential
from tensorflow.python.keras.layers import Dense
from tensorflow.python.keras.callbacks import ModelCheckpoint, EarlyStopping
from tensorflow.python.keras.optimizers import SGD
import numpy as np
def createModel(inp... | {"hexsha": "aca3345377d394b07f67b60943b96122576ce1eb", "size": 1431, "ext": "py", "lang": "Python", "max_stars_repo_path": "EX_1.py", "max_stars_repo_name": "tszdanger/NUS_ALL", "max_stars_repo_head_hexsha": "2b38cce6c0aeebed4bbd211e3e29565c66084cf6", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, "max_stars... |
[STATEMENT]
lemma cindexP_lineE_changes:
fixes p::"complex poly" and a b ::complex
assumes "p\<noteq>0" "a\<noteq>b"
shows "cindexP_lineE p a b =
(let p1 = pcompose p [:a, b-a:];
pR1 = map_poly Re p1;
pI1 = map_poly Im p1;
gc1 = gcd pR1 pI1
in
real_of_int (changes_alt_itv_sm... | {"llama_tokens": 5745, "file": "Count_Complex_Roots_Extended_Sturm", "length": 48} |
"""
UNet architecture in Keras TensorFlow
"""
import os
import numpy as np
import cv2
import tensorflow as tf
from tensorflow.keras.layers import *
from tensorflow.keras.models import Model
class Unet:
def __init__(self, input_size=256):
self.input_size = input_size
def build_model(self):
def... | {"hexsha": "006c51fc073b43d13f8a06dd0e2f5525ef14f086", "size": 2247, "ext": "py", "lang": "Python", "max_stars_repo_path": "Classes/ResUNetPlusPlus/unet.py", "max_stars_repo_name": "Nitin-Mane/ALL-PyTorch-Segmentation-2021", "max_stars_repo_head_hexsha": "0f3c7b129629cc2863c502898bcfa3c45077af85", "max_stars_repo_licen... |
import numpy as np
import pandas as pd
import os, glob, pickle
from pathlib import Path
from os.path import join, exists, dirname, abspath, isdir
import random
from sklearn.neighbors import KDTree
from tqdm import tqdm
import logging
from .utils import DataProcessing, get_min_bbox, BEVBox3D
from .base_dataset import B... | {"hexsha": "5de409f1c88e3e39caa32119aaaf36957101dbc9", "size": 10708, "ext": "py", "lang": "Python", "max_stars_repo_path": "ml3d/datasets/s3dis.py", "max_stars_repo_name": "thomasbrockmeier-ams/Open3D-ML", "max_stars_repo_head_hexsha": "1e362bbf133537668923905a12a15c540d9b689d", "max_stars_repo_licenses": ["MIT"], "ma... |
########################################################################################
## This file is a part of YAP package of scripts. https://github.com/shpakoo/YAP
## Distributed under the MIT license: http://www.opensource.org/licenses/mit-license.php
## Copyright (c) 2011-2013 Sebastian Szpakowski
#############... | {"hexsha": "90e511f6b71389c7fc4b3d03c8b8ff2fc4fe2528", "size": 11587, "ext": "r", "lang": "R", "max_stars_repo_path": "OtuReadPlots.r", "max_stars_repo_name": "andreyto/YAP", "max_stars_repo_head_hexsha": "5e897b7bbc8d3dc7a7d1d5ac6485ad474f2d51c0", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_stars... |
from datetime import timedelta
import pandas as pd
import numpy as np
import re
def groupact(x):
if x < 10:
return "[0-10)"
if x < 30:
return "[10-30)"
if x < 100:
return "[30-100)"
else:
return "[100,)"
def get_matched_dataframes(df_, reddit_venue, fringe_venue, migr... | {"hexsha": "f35159d074d4e20084ffc2c9926122fcbe2d13b6", "size": 5980, "ext": "py", "lang": "Python", "max_stars_repo_path": "helpers/match_helpers.py", "max_stars_repo_name": "epfl-dlab/platform_bans", "max_stars_repo_head_hexsha": "a294477687ffb4f636eb69c2492d8858ab2621f4", "max_stars_repo_licenses": ["MIT"], "max_star... |
program write_to_console
implicit none
character(len=:), allocatable :: chars
chars = 'Fortran is 💪, 😎, 🔥!'
write(*,*) chars
end program | {"hexsha": "a17fec8cd002141111a0cdb3651afebf64d19b9f", "size": 153, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "example/write_to_console.f90", "max_stars_repo_name": "plevold/unicode-in-fortran", "max_stars_repo_head_hexsha": "1ab8fbb154bef172e947c9c8573f950359e2c308", "max_stars_repo_licenses": ["MIT"], "... |
function UseCards(object, ~, inventory, main)
res = get(0, 'ScreenSize');
%% FIGURE WINDOW
handle = ...
figure('Name', 'Use Cards', ...
'Units', 'pixels', ...
'MenuBar', 'none', ...
'NumberTitle', 'off', ...
'Position', [res(3:4)/3, 150, 200]);
%% RADIO BUTTONS
str = {... | {"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/34438-risk/Final/UseCards.m"} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.