text
stringlengths
3.07k
22.1k
"""Build industrial production per country.""" import pandas as pd import numpy as np import multiprocessing as mp from tqdm import tqdm tj_to_ktoe = 0.0238845 ktoe_to_twh = 0.01163 sub_sheet_name_dict = {'Iron and steel': 'ISI', 'Chemicals Industry': 'CHI', 'Non-metall...
from django.contrib.auth import authenticate, login, logout from django.db import IntegrityError from django.http import HttpResponse, HttpResponseRedirect, request from django.shortcuts import render, get_object_or_404 from django.urls import reverse from django.contrib.auth.decorators import login_required from djang...
from __future__ import print_function import os import torch # import torch.utils.data as data from torchvision.datasets.folder import is_image_file, default_loader from torchvision.datasets.vision import VisionDataset import numpy as np from PIL import Image classes = ['Sky', 'Building', 'Column-Pole', 'Road', 'Sid...
#!/usr/bin/env python3 import os import argparse import subprocess as sub from shutil import copyfile, move, rmtree import utils from utils.colors import * from utils.inputs import * from utils.file_utils import * from utils.c2_linter import * from utils.web_delivery import * import getpass import json import signal im...
import torch import numpy as np from torch import nn from tltorch.factorized_tensors import TensorizedTensor,tensor_init from tltorch.utils import get_tensorized_shape # Authors: <NAME> # <NAME> class FactorizedEmbedding(nn.Module): """ Tensorized Embedding Layers For Efficient Model Compression ...
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. """Talk with a model using a web UI.""" from http.server import BaseHTTPRequestHandler, HTTPServer from socketserver im...
from django.forms.widgets import Input from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import render, redirect from django.template import loader from .models import Article from django.contrib.auth.decorators import login_required from django.http import FileResponse import io from r...
import torch import numpy as np import torch.nn.functional as F import time import sys from types import SimpleNamespace HYPERPARAMS = SimpleNamespace(**{ 'pong': SimpleNamespace(**{ 'env_name': "PongNoFrameskip-v4", 'stop_reward': 18.0, 'run_name': 'pong', 'rep...
from datetime import datetime, timedelta import logging import os import tempfile from thespian.actors import InvalidActorSpecification import inspect import warnings ### ### Logging ### # recognized logging level names for the Thespian internal log. _name_to_level = { "CRITICAL": logging.CRITICAL, "ERROR": ...
import unittest import cvxpy from cvxpy.expressions.expression import Expression import numpy as np from sigpy.polys.polynomials import Polynomial, standard_monomials from sigpy.polys import sage_poly as sage def primal_dual_unconstrained(p, level, verbose=False, solver=None): if solver is None: solver = ...
# ShapelyValues.py # Written <NAME> - June 2021 # # A set of methods to calculate Shapely values. # # References: # [1] From Local Explanation to Global Understanidng with Explainable AI for Trees # (2020) <NAME>, et al. import rdml_graph as gr from rdml_graph.decision_tree import DecisionNode, \ learn_d...
import csv from IoU import calc_iou import numpy as np # Create a dictionary that contains the prediction and the true-bbbox def gt_splitter(path_to_data): data = list() with open(path_to_data) as csv_file: csv_reader = csv.reader(csv_file, delimiter=',') for row in csv_reader: d...
from flask_sqlalchemy import SQLAlchemy from flask_migrate import Migrate from datetime import datetime import json import numpy from app import app db = SQLAlchemy(app) migrate = Migrate(app, db) def default(o): if isinstance(o, numpy.int64): return int(o) if isinstance(o, numpy.int32): return int(o) if...
# -*- coding: utf-8 -*- from builtins import str import gzip from datetime import datetime from io import BytesIO from django.contrib import messages from django.contrib.auth import get_user_model from django.contrib.sessions.models import Session from django.db.models import Q from django.http import HttpResponse f...
import argparse import os import pickle import sys import numpy as np import torch import torch.nn.functional as F import torch_geometric.transforms as T from torch_geometric.datasets import Planetoid from models import GAT, GCN, SGC, USGC from utils import (EPOCHS_CONFIG, load_data, load_dataset, load_split, test, ...
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
# app.py # 2019-06-15 from googleapiclient.discovery import build from google_auth_oauthlib.flow import InstalledAppFlow from google.auth.transport.requests import Request import dateutil.parser import pytz import argparse import datetime import enum import os import pickle import re import signal import traceback #...
''' The MIT License (MIT) Copyright (c) 2016 <NAME> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publi...
### Example program to save several sensor data including bounding box ### Sensors: RGB Camera (+BoundingBox), De[th Camera, Segmentation Camera, Lidar Camera ### By <NAME> ### 2020 ### Last tested on CARLA 0.9.10.1 ### CARLA Simulator is licensed under the terms of the MIT license ### For a copy, see <https://...
import numpy as np from utils.common import np_soft_threshold from utils.common import cp_soft_threshold def objective_g(A_inv,S): return S-A_inv def subgrad_min(A,S,lam): A_inv = np.linalg.inv(A) grad = objective_g(A_inv,S)+lam*np.sign(A) mask = 1.0 - np.abs(np.sign(A)) return np_soft_threshold(g...
""" Main script for models """ from __future__ import absolute_import, division, print_function, unicode_literals import time from train import test, train, params from util import utils from sklearn.manifold import TSNE import torch import torch.nn as nn import numpy as np import argparse, sys, os def visualize_p...
# -*- coding: utf-8 -*- # Copyright (c) 2021, ifitwala and contributors # For license information, please see license.txt from __future__ import unicode_literals import os import json import frappe from frappe import _ def setup_taxes_and_charges(organization_name: str, country: str): file_path = os.path.join(os.pa...
# coding: utf-8 # /*########################################################################## # Copyright (C) 2016-2017 European Synchrotron Radiation Facility # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to dea...
################################################################################ # Copyright (c) 2021 ContinualAI. # # Copyrights licensed under the MIT License. # # See the accompanying LICENSE file for terms. ...
"""This module implements gammatone filters and a filtering routine. A filterbank is coming soon [Hohmann2002]_. .. plot:: import gammatone gammatone.example() TODO: - Tests, - nice introduction with example, - implementing the filterbank class References ---------- .. [Hohmann2002] <NAME>...
''' family 0x0d Chat navigation. ''' import struct import logging import util import oscar x0d_name="Chat nav" log = logging.getLogger('oscar.snac.x0d') subcodes = {} @util.gen_sequence def x0d_init(o, sock, cb): log.info('initializing') me = (yield None); assert me sock.send_snac(*os...
# (c) 2005 <NAME> and contributors; written for Paste # (http://pythonpaste.org) Licensed under the MIT license: # http://www.opensource.org/licenses/mit-license.php # # For discussion of daemonizing: # http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/278731 # # Code taken also from QP: http://www.mems-exchange....
#!/usr/bin/env python # Copyright 2015 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. """This script runs an automated Cronet performance benchmark. This script: 1. Sets up "USB reverse tethering" which allow network tra...
# BA - checked for metric randomness import os.path from os import path threads = "64" # set number of threads - this should be optimized per compute instance os.environ["TF_NUM_INTEROP_THREADS"] = threads os.environ["TF_NUM_INTRAOP_THREADS"] = threads os.environ["ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS"] = threads impor...
from django.core.validators import MinLengthValidator from django.db import models from django.db.models import F, Func from config.constants import ResearcherRole from database.common_models import UtilityModel from database.models import TimestampedModel from database.validators import ID_VALIDATOR, STANDARD_BASE_64...
import os import cv2 import numpy as np VALUE_RANGE_0_1 = '0,1' VALUE_RANGE_1 = '-1,1' VALUE_RANGE_0_255 = '0,255' def read(filepath, color_flags=cv2.IMREAD_COLOR): """Opens an image file from disk. Parameters ---------- filepath: str The path to the image file to open. color_flags: int,...
# [A Style-Based Generator Architecture for Generative Adversarial Networks](https://arxiv.org/pdf/1812.04948.pdf) import tensorflow as tf from tensorflow import keras from visual import save_gan, cvt_gif from utils import set_soft_gpu, save_weights from mnist_ds import get_half_batch_ds from gan_cnn import mnist_uni_...
import os import time import random import numpy as np import matplotlib.pyplot as plt import scipy.ndimage as nd import math import torch import torch.utils import torch.nn as nn import torch.optim as optim import torch.nn.functional as F import dataloaders as dl import augmentation as aug import cost_functions as...
#! /usr/bin/env python3 # Copyright 2016 <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
import torch from torch import nn as nn from torch.nn.functional import binary_cross_entropy_with_logits, cross_entropy from bases.nn.conv2d import DenseConv2d from bases.nn.linear import DenseLinear from bases.nn.models.base_model import BaseModel from bases.nn.sequential import DenseSequential from .utils import is_...
import keras as k import pandas as pd import cufflinks as cf from sklearn.model_selection import train_test_split from keras import Sequential from keras.layers import Embedding from keras.layers import Dense,SpatialDropout1D from keras.preprocessing.text import Tokenizer from keras.preprocessing.sequence import pad_s...
# -*- coding: utf-8 -*- # Copyright (c) 2012 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. """Unittest for cros_test_lib (tests for tests? Who'd a thunk it).""" from __future__ import print_function import os import...
from pathlib import Path from typing import Dict, List, Tuple, Union import numpy as np import pandas as pd import xarray from neuralhydrology.datasetzoo.basedataset import BaseDataset from neuralhydrology.utils.config import Config class CamelsUS(BaseDataset): """Data set class for the CAMELS US data set by [#...
def get_matching_paren(exp: str) -> int: """ Returns the index of the right parenthesis which matches the first left parenthesis. exp[0] should be a left parenthesis """ if exp[0] != '(': raise ValueError('Given string must begin with \'(\' character') left = 1 right = 0 i = 1 ...
# -*- coding: utf-8 -*- import numpy as np import tensorflow as tf import pandas as pd import json import random from poke_env.player_configuration import PlayerConfiguration from poke_env.player.env_player import Gen7EnvSinglePlayer from poke_env.player.random_player import RandomPlayer from poke_env.player.frozen_rl...
import os import os.path as osp import tempfile import numpy as np import pytest import torch from mmhuman3d.models import HybrIK_trainer, HybrIKHead from mmhuman3d.models.builder import build_body_model from mmhuman3d.models.utils.inverse_kinematics import ( batch_get_3children_orient_svd, batch_get_pelvis_o...
""" Tests for replacing master nodes. """ import textwrap import uuid from pathlib import Path from typing import Iterator import docker import pytest from _pytest.fixtures import SubRequest from cluster_helpers import wait_for_dcos_oss from dcos_e2e.backends import Docker from dcos_e2e.cluster import Cluster from dc...
# -*- coding: utf-8 -*- import warnings; warnings.simplefilter('default') import sys from warnings import warn import warnings class Dum(object): def __init__(self,name, predicate): self.name = name if callable(predicate): self._predicate = predicate() else: sel...
# -*- coding: utf-8 -*- from numpy import asarray import math ENERGY_LEVEL = [100, 113, 110, 85, 105, 102, 86, 63, 81, 101, 94, 106, 101, 79, 94, 90, 97] # ============================================================== # The brute force method to solve first problem def find_significant_energy_incr...
#!/usr/bin/python3 """ This test checks that we can assemble and disassemble all the instructions found in `arm_test.dis` and similar dumps obtained via `objdump` """ import re import sys from typing import List, Dict from CpuA64.opcode_tab import OK, Opcode, OPC_FLAG, CONDITION_CODES_INV_MAP, Assemble, Disassemble,...
import cv2 import numpy as np from midiutil import MIDIFile def show_and_destroy(img, window=''): cv2.imshow(window, img) cv2.waitKey(0) cv2.destroyAllWindows() def match_pattern_unique_tempo(src, pattern, bnry): w, h = pattern.shape[::-1] res = cv2.matchTemplate(src, pattern, cv2.TM_CCOEFF_NORM...
from discord.ext import commands from .utils import fuzzy, time import asyncio import discord import re import zlib import io import os import lxml.etree as etree DISCORD_PY_GUILD_ID = 336642139381301249 ROBODANNY_ID = 80528701850124288 def can_use_block(): def predicate(ctx): if ctx.guild is None: ...
#!/usr/bin/python # # 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 your option) any later version. # # Ansible is distribut...
__all__ = ['DelimitedTextReader', 'DelimitedPointsReaderBase', 'XYZTextReader'] __displayname__ = 'Delimited File I/O' import sys import numpy as np import pandas as pd from .. import _helpers, interface from ..base import ReaderBase if sys.version_info < (3,): from StringIO import StringIO else: from io i...
from django.shortcuts import get_object_or_404, render, redirect from django.contrib.auth import authenticate, login, logout, update_session_auth_hash from django.contrib.auth.decorators import login_required from django.contrib.auth.models import User from django.contrib import messages from django.db.models import Q ...
#!/usr/bin/env nix-shell #!nix-shell -p python3 -p nix-prefetch-git -p nix -i python3 import json import shutil import re import sys import os from pathlib import Path from typing import List, Optional, Tuple, Dict, Any, Tuple import xml.etree.ElementTree as ET import urllib.request import urllib.error import subproce...
""" This module implements runtime logic to orchestrate the following steps 1. Attach to a target application 2. Resolve and activate probes 3. Resolve and program pmc events 4. Collect profile data for reporting Author: <NAME>, <NAME> """ import logging from xpedite.txn.classifier import DefaultClassif...
import pprint import random import time import os import numpy as np import pandas as pd from config import Config from .entities import Snake, Field, CellType, SnakeAction, ALL_SNAKE_ACTIONS, Point class Environment(object): """ Represents the RL environment for the Snake game that implements the game logi...
from selenium import webdriver from requests import post from time import sleep from sys import stdout from json import loads from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC credit_list = [0.1, 0.2, 0.3...
from datetime import datetime, timedelta from typing import Any, Union from dateutil.parser import parse as parse_date import numpy from pyproj import CRS, Geod, Transformer from packetraven.packets.parsing import InvalidPacketError, parse_raw_aprs DEFAULT_CRS = CRS.from_epsg(4326) class LocationPacket: """ lo...
# python3.7 """Contains the class to evaluate GANs with Frechet Inception Distance (FID). FID metric is introduced in paper https://arxiv.org/pdf/1706.08500.pdf """ import os.path import time import numpy as np import torch import torch.nn.functional as F from models import build_model from utils.misc import get_ca...
#Small robot 2020 config from core.Util import * from modules.sensors.BinaryInfrared import * from modules.sensors.PressureSensor import * from modules.sensors.ColorSensor import * from core.network.Tcp import * from modules.services.ShareService import * from modules.drivers.Servo import * from core.network.Splitter i...
# SPDX-FileCopyrightText: 2020 Splunk Inc. # # SPDX-License-Identifier: Apache-2.0 from builtins import range from builtins import object import os.path as op import os import json import time import splunktalib.kv_client as kvc from splunktalib.common import util from splunktalib.common import log import threading ...
#!/usr/bin/env python # -*- coding:utf-8 -*- # author:owefsad # software: PyCharm # project: lingzhi-webapi from dongtai.endpoint import R from dongtai.endpoint import UserEndPoint from dongtai.models.vul_level import IastVulLevel from dongtai.models.vulnerablity import IastVulnerabilityModel from dongtai.models.strat...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ''' Synchronizes patches and packaging between this repo and a local copy of ungoogled-chromium-debian ''' import argparse import logging import shutil import stat from pathlib import Path import git # GitPython # Prefix of packaging and patches branch names _BRANCH_PRE...
#!/usr/bin/env python3 import os import sys import time from tornado.httpserver import HTTPServer from tornado.ioloop import IOLoop from tornado.web import RequestHandler, Application, url, stream_request_body sys.path.insert(0, os.pardir) # noinspection PyPep8 from tornadostreamform.multipart_streamer import MultiPa...
import sys sys.path.append('./') import os from vtkplotter import shapes, merge import pandas as pd from tqdm import tqdm import numpy as np from brainrender.Utils.data_io import load_json from brainrender import STREAMLINES_RESOLUTION, INJECTION_VOLUME_SIZE from brainrender.Utils.webqueries import request from brai...
# -*- coding: utf-8 -*- """ Created on Wed Jan 09 15:52:48 2019 @author: <NAME> @ Gilmour group @ EMBL Heidelberg @descript: Sympy-based function (with numpy speed-up) to compute the roundness of an outline-derived point cloud based on the deviation of its points from a circumscribed ellip...
r""" Convert a restructured text document to html. Inline math markup can uses the *math* directive, or it can use latex style *\$expression\$*. Math can be rendered using simple html and unicode, or with mathjax. """ import re from contextlib import contextmanager # CRUFT: locale.getlocale() fails on some versions...
# coding=utf-8 # Copyright 2020 The TF-Agents 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 la...
from rfc3986 import urlparse import urllib import re from click import UsageError from enum import Enum from .logging import logger class ScpOperand(): def __init__(self, remote=False, uri=False, user=None, host=None, path=None, port=None, original_str=None): self.__remo...
import json import os import random from pathlib import Path import discord import discord_slash from discord.ext import commands, menus from assets import count_lines, random_assets, get_color, list_funcs from assets.keep_alive import keep_alive with open('config.json', 'r') as detailsFile: details_data = json....
import itertools from scipy import spatial import os import pickle import string import numpy as np from nltk import tokenize from sklearn.model_selection import train_test_split from keras.preprocessing.sequence import pad_sequences from keras.preprocessing.text import Tokenizer from nltk.util import ngrams def cosi...
from .custom_driver import client, use_browser import time from random import randint from .utils import log from .village import open_village, open_city, open_building from .farming import send_farm from .util_game import close_modal, shortcut, open_shortcut, check_resources, old_shortcut from .settings import setting...
import sys from bambou import NURESTFetcher, NURESTSession, NURESTObject, NURESTRootObject from bambou.exceptions import InternalConsitencyError CSP_ENTERPRISE_ID = "76046673-d0ea-4a67-b6af-2829952f0812" CSP_ENTERPRISE_NAME = "CSP" class Session(NURESTSession): """ Wrapper class around Bambou session needed...
# RegEx pattern for matching zip code. ZIP_CODE = { "US": r"\d{5}([ \-]\d{4})?", "DE": r"\d{5}", "JP": r"\d{3}-\d{4}", "FR": r"\d{2}[ ]?\d{3}", "AU": r"\d{4}", "IT": r"\d{5}", "CH": r"\d{4}", "AT": r"\d{4}", "ES": r"\d{5}", "NL": r"\d{4}[ ]?[A-Z]{2}", "BE": r"\d{4}", "DK"...
""" The MIT License (MIT) Copyright (c) 2016 <NAME> <<EMAIL>> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, me...
# Copyright 2018 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...
# -*- coding: utf-8 -*- import argparse import os import shutil import time import yaml import multiprocessing as mp import numpy as np import torch import torch.nn as nn import torch.optim as optim import wandb from config.load_config import load_yaml, DotDict from data.dataset import SynthTextDataSet from loss.msel...
#### PATTERN | DE ################################################################################## # -*- coding: utf-8 -*- # Copyright (c) 2012 University of Antwerp, Belgium # Author: <NAME> <<EMAIL>> # License: BSD (see LICENSE.txt for details). # http://www.clips.ua.ac.be/pages/pattern ###########################...
from __future__ import print_function import argparse import datetime import functools import logging import re import signal import subprocess import sys import textwrap import time import redlock log = logging.getLogger('redlock.cli') logging.basicConfig(level=logging.INFO) state = { 'running': True } def tim...
""" Base environment class that all experiments must inherit from (or at least implement this interface). """ import theano from lasagne.layers import InputLayer from ..utils.format import check_list, check_tuple from ..utils.layers import DictLayer from collections import OrderedDict class BaseEnvironment(object):...
import torch from torch import nn, optim from torch.utils.data import DataLoader, sampler from tqdm import tqdm from argument import get_args from backbone import vovnet39, vovnet57, resnet50, resnet101 from utils.dataset import DOTADataset, collate_fn from model import ATSS,Efficientnet_Bifpn_ATSS from distrib...
from cbint.utils.detonation import DetonationDaemon, ConfigurationError from cbint.utils.detonation.binary_analysis import (BinaryAnalysisProvider, AnalysisPermanentError, AnalysisTemporaryError, AnalysisResult, AnalysisInProgress) import cbint.utils.feed from cbapi.c...
""" Note that this ETL cannot be run in the VM because it needs too much memory. Specifically, county_outcomes.csv should not be read in memory. To run it in the VM, we should (generate JSON submissions instead of TSV, and) read county_outcomes.csv as below, which means removing uses of pandas. Since this is a one-time...
"""Header Quoi : Space invader Qui : <NAME> """ """ --- Importation des modules --- """ from tkinter import * from tkinter import messagebox import time import random """_______________________________________________________________________""" """ --- Classe --- """ class action : def...
import numpy as np import matplotlib.pyplot as plt import tensorflow as tf from IPython.display import display, HTML from mpl_toolkits.mplot3d import Axes3D from safe_learning.utilities import (with_scope, get_storage, set_storage, get_feed_dict) __all__ = ['plot_lyapunov_1d', 'p...
from enum import IntFlag import pytest from ubl.business_document.components import ABIERegistry, BIERegistry, \ DocumentRegistry, ComponentRegistry, Components, \ Documents, Schemas from ubl.business_processes import ProcessRegistry from ubl.business_document.components.ccts import CodeType, AmountType, \ ...
import warnings from datetime import datetime, timedelta from onegov.core.crypto import random_token from onegov.core.utils import normalize_for_url from onegov.core.collection import GenericCollection from onegov.file.utils import as_fileintent from onegov.form.errors import UnableToComplete from onegov.form.fields i...
# -*- coding: utf-8 -*- # 版权所有 2019 深圳米筐科技有限公司(下称“米筐科技”) # # 除非遵守当前许可,否则不得使用本软件。 # # * 非商业用途(非商业用途指个人出于非商业目的使用本软件,或者高校、研究所等非营利机构出于教育、科研等目的使用本软件): # 遵守 Apache License 2.0(下称“Apache 2.0 许可”),您可以在以下位置获得 Apache 2.0 许可的副本:http://www.apache.org/licenses/LICENSE-2.0。 # 除非法律有要求或以书面形式达成协议,否则本软件分发时需保持当前许可“原样”...
#!/usr/bin/python3 # ----------------------------------------------------------- # Train model, generates prediction and evaluate when possible # ----------------------------------------------------------- import math import os import datetime import pandas as pd from sklearn.metrics import r2_score, mean_absolute_err...
import math import numpy as np __all__ = ['SourceWaveletBase', 'DerivativeGaussianPulse', 'RickerWavelet', 'GaussianPulse', 'WhiteNoiseSource'] _sqrt2 = math.sqrt(2.0) def _arrayify(arg): if not np.iterable(arg): return True, np.array([arg]) else: return False, np.asarray(arg) class Sourc...
import argparse import boto3 import botocore import csv import json import lattice import os import pandas as pd import re import requests import subprocess import sys import qcmetrics_mapper from urllib.parse import urljoin from bs4 import BeautifulSoup EPILOG = ''' Extract summary info and QC metrics from a cellran...
import os, sys, time import numpy as np from scipy.interpolate import RectBivariateSpline from sklearn.metrics.pairwise import euclidean_distances import matplotlib.pylab as plt from se2waveload import * ## Zero level set definition # Sigmoid or any function of interest to represent the center of the fault / Zero ...
""" Contains lambdahandler functions for cloudsploit scanning / population steps of the scanning step function. """ import datetime import json import os from collections import defaultdict from lib.logger import logger from lib.dynamodb import requirements_table, accounts_table, ncr_table, scores_table, scans_table f...
import pandas as pd import numpy as np from tqdm import tqdm import os def exponentiate(d): ''' Exponentiates a dictionary's probabilities. ''' return {k: np.exp(v) for k, v in d.items()} def normalize(d): ''' Normalizes a dictionary to sum to one. ''' return {k: v/sum(d.values()) for ...
# Imports arcade library import arcade # Imports randomlibrary import random # Imports threading library import threading # From shooter imports Shooter from game.shooter import Shooter # From score imports Score from game.score import Score # From constants import all from game.constants import * # From Target imports...
import os import time import json import numpy as np from numpy import matlib import matplotlib.pyplot as plt import torch from torch import nn from torch.nn import functional as F from torch.utils.data import DataLoader from torch.optim.lr_scheduler import StepLR from DeepSSMUtils import model from DeepSSMUtils impor...
# -*- coding: utf-8 -*- """ Created on Wed Nov 7 11:24:21 2018 @author: jtfl2 """ import random import os import copy import easygui as eg import re #aa = 'A,R,N,D,C,Q,E,G,H,I,L,K,M,F,P,S,T,W,Y,V'.split(',') filenames = [] eds = [] mat_filepath = eg.diropenbox(msg = 'Folder containing the similarity m...
# -*- coding: utf-8 -*- # # Package documentation API # # Copyright (c) Honda Research Institute Europe GmbH # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of source code must retain the ...
#!/usr/bin/python import sys import os import logging import argparse import traceback import mysql.connector import dnslib as dl from collections import defaultdict from datetime import datetime,timedelta from json import dumps as json_dump, loads as json_load from circuits.web import Server, Controller from raw_serv...
""" process.py Created by <NAME> on 2011-05-02. Copyright (c) 2009-2017 Exa Networks. All rights reserved. License: 3-clause BSD. (See the COPYRIGHT file) """ import os import errno import time import subprocess import select import fcntl from exabgp.util.errstr import errstr from exabgp.reactor.network.error import...
import os import sys import shutil import dotbot import subprocess import platform class CrossPlatformTask: def parse_platform(self, platform_val) -> bool: if platform_val is None: return True if len(platform_val) > 0 and platform_val[0] == "!": reverse_it = True ...
import tensorflow as tf from finetune.base_models.gpt.featurizer import dropout, embed, split_heads, merge_heads from finetune.util.shapes import shape_list, lengths_from_eos_idx from finetune.custom_ops import recursive_agg from finetune.base_models.gpt.featurizer import get_pos_values from finetune.optimizers.recompu...
from contextlib import suppress from typing import List, Optional from napari import Viewer as NViewer from napari.utils.colormaps import Colormap from qtpy.QtWidgets import QCheckBox, QFormLayout, QPushButton, QWidget from PartSeg.common_backend.base_settings import BaseSettings class SynchronizeWidget(QWidget): ...