content
stringlengths
5
1.05M
# coding:utf-8 # -- standard library --------------------------------------------------------- import json import unittest # --Modules to test ----------------------------------------------------------- from VestaService.Report import WorkerReport, TaskReport class UtilsTests(unittest.TestCase): def test_Worke...
#!/usr/bin/env python2.7 # vim : set fileencoding=utf-8 expandtab noai ts=4 sw=4 filetype=python : """ embeddedfactor GmbH 2015 Simple python orchestration with fabric, stitch.datastore and fabtools """ from __future__ import print_function import stitch.datastore from stitch.datastore.utils import resolve from stitch....
# -*- python -*- # This software was produced by NIST, an agency of the U.S. government, # and by statute is not subject to copyright in the United States. # Recipients of this software assume all responsibilities associated # with its operation, modification and maintenance. However, to # facilitate maintenance we as...
import os import numpy as np from datetime import datetime as dt,timedelta import pandas as pd import requests import pickle from scipy.interpolate import interp1d from scipy.ndimage import gaussian_filter as gfilt,gaussian_filter1d as gfilt1d from scipy.ndimage.filters import minimum_filter import matplotlib.dates as...
from tensorflow.keras.layers import Input, Conv2D, MaxPooling2D, AveragePooling2D, concatenate,\ GlobalAveragePooling2D, add, UpSampling2D, Dropout, Activation from tensorflow.keras.models import Model def unet(num_channels, ds=2, lr=1e-4, verbose=0,): inputs = Input((None, None, nu...
from rest_framework.views import APIView from rest_framework.response import Response from rest_framework import status from rest_framework import viewsets from rest_framework.authentication import TokenAuthentication from rest_framework import filters from rest_framework.authtoken.views import ObtainAuthToken from res...
#!/usr/bin/env python """A widget to display changing values in real time as a strip chart Known issues: Matplotlib's defaults present a number of challenges for making a nice strip chart display. Here are manual workarounds for some common problems: - Memory Leak: Matplotlib 1.0.0 has a memory leak in canvas.dr...
# Copyright 2019 Atalaya Tech, 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 applicable law or agreed to in writing, ...
import re from src.detection import Result from src.detection.harness import Harness def check_effective_with_differential_test(testcase: str, normal_outputs: list, suspicious_outputs: list, with_output_info=False): testbed = [] for output in (normal_outputs + suspicious_outputs): testbed.append(outp...
# Copyright (C) 2019-2020 Intel Corporation # # SPDX-License-Identifier: MIT # pylint: disable=unused-import from enum import Enum from io import BytesIO import numpy as np import os import os.path as osp _IMAGE_BACKENDS = Enum("_IMAGE_BACKENDS", ["cv2", "PIL"]) _IMAGE_BACKEND = None try: import cv2 _IMAGE_...
import os, sys import warnings from os.path import join as opj import yaml import numpy as np import random import pathlib import subprocess import torch from torch.utils.data import Subset def save_args(args, odir): if type(args) != dict: args = vars(args) with open(opj(odir,"args.yaml"),mode="w") ...
import hoomd from hoomd.conftest import pickling_check import numpy import pytest @pytest.fixture(scope='session') def polymer_snapshot_factory(device): """Make a snapshot with polymers and distance constraints.""" def make_snapshot(polymer_length=10, N_polymers=10, ...
# GNU MediaGoblin -- federated, autonomous media hosting # Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either versio...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # This file is part of Karesansui. # # Copyright (C) 2012 HDE, Inc. # # 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, incl...
# # @lc app=leetcode id=700 lang=python3 # # [700] Search in a Binary Search Tree # # https://leetcode.com/problems/search-in-a-binary-search-tree/description/ # # algorithms # Easy (73.58%) # Total Accepted: 290.2K # Total Submissions: 394.1K # Testcase Example: '[4,2,7,1,3]\n2' # # You are given the root of a bin...
from typing import Any from convertible.Convert.ExceptionHandler.ConvertException import ConvertException from .Convertible import Convertible class Optional(Convertible): """ A Convertible that will either Convert the argument with the Convertible provided or return None. """ __slots__ = ("convert...
import math a,b,c = map(float,input().split()) d = (b*b) - (4*a*c) if(a==0 or d<0): print("Impossivel calcular") else: d = math.sqrt(d) r1 = (-b + d) / (2*a) r2 = (-b -d) / (2*a) print(f'R1 = {r1:.5f}') print(f'R2 = {r2:.5f}')
from graphviz import Source s = Source.from_file('fboaventuradev_terraform.dot', format='png') s.save(filename='fboaventuradev_tf') s.view()
from colorama import Fore, Style import logging LEVEL_NAMES = ["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"] LEVEL_COLORS = { "DEBUG": Style.DIM, "INFO": '', "WARNING": Fore.YELLOW, "ERROR": Fore.RED, "CRITICAL": Fore.RED } LEVEL_SHOW_LABEL = { "DEBUG": False, "INFO": False, "WARNING...
# -*- coding: utf-8 -*- # # Copyright (c) 2021 VMware, Inc. All Rights Reserved. # SPDX-License-Identifier: BSD-2-Clause """ SPDX document formatting """ # document level strings spdx_version = 'SPDX-2.2' data_license = 'CC0-1.0' spdx_id = 'SPDXRef-DOCUMENT' document_name = 'Tern report for {image_name}' document_co...
# -*- coding: utf-8 -*- """ Created on Sat Mar 28 15:36:42 2020 @author: nikbakht """ #--------------------------------- import tensorflow as tf #import socket GPU_mode = 0 if GPU_mode: num_GPU =0# GPU to use, can be 0, 2 mem_growth = True print('Tensorflow version: ', tf.__version__) gpus = tf.config...
from django.contrib.auth.models import User from django.core.exceptions import ValidationError from django.db import models from django.db.models.signals import post_save from django.dispatch import receiver from hustlers.constants import REGULAR_HUSTLER_PERMISSIONS from hustlers.utils.permission_utils import ( as...
""" 机器学习是关于学习数据集的一些属性并将其应用于新数据。 这就是为什么在机器的普遍做法学习评价的算法是手头上的数据分成两组, 一个是我们所说的训练集上, 我们了解到,我们称之为数据属性和一个测试集 上,我们测试这些属性。 scikit-learn提供了一些标准数据集,例如: 用于分类的 虹膜和数字数据集和波士顿房价回归数据集。 数据集是一个类似字典的对象,它保存有关数据的所有数据和一些元数据。该数据存储在.data成员中,它是一个数组。 在监督问题的情况下,一个或多个响应变量存储在成员中。 有关不同数据集的更多详细信息,请参见 : 数据集加载工具一节。 """
import numpy import theano import theano.tensor as tensor from neural_srl.theano.util import floatX def adadelta(parameters, gradients, rho=0.95, eps=1e-6): """ Reference: ADADELTA: An Adaptive Learning Rate Method, Zeiler 2012. https://arxiv.org/abs/1212.5701 Adapted from the Adadelta implementation...
# -*- coding: utf-8 -*- ''' Often-needed functions when using binet Copyright © 2013-2015 Thomas Unterthiner. Licensed under GPL, version 2 or a later (see LICENSE.rst) ''' from __future__ import print_function from __future__ import unicode_literals from __future__ import division from __future__ import absolute_imp...
coords = [] while True: try: pair = list(map(int, input().split(","))) coords.append(pair) except: break xmin = min([pair[0] for pair in coords]) xmax = max([pair[0] for pair in coords]) ymin = min([pair[1] for pair in coords]) ymax = max([pair[1] for pair in coords]) xd = xmax - xmin ...
from z3 import * npcs = [] biomes = [] class npc(object): def __init__(self, name): self.name = name self.sells = True self.guide = False self._loves = [] self._likes = [] self._dislikes = [] self._hates = [] self.near = {} npcs.append(self) def loves(self, *loves): self._l...
from django.shortcuts import render from .models import Post # Create your views here.
import sys sys.path.insert(0, "multidoc") from multidoc.generate import generate_pybind_documented, generate_cpp_documented if __name__ == "__main__": generate_pybind_documented(api_prefix="docstrings", target_src="../tudatpy") generate_cpp_documented(api_prefix="docstrings", target_src="../tudat")
#!/usr/bin/env python # coding: utf-8 ''' Usage: process_task.py <config_file> process_task.py (--help|--version) Arguments: config_file the path of config_file Options: -h --help show this help message and exit -v --version show version and exit ''' import time import sys import os i...
# -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2017-10-13 00:52 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('core', '0003_auto_20171012_1411'), ] operations = [ migrations.AlterField( ...
VERSION = (0, 10, 0, 'alpha', 1)
from setuptools import setup import httpie_jwt_auth setup( name='httpie-jwt-auth', description='JWTAuth plugin for HTTPie.', long_description=open('README.rst').read().strip(), version=httpie_jwt_auth.__version__, author=httpie_jwt_auth.__author__, author_email='hoatle@teracy.com', license...
import cv2 import numpy as np ''' we can use OpenCV functions to draw different Shaps like line, rectangle, circle etc ''' # Create an image # here i have created an image of 400*400 and having # 3 channels and in OpenCV datatype = uint8 img = np.zeros((400, 400, 3), dtype = 'uint8') a = img.copy() line = cv2.li...
from django.conf.urls import url from demo.views import (Home, QuestionDetail) urlpatterns = [ url(r'^question/(?P<pk>[0-9]+)$', QuestionDetail.as_view(), name="questiondetail"), url(r'^$', Home.as_view(), name="home"), ] from django.conf.urls.static import static, settings urlpatterns = urlpatte...
from machine import Pin from time import ticks_us from time import ticks_diff IR_PIN = 14 timeStart = -1 data = 0 dataBitIndex = 0 irQueue = [ ] pin = None pinIR = None lastData = 0 def onIRPinChange(p): global timeStart, data, dataBitIndex, irQueue, lastData if p.value() == 1: # 1 timeStart = ticks_...
import requests from bs4 import BeautifulSoup def fetch_reddit_posts(): news = [] community = [] media = [] art = [] funny = [] gaming = [] # def get_stories_from_url(url): headers = { 'user-agent': 'the front page/0.0.1' } url = 'https://www.reddit.com/r/news+worldnews+uplifting...
#!/usr/bin/env python # # portable serial port access with python # this is a wrapper module for different platform implementations # # (C) 2017-2017 Kenneth Ceyer <kennethan@nhpcw.com> # this is distributed under # Apache 2.0 <https://www.apache.org/licenses/LICENSE-2.0>
import argparse import socket import datetime import yaml import torch import numpy as np import time import random import math import os import getpass import glob from functools import reduce import operator def pad_with_last_col(matrix, cols): out = [matrix] pad = [matrix[:, [-1]]] * (cols - matrix.size(1)...
# encoding=utf-8 # Project: transfer_cws # Author: xingjunjie # Create Time: 07/11/2017 2:35 PM on PyCharm import argparse from data_utils import load_pre_train, load_vocab, get_processing, Dataset, EvaluateSet import tensorflow as tf import os import pickle import json from utils import get_logger def train_pos(arg...
import datetime import json import os import spotipy from tzlocal import get_localzone class StreamingHistory: def __init__(self, path: str = '.') -> None: self.current_year = datetime.date.today().year self.end = None self.minutes_listened = 0 self.hours_listened = 0 fi...
from typing import Union import scipy.stats as stats from beartype import beartype from UQpy.distributions.baseclass import DistributionContinuous1D class GeneralizedExtreme(DistributionContinuous1D): @beartype def __init__( self, c: Union[None, float, int], loc: Union[None, float, ...
import os import strax import numba import numpy as np export, __all__ = strax.exporter() # (5-10x) faster than np.sort(order=...), as np.sort looks at all fields # TODO: maybe this should be a factory? @export @numba.jit(nopython=True, nogil=True, cache=True) def sort_by_time(x): """Sort pulses by time, then c...
from .TopDownCrawl import main main()
from collections import namedtuple import logging import os import numpy as onp from numpy.testing import assert_allclose import pytest from jax import device_put, disable_jit, grad, jit, random, tree_map import jax.numpy as np import numpyro.distributions as dist from numpyro.infer.hmc_util import ( AdaptWindow...
from datetime import datetime, timedelta import logging import geopandas import movingpandas import pandas import requests from mesa.datacollection import DataCollector from tqdm import tqdm from pyproj import CRS from dpd.modeling.agents.people import Pedestrian, Cyclist, Driver from dpd.werkzeug import WerkzeugThre...
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, with_statement import os import shutil import kaptan import tempfile from .. import config, cli from ..util import tmux from .helpers import TestCase import logging logger = logging.getLogger(__name__) TMUXP_DIR = os.path.join(...
import socket from krgram.utils.bytes import Bytes from krgram.utils.stream import QueueByteStream, IByteStream _debug= True class TCPByteStream(IByteStream): """ Represents a TCP connection as a bidirectional stream (readable/writable) Example usage:: tcpstream = TCPByteStream(host, port) tcpstream.write("...
#********************************************************************** # Copyright 2020 Advanced Micro Devices, 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.o...
from .site_settings import SiteSettingsSerializer
import pygame.mixer from pygame.mixer import Sound from gpiozero import Button from signal import pause pygame.mixer.init() sound_pins = { 2: Sound("test soundeff.wav"), } buttons = [Button(pin) for pin in sound_pins] for button in buttons: sound = sound_pins[button.pin] button.when_pressed = sound.play...
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
"""This file contains code used in "Think Stats", by Allen B. Downey, available from greenteapress.com Copyright 2010 Allen B. Downey License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html """ import math import matplotlib.pyplot as pyplot import myplot import Pmf def NormalPdf(x): """Computes the PDF of x i...
# # Copyright (c) 2019 Juniper Networks, Inc. All rights reserved. # from cfgm_common.exceptions import NoIdError from vnc_api.gen.resource_client import RouteTarget from schema_transformer.resources._resource_base import ResourceBaseST class RouteTargetST(ResourceBaseST): _dict = {} obj_type = 'route_targe...
import os import shutil import tempfile from pathlib import Path from unittest.mock import patch, MagicMock from pipeline.recon.web import WebanalyzeScan, GatherWebTargets from pipeline.tools import tools webanalyze_results = Path(__file__).parent.parent / "data" / "recon-results" / "webanalyze-results" class TestW...
# Signatures from DSGRN import * import sqlite3 def SaveDatabase(filename, data, pg): # print("Save Database") conn = sqlite3.connect(filename) conn.executescript(""" create table if not exists Signatures (ParameterIndex INTEGER PRIMARY KEY, MorseGraphIndex INTEGER); create table if not exists ...
#!/usr/bin/env python # Use Netmiko to change the logging buffer size and to disable console logging # from a file on both pynet-rtr1 and pynet-rtr2. from netmiko import ConnectHandler def main(): # Definition of rtr2. rtr1 = { 'device_type': 'cisco_ios', 'ip': '50.76.53.27', 'use...
from core import Locust, TaskSet, WebLocust, SubLocust, task from exception import InterruptTaskSet, ResponseError, RescheduleTaskImmediately version = "0.6.2"
import sys import tkinter from PIL import Image, ImageTk import threading import time import urllib.request import io import requests import json def show_image(): global item, canvas root = tkinter.Tk() root.attributes('-fullscreen', True) # root.bind('', lambda e: root.destroy()) root.title('...
import pyxel pyxel.init(200, 200) pyxel.cls(7) for i in range(0, 110, 10): pyxel.line(i, 0, 100 + i, 200, 0) pyxel.show()
#!/usr/bin/env python from _menu import *
#!/usr/bin/env python # -*- coding: utf-8 -*- # # @Author: José Sánchez-Gallego (gallegoj@uw.edu) # @Date: 2018-01-16 # @Filename: command.py # @License: BSD 3-clause (http://www.opensource.org/licenses/BSD-3-Clause) # # @Last modified by: José Sánchez-Gallego (gallegoj@uw.edu) # @Last modified time: 2019-04-27 12:35:2...
# The contents of this file are subject to the BitTorrent Open Source License # Version 1.1 (the License). You may not copy or use this file, in either # source code or executable form, except in compliance with the License. You # may obtain a copy of the License at http://www.bittorrent.com/license/. # # Software di...
from decimal import * class DecimalStack(object): def __init__(self, *d): self.data = list(d) def __getitem__(self, id): return self.data[id] def add(self): self.data.append(self.data.pop() + self.data.pop()) def sub(self): self.data.append(0 - (self.data.pop() - sel...
import pytest from ctrlibrary.threatresponse.enrich import enrich_observe_observables from ctrlibrary.core.utils import get_observables from tests.functional.tests.constants import ( MODULE_NAME, CTR_ENTITIES_LIMIT ) @pytest.mark.parametrize( 'observable, observable_type', (('a23-38-112-137.deploy.sta...
from quart import Quart from db import Session from blueprints import auth_blueprint, websockets_blueprint app = Quart(__name__) app.register_blueprint(auth_blueprint) app.register_blueprint(websockets_blueprint) @app.teardown_appcontext async def teardown_db(resp_or_exc): Session.remove() app.run()
def remove_all_occurences(list, remove_value): return None def is_leap(list, remove_value): return None def add(a, b): return None def g(list, remove_value): return None def t(list, remove_value): return None print(2 in [1,2]) def if_funtion(): if 2 in [1,2]: return True print(i...
# -*- coding: utf-8 -*- # @Time : 2017/12/17 12:47 # @Author : Xiaofeifei # @File : evaluation.py from sklearn.metrics import roc_auc_score, average_precision_score, roc_curve, confusion_matrix, precision_recall_curve import numpy as np import matplotlib.pyplot as plt import itertools def auc(y_true, y_pred):...
def args(method): pass def fred(method): breakpoint() args_ = method() # noqa
#!/usr/bin/env python2 """ This is a template file of abt command """ import argparse import abt.cli as cli import abt.rpc_client as client if __name__ == '__main__': parser = argparse.ArgumentParser(prog=cli.progname, description=__doc__.strip()) parser.add_argument('arg1', action='store', help="balabalah")...
from cms.admin.placeholderadmin import PlaceholderAdminMixin from django.contrib import admin from .models import AppTemplate @admin.register(AppTemplate) class AppTemplateAdmin(PlaceholderAdminMixin, admin.ModelAdmin): list_display = ('date', 'title', 'published', ) fieldsets = ( ('', { ...
#Faça um programa que mostre a tabuada de vários números, um de cada vez, #para cada valor digitado pelo usuário. #O programa será interrompido quando o número solicitado for negativo. cont = 1 c = 1 print('\033[37mCaso digite um número negativo o programa será encerrado.\033[m') while True: num = int(input('\033[1...
############################################################################### # Core Python Wrapper for RP1210 dlls ############################################################################### from struct import pack, unpack from ctypes import windll, byref, c_char_p, c_int, c_short, c_long, c_void_p, create_str...
# Beautiful Soup 4で「技評ねこ部通信」を取得 import requests from bs4 import BeautifulSoup r = requests.get('http://gihyo.jp/lifestyle/clip/01/everyday-cat') soup = BeautifulSoup(r.content, 'html.parser') title = soup.title # titleタグの情報を取得 print(type(title)) # オブジェクトの型は Tag 型 # <class 'bs4.element.Tag'> print(title) # タイトルの中...
import FWCore.ParameterSet.Config as cms # Single muon for Wjets isomuons = cms.EDFilter( "MuonSelector", src = cms.InputTag('muons'), cut = cms.string("(isTrackerMuon) && std::abs(eta) < 2.5 && pt > 9.5"+#17. "+ "&& isPFMuon"+ "&& globalTrack.isNonnull"+ ...
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.trial._dist.disttrial}. """ import os import sys from twisted.internet.protocol import Protocol, ProcessProtocol from twisted.internet.defer import fail, gatherResults, maybeDeferred, succeed from twisted.internet.task im...
import numpy as np import tensorflow as tf import keras from keras.datasets import mnist from keras.layers import Dense, Flatten, Dropout from keras.layers import Conv2D, MaxPooling2D from keras.models import Sequential import matplotlib.pylab as plt import load_data as ld from keras.callbacks import TensorBoard tenso...
from hashlib import sha256 from chinilla.types.blockchain_format.sized_bytes import bytes32 def std_hash(b, skip_bytes_conversion: bool = False) -> bytes32: """ The standard hash used in many places. """ if skip_bytes_conversion: return bytes32(sha256(b).digest()) else: return byt...
# -*- coding: utf-8 -*- from gluon.contrib.appconfig import AppConfig myconf = AppConfig(reload=True) db = DAL(myconf.take('db.uri'), pool_size=myconf.take('db.pool_size', cast=int), check_reserved=['all']) dboee = DAL('sqlite://oee.db', pool_size=0, migrate=False) response.generic_patterns = ['*'] if reques...
from unet_stylegan2.unet_stylegan2 import Trainer, StyleGAN2, NanException
# # 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 under the Apache License, Version 2.0 (the # "License"); you may not...
import numpy as np from sklearn.metrics import ( precision_score, recall_score, accuracy_score, f1_score, roc_auc_score, ) from typing import Dict import tensorflow.keras.metrics as metrics from typing import List def get_metrics(y_pred: np.ndarray, y_actual: np.ndarray) -> Dict[str, float]: m...
from collections import defaultdict from datetime import datetime, timedelta import operator from pathlib import Path from pprint import pprint import sys from types import MappingProxyType from zipfile import ZipFile, ZIP_LZMA import django from django.conf import settings from django.contrib.auth import get_user_mod...
import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F import numpy as np import pandas as pd from tqdm import tqdm import os from io import open import hashlib import argparse from transformers import get_linear_schedule_with_warmup from layers import RNNModel, AWDLSTMEncoder,...
import os import sys import shutil import platform print('!!!!!!!!!! WARNING !!!!!!!!!!') print('You should use GenerateADISymlinks instead.') print('To force continue type \'yes\':') if(input() == 'yes'): print('Continuing') else: print('Exiting') sys.exit() env = platform.system() print('OS: ' + env) d...
""" Render service to render previews of materials """ from __future__ import print_function import sys import socket import time import pickle from threading import Thread from panda3d.core import load_prc_file_data, Vec4, Filename, Mat4, Notify from panda3d.core import CS_zup_right, CS_yup_right...
__all__ = ['itur_test', 'ITU_validation_report_test', 'ITU_validation_test', 'examples_test']
import tensorflow.compat.v1 as tf try: from .tokenizer_utils import get_tokenizer except ImportError: from tokenizer_utils import get_tokenizer import json from pathlib import PurePath, Path import cv2 from tqdm import tqdm import glob import random import os import shutil def dump_jsonl(data, output_path, ap...
#!/usr/bin/env python # coding: utf-8 # # mnist-cnn # Let's build a super basic Convolutional Neural Network(CNN) to classify MNIST handwritten digits! We'll be using pytorch to specify and train our network. # ## Setup # In[ ]: import matplotlib.pyplot as plt import numpy as np # In[ ]: import torch import t...
# -*- coding: utf-8 -*- class Node: """ A class to represent the nodes in SCRDR tree """ def __init__(self, condition, conclusion, father = None, exceptChild = None, elseChild = None, cornerstoneCases = [], depth = 0): self.condition = condition self.conclusion = conclusion sel...
import primes import time class Timer(object): def __enter__(self): self.start = time.clock() return self def __exit__(self, exception_type, exception_value, traceback): self.end = time.clock() self.interval = self.end - self.start if __name__ == '__main__': n = 39916801 ...
from .AsynchronousStatus import * from .SynchronousStatus import * from .errors import * __name__ = "danbot-status" __version__ = "0.1.1" __author__ = "VineyS" __license__ = "MIT"
import re import requests import json from AnimusExceptions import * class AnimusGenericLog: ################################ # Description: # Initializer for the AnimusGenericLog object. Pass it a fileName and it will handle # reduction for generic logs. # # Params: # logfile - The...
import base64 import uuid def base64_uuid4(): """ Return a base64 encoded uuid4 """ base64_encoded = base64.urlsafe_b64encode(uuid.uuid4().bytes) base64_encoded = base64_encoded.decode("utf-8") return base64_encoded.rstrip("=")
""" TR 64 specific actions ~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2015 by Benjamin Pannier. :license: Apache 2.0, see LICENSE for more details. """ from .lan import Lan, HostDetails, EthernetInfo, EthernetStatistic from .system import System, SystemInfo, TimeInfo from .wan import Wan, WanLinkInfo, WanLinkProperties...
import numpy as np import gym class DQN: def __init__(self, env_name): self.env = gym.make(env_name) def run(self): play(self.env, zoom=4) test_class = DQN('SpaceInvaders-v0') test_class.run()
''' This agent is a base agent that works under the architecture defined in the documentation. We are using this base agent to implement a lot of different RL algorithms. We will maintain updated this base agent with the goal of keeping the balance between flexibility and comfortability. ''' from .knowled...
import pandas as pd import glob, re, os import click def split_lines(text): text = [' '.join(i.split()) for i in re.split(r'\n{2,}', text)] text = [i for i in text if i] return text def get_num(txt): return int(re.findall(r'\d+', txt)[0]) def get_ref(txt): return int(re.findall(r'\d+', txt)[1]) ...
# -*- coding: utf-8 -*- """ Created on Thu Dec 17 11:35:43 2020 @author: willi """ import re import time import os import numpy as np from . import CodonDictionaries from . import FileParser from . import poi as POI try: from Bio import SeqIO from Bio import Entrez except: print('BioPython is not install...
import numpy as np import gc import time import cv2 class database: def __init__(self, params): self.size = params['db_size'] self.img_scale = params['img_scale'] self.states = np.zeros([self.size,84,84],dtype='uint8') #image dimensions self.actions = np.zeros(self.size,dtype='float32') self.terminals = np....