text
stringlengths
3.07k
22.1k
################################################## # Import Own Assets ################################################## from hyperparameter_hunter.library_helpers.keras_helper import keras_callback_to_dict from hyperparameter_hunter.settings import G from hyperparameter_hunter.utils.boltons_utils import remap, get_pa...
import numpy as np import os import torch import gym import onnxruntime as ort from unittest.mock import Mock from tests.base_test import base_tester, base_update_tester from d3rlpy.algos.torch.base import TorchImplBase from d3rlpy.datasets import get_cartpole, get_pendulum from d3rlpy.preprocessing import Scaler cl...
# ****************************************************************************** # Copyright (c) 2020, Intel Corporation # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code mus...
from telegram.ext import CommandHandler from telegram import ReplyKeyboardMarkup, KeyboardButton from .base import NPModuleBase class UserRedisTransactions(object): def __init__(self, redis): self.redis = redis self.flags = self.get_flags() if (self.flags is None or "admin" not...
#coding:utf-8 import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data import time """ 权重初始化 weight init 初始化为一个接近0的很小的正数 init to a small number close to zero """ def weight_variable(shape): initial = tf.truncated_normal(shape, stddev = 0.1) return tf.Variable(initial) ...
__all__ = ["Registry"] _registry_key = "registry" def _inc_uid(vals): import copy as _copy vals = _copy.copy(vals) for j in range(0, len(vals)): i = len(vals) - j - 1 vals[i] += 1 if i % 2 == 1: if vals[i] < 10: return vals else: ...
import logging from typing import Dict from typing import List import neo4j from azure.core.exceptions import HttpResponseError from azure.mgmt.compute import ComputeManagementClient from .util.credentials import Credentials from cartography.util import run_cleanup_job from cartography.util import timeit logger = lo...
# Copyright 1999-2021 Alibaba Group Holding Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
# -*- coding:utf-8 -*- # &Author AnFany # 引入三种方法 import LR_AnFany as LR_A # AnFany import LR_Sklearn as LR_S # Sklearn import LR_TensorFlow as LR_T # TensorFlow from pylab import mpl # 作图显示中文 mpl.rcParams['font.sans-serif'] = ['FangSong'] # 设置中文字体新宋体 mpl.rcParams['axes.unicode_minus'] = False import ...
from robosuite import load_controller_config from robosuite.models import MujocoWorldBase from robosuite.models.arenas.table_arena import TableArena from robosuite.models.robots import Panda from robosuite.models.base import MujocoXML from robosuite.utils import SimulationError from robosuite.robots import SingleArm fr...
from helpers.func import ( resJson, resType, exceptionRaise, validate_list ) from helpers.validator import paginateValidator, postProdAttributeLineValidator, updateProdAttributeLineValidator from helpers.query import ( paginatedQuery, insertQuery, softDelbyId, findRecordById, findRec...
""" This module holds models related to the Sponsor entity. """ from allauth.account.models import EmailAddress from django.conf import settings from django.db import models from django_countries.fields import CountryField from ordered_model.models import OrderedModel from django.contrib.contenttypes.fields import Gene...
import csv import datetime import math import operator import random import pandas_datareader.data as dr import pandas import matplotlib.pyplot as plt import json from sklearn.model_selection import train_test_split def main(): startDate = datetime.datetime(2014, 1, 1) endDate = datetime.date.today() # p...
from server import MudServer import database from database import ObjectFlags import bcrypt import os.path import pickle import time import queue import fnmatch _BASE="data" _LOG="log.txt" _LOGLEVEL=2 _GODPASS = "<PASSWORD>" _PERIODIC_UPDATE = 60 _MUSHNAME = "PynnMush" _MUSHVERSION = 1.02 _WELCOMEMSG = f""" =-...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Apr 5 15:35:52 2021 @author: rayin """ import os, sys import numpy as np import pandas as pd import torch import warnings import torchvision.models as models import matplotlib.pyplot as plt from sklearn.metrics import accuracy_score from sklearn.metr...
## --- AlignmentManager --- # Purpose: # Converts inputs from disparate sources into a single, cohesive format for use by SamplingManager. # Additionally, handled temporal scaling and alignment of results. # 1. Receive DSARs from window manager # - read from ds_state. # - each DSAR belongs to one specific model # -...
from warnings import warn try: import tensorflow as tf except Exception as e: print('tensorflow import failed', e) try: from utils import get_tf_dtype, get_tf_shape, is_iterable except: from .utils import get_tf_dtype, get_tf_shape, is_iterable import numpy as np import types def _get_t...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import warnings warnings.filterwarnings('ignore') import numpy as np import matplotlib.pyplot as plt import getopt import sys import os import math import time import argparse import torch as T from torch.autograd import Variable as var import torch.nn.functional as F i...
#!/usr/bin/env python """This module provides routine thermodynamic functions """ #todo # complete constants and function library #constants import math import numpy as np from pymeteo.constants import * import pymeteo.interp # Mean wind in the layer [zmin,zmax] def avg_wind(_u, _v, _z, zmin, zmax): #TODO: np.avera...
from collections import namedtuple import pprint from enum import Enum class Direction(Enum): NO_SIDE = 0 LEFT = 1 RIGHT = 2 TOP = 3 BOTTOM = 4 # Track (aka Channel) is a wire that runs from one position to another along X or Y axis Track = namedtuple('Track', 'direction x_low x_high y_low y_hig...
import itertools import numpy as np from sklearn.neighbors import kneighbors_graph import networkx as nx from numba import jit @jit(nopython=True) def uf_find(i, parents): """ Find function for Union-Find data structure. Parameters: i (int): ID of point for which parent is required. pare...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import re import numpy as np from itertools import chain import six pattern_num = re.compile(r'[0-9]') CHAR_PADDING = u"_" UNKWORD = u"UNKNOWN" PADDING = u"PADDING" BOS = u"<BOS>" def flatten(l): return list(chain.from_iterable(l)) def repla...
# -*- coding: utf-8 -*- from __future__ import print_function __all__ = [ "is_token_expired", "SpotifyClientCredentials", "SpotifyOAuth", "SpotifyOauthError", ] import base64 import json import os import sys import time import warnings import requests from spotipy.util import CLIENT_CREDS_ENV_VARS ...
# Copyright 2018 The TensorFlow Probability 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 applicable law o...
import streamlit as st events = {0: "Introduction", 1: "#01 - Web visualisation", 2: "#02 - Dimensionality reduction", 3: "#03 - TBA"} class Talk: title: str = None speaker: str = None speaker_affiliation: str = None video_url: str = None summary: str = None reso...
# -*- coding: utf-8 -*- """ File: gmag_load.py Description: Data loading functions for the THEMIS GMAG stations. Example: pyspedas.gmag_load(['2015-12-31'], ['bmls', 'ccnv', 'drby']) Parameters: dates: str/list of str ['yyyy-mm-dd'] List of dates to be downloaded (eg. ['2015-12-31']). sta...
""" TODO: - Objects are not being drawn ok on top of the image. """ import os import cv2 import numpy as np from biometrics.face_operations import face_detectors, face_aligners def load_frame(): path:str = 'trump.jpg' frame:np.ndarray = cv2.imread(path) assert isinstance(frame, np.ndarray), 'image is not valid'...
# Copyright 2020 The Pigweed 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
""" None of the functions/objects in this module need be passed `db`. Naming convention: a `pub` is either a pubkey or a pubkeyhash """ import hashlib import bitcoin as bitcoinlib import binascii from bitcoin.core.key import CPubKey from bitcoin.bech32 import CBech32Data from counterpartylib.lib import util from co...
import torch import torch.nn as nn import torch.nn.functional as F try: from torch.hub import load_state_dict_from_url except ImportError: from torch.utils.model_zoo import load_url as load_state_dict_from_url import numpy as np import pdb __all__ = ['AlexNet', 'alexnet'] model_urls = { 'alexnet': 'https...
import matplotlib import matplotlib.pyplot as plt import mnist import numpy as np # Gradient descent optimization # The learning rate is specified by eta class GDOptimizer(object): def __init__(self, eta): self.eta = eta def initialize(self, layers): pass # This function performs one grad...
import pandas as pd import numpy as np import os from sklearn.preprocessing import MinMaxScaler from random import shuffle import random as rn import pickle from biosppy.signals.tools import band_power os.environ['PYTHONHASHSEED'] = '0' np.random.seed(42) rn.seed(12345) rn.seed(12345) slidingWindowSize = 100 def ...
""" A TUF hash bin delegation example using the low-level TUF Metadata API. As 'repository_tool' and 'repository_lib' are being deprecated, hash bin delegation interfaces are no longer available in this implementation. The example code in this file demonstrates how to easily implement those interfaces, and how to use ...
import copy import glob import itertools import os import uuid from typing import Dict, List, Optional, Union import warnings import numpy as np from ray.tune.error import TuneError from ray.tune.experiment import Experiment, convert_to_experiment_list from ray.tune.config_parser import make_parser, create_trial_from_...
"""init schema tables Revision ID: 4591dee5c8d6 Revises: Create Date: 2020-11-18 16:29:10.619479 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '4591dee5c8d6' down_revision = None branch_labels = None depends_on = None def upgrade(): # ### commands auto...
"""Added 'pause_update' field Revision ID: add6265f2306 Revises: <PASSWORD> Create Date: 2018-09-25 18:12:53.872002 """ from alembic import op import sqlalchemy as sa from sqlalchemy import ( Column, Integer, UnicodeText, DateTime, Boolean, ForeignKey, Table, ) from sqlalchemy.ext.declara...
from functools import partial from pathlib import Path import types import pandas as pd # from pandas.util.testing import assert_series_equal import pytest from solarforecastarbiter.io import nwp from solarforecastarbiter.reference_forecasts import models latitude = 32.2 longitude = -110.9 elevation = 700 init_tim...
from __future__ import absolute_import from __future__ import print_function from math import sqrt import keras.backend as K import numpy as np import tensorflow as tf from importData_gifgif import * from keras.layers import Input, Lambda from keras.models import Model from keras.optimizers import SGD from sklearn.me...
# file: experiment.py # author: <NAME> # created: 10/24/2017 # modified: 10/24/2017 # purpose: runs tusv.py on mulitple patients and validates the results # # # # # # # # # # # # I M P O R T S # # # # # # # # # # # # import sys # for command line arguments import os # for manipulating file...
""" Interpolation functions. 2020-09 <EMAIL> """ import numpy as np from typing import Iterable, Callable from scipy.spatial import Delaunay, ConvexHull from polygonation import Polygonate # %% Interpolation function in single polygon. def polygon(anchorpoints: Iterable, anchorvalues: Iterable) -> Callable: "...
from __future__ import division, print_function, absolute_import """ Unit test for constraint conversion """ import numpy as np from numpy.testing import (assert_, assert_array_almost_equal, assert_allclose, assert_equal, TestCase, suppress_warnings, assert_warns, ...
from __future__ import annotations from sklearn.datasets import load_diabetes from sklearn.linear_model import Lasso from sklearn.model_selection import train_test_split from IMLearn.learners.regressors import PolynomialFitting, LinearRegression, RidgeRegression from IMLearn.metrics import mean_square_error from IMLear...
#!/usr/bin/env pytho import re import sys import math import os.path from PIL import Image import pytesseract import datetime import numpy as np import argparse import csv WHITE = (255, 255, 255) BLACK = (0, 0, 0) GREEN = (0, 96, 0) RED = (193, 5, 52) BLUE = (0, 0, 255) # May change depending on resolution Y_AXIS...
import sys from PyQt5 import QtCore, QtGui, QtWidgets import matplotlib matplotlib.use('QT5Agg') from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas import matplotlib.pyplot as plt import json from crystal_math import * class PolePlot(FigureCanvas): def __init__(self, parent=None, wi...
import datetime from dateutil import rrule from dateutil.relativedelta import relativedelta from decimal import Decimal from itertools import groupby from timepiece.utils import get_hours_summary, add_timezone, get_week_start,\ get_month_start, get_year_start def date_totals(entries, by): """Yield a user...
# -*- coding: utf-8 -*- """ Created on Fri May 24 13:21:51 2019 @author: elif.ayvali """ #import os from sklearn.model_selection import train_test_split from sklearn.utils import shuffle import sklearn import numpy as np import matplotlib.pyplot as plt from keras.models import Sequential from keras.layers import Conv...
import itertools from typing import Dict, List, Tuple from girder.constants import AccessType from girder.models.folder import Folder from girder_jobs.constants import JobStatus class Simulation(Folder): def initialize(self): # noinspection PyAttributeOutsideInit self._skipNLIFilter = False ...
from builtins import range from builtins import object import json import logging from collections import defaultdict from mrtarget.common.DataStructure import JSONSerializable from mrtarget.common.chembl_lookup import ChEMBLLookup from mrtarget.common.connection import new_es_client from mrtarget.common.esutil impor...
import xml import xml.etree.ElementTree as ET import pandas as pd import re from SPARQLWrapper import SPARQLWrapper, XML, JSON def get_movie_data_from_wikidata(slice_movie_set: pd.DataFrame): """ Function that consults the wikidata KG for a slice of the movies set :param slice_movie_set: slice of the movi...
import os import sys import re import calendar import collections import simdjson as json import time import google.auth from datetime import datetime from google.cloud import monitoring_v3 from google.protobuf.json_format import MessageToJson from tpubar import env if env['profiler']: from tensorflow.python.fr...
import subprocess import threading import logging import contextlib import functools import socket import pytest import megastone as ms from megastone.rsp.stream import SocketStream from megastone.rsp.connection import RSPConnection PORT = 1337 GDB_ARCHES = [arch for arch in ms.Architecture.all() if arch.gdb_suppor...
from typing import NewType from src.independent.util import todo_once from src.independent.util_for_str import mapjoin from src.constants_and_defined_types import ActionId from src.model.Sort import Sort, SortOpApp from src.independent.typing_imports import * # Immutable recursive datatypes pattern SMTAtom = Union[st...
""" This file holds all the code for parsing values from config.ini. This should probably be renamed config.py despite naming conflicts """ import os import configparser from core.mcc import MCC_MODE_DICT #definitions of the strings as they will appear in config.ini _PATHS = 'PATHS' _PICKLEPATH = 'PICKLEPATH'...
""" Project: RadarBook File: back_projection_backhoe_example.py Created by: <NAME> On: 2/20/2019 Created with: PyCharm Copyright (C) 2019 Artech House (<EMAIL>) This file is part of Introduction to Radar Using Python and MATLAB and can not be copied and/or distributed without the express permission of Artech House. ""...
""" Script for searching and downloading data from sentinel satellites. dhusget.sh script from the Copernicus web-page is used. Single scenes can be downloaded from https://datapool.asf.alaska.edu """ __author__ = '<NAME>' __email__ = '<EMAIL>' import os import subprocess import datetime import shutil import stat im...
#!/usr/bin/env python import torch.nn from deepinpy.utils import utils class Conv2dSame(torch.nn.Module): def __init__(self, in_channels, out_channels, kernel_size, bias=True, padding_layer=torch.nn.ReflectionPad2d): super().__init__() ka = kernel_size // 2 kb = ka - 1 if kernel_size % 2...
''' Plots stellar to dark matter halo mass ratios from Bolshoi and compares the results to Peter's curves. :author: <NAME> ''' import matplotlib matplotlib.rc('text', usetex=True) matplotlib.rcParams['font.size'] = 15 matplotlib.rc('xtick', labelsize=14) matplotlib.rc('axes', linewidth=1.2) matplotlib.rcParams['legen...
from __future__ import print_function from abc import ABCMeta, abstractmethod import numpy as np import sys import argparse import time from imagenet_cls_test_alexnet import CaffeModel, DnnCaffeModel try: import cv2 as cv except ImportError: raise ImportError('Can\'t find OpenCV Python module. If you\'ve built...
# To use this code, make sure you # # import json # # and then, to convert JSON from a string, do # # result = admin_apps_restricted_list_response_from_dict(json.loads(json_string)) from dataclasses import dataclass from typing import Optional, List, Any, TypeVar, Callable, Type, cast T = TypeVar("T") def ...
import os import tensorflow as tf import numpy as np import json import unidecode from tensorflow import keras from random import shuffle import colorsys os.environ['TF_CPP_MIN_LOG_LEVEL'] = '1' MALE = "male" FEMALE = "female" GENDERMAP = { MALE: 0, FEMALE: 1 } # file_writer = tf.summary.FileWrit...
# -*- coding: utf-8 -*- import logging import os import sys from abc import abstractmethod from functools import reduce from typing import Iterable, Tuple, List, Mapping, Sequence import numpy as np import tensorflow as tf from jack.core import JTReader, QASetting, Answer, Ports, ModelModule, SharedResources, Tensor...
import csv import logging import os import re import threading import traceback from data_prep import AbortException from smartva.who_prep import WHOPrep from smartva.common_prep import CommonPrep from smartva.pre_symptom_prep import PreSymptomPrep from smartva.symptom_prep import SymptomPrep from smartva.rules_prep i...
import collections import operator import os import logging import math import re import ftplib from tqdm import tqdm from lxml import etree from .db import Database logger = logging.getLogger(__name__) """Module to generate external data and crosslinks for NCBI. """ class NCBILinkOutXML(object): root_node = ...
import tensorflow as tf from tensorflow.contrib import rnn import numpy as np import time import string import matplotlib.pyplot as plt from random import randint, choice ### to train on different data, just insert a path to a text file here: corpus_path = '../corpora/CNCR_2017-18_corpus.txt' ### # rest...
import numpy as np import h5py import galcv data = {} models = ["A", "B", "C"] simulations = ["TNG100-1", "TNG300-1", "TNG50-1", "combined"] redshifts = {33:2, 25:3, 21:4, 17:5, 13:6, 11:7, 8:8, 6:9, 4:10} quantities = ["bincenters", "luminosity_function", "number_count", "lf_combined"] ## Extract data and store in d...
""" General utilities. """ import os import shutil from functools import partial import torch import random import warnings import requests from tqdm import tqdm import torch.backends.cudnn as cudnn import torch.nn.init as init from fsgan.utils.obj_factory import extract_args, obj_factory def init_weights(m, init_ty...
#!/usr/bin/env python3 """ RSM Client """ __author__ = "<NAME>" __license__ = "MIT" __version__ = "0.1" __maintainer__ = "<NAME>" __email__ = "<EMAIL>" import os, sys import socket, random, json, traceback, zlib, fcntl, time, threading, pickle, argparse, statistics, datetime from apscheduler.schedulers.background im...
from union_find import * from math import log import sys import numpy as np from numba import njit, jit from numpy import random as rand from model_sqrt import * """ This module implements several methods for calculating and outputting solutions of the unionfind_cluster_editing() algorithm. It contains two methods for ...
from typing import Dict, List, Tuple, Union import numpy as np import pandas as pd import torch from torch.utils.data import Dataset as TorchDataset from transformers import AutoModelForSequenceClassification, AutoTokenizer, PreTrainedModel, Trainer, TrainingArguments def _format_records(records, attr_strings): ...
from cantools import db, config from cantools.util import log from cantools.web import send_mail from ctcoop.model import Timeslot from compTemplates import MEET, PAID, APPLY, APPLICATION, EXCLUDE, BLURB, CONVO, DELIVERY ratios = config.ctcomp.ratios class Verifiable(db.TimeStampedBase): membership = db.ForeignKey(k...
# coding=utf8 from __future__ import unicode_literals, absolute_import, division, print_function from sopel.tools import Identifier from sopel.irc.utils import safe import threading # import time import sys import inspect if sys.version_info.major >= 3: from collections import abc if sys.version_info.major >= 3:...
import re import subprocess import pandas as pd import numpy as np try: from StringIO import StringIO as BytesIO except ImportError: from io import BytesIO TABLE_RE = re.compile("CREATE TABLE \[([^\]]+)\]\s+\((.*?\));", re.MULTILINE | re.DOTALL) class MdbTable: """ A MdbTable is ba...
import numpy as np import cv2 class Calibrator: # Termination criteria for point detection criteria = (cv2.TERM_CRITERIA_EPS + cv2.TERM_CRITERIA_MAX_ITER, 50, 0.001) patternsize = (7, 5) # Prepare object points, like (0,0,0), (1,0,0), (2,0,0) ....,(6,5,0) objp = np.zeros((7*5, 3), np.float32) ...
#!/usr/bin/python3 # -*- coding: utf-8 -*- import numpy as np from pyIGRF.loadCoeffs import get_coeffs, gh FACT = 180./np.pi def geodetic2geocentric(theta, alt): """ Conversion from geodetic to geocentric coordinates by using the WGS84 spheroid. :param theta: colatitude (float, rad) :param alt: alt...
# Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. import os import logging import mimetypes from ..base.handlers import APIHandler, IPythonHandler from ..utils import url_path_join from tornado import gen, web from tornado.concurrent import Future from tornado.ioloo...
import socket import json import base64 import datetime from decrypt import * # import join ##switched to ABP so no need for join requests from binascii import unhexlify from db import * import time DEBUG = False def print_GPS(GPS_data): print('\n') print('--------Decoded GPS Data--------') print("LAT:\t", GPS_dat...
import functools import mock import warnings try: import urlparse except ImportError: # Python 3 from urllib import parse as urlparse from django.core.urlresolvers import NoReverseMatch, set_urlconf from django.template import Context, Template from django.test import TestCase from django.test.client import R...
from operator import itemgetter from datetime import date, timedelta from django.core.cache import cache from django.db import connections, router from django.db.models import Count, F from rest_framework.views import APIView from rest_framework.response import Response from kitsune.kpi.models import ( Metric, M...
""" financial_interpolation ----------------------- Financial cleaning and interpolation imputing. """ import numpy as np import pandas as pd from sklearn.neighbors import KNeighborsRegressor from ..IO.io_standarized import get_atemporal_data,\ get_sequencial_financial_data, write_financial def financial_inter...
# -*- coding: utf-8 -*- """ evaluation.py ~~~~~~~~~~~~~ """ import multiprocessing as mp import numpy as np import scipy.sparse from tqdm import tqdm from tesseract import utils as utils, metrics as metrics class Stage: """Parent class representing stage of the time-aware evaluation cycle. The time-awa...
# Awokawokawokawok Ngentod Mau Apa ? Hm, Boleh Lah # Start : 26-03-2021 07:22 # Done : 26-03-2021 13:23 # Only Python3 # Coded : Kingtebe from telethon.errors import FloodWaitError from telethon.errors import SessionPasswordNeededError as awokawokawokmengontol from telethon import TelegramClient, sync, events from te...
import subprocess import socket import time import requests import json from typing import List, Tuple from collections import namedtuple from qanta.util.environment import (QB_QUESTION_DB, QB_SPARK_MASTER, QB_STREAMING_CORES, QB_API_DOMAIN, QB_API_KEY, QB_API_USER_ID) from qanta.ut...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # This software and supporting documentation are distributed by # Institut Federatif de Recherche 49 # CEA/NeuroSpin, Batiment 145, # 91191 Gif-sur-Yvette cedex # France # # This software is governed by the CeCILL license version 2 under # French law ...
import os import cv2 import numpy as np from statistics import mean BASE_DIR = os.path.dirname(__file__) SYMBOL_DIR = os.path.join(BASE_DIR, "Symbols3") SYMBOL_DIR_EXTRA = os.path.join(BASE_DIR, "SymbolExtra") CHALLENGE_DIR = os.path.join(BASE_DIR, "Challenge") SYMBOL_PREFX = "Slide" def show_result(img_t, img_c,name...
import pandas as pd import numpy as np from matplotlib import pyplot as plt import matplotlib.patches as mpatches def creating_tables(beta_list, m_list, func_name, d, p, set_x, sigma_sq, num_p, option, initial_guess): data_table = np.zeros((len(m_list) * len(beta_list), 7)) inde...
"""tf.data.Dataset interface to searchstims dataset.""" import json import os from pathlib import Path import numpy as np import tensorflow as tf from tqdm import tqdm from .data import Data def split(stim_json_filename, stim_type, test_size=None, val_size=None, train_size=No...
from __future__ import print_function import json import logging import os import sys import time import h5py import numpy as np import tensorflow as tf import zarr import gunpowder as gp logger = logging.getLogger(__name__) class NoOp(gp.BatchFilter): def __init__(self): pass def process(self, ba...
#!/usr/bin/env python3 import os import sys import time import serial import json import argparse from threading import Thread class NThread(Thread): def __init__(self, func, args): super(NThread, self).__init__() self.func = func self.args = args def run(self): self.result = ...
import random import string from tkinter.ttk import Combobox from colorama import Fore from colorama import Style import tkinter from tkinter import ttk from ttkthemes import ThemedTk from tkinter.messagebox import showinfo def generator(): MIN = string.ascii_lowercase MAJ = string.ascii_upperc...
import math from . import error, encoding, transaction, logic import base64 class Template: def get_address(self): """ Return the address of the contract. """ return logic.address(self.get_program()) def get_program(self): pass class Split(Template): """ Spli...
#!/usr/bin/env python import os import re import json import pytz import string import tzlocal import logging import zipfile import datetime import classification_from_label import pprint logging.basicConfig() log = logging.getLogger('pfile-mr-classifier') def format_string(in_string): formatted = re.sub(r'[^\x0...
import argparse import os.path as osp import warnings import numpy as np import onnx import onnxruntime as rt import torch from mmcv import DictAction from mmdet.core.export import (build_model_from_cfg, generate_inputs_and_wrap_model, preprocess_example_i...
from django.conf import settings from django.contrib import messages from django.contrib.auth import authenticate, login from django.contrib.formtools.wizard.views import SessionWizardView from django.contrib.sites.models import Site from django.core.urlresolvers import reverse_lazy from django.http import HttpResponse...
import os import glob import json import unittest from unittest import skip from bs4 import BeautifulSoup as bs from aids.app.settings import BASE_DIR from aids.app.client import AIDScrapper from aids.app.models import Story, Scenario, ValidationError from aids.app.schemes import FrozenKeyDict from aids.commands impo...
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. # Python version 3.4 or higher is required to run this script. # Use case: Creates an aggregate POM which contains all modules for which aggregate code coverage will be reported. # # Flags # --project-list/--pl: List of pr...
"""Base class for EvalML engines.""" import sys import time import traceback from abc import ABC, abstractmethod from collections import OrderedDict import numpy as np import pandas as pd import woodwork as ww from evalml.automl.utils import tune_binary_threshold from evalml.exceptions import PipelineScoreError from ...
import argparse import importlib import os import tensorflow as tf from tensorflow.python import debug as tf_debug from tqdm import trange from config import MovieQAPath # from input import Input as In # from input_v2 import Input as In2 from legacy.soft_input import Input from utils import data_utils as du from util...
# -*- coding: utf-8 -*- from srttools.read_config import read_config from astropy.time import Time from astropy.coordinates import SkyCoord from astropy.io import fits import astropy.units as u import pytest from srttools.scan import Scan, HAS_MPL from srttools.io import print_obs_info_fitszilla, bulk_change, main_...
"""Helper functions.""" from dataclasses import dataclass from importlib import import_module from numbers import Integral import shutil from typing import ( Any, Callable, cast, Iterable, List, Literal, Optional, overload, Sequence, Union, ) import numpy as np from scipy.spars...
""" Copyright 2018 <NAME>. Licensed under the Apache License, Version 2.0 (the 'License'); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distribut...