text stringlengths 3.07k 22.1k |
|---|
import time
import pytest
import numpy as np
import pandas as pd
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import filestore
import filestore.api
import filestore.handlers
import hxnfly.fly
import hxnfly.log
from hxnfly.callbacks import FlyLiveCrossSection
from hxnfly.fly2d import Fly2D... |
import functools
import pendulum
import pandas as pd
from elasticsearch import Elasticsearch
from retrying import retry
import redis
import arrow
import json
from futu import OpenQuoteContext
from functools import reduce
from pandasql import sqldf
import os
# global systemSignal
systemSignal = os.system('ls /.dockeren... |
"""Tests for TR46 code."""
import os.path
import re
import unittest
import idna
_RE_UNICODE = re.compile("\\\\u([0-9a-fA-F]{4})")
_RE_SURROGATE = re.compile("[\uD800-\uDBFF][\uDC00-\uDFFF]")
_SKIP_TESTS = [
# These are strings that are illegal in IDNA 2008. Older versions of the UTS-46 test suite
# had these... |
import base64
from poputils.boto import error, ec2
import boto.vpc
import boto.ec2.ec2object
import boto.ec2.securitygroup
import boto.ec2.address
import boto.ec2.instance
class Address(boto.ec2.address.Address):
def endElement(self, name, value, connection):
if name == 'allocationId':
... |
import os
import dash_html_components as html
import dash_core_components as dcc
from dash.dependencies import Input, Output
import dash_bio
import pandas as pd
import numpy as np
import math
import plotly.graph_objects as go
from layout_helper import run_standalone_app
text_style = {"color": "#506784", "font-family"... |
# pylint: disable=invalid-name
# pylint: disable=bare-except
# pylint: disable=no-member
"""
Useful routines for symbolic manipulation of Jones vectors and matrices.
Creating Jones vectors for specific polarization states::
* field_linear(angle)
* field_left_circular()
* field_right_circular()
* fiel... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
import gc
import logging
import mock
from multiprocessing import Process, Queue
import os
import sys
from threading import Timer
import time
from shellbot import Context, Engine
from shellbot.events import Message
from shellbot.observer import Observer
cl... |
'''
Created on Jan 10, 2017
@author: mike
'''
import collections
from types import SimpleNamespace
class Edge(collections.namedtuple('_Edge', ['id', 'offset', 'length', 'text_index', 'parent'])):
"""Represents edge in the suffix tree.
It is "growing" from the parent edge
Each edge has its unique id and s... |
#!/bin/python3
# Copyright (C) 2017 Quentin "Naccyde" Deslandes.
# Redistribution and use of this file is allowed according to the terms of the MIT license.
# For details see the LICENSE file distributed with yall.
import sys
import os
import requests
import json
import argparse
import subprocess
import fnmatch
owne... |
import numpy as np
import cv2
import numba
def prim_mst(graph, W, N):
visited = np.zeros(N, dtype=bool)
mst = - np.ones(N, dtype=np.int)
cost = np.inf * np.ones(N)
pi = np.zeros(N)
# Start from the pixel at (0, 0)
visited[0] = True
mst[0] = 0
cost[1], pi[1] = graph[0, 1], 0 # cost be... |
""" The interactions module. """
import itertools as it
import collections as col
from mastic.selection import SelectionsList
from mastic.features import FeatureType
# from mastic.system import System
# import mastic.selection as masticsel
# import mastic.molecule as masticmol
# import mastic.system as masticsys
# im... |
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from cogdl.layers import SELayer
from .. import BaseModel
from cogdl.layers import MLP, GATLayer, GINLayer
from cogdl.utils import batch_sum_pooling, batch_mean_pooling, batch_max_pooling
from cogdl.layers import Set2Set
class App... |
#-*- encoding:utf-8 -*-
import os
import re
import json
from copy import deepcopy
from bs4 import BeautifulSoup
from . import Segmentation
# CurrentWorkingDirectory = os.getcwd()
# filter text and combine text
def processText(textPath, outputfile):
qaList = []
wrong_answer = []
qaDict = {}
rightChoice... |
# Copyright (C) 2011 <NAME> <nickbjohnson4224 at g<EMAIL>>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE ... |
'''ResNet in PyTorch.
For Pre-activation ResNet, see 'preact_resnet.py'.
Reference:
[1] <NAME>, <NAME>, <NAME>, <NAME>
Deep Residual Learning for Image Recognition. arXiv:1512.03385
'''
import torch
import torch.nn as nn
import torch.nn.functional as F
from models.losses import AMSoftmax, Softmax
def conv3x3(in_p... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Useful utilities
"""
import sys
import numpy as np
from numpy import array, zeros
import csv
from happyfuntokenizing import Tokenizer
TOKENIZER = Tokenizer(preserve_case=True)
from happyfuntokenizing import Tokenizer
TOKENIZER = Tokenizer(preserve_case=True)
import i... |
from __future__ import unicode_literals, absolute_import
from datetime import datetime, timedelta
from django import forms
from django.conf import settings
from django.utils.dates import MONTHS
from django.core.validators import validate_email
from django.core.urlresolvers import resolve, Resolver404
from uwsgiit.api... |
import json
import datetime
from dateutil import parser
from pyspark import SparkContext
from pyspark.sql import SparkSession
from pyspark.sql import functions as F
from pyspark.sql import types as T
try:
spark
except NameError:
spark = SparkSession.builder.appName("proj").getOrCreate()
#####################... |
from tkinter import *
from tkinter import filedialog
from tkinter import font
from tkinter import colorchooser
import os, sys
import win32print
import win32api
root = Tk()
root.title('Codemy.com - TextPad!')
root.iconbitmap('Assets/Gallery/icon.ico')
root.geometry("1200x710")
# Set variable for open file name
global... |
from django.conf import settings
from django.http import HttpResponse
from django.template import TemplateDoesNotExist, TemplateSyntaxError, Context, RequestContext
from mako.exceptions import TopLevelLookupException, TemplateLookupException, CompileException, SyntaxException, html_error_template
from mako.lookup impo... |
from Modules.Utils.ApplyFunctions import *
from Modules.ModelSelection.CrossValidation import CrossValidation
from Modules.DataAugmentations.DataAugmentationDefault import *
from Modules.Embeddings.EmbeddingDefault import *
from Modules.Kernels.KernelDefault import *
import itertools
import numpy as np
import pandas a... |
import unittest
import logging
import datetime
import json
import os
from pvcontrol.car import HtmlFormParser, LoginFormParser, VolkswagenIDCar, VolkswagenIDCarConfig
logging.basicConfig(level=logging.DEBUG, format="%(asctime)s [%(levelname)s] %(name)s - %(message)s")
# logging.getLogger("urllib3.connectionpool").setL... |
import argparse
import importlib
import importlib.util
import json
import socket
import sys
import time
from pathlib import Path
from urllib.error import HTTPError, URLError
from urllib.request import Request, urlopen
import cv2
class RawSender:
def __init__(self, host, port):
self.host, self.port = host... |
# Copyright 2016 The TensorFlow 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 applica... |
from contextlib import redirect_stdout
import os
from typing import Dict, Tuple, Union
from distutils.util import strtobool
from .constant import *
import torch
import torch.nn as nn
from torch.optim import optimizer, lr_scheduler, Adam, SGD
from adabelief_pytorch import AdaBelief
def init_weights(
net: nn.Module... |
"""
<NAME>
2014 August 21
Various utilities for calculating angular separations.
"""
import matplotlib.pyplot as plt
import numpy
from astropy import units as u
from astropy.coordinates import SkyCoord
def rmSingles(fluxcomponent, targetstring='target'):
"""
Filter out targets in fluxcomponent that ha... |
from hepaccelerate.utils import Results, Dataset, Histogram, choose_backend, JaggedStruct
import uproot
import numpy
import numpy as np
import unittest
import os
from uproot_methods.classes.TH1 import from_numpy
USE_CUDA = bool(int(os.environ.get("HEPACCELERATE_CUDA", 0)))
class TestJaggedStruct(unittest.TestCase):
... |
# Copyright (c) 2017 NVIDIA Corporation
# NOTE from Miguel: The code is the same as in https://github.com/NVIDIA/DeepRecommender/blob/master/run.py
# but I removed the logger
import os
import torch
import argparse
from reco_encoder.data import input_layer
from reco_encoder.model import model
import torch.optim as opti... |
# Copyright 2021 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0
import json
from datetime import datetime, timedelta
from unittest import TestCase
from commonconf import override_settings
from gcs_clients import RestclientGCSClient
from gcs_clients.restclient import CachedHTTPResponse
from mock ... |
"""
Module used to train the noise remover model,save it to HDF5 format, and later use it.
"""
import glob
import PIL
import cv2
import numpy as np
from tensorflow.keras.models import Sequential, load_model
from tensorflow.keras.layers import InputLayer, Conv2D, MaxPooling2D, UpSampling2D
from tensorflow.keras.losses ... |
from VEEParser import read_string, send_record
from VEEParser import send_string, PYTHON_TO_VEE_TYPES, read_script, R_TO_PYTHON_TYPES
import socket
import argparse
import subprocess
import threading
import os
import uuid
from bridgescripts import BRIDGE_SCRIPTS
import tempfile
from client import Client
PROTOCOLS = set(... |
#!/usr/bin/python3
import requests
import math
import os
import json
import threading
import sys
from mutagen.id3 import ID3, APIC, TIT2, TPE1, COMM
from tenacity import retry, stop_after_attempt
from requests import get, head
import platform
media_id = input('media_id:')
ng_str = r'\/:*?"<>|' #win特供文件命名规则
translate... |
# -*- coding: utf-8 -*-
import torch
import torch.nn.functional as F
from torch.nn import Linear, Embedding
from torch_geometric.nn import GATConv
from torch_geometric.data import Data, DataLoader, DataListLoader, NeighborSampler
from util import timeclass
import pandas as pd
import numpy as np
import random
import ti... |
import numpy as np
import numpy.random
import matplotlib.pyplot as plt
import random
# 设置常量
# HIDDEN_LAYER_NUM = 隐层的个数
# LEARNING_RATE = 学习率
# NET_DEEP_ARRAY = 神经网络的深度(输入层X为0)对应的神经元个数
# DEFAULT_TRAIN_TIMES = 默认训练次数
LEARNING_RATE = 1.2
NET_DEEP_ARRAY = []
DEFAULT_TRAIN_TIMES = 5000
# RANDOM_SEED = 随机数的种子
RANDOM_SEED = ... |
# -*- coding: utf-8 -*-
import math
import random
import datetime
import hashlib
from flask_login import current_user
from configs.enum import LOG_STATS
from configs.order_status import SHIPPING_HISTORY
import configs.signals as Signals
from configs.enum import PAYMENT_TYPE
from application.extensions import db
from ap... |
import requests, json
from datetime import datetime
from pytz import timezone
from django.conf import settings
from django.dispatch import receiver
from django.db.models.signals import post_save, post_delete
from wagtail.core.signals import page_published, page_unpublished
from graphene import Node
from wagtail.core.mo... |
import pandas as pd
import numpy as np
import emission.storage.timeseries.abstract_timeseries as esta
import emission.storage.timeseries.tcquery as esttc
import emission.core.wrapper.localdate as ecwl
# Module for pretty-printing outputs (e.g. head) to help users
# understand what is going on
# However, this means th... |
import os
import numpy as np
import random
def identify(root):
if 'live' in root or '真人' in root:
return True
return False
def findsamename(root):
dolpfiles = os.listdir(os.path.join(root,'DOLP'))
s0files = os.listdir(os.path.join(root,'S0'))
s0flag = False
if '.png_s0' in s0files[0]:
... |
from pyE17.utils import imsave
from matplotlib import pyplot as plt
import numpy as np
from numpy.fft import fft2, ifftshift, fftshift, ifft2, fft, ifft
from scipy.ndimage.filters import gaussian_filter1d
from .plot import imsave
def taperarray(shape, edge):
xx, yy = np.mgrid[0:shape[0], 0:shape[1]]
xx1 = np.f... |
import pytest
from openapi_tester import SchemaTester
from openapi_tester.exceptions import CaseError, DocumentationError
from openapi_tester.validators import (
validate_enum,
validate_format,
validate_max_items,
validate_max_length,
validate_max_properties,
validate_maximum,
validate_min_... |
from .translator import Translator
from typing import List, Dict
from .constants import SYSTEM_LANGUAGE
from collections import OrderedDict
from copy import deepcopy
import logging
import datetime
from ordered_set import OrderedSet
class Paraphraser:
def __init__(self, translators: List[str]):
self.transl... |
# Website performance testing script
# Copyright 2014 <NAME>/Anibit Technology All rights reserved.
# You may use this script as you see fit, but you may not claim
# credit for it's authorship.
# If you do find this useful, a note to <EMAIL> would
# be greatly appreciated.
#This was originaly wirtten using Py... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@Time : 2019/8/1
@Author : AnNing
功能:
1、计算G0、Gt、DNI
2、补全缺失的整点时次数据的Itol、Ib、Id
优化
1、修改为矩阵运算
2、优化assignE
3、DEBUG函数assignTime,原来的函数直接在hour加8可能超过24
"""
import os
import h5py
import numpy as np
from dateutil.relativedelta import relativedelta
from lib.lib_constant impo... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Jul 22 11:24:01 2021
@author: ja17375
"""
import pygmt
import numpy as np
import pandas as pd
import xarray as xr
import netCDF4 as nc
def plot_forte_gmt():
tx2008 = np.loadtxt('/Users/ja17375/SWSTomo/ForteModels/Flow_Models/TX2008/forteV2_1deg_15... |
import numpy as np
import gym
from gym.spaces import Box
import pdb
class AtariPreprocessing(gym.Wrapper):
r"""Atari 2600 preprocessings.
This class follows the guidelines in
Machado et al. (2018), "Revisiting the Arcade Learning Environment:
Evaluation Protocols and Open Problems for General Agents... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Dec 22 09:34:05 2020
@author: didi
"""
import collections
import numpy as np
import tensorflow as tf
import gym
import random
import copy
import os
import sys
from peal.utils.epsilon_decay import linearly_decaying_epsilon
from peal.replay_buffers.rep... |
#
# PySNMP MIB module MY-NTP-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/MY-NTP-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 20:06:36 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:... |
# coding=utf-8
from __future__ import unicode_literals
from tornado.httpclient import HTTPRequest
from tornado.simple_httpclient import SimpleAsyncHTTPClient, _HTTPConnection
from apps.core.datastruct import QueryDict
import base64
import hashlib
import hmac
from datetime import datetime
from functools import partial
f... |
from django.db import models, OperationalError
from django.urls import reverse
import os
from hashlib import sha256
from prplatform.core.models import TimeStampedModel
from prplatform.users.models import User, StudentGroup
from prplatform.courses.models import Course
from prplatform.exercises.models import Submission... |
from __future__ import absolute_import, division, print_function
# LIBTBX_SET_DISPATCHER_NAME phenix.real_space_diff_map
from scitbx.array_family import flex
import sys
import iotbx.pdb
from libtbx.utils import Sorry
import mmtbx.utils
from cctbx import maptbx
from cctbx import miller
from cctbx import uctbx
from cctb... |
import torch
from torch.utils.data import Dataset
import numpy as np
import pandas as pd
import utils
class DatasetWithNegativeSampling(Dataset):
"""
We create new Dataset class because for pairwise ranking loss, an important step is negative sampling.
For each user, the items that a user has not interact... |
import builtins
import collections.abc as c_abc
import inspect
from typing import (Any, Callable, Dict, Hashable, Iterable, Mapping, overload, Set,
TypeVar, Union)
from .._internal.argspec import Arguments
from .._internal.default_container import get_default_container
from .._internal.wrapper impo... |
import logging
from math import cos, degrees, pi, sin, sqrt
from random import random, uniform
from typing import List, Optional, Tuple
import bpy
from mathutils import Quaternion, Vector
from .camera import camera_detect_nearest_intersection
from .math import euclidean_distance
from .object import get_environment_c... |
# -*- coding: utf-8 -*-
__doc__ = """This module implements the webscraper.
"""
import functools
import http.client
import logging
import os
from concurrent.futures import ThreadPoolExecutor # ,ProcessPoolExecutor
from typing import List, Optional, Union
import requests
from bs4 import BeautifulSoup, SoupStrainer
f... |
from graphics import *
class Button:
"""A button is a labeled rectangle in a window .
It is activated or deactivated with the activate()
and deactivate() methods. The clicked (p) method
returns true if the button is active and p is inside it."""
def __init__(self, win, center, width, height, labe... |
import pandas as pd
import numpy as np
import umap
import pyarrow.parquet as pq
from sklearn.preprocessing import MinMaxScaler, StandardScaler
from sklearn.model_selection import train_test_split
from sklearn.manifold import TSNE
from sklearn.pipeline import Pipeline
from sklearn.decomposition import PCA
from pyensembl... |
import tensorflow as tf
import numpy as np
from PIL import Image
from tensorflow.core.framework import graph_pb2
from tensorflow.python.platform import gfile
from tensorflow.python.data.experimental import parallel_interleave
from tensorflow.python.data.experimental import map_and_batch
def read_graph(input_graph):
... |
import json
import zlib
import sqlite3
import socket
import threading
from passlib.context import CryptContext
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.asymmetric import rsa
from cryptography.hazmat.primitives import serialization
from cryptography.hazmat.primitives ... |
#!/usr/bin/env python3
# Copyright (c) 2020 freetrader
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Compares bench_bitcoin outputs and displays percentage changes.
Changes are computed between a 'before_file' and 'after_file... |
#! /usr/bin/env python3
# Robot Planning Python Library (RPPL)
# Copyright (c) 2021 <NAME>. All rights reserved.
# This software is distributed under the simplified BSD license.
import pygame, time, random
from pygame.locals import *
import networkx as nx
from networkx import shortest_path
from math import ... |
########################################################################################################################
#WORD2VEC MODEL
########################################################################################################################
# Import libaries
from sklearn.manifold import TSNE
from rando... |
"""
Functions relating to OpenSSL certificates.
"""
import os
import time
import socket
import subprocess
import hashlib
import logging
from datetime import datetime
import uuid
from OpenSSL import SSL,crypto
from pyasn1.type import univ
from pyasn1.codec.der import encoder
from iceprod.core import functions
logger... |
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
import pandas as pd
import json
import re
from bokeh.io import output_notebook, show
output_notebook()
from bokeh.models import GMapOptions
from bokeh.plotting import gmap
from pathlib import Path
#import bokeh.palettes as bp
from bokeh.io import output_notebook, show
output_notebook()
from bokeh.models import GMapOpt... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2014, Zoof Development Team
# Distributed under the (new) BSD License.
# Originally developed under the Vispy project.
"""
Convenience tools for Zoof developers
python make command [arg]
"""
from __future__ import division, print_function
import s... |
import unittest2 as unittest
import pymongo
import time
import random
import threading
from oplogreplay import OplogReplayer
SOURCE_HOST = '127.0.0.1:27017'
DEST_HOST = '127.0.0.1:27018'
TESTDB = 'testdb'
# Inherit from OplogReplayer to count number of processed_op methodcalls.
class CountingOplogReplayer(OplogRepl... |
# Future Imports
from __future__ import absolute_import
# Python Standard Library Imports
import json
import os
from functools import lru_cache
# Third Party (PyPI) Imports
from phabricator import Phabricator
# Phablytics Imports
from phablytics.classes import (
Maniphest,
PhabricatorEntity,
Project,
... |
import logging
import time
from enum import Enum
import jsonpickle
import requests
import uuid
from django.conf import settings
from django.db import models
from django.db.models.signals import pre_save
from django.dispatch import receiver
from django.utils.translation import gettext_lazy as _
logger = logging.getLog... |
import numpy as np
#import scipy as sp
import pylab as p
import matplotlib
import matplotlib.cm as cm
import matplotlib.pyplot as plt
import pandas as pd
import hydropy as hp
from matplotlib.colors import Normalize
from matplotlib.transforms import offset_copy
from matplotlib.ticker import MaxNLocator
from... |
import csv
import os
import copy
import pygame
import jovialengine
import constants
import mode
from .modebuttons import ModeButtons
class ConvoChoice(object):
__slots__ = (
'text',
'key',
)
def __init__(self, text: str, key: str):
self.text = text
self.key = key
de... |
from __future__ import annotations
import abc
import enum
import sre_compile
from pathlib import Path
from typing import Dict, Mapping, MutableMapping, Optional, Sequence, Set
from typing import Tuple as Tup
from typing import Type
import decorateme
import regex
from pocketutils.core.enums import CleverEnum
from pock... |
import os, sys
import argparse
import numpy as np
from ipfml import utils
from keras.models import load_model
from sklearn.metrics import roc_auc_score, accuracy_score
'''
Display progress information as progress bar
'''
def write_progress(progress):
barWidth = 180
output_str = "["
pos = barWidth * pro... |
'''
This file is part of PM4Py (More Info: https://pm4py.fit.fraunhofer.de).
PM4Py 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
(at your option) any late... |
#!/usr/bin/env python
#
# Copyright (C) 2011, 2012, 2017 Igalia S.L.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later ve... |
from __future__ import division
import os
import sys
import cv2
import argparse
import glob
import math
import numpy as np
import matplotlib.pyplot as plt
from skimage import draw, transform
from scipy.optimize import minimize
from PIL import Image
import objs
import utils
#fp is in cam-ceil normal, h... |
#!/usr/bin/env python3
'''
This script either runs inference and visualizes results. Or runs evaluations on the test set.
The following will just run inference and show GT (Green) and predictions (Red).
./infer.py infer
Running the following will visualize results:
infer.py --debug test
Visualization legend:
Blue -... |
import argparse
import resource
from evalutils import *
from lccv import lccv
from commons import *
import logging
import json
def parse_args():
default_path = '~/experiments/lccv/'
parser = argparse.ArgumentParser()
parser.add_argument('--experiment_idx', type=int)
parser.add_argument('--num_seeds', ... |
import json
import hashlib
from time import time
import sys
import socket
import random
import binascii
def jsonDumper(block):
sorted_block="{"
sorted_keys=sorted(block.keys())
for key in sorted_keys:
if(key=="transactions"):
print("!!")
print(type(block[key]))
if type(block[key])==str:
sorted_block+="... |
# works as intended
import mysql.connector
from mysql.connector import errorcode
import sys
import re
import os
from os import listdir
from os import system, name
from os import walk
from os.path import isfile, join
from pprint import pprint as p
import glob
# defines strip_end for variable instantiation
def strip_en... |
"""
Browsing the origin of code generated by yupp lexical preprocessor.
http://github.com/in4lio/yupp/
Copyright (c) 2015-16 <NAME> (<EMAIL>)
"""
__version__ = 1.4
import os
import json
import sublime, sublime_plugin
STATE_NO_BROWSE = 0
STATE_FRUIT = 1
STATE_ORIGIN = 2
STATE_CHECK_RAW = 3
file_state = {}
... |
import librosa #for audio processing
import IPython.display as ipd
import matplotlib.pyplot as plt
import numpy as np
from scipy.io import wavfile #for audio processing
import warnings
warnings.filterwarnings("ignore")
import math, random
import torch
import torchaudio
from torchaudio import transforms
from IPython.d... |
#!/usr/bin/env python2.7
# Author : <NAME> (<EMAIL>)
#
# Description : Filter data
#
# Acknowledgement : TomRoelandts.com
#
# Last updated
# 2018.12.15 : version 0.10;
import numpy as np
import h5py
import pywt
import matplotlib.pyplot as plt
import stats as st
def nextpow2(i):
n = 1
... |
from PIL import Image
import pytest
from yoga.image.encoders import png
class Test_big_endian_unint32_bytes_to_python_int(object):
def test_uint32_value(self):
assert (
png.big_endian_uint32_bytes_to_python_int(b"\xAA\xBB\xCC\xDD")
== 0xAABBCCDD
)
class Test_python_int_t... |
import asyncio
import errno
import logging
import os
import shlex
import subprocess
import threading
import time
from aiohttp import web, errors
from contextlib import suppress
import awaitablelock
# set up the logger
log = logging.getLogger('ddmbot.streamserver')
class AacProcessor(threading.Thread):
def __ini... |
"""@file audio_feat_processor.py
contains the AudioFeatProcessor class"""
import os
import subprocess
import StringIO
import scipy.io.wavfile as wav
import numpy as np
import processor
import gzip
from nabu.processing.feature_computers import feature_computer_factory
class AudioFeatProcessor(processor.Processor):
... |
import time
import numpy as np
import multiprocessing as mp
import ctypes
from rlpyt.samplers.base import BaseSampler
from rlpyt.samplers.utils import build_samples_buffer, build_step_buffer
from rlpyt.samplers.parallel_worker import sampling_process
from rlpyt.samplers.gpu.collectors import EvalCollector
from rlpyt.... |
import os, sys
sys.path.append(os.getcwd())
import time
from utils import load, save_images, Adamp, SGDNM
import numpy as np
import torch
import torchvision
from torch import nn
from torch import autograd
from torch import optim
import cifar10
np.random.seed(1234)
torch.manual_seed(1234)
torch.cuda.manual_seed_all(123... |
import warnings
from itertools import tee, starmap
from operator import gt
from copy import copy
import numpy as np
import pandas as pd
import bioframe
def assign_view_paired(
features,
view_df,
cols_paired=["chrom1", "start1", "end1", "chrom2", "start2", "end2"],
cols_view=["chrom", "start", "end"]... |
# BSM Python library and command line tool
#
# Copyright (C) 2020 chargeIT mobility GmbH
#
# SPDX-License-Identifier: Apache-2.0
from ..bsm import config
from ..bsm import dlms
from ..bsm.client import BsmClientDevice, SnapshotStatus, SunSpecBsmClientDevice
from ..sunspec.core import suns
from collections import Orde... |
"""'check_fasta.py' written by <NAME>, OHSU, 2011-2020
# written by <NAME>, OHSU, 2011, 2020
The MIT License (MIT)
Copyright (c) 2020 <NAME> and OHSU
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 Softw... |
from __future__ import division, print_function
from sympy import *
_inverse_relations = { Ge: Le, Le: Ge, Gt: Lt, Lt: Gt }
def add_equations(equation1,equation2):
r"""
Adds each side of two equations and returns the resulting equation.
Parameters
==========
equation1 : Equality
equation2 : E... |
"""Function derivatives for error propagation."""
import sys
import numpy as np
import copy
__all__ = ['derivatives', 'propagate_1', 'propagate_2']
STEP_SIZE = np.sqrt(sys.float_info.epsilon)
@np.vectorize
def _deriv_pow_0(x, y):
"""Partial derivative of x**y in x."""
if y == 0:
return 0.0
if... |
# <NAME> https://github.com/swz30/MPRNet
import torch
import torch.nn as nn
from models import Conv3x3, FRM
##########################################################################
conv = lambda in_channels, out_channels, kernel_size, bias=False, stride = 1:\
nn.Conv2d(in_channels, out_channels, kernel_size, paddi... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import time
import pickle
import scipy.stats as stats
import seaborn as sns
import matplotlib.pyplot as plt
import numpy as np
import torch
import torch.nn.functional as F
from torch.utils.data import DataLoader
from tqdm import tqdm
from logdeep.dataset.log... |
# Date 1.12
# Author <NAME>
#
# Objective: using datas stored in distances.txt and the database.txt (manually for this one), construct the matrixes needed.
#imports
import time
import requests
# Parameters
database = 'LT/project/txt_files/database.txt'
locations = 'LT/project/txt_files/locations.txt'
distances = 'L... |
import os
import pandas as pd
from .db import db, Measurement, PvModule, FlasherData, ManufacturerData, MeasurementValues
import configparser
from flask import flash
from .routes._main import internal_server_error
UPLOAD_FOLDER = os.path.join('/var/www/pv-FHNW/', 'pvtool/files')
ALLOWED_EXTENSIONS = set(['csv', 'xls',... |
# -*- coding: utf-8 -*-
import gym
gym.logger.set_level(40) # suppress warnings (please remove if gives error)
import numpy as np
from collections import deque
import matplotlib.pyplot as plt
from time import time
import itertools
import torch
torch.manual_seed(0) # set random seed
import torch.nn as nn
import torch.... |
"""Implementation of 'Interpretable Counterfactual Explanations Guided by Prototypes'
Based on the original paper authored by <NAME> and <NAME>, and available at
https://arxiv.org/abs/1907.02584
We have used the implementation of the method available in the library ALIBI
(https://github.com/SeldonIO/alibi), with the ... |
import nltk
import random
import spacy
import string
import numpy as np
from nltk import ngrams
from nltk.corpus import stopwords
from nltk.stem import PorterStemmer
from nltk.stem import WordNetLemmatizer
from spacy.tokens import Doc
np.random.seed(1234)
random.seed(1234)
stopWords = set(stopwords.words('english'))... |
# Ravestate wrapper classes which limit a state's context access
from ravestate.property import PropertyBase
from ravestate import state
from ravestate import icontext
from ravestate.spike import Spike
from typing import Any, Generator, Set
from ravestate.constraint import s
from reggol import get_logger
logger = ge... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.