text stringlengths 0 1.25M | meta stringlengths 47 1.89k |
|---|---|
r"""
Tabular representation of datasets.
.. sidebar:: Contents
.. contents::
:local:
:depth: 1
While spectroscopic data are usually presented graphically (see
the :mod:`aspecd.plotting` module for details), there are cases where a
tabular representation is useful or even necessary.
One prime ex... | {"hexsha": "b2219045fe1211add4209f6ac22423e974338540", "size": 44273, "ext": "py", "lang": "Python", "max_stars_repo_path": "aspecd/table.py", "max_stars_repo_name": "tillbiskup/aspecd", "max_stars_repo_head_hexsha": "5c7d7ceb9ec3eb97d01348c0495adc999c7af78a", "max_stars_repo_licenses": ["BSD-2-Clause"], "max_stars_cou... |
import cirq
import numpy as np
import pytest
from zquantum.core.circuits import GateOperation, import_from_cirq
from zquantum.core.decompositions import (
PowerGateToPhaseAndRotation,
decompose_cirq_circuit,
)
class TestDecompositionOfPowerGates:
@pytest.mark.parametrize("target_qubit", [cirq.LineQubit(0)... | {"hexsha": "db7a7f5617734716cc219948fcf80bd085a04158", "size": 5326, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/zquantum/core/_cirq_decomposition_test.py", "max_stars_repo_name": "yukiizm/z-quantum-core", "max_stars_repo_head_hexsha": "c96804d9f0a35e1dde150db21b9e0e91a54f449f", "max_stars_repo_license... |
import numpy as np
import matplotlib.pyplot as plt
from autograd import Tensor, Module
from autograd.optim import SGD, Adam
from autograd.module import Linear
from autograd.activation import Sigmoid, Tanh
def xor_gate(a, b):
assert isinstance(a, int) and isinstance(b, int)
if a != b:
return 1
else... | {"hexsha": "2f21407fc259f60cb5b4e66ccb8b5b46f3074322", "size": 1878, "ext": "py", "lang": "Python", "max_stars_repo_path": "simple_neural_net.py", "max_stars_repo_name": "ly49nkallo/AdvancedTopics2021", "max_stars_repo_head_hexsha": "f729b16c3f7a5a6de64131039943977db97fc57c", "max_stars_repo_licenses": ["MIT"], "max_st... |
export mean_shift
using mlpack._Internal.io
import mlpack_jll
const mean_shiftLibrary = mlpack_jll.libmlpack_julia_mean_shift
# Call the C binding of the mlpack mean_shift binding.
function mean_shift_mlpackMain()
success = ccall((:mean_shift, mean_shiftLibrary), Bool, ())
if !success
# Throw an exception--... | {"hexsha": "be5fb433c3f24d7870634962a6e0dd0f2bfc009c", "size": 4397, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/mean_shift.jl", "max_stars_repo_name": "mlpack/mlpack.jl", "max_stars_repo_head_hexsha": "7c499f056dc46ee54a2be6da1beb3066f40cbf09", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_coun... |
##############################################################################
# Copyright 2020 IBM Corp. 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
#
# htt... | {"hexsha": "e2423ccfa452a4209573e6892a30c2ad9663f388", "size": 3711, "ext": "py", "lang": "Python", "max_stars_repo_path": "dfpipeline/ComplementLabelEncoder.py", "max_stars_repo_name": "IBM/dataframe-pipeline", "max_stars_repo_head_hexsha": "44bb4efc77ca36022ef2d54cba4d77825111841f", "max_stars_repo_licenses": ["Apach... |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# --------------------------------------------------------------------------------------------
import os
import unittest
import nu... | {"hexsha": "f16e43aa5756f2a55b7ee9d58ba32e5407daac85", "size": 18002, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/python/nimbusml/tests/pipeline/test_pipeline_combining.py", "max_stars_repo_name": "michaelgsharp/NimbusML", "max_stars_repo_head_hexsha": "50031157265f49eec85d27fe67582d9ddaf01ef9", "max_sta... |
[STATEMENT]
lemma rm_vars_ground_supports:
assumes "ground (subst_range \<theta>)"
shows "rm_vars X \<theta> supports \<theta>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. rm_vars X \<theta> supports \<theta>
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
1. \<And>x. rm_vars X \<theta> x \<... | {"llama_tokens": 1424, "file": "Stateful_Protocol_Composition_and_Typing_More_Unification", "length": 16} |
[STATEMENT]
lemma of_rat_less_1_iff [simp]: "(of_rat r :: 'a::linordered_field) < 1 \<longleftrightarrow> r < 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. (of_rat r < (1::'a)) = (r < 1)
[PROOF STEP]
using of_rat_less [of r 1]
[PROOF STATE]
proof (prove)
using this:
(of_rat r < of_rat 1) = (r < 1)
goal (1 subgo... | {"llama_tokens": 188, "file": null, "length": 2} |
##########################################
# This code impliment fuzzy controller #
##########################################
import pendulum
import const
import numpy as np
import abc_py
import pso_e
#import pso_v2 as pso_e # Optimizer algorithm
from matplotlib import pyplot as plt
#############... | {"hexsha": "a6d3f8b749a075706a2b4dd0709d286f0c16da2a", "size": 8515, "ext": "py", "lang": "Python", "max_stars_repo_path": "main.py", "max_stars_repo_name": "Ernie-Wang/IC_HW2", "max_stars_repo_head_hexsha": "77e792f9afcbc0a0bffeefbf79fb4fe8b933c01d", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_st... |
from collections import OrderedDict
import torch
import os
import numpy as np
def get_predicteds(output,topk=(5,)):
"""
:param output: model's output tensor
:param topk: a tuple for topk (top_start,top_end)
:return: preds_list scores_list
"""
maxk = max(topk)
scores, preds = output.topk(maxk... | {"hexsha": "bccb3913b717146c7067260e3f6c11450675e709", "size": 3188, "ext": "py", "lang": "Python", "max_stars_repo_path": "vcoco_det/model/test_generator.py", "max_stars_repo_name": "ZHUXUHAN/HOI", "max_stars_repo_head_hexsha": "c642e0edeabf47c396e359b6e7059e664644d5aa", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
"""Module to run a basic decision tree model
Author(s):
Mike Skarlinski (michael.skarlinski@weightwatchers.com)
"""
import pandas as pd
import numpy as np
import logging
from sklearn import preprocessing
from primrose.base.transformer import AbstractTransformer
class ExplicitCategoricalTransform(AbstractTransf... | {"hexsha": "4a1c0600062b6b24e5b7bc8a9584297e3f557cac", "size": 6766, "ext": "py", "lang": "Python", "max_stars_repo_path": "primrose/transformers/categoricals.py", "max_stars_repo_name": "astro313/primrose", "max_stars_repo_head_hexsha": "891f001e4e198096edb74eea951d27c9ae2a278f", "max_stars_repo_licenses": ["Apache-2.... |
#include <memo/silo/Silo.hh>
#include <boost/algorithm/string/case_conv.hpp>
#include <elle/factory.hh>
#include <elle/find.hh>
#include <elle/log.hh>
#include <memo/silo/Key.hh>
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/split.hpp>
ELLE_LOG_COMPONENT("memo.silo.Silo");
... | {"hexsha": "c9356a154e577282541fe4b9995a690020f44302", "size": 4860, "ext": "cc", "lang": "C++", "max_stars_repo_path": "src/memo/silo/Silo.cc", "max_stars_repo_name": "infinit/memo", "max_stars_repo_head_hexsha": "3a8394d0f647efe03ccb8bfe885a7279cb8be8a6", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count": ... |
import os
import numpy as np
import pandas as pd
import pickle
import re
def read_joules(f,device):
''' Reads a joules trace csv generated by run_experiment.py'''
joules_df = pd.read_csv(f)
jcols = joules_df.columns
regex = re.compile('package_.')
package_cols = [string for string in jcols if re.m... | {"hexsha": "12f1faed903b985141a21c633608bab297ea14df", "size": 1542, "ext": "py", "lang": "Python", "max_stars_repo_path": "utils/io_utils.py", "max_stars_repo_name": "neurodatascience/watts_up_compute", "max_stars_repo_head_hexsha": "1ed41e62690f99f699b44180208689cc19616bb7", "max_stars_repo_licenses": ["MIT"], "max_s... |
from pathlib import Path
from typing import List, Tuple
import numpy as np
import cv2
import matplotlib.pyplot as plt
GRID_X = 9
GRID_Y = 6
class Undistorter:
def __init__(self, img_shape: Tuple[int, int]):
self.img_shape = img_shape
self.mtx = None
self.dist = None
self._calibr... | {"hexsha": "b2c609f5acd20159413a1401e93443901cedd9f4", "size": 2160, "ext": "py", "lang": "Python", "max_stars_repo_path": "Project2_Advanced_Lane_Finding/lib/camera_calib.py", "max_stars_repo_name": "jvanlier/self-driving-car-engineer", "max_stars_repo_head_hexsha": "08300245fbfa50858ac77a167d6ae8ceb054c0d4", "max_sta... |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | {"hexsha": "d048e7b81a23bad565f94e4d50284732c2009525", "size": 20081, "ext": "py", "lang": "Python", "max_stars_repo_path": "built-in/TensorFlow/Official/cv/Image_translation/Pix2Pix_ID0359_for_TensorFlow/model.py", "max_stars_repo_name": "Ascend/modelzoo", "max_stars_repo_head_hexsha": "f018cfed33dbb1cc2110b9ea2e23333... |
[STATEMENT]
lemma coclop_coextensive: "coclop f \<Longrightarrow> f \<le> id"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. coclop f \<Longrightarrow> f \<le> id
[PROOF STEP]
by (simp add: coclop_def) | {"llama_tokens": 84, "file": "Order_Lattice_Props_Closure_Operators", "length": 1} |
import tetris
import random
# import math
import numpy as np
# import pickle
# from tqdm import tqdm
# from collections import deque
# from keras.models import Sequential
# from keras.layers import Dense
# from keras.optimizers import Adam
class Tetris:
def __init__(self):
print("init")
self.score... | {"hexsha": "e955848b34e44bcada3b808ce371fa08b9e84521", "size": 9452, "ext": "py", "lang": "Python", "max_stars_repo_path": "boost/test-boost-tetris.py", "max_stars_repo_name": "TylerWasniowski/tetris", "max_stars_repo_head_hexsha": "8be9fdbf46d134c89e2e5d450c5148cfa6ad76de", "max_stars_repo_licenses": ["MIT"], "max_sta... |
import os
import numpy as np
import tensorflow as tf
import cv2
import math
import time
import shutil
import cfg
from lpdr_net import LpdrNet
from utils import data_reader, dataset
from net.resnet import load_weights
os.environ["CUDA_VISIBLE_DEVICES"] = '1'
def train():
# define dataset
configs = cfg.Config()... | {"hexsha": "1e4fa9ee50e629f68373ea34486e207d0e65a8ae", "size": 7272, "ext": "py", "lang": "Python", "max_stars_repo_path": "train.py", "max_stars_repo_name": "shuxin-qin/TE-CLPDR-IUS", "max_stars_repo_head_hexsha": "65eba5d6368bd9477ac6a2cc999006a97edf913a", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, ... |
/* Copyright © 2017 Apple Inc. All rights reserved.
*
* Use of this source code is governed by a BSD-3-clause license that can
* be found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
*/
#include <string>
#include <logger/logger.hpp>
#include <boost/algorithm/string/predicate.hpp>
#incl... | {"hexsha": "60ec6adc274cea473ac0dc371077f8617ef80c4c", "size": 2797, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "src/fileio/file_download_cache.cpp", "max_stars_repo_name": "TimothyRHuertas/turicreate", "max_stars_repo_head_hexsha": "afa00bee56d168190c6f122e14c9fbc6656b4e97", "max_stars_repo_licenses": ["BSD-3... |
import numpy as np
import sklearn
import math
from scipy.stats import chi2
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
from random import *
from matplotlib.patches import Ellipse
from numpy.linalg import cholesky
import pandas as pd
import matplotlib as mpl
import seaborn as snss
# https://github... | {"hexsha": "9b3e6a88088f0b899491fa7464b6a966f7f2c60c", "size": 55417, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/models/make_graphs.py", "max_stars_repo_name": "nayronmorais/EMPF", "max_stars_repo_head_hexsha": "4baf87dcbd0689cbe43ec3d8775f489ee7742426", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
import numpy.testing as npt
import pytest
from cued_sf2_lab.dct import *
class TestDctII:
def test_basic(self):
dct4 = dct_ii(4)
npt.assert_allclose(dct4,
[[0.5, 0.5, 0.5, 0.5 ],
[0.65328, 0.27059, -0.27059, -0.65328],
[0.5, -0.5, -... | {"hexsha": "2685041eeb1545e048f90dec9547486a331d1cfc", "size": 2929, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_dct.py", "max_stars_repo_name": "sigproc/cued_sf2_lab", "max_stars_repo_head_hexsha": "d31f5e6725e9c1be64145006d20ddb08ae68e70e", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
# Author: Alexandre Bovet <alexandre.bovet@gmail.com>
# License: BSD 3 clause
from sklearn.linear_model import SGDClassifier
from sklearn.model_selection import KFold, GridSearchCV
from sklearn.pipeline import Pipeline
from sklearn.externals import joblib
import time
import numpy as np
import ujson as json
from mult... | {"hexsha": "dca351b778146ab7164e67395ee34eaf7ea86cd8", "size": 7204, "ext": "py", "lang": "Python", "max_stars_repo_path": "crossValOptimize.py", "max_stars_repo_name": "alexbovet/twitter_opinion_mining", "max_stars_repo_head_hexsha": "e071fc0447072877518a14f2f8f59f0dd974167f", "max_stars_repo_licenses": ["BSD-3-Clause... |
import sys
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from scipy.stats import skew
import imp
parameters = imp.load_source("parameters", "../../../data/raw/parameters.py")
selection_of_players = ["EvolvedLookerUp2_2_2",
"Tit For Tat",
"ZD-Extort-2"
]
def main():
... | {"hexsha": "55f1b380014304fc08b7167e5cf499d64f8535ba", "size": 1060, "ext": "py", "lang": "Python", "max_stars_repo_path": "assets/img/sserror_distribution_for_selection_of_strategies/main.py", "max_stars_repo_name": "drvinceknight/testing_for_ZD", "max_stars_repo_head_hexsha": "a08643849a8e4ed3c1ee86ab8bd4530a97e92154... |
program Example
implicit none
integer :: n
n = countsubstring("the three truths", "th")
write(*,*) n
n = countsubstring("ababababab", "abab")
write(*,*) n
n = countsubstring("abaabba*bbaba*bbab", "a*b")
write(*,*) n
contains
function countsubstring(s1, s2) result(c)
character(*), intent(in) :: s1, ... | {"hexsha": "a9156702ad502ef72c7aa1848b4bad450b2e8803", "size": 524, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "Task/Count-occurrences-of-a-substring/Fortran/count-occurrences-of-a-substring.f", "max_stars_repo_name": "LaudateCorpus1/RosettaCodeData", "max_stars_repo_head_hexsha": "9ad63ea473a958506c041077f1... |
import hashlib
import struct
import sys
import logging
from functools import reduce
import numpy as np
from itertools import islice, chain
logger = logging.getLogger(__name__)
logger.setLevel("DEBUG")
COMPLEMENT = {"A": "T", "C": "G", "G": "C", "T": "A"}
BITS = {"A": "00", "G": "01", "C": "10", "T": "11"}
BASES = {"0... | {"hexsha": "22b2b60a5e642ae5725a20587d3e328903665cf3", "size": 1351, "ext": "py", "lang": "Python", "max_stars_repo_path": "bigsi/utils/fncts.py", "max_stars_repo_name": "Phelimb/bfg", "max_stars_repo_head_hexsha": "bf34abbb9d6f72a9f0c64c40eefc44d810a2502e", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 109, "... |
import unittest
import scipy.optimize as opt
import numpy as np
from parameterized import parameterized
from lab3.src.methods.simplex_method import simplex_method
simplex_method_testcases = [
(
np.array([[1, 2, -1, 2, 4],
[0, -1, 2, 1, 3],
[1, -3, 2, 2, 0]]),
np.... | {"hexsha": "568178dbecc05d78c401cdd45785ab72dee0642b", "size": 2856, "ext": "py", "lang": "Python", "max_stars_repo_path": "lab3/test/test_simplex_method.py", "max_stars_repo_name": "pavponn/optimization-methods", "max_stars_repo_head_hexsha": "00db08c1b28a1ffad781fb918869247a4f2ab329", "max_stars_repo_licenses": ["MIT... |
[STATEMENT]
lemma cf_adj_eqI:
assumes "\<Phi> : \<FF> \<rightleftharpoons>\<^sub>C\<^sub>F \<GG> : \<CC> \<rightleftharpoons>\<rightleftharpoons>\<^sub>C\<^bsub>\<alpha>\<^esub> \<DD>"
and "\<Phi>' : \<FF>' \<rightleftharpoons>\<^sub>C\<^sub>F \<GG>' : \<CC>' \<rightleftharpoons>\<rightleftharpoons>\<^sub>C\<^bsu... | {"llama_tokens": 2272, "file": "CZH_Universal_Constructions_czh_ucategories_CZH_UCAT_Adjoints", "length": 18} |
(* Title: Jive Data and Store Model
Author: Norbert Schirmer <schirmer at informatik.tu-muenchen.de>, 2003
Maintainer: Nicole Rauch <rauch at informatik.uni-kl.de>
License: LGPL
*)
section \<open>Location\<close>
theory Location
imports AttributesIndep "../Isabelle/Value"
begin
text \<o... | {"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/JiveDataStoreModel/Isabelle_Store/Location.thy"} |
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
2/24/2021
This script takes outputs from a regional climate model (RCM) - e.g. MERRA,
MAR - for a particular site and puts that data into a pandas dataframe.
The output can be fed to RCMpkl_to_spin.py to generate a time series to force the CFM
YOU MAY HAVE TO EDIT THIS... | {"hexsha": "e0783995f34d1a18371acc0a213f57497d162465", "size": 15923, "ext": "py", "lang": "Python", "max_stars_repo_path": "CFM_main/siteClimate_from_RCM.py", "max_stars_repo_name": "UWGlaciology/CommunityFirnModel", "max_stars_repo_head_hexsha": "820f8b3cfd8355b0c3085058a51f7488cac17fbe", "max_stars_repo_licenses": [... |
#!/usr/bin/env python
"""About TUI window
2003-12-17 ROwen
2004-03-08 ROwen Expanded the text and made it center-justified.
Moved the code to a separate class.
Added test code.
2004-05-18 ROwen Stopped obtaining TUI model in addWindow; it was ignored.
T... | {"hexsha": "560e573a83b57b0eed6b06e84e17c6ec08b0dfd4", "size": 4778, "ext": "py", "lang": "Python", "max_stars_repo_path": "TUI/TUIMenu/AboutWindow.py", "max_stars_repo_name": "r-owen/TUI", "max_stars_repo_head_hexsha": "8f130368254161a2748167b7c8260cc24170c28c", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_... |
"""
Geothermal: Climate signal: What happens when assuming a climate change is
linear, when in fact it was abrupt?
"""
import numpy
from fatiando import logger, utils
from fatiando.geothermal import climsig
from fatiando.vis import mpl
log = logger.get()
log.info(logger.header())
log.info(__doc__)
# Generating synthe... | {"hexsha": "0b54bd8fec29eebcfaff6ab8925cb51f7ba50299", "size": 1482, "ext": "py", "lang": "Python", "max_stars_repo_path": "_static/cookbook/geothermal_climsig_wrong.py", "max_stars_repo_name": "fatiando/v0.1", "max_stars_repo_head_hexsha": "1ab9876b247c67834b8e1c874d5b1d86f82802e2", "max_stars_repo_licenses": ["BSD-3-... |
#include "hsm/details/has_action.h"
#include "hsm/details/state.h"
#include "hsm/details/traits.h"
#include "hsm/details/transition_table.h"
#include "hsm/front/transition_tuple.h"
#include <gtest/gtest.h>
#include <boost/hana.hpp>
using namespace ::testing;
namespace {
class TraitsTests : public Test {
};
struct ... | {"hexsha": "bb0664814771e960236ebc081c9407608d8b8d12", "size": 2487, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "test/unit/traits_tests.cpp", "max_stars_repo_name": "erikzenker/hsm", "max_stars_repo_head_hexsha": "02369b68b36faa2c3e101b66725b5e38f15250a8", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
# -*- coding: utf-8 -*-
"""
Created on Wed Feb 27 13:34:37 2019
With help from : https://pytorch.org/tutorials/beginner/data_loading_tutorial.html
https://github.com/pytorch/vision/blob/master/torchvision/datasets/folder.py
@author: abobashe
"""
import os
import numpy as np
import... | {"hexsha": "882806b3f7d30acc1edc5f2eb311dd4b6eb2c291", "size": 9456, "ext": "py", "lang": "Python", "max_stars_repo_path": "MonaLIA/data/image_dataset.py", "max_stars_repo_name": "Wimmics/MonaLIA", "max_stars_repo_head_hexsha": "448cbcf08ddcd837f63cd959a5b7f1ff393e60d3", "max_stars_repo_licenses": ["CC0-1.0"], "max_sta... |
'''
Copyright 2022 Airbus SAS
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
dis... | {"hexsha": "1830080ef159161b0af3b9031b1ef4874c55bb92", "size": 35947, "ext": "py", "lang": "Python", "max_stars_repo_path": "climateeconomics/tests/l1_test_gradient_macroeconomics_discipline.py", "max_stars_repo_name": "os-climate/witness-core", "max_stars_repo_head_hexsha": "3ef9a44d86804c5ad57deec3c9916348cb3bfbb8", ... |
## Standard Library Imports
## Library Imports
import numpy as np
from IPython.core import debugger
breakpoint = debugger.set_trace
## Local Imports
from .shared_constants import *
def gamma_tonemap(img, gamma = 1/2.2):
assert(gamma <= 1.0), "Gamma should be < 1"
assert(0.0 <= gamma), "Gamma should be non-ne... | {"hexsha": "dd54bf271549b23813482abdc07030db85d7e7ea", "size": 2671, "ext": "py", "lang": "Python", "max_stars_repo_path": "improc_ops.py", "max_stars_repo_name": "felipegb94/fgb_research_utils", "max_stars_repo_head_hexsha": "8328b9c65bf22d6e84df54106f9bd2d2029b6aa5", "max_stars_repo_licenses": ["MIT"], "max_stars_cou... |
# Data Management
import pandas
# External Interfaces
import glob
import kaggle
import os
from zipfile import ZipFile
# Evaluation
from sklearn.metrics import roc_auc_score
from sklearn.metrics import precision_score
from sklearn.metrics import recall_score
from sklearn.model_selection import train_test_split
# Proc... | {"hexsha": "a615a6bab95a3a8674d3e5748821fddd32c4391a", "size": 3200, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/retrieve.py", "max_stars_repo_name": "christian-westbrook/intrusion-detection", "max_stars_repo_head_hexsha": "7f7e8470327ead1cd122918452d1238a90361c75", "max_stars_repo_licenses": ["MIT"]... |
julia> horner2([-19,7,-4,6], 3)
128
| {"hexsha": "eaef6d16068e29d90459095ae36590fa86dab71f", "size": 36, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "lang/Julia/horners-rule-for-polynomial-evaluation-4.jl", "max_stars_repo_name": "ethansaxenian/RosettaDecode", "max_stars_repo_head_hexsha": "8ea1a42a5f792280b50193ad47545d14ee371fb7", "max_stars_rep... |
import MLJModelInterface
import Soss
function predict_particles(predictor::SossMLJPredictor, Xnew)
args = predictor.args
pars = Soss.particles(predictor.post)
pred = predictor.pred
transform = predictor.model.transform
dist = pred(merge(args, transform(Xnew), pars))
return Soss.particles(dist)
... | {"hexsha": "007e86167a8f3cf4a12ada4dacc48d91fb941ebe", "size": 646, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/particles.jl", "max_stars_repo_name": "cscherrer/SossMLJ.jl", "max_stars_repo_head_hexsha": "0baac3355802b8af2c682f98845d29de6e1f2901", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 19,... |
import sys
import numpy as np
import pandas as pd
from helicalc import helicalc_dir, helicalc_data
from helicalc.coil import CoilIntegrator
from helicalc.busbar import ArcIntegrator3D
from helicalc.geometry import read_solenoid_geom_combined
from helicalc.solenoid_geom_funcs import load_all_geoms
from helicalc.constant... | {"hexsha": "28d614aea2f3848647acab2b760ec98874d75257", "size": 2879, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/validation/DS1/compare_DS1_gen.py", "max_stars_repo_name": "FMS-Mu2e/helicalc", "max_stars_repo_head_hexsha": "557ab63696459807998a9ab44f92badd62e93a2a", "max_stars_repo_licenses": ["MIT"]... |
"popen_ex.py"
from subprocess import Popen
import os
from astropy.io import fits
flg = 1 # SDSS
nproc = 8
## ############################
# "Parallel"
if flg == 0:
print('Running BOSS!')
boss_cat_fil = os.environ.get('BOSSPATH')+'/DR10/BOSSLyaDR10_cat_v2.1.fits.gz'
bcat_hdu = fits.open(boss_cat_fil)
t... | {"hexsha": "e501a9162197d1da250216309955f9bf35dcc046", "size": 1042, "ext": "py", "lang": "Python", "max_stars_repo_path": "py/desisim/qso_template/run_qso_fits.py", "max_stars_repo_name": "HiramHerrera/desisim", "max_stars_repo_head_hexsha": "3ae76e4c921f72b71ff7522462740e904136f428", "max_stars_repo_licenses": ["BSD-... |
# -*- coding: utf-8 -*-
import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
from keras.datasets import imdb
from keras.datasets import reuters
from keras.datasets import mnist
from sklearn.datasets import load_digits
def vetorizar_sequencias(sequencias, dimensao = 10000):
re... | {"hexsha": "9fc68b77a211cef0efc220018d9534f0aec00330", "size": 2552, "ext": "py", "lang": "Python", "max_stars_repo_path": "BaseDados.py", "max_stars_repo_name": "brunnovicente/SKNN", "max_stars_repo_head_hexsha": "8a201cb3b24f1e725ba7077c82af11be3eb68398", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "... |
import ase.db
import warnings
import numpy
import matplotlib.pyplot as plt
from ase.data import covalent_radii
from scipy.stats import linregress
import os, os.path
from scipy.constants import pi, epsilon_0
db_file = "../../data/gpaw_data/c2db.db"
if not os.path.exists(db_file):
raise FileExistsError(("Please down... | {"hexsha": "4021a682840d514cbe93bee8dc67d0326a58b12d", "size": 1461, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/gpaw_analysis/alpha_opt_gap.py", "max_stars_repo_name": "lovaulonze/paper.2D_dielectric", "max_stars_repo_head_hexsha": "df6718840e74807a7ea3a969cd7d88bcbdac9284", "max_stars_repo_licenses": [... |
This editor can edit this entry and tell us a bit about themselves by clicking the Edit icon.
20100521 11:07:33 nbsp Welcome to the Wiki Howdy Mr. Knights, and welcome to the wiki! My names Evan, pleased to meet you! Thanks for adding the comment about WiFi at Giedt Hall, but also feel free to edit the entry and ... | {"hexsha": "ff9d4943a10b2fdcd1cf5f91ca6404ccf2959b7c", "size": 473, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "lab/davisWiki/saviorknights.f", "max_stars_repo_name": "voflo/Search", "max_stars_repo_head_hexsha": "55088b2fe6a9d6c90590f090542e0c0e3c188c7d", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
module GreekModule
σ(x) = 1 ./ (1 + exp.(-x))
logσ(x) = - log1p.(exp.(-x))
end
| {"hexsha": "e95db1dd8955d147e312371783e191edf9028fea", "size": 89, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "inst/examples/GreekModule.jl", "max_stars_repo_name": "bakaburg1/JuliaConnectoR", "max_stars_repo_head_hexsha": "d0b2d2ac974ddee52fb3bbe7fcc92c4eab7dc477", "max_stars_repo_licenses": ["MIT"], "max_st... |
from pathlib import Path
import os
import random
import math
import torch
import numpy as np
from torch.utils.data.dataset import Dataset
from torchaudio.sox_effects import apply_effects_file
from collections import Counter
from itertools import accumulate
import pdb
CLASSES = [1,2,3,4,5]
PERTURBATION={'speed': (la... | {"hexsha": "582329386c4dd7da861b7fece5ac07168b7a0733", "size": 7213, "ext": "py", "lang": "Python", "max_stars_repo_path": "s3prl/downstream/voiceMOS/dataset.py", "max_stars_repo_name": "RayTzeng/voiceMOS", "max_stars_repo_head_hexsha": "65ad6b4c8a9c572b5a69126a68e8c9886267e886", "max_stars_repo_licenses": ["Apache-2.0... |
#=
Copyright (c) 2015, Intel Corporation
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaime... | {"hexsha": "cb6196986957de0b7ed04b9e254d2536502edc4a", "size": 2417, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/correctness/liveness-test1.jl", "max_stars_repo_name": "IntelLabs/Sparso", "max_stars_repo_head_hexsha": "570e7a18a96045e490f4ebf27ea948592e0bfa0b", "max_stars_repo_licenses": ["BSD-3-Clause"]... |
#include <cstdlib>
#include <iostream>
#include <complex>
#include <type_traits>
#include <algorithm>
#include <boost/numeric/ublas/vector.hpp>
#include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/banded.hpp>
#include <boost/numeric/bindings/ublas/vector.hpp>
#include <boost/numeric/bindings/ublas/ba... | {"hexsha": "a6d8f122e52c9956af65e90f40a7311450aaf848", "size": 2858, "ext": "cc", "lang": "C++", "max_stars_repo_path": "examples/lapack/ptsv.cc", "max_stars_repo_name": "rabauke/numeric_bindings", "max_stars_repo_head_hexsha": "f4de93bd7a01a8b31c9367fad35c81d086768f99", "max_stars_repo_licenses": ["BSL-1.0"], "max_sta... |
//------------------------------------------------------------------------------
/*
Copyright (c) 2012, 2013 Ripple Labs Inc.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this ... | {"hexsha": "4fe91d6b0ace58d2acbecd989c6951e97ece11a0", "size": 15417, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "src/ripple/protocol/impl/STTx.cpp", "max_stars_repo_name": "ripplealpha/ripple-alpha-core", "max_stars_repo_head_hexsha": "509118209407d46ce29d2889b982b8999fb1eeaa", "max_stars_repo_licenses": ["BS... |
\documentclass[11pt]{report}
\usepackage[margin=2cm]{geometry}
\usepackage{graphicx}
\usepackage{float}
\usepackage{times}
\usepackage{url}
\newcommand{\Gap}{\texorpdfstring{\hfill}{}}
\newcommand{\Rec}{\texorpdfstring{{\small\emph{\color{blue}{\fbox{High Leverage}}}}}{}}
\newcommand{\HighRisk}{\texorpdfstring{{\small... | {"hexsha": "f6b2a6e28c7051cd4f231900a2abdcc818b3f1d0", "size": 8958, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "tacling_climate_change_source/sections/toolsIndividuals.tex", "max_stars_repo_name": "mirandrom/climatechange-ml", "max_stars_repo_head_hexsha": "2aa36c90f047ba7b10310c66df2ecfc0aa90e304", "max_star... |
import numpy as np
import nltk
import pandas as pd
from ast import literal_eval
from collections import Counter
def sampleFromDirichlet(alpha):
return np.random.dirichlet(alpha)
def sampleFromCategorical(theta):
# theta = theta / np.sum(theta)
return np.random.multinomial(1, theta).argmax()... | {"hexsha": "6cd4456b5b179c47022299336306a8ce21a85df5", "size": 8271, "ext": "py", "lang": "Python", "max_stars_repo_path": "STMD-hs.py", "max_stars_repo_name": "dedert/python_lda", "max_stars_repo_head_hexsha": "7ffb792ccee468c0d6afc41f38efd63c33fa59fe", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count": nul... |
#redirect University Village
| {"hexsha": "869400517b141f1981b212b2f55f8b75d2dc6de8", "size": 29, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "lab/davisWiki/Sterling_University_Vista.f", "max_stars_repo_name": "voflo/Search", "max_stars_repo_head_hexsha": "55088b2fe6a9d6c90590f090542e0c0e3c188c7d", "max_stars_repo_licenses": ["MIT"], "max_... |
import os
import sys
import time
import math
import torch
import torch.nn as nn
import torch.nn.init as init
from torch.utils.data import DataLoader
import torch.utils.data as Data
from torchvision import datasets,models,transforms
from torch.utils import data
from PIL import Image
import numpy as np
import torch
# 0,... | {"hexsha": "3a1eac95e9a0bac73825a9faffe9b03e96c2bd30", "size": 6912, "ext": "py", "lang": "Python", "max_stars_repo_path": "mutils.py", "max_stars_repo_name": "liuhantang/DeepFacade", "max_stars_repo_head_hexsha": "3751d01dee46cde5396d14b724dfd7f3f9499b66", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 15, "ma... |
\section{ITK Introduction}
\centeredlargetext{white}{black}{
ITK Introduction
}
\begin{frame}
\frametitle{ITK is a Templated Library}
You will typically do:
\begin{itemize}
\item Include headers
\pause
\item Pick pixel type
\pause
\item Pick image dimension
\pause
\item Instantiate image type
\pause
\item Instantiat... | {"hexsha": "142de0ac693545270deb37c660258fb8ffb00f57", "size": 12659, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "Documents/Tutorial/ITKIntroduction.tex", "max_stars_repo_name": "InsightSoftwareConsortium/ITK-OpenCV-Bridge-Tutorial", "max_stars_repo_head_hexsha": "0c47e0a06d61f21acd27ad4339ce0e42c8260a0c", "ma... |
import pandas as pd
import numpy as np
import re
import calendar
from datetime import datetime
from sklearn import linear_model
from sklearn.cluster import KMeans
from sklearn.decomposition import PCA
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from sklearn.prep... | {"hexsha": "158d383f78bf7aa66754b2705d3bb97e405f8a51", "size": 6592, "ext": "py", "lang": "Python", "max_stars_repo_path": "model/main.py", "max_stars_repo_name": "hydrogen1999/flask-admin-boilerplate", "max_stars_repo_head_hexsha": "0abf95ddfb48789764d3d06939eb9cbaf93a3149", "max_stars_repo_licenses": ["MIT"], "max_st... |
# pylint: disable=missing-docstring
import unittest
import numpy as np
import tensorflow as tf
from absl.testing import parameterized
from tf_encrypted.test import tf_execution_context
class TestExecutionContext(parameterized.TestCase):
@parameterized.parameters({"run_eagerly": True}, {"run_eagerly": False})
... | {"hexsha": "b20d6278367708a2554348cef9da19af4f43cec7", "size": 869, "ext": "py", "lang": "Python", "max_stars_repo_path": "primitives/tf_encrypted/test/execution_context_test.py", "max_stars_repo_name": "wqruan/tf-encrypted", "max_stars_repo_head_hexsha": "50ee4ae3ba76b7c1f70a90e18f875191adea0a07", "max_stars_repo_lice... |
import numpy as np
import torch
import os
import pandas as pd
import pickle
import json
import os.path as op
import re
import pathlib
def nparams(model):
return sum([p.numel() for p in model.parameters()])
def get_eval_idx(save_dir):
model_dir = op.join(save_dir, 'model_ckpt')
filenames = os.listdir(mo... | {"hexsha": "46e88833ca73bfbeef92b875035d55e8e1cdf653", "size": 8382, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/experiment/utils.py", "max_stars_repo_name": "flowersteam/spatio-temporal-language-transformers", "max_stars_repo_head_hexsha": "a33a9bc4748586ef08f9768de2aafd76de71823c", "max_stars_repo_lice... |
import torch
import torch.nn.functional as F
from torch.utils.data import DataLoader
import skimage.io
import argparse
import numpy as np
import time
import os
import cv2
import math
# from memory_profiler import profile
import nets
import dataloader
from dataloader import transforms
from utils import... | {"hexsha": "817dfb37e56e1910223a26eedf4c828011033a39", "size": 8689, "ext": "py", "lang": "Python", "max_stars_repo_path": "webcam_inference.py", "max_stars_repo_name": "jwpleow/aanet", "max_stars_repo_head_hexsha": "b83e7b11dfee117114ae7b35645b85e886d3d436", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count"... |
import numpy as np
import os
import tensorflow.contrib.keras as kr
import torch
# 读取词汇表
def read_vocab(vocab_dir):
with open(vocab_dir, 'r', encoding='utf-8', errors='ignore') as fp:
words = [_.strip() for _ in fp.readlines()]
word_to_id = dict(zip(words, range(len(words))))
return words, word_to_... | {"hexsha": "b2a213af9e2487fa822f6ae418fc4d112fa766f2", "size": 2391, "ext": "py", "lang": "Python", "max_stars_repo_path": "cnews_loader.py", "max_stars_repo_name": "RikkyLai/CNews", "max_stars_repo_head_hexsha": "ee8c3597d44c2f765a65a7e5bafa432b305feec5", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 2, "max_... |
[STATEMENT]
lemma OclOr_false2[simp]: "(Y or false) = Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. (Y or false) = Y
[PROOF STEP]
by(simp add: OclOr_def) | {"llama_tokens": 74, "file": "Featherweight_OCL_UML_Logic", "length": 1} |
# Imports
from ast import literal_eval as make_tuple
import configparser
import os
import time
from PIL import Image
import cv2
import imutils
import numpy as np
from encrypt_archive import p7zip
fn_config = 'biometric.cfg'
class FacialCamera:
def __init__(self, pn_output="./"):
"""
Initialize ... | {"hexsha": "8ecd2cc069c8df17bf4eafdadf92b91903ee2393", "size": 12168, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/camera.py", "max_stars_repo_name": "blakeflei/biometric_camera_signin", "max_stars_repo_head_hexsha": "e7c0c1e56d9193bf6bfc9bd9141a1bf4960f305e", "max_stars_repo_licenses": ["BSD-3-Clause"], ... |
import random, os
import argparse
import numpy as np
import torch
import torch.optim as optim
import torch.nn.functional as F
from tqdm import tqdm
from torch.autograd import Variable
from transformers import *
from models import inference_model
from data_loader import DataLoader
from torch.nn import NLLLoss
import lo... | {"hexsha": "f4b5c7cfdf2a0907b6205d4257a618328be1d86d", "size": 4083, "ext": "py", "lang": "Python", "max_stars_repo_path": "model/test_src.py", "max_stars_repo_name": "andreaschari/VERNet", "max_stars_repo_head_hexsha": "e148ad1b0314d77838f5d0035aa946f01597b037", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 3... |
#!/usr/bin/python3
"""
Generates plots from flow records and fitted models (requires `pandas` and `scipy`).
"""
import argparse
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
from .lib.data import UNITS, LINE_NBINS, load_data
from .lib.plot import plot_pdf, plot_cdf, plo... | {"hexsha": "a59f5babbb335d7613fe164366a75b4c24aee343", "size": 4264, "ext": "py", "lang": "Python", "max_stars_repo_path": "flow_models/plot.py", "max_stars_repo_name": "piotrjurkiewicz/flow_stats", "max_stars_repo_head_hexsha": "cc97a8381275cb9dd23ed0c3432abffaf4198431", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
[STATEMENT]
lemma module_pair_with_imp_module_with[explicit_ab_group_add]:
"module_on_with S (+) (-) uminus 0 s"
"module_on_with T (+) (-) uminus 0 t"
if "module_pair_on_with S T (+) (-) uminus 0 s (+) (-) uminus 0 t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. module_on_with S (+) (-) uminus (0::'a) s &&& ... | {"llama_tokens": 422, "file": null, "length": 3} |
import numpy as np
import pandas as pd
from datetime import datetime, timedelta
BUFFER_MAX = 700
BASE_SIZE = 500
class DataBuffer(object):
def __init__(self, market, timeframe):
self.market = market
self.timeframe = timeframe
self.buffer = []
self.last_time = None
def... | {"hexsha": "867192044fda9cb55afd551c2708e4dffa36f597", "size": 2791, "ext": "py", "lang": "Python", "max_stars_repo_path": "common/DataBuffer.py", "max_stars_repo_name": "Aquaware/MarketAlertWithXM", "max_stars_repo_head_hexsha": "6cfbc26f7b32880ff9a6911599b4a9614345e505", "max_stars_repo_licenses": ["MIT"], "max_stars... |
# -*- coding: utf-8 -*-
""" This module contains a local planner to perform
low-level waypoint following based on PID controllers. """
# Author: Runsheng Xu <rxx3386@ucla.edu>
# License: MIT
from collections import deque
from enum import Enum
import statistics
import math
import carla
import numpy as np
from opencd... | {"hexsha": "49597fcebc57d475af73fd0f984eb036b05548a5", "size": 17603, "ext": "py", "lang": "Python", "max_stars_repo_path": "opencda/core/plan/local_planner_behavior.py", "max_stars_repo_name": "xiaxin2000/OpenCDA-Documents", "max_stars_repo_head_hexsha": "1ad4b368d4287dae8b282bac1665816a496d57c6", "max_stars_repo_lice... |
import numpy as np
import tensorflow as tf
import json
import baseline
import os
from tensorflow.python.framework.errors_impl import NotFoundError
import mead.utils
import mead.exporters
from mead.tf.signatures import SignatureInput, SignatureOutput
from mead.tf.preprocessor import PreprocessorCreator
from baseline.uti... | {"hexsha": "6b4826fff05aa867f151452b38c5ce2afe074923", "size": 19452, "ext": "py", "lang": "Python", "max_stars_repo_path": "python/mead/tf/exporters.py", "max_stars_repo_name": "bjayakumar/test_vendor", "max_stars_repo_head_hexsha": "e32c1a69754cedcec46d3e76e43a72743ebb8ed8", "max_stars_repo_licenses": ["Apache-2.0"],... |
"""
Problem Statement
inner
The inner tool returns the inner product of two arrays.
import numpy
A = numpy.array([0, 1])
B = numpy.array([3, 4])
print numpy.inner(A, B) #Output : 4
outer
The outer tool returns the outer product of two arrays.
import numpy
A = numpy.array([0, 1])
B = numpy.array([3, 4])
pri... | {"hexsha": "b0e2868ee66f4586e914506dedfe5dbc7ad247c4", "size": 981, "ext": "py", "lang": "Python", "max_stars_repo_path": "hackerrank/domain/python/numpy/inner_outer.py", "max_stars_repo_name": "spradeepv/dive-into-python", "max_stars_repo_head_hexsha": "ec27d4686b7b007d21f9ba4f85d042be31ee2639", "max_stars_repo_licens... |
import torch
from torch.utils.data import DataLoader
import os.path as osp
import cv2
import numpy as np
import albumentations as A
from albumentations.pytorch import ToTensorV2
from typing import List, Optional, Callable, List, Any
from torch.utils.data.dataset import Dataset
from .eyepacs import data_transformation
... | {"hexsha": "9eeeb9c1ffe0a9a2d682268edca5b0fc102fa6c7", "size": 2418, "ext": "py", "lang": "Python", "max_stars_repo_path": "retinal/data/diagnos.py", "max_stars_repo_name": "by-liu/RetinalApp", "max_stars_repo_head_hexsha": "53173b2b20dfcf613a3a22d6caa5178771d14225", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
#!/bin/env python3.5
#Author: Saurabh Pathak (phoenix)
import matplotlib.pyplot as pl, sys, math as m
from decimal import Decimal
from numpy import *
from numpy.linalg import inv,det
tSRiver = tSLand = None
class Sampler:
'''handles sampling and contains the mouse click handler'''
def __init__(self, maxcount... | {"hexsha": "57f65a49c712b9b0bbbf49f1bc5ed554180f8719", "size": 3627, "ext": "py", "lang": "Python", "max_stars_repo_path": "ai_ml_projects/masters_courses/machine_learning/bayesian/bayesian.py", "max_stars_repo_name": "5aurabhpathak/src", "max_stars_repo_head_hexsha": "dda72beba2aaae67542a2f10e89048e86d04cb28", "max_st... |
% These lines are necessary to adjust the spacing of the heading
\titleformat{\chapter}[hang]{\huge\bfseries}{\thechapter}{1em}{}
\titlespacing{\chapter}{0pt}{0pt}{1cm}
\chapter{Acknowledgments}
Thank your professors, colleagues, funding agencies, friends, and family. Usually,
people sign out by specifying the date a... | {"hexsha": "20d47498813654a62769788ced142b104f825e18", "size": 378, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "source/chapters/acknowledgements/acknowledgements.tex", "max_stars_repo_name": "ibrsam/matsci-thesis", "max_stars_repo_head_hexsha": "270b9917a398ae4004e35be1bba6a9c9800fd12f", "max_stars_repo_licens... |
# This file is part of the Astrometry.net suite.
# Licensed under a 3-clause BSD style license - see LICENSE
from __future__ import print_function
import matplotlib
matplotlib.use('Agg')
import pylab as plt
import sys
from astrometry.sdss.dr8 import *
import numpy as np
def test_astrans(sdss, r,c,f,b):
bandnum = ... | {"hexsha": "813abd5597f5078bf564dca9f6eb8c20584ae4e1", "size": 2525, "ext": "py", "lang": "Python", "max_stars_repo_path": "sdss/test_dr8.py", "max_stars_repo_name": "juandesant/astrometry.net", "max_stars_repo_head_hexsha": "47849f0443b890c4a875360f881d2e60d1cba630", "max_stars_repo_licenses": ["Net-SNMP", "Xnet"], "m... |
[STATEMENT]
lemma test_compl_1 [simp]: "is_test x \<Longrightarrow> x + tc x = 1'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. is_test x \<Longrightarrow> x + tc x = 1'
[PROOF STEP]
by (metis is_test_def local.aux4 local.inf.absorb_iff1 local.inf_commute tc_def) | {"llama_tokens": 114, "file": "Relation_Algebra_Relation_Algebra_Tests", "length": 1} |
"""
ゼロから学ぶスパイキングニューラルネットワーク
- Spiking Neural Networks from Scratch
Copyright (c) 2020 HiroshiARAKI. All Rights Reserved.
"""
import numpy as np
import matplotlib.pyplot as plt
if __name__ == '__main__':
time = 300
dt = 0.5
# Spike Traceを適当に作る
spikes = np.zeros(int(time/dt))
# 5本適当にスパイクを立てる
... | {"hexsha": "55fe204f56429307ad0535d33f2bdc461fdcf13d", "size": 906, "ext": "py", "lang": "Python", "max_stars_repo_path": "codes/s5-1-2_Trace.py", "max_stars_repo_name": "HiroshiARAKI/snn_from_scratch", "max_stars_repo_head_hexsha": "e26e7ce2bbebaa35ad3e325c09f05c334d753049", "max_stars_repo_licenses": ["MIT"], "max_st... |
import json
import numpy as np
from sklearn.linear_model import LinearRegression
trainData = json.load(open("train_data.json", "r"))
trainInput = list()
trainOutput = list()
for row in trainData:
trainInput.append(row['date'])
trainOutput.append(row['sea_level'])
ti = np.array(trainInput)
ti.reshape(-1, 1... | {"hexsha": "6520e05e17de35daf4f9806387be925e5881da8f", "size": 409, "ext": "py", "lang": "Python", "max_stars_repo_path": "ml.py", "max_stars_repo_name": "Virmak/IOSea", "max_stars_repo_head_hexsha": "1ecbd5df7119a2dcd89bb97834f6c2fac6a55f8d", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_stars_repo... |
"""
Some device functions for doing complex scalar maths with :mod:`numba.cuda`.
"""
import math
import numpy as np
import numba as nb
from numba import cuda
#@cuda.jit(device = True, inline = True)
def conj(z):
"""
Conjugate of a complex number.
.. math::
\\begin{align*}
(a + ib)^* &= a ... | {"hexsha": "ef1cdc3d48f24b9392632477427c296ba2013161", "size": 1144, "ext": "py", "lang": "Python", "max_stars_repo_path": "spinsim/utilities_old/scalar.py", "max_stars_repo_name": "rpanderson/spinsim", "max_stars_repo_head_hexsha": "8f93b7dd1964290e2cc85ae1c15e73ca31a34bdc", "max_stars_repo_licenses": ["BSD-3-Clause"]... |
#!/usr/bin/env python
# coding: utf-8
# In[1]:
import os, sys, gc
import time
import glob
import pickle
import copy
import json
import random
from collections import OrderedDict, namedtuple
import multiprocessing
import threading
import traceback
from typing import Tuple, List
import h5py
from tqdm import tqdm, tq... | {"hexsha": "16621515f19326c432b80a74ed7077283fe12327", "size": 6839, "ext": "py", "lang": "Python", "max_stars_repo_path": "phase2_scripts/model_inference.py", "max_stars_repo_name": "socom20/facebook-image-similarity-challenge-2021", "max_stars_repo_head_hexsha": "bf4226241be30cdf99180543f214edf571043e8d", "max_stars_... |
#include <string>
#include <vector>
#include <memory>
#include <map>
#include <iostream>
#include <fstream>
#include <boost/filesystem.hpp>
#include <yaml-cpp/yaml.h>
#include "cantera/base/stringUtils.h"
#include "cantera/base/ct_defs.h"
//#include "cantera/IdealGasMix.h"
//#include "cantera/InterfaceLatInt.h"
//#in... | {"hexsha": "1bb9142e82231c6c8f77cee1459e1aab2d976898", "size": 14050, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "src/onedReactor.cpp", "max_stars_repo_name": "skasiraj/openmkm", "max_stars_repo_head_hexsha": "ec910ba78f6510647bfe1a2e5e0d7a68a63c0261", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 3.0... |
#!-*-coding:utf-8-*-
import numpy as np
import cv2
#相机的行列数
cols = 640
rows = 480
# 获得相应的帧图像
def getDataset():
cap = cv2.VideoCapture('./test.mp4')
cap.set(cv2.CAP_PROP_FRAME_WIDTH, cols)
cap.set(cv2.CAP_PROP_FRAME_HEIGHT, rows)
i = 0
while(cap.isOpened()):
ret,frame = cap.read()
cv... | {"hexsha": "0dacd6697fe04362621538d831435376f1a7f9e6", "size": 1315, "ext": "py", "lang": "Python", "max_stars_repo_path": "calibration_bev_fitcurve-1/get_dataset.py", "max_stars_repo_name": "GuoPingPan/LinearTracking_Huawei", "max_stars_repo_head_hexsha": "499e16448081421766df66614551750c1cb71a1d", "max_stars_repo_lic... |
# EPA_GHGI.py (flowsa)
# !/usr/bin/env python3
# coding=utf-8
"""
Inventory of US EPA GHG
https://www.epa.gov/ghgemissions/inventory-us-greenhouse-gas-emissions-and-sinks-1990-2018
"""
import io
import zipfile
import numpy as np
import pandas as pd
from flowsa.flowbyfunctions import assign_fips_location_system
DEFAUL... | {"hexsha": "d7628ee5699c4dbf2ccc54c92fe4ce4a86960059", "size": 23157, "ext": "py", "lang": "Python", "max_stars_repo_path": "flowsa/data_source_scripts/EPA_GHGI.py", "max_stars_repo_name": "JohnAndrewTaylor/flowsa", "max_stars_repo_head_hexsha": "21b14b19f08370db574bdd59219a2773983c6f95", "max_stars_repo_licenses": ["C... |
import dill
import numpy as np
from typing import *
from abc import abstractmethod
from abc import ABCMeta
from cftool.misc import register_core
from cftool.misc import shallow_copy_dict
from ..misc import DataStructure
processor_dict: Dict[str, Type["Processor"]] = {}
class Processor(DataStructure, metaclass=AB... | {"hexsha": "3ee206152e6020a8f51281157ca4082ecc3d0846", "size": 3717, "ext": "py", "lang": "Python", "max_stars_repo_path": "cfdata/tabular/processors/base.py", "max_stars_repo_name": "carefree0910/carefree-data", "max_stars_repo_head_hexsha": "ae0f4ea5724b4efd5d76f2a9d420acf3322c1d19", "max_stars_repo_licenses": ["MIT"... |
from __future__ import annotations
import logging
from math import floor, sqrt
import numpy as np
from numpy.linalg import inv, norm
from cctbx.array_family import flex
from dxtbx import flumpy
from scitbx import matrix
from dials.algorithms.profile_model.ellipsoid import chisq_quantile
from dials.algorithms.statis... | {"hexsha": "3fd568a09fc928d6ddc1ebbe27bdae27214f7acd", "size": 7181, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/dials/algorithms/profile_model/ellipsoid/indexer.py", "max_stars_repo_name": "dials-src/dials", "max_stars_repo_head_hexsha": "25055c1f6164dc33e672e7c5c6a9c5a35e870660", "max_stars_repo_licens... |
import base64
import json
import posixpath
import nbformat
import numpy
import tiledb
import tiledb.cloud
import tornado.web
import traitlets
from notebook.services.contents import checkpoints
from notebook.services.contents import filecheckpoints
from notebook.services.contents import filemanager
from notebook.servic... | {"hexsha": "33b9b26cadbaa18bb6fdbf0f666d4d77e2f50bbf", "size": 23572, "ext": "py", "lang": "Python", "max_stars_repo_path": "tiledbcontents/tiledbcontents.py", "max_stars_repo_name": "TileDB-Inc/TileDB-Cloud-Jupyter-Contents", "max_stars_repo_head_hexsha": "4161772f27befd2ad27c76297266f38794abc3b4", "max_stars_repo_lic... |
import ctypes
import os
import platform
import cv2
import json
import math
import numpy as np
dir_path = os.path.dirname(os.path.realpath(__file__))
if platform.system() == "Windows":
path = os.path.join(dir_path, "moildev.dll")
shared_lib_path = path
else:
path = os.path.join(dir_path, "moild... | {"hexsha": "d5ee7168bfa76e1781d3fa04d2b1b90f41821bf4", "size": 22880, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/Moildev/Moildev.py", "max_stars_repo_name": "aji-ptn/MoilApp", "max_stars_repo_head_hexsha": "9742a28074add23fda1afa534f25a1b8bea68c93", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from pandas_datareader import data
import pymc3 as pm
np.random.seed(0)
def main():
#load data
returns = data.get_data_google('SPY', start='2008-5-1', end='2009-12-1')['Close'].pct_change()
returns.plot()
plt.ylabel('daily r... | {"hexsha": "5c0d92c128205870ee5175ad61eeb6f6c537ab1b", "size": 1021, "ext": "py", "lang": "Python", "max_stars_repo_path": "stochastic_volatility.py", "max_stars_repo_name": "vsmolyakov/fin", "max_stars_repo_head_hexsha": "901f3c5a9a17e65913fa5a00fc5bf7c3b9de6a5d", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
# Gamma is a discrete RandomVariable that represents
# the instantaneous values of a model parameter
# to be embedded into continuous space
# parameters:
#
# stencil : list of values that the parameter takes
# alphas: probabilities of taking each value.
# For example, stencil = [2, 3] and alphas=[0.2, 0.8]
# means th... | {"hexsha": "1a3f02f06051179e57c0a6fe730b8ce2e37bc952", "size": 1191, "ext": "py", "lang": "Python", "max_stars_repo_path": "2_SimPy_models/Gamma.py", "max_stars_repo_name": "NehaKaranjkar/Embedding", "max_stars_repo_head_hexsha": "0f6ed608819cdf680a8db9beae939bf8617797a9", "max_stars_repo_licenses": ["MIT"], "max_stars... |
from __future__ import print_function
import sys
import argparse
import os
import torch
import time
import imp
import numpy as np
import datetime
from torch import nn, optim
from PIL import Image
from torch.nn import functional as F
from torch.utils.data import DataLoader
from utils.AverageMeter import Av... | {"hexsha": "b86530274286fdeb11de7532ca7db529d5d4fbb4", "size": 7025, "ext": "py", "lang": "Python", "max_stars_repo_path": "code/model_1_main.py", "max_stars_repo_name": "zzz1515151/TianChi-JingWei-Competation-Round1", "max_stars_repo_head_hexsha": "82b26a4cd0e7a6e3c0264c9dbd0100326f9727ad", "max_stars_repo_licenses": ... |
##~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~##
## ##
## This file forms part of the Badlands surface processes modelling companion. ##
## ... | {"hexsha": "6858f80339a4f3d81cac710176f9180bb9b713f4", "size": 26546, "ext": "py", "lang": "Python", "max_stars_repo_path": "Examples/mountain/morphoGrid.py", "max_stars_repo_name": "intelligentEarth/surrogateBayeslands", "max_stars_repo_head_hexsha": "24462cafed05ac0c377865d8fe039cafa0aa59d4", "max_stars_repo_licenses... |
using TensorFlowBuilder
using Base.Test
include("test_apigen.jl")
| {"hexsha": "26f2fee83184899d7e24e86b747590cb67f13891", "size": 67, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/runtests.jl", "max_stars_repo_name": "benmoran/TensorFlowBuilder.jl", "max_stars_repo_head_hexsha": "fbe31778f65e7ac45319b9a53d1cbd4afdc7c7ab", "max_stars_repo_licenses": ["Apache-2.0"], "max_st... |
module Braking
export dist, speed
const EARTH_GRAVITY = 9.81
function dist(v::Number, μ::Number)::Real
# convert from km/h to m/s
v /= 3.6
# Reaction time: 1
v + v^2/2/μ/EARTH_GRAVITY
end
# Reaction time: 1
function speed(d::Number, μ::Number)::Real
... | {"hexsha": "e1f4ae1f94f6bee889128498ec75110edae646e0", "size": 440, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "6_kyu/Braking_well.jl", "max_stars_repo_name": "UlrichBerntien/Codewars-Katas", "max_stars_repo_head_hexsha": "bbd025e67aa352d313564d3862db19fffa39f552", "max_stars_repo_licenses": ["MIT"], "max_sta... |
import cv2
import numpy as np
###pip install cutil
from cutils.cv.bwutils import remove_spirious_blobs, fill_hole
def gen_thickness_map(segmap, layer_index, axial_resolution=255, exclude_disc=True, pvars=None, pvar_thresh=None):
"""
:param segmap: segmentation map
:param layer_index: index of layer of w... | {"hexsha": "489c1156d93a6da70febd2d49d0e4426c44e9bd7", "size": 3363, "ext": "py", "lang": "Python", "max_stars_repo_path": "python_code/thickness_maps.py", "max_stars_repo_name": "IBM/oct-glaucoma-vf-estimate", "max_stars_repo_head_hexsha": "ea79352547f33fe05ee532ab9faad6a5e4811a76", "max_stars_repo_licenses": ["Apache... |
# -*- coding: UTF-8 -*-
# ask_yes_no.py
from EmotionDetection import TrainOption
from EmotionDetection import TestOption
from EmotionDetection import WordFilter
from EmotionDetection import EvaluateText
from math import log10
from Tkinter import *
try:
import Tkinter as tk
import tkMessageBox, tkFileDialog, ... | {"hexsha": "144be0a1ba4a265df79f2fdebb9d304e95c69037", "size": 10545, "ext": "py", "lang": "Python", "max_stars_repo_path": "EmotionDetectionGUI.py", "max_stars_repo_name": "emotion-detection-analysis/Emotion-detection", "max_stars_repo_head_hexsha": "e21ec0817ff86d8ce8d58534053aff6d731407c0", "max_stars_repo_licenses"... |
#
# Copyright (c) 2017 Intel Corporation
# SPDX-License-Identifier: BSD-2-Clause
#
from numba import njit
import numpy as np
from math import sqrt
import argparse
import time
@njit
def kmeans(A, numCenter, numIter, N, D, init_centroids):
centroids = init_centroids
for l in range(numIter):
dist = np.a... | {"hexsha": "b4c22cd9d5af2a940fe3e368d509ae64375ab401", "size": 1662, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/k-means/k-means_numba.py", "max_stars_repo_name": "uw-ipd/numba", "max_stars_repo_head_hexsha": "26dde2b28cadda403a5549a84dc1698900b23f74", "max_stars_repo_licenses": ["BSD-2-Clause"], "m... |
/**
* (c) Author: Woongkyu Jee, woong.jee.16@ucl.ac.uk, wldndrb1@gmail.com
* Created: 02.06.2019 ~
*
* University College London, Department of Chemistry
**/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <gsl/gsl_eigen.h>
#include <gsl/gsl_matrix.h>
#include <gsl/gsl_math.h>
#include <... | {"hexsha": "f860481510256732fa35f546e67ba1a996d7642b", "size": 28009, "ext": "c", "lang": "C", "max_stars_repo_path": "src/sp_cluster_support.c", "max_stars_repo_name": "sweetmixture/SLAM_2.2.1_snapshot", "max_stars_repo_head_hexsha": "60335c37ce75b82f6589c67f3a1c1be37decfd71", "max_stars_repo_licenses": ["MIT"], "max_... |
/*
* Author: Johannes M Dieterich
*/
#ifndef CARTESIANGRID_HPP
#define CARTESIANGRID_HPP
#include <armadillo>
#include <cmath>
#include <memory>
#include <complex.h>
#include <tgmath.h>
#include "BasicGridComputer.hpp"
#include "FourierGrid.hpp"
#include "GVectorBuilder.hpp"
using namespace std;
using namespace ar... | {"hexsha": "64b8e11feae802851f6615a98352b5c1b1e3fc90", "size": 12185, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "include/CartesianGrid.hpp", "max_stars_repo_name": "EACcodes/libKEDF", "max_stars_repo_head_hexsha": "3dff53318ce7be52be5f45242ea8daf08a032866", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_st... |
"""
This is the script that is used for the implementation of HoloNet. The class HoloNet(nn.module) is
described in the following.
This code and data is released under the Creative Commons Attribution-NonCommercial 4.0 International license (CC BY-NC.) In a nutshell:
# The license is only for non-commercial use (... | {"hexsha": "8ea528d7f7008a6149a2600d5c7244bc2f25abf3", "size": 12940, "ext": "py", "lang": "Python", "max_stars_repo_path": "holonet.py", "max_stars_repo_name": "Ter-hash/holography_test", "max_stars_repo_head_hexsha": "372e5192cd1355cb565159f2a96fd2f7370095ce", "max_stars_repo_licenses": ["CC-BY-3.0"], "max_stars_coun... |
<h1>Table of Contents<span class="tocSkip"></span></h1>
<div class="toc"><ul class="toc-item"><li><span><a href="#Warming-up" data-toc-modified-id="Warming-up-1"><span class="toc-item-num">1 </span>Warming-up</a></span><ul class="toc-item"><li><span><a href="#Point-Estimate" data-toc-modified-id="Point-Estim... | {"hexsha": "cab3802fffb1fe6b12c89367334e401d8af81615", "size": 888138, "ext": "ipynb", "lang": "Jupyter Notebook", "max_stars_repo_path": "ab_tests/frequentist_ab_test.ipynb", "max_stars_repo_name": "anhnongdan/machine_learning", "max_stars_repo_head_hexsha": "ad247554026b53f285ea96491c4834c8f3057435", "max_stars_repo_... |
function [m, ssmp] = cellmean(x, dim)
% [M] = CELLMEAN(X, DIM) computes the mean, across all cells in x along
% the dimension dim.
%
% X should be an linear cell-array of matrices for which the size in at
% least one of the dimensions should be the same for all cells
nx = size(x);
if ~iscell(x) || length(nx)>2 ||... | {"author": "fieldtrip", "repo": "fieldtrip", "sha": "c2039be598a02d86b39aae76bfa7aaa720f9801c", "save_path": "github-repos/MATLAB/fieldtrip-fieldtrip", "path": "github-repos/MATLAB/fieldtrip-fieldtrip/fieldtrip-c2039be598a02d86b39aae76bfa7aaa720f9801c/external/cellfunction/cellmean.m"} |
using Statistics, SpecialFunctions
"""
tnmom2(a, b)
Second moment of the truncated standard normal distribution.
"""
function tnmom2(a::Real, b::Real)
#return tnmom2c(0, a, b)
if !(a ≤ b)
return oftype(middle(a, b), NaN)
elseif a == b
return middle(a, b)^2
elseif abs(a) > abs(b)
... | {"hexsha": "f68e77c5164de0c61f044b41dbd62789b2dbff29", "size": 2535, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/tnmom2.jl", "max_stars_repo_name": "suzannastep/TruncatedNormal.jl", "max_stars_repo_head_hexsha": "3c16866c3afa3920e787513d492689e9e81192ca", "max_stars_repo_licenses": ["MIT"], "max_stars_cou... |
# # Training interface
| {"hexsha": "c826d4c1a6ee24929d17bf321df0493ac40789eb", "size": 23, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/training.jl", "max_stars_repo_name": "lorenzoh/DeepLearningTasks.jl", "max_stars_repo_head_hexsha": "9bf0eb19c1bc5dbefa8cefe9266eee03d2bfa8c4", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
'''
Features for the phasephase motiontracker
'''
import time
import tempfile
import random
import traceback
import numpy as np
import fnmatch
import os
from riglib import calibrations
import os
import subprocess
import time
from riglib.experiment import traits
#####################################################... | {"hexsha": "42949b1c9449129df93d9333f00b612a08905a7f", "size": 3991, "ext": "py", "lang": "Python", "max_stars_repo_path": "features/phasespace_features.py", "max_stars_repo_name": "sgowda/brain-python-interface", "max_stars_repo_head_hexsha": "708e2a5229d0496a8ce9de32bda66f0925d366d9", "max_stars_repo_licenses": ["Apa... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.