text stringlengths 0 1.25M | meta stringlengths 47 1.89k |
|---|---|
# fmt: off
from copy import copy, deepcopy
import numpy as np
import pandas as pd
from plotly import express as px
from plotly import graph_objects as go
from plotly.subplots import make_subplots
from scipy.interpolate import interp1d
from scipy.signal import argrelextrema
from ross.bearing_seal_element import Bearin... | {"hexsha": "f76f779bd6ce727822f531d1c6602fadb9572093", "size": 63891, "ext": "py", "lang": "Python", "max_stars_repo_path": "ross/api_report.py", "max_stars_repo_name": "hiagopinacio/ross", "max_stars_repo_head_hexsha": "1bc84061f23df455d9e37cb11b244ac795c836ad", "max_stars_repo_licenses": ["MIT"], "max_stars_count": n... |
#!/usr/bin/env python
#encoding=utf8
#Copyright [2014] [Wei Zhang]
#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 ... | {"hexsha": "24539829969e38a66d123ce69d883782cc6cd3e5", "size": 5292, "ext": "py", "lang": "Python", "max_stars_repo_path": "script/crtUserEvent.py", "max_stars_repo_name": "anthonylife/EventRecommendation", "max_stars_repo_head_hexsha": "d48c3311a657e43979b77de177318748d72ce76f", "max_stars_repo_licenses": ["Apache-2.0... |
import numpy as np
import cv2
import cv2.aruco as aruco
'''
drawMarker(...)
drawMarker(dictionary, id, sidePixels[, img[, borderBits]]) -> img
'''
aruco_dict = aruco.Dictionary_get(aruco.DICT_5X5_50) #creating aruco dictionary...250 markers and a marker size of 6x6 bits
print(aruco_dict)
# second para... | {"hexsha": "67c01a9ecb845e460c734b54133e31538db0316e", "size": 807, "ext": "py", "lang": "Python", "max_stars_repo_path": "SB#2726_Task2/aruco_generation.py", "max_stars_repo_name": "Shubham18091998/Supply-Bot", "max_stars_repo_head_hexsha": "971c3615697d5c3137caaa3aa9d96faf91968cb9", "max_stars_repo_licenses": ["MIT"]... |
import numpy as np
import matplotlib.pyplot as plt
step = 1000000
datadir= '/Users/yue/Library/Developer/Xcode/DerivedData/MoelansPhaseFieldFD-dkgbyukpiwflguerltsdaasmoecd/Build/Products/Debug/output/'
datadir= 'output/'
f1 = datadir + 'comp_' + str(step) +'.bin'
f2 = datadir + 'phi_' + str(step) +'.bin'
a1 = np.fro... | {"hexsha": "6446fac1c87e44b9f99792ea837f3c22fd79bd7a", "size": 632, "ext": "py", "lang": "Python", "max_stars_repo_path": "process/plot.py", "max_stars_repo_name": "gromitsun/MultiPhaseFieldFD", "max_stars_repo_head_hexsha": "f89f0382f06c2732d6ed140bf063e1e9e7656b41", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
import os
import sys
import cv2
import numpy as np
from cv2 import VideoWriter, VideoWriter_fourcc
from PIL import Image, ImageDraw, ImageFont
import crawler
import image_processing
import text_processing
from config import config
def main(title:str):
title = str(title)
fps = config['fps']
result, audio_... | {"hexsha": "b4731912f94092f74bbc3415b2c011fd82ebc50f", "size": 2816, "ext": "py", "lang": "Python", "max_stars_repo_path": "deprecated/main.py", "max_stars_repo_name": "Chthol1y/GadioVideo", "max_stars_repo_head_hexsha": "b0ef25ba6fab09fbf9b26d548b8a6573c5f9730a", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
!! R911 write-stmt
! is WRITE ( io-control-spec-list ) [ output-item-list ]
!
! Not tested here: io-control-spec-list and output-item-list.
write(5)
write(6,10)
write(6,10, ASYNCHRONOUS="YES") i
write(5, decimal="point", ERR=12, fmt=10) a, b, c
write(err=12, unit=5)
10 format(i5)
12 end
| {"hexsha": "81cac6b1222609f767e3f791f7b0e143cdd82412", "size": 293, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "tests/rule-tests/R911.f90", "max_stars_repo_name": "OpenFortranProject/ofp-sdf", "max_stars_repo_head_hexsha": "202591cf4ac4981b21ddc38c7077f9c4d1c16f54", "max_stars_repo_licenses": ["BSD-3-Claus... |
using Test
using CUDAnative, CuArrays, CUDAdrv
import Adapt, LLVM
include("util.jl")
@testset "CUDAnative" begin
@test CUDAnative.functional()
CUDAnative.version()
CUDAnative.enable_timings()
# see if we have a device to run tests on
# (do this early so that the codegen tests can target the same compute capabili... | {"hexsha": "38bef3723fb10fdd67f113fe5fea5072a07c2021", "size": 2580, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/runtests.jl", "max_stars_repo_name": "PhilipVinc/CUDAnative.jl", "max_stars_repo_head_hexsha": "bc12ed147398210e27aa1258abee336e2ca561bd", "max_stars_repo_licenses": ["MIT"], "max_stars_count"... |
import torch
import torch.nn as nn
from agent.util import conv_output_size
from .layer import LogicMachine
from torch.nn import functional as F
import numpy as np
class NLMAgent(nn.Module):
def __init__(
self,
obj_n,
depth,
breadth,
input_dims,
... | {"hexsha": "4fb0487a931d962b04118222ed95e7da54778c5d", "size": 5985, "ext": "py", "lang": "Python", "max_stars_repo_path": "agent/neural_logic/nlmagent.py", "max_stars_repo_name": "Spiph/GTG", "max_stars_repo_head_hexsha": "4a45032290d0c1364e4398684582c51094b245f5", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars... |
# _*_ coding: utf-8 _*_
import os
import pathlib
import datetime
import numpy as np
import pandas as pd
def product_filename(model=None, product=None, level=None, obs_time=None,
init_time=None, fhour=None, valid_time=None,
statistic=None, place=None, suffix=None, root_dir=No... | {"hexsha": "0fac8594c94ad7de86cd176e101ca4bb005b89a3", "size": 3630, "ext": "py", "lang": "Python", "max_stars_repo_path": "dk_met_base/filepath.py", "max_stars_repo_name": "guoyunqian/dk_met_base", "max_stars_repo_head_hexsha": "cf315fbb887d2ec7d8b028e24b9f161a2296543a", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
from chess.ChessGame import display
from chess.ChessLogic import Board
from chess.ChessUtil import *
from chess.ChessConstants import *
from chess.keras.NNet import NNetWrapper as NNet
from MCTS import MCTS
from utils import *
from _pickle import Unpickler
import numpy as np
import copy
from queue import Queue
import ... | {"hexsha": "1f6486d774db1f4b8bd52a1ac99b1043a207d2cc", "size": 24140, "ext": "py", "lang": "Python", "max_stars_repo_path": "chess/ChessPlayers.py", "max_stars_repo_name": "vinoo999/alpha-zero-general", "max_stars_repo_head_hexsha": "01bd6ac40d7b1fed97a84e37f7a549be8d50f668", "max_stars_repo_licenses": ["MIT"], "max_st... |
from os import listdir
from os import path
from ocgis import RequestDataset, OcgOperations
from ocgis.contrib import library_icclim as lic
from datetime import datetime as dt
from flyingpigeon.ocgis_module import call
from flyingpigeon.utils import get_values, get_time
from numpy import ma
import uuid
# p = '/home... | {"hexsha": "66a921a24f982390f74db841f5b92868d217f8b3", "size": 2526, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/ocgis_indices_percentile.py", "max_stars_repo_name": "Zeitsperre/flyingpigeon", "max_stars_repo_head_hexsha": "678370bf428af7ffe11ee79be3b8a89c73215e5e", "max_stars_repo_licenses": ["Apach... |
'''Module to plot some data for the EAGLE sim project
by Nicholas Zieleniewski of Durham University.'''
#Import
import numpy as np
import pylab
from matplotlib import cm #Colour maps
#Import custom modules
from spaxelfunc import r_values
import intensityprofiles as ip
#from DurhamModules.Maths import SimpleNumeric... | {"hexsha": "186982831fc962d18a54ffc14049187a69ddd0b2", "size": 1740, "ext": "py", "lang": "Python", "max_stars_repo_path": "Modules/plotdata.py", "max_stars_repo_name": "szieleniewski/CUBEGEN", "max_stars_repo_head_hexsha": "b3b4c160eebe53fa8bbd8a95390c3f755291586d", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_st... |
# -*- coding: utf-8 -*-
"""
Copyright () 2018
All rights reserved
FILE: sklearn_multi_linear_model.py
AUTHOR: tianyuningmou
DATE CREATED: @Time : 2018/3/6 下午5:15
DESCRIPTION: .
VERSION: : #1
CHANGED By: : tianyuningmou
CHANGE: :
MODIFIED: : @Time : 2018/3/6 下午5:15
"""
from numpy.linalg import inv
from numpy ... | {"hexsha": "88399f75ed506d12ae1e3714cec04d6e09e14c08", "size": 661, "ext": "py", "lang": "Python", "max_stars_repo_path": "machine_learn/sklearn_multi_linear_model.py", "max_stars_repo_name": "tianyuningmou/machine_learning", "max_stars_repo_head_hexsha": "7d58d03a83e1cf45040870b9ff88dc95cf712d01", "max_stars_repo_lice... |
*DECK DAINVG
SUBROUTINE DAINVG (RES, ADDA, NEQ, T, Y, YDOT, MITER,
1 ML, MU, PW, IPVT, IER )
EXTERNAL RES, ADDA
INTEGER NEQ, MITER, ML, MU, IPVT, IER
INTEGER I, LENPW, MLP1, NROWPW
DOUBLE PRECISION T, Y, YDOT, PW
DIMENSION Y(*), YDOT(*), PW(*), IPVT(*)
di... | {"hexsha": "957634a05798e1f15ac20075c52c961f0ac8d2c1", "size": 2056, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "src/f2cl/packages/odepack/dainvg.f", "max_stars_repo_name": "sbwhitecap/clocc-hg", "max_stars_repo_head_hexsha": "f6cf2591ceef8a3a80e04da9b414cdf60a25a90f", "max_stars_repo_licenses": ["MIT"], "ma... |
\section{The mathematics of calculating \gn{n}}
\label{sec:math_background}
This section will detail the mathematics of calculating correlation functions \gn{n}. If you are familiar with the results, you can safely skip this section, but do note that the correlation of photon events is in many ways distinct from a stan... | {"hexsha": "e6937d0a1c8ff4698ce775aed1c3f0a5f60f61d9", "size": 65216, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "doc/tex/math.tex", "max_stars_repo_name": "mktt2897/photon_correlation", "max_stars_repo_head_hexsha": "b5cb9376f883ff25f81521d4270d8dd7f750efb1", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_... |
[STATEMENT]
lemma translation_galois:
fixes a :: "'a::ab_group_add"
shows "T = ((\<lambda>x. a + x) ` S) \<longleftrightarrow> S = ((\<lambda>x. (- a) + x) ` T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. (T = (+) a ` S) = (S = (+) (- a) ` T)
[PROOF STEP]
using translation_assoc[of "-a" a S]
[PROOF STATE]
pr... | {"llama_tokens": 548, "file": null, "length": 5} |
"""
The ``earthpy`` spatial module provides functions that wrap around ``rasterio``
and ``geopandas`` to make it easier to manipulate raster raster and vector
data in Python.
"""
import os
import sys
import contextlib
import warnings
import numpy as np
from shapely.geometry import mapping, box
import geopandas as gpd
... | {"hexsha": "812710a64810762aaebc2232601355c5d0a34dfc", "size": 15826, "ext": "py", "lang": "Python", "max_stars_repo_path": "earthpy/spatial.py", "max_stars_repo_name": "Dineshchandrasekar/earthpy", "max_stars_repo_head_hexsha": "fec6dc0ce4161469ac1d5081b00833d4b8dfb14e", "max_stars_repo_licenses": ["BSD-3-Clause"], "m... |
"""
======================================
Topic models with Gaussian likelihoods
======================================
Quick demonstration that you can easily use bnpy to
perform mixed membership modeling of grouped data with *any* likelihood.
The basic idea is that we use the same Gaussian mixture model for each
g... | {"hexsha": "78c8ece9bdf0404638dc42fa36666f764cd7e3b9", "size": 7481, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/08_mocap6/plot-05-topic_model_gaussian_likelihood.py", "max_stars_repo_name": "zhaottcrystal/bnpy", "max_stars_repo_head_hexsha": "0195a0228e9e698799e52a6dfa1d051e82b43fd0", "max_stars_re... |
""" functions to deal with clargs """
import sys
import numpy as np
def get_args():
""" get args from command line """
args = sys.argv
dot_py_ix = np.where([".py" in arg for arg in args])[0][0]
args = args[(dot_py_ix + 1) :]
return args
| {"hexsha": "c425e430d8bcef736b13b4e7e288cfa01ca62427", "size": 260, "ext": "py", "lang": "Python", "max_stars_repo_path": "doors/clargs.py", "max_stars_repo_name": "chechir/doors", "max_stars_repo_head_hexsha": "57d1bc7871e42bff255a9d01ef1d6b0894763e40", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 2, "max_st... |
import tensorflow as tf
from tensorflow.keras.preprocessing.image import ImageDataGenerator
import numpy as np
from matplotlib.pyplot import imread
from sklearn.metrics import confusion_matrix , accuracy_score
from sklearn.metrics import precision_score, recall_score, f1_score
from utils.create_model import cre... | {"hexsha": "eba3ed5f2990777a2cf7cd228b49b5f518a4b22e", "size": 9348, "ext": "py", "lang": "Python", "max_stars_repo_path": "utils/k_fold_separate.py", "max_stars_repo_name": "rishavpramanik/CervicalFuzzyDistanceEnsemble", "max_stars_repo_head_hexsha": "c9d529aff492d75b6a1afe184f7b41dc4edca221", "max_stars_repo_licenses... |
#pragma once
/*
Implementation of the abstract transfer functions by reducing them
to abstract domain operations.
These are the main Crab statements for which we define their abstract
transfer functions:
ARITHMETIC and BOOLEAN
x := y bin_op z;
x := y;
assume (cst)
assert ... | {"hexsha": "c86c01735d097cf7882703fc166722323d740170", "size": 33714, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "include/crab/analysis/abs_transformer.hpp", "max_stars_repo_name": "aziem/crab", "max_stars_repo_head_hexsha": "e150afd53d6fe49cefaade389542b3f3cfe9dbe5", "max_stars_repo_licenses": ["Apache-2.0"],... |
# -*- coding: utf-8 -*-
"""
Gaussian Process Posterior Predictive
=====================================
Hello world
"""
# sphinx_gallery_thumbnail_number = 4
import numpy as np
import tensorflow_probability as tfp
import matplotlib.pyplot as plt
from scribbles.datasets.synthetic import synthetic_sinusoidal, make_r... | {"hexsha": "a33fb9ebb91d42b7c83fdac05c26e48df3fa94c8", "size": 3529, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/gaussian_processes/plot_gp_posterior_predictive.py", "max_stars_repo_name": "ltiao/scribbles", "max_stars_repo_head_hexsha": "9f30ea92ee348154568a7791751634d1feaba774", "max_stars_repo_li... |
import numpy
from entities.band import Band
from entities.scene_id import SceneID
from entities.true_color import TrueColor
from entities.interfaces.scene_interface import SceneInterface
from utils import logging, utils
logger = logging.getLogger(__name__)
class Scene(SceneInterface):
def __init__(self, scene_id... | {"hexsha": "fa2c001624dc32c59c5323d4358b2150eaa8d97a", "size": 2510, "ext": "py", "lang": "Python", "max_stars_repo_path": "gits/entities/scene.py", "max_stars_repo_name": "BabyCakes13/GlacierImagePredictor", "max_stars_repo_head_hexsha": "07665dee1a6f77cf5b10da81df5cca880e2e8551", "max_stars_repo_licenses": ["Apache-2... |
# -*- coding: utf-8 -*-
# ---
# jupyter:
# jupytext:
# cell_metadata_filter: collapsed,title
# formats: ipynb,py:percent
# notebook_metadata_filter: all
# rst2md: false
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version... | {"hexsha": "681e0cb2b6bfba09e12077e91c596c8dff2f273b", "size": 22178, "ext": "py", "lang": "Python", "max_stars_repo_path": "notebooks/DCEGM-Upper-Envelope.py", "max_stars_repo_name": "MridulS/DemARK", "max_stars_repo_head_hexsha": "ac10e6e48dfb758d33fe67efb3b60237402fe3b4", "max_stars_repo_licenses": ["Apache-2.0"], "... |
from tqdm import tqdm
import numpy as np
import matplotlib.pyplot as plt
import torch
from utilities import *
from VoxelGrid import *
import os
import argparse
import time as tm
t_start = tm.time()
parser = argparse.ArgumentParser(
description='Compute a voxel grid from images, with spherical harmonics')
parser.a... | {"hexsha": "2496a019df42adef307c9aa979aad2cadc3481b6", "size": 2199, "ext": "py", "lang": "Python", "max_stars_repo_path": "main_carve_sph.py", "max_stars_repo_name": "nissmar/Radiance-Fields", "max_stars_repo_head_hexsha": "f990e22c2ed8caee0ba485d0438fb7e1624470a9", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
#
# estimate and plot a chi-squared distribution with error bounds
#
from scipy import stats
import matplotlib.pyplot as plt
import numpy as np
#
# file_out='/Users/riser/Desktop/ocean.569A/chi-sq.nu=10.confidence.limits.jpg'
#
# define the number of degrees of freedom
#
nu=10
#
# define the arrays
#
nn=1000
xx=np.zer... | {"hexsha": "dac144c9007a26e20df1188e8a607ec8b72128b9", "size": 3718, "ext": "py", "lang": "Python", "max_stars_repo_path": "ErrorAnalysis_Code/ErrorAnalysis.py", "max_stars_repo_name": "mmstoll/Ocean569_Code", "max_stars_repo_head_hexsha": "228cb719f3e82f187f704f343d3b3590a38236d7", "max_stars_repo_licenses": ["MIT"], ... |
"""
Given a .pycgr file generated by [OsmToRoadGraph](https://github.com/AndGem/OsmToRoadGraph) from an exported .osm file from [OpenStreetMaps](https://www.openstreetmap.org/), generate an adjacency list representation of the road graph
```sh
python OsmToRoadGraph/run.py -f ./Auckland.osm -n c
```
The generated .pycg... | {"hexsha": "c44ee67135a5f647f9c79eb241b27892bd330752", "size": 7862, "ext": "py", "lang": "Python", "max_stars_repo_path": "merge_edges.py", "max_stars_repo_name": "ddl37/RoadGraphs", "max_stars_repo_head_hexsha": "99c365951f49cc848582dca1e255210a2eeb9465", "max_stars_repo_licenses": ["AFL-1.1"], "max_stars_count": nul... |
[STATEMENT]
lemma root_point:
"disjoint_set_forest p \<Longrightarrow> point x \<Longrightarrow> point (root p x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<lbrakk>(coreflexive (p[[p]]) \<and> times_top_class.total p) \<and> pd_kleene_allegory_class.acyclic (p - (1::'a)); point x\<rbrakk> \<Longrightarrow> ... | {"llama_tokens": 393, "file": "Relational_Disjoint_Set_Forests_Disjoint_Set_Forests", "length": 2} |
/*
* #%L
* OME-FILES C++ library for image IO.
* Copyright © 2014 - 2015 Open Microscopy Environment:
* - Massachusetts Institute of Technology
* - National Institutes of Health
* - University of Dundee
* - Board of Regents of the University of Wisconsin-Madison
* - Glencoe Software, Inc.
* %%
* Red... | {"hexsha": "7807655fe476fd00529d884c39a4a758e4d4bfc9", "size": 6001, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "libexec/info/info.cpp", "max_stars_repo_name": "rleigh-dundee/bioformats-cpp", "max_stars_repo_head_hexsha": "e8e3c03cab4d00edb96f40aa2b86bc7c99d6588c", "max_stars_repo_licenses": ["BSD-2-Clause"], ... |
\chapter*{Mou Mou's Individual Contribution Report}
\blindtext
\section*{Contributions}
\blindtext
\section*{Inspiration and Exploration}
\blindtext
\section*{Skills and Knowledge Acquisition}
\blindtext | {"hexsha": "252cd8215771257db8c122a33612d4b6b0333acc", "size": 210, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "individual/report.tex", "max_stars_repo_name": "yihuajack/SJTU-Thesis-JI-Adaption", "max_stars_repo_head_hexsha": "ab90f841262b86e6fa209adbe47525cfdc4d54ee", "max_stars_repo_licenses": ["Apache-2.0"]... |
import tensorflow as tf
from tensorflow.keras.optimizers import SGD, Adam
import numpy as np
from losses.dv_loss import DINELoss, DVLoss
from metrics.dine_ndt_metrics import DINE_NDT_Metrics, MINE_NDT_Metrics
from trainers.saver import DINE_NDT_vis, MINE_vis
import os
def build_trainer(model, data, config):
if co... | {"hexsha": "5c2fb654f408f26f1caba1132c70179abf2dc4c6", "size": 19940, "ext": "py", "lang": "Python", "max_stars_repo_path": "trainers/trainer.py", "max_stars_repo_name": "DorTsur/dine_ndt", "max_stars_repo_head_hexsha": "3a07064b1d37da12c36e679a9b1de6a32ae42689", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1... |
function mylayer = riverplot_draw_layer(x_loc, n_rects, varargin)
%
% This is a subfunction of the riverplot toolbox.
% - Draws a series of rects at an x location x_loc, number specified by n_rects
% - rect1 and rect2 are structures created by riverplot_rect.m
% - Ribbon covers a specified percentage of each rect
% ... | {"author": "canlab", "repo": "CanlabCore", "sha": "af242e120f0480c4feaeea90471c015a14f1f60e", "save_path": "github-repos/MATLAB/canlab-CanlabCore", "path": "github-repos/MATLAB/canlab-CanlabCore/CanlabCore-af242e120f0480c4feaeea90471c015a14f1f60e/CanlabCore/Visualization_functions/riverplot/riverplot_draw_layer.m"} |
import csv
import logging
import numpy as np
from abc import ABC, abstractmethod
# Constants (default values unless provided by caller)
MAX_STEPS = 2000
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
logger = logging.getLogger(__name__)
class EpisodeStats(... | {"hexsha": "f0e88b7b55b2c8597d368585912702a3e1cb5677", "size": 6299, "ext": "py", "lang": "Python", "max_stars_repo_path": "Assignment 4/solvers/base.py", "max_stars_repo_name": "yuhu0016/machine-learning-cs7641", "max_stars_repo_head_hexsha": "b746acb1573317ff1ba2fbf72a6f9bac667f340d", "max_stars_repo_licenses": ["MIT... |
import numpy as np
import pytest
from arc.definitions import Constants as cst
from arc.grid_methods import (
connect,
get_boundary,
gridify,
mirror_order,
norm_points,
rotational_order,
translational_order,
)
from arc.types import BoardData, Grid
@pytest.fixture(scope="module")
def board_d... | {"hexsha": "08318af542e819726c57436f1f48087a3544baa6", "size": 5018, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_grid_methods.py", "max_stars_repo_name": "dereklarson/ARC_study", "max_stars_repo_head_hexsha": "ba299e82d162ee317caa14739faa96989ea0cf31", "max_stars_repo_licenses": ["Apache-2.0"], "m... |
from IPython.display import clear_output, display, HTML
import ipywidgets as ipw
import numpy as np
import io
import os
import pandas as pd
import altair as alt
from collections import defaultdict
from .description import drg, table_text
from .emutils import read_data as emread_data
from . import cases, CASE_DATADIR
fr... | {"hexsha": "7148b992f8413269788363469688eff58bf56b36", "size": 8868, "ext": "py", "lang": "Python", "max_stars_repo_path": "cdsutils/aeutils.py", "max_stars_repo_name": "melbourne-cdth/mms_explore_mimic2", "max_stars_repo_head_hexsha": "e89bfdbb25386b6fb7bf3e845ba233f034910162", "max_stars_repo_licenses": ["CC0-1.0"], ... |
import torch
from torch.nn import Module
from torch.nn import KLDivLoss
from torch.autograd import Variable
import numpy as np
class emd_loss(Module):
def forward(self, input, target):
input_cdf = torch.cumsum(input, dim=1)
target_cdf = torch.cumsum(target, dim=1)
wass_dist = torch.mean(t... | {"hexsha": "f13acdf7006ed3163554032760752067159ad31a", "size": 809, "ext": "py", "lang": "Python", "max_stars_repo_path": "losses.py", "max_stars_repo_name": "williamdjones/ma721_hw1", "max_stars_repo_head_hexsha": "6c5bdea9363a24cd3ccb5cee2cf9203a6f62b716", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, ... |
# -*- coding: utf-8 -*-
"""Imports PLasTiCC datasets to bcolz."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import os.path
import shutil
import bcolz
import pandas as pd
import numpy as np
import pathlib
from justice import path_util
... | {"hexsha": "61563d1cef6821dfa2e6bbf941a1392f77bb894e", "size": 3326, "ext": "py", "lang": "Python", "max_stars_repo_path": "justice/datasets/plasticc_bcolz.py", "max_stars_repo_name": "aimalz/justice", "max_stars_repo_head_hexsha": "2edcb471cd01d6659a498bcd0209cb5dae83375a", "max_stars_repo_licenses": ["MIT"], "max_sta... |
/-
Copyright (c) 2022 Joël Riou. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Joël Riou
! This file was ported from Lean 3 source module category_theory.localization.construction
! leanprover-community/mathlib commit 1a5e56f2166e4e9d0964c71f4273b1d39227678d
! Please... | {"author": "leanprover-community", "repo": "mathlib4", "sha": "b9a0a30342ca06e9817e22dbe46e75fc7f435500", "save_path": "github-repos/lean/leanprover-community-mathlib4", "path": "github-repos/lean/leanprover-community-mathlib4/mathlib4-b9a0a30342ca06e9817e22dbe46e75fc7f435500/Mathlib/CategoryTheory/Localization/Constru... |
import numpy as np
import scipy.stats
from questplus import QuestPlus
from questplus.psychometric_function import weibull
import matplotlib.pyplot as plt
def plot(q):
fig, ax = plt.subplots(2, 2, figsize=(10,8))
ax[0, 0].plot(q.param_domain['threshold'],
q.posterior.sum(dim=['lower_asymptot... | {"hexsha": "0b3dc1e537e0e1c8f7c0c31af03ae650e87f4e87", "size": 9072, "ext": "py", "lang": "Python", "max_stars_repo_path": "venv/Lib/site-packages/questplus/demos/run_qp.py", "max_stars_repo_name": "mintzer/pupillometry-rf-back", "max_stars_repo_head_hexsha": "cfa86fa984a49dce0123798f8de5b838c02e10d5", "max_stars_repo_... |
# *****************************************************************************
# Copyright (c) 2019, Intel Corporation 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 sou... | {"hexsha": "bca3f174b1636ffd480748a99fe26481c585478f", "size": 10521, "ext": "py", "lang": "Python", "max_stars_repo_path": "sdc/set_ext.py", "max_stars_repo_name": "sklam/sdc", "max_stars_repo_head_hexsha": "36340f991c9354e626dea6d3511f3f81d09448aa", "max_stars_repo_licenses": ["BSD-2-Clause"], "max_stars_count": null... |
[STATEMENT]
lemma enabled_qsend_indis:
assumes "enabled cf \<omega>" "qsend (cf ## \<omega>) \<le> n" "qsend (cf ## \<omega>) \<le> m"
shows "snd ((cf ## \<omega>) !! n) \<approx> t \<longleftrightarrow> snd ((cf ## \<omega>) !! m) \<approx> t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. (snd ((cf ## \<omega>... | {"llama_tokens": 1587, "file": "Probabilistic_Noninterference_Trace_Based", "length": 14} |
import os.path as op
import numpy as np
import pycuda.gpuarray as gpuarray
from pycuda.compiler import SourceModule
from ..improc_types import int3
from ..utils import gpufeature
from ..cuda import asgpuarray, flat_kernel_config
__dirname__ = op.dirname(__file__)
@gpufeature
def tvdenoising3d(dat... | {"hexsha": "5d278f53ba69759b288bdcb28aad6a4b93499b9f", "size": 1544, "ext": "py", "lang": "Python", "max_stars_repo_path": "survos2/improc/features/tv.py", "max_stars_repo_name": "DiamondLightSource/SuRVoS2", "max_stars_repo_head_hexsha": "42bacfb6a5cc267f38ca1337e51a443eae1a9d2b", "max_stars_repo_licenses": ["MIT"], "... |
"""
Experiment for XGBoost + RI
Aim: To find the best m and ntree(num_round)
m: [100, 120, 140, 160]
ntree: [140, 160, 180, 200, 220, 240, 260]
Averaging 20 models
Summary
loss ntree
m
100 0.450670 240
120 0.450491 220
140 0.449575 220
160 0.449249 220 *
Time: 2:56:52 on ... | {"hexsha": "4165e6476a4706e3c08d4f7c953ff7e9da35d825", "size": 4061, "ext": "py", "lang": "Python", "max_stars_repo_path": "exp_XGB_RI_m_ntree.py", "max_stars_repo_name": "duthchao/kaggle-otto", "max_stars_repo_head_hexsha": "37620176c6795419457ff96363fa85d3375152c0", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
import numpy as np
import math
from numpy import *
import random
def coco_rand_uniform(dim,seed):
#random.seed(seed)
uniftmp = np.random.uniform(low=0.5, high=(seed), size=(1,dim))
return uniftmp
def coco_rand_gauss( dim, seed):
g = np.ones((1,dim), dtype=np.float64)
unif... | {"hexsha": "706bf4612ebcb9db1a019feb9334cb7484199a65", "size": 3605, "ext": "py", "lang": "Python", "max_stars_repo_path": "weierstrasspackage/F_weierstrass.py", "max_stars_repo_name": "aryamtos/compiladores-weierstrass", "max_stars_repo_head_hexsha": "6ff779a692b0268d3b53d5fd87577315c9b4e34c", "max_stars_repo_licenses... |
[STATEMENT]
lemma if_redT_known_addrs_new:
assumes redT: "mthr.if.redT s (t, ta) s'"
shows "if.known_addrs_state s' \<subseteq> if.known_addrs_state s \<union> new_obs_addrs_if \<lbrace>ta\<rbrace>\<^bsub>o\<^esub>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. if.known_addrs_state s' \<subseteq> if.known_addrs... | {"llama_tokens": 8946, "file": "JinjaThreads_MM_JMM_Framework", "length": 56} |
// see LICENSE.txt
#include <graphene/chain/database.hpp>
#include <graphene/chain/account_object.hpp>
#include <graphene/chain/fund_object.hpp>
#include <graphene/chain/asset_object.hpp>
#include <graphene/chain/vesting_balance_object.hpp>
#include <graphene/chain/witness_object.hpp>
#include <graphene/chain/setting... | {"hexsha": "caf08e0f283e8f4b1d8f138afd3bd4de4334ab3d", "size": 23717, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "libraries/chain/db_balance.cpp", "max_stars_repo_name": "EDCBlockchain/blockchain", "max_stars_repo_head_hexsha": "41c74b981658d79d770b075191cfb14faeb84dab", "max_stars_repo_licenses": ["MIT"], "ma... |
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'],
'obs_filter': ['filter_none', 'filter_with_random'],
'var_filter': ['filter_with_random'],
'output': 'output.h5mu'
}
mdata = mu.r... | {"hexsha": "9c08bb2bd1bf12c04a43cd26c1d223898a904521", "size": 1956, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/filter/do_filter/script.py", "max_stars_repo_name": "openpipeline-bio/openpipeline", "max_stars_repo_head_hexsha": "1e030961303b21b4351503cdc5f0a25d2879d094", "max_stars_repo_licenses": ["MIT"... |
(*
Author: René Thiemann
Sebastiaan Joosten
Akihisa Yamada
License: BSD
*)
section \<open>Algebraic Numbers -- Excluding Addition and Multiplication\<close>
text \<open>This theory contains basic definition and results on algebraic numbers, namely that
algebraic num... | {"author": "data61", "repo": "PSL", "sha": "2a71eac0db39ad490fe4921a5ce1e4344dc43b12", "save_path": "github-repos/isabelle/data61-PSL", "path": "github-repos/isabelle/data61-PSL/PSL-2a71eac0db39ad490fe4921a5ce1e4344dc43b12/SeLFiE/Example/afp-2020-05-16/thys/Algebraic_Numbers/Algebraic_Numbers_Prelim.thy"} |
[STATEMENT]
lemma new\<^sub>S\<^sub>h\<^sub>a\<^sub>d\<^sub>o\<^sub>w\<^sub>R\<^sub>o\<^sub>o\<^sub>t_ptr_in_heap:
assumes "new\<^sub>S\<^sub>h\<^sub>a\<^sub>d\<^sub>o\<^sub>w\<^sub>R\<^sub>o\<^sub>o\<^sub>t h = (new_shadow_root_ptr, h')"
shows "new_shadow_root_ptr |\<in>| shadow_root_ptr_kinds h'"
[PROOF STATE]
pr... | {"llama_tokens": 773, "file": "Shadow_DOM_classes_ShadowRootClass", "length": 4} |
cd(@__DIR__); include("setups/distROT_distTSD_ratio.jl")
gr(dpi = 200)
## (a) P64
include("setups/path64.jl")
ρ1 = generate_ROT_TSD_ratio(nsim, 𝚽, ∇𝚽, 𝛌, Q)
# plt = ROT_TSD_ratio_histogram(ρ1)
# savefig(plt, "../figs/Path64_ROT_TSD.png")
## (b) P₇ x P₃
include("setups/grid7x3.jl")
ρ2 = generate_ROT_TSD_ratio(nsim,... | {"hexsha": "aeb57df04e5f960e24406d28d7e7f33549771aad", "size": 1204, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/dissertations/htli/scripts/Figure4.1.jl", "max_stars_repo_name": "BoundaryValueProblems/MTSG.jl", "max_stars_repo_head_hexsha": "8cf8e2b3035876b5ceda45109b0847a60b581a7c", "max_stars_repo_lice... |
full_adderCout <= ((((( not ( full_adderA ) ) and full_adderB) or (( not ( full_adderB ) ) and full_adderA)) and full_adderCin) or (full_adderA and full_adderB));
full_adderS <= ((( not ( ((( not ( full_adderA ) ) and full_adderB) or (( not ( full_adderB ) ) and full_adderA)) ) ) and full_adderCin) or (((( not ( full_... | {"hexsha": "e81b631517023c7feedca1998d089c66285b3284", "size": 427, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "tests/v/staff.out/end2end/full_adder.f", "max_stars_repo_name": "Deshiuu/351lab-code-copy", "max_stars_repo_head_hexsha": "4d1fdf1f119c6798332c662dee99dd29d7a01520", "max_stars_repo_licenses": ["BS... |
# coding: utf-8
# author Yuichi Yasuda @ quattro corporate design
# copyright quattro corporate design. All right reserved.
from .weatherdata import WeatherDataFile
import struct
import math
import numpy as np
import pandas as pd
import csv
class EpwFile(WeatherDataFile):
# コンストラクタの定義
def __init__(self, ... | {"hexsha": "148ca56c7ff447741ccc203c815e3b69e4c64dee", "size": 5704, "ext": "py", "lang": "Python", "max_stars_repo_path": "weapy/epwfile.py", "max_stars_repo_name": "TRNSYSJP/weapy", "max_stars_repo_head_hexsha": "6e0cebe8be9f7d89894f2800dbf3b3074184d265", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "... |
subroutine outconnect(matp)
parameter (nume=40000)
parameter (nume2=20000)
common/bk06/nprnt,mprint,itmpop,numelt,jprint,idump,locstr
common /pcracktip/ connect(4,nume2), node(2,nume2),
> penta(nume2),ndflag(2,nume2), numnpt, numeltu, ndc
dimension matp(*)
integer numelt,... | {"hexsha": "5f402bd7fc9eac7762072b4330c5351fae11dcb6", "size": 985, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "src/outconnect.f", "max_stars_repo_name": "imohame/LabCode", "max_stars_repo_head_hexsha": "b7fca6e58f6c26917ff4a8862ab473da282d027d", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "... |
from itertools import zip_longest
import numpy as np
import sklearn.utils
def grouper(iterable, n, fillvalue=None):
"Collect data into fixed-length chunks or blocks"
# grouper('ABCDEFG', 3, 'x') --> ABC DEF Gxx"
args = [iter(iterable)] * n
return zip_longest(*args, fillvalue=fillvalue)
def load_kmer... | {"hexsha": "1455f9173559a159403d491702b38de8f0f2948a", "size": 7223, "ext": "py", "lang": "Python", "max_stars_repo_path": "vl/data.py", "max_stars_repo_name": "hurwitzlab/viral-learning", "max_stars_repo_head_hexsha": "8d7aebc0d58fa32a429f4a47593452ee2722ba82", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1,... |
//==================================================================================================
/**
Copyright 2016 NumScale SAS
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
**/
//====================================... | {"hexsha": "ea987a1a1061ba6a5288cc928498dba7b0780203", "size": 685, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "third_party/boost/simd/function/simd/twopower.hpp", "max_stars_repo_name": "xmar/pythran", "max_stars_repo_head_hexsha": "dbf2e8b70ed1e4d4ac6b5f26ead4add940a72592", "max_stars_repo_licenses": ["BSD-3... |
""" Testing out MPI optimization with pyopt_sparse"""
import os
import unittest
import numpy as np
from openmdao.api import IndepVarComp, ExecComp, LinearGaussSeidel, Component, \
ParallelGroup, Problem, Group
from openmdao.core.mpi_wrap import MPI
from openmdao.test.mpi_util import MPITestCase
from openmdao.test... | {"hexsha": "bf4bbbb73f9ce5c8507a8244df21c76174a62998", "size": 17207, "ext": "py", "lang": "Python", "max_stars_repo_path": "mpitest/test_mpi_opt.py", "max_stars_repo_name": "naylor-b/OpenMDAO1", "max_stars_repo_head_hexsha": "49d82f6601b33db9bdcf7d146d030d55e3b62ef4", "max_stars_repo_licenses": ["Apache-2.0"], "max_st... |
import numpy as np
def problem( x ):
f1 = x[0]
f2 = 1 - 1/(4*np.pi**2) * (x[0]+np.pi)**2 +\
(abs(x[1] - 5*np.cos(x[0]) ))**(1/3.)\
+ (abs( x[2]- 5*np.sin(x[0]) ))**(1/3.)
return [f1, f2]
def bounds():
return np.array([[-np.pi, -5.,-5.],[np.pi,5.,5.]]) | {"hexsha": "c8d39fe45c86134880869296778aa8db8433928e", "size": 290, "ext": "py", "lang": "Python", "max_stars_repo_path": "test_functions/oka2.py", "max_stars_repo_name": "panos108/Multi-objective-Bayesian-Opt", "max_stars_repo_head_hexsha": "1500a9db8c427d79b4631df9b96cddb8980bc8a2", "max_stars_repo_licenses": ["MIT"]... |
////////////////////////////////////////////////////////////////////////////////
/// \copyright MIT License ///
/// \author Caylen Lee ///
/// \date 2019 ... | {"hexsha": "4ac125df812eab538664b203de78c5a2cc61c189", "size": 9633, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "engine/src/Controller.cpp", "max_stars_repo_name": "zhec9/renemo", "max_stars_repo_head_hexsha": "3c6bb860022407d3a52c5b988771918041a23c64", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nu... |
from __future__ import print_function
import argparse
import getpass
import json
import datetime
import base64
import sys
import csv
import os
from future.utils import iteritems
import dateutil.parser
from dateparser import parse as relative_parser
import numpy as np
import pandas as pd
from jira import JIRA, JIRAEr... | {"hexsha": "c34596cd85a0ddaf741368aac11b41d51987988f", "size": 32444, "ext": "py", "lang": "Python", "max_stars_repo_path": "jira_metrics_extract/cli.py", "max_stars_repo_name": "The-Capital-Group-Companies-Inc/jira-metrics-extract", "max_stars_repo_head_hexsha": "31bca6865a7518a61bc196ff7066235d0b0444b8", "max_stars_r... |
SUBROUTINE resid(res,u,rhs,n)
INTEGER n
DOUBLE PRECISION res(n,n),rhs(n,n),u(n,n)
INTEGER i,j
DOUBLE PRECISION h,h2i
h=1.d0/(n-1)
h2i=1.d0/(h*h)
do 12 j=2,n-1
do 11 i=2,n-1
res(i,j)=-h2i*(u(i+1,j)+u(i-1,j)+u(i,j+1)+u(i,j-1)-4.d0*u(i,
*j))+... | {"hexsha": "cc5ae3fc0f41cad06a87a7c9e33184669a3a81b8", "size": 516, "ext": "for", "lang": "FORTRAN", "max_stars_repo_path": "NR-Functions/Numerical Recipes- Example & Functions/Functions/resid.for", "max_stars_repo_name": "DingdingLuan/nrfunctions_fortran", "max_stars_repo_head_hexsha": "37e376dab8d6b99e63f6f1398d0c33d... |
import os
import random
import math
import json
import numpy as np
import pandas as pd
from scipy import stats
from scipy import sparse
from scipy.stats import poisson
from scipy.optimize import nnls
from fdr import qvalues
from sklearn.linear_model import ElasticNet
from sklearn.linear_model import Lasso
from sklearn.... | {"hexsha": "af6526626bdc4371d8f06517c6e436df37cf51e2", "size": 45731, "ext": "py", "lang": "Python", "max_stars_repo_path": "DubSeq/dubseq/fitness.py", "max_stars_repo_name": "Asplund-Samuelsson/dubdub", "max_stars_repo_head_hexsha": "f05d620f203406c048d0d22ad4a2fc0bda04a50d", "max_stars_repo_licenses": ["MIT"], "max_s... |
[STATEMENT]
lemma "VARS H
{p\<noteq>0 \<and> [p \<mapsto> x] ** List H q qs}
H := H(p \<mapsto> q)
{List H p (p#qs)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. {p \<noteq> 0 \<and> [p \<mapsto> x] ** List B.0 q qs}
H := H(p \<mapsto> q)
{List H p (p # qs)}
[PROOF STEP]
apply vcg
[PROOF STATE]
proof (prove)
g... | {"llama_tokens": 1020, "file": null, "length": 8} |
import numpy as np
import pandas as pd
import os
import nltk
from nltk.corpus import stopwords, twitter_samples
from nltk.stem import PorterStemmer
from nltk.tokenize import TweetTokenizer
import re
import pickle
from collections import OrderedDict
import torch
from src.config import cfg
from gensim.models import FastT... | {"hexsha": "66b526521438c44c8c9ac49de5a5522e09480ec9", "size": 6200, "ext": "py", "lang": "Python", "max_stars_repo_path": "flask-ui/src/utils/embeddings.py", "max_stars_repo_name": "Kau5h1K/ds5500-userprivacy-deploy", "max_stars_repo_head_hexsha": "38c91d20596163427b4f169c9ee221057ac438ce", "max_stars_repo_licenses": ... |
#==============================================================================
# AUTHOR: MAHNOOR ANJUM
# EMAIL: manomaq@gmail.com
# DATE: 17/12/2018
# CODE REFERENCE: https://www.swharden.com
# DESCRIPTION: Live Volume Meter in Python
#=========================================================================... | {"hexsha": "c1cf985392f394436dcfc18b130b8947f4e3be9e", "size": 760, "ext": "py", "lang": "Python", "max_stars_repo_path": "VUMeter_text.py", "max_stars_repo_name": "mahnooranjum/VUMeter_Utility", "max_stars_repo_head_hexsha": "be8267472cbb97d80f057f4de8bfb9289ceaeebd", "max_stars_repo_licenses": ["MIT"], "max_stars_cou... |
""" test on batch of images """
# python eval.py --trained_model=weights/yolact_base_31999_800000.pth --score_threshold=0.15 --top_k=15 --images=data/coco/JPEGImages:results
""" check webcam device id """
# ls -ltrh /dev/video*
""" use live webcam """
# python eval.py --trained_model=weights/yolact_base_31999_800000.... | {"hexsha": "8a221280874348eb9e55804126a6dd240f825577", "size": 46939, "ext": "py", "lang": "Python", "max_stars_repo_path": "eval.py", "max_stars_repo_name": "avasalya/yolact", "max_stars_repo_head_hexsha": "14c9eceae0432219084f9157c5ea00a246ff1cc6", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_sta... |
"""Implementation of the Dynamic Frienemy Pruning (DFP) algorithm for online
pruning of base classifiers.
References
----------
Oliveira, D.V.R., Cavalcanti, G.D.C. and Sabourin, R., Online Pruning
of Base Classifiers for Dynamic Ensemble Selection,
Pattern Recognition, vol. 72, December 2017, pp 44-58.
Cruz, Rafael ... | {"hexsha": "82dd981e0f8028d9af2b9f89960832e694d957b4", "size": 4337, "ext": "py", "lang": "Python", "max_stars_repo_path": "deslib/util/dfp.py", "max_stars_repo_name": "vishalbelsare/DESlib", "max_stars_repo_head_hexsha": "64260ae7c6dd745ef0003cc6322c9f829c807708", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_star... |
# -*- coding: utf-8 -*-
"""
Created on Mon Nov 27 12:23:15 2017
@author: alex_
"""
import numpy as np
import flarepy.synthetic_data_generation as gen
import matplotlib.pyplot as plt
from scipy import signal
import os
#import sunpy.timeseries as ts
#import pandas as pd
lis_markers = ['x','+','1','2','3','4','o','v', '... | {"hexsha": "a64ded7e67ab0f64455f3dccd5d281a67c2a4b6d", "size": 15846, "ext": "py", "lang": "Python", "max_stars_repo_path": "flarepy/examples/tutorials/OLD/wavelet_functions_02b_generate_dummy_data.py", "max_stars_repo_name": "Alex-Ian-Hamilton/flarepy", "max_stars_repo_head_hexsha": "e441fcfebb6bf68bfb0070155b8659eb86... |
import numpy as np
from matplotlib import pyplot as plt
from sklearn.metrics import roc_auc_score, roc_curve
def plot_train_process(train_loss, val_loss, train_accuracy, val_accuracy, title_suffix=''):
fig, axes = plt.subplots(1, 2, figsize=(15, 5))
axes[0].set_title(' '.join(['Loss', title_suffix]))
axe... | {"hexsha": "116e4fae31211075631a23f7ede21b8162da0747", "size": 1203, "ext": "py", "lang": "Python", "max_stars_repo_path": "homeworks/homework01_word_vectors/utils.py", "max_stars_repo_name": "SnetkovR/made_nlp_course", "max_stars_repo_head_hexsha": "056a86c9b6bf17f8cddf9d95f178c3f2a9cd777f", "max_stars_repo_licenses":... |
def np_reshape_safe(A, shape, just_warn=False):
'''
ndarray.reshape has the potential to create a copy. This will will raise an exception or issue
a warning if a copy would be made.
'''
import warnings
res = A.view()
if just_warn:
try:
res.shape = shape
except Att... | {"hexsha": "4c9c3e3a1f504edfbe9126107f06325c9d41baad", "size": 662, "ext": "py", "lang": "Python", "max_stars_repo_path": "blmath/numerics/numpy_ext.py", "max_stars_repo_name": "metabolize/blmath", "max_stars_repo_head_hexsha": "8ea8d7be60349a60ffeb08a3e34fca20ef9eb0da", "max_stars_repo_licenses": ["BSD-2-Clause"], "ma... |
[STATEMENT]
lemma explode_add [simp]:
"String.explode (s + t) = String.explode s @ String.explode t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. literal.explode (s + t) = literal.explode s @ literal.explode t
[PROOF STEP]
by (fact plus_literal.rep_eq) | {"llama_tokens": 104, "file": "JinjaThreads_Basic_Auxiliary", "length": 1} |
[STATEMENT]
lemma path_prefix_extr_l:
"\<lbrakk>hd l = hd l'; l' \<noteq> []\<rbrakk> \<Longrightarrow> prefix (AHIS (hfs_valid_prefix ainfo uinfo l nxt))
(extr_from_hd l')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<lbrakk>hd l = hd l'; l' \<noteq> []\<rbrakk> \<Longrightarrow> prefix (AHIS (h... | {"llama_tokens": 640, "file": "IsaNet_Parametrized_Dataplane_3_directed", "length": 2} |
/*
* Distrubuted under The MIT License (MIT)
*
* Copyright (c) 2016 Aaron Bishop
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the... | {"hexsha": "c877958ccbe8367cd50dcf95aa3bb93d9c258cb4", "size": 7346, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "src/util/ip.cpp", "max_stars_repo_name": "Erroneous1/brewpipp", "max_stars_repo_head_hexsha": "73b65f0c7f78920fa1f65b787ed19f5b3681ffcd", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1.0, ... |
using ExcelReaders
function getdice2016excelparameters(filename)
p = Dict{Symbol,Any}()
T = 100
#Open DICE_2016 Excel File to Read Parameters
f = openxl(filename)
p[:a0] = getparams(f, "B108:B108", :single, "Parameters",1)#Initial level of total factor productivity
p[:a1] = getparams... | {"hexsha": "bc58aa9057fe35b32f38db28fa831ec4cf397302", "size": 10815, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/parameters.jl", "max_stars_repo_name": "davidanthoff/MimiDICE2016.jl", "max_stars_repo_head_hexsha": "9b4e5ba5eb9c6cfaec2e825f603b8b095e6ba4b7", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
SubRoutine CLS
*
* Clears the screen.
* Put machine dependent code here.
*
Character Esc,Clear_String*6
Esc=CHAR(27)
Clear_String(1:1)=Esc
Clear_String(2:2)='['
Clear_String(3:3)='H'
Clear_String(4:4)=Esc
Clear_String(5:5)='['
Clear_String(... | {"hexsha": "87a51feeea7d52716071feb2781c97b01dcc93fc", "size": 393, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "test/animated_pendulum_cls.f", "max_stars_repo_name": "kurtsansom/ftnchek", "max_stars_repo_head_hexsha": "cb5b24689fec20e0dac4d158ae57a5b7387e9723", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
[STATEMENT]
lemma clauseTrueRemoveDuplicateLiterals:
shows "clauseTrue c v = clauseTrue (remdups c) v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. clauseTrue c v = clauseTrue (remdups c) v
[PROOF STEP]
by (induct c) (auto simp add: clauseTrueIffContainsTrueLiteral) | {"llama_tokens": 102, "file": "SATSolverVerification_CNF", "length": 1} |
#!/usr/bin/python3
from frc971.control_loops.python import control_loop
from frc971.control_loops.python import controls
import numpy
import scipy
import sys
from matplotlib import pylab
import gflags
import glog
FLAGS = gflags.FLAGS
gflags.DEFINE_bool('plot', False, 'If true, plot the loop response.')
def PlotDi... | {"hexsha": "be4fb81d5612e9900542a34e9f267255a19827a5", "size": 13637, "ext": "py", "lang": "Python", "max_stars_repo_path": "y2017/control_loops/python/shooter.py", "max_stars_repo_name": "AustinSchuh/971-Robot-Code", "max_stars_repo_head_hexsha": "99abc66fd2d899c0bdab338dc6f57dc5def9be8d", "max_stars_repo_licenses": [... |
Cecilia EscamillaGreenwald is originally from the small town of Chico. She is married to David Greenwald. After graduation she realized that Davis could Stay in Davis become her home. She formerly served as chair of the Davis Human Relations Commission and was the first president of the Davis College Democrats. Escamil... | {"hexsha": "20551ac2cdc55894371eb1178d275999611a3b86", "size": 747, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "lab/davisWiki/Cecilia_Escamilla-Greenwald.f", "max_stars_repo_name": "voflo/Search", "max_stars_repo_head_hexsha": "55088b2fe6a9d6c90590f090542e0c0e3c188c7d", "max_stars_repo_licenses": ["MIT"], "m... |
[STATEMENT]
lemma interpret_floatarith_FDERIV_floatarith_append:
assumes iD: "\<And>i j. i < DIM('a) \<Longrightarrow> isDERIV i (fa) (list_of_eucl x @ params)"
assumes m: "max_Var_floatarith fa \<le> DIM('a) + length params"
shows "((\<lambda>x::'a::executable_euclidean_space.
interpret_floatarith fa (list... | {"llama_tokens": 4997, "file": "Affine_Arithmetic_Floatarith_Expression", "length": 21} |
"""
In this example, we compute the time correlation function of the
rotations of the side chain of a trp residue
"""
using M3GTools
println(" Loading Plots... ")
using Plots
ENV["GKSwstype"]="nul" # This supresses the need of a display while plotting
# Initialize simulation data and path to VMD executable
println... | {"hexsha": "1d5a5561a50534c2bc90a95134f0cd096b160a5b", "size": 1729, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "examples/tcf/tcf.jl", "max_stars_repo_name": "mcubeg/M3GTools", "max_stars_repo_head_hexsha": "48ab02a23f0095e7964bfb047836f090f8d35331", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 2, "... |
import numpy as np
from evalml.preprocessing.data_splitters.sampler_base import SamplerBase
from evalml.utils.woodwork_utils import infer_feature_types
class BalancedClassificationSampler(SamplerBase):
"""Class for balanced classification downsampler.
Arguments:
sampling_ratio (float): The smallest ... | {"hexsha": "0250b05e3c3df1368c6c7fdc66e7775f6ee9b42b", "size": 5997, "ext": "py", "lang": "Python", "max_stars_repo_path": "evalml/preprocessing/data_splitters/balanced_classification_sampler.py", "max_stars_repo_name": "ObinnaObeleagu/evalml", "max_stars_repo_head_hexsha": "3b5bf62b08a5a5bc6485ba5387a08c32e1857473", "... |
# Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | {"hexsha": "60ec9997f4a7ce6f1572a84faac3cc6597d2c37d", "size": 2974, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_api/test_PINNs.py", "max_stars_repo_name": "Liu-xiandong/PaddleScience", "max_stars_repo_head_hexsha": "5e667a4fe6138c22e0ff54af81d83a0b7cae4572", "max_stars_repo_licenses": ["Apache-2.... |
import math
import numpy as np
import starmatrix.constants as constants
import starmatrix.elements as elements
import starmatrix.matrix as matrix
from starmatrix.imfs import select_imf
from starmatrix.abundances import select_abundances
from starmatrix.dtds import select_dtd, dtd_correction
from starmatrix.functions im... | {"hexsha": "99678d673ab1f054603a32f1175f4534faad63bf", "size": 11420, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/starmatrix/model.py", "max_stars_repo_name": "xuanxu/intergalactic", "max_stars_repo_head_hexsha": "961349405b33bbc622cdcda505f08a500c77f3eb", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
import seaborn as sns
import numpy as np
import cv2
import time
import tensorflow as tf
"""
@ brief: draw boxes and put texts on image or video frames
@ param:
img: raw image which readed directly by `cv2.imread()`
boxes_dicts: best bboxes results after running model and filted bboxes by NMS
class_na... | {"hexsha": "97376db67c41748b903359b03eed423f6bb33d0a", "size": 2561, "ext": "py", "lang": "Python", "max_stars_repo_path": "official/projects/yolo3/utils/interface.py", "max_stars_repo_name": "tf-models/docs", "max_stars_repo_head_hexsha": "a80194e933d686285ab2fa85ad178faebd32f4a5", "max_stars_repo_licenses": ["Apache-... |
import os
import time
import threading
import requests
import pyaudio
import numpy as np
import anal
import json
import websocket
try:
import thread
except ImportError:
import _thread as thread
from core import config
from core import message
from core import preprocessing
from core import record
from core imp... | {"hexsha": "2390587445cefb0a4d99dd1466e235bfd6111273", "size": 10248, "ext": "py", "lang": "Python", "max_stars_repo_path": "door_phone/core/demo.py", "max_stars_repo_name": "averak/2021_f", "max_stars_repo_head_hexsha": "aac9eb5bdaf99e16760ce8b706be5beb3e14c948", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
function runge_kutta(y0::Float64, t0::Float64, h::Float64, steps::Int, func::AbstractString)
result = Float64[]
t_array = Float64[]
expression = parse(func)
global y = y0
global t = t0
push!(result, y0)
push!(t_array, t0)
for i = 2:(steps+1)
tn = t
kn1 = eval(express... | {"hexsha": "9a05cc1f30371a60ad023d7902fcad4d78d4c0bb", "size": 846, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "math/runge-kutta_method/Julia/runge-kutta_method.jl", "max_stars_repo_name": "CarbonDDR/al-go-rithms", "max_stars_repo_head_hexsha": "8e65affbe812931b7dde0e2933eb06c0f44b4130", "max_stars_repo_licen... |
import os
import time
import random
import numpy as np
import torch
from .models import EncoderLayer, Actor
from .converter import graphGoalConverter
from grid2op.Agent import BaseAgent
class Agent(BaseAgent):
def __init__(self, env, state_mean, state_std, **kwargs):
self.name = "Kait"
self.device... | {"hexsha": "5bfd990228f73f4153223f5d0b860fa0de808c86", "size": 11876, "ext": "py", "lang": "Python", "max_stars_repo_path": "old/src/baseline_agents/Kait/agent.py", "max_stars_repo_name": "horacioMartinez/L2RPN", "max_stars_repo_head_hexsha": "11e13a60a568b8ad7f9c6de060ac8c41784ced96", "max_stars_repo_licenses": ["MIT"... |
from typing import Dict, cast
import matplotlib
import numpy as np
from rio_tiler.types import ColorMapType, ColorTuple
def make_biomass_colormap() -> ColorMapType:
biomass = matplotlib.colors.LinearSegmentedColormap.from_list(
"chloris-biomass",
[
"#c6c875",
"#77a865",
... | {"hexsha": "927b929c4445cc629ea60b13eab37aac3fb95691", "size": 787, "ext": "py", "lang": "Python", "max_stars_repo_path": "pctiler/pctiler/colormaps/chloris.py", "max_stars_repo_name": "gadomski/planetary-computer-apis", "max_stars_repo_head_hexsha": "53a04c0b24b9ccc06812bfb8ac2961bbfe58a108", "max_stars_repo_licenses"... |
"""
Examples
-------
An AIA map
.. plot::
:include-source: true
import astropy.units as u
from astropy.coordinates import SkyCoord
from sunpy.net import Fido, attrs as a
from sunpy.map import Map
from sunpy.coordinates.frames import HeliographicStonyhurst
from stixpy.vis.map_reprojection import ... | {"hexsha": "0fed0fbcf2ed88216597153e91010c4f3bb9a23c", "size": 7940, "ext": "py", "lang": "Python", "max_stars_repo_path": "stixpy/vis/map_reprojection.py", "max_stars_repo_name": "nicHoch/stixpy", "max_stars_repo_head_hexsha": "cdb86094995590da36f3ae5e01f4ca4b9aac819c", "max_stars_repo_licenses": ["BSD-3-Clause"], "ma... |
import numpy as np
from scipy.integrate import RK45, quad_vec
import scipy.linalg
"""A function which uses a fast algorithm to evolve a constant-coupling system
Given parameters which specify an N-level Hamiltonian with no more than N couplings of
constant magnitude and fixed detuning, uses a fast algorithm to s... | {"hexsha": "78cb5db8f717c7b80d37da95f4660736838989be", "size": 24882, "ext": "py", "lang": "Python", "max_stars_repo_path": "evolution_functions.py", "max_stars_repo_name": "ewolf20/NLevelSolver", "max_stars_repo_head_hexsha": "b790a583a0eb0ee22f6b6e0a7d5708ab1a21c373", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
classdef constrained_quadratic
% This file defines constrained quadratic problem class
%
% Inputs:
% Q a positive definite matrix of size nxn
% p a column vector of size n
% A a matrix of size nxm
% b a column vector of size m
% G a matrix ... | {"author": "hiroyuki-kasai", "repo": "SGDLibrary", "sha": "d19a12559c79c3726683243885b15f982f4bec3d", "save_path": "github-repos/MATLAB/hiroyuki-kasai-SGDLibrary", "path": "github-repos/MATLAB/hiroyuki-kasai-SGDLibrary/SGDLibrary-d19a12559c79c3726683243885b15f982f4bec3d/problem/constrained_quadratic.m"} |
from typing import List, Tuple
import numpy as np
from tdw.tdw_utils import TDWUtils
from magnebot import MagnebotController, ActionStatus, Arm
class Convex(MagnebotController):
"""
Test how often the Magnebot can grasp a strangely-shaped object.
"""
# A list of medium-sized objects that have at leas... | {"hexsha": "e68c21c04929878edb839a53f5eb5d6d86b14765", "size": 4326, "ext": "py", "lang": "Python", "max_stars_repo_path": "controllers/tests/convex.py", "max_stars_repo_name": "alters-mit/magnebot", "max_stars_repo_head_hexsha": "97641717ad7964a67e24d11379b7aa04693b38d2", "max_stars_repo_licenses": ["MIT"], "max_stars... |
{"mathlib_filename": "Mathlib.Topology.Order.Lattice", "llama_tokens": 0} | |
[STATEMENT]
lemma lookup_of_nat:
"lookup (of_nat n) k = (of_nat n when k = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. lookup (of_nat n) k = (of_nat n when k = (0::'b))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
1. lookup (of_nat n) k = (of_nat n when k = (0::'b))
[PROOF STEP]
have ... | {"llama_tokens": 614, "file": null, "length": 8} |
import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)
with warnings.catch_warnings():
warnings.filterwarnings("ignore")
import argparse
import datetime
import os
from boto3 import client, resource
# initializing setup
from pycaret.classification import *
from sagemaker_containers.beta.... | {"hexsha": "93720b5bf1de1fa25e12dd1956f1a7749be719c0", "size": 3690, "ext": "py", "lang": "Python", "max_stars_repo_path": "sagemaker/ModConversion/trader/pycaret_sagemaker_ModConversion_trader.py", "max_stars_repo_name": "sgavmp/tfm_ml_code", "max_stars_repo_head_hexsha": "fb5b3f5a9e97f05416f005e0ab38f32d6e27eeee", "m... |
import tensorflow as tf
from tensorflow.contrib import learn
import numpy as np
import os
import time
import csv
import datetime
import data_controller
from Model import Model
# ==================
# Parameter settings
# ==================
flags = tf.flags
# ==Data==
flags.DEFINE_string("positive_data_file", "./data/... | {"hexsha": "20dfbe0bae2addc32ff4fa3cfebf65677a5faf0e", "size": 17464, "ext": "py", "lang": "Python", "max_stars_repo_path": "sentence_classification.py", "max_stars_repo_name": "Danboruya/gr-rnn-sentence-calcification", "max_stars_repo_head_hexsha": "765745b8a2b2e7bc8aba7e8fb71269e52bea03be", "max_stars_repo_licenses":... |
#include <iostream>
#include <boost/asio.hpp>
/* Using asio's asynchronous functionality means having a callback function
that will be called when an asynchronous operation completes. */
void print(const boost::system::error_code & /*e*/)
{
std::cout<<"hello,world and Mr.chen !"<<std::endl;
}
int main()
{
b... | {"hexsha": "1a63b0b9f4c1b5fc4d5ef837327f703d7784d29f", "size": 505, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "Concurrent_programming/asio/tutorial/asyn_timer.cpp", "max_stars_repo_name": "ai-chen2050/Boot_chenLearning", "max_stars_repo_head_hexsha": "4543080e2c2173a498a4836e3176524ed26ecb29", "max_stars_repo... |
module Structure.Operator.Proofs.Util where
import Lvl
open import Data
open import Data.Tuple
open import Functional hiding (id)
open import Function.Equals
import Function.Names as Names
import Lang.Vars.Structure.Operator
open Lang.Vars.Structure.Operator.Select
open import Logic.IntroInstances
ope... | {"hexsha": "3da926bccdd5fa6bde402ced10159bffa504d189", "size": 6764, "ext": "agda", "lang": "Agda", "max_stars_repo_path": "Structure/Operator/Proofs/Util.agda", "max_stars_repo_name": "Lolirofle/stuff-in-agda", "max_stars_repo_head_hexsha": "70f4fba849f2fd779c5aaa5af122ccb6a5b271ba", "max_stars_repo_licenses": ["MIT"]... |
[STATEMENT]
lemma P2_closeda: "P2 x \<longrightarrow> (\<forall>y. (P1 (s(x)) y \<longrightarrow> P1 (s(x)) (s(y))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. P2 x \<longrightarrow> (\<forall>y. P1 (s x) y \<longrightarrow> P1 (s x) (s y))
[PROOF STEP]
using A3 P1_def P2_def
[PROOF STATE]
proof (prove)
using t... | {"llama_tokens": 262, "file": "Boolos_Curious_Inference_Boo2", "length": 2} |
# https://docs.opencv.org/3.4/dc/d7d/tutorial_py_brief.html
# brief is used to generate smaller descriptor lists
import cv2
import numpy as np
# filename = 'logo/gray/c280.jpg'
# gray = cv2.imread(filename)
filename = 'in/logo.jpg'
img = cv2.imread(filename)
# gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
# Initiate F... | {"hexsha": "e5af889cb5edaa1cb2fb2cf8ce350319426ff4bf", "size": 790, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests_matching/Learn/07_brief_detection.py", "max_stars_repo_name": "epfl-sdf/logomatch", "max_stars_repo_head_hexsha": "01ceb0ad6ee7a2fca8316b8ee0b4f6044d03a7ae", "max_stars_repo_licenses": ["MIT"... |
#!/usr/bin/env python
# coding: utf-8
# In[338]:
import pandas as pd
import matplotlib.pyplot as plt
import re
import nltk
from nltk.corpus import stopwords
from nltk.stem import PorterStemmer
from nltk.stem import WordNetLemmatizer
from sklearn.feature_extraction.text import CountVectorizer, TfidfVectorizer
from s... | {"hexsha": "d96784bd44b7da8e56ac1cff487516ced2e3f8f1", "size": 5535, "ext": "py", "lang": "Python", "max_stars_repo_path": "Emotix NLP Task.py", "max_stars_repo_name": "aknottymathematician/Intent-Detection", "max_stars_repo_head_hexsha": "c568a3049f85ffabc774681a94532c88ede2feb9", "max_stars_repo_licenses": ["MIT"], "... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.