text
stringlengths
3.07k
12.6k
req = """Step U must be finished before step R can begin. Step C must be finished before step B can begin. Step A must be finished before step S can begin. Step E must be finished before step O can begin. Step D must be finished before step Z can begin. Step L must be finished before step X can begin. Step S must be fi...
import ntpath import os import click import numpy as np import pandas as pd from yaml import dump, load import CosmOrc.gauspar as gauspar import CosmOrc.orpar as orpar from CosmOrc.cospar import Jobs from CosmOrc.reactions import Compound, Reaction, Reaction_COSMO from CosmOrc.generator import Cosmo_Generator try: ...
import os import json import numpy as np import matplotlib.pyplot as plt def compute_iou(box_1, box_2): ''' This function takes a pair of bounding boxes and returns intersection-over- union (IoU) of two bounding boxes. ''' # Find intersection of the two boxes tl_row1, tl_col1, br_row1, br_...
#!/usr/bin/env python import datetime import json import os import subprocess import sys import argparse from prettytable import PrettyTable import requests def add_cli_args(): parser = argparse.ArgumentParser() parser.add_argument('type', choices=["allinone", "allinone-ha", "openlab"...
""" <NAME>, <EMAIL> seoulai.com 2018 """ from typing import Tuple from typing import Dict from typing import List from types import SimpleNamespace from seoulai_gym.envs.checkers.base import Constants from seoulai_gym.envs.checkers.base import DarkPiece from seoulai_gym.envs.checkers.base import LightPiece from seoula...
# usage: python driving_models.py 1 - train the dave-orig model from __future__ import print_function import sys from keras.layers import Convolution2D, Input, Dense, Flatten, Lambda, MaxPooling2D, Dropout from configs import bcolors from data_utils import load_train_data, load_test_data from utils import * def D...
import string import numpy as np from nltk import wordpunct_tokenize from nltk.corpus import stopwords from nltk.stem import PorterStemmer from .utils import print_progress_bar def flatten(captions_list): """ Flatten all the captions into a single list """ caption_list = [ caption for captions in cap...
#!/usr/bin/env python3 # # Copyright 2014 <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 ag...
# encoding: utf-8 '''🐱 PDS GitHub Utilities: Python Version determination''' import logging, os, packaging.version, re, sys, subprocess _logger = logging.getLogger(__name__) _detectives = set() # Classes # ------- class NoVersionDetectedError(ValueError): '''😦 Raised when we cannot detect a version from ...
# Copyright 2016-2021 <NAME>, 43ravens # 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 wri...
import time import fnmatch import warnings import logging import numpy as np import gi gi.require_version('Gst', '1.0') gi.require_version("GstApp", "1.0") gi.require_version('GstVideo', '1.0') from gi.repository import Gst, GstApp, GLib, GObject, GstVideo class GStream: _inited = False @classmethod def ...
#!/usr/bin/env python3 import fileinput import os from dataclasses import dataclass from distutils.util import strtobool from typing import Callable from typing import Iterable from typing import List from typing import NamedTuple from typing import Optional from typing import Tuple class Step(NamedTuple): direct...
# Copyright (c) 2021 Sony 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 applicabl...
#!/usr/bin/env python3 # # SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD # SPDX-License-Identifier: Apache-2.0 import json import os import shutil import time import gitlab import requests from git import Git, Repo def pr_check_forbidden_files(pr_files_url): print("Checking if PR modified for...
import pandas as pd import numpy as np import os import shutil from pathlib import Path from torch.utils.data import Subset from torchvision.datasets import ImageFolder from torchvision import models, transforms import matplotlib.pyplot as plt from sklearn.model_selection import train_test_split from sklearn.utils.rand...
# Copyright (C) 2021 Cancer Care Associates # 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 ...
# -*- coding: utf-8 -*- """WAVE DPCTF QR code decoder Translates the detected QR codes into the different QR codes type. DPCTF specific QR codes - MezzanineDecodedQr, TestStatusDecodedQr and PreTestDecodedQr The Software is provided to you by the Licensor under the License, as defined below, subject to the following ...
""" Project: RadarBook File: ovals_of_cassini_example.py Created by: <NAME> On: 7/2/2018 Created with: PyCharm Copyright (C) 2019 Artech House (<EMAIL>) This file is part of Introduction to Radar Using Python and MATLAB and can not be copied and/or distributed without the express permission of Artech House. """ import...
# Copyright 2009-2015 Eucalyptus Systems, Inc. # # Redistribution and use of this software in source and binary forms, # with or without modification, are permitted provided that the following # conditions are met: # # Redistributions of source code must retain the above copyright notice, # this list of conditions ...
__all__ = ["set_node_attributes", "set_edge_attributes"] def set_node_attributes(G, values, name=None): """PORTED FROM NETWORKX Sets node attributes from a given value or dictionary of values. .. Warning:: The call order of arguments `values` and `name` switched between v1.x & v2.x. ...
#!/usr/bin/env python """Script to extract ResNet features from video frames.""" import argparse import h5py from overrides import overrides import torch import torch.nn import torch.utils.data import torchvision from tqdm import tqdm from c3d import C3D from i3d import I3D from dataset import SarcasmDataset # noins...
import datetime import os import re from peewee import * # noqa current_location = os.path.dirname(os.path.abspath(__file__)) file_location = os.path.join(current_location, 'database.db') # noqa, is added after peewee related lines so it does not give a # flake8 error. db = SqliteDatabase(file_location) # noqa clas...
# import dependences import streamlit as st import librosa import csv import os import numpy as np import pandas as pd from PIL import Image from keras.models import load_model from sklearn.preprocessing import StandardScaler from sklearn.preprocessing import LabelEncoder # save sound file, uploaded before, in a fol...
################################################################# # readLogs.py # # Reads the LCM EventLogs, and can be modified to plot various # relevant data. ################################################################# import lcm from sys import argv from datetime import datetime from planeDataT import vicon...
import torch import pandas as pd import numpy as np import matplotlib.pyplot as plt from tqdm import trange from itertools import combinations class NSGA2: # based on implementation from https://github.com/haris989/NSGA-II/blob/master/NSGA%20II.py # NSGA2 is configured to always minimize (with 0 being optima...
import numpy as np from ..tools.utils import update_dict from .scatters import scatters, save_fig from .ezplots import plot_X, zscatter from .utils import map2color from ..prediction.utils import interp_second_derivative, interp_curvature, kneedle_difference from ..utils import normalize, denormalize def least_actio...
""" Labeled square matrix format (:mod:`skbio.io.format.lsmat`) =========================================================== .. currentmodule:: skbio.io.format.lsmat The labeled square matrix file format (``lsmat``) stores numeric square matrix data relating a set of objects along each axis. The format also stores ide...
#!/usr/bin/env python from bs4 import BeautifulSoup import img2pdf from md2pdf.core import md2pdf import os import requests import shutil import sys import json import argparse def get_arguments(): parser = argparse.ArgumentParser( description='Download documents/text from scribd.com') parser.add_ar...
#!/usr/bin/env python # encoding: utf-8 # # Copyright (c) 2014 <EMAIL> # # MIT Licence. See http://opensource.org/licenses/MIT # # Created on 2014-02-24 # """Script to update exchange rates in the background.""" from __future__ import print_function import logging from itertools import zip_longest from multiprocess...
# -*- coding: utf-8 -*- # Standard Library from random import choice, getrandbits, randint, sample, shuffle, uniform class PetMaker: def __init__(self, name, modifier, petname_list): self.name = name self.modifier = modifier self.make_name() index = petname_list.index(name) ...
import pandas as pd import tushare as ts from StockAnalysisSystem.core.config import TS_TOKEN from StockAnalysisSystem.core.Utility.common import * from StockAnalysisSystem.core.Utility.time_utility import * from StockAnalysisSystem.core.Utility.CollectorUtility import * FIELDS = { 'Stockholder.Repurchase': { ...
import json import os.path import logging import pydnsbl import tldextract import numpy as np from concurrent.futures import ThreadPoolExecutor __location__ = os.path.realpath(os.path.join(os.getcwd(), os.path.dirname(__file__))) #TODO combine with Label class class LabelFiles: """ Class that takes two files with ...
import tensorflow as tf from tensorflow.keras import Input, Model from tensorflow.keras.layers import Activation, Add, BatchNormalization, Conv2D, Dense, Dropout, Layer, Multiply, Concatenate from src.layers import Mean, Max, Expand, Squeeze def get_particle_net(num_constituents, num_globals, num_points, config): ...
import re import time import json import logging import argparse import datetime import logging.config import dateutil.parser import googleapiclient.errors import googleapiclient.discovery log = logging.getLogger('snapshooter') LOG_FORMAT = '[%(asctime)s] %(name)s:%(levelname)s: %(message)s' def main(): parser ...
# Copyright (c) 2019, NVIDIA CORPORATION. # 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 i...
from SettingsList import setting_infos, setting_map, get_setting_info from Utils import data_path import sys import json tab_keys = ['text', 'app_type'] section_keys = ['text', 'is_colors', 'is_sfx', 'col_span', 'row_span', 'subheader'] setting_keys = ['hide_when_disabled', 'min', 'max', 'size', 'max_length', 'fi...
__all__ = ['process_annotations', 'get_annotations', 'upload_annotation', 'upload_statement_annotation', 'statement_to_annotations'] import logging import requests from indra.config import get_config from .processor import HypothesisProcessor from .annotator import statement_to_annotations logger = logging...
import numpy as np import os import sys import argparse import glob import time import _init_paths from units import SClassifier, AverageMeter, convert_secs2time import caffe import scipy.io as sio def load_txt(xfile): img_files = [] labels = [] for line in open(xfile): line = line.strip('\n').split(' ') ...
"""Test AFM workshop format""" import pathlib import tempfile import numpy as np import pytest import afmformats data_path = pathlib.Path(__file__).resolve().parent / "data" def test_map_grid(): tf = data_path / "fmt-afm-workshop-fd_mapping_16_2018-08-01_13.07.zip" k = 20 sens = .01e-6 qmap = afmf...
# Copyright 2022 PyQ Development Team # 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 wri...
#!/usr/bin/env python3 # -*-coding:utf-8 -*- # ============================================================================= """ @Author : <NAME> @File : crowdbot_data.py @Date created : 2021/10/26 @Maintainer : <NAME> @Email : <EMAIL> """ # ========================================...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # encoding: utf-8 # Copyright 2014 Orange # # 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 # # Un...
"""Objects used for the AST -> IL phase of the compiler.""" from collections import namedtuple from copy import copy from shivyc.errors import CompilerError class ILCode: """Stores the IL code generated from the AST. commands (List) - The commands recorded. label_num (int) - Unique identifier returned b...
"""ML-Ensemble :author: <NAME> :copyright: 2017-2018 :license: MIT Scikit-learn estimators of computational graph nodes. Estimator classes are full Scikit-learn estimators that can be used in conjunction with other standard estimators. """ from ..parallel import Layer, make_group from ..parallel.base import ParamMixi...
from facenet_pytorch import MTCNN, InceptionResnetV1 import numpy as np from torch.utils.data import DataLoader from torchvision import datasets from torch import nn import torch.nn.functional as F import torch.optim as optim import torch class FaceNet: """ Instantiate InceptionResnet and simple classifie...
# Run parameter sweep over trust-region experiments import random import os from argparse import ArgumentParser from multiprocessing import Pool from tqdm import tqdm # Maps experiment name to envs to loop over EXPERIMENTS = { "DangerousPath": ["DangerousPath-HalfMines-len25-dim5-v0"], } EXPERIMENT_EXTRA_ARGS =...
""" This script creates monoT5 input files by taking corpus, queries and the retrieval run file for the queries and then create files for monoT5 input. Each line in the monoT5 input file follows the format: f'Query: {query} Document: {document} Relevant:\n') """ import argparse import collections import re import s...
import os import time import numpy as np from pyshac.config import hyperparameters as hp, data from pyshac.core import engine np.random.seed(0) def get_branin_hyperparameter_list(): h1 = hp.UniformContinuousHyperParameter('h1', -5.0, 10.0) h2 = hp.UniformContinuousHyperParameter('h2', 0.0, 15.0) return ...
# -*- coding: utf-8 -*- """ Created on 2018-2-6 @author: cheng.li """ from typing import List from typing import Tuple from math import inf import copy from PyFin.api import pyFinAssert class Allocation(object): def __init__(self, code: int, minimum: int = 0, ...
#!@WHICHPYTHON@ """ Driver for interfacing pdb2pqr web form with OPAL SOAP job submission. """ from io import StringIO __date__ = "5 April 2010" __author__ = "<NAME>, <NAME>" __version__ = "1.6" from .src.server import * from .src.hydrogens import * from .src.aconf import * from .src.utilities import * from...
""" This pytest runs IPVC as a command line program and checks the output against the correct stored output Tests can be recorded by adding the "--record <path>" option to IPVC. It records the command itself, the resulting stdout and stderr, and a copy of the repository (cwd) folder before the command and after, store...
from django.shortcuts import render, HttpResponse import random def arrayValues(): ary = [] for i in range(0, 1000, 40): n = random.randint(100, 1000) ary.append(n) return ary def index(request): global arr arr = arrayValues() return render(request, "sorting/index.html", {'arr'...
"""Test tensorpac functions.""" import numpy as np import matplotlib from tensorpac import Pac, EventRelatedPac, PreferredPhase from tensorpac.utils import pac_trivec class TestPac(object): """Tests for Pac, Erpac and Preferred phase.""" def test_id_pac_definition(self): """Test Pac object definitio...
import os import json import shutil import pickle import numpy as np import nibabel as nib from util.util import mkdir from util.image_property import hash_file, slice_with_neighborhood from configurations import SUFFIX def remove_folder_if_exist(folder_path): if os.path.exists(folder_path): shutil.rmtree...
# coding: utf-8 ''' .. code-block:: bash node-doctor <node_name> ''' from datetime import datetime, timedelta import re import sys from hammers import osrest, osapi from hammers.util import base_parser, now_utc, parse_datestr MAINTENANCE_LEASE_REGEX = "^[a-zA-Z0-9\-]+-maintenance$" NODE_AILMENTS_MESSAGES = { ...
import copy import re from django.core.urlresolvers import reverse from django.db import models from django.utils import timezone from autoslug.utils import generate_unique_slug, slugify from django_markdown.models import MarkdownField from ..attachments.models import BaseDocument from ..utils.base import markdown_t...
from abc import ABC, abstractmethod import numpy as np import shapely import shapely.affinity import shapely.geometry from descartes import PolygonPatch from matplotlib.patches import PathPatch from matplotlib.text import TextPath from shapely.geometry import Polygon, Point from src.common import ZORDERS, SHOW_HIT_BO...
import json from collections import OrderedDict from ..ethereum import Method from ..ethereum.evm.opcode import INVALID, RETURN, REVERT from ..ethereum import SolType class RecordManager: """Manage contract method record. Update contract method features and get method feature vector of certain contract. ...
try: import cPickle as pickle except: import pickle from gemben.evaluation import metrics from gemben.utils import evaluation_util, graph_util import networkx as nx import numpy as np def evaluateStaticGraphReconstruction(digraph, graph_embedding, X_stat, node_l=None, fi...
""" Generates a pickle file representing a tileset and the constraints for each tile's 8 neighbor positions """ import argparse from datetime import datetime from model.level import TILE_DIM from model.metatile import Metatile from utils import read_pickle, write_pickle, get_filepath LEFT = (-1, 0) RIGHT = (1, 0) TO...
import ramda as R from ramda.shared import eq def describe_clamp(): def it_clamps_to_the_lower_bound(): eq(R.clamp(1, 10, 0), 1) eq(R.clamp(3, 12, 1), 3) eq(R.clamp(-15, 3, -100), -15) def it_clamps_to_the_upper_bound(): eq(R.clamp(1, 10, 20), 10) eq(R.clamp(3, 12, 23)...
import os from typing import cast import matplotlib.pyplot as plt import pandas as pd import pandera as pa import requests import seaborn as sns from dagster_pandera import pandera_schema_to_dagster_type from pandera.typing import Series # **************************************************************************** #...
import json import re import uuid from datetime import datetime, date import xmltodict from os import path import requests from chalicelib import APP_NAME, APP_VERSION, APP_ARCH_VERSION, helper from chalicelib.boot import ROOT_DIR from chalicelib.config import get_config from chalicelib.database import get_connection...
import warnings import numpy as np import torch import torch.nn.functional as F import torchtuples as tt from pycox.preprocessing.discretization import (make_cuts, IdxDiscUnknownC, _values_if_series, DiscretizeUnknownC, Duration2Idx) class LabelTransform: """ Defining time intervals (`cuts`) needed for the...
from clubs.models import Club, FinancialStatementFact, FinancialStatementLine from rest_framework import viewsets, permissions from .searilizers import ClubSerializer, FinancialStatementFactSerializer, FinancialStatementLineSerializer from rest_framework.decorators import action from rest_framework.response import Resp...
# A part of NonVisual Desktop Access (NVDA) # Copyright (C) 2014-2022 NV Access Limited # This file is covered by the GNU General Public License. # See the file COPYING for more details. """Utilities for working with the Windows Ease of Access Center. """ from buildVersion import version_year from enum import Enum, I...
########################################################################### # # Copyright 2020 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 # # https://www.apache.org/l...
import numpy as np import hyperspy.api as hs from skimage.transform import hough_line, hough_line_peaks, probabilistic_hough_line from skimage.feature import canny import matplotlib.pyplot as plt def Find_number(string): '''Pulls the number out from between xmp flags.''' start = string.find('>') + 1 fini...
#!/usr/bin/env python # encoding: utf-8 """ string.py string utility """ import re import datetime # douban-utils copy begin. # follow code block were copy from douban-utils (https://github.com/douban/douban-utils) def trunc_utf8(string, num, etc="..."): """truncate a utf-8 string, show as num chars. arg...
from pytti import * import pytti import math import torch from torch import nn from torch.nn import functional as F import kornia.augmentation as K PADDING_MODES = {'mirror':'reflect','smear':'replicate','wrap':'circular','black':'constant'} def sinc(x): return torch.where(x != 0, torch.sin(math.pi * x) / (math.p...
import matplotlib.pyplot as plt import matplotlib.dates as mpldates from datetime import datetime from floodsystem.analysis import polyfit from .flood import flood_risk, increase_rate import numpy as np import matplotlib.patches as mpatches def plot_water_levels(station_levels_list): '''plots water level data and ...
import math import random from shapely.geometry.point import Point from simpleai.search import SearchProblem from truthsayer.poly import generate_random def rotateAboutPoint(ox, oy, px, py, angle): nx = ox + math.cos(angle)*(px-ox)-math.sin(angle)*(py-oy) ny = oy + math.sin(angle)*(px-ox)+math.cos(angle)*(...
import io import os import subprocess import sys import pytest import numpy as np from conftest import here is_py2 = sys.version_info[0] == 2 try: import nbformat jupyter_installed = True except ImportError: jupyter_installed = False ene_path = os.path.join(here, '..', 'tutorial', 'Austrian_energy_syst...
import datetime import errno import os import random import string import sys import uuid from django.core.files.storage import DefaultStorage from django.utils import timezone from PIL import Image, ImageDraw DEFAULT_STRING_LENGTH = 8 DECIMAL_TEMPLATE = "%%d.%%0%dd" EMAIL_TEMPLATE = "%s%%d@%s" DATETIME_TEMPLATE = ...
import requests import aiohttp import simdjson as json from lazyops.utils import timed_cache from lazyops.serializers import async_cache from ._base import lazyclass, dataclass, List, Union, Any, Dict from .tfserving_pb2 import TFSModelConfig, TFSConfig jparser = json.Parser() @lazyclass @dataclass class TFSRequest...
# -*- coding: utf-8 -*- # # Copyright 2020 Data61, CSIRO # # 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...
# Custom profile override import os import pathlib import re import subprocess import tempfile import git from addict import Dict import importlib.util from thop import profile as th_profile import contextlib MAESTRO_ENV_KEY = "USE_MAESTRO" def set_maestro(on_off: bool): os.environ[MAESTRO_ENV_KEY] = "1" if on_o...
#!/usr/bin/python3 import sys import json from textwrap import fill from optparse import OptionParser class map_node: def __init__(self): self.name = '' self.content = '' self.solutions = list() self.evidence = list() self.deps = set() class dot_map: def __init__(self):...
#! /usr/bin/env python ############################################################################## ## DendroPy Phylogenetic Computing Library. ## ## Copyright 2010-2015 <NAME> and <NAME>. ## All rights reserved. ## ## See "LICENSE.rst" for terms and conditions of usage. ## ## If you use this work or any portio...
from django.urls import reverse from django.db import models from django.contrib.auth.models import User from django.db.models.signals import post_save from django.dispatch import receiver #from __future__ import unicode_literals from django.db import models from django.core.validators import RegexValidator ...
# ---------------------------------------------------------------------------- # Copyright (c) 2016-2018, QIIME 2 development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE, distributed with this software. # ------------------------------------------------...
""" Run dash app to view fmriprep qc images Modified from https://github.com/SIMEXP/fmriprep-qc Modified by: <NAME> """ import argparse import dash import dash_core_components as dcc import dash_html_components as html from dash_extensions import Keyboard import flask import glob import os import re def build_app...
import argparse import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torchvision import datasets, transforms import pytorch_warmup as warmup import os class Net(nn.Module): def __init__(self): super(Net, self).__init__() self.conv1 = nn.Conv2d(1, 20,...
# -*- coding: utf-8 -*- import threading import time import rospy from drivers.sds011 import SDS011_MODEL, MOBILE_GPS import json import cgi #import nacl.signing import copy import hashlib from stations import IStation, StationData, Measurement, STATION_VERSION from http.server import BaseHTTPRequestHandler, HTTPServ...
# -*- coding: utf-8 -*- """Here we test the programs. @author: <NAME>. Department of Aerodynamics Faculty of Aerospace Engineering TU Delft, Delft, Netherlands """ import sys if './' not in sys.path: sys.path.append('./') from root.config.main import * from objects.CSCG._3d.__tests__.unitt...
""" LabFuncs.py - Version 1 - 27/01/2017 Module for calculating the velocity of a lab on the Earth as a function of time. Based on code provided by <NAME>. Author: <NAME> Email: <EMAIL> """ import numpy as np from numpy import cos, sin, pi, floor #----Parameter definitions---- vv_earthrev = 29.8 eccentricity = 0....
# Copyright (c) 2019 Dubalu LLC # Copyright (c) 2017 Elasticsearch # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to you unde...
import logging class NullHandler(logging.Handler): def emit(self, record): pass log = logging.getLogger('MoteDataPages') log.setLevel(logging.ERROR) log.addHandler(NullHandler()) import time import datetime import random from dustWeb import web import threading import copy import json from...
# -*- coding: utf-8 -*- """ Created on Mon Mar 23 15:30:58 2020 @author: Mohan """ import numpy as np import moption.options as options from scipy.stats import norm def div_adj(option): return np.exp(-option.q*option.t) def vol_adj(option): return option.sigma*np.sqrt(option.t) def discount(option): ...
# -*- coding: utf-8 -*- """ aiu.utils ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This module contains functions used to download mementos and TimeMaps and process them. Note: There be dragons here. This code was originally written for a different project. I'm sure it can be improved. """ import os import logging import multip...
""" @author: <NAME> @description : core objects not used to describe a scene """ import math import numpy as np import numba from jit.maths import normalize import random # A per-thread fixed memory pool to prevent memory allocation and contains # . pre-allocated arrays # . pre-allocated ray (origin, direction) # . ...
from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.firefox.options import Options from Page import * class Minicursos(Page): def deletar(self): self.logar() self.get(site_url("/trabalhos/submissoes")) try: elem = self....
#!/usr/bin/env python # coding: utf-8 import glob import os import requests from concurrent.futures import ProcessPoolExecutor import pandas as pd from ruamel.yaml import YAML # Path data CSV = "data/citizen-science-projects.csv" DATA = "data/categories" NOT_OK = ":x:" OK = ":white_check_mark:" def read_csv_data():...
import numpy as np np.set_printoptions(suppress=True, precision=4) from tests.unit.fixtures import local_perturbations_model_randomized from experiments.util import cum_means from experiments.consistency.model_to_distance_info import ( main_fitter, fitted_model_from_true_model, score_sample_with_two_model...
# Lint as: python3 # Copyright 2021 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 ...
import http.client import os import socket import struct import typing import urllib.error from urllib.parse import quote try: import orjson as json except ImportError: import json class Util: class Trim: pass class Increment: def __init__(self, value=None): self.val = va...
import keras.backend as KB import keras.layers as KL ############################################################ # ResNeXt Graph ############################################################ def identity_block(input_tensor, kernel_size, filters, stage, block, cardinality=1, use_bias=True, train_bn=True): """ ...
import os import uuid import boto3 import psycopg2 import pytest from dagster_aws.redshift import FakeRedshiftResource, fake_redshift_resource, redshift_resource from dagster import ModeDefinition, execute_solid, solid from dagster.seven import mock REDSHIFT_ENV = { 'resources': { 'redshift': { ...
# This file is part of the MapProxy project. # Copyright (C) 2010 Omniscale <http://omniscale.de> # # 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...
from datetime import datetime import logging from zentral.contrib.inventory.models import PrincipalUserSource from zentral.utils.certificates import parse_text_dn logger = logging.getLogger("zentral.contrib.osquery.views.utils") def clean_dict(d, keys_to_keep=None): for k, v in list(d.items()): if keys_...