text
stringlengths
0
27.1M
meta
dict
# import aei import gdal import pickle import numpy as np import pandas as pd import matplotlib.pyplot as plt %matplotlib tk # set the working directories base = '/home/cba/Downloads/scale-conceptual/' plots = base + 'plots/' tch_file = base + 'marin_tch_byte.tif' gd_file = base + 'marin_tch_mask.tif' rnd_data = bas...
{ "alphanum_fraction": 0.6294256491, "author": null, "avg_line_length": 33.4473684211, "converted": null, "ext": "py", "file": null, "hexsha": "f42ecba628c1621be6f014aa7951f72152e9670d", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import pandas as pd import numpy as np #https://iq-inc.com/importerror-attempted-relative-import/ import data.data_retrieve as dr import features.data_preprocessing as pp import models.train_model as tm import models.train_model_FTR as tmFTR #could make it object oriented so that different models can be different o...
{ "alphanum_fraction": 0.7020884521, "author": null, "avg_line_length": 33.2244897959, "converted": null, "ext": "py", "file": null, "hexsha": "3fd22b434f4f7aa3afeef1945640e691b4f570aa", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
""" Provides a subclass to DSNFITSexaminer for plotting data. Possible symbols:: ================ =============================== character description ================ =============================== ``'o'`` circle marker ``'v'`` triangle_down marker ``'...
{ "alphanum_fraction": 0.5367081632, "author": null, "avg_line_length": 40.4488348531, "converted": null, "ext": "py", "file": null, "hexsha": "6facd4eefdba2e2ac4c0df75b4116e52909233dd", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import argparse import os import pandas as pd import imagesize import nltk from nltk.corpus import wordnet as wn import numpy as np import re from ..create.scads_classes import Node, Image, Clip from ..create.create_scads import add_conceptnet from ..create.add_datasets import add_dataset from .wnids_to_concept import...
{ "alphanum_fraction": 0.5398881218, "author": null, "avg_line_length": 42.5815450644, "converted": null, "ext": "py", "file": null, "hexsha": "7e161ca862e61e36df6c1b3e4d05470e87a9edb5", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import csv import numpy as np import cv2 def read_data(file_path,header=True,delimiter=','): # The read-in data should be a N*W matrix, # where N is the length of the time sequences, # W is the number of sensors/data features i = 0 with open(file_path, 'r') as file: reader = csv.reader(file...
{ "alphanum_fraction": 0.4574383453, "author": null, "avg_line_length": 34.4383561644, "converted": null, "ext": "py", "file": null, "hexsha": "0081ce0f5a205f67c9645abccd2a6851af09777a", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
\section{EDA Figures} \begin{figure}[!h] \begin{minipage}{.45\textwidth} \caption{Date of birth frequency.} \label{fig:birth_date_freq} \centering \scalebox{0.5}{\input{./img/birth_date_freq.pgf}} % \includegraphics[width=10]{./img/birth_date_freq.pgf} \end{minipage} %\end{figure} %\begin{figure}[!h...
{ "alphanum_fraction": 0.634525661, "author": null, "avg_line_length": 29.2272727273, "converted": null, "ext": "tex", "file": null, "hexsha": "7578443ac5fa1d95d18d3905f5dfb926aa84a540", "include": null, "lang": "TeX", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_...
import random import numpy as np import geomstats.backend as gs import geomstats.tests from geomstats.geometry.poincare_half_space import PoincareHalfSpace from tests.data_generation import _OpenSetTestData, _RiemannianMetricTestData class PoincareHalfSpaceTestData(_OpenSetTestData): dim_list = random.sample(ra...
{ "alphanum_fraction": 0.5928700594, "author": null, "avg_line_length": 33.18, "converted": null, "ext": "py", "file": null, "hexsha": "540e863defc5ae7b6956a8d726f17b832b4c3c3f", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_count...
[STATEMENT] lemma naturality_hom_induced: assumes "continuous_map X Y f" "f ` S \<subseteq> T" shows "hom_boundary q Y T \<circ> hom_induced q X S Y T f = hom_induced (q - 1) (subtopology X S) {} (subtopology Y T) {} f \<circ> hom_boundary q X S" [PROOF STATE] proof (prove) goal (1 subgoal): 1. hom_boundary...
{ "alphanum_fraction": null, "author": null, "avg_line_length": null, "converted": null, "ext": null, "file": null, "hexsha": null, "include": null, "lang": null, "length": 48, "llama_tokens": 6985, "mathlib_filename": null, "max_forks_count": null, "max_forks_repo_forks_event_max_datetime":...
import datetime import logging import sys from pytorch_lightning.core import datamodule from torch.utils import data #cd /home/dcast/adversarial_project ; /usr/bin/env /home/dcast/anaconda3/envs/deep_learning_torch/bin/python -- /home/dcast/adversarial_project/irt_to_nlp/train.py # sys.path.append("/content/adversari...
{ "alphanum_fraction": 0.539257981, "author": null, "avg_line_length": 37.6298701299, "converted": null, "ext": "py", "file": null, "hexsha": "52171e245698182223244a2290fe4a266c17a6f7", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
[STATEMENT] lemma OrdP_linear_lemma: assumes j: "atom j \<sharp> i" shows "{ OrdP (Var i) } \<turnstile> All j (OrdP (Var j) IMP (Var i IN Var j OR Var i EQ Var j OR Var j IN Var i))" (is "_ \<turnstile> ?scheme") [PROOF STATE] proof (prove) goal (1 subgoal): 1. {OrdP (Var i)} \<turnstile> SyntaxN.All j (...
{ "alphanum_fraction": null, "author": null, "avg_line_length": null, "converted": null, "ext": null, "file": "Incompleteness_Predicates", "hexsha": null, "include": null, "lang": null, "length": 38, "llama_tokens": 9154, "mathlib_filename": null, "max_forks_count": null, "max_forks_repo_for...
# Problem: https://projecteuler.net/problem=367 # To run the code: `./problem367.sh` """ * Define notations as follows: . let e(i) represent the element at position i of a permutation . a permutation p of n elements is represented as follows p = [e(1) e(2) e(3) ... e(n)] ...
{ "alphanum_fraction": 0.621148632, "author": null, "avg_line_length": 37.2201834862, "converted": null, "ext": "py", "file": null, "hexsha": "283e73b0ce691c24c813b7de22fb52a1f8e34669", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
/- Copyright (c) 2018 Johannes Hölzl. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Johannes Hölzl, Jens Wagemaker -/ import algebra.big_operators.basic import algebra.divisibility import algebra.invertible /-! # Associated, prime, and irreducible elements. -/ varia...
{ "alphanum_fraction": null, "author": "jjaassoonn", "avg_line_length": null, "converted": null, "ext": null, "file": null, "hexsha": null, "include": null, "lang": null, "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_count": null, "max_forks_repo_forks_event_max_...
println("Fitting linear, time-invariant model") n,λ = 150,2.48 M2 = RegularizedLTIModel(n,N1,λ) lti = estfun(M2,p1,Q1)
{ "alphanum_fraction": 0.7166666667, "author": null, "avg_line_length": 20, "converted": null, "ext": "jl", "file": null, "hexsha": "7afba9996c1ecfd503c9b4e359e971734b956aab", "include": null, "lang": "Julia", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_count": n...
""" Utiltiy helper functions of Machine Learning """ import numpy as np def sigmoid(val: np.ndarray) -> np.ndarray: """Sigmoid function .. math:: f(z) = \\frac{1}{1 + e^{-z}} Args: val (ndarray): input value Returns: np.ndarray: sigmoid value """ return 1 / (1 + np....
{ "alphanum_fraction": 0.5892696123, "author": null, "avg_line_length": 24.9213483146, "converted": null, "ext": "py", "file": null, "hexsha": "699de411495f604474cfae0460531563b0b026bf", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
struct LSQOutput β::Vector{Float64} ζ::Vector{Float64} Σβ::Matrix{Float64} Σζ::Matrix{Float64} Σβζ::Matrix{Float64} χ²::Float64 dof::Int βindex::Dict{Symbol, Union{Int, UnitRange{Int}}} zindex::Dict{Symbol, Union{Int, UnitRange{Int}}} end _names_ordered(index) = map(x->x[1], sort(co...
{ "alphanum_fraction": 0.6678141136, "author": null, "avg_line_length": 28.5737704918, "converted": null, "ext": "jl", "file": null, "hexsha": "3c6c4a0adabf3ce867c9ca4467a2902aac1d73f2", "include": null, "lang": "Julia", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
""" This is an example of the application of DeepESN model for multivariate time-series prediction task on Piano-midi.de (see http://www-etud.iro.umontreal.ca/~boulanni/icml2012) dataset. The dataset is a polyphonic music task characterized by 88-dimensional sequences representing musical compositions. Starting from p...
{ "alphanum_fraction": 0.7298127969, "author": null, "avg_line_length": 38.4838709677, "converted": null, "ext": "py", "file": null, "hexsha": "380269179ae781b7f8743a2681449f105fc5f807", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
''' #Requirement: opencv-python, tkinter # Usage instruction: Choose point (double click left mouse button) in the order leftUpper, RightUpper, LeftLower, RightLower Click "c" in the keyword for confirmation This is for two-chamber crylic transfer box, the dimension is two-chamber place preference _________445mm__...
{ "alphanum_fraction": 0.4995901639, "author": null, "avg_line_length": 26.2365591398, "converted": null, "ext": "py", "file": null, "hexsha": "55c392905745884931fe9fccacd3dea0f1f826f2", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
""" # WordSlots are the main objects of the grid, they are the word "spaces" to be filled """ import numpy as np class WordSlot(): def __init__(self, identifiant, length, first_letter_position, direction, initial_letters): self.identifiant = identifiant self.length = length sel...
{ "alphanum_fraction": 0.6315142576, "author": null, "avg_line_length": 38.3773584906, "converted": null, "ext": "py", "file": null, "hexsha": "fa1ddf57466635b41ffb1203374fb3db16de4c85", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import argparse import json from pathlib import Path import numpy as np import torch import yaml from .binary_tree import BinaryTree from .graph import Graph from .random_walker import RandomWalker from .skipgram import SkipGram def run(args): if args.config_file.absolute().exists(): with open(args.con...
{ "alphanum_fraction": 0.6199236376, "author": null, "avg_line_length": 27.7019230769, "converted": null, "ext": "py", "file": null, "hexsha": "fd9e05b85996163e5cd68c3fdcdb8a89297ce51e", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import matplotlib matplotlib.use('pdf') from matplotlib import pyplot as plt from mpl_toolkits.axes_grid1 import make_axes_locatable from scipy.cluster.hierarchy import dendrogram, linkage from scipy.spatial.distance import is_valid_dm import numpy as np import general_scripts as gs matplotlib.rcParams['font.family'] ...
{ "alphanum_fraction": 0.6265841014, "author": null, "avg_line_length": 37.3333333333, "converted": null, "ext": "py", "file": null, "hexsha": "31403b1302787ab14d366253681a621ce85ecd15", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
! ! -- LAPACK95 interface driver routine (version 3.0) -- ! UNI-C, Denmark; Univ. of Tennessee, USA; NAG Ltd., UK ! September, 2000 ! ! .. USE STATEMENTS .. USE LA_PRECISION, ONLY: WP => SP USE LA_AUXMOD, ONLY: ERINFO, LSAME ! .. IMPLICIT STATEMENT .. IMPLICIT NONE ! .. SCALAR ARGUMENTS .....
{ "alphanum_fraction": 0.5439239873, "author": null, "avg_line_length": 40.5337837838, "converted": null, "ext": "f90", "file": null, "hexsha": "f06960500fd06d00e7c57a75bfb2690b2f41cd58", "include": null, "lang": "FORTRAN", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_f...
# This contains inherited classes from detectron2, which were defined wit h he detectron2 version on January 21, 2019. # the changes are made to allow for logging validation set metrics during training and to allow for a custom data loader for tif imagery. import copy import logging import numpy as np import os import ...
{ "alphanum_fraction": 0.6674586269, "author": null, "avg_line_length": 39.3741935484, "converted": null, "ext": "py", "file": null, "hexsha": "bb194a4b4af081a7c8b6a84ec28706d6772b9301", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import numpy as np from ssr.ext.plyfile import PlyData, PlyElement from ssr.utility.logging_extension import logger from ssr.ssr_types.point import Point, Measurement class Face: # Do NOT confuse this class with a real triangle. # A face saves ONLY VERTEX INDICES, NO 3D information. def __init__(self, in...
{ "alphanum_fraction": 0.5634531229, "author": null, "avg_line_length": 33.0021881838, "converted": null, "ext": "py", "file": null, "hexsha": "ad78c1a9c9506221724b8eddba8c38c68f33a474", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
// Copyright (c) 2007-2017 Hartmut Kaiser // Copyright (c) 2008-2009 Chirag Dekate, Anshul Tandon // Copyright (c) 2012-2013 Thomas Heller // // 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 <hpx/runti...
{ "alphanum_fraction": 0.5428243935, "author": null, "avg_line_length": 32.0482993197, "converted": null, "ext": "cpp", "file": null, "hexsha": "4f6c540155e5f21f22a67428977b3c0c7838c89c", "include": null, "lang": "C++", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks...
# coding: utf-8 # In[7]: from __future__ import absolute_import from __future__ import print_function import keras from keras.preprocessing.image import ImageDataGenerator from keras.layers import Dense, Dropout, Activation, Flatten from keras.layers import Conv2D, MaxPooling2D from keras import applications from k...
{ "alphanum_fraction": 0.7049956934, "author": null, "avg_line_length": 32.9361702128, "converted": null, "ext": "py", "file": null, "hexsha": "759774f3d3d6a3fc8d8140381570bd61e664f568", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
#!/usr/bin/env python # coding: utf-8 import os import numpy as np import pandas as pd from matplotlib import pyplot as plt import seaborn as sb sb.set(style="white") sb.set(color_codes=True) sb.set_context('paper') os.chdir('/Users/pauline/Documents/Python') df = pd.read_csv("Tab-Bathy.csv") # define variables and ...
{ "alphanum_fraction": 0.6756756757, "author": null, "avg_line_length": 28.6451612903, "converted": null, "ext": "py", "file": null, "hexsha": "d5c887b723027fd64248cc2f672296905ecffd1e", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
module numz !************************************* integer, parameter:: b8 = selected_real_kind(14) ! basic real types integer, parameter:: b4 = selected_real_kind(4) ! integer, parameter:: i8 = selected_int_kind(14) integer, parameter:: out1 = 11 ! output file number for writes integer, parameter:: ...
{ "alphanum_fraction": 0.6316916488, "author": null, "avg_line_length": 35.9230769231, "converted": null, "ext": "f90", "file": null, "hexsha": "446922b4774ae04c8bf460371ec6e22897976767", "include": null, "lang": "FORTRAN", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_f...
""" Set of functions for measuring the spectral properties of galaxies. """ from __future__ import (absolute_import, division, print_function, unicode_literals) from ..plot import Plot from astropy.stats import sigma_clip from astropy.constants import c from astropy.units import km, s, erg, ...
{ "alphanum_fraction": 0.5232984649, "author": null, "avg_line_length": 38.4185803758, "converted": null, "ext": "py", "file": null, "hexsha": "e127479671e43975de018607f981b85443308ffd", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
#include <turbodbc/field_translators/timestamp_translator.h> #include <boost/variant/get.hpp> #include <sql.h> namespace turbodbc { namespace field_translators { timestamp_translator::timestamp_translator() = default; timestamp_translator::~timestamp_translator() = default; field timestamp_translator::do_make_fi...
{ "alphanum_fraction": 0.741130092, "author": null, "avg_line_length": 28.1851851852, "converted": null, "ext": "cpp", "file": null, "hexsha": "fb8a4e01d2f1faa4950c1586e9f2d6e0f72beadc", "include": null, "lang": "C++", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_...
Base.@kwdef struct FieldInfo name::String ltype::Union{DataType,String,Symbol} rtype::Union{DataType,String,Symbol} = rtype get_returns_reference::Bool = true end struct TypeInfo name::String fields::Vector{FieldInfo} end
{ "alphanum_fraction": 0.7217741935, "author": null, "avg_line_length": 19.0769230769, "converted": null, "ext": "jl", "file": null, "hexsha": "bfc9a32bc789087a238cc615b203ff17549c939e", "include": null, "lang": "Julia", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
""" Kernel PCA object """ struct kPCA{T <: Real} X::Matrix{Union{T, Missing}} # original data κ::Kernel{T} # kernel function (from MLKernels) μ::Vector{T} # row/col means of the kernel matrix μ2::T # mean of the kernel matrix λ::Vector{T} # eigenvalues in feature space α::Matrix{T} # ...
{ "alphanum_fraction": 0.5645454545, "author": null, "avg_line_length": 30.5555555556, "converted": null, "ext": "jl", "file": null, "hexsha": "37caff6d0cddd649c7ed5fdb50bd4c496000b1d2", "include": null, "lang": "Julia", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
from keras.models import load_model from load_face_dataset import load_dataset, IMAGE_SIZE, resize_image import numpy as np from fr_utils import img_to_encoding from sklearn.model_selection import cross_val_score, ShuffleSplit, KFold from sklearn.neighbors import KNeighborsClassifier from sklearn.externals import...
{ "alphanum_fraction": 0.6368642695, "author": null, "avg_line_length": 29.1226415094, "converted": null, "ext": "py", "file": null, "hexsha": "70ef1ecf78fd65ee39c652583df96736a0de9d0d", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import os import numpy as np from pwtools import io from pwtools.test import tools from .testenv import testdir rand = np.random.rand def test_h5(): try: import h5py dct1 = \ {'/a': 'abcgs', '/b/c/x1': 3, '/b/c/x2': rand(2,3), } # writing a...
{ "alphanum_fraction": 0.5114854518, "author": null, "avg_line_length": 36.2777777778, "converted": null, "ext": "py", "file": null, "hexsha": "19e08c50ec4f9d13ec3ea8cb5a1b03fd9284a0ae", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import time import math import numpy as np from itertools import product from collections import deque, defaultdict, namedtuple #TODO #4 make 2nd part of the task def load_data(): with open("AoC2020/aoc20-20-data.txt", "r") as f: data = f.read() print("Loaded lines:", len(data.splitlines())) with...
{ "alphanum_fraction": 0.5621552821, "author": null, "avg_line_length": 27.4069767442, "converted": null, "ext": "py", "file": null, "hexsha": "c63fc3a03d060d3f2f77d8c1204846eb72c77a85", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
from kivy.config import Config # Config.set('kivy', 'exit_on_escape', '0') # Config.set('graphics', 'resizable', '0') Config.set('graphics', 'width', '640') Config.set('graphics', 'height', '480') import os import cv2 from detection import Face_Detector, Landmark_Detector from faceswap_cam import face_swap from kivy....
{ "alphanum_fraction": 0.5767217919, "author": null, "avg_line_length": 29.487654321, "converted": null, "ext": "py", "file": null, "hexsha": "d2de28cea11632f26f235750e1c4ad63996da8ba", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
#include <boost/gil/extension/dynamic_image/algorithm.hpp>
{ "alphanum_fraction": 0.8305084746, "author": null, "avg_line_length": 29.5, "converted": null, "ext": "hpp", "file": null, "hexsha": "c585151cc6fe9f7cccb1e1e59821a4a3ded82ad2", "include": null, "lang": "C++", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_count": ...
#!/usr/bin/env python # Copyright 2014-2020 The PySCF Developers. 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 # # U...
{ "alphanum_fraction": 0.6080818414, "author": null, "avg_line_length": 45.4651162791, "converted": null, "ext": "py", "file": null, "hexsha": "86e1293f2c61d1a13edf3dcf1e7a5ed2f5b43296", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import logging from typing import Dict from typing import Sequence from typing import Tuple import yaml import argparse import torch import torch.nn.functional as F from espnet2.tts.abs_tts import AbsTTS from espnet.nets.pytorch_backend.gradtts.diffusion import Diffusion from espnet2.torch_utils.device_funcs import f...
{ "alphanum_fraction": 0.6089778259, "author": null, "avg_line_length": 37.2281879195, "converted": null, "ext": "py", "file": null, "hexsha": "213686a082af73aa65210e99ccede9eeda2ab854", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
# quantum solver import numpy as np from scipy.linalg import eigh def solver(nk, nbasis, mu, hamiton_mat): kpoints = np.linspace(0, np.pi, nk) # build and solve eigenvalue problem T = 0 # En = np.zeros((nk, nbasis)) density = np.zeros(nbasis, dtype=np.complex64) for ki, k in enumerate(kpoints)...
{ "alphanum_fraction": 0.5734317343, "author": null, "avg_line_length": 33.0487804878, "converted": null, "ext": "py", "file": null, "hexsha": "6fc2f97757e6319b9f7efd431ff80db0d256bc74", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import oemof.solph as solph from .component_electrolyzer import Electrolyzer import pyomo.environ as po class ElectrolyzerWasteHeat(Electrolyzer): """ Electrolyzer agents with waste heat model are created through this subclass of the Electrolyzer class """ def __init__(self, params): # Split the...
{ "alphanum_fraction": 0.6440026889, "author": null, "avg_line_length": 46.0752212389, "converted": null, "ext": "py", "file": null, "hexsha": "1f1ae7c604af497219008ebfbf892eec12275e4a", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
from efficientnet_pytorch import EfficientNet import torch from torch import nn from torch import optim from torch.utils.data import TensorDataset, DataLoader, Dataset import tokenizers from torchvision import transforms from PIL import Image from tqdm import tqdm import numpy as np import pandas as pd model = Efficie...
{ "alphanum_fraction": 0.6686877436, "author": null, "avg_line_length": 31.2027027027, "converted": null, "ext": "py", "file": null, "hexsha": "b8c2869fd005364d7008bc2f6c4240bdf1c8e376", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
[STATEMENT] lemma sH_seq: "\<^bold>{P\<^bold>} X;Y \<^bold>{Q\<^bold>} = \<^bold>{P\<^bold>} X \<^bold>{\<lambda>s. \<forall>s'. (s, s') \<in> Y \<longrightarrow> Q s'\<^bold>}" [PROOF STATE] proof (prove) goal (1 subgoal): 1. \<^bold>{P\<^bold>}X ; Y\<^bold>{Q\<^bold>} = \<^bold>{P\<^bold>}X\<^bold>{\<lambda>s. \<for...
{ "alphanum_fraction": null, "author": null, "avg_line_length": null, "converted": null, "ext": null, "file": "Hybrid_Systems_VCs_KleeneAlgebraTests_HS_VC_KAT_rel", "hexsha": null, "include": null, "lang": null, "length": 2, "llama_tokens": 296, "mathlib_filename": null, "max_forks_count": nul...
import numpy as np import pandas as pd import matplotlib.pyplot as plt import re def getting_and_knowing_your_data(chipo): #Step 4. See the first 10 entries print(chipo.head(10)) #Step 5. What is the number of observations in the dataset? print(len(chipo.index)) #Ste...
{ "alphanum_fraction": 0.6405439864, "author": null, "avg_line_length": 41.2807017544, "converted": null, "ext": "py", "file": null, "hexsha": "9754575b4fe635780cb9a18b48948eb64925e834", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
# Copyright (c) Facebook, Inc. and its affiliates. import unittest import torch import random import os import numpy as np from pythia.models.cnn_lstm import CNNLSTM from pythia.common.registry import registry from pythia.common.sample import Sample, SampleList from pythia.utils.configuration import ConfigNode, Confi...
{ "alphanum_fraction": 0.6508058327, "author": null, "avg_line_length": 38.3235294118, "converted": null, "ext": "py", "file": null, "hexsha": "126d74ed63a92230fa452d77527a1e8fba0cc3b9", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
% Ubah judul dan label berikut sesuai dengan yang diinginkan. \section{Design and Implementation} \label{sec:designandimplementation} % Ubah paragraf-paragraf pada bagian ini sesuai dengan yang diinginkan. This research is explaining about the implementation of one of the branch of deep learning studies with the aim t...
{ "alphanum_fraction": 0.7208559745, "author": null, "avg_line_length": 88.8109452736, "converted": null, "ext": "tex", "file": null, "hexsha": "4a2cd55d7f1d7e21094829673f020774a8394012", "include": null, "lang": "TeX", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks...
import numpy as np import tensorflow as tf from tqdm import tqdm from flearn.models.client import Client from flearn.utils.tf_utils import process_grad class BaseFedarated(object): def __init__(self, params, learner, dataset): '''initialize local models, build comp. graph''' # transfer...
{ "alphanum_fraction": 0.5793450882, "author": null, "avg_line_length": 33.6440677966, "converted": null, "ext": "py", "file": null, "hexsha": "eee456027042d54e1c310f759be8ce0727c02ce4", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
from typing import Union from pathlib import Path from glob import glob from tqdm import tqdm import json import numpy as np import torch from torch.utils.data import Dataset, DataLoader from utils.bert.utils.utils import BertTokenizer def collate_fn(data): document, section, sentence, contains_ds = data[0] se...
{ "alphanum_fraction": 0.6245487365, "author": null, "avg_line_length": 36.9333333333, "converted": null, "ext": "py", "file": null, "hexsha": "af03545072002df2ec1ba313b72cc498c5c3e597", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
from flask import Flask,request, url_for, redirect, render_template, jsonify from pycaret.regression import * import pandas as pd import pickle import numpy as np app = Flask(__name__) model = load_model('insurance_14052020') cols = ['age', 'sex', 'bmi', 'children', 'smoker', 'region'] @app.route('/') def home(): ...
{ "alphanum_fraction": 0.7019319227, "author": null, "avg_line_length": 31.9705882353, "converted": null, "ext": "py", "file": null, "hexsha": "6b2df42d48ced47ae8de4538d43436a05825ac8f", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import random import numpy as np from rl.policies import Policy class RandomPolicy(Policy): def __init__(self, action_mapper, epsilon=0.1, epsilon_decay_step=0.0001, epsilon_decay_epoch=0., epsilon_min=0.001, re...
{ "alphanum_fraction": 0.618556701, "author": null, "avg_line_length": 32.8307692308, "converted": null, "ext": "py", "file": null, "hexsha": "de1d659f25a2a07037386aab08679f19ddc5949d", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
#!/usr/bin/env python # A simple script to test the installed version of numpy by calling # 'numpy.test()'. Key features: # -- convenient command-line syntax # -- sets exit status appropriately, useful for automated test environments # It would be better to set this up as a module in the numpy namespace, so # tha...
{ "alphanum_fraction": 0.63304253, "author": null, "avg_line_length": 39.0212765957, "converted": null, "ext": "py", "file": null, "hexsha": "91e619e96e1e9e609ed76b6706976d86df264724", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks...
from __future__ import absolute_import from __future__ import print_function from __future__ import division import tensorflow as tf # import numpy as np import time import discogan import sys sys.path.insert(0, '../') import image_utils as iu from datasets import Pix2PixDataSet as DataSets results = { 'sampl...
{ "alphanum_fraction": 0.5371993706, "author": null, "avg_line_length": 34.7578125, "converted": null, "ext": "py", "file": null, "hexsha": "83a84321ea0a0bc9570475d0ce3c63e9712bd0ca", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_...
//============================================================================================================= /** * @file mne_project_to_surface.cpp * @author Jana Kiesel <jana.kiesel@tu-ilmenau.de>; * Matti Hamalainen <msh@nmr.mgh.harvard.edu> * @version 1.0 * @date August, 2016 * * @section LI...
{ "alphanum_fraction": 0.4358686049, "author": null, "avg_line_length": 35.0732394366, "converted": null, "ext": "cpp", "file": null, "hexsha": "84713ba83b656e77f04261c025ef40951c1d3770", "include": null, "lang": "C++", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks...
#include <boost/python/class.hpp> #include <boost/python/overloads.hpp> #include <boost/python/manage_new_object.hpp> #include <boost/python/suite/indexing/vector_indexing_suite.hpp> #include "MultiChannel.h" using namespace boost::python; // // MultiChannel class // void wrapMultiChannel() { #if PVA_API_VERSION >= ...
{ "alphanum_fraction": 0.6396510483, "author": null, "avg_line_length": 49.0137931034, "converted": null, "ext": "cpp", "file": null, "hexsha": "83744930db4cba5a0809579242be1e9a67c0e606", "include": null, "lang": "C++", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks...
SUBROUTINE ML5_0_HELAS_CALLS_AMPB_1(P,NHEL,H,IC) C C Modules C USE ML5_0_POLYNOMIAL_CONSTANTS C IMPLICIT NONE C C CONSTANTS C INTEGER NEXTERNAL PARAMETER (NEXTERNAL=4) INTEGER NCOMB PARAMETER (NCOMB=16) INTEGER NBORNAMPS PARAME...
{ "alphanum_fraction": 0.6241134752, "author": null, "avg_line_length": 43.3348623853, "converted": null, "ext": "f", "file": null, "hexsha": "cb912048c843496f63ef640defa460288af3fb7d", "include": null, "lang": "FORTRAN", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
Require Import Bool List. Import ListNotations. Require Import Undecidability.PCP.PCP. Require Import Undecidability.PCP.Util.Facts. Import PCPListNotation. Require Import Undecidability.PCP.Util.PCP_facts. Require Import Undecidability.Synthetic.Definitions. Local Hint Rewrite <- app_assoc : list. Local Hint Resolve...
{ "alphanum_fraction": null, "author": "uds-psl", "avg_line_length": null, "converted": null, "ext": null, "file": null, "hexsha": null, "include": null, "lang": null, "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_count": null, "max_forks_repo_forks_event_max_dat...
from tkinter import * from PIL import ImageTk, Image from tkinter import filedialog import numpy as np from tensorflow import keras import tensorflow as tf from tensorflow.python.keras.models import load_model from tkinter import messagebox longitud, altura = 200, 200 modelo = './modelo_project_modelo_20...
{ "alphanum_fraction": 0.6856780735, "author": null, "avg_line_length": 27.6842105263, "converted": null, "ext": "py", "file": null, "hexsha": "6a22310329aa77b68564040c3994cc4b4f578736", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import vnmrjpy as vj import numpy as np from scipy.ndimage.filters import gaussian_filter, median_filter from vnmrjpy.core.utils import vprint import copy # for hiding zero-divide warnigns import warnings warnings.filterwarnings("ignore", category=RuntimeWarning) """ Generate fieldmap from a set of gradient echo imag...
{ "alphanum_fraction": 0.6383758429, "author": null, "avg_line_length": 32.9565217391, "converted": null, "ext": "py", "file": null, "hexsha": "25e1d2ce8c0312c5da1641ec6cbaa3b6df737651", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
Quad Phone 2 on the Campus Payphones node Phone Number: (530) 7599256 Location: Sits not exactly in the Quad, but on the same block. Lives in the indented area next to the Memorial Union computer lab. Description: Its identical twin, Quad Phone 1, is to its right. Charge: 50 cents for local.
{ "alphanum_fraction": 0.7651006711, "author": null, "avg_line_length": 27.0909090909, "converted": null, "ext": "f", "file": null, "hexsha": "022a2499771e5345bf11425403e543ac771efdcd", "include": null, "lang": "FORTRAN", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/02_transforms.fractal.ipynb (unless otherwise specified). __all__ = ['MandelBrotFractalTransform', 'JuliaFractalTransform'] # Cell import numpy as np from albumentations.core.transforms_interface import ImageOnlyTransform from PIL import Image # Cell class MandelBrot...
{ "alphanum_fraction": 0.4702889703, "author": null, "avg_line_length": 33.4285714286, "converted": null, "ext": "py", "file": null, "hexsha": "57e461821f2fd61a69b152dd8b58b3fb354181a1", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
\section{Decomposition 8: UC22, UC23 (application upload and statistics)} \subsection*{Selected architectural drivers} The functional drivers are: \begin{itemize} \item \emph{UC22}: Upload an application \item \emph{UC23}: Consult application statistics \end{itemize} % UC22: % ...
{ "alphanum_fraction": 0.739755663, "author": null, "avg_line_length": 64.9421487603, "converted": null, "ext": "tex", "file": null, "hexsha": "7991d9dcbbfc822395574d981f0492f1904eded3", "include": null, "lang": "TeX", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_...
# ----------------------------------------------------------------------------- # # -*- coding: utf-8 -*- # # phlox-libdc1394/dc1394/frame.py # # Copyright (C) 2016, by Matthias Yang Chen <matthias_cy@outlook.com> # All rights reserved. # # phlox-libdc1394 is free software: you can redistribute it and/or modify it # un...
{ "alphanum_fraction": 0.6030410393, "author": null, "avg_line_length": 38.0561797753, "converted": null, "ext": "py", "file": null, "hexsha": "22df73cb320628fed7eb171e06fab821cbb9e8f4", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
#' @title save_data #' @description This function takes either a dataframe or all of the data you've filtered, and rolls it up into a csv and/ #' or a shapefile for continued analysis #' @param df This is a dataframe that you want to save in some other format. If a spatial format is selected #' (e.g. shapefile), it m...
{ "alphanum_fraction": 0.6494579246, "author": null, "avg_line_length": 49.6666666667, "converted": null, "ext": "r", "file": null, "hexsha": "0e2f97f4b488fcb50e53247cc74ed2f7c0f24718", "include": null, "lang": "R", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_cou...
import sys import numpy as np import torch from tqdm import trange from atom_joggling.utils import ROOT, mean, parser # Method specific options # Mixup parameter of the Beta distribution parser.add_argument("--alpha", default=0.75, type=float) # weighting factor for the unlabeled loss term parser.add_argument("--l...
{ "alphanum_fraction": 0.6470119522, "author": null, "avg_line_length": 33.1718061674, "converted": null, "ext": "py", "file": null, "hexsha": "37d4ebb25acea6ac26d7e6196c6ced81b9b07121", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
[STATEMENT] lemma order_dense_order_ow_transfer[transfer_rule]: assumes [transfer_rule]: "bi_unique A" "right_total A" "bi_unique B" "right_total B" shows "( rel_set A ===> (A ===> A ===> (=)) ===> (A ===> A ===> (=)) ===> rel_set B ===> (B ===> B ===> (=)) ===> (B ===> B ===> (=)) ===> ...
{ "alphanum_fraction": null, "author": null, "avg_line_length": null, "converted": null, "ext": null, "file": "Types_To_Sets_Extension_Examples_TTS_Foundations_Orders_Set_Simple_Orders", "hexsha": null, "include": null, "lang": null, "length": 1, "llama_tokens": 284, "mathlib_filename": null, ...
import scanpy as sc import muon as mu import numpy as np ## VIASH START par = { 'input': 'resources_test/pbmc_1k_protein_v3/pbmc_1k_protein_v3_filtered_feature_bc_matrix.h5mu', 'modality': ['rna'], 'output': 'output.h5mu', 'var_name_filter': 'filter_with_hvg', 'do_subset': False, 'flavor': 'seurat', 'n_t...
{ "alphanum_fraction": 0.6294695481, "author": null, "avg_line_length": 29.5930232558, "converted": null, "ext": "py", "file": null, "hexsha": "cfed615c93813dc24fbc5ba55b533312a1aae9d2", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
#include <stdlib.h> /* srand, rand */ #include <iostream> #include <fstream> // creating (.csv) files #include <vector> #include <cstring> #include <string> #include <functional> #include <armadillo> // http://arma.sourceforge.net/docs.html #include <thread> /* std::this_thread::sleep_for */ #include "EvolutionaryA...
{ "alphanum_fraction": 0.6446322379, "author": null, "avg_line_length": 34.0618336887, "converted": null, "ext": "cpp", "file": null, "hexsha": "817f3f3e140d414af2ed2a806bf75ed146ffc175", "include": null, "lang": "C++", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks...
abstract type distribution end module genericDistribution <: distribution #default values E(x)=0 #mean value #1st moment generating function σ(x)=1 #variance #2nd moment generating function function getPdf(x=smoothFunction) """ generalization of (any ) """ return pdf(x)= smoothFunction end functio...
{ "alphanum_fraction": 0.7398373984, "author": null, "avg_line_length": 26.7391304348, "converted": null, "ext": "jl", "file": null, "hexsha": "a7f53b14cd62701c96c96999ba0ec9d89f90e6bb", "include": null, "lang": "Julia", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
from collections import OrderedDict import copy import cPickle import gzip import os import urllib import random import stat import subprocess import sys import time import numpy import theano from theano import tensor as T PREFIX = os.getenv( 'ATISDATA', os.path.join(os.path.split(os.path.abspath(os.path.di...
{ "alphanum_fraction": 0.5116349123, "author": null, "avg_line_length": 34.0487179487, "converted": null, "ext": "py", "file": null, "hexsha": "4ab80b54b27e6bf293f12223a4a70e109b8a6252", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
# Copyright 2021 Huawei Technologies Co., Ltd # # 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...
{ "alphanum_fraction": 0.74734119, "author": null, "avg_line_length": 47.6575342466, "converted": null, "ext": "py", "file": null, "hexsha": "a5d53fbbbde0aaca332183cb7f46700e5f751e6f", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks...
# influence functions for shapley values def shapley_influence_function(Z, z_counts, W, v, psi, G, c_n, ics, measure): """ Compute influence function for the given predictiveness measure @param Z the subsets of the power set with estimates @param W the matrix of weights @param v the estimated pred...
{ "alphanum_fraction": 0.6676190476, "author": null, "avg_line_length": 37.5, "converted": null, "ext": "py", "file": null, "hexsha": "b41c723de4428c8f8fa5b297281a5294734406c4", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_count"...
import numpy as np from pengle.transformer.base import FeatureOverwriter, timer import copy class ComplementMissingValue(FeatureOverwriter): def __init__(self, columns, agg_func=np.mean): super().__init__(columns) self.agg_func = agg_func def apply(self, train_dataset, test_dataset): ...
{ "alphanum_fraction": 0.6727066818, "author": null, "avg_line_length": 36.0408163265, "converted": null, "ext": "py", "file": null, "hexsha": "406874c7e5050d3199d65f5e4d48e83ed2507c8c", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import chainer import chainer.functions as F import chainer.links as L import onnx import onnx.helper as oh from onnx import numpy_helper from onnx import TensorProto from onnx import ModelProto from chainer_compiler.elichika.parser import core from chainer_compiler.elichika.parser import graphs from chainer_compiler...
{ "alphanum_fraction": 0.6059701493, "author": null, "avg_line_length": 26.4971751412, "converted": null, "ext": "py", "file": null, "hexsha": "f2b898e02c1aa7075b806196125c0a2caf17aa97", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import argparse import logging import os import sys import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import yaml from torch import optim from torch.utils.data import DataLoader, random_split from torch.utils.tensorboard import SummaryWriter from tqdm import tqdm from evaluation im...
{ "alphanum_fraction": 0.5822586948, "author": null, "avg_line_length": 36.2122641509, "converted": null, "ext": "py", "file": null, "hexsha": "2a3790dca9b3ad7a15a57d4bee446ccfe0cda367", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
""" ============================ StrongTree Fit Example ============================ An example of fitting a StrongTree decision tree using :class:`trees.StrongTree.StrongTreeClassifier` """ from pickle import TRUE import pandas as pd import numpy as np from sklearn.model_selection import train_test_split from trees.S...
{ "alphanum_fraction": 0.6896551724, "author": null, "avg_line_length": 25.5882352941, "converted": null, "ext": "py", "file": null, "hexsha": "4340e20e891e4239ee975c1eb55d8e739176922a", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
#include <server_lib/emergency_helper.h> #if !defined(STACKTRACE_DISABLED) #include <boost/version.hpp> #include <boost/filesystem.hpp> #include <iostream> #include <sstream> #include <fstream> #if !defined(CUSTOM_STACKTRACE_IMPL) && BOOST_VERSION >= 106500 #include <boost/stacktrace.hpp> namespace server_lib { ...
{ "alphanum_fraction": 0.5386509109, "author": null, "avg_line_length": 25.3875, "converted": null, "ext": "cpp", "file": null, "hexsha": "33b042f69c5293fe11643ebbed12756cfdac17dd", "include": null, "lang": "C++", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_count...
""" Algorithms that Involve Multiple DataFrames =========================================== The pandas operations ``concat``, ``join``, and ``merge`` combine multiple DataFrames. This module contains analogous algorithms in the parallel case. There are two important cases: 1. We combine along a partitioned index 2...
{ "alphanum_fraction": 0.6007355715, "author": null, "avg_line_length": 33.2413793103, "converted": null, "ext": "py", "file": null, "hexsha": "169c1c76b670702cd985b6c2681318522a53ceb6", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
In order to give a better sense of the approach to reliability analysis and optimization presented in \sref{chaos-reliability-analysis} and \sref{chaos-optimization}, we consider a concrete application, meaning that we specify the uncertain parameters and discuss the accompanying computations. This application is also ...
{ "alphanum_fraction": 0.7832131148, "author": null, "avg_line_length": 56.4814814815, "converted": null, "ext": "tex", "file": null, "hexsha": "e99f311050dff10e93558ec47c98125975d34d16", "include": null, "lang": "TeX", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks...
import os import pytest import musdb import simplejson as json import museval import numpy as np json_path = os.path.join( os.path.dirname(os.path.realpath(__file__)), 'data/Music Delta - Rock.json', ) @pytest.fixture() def mus(): return musdb.DB(root_dir='data/MUS-STEMS-SAMPLE', is_wav=True) def test...
{ "alphanum_fraction": 0.6033573141, "author": null, "avg_line_length": 25.4268292683, "converted": null, "ext": "py", "file": null, "hexsha": "b89de0cc8403e81c3eb63f62b1bba82b7784bbe9", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
// Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test // Copyright (c) 2015, Oracle and/or its affiliates. // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle // Licensed under the Boost Software License version 1.0. // http://www.boost.org/users/license.html #ifndef BOOST_GEOMETR...
{ "alphanum_fraction": 0.6170454545, "author": null, "avg_line_length": 28.5185185185, "converted": null, "ext": "hpp", "file": null, "hexsha": "14066cd472543364ca9b0055b406937a792d36fb", "include": null, "lang": "C++", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks...
#Djnago stuff from .models import * from django.shortcuts import render,redirect from django.http import HttpResponse,JsonResponse from django.core.serializers import serialize import time #helper functions from .utils import traverse,convertGraph #run binaries import subprocess from subprocess import PIPE, run #netw...
{ "alphanum_fraction": 0.551655365, "author": null, "avg_line_length": 28.6187214612, "converted": null, "ext": "py", "file": null, "hexsha": "25cf1d93e52afa109a0fa9687cebe1680ff7bd2e", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
from datetime import datetime, timezone import numpy as np import pytest import astropy.units as u from stixcore.time import SCETime, SCETimeDelta, SCETimeRange from stixcore.time.datetime import MAX_COARSE, MAX_FINE def test_time_init(): t1 = SCETime(0, 0) t2 = SCETime.from_float(0*u.s) t3 = SCETime(t...
{ "alphanum_fraction": 0.6251581167, "author": null, "avg_line_length": 26.8490566038, "converted": null, "ext": "py", "file": null, "hexsha": "13c9ded99596299bd7e7d929dcea175a60724c3d", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import os import sys import time import pickle import random import tarfile import matplotlib import numpy as np import matplotlib.pyplot as plt import matplotlib.image as mpimg from scipy import ndimage from urllib.request import urlretrieve from sklearn.linear_model import LogisticRegression from utils import * fro...
{ "alphanum_fraction": 0.6471323336, "author": null, "avg_line_length": 37.3562653563, "converted": null, "ext": "py", "file": null, "hexsha": "1d19da61f9bf446a9638a18102d8c2594b1fa562", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import sys, os sys.path.append(os.getcwd()) import entities, viewer import numpy as np import importlib importlib.reload(entities) importlib.reload(viewer) cube = entities.Entity(node_color=(255, 255, 255), name="cube") cube_nodes = [(x, y, z) for x in (-75, 75) for y in (-75, 75) for z in (-75, 75)] cube.addNodes(np...
{ "alphanum_fraction": 0.6286885246, "author": null, "avg_line_length": 32.1052631579, "converted": null, "ext": "py", "file": null, "hexsha": "bb7adaaee71678d1d180363d9d219fc26fedfb79", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import numpy as np import matplotlib.pyplot as plt from IPython.display import clear_output import os import contextlib np.seterr(all='raise') class NoSignChange(Exception): def __init__(self, message='No sign change in specified bounds'): # Call the base class constructor with the parameters it needs ...
{ "alphanum_fraction": 0.5831949268, "author": null, "avg_line_length": 45.5189003436, "converted": null, "ext": "py", "file": null, "hexsha": "2cbe963f07942145345946724a3b259b4be4d736", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import abc import os import inspect import requests import pandas as pd import numpy as np import xarray as xr from .adapters import Adapter from .bounds import Bounds from .constants import (RCMED_QUERY_URL, ESGF_NODES, DEFAULT_INTAKE_CAT, DEFAULT_INTAKE_ESM_CAT) from .ensemble impor...
{ "alphanum_fraction": 0.5699197068, "author": null, "avg_line_length": 40.8744493392, "converted": null, "ext": "py", "file": null, "hexsha": "317bd89efcfdb25fcfe273e43c8ee7ba9bfec5c9", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
[STATEMENT] lemma numsubst0_numbound0: assumes "numbound0 t" shows "numbound0 (numsubst0 t a)" [PROOF STATE] proof (prove) goal (1 subgoal): 1. numbound0 (numsubst0 t a) [PROOF STEP] using assms [PROOF STATE] proof (prove) using this: numbound0 t goal (1 subgoal): 1. numbound0 (numsubst0 t a) [PROOF STEP] proof ...
{ "alphanum_fraction": null, "author": null, "avg_line_length": null, "converted": null, "ext": null, "file": null, "hexsha": null, "include": null, "lang": null, "length": 7, "llama_tokens": 1565, "mathlib_filename": null, "max_forks_count": null, "max_forks_repo_forks_event_max_datetime": ...
function vertCongruenceAA(W) err, i, todelete, vclasses = 10^-6, 1, [], [] verts = convert(Lar.Points, W') kdtree = NearestNeighbors.KDTree(verts) newverts = zeros(Int, size(verts,2)) for vi in 1:size(verts,2) if !(vi in todelete) nearvs = NearestNeighbors.inrange(kdtree, verts[:,vi], err) push!(vclasses,n...
{ "alphanum_fraction": 0.6793248945, "author": null, "avg_line_length": 26.3333333333, "converted": null, "ext": "jl", "file": null, "hexsha": "c37df422ab2d06863d2f38341123e15a0daffa3a", "include": null, "lang": "Julia", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
const INTERNALNAMES = (:__model__, :__context__, :__varinfo__) """ isassumption(expr[, vn]) Return an expression that can be evaluated to check if `expr` is an assumption in the model. Let `expr` be `:(x[1])`. It is an assumption in the following cases: 1. `x` is not among the input data to the model, 2....
{ "alphanum_fraction": 0.6598417869, "author": null, "avg_line_length": 34.1111111111, "converted": null, "ext": "jl", "file": null, "hexsha": "4038d5d14fa21e2ffffb7b218e417419814bf00a", "include": null, "lang": "Julia", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
import os, sys lib_path = os.path.abspath(os.path.dirname(__file__)) sys.path.append(lib_path) import tensorflow as tf from ddpg_actor import DDPG_Actor from ddpg_critic import DDPG_Critic class Model(object): def __init__(self, state_dim, action_dim, optimizer=...
{ "alphanum_fraction": 0.6378258458, "author": null, "avg_line_length": 37.175257732, "converted": null, "ext": "py", "file": null, "hexsha": "d46e6e9beb440dccb73d0170bdc39dee3e2403fc", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
[STATEMENT] lemma f_Exec_Stream_Acc_Output_drop: " f_Exec_Comp_Stream_Acc_Output k output_fun trans_fun xs c \<up> n = f_Exec_Comp_Stream_Acc_Output k output_fun trans_fun (xs \<up> n) ( f_Exec_Comp trans_fun (xs \<down> n \<odot>\<^sub>f k) c)" [PROOF STATE] proof (prove) goal (1 subgoal): 1. f_Exec_Comp_Stre...
{ "alphanum_fraction": null, "author": null, "avg_line_length": null, "converted": null, "ext": null, "file": "AutoFocus-Stream_AF_Stream_Exec", "hexsha": null, "include": null, "lang": null, "length": 1, "llama_tokens": 245, "mathlib_filename": null, "max_forks_count": null, "max_forks_repo...
import sys import networkx as nx import matplotlib import matplotlib.pyplot as plt import pygraphviz from networkx.drawing.nx_agraph import graphviz_layout graph = nx.Graph() def dtoCOM(a): global graph return nx.dijkstra_path_length(graph, a, "COM") for orbit in sys.stdin: A, B = [i.strip() for i in o...
{ "alphanum_fraction": 0.7054187192, "author": null, "avg_line_length": 29, "converted": null, "ext": "py", "file": null, "hexsha": "167ef5d44bcb082d0a7c1ca96f8beb1326ad4fc2", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_count": ...
import math from typing import Iterable, Union import numpy as np from shor.errors import CircuitError from shor.layers import _Layer from shor.utils.collections import flatten QbitOrIterable = Union[int, Iterable] class _Gate(_Layer): """Abstract base quantum gate class # Properties input_length = va...
{ "alphanum_fraction": 0.5080947384, "author": null, "avg_line_length": 23.9964028777, "converted": null, "ext": "py", "file": null, "hexsha": "696bfe59953f2dc657d64439260348f8fed03c23", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import argparse import logging import json from pprint import pprint import numpy as np import os from astropy.coordinates import EarthLocation, SkyCoord from astropy.time import Time from astropy import units as u from astropy.coordinates import AltAz from datetime import datetime import ctbend.ctbendbase.CTBend as...
{ "alphanum_fraction": 0.5727593646, "author": null, "avg_line_length": 34.2214765101, "converted": null, "ext": "py", "file": null, "hexsha": "6dabd5f28654c086b3d4d43656607b582aa8a14a", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
[STATEMENT] lemma dj_cp: fixes pi1::"'x prm" and pi2::"'y prm" and x ::"'a" assumes cp: "cp TYPE ('a) TYPE('x) TYPE('y)" and dj: "disjoint TYPE('y) TYPE('x)" shows "pi1\<bullet>(pi2\<bullet>x) = (pi2)\<bullet>(pi1\<bullet>x)" [PROOF STATE] proof (prove) goal (1 subgoal): 1. pi1 \<bullet> pi2 \<bul...
{ "alphanum_fraction": null, "author": null, "avg_line_length": null, "converted": null, "ext": null, "file": null, "hexsha": null, "include": null, "lang": null, "length": 1, "llama_tokens": 201, "mathlib_filename": null, "max_forks_count": null, "max_forks_repo_forks_event_max_datetime": n...
""" To run tests: pytest test_game.py """ import numpy as np import curling.constants import log_handler from curling import board as board_utils from curling import constants as c from curling import game from curling import simulation from curling import utils log_handler.flush_on_error() def test_simulation_set...
{ "alphanum_fraction": 0.700264667, "author": null, "avg_line_length": 26.514619883, "converted": null, "ext": "py", "file": null, "hexsha": "06fcbe0272354b4f01046abddb88d8329b17ee08", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks...
# Imports here import matplotlib.pyplot as plt import numpy as np import time import json import torch from torch import nn from torch import optim import torch.nn.functional as F from torchvision import datasets, transforms, models from collections import OrderedDict import PIL from PIL import Image import argparse ...
{ "alphanum_fraction": 0.6274171584, "author": null, "avg_line_length": 33.7883435583, "converted": null, "ext": "py", "file": null, "hexsha": "7c912d11c4873d7dc4f4c126e7652382860f22d6", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import os from os.path import basename os.environ['CUDA_VISIBLE_DEVICES'] = '' from keras.models import load_model import matplotlib.pyplot as plt from skimage import io import numpy as np from skimage.color import gray2rgb, label2rgb from skimage.io import imsave from datetime import datetime from functions import y...
{ "alphanum_fraction": 0.597693786, "author": null, "avg_line_length": 34.947761194, "converted": null, "ext": "py", "file": null, "hexsha": "26c732c18116a026621aceeb43de31b4fecddbe6", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks...
C C $Id: pakrsp.f,v 1.5 2008-07-27 00:17:10 haley Exp $ C C Copyright (C) 2000 C University Corporation for Atmospheric Research C All Rights Reserved C C The use of this Software is governed by a License Agreement. C REAL FUNCTION PAKRSP (ANG) C C Function to convert DMS pac...
{ "alphanum_fraction": 0.648312611, "author": null, "avg_line_length": 20.8518518519, "converted": null, "ext": "f", "file": null, "hexsha": "a9ec52742119d6515683a05c9da27279a7c9935e", "include": null, "lang": "FORTRAN", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
rng = StableRNG(614) # convert a Binary vector into vector of +1 or -1 values # (for testing only): pm1(y) = Int8(2) .* (Int8.(MLJBase.int(y))) .- Int8(3) const MARGIN_LOSSES = MLJBase.MARGIN_LOSSES const DISTANCE_LOSSES = MLJBase.DISTANCE_LOSSES # using `WeightedSum` instead of `WeightedMean`; see # https://github....
{ "alphanum_fraction": 0.5810260586, "author": null, "avg_line_length": 33.1891891892, "converted": null, "ext": "jl", "file": null, "hexsha": "30fe057e61ad0278776f921042bbc71acaa066f0", "include": null, "lang": "Julia", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
import numpy as np import pandas as pd data = pd.read_csv('input.txt', sep="\n", header=None) # Part 1 def calculate_fuel_required(mass): return int(mass / 3) - 2 # divide by 3, round down, subtract 2 fuel = data.apply(calculate_fuel_required, axis=1) fuel_required_sum = fuel.values.sum() print("Fuel required ...
{ "alphanum_fraction": 0.7489878543, "author": null, "avg_line_length": 27.4444444444, "converted": null, "ext": "py", "file": null, "hexsha": "9ec4e921aeefccda9c37f646f2c75a516876e76d", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...