text
stringlengths
3.07k
22.1k
from django.contrib.auth.models import User from django.db import models from django.urls import reverse from django.utils.text import slugify from Building.validators import MaxSizeValidator NUMBER_SUFFIX = [ ('A', 'A'), ('B', 'B'), ('C', 'C'), ('D', 'D'), ('E', 'E'), ('F', 'F'), ('G', 'G'), ('H', 'H'), ('I', 'I...
import json import logging import os import posixpath import shutil from html.parser import HTMLParser from os.path import basename from zipfile import ZipFile import dawn import wordfreq as wf from dawn.epub import Epub from django.utils import timezone from nltk import RegexpTokenizer from glossary.util import base...
import numpy as np from time import sleep import struct import matplotlib.pyplot as plt from matplotlib import patches from scipy.io import wavfile from scipy.fftpack import dct from tqdm import tqdm import edison.mfcc.mfcc_utils as mfu from config import * # Input wav file to use in_wav = 'data/edison_16k_16b.wav' ...
""" Drain running ECS services from an instance about to be terminated.""" import json import logging import time import boto3 import math import os DEFAULT_MAX_ITERATIONS_PER_INSTANCE = 10 # Stagger execution to avoid spamming SNS DEFAULT_PAUSE = 30 # seconds logging.basicConfig() logger = logging.getLogger() logge...
import asyncio from typing import List from .api import ApiProvider, ApiError from .structs import ( Pair, OrderSide, OrderStatus, OrderType, Period, Candle, Trade, OrderInBook, OrderBook ) class Exchange: """Interface to base exchange methods.""" def __init__(self, api: ApiProvider = None): ...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import collections import os import random import cPickle as pickle import numpy as np import bisect import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import argparse import subprocess as ...
import csv import os import sys import transaction from pyramid import testing from pyramid.paster import get_appsettings, setup_logging from pyramid.scripts.common import parse_vars from fabrikApi.models import DBAssembly, DBContentTree, DBContent, DBUser, \ get_engine, get_session_factory, get_tm_session from f...
# -*- coding: utf-8 -*- import netifaces import re import netaddr import psutil from amplify.agent.common.context import context from amplify.agent.common.errors import AmplifySubprocessError from amplify.agent.common.util import subp from amplify.agent.common.util.ec2 import AmazonEC2 from amplify.agent.common.util....
from functools import wraps import os import json from base64 import b64encode import time as time_module from copy import copy import logging from six.moves.urllib.parse import urlencode from flask import request, session, redirect, url_for, g from oauth2client.client import flow_from_clientsecrets, OAuth2WebServerFl...
#!/usr/bin/python3 import os import sys import json import hashlib import configparser try: from rich import print from rich.table import Table except: print("Error: >rich< module not found.") sys.exit(1) try: import lief except: print("Error: >lief< module not found.") sys.exit(1) try: ...
import copy import numpy as np import torch from scipy.sparse.linalg import svds def compute_svd(embedding, rank, q=None, mem_efficient=False): np.random.seed(1234) torch.manual_seed(1234) embedding = embedding.cpu() if q is not None: q = q.cpu() if mem_efficient: q = torch...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Example retrieve pushes with iterator. """ import asyncio import datetime import os import pprint import sys import threading import tkinter as tk import traceback from functools import partial import queue from typing import List, Callable from asyncpushbullet.async_...
# # Copyright (c) 2014 by <NAME>. # 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 applicable law o...
# igo.py '''iGo is a module to guide drivers through the streets of a city. This module contains functions able to handle acquisition, storage and consulting of graphs representing streets of a city, which must be kept track of in OpenStreetMap (www.openstreetmap.org). The module also relies on having the data of stre...
# Prometheus exporter for icon blockchain network # Scrapes metrics from all the nodes in the network and exposes them # to be scraped by prometheus import asyncio from datetime import datetime from signal import SIGINT, SIGTERM, signal from time import sleep, time from typing import List import requests from prometh...
#!/usr/bin/env python # coding:utf-8 from unittest import result from ast import arg from cv2 import log import numpy as np import sklearn import torch import os import shutil import params import matplotlib.pyplot as plt import params import torchvision.transforms as transforms import logging import random from mpl_to...
import os import httplib2 as httplib2 import requests from flask import json, request, make_response, flash, Blueprint, Response from flask_cors import cross_origin import string import random from sqlalchemy.orm import sessionmaker from sqlalchemy import create_engine from flask_sqlalchemy import xrange from oauth2c...
from unittest import TestCase import os import numpy as np import pytest import tensorflow as tf from numpy.testing import assert_array_equal, assert_array_almost_equal from tensorflow.python.framework.errors import InvalidArgumentError from gtd.ml.tf.utils import TensorDebugger, clean_session, expand_dims_for_broadc...
import os import numpy as np import theano import lasagne import time from scipy.stats import bayes_mvs from loading import augment from network import Network, Autoencoder L = lasagne.layers T = theano.tensor class Trainer(object): """ Base for subclassing optimizers Includes: - a function for it...
# -*- coding: utf-8 -*- """ @create: 2017-10-13 11:10:34. @author: name @desc: api_template_maker """ import re import os import json import time import codecs import random import hashlib import datetime from tornado import gen from tornado import ioloop from tornado import template from tornado import httpclient fr...
#!/usr/bin/env python """ Change Local Git Repo Directory name to RepoName@OrganizationName format """ import click # TODO: split rich style to standalone def rich_style(org_str="", pro_str=""): """ Compare original string and processed string , return difference with rich style delete decorated by bo...
import requests from bs4 import BeautifulSoup import re from time import sleep,perf_counter from random import uniform,choice user_agent_list = ["Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36", "Mozilla/5.0 (Windows NT 10.0; …) Gecko/201001...
#!/usr/bin/env python3 # MIT License # # Copyright (c) 2021 <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 # ...
import cv2 import os from tqdm import tqdm import numpy as np import math import sys import argparse from utils import * #Some function definition for image based rendering def GuidedFiltF(img, r): eps = 0.04; I = img I2 = cv2.pow(I,2); mean_I = cv2.boxFilter(I,-1,((2*r)+1,(2*r)+1)) mean_I2 = cv2....
#! -*- coding: utf-8 -*- from math import floor import os import sys import time import numpy as np import faiss # make faiss available import os import psutil import mkl mkl.get_max_threads() def measure(d=768, nb=1000000, nq=1000, nlist=100, k=5): # print('faiss-cpu 速度测试'.center(40,'-')) # print('正在生成模拟数据....
#================================LabFuncs.py===================================# # Created by <NAME> 2021 # Description: # Contains an assortment of functions that are all related to the 'Lab' somehow # e.g. the nuclear form factor, lab velocity etc. # Contains: ##### # Efficiency functions for Ar and Xe # Energy re...
import tensorflow as tf import numpy as np import pickle from flask import Flask, request, jsonify from dotenv import load_dotenv import base64 from flask_cors import CORS load_dotenv() app = Flask(__name__) CORS(app) def load_image(image_path): img = tf.io.read_file(image_path) img = tf.image.decode_jpeg(im...
''' This file is part of PM4Py (More Info: https://pm4py.fit.fraunhofer.de). PM4Py 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 late...
import random import string, re import requests as core_requests from django.shortcuts import render from django.contrib.auth import get_user_model from django.core.mail import EmailMessage from django.template.loader import render_to_string from django.contrib.auth import authenticate from django.contrib.auth.passwor...
""" 295. Find Median from Data Stream Hard The median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value and the median is the mean of the two middle values. For example, for arr = [2,3,4], the median is 3. For example, for arr = [2,3], the median is (2 + 3) / 2...
# coding: utf-8 # author: hxy # 2021-4-25,python3.8 """ 针对图片内小目标数据增强的脚本; 增加目标的数量; 更新标签文件.xml; """ import os import cv2 import time try: import xml.etree.cElementTree as ET except ImportError: import xml.etree.ElementTree as ET from xml.dom.minidom import parseString from lxml.etree import Element, SubElement...
import torch import cupy as cp from torch.utils.data import Dataset, DataLoader from torch.utils.dlpack import from_dlpack,to_dlpack from cuml.preprocessing.model_selection import train_test_split import time from sklearn.datasets import load_boston, load_breast_cancer, load_iris, load_digits import cupy as cp import...
import calendar from gettext import ngettext from pathlib import Path import arrow from flask import ( abort, current_app, g, redirect, render_template, request, Response, url_for, ) from flask_login import current_user, login_required from lemonade_soapbox import db from lemonade_soap...
import math import logging import torch import torch.nn as nn from torch.nn import functional as F logger = logging.getLogger(__name__) def gelu(x): """Implementation of the gelu activation function. For information: OpenAI GPT's gelu is slightly different (and gives slightly different results): ...
# -*- coding: UTF-8 -*- from six import string_types import json import os import shutil import pygame from constants import ATTACK_POINTS, ARMOR_CLASS, ITEMS, TACTICS # WARNING: Don't import anything from the rotj repo into here. To avoid circular imports, # we are restricting this module to only functions that do...
# -*- coding: utf-8 -*- # Импорт библиотек import logging import os.path import sys import time import click import pandas as pd from datetime import datetime, timedelta from terminaltables import AsciiTable sys.path.append(os.path.join(os.path.dirname(__file__), '..')) from cointrader import db, STRATEGIES from coint...
# -*- coding: utf-8 -*- import numpy as np class Population: INTEGER = 0 FLOAT = 1 CATEGORICAL = 2 CONSTANT = 3 def __init__(self, params, columns, population = None): r""" This class is used to create the GA populations. Allow chromosomes to have int, float, and constan...
# ---------------------------------------------------------------------- # | # | FuncDefinitionStatementParserInfo.py # | # | <NAME> <<EMAIL>> # | 2021-10-08 10:02:26 # | # ---------------------------------------------------------------------- # | # | Copyright <NAME> 2021 # | Distributed under the B...
import asyncio import traceback import json import urllib.parse as urlparse import pyx from pyx.log import logger __all__ = ['TransferIncompleteError', 'TransportEntry', 'RootResource', 'HubResource', 'RecvResource', 'ListResource', 'shelf'] shelf = {} class TransferIncompleteError(Exception...
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). You may not # use this file except in compliance with the License. A copy of the License # is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file acc...
#!/usr/bin/env python3 import argparse import fnmatch import os import shutil import subprocess import sys from elftools.elf.elffile import ELFFile __appname__ = 'copydeps' __version__ = '1.1.1' DESCRIPTION = """\ Copy dependencies required by an executable to the specified dir. Dependencies can be excluded. If a l...
"""cameraTest2 controller.""" # You may need to import some classes of the controller module. Ex: # from controller import Robot, Motor, DistanceSensor from controller import Robot import cv2 import numpy as np from controller import Keyboard from movement_commands import * from gesture_commands import * #install wit...
# (C) Copyright 2020 ECMWF. # # This software is licensed under the terms of the Apache Licence Version 2.0 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. # In applying this licence, ECMWF does not waive the privileges and immunities # granted to it by virtue of its status as an intergovernment...
import datetime import datetime as dt import itertools import json import math import os from collections import OrderedDict from copy import deepcopy import numpy as np from pomegranate.BayesianNetwork import BayesianNetwork from pomegranate.base import State from pomegranate.distributions.ConditionalProbabilityTable...
# Copyright 2015 Twitter, Inc and other contributors. # # 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 -*- # Copyright 2018-2019 Streamlit Inc. # # 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 applicabl...
# coding=utf-8 # Copyright 2019 Google LLC # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to ...
import warnings warnings.filterwarnings("ignore") import plotly.graph_objects as go import pandas as pd import mysql.connector import pandas as pd import sys sys.path.insert(1, '../corona-dashboard-server/scripts') import config import json import chart_studio.plotly as py import chart_studio.tools as tls import numpy ...
# <NAME>, <NAME>, and <NAME> # 2018-04-03 # The three of us collaborated on this assignment. # We made use of the textbook as well as code on Moodle 2. from random import randint, choice # From Alignments.py on Moodle 2 DNA_2 = {'G': { 'G': 1, 'C':-3, 'A':-3, 'T':-3, 'N':0 }, 'C': { 'G':-3, 'C': 1, 'A':-3, '...
#%% Start a fig # Select an Image # image_id = df_by_image.index[-1] # image_id = df_by_image.index[9] # Select an image with 15 ships image_id = np.random.choice(df[df['HasShip']].index.values) img, contours = get_ellipsed_images(image_id) plt.figure() plt.interactive(True) plt.interactive(False) plt.imshow(img) #%...
import os import pickle import torch import torch.nn as nn import torch.autograd as autograd from datetime import datetime class Message_printer: def __init__(self, total_iter, freq=10): self.iter_total = total_iter self.iter_curr = 0 self.loss_cls = 0 self.num_total = 0 se...
import torch import torch.nn as nn import torch.nn.functional as F import torchvision from torch.utils.model_zoo import load_url as load_state_dict_from_url # Inception weights ported to Pytorch from # http://download.tensorflow.org/models/image/imagenet/inception-2015-12-05.tgz FID_WEIGHTS_URL = 'https://github.com/...
import pandas as pd import requests import plotly.graph_objects as go from django.shortcuts import render from django.contrib.auth.forms import UserCreationForm from .models import * from .forms import CreateUserForm from django.shortcuts import redirect from django.contrib import messages from django.contrib.auth im...
""" Created by <NAME> on 1/6/2020. """ import json import collections import os from lib import global_variables from lib.logger import log_call, log from lib.file_io import write_json, read_json def _to_nested_dict(raw_data): log_call('config:_parse_json') parsed_data = collections.defaultdict(lambda: coll...
# -*- coding: utf-8 -*- """ Created on Thu Jan 7 23:32:21 2021 @author: <NAME> Title: AMLSim Final """ # In[ ]: # ## 1. PACKAGES ## # Data processing import numpy as np import pandas as pd # Loading data, line import random import os from tensorflow.keras.utils import to_categorical from collections import Counte...
# coding=utf-8 import discord, asyncio, ast, datetime, os, dotenv, koreanbots, sqlite3, random dotenv.load_dotenv(verbose=True) token = os.getenv("BOT_TOKEN") admin = [] # 봇 관리자 목록입니다. prefix = "상추야" intents = discord.Intents.all() client = discord.AutoShardedClient(intents=intents) Bot = koreanbots.Client(client, o...
#!/usr/bin/env python ### # Copyright (c) 2002-2007 Systems in Motion # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS I...
# Copyright (c) 2021 CNES/JPL # # All rights reserved. Use of this source code is governed by a # BSD-style license that can be found in the LICENSE file. """ Settings handling ----------------- """ from typing import Any, Dict, Iterator, Tuple, Union import contextlib import copy import importlib import logging import...
import urllib from buildbot.status import builder from buildbot.status.web.base import HtmlResource HEAD = """ <script type="text/javascript" src="%(path)s/mochikit/MochiKit.js"></script> <script type="text/javascript" src="%(path)s/plotkit/Base.js"></script> <script type="text/javascript" src="%(path)s/p...
# -*- coding: utf-8 -*- from selenium import webdriver import time #auxiliary functions def read_saved_track_names(track_file): tracks = set() with open(track_file) as f: for line in f: line2 = line.strip() tracks.add(line2) return tracks def save_garmin_tracks(activity_li...
import torch import torch.nn as nn from torch.nn import functional as F import torch.distributions as dist ### Follows model as seen in LEARNING ROBUST REPRESENTATIONS BY PROJECTING SUPERFICIAL STATISTICS OUT # Decoders class px(nn.Module): def __init__(self, d_dim, x_dim, y_dim, z_dim): super(px, self)._...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from .. import _utilities from...
# python standard library import re import csv import datetime import textwrap import os import threading # this package from tuna import BaseClass from tuna import TunaError from tuna import BaseConfiguration from tuna.clients.simpleclient import ConnectionError from tuna.commands.command import TheCommand from tu...
"""List, add, remove and modify SCION links.""" import logging from pathlib import Path import sys from typing import Any, Callable, Mapping, NamedTuple, Tuple import docker from ixp_testbed import errors from ixp_testbed.address import IfId, ISD_AS from ixp_testbed.gen.gen_dir import ( add_br_interface, modify_...
""" This is a basic experiment trying to replicate the results in https://arxiv.org/abs/1508.06576 and using it to minimise the styles of multiple images at the same time. The idea is that I'll copy the code required to load the VGG model but try to reproduce the rest by myself. """ import time import os import argpar...
"""Collection of SUMO instance management classes. The classes in this module probably should not be instantiated directly, instead they should be created and managed by objects from :mod:`~muve.sumo_server.sumo.manager`. """ from __future__ import annotations import abc import ipaddress import os import pathlib impo...
# -*- coding: utf-8 -*- import time, datetime from init import InitModel from google.appengine.ext import ndb from gcm import GCM from authomatic import Authomatic from handlers.controllers.auth import CONFIG from google.appengine.api import urlfetch from google.appengine.api import mail import logging from...
import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' # os.environ['CUDA_VISIBLE_DEVICES'] = '-1' import numpy as np import cv2 import tensorflow.keras.backend as K IMAGE_SHAPE = (448, 448, 3) CLASS_NAME_TO_INDEX = { 'aeroplane': 0, 'bicycle': 1, 'bird': 2, 'boat': 3, 'bottle': 4, 'bus': 5, 'car': 6, 'cat': 7,...
from flask import Flask, Response import cv2 from Flask.jumple_student import start_loop, image_overlapping import torch import cv2 import socket import time import argparse import numpy as np from PIL import Image, ImageFont, ImageDraw img_rate = 0.8 import posenet import jangjorim_games import time from playsound...
#___________________________________________________________________________# # Some notes: # Written by <NAME> of Geoscience Australia, date: 08/11/2019 # This code contains functions to handle tranformations between GPS and # AWVS/AHD and Vice Versa # Gridded data used for the varisous reference surfaces are geotif...
from matplotlib import pyplot as plt import numpy as np import pandas as pd from numpy import pi,abs,exp,log,log10 from scipy import optimize class Rowe2004Model(): def __init__(self,freqs=None, alpha = 88.,gamma = 71.8, t_0 = 79.2, G_ee = 3.8,G_ei = -8.,G_ese = 10.8, G_esre = -5.7, ...
import os import re import io import yaml import numpy as np from scipy.io import loadmat from scipy.io.matlab.mio5_params import mat_struct # HACK: fix loading number in scientific notation # # https://stackoverflow.com/questions/30458977/yaml-loads-5e-6-as-string-and-not-a-number # # An apparent bug in python-yaml ...
# -*- coding: utf-8 -*- ########################################################### # Elasticsearch Snack 1.1 # # A brief example case indexing recipes with Elasticsearch, # Python and Docker containers # # Copyright 2020 <NAME> # # Contact: <EMAIL> ########################################################### """TUI m...
from typing import * import numpy as np from .common import VIRTUAL_ROOT, DEFAULT_SPAN from .bio_smoothing import BIOSmoothing from .functions import max_match class Span: """ Span is a simple data structure for a span (not necessarily associated with text), along with its label, children and possibly i...
from datetime import datetime import sys import importlib importlib.reload(sys) # Reload does the trick! sys.path.insert(0, '../../../src/') from models import Referencedbentity, Locusdbentity, Taxonomy, Eco, Go, Regulationannotation, Source sys.path.insert(0, '../') from database_session import get_nex_session # from...
#!/usr/bin/env python """ Used to identify characteristics of a file contains: - FileTyper class todo: - explore details around quoting flags - they seem very inaccurate See the file "LICENSE" for the full license governing this code. Copyright 2011,2017 <NAME> """ import os import sys impo...
""" Module for making experimental Siamese DNNs for similarity analysis """ import sys import tensorflow as tf from tensorflow import keras from tensorflow.keras import models from tensorflow.keras import layers from ModelUtils import * from FuncModelMaker import FuncModelFactory #LOSS FUNCTIONS register = ker...
"""Training GNMT for WMT16 Dataset This implements the Machine Translation task 4b see https://mlbench.readthedocs.io/en/latest/benchmark-tasks.html#a-lstm-wmt16-en-de for more details. Model and training taken from https://github.com/mlperf/training_results_v0.6/tree/master/NVIDIA/benchmarks/gnmt""" import argparse ...
""" - Author: DiheChen - Date: 2021-08-31 19:45:30 - LastEditTime: 2021-09-27 00:23:06 - LastEditors: DiheChen - Description: None - GitHub: https://github.com/Chendihe4975 """ from asyncio import sleep from collections import Counter from os import mkdir, path from random import choice, random from typing import...
import logging import re from pathlib import Path from typing import List, Union import pandas as pd from kmbio.PDB import Structure from kmtools import structure_tools, system_tools from kmtools.structure_tools.types import DomainMutation as Mutation from elaspic2.core.utils import features_to_differences from elasp...
#!/usr/bin/env python ############### # @file geometry2D.py # @author <NAME> # @date 1/24/08 # # @brief Some basic geometry tools ############### __cvs_id__ = "$Id: geometry2D.py,v 1.3 2008-01-25 00:21:53 dapple Exp $" ############### import numpy from math import sqrt import unittest ##############################...
""" @author: <NAME> @copyright: Copyright 2019, supervised-translation @license: MIT @email: <EMAIL> @date: 2019.04.04. """ # pylint: disable=import-error import torch import requests import shutil import os import random import json import sentencepiece as spm from collate import padded_collate from...
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- """Noteboo...
from flycatcher.downloader import Downloader from datetime import datetime from setup import ROOT_DIR import argparse import calendar import logging import os import pickle class RyanairDownloader(Downloader): API_ENDPOINT = 'https://api.ryanair.com/farefinder/3/roundTripFares' HEADERS = { 'Accept': '...
# -*- coding: utf-8 -*- import os from functools import partial import numpy as np import matplotlib.pyplot as plt from scipy.optimize import curve_fit, leastsq from scipy.signal import find_peaks, savgol_filter def get_file_list(dir_path, target_file_list=None): if target_file_list is None: target_file_...
import pandas as pd import numpy as np from tqdm.auto import tqdm from collections import Counter from sklearn.preprocessing import MultiLabelBinarizer from efficient_apriori import apriori as apr class CrowdTruth: def __init__(self, df=None, turk_json=None, turk_labels_j=None): if df is not None: ...
from __future__ import print_function import os import argparse import torch import torch.nn as nn import torch.nn.functional as F import torchvision import torch.optim as optim from torchvision import datasets, transforms from torch.utils.tensorboard import SummaryWriter from models.wideresnet import * from models.res...
__copyright__ = "Copyright (C) 2019 <NAME>" __license__ = """ 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, modif...
import os import numpy as np from .plot import Plot, Dashboard, TwoAxesPlot class StatePlot(Plot): def plot_outcome(self, outcome, *_): t = np.arange(len(outcome)) N = outcome.population_size # rates s = np.array([s.susceptible for s in outcome]) / N e = np.array([s.exp...
from functools import partial from django.conf import settings from datetime import timedelta from importlib import import_module from django.db.models import F, Func, Q, Max, Min from psycopg2.extras import DateTimeTZRange from apps.common.models import Property, Topic, TimeSlots, Process from apps.common.util.util i...
# -*- coding: utf-8 -*- """ The core Pipewelder API. """ from __future__ import print_function import re import os import logging import hashlib from copy import deepcopy from datetime import datetime, timedelta from pipewelder import translator from boto import connect_s3 from boto.s3.key import Key as S3Key from ...
#!/usr/bin/python3 import re import os from common import ( constants, cli_helpers, plugin_yaml, ) from common.searchtools import ( SearchDef, SequenceSearchDef, FileSearcher, ) from common.utils import mktemp_dump from openstack_common import OpenstackChecksBase CONFIG = {"nova": [{"path": o...
#!/usr/bin/env python # # Copyright 2016 The IskipTests 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 appl...
import re from address_extractor import ( unit_type, zipcode, street_direction, street_type, cities, ) class InvalidAddressError(Exception): pass class Address(object): def __init__(self, tokens): self.tokens = tuple(self._clean_tokens(tokens[:11])) self.street_number_ind...
import sys sys.dont_write_bytecode = True # No '*.pyc' precompiled files from rich import print import re from time import ctime from socket import gaierror, gethostbyname, gethostbyaddr from netaddr import IPAddress from scapy.all import ICMP, IP, sr, srp, TCP, Ether, ARP from lib_lan import validate_subnet, valida...
import logging import sh, os, subprocess import json import StringIO import traceback import sys import PblAnalytics from PblCommand import PblCommand from PblProjectCreator import requires_project_dir from LibPebblesCommand import (NoCompilerException, BuildErrorException, AppTooBigExc...
#!/usr/bin/python3 from argparse import ArgumentParser from os import getcwd from pathlib import Path from pprint import pprint from InquirerPy import inquirer from InquirerPy.base import Choice from .git import ( get_extra_gitconfig_file, gitconfig_parse_repotags, gitconfig_add, gitconfig_remove, ) fr...
# coding: utf-8 from systemtools.basics import * from systemtools.location import * from systemtools.system import * from systemtools.file import * from systemtools.logger import log, logInfo, logWarning, logError, Logger from sklearn.tree import DecisionTreeClassifier from sklearn.model_selection import cross_val_sco...
import os from flask import Flask, render_template, flash, redirect, url_for, request, send_from_directory, session from flask_wtf.csrf import validate_csrf from wtforms import ValidationError from flask_ckeditor import CKEditor from flask_dropzone import Dropzone from forms import LoginForm, FortyTwoForm, UploadForm, ...
import argparse import sys import logging import os import csv class ReadItem: def __init__(self, sequence, totalCount): self.Sequence = sequence self.TotalCount = totalCount self.SampleMap = {} class AnnotationItem: def __init__(self, sequence, totalCount, category, counts): self.Sequence = seque...