text
stringlengths
1
927k
import enum from dataclasses import dataclass from typing import Dict, List, Optional, Tuple from serde import serde from . import imported @serde @dataclass(unsafe_hash=True) class Int: """ Integer. """ i: int @serde @dataclass(unsafe_hash=True) class Str: """ String. """ s: str...
for count in range(10): print (count + 1)
# -*- coding: utf-8 -*- """ Model definition functions and weight loading. """ from __future__ import print_function, division, unicode_literals from os.path import exists import torch import torch.nn as nn from torch.autograd import Variable from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence, ...
# nlantau, 2021-01-17 INT_MIN=-32422 def cut_log(p,n): r = [0 for _ in range(n+1)] r[0] = 0 for j in range(1,n+1): q = INT_MIN for i in range(1,j+1): q = max(q, p[i] + r[j-i]) r[j] = q return r[n] # Clever solutions def cl(p,n): l = [0] for _ in range(n)...
import falcon import json import mysql.connector import config from datetime import datetime, timedelta, timezone class WechatMessageCollection(object): @staticmethod def on_options(req, resp, startdate, enddate): resp.status = falcon.HTTP_200 @staticmethod def on_get(req, resp, startdate, e...
import random import string # length of password length = int(input('\nEnter the length of password: ')) # define characters for making password lower = string.ascii_lowercase upper = string.ascii_uppercase num = string.digits symbols = string.punctuation all = lower + upper + num + symbols # use random temp = ra...
import inspect from collections.abc import Callable from inspect import Parameter from typing import Optional, TypeVar, Union from fastapi import APIRouter, Depends from starlette.routing import Route, WebSocketRoute from .types import InitializedError from .utils import make_cls_accept_cls_annotated_deps T = TypeVa...
from pal.transform.abstract_transform import AbstractTransform class MakeWriteOnly(AbstractTransform): @property def description(self): d = "removing readable access mechanisms" return d def do_transform(self, reg): readable = [ "mrs_register", "mrs_banked"...
# -*- coding: utf-8 -*- # Generated by Django 1.11.25 on 2019-10-29 17:24 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("core", "0041_jobapplication_output_sent"), ] operations = [ migrations.Add...
# MIT LICENSE # # Copyright 1997 - 2020 by IXIA Keysight # # 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, modify,...
""" A user-facing wrapper around the neural network models for solving the cube. """ import models from typing import Optional class CubeModel: _model = None # type: Optional[models.BaseModel] def __init__(self): pass def load_from_config(self, filepath: Optional[str] = None) -> (): ""...
import asyncio import dataclasses import io import logging import random import time import traceback from typing import Callable, Dict, List, Optional, Tuple, Set from chiavdf import create_discriminant from flax.consensus.constants import ConsensusConstants from flax.consensus.pot_iterations import calculate_sp_ite...
# This file was *autogenerated* from the file RMFE_24.sage from FFTa import * from field_iso import * from FFTpreproc import * from sage.all_cmdline import * # import sage library _sage_const_2 = Integer(2) _sage_const_1 = Integer(1) _sage_const_0 = Integer(0) _sage_const_4 = Integer(4) _sage_const_128 = Integer(128...
# from visdom import Visdom from cctpy import * from ccpty_cuda import * import time import numpy as np VIZ_PORT = 8098 ga32 = GPU_ACCELERATOR() momentum_dispersions = [-0.05, -0.025, 0.0, 0.025, 0.05] particle_number_per_plane_per_dp = 12 particle_number_per_gantry = len(momentum_dispersions) * particle_number_pe...
# coding: utf-8 # Import all the things we need --- #get_ipython().magic(u'matplotlib inline') import os,random #os.environ["KERAS_BACKEND"] = "theano" os.environ["KERAS_BACKEND"] = "tensorflow" #os.environ["THEANO_FLAGS"] = "device=gpu%d"%(1) #disabled because we do not have a hardware GPU import numpy as np from ...
"""Axis network device abstraction.""" import asyncio import async_timeout import axis from axis.configuration import Configuration from axis.errors import Unauthorized from axis.event_stream import OPERATION_INITIALIZED from axis.mqtt import mqtt_json_to_event from axis.streammanager import SIGNAL_PLAYING, STATE_STO...
from flask import Flask, render_template, flash, request from wtforms import Form, TextField, TextAreaField from wtforms import validators, StringField, SubmitField, DateField # App config. DEBUG = True app = Flask(__name__) app.config.from_object(__name__) app.config['SECRET_KEY'] = '7d441f27d441f27567d441f2b6176a' ...
from django.contrib.contenttypes.models import ContentType from django.db.models import F from django.http import JsonResponse from rest_framework import status from rest_framework.generics import ListCreateAPIView, RetrieveUpdateAPIView from rest_framework.views import APIView from api.audit_trail import service as a...
class Elevator: occupancy_limit = 8 def __init__(self, occupants=0): self.floor = 0 if occupants <= Elevator.occupancy_limit: self.occupants = occupants else: self.occupants = Elevator.occupancy_limit print('too many occupants', occupants - Elevator.o...
# -*- coding: utf-8 -*- import os, sys import configparser import warnings # # Look for a global .ini in the current directory. If none is # there, raise an exception and exit. Look for a local .ini # in the same directory. If that isn't present, issue a warning # but carry on and use the global values # global_filepa...
import pytest from nutshell_api.users.models import User from nutshell_api.users.tests.factories import UserFactory @pytest.fixture(autouse=True) def media_storage(settings, tmpdir): settings.MEDIA_ROOT = tmpdir.strpath @pytest.fixture def user() -> User: return UserFactory()
import vespidlib from util import log log("Creating task . . .") task = vespidlib.task_create( executable_pyscript = open("prototype_build_all_start.py", "r").read(), name = "fullbuild_project_main_dev", requirements = {"memory": 0, "cores": 0}, repositories = {"env": {"request": "project_main_dev", "local":...
import sys import prctl # Used to set thread name (visible in htop) import zmq from time import sleep from threading import Thread, Event, current_thread from datetime import datetime from flask import current_app as app from . import zmq_socket_config context = zmq.Context() """ Configure logger """ import logging ...
from marshmallow import Schema, fields, post_load from ap_server.common.models import CreateApModel class CreateApSchema(Schema): wiface = fields.Str(required=True) bridge = fields.Str(required=True) ssid = fields.Str(required=True) virt_prefix = fields.Str(required=True) password = fields.Str() ...
import os import uuid from pathlib import Path from typing import Dict, Iterator, List, Optional import google.auth.exceptions import google.cloud.storage import pytest from determined.common import storage from determined.tensorboard.fetchers.gcs import GCSFetcher from tests.storage import util BUCKET_NAME = "stora...
# Copyright 2020 DeepMind Technologies Limited. 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 ...
#!/usr/bin/env python from distutils.core import setup setup( name="django-boundaryservice", version="0.2.2", description="A reusable system for aggregating and providing API access to regional boundary data.", long_description='See `django-boundaryservice <https://github.com/newsapps/django-boundarys...
# Generated by Django 2.2 on 2020-02-20 15:22 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('posts', '0006_auto_2020022...
log_level = 'INFO' load_from = None resume_from = None dist_params = dict(backend='nccl') workflow = [('train', 1)] checkpoint_config = dict(interval=10) evaluation = dict(interval=10, metric='mAP', key_indicator='AP') optimizer = dict( type='Adam', lr=5e-4, ) optimizer_config = dict(grad_clip=None) # learning...
import roboticstoolbox as rtb # load a model with inertial parameters p560 = rtb.models.DH.Puma560() # remove Coulomb friction p560 = p560.nofriction() # print the kinematic & dynamic parameters p560.printdyn() # simulate motion over 5s with zero torque input d = p560.fdyn(5, p560.qr, dt=0.05) # show the joint ang...
from django import forms from django import template from django.forms import ModelForm from django.template import loader, Context from django.core.context_processors import media as media_processor from djangular.forms import NgFormValidationMixin, NgModelFormMixin from property.models import Property, Borough, Neigh...
from django.contrib import admin from .models import Employer, ContactPerson, Language, Expenses, Vacancy from django.contrib.auth.models import Permission admin.site.register(Permission) @admin.register(Employer, ContactPerson, Language, Expenses, Vacancy) class AuthorAdmin(admin.ModelAdmin): pass
#!/usr/bin/env python from __future__ import print_function from collections import OrderedDict import re # TODO nf-core: Add additional regexes for new tools in process get_software_versions regexes = { '{{ cookiecutter.name }}': ['v_pipeline.txt', r"(\S+)"], 'Nextflow': ['v_nextflow.txt', r"(\S+)"], 'Fas...
from django.apps import AppConfig class AwardzConfig(AppConfig): name = 'awardz'
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
# ws_dual_camera.py # WSmith 12/23/20 # utilize modified module ws_csi_camera for the camera class import cv2 import numpy as np import ws_csi_camera as ws from importlib import reload reload(ws) # ws is under development def display(sensor_mode=ws.S_MODE_3_1280_720_60, dispW=ws.DISP_W_M3_M4_one_half, ...
# -*- coding: utf-8 -*- """ Created on Mon Dec 21 16:44:36 2020 @author: wantysal """ # Standard library import import numpy as np # Local import from mosqito.sound_level_meter.noct_spectrum._getFrequencies import _getFrequencies def _spectrum_smoothing(freqs_in, spec, noct, low_freq, high_freq, freqs_out): """...
import tensorflow as tf from utils import bbox_utils, data_utils, drawing_utils, io_utils, train_utils, landmark_utils import blazeface args = io_utils.handle_args() if args.handle_gpu: io_utils.handle_gpu_compatibility() batch_size = 1 use_custom_images = False custom_image_path = "data/images/" hyper_params = t...
'''Implements a multiprocessing deconvolution algorithm ''' import os import multiprocessing from collections import deque import ms_peak_picker import ms_deisotope import traceback from ms_deisotope.processor import ( ScanProcessor, MSFileLoader, NoIsotopicClustersError, EmptyScanError) from ms_deisotope...
from typing import List from .cart import Cart from .consts import * ROM_BANK_SIZE = 0x4000 RAM_BANK_SIZE = 0x2000 class RAM: def __init__(self, cart: Cart, debug: bool = False) -> None: self.cart = cart self.boot = self.get_boot() self.data = [0] * (0xFFFF + 1) self.debug = debug ...
# Python # Django # Rest Framework from django.contrib.auth.models import User from rest_framework.serializers import ModelSerializer from rest_framework_simplejwt.serializers import TokenObtainPairSerializer # Local class LoginSerializer(TokenObtainPairSerializer): @classmethod def get_token(cls, user): ...
class PresentationSource(DispatcherObject): """ Provides an abstract base for classes that present content from another technology as part of an interoperation scenario. In addition,this class provides static methods for working with these sources,as well as the basic visual-layer presentation architecture. """ def A...
# Copyright 2105 Scalyr 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, so...
class SortedList: """ This is a list object which is sorted. Actually this is not sorted now. Because this is a parent class. """ _list = list() def __init__(self, arg: list or tuple) -> None: try: if type(arg) == list: self._list = arg elif ...
# Licensed under a 3-clause BSD style license - see LICENSE.rst # -*- coding: utf-8 -*- import io import pytest from astropy import units asdf = pytest.importorskip('asdf', minversion='2.0.0') from asdf.tests import helpers def roundtrip_quantity(yaml, quantity): buff = helpers.yaml_to_asdf(yaml) with asdf...
import logging from typing import Union, Dict from crc32c import crc32 logger = logging.getLogger(__name__) def get_modulo_value(experiment, user_id): # type: (str, Union[str, int]) -> int return crc32(str(user_id).encode(), crc32(experiment.encode())) % 100 def match_user_cohort( experiment_config, ...
#! /usr/bin/env python # $Id: test_date.py 4667 2006-07-12 21:40:56Z wiemann $ # Author: David Goodger <goodger@python.org> # Copyright: This module has been placed in the public domain. """ Tests for the misc.py "date" directive. """ from __init__ import DocutilsTestSupport import time def suite(): s = Docuti...
# -*- coding: utf-8 -*- # pragma pylint: disable=unused-argument, no-self-use # (c) Copyright IBM Corp. 2010, 2022. All Rights Reserved. import calendar import logging import json import os import time from resilient_circuits.template_functions import render_json, environment LOG = logging.getLogger(__name__) class J...
"""Template unit tests for scikit-learn estimators.""" import pytest from sklearn.datasets import load_iris import geomstats.backend as gs import geomstats.tests from geomstats.learning._template import ( TemplateClassifier, TemplateEstimator, TemplateTransformer, ) ESTIMATORS = (TemplateClassifier, Temp...
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2019, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
import pymongo from config import DB_CONFIG, DEFAULT_SCORE from db.ISqlHelper import ISqlHelper class MongoHelper(ISqlHelper): def __init__(self): self.client = pymongo.MongoClient(DB_CONFIG['DB_CONNECT_STRING'], connect=False) def init_db(self): self.db = self.client.proxy self.prox...
# -*- coding: utf-8 -*- __author__ = 'aidai_TEC_QA' # -*- date:'2017/8/1 0001' -*- def start_to_realnameauth(): print(u'realname auth')
# -*- coding: utf-8 -*- """ Created on Sun May 16 09:31:53 2021 @author: Muhammad Ayman Ezzat Youmna Magdy Abdullah """ from algorithms import branch_and_bound import timeit import pandas as pd ''' Accuracy Testing ''' LabSpectrum = [97, 97, 99, 101, 103, 196, 198, 198, 200, 202, 295, 297, 29...
import torch import torch.nn as nn import numpy as np import math import scipy.spatial import scipy.ndimage.morphology """ True Positive (真正, TP)预测为正的正样本 True Negative(真负 , TN)预测为负的负样本 False Positive (假正, FP)预测为正的负样本 False Negative(假负 , FN)预测为负的正样本 """ def metrics(predict, label, out_class): """Calculate the re...
''' Re-organize the MMIG model 2021-09-20 ''' import os import sys import time import json import logging import argparse import torch import torch.optim as Optim from torch.autograd import Variable import utils import modules import dataset import metrics # set gpu os.environ["CUDA_VISIBLE_DEVICES"] = '0,...
from numpy import pi from numpy import array from numpy import linspace from numpy import arange from numpy import zeros from numpy import column_stack from numpy import array from time import time from math import radians import cairocffi as cairo from sand import Sand from ..lib.sand_spline import SandSpline from .....
# -*- coding: utf-8 -*- # # ramstk.views.gtk3.pof.panel.py is part of the RAMSTK Project # # All rights reserved. # Copyright since 2007 Doyle "weibullguy" Rowland doyle.rowland <AT> reliaqual <DOT> com """GTK3 PoF Panels.""" # Standard Library Imports from typing import Any, Dict, List # Third Party Imports im...
import logging from flask import Flask import google.cloud.logging from settings import DEBUG from views import * app = Flask(__name__) app.add_url_rule('/', \ view_func=IndexView.as_view('index')) app.add_url_rule('/a_plus_b', \ view_func=APlusBView.as_view('a_plus_b')) if __name__ == '__main_...
from abc import ABCMeta class BaseEstimator(metaclass=ABCMeta): """ Abstract base class for all estimators in scikit-stan. """ def get_params(self, deep=True): """ Parameters ---------- deep Returns ------- """ pass @classmethod...
import re import pytest from django.contrib.auth.models import User from django.test import override_settings from django.urls import reverse from django_dynamic_fixture import get from readthedocs.builds.constants import LATEST from readthedocs.builds.models import Version from readthedocs.projects.models import Pro...
import unittest import re import json import collections from collections import namedtuple import client,api,entities # TODO: # Test multiple get_entities calls # so that the second one uses the cached value # Really - the class factory needs a delegate to call inorder to get # the meta data. THE CLIENT SHOULDN"T N...
import pyvista as pv data = [pv.Sphere(center=(2, 0, 0)), pv.Cube(center=(0, 2, 0)), pv.Cone()] blocks = pv.MultiBlock(data) new_blocks = blocks.copy() len(new_blocks) # Expected: ## 3
# Copyright (c) 2021 PaddlePaddle 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 appli...
import copy import inspect import logging from collections import defaultdict from autogluon.core.constants import AG_ARGS, AG_ARGS_FIT, AG_ARGS_ENSEMBLE, BINARY, MULTICLASS, REGRESSION, SOFTCLASS, QUANTILE from autogluon.core.models import AbstractModel, GreedyWeightedEnsembleModel, StackerEnsembleModel, SimpleWeight...
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/31_text.data.ipynb (unless otherwise specified). __all__ = ['make_vocab', 'TensorText', 'LMTensorText', 'Numericalize', 'LMDataLoader', 'pad_input', 'pad_input_chunk', 'SortedDL', 'TextBlock', 'TextDataLoaders'] # Cell from ..torch_basics import * from ..data...
from textwrap import dedent import dash_cytoscape as cyto import dash_core_components as dcc import dash_html_components as html from .utils import CreateDisplay, PythonSnippet from tutorial import tools, styles examples = { example: tools.load_example( 'tutorial/examples/cytoscape/{}'.format(example) ...
from enum import Enum class Operation(Enum): Create = 1 Retrieve = 2 Update = 3 Delete = 4 Notify = 5 class ResourceType(Enum): container = 3 contentInstance = 4 AE = 1 CSEBase = 5 class cseTypeID(Enum): IN_CSE = 1 MN_CSE = 2 ASN_CSE = 3 class ResponseStatusCode(Enum): ACCEPTED = 1000 OK = 2000 CREATE...
from keras.models import Sequential from keras.layers import Dense, Activation, Dropout, LSTM, Flatten, Embedding, Merge from keras.layers.convolutional import Convolution2D, MaxPooling2D, ZeroPadding2D import h5py def Word2VecModel(embedding_matrix, num_words, embedding_dim, seq_length, dropout_rate): print "Crea...
import os from django.conf import settings import requests def get_packet_file_path(): return os.path.join(settings.PROJECT_ROOT, 'static', settings.SPONSORSHIP_PACKET_FILE) if settings.SPONSORSHIP_PACKET_FILE else None def fetch_packet(): if settings.SPONSORSHIP_PACKET_FILE and settings.SPONSORSHIP_PACKET_UR...
from PySide2 import QtWidgets from mapclientplugins.coordinateframeselectorstep.ui_configuredialog import Ui_ConfigureDialog INVALID_STYLE_SHEET = 'background-color: rgba(239, 0, 0, 50)' DEFAULT_STYLE_SHEET = '' class ConfigureDialog(QtWidgets.QDialog): ''' Configure dialog to present the user with the optio...
# -*- coding: utf-8 -*- """ Created on Sun May 12 20:17:17 2019 @author: syuntoku """ import adsk, re from xml.etree.ElementTree import Element, SubElement from ..utils import utils class Joint: def __init__(self, name, xyz, axis, parent, child, joint_type, upper_limit, lower_limit): """ Attribut...
import os import numpy as np import qutip.settings as qset from qutip.interpolate import Cubic_Spline _cython_path = os.path.dirname(os.path.abspath(__file__)).replace("\\", "/") _include_string = "'"+_cython_path+"/complex_math.pxi'" __all__ = ['BR_Codegen'] class BR_Codegen(object): """ Class for generating...
import os from functools import reduce from pathlib import Path from gzip import GzipFile import json import shutil import numpy as np import nibabel as nb from collections import defaultdict from nipype import logging from nipype.utils.filemanip import makedirs, copyfile from nipype.interfaces.base import ( Base...
from sys import argv script, first, second = argv print "This script is called: ", script print "The first variable is: ", first print "The second variable is: ", second
#!/usr/bin/env python # Licensed under a 3-clause BSD style license - see LICENSE.rst import glob import os import sys import ah_bootstrap from setuptools import setup #A dirty hack to get around some early import/configurations ambiguities if sys.version_info[0] >= 3: import builtins else: import __builtin_...
#! /usr/bin/env python #-*- coding:utf-8 -*- from utils import * import pypinyin py_raw = os.path.join(DATA_RAW_DIR, 'pinyin.txt') _rhy_path = os.path.join(DATA_PROCESSED_DIR, 'rhy_dict.json') ''' Tonal and rhyming reference from: https://baike.baidu.com/item/绝句律诗格律 ''' ''' 类型一 ⊙平平仄仄,⊙仄仄平平。(韵)⊙仄平平仄,平平仄仄平。(韵)...
from scapy.all import * def basic_flows(): flow_numbers = [ #1, #100, #5000, 10000, 50000, 75000, 85000, 95000, #100000 ] for f_n in flow_numbers: pkts = [] rules = [] for i in range(f_n): a, b, c ...
from collections.abc import Iterable from functools import reduce import networkx as nx from tensorflow import keras from tensorflow.python.keras.utils.vis_utils import model_to_dot from deephyper.core.exceptions.nas.space import (InputShapeOfWrongType, NodeAlreadyAdde...
import os from flask import Flask from flask_sqlalchemy import SQLAlchemy # Get base directory base_dir = os.path.abspath(os.path.dirname(__file__)) base_url = '' # Base url app = Flask(__name__) # CONFIG app.config['SECRET_KEY'] = '$tfx37h5kqv*!$4hMfHAvrfEZQFyz0e4r6$49$t3-i0(uN1uwSBQKh!y%6HVnw4n' app.config['SQLALC...
from __future__ import division, print_function import numpy as np from shapely.geometry import Polygon import cv2 from collections import defaultdict from kitti import Calibration def camera_to_lidar(points, r_rect, velo2cam): points_shape = list(points.shape[0:-1]) if points.shape[-1] == 3: point...
""" Utilities for working with the local dataset cache. This file is adapted from the AllenNLP library at https://github.com/allenai/allennlp Copyright by the AllenNLP authors. """ from __future__ import absolute_import, division, print_function, unicode_literals import fnmatch import json import logging import os imp...
# Copyright (c) 2010-2020 OpenStack Foundation # # 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 t...
# -*- coding: utf-8 -*- # # 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 #...
"""Node views Copyright 2015 Archive Analytics Solutions 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 ...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals if __name__ == '__main__': import autopath import argparse import glob import os import xml.dom.minidom import random import sys import multiprocessing import alex.utils.various as various from alex.utils.config import as_proj...
from __future__ import unicode_literals import re class CanonBase: single_verse_re = { 'en': 'v[.]*', 'fr': '[v]{1,2}[.]?\s{0,2}', } def __init__(self, language='en'): self.language = language # We check for books if hasattr(self, 'books'): # We it is ...
import unittest loader = unittest.TestLoader() start_dir = '.' suite = loader.discover(start_dir) runner = unittest.TextTestRunner() runner.run(suite)
#!/usr/bin/python # -*- coding: utf-8 -*- import base64 import json import os import socket import struct import uuid import time from hashlib import md5 as MD5 from binascii import crc32 from random import Random from core.err_code import err_desc_en, err_desc_ch from utils.timeUtil import get_current_time DEBIAN_VE...
import math import numpy as np EPS = 1e-8 class MCTS(): """ This class handles the MCTS tree. """ def __init__(self, game, nnet, args): self.game = game self.nnet = nnet self.args = args self.Qsa = {} # stores Q values for s,a (as defined in the paper) sel...
# 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, ...
# -*- coding: utf-8 -*- # # Copyright 2020 Google LLC. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
from .profile import WhyProfileSession, new_profiling_session __ALL__ = [ WhyProfileSession, new_profiling_session, ]
import tensorflow as tf flags = tf.app.flags '''학습 데이터 경로''' flags.DEFINE_string('train_data_path', 'G:/04_dataset/eye_verification/pair_eye/train', '눈 학습 데이터 경로') flags.DEFINE_string('test_data_path', 'G:/04_dataset/eye_verification/pair_eye/test', ...
default_app_config = 'authmultitoken.apps.AuthMultiTokenConfig'
from __future__ import absolute_import import numpy as np from scipy.stats import pearsonr, spearmanr from scipy import signal from scipy.interpolate import InterpolatedUnivariateSpline def generate_index_distribution(numTrain, numTest, numValidation, params): """ Generates a vector of indices to partition the d...
import os import re from os.path import isfile from pathlib import Path from typing import AnyStr, List, Union, Optional from .dialogue import Dialogue class Subtitle: """ Converting ass to art. :type filepath: Path to a file that contains text in Advanced SubStation Alpha format """ dialog_mask...
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
import threading from bs4 import BeautifulSoup import re import math import json import urllib2 from datetime import datetime import pytz start_time = datetime.utcnow() # convert pixels to coordinates ''' def pixels_to_coordinates(route_no, center_x, center_y): ds = gdal.Open(route_no) # unravel GDAL affine...
_base_ = [ '../_base_/models/mask_rcnn_r50_fpn.py', '../_base_/datasets/coco_instance.py', '../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py' ] norm_cfg = dict(type='GN', num_groups=32, requires_grad=True) model = dict( pretrained=None, backbone=dict( frozen_stages=-1, zero...
import numpy as np import matplotlib.pyplot as plt from scipy import integrate import reslast plt.close("all") # Symmetric network q,a,p,u,c,n,s = reslast.resu("network") # Non-symmetric network qn,an,pn,un,cn,nn,sn = reslast.resu("networknonsym") plt.show()