text
stringlengths
0
27.1M
meta
dict
module pidef ! Value of pi real, parameter :: pi = 4.0*atan(1.0) real, parameter :: conrad = pi/180.0 real, parameter :: condeg = 180.0/pi end module pidef
{ "alphanum_fraction": 0.6149425287, "author": null, "avg_line_length": 19.3333333333, "converted": null, "ext": "f95", "file": null, "hexsha": "1b5192b04cd39c6c1d6f46adb443c628d2e738e6", "include": null, "lang": "FORTRAN", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_f...
import numpy as np from itertools import product class GridWorld: UP = 0 RIGHT = 1 DOWN = 2 LEFT = 3 def __init__(self, size=5): self.size = size self.action_space = [self.UP, self.RIGHT, self.DOWN, self.LEFT] self.A = (0, 1) self.A_prime = (4, 1) self.B =...
{ "alphanum_fraction": 0.5732283465, "author": null, "avg_line_length": 42.3333333333, "converted": null, "ext": "py", "file": null, "hexsha": "61998bba71224ade011cb97edcdd42cfcb3d000e", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
# -*- coding: utf-8 -*- # ProDy: A Python Package for Protein Dynamics Analysis # # Copyright (C) 2010-2012 Ahmet Bakan # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of th...
{ "alphanum_fraction": 0.534725655, "author": null, "avg_line_length": 32.6290322581, "converted": null, "ext": "py", "file": null, "hexsha": "b982471333265b259ba7350caa9935bb993f53b8", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
# topic_modeling.py # Topic model analysis for professional articles on machine intelligence. import numpy as np import pandas as pd import altair as alt import streamlit as st def buildAcademicData(data): df = pd.DataFrame() topics = [ "Language Models", "Cloud-Based ML Frameworks", ...
{ "alphanum_fraction": 0.5895953757, "author": null, "avg_line_length": 28.8333333333, "converted": null, "ext": "py", "file": null, "hexsha": "a73bea41a61893a2120c330d23d1c3958896d288", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
# -*- coding: utf-8 -*- """ Created on Tue Feb 9 09:07:22 2021 This script creates the PhoREAL GUI exe along with the Windows Installer file. Steps: 1) Place all necessary PhoREAL files into the path given by the "phorealDirPath" parameter 2) Set the PhoREAL version number for the naming of the exe...
{ "alphanum_fraction": 0.5906263883, "author": null, "avg_line_length": 40.3164179104, "converted": null, "ext": "py", "file": null, "hexsha": "ad8a37f426509894f4168a0b3b9362fd51b9a6e4", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import unittest import numpy as np import pandas as pd import networkx as nx from pgmpy.models.BayesianModel import BayesianModel from pgmpy.estimators import TreeSearch from pgmpy.factors.discrete import TabularCPD from pgmpy.sampling import BayesianModelSampling class TestTreeSearch(unittest.TestCase): def se...
{ "alphanum_fraction": 0.4204180064, "author": null, "avg_line_length": 32.5654450262, "converted": null, "ext": "py", "file": null, "hexsha": "ed2bc18e6ac8b19ae75c10da0fa1340f57f59642", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
[STATEMENT] lemma exec_n_end: "size P <= (n::int) \<Longrightarrow> P \<turnstile> (n,s,stk) \<rightarrow>^k (n',s',stk') = (n' = n \<and> stk'=stk \<and> s'=s \<and> k =0)" [PROOF STATE] proof (prove) goal (1 subgoal): 1. size P \<le> n \<Longrightarrow> P \<turnstile> (n, s, stk) \<rightarrow>^k (n', s', stk') ...
{ "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": 198, "mathlib_filename": null, "max_forks_count": null, "max_forks_repo_forks_event_max_datetime": n...
import datetime import pandas as pd import numpy as np from edgar3 import edgar_index def get_13f_listings(date: datetime.datetime, populate: bool) -> pd.DataFrame: ed_i = edgar_index.edgar_index() df = ed_i.get_full_listing_as_pd(date) df = df[df["Form Type"].isin(["13F-HR", "13F-HR/A", "13F-NT", "13F-NT...
{ "alphanum_fraction": 0.6613861386, "author": null, "avg_line_length": 31.5625, "converted": null, "ext": "py", "file": null, "hexsha": "d1afb98e1acaa121194d3802b010f2dbdeaf6c29", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_cou...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = "Larissa Triess" __email__ = "mail@triess.eu" import numpy as np def get_kitti_columns(points: np.array, number_of_columns: int = 2000) -> np.array: """ Returns the column indices for unfolding one or more raw KITTI scans """ azi = np.arctan2(poin...
{ "alphanum_fraction": 0.6667161961, "author": null, "avg_line_length": 43.141025641, "converted": null, "ext": "py", "file": null, "hexsha": "220caac06b70b7608ea933de236fef8e1c61f2fd", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
# coding=utf-8 # Copyright 2019 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
{ "alphanum_fraction": 0.7193605684, "author": null, "avg_line_length": 31.528, "converted": null, "ext": "py", "file": null, "hexsha": "e79c83cb2962e7003b5c34c0f370aee55df6815e", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_coun...
struct DiffusionObservationModel{S1, S2, TF} <: ObservationModel{Vector{S1}, Vector{S2}, ContinuousTime} n::Int m::Int observation_function::TF end ##################### ### BASIC METHODS ### ##################### ...
{ "alphanum_fraction": 0.6130500759, "author": null, "avg_line_length": 23.1228070175, "converted": null, "ext": "jl", "file": null, "hexsha": "3421295f0a2dcdadba0e5fb70ed4b7832c600731", "include": null, "lang": "Julia", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
[STATEMENT] theorem product_of_chord_segments: fixes S\<^sub>1 T\<^sub>1 S\<^sub>2 T\<^sub>2 X C :: "'a :: euclidean_space" assumes "between (S\<^sub>1, T\<^sub>1) X" "between (S\<^sub>2, T\<^sub>2) X" assumes "dist C S\<^sub>1 = r" "dist C T\<^sub>1 = r" assumes "dist C S\<^sub>2 = r" "dist C T\<^sub>2 = r" ...
{ "alphanum_fraction": null, "author": null, "avg_line_length": null, "converted": null, "ext": null, "file": "Chord_Segments_Chord_Segments", "hexsha": null, "include": null, "lang": null, "length": 12, "llama_tokens": 1347, "mathlib_filename": null, "max_forks_count": null, "max_forks_repo...
c--------------------------------------------------------------------- c--------------------------------------------------------------------- subroutine make_set c--------------------------------------------------------------------- c--------------------------------------------------------------------- c------...
{ "alphanum_fraction": 0.3640730067, "author": null, "avg_line_length": 41.3095238095, "converted": null, "ext": "f", "file": null, "hexsha": "ffab37c37e638e979f69863faf941271a0141c92", "include": null, "lang": "FORTRAN", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
/* Copyright (c) 2017, CNRS-LAAS All rights reserved. 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 di...
{ "alphanum_fraction": 0.609384995, "author": null, "avg_line_length": 42.74609375, "converted": null, "ext": "hpp", "file": null, "hexsha": "f9e054497d4f7bd7be1068f0908afc24f2cbac87", "include": null, "lang": "C++", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_co...
[STATEMENT] lemma a_insert: "T_insert a t + \<Phi>(skew_heap.insert a t) - \<Phi> t \<le> 3 * log 2 (size1 t + 2) + 2" [PROOF STATE] proof (prove) goal (1 subgoal): 1. real_of_int (T_insert a t + \<Phi> (skew_heap.insert a t) - \<Phi> t) \<le> 3 * log 2 (real (size1 t + 2)) + 2 [PROOF STEP] using a_merge[of "Node Leaf...
{ "alphanum_fraction": null, "author": null, "avg_line_length": null, "converted": null, "ext": null, "file": "Amortized_Complexity_Skew_Heap_Analysis", "hexsha": null, "include": null, "lang": null, "length": 2, "llama_tokens": 391, "mathlib_filename": null, "max_forks_count": null, "max_fo...
import sys sys.path.append("../../../../common") sys.path.append("../") import os import json import numpy as np import acl import cv2 as cv from PIL import Image import pickle import LaneFinder import atlas_utils.constants as const from atlas_utils.acl_model import Model from atlas_utils.acl_resource import AclResourc...
{ "alphanum_fraction": 0.6057404473, "author": null, "avg_line_length": 40.2765957447, "converted": null, "ext": "py", "file": null, "hexsha": "bc569cc2927fc10e74e22c4c892b1d19791a2e9e", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
""" Non-probabilistic non-negative matrix tri-factorisation, as presented in "Probabilistic Matrix Tri-Factorisation" (Yoo and Choi, 2009). We change the notation to match ours: R = FSG.T instead of V = USV.T. The updates are then: - Uik <- Uik * (sum_j Vjk * Rij / (Ui dot Vj)) / (sum_j Vjk) - Vjk <- Vjk * (sum_i Uik...
{ "alphanum_fraction": 0.5593623848, "author": null, "avg_line_length": 44.7268518519, "converted": null, "ext": "py", "file": null, "hexsha": "65616fa05f995ebbde603e17e2f5c02020680367", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
From ConCert.Execution Require Import Blockchain. From ConCert.Execution Require Import Containers. From ConCert.Execution Require Import Serializable. From ConCert.Execution Require Import ResultMonad. From ConCert.Execution.Test Require Import QCTest. From ConCert.Examples.FA2 Require Import FA2Token. From ConCert.Ex...
{ "alphanum_fraction": null, "author": "AU-COBRA", "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_da...
# Copyright 2021 CR.Sparse Development Team # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed...
{ "alphanum_fraction": 0.6976284585, "author": null, "avg_line_length": 25.3, "converted": null, "ext": "py", "file": null, "hexsha": "12146aed600e03df2c9f16e06315a9dd1cc61a34", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_count"...
# -*- coding: utf-8 -*- """ Created on Mon Jan 10 08:31:20 2022 @author: Ezra """ import pandas as pd import matplotlib.pyplot as plt import numpy as np from scipy.optimize import curve_fit def f(t,A,w,phi): y = A*np.sin(w*t+phi) return y data1 = pd.read_csv(r'fileDirectory') x = data1['t...
{ "alphanum_fraction": 0.593716143, "author": null, "avg_line_length": 22.512195122, "converted": null, "ext": "py", "file": null, "hexsha": "d9d65b60bada5a0053981b38e68a19646dda9f9c", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks...
# -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function) import math from operator import add from functools import reduce import pytest from chempy import Substance from chempy.units import ( allclose, units_library, default_constants, Backend, to_unitless, SI_base_registry...
{ "alphanum_fraction": 0.5809999406, "author": null, "avg_line_length": 30.9779005525, "converted": null, "ext": "py", "file": null, "hexsha": "4f965130e6d16bb4fed5ee7992372d9f02835905", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import numpy as np import cv2 import matplotlib.pyplot as plt import matplotlib.image as mpimg image = mpimg.imread('cutout1.jpg') # Define a function to compute color histogram features def color_hist(img, nbins=32, bins_range=(0, 256)): # Compute the histogram of the RGB channels separately rhist = np.his...
{ "alphanum_fraction": 0.684244373, "author": null, "avg_line_length": 35.3409090909, "converted": null, "ext": "py", "file": null, "hexsha": "8683f3c39a019b64f9cd9f17965eb8520ab7b904", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
import random import matplotlib.pyplot as plt import math import numpy as np import cv2 import os def distance(x0, y0, x1, y1): return math.sqrt((x0 - x1)**2 + (y0 - y1)**2) def find_n_nearest(agent_idx, agent_pos, n_nearest): dis = [] for i in range(num_agents): if (i != agent_idx): d = distance(agent_pos[a...
{ "alphanum_fraction": 0.695949092, "author": null, "avg_line_length": 30.8277511962, "converted": null, "ext": "py", "file": null, "hexsha": "48d7e075d62fa3add92b50b610c3b32783048c08", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
import os import pandas as pd import numpy as np para = {"window_size":0.5,"step_size":0.2,"structured_file":"bgl/BGL_100k_structured.csv","BGL_sequence":'bgl/BGL_sequence.csv'} ''' anomaly的算法:將整段資料依序切成不相教的window,只要這個window裡面有一個 的label是abnomal ,就說這一個window是abnomal 至個abnomal的label是之前就label好了 輸出的訊息會標示這個window裡面...
{ "alphanum_fraction": 0.6464765496, "author": null, "avg_line_length": 38.9266055046, "converted": null, "ext": "py", "file": null, "hexsha": "b39ffadea53439d1f2e97952cf23ca97e64a2299", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
/******************************************************************************* * Copyright (c) 2016, Hitachi-LG Data Storage * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions...
{ "alphanum_fraction": 0.6582809224, "author": null, "avg_line_length": 31.5894039735, "converted": null, "ext": "cpp", "file": null, "hexsha": "c051a82a69bcf5a83c434cf9a605c749a3765cbe", "include": null, "lang": "C++", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks...
# python3 # Copyright 2018 DeepMind Technologies Limited. 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 re...
{ "alphanum_fraction": 0.6882076293, "author": null, "avg_line_length": 38.7905405405, "converted": null, "ext": "py", "file": null, "hexsha": "8323c4ded4da2db8f3aef3afec02ae363924f08f", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import os import re import nltk import string import sparknlp import numpy as np import pandas as pd import transformers import seaborn as sns import tensorflow as tf from sparknlp.base import * import plotly.express as px from tqdm.notebook import tqdm from pyspark.ml import Pipeline import matplotlib.pyplot as plt fr...
{ "alphanum_fraction": 0.4904176904, "author": null, "avg_line_length": 32.7931960609, "converted": null, "ext": "py", "file": null, "hexsha": "17e12e1df5078bd652dec29731f8a7708768af5a", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
immutable Uniform <: ContinuousUnivariateDistribution a::Float64 b::Float64 function Uniform(a::Real, b::Real) if a < b new(float64(a), float64(b)) else error("a < b required for range [a, b]") end end end Uniform() = Uniform(0.0, 1.0) @_jl_dist_2p Uniform unif entropy(d::Unif...
{ "alphanum_fraction": 0.5671175858, "author": null, "avg_line_length": 20.4468085106, "converted": null, "ext": "jl", "file": null, "hexsha": "37694ccf207552ab00191f3b0c0ff7489e1bb142", "include": null, "lang": "Julia", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
import chainer import numpy import pytest import chainerx from chainerx_tests import array_utils def _create_batch_norm_ndarray_args( xp, device, x_shape, gamma_shape, beta_shape, mean_shape, var_shape, float_dtype): x = array_utils.create_dummy_ndarray(xp, x_shape, float_dtype) # Non-conti...
{ "alphanum_fraction": 0.6666666667, "author": null, "avg_line_length": 38.9516129032, "converted": null, "ext": "py", "file": null, "hexsha": "926da6e1c91c2be81717e90eb21b09a362913ec1", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
""" _main_driver.py Copyright 2016 University of Melbourne. 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.6880793625, "author": null, "avg_line_length": 35.9590643275, "converted": null, "ext": "py", "file": null, "hexsha": "b18224b91d3f008be4d7f56d072a173b4ac76334", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
#!/usr/bin/env python # -*- coding: utf-8 -*- import pandas as pd from datetime import datetime, timedelta import numpy as np import math as m id import itertools import datetime from scipy.stats import ks_2samp import os import statistics from pysolar.solar import * from scipy.stats import pearsonr from scipy import s...
{ "alphanum_fraction": 0.6250717703, "author": null, "avg_line_length": 32.2530864198, "converted": null, "ext": "py", "file": null, "hexsha": "129d8e82b2cddb9a6c85d77439075d8da7e1c042", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
[STATEMENT] lemma f_expand_nth_mult: "\<And>n. \<lbrakk> n < length xs; 0 < k \<rbrakk> \<Longrightarrow> (xs \<odot>\<^sub>f k) ! (n * k) = xs ! n" [PROOF STATE] proof (prove) goal (1 subgoal): 1. \<And>n. \<lbrakk>n < length xs; 0 < k\<rbrakk> \<Longrightarrow> xs \<odot> k ! (n * k) = xs ! n [PROOF STEP] apply (i...
{ "alphanum_fraction": null, "author": null, "avg_line_length": null, "converted": null, "ext": null, "file": "AutoFocus-Stream_AF_Stream", "hexsha": null, "include": null, "lang": null, "length": 5, "llama_tokens": 653, "mathlib_filename": null, "max_forks_count": null, "max_forks_repo_fork...
# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
{ "alphanum_fraction": 0.7391653291, "author": null, "avg_line_length": 44.5, "converted": null, "ext": "py", "file": null, "hexsha": "d9aaf3fc78e69d05731d57295541f61f9af5f69e", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_count"...
# -*- coding: utf-8 -*- """ Modify on 2020年4月1日 @author: LXG Benchmark Code of Coupled PhaseDNN for ODE. """ import tensorflow as tf import numpy as np # ---------------------------------------------- my activations ----------------------------------------------- def srelu(x): return tf.nn.relu(1...
{ "alphanum_fraction": 0.6182909931, "author": null, "avg_line_length": 39.0794223827, "converted": null, "ext": "py", "file": null, "hexsha": "ea57fec66f53af30e47e4cae0c5c43b28af3d25f", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import math import numpy as np import torch from scipy import optimize from torch import nn as nn from torch import optim from torch.nn import functional as F from rlkit.state_distance.policies import UniversalPolicy from rlkit.pythonplusplus import identity from rlkit.torch import pytorch_util as ptu from rlkit.torc...
{ "alphanum_fraction": 0.5748518313, "author": null, "avg_line_length": 32.5736111111, "converted": null, "ext": "py", "file": null, "hexsha": "3f8406adee3514b5c035eaa9f30d82584f129fc5", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
from __future__ import absolute_import, division, print_function from scitbx.array_family import flex from scitbx.matrix import sqr from simtbx.nanoBragg import shapetype, nanoBragg from simtbx.nanoBragg.nanoBragg_crystal import NBcrystal from simtbx.nanoBragg.nanoBragg_beam import NBbeam from copy import deepcopy de...
{ "alphanum_fraction": 0.6949753524, "author": null, "avg_line_length": 31.0833333333, "converted": null, "ext": "py", "file": null, "hexsha": "336b9ca2b7215a05793ae755f6ae87bc062e7cad", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
# Copyright (c) 2021 Dai HBG """ 该代码定义2_num_num_num型运算符 """ import numpy as np import numba as nb def tssubset(a, b, delay, num_0, num_1): # 时序选择算子,回溯delay天,根据b的排序选出从num_0到num_1的子集,返回均值 if len(a.shape) == 2: s = np.zeros(a.shape) tmp_a = np.zeros((delay + 1, a.shape[0], a.shape[1])) t...
{ "alphanum_fraction": 0.5081192796, "author": null, "avg_line_length": 31.3611111111, "converted": null, "ext": "py", "file": null, "hexsha": "2072f83d8dd8d6436b063475e3aff3ea4eaff097", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
""" Author: Madhivarman contact: madhi@pluto7.com Project: Customer Segmentation Version: 1.0 """ import sys sys.path.append('F:/work projects/Dash Application') import pandas as pd import io import numpy as np from Cloud_API.storage import Storage from cluster_analysis import ClusterAnalysis cl...
{ "alphanum_fraction": 0.7292253521, "author": null, "avg_line_length": 28.9795918367, "converted": null, "ext": "py", "file": null, "hexsha": "a234bb43cc61414c5a98624840fe1f25b21efc8b", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import os, sys import json import time import StringIO from collections import Counter, defaultdict import subprocess import tempfile import urllib import h5py import numpy as np np.random.seed(10) import pandas as pd from flask import Flask, request, redirect, render_template, \ jsonify, send_from_directory, abort, ...
{ "alphanum_fraction": 0.7023943578, "author": null, "avg_line_length": 36.2081545064, "converted": null, "ext": "py", "file": null, "hexsha": "fb1a0af70218503d23bc23ca0383e63fe56ebfc0", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
/** * Copyright Soramitsu Co., Ltd. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ #include "common/default_constructible_unary_fn.hpp" // non-copyable value workaround #include "torii/impl/command_service_transport_grpc.hpp" #include <atomic> #include <condition_variable> #include <iterator> #in...
{ "alphanum_fraction": 0.5990128332, "author": null, "avg_line_length": 40.1984126984, "converted": null, "ext": "cpp", "file": null, "hexsha": "7d835dceb59ff1cf11155b319b1880ddf491489b", "include": null, "lang": "C++", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Make a Python class. See the README.md file and the GitHub wiki for more information. http://www.tomwhyntie.com """ #...for the future! from __future__ import absolute_import # Import the code needed to manage files. import os # from os.path import join as ...
{ "alphanum_fraction": 0.5676311782, "author": null, "avg_line_length": 28.437007874, "converted": null, "ext": "py", "file": null, "hexsha": "1aa212dec94a027d7757dd90a6c603bf142aae3d", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
using DelimitedFiles function generate_datasets(namedir, application_name, nbpoints) """ This function takes the full dataset and sets the first nbpoints points in a test set, then creates an ever growing train dataset by increments of nboints""" fulldataset = readdlm("examples/data/consolidated_d...
{ "alphanum_fraction": 0.72, "author": null, "avg_line_length": 31.7307692308, "converted": null, "ext": "jl", "file": null, "hexsha": "eb63054fbb39b4d3729e739b45d45235b06ce091", "include": null, "lang": "Julia", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_count"...
// -*- C++ -*- // // Package: Core // Class : FWConfiguration // // Implementation: // <Notes on implementation> // // Original Author: Chris Jones // Created: Fri Feb 22 15:54:29 EST 2008 // // system include files #include <stdexcept> #include <algorithm> #include <boost/bind.hpp> // user inc...
{ "alphanum_fraction": 0.6241236456, "author": null, "avg_line_length": 25.9338842975, "converted": null, "ext": "cc", "file": null, "hexsha": "98ac21c03d3c47e6383c90a63948b3d23e7ecd91", "include": null, "lang": "C++", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_...
# -*- coding: utf-8 -*- """ Created on Tue Feb 23 18:56:28 2021 @author: m1390 """ import numpy as np import matplotlib.pyplot as plt #%% class Cubic_Spline: def __init__(self, x, y, f=None): """ Parameters ---------- x : data points N-D vector. y...
{ "alphanum_fraction": 0.4238410596, "author": null, "avg_line_length": 26.9944134078, "converted": null, "ext": "py", "file": null, "hexsha": "3d266b310f8c1b70eeb8a4bd712864e0f744d966", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import numpy as np def assert_model(true_model, created_model, rtol=1.e-4, atol=1.e-6): assert len(true_model['model']) == len(created_model['model']) for i in range(len(true_model['model'])): true_tree = true_model['model'][i] created_tree = created_model['model'][i] assert np.allclos...
{ "alphanum_fraction": 0.6340110906, "author": null, "avg_line_length": 41.6153846154, "converted": null, "ext": "py", "file": null, "hexsha": "25e1fa8f508e4f64b1a8ce48ae2fa59721962738", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
# Rest of requiresments should be install via the program. cranRepo<-"http://cran.rstudio.com/" install.packages("optparse", repos=cranRepo) install.packages("rvest", repos=cranRepo) install.packages("gdata", repos=cranRepo) install.packages("ggplot2", repos=cranRepo) install.packages("xgboost", repos=cranRepo) install...
{ "alphanum_fraction": 0.7852760736, "author": null, "avg_line_length": 40.75, "converted": null, "ext": "r", "file": null, "hexsha": "f926c5391878602a8dff64cb6a00f67b2bb28769", "include": null, "lang": "R", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_count": nul...
#!/usr/bin/env python3 """ Uses a Kalman Filter to model the motion of each observed agent Can be used for constant velocity prediction if no observations supplied """ import numpy as np from pykalman import KalmanFilter class KFMulti(): """ Tracks multiple objects (without association) using pykalman ...
{ "alphanum_fraction": 0.5665680473, "author": null, "avg_line_length": 43.3333333333, "converted": null, "ext": "py", "file": null, "hexsha": "971140d14f9dd29edbf22f7ac788b71f3383f86d", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
[STATEMENT] lemma secret_parts_Spy_converse: " m \<in> initState Spy \<or> (\<exists>C B X. Says C B X \<in> set evs \<and> m \<in> parts{X}) \<or> (\<exists>C Y. Notes C Y \<in> set evs \<and> C \<in> bad \<and> m \<in> parts{Y}) \<Longrightarrow> m \<in> parts(knows Spy evs)" [PROOF STATE] proof (prove) goal (1 su...
{ "alphanum_fraction": null, "author": null, "avg_line_length": null, "converted": null, "ext": null, "file": "Inductive_Confidentiality_DolevYao_ConfidentialityDY", "hexsha": null, "include": null, "lang": null, "length": 6, "llama_tokens": 818, "mathlib_filename": null, "max_forks_count": nu...
import numpy as np import simtk.unit as unit def get_membrane_size(n_POPC = 0 , n_DPPC = 0 , n_DOPC = 0): surface_area_POPC = 68.3 * unit.angstroms**2 surface_area_DPPC = 63 * unit.angstroms**2 surface_area_DOPC = 69.7 * unit.angstroms**2 total_area_POPC = n_POPC * surface_area_POPC total_area...
{ "alphanum_fraction": 0.7110519308, "author": null, "avg_line_length": 27.8148148148, "converted": null, "ext": "py", "file": null, "hexsha": "91e8f3b1883e9c8ebdedbd2197a7cfe1c81f3e16", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
from pandas import Series, DataFrame from numpy import array, arange, log10, ndarray from .expected import _get_expected_digits_ from .constants import DIGS, REV_DIGS from .stats import Z_score from .checks import _check_num_array_, _check_sign_, _check_decimals_ def _set_N_(len_df, limit_N): """""" # Assigni...
{ "alphanum_fraction": 0.5812815415, "author": null, "avg_line_length": 29.1919642857, "converted": null, "ext": "py", "file": null, "hexsha": "b9773fb101cd63c92c72a48a8a64f359f19183b7", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import pandas as pd from albumentations.pytorch import ToTensorV2 from torch.utils.data import Dataset import cv2 import torch import numpy as np from torchvision import transforms from torch.utils.data import DataLoader import albumentations as alb import cv2 import torchvision import matplotlib.pyplot as plt from con...
{ "alphanum_fraction": 0.642272262, "author": null, "avg_line_length": 27.5211267606, "converted": null, "ext": "py", "file": null, "hexsha": "53af143587cde8b43b86f82593c3f84eb42aa6c5", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
""" This library defines classes that implement neural networks as well as a generic EA algorithm. """ import json import pickle import random import numpy as np def interpolate(val, min, max): """ Interpolates values between 0 and 1 to values between the specified min and max. Used primarily map...
{ "alphanum_fraction": 0.6530958439, "author": null, "avg_line_length": 41.7009646302, "converted": null, "ext": "py", "file": null, "hexsha": "87e4f00dcc9af6a4957b41e712d2fc050a138e45", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
#!/usr/bin/env python2 import sys import numpy as np from copy import deepcopy from fml.math import cho_solve from scipy.stats import pearsonr if __name__ == "__main__": ntrain = int(sys.argv[1]) ntest = int(sys.argv[2]) D = np.load("D.npy")[:ntrain,:ntrain] Ds = np.load("D.npy")[:ntrain,-ntest:] ...
{ "alphanum_fraction": 0.4880187025, "author": null, "avg_line_length": 23.4383561644, "converted": null, "ext": "py", "file": null, "hexsha": "15fe3815719ddf6cc75b140020557d2add8d16b1", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
#!/usr/bin/python # Filename: time_series.py ################### IMPORTS ####################### import pandas as pd from pandas import DataFrame import numpy as np #for whittacker smoother import scipy as sp import scipy.sparse import scipy.linalg from scipy.sparse.linalg import cg ##################################...
{ "alphanum_fraction": 0.5737945848, "author": null, "avg_line_length": 32.9441340782, "converted": null, "ext": "py", "file": null, "hexsha": "916f11a7b3223cc07035792f7ac59bcd4823dd0e", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Exercises 11.12, 11.13 from Kane 1985.""" from __future__ import division from sympy import pi, solve, symbols, trigsimp from sympy.physics.mechanics import ReferenceFrame, RigidBody, Point from sympy.physics.mechanics import dot, dynamicsymbols, inertia, msprint from u...
{ "alphanum_fraction": 0.661883738, "author": null, "avg_line_length": 31.9764705882, "converted": null, "ext": "py", "file": null, "hexsha": "12987ebff61aceb42363862f8b8a9b8b014bd4de", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
import torch import torch.nn as nn import torch.nn.functional as F import numpy as np class QLinearNetwork(nn.Module): def __init__(self, input_feature: ("int: input state dimension"), output_feature: ("output: action dimensions"), ): super(QLinearNetwork, sel...
{ "alphanum_fraction": 0.6397817578, "author": null, "avg_line_length": 44.3736842105, "converted": null, "ext": "py", "file": null, "hexsha": "bd0fd3c89c07b5dc2c52f93420b94253f556cc3b", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
\chapter{Built-in Objects} \section{Concrete Semantics} \subsection{Helper Functions} \[ \begin{array}{ll} \chf{getMatcher} & : \matcher \rightarrow (\SF{String} \times \SF{Int} \rightarrow \SF{MatchResult}) \\ \\ \chf{NewRegExp} & : \SF{Value} \times \SF{Bool} \times \SF{Bool} \times \SF{Bool} \times \matcher \r...
{ "alphanum_fraction": 0.5662845136, "author": null, "avg_line_length": 43.1500530223, "converted": null, "ext": "tex", "file": null, "hexsha": "3ffbc90f52e16500267919b7c3dfa2abbbb4f956", "include": null, "lang": "TeX", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks...
/* __ __ __ |__|__| | __ | | | ||__| ___ ___ __ | | | | | | | || | | | Ubiquitous Internet @ IIT-CNR | | | || | | | C++ edge computing libraries and tools |_______|__||__|__|__| https://github.com/ccicconetti/serverlessonedge Licensed under t...
{ "alphanum_fraction": 0.6235294118, "author": null, "avg_line_length": 32.5802997859, "converted": null, "ext": "cpp", "file": null, "hexsha": "d4d9f9eaf2a2ecf0cc42a4e2fa36adcfe7a90a59", "include": null, "lang": "C++", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks...
import logging import json import numpy as np from collections import OrderedDict from galaxy.utils import ontology def clean_replace(s, r, t, forward=True, backward=False): def clean_replace_single(s, r, t, forward, backward, sidx=0): # idx = s[sidx:].find(r) idx = s.find(r) if idx == -1:...
{ "alphanum_fraction": 0.57518064, "author": null, "avg_line_length": 35.016064257, "converted": null, "ext": "py", "file": null, "hexsha": "0301fee5da97648340aa6763cfddf88c9fcf5b8b", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_...
module Etcd using Requests using Memento import HttpCommon: Response immutable Client host::String port::Int version::String end include("constants.jl") include("requests.jl") include("api.jl") include("utils.jl") """ connect(host="localhost", port=2379, version="v2") Creates an `Etcd.Client` whic...
{ "alphanum_fraction": 0.6448230668, "author": null, "avg_line_length": 14.9607843137, "converted": null, "ext": "jl", "file": null, "hexsha": "70026e22ffcad036be94b3204c6b646564c7fce9", "include": null, "lang": "Julia", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
# Taken from Base: test/show.jl replstr(x, lim=true) = sprint((io,x) -> show(IOContext(io, :limit => lim, :displaysize => (24, 80)), MIME("text/plain"), x), x) showstr(x) = sprint((io,x) -> show(IOContext(io, :limit => true, :displaysize => (24, 80)), x), x) macro test_show(expr) esc(quote @test string...
{ "alphanum_fraction": 0.6221180644, "author": null, "avg_line_length": 140.9642857143, "converted": null, "ext": "jl", "file": null, "hexsha": "9f1b4d79c8b9454fdc426ec10efa77ebfd4f0796", "include": null, "lang": "Julia", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
Require Import String. Require Import List. Require Import Coq.Arith.EqNat. Module Export DeBruijn. Inductive lterm : Type := | Var : nat -> lterm | Lam : lterm -> lterm | App : lterm -> lterm -> lterm. End DeBruijn. Module PrettyTerm. Inductive pterm : Type := | Var : string -> pterm | Lam : string -> p...
{ "alphanum_fraction": null, "author": "knuton", "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_date...
[STATEMENT] lemma [simp]: "(u::'a) \<in> G" [PROOF STATE] proof (prove) goal (1 subgoal): 1. u \<in> G [PROOF STEP] by (simp add: G_def)
{ "alphanum_fraction": null, "author": null, "avg_line_length": null, "converted": null, "ext": null, "file": "PseudoHoops_Examples", "hexsha": null, "include": null, "lang": null, "length": 1, "llama_tokens": 67, "mathlib_filename": null, "max_forks_count": null, "max_forks_repo_forks_event...
from __future__ import division, print_function import itertools import numpy as np import healpy as hp def digitize_columns(data, bins): digitized = np.empty_like(data, dtype=int) for i in range(len(bins)): digitized[:, i] = np.digitize(data[:, i], bins=bins[i]) - 1 return digitized def binne...
{ "alphanum_fraction": 0.6557788945, "author": null, "avg_line_length": 27.1363636364, "converted": null, "ext": "py", "file": null, "hexsha": "d2de95247f99b6c36f05a8900c26bc351733b5a6", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
""" Original work Copyright (c) 2015 Mark Vismer Defines the interface for a DataSource class which provides the data for a plotter. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import weakref import traceback...
{ "alphanum_fraction": 0.6259185037, "author": null, "avg_line_length": 19.96, "converted": null, "ext": "py", "file": null, "hexsha": "f8f9c17363f2e93dbabb76dba6927f7b424a65c3", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_count...
[STATEMENT] lemma onorm_pos_lt: assumes f: "bounded_linear f" shows "0 < onorm f \<longleftrightarrow> \<not> (\<forall>x. f x = 0)" [PROOF STATE] proof (prove) goal (1 subgoal): 1. (0 < onorm f) = (\<not> (\<forall>x. f x = (0::'b))) [PROOF STEP] by (simp add: less_le onorm_pos_le [OF f] onorm_eq_0 [OF f])
{ "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": 138, "mathlib_filename": null, "max_forks_count": null, "max_forks_repo_forks_event_max_datetime": n...
# Lower and upper bounds to detect the pink color in the HSV color space # lower bound [142 102 184] # upper bound [255 255 255] import cv2 import numpy as np import time cap = cv2.VideoCapture(0) img = np.zeros((480,640,3),np.uint8) points = [] while True: # Reading frame _, frame = cap.read() ...
{ "alphanum_fraction": 0.618957941, "author": null, "avg_line_length": 34.6304347826, "converted": null, "ext": "py", "file": null, "hexsha": "5f041616949d53aedd42fd68003d1bdbd47d1faf", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
#!/usr/bin/env python #encoding=utf-8 ''' @Time : 2020/11/02 00:06:44 @Author : Zhiyang.zzy @Contact : zhiyangchou@gmail.com @Desc : ''' # here put the import lib from model.bert_classifier import BertClassifier import os import time from numpy.lib.arraypad import pad from tensorflow.python.ops.gen_io...
{ "alphanum_fraction": 0.6991525424, "author": null, "avg_line_length": 33.04, "converted": null, "ext": "py", "file": null, "hexsha": "9d9be5d9de24875443268809174fff2c8f393a2b", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_count...
program ex use gabriel use MPI implicit none integer,parameter :: n=10 integer,parameter :: s=2 real,dimension(:,:,:),allocatable :: a,b integer ierr,rank,right,left,mpisize,i,j,k integer hor,ver type(distribution) :: d call MPI_Init(ierr) call MPI_Comm_rank(MPI_COMM_WORLD,rank,ierr) call MP...
{ "alphanum_fraction": 0.6238286479, "author": null, "avg_line_length": 29.2941176471, "converted": null, "ext": "f90", "file": null, "hexsha": "2004b30d4287b02c94be68b103ae5731f0fdb4e5", "include": null, "lang": "FORTRAN", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_f...
# Code is based on https://github.com/sungyubkim/GBML # Here is our the main contribution that the initialization is made from word embeddings of labels import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import higher from gbml.gbml import GBML from utils import get_accuracy, apply_...
{ "alphanum_fraction": 0.6279126809, "author": null, "avg_line_length": 42.46875, "converted": null, "ext": "py", "file": null, "hexsha": "ba095d787c7f99d44303373fbaeac08ae13bcc3a", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_co...
from sklearn.model_selection import train_test_split import pandas as pd import numpy as np from sklearn.preprocessing import StandardScaler from sklearn.datasets import load_breast_cancer data = load_breast_cancer() print(data.DESCR) df = pd.DataFrame(data.data, columns=data.feature_names) df['target'] = data.target...
{ "alphanum_fraction": 0.7746781116, "author": null, "avg_line_length": 26.6285714286, "converted": null, "ext": "py", "file": null, "hexsha": "ca830d11be81758b82d3478fc74a4d6ded6841b8", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
[STATEMENT] lemma T_completeness: "Model wtFsym wtPsym arOf resOf parOf \<Phi> intT intF intP" [PROOF STATE] proof (prove) goal (1 subgoal): 1. Ik.MModel intT intF intP [PROOF STEP] by standard (rule completeness)
{ "alphanum_fraction": null, "author": null, "avg_line_length": null, "converted": null, "ext": null, "file": "Sort_Encodings_T", "hexsha": null, "include": null, "lang": null, "length": 1, "llama_tokens": 90, "mathlib_filename": null, "max_forks_count": null, "max_forks_repo_forks_event_max...
# -*- coding: utf-8 -*- # Copyright (C) 2021-2022 Textualization Software Ltd. # Distributed under the terms of the MIT License # https://mit-license.org/ import random import copy import sys import multiprocessing import numpy as np from wicked21st.graph import load_graph, Cascades from wicked21st.classes import Cl...
{ "alphanum_fraction": 0.6024729521, "author": null, "avg_line_length": 27.1848739496, "converted": null, "ext": "py", "file": null, "hexsha": "36aa54f280a002fe49d1d3dd205a1c3935c7c5c6", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import networkx as nx # import matplotlib.pyplot as plt ### # Load the Graph ### filename = 'dijkstraData.txt' DG = nx.DiGraph() with open(filename) as f: for line in f: # Parse the line parsed_line = line.rsplit('\t') node_from = int(parsed_line.pop(0)) # Get rid of the line ...
{ "alphanum_fraction": 0.5883561644, "author": null, "avg_line_length": 23.5483870968, "converted": null, "ext": "py", "file": null, "hexsha": "33b3d734a87da5904280cd4fb8f0fc7727e1ecad", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import matplotlib.pyplot as plt import numpy as np from matplotlib.collections import LineCollection # In order to efficiently plot many lines in a single set of axes, # Matplotlib has the ability to add the lines all at once. Here is a # simple example showing how it is done. N = 50 x = np.arange(N) # Here are many ...
{ "alphanum_fraction": 0.6977077364, "author": null, "avg_line_length": 36.7368421053, "converted": null, "ext": "py", "file": null, "hexsha": "8165ca87eab442d9c65ec46cf8ba843c2cd2d17f", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
# -*- coding: utf-8 -*- """ *GSASIIElem: functions for element types* ----------------------------------------- """ # Copyright: 2008, Robert B. Von Dreele & Brian H. Toby (Argonne National Laboratory) ########### SVN repository information ################### # $Date: 2019-01-17 14:31:32 -0600 (Thu, 17 Jan 2019) $ # ...
{ "alphanum_fraction": 0.5309750192, "author": null, "avg_line_length": 32.1309297913, "converted": null, "ext": "py", "file": null, "hexsha": "b2af7900bd42c07264ee4adab04f52111b97505d", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
__author__ = 'Fabian Isensee' import numpy as np import lasagne def batch_generator(data, target, BATCH_SIZE, shuffle=False): if shuffle: while True: ids = np.random.choice(len(data), BATCH_SIZE) yield data[ids], target[ids] else: for idx in range(0, len(data), BATCH_SIZ...
{ "alphanum_fraction": 0.6370896185, "author": null, "avg_line_length": 36.3548387097, "converted": null, "ext": "py", "file": null, "hexsha": "b9bfc040edeff4afbf89d41522980888b13d73a5", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import numpy as np import sympy as sym import sys import itertools import math import copy #Ii-Il can't be set to as positive True and real True because: #when substitue Im with fm, it will do like Im = sqrt(Im**2)replacement Ii = sym.symbols('Ii') Ij = sym.symbols('Ij') Ik = sym.symbols('Ik') Il = sym.symbols('Il') wi...
{ "alphanum_fraction": 0.5767392459, "author": null, "avg_line_length": 45.0119521912, "converted": null, "ext": "py", "file": null, "hexsha": "af8fedfb4f976aee28fe55b8c1be6249624923aa", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
from sstcam_sandbox import get_data, get_plot from sstcam_sandbox.d191122_dc_tf import get_dc_tf, get_ac_tf, get_ac_cc_tf from CHECLabPy.plotting.setup import Plotter import numpy as np from numba import guvectorize, float64 class TFPlot(Plotter): def plot(self, x, y, label=None): self.ax.plot(x, y, label...
{ "alphanum_fraction": 0.6717216771, "author": null, "avg_line_length": 31.8014184397, "converted": null, "ext": "py", "file": null, "hexsha": "64e9fcafe2e155c83b17ade45b0225565a495119", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import math import numpy as np import rospy import torch from geometry_msgs.msg import Twist from nav_msgs.msg import Odometry class Jackal: def __init__(self): self.dtype = torch.float self._linear_velocity = 1.5 self.x = 0.0 self.y = 0.0 self.q1 = 0.0 self.q2 = ...
{ "alphanum_fraction": 0.5812612613, "author": null, "avg_line_length": 25.9345794393, "converted": null, "ext": "py", "file": null, "hexsha": "8c5a2cca6457fdca9f34171f5701c6acce4bbf9f", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
immutable Point x y end
{ "alphanum_fraction": 0.8260869565, "author": null, "avg_line_length": 5.75, "converted": null, "ext": "jl", "file": null, "hexsha": "ffeee4ba22db697181762e0755170d1c4f50e745", "include": null, "lang": "Julia", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_count":...
# --- # title: 226. Invert Binary Tree # id: problem226 # author: Tian Jun # date: 2020-10-31 # difficulty: Easy # categories: Tree # link: <https://leetcode.com/problems/invert-binary-tree/description/> # hidden: true # --- # # Invert a binary tree. # # **Example:** # # Input: # # # # 4 # ...
{ "alphanum_fraction": 0.5797842135, "author": null, "avg_line_length": 23.1710526316, "converted": null, "ext": "jl", "file": null, "hexsha": "dd1244ef17e1fd220f1a65b7f9eb4de425a3ba06", "include": null, "lang": "Julia", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
(** Here we define the signature for the group quotient. We also derive its usual elimination principle. Given a group `G`, we define the group quotient as follows HIT group_quot G := | base : group_quot G | loop : ∏ (g : G), base = base | loop_e : loop e = idpath base | loop_m : ∏ (g₁ g₂ : G), loop (g₁ · g₂) = loop g...
{ "alphanum_fraction": null, "author": "UniMath", "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...
subroutine subqcdm(i1,i2,i3,i4,i5,i6,p156,p256,za,zb, & invtwog1Dc,invtwog2Dc,mc,aamp,bamp) c******************************************************************* c the matrix elements of the C helicity amplitudes for the QCD process c s(-p1)+cbar(-p2) --> l(p3)+abar(p4)+g(p5)+g(p6) c multiplie...
{ "alphanum_fraction": 0.4546537856, "author": null, "avg_line_length": 59.7888040712, "converted": null, "ext": "f", "file": null, "hexsha": "4fbb1d478240807dd2390c1af059adbd1bd9d0ed", "include": null, "lang": "FORTRAN", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import torch import torch.nn.functional as F import numpy as np import math from torch import nn device = torch.device("cuda" if torch.cuda.is_available() else "cpu") class ETMCOV(nn.Module): def __init__(self, num_topics, vocab_size, t_hidden_size, rho_size, emsize, theta_act, embeddings...
{ "alphanum_fraction": 0.6021937843, "author": null, "avg_line_length": 37.724137931, "converted": null, "ext": "py", "file": null, "hexsha": "9c1982d1b9f90175c2514b35c1bb2967686e0a14", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
module AgnosticBayesEnsemble using Optim export TDistPosteriorEstimation, GMatrix, dirichletPosteriorEstimation, dirichletPosteriorEstimationV2, dirichletPosteriorEstimation!, metaParamSearchValidationDirichlet, bootstrapPosteriorEstimation, bootstrapPosteriorEstimation!, ...
{ "alphanum_fraction": 0.7420924574, "author": null, "avg_line_length": 28.3448275862, "converted": null, "ext": "jl", "file": null, "hexsha": "ed664736afaa485669c1bcdc731f01185b1bc7de", "include": null, "lang": "Julia", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
using DataFrames mdata = readtable("original_data/mdata.csv") qdata = readtable("original_data/qdata.csv") # y/y log change in GDP, CPI, and IPindex GDP = (log(qdata[:GDPlev][5:end]) - log(qdata[:GDPlev][1:(end - 4)]))*100 INFL = (log(mdata[:CPI][13:end]) - log(mdata[:CPI][1:(end - 12)]))*100 IP = (log(mdata[:INDPRO]...
{ "alphanum_fraction": 0.6988304094, "author": null, "avg_line_length": 42.75, "converted": null, "ext": "jl", "file": null, "hexsha": "e80c206a4103aaf15e317a649945d35b786a1b8c", "include": null, "lang": "Julia", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_count"...
# Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). You may not # use this file except in compliance with the License. A copy of the License # is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file acc...
{ "alphanum_fraction": 0.4367689556, "author": null, "avg_line_length": 69.875, "converted": null, "ext": "py", "file": null, "hexsha": "c7b05815857074f2d30c97ce9526649bf40421d3", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_coun...
from CPAC.pipeline.schema import valid_options from CPAC.utils.docs import docstring_parameter def convert_pvalue_to_r(datafile, p_value, two_tailed=False): ''' Method to calculate correlation threshold from p_value Parameters ---------- datafile : string filepath to dataset to extract nu...
{ "alphanum_fraction": 0.6492875989, "author": null, "avg_line_length": 35.3544776119, "converted": null, "ext": "py", "file": null, "hexsha": "e8411dde33d1505b33f705e3a169524098d5c6f6", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
export Grid struct Grid cells::Array{Cell} starts::Array{Int64} exits::Array{Int64} end function get_empty(cells::Array{Cell}, x::Int64, y::Int64) xs = x > 0 ? [x] : shuffle!(collect(1:size(cells, 2))) ys = y > 0 ? [y] : shuffle!(collect(1:size(cells, 1))) for xi in xs for yi in ys ...
{ "alphanum_fraction": 0.4657534247, "author": null, "avg_line_length": 25.7042253521, "converted": null, "ext": "jl", "file": null, "hexsha": "8c64e4b3d25b97e572409658f12bf2560db93161", "include": null, "lang": "Julia", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
# -*- coding: utf-8 -*- # from helpers import assert_equality def plot(): import numpy as np import matplotlib.pyplot as plt fig, ax = plt.subplots(figsize=(17, 6)) ax.plot(np.array([1, 5]), label="Test 1") ax.plot(np.array([5, 1]), label="Test 2") ax.legend(ncol=2, loc="upper center") re...
{ "alphanum_fraction": 0.6402877698, "author": null, "avg_line_length": 20.85, "converted": null, "ext": "py", "file": null, "hexsha": "be16d6c88a7922b42412b21c005aa873fa8c27b6", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_count...
# coding: utf8 import numpy as np import argparse import math from time import clock, sleep from solo8 import Solo8 from pynput import keyboard import matplotlib.pyplot as plt from math import ceil import curves from multicontact_api import ContactSequence curves.switchToNumpyArray() DT = 0.001 KP = 4. KD = 0.05 KT = ...
{ "alphanum_fraction": 0.6975401951, "author": null, "avg_line_length": 34.1643192488, "converted": null, "ext": "py", "file": null, "hexsha": "ce0c3ffa3fa6e9b79bb7bfc76cfe0c9f235028ad", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Author : 河北雪域网络科技有限公司 A.Star # @contact: astar@snowland.ltd # @site: www.snowland.ltd # @file: color.py # @time: 2018/7/26 0:24 # @Software: PyCharm import numpy as np npa = np.array def rgb2ycbcr(img): origT = npa([[65.481, 128.553, 24.966], [-37.797, -74.203, ...
{ "alphanum_fraction": 0.5290010741, "author": null, "avg_line_length": 27.3823529412, "converted": null, "ext": "py", "file": null, "hexsha": "d160b7b2ca0f3b9d6fc2db03537338e3e370d4cc", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import numpy as np import shapefile from mpl_toolkits.basemap import Basemap from numpy import ndarray import matplotlib.pyplot as plt from matplotlib.patches import PathPatch from matplotlib.path import Path def rain_single_heatmap(rain: ndarray): # ============================================ 绘图参数准备 =========...
{ "alphanum_fraction": 0.6338220252, "author": null, "avg_line_length": 35.7682926829, "converted": null, "ext": "py", "file": null, "hexsha": "39c240b1abbbaf7cc9f65a897a31bffa729145d3", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
def lookupIDX(words,w): w = w.lower() if w in words: return words[w] else: return words['something'] def addOOVwords(examples, words, We, mean=0, sigma=0.01): import numpy as np dim = We[0].shape[0] next_idx = len(words) We_OOV = [] for example in ...
{ "alphanum_fraction": 0.5521367521, "author": null, "avg_line_length": 26.5909090909, "converted": null, "ext": "py", "file": null, "hexsha": "98bf13e7efbfdca2b12c039b513b0faea17fe641", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
"""Solution problems / methods / algorithms module""" import collections import cvxpy as cp import gurobipy as gp import itertools import numpy as np import pandas as pd import scipy.optimize import scipy.sparse as sp import typing import mesmo.config import mesmo.utils logger = mesmo.config.get_logger(__name__) c...
{ "alphanum_fraction": 0.5953950843, "author": null, "avg_line_length": 47.306923626, "converted": null, "ext": "py", "file": null, "hexsha": "1f8283682ce6bfbaf677fa280745b9186a9776a9", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
#pragma once #include <boost/algorithm/string.hpp> #include <string> namespace cnt { struct NoneCommand {}; struct UnknownCommand {}; struct PrintHelpCommand {}; struct PrintRecordsCommand {}; struct QuitCommand {}; struct AddRecordCommand { std::string recordName{}; explicit AddRecordCommand(std::string s) : re...
{ "alphanum_fraction": 0.6709068527, "author": null, "avg_line_length": 24.1287128713, "converted": null, "ext": "hpp", "file": null, "hexsha": "2198a9bc6498507a47193c2da67fdad1faa81936", "include": null, "lang": "C++", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks...
# check sparse matrix construction @test isequal(full(sparse(complex(ones(5,5),ones(5,5)))), complex(ones(5,5),ones(5,5))) # check matrix operations se33 = speye(3) do33 = ones(3) @test isequal(se33 * se33, se33) # check sparse binary op @test all(full(se33 + convert(SparseMatrixCSC{Float32,Int32}, se33)) == 2*eye(3)...
{ "alphanum_fraction": 0.5446267432, "author": null, "avg_line_length": 30.9390862944, "converted": null, "ext": "jl", "file": null, "hexsha": "5205120164e18f583bf61156c0d448f1ae89f826", "include": null, "lang": "Julia", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
import numpy as np import pandas as pd import os from main_db_script import get_id, append_non_duplicates, make_date_index from data_utils import hampel_filter, account_for_elev current_directory = os.path.dirname(__file__) data_dir = os.path.join(current_directory, '../HRSD') def qc_shallow_well_data(df): colum...
{ "alphanum_fraction": 0.662969809, "author": null, "avg_line_length": 38.6428571429, "converted": null, "ext": "py", "file": null, "hexsha": "05cee2358fda18c38fe9f818df01345cbaa5aa5d", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
#! /usr/bin/env python ############################################################################### # basicPID_wrapping.py # # Python code to wrap a very simple PID controller shared library # # NOTE: Any plotting is set up for output, not viewing on screen. # So, it will likely be ugly on screen. The saved P...
{ "alphanum_fraction": 0.6552783581, "author": null, "avg_line_length": 30.7056603774, "converted": null, "ext": "py", "file": null, "hexsha": "5d36fd4f03d2dd69a446fc9d9aa43738b47c4a82", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...