text
stringlengths
2
999k
#!/usr/bin/env python # -*- coding: utf-8 -*- try: from setuptools import setup except ImportError: from distutils.core import setup import os import re import sys try: import pypandoc readme = pypandoc.convert('README.md', 'rst') except (IOError, ImportError): readme = '' package = 'tapioca_s...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import edward as ed import numpy as np import tensorflow as tf from edward.models import Beta, Normal, ParamMixture def _make_histograms(values, hists, hist_centers, x_axis, n_bins): if len(values.shape) >...
""" Copyright [2009-2017] EMBL-European Bioinformatics Institute Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
import unittest from unittest.mock import call, patch from znail.netem.disciplines import PacketLoss from znail.netem.tc import Tc from znail.ui import app class TestPacketLoss(unittest.TestCase): def setUp(self): tc_clear_patcher = patch.object(Tc, 'clear') self.tc_clear = tc_clear_patcher.star...
from sqlalchemy.exc import SQLAlchemyError class DBError(SQLAlchemyError): def __init__(self, code=None, description=''): code = self.__class__.__name__ if not code else code super(DBError, self).__init__(description) self.description = description self.code = code
#!/usr/bin/python ''' Extract _("...") strings for translation and convert to Qt stringdefs so that they can be picked up by Qt linguist. ''' from __future__ import division,print_function,unicode_literals from subprocess import Popen, PIPE import glob import operator import os import sys OUT_CPP="qt/cubisstrings.cpp"...
from collections import Counter import string import re def normalize_answer(s): """Lower text and remove punctuation, articles and extra whitespace.""" def remove_articles(text): return re.sub(r'\b(a|an|the)\b', ' ', text) def white_space_fix(text): return ' '.join(text.split()) def ...
import numpy as np import pygame import sys ROW_COUNT = 6 COL_COUNT = 7 RED = (255,0,0) YELLOW = (255,255,0) BLUE = (0,0,255) BLACK = (0,0,0) colors = [BLACK, RED, YELLOW] def create_board(): return np.zeros((6, 7)) def drop_piece(board, row, col, piece): board[row][col] = piece def is_valid_column(boa...
import numpy from chainer.backends import cuda from chainer import configuration from chainer import functions from chainer import initializers from chainer import link from chainer.utils import argument from chainer import variable class BatchNormalization(link.Link): """Batch normalization layer on outputs of...
# coding=utf-8 # Copyright 2019 The TensorFlow Datasets Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
#!/usr/bin/python3 from prometheus_client import start_http_server, Gauge, Counter import random import time import subprocess import logging MIN_DELAY_BETWEEN_MEASSUREMENTS_IN_SECONDS = 3600*4 # 4 hours RANDOM_DELAY_FACTOR_IN_SECONDS = 60 * 30 # 30 minutes LATENCY_GAUGE = Gauge('latency', 'Response time in ms') DOW...
from book import Book from book_repository import BookRepository from book_repository_json import BookRepositoryJson if __name__ == "__main__": b1 = Book( "Head First Python", "A Brain-Friendly Guide", ["Paul Barry"], "1491919531", "O'Reilly UK Ltd.", 2016, 4...
import argparse import os import cv2 import cluster from shutil import copyfile from fba.preprocess import Preprocess from fba.searcher import Searcher def initialize(): #TODO: need to fix database indexing # create_database() # index.indexing('images/ori_data', using="db") index.indexing('images/ori_...
import os from setuptools import setup, find_packages base_dir = os.path.dirname(__file__) about = {} with open(os.path.join(base_dir, "gql_checker", "__about__.py")) as f: exec(f.read(), about) with open(os.path.join(base_dir, "README.rst")) as f: long_description = f.read() setup( name=about["__titl...
from typing import Dict, List, Optional, Tuple import aiosqlite from thyme.consensus.block_record import BlockRecord from thyme.types.blockchain_format.sized_bytes import bytes32 from thyme.types.blockchain_format.sub_epoch_summary import SubEpochSummary from thyme.types.header_block import HeaderBlock from thyme.uti...
import os import codecs from django.utils import six from django.conf import settings from django.core.management import BaseCommand from django.core.exceptions import ImproperlyConfigured from djsw_wrapper.core import Swagger from djsw_wrapper.utils import Template from djsw_wrapper.router import SwaggerRouter clas...
#!/usr/bin/env python # -*- coding: utf-8 -*- from argparse import ArgumentParser, FileType import itertools as it import os import mpi4py.rc mpi4py.rc.initialize = False from pyfr.backends import BaseBackend, get_backend from pyfr.inifile import Inifile from pyfr.mpiutil import register_finalize_handler from pyfr.p...
from django import forms from django.utils.safestring import mark_safe from derrida.books.forms import FacetChoiceField, RangeField class InterventionSearchForm(forms.Form): defaults = { 'order_by': 'author' } query = forms.CharField(label='Search', required=False) order_by = forms.ChoiceFie...
# Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the...
import subprocess import sys import setup_util import os from zipfile import ZipFile def start(args): setup_util.replace_text("play-activate-mysql/conf/application.conf", "jdbc:mysql:\/\/.*:3306", "jdbc:mysql://" + args.database_host + ":3306") subprocess.check_call("play clean dist", shell=True, cwd="play-activ...
""" This file is part of the RobDREAM (http://robdream.eu/) deliverable D4.2. The ManipulationOptimizer provides utilizes pySMAC as well as the ManipulationDreamBed to determine the optimal algorithms and respective parameters for a given task within a given context. @author: Joshua Haustein (haust...
from sciapp.action import dataio import numpy as np import os dataio.ReaderManager.add('npy', np.load, 'img') dataio.WriterManager.add('npy', np.save, 'img') dataio.ReaderManager.add('npy', np.load, 'imgs') dataio.WriterManager.add('npy', np.save, 'imgs') class OpenFile(dataio.Reader): title = 'Numpy Open' tag = 'i...
# Copyright 2018 The Bazel 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 applicable la...
import csv import os from lib.result_store.stores.base_store import BaseReader, BaseUploader from env import QuerybookSettings # to use, enable docker volume inside docker-compose.yml # uncomment lines `- file:/opt/store/` # and the 'file' volume code @ bottom # host path (currently '/mnt/querybook-store/') can be cha...
import logging from app import repository_gc_queue, all_queues from data import model, database from workers.queueworker import QueueWorker from util.log import logfile_path logger = logging.getLogger(__name__) POLL_PERIOD_SECONDS = 60 REPOSITORY_GC_TIMEOUT = 60 * 15 # 15 minutes class RepositoryGCWorker(QueueWo...
from sympy import symbols, pi, sin, cos, Float, ImmutableMatrix as Matrix from sympy.physics.vector import ReferenceFrame, Vector, dynamicsymbols, dot from sympy.abc import x, y, z from sympy.testing.pytest import raises Vector.simp = True A = ReferenceFrame('A') def test_Vector(): assert A.x != A.y assert ...
import json # import os import copy import hashlib import time import logging from rest_framework.decorators import api_view # from rest_framework.response import Response from django.http import JsonResponse from nlu.keyword_based.api import get_reply_list logger = logging.getLogger(__name__) default_response = { ...
# urllib3/poolmanager.py # Copyright 2008-2014 Andrey Petrov and contributors (see CONTRIBUTORS.txt) # # This module is part of urllib3 and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php import logging try: # Python 3 from urllib.parse import urljoin except ImportError: ...
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Server.notes' db.add_column(u'servers_server', 'notes', ...
# Create your forms here. from django import forms class CreateForm(forms.Form): domain_id = forms.CharField(required=True, widget=forms.HiddenInput) group_name = forms.CharField(required=True) description = forms.CharField( required=True, widget=forms.Textarea ) group_owner = form...
# --------------------------------------------------------------------------- # # annotations.py # # # # Copyright © 2015-2021, Rajiv Bakulesh Shah, original author. # ...
import os from django import forms from django.contrib.staticfiles.storage import staticfiles_storage from django.db.models import fields from django.db.models.fields import files from six import text_type try: from django.core import checks except ImportError: pass from smartfields.settings import KEEP_ORPHANS fr...
import os, sys, importlib, subprocess, platform, glob, json from konsoru import CLI from konsoru.decorators import parameter OPTION_CONFIG_EXAMPLE = ''' { "data": [ { "module_name": "tkfilebrowser", "system": "Windows", "data": [ { "sr...
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Interface documentation. Maintainer: Itamar Shtull-Trauring """ from __future__ import division, absolute_import from zope.interface import Interface, Attribute from twisted.python import deprecate from twisted.python.versions import Versi...
from utilities import time_it @time_it def linear_search(numbers_list, number_to_find): for idx, number in enumerate(numbers_list): if number == number_to_find: return idx return -1 @time_it def binary_search(numbers_list, number_to_find): left_index = 0 right_index = len(numbers_l...
import re from selenium import webdriver from bs4 import BeautifulSoup as bf def Notas(matricula, senha): driver_path = 'C:\Program Files\Google\Chrome\Application\chromedriver' url = 'https://portalence.ibge.gov.br/gcad-aluno/' chrome_options = webdriver.ChromeOptions() prefs = {"profile.managed_d...
import os from dotenv import load_dotenv from flask import Flask load_dotenv() app = Flask(__name__) app.config.update( REDIS_HOST=os.getenv('REDIS_HOST') or 'localhost', REDIS_PORT=os.getenv('REDIS_PORT') or 6379 ) from app import routes
import json import logging import re from api.api_samples.python_client.api_client import CloudBoltAPIClient from api.api_samples.python_client.samples.api_helpers import wait_for_order_completion from common.methods import set_progress from servicecatalog.models import ServiceBlueprint from utilities.exceptions impor...
import io import socket import struct import time import picamera class SplitFrames(object): def __init__(self, connection): self.connection = connection self.stream = io.BytesIO() self.count = 0 def write(self, buf): if buf.startswith(b'\xff\xd8'): # Start of new f...
from typing import Text, Any, Dict, List, Union, Optional, Tuple, Set from anytree import Resolver from dataclasses import dataclass from dataclasses_json import dataclass_json from anytree.node.nodemixin import NodeMixin from anytree.node.util import _repr from anytree.search import findall, findall_by_attr, find fr...
import pytest from django_vue_shopping_list.users.models import User from django_vue_shopping_list.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()
from .operator_factory import operation import numpy as np @operation def H(i, o): return o.H(i) @operation def Z(i, o): return o.Rz(i, np.pi) @operation def Y(i, o): return o.Y(i) @operation def I(i, o): return o.I(i) @operation def X(i, o): return o.X(i) @operation def NOT(i, o): return o.NOT...
# -*- coding: utf-8 -*- # Generated by Django 1.11.12 on 2018-04-19 14:16 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('media_service', '0004_auto_20170329_1530'), ] operations = [ migrations.Ad...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Yahoo! Finance market data downloader (+fix for Pandas Datareader) # https://github.com/ranaroussi/yfinance # # Copyright 2017-2019 Ran Aroussi # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the ...
""" A *local cutpoint* of a graph :math:`G` is a vertex :math:`x` such that its open neighborhood :math:`N_{G}(x)` is not connected. """ import networkx as nx from pycliques.surfaces import open_neighborhood def local_cutpoints(graph): """Generator of local cutpoints Args: graph (networkx.classes.grap...
from pyaedt.generic.general_methods import aedt_exception_handler from pyaedt.generic.DataHandlers import _dict2arg from collections import OrderedDict meshlink = [("ImportMesh", False)] autosweep = [("RangeType", "LinearStep"), ("RangeStart", "1GHz"), ("RangeEnd", "10GHz"), ("RangeStep", "1GHz")] autosweeps = [("Swee...
# -*- coding: utf-8 -*- # Copyright (C) 2012-2014 Mag. Christian Tanzer All rights reserved # Glasauergasse 32, A--1130 Wien, Austria. tanzer@swing.co.at # #*** <License> ************************************************************# # This module is part of the package GTW.RST.MOM. # # This module is licensed under th...
from pandas import DataFrame def make_cookies_observations() -> DataFrame: return DataFrame({ 'bowl': ['bowl 1'] * 40 + ['bowl 2'] * 40, 'flavor': ( ['vanilla'] * 30 + ['chocolate'] * 10 + ['vanilla'] * 20 + ['chocolate'] * 20 ) })
''' 13 - Loading .mat file In this exercise, you'll figure out how to load a MATLAB file using scipy.io.loadmat() and you'll discover what Python datatype it yields. The file 'albeck_gene_expression.mat' is in your working directory. This file contains gene expression data from the Albeck Lab at UC Davis. You can fin...
def squareRoot(n): x = n y = 1 e = 0.000001 while (x - y > e): x = (x + y) / 2 y = n/x return x print(squareRoot(50))
# ------------------------------------------------------------------------- # # Part of the CodeChecker project, under the Apache License v2.0 with # LLVM Exceptions. See LICENSE for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception # # ---------------------------------------------------...
## -- IMPORTING -- ## # MODULES import disnake import os import random import asyncio import datetime import certifi from disnake.ext import commands from disnake.errors import Forbidden, HTTPException from disnake.ext.commands import errors from pymongo import MongoClient from extra.webhooks import Webhook # FILES ...
from ..base import WriterBase class Writer(WriterBase): def __init__(self, out_directory): WriterBase.__init__(self, out_directory) def write_class(self, cls): self.set_initial_values(cls) members_list = '' static_list = '' for member in cls.members: decl...
import numpy as np import scipy.sparse as sp from .walker import RandomWalker from .utils import Word2Vec from .trainer import Trainer class DeepWalk(Trainer): r"""An implementation of `"DeepWalk" <https://arxiv.org/abs/1403.6652>`_ from the KDD '14 paper "DeepWalk: Online Learning of Social Representations"....
# Code obtained from django-debug-toolbar sql panel tracking from __future__ import absolute_import, unicode_literals import json from threading import local from time import time from django.utils import six from django.utils.encoding import force_text from .types import DjangoDebugSQL class SQLQueryTriggered(Exc...
# Module version py_version_info = (1, 0, 4) js_version_info = (0, 1, 9) # Module version accessible using vitessce.__version__ __version__ = '%s.%s.%s' % (py_version_info[0], py_version_info[1], py_version_info[2])
import os import pandas as pd def get_data(): """ Loads the data for the project. """ import os import pandas as pd pardir = os.path.abspath(os.path.join(os.getcwd(), os.pardir)) datadir = pardir + "\\Data" datadir offense = [] defense = [] offensel = []...
import os # use if needed to pass args to external modules import sys # used for directory handling import glob import time import threading #gogo MOD telegram needs import request import requests # needed for the binance API / websockets / Exception handling from binance.client import Client from binance.exceptions ...
"""Create progressions through a sequentially built graph.""" from typing import Any, Callable, Dict, List, Optional, Union from .selectors import first, last, randomness # noqa: F401 class DFSProgressor: """Progressor for Depth First Search.""" def __init__(self, graph: Optional[Dict[Any, Any]] = None) -...
# Copyright 2013 Blue State Digital # # 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 wr...
from airflow.plugins_manager import AirflowPlugin from airflow.models import BaseOperator from airflow.sensors.base import BaseSensorOperator import logging as log from airflow.contrib.hooks.fs_hook import FSHook import os, stat class DataTransferOperator(BaseOperator): template_fields = ['delete_list'] def __...
import os from tractseg.config.TractSegHP import HP as TractSegHP class HP(TractSegHP): EXP_NAME = os.path.basename(__file__).split(".")[0] DATA_AUGMENTATION = True FEATURES_FILENAME = "T1_Peaks12g90g270g" NR_OF_GRADIENTS = 10 NUM_EPOCHS = 500 NORMALIZE_PER_CHANNEL = True
import random from direct.distributed import ClockDelta from direct.task import Task from toontown.coghq import LaserGameBase class LaserGameAvoid(LaserGameBase.LaserGameBase): def __init__(self, funcSuccess, funcFail, funcSendGrid, funcSetGrid): LaserGameBase.LaserGameBase.__init__(self, funcSuccess, fu...
bitcoins = int(input()) china = float(input()) commission = (100-float(input()))/100 bgn = bitcoins * 1168 bgn += china * 0.15 * 1.76 euro = bgn / 1.95 print(round(euro*commission, 2))
def factorial(n): if n==0: return 1 else: return n* factorial(n-1) if __name__ == "__main__": print(factorial(7))
import unittest import os import torch import torch.distributed as dist import cortex.ops as ops def _single_process(): data = [ops.get_rank()] * (ops.get_rank() + 1) gathered_data = ops.gather(data, dst=0) dict_data = {'avg_rank': torch.Tensor([ops.get_rank()]).cuda()} reduced_data = ops.reduce_dict...
import os import kenlm model = kenlm.LanguageModel('../software/kenlm/test.bin') print('{0}-gram model'.format(model.order)) sentence = '面临 验考' print(sentence) print(model.full_scores(sentence)) # Check that total full score = direct score def score(s): return sum(prob for prob, _, _ in model.full_scores(s)) as...
# -*- coding: utf-8 -*- # # Flask-OAuthlib documentation build configuration file, created by # sphinx-quickstart on Fri May 17 21:54:48 2013. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. ...
import click from .summary_table_factory import SummaryTableFactory from .api import make_all_tables @click.command('read-stats') @click.argument('dirname') @click.argument('outname') def cli_make_read_stats(dirname, outname): dff = SummaryTableFactory(dirname) dff.readstats.table().to_csv(outname) @click....
# Copyright (c) 2020 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 app...
"""An alternative entry point """ from .cli import main if __name__ == '__main__': main()
import os import time import datetime import glob import serial import MySQLdb from time import strftime os.system('modprobe w1-gpio') os.system('modprobe w1-therm') #temp_sensor = '/sys/bus/w1/devices/28-00000622fd44/w1_slave' sensor_temp = '/dev/serial/by-id/usb-Arduino_Srl_Arduino_Uno_75439323735351B09120-if00' se...
# coding: utf-8 """ LUSID API FINBOURNE Technology # noqa: E501 The version of the OpenAPI document: 0.11.3192 Contact: info@finbourne.com Generated by: https://openapi-generator.tech """ import pprint import re # noqa: F401 import six class ResourceListOfTransaction(object): """NOTE: T...
import os import sys from django.core.management import setup_environ thisdir = os.path.dirname(os.path.abspath(__file__)) appdir = os.path.realpath(os.path.join(thisdir, '..', '..')) sys.path.append(appdir) import settings setup_environ(settings) ##############################e from trees.plots import get_nearest_neig...
import os import sys from haproxy_stats import HaproxyStats from vrouter.loadbalancer.ttypes import \ LoadbalancerStats, UveLoadbalancerStats, UveLoadbalancerTrace from pysandesh.sandesh_logger import SandeshLogger from pysandesh.gen_py.sandesh.ttypes import SandeshLevel LB_BASE_DIR = '/var/lib/contrail/loadbalan...
import sys from functools import lru_cache import numpy as np from PIL import Image from util.richlog import get_logger from . import imgops from . import minireco from . import resources from . import util logger = get_logger(__name__) @lru_cache(1) def load_data(): reco = minireco.MiniRecognizer(resources.loa...
import numpy as np import os import cv2 pengenalwajah = cv2.face.LBPHFaceRecognizer_create() detektor = cv2.CascadeClassifier("haarcascade/haarcascade_frontalface_default.xml") def perolehCitradanLabel(lintasan): daftarFolderCitra = [os.path.join(lintasan, f)\ for f in os.listdir(lintasan)] daftarSam...
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2018/1/2 9:48 # @Author : WIX # @File : MinNumberInRotatedArray.py """ 把一个数组最开始的若干个元素搬到数组的末尾,我们称之为数组的旋转。 输入一个递增排序的数组的一个旋转,输出旋转数组的最小元素。 例如数组{3,4,5,1,2}为{1,2,3,4,5}的一个旋转,该数组的最小值为1。 NOTE:给出的所有元素都大于0,若数组大小为0,请返回0。 """ """ 思路:二分查找的变种,需要用两个下标指针。 两点需要注意: 1. 若没有翻...
import esphome.codegen as cg import esphome.config_validation as cv from esphome.components import cover, ble_client from esphome.const import CONF_ID, CONF_PIN CODEOWNERS = ["@buxtronix"] DEPENDENCIES = ["ble_client"] AUTO_LOAD = ["am43", "sensor"] CONF_INVERT_POSITION = "invert_position" am43_ns = cg.esphome_ns.na...
import paramiko from tests.helpers.test_users import get_test_user_password from tests.helpers.testing_environment \ import get_testing_host, get_testing_port class IgnorePolicy(paramiko.MissingHostKeyPolicy): """Missing key policy for `paramiko` that ignores the fact, that the host key is missing. ...
from django.contrib.auth.models import AbstractUser from django.db.models import CharField from django.urls import reverse from django.utils.translation import gettext_lazy as _ import pytz class User(AbstractUser): """Default user for Expensive Taste.""" #: First and last name do not cover name patterns aro...
############################################################################### # # The MIT License (MIT) # # Copyright (c) Crossbar.io Technologies GmbH # # 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 ...
""" Copyright 2017 Robin Verschueren 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, softw...
# -*- coding: utf-8 -*- # # Copyright © Spyder Project Contributors # Licensed under the terms of the MIT License # (see spyder/__init__.py for details) """ Spyder API helper mixins. """ # Standard library imports import logging from typing import Any, Union, Optional import warnings # Third-party imports from qtpy....
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union from ... import _utilities, _tables from...
''' root/misc/population_growth_analysis.py Response to Issue #242 Mating and Mutating params in ezCGP has been BARLEY looked into, and I don't want to accidentally blow up my population size each generation. This script should run several evolutions and build a histogram so we know about how big of a population we can...
# coding: utf-8 """ Hydrogen Proton API Financial engineering module of Hydrogen Atom # noqa: E501 OpenAPI spec version: 1.7.18 Contact: info@hydrogenplatform.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F401 import six class Educ...
#!/usr/bin/env python # -*- coding: utf-8 -*- ################################################################################# # Copyright (c) 2018 Tsinghua Institute of Geo-Environment. All Rights Reserved # ################################################################################# """ File: Simulator.py Date:...
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P. # Copyright (c) 2012 VMware, 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/lic...
#!/usr/bin/env python # SECUREAUTH LABS. Copyright 2018 SecureAuth Corporation. All rights reserved. # # This software is provided under under a slightly modified version # of the Apache Software License. See the accompanying LICENSE file # for more information. # # [MS-SCMR] services common functions for manipulating ...
# 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 ...
# Copyright (c) 2020, Huawei Technologies.All rights reserved. # # Licensed under the BSD 3-Clause License (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://opensource.org/licenses/BSD-3-Clause # # Unless required by applicable law...
# -*- coding: utf-8 -*- from .util import _build_repeat_cell_request, _fetch_with_updated_properties, _range_to_dimensionrange_object from .models import CellFormat from .conditionals import DataValidationRule # These imports allow IDEs like PyCharm to verify the existence of these functions, # even though we will re...
# Copyright 2018 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/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
from time import perf_counter import numpy as np import scipy.linalg as spl #from joblib import Parallel, delayed def gpr(ymean, Cy, yobs, iobs): Cytest = Cy[iobs] L = spl.cholesky(Cy[np.ix_(iobs, iobs)] + np.sqrt(np.finfo(float).eps) * np.eye(iobs.size), lower=True) a = spl.solve_triangular(L.T, spl.solve...
import asyncio import logging from apscheduler.schedulers.asyncio import AsyncIOScheduler from pytz import UnknownTimeZoneError __scheduler = None logger = logging.getLogger(__name__) async def scheduler() -> AsyncIOScheduler: """Thread global scheduler to handle all recurring tasks. If no scheduler exist...
""" Django settings for db_operation_demo project. Generated by 'django-admin startproject' using Django 2.0. For more information on this file, see https://docs.djangoproject.com/en/2.0/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/2.0/ref/settings/ """ impo...
import typing from datetime import datetime from opentrons.hardware_control.modules.types import ModuleModel from opentrons_shared_data.pipette.dev_types import PipetteName from opentrons_shared_data.module.dev_types import ModuleType from pydantic import BaseModel, Field from opentrons.hardware_control.dev_types imp...
import joblib import numpy as np import matplotlib.pyplot as plt import argparse from statsmodels.tsa.arima_model import ARIMA from sklearn.metrics import mean_squared_error,mean_absolute_error def parser(x): return datetime.strptime('190'+x, '%Y-%m') def run_ARIMA(eq_num, src_dir, tar_path, num_preds = 1000, wei...
# Colored log, requires Python 2.3 or up. import sys from distutils.log import * from distutils.log import Log as old_Log from distutils.log import _global_log from numpy.distutils.misc_util import (red_text, default_text, cyan_text, green_text, is_sequence, is_string) def _fix_args(args,flag=1): if is_s...