text
stringlengths
3.07k
22.1k
from asyncio import Future import asyncio from asyncio.queues import Queue #import uvloop #asyncio.set_event_loop_policy(uvloop.EventLoopPolicy()) import tensorflow as tf import numpy as np import os import sys import random import time import argparse from collections import deque, defaultdict, namedtuple import scip...
import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from models.policy_net import p_joint_mobilenet from models.joint_resnet_mobilenetv2 import joint_resnet_mobilenetv2 __all__ = ['adamml'] class AdaMML(nn.Module): def __init__(self, policy_net, main_net, num_frames, num_segme...
import logging from collections import OrderedDict import hlt import pprint game = hlt.Game("v20") logging.info("v20 log") def get_notfull_n_empty(ship): result = {} for planet in game_map.all_planets(): if not planet.is_full() and (planet.owner == mybot or not planet.owner): result.setdef...
# --- # jupyter: # jupytext: # formats: py:percent,ipynb # text_representation: # extension: .py # format_name: percent # format_version: '1.3' # jupytext_version: 1.13.6 # kernelspec: # display_name: Python 3 (ipykernel) # language: python # name: python3 # --- # %% imp...
# -*-coding:utf-8-*- import numpy as np import freetype import copy import random import cv2 font_path = '/media/cyoung/000E88CC0009670E/projectCV/chinese_image_text/' \ 'img/Img2TextSequence/data_gen/fonts/Deng.ttf' class put_chinese_text(object): def __init__(self, ttf_path): self._face = f...
#Quick Sort is another sorting algorithm which follows divide and conquer approach. #It requires to chose a pivot, then place all elements smaller than the pivot on the left of the pivot and all elements larger on the right #Then the array is partitioned in the pivot position and the left and right arrays followthe sam...
""" Implementation of the three networks that make up the Talking Heads generative model. """ from collections import OrderedDict import torch import torch.nn as nn from torch.nn import functional as F from .components import ResidualBlock, ResidualBlockDown, ResidualBlockUp, SelfAttention from .adain import adain_di...
#!/opt/conda/envs/ih8life/bin/python # coding: utf-8 import sys import os import json import time from copy import deepcopy import matplotlib.pyplot as plt import numpy as np import cv2 import torch import torch.nn as nn from torch.utils.data import Dataset, DataLoader from torchvision import transforms, models gpu...
import sys import csv import numpy as np import gpflow import os os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID" os.environ["CUDA_VISIBLE_DEVICES"]="0" import pandas as pd import h5py from sklearn.model_selection import train_test_split import tensorflow as tf from scipy.cluster.vq import kmeans tf.set_random_seed(1234) i...
import numpy as np import matplotlib.pyplot as plt import seaborn as sns from scipy import stats from itertools import combinations from statsmodels.stats.multitest import multipletests sns.set() def box_whisker(ax, df, cmap=None, labels=None): if not labels: labels = list(df.columns) ax.set_ylim([0....
import sys import click import numpy as np import tensorflow_probability as tfp import matplotlib.pyplot as plt import seaborn as sns from gpdre import DensityRatioMarginals from sklearn.svm import SVC from sklearn.datasets import make_moons from pathlib import Path # shortcuts tfd = tfp.distributions GOLDEN_RAT...
from losses import f2 from rle import * import numpy as np import pandas as pd import keras.backend as K from keras.callbacks import Callback, TensorBoard """ F2 metric implementation for Keras models. Inspired from this Medium article: https://medium.com/@thongonary/how-to-compute-f1-score-for-each-epoch-in-keras-...
#!/usr/bin/env python '''The ISS program Tracks the ISS and astronauts in space in real time also provides gui for visual tracking of the ISS and specific times the ISS will pass over specific destinations supplied by the user.''' __author__ = '''<NAME> with help from request docs, python turtle ...
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. """Optimization for T5 model""" import logging import torch import torch.nn.functional as F from transformers.configuration_t5 import T5Config from transformers.modeling_auto import MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING from transformers.mode...
# Sample code from http://www.redblobgames.com/pathfinding/ # Copyright 2014 <NAME> <<EMAIL>> # # Feel free to use this code in your own projects, including commercial projects # License: Apache v2.0 <http://www.apache.org/licenses/LICENSE-2.0.html> from collections import deque from math import sqrt from rand...
import sys import csv import logging import collections import itertools import combatlog9 import combatlog12 # Type COMBATLOG_OBJECT_TYPE_MASK = 0x0000FC00 COMBATLOG_OBJECT_TYPE_OBJECT = 0x00004000 COMBATLOG_OBJECT_TYPE_GUARDIAN = 0x00002000 COMBATLOG_OBJECT_TYPE_PET = 0x00001000 COMBATLOG_OBJECT_TYPE_NPC = 0x000008...
import os import pandas as pd from pathlib import Path import datetime import logging import boto3 def traverse_path(path, split_idx): """ Generates a dictionary of the path to each country. Input: path: str. The path to the root directory split_idx: int. split point to capture country nam...
#!/usr/bin/env python3 """Speed Limit -- PyWeek#31 'Cops' -- <NAME> <thp.io>""" # Copyright (c) 2021-04-02 <NAME> <<EMAIL>> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions o...
from functools import wraps import json import inspect from django.db.models import Q from django.http import Http404 from django.http.response import ( HttpResponse, HttpResponseBadRequest, ) from django.shortcuts import ( get_object_or_404, render, ) from django.views.decorators.http import require_h...
# TODO: model import random import copy import typing import warnings warnings.filterwarnings('ignore') # import logging # logging.getLogger('lightning').setLevel(0) import numpy as np from numpy.random.mtrand import normal import torch as T from torch._C import dtype from torch.distributions.normal import Normal nn...
# -*- coding: utf-8 -*- import logging import itertools from functools import partial from typing import List, Dict, Tuple from weakref import WeakValueDictionary from PyQt5.QtCore import Qt, pyqtSignal, QModelIndex, QAbstractItemModel, QSize, QPoint from PyQt5.QtGui import QStandardItem, QStandardItemModel, QMouseEve...
import os import numpy as np import sys import cv2 from tqdm import tqdm img_scale = 1 def mkdir(directory): """Checks whether the directory exists and creates it if necessacy.""" if not os.path.exists(directory): os.makedirs(directory) def nearest(ts, img_list): """given a timestamp, find the nearest timest...
#! python3 import sys import os, os.path import shutil import subprocess import util import archive_bsa import bsarch_bsa import bsa_rules import re import bitflag def PackMod(mod_name, target): script_path = util.GetScriptPath() utilities_path = util.GetUtilitiesPath() bsarch = os.path.join(utilities_path, "bsar...
import vrep from omnimath import * import time class Car: is_stop = False x_real = [0] y_real = [0] x_estm = [0] y_estm = [0] _T = np.eye(4) _period = 0.2 # seconds between odometry update def __init__(self, client_id, car_name, wheel_names, w, l, r): self._next_call = time....
# gui.py from kivy.app import App from kivy.uix.boxlayout import BoxLayout from kivy.uix.button import Button from kivy.uix.textinput import TextInput from kivy.uix.label import Label import brownie from brownie import config, network, DuelPoints, JustaDuel, MockV3Aggregator import numpy as np ERR_MSG = "" card_type ...
from thingy52.uuids import * from thingy52.characteristics import * from enum import Enum from random import randint import binascii class Color(Enum): RED = 1 GREEN = 2 YELLOW = 3 BLUE = 4 PURPLE = 5 CYAN = 6 WHITE = 7 class LedMode(Enum): OFF = 0 CONSTANT = 1 BREATHE = 2 ...
import types import numpy as np import pytest import torch from combine1d.core.cost_function import (get_indices_for_unknown_parameters, get_known_parameters, create_cost_fct, initialise_flowline, ...
# -*- coding: utf-8 -*- import hashlib import json from troposphere.cloudformation import Stack from . import metadata as mtdt from .mate import Template try: import typing except: pass def md5_of_text(text): md5 = hashlib.md5() md5.update(text.encode("utf-8")) return md5.hexdigest() DEFAULT...
from django.shortcuts import render from django.http import HttpResponse, HttpResponseBadRequest, HttpResponseNotFound from django.core.exceptions import ObjectDoesNotExist from .models import RequestCount from sync.models import Road, Schedule from django.utils import timezone from django.contrib.admin.views.decorator...
""" Handles extending search results with scraping. """ from .utils import ( extract_href, read_pronunciation, read_conjugation_pronunciation, read_view_hanja_info, extract_video_urls ) from .request import send_extend_request, send_image_request, send_video_request def _extend_advanced_search_re...
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: MIT-0 import numpy as np import pandas as pd from sklearn.metrics import ( log_loss, fbeta_score, jaccard_score, balanced_accuracy_score, get_scorer, ) from sklearn.model_selection import train_test_spli...
from __future__ import unicode_literals from __future__ import print_function import base64 import json from django.db import models from django.core.exceptions import ImproperlyConfigured from django.core import serializers from django.utils import timezone from django.utils.translation import ugettext_lazy as _ fro...
# python3.7 """Script to prepare dataset in `zip` format.""" import os import io import warnings import argparse import json import zipfile from tqdm import tqdm from packaging import version import torchvision import torchvision.datasets as torch_datasets _ALLOWED_DATASETS = [ 'folder', 'cifar10', 'cifar100', '...
"""Functions for calculating and combining activation probability distributions (APD) APDs are non-parametric probability distributions of the intermediate outputs of a neural network. Currently APDs are modelled as histograms.""" import copy import numpy as np import xarray as xr from littlenet import neural_net as n...
# Import Python libs import sys, os import shutil import tempfile from cStringIO import StringIO # Import Salt libs from saltunittest import TestCase import salt.loader import salt.config from salt.state import State, HighState REQUISITES = ['require', 'require_in', 'use', 'use_in', 'watch', 'watch_in'] OPTS = salt....
#!/usr/bin/env python # -*- coding: utf-8 -*- """Módulo 'validator' de Pydatajson Contiene los métodos para validar el perfil de metadatos de un catálogo. """ from __future__ import unicode_literals, print_function from __future__ import with_statement, absolute_import import logging import os import platform impo...
from __future__ import annotations import os import sys from pathlib import Path from types import TracebackType from typing import TYPE_CHECKING, Any, Callable, List, Optional, Type, Union from sphinx.util.logging import getLogger from sphinx_terraform import get_builder, get_highlighter from sphinx_terraform.i18n ...
''' CS5250 Assignment 4, Scheduling policies simulator Sample skeleton program Input file: input.txt Output files: FCFS.txt RR.txt SRTF.txt SJF.txt ''' import sys import heapq from collections import deque input_file = 'input.txt' class Process: last_scheduled_time = 0 ...
# -*- coding: utf-8 -*- from __future__ import print_function import os import argparse import socket import sys from jasmine.config import Config from jasmine.standalone import JasmineApp from jasmine.ci import CIRunner def begin(): cmd = Command(JasmineApp, CIRunner) cmd.run(sys.argv[1:]) def mkdir_p(pat...
import shutil, os, re import pandas as pd import numpy as np from pandas import DataFrame, Series def getdata1(rawdata): '''提取Id vs. Vg@Vd=5V的测试数据,此数据暂不需要插值''' start = (rawdata['c'] == ' Id vs. Vg@Vd=5V').idxmax() end = (rawdata['b'] == ' Initial Id vs. Vg@Vd=0.1V').idxmax() # rawdata.iloc[start:end] ...
import matplotlib.pyplot as plt import numpy as np import math import pandas as pd import json class ShootParams(): def __init__(self, input_dict): # self.shot_spacing = 6 # self.phone_spacing = 2 # self.num_16_strings = 2 # self.num_24_strings = 4 # self.lead_shots = 2 ...
import json import logging import os from enum import Enum from io import StringIO import yaml from jinja2 import (Environment, FileSystemLoader, TemplateNotFound) from graviteeio_cli.exeptions import GraviteeioError from graviteeio_cli.extensions.jinja_filters import filter_loader from graviteeio_cli.commands.apim.a...
# Copyright 2020 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
import argparse import random import time from os import path, makedirs import numpy as np import torch.nn as nn import torch.utils.data from gurobipy import GRB, LinExpr, Model from sklearn.metrics import balanced_accuracy_score from constraints import ConstraintBuilder from dl2 import dl2lib from dl2.training.super...
import argparse import os import math import ruamel.yaml as yaml import numpy as np import random import time import datetime import json from pathlib import Path import torch import torch.backends.cudnn as cudnn import torch.distributed as dist from models import load_pretrained from models.model_captioning import X...
import math import numpy as np import numpy.matlib import time import uuid import os import sqlite3 import datetime import threading import multiprocessing import time import random import sys sys.path.append("../src/") import plantsKin as pk import baseToolbox as bt from math import pi threaded =...
from data_provider import hist_stock_data, tickers from platforms import sandbox_platform from strategies import dummy_strategy, rolling_mean_strategy import matplotlib import matplotlib.pyplot as plt import numpy as np class adjClose_market_simulator(): """Simulate market """ # Init, load & save stat...
import matplotlib.pyplot as plt import numpy as np import torch import pickle from tqdm import tqdm from boneik import kinematics, solvers, utils, draw, criteria, io from boneik import bvh def create_human_body() -> kinematics.Body: b = kinematics.BodyBuilder() b.add_bone( "torso", "chest", ...
import os import logging from pili.filters import to_bool basedir = os.path.abspath(os.path.dirname(__file__)) class Config: ENVIRONMENT = 'development' SECRET_KEY = os.environ.get('SECRET_KEY') MAX_CONTENT_LENGTH = 16 * 1024 * 1024 # 16 Mb METRICS_URL = '/metrics' # Logging LOG_LEVEL = lo...
from __future__ import print_function import os import subprocess from io import BytesIO import numpy as np from functools import partial import PIL.Image from IPython.display import clear_output, Image, display, HTML import tensorflow as tf img_noise = np.random.uniform(size=(224,224,3)) + 100.0 def load_dependenc...
# -*- coding: utf-8 -*- """High level API for extracting OBO content.""" import logging import os from functools import lru_cache from typing import Iterable, List, Mapping, Optional, Tuple, Union import networkx as nx import pandas as pd from .cache_utils import cached_df, cached_mapping, cached_multidict from .co...
from ply import yacc from plyddl.pddllex import tokens from plyddl.pddl.domain.domain import Domain from plyddl.pddl.domain.requirements import Requirements from plyddl.pddl.domain.types import Type, Variables from plyddl.pddl.predicate import Predicate, PredicateGroup, ConditionGroup, QuantifyGroup, NumericGroup, Grou...
import nibabel as nib import numpy as np import numpy.linalg as npl import random from mpunet.interpolation.linalg import mgrid_to_points, points_to_mgrid from mpunet.interpolation.linalg import get_rotation_matrix def get_pix_dim(nii_image): return nii_image.header["pixdim"][1:4] def get_real_image_size(nii_im...
# -*- coding: utf-8 -*- # dcf # --- # A Python library for generating discounted cashflows. # # Author: sonntagsgesicht, based on a fork of Deutsche Postbank [pbrisk] # Version: 0.7, copyright Sunday, 22 May 2022 # Website: https://github.com/sonntagsgesicht/dcf # License: Apache License 2.0 (see LICENSE file) ...
from imports import * """ Demo script for structure tensor-guided methods: 1. oriented smoothing 2. blended neightbor interpolation Author: <NAME>, Colorado School of Mines Version: 15/05/2013 """ # Amplitude p0 = 0.0 # Linearity p1 = 1.5 # Planarity (3D only) p2 = 1.0 # tpst image samplings #s1 = Sampling(301,0....
import argparse import util as ut import numpy as np import pandas as pd import matplotlib.pyplot as plt from generator import Generator def do_log_scale_binning(dummy_df, base=2): size = dummy_df['size'] max_size = max(size) stop = 0 for j in range(100): if base ** j >= max_size: ...
#!/usr/bin/python # -*- coding: utf-8 -*- import os import random import re import time from datetime import timedelta import keras import numpy as np import tensorflow as tf from gensim.models import word2vec from textcnn_model_v1 import TCNNConfig, TextCNN save_dir = 'checkpoints/textcnn' save_path = os.path.join(...
# -*- coding: utf-8 -*- __author__: str = "<NAME>" __version__: str = "1.0.0" import pyautogui import time import win32api import random import keyboard import configparser import winsound import os import colorama colorama.init() class Color: "ColorText Console" @staticmethod def red(text: str) -> str: ...
from typing import Union, Optional, Dict import torch from allennlp.common import FromParams from allennlp.modules.transformer.transformer_module import TransformerModule from allennlp.modules.transformer.activation_layer import ActivationLayer from allennlp.modules.transformer.self_attention import SelfAttention f...
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ Contains the transofrmation functions for getting from ICRS to CIRS and anything in between (currently that means GCRS) """ from __future__ import (absolute_import, unicode_literals, division, print_funct...
import pandas as pd from multipledispatch import dispatch import matplotlib.pyplot as plt import seaborn as sns def load_and_process(path): # Method Chain 1 (Load data and deal with missing data) df1 = ( pd.read_csv(path )#reads data file from the given path .dropna(axis=0 )#d...
import json import enum from PIL import Image, ImageFont, ImageDraw from noise import pnoise2, snoise2 from noisemaptile import NoiseMapTile from noiserange import NoiseRange class NoiseMapBiome(enum.Enum): OCEAN = 1 SHALLOWS = 2 BEACH = 3 SCORCHED = 4 BARE = 5 TUNDRA = 6 TEMPERATE_DESER...
#exec(open('./boot.py').read(),globals()) import sys import os import uos import machine import time import ujson as json import ubinascii as binascii import socket from umqtt_robust import MQTTClient import config as conf VERSION_MAINPROG = 'V1.03--20191930--set--tcptimeout.py' #VERSION_MAINPROG = 'V...
#!/usr/bin/env python3 import fuzzy from timeit import default_timer as timer from collections import Counter from reader import load_sanctions from dataobjects import NamePart from dataobjects import NameAlias dmeta = fuzzy.DMetaphone() import normalizer def find_noise_words(id_to_name): """ Finds the mos...
from raytracerchallenge_python.matrix import ( Matrix, identity_matrix, NonInvertibleMatrixError) from raytracerchallenge_python.tuple import Tuple from raytracerchallenge_python.helpers import equal import pytest def test_constructing_and_inspecting_a_4x4_matrix(): # Given M = Matrix(1, 2, 3, 4, ...
#!/usr/bin/env python3 # Copyright 2017 <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 applicabl...
from urllib.request import urlopen import json from . import Distributor from ..base import Page class HEB(Distributor): def __init__(self, driver, logger): super().__init__("H.E.B.", driver, logger) self.statusUrl = "https://heb-ecom-covid-vaccine.hebdigital-prd.com/vaccine_locations.json" ...
import math from repartition_experiments.algorithms.utils import * from repartition_experiments.algorithms.policy_remake import compute_zones_remake def shape_to_end_coords(M, A, d=3): ''' M: block shape M=(M1, M2, M3). Example: (500, 500, 500) A: input array shape A=(A1, A2, A3). Example: (3500, 3500, 35...
import torch import random import torch.autograd as autograd import torch.nn as nn import torch.nn.functional as F import os from utils.conf import args, set_random_seed from models.Set2Seq2Seq import ListeningAgent from models.Losses import seq_cross_entropy_loss from preprocesses.DataIterator import PairDataset from...
# (C) Datadog, Inc. 2018-present # All rights reserved # Licensed under Simplified BSD License (see LICENSE) import copy import json import os from collections import defaultdict import mock import pytest from datadog_checks.kafka_consumer import KafkaCheck from datadog_checks.kafka_consumer.legacy_0_10_2 import Lega...
# -*- coding: utf-8 -*- """ @file @brief Shortcut to *tests*. """ import math from ..activities import Notion, QuestionChoice, ActivityGroup def simple_french_qcm(): """ Builds a simple French :epkg:`QCM` about mathématiques. """ math_sixieme = Notion('not-math-1', 'not-math-1', 'fr', ...
import pyglet import pyglet.font import pyglet.text import pyglet.graphics import pyglet.gl as GL from .drag import DragMixin from . import drawtools from .drawable import Drawable, DEBUG_DRAWABLES # TODO automatically wrap drawtools routines (and eventually) static # drawtools things class DrawWrapper(Drawable): ...
# -*- coding: utf-8 -*- """ Utils has nothing to do with models and views. """ import json import math from bson import json_util import string import uuid import base64 import time import random import datetime import os import subprocess import sys from functools import partial import pytz from flask import ses...
from pygame.sprite import * from pygame.locals import * from pygame.mixer import * from math import * from random import randint from enum import Enum from tower import * from towerData import * # definitions class Ground(Sprite): def __init__(self, x, y): Sprite.__init__(self) self.image = load...
from tkinter import * import os.path from tkinter import filedialog from tkinter.filedialog import askopenfilename from PIL import Image import stepic def encode_logic(): msg=message.get() new=newfile.get() try: im=Image.open(c) im1=stepic.encode(im,bytes(msg,'utf-8')) im1.save(fol...
""" This file is used for other modules to access the settings for the application Privex's BGP Neighbour Generator - https://github.com/Privex/neighgen X11 / MIT License **Copyright**:: +===================================================+ | © 2021 Privex Inc. | | ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: © 2021 Massachusetts Institute of Technology. # SPDX-FileCopyrightText: © 2021 <NAME> <<EMAIL>> # NOTICE: authors should document their contributions in concisely in NOTICE # with details inline in source files...
#!/usr/bin/env python3 # Randomized Binary Search Tree # derived from https://qiita.com/drken/items/1b7e6e459c24a83bb7fd import time def dp(*x): # debugprint if RBST.debug: print(*x) def randInt(t=[123456789, 362436069, 521288629, 88675123]): tx, ty, tz, tw = t tt = tx ^ (tx << 11) t[0] =...
from __future__ import print_function import os import sys import time import shutil import logging import datetime import traceback import subprocess import numpy as np from ..core.environ import environ from ..core.logio import get_logger, add_filehandler, splash from .tabular import TabularWriter IOPT = 0 LASTEVAL...
from __future__ import unicode_literals from channels.generic.websocket import WebsocketConsumer import json from django.shortcuts import render, redirect from django.http import HttpResponse, JsonResponse from django.contrib.auth.decorators import login_required from .models import * import re import json import ...
from __future__ import print_function import json import os import re import sys import string entrypoint_information = { 'performanceplatform.collector.ga': { 'credentials': [ ('^gov[-]?uk.*$', 'credentials/ga_govuk.json'), ('^.+$', 'credentials/ga.json')...
import logging import graphene from graphene_django import DjangoObjectType, DjangoConnectionField from graphql_jwt.decorators import login_required from django.db.models import Q from django.db import transaction from django.conf import settings from common import exceptions from common.schema import LoginProvider, ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- #Created on Sat Nov 18 11:15:35 2017 #@author: ryanday #MIT License #Copyright (c) 2018 <NAME> #Permission is hereby granted, free of charge, to any person obtaining a copy #of this software and associated documentation files (the "Software"), to deal #in the Software...
""" @package ctiOS.helpers @brief Base script for general classes needed for ctiOS service Classes: - ctiOS::CtiOSXMLParser - ctiOS::CtiOSCounter - ctiOS::CtiOSDbManager - ctiOS::CtiOSXml2DbConverter (C) 2021 <NAME> <EMAIL> This library is free under the MIT License. """ import re import json import sqlite3 fr...
''' Description: In User Settings Edit Author: Qianen Date: 2021-09-11 16:54:20 LastEditTime: 2021-09-14 18:25:34 LastEditors: Qianen ''' import os import trimesh import numpy as np from .face import Face from .point import FacePoint from .contact import Contact class MeshBase(object): ''' 基础的网格文件类,用以保存原始数据 '...
# -*- coding: utf-8 -*- ############################################################################ # # Copyright © 2008, 2009, 2010, 2011, 2012, 2013, 2014 OnlineGroups.net and # Contributors. All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy ...
import math import random from DataRW import dataReader import BackPropagation as BP def optimize_ANN(data, iterations, pop_size, selection_rate, accuracy_weight, efficiency_weight, benchmark): population = init_population(pop_size) mutation_rate = 1.0 for i in range(iterations): print("TESTING...
#Import Libraries import requests from bs4 import BeautifulSoup import pandas as pd import re from datetime import datetime import streamlit as st #Class for getting company background informantion class CompanyGetter(): def get_html(url): response = requests.get(url) if not response.ok: ...
# Functions to install files on all nodes. import os import binascii from ZeekControl import util from ZeekControl import config # In all paths given in this file, ${<option>} will replaced with the value of # the corresponding configuration option. # Directories/files in form (path, mirror, optional) which are syn...
# -*- coding: utf-8 -*- """ Code for specific factors model Created on Mon Oct 3 2019 16 08:57:01 2019 @author: jconning """ import numpy as np from scipy.optimize import fsolve, minimize np.seterr(divide='ignore', invalid='ignore') import matplotlib.pyplot as plt from ipywidgets import interact, fixed import seabo...
''' Testing trackvis module ''' from StringIO import StringIO import numpy as np from .. import trackvis as tv from nose.tools import assert_true, assert_false, assert_equal, assert_raises from numpy.testing import assert_array_equal, assert_array_almost_equal from ..testing import parametric @parametric def te...
# 547,26 - 628,51 # 27*26 # Skill name size 216*21 # it appears those dimensions cause some slight shifting # Skill 1: 413, 94 # Skill 2: 413, 144 # Skill 3: 413, 194 -> Jewels were not removed # Level Size: 12 * 21 # Level 1: 618, 117 # Level 2: 618, 167 # Level 3: 618, 217 -> Jewels were not removed from .Charm im...
# Copyright (c) 2021 Cisco Systems, Inc. and its affiliates # All rights reserved. import importlib import itertools import os import pkgutil import sys import fixtures import sqlalchemy as sa import testresources models_loaded = False class DatabaseResource(testresources.TestResourceManager): """Test resource...
# Copyright 2020 Google LLC, <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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in w...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Copyright 2018 Open Energy Efficiency, 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/LICE...
import numpy as np import scipy.stats as stats import pandas as pd import loter.pipeline as lt import loter.initparam as initparam import loter.initdata as initdata import loter.opti as opti import loter.estimatea as esta import loter.estimateh as esth import loter.graph as ests ######################################...
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.common.exceptions import TimeoutException from selenium.webdriver.common.action_chains import ActionChains from selenium.webdriver.support.ui import...
import nltk import numpy as np from collections import namedtuple SemanticElement = namedtuple("SemanticElement", ["element_type", "literal"]) SemanticTuple = namedtuple("SemanticTuple", ["from_node", "to_node", "link", "literal"]) class SLN: def __init__(self, words, construct=False): self.words = words...
import os import sys # go to parent directory script_dir = os.path.dirname(os.path.abspath( __file__ )) par_dir = os.path.join(script_dir, os.pardir) sys.path.append(par_dir) os.chdir(par_dir) import random import numpy as np import time import hpbandster.core.nameserver as hpns import hpbandster.core.result as hpres...
import re from io import BytesIO from fabric.context_managers import hide, settings from fabric.contrib.console import confirm from fabric.contrib.files import sed, append from fabric.decorators import task from fabric.operations import sudo, prompt, get, put from fabdeb.apt import set_apt_repositories, apt_update, apt...