text stringlengths 0 1.25M | meta stringlengths 47 1.89k |
|---|---|
import os
import random
import shutil as shell
import numpy as np
import matplotlib.pyplot as plt
from PIL import Image
import image_toolkit
def train_test_split_from_dir(res_dir , target_dir , test_size ):
## Reads the directory and creates another directory that consists of train-test splitted classes.
... | {"hexsha": "f15aa4bce4b4310d4731e0da4540711a761591ee", "size": 4779, "ext": "py", "lang": "Python", "max_stars_repo_path": "im.py", "max_stars_repo_name": "1942Spectre/image_data_augmenter", "max_stars_repo_head_hexsha": "d1e321bbc9bd94d54f15b5d683d1db889b3c3b38", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
import argparse
import numpy as np
import tensorflow as tf
import time
import pickle
import maddpg.common.tf_util as U
from maddpg.trainer.maddpg import MADDPGAgentTrainer
import tensorflow.contrib.layers as layers
import maddpg.common.environment as environment
import json
# code is mainly from openAI, v... | {"hexsha": "e70f7a306de8c4947028a9ccf5fcb0badf650937", "size": 11344, "ext": "py", "lang": "Python", "max_stars_repo_path": "MADDPG/maddpg-master/experiments/MADDPG_DDPG.py", "max_stars_repo_name": "lqy0057/MADDPG-Congestion-Control-Based-on-OMNET-", "max_stars_repo_head_hexsha": "495f817b3e7342a66315848a0a50acb569dba8... |
import os
import json
import time
import numpy as np
snapshot_folder = "firebase-snapshots"
snapshot_name = "1604179441.9017837"
json_snapshot = {}
with open(os.path.join(snapshot_folder, snapshot_name + ".json")) as f:
json_snapshot = json.load(f)
user_data = json_snapshot['users']
state_data = json_snapshot['s... | {"hexsha": "35a19ae8d3203164bc5ef114660ab6002fb54bee", "size": 1329, "ext": "py", "lang": "Python", "max_stars_repo_path": "se3/data-processing/calculate_session_lengths.py", "max_stars_repo_name": "mayacakmak/se2", "max_stars_repo_head_hexsha": "e366ff13c872365e6685ac4ad120e33c74494849", "max_stars_repo_licenses": ["B... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Oct 9 13:56:42 2020
@author: alfredocu
"""
import numpy as np
import matplotlib.pyplot as plt
class LinearNeuron:
def __init__(self, n_inputs, learning_rate = 0.1):
self.w = -1 + 2 * np.random.rand(n_inputs)
self.b = -1 + 2 * np.r... | {"hexsha": "4d2c6b053e633cc3bf4223ab316ec62b0f76df49", "size": 1633, "ext": "py", "lang": "Python", "max_stars_repo_path": "LinearNeuron.py", "max_stars_repo_name": "AlfredoCU/LInear-Neuron", "max_stars_repo_head_hexsha": "361cc7089321cb25c091a8f875369d0f817981c1", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
import numpy as np
from rdkit.Chem.rdchem import Atom, BondType, EditableMol
from glyles.grammar.GlycanLexer import GlycanLexer
def not_implemented_message(mod):
print(f"ModificationNotImplementedWarning: {mod} Modification not implemented. The returned molecule will not have "
f"this modification")
... | {"hexsha": "f06d691d7d4e528c71e8f6a973c94e046142f320", "size": 10232, "ext": "py", "lang": "Python", "max_stars_repo_path": "glyles/glycans/rdkit_reactor.py", "max_stars_repo_name": "kalininalab/GlyLES", "max_stars_repo_head_hexsha": "a974d336a0358768957025c0ea1f318f60b63664", "max_stars_repo_licenses": ["MIT"], "max_s... |
from os import system
from tempfile import NamedTemporaryFile
import json
from warnings import warn
def static_graph(rules_dag, options='{}'):
from networkx.drawing.nx_agraph import to_agraph
graph = to_agraph(rules_dag)
graph.node_attr['fontname'] = 'Arial, sans-serf'
graph.edge_attr['fontname'] = '... | {"hexsha": "e55b8c321e532b2c9baad2f16d56bab9d7472e20", "size": 1439, "ext": "py", "lang": "Python", "max_stars_repo_path": "nbpipeline/visualization/static_graph.py", "max_stars_repo_name": "krassowski/nbpipeline", "max_stars_repo_head_hexsha": "c2337db2b19767b2cdfcc9bf019e2bf687bb4423", "max_stars_repo_licenses": ["MI... |
\documentclass[letterpaper]{article}
\usepackage[utf8]{luainputenc}
\usepackage{fullpage}
\usepackage{nopageno}
\usepackage{amsmath}
\usepackage{amssymb}
\allowdisplaybreaks
\newcommand{\abs}[1]{\left\lvert #1 \right\rvert}
\begin{document}
\title{Notes}
\date{2 mars, 2015}
\maketitle
when does taylor series conver... | {"hexsha": "3bef4a4e2b11fc1128d0406cfeb364bbf0dff5ec", "size": 2341, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "ra2/ra2-notes-2015-03-02.tex", "max_stars_repo_name": "ylixir/school", "max_stars_repo_head_hexsha": "66d433f2090b6396c8dd2a53a733c25dbe7bc90f", "max_stars_repo_licenses": ["Unlicense"], "max_stars_... |
import os
from collections import defaultdict, namedtuple
import array
import numpy as np
from glycan_profiling.task import TaskBase, log_handle
from glycan_profiling.chromatogram_tree import (
ChromatogramWrapper, build_rt_interval_tree, ChromatogramFilter,
Unmodified)
from glycan_profiling.chromatogram_tr... | {"hexsha": "9f003a1d35b753b496db83a09e4e3d935bb58f50", "size": 58019, "ext": "py", "lang": "Python", "max_stars_repo_path": "glycan_profiling/tandem/chromatogram_mapping.py", "max_stars_repo_name": "mobiusklein/glycresoft", "max_stars_repo_head_hexsha": "60d6eddffc6d8c783f0fe470b5010d4f437c7e73", "max_stars_repo_licens... |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT license.
import torch
import torch.nn as nn
import torch.utils.data as data
import torch.backends.cudnn as cudnn
import torchvision.transforms as transforms
import os
import time
import argparse
import numpy as np
from PIL import Ima... | {"hexsha": "99b4b3a7afd4598d41dde0d1be077a47650cfd1d", "size": 4147, "ext": "py", "lang": "Python", "max_stars_repo_path": "tools/SeeDot/faceDetection/eval_fromquant.py", "max_stars_repo_name": "Shenzhen-Cloudatawalk-Technology-Co-Ltd/EdgeML", "max_stars_repo_head_hexsha": "ef9f8a77f096acbdeb941014791f8eda1c1bc35b", "m... |
export invariant_polytopes
using LinearAlgebra
struct SymPoint{VT}
point::VT
end
include("conitope.jl")
include("balanced_real_polytope.jl")
include("balanced_complex_polytope.jl")
const PolytopeLike = Union{Conitope, BalancedRealPolytope, BalancedComplexPolytope}
function Polyhedra.convexhull!(p::PolytopeLike,... | {"hexsha": "b68ca521acd0a374b0a1e4296438e751cb522849", "size": 14580, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/polytopes.jl", "max_stars_repo_name": "blegat/SwitchOnSafety.jl", "max_stars_repo_head_hexsha": "c5461c0d9fbdf63ed0fb284962808b963d218070", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
# coding=utf-8
# Copyright (c) 2020, NVIDIA CORPORATION. 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... | {"hexsha": "b69487379e11c635fdd0fb274bd4159a17cff283", "size": 5405, "ext": "py", "lang": "Python", "max_stars_repo_path": "tools/preprocess_pretrain_data_cls.py", "max_stars_repo_name": "thu-coai/PPT", "max_stars_repo_head_hexsha": "0c1de17c8e7bb0dd071f102cb4236b16ab7c0e1a", "max_stars_repo_licenses": ["MIT"], "max_st... |
[STATEMENT]
lemma preceq_star: "s \<star> (rs#r) \<preceq> s' \<Longrightarrow> s \<star> rs \<preceq> s'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. s \<star> Cons r rs \<preceq> s' \<Longrightarrow> s \<star> rs \<preceq> s'
[PROOF STEP]
by (metis pre_RDR.exec.simps(1) pre_RDR.exec.simps(2) pre_RDR.less_eq_def... | {"llama_tokens": 146, "file": "Abortable_Linearizable_Modules_RDR", "length": 1} |
# Copyright (c) 2018 Andy Zeng
import numpy as np
def pcwrite(filename, xyzrgb):
"""Save a point cloud to a polygon .ply file.
"""
xyz = xyzrgb[:, :3]
if xyzrgb.shape[1] > 3:
rgb = xyzrgb[:, 3:].astype(np.uint8)
else:
rgb = np.ones(xyz.shape)
# Write header
ply_file = open(filename,'w')
ply_f... | {"hexsha": "a279133db06c5b7071bdf0443a6c29ecb0469607", "size": 892, "ext": "py", "lang": "Python", "max_stars_repo_path": "utils/fusion.py", "max_stars_repo_name": "urasakikeisuke/rigidmask", "max_stars_repo_head_hexsha": "4bb781102218dfd11efa767e2d0ba987d9949fd1", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
# ***************************************************************
# Copyright (c) 2020 Jittor. Authors:
# Guoye Yang <498731903@qq.com>
# Dun Liang <randonlang@gmail.com>.
# All Rights Reserved.
# This file is subject to the terms and conditions defined in
# file 'LICENSE.txt', which is part of this source co... | {"hexsha": "42a7e4f6af2edd7af800c9376104fae8cbc644fd", "size": 4376, "ext": "py", "lang": "Python", "max_stars_repo_path": "python/jittor/test/test_merge_single_array_op.py", "max_stars_repo_name": "wanghonghui1998/jittor", "max_stars_repo_head_hexsha": "9f3c97a605be8eecda84fb4b5786706fe0096729", "max_stars_repo_licens... |
import warnings
import pickle
import matplotlib.pyplot as plt
import matplotlib
import numpy as np
import sys
import os
import os.path
import math
import bisect
import tensorflow as tf
sys.path.insert(0, '../../..')
from cde.density_estimator import GPDExtremeValueMixtureDensityNetwork,NoNaNGPDExtremeValueMixtureDens... | {"hexsha": "6fdc5999e95d1927697e67672f8efa773f952cee", "size": 3315, "ext": "py", "lang": "Python", "max_stars_repo_path": "experiments/models/onehop/train_model.py", "max_stars_repo_name": "samiemostafavi/conditional-density-estimation", "max_stars_repo_head_hexsha": "a00e51dccd51b673896055c22e09fa4197efabde", "max_st... |
import matplotlib.pyplot as plt
import numpy
import fastseriation.seriate
if __name__ == "__main__":
scores = numpy.zeros((100, 10))
for i in range(100):
for j in range(10):
scores[i, j] = abs(i - j)
plt.figure()
plt.imshow(scores, cmap='brg', interpolation='nearest', aspect='auto... | {"hexsha": "40e5ccc241780ac5a1f9660c9080b996ca4ed8ed", "size": 772, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/example_1.py", "max_stars_repo_name": "avramidis/fastseriation", "max_stars_repo_head_hexsha": "bddc79f21c8172c9af339d058190ab9255d3f66d", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
module HexapoleDataFit
include("types.jl")
include("ellipse.jl")
include("IO.jl")
include("ellipse_fitting.jl")
include("plot.jl")
include("transformations.jl")
include("kernels.jl")
end # module
| {"hexsha": "94bf14334431ba9f01419cfeb2892dd09b708058", "size": 226, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/HexapoleDataFit.jl", "max_stars_repo_name": "razvangheorghe/HexapoleDataFit.jl", "max_stars_repo_head_hexsha": "7586e7465f6c339fcedaf17d55978dcbc23d9aa1", "max_stars_repo_licenses": ["MIT"], "ma... |
"""Similarity measures."""
# Author: Thales Bertaglia <thalesbertaglia@gmail.com>
import editdistance
import numpy as np
# Constants
METRICS_DICT = {}
DIACRITICS = {}
DIACRITICS["a"] = {"á", "ã", "à", "â"}
DIACRITICS["e"] = {"é", "ê"}
DIACRITICS["i"] = {"í"}
DIACRITICS["o"] = {"ó", "õ", "ô"}
DIACRITICS["u"] = {"ú"}
... | {"hexsha": "312889b660b79256bf40345844daec5707a7ca68", "size": 6220, "ext": "py", "lang": "Python", "max_stars_repo_path": "enelvo/metrics/metrics.py", "max_stars_repo_name": "thalesbertaglia/enelvo", "max_stars_repo_head_hexsha": "60358d80ee4300872838f44f8f866aea2a2f113d", "max_stars_repo_licenses": ["MIT"], "max_star... |
// kate: replace-tabs off; indent-width 4; indent-mode normal
// vim: ts=4:sw=4:noexpandtab
/*
Copyright (c) 2010--2012,
François Pomerleau and Stephane Magnenat, ASL, ETHZ, Switzerland
You can contact the authors at <f dot pomerleau at gmail dot com> and
<stephane at magnenat dot net>
All rights reserved.
Redistrib... | {"hexsha": "a7fe923efa5a83b608a0ce83d22fb1f7609dc078", "size": 8755, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "examples/compute_overlap.cpp", "max_stars_repo_name": "skn123/libpointmatcher", "max_stars_repo_head_hexsha": "3464af6f218578e7b3053c89fa6661399952b0d1", "max_stars_repo_licenses": ["BSD-3-Clause"],... |
__author__ = 'bs'
import cv2
from matplotlib import *
from tools import IO
import numpy as np
from matplotlib.pyplot import *
from config.Const import *
from tools import Utils
from tools import Calc
import personMapLocation as pml
import textureMapping as tm
def texturemapObjectSequence():
""" Poor implementati... | {"hexsha": "5ce7bef39e5be632e89b14b3a26776148b812f31", "size": 2384, "ext": "py", "lang": "Python", "max_stars_repo_path": "Projective-Geometry/bergar/com.bergar.simonsen.homography/main.py", "max_stars_repo_name": "tonybeltramelli/Graphics-And-Vision", "max_stars_repo_head_hexsha": "a1dbeada8e907b119ecce1fe421ae91e64f... |
import matplotlib.pyplot as plt
import numpy as np
# each threshold used
# thold_x = [2, 4, 8, 16, 32, 64, 128, 256, 512, 1024]
# this is required to get each number in thold_x to show on the graph
# and make it similar to the graph in the book
thold_x = np.arange(0, 11)
x = 2 ** thold_x # exponents
# timing of eac... | {"hexsha": "ead327178cf5f1e7c6837bc56ad8d0e0a736fabd", "size": 713, "ext": "py", "lang": "Python", "max_stars_repo_path": "chap29/plot.py", "max_stars_repo_name": "breakthatbass/OStep", "max_stars_repo_head_hexsha": "b9fb1b1f12e4975539c088dc909f0d3926c9646e", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null,... |
/*******************************************************
* Copyright (C) 2022, Chen Jianqu, Shanghai University
*
* This file is part of is_slam.
*
* Licensed under the MIT License;
* you may not use this file except in compliance with the License.
*******************************************************/
#incl... | {"hexsha": "3f5bb4fa5ded60688958428e9c3e59bd31a5315d", "size": 3450, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "src/is_slam/src/playdata.cpp", "max_stars_repo_name": "chenjianqu/is_slam", "max_stars_repo_head_hexsha": "519664c1c32d53119d5e3b36f5acc06e338495fb", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
from __future__ import (absolute_import, division,print_function, unicode_literals)
from builtins import *
import numpy as np
import cv2
import SimpleITK as sitk
from builtins import *
from scipy.spatial import distance
from scipy import stats
import sys
import time
############### FUNCTIONS ##############... | {"hexsha": "0ae4d30d3eb0fe4779cea71fed2e9cf129b520f4", "size": 9713, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/video/crack_detection2_fast.py", "max_stars_repo_name": "ficusoftdeveloper/bluedome", "max_stars_repo_head_hexsha": "3dc04fd749bee22b4f5eb94db85a5c15d7ef8ea0", "max_stars_repo_licenses": [... |
!***********************************************************************
! *
REAL(KIND(0.0D0)) FUNCTION BRINTF (ITYPE, IA, IB, IC, ID, K)
! *
! Computes integrals for the tra... | {"hexsha": "9c026266cbd15633f81dc6dfafdb20269e505693", "size": 3642, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "src/appl/rci90_mpi/brintf.f90", "max_stars_repo_name": "sylas/grasp-continuum", "max_stars_repo_head_hexsha": "f5e2fb18bb2bca4f715072190bf455fba889320f", "max_stars_repo_licenses": ["MIT"], "max... |
from Automated_version_3 import myClass
import pandas as pd
import numpy as np
import datetime
import time
import gspread
from pymongo import MongoClient
import itertools
from multiprocessing.dummy import Pool as ThreadPool
import multiprocessing
from itertools import repeat
from bson import ObjectId
def get_city_in... | {"hexsha": "8175574d74098d1c4df46777c9bc02f6a30bcb7d", "size": 4301, "ext": "py", "lang": "Python", "max_stars_repo_path": "headless_chrome.py", "max_stars_repo_name": "infernus616/Internship_Projects", "max_stars_repo_head_hexsha": "cb8ddcc55e7fa8558d0e6c09a3c29bddcefca640", "max_stars_repo_licenses": ["Apache-2.0"], ... |
import numpy as np
from nltk.stem import SnowballStemmer
from nltk.stem.porter import PorterStemmer
from nltk.stem import WordNetLemmatizer
from nltk.tokenize import TweetTokenizer
from gensim.models.keyedvectors import KeyedVectors
snowball_stemmer = SnowballStemmer('english')
porter_stemmer = PorterStemmer()
wordnet... | {"hexsha": "a2ec9e7130483f2529cf99d72d9cdbcc69546201", "size": 1030, "ext": "py", "lang": "Python", "max_stars_repo_path": "wordvec_utils.py", "max_stars_repo_name": "jitinkrishnan/Diversity-Based-Generalization", "max_stars_repo_head_hexsha": "acdfa28d26414d5a3c95dcaf4ca2130a2bd83f8b", "max_stars_repo_licenses": ["MIT... |
#!/usr/bin/env python
"""
SmallNet.py is a class that provides a network for Person localization
Created 6/13/17.
"""
__author__ = "Alexander Ponamarev"
__email__ = "alex.ponamaryov@gmail.com"
from collections import namedtuple
import tensorflow as tf
import numpy as np
from tensorflow import variable_scope, reshape, ... | {"hexsha": "74888651165129375923ad9da58ff3486c3457af", "size": 21008, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/ObjectDetection.py", "max_stars_repo_name": "aponamarev/FootBallTracking", "max_stars_repo_head_hexsha": "a1907164aa35fe925b2a11a1c596c1a489b90231", "max_stars_repo_licenses": ["MIT"], "max_s... |
# Copyright (c) Lawrence Livermore National Security, LLC and other Conduit
# Project developers. See top-level LICENSE AND COPYRIGHT files for dates and
# other details. No copyright assignment is required to contribute to Conduit.
"""
file: t_python_relay_mpi.py
description: Unit tests for relay mpi
"""
import sy... | {"hexsha": "f6ebbf812536c848092e5370230261ccb8db4717", "size": 12619, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/tests/relay/python/t_python_relay_mpi.py", "max_stars_repo_name": "jakebolewski/conduit", "max_stars_repo_head_hexsha": "6bf9fd6a380a5ab767b41cc9f1a93c905786dfa6", "max_stars_repo_licenses": ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#------------------------------------------------------------------------------
# Copyright (c) 2007-2020, Acoular Development Team.
#------------------------------------------------------------------------------
"""
Loads the example data set, sets diffrent Sectors for i... | {"hexsha": "ab2da2e3234f239c5ee0ccc16545c07fb52e329f", "size": 3895, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/example_sectors_and_intergration.py", "max_stars_repo_name": "esarradj/acoular", "max_stars_repo_head_hexsha": "ed73ab666f994421cfcf8d0b5310a563d99f5f40", "max_stars_repo_licenses": ["BSD... |
#
# offernet_dsl/utils.py - unit test for the app.
#
# Copyright (c) 2018 SingularityNET
#
# Distributed under the MIT software license, see LICENSE file.
#
from numpy.random import randint
import json
import offernet_dsl.ns as ns
def binary_array(length):
array = randint(2, size=length).tolist()
json_string ... | {"hexsha": "a6f65e78ad42c625d6c81266c745e660cb75b963", "size": 577, "ext": "py", "lang": "Python", "max_stars_repo_path": "offernet_dsl/utils.py", "max_stars_repo_name": "kabirkbr/offernet-python", "max_stars_repo_head_hexsha": "a8f934aad96d23072ffd173c600ad08efdc25598", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
module mnt_ncfieldwrite_capi_mod
! C function prototypes
interface
function mnt_ncfieldwrite_new(obj, fileName, fileNameLen, &
varName, varNameLen, append) &
bind(C, name='mnt_ncfieldwrite_new')
! Constructor
! @param obj instance o... | {"hexsha": "2f4475a4b8039a3f95a67d2f853806299f8dd697", "size": 4614, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "src/mnt_ncfieldwrite_capi_mod.f90", "max_stars_repo_name": "bjlittle/mint", "max_stars_repo_head_hexsha": "fe4862951e0c570caef6e86440b090650dca000b", "max_stars_repo_licenses": ["0BSD"], "max_st... |
[STATEMENT]
lemma image_mset_mono:
assumes
mono_f: "\<forall>x \<in> set_mset M. \<forall>y \<in> set_mset N. x < y \<longrightarrow> f x < f y" and
less: "M \<le> N"
shows "image_mset f M \<le> image_mset f N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. image_mset f M \<le> image_mset f N
[PROOF STEP... | {"llama_tokens": 182, "file": null, "length": 1} |
#include <boost/fusion/mpl/erase_key.hpp>
| {"hexsha": "249b92626274bc219d6304cdd09906463622c5f7", "size": 42, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "src/boost_fusion_mpl_erase_key.hpp", "max_stars_repo_name": "miathedev/BoostForArduino", "max_stars_repo_head_hexsha": "919621dcd0c157094bed4df752b583ba6ea6409e", "max_stars_repo_licenses": ["BSL-1.0"... |
# Lint as: python3
# Copyright 2020 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | {"hexsha": "54b970aa75a1532c188d3ac764669d6fe07a487e", "size": 3435, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/madi/detectors/neg_sample_random_forest.py", "max_stars_repo_name": "yllhaziri/madi", "max_stars_repo_head_hexsha": "d960230be7d6e18055a421c45b43d769d4d48b6e", "max_stars_repo_licenses": ["Apa... |
\chapter{Device maintenance}
\section{File system}
The \verb|show file systems| command (Figure \ref{ShowFileSystem}) lists all of the available file systems. This command provides useful information such as the amount of available and free memory, the type of file system, and its permissions. Permissions include rea... | {"hexsha": "e9991e4064ee9f96d5407537775db9a43e036d21", "size": 14609, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "Notebook/Maintenance.tex", "max_stars_repo_name": "buiquanghuy23103/CCNA", "max_stars_repo_head_hexsha": "1234574bcba3c206263091ef90191fd9c41c624f", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
#include "board.h"
#include "utils/logger.h"
#include <boost/date_time/posix_time/posix_time.hpp>
#include <thread>
#include <iostream>
using namespace std;
using namespace boost;
using namespace boost::posix_time;
using namespace boost::asio;
using namespace home_system::io;
board::board(const std::string &name, con... | {"hexsha": "599407a8739623f4560b008cbeb22608ce0ea78c", "size": 4724, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "io-relay-board/src/board.cpp", "max_stars_repo_name": "wozio/home-system", "max_stars_repo_head_hexsha": "ac73bec6e5050246f0e3debfbdfa43d4762bb144", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
"""
templates.py
james.p.houghton@gmail.com
Jan 12, 2016
Specifies the structure of python blocks corresponding with various model elements.
"""
from string import Template
templates = dict()
templates['new file'] = Template(
"""
from __future__ import division
import numpy as np
from pysd import functions
from pys... | {"hexsha": "81c090c5a59452e8c238c4b1ab51836ec76b07f1", "size": 3829, "ext": "py", "lang": "Python", "max_stars_repo_path": "pysd/builder/templates.py", "max_stars_repo_name": "mhy05/PySD-Jitia", "max_stars_repo_head_hexsha": "fa7bccf4edf7b9031c7fb87b589acce199c72b26", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
from pathlib import Path
import cv2
import time
import numpy as np
import tensorflow as tf
from object_detection.utils import label_map_util
from object_detection.utils import visualization_utils as vis_util
from object_detection.utils import ops as utils_ops
CWD_PATH = Path('.')
TF_MODELS_PATH = Path('../TensorFlow ... | {"hexsha": "fa46ba3beb2712f3ad8920e8c7ebd2b4332bb34a", "size": 9667, "ext": "py", "lang": "Python", "max_stars_repo_path": "pruebas.py", "max_stars_repo_name": "xavialex/Instance-Segmentation", "max_stars_repo_head_hexsha": "7ad73ed8b352d8ffefe4265b2469949daae5e209", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
function solution()
n = 600851475143
factor = 1
while true
factor += 2
while n % factor == 0
n = div(n, factor)
end
if factor * factor > n
return n
elseif n == 1
return factor
end
end
end
if length(ARGS) == 1 && ARGS[1] == "-a"
println(solution())
exit(0)
end
f... | {"hexsha": "1e908941fd1a63a39f99554865a68440c820b3c8", "size": 476, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "problems/003/003.jl", "max_stars_repo_name": "jsdelivrbot/euler_criterion.rs", "max_stars_repo_head_hexsha": "7eee1353560d2a784209ca8735632806388e14e1", "max_stars_repo_licenses": ["Apache-2.0", "MI... |
import os
import argparse
# import numpy as np
import torch
# import torch.nn as nn
import torch.optim as optim
# import torchvision.utils as utils
import time
from torch.autograd import Variable
from torch.utils.data import DataLoader
from MRFNETgray.model import MRFNET
# from torch.nn.modules.loss import... | {"hexsha": "30f9bfaa215161177b7bdfd23e7b5f9fb497c60a", "size": 5751, "ext": "py", "lang": "Python", "max_stars_repo_path": "MRFNETgray/trainf.py", "max_stars_repo_name": "BiolabHHU/Image-denoising-with-MRFNet", "max_stars_repo_head_hexsha": "79420d707058de0ac04522d499adef79b5f6fc6e", "max_stars_repo_licenses": ["Apache... |
# This file was generated by the Julia Swagger Code Generator
# Do not modify this file directly. Modify the swagger specification instead.
mutable struct DeploymentProperties <: SwaggerModel
template::Any # spec type: Union{ Nothing, Any } # spec name: template
templateLink::Any # spec type: Union{ Nothing, ... | {"hexsha": "39b7c790179b205ec5c3973767c2234866b8fb9b", "size": 3499, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/Resource/ResourceManagementClient/model_DeploymentProperties.jl", "max_stars_repo_name": "JuliaComputing/Azure.jl", "max_stars_repo_head_hexsha": "0e2b55e7602352d86bdf3579e547a74a9b5f44f8", "ma... |
import pyautogui
import cv2
import numpy as np
import threading
import time
class recorder:
def __init__(self):
# all video customizations
self.output_filename = self.getFilename()
print(self.output_filename)
self.fps = 7
def getFilename(self):
ct = time.localtime()
return "{0}-{1}-{2}_{3}:{4}:... | {"hexsha": "881c48cad45e2a30620e0dce7758b6bc7d1af46c", "size": 1280, "ext": "py", "lang": "Python", "max_stars_repo_path": "recorder.py", "max_stars_repo_name": "sukreshmanda/screen-recorder", "max_stars_repo_head_hexsha": "9c3818f51cf97cf44324235052e19007fbd0f29b", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars... |
from dateutil import parser as dateparser
from typing import Dict
import numpy as np
from copy import deepcopy
from liftoff.config import namespace_to_dict
from utils.reporting import Reporting, EVAL_METRICS_BASE, get_base_score
def repair_template(data: Dict, lprint = print, eprint = print):
"""
Should appl... | {"hexsha": "18b062ebf2b959b0d5ad13f456d85e39b55d4348", "size": 8247, "ext": "py", "lang": "Python", "max_stars_repo_path": "reports_repairs.py", "max_stars_repo_name": "tudor-berariu/lifelong-learning", "max_stars_repo_head_hexsha": "35041e0e466dd165bd112d65a571e38518a49783", "max_stars_repo_licenses": ["MIT"], "max_st... |
import numpy as np
import torch
from torch import nn
import torch.nn.functional as F
from ccontrol.utils import OptimizerCreator
class Critic_network_creator:
def __init__(self):
self.builders = {
'vanilla': lambda context, config: Critic_network_vanilla(context, config),
'BN':... | {"hexsha": "659546d08c0eb27f2b292b8473f98f3b1923cc1d", "size": 5061, "ext": "py", "lang": "Python", "max_stars_repo_path": "ccontrol/model/critic_network.py", "max_stars_repo_name": "PierreMsy/DRL_continuous_control", "max_stars_repo_head_hexsha": "40a443ea2c7415a5dd7185114da0f06902122c4b", "max_stars_repo_licenses": [... |
from typing import Any, List, Union, Optional, Dict
import gym
import numpy as np
import pettingzoo
from functools import reduce
from ding.envs import BaseEnv, BaseEnvTimestep, FrameStackWrapper
from ding.torch_utils import to_ndarray, to_list
from ding.envs.common.common_function import affine_transform
from ding.uti... | {"hexsha": "1a3eb86dd9a642ad6259a245b4767964298f06d9", "size": 13662, "ext": "py", "lang": "Python", "max_stars_repo_path": "dizoo/petting_zoo/envs/petting_zoo_env.py", "max_stars_repo_name": "davide97l/DI-engine", "max_stars_repo_head_hexsha": "d48c93bcd5c07c29f2ce4ac1b7756b8bc255c423", "max_stars_repo_licenses": ["Ap... |
import argparse
import numpy as np
from caffe2.python import core, workspace
def benchmark_mul_gradient(args):
workspace.FeedBlob("dC", np.random.rand(args.m, args.n).astype(np.float32))
workspace.FeedBlob("A", np.random.rand(args.m, args.n).astype(np.float32))
workspace.FeedBlob("B", np.random.rand... | {"hexsha": "2e11aefcb49775f7aee8863634aa826a53bdc5b3", "size": 1118, "ext": "py", "lang": "Python", "max_stars_repo_path": "caffe2/python/operator_test/mul_gradient_benchmark.py", "max_stars_repo_name": "raven38/pytorch", "max_stars_repo_head_hexsha": "3a56758e1fdbc928be3754d5b60e63c7fc55ea45", "max_stars_repo_licenses... |
from src.classifiers.random_forest import RandomForest
from src.classifiers.svm_classifier import SVMClassifier
from src.classifiers.mlp_classifier import MLPClassifier
import pandas as pd
import numpy as np
from sklearn.metrics import precision_recall_fscore_support
from sklearn.model_selection import KFold
df = pd... | {"hexsha": "9fd2d6229fbdf0eca991f73904569e75c542bddc", "size": 1742, "ext": "py", "lang": "Python", "max_stars_repo_path": "model_maker.py", "max_stars_repo_name": "MatteoBre/AND_clinical_trials", "max_stars_repo_head_hexsha": "c4b1ce8796b4b5ee87b0938d65caaeddf76b787c", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
# coding=utf-8
import os
import numpy as np
import tensorflow as tf
data_path = "data/artificial_extraction"
def get_training_set(buffer=1024, epochs=1, batch_size=16):
training_data = _load_training_data()
tf.logging.debug("training feature shape: " + str(training_data["features"].shape))
tf.logging.deb... | {"hexsha": "c61b0ed2359249bc8d9ca98dd4e1fa97d45b2319", "size": 2770, "ext": "py", "lang": "Python", "max_stars_repo_path": "discriminative_model/data_set.py", "max_stars_repo_name": "ys10/GCIClassify", "max_stars_repo_head_hexsha": "a66b1a257ac26b10732a68228721023b99f67a8e", "max_stars_repo_licenses": ["MIT"], "max_sta... |
import tensorflow as tf
import numpy as np
import logging
logging.getLogger('tensorflow').setLevel(logging.ERROR)
from tensorflow.keras.callbacks import Callback
class CosineAnnealer:
def __init__(self, start, end, steps):
self.start = start
self.end = end
self.steps = steps
... | {"hexsha": "b2862ca485d620b30faf4374e3f0aee315642bbe", "size": 3544, "ext": "py", "lang": "Python", "max_stars_repo_path": "onecycle.py", "max_stars_repo_name": "s-broda/capstoneproject", "max_stars_repo_head_hexsha": "816fe144db6dc7eb430e5e1cc14937c63a8fc4b0", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nul... |
import os, time
from glob import glob
import sys
from http.server import HTTPServer, BaseHTTPRequestHandler
import cv2
import argparse
import arrow
import pycuda.driver as cuda # noqa, must be imported
import pycuda.autoinit # noqa, must be imported
import tensorrt as trt
import numpy as np
from bistiming import St... | {"hexsha": "f6e0b2e62ea3621e1a4b5861836de45f5e617c79", "size": 9639, "ext": "py", "lang": "Python", "max_stars_repo_path": "yolov3.py", "max_stars_repo_name": "Ma-Dan/yolov3-tensorrt", "max_stars_repo_head_hexsha": "18b7b45a5b526bc0cc72176bec3332a554e10263", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, ... |
if !@isdefined TEST
using Revise
end
using Mitosis
using Random, Test, LinearAlgebra, Statistics
Random.seed!(1)
# Prior (as kernel of prior mean)
μ0 = zeros(2)
σ2 = 8.0 # noise
V0 = 10*I(2)
Σ0 = σ2*V0 # prior
prior = kernel(Gaussian; μ=ConstantMap(μ0), Σ=ConstantMap(Σ0))
# Data
x = [18.25 19.75 16.5 18.25 19.5... | {"hexsha": "89446500a43e2067b8d18f4856e2480788aad320", "size": 809, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "example/regression.jl", "max_stars_repo_name": "cscherrer/Mitosis.jl", "max_stars_repo_head_hexsha": "e11113d392a9ac9c884212acaf177bc4dbb619c5", "max_stars_repo_licenses": ["MIT"], "max_stars_count"... |
import google.protobuf.json_format as pbjson
import os
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import cv2
import PoseSequenceLabel_pb2
import argparse
import deepracing.imutils as imutils
import torchvision
import torchvision.utils as tvutils
import torchvision.transfo... | {"hexsha": "8e4dd3502814fe96477a25925d1cd716591320e1", "size": 7791, "ext": "py", "lang": "Python", "max_stars_repo_path": "deepracing_py/evaluate_bezier_curve_jumpiness.py", "max_stars_repo_name": "linklab-uva/deepracing", "max_stars_repo_head_hexsha": "fc25c47658277df029e7399d295d97a75fe85216", "max_stars_repo_licens... |
C Copyright(C) 2014-2017 National Technology & Engineering Solutions of
C Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
C NTESS, the U.S. Government retains certain rights in this software.
C
C Redistribution and use in source and binary forms, with or without
C modification, are pe... | {"hexsha": "455e6cbd6a7c330963ce79b9c4fa96836392b5e7", "size": 4388, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "packages/seacas/applications/fastq/qaaval.f", "max_stars_repo_name": "brian-kelley/seacas", "max_stars_repo_head_hexsha": "f6e819de11ed231d30fe788600b3b29efd8014d5", "max_stars_repo_licenses": ["P... |
import csv
import json
import logging
import math
import os
import sys
from collections import defaultdict
from itertools import islice
from pathlib import Path
from typing import Dict
import torch
from skimage import exposure
import PIL.Image
import click
import numpy as np
from pytorch_lightning import seed_everyth... | {"hexsha": "0caa9f78211a15b0863e04ce7d16d79896ab687c", "size": 7539, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/data/datasets/COVID_rural/covid_rural_dataset.py", "max_stars_repo_name": "philip-mueller/lovt", "max_stars_repo_head_hexsha": "91cf2094a0e140b8431b8e4ebadc56547a8df6b2", "max_stars_repo_licen... |
import torch
import numpy as np
def get_returns(episodes_per_task):
# sum up for each rollout, then take the mean across rollouts
returns = []
for task_idx in range(len(episodes_per_task)):
curr_returns = []
episodes = episodes_per_task[task_idx]
for update_idx in range(len(episode... | {"hexsha": "14c4d122ce949801497c74902e7b7ca7c1633e46", "size": 3065, "ext": "py", "lang": "Python", "max_stars_repo_path": "rl/trainer.py", "max_stars_repo_name": "dkkim93/cavia", "max_stars_repo_head_hexsha": "d83f44b8443f4d202396b827e13eced2cfb40b11", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_... |
import time
import numpy as np
from sklearn.metrics import accuracy_score
def clf_fit_predict(clf, X_batch, y_batch, X_test, y_test):
t = time.time()
clf.fit(X_batch, y_batch)
ft = time.time() - t
tr_acc = accuracy_score(y_batch, clf.predict(X_batch))
test_acc = accuracy_score(y_test, clf.predict... | {"hexsha": "0492039a3a7ea73fde4ed8f794d212c00c9b737f", "size": 4300, "ext": "py", "lang": "Python", "max_stars_repo_path": "methods.py", "max_stars_repo_name": "apnkv/mondrian-forest", "max_stars_repo_head_hexsha": "17cb1cf68fcdef77dead37e15ce865c56a5bf82a", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, ... |
'''
train_EM_gmm_with_many_runs.py
Use EM algorithm to train many GMMs, with different numbers of clusters and random seeds for initialization.
Post Condition
---------------
For each number of clusters K and seed, we will save:
* CSV file of the history for the GMM training process (perf metrics at every iteration)
... | {"hexsha": "7cb5a5c49114daeecbb06373429ec7e82827a8d2", "size": 2175, "ext": "py", "lang": "Python", "max_stars_repo_path": "cp4/src/train_EM_gmm_with_many_runs.py", "max_stars_repo_name": "ErliCai/comp136-21s-assignments", "max_stars_repo_head_hexsha": "da690dc23a09624a16ba96e1b34ef991f4001a6e", "max_stars_repo_license... |
"""
.. module:: Alignment
:synopsis: This module implements the Alignment class.
"""
# Third-party modules
import contextlib
import os
import re
import pathlib
import logging
import numpy as np
from Bio.SubsMat import MatrixInfo
from Bio.SeqUtils import seq3
from Bio.PDB import PDBParser
from Bio.PDB import DSSP
im... | {"hexsha": "0ac1cb9f22a75d6a11dfbab49b442089d887b6ea", "size": 26043, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/alignment.py", "max_stars_repo_name": "kabhel/Fold_U", "max_stars_repo_head_hexsha": "8864e6b8892d0fe18b072eb8cae6a0c78ff067c7", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "... |
import unittest
import parameterscan
import tempfile
from shutil import rmtree
import numpy as np
import pandas.util.testing as pdt
def random_par():
return {'x': np.random.rand(),
'y': np.random.rand(3, 3)}
def obs_func(par):
return {'bla': 2 * par['x'] + np.linalg.det(par['y']),
'b... | {"hexsha": "c748a4d2bf04b2ab6ef49bc7bff1fd368e4092c2", "size": 1505, "ext": "py", "lang": "Python", "max_stars_repo_path": "parameterscan/test_random.py", "max_stars_repo_name": "DavidMStraub/parameterscan", "max_stars_repo_head_hexsha": "4fa1ce2bd9ed0f4ed20b0cafa6f17e6a98031903", "max_stars_repo_licenses": ["MIT"], "m... |
using LinearAlgebra
using Plots
function get_mass2_mat(nu1_mass::Float16, nu2_mass::Float16)::Array
"""Create a 2D mass-squared diagonal matrix"""
ret_array::Array{Float16} = Diagonal([nu1_mass^2, nu2_mass^2])
return ret_array
end
function get_mixing_matrix(mixing_angle::Float16, isdeg::Bool = true)::Arra... | {"hexsha": "403302e00a3474a7817d2ffffd888e7a86f1e912", "size": 3100, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "schrodingerODE.jl", "max_stars_repo_name": "hoganman/NeutrinoOscillations2D", "max_stars_repo_head_hexsha": "60a795bfca54e8716034b40b7b0c1470ab665427", "max_stars_repo_licenses": ["MIT"], "max_star... |
#include <boost/archive/iterators/base64_exception.hpp>
| {"hexsha": "63822f6261d8db5ea369b6700da036d0c2945d81", "size": 56, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "src/boost_archive_iterators_base64_exception.hpp", "max_stars_repo_name": "miathedev/BoostForArduino", "max_stars_repo_head_hexsha": "919621dcd0c157094bed4df752b583ba6ea6409e", "max_stars_repo_license... |
Require Import Crypto.Arithmetic.PrimeFieldTheorems.
Require Import Crypto.Specific.montgomery32_2e192m2e64m1_6limbs.Synthesis.
(* TODO : change this to field once field isomorphism happens *)
Definition sub :
{ sub : feBW_small -> feBW_small -> feBW_small
| forall a b, phiM_small (sub a b) = F.sub (phiM_small a) ... | {"author": "anonymous-code-submission-01", "repo": "sp2019-54-code", "sha": "8867f5bed0821415ec99f593b1d61f715ed4f789", "save_path": "github-repos/coq/anonymous-code-submission-01-sp2019-54-code", "path": "github-repos/coq/anonymous-code-submission-01-sp2019-54-code/sp2019-54-code-8867f5bed0821415ec99f593b1d61f715ed4f7... |
# Copyright (c) 2020, NVIDIA CORPORATION. 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 appli... | {"hexsha": "0dda57e6ed399a2b7adff1bef1b3dbba6212d905", "size": 6839, "ext": "py", "lang": "Python", "max_stars_repo_path": "nemo/collections/common/data/dataset.py", "max_stars_repo_name": "hamjam/NeMo", "max_stars_repo_head_hexsha": "b3484d32e1317666151f931bfa39867d88ed8658", "max_stars_repo_licenses": ["Apache-2.0"],... |
# -*- coding:utf-8 -*-
import numpy as np
def decode_bbox(anchors, raw_outputs, variances=[0.1, 0.1, 0.2, 0.2]):
'''
Decode the actual bbox according to the anchors.
the anchor value order is:[xmin,ymin, xmax, ymax]
:param anchors: numpy array with shape [batch, num_anchors, 4]
:param raw_outputs: ... | {"hexsha": "07a8818c3b4fde1ee6043727eb7b2499ae56298a", "size": 1395, "ext": "py", "lang": "Python", "max_stars_repo_path": "utils/anchor_decode.py", "max_stars_repo_name": "LeviVasconcelos/FaceMaskDetection", "max_stars_repo_head_hexsha": "4873f0073127cdd3b67aa249db746777b342ec90", "max_stars_repo_licenses": ["MIT"], "... |
[STATEMENT]
lemma L_10_5_\<upsilon>_components:
shows "L_10_5_\<upsilon> \<alpha> \<TT> \<KK> c \<tau> a\<lparr>NTMap\<rparr> =
(\<lambda>b\<in>\<^sub>\<circ>\<TT>\<lparr>HomDom\<rparr>\<lparr>Obj\<rparr>. L_10_5_\<upsilon>_arrow \<TT> \<KK> c \<tau> a b)"
and "L_10_5_\<upsilon> \<alpha> \<TT> \<KK> c \<tau>... | {"llama_tokens": 2209, "file": "CZH_Universal_Constructions_czh_ucategories_CZH_UCAT_PWKan", "length": 2} |
import os
import pickle
from pathlib import Path
import numpy as np
import open3d as o3d
import plac
from open3d.open3d_pybind.camera import PinholeCameraIntrinsic
from open3d.open3d_pybind.geometry import RGBDImage, PointCloud, TriangleMesh, Image
from open3d.open3d_pybind.io import write_point_cloud, write_triangle_... | {"hexsha": "5c4713e1a12480da5f71e9dca71fa4cecb0f4ce3", "size": 6546, "ext": "py", "lang": "Python", "max_stars_repo_path": "Video3D/rgbd2geometry.py", "max_stars_repo_name": "eight0153/flownet2-pytorch", "max_stars_repo_head_hexsha": "cc2964233cd18c8db05d1751281c6ab9d3165da6", "max_stars_repo_licenses": ["Apache-2.0"],... |
#!/usr/bin/env python
import unittest
import numpy as np
from . import lambdata_dmhliu
from lambdata_dmhliu.hd_km import hd
class HaversineDistanceTest(unittest.TestCase):
"""Making sure our example module works haversine(θ) = sin²(θ/2)
The haversine formula is a very accurate way of computing distances betwe... | {"hexsha": "3d37578488f3145a60a61da54185f305fc3d0a4e", "size": 781, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/unit_tests.py", "max_stars_repo_name": "dmhliu/lambdata", "max_stars_repo_head_hexsha": "9ae93eafbc3d1dc950e2cdb0b800f46f8d38785a", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null... |
using CUDA
using PaddedViews
function k_index_kernel_fft_2d(data, out,offx, offy)
dx = (blockIdx().x-1)*blockDim().x + threadIdx().x
dy = (blockIdx().y-1)*blockDim().y + threadIdx().y
#dz = (blockIdx().z-1)*blockDim().z + threadIdx().z
#sx,sy,sz = size(data)
# if dx > sx || dy > sy || dz > sz
... | {"hexsha": "40bfbb982c1108149b19eea6faf921d7b0de73f4", "size": 2998, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "module/fft_2d.jl", "max_stars_repo_name": "KonstantinosChatziantoniou/CustomStencil", "max_stars_repo_head_hexsha": "3b9d20521f35b5e05ecce5f251e60e8c7f738950", "max_stars_repo_licenses": ["MIT"], "... |
#
# * The source code in this file is based on the soure code of CuPy.
#
# # NLCPy License #
#
# Copyright (c) 2020-2021 NEC Corporation
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are ... | {"hexsha": "11119a69b6567ebdcb5aa010adcf35c5bc799b65", "size": 11206, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/pytest/math_tests/test_arithmetic.py", "max_stars_repo_name": "SX-Aurora/nlcpy", "max_stars_repo_head_hexsha": "0a53eec8778073bc48b12687b7ce37ab2bf2b7e0", "max_stars_repo_licenses": ["BSD-3... |
[STATEMENT]
lemma neutral: "\<forall>x\<in>A. g x = \<^bold>1 \<Longrightarrow> F g A = \<^bold>1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<forall>x\<in>A. g x = \<^bold>1 \<Longrightarrow> F g A = \<^bold>1
[PROOF STEP]
by (induct A rule: infinite_finite_induct) simp_all | {"llama_tokens": 117, "file": "Aggregation_Algebras_Semigroups_Big", "length": 1} |
import pandas as pd
import yaml
import os
import datetime
import dill
import collections
import numpy as np
import scipy as sp
from src.interpretability.lime_tabular import LimeTabularExplainer
from src.interpretability.submodular_pick import SubmodularPick
#from lime.lime_tabular import LimeTabularExplainer
#from lime... | {"hexsha": "ada21a510225bd43b8b5d70e5652a94dbe24a5d8", "size": 16460, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/interpretability/lime_explain.py", "max_stars_repo_name": "aildnont/HIFIS-model", "max_stars_repo_head_hexsha": "ee077ee96e20f8473f5d5628873d58a1f0521344", "max_stars_repo_licenses": ["MIT"],... |
# Copyright 2017 Battelle Energy Alliance, 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 t... | {"hexsha": "c70dee7a13bab0be8deda8f0e3824ac1f286cd9b", "size": 11367, "ext": "py", "lang": "Python", "max_stars_repo_path": "framework/Samplers/CustomSampler.py", "max_stars_repo_name": "milljm/raven", "max_stars_repo_head_hexsha": "5f29fe81b75e2ffbeb54a55aa63647e7b2f6457b", "max_stars_repo_licenses": ["Apache-2.0"], "... |
[STATEMENT]
lemma eq_\<I>_gpvD:
"eq_\<I>_gpv A \<I> gpv gpv' \<Longrightarrow> rel_spmf (eq_\<I>_generat A \<I> (eq_\<I>_gpv A \<I>)) (the_gpv gpv) (the_gpv gpv')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. eq_\<I>_gpv A \<I> gpv gpv' \<Longrightarrow> rel_spmf (eq_\<I>_generat A \<I> (eq_\<I>_gpv A \<I>)) (th... | {"llama_tokens": 224, "file": "Constructive_Cryptography_Converter_Rewrite", "length": 1} |
#include <iostream>
#define ADEPT_NO_AUTOMATIC_DIFFERENTIATION
#define ADEPT_REAL_TYPE_SIZE 4
#include <adept_arrays.h>
#include "Timer.h"
#define ASSIGN =
#define WARMUP_OPERATOR + exp
#define OPERATOR + fastexp
//#define SUFFIX_OP + 0.5
#define SUFFIX_OP
using namespace adept;
int main()
{
Timer timer;
timer... | {"hexsha": "a8d06113f4a0c4aee388a1426cb039c17acf0d0a", "size": 4462, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "test/test_array_speed.cpp", "max_stars_repo_name": "yairchu/Adept-2", "max_stars_repo_head_hexsha": "3b4f898c74139618464ccd8e8df0934aed9ed6a2", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_... |
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distribu... | {"hexsha": "53452f412d3aac055bc690774c55547d543a32c0", "size": 9717, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/openfermion/circuits/primitives/state_preparation.py", "max_stars_repo_name": "bene1337/OpenFermion", "max_stars_repo_head_hexsha": "84d169b529a27a0cfd1cc41073d2665f1fcf0312", "max_stars_repo_... |
import sys
import os
from numpy.ma.core import size
import pygame
import matplotlib
matplotlib.use("module://pygame_matplotlib.backend_pygame")
# matplotlib.use('Qt4Agg')
import matplotlib.pyplot as plt
import matplotlib.figure as fg
plt.figure(figsize=(16, 9))
plt.plot([1, 2], [1, 2], color="green", label="HAHA")
... | {"hexsha": "7a74ca7185748b03b1f66780e3b34f5960658d2e", "size": 398, "ext": "py", "lang": "Python", "max_stars_repo_path": "test_plt.py", "max_stars_repo_name": "lionel42/pygame-matplotlib-backend", "max_stars_repo_head_hexsha": "7b15c06189e0b690a0ec5ba83e6b9759f940642e", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
/* boost random/cauchy_distribution.hpp header file
*
* Copyright Jens Maurer 2000-2001
* Distributed under the Boost Software License, Version 1.0. (See
* accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* See http://www.boost.org for most recent version including do... | {"hexsha": "d4dee6541bfedb2dbe87cba9e3dfb1455a7bd053", "size": 2647, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "include/boost/random/cauchy_distribution.hpp", "max_stars_repo_name": "dstrigl/mcotf", "max_stars_repo_head_hexsha": "92a9caf6173b1241a2f9ed45cd379469762b7178", "max_stars_repo_licenses": ["BSL-1.0"... |
import numpy as np
import pandas as pd
import cv2
from numba import jit
from . import datamanager
class ThreeDI(datamanager.DataManager):
"""data manager for 3DI
:param _scenarios: list of scenario
:type _scenarios: dict
:param _sensored: sensored axis list in 3di experiment
:type _sensored: list
... | {"hexsha": "6da428d585c88c37a8f3d79cd7fe5a51f919e200", "size": 14130, "ext": "py", "lang": "Python", "max_stars_repo_path": "mpvr/datamodule/motion_device.py", "max_stars_repo_name": "nearj/mpvr-motionfiltering", "max_stars_repo_head_hexsha": "478304391e031a11bd15a604a272017ce8e48abf", "max_stars_repo_licenses": ["MIT"... |
[STATEMENT]
lemma ntrs_c_cases_s[cases set]: "\<lbrakk>
((s,c),w,(s',c'))\<in>ntrs fg;
!!csp. \<lbrakk> c'=csp+c; !!s. s \<in># csp \<Longrightarrow> \<exists>p u v. s=[entry fg p] \<and>
(u,Spawn p,v)\<in>edges fg \<and>
init... | {"llama_tokens": 334, "file": "Program-Conflict-Analysis_Normalization", "length": 1} |
# Computes expected results for `testGRU()` in `Tests/TensorFlowTests/LayerTests.swift`.
# Requires 'tensorflow>=2.0.0a0' (e.g. "pip install tensorflow==2.2.0").
import sys
import numpy
import tensorflow as tf
# Set random seed for repetable results
tf.random.set_seed(0)
def indented(s):
return '\n'.join([' '... | {"hexsha": "07ee7619d861f5dd293f0ef808fb61721aee0999", "size": 5241, "ext": "py", "lang": "Python", "max_stars_repo_path": "Utilities/ReferenceImplementations/gru.py", "max_stars_repo_name": "vguerra/swift-apis", "max_stars_repo_head_hexsha": "215c1380874c55d2f12ae81ce78968f9e25ed723", "max_stars_repo_licenses": ["Apac... |
import math
import numpy as np
earth_radius = 6373
def dot_product(v1, v2):
return sum((a * b) for a, b in zip(v1, v2))
def vector_length(v):
return math.sqrt(dot_product(v, v))
def angle(v1, v2):
return math.acos(dot_product(v1, v2) / (vector_length(v1) * vector_length(v2)))
def degrees_to_radians... | {"hexsha": "5a2e0a64924380f720f52a596fdc4092f18b8f4c", "size": 5789, "ext": "py", "lang": "Python", "max_stars_repo_path": "locintel/core/algorithms/geo.py", "max_stars_repo_name": "pedrofreitascampospro/locintel", "max_stars_repo_head_hexsha": "eb9c56cdc308660c31d90abe9fe62bd3634ba273", "max_stars_repo_licenses": ["MI... |
import copy
import pandas as pd
import numpy as np
import pytest
from gluonts.dataset.common import ListDataset
from autogluon.forecasting.dataset.ts_dataframe import TimeSeriesDataFrame
START_TIMESTAMP = pd.Timestamp("01-01-2019", freq='D')
END_TIMESTAMP = pd.Timestamp("01-02-2019", freq='D')
ITEM_IDS = (0, 1, 2)
... | {"hexsha": "1890d69f74178181f73806f62e30d57b0dbb0c87", "size": 7306, "ext": "py", "lang": "Python", "max_stars_repo_path": "forecasting/tests/unittests/test_ts_dataset.py", "max_stars_repo_name": "willsmithorg/autogluon", "max_stars_repo_head_hexsha": "1e8c6a2f30fcc473411bf393c9827eb4713dcef6", "max_stars_repo_licenses... |
import os, glob, cv2
import numpy as np
import pylab
im_simple = '/home/faedrus/Documents/au_trap/20141031/1414763725.88.png'
im_complex = '/home/faedrus/Documents/au_trap/20141031/1414769658.04.png'
img = cv2.imread(im_complex)
(height, width, depth) = img.shape
cv2.namedWindow('original', cv2.WINDOW_NORMAL)
cv2.ims... | {"hexsha": "021885011af7a639b6d7e8858c7aa647562f9674", "size": 727, "ext": "py", "lang": "Python", "max_stars_repo_path": "test_sift.py", "max_stars_repo_name": "jfindleyderegt/au_trap", "max_stars_repo_head_hexsha": "cc1d6a4001adb44a73cc64124c0853e6d899b1ba", "max_stars_repo_licenses": ["CC0-1.0"], "max_stars_count": ... |
\documentclass[12pt]{article}
\usepackage{latexsym,amssymb,amsmath} % for \Box, \mathbb, split, etc.
% \usepackage[]{showkeys} % shows label names
\usepackage{cite} % sorts citation numbers appropriately
\usepackage{path}
\usepackage{url}
\usepackage{verbatim}
\usepackage{graphicx}
\usepackage{array}
\usepackage{multir... | {"hexsha": "80c7326d6e6a566b479b1758569eefe99e41856e", "size": 12855, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "docs/assignment-3/MCP_9531504_HW3.tex", "max_stars_repo_name": "gholomia/Parallax", "max_stars_repo_head_hexsha": "f6ddf919d105fb385a735e598abd82a330b13de0", "max_stars_repo_licenses": ["MIT"], "ma... |
from dolo.symbolic.symbolic import Variable,Parameter
import sympy
def convert_struct_to_dict(s):
# imperfect but enough for now
if len(s.dtype) == 0:
if s.shape == (1,):
return str(s[0])
elif s.shape == (0,0):
return []
elif s.shape == (1,1):
return... | {"hexsha": "e405061faa80d57221c5a62c7113a8261c768cbd", "size": 4015, "ext": "py", "lang": "Python", "max_stars_repo_path": "dolo/misc/matlab.py", "max_stars_repo_name": "christophe-gouel/dolo", "max_stars_repo_head_hexsha": "d9aef6d78d19899e2669e49ee6b7ad9aacf0e35d", "max_stars_repo_licenses": ["BSD-2-Clause"], "max_st... |
#include <boost/asio/io_service.hpp>
#include <boost/asio/spawn.hpp>
#include <boost/asio/write.hpp>
#include <boost/asio/buffer.hpp>
#include <boost/asio/ip/tcp.hpp>
#include <list>
#include <string>
#include <ctime>
using namespace boost::asio;
using namespace boost::asio::ip;
io_service ioservice;
tcp::endpoint tcp... | {"hexsha": "a1e1126520963849ebdd461f7f66fe3945cc9f84", "size": 1040, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "cpp/boost-asio/6-server-yield.cpp", "max_stars_repo_name": "harkhuang/harkcode", "max_stars_repo_head_hexsha": "1c9802bfc8d599e20ee9082eca14165a782ddf85", "max_stars_repo_licenses": ["MIT"], "max_st... |
import datetime
from pathlib import Path
import numpy
import simpleaudio as sa
import io
import math
from pydub import AudioSegment
from pydub.utils import mediainfo
from pydub.playback import play
from dearpygui.core import *
from dearpygui.simple import *
import os
import ntpath
import csv
import argpar... | {"hexsha": "6aa2e616288473a2b0cec3c36b26239fb03028f3", "size": 28407, "ext": "py", "lang": "Python", "max_stars_repo_path": "proofreader.py", "max_stars_repo_name": "youmebangbang/TTS-dataset-tools", "max_stars_repo_head_hexsha": "0302c259d5c7b85333ab34575abb8e8aa5127cbb", "max_stars_repo_licenses": ["MIT"], "max_stars... |
# -*- coding: utf-8 -*-
"""
Created on Wed Oct 7 22:06:42 2015
@author: hoseung
"""
import numpy as np
a = np.zeros(10)
b = [0,1,4,7]
c= a[b]
print(c)
c[2] = 1.2
print(c)
print(a)
#%%
x = np.array([(1.5, 4), (1.0, 2), (3.0, 4)], dtype=[('x', float), ('y', int)])
ind = np.where(x['x'] < 2)
b = x[ind]
#%%
fr... | {"hexsha": "c9704f99d59e6139f6c776930eb443fbab0b531e", "size": 1775, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/galaxy_evol/lambda_mp_good.py", "max_stars_repo_name": "Hoseung/pyRamAn", "max_stars_repo_head_hexsha": "f9386fa5a9f045f98590039988d3cd50bc488dc2", "max_stars_repo_licenses": ["MIT"], "max... |
#!/usr/bin/python
#
# Copyright 2022 DeepMind Technologies Limited
#
# 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 a... | {"hexsha": "cfed4d0f9c2e8765de42c29ed0e5466786a598e1", "size": 26543, "ext": "py", "lang": "Python", "max_stars_repo_path": "distribution_shift_framework/classification/experiment_lib.py", "max_stars_repo_name": "deepmind/distribution_shift_framework", "max_stars_repo_head_hexsha": "f6946779128dd90ae820f5c36fb5dbfad58a... |
from ..dataset import DataSet
from . import BaseNode
import numpy as np
from ..trials import reject_trials, baseline, erp, random_groups, ungroup
import inspect
class Mean(BaseNode):
""" Take the mean along a given axis """
def __init__(self, axis=2, n=None):
BaseNode.__init__(self)
self.axis=a... | {"hexsha": "cb83a080a2728e5a3b4b82f1fe68a2af808a0057", "size": 5765, "ext": "py", "lang": "Python", "max_stars_repo_path": "psychic/nodes/erp.py", "max_stars_repo_name": "wmvanvliet/psychic", "max_stars_repo_head_hexsha": "4ab75fb655795df0272c1bb0eb0dfeb232ffe143", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_star... |
# The MIT License (MIT)
#
# Copyright (c) 2017 Niklas Rosenstein
#
# 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
# rights to use, copy,... | {"hexsha": "9cd0e9a78ff52924a76ca067a128b8f22f02112a", "size": 3008, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/03_live_emg.py", "max_stars_repo_name": "hugh-dickens/myo-python", "max_stars_repo_head_hexsha": "bec3652c33e6198ab53836fe6fa27f5d89a4d3b0", "max_stars_repo_licenses": ["MIT"], "max_stars... |
import sys
from sklearn.metrics import classification_report, accuracy_score
import numpy as np
import scipy
true = [int(line.strip()) for line in open(sys.argv[1])]
pred = [int(line.strip()) for line in open(sys.argv[2])]
print classification_report(true, pred)
print accuracy_score(true, pred)
| {"hexsha": "4a7ff443c43aa2be08f8a8569ee92e07984764bf", "size": 300, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/accu.py", "max_stars_repo_name": "mriosb08/palodiem-QE", "max_stars_repo_head_hexsha": "a946337db8016c8811374303749b1c4239bed6cc", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count": ... |
function [Xt,Yt] = elec_3d_2d(X,Y,Z,Zrad)
% elec_3d_2d - Project Cartesian 3D coordinates to a 2D plane.
%
% [Xt,Yt] = elec_3d_2d(X,Y,Z,Zrad)
%
% Project 3D electrode positions onto a 2D plane, using
% gnomonic projection, which draws a line from a point
% halfway between equator and south pole, through electrode,
... | {"author": "PatternRecognition", "repo": "OpenBMI", "sha": "3c42e609d5b867a8e15c780df3f8b0a8b86edcb8", "save_path": "github-repos/MATLAB/PatternRecognition-OpenBMI", "path": "github-repos/MATLAB/PatternRecognition-OpenBMI/OpenBMI-3c42e609d5b867a8e15c780df3f8b0a8b86edcb8/PR_BCI_team/Team_EarEEG/ear-EEG connecting/extern... |
"""
Author: Timothy Tickle
Description: Class to abstract an abundance table and methods to run on such a table.
"""
#####################################################################################
#Copyright (C) <2012>
#
#Permission is hereby granted, free of charge, to any person obtaining a copy of
#this softw... | {"hexsha": "916125547a6d132438c4e205d0b7c80cef0add64", "size": 114315, "ext": "py", "lang": "Python", "max_stars_repo_path": "lefsebiom/AbundanceTable.py", "max_stars_repo_name": "gsetia1/lefse", "max_stars_repo_head_hexsha": "200aa6ae67992aa791f4b96f5c7aa8005bfb870c", "max_stars_repo_licenses": ["MIT"], "max_stars_cou... |
[STATEMENT]
lemma isCont_powrat:
assumes "0 < x" shows "isCont (\<lambda>x. x pow\<^sub>\<rat> r) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. isCont (\<lambda>x. x pow\<^sub>\<rat> r) x
[PROOF STEP]
proof (cases r)
[PROOF STATE]
proof (state)
goal (1 subgoal):
1. \<And>a b. \<lbrakk>r = Fract a b; 0 < b; co... | {"llama_tokens": 1890, "file": "Real_Power_RatPower", "length": 19} |
import hashlib
import os
import shutil
from abc import abstractmethod
from datetime import datetime
from glob import glob
from logging import getLogger
from typing import Any, Optional
import luigi
import numpy as np
import pandas as pd
from tqdm import tqdm
from gokart.file_processor import FileProcessor, make_file_... | {"hexsha": "b888ff50374d3524daefdad814bbe5ecc9692c22", "size": 8376, "ext": "py", "lang": "Python", "max_stars_repo_path": "gokart/target.py", "max_stars_repo_name": "ujiuji1259/gokart", "max_stars_repo_head_hexsha": "904268ff32feb42847df7ae898b0e2e454f787b5", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null... |
module Stardates
import Dates
import Printf
using TimeZones
include("constants.jl")
include("startofyear.jl")
include("sd.jl")
export Stardate, stardate, defaulttimezone, mediawiki, mstardate,
nyse_closing_stardate
end # module
| {"hexsha": "e5d107c50b3a992418878965fe6efb42f0239b26", "size": 236, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/Stardates.jl", "max_stars_repo_name": "chrisoei/Stardates.jl", "max_stars_repo_head_hexsha": "93285fc9080ec746f675d578e29594f5d9a2f1f0", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nu... |
[STATEMENT]
lemma certification_via_eq_HNF:
assumes sound_HNF: "is_sound_HNF HNF associates res"
and P1_H1: "(P1,H1) = HNF (mat_of_rows n fs_init)"
and P2_H2: "(P2,H2) = HNF (mat_of_rows n gs)"
and H1_H2: "H1 = H2" (*The HNF are equal*)
and gs: "set gs \<subseteq> carrier_vec n" and len_gs: "length gs... | {"llama_tokens": 12463, "file": "Modular_arithmetic_LLL_and_HNF_algorithms_HNF_Mod_Det_Soundness", "length": 115} |
import os, tarfile, pickle
import numpy as np
import h5py
from PuzzleLib.Datasets.DataLoader import DataLoader
class Cifar10Loader(DataLoader):
def __init__(self, onSample=None, onSampleBatch=None, cachename="cifar10.hdf"):
super().__init__(("data", "labels"), cachename)
if onSample:
self.onSample = onSamp... | {"hexsha": "c3a6a9d8fa882a9a0033ef7fd91284f96a94f18a", "size": 2570, "ext": "py", "lang": "Python", "max_stars_repo_path": "Datasets/Cifar10Loader.py", "max_stars_repo_name": "EmilPi/PuzzleLib", "max_stars_repo_head_hexsha": "31aa0fab3b5e9472b9b9871ca52e4d94ea683fa9", "max_stars_repo_licenses": ["Apache-2.0"], "max_sta... |
[STATEMENT]
lemma fls_divide_X_intpow':
fixes f :: "'a::{semiring_1,inverse,uminus} fls"
assumes "inverse (1::'a) = 1"
shows "f / (fls_X_intpow i) = fls_shift i f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. f / fls_X_intpow i = fls_shift i f
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using ... | {"llama_tokens": 234, "file": null, "length": 2} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.