text stringlengths 6.04k 39.5k |
|---|
from django.contrib.auth.decorators import login_required
from django.contrib.auth import get_user_model
from django.core.urlresolvers import reverse
from django.db.models import Count, Q
from django.http import (
Http404, HttpResponse, HttpResponseNotAllowed, HttpResponseRedirect
)
from django.shortcuts import ren... |
import pytest
from itertools import chain
from fi.fi import create_lookups_from_json_reader, VoikkoLemmatizer
from pathlib import Path
from spacy.lang.fi import Finnish
from spacy.tokens import Doc
from spacy.vocab import Vocab
XFAIL = 1
testcases = {
'NOUN': [
('tila', ['tila']),
('tilassa', ['ti... |
import fnmatch
import itertools
import json
import random
import re
import string
import traceback
import urllib
import botconfig
import src.settings as var
from src import proxy, debuglog
from src.events import Event
from src.messages import messages
# message either privmsg or notice, depending on user settings
def... |
#!/usr/bin/env python2
#
# Docker controlling module
#
# Copyright (c) 2016 Red Hat Inc.
#
# Authors:
# <NAME> <<EMAIL>>
#
# This work is licensed under the terms of the GNU GPL, version 2
# or (at your option) any later version. See the COPYING file in
# the top-level directory.
from __future__ import print_function... |
import gevent
import logging
import importlib
import pkgutil
from monotonic import monotonic
ENTER_AT_PEAK_MARGIN = 5 # closest that captured enter-at level can be to node peak RSSI
CAP_ENTER_EXIT_AT_MILLIS = 3000 # number of ms for capture of enter/exit-at levels
logger = logging.getLogger(__name__)
def discover_... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Jun 26 14:56:33 2019
@author: JoeCalverley
"""
import numpy as np
import math
import scipy.stats as sk
import matplotlib.pyplot as plt
def choose_b(J_est):
# Input is the array of current estimates of means
b = J_est.index(min(J_est))
#Fun... |
"""
Model Schema 包含Mutation等各种方法
"""
import graphene
from datetime import datetime
from graphene_sqlalchemy import SQLAlchemyObjectType
from .base import db_session
from .base import Book as BookModel
from .base import BookType as BookTypeModel
from .base import Chapter as ChapterModel
from .base import Content as Cont... |
# Copyright (c) 2018-present, Royal Bank of Canada and other authors.
# See the AUTHORS.txt file for a list of contributors.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
from __future__ import absolute_import
from __f... |
import json
from operator import itemgetter
from typing import Any
import boto3
import click
import pyperclip
from botocore.exceptions import ClientError
from halo import Halo
from secure_ec2.src.aws import (
construct_console_connect_url,
construct_session_manager_url,
get_region_from_boto3_client,
)
fro... |
import logging
import os
import random
import shutil
import time
import numpy
import torch
from draugr import AverageMeter
from draugr.torch_utilities import Split, TensorBoardPytorchWriter
from neodroidvision.classification.architectures.self_attention_network import (
SelfAttentionTypeEnum,
make_san,
)
from sa... |
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from args import get_parser
from modules.model import RSISMask, FeatureExtractor
import torchvision.models as models
from utils.hungarian import match, softIoU, reorder_mask
from utils.utils import get_optimizer, batch_to_var, make_dir, check_paral... |
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
"""
This module implements the contrastive-predictive-coding model for image processing.
"""
import keras
import tensorflow as tf
from keras import backend as K
import numpy as np
import math
def network_cpc(crop_shape, n_crops, code_size, learning_rate, ks, n_neg, pred_dir):
"""
Main function defining the C... |
"""
Helpers for the API
"""
import re
from collections import namedtuple
from textwrap import dedent
from itertools import chain
from functools import wraps
from parso.python.parser import Parser
from parso.python import tree
from jedi._compatibility import u, Parameter
from jedi.inference.base_value import NO_VALUES... |
#
# This source file is part of the EdgeDB open source project.
#
# Copyright 2021-present MagicStack Inc. and the EdgeDB authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http... |
from enum import Enum, IntEnum
from itertools import chain
from dash.orgs.models import Org
from dash.utils import intersection
from django_redis import get_redis_connection
from django.contrib.auth.models import User
from django.core.exceptions import PermissionDenied
from django.db import models
from django.db.mode... |
from functools import reduce
from typing import Tuple, Dict, Any
import pandas as pd
import streamlit as st
import numpy as np
import altair as alt
hide_menu_style = """
<style>
#MainMenu {visibility: hidden;}
</style>
"""
st.markdown(hide_menu_style, unsafe_allow_html=True)
delaware =... |
#eventHandler.py
#A part of NonVisual Desktop Access (NVDA)
#This file is covered by the GNU General Public License.
#See the file COPYING for more details.
#Copyright (C) 2007-2017 NV Access Limited, Babbage B.V.
import threading
from typing import Optional
import garbageHandler
import queueHandler
import... |
#!/usr/bin/python3
# ================================================================
# Created by <NAME> on 11/14/17.
# Copyright (c) 2017 <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 Lic... |
# Copyright (C) 2018-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import logging as log
import os
import numpy as np
from openvino.tools.mo.back.MaxPool import MaxPool
from openvino.tools.mo.back.TopKNormalizer import TopKNormalizer
from openvino.tools.mo.ops.Cast import Cast
from openvino.tools.mo.o... |
""" Tests for the typing_json.typechecking sub-module. """
import typing
from typing import NamedTuple, List, Tuple, Set, FrozenSet, Dict, Union, Any, Deque, Optional, Mapping
from typing_extensions import Literal
import collections
from collections import namedtuple, deque, ChainMap, Counter, UserDict, UserList, User... |
# -*- coding: utf-8 -*-
# *****************************************************************************
# NICOS, the Networked Instrument Control System of the MLZ
# Copyright (c) 2009-2021 by the NICOS contributors (see AUTHORS)
#
# This program is free software; you can redistribute it and/or modify it under
# the te... |
import shutil
import unittest
from typing import Set
import fsspec
import numpy as np
import pyproj
import xarray as xr
from test.s3test import MOTO_SERVER_ENDPOINT_URL
from test.s3test import S3Test
from xcube.core.gridmapping import GridMapping
from xcube.core.gridmapping.cfconv import GridCoords
from xcube.core.gr... |
"""
Created on Thu Oct 24 11:44:50 2019
@author: Julia
"""
import pandas as pd
import numpy as np
from collections import defaultdict, Counter
import logging
from pyteomics import mass
try:
from pyteomics import cmass
except ImportError:
cmass = mass
import string
from . import utils, io
logger = logging.ge... |
"""
The Flask frontend for the GA4GH API.
TODO Document properly.
"""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import datetime
import socket
import urlparse
import functools
import flask
import flask.ext.cors as cors
import humanize
impor... |
import sqlite3 # sqlite是个很灵活的东西,会自动转换,但是如果错误type且无法转换那么也不报错,传说中的沙雕feature https://www.sqlite.org/faq.html#q3
from os import path
from .bili_data_types import DynRaffleStatus, DynRaffleJoined, DynRaffleResults, DynRaffleLuckydog
# 设计理由是execute script from another directory时,保证仍然可以正确执行(与conf读取设计一致,后续config读取也将自... |
import datetime
import logging
import math
import os
import pickle
import random
import sys
import librosa
import soundfile as sf
import lmdb
import numpy as np
import time
import pyarrow
import torch
from torch.utils.data import DataLoader
import utils
from data_loader.lmdb_data_loader import SpeechMotionDataset, d... |
#
# Copyright (c) nexB Inc. and others. All rights reserved.
# ScanCode is a trademark of nexB Inc.
# SPDX-License-Identifier: Apache-2.0
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
# See https://github.com/nexB/scancode-toolkit for support or download.
# See https://aboutcode.org for more in... |
#!/usr/bin/env python
# coding: utf-8
"""
make_herbarium_2022_catalog_df.py
"""
#
# Description:
#
# Created On: Sunday Feb 27th, 2022
# Created By: <NAME>
# ### Key constants
# DATASETS_ROOT = "/media/data_cifs/projects/prj_fossils/data/processed_data/leavesdb-v1_1/images"
# EXTANT_ROOT = "/media/data_cifs/pr... |
"""
Combiner for httpd configurations
=================================
Combiner for parsing part of httpd configurations. It collects all HttpdConf
generated from each configuration file and combines them to expose a
consolidated configuration tree.
.. note::
At this point in time, you should **NOT** filter the ... |
# coding=utf-8
# Copyright 2019 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
# -*- coding: utf-8 -*-
"""
Spyder Editor
This is a simple implementation of CGAN. When trained, the network will be able to generate an image of a user specified number using a given latent vector.
"""
import tensorflow as tf
import numpy as np
import math
import datetime
import time
import matplotlib.pyplot as pl... |
import torch
import torch.nn as nn
import torchsnooper
import torch.nn.functional as F
import functools
from pyanomaly.networks.model_registry import META_ARCH_REGISTRY
class BasicConv2d(nn.Module):
'''
The basic convaolution with bn
'''
def __init__(self, in_channels, out_channels, **kwargs... |
import parse
import numpy as np
import matplotlib.pyplot as plt
import os
from utils import load_from_file
from matplotlib.ticker import FormatStrFormatter
default_hp = {'momentum': '0.0', 'norm_constraint': '0.001', 'damping': '0.001', 'learning_rate': '0.0001', 'decay': '6000'}
REFERENCE_ENERGIES = {'He': -2.90372,... |
# -*- coding: utf-8 -*-
"""
models from imed:
Context Encoder Network (CE-Net, TMI 2019)
Channel and Spatial CSNet Network (CS-Net, MICCAI 2019).
"""
from __future__ import division
import torch
import torch.nn as nn
from torchvision import models
import torch.nn.functional as F
from functools import partial
nonlinear... |
from discord.ext import commands
import discord
import re
import time
from itertools import count
from collections import namedtuple
import io
from PIL import Image, ImageDraw, ImageFont
import asyncio
import cogs.utils.database as DB
# Source
# https://github.com/thomasahle/sunfish/blob/master/LICENSE.md
# https://gi... |
"""Runner script for single and multi-agent reinforcement learning experiments.
This script performs an RL experiment using the PPO algorithm. Choice of
hyperparameters can be seen and adjusted from the code below.
Usage
python train.py EXP_CONFIG
"""
import argparse
import json
import os
import sys
from... |
# 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
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (t... |
#!/usr/bin/python
'''
Sript to ingest historical gdelt data and save to s3.
'''
# pickle.dump(gkg_columns, open('~/gdelt_distributed_architecture/data/interim/gkg_columns.pkl', 'wb'))
# Import Dependencies
from __future__ import print_function
from __future__ import unicode_literals
import os
import io
import sys
im... |
# Copyright 2020 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... |
#!/usr/bin/python
# -*- coding: utf8 -*-
import logging
import copy
import codecs
import threading
from xml.dom.minidom import Document, parseString
import tempfile
from gettext import gettext as _
import florun
from .utils import empty, atoi, import_plugins
logger = logging.getLogger(__name__)
class FlowError(Ex... |
# <NAME>, 2013
# This file attempts to implement the minstrel rate control algorithm
from random import randint
from random import choice
import rates
from rates import ieee80211_to_idx
class BalancedEWMA:
def __init__(self, time, time_step, pval):
self.p = pval
self.time = time
self.step... |
#! /usr/bin/env python
import rospy
import math
import numpy as np
import pandas as pd
import cv2
from sensor_msgs.msg import LaserScan
from ackermann_msgs.msg import AckermannDriveStamped
from nav_msgs.msg import Odometry
from collections import defaultdict
from tf import transformations
import time
class PID(object... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2018-2019 Fetch.AI Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You ma... |
import numpy as np
import torch
from tqdm import tqdm
import os
from matplotlib import pyplot as plt
import subprocess
from scipy.io import loadmat, savemat
def last_frame_difference(stream, reference, mask=None):
with torch.no_grad():
pytorch_wf = stream[:, -1, 0] + 1j * stream[:, -1, 1]
stream =... |
"""
Calculation of metrics including accuracy, AUROC, and PRC, outputing CAM of tiles, and output
last layer activation for tSNE 2.0
Created on 01/21/2020
@author: RH
"""
import numpy as np
import sklearn.metrics
from scipy import interp
import matplotlib.pyplot as plt
import pandas as pd
from itertools import cycle
... |
#!/usr/bin/env python
docstring='''
get_final_score.py data_dir
main script to perform SSIPe prediction
Input files:
complex.pdb (complex structure)
mutList.txt (list of mutations to make)
force_field (optional: SSIPE - (default) profile score + evoef
SSIP - profile score on... |
#!/usr/bin/python3
import sys
import re
import threading
import os
import queue
import datetime
from monero_archive_data import monitor_req
import platform
print(f'Python version: {platform.python_version()}')
import plotly
print(f"Plotly version: {plotly.__version__}")
import networkx as nx
print (nx.__version__)
... |
import numpy as np
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
def get_min_distances(dists, k):
"""
dists: bs x #neurons - tensor of distances to hyperplanes
k: int - how many hyperplanes to take
"""
return -tf.nn.top_k(-dists, k=k).values
def zero_out_non_min_distances(dist, n_bo... |
# OpenPCDet PyTorch Dataloader and Evaluation Tools for Waymo Open Dataset
# Reference https://github.com/open-mmlab/OpenPCDet
# Written by <NAME>, <NAME>
# All Rights Reserved 2019-2020.
import os
import pickle
import numpy as np
from ...utils import common_utils
import tensorflow as tf
from waymo_open_dataset.utils... |
from utils import yacc
from quiubule_lexer import tokens
memory = {
"cosos" : {},
"juntitos": {},
"chafiretes": {},
"funciones": {}
}
# ---------------------- Instrucciones (S) ------------------------ #
def p_instrucciones(p):
'''instrucciones : instruccion instrucciones
| l... |
import ctypes
import os
from SSD.ssd_utils import *
from SSD.ssd_model import SSD
from SSD.ssd_utils import L2Norm
from CvT.models.cvt import *
from SSD.ssd_utils import PriorBox
USE224 = True
class Attention_Unit(t.nn.Module):
"""自注意力机制"""
def __init__(self, hidden_dim):
super(Attention_Unit, self... |
"""This python script contains the libraries and functions needed to run the other two ML py scripts in this folder.
"""
# load libraries necessary for both offline and live ML scripts
import argparse
import numpy as np
import pandas as pd
from datetime import timedelta
from datetime import datetime
import math
# ML M... |
"""Those things that are core to tests.
This module provides the most fundamental test entities, which include such
things as:
- Tests
- Suites
- Test states
"""
from __future__ import print_function
__docformat__ = "restructuredtext"
import os
import textwrap
import time
import weakref
import inspect
from clevers... |
#!/usr/bin/env python
# Little script to convert tracer data to a form suitable for PRISM
# Author: <NAME> (<EMAIL>)
# Based on the work of Matt Mumpower
from __future__ import print_function, division
import sys; sys.dont_write_bytecode = True
import units; cgs = units.get_cgs()
import numpy as np
import os, shutil, ... |
# python3.7
"""Contains the implementation of discriminator described in PGGAN.
Paper: https://arxiv.org/pdf/1710.10196.pdf
Official TensorFlow implementation:
https://github.com/tkarras/progressive_growing_of_gans
"""
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as ... |
from datetime import datetime
import os
import pwd
import json
from eth_account.messages import defunct_hash_message
from eth_account.account import Account
import requests
from .EVContractUtils import ABIParser, extract_abi
from types import MethodType
import inspect
from solidity_parser import parser
import sys
impor... |
r"""
Nilpotent Lie algebras
AUTHORS:
- <NAME> (2018-08-16): initial version
"""
# ****************************************************************************
# Copyright (C) 2018 <NAME> <<EMAIL>>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General P... |
#!/usr/bin/env python3
#
# Copyright 2016 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unittests for simple file-based buffer."""
# TODO(kitching): Add tests that deal with "out of disk space" situations.
# TODO(... |
import os
import signal
from unittest.mock import patch
from circus import logger
from circus.arbiter import Arbiter
from circus.config import get_config
from circus.watcher import Watcher
from circus.process import Process
from circus.sockets import CircusSocket
from circus.tests.support import TestCase, EasyTestSuit... |
import math
import numpy as np
import scipy.misc
from PIL import Image
import cv2
import sys
import pickle
from rtree import index
from common import *
def GPSDistance(p1, p2):
a = p1[0] - p2[0]
b = (p1[1] - p2[1]) * math.cos(math.radians(p1[0]))
return math.sqrt(a*a + b*b)
def graphInsert(node_neighbor,... |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import os
import re
import shutil
import warnings
import pandas as pd
from zipfile import ZipFile
from reco_utils.dataset.url_utils import maybe_download, download_path
from reco_utils.common.notebook_utils import is_databric... |
# Copyright 2019 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 applicable law or agr... |
############################################################################
# Copyright (c) 2015-2017 Saint Petersburg State University
# Copyright (c) 2011-2015 Saint Petersburg Academic University
# All Rights Reserved
# See file LICENSE for details.
##################################################################... |
# -----------------------------------------------------------------------------
# IMPORTS
# -----------------------------------------------------------------------------
import numpy as np
import h5py
import os
import sys
import time
import datetime
import warnings
from tensorboard import SummaryWriter
import torch
... |
import numpy as np
class Map(object):
def __init__(self, gentypes):
#gentypes is not being used now
from utils import BeginningOfString, EndOfString, colormapbygen
self._points = []
self._BS = BeginningOfString
self._ES = EndOfString
#todo: change colors according to the overall generator capacit... |
from typing import Any, Optional, Tuple, Union
from collections import namedtuple
from string import Template
import torch
from torch.nn.modules.utils import _pair
import torch.nn as nn
import torch.nn.functional as F
from torch.cuda import HalfTensor, FloatTensor, DoubleTensor
import cupy
__all__ = ['Involution2d']... |
import io
import os
import sys
import re
import timeit
import random
import tensorflow as tf
import editdistance
import numpy as np
from scipy import exp
from scipy.special import lambertw
from ai.datasets import ALLDATASET
from ai.models import Seq2Seq
# INPUT FILES
tf.app.flags.DEFINE_string('train_input', None, "... |
import contextlib
import json
import os
import time
from os.path import dirname, join
from typing import List, Optional
from .conftest import HqEnv
from .utils.check import check_error_log
from .utils.wait import wait_until
def test_autoalloc_descriptor_list(hq_env: HqEnv):
mock = PbsMock(hq_env, qtime="Thu Aug ... |
"""Module for all the loss of Neural Process Family."""
import abc
import math
import numpy as np
import torch
import torch.nn as nn
from npf.utils.helpers import (
LightTailPareto,
dist_to_device,
logcumsumexp,
sum_from_nth_dim,
)
from torch.distributions.kl import kl_divergence
__all__ = ["CNPFLoss",... |
"""
Tests for recursive least squares models
Author: <NAME>
License: Simplified-BSD
"""
import numpy as np
import pandas as pd
import pytest
from scipy.stats import norm
import os
from statsmodels.datasets import macrodata
from statsmodels.regression.linear_model import OLS
from statsmodels.genmod.api import GLM
fro... |
import numpy as np
import tensorflow as tf
from maci.misc import logger
from maci.misc.overrides import overrides
from maci.misc.kernel import adaptive_isotropic_gaussian_kernel
from maci.misc import tf_utils
from .base import MARLAlgorithm
EPS = 1e-6
def assert_shape(tensor, expected_shape):
tensor_shape = t... |
import os
import struct
import pickle
from io import BytesIO
from typing import Union, Dict
CACHE_DURATION = 3600
# CACHE_DIRECTORY = os.path.join(os.getcwd(),"cache")
# CACHE_DIRECTORY = "/Volumes/USB2/pycasccache/"
CACHE_DIRECTORY = "/Volumes/Secure/pycasc"
LISTFILE = (os.path.join(os.getcwd(),"listfiles","wow-82.t... |
import torch
import copy
import logging
from optimization.common import Compressor, build_module_graph
from .utils import QuantType, BN_FOLD_TAG, BN_FOLD_OP
from torch.quantization import RecordingObserver as _RecordingObserver
_logger = logging.getLogger(__name__)
def _setattr(model, name, module):
name_list = ... |
'''
====================
Modules.housekeeping
====================
This is the housekeeping module for the two python scripts that are in The
Great RNA-seq Experiment codebase. These functions include logging, parsing,
custom warning messages and custom formatting for time and date strings.
.. moduleauthor:: <NAME> ... |
"""latex_envs Exporter class"""
# -----------------------------------------------------------------------------
# Copyright (c) 2016, the IPython IPython-Contrib Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# --------------------------------------------------------------------------... |
#!/usr/bin/env python3
import sys
import argparse
import inspect
from signal import signal, SIGINT
import time
import datetime
import board
import neopixel
from colors import Color
from helpers import frange, pre_execution, post_execution, retry
class LEDPanel:
def __init__(self, pixel_pin=board.D18, num_pixels... |
from __future__ import annotations
import inspect
import types
import csv
from typing import Dict
__version__ = "0.1.1"
def string_template(base_str):
def string_handle(*args, **kwargs):
return base_str.format(*args, **kwargs)
return string_handle
type_handler = {
int: string_template("\tmp_in... |
from multiprocessing import set_start_method
set_start_method("spawn")
import scipy.signal
from random import choice
from time import sleep, time
import gym
import numpy as np
import os
import matplotlib
import matplotlib.pyplot as plt
from collections import namedtuple
from itertools import count
from PIL import Imag... |
# (c) 2017 Red Hat Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import pytest
# Magic... Incorrectly identified by pylint as unused
from ansible_collections.amazon.a... |
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... |
import gnureadline
import os
import sys
import re
import string
from typing import Tuple, List, Dict, Callable
from collections import defaultdict
from graphviz import Digraph, Graph
import pandas
from itertools import product
from docs import Docs
from functions import flatten, get_mdnf, extract_variables
MIN_NUMBE... |
# -*- coding: utf-8 -*-
import numpy as np
import matplotlib.pyplot as plt
import deeptrain.metrics
from types import LambdaType
from functools import wraps
from inspect import getfullargspec
from copy import deepcopy
from deeptrain.backend import model_utils
from .algorithms import deepmap, obj_to_str
from .experime... |
#! /usr/bin/env python3
#
# In this script we solve the Cahn-Hilliard equation, which models the unmixing
# of two phases (φ=+1 and φ=-1) under the influence of surface tension. It is a
# mixed equation of two scalar equations for phase φ and chemical potential η::
#
# dφ/dt = -div(J(η))
# η = ψ'(φ) σ / ε - σ ε... |
import os
import numpy as np
import acoustics as ac # https://github.com/timmahrt/pyAcoustics
import soundfile as sf
class TestSignal():
"""
Create a signal object that bears methods to create the
resulting signal together with its analyses.
"""
def channel_count(self):
"""Give channel c... |
from random import randint, uniform
from copy import deepcopy
from kivy.adapters.dictadapter import DictAdapter
from kivy.event import EventDispatcher
from kivy.lang import Builder
from kivy.logger import Logger
from kivy.properties import BooleanProperty, NumericProperty
from kivy.uix.boxlayout import BoxLayout
from k... |
import asyncio
import database
import discord
from datetime import datetime
from discord.ext import commands
def current_time():
return datetime.now().strftime("%d/%m/%Y %H:%M:%S")
"""
Permissions volgorde @commands.has_any_role is:
Proxy, Hoofd Yuuto, Yuuto, Trial-Yuuto, Dev Team
IDs:
Proxy = 6691814601... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import math
import matplotlib.patheffects as path_effects
import cv2
from matplotlib import pyplot as plt
from matplotlib.patches import Ellipse
from matplotlib.pyplot import arrow
from matp... |
from tkinter import Tk, Frame, Listbox, Label, Text, StringVar, BooleanVar, Entry, EXTENDED, MULTIPLE, SINGLE, INSERT, END, ACTIVE, N, S, E, W
from tkinter import ttk
from tkinter.scrolledtext import *
from LURKp import LURKp
import time, threading
### Character Stats ###
character_dict = {
'name': '', # 31 bytes... |
#!/usr/bin/env python
#
# * boilerpipe
# *
# * Copyright (c) 2009 <NAME>
# *
# * The author licenses this file to You 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.apa... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
This code implements the speech enhancement method published in: <NAME>,
<NAME>, <NAME>, <NAME>, "A recurrent variational autoencoder
for speech enhancement", IEEE International Conference on Acoustics Speech and
Signal Processing (ICASSP), Barcelona, Spain, 2020.
... |
from __future__ import unicode_literals
from BaseHTTPServer import HTTPServer
from ConfigParser import SafeConfigParser
from git import Repo
from github import Github
from Queue import Empty
from multiprocessing import Queue, Process
from SimpleHTTPServer import SimpleHTTPRequestHandler
from subprocess import call
im... |
"""Generate brainweb data with two simulated temporal arteries
Usage:
generate_brainweb_vasculitis [--help | options]
Options:
-i <path>, --out_im=<path> output image filename prefix [default: im]
--save-labels save label images for all non-zero structures and a total background
--brainweb-c... |
"""
Pythonic way to access ERDDAP data
"""
import copy
import functools
from datetime import datetime
from typing import Dict, List, Optional, Tuple, Union
from urllib.parse import quote_plus
import pandas as pd
import pytz
from erddapy.netcdf_handling import _nc_dataset, _tempnc
from erddapy.servers import servers... |
#from scipy.stats import wilcoxon
from scipy.stats import ranksums
#from scipy.stats import mannwhitneyu
import numpy as np
from sklearn.decomposition import PCA
import matplotlib.pyplot as plt
import louvain
import igraph as ig
import pandas as pd
from sklearn.neighbors import NearestNeighbors
from scipy.sparse import... |
import tempfile
from typing import Dict, Optional, Type, Iterable
import torch
from .monitors import AbstractMonitor
from bindsnet.network.nodes import Nodes, CSRMNodes
from bindsnet.network.topology import AbstractConnection
from bindsnet.learning.reward import AbstractReward
from bindsnet import manual_seed
def ... |
# Created on Tue April 15 01:18:51 2019
# @author: <NAME>
import hashlib
import json
from time import time
from urllib.parse import urlparse
from uuid import uuid4
import random
import string
from model import AccountDetails, Base, LicenceIds, UPCNumbers
from sqlalchemy import create_engine
from argparse import Argum... |
"""DictizableMixin
A mixin class to add `todict` method to objects.
"""
from __future__ import absolute_import
from sqlalchemy.ext.associationproxy import AssociationProxyInstance
from toolspy import deep_group
import json
from sqlalchemy.sql import sqltypes
from decimal import Decimal
from datetime import datetime, ... |
"""Chain binomial process rippler algorithm"""
import numpy as np
import tensorflow as tf
import tensorflow_probability as tfp
from tensorflow_probability.python.internal import samplers
from tensorflow_probability.python.internal import prefer_static as ps
from gemlib.util import compute_state
from gemlib.distributi... |
from AgentRun import *
from AgentNet import *
from AgentZoo import *
""" ISAC
Auto TTUR
Adaptive lambda
Adam regular term actor_term beta13
Adam regular term actor_term cancel beta0
"""
class InterSPG(nn.Module): # class AgentIntelAC for SAC (SPG means stochastic policy gradient)
def __init__(self, state_dim, ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.