text
stringlengths
957
885k
<reponame>qihuilyu/P2T import sys, os from os.path import join as pjoin import math import numpy as np from rotation import inv_rotbeam TEMPLATES = pjoin(os.path.abspath(os.path.dirname(__file__)), 'templates') def generate_beamon(stream, nparticles, nruns=1): """write entire beamon file contents to stream for ...
#!/usr/bin/env python """ A very-specific malware search and removal program for PHP / WordPress v1.0 The MIT License (MIT) Copyright (c) 2015 <NAME>. 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 Sof...
<reponame>MiroK/nEuronMI from neuronmi.simulators.solver.embedding import EmbeddedMesh from neuronmi.simulators.solver.transferring import SubMeshTransfer import dolfin as df import numpy as np import unittest class TestCases(unittest.TestCase): def test_to_DG0(self): subdomains = (df.CompiledSubDomain('...
# -*- coding: utf-8 -*- """Final Project Poem Automatically generated by Colaboratory. Original file is located at https://colab.research.google.com/drive/1dX7e5VDsDkr_Go9GlTQbMDyOUOiBC11- """ import random day = ["year","hour","second","minute","dawn","evening"] day2 = ["Easter","Hanukkah","Easter","Black Frid...
# ----------------------------------------------------------------------------- # Copyright (c) 2009-2016 <NAME>. All rights reserved. # Distributed under the (new) BSD License. # ----------------------------------------------------------------------------- """ Template backend for writing a new backend. """ import os,...
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
import urllib.parse import bs4 import copy import hashlib import os.path import traceback import WebRequest from WebMirror.processor.ProcessorBase import PageProcessor # import TextScrape.SiteArchiver import common.util.urlFuncs as urlFuncs import WebMirror.processor.ProcessorUtils.gDocParse as gdp # import T...
<reponame>shubhamdipt/refugee-management<filename>organization/models.py from django.conf import settings from django.core.validators import MaxValueValidator, MinValueValidator from django.db import models from django.utils import timezone from django.utils.translation import gettext_lazy as _ from locations.models i...
<reponame>germal/Semantic_SLAM-1<gh_stars>100-1000 # coding: utf-8 import numpy as np import matplotlib.pyplot as plt import sklearn.datasets as ds import matplotlib.colors from sklearn.cluster import DBSCAN from sklearn.preprocessing import StandardScaler def expand(a, b): d = (b - a) * 0.1 return a-d, b+d ...
from torch.utils.tensorboard import SummaryWriter from torchvision import transforms from datasets.dataset_processors import ExtendedDataset from models.model import ResNet50 from models.siamese import MssNet from base import BaseExecutor from utils.utilities import type_error_msg, value_error_msg, timer, load_model fr...
<gh_stars>1-10 # Copyright 2020 <NAME> # # 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 wr...
<gh_stars>10-100 # Copyright (c) 2021, <NAME> # See LICENSE file for details: <https://github.com/moble/spherical/blob/master/LICENSE> import os import pytest import numpy as np import quaternionic ell_max_default = 36 try: import spinsfast requires_spinsfast = lambda f: f except: requires_spinsfast = py...
<filename>setup.py #!/usr/bin/env python from __future__ import print_function import os import sys import contextlib from setuptools import Extension, setup from distutils.command.build_ext import build_ext from distutils.sysconfig import get_python_inc from distutils import ccompiler, msvccompiler from Cython.Build i...
<reponame>molaruna/rcs_wearable_analysis #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ This function synchronizes and processes all data from the local directory it is run. This data can include files from the Summit RC+S system, Apple watches, PKG watches, and patient reports. All data must be CSV formatted a...
# Copyright(c) 2007-2009 by <NAME> <<EMAIL>> # # This file is part of Chavier. # # Chavier is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any late...
import multiprocessing as mp import os from threading import Thread from human_tracker import camera_capture from database import ImageDB from absl import app, flags, logging from absl.flags import FLAGS import numpy as np import pandas as pd import signal, sys import datetime as dt import shutil import time flags.DEF...
import tempfile import numpy as np import h5py from pyscf import lib #einsum = np.einsum einsum = lib.einsum # This is restricted (R)CCSD # Ref: Hirata et al., J. Chem. Phys. 120, 2581 (2004) ### Eqs. (37)-(39) "kappa" def cc_Foo(t1,t2,eris): nocc, nvir = t1.shape foo = eris.fock[:nocc,:nocc] Fki = foo....
'''usage: python cordexabel.py ncpath lname llon llat lalt prefix n onlygeog with default values for prefix = . and n = 500. ''' import sys import os import numpy as np import netCDF4 import datetime import time sys.path.append('/cluster/home/kojito/lib/python/site-packages') import geopy.distance myfmt = '%.8f' ##...
import numpy as np import cv2 import socket class videoStreaming(object): def __init__(self, host, port): self.serverSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # server socket self.serverSocket.bind((host, port)) # binds the host ip with port self.serverSocket.listen(0) ...
<reponame>kspook/text-detection-ctpn01 from __future__ import print_function import tensorflow as tf import numpy as np import os, sys, cv2 from tensorflow.python.platform import gfile import glob import shutil dir_path = os.path.dirname(os.path.realpath(__file__)) sys.path.append(os.path.join(dir_path, '..')) from l...
<gh_stars>1-10 import logging from zensols.actioncli import OneConfPerActionOptionsCliEnv import zensols.dlqaclass.lsa from zensols.dlqaclass import ( AppConfig, QADataLoader, QAModelManager, Ranker, ) class CorpusExec(object): def __init__(self, config): self.config = config self....
<reponame>Ilanad/cloudify-cli ######## # Copyright (c) 2018 Cloudify Platform Ltd. 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/license...
#!/usr/bin/env python # -*- coding:utf-8 -*- """ Authors: fuqiang(<EMAIL>) Date: 2017/11/29 使用paddle框架实现个性化电影推荐系统的模型训练和参数输出保存,关键步骤如下: 1.初始化 2.配置网络结构和设置参数: - 构造用户融合特征模型 - 构造电影融合特征模型 - 定义特征相似性度量inference - 成本函数cost - 创建parameters - 定义feeding 3.定义event_handle...
from tkinter import* from tkinter import StringVar, ttk from communicationInformation import communicationInformation from CVManager import CVManager from tkinter import filedialog from buttonHandler import buttonHandler class GUI: def __init__(self,root): self.passingInfo=communicationInformation() ...
# Copyright 2021 Alibaba Group Holding Limited. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
import numpy RdYlGn = numpy.array([ [0.64705882, 0., 0.14901961, 1.], [0.66243752, 0.01476355, 0.14932718, 1.], [0.68550557, 0.03690888, 0.14978854, 1.], [0.70088428, 0.05167243, 0.15009612, 1.], [0.72395233, 0.07381776, 0.15055748, 1.], [0.73933103, 0.08858131, 0.15086505, 1.], [0.76239908...
import os import shutil from ..package import Package from ..util import run, download, require_program, param_attrs class APR(Package): """ The Apache Portable Runtime. :identifier: apr-<version> :param version: version to download """ def __init__(self, version: str): self.version =...
<filename>__init__.py import time from mycroft.messagebus.message import Message from mycroft.skills.core import MycroftSkill, intent_handler from adapt.intent import IntentBuilder from mycroft.util.log import LOG from mycroft import intent_file_handler from apa102_pi.colorschemes import colorschemes from apa102_pi....
from flask import Flask, render_template, url_for, request, redirect, url_for, abort from .forms import PitchForm, UpdateProfile from . import main from ..models import User,Pitch # Pitch, Comments, PitchCategory, Votes from flask_login import login_required, current_user from .. import db,photos #db app = Flask(__na...
# Copyright (c) 2019, Myrtle Software Limited. All rights reserved. # Copyright (c) 2019, 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 # # ...
from pytest import raises import pytest def test_register(): from DeSSL.data import SEMI_DATASET_REGISTRY from DeSSL import loadding_config parser = loadding_config('config/base.yml') args = parser.parse_args([]) semi_cifar = SEMI_DATASET_REGISTRY( 'semi_cifar10')(args.root, args.num_lab...
<reponame>jentjr/envirobase import json from . import db import pandas as pd from datetime import datetime from geoalchemy2 import functions from geoalchemy2.types import Geometry from flask import current_app, request, url_for from .errors import AlreadyExistsError class BaseExtension(db.MapperExtension): """Bas...
# -*- coding: utf-8 -*- import os import numpy as np from sklearn.datasets import fetch_mldata import npdl def get_data(): # data print("loading data, please wait ...") mnist = fetch_mldata('MNIST original', data_home=os.path.join(os.path.dirname(__file__), './data')) print('data loading is done ......
# --------------------------------------------------------------------- # Vendor: Huawei # OS: MA5300 # --------------------------------------------------------------------- # Copyright (C) 2007-2020 The NOC Project # See LICENSE for details # --------------------------------------------------------------------- #...
<reponame>ossf-cve-benchmark/CVE-2018-8035 #!/usr/bin/python # ----------------------------------------------------------------------- # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # re...
<filename>src/main.py<gh_stars>1-10 from tkinter import filedialog , Button, W, E, Label, Tk, messagebox from informationgetter import InformationGetter from pathgetter import getprojectspath, getprojectspath_window, filepath_status from datetime import datetime import tzlocal import json # window creation root = Tk()...
<filename>read_database.py import numpy as np import pandas as pd import re #get rid of nun numeric strings def fill_zeros_with_last(arr): last_val = None # I don't really care about the initial value for i in range(arr.size): if arr[i] and arr[i]!='': last_val = arr[i] else: arr[i] = last_val ...
#!/usr/bin/env python3 ''' generate a one liner for python based shellcode delivery ''' # pylint: disable=invalid-name, broad-except import atexit import base64 import readline import sys sc_loader_template = ''' import ctypes import sys from ctypes.util import find_library PROT_READ = 0x01 PROT_WRITE = 0x02 PROT_E...
<reponame>radekg/netapp-ontap-lib-get from netapp.igroup.initiator_info import InitiatorInfo from netapp.netapp_object import NetAppObject class InitiatorGroupInfo(NetAppObject): """ Information about an initiator group. """ _initiator_group_alua_enabled = None @property def initiator_grou...
######################################################################## # # License: BSD # Created: January 14, 2004 # Author: <NAME> - <EMAIL> # # $Id$ # ######################################################################## """Here is defined the UnImplemented class. See UnImplemented cl...
<reponame>mgornik/PEAN<gh_stars>0 # -*- coding: utf-8 -*- import logging import util import os import os.path as path import re import final_report import datetime import sys import fnmatch from util import bcolors from os.path import join from Queue import Queue from shutil import copyfile from threading import Thre...
from ui.dialogs.ui_preferences import Ui_Preferences from views import styles import util import cadnano import os.path, zipfile, shutil, platform, subprocess, tempfile, errno util.qtWrapImport('QtCore', globals(), ['QObject', 'QSettings', 'pyqtSlot', 'Qt']) util.qtWrapImport('QtWidgets', globals(), ['QWidget', 'QDialo...
# # test_route # # Copyright (c) 2011-2021 <NAME> <<EMAIL>> # # SPDX-License-Identifier: MIT # import ayame from ayame import http, route from base import AyameTestCase class RouteTestCase(AyameTestCase): def test_static_rules(self): map = route.Map() map.connect('/', 0) map.connect(...
#!/usr/bin/env python # Copyright 2014 The LUCI Authors. All rights reserved. # Use of this source code is governed under the Apache License, Version 2.0 # that can be found in the LICENSE file. import sys import unittest from test_support import test_env test_env.setup_test_env() from google.appengine.ext import nd...
<gh_stars>0 # -*- coding: utf-8 -*- """ Unit tests for the BlogPost plugin and its model """ import re from datetime import datetime from unittest import mock from django import forms from django.conf import settings from django.contrib.auth.models import AnonymousUser from django.test.client import RequestFactory fro...
<reponame>TheCheapestPixels/panda3d-simplepbr import os import panda3d.core as p3d from direct.filter.FilterManager import FilterManager from .version import __version__ __all__ = [ 'init', ] def _add_shader_defines(shaderstr, defines): shaderlines = shaderstr.split('\n') for line in shaderlines: ...
<gh_stars>1-10 # $Id$ #----------------------------------------------------------------------- # Copyright (C) 2019 # Associated Universities, Inc. Washington DC, USA. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by t...
# -*- coding: utf-8 -*- # Import Python libs from __future__ import absolute_import, print_function, unicode_literals # Import Salt Libs import salt.modules.helm as helm # Import Exception from salt.exceptions import CommandExecutionError # Import Salt Testing Libs from tests.support.mixins import LoaderModuleMockM...
<filename>canteen_tests/test_model/test_key.py # -*- coding: utf-8 -*- """ model key tests ~~~~~~~~~~~~~~~ tests canteen's model keys. :author: <NAME> <<EMAIL>> :copyright: (c) <NAME>, 2014 :license: This software makes use of the MIT Open Source License. A copy of this license is included a...
from typing import Optional, List, Type from scrapy import signals, Spider from scrapy.crawler import CrawlerProcess from scrapy.signalmanager import dispatcher from proxy_parse.proxy.abc import ABCProxyParser from proxy_parse.spiders import ( FreeProxyListSpider, BlogSpotSpider, ProxySearcherSpider, ...
<reponame>iBiology/ProtParCon #!/usr/bin/env python # -*- coding: utf-8 -*- """ Providing a common interface for performing topology test (`AU test`_) over protein alignments using various programs. Users are asked to provide a multiple sequence alignment (MSA) file, a NEWICK format tree file, and a topology test pr...
from __future__ import print_function import httplib2 import sys, os import re from apiclient import discovery from oauth2client import client from oauth2client import tools from oauth2client.file import Storage import sqlite3 from .AddScoresToDatabase import convertTitle # If modifying these scopes, delete your p...
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2017 F5 Networks Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # ...
# Copyright 2019 <NAME> # # This file is part of StDb. # # 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, modify, m...
<reponame>bio-hpc/metascreener<gh_stars>1-10 ## Automatically adapted for numpy.oldnumeric Jul 23, 2007 by ######################################################################## # # Date: May 2006 Authors: <NAME>, <NAME> # # <EMAIL> # <EMAIL> # # The Scripps Research Institute (TSRI) # Molecular G...
<filename>src/GradientFreeOptimizers/Helpers.py ''' Name: Helpers Desriptption: Some helper functions Email: <EMAIL> OpenSource: https://github.com/yesunhuang Msg: for studying quantum RNN Author: YesunHuang Date: 2022-04-02 23:10:18 ''' #import everything from IPython import display import time import matplotlib.pypl...
# -*- coding: utf-8 -*- import tensorflow as tf class HEBR_Cell(): def __init__(self): self.dims = {'user': None, 'area': None, 'climate': None, 'user_hidden': None, 'area_hidden': None, 'climate_hid...
<gh_stars>1-10 from net.tran import FeatureNet, TransformerNet from net.tran import gram_matrix,batch_normalize import torch as t import torchvision as tv from torch.nn import functional as F from torch.utils.data import DataLoader import tqdm import matplotlib.pyplot as plt import cv2 import numpy as np device=t....
<reponame>beardad1975/thonny-pos import tkinter as tk from tkinter import ttk from thonny.codeview import CodeViewText from thonny.shell import ShellText from thonny import get_workbench, get_shell from ..base_postit import BaseCode, BasePost, BasePopup from ..common import common_images class ToolWidget(ttk.Frame):...
<reponame>ni/hoplite import time from hoplite.builtin_plugins.constants import DOWNLOAD_NETWORK_FOLDER_JOB_NAME from hoplite.utils import server_logging from hoplite.server.jobs.job import Job, JobNotStartedError, NotAuthorizedError from tests import HopliteTestCase logger = server_logging.get_server_logger(__name__)...
<filename>app.py from flask import Flask, render_template, request, session from flask_bootstrap import Bootstrap import os import numpy import gui_logic as hmm app = Flask(__name__) bootstrap = Bootstrap(app) app.secret_key = "secret" @app.route('/', methods = ['GET']) @app.route('/index', methods = ['GET']) def ind...
<filename>simpleml/linear_regression.py<gh_stars>0 import numpy as np from abc import ABC class BaseModel(ABC): """ Abstract Model Class used as interface of all regression models. :param model: Stored model data (NumPy array in most cases) :type model: np.ndarray :param data: input data for trai...
from functools import partial from operator import itemgetter import attr from characteristic import Attribute, attributes from effect import catch, raise_ import six from toolz.functoolz import identity from toolz.itertoolz import concat from otter.cloud_client import cloudfeeds as cf from otter.cloud_client imp...
<gh_stars>0 try: from collections import OrderedDict except ImportError: from django.utils.datastructures import SortedDict as OrderedDict from django.db import models from django.db.models.fields import BLANK_CHOICE_DASH from django.utils.encoding import python_2_unicode_compatible from django.utils.functiona...
#!/usr/bin/env python # coding: utf-8 # # Copyright (c) 2015, PAL Team. # All rights reserved. See LICENSE for details. # # An API to the Bon Appetit food service data # # Author: <NAME> and <NAME> # TODO: # - Add support for caching data with pickle # - Decide on a naming scheme for cached data # - Implement a way to ...
import os import xml.etree.ElementTree as ET import matplotlib.font_manager as fm import numpy as np from PIL import ImageDraw, ImageFont def get_label(path): """get label info from txt file""" labels = [] with open(path, encoding='UTF-8') as f: lines = f.readlines() for line in lines: ...
import json import math import unittest import numpy as np import random from audiomentations.core.utils import calculate_rms from audiomentations import AddGaussianSNR class TestGaussianSNR(unittest.TestCase): def test_gaussian_noise_snr_defaults(self): np.random.seed(42) samples_in = np.rando...
import os from glob import glob import itertools import numpy as np import time from queue import LifoQueue as Queue import torch.cuda.nvtx as nvtx import copy import h5py import subprocess def get_shard_range(num_files, num_shards, shard_id, cycle_dist=0): assert (shard_id < num_shards) # shard files into b...
<reponame>IntuitionMachine/cppn-gan-vae-tensorflow import math import numpy as np import tensorflow as tf from tensorflow.python.framework import ops #from utils import * class batch_norm(object): """Code modification of http://stackoverflow.com/a/33950177""" def __init__(self, batch_size, epsilon=1e-5, mome...
import re, string from nltk.stem.snowball import SnowballStemmer from nltk.tokenize import word_tokenize class Cleaners(object): """class for collecting cleaning methods""" def __init__(self, stopwords=None): if isinstance(stopwords, list): self.stopwords = stopwords elif isinstan...
<reponame>yangwu91/biopython #!/usr/bin/env python """Test the HMM.MarkovModel and HMM.DynamicProgramming modules. Also tests Training methods. """ # standard modules from __future__ import print_function import unittest import math # biopython from Bio import Alphabet from Bio.Seq import Seq # stuff we are testin...
import os import numpy as np import pandas as pd import seaborn as sb import tensorflow as tf import tensorflow_hub as hub import sklearn.metrics import sklearn.model_selection from absl import logging logging.set_verbosity(logging.INFO) # !pip install sentencepiece # in case there is no such file in local path if ...
#!/usr/bin/env python ''' MIT License Copyright (c) 2021 <NAME>, <NAME>, <NAME>, <NAME> and <NAME> 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 limitati...
# # Copyright (c) 2013 Juniper Networks, Inc. All rights reserved. # import sys import gevent sys.path.append("../common/tests") from testtools.matchers import Equals, Contains, Not from test_utils import * import test_common import test_case from vnc_api.vnc_api import * try: import to_bgp except ImportError: ...
#!/usr/bin/python import string import sys import os import re import binascii import struct import zlib chksum = 0 FILE_READ_SIZE=512 def write_file(file_name,data): if file_name is None: print 'file_name cannot be none\n' sys.exit(0) fp = open(file_name,'ab') if fp: fp.seek(0,os.SEEK_END) fp.write(da...
import numpy as np import sys import os #print(os.getcwd()) import random import copy from envs.ElevatorENV.gridworld import Grid class Lift(): def __init__(self,agent_num,height): self.agent_num = agent_num self.height = height obs_dim = height*4+1 self.action_range = [0, 1, 2] ...
<reponame>jriddle-linode/splunk-addon-linode<filename>TA-linode/bin/ta_linode/aob_py3/jsoncomment/comments.py<gh_stars>10-100 #!/bin/python # coding: utf-8 ########################################################################################################################################## # For templating ...
<reponame>patricknaughton01/RoboticSystemsBook<filename>figures/perception/randomwalk.py<gh_stars>100-1000 import matplotlib.pyplot as plt import numpy as np from kalman import * def kf_trace(F,g,P,H,j,Q,Xmean,Xvar,Z): if not isinstance(F,np.ndarray): F = np.array([[F]]) if not isinstance(g,np.ndarray): g = np...
<reponame>goofus/smoked-salmon import os import re import shutil from copy import copy from string import Formatter import click from salmon import config from salmon.common import strip_template_keys from salmon.constants import ( BLACKLISTED_CHARS, BLACKLISTED_FULLWIDTH_REPLACEMENTS, ) from salmon.errors im...
<reponame>algofairness/runaway-feedback-loops-src #!/usr/bin/env python3 import math import pylab import sys import click from polya import * from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt from matplotlib import cm from matplotlib.ticker import LinearLocator, FormatStrFormatter import numpy as...
import copy import json import pytest import requests app_endpoint = "api/iiif_store" test_headers = {"Content-Type": "application/json", "Accept": "application/json"} test_data_store = {} def test_iiif_store_api_root_get(http_service): status = 200 response = requests.get(f"{http_service}/{app_endpoint}",...
<reponame>alexharvill/colorex # Copyright 2021 <NAME> # SPDX-License-Identifier: Apache-2.0 'colorex keras layers' import tensorflow.keras as keras import tensorflow.keras.backend as K from colorex.cex_constants import ( REC_709_LUMA_WEIGHTS, MAX_COMPONENT_VALUE, SMALL_COMPONENT_VALUE, XYZ_D65_2A_WHITE...
import os from mecab_value_extractor_dir.ner_intent_dir import utility_data, ner_string, ner_mecab PARENT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) entity_dir_path = PARENT_DIR + "/data_dir/entity_mecab" intent_dir_path = PARENT_DIR + "/data_dir/intent_mecab" entity_filenames = os.listdir(ent...
# -*- coding: utf-8 -*- import time import logging from bottle import route, response from error import ApplicationError, PostNotExistError from http import get_response, get_request from utilities import TimeUtil req_proto = {'num': int, } # 보고싶은 포스팅 번호 res_proto = {'code': int, 'msg': str, } @route(...
""" main.py (Signal Processing of an ECG program) The main module for the Signal Processing of an ECG program. This module imports ECG data from a .txt and creates IIR and FIR notch filters to reduce narrowband noise from the data. Figures of the data, filtered data and filter responses are prod...
<filename>mmf/models/cnn_lstm.py from copy import deepcopy import torch from torch import nn from mmf.common.registry import registry from mmf.models.base_model import BaseModel from mmf.modules.layers import ClassifierLayer, ConvNet, Flatten _TEMPLATES = { "question_vocab_size": "{}_text_vocab_size", "numbe...
<reponame>laekov/akg # Copyright 2019 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
<filename>src/longbow/utils/bam_utils.py<gh_stars>0 import sys import os import gzip import re import logging import click_log import collections import re from collections import OrderedDict from math import ceil, floor from construct import * from inspect import getframeinfo, currentframe, getdoc import pysam from...
import logger import os import json import time from datetime import datetime from datetime import time from operator import itemgetter import sqlite3 from typing import List, Tuple #this is used for storing a list of tasks as well as adding them class TaskCollection(object)...
""" This program generates positions of stars born through a fractal tree (see Goodwin, Whitworth 2004) """ import numpy as np from random import * from matplotlib import pyplot as plt import itertools from copy import deepcopy from nb6.pysnap import PySnap import cluster_models as CM from cluster_models import salp...
import os from pymediainfo import MediaInfo filetuple = os.walk(r'./') #走显存编码,可选qsv/cuda/nvenc/amf,使用qsv时需保证没有独立显卡(特别是N卡),否则会报错,是bug,来自[#6996(尝试在 Windows 10 上使用 NVidia 主 GPU 支持的 Intel 系统上使用 QSV 会导致崩溃)– FFmpeg](https://trac.ffmpeg.org/ticket/6996),不用可置空。 hwaccel='' #hwaccel=r' -hwaccel qsv ' #解码方法,可用h264_cuvid/h264_am...
import sys sys.path.insert(1, "../../../") import h2o import numpy as np import random import math import scipy.special def vec_math_ops(ip,port): sin_cos_tan_atan_sinh_cosh_tanh_asinh_data = [[random.uniform(-10,10) for r in range(10)] for c in range(10)] asin_acos_atanh_data = [[random.uniform(-1,...
<gh_stars>0 #!/usr/bin/env python3 ''' Copyright 2016 <NAME> 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 app...
#!/usr/bin/python # -*- coding: utf-8 -*- # ---------------------------------------------------------------------------- # Xcode 4 template generator for cocos2d project # (c) 2011 <NAME> # # LICENSE: Dual License: MIT & GNU GPL v2 Whatever suits you best. # # Given a directory, it generates the "Definitions" and "Node...
#Some codes are adopted from https://github.com/DCASE-REPO/DESED_task import torch import torch.nn as nn import torchaudio from torch.utils.data import Sampler import os import math import scipy from pathlib import Path from utils.evaluation_measures import compute_sed_eval_metrics from utils.dataset import * class ...
<gh_stars>1-10 # Author: <NAME> # Date: Mar 19, 2020 # Version: 0.0.2 import numpy as np import pandas as pd import time import stochastic import portfolio def test_est(): a = np.random.randint(10, 20) b = np.random.randint(2 * a, 3 * a) m1 = ('equal_weights', 'exponential_weights', 'linear-weights') ...
<filename>4_Data_Augmentation.py # -*- coding: utf-8 -*- """ Created on Thu Nov 28 14:44:36 2019 @author: fg010 """ import os import cv2 import numpy as np import imgaug as ia from imgaug import augmenters as iaa import glob """ 该过程可选 需要预先复制一份train set到同一个文件夹下,取名为train_data_augmentation """ def Data_Au...
<reponame>atitaya1412/Mayan-EDMS from mayan.apps.django_gpg.permissions import permission_key_sign from mayan.apps.django_gpg.tests.mixins import KeyTestMixin from mayan.apps.documents.tests.base import GenericDocumentViewTestCase from mayan.apps.documents.tests.literals import ( TEST_DOCUMENT_PATH, TEST_SMALL_DOCU...
# -*- coding: utf-8 -*- import argparse import time from model import resnet from model.dpn import dpn92 import torch import torch.backends.cudnn as cudnn import torchvision from torchvision import transforms import torch.nn as nn from torch.autograd import Variable from model.utils import load_filtered_state_dict,...
# coding=utf-8 # Copyright 2022 Google LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed ...