text stringlengths 8.04k 46.5k |
|---|
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
try:
import unittest.mock as mock
except ImportError:
import mock
from nose.tools import *
import io
import os
import struct
import zipfile
from buckeye import... |
"""
gen_cpp.py - Generate C++ classes from an ASDL schema.
TODO:
- Integrate some of the lessons here:
- https://github.com/oilshell/blog-code/tree/master/asdl
- And maybe mycpp/target_lang.cc
- pretty printing methods
- so asdl/format.py get translated?
- NoOp needs to be instantiated without args?
- dict ... |
"""Mapping functions that get values on a prescribed Cartesian coordinates grids from GTS output data files which are in flux coordinates.
"""
import Map_Mod_C as mmc
import numpy as np
from sdp.geometry import grid
import scipy.io.netcdf as nc
from scipy.interpolate import NearestNDInterpolator
from time import clock
... |
import os
import sys
import datetime
import json
import logging
import imageio
import PIL.Image
import numpy as np
import matplotlib.pyplot as plt
from plark_game import classes
from gym_plark.envs import plark_env
from gym_plark.envs.plark_env_sparse import PlarkEnvSparse
from gym_plark.envs.plark_env import PlarkEnv
... |
import torch
from torch import nn
import torch.nn.functional as F
from torch.nn import BatchNorm2d as BatchNorm
import numpy as np
import random
import time
import cv2
import model.resnet as models
import model.vgg as vgg_models
from model.ASPP import ASPP
from model.atten import Feature_Reweighting
from util... |
# This code is part of Qiskit.
#
# (C) Copyright IBM 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... |
# emacs: -*- mode: python; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*-
# ex: set sts=4 ts=4 sw=4 noet:
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the datalad package for the
# copyright and license terms.
#
# ## ### ##... |
# coding: utf-8
import sys
import os
import threading
import wx
import webbrowser
from operator import ge, le
from contextlib import suppress
from functools import partial
from pathlib import Path
from chemical import it
from slugify import slugify
from bookworm import config
from bookworm import paths
from bookworm i... |
# 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 to in writing, ... |
#!/usr/bin/env python3
from __future__ import print_function, absolute_import, division
import argparse
import os
import random
import shutil
import time
import warnings
import numpy as np
import sys
import caffe
import argparse
import numpy as np
import scipy.misc
from os import listdir
from os.path import splitext
i... |
#!/usr/bin/env python
# This is script that shows how to use the Ignition tools to run a cluster using spots machine but with automatic recovery
# It is a supervisor that guarantees to:
# 1) Pick the best configuration based on spot price (it also supports ondemand machines)
# 2) Launch the cluster
# 3) Verify the clus... |
"""
SORT: A Simple, Online and Realtime Tracker
Copyright (C) 2016 <NAME> <EMAIL>
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
the Free Software Foundation, either version 3 of the License, or
(at your ... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, <NAME> <<EMAIL>>
#
# 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
# (at yo... |
"""Algorithms for inference."""
import asyncio
import typing
from dataclasses import is_dataclass, replace as dc_replace
from functools import reduce
import numpy as np
from .. import operations, xtype
from ..info import About
from ..ir import Graph, MetaGraph
from ..prim import Primitive, ops as P
from ..utils impo... |
import gc
from icecream import ic
import sys
import random
from timeit import default_timer as timer
import numpy as np
import torch
from icecream import ic
num2aa=[
'ALA','ARG','ASN','ASP','CYS',
'GLN','GLU','GLY','HIS','ILE',
'LEU','LYS','MET','PHE','PRO',
'SER','THR','TRP','TYR','VAL',
]
aa2n... |
"""YOLO_v3 Model Defined in Keras."""
from yolo3.enums import BOX_LOSS
import numpy as np
import tensorflow as tf
from typing import List, Tuple
from yolo3.utils import compose,do_giou_calculate
from yolo3.override import mobilenet_v2
from yolo3.darknet import DarknetConv2D_BN_Leaky, DarknetConv2D, darknet_body
from y... |
__doc__ = '''
Linear regression of sampled analog responses
'''
import numpy as np
import os
import copy
import re
import statsmodels.formula.api as sm
import pandas as pd
from itertools import product, combinations, groupby
from operator import itemgetter
from dave.common.davelogger import DaVELogger
from environ i... |
# from https://github.com/Hugo-Nattagh/2017-Hip-Hop
# Usage:
# import genius
# api = genius.Genius('my_client_access_token_here')
# artist = api.search_artist('<NAME>', max_songs=5)
# print(artist)
#
# song = api.search_song('To You', artist.name)
# artist.add_song(song)
# print(artist)
# print... |
import asyncio
import logging
import time
from abc import abstractmethod
from ipaddress import ip_address, IPv4Address, IPv6Address
from types import FunctionType
from typing import Tuple, Union, Dict, Iterable, Type, List, Set, Any, Optional
from unittest import mock
from aiohttp import web, hdrs
from aiohttp.web_requ... |
#!/usr/bin/env python3
str_desc = """
__ _ _
/ _(_) | |
_ __ | |_ _ ___ | |__
| '_ \| _| |/ _ \| '_ \\
| |_) | | | | (_) | | | |
| .__/|_| |_|\___/|_| |_|
| |
|_|
A simple http file IO handler
`pfioh' is a simple http-based file I/O handler/server allowing s... |
from util import *
from torchvision import models
import random
class VGG16FeatureExtractor(nn.Module):
def __init__(self):
super().__init__()
vgg16 = models.vgg16(pretrained=True)
self.enc_1 = nn.Sequential(*vgg16.features[:5])
self.enc_2 = nn.Sequential(*vgg16.features[5:10])
... |
#!/usr/bin/env python
# encoding: utf-8
"""
Pipeline for analysis of the PHAT six-color photometry.
"""
import os
from glob import glob
from collections import namedtuple, OrderedDict
from functools import partial
import numpy as np
from astropy.table import Table
from m31hst import phat_v2_phot_path
from astropy.co... |
import time
import cv2
import logging
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
import albumentations
import pandas as pd
from .tools import *
from .config import *
from .ramps import *
from modules.losses.mse_loss import cls_mse_loss, att_mse_loss
from torchvision import tra... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
import numpy as np
import tensorflow as tf
#from cleverhans.compat import flags
from tensorflow.python.platform import flags
from cleverhans.loss import C... |
#!/usr/bin/env python
#
# License: BSD
# https://raw.githubusercontent.com/splintered-reality/py_trees/devel/LICENSE
#
##############################################################################
# Imports
##############################################################################
import nose
import py_trees
... |
# =============================================================================
# Copyright 2020 NVIDIA. All Rights Reserved.
# 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 obt... |
# Tools to load g3 files and manipulate/convert into FITS
from spt3g import core, maps, transients
import os
import sys
import time
import logging
from logging.handlers import RotatingFileHandler
from astropy.time import Time
import multiprocessing as mp
import types
import copy
import shutil
import magic
import errno... |
import sys,os
import pyqtgraph as pg
from PyQt5 import QtCore, QtGui, QtWidgets
import qtmodern.styles
import qtmodern.windows
import nanoindentation.nano_view as view
import nanoindentation.engine as engine
import json
import protocols.filters,protocols.cpoint,protocols.fmodels,protocols.emodels
from gevent import mo... |
import os
import shutil
import stat
import json
import time
import fileinput
import sys
from copy import deepcopy
from concurrent import futures
from subprocess import call, check_output, CalledProcessError, STDOUT
from datetime import datetime, timedelta
from multiprocessing import cpu_count
import numpy as np
import... |
"""
Unittests for ffs.path
"""
from __future__ import with_statement
import filecmp
import getpass
import itertools
try:
import json
except ImportError:
import simplejson as json
import os
import sys
import tempfile
import unittest
if sys.version_info < (2, 7):
import unittest2 as unittest
if sys.version... |
import struct
import sys
import pyboof
from pyboof import JavaConfig
from pyboof import JavaWrapper
from pyboof import dtype_to_Class_SingleBand
from pyboof import dtype_to_ImageType
from pyboof import gateway
from pyboof.common import JavaList
from pyboof.common import JavaList_to_fastarray
from pyboof.common import i... |
import datetime
import sys
import threading
import tkinter as tk
from tkinter import *
import time
import os
import socket, time, json
from tkinter import ttk # 导入ttk模块,因为下拉菜单控件在ttk中
import websocket
# 这个是客户端程序
AvailableKeys = ["w", "s", "a", "d", "up", "down", "left", "right", "q", "escape"]
msg = """
... |
import numpy as np
import pylab as pl
import matplotlib.pyplot as plt
import warnings
warnings.filterwarnings("ignore")
from matplotlib.backends.backend_pdf import PdfPages
global file_name,file_name2
global extension,path
# which simulation ?
path='/Users/yves/fortran/GEOCLIM4_thea/OUTPUT/' # / at the end of the ... |
# -*- coding: utf-8 -*-
"""
Copyright (C) 2018 <NAME>
The pproject-module provides the functionality and logic used by the
pproject.sh-file.
"""
import argparse
import datetime as dt
import logging
import os
from pathlib import Path
import string
import sys
from subprocess import CalledProcessError
from pkg_resourc... |
import pandas as pd
import numpy as np
from sklearn.pipeline import Pipeline
from sklearn.pipeline import FeatureUnion
from sklearn.preprocessing import StandardScaler, MinMaxScaler, RobustScaler, Normalizer
from sklearn.preprocessing import LabelEncoder
from sklearn.decomposition import PCA
from sklearn.base import... |
# Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
# Licensed under the Apache License, Version 2.0 https://aws.amazon.com/apache-2-0/
import boto3
import botocore
import json
import time
import os
import logging
import subprocess
import traceback
import ran... |
import os
import sys
import csv
import shutil
import argparse
import datetime
import logging
import traceback
from collections import defaultdict
from os.path import basename, join, dirname
from cached_property import cached_property
from egcg_core import executor, rest_communication, clarity
from egcg_core.app_logging... |
bl_info = {
'name':'PRDTools',
'description':'Tools for Primitive Root Diffusers',
'author':'<NAME>',
'version':(0, 1),
'blender':(2, 93),
'location':'View3D > Properties > PRDTools',
'category':'Add Mesh',
}
import json
import bpy
import bmesh
from .table import TableParameters, TableResu... |
# -*- coding: utf-8 -*-
"""
Created on Mon Jan 31 18:19:26 2022
@author: <NAME>
"""
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from statsmodels.tsa.tsatools import lagmat2ds
#%% Check input
def check_input(
x,
maxlag,
Network_layers,
Network_neurons,
Dense_layers,
... |
import os
import logging
import inflect
import uuid
from rivescript import RiveScript
from controllers import mongo_controller
from controllers import nlp_controller
from controllers import handover_controller
logger = logging.getLogger("Rule Controller")
logger.setLevel(logging.INFO)
# create file handler which logs ... |
import torch
import torch.nn as nn
from ...ops.roipoint_pool3d import roipoint_pool3d_utils
from ...utils import common_utils
from .roi_head_template import RoIHeadTemplate
from .attention_v2 import StackMetaFormers
class SECONDAttnHead(RoIHeadTemplate):
def __init__(self, input_channels, model_cfg, num_class=1, ... |
# -*- coding: utf-8 -*-
"""
Created on Wed Apr 7 02:29:51 2021
@author: dv516
"""
import numpy as np
import pickle
import pyro
pyro.enable_validation(True) # can help with debugging
pyro.set_rng_seed(1)
from algorithms.PyBobyqa_wrapped.Wrapper_for_pybobyqa import PyBobyqaWrapper
from algorithms.Bayesian_opt_Pyro.... |
# Type checkers don't like the wrapper names not existing.
# mypy: ignore-errors
# pytype: disable=module-attr
import collections
import contextlib
import datetime
import os
import pwd
import resource
import shutil
import signal
import subprocess
import threading
import time
from typing import Any, Callable, Dict, Iter... |
from itertools import product, combinations
import numpy as np
import pandas as pd
from os.path import exists, join
import random
from math import sqrt
from scipy import stats
from dateutil.parser import parse
try:
from data_access import GetData
from utils import *
from configs import time_dimensions, day... |
import concurrent.futures
import json
import os
import warnings
from functools import lru_cache
from itertools import chain
from pathlib import Path
from typing import List, Set, Union, Iterable, Tuple, Dict, Any
import numpy as np
import pandas as pd
import requests
from rnalysis.utils import parsing, validation, on... |
import warnings
import copy
import traceback
import cloudpickle
import base64
from types import ModuleType
from collections import OrderedDict
import ruamel.yaml
from ._node_flow import _CLEANUP
from .task import Task
from .taskSpecSchema import TaskSpecSchema
from .portsSpecSchema import PortsSpecSchema
from .util im... |
"""=============================================================
c:/Users/COTTRILLAD/1work/Python/djcode/creel_portal/creel_portal/models/FishNet2.py
Created: 30 Mar 2020 08:39:05
DESCRIPTION:
This file contains all of the standard tables from a fishnet-II project:
+ FN011
+ FN121
+ FN122 (omitted for creels)
+... |
"""API handling the communication between AWS MTurk and our code."""
import datetime
import boto3
from aws_credentials import AWSCredentials
import warnings
import logging
import time
import xml.etree
import json
from collections import namedtuple
from typing import List, Optional, Callable, Tuple
from typing_extensio... |
import neo4j
import configparser
from typing import List
import re
from openapi_server.models.codes_codes_obj import CodesCodesObj # noqa: E501
from openapi_server.models.concept_detail import ConceptDetail # noqa: E501
from openapi_server.models.concept_term import ConceptTerm # noqa: E501
from openapi_server.mode... |
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from copy import copy
import logging
import os
import posixpath
from data_source import DataSource
from docs_server_utils import StringIdentity, MarkFir... |
import math
import numbers
import numpy as np
from keras.layers import Lambda
from tensorflow.contrib.layers import xavier_initializer_conv2d
from tensorflow.python.framework import ops, tensor_shape, tensor_util
from tensorflow.python.layers import utils
from tensorflow.python.ops import array_ops, math_ops, random_op... |
# Library Imports
import os
import sys
import math
import colorsys
from dataclasses import dataclass
import unittest
import doctest
import pandas as pd
import numpy as np
from IPython.core.display import display
from IPython.core.display import clear_output
from ipywidgets import widgets
import plotly
import plotly.cal... |
import tensorflow as tf
from .configuration import get_defaults
from .tfrecords_utils import read_tfrecords
from . import utils
def load_image(im_id, image_size, image_folder, image_format):
"""Resolve the correct image path from the given arguments.
Args:
im_id: image id saved in the tfrecords
... |
import os
import pathlib
import pickle
import shutil
import time
from functools import partial
import json
import fire
import numpy as np
import torch
from google.protobuf import text_format
from tensorboardX import SummaryWriter
import copy
import torchplus
from second.core import box_np_ops
import second.data.kitti_... |
# -*- coding: utf-8 -*-
# imreg.py
# Copyright (c) 2014-?, <NAME>
# Copyright (c) 2011-2014, <NAME>
# Copyright (c) 2011-2014, The Regents of the University of California
# Produced at the Laboratory for Fluorescence Dynamics
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without... |
#!/usr/bin/env python3
"""Commandline Interface to the Turtle DB"""
import argparse
import logging
import os
import shlex
import sys
import dateutil.parser as dp
from dateutil.relativedelta import relativedelta
import IPython
from django.utils import timezone
from django.db.models import Q
from django.db import conn... |
# Copyright 2016 Google Inc.
#
# 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
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the ho... |
from flask import render_template, redirect, url_for, request, send_from_directory
from flask_login import login_required, current_user
from flask_apscheduler import APScheduler
from functools import wraps
import datetime
import time
import pandas as pd
from app import app
from app.database.database import *
from app... |
# Copyright (c) 2006, <NAME>
# Copyright (c) 2006-2009, The Regents of the University of California
# Copyright (c) 2021 PickNik Robotics
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redi... |
"""Example Gym environment for the RRC 2021 Phase 2."""
import enum
import typing
import gym
import numpy as np
import time
import robot_fingers
# import trifinger_simulation
# import trifinger_simulation.visual_objects
# from trifinger_simulation import trifingerpro_limits
# import trifinger_simulation.tasks.move_c... |
# -*- coding: utf-8 -*-
"""
Created on Fri Oct 5 14:53:10 2018
@author: gregz
"""
import os.path as op
import sys
from astropy.io import fits
from astropy.table import Table
from utils import biweight_location
import numpy as np
from scipy.interpolate import LSQBivariateSpline, interp1d
from astropy.convolution impo... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jul 31 14:16:36 2017
@author: gabrielfabien-ouellet
"""
import math
import tensorflow as tf
from scipy.ndimage.filters import gaussian_filter
import os
from invflow.Forward import FclassError
class InvertError(Exception):
pass
def norm_grad( grad... |
"""
Deccan Delight Kodi Addon
Copyright (C) 2016 gujal
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
... |
#Copyright (C) 2019. Huawei Technologies Co., Ltd. All rights reserved.
#This program is free software; you can redistribute it and/or modify it under the terms of the BSD 3-Clause License.
#This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of ... |
#Functions implementing potential parameter space symmetries
#<NAME> (2019) NASA-GSFC
#
#These functions are of a standard form needed for specifying (potential)
#symmetries of the parameter state space, and can be exploited as
#specialized MCMC proposals.
#Implementing potential parameter space symmetries
#These clas... |
"""
Main script for running the adversarial and OOD detection experiments.
"""
from __future__ import absolute_import, division, print_function
import sys
import argparse
import os
import time
import random
import numpy as np
import torch
from torchvision import datasets, transforms
from nets.mnist import *
# from nets... |
#------------------------------------------------------------------------------
# Copyright 2014 Esri
# 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/LICENS... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, unicode_literals
import pytest
from packermate.config import (
Config, ConfigValue,
ConfigException, ConfigLoadException,
CONFIG_DEFAULTS, ENV_VAR_PREFIX
)
import logging
import os
import yaml
import struct
import base64
i... |
"""Low-memory json-based databse for MicroPython.
Data is stored in a folder structure in json for easy inspection.
Indexing multiple columns is supported, and RAM usage is optimized
for embedded systems.
Database examples:
db_object = Database.create("mydb")
db_object = Database.open("mydb")
Table examples:
db_table =... |
"""Script containing a non-flow variant of the ring road environment."""
import numpy as np
import csv
import time
import random
import json
import gym
from scipy.optimize import fsolve
from collections import defaultdict
from gym.spaces import Box
from copy import deepcopy
from hbaselines.envs.mixed_autonomy.envs.uti... |
# Portions of this code were adapted from
# https://github.com/jingraham/neurips19-graph-protein-design
import numpy as np
import tensorflow as tf
from tensorflow.keras import *
from tensorflow.keras.layers import *
from gvp import *
class MQAModel(Model):
def __init__(self, node_features, edge_features,
... |
# -*- coding: utf-8 -*-
"""
This module contains a set of utility functions and classes used for developing
and testing Neural Maching Translation models. Everything comes directly
from the accompanying code to the book "Natural Language Processing with
PyTorch" by <NAME> and <NAME>.
The original code and data ... |
import os
import configparser
import numpy as np
from scipy import signal
import matplotlib.pyplot as plt
import numba
np.seterr(divide="print")
__import__ = ["davenport", "karman", "harris", "simiu", "kaimal",
"plot_time_history", "plot_spectrum", "plot_coherence",
"plot_stats", "plot_co... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import sys
import numpy as np
import random
if os.environ.get('MOCK_TENSORFLOW',False):
import psmlearn.mock_tensorflow as tf
else:
import tensorflow as tf
from scipy.misc import imresize
from... |
#!/usr/bin/python3
import pandas as pd
import numpy as np
from style import style
names = {"data-driven": "Data-Driven", "rdoc": "RDoC", "dsm": "DSM"}
suffix = {"data-driven": "", "rdoc": "_opsim", "dsm": "_opsim"}
def doc_mean_thres(df):
doc_mean = df.mean()
df_bin = 1.0 * (df.values > doc_mean.values)
df_bin... |
import eel
import sqlite3
from sqlite3 import Error
import io
try:
import pkg_resources.py2_warn
except ImportError:
pass
eel.init('web')
def backup():
from datetime import date # Getting date
today = date.today() # Getting today
#print("Today's date:", today)
d1 = today.strftime("%d") # Get... |
"""
ARCHES - a program developed to inventory and manage immovable cultural heritage.
Copyright (C) 2013 <NAME> and World Monuments Fund
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either ... |
#!/usr/bin/env python3
import rospy
from humanoid_league_msgs.msg import \
ObstacleInImageArray, BallInImageArray, \
GoalPostInImageArray
from geometry_msgs.msg import Point, PolygonStamped
from sensor_msgs.msg import Image
from cv_bridge import CvBridge
import numpy as np
import math
import cv2
import yaml
imp... |
"""
Simulate a ts with ancient samples, infer ts with modern samples and add ancient samples on
From <NAME>, adapted for HIV simulations, and for .py not jup notebk
<NAME> 27/9/2019
"""
##### Imports #####
from IPython.display import display, SVG
import numpy as np
import pandas as pd
import subprocess
import sys
imp... |
import os
import math
import numpy as np
import numpy.random as random
import json
import glob
import warnings
from datetime import datetime
# sim modules
import Box2D
from Box2D.b2 import (edgeShape, circleShape, fixtureDef, polygonShape, revoluteJointDef, contactListener)
import gym
from gym.utils import colorize, s... |
import errno
import hashlib
import json
import math
import os
import re
import subprocess
import sys
from datetime import date, datetime
from functools import partial, reduce
from glob import glob
from os import path
from shutil import copyfile
from subprocess import PIPE, Popen
import bayleef
import gdal
import geopa... |
import os
from pathlib import Path
import gdown
import tensorflow as tf
import keras
from keras.models import Model, Sequential
from keras.layers import Conv2D, ZeroPadding2D, Activation, Input, concatenate
from keras.layers.core import Dense, Activation, Lambda, Flatten
from keras.layers.pooling import MaxPooling2D, ... |
#!/usr/bin/env python3
#
# Compare accounting of algod and indexer
#
# setup requires:
# pip install "msgpack >=1" py-algorand-sdk
import base64
import json
import logging
import os
import queue
import signal
from ssl import SSLContext
import struct
import sys
import threading
import time
import urllib.error
import u... |
import warnings
import numpy as np
from decimal import Decimal, ROUND_HALF_UP
from scipy.signal import butter, blackman, blackmanharris, upfirdn, filtfilt
from scipy import sparse
from scipy.interpolate import interp1d
import matplotlib.pyplot as plt
def upsample(s, n, phase=0):
"""Increase sampling rate by i... |
#
# This file is part of LiteDRAM.
#
# Copyright (c) 2020-2021 Antmicro <www.antmicro.com>
# SPDX-License-Identifier: BSD-2-Clause
from math import ceil
from operator import and_
from migen import *
from migen.genlib.misc import WaitTimer
from litex.soc.interconnect.csr import AutoCSR, CSR, CSRStatus, CSRStorage
fr... |
import os.path as osp
from collections import defaultdict
from functools import partial
import numpy as np
import cv2
import matplotlib.pyplot as plt
from matplotlib.collections import PatchCollection
from matplotlib.patches import Polygon
from IPython.display import display
from ipywidgets import interactive
import ... |
#!/usr/bin/python3
# ******************************************************************************
# Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved.
# licensed under the Mulan PSL v2.
# You can use this software according to the terms and conditions of the Mulan PSL v2.
# You may obtain a c... |
import os
import time
import numpy as np
import threading
import tensorboard
from distutils.version import LooseVersion
if not hasattr(tensorboard, '__version__') or LooseVersion(tensorboard.__version__) < LooseVersion('1.15'):
raise ImportError('TensorBoard logging requires TensorBoard version 1.15 or above')
del... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 11 13:12:22 2019
@author: shlomi
"""
from strat_paths import work_chaim
sound_path = work_chaim / 'sounding'
sean_tropopause_path = work_chaim / 'Sean - tropopause'
def read_ascii_randel(path, filename='h2o_all_timeseries_for_corr.dat'):
impor... |
from os import listdir
from os.path import isfile, join
import re
import numpy as np
from scipy.stats import norm
from scipy.stats import lognorm
import matplotlib as mpl
import matplotlib.pyplot as plt
from matplotlib.mlab import griddata
import preprocessing as prep
import pdfplot as pdfplt
import kldplot as kldplt
f... |
# -*- coding: utf-8 -*-
""" Kullback-Leibler divergence functions and klUCB utilities.
- Faster implementation can be found in a C file, in ``Policies/C``, and should be compiled to speedup computations.
- Cf. http://banditslilian.gforge.inria.fr/docs/Policies.kullback.html for a documentation.
- Cf. https://en.wikipe... |
import requests
import os
import time
from pathlib import Path
from io import BytesIO
from PIL import Image, ImageDraw, ImageFont, ImageEnhance
from collections import namedtuple
from qrcode import QRCode, constants
from django.conf import settings
from django.core.files import File
from django.db.models import Q
fro... |
"""Install proteomics tools not currently packaged.
"""
import os
import re
from fabric.api import cd
from fabric.context_managers import prefix
from shared import (_if_not_installed, _make_tmp_dir,
_get_install, _make_copy,
_java_install, _symlinked_java_version_dir,
... |
import pandas as pd
import numpy as np
import scipy
import sys
from annoy import AnnoyIndex
from packaging import version
from scipy.spatial import cKDTree
from scipy.sparse import coo_matrix
from umap.umap_ import fuzzy_simplicial_set
from sklearn.neighbors import KDTree
from sklearn.neighbors import DistanceMetric
fr... |
#!/usr/bin/env python3
"""
"""
import argparse
import os
from enum import Enum
import lxml.etree as ET
import capnp
import capnp.lib.capnp
capnp.remove_import_hook()
from rr_graph import tracks
import rr_graph.graph2 as rr
import rr_graph_xml.graph2 as rr_xml
import rr_graph_capnp.graph2 as rr_capnp
from rr_graph.l... |
# Copyright 2014 CloudFounders NV
#
# 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 writ... |
# @date 2018-08-07
# @author <NAME>, All rights reserved without prejudices.
# @license Copyright (c) 2018 Dream Overflow
# Siis standard implementation of the application (application main)
from __init__ import APP_VERSION, APP_SHORT_NAME, APP_RELEASE
import signal
import sys
import os
import time
import logging
imp... |
# Copyright (C) 2018 <NAME> <<EMAIL>>
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
"""@package PyToAPI
This module handles offset and sizes dictated by the memory map for the BPT.
This module is... |
"""Mixins for use by assessment package implementations"""
from bson import ObjectId
from collections import OrderedDict
import dlkit.abstract_osid.osid.errors as errors
from dlkit.primordium.id.primitives import Id
from dlkit.primordium.type.primitives import Type
from dlkit.primordium.calendaring.primitives import ... |
#!/usr/bin/env python3
import argparse
import datetime
import gzip
import multiprocessing
import os
import subprocess
import sys
import tarfile
import urllib.request
import about
import check
import shared
import tax
def parse_arguments():
date = datetime.datetime.now().strftime('%Y-%m-%d')
parser = ar... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.