text
stringlengths
2
999k
# Author: Tomas Hodan (hodantom@cmp.felk.cvut.cz) # Center for Machine Perception, Czech Technical University in Prague # Samples views from a sphere. import math import numpy as np #import transform from utils.sundermeyer.pysixd import transform def calc_2d_bbox(xs, ys, im_size): bbTL = (max(xs.min() - 1, 0), ...
import draftlog from draftlog.ansi import * # For colors from random import randrange draft = draftlog.inject() def progress_bar(progress): if progress >= 100: progress = 100 units = int(progress / 2) return ("[{0}{1}] " + GREEN + "{2}%" + END).format(BBLUE + "#" * units + END, "-" * (50 -...
import sys import os from subprocess import check_call from progress.bar import ChargingBar from .._package_manager import PackageManager from .._exec import exec class WebvizCoreComponents(PackageManager): def __init__(self) -> None: PackageManager.__init__(self, "webviz-core-components") def exe...
# -*- coding: utf-8 -*- from flask import Flask from flask.views import http_method_funcs from .auth import secure from .config import config_autoapi from .messages import message from .operations import invalid_operation, login, logout, password, roles, user from .views import get, post, delete, put, patch class Au...
import logging import tensorflow_datasets as tfds import tensorflow as tf import tensorflow_text as text logging.getLogger('tensorflow').setLevel(logging.ERROR) class src_tgt_data_prep: ''' Prepares data for encoder-decoder architecture for machine translation task default inputs are for portuguese to ...
# -*- coding: utf-8 -*- # @Time : 2018/10/9 0009 下午 9:39 # @Author : songzxDev # @Email : songzx_2326@163.com # @File : __init__.py.py # @Software: PyCharm
#!/usr/bin/env python # -*- coding: utf-8 -*- from sdk import UcloudApiClient from config import * import sys import json #实例化 API 句柄 if __name__=='__main__': arg_length = len(sys.argv) if arg_length == 1 or arg_length == 2 : print './sendsms.py "1377777777777|137888888888" "测试短信"' sys.exit()...
# # Created by: Pearu Peterson, March 2002 # """ Test functions for scipy.linalg.matfuncs module """ from __future__ import division, print_function, absolute_import import math import numpy as np from numpy import array, eye, exp, random from numpy.linalg import matrix_power from numpy.testing import ( asse...
import os import shutil import threading import time class DirCloner: def __init__(self, root:str='') -> None: # set path if os.path.exists(root): self.root = root else: self.root = os.path.dirname(__file__) # set os self.os_name = os.name ...
from tir import Webapp import unittest class ATFA001(unittest.TestCase): @classmethod def setUpClass(inst): inst.oHelper = Webapp() inst.oHelper.Setup("SIGAATF", "30/06/2020", "T1", "D MG 01 ", "01") inst.oHelper.Program("ATFA001") # ================================================...
""" # coding:utf-8 @Time : 2021/01/03 @Author : oriyao @mail : ylzhangyao@gmail.com @File : __init__.py @Describe: for mongodb initial command """ import time import pymongo from flask import current_app def initial_mongodb(): current_app.logger.info('Initial my mongodb.') # app.l...
# Copyright 2021 The Pigweed 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Lenovo, Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # ...
import matplotlib.pyplot as plt import numpy as np import seaborn as sns def show_corr(X, mask=True, figsize=(7,7)): fig, ax = plt.subplots(figsize=figsize) corr = X.corr() mask = np.triu(np.ones_like(corr, dtype=bool)) if mask else np.ones_like(corr, dtype=bool) sns.heatmap(corr, mask=mask, square=Tr...
"""This module implements a Hindsight Experience Replay (HER). See: https://arxiv.org/abs/1707.01495. """ import inspect import numpy as np from garage.replay_buffer.replay_buffer import ReplayBuffer def make_her_sample(replay_k, reward_fun): """Generate a transition sampler for HER ReplayBuffer. ...
""" Django settings for myproject project. Generated by 'django-admin startproject' using Django 2.2. For more information on this file, see https://docs.djangoproject.com/en/2.2/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/2.2/ref/settings/ """ import os #...
# -*- coding: utf-8 -*- import functools import warnings import numpy as np import pandas as pd from lifelines.fitters import UnivariateFitter from lifelines.utils import ( _preprocess_inputs, _additive_estimate, _to_1d_array, StatError, inv_normal_cdf, median_survival_times, qth_survival_t...
import pytest from esu.base import NotFoundEx from esu.client import Client from esu.project import Project from esu.tests import load_fixtures @load_fixtures def test_not_found_by_id(rsps): client_id = '10000000-1000-1000-1000-100000000000' with pytest.raises(NotFoundEx): Client.get_object(client_id...
from setuptools import setup, find_packages with open('intrepid/version.py') as f: exec(f.read()) with open('requirements.txt') as f: install_requires = f.readlines() # tests_require = parse_requirements('test-requirements.txt') setup( name='intrepid', version=VERSION, description='Fast Python',...
from .varint_parser import parse_varint def parse_record(stream, column_count): """ Parses SQLite's "Record Format" as mentioned here: https://www.sqlite.org/fileformat.html#record_format """ _number_of_bytes_in_header = parse_varint(stream) serial_types = [parse_varint(stream) for i in range(col...
import os import threading import time import numpy as np import tensorflow as tf from datasets import audio from infolog import log from keras.utils import np_utils from sklearn.model_selection import train_test_split from .util import is_mulaw_quantize, is_scalar_input _batches_per_group = 64 class Feeder: ""...
from __future__ import division, absolute_import, print_function import copy import pickle import sys import platform import gc import warnings import tempfile from os import path from io import BytesIO from itertools import chain import numpy as np from numpy.testing import ( run_module_suite, assert_, asser...
import signal import time from xbox360controller import Xbox360Controller with Xbox360Controller(0, axis_threshold=0.2) as controller: print("Xbox controller writing in piTankEx") while 1: str1 = 'N' str2 = 'N' str3 = "0.000" str4 = "0.000" #Control de los botones pulsa...
# -*- coding: utf-8 -*- """Defines a %%cache cell magic in the notebook to persistent-cache results of long-lasting computations. """ import hashlib import os import re import sys from IPython.config.configurable import Configurable from IPython.core import magic_arguments from IPython.core.magic import Magics, magi...
import pytest from src.detect_anime import ( connect_to_db, text_is_equal_to_column, slug_text_is_equal_to_slug_column, text_is_in_synonyms_array, text_is_substring_of_franchise, text_without_spaces_is_equal_to_franchise_column, # franchise_is_substring_of_text, text_is_substring_of_slu...
# Lint as: python3 # Copyright 2019, The TensorFlow Federated 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 ...
""" DQN agent implementation. Heavily based on: https://github.com/deepmind/acme/blob/master/acme/agents/tf/dqn/agent.py """ import copy from typing import Optional, List, Dict import numpy as np import reverb import sonnet as snt import tensorflow as tf import trfl from acme import datasets from acme import specs f...
""" mfsms module. This is the solver for MODFLOW-USG. Contains the ModflowSms class. Note that the user can access the ModflowSms class as `flopy.modflow.ModflowSms`. """ import sys from ..pakbase import Package from ..utils.flopy_io import line_parse class ModflowSms(Package): """ MODFLO...
import copy import logging import os import time from collections import Counter from statistics import mean from functools import reduce import numpy as np import pandas as pd from ...constants import MULTICLASS, REGRESSION, SOFTCLASS, REFIT_FULL_SUFFIX from ...utils.exceptions import TimeLimitExceeded from ...utils...
#!/usr/bin/env python """Django's command-line utility for administrative tasks.""" import os import sys def main(): """Run administrative tasks.""" os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'consciousMain.settings') try: from django.core.management import execute_from_command_line excep...
import base_test from src.gui.animations import * import numpy as np import cv2 as cv import data.resources DFORMAT = QImage.Format_RGB888 # color space class TestVideo(QObject): image_data = pyqtSignal(np.ndarray) def __init__(self, parent=None): super().__init__(parent) self.cap = cv.VideoCa...
#!/usr/bin/env python """gevent build & installation script""" from __future__ import print_function import sys import os import re import shutil import traceback from os.path import join, abspath, basename, dirname from subprocess import check_call from glob import glob PYPY = hasattr(sys, 'pypy_version_info') WIN =...
import tkinter as tk from tkinter import ttk from tkinter.constants import NSEW, VERTICAL from tkinter.messagebox import showinfo class App(tk.Tk): def __init__(self): super().__init__() self.title('Treeview demo') self.geometry('620x200') self.tree = self.create_tree_widget() ...
""" Copyright 2019 ShipChain, 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, softwar...
""" A special directive for generating a matplotlib plot. .. warning:: This is a hacked version of plot_directive.py from Matplotlib. It's very much subject to change! Usage ----- Can be used like this:: .. plot:: examples/example.py .. plot:: import matplotlib.pyplot as plt plt.plot...
import asyncio import logging from seleniumwire.handler import MitmProxyRequestHandler from seleniumwire.modifier import RequestModifier from seleniumwire.storage import RequestStorage from seleniumwire.thirdparty.mitmproxy import addons from seleniumwire.thirdparty.mitmproxy.master import Master from seleniumwire.thi...
# Copyright (c) 2011 matt # Copyright (c) 2011 Paul Colomiets # Copyright (c) 2011-2014 Tycho Andersen # Copyright (c) 2012 dmpayton # Copyright (c) 2012 hbc # Copyright (c) 2012 Tim Neumann # Copyright (c) 2012 uberj # Copyright (c) 2012-2013 Craig Barnes # Copyright (c) 2013 Tao Sauvage # Copyright (c) 2014 Sean Vig ...
x = int = int(input('coloque o tamanho da primeira reta: ')) y = int(input('coloque o valor da segunda reta: ')) z = int(input('coloque o valor da terceira reta: ')) if x + y > z and z + y: if x == y and x == z and z == y: print('forma um triangulo equilatero') elif x == y or x == z or z == y: p...
# -*- coding: utf-8 -*- # Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html class ConcertinoPipeline(object): def process_item(self, item, spider): return item
import logging import os, sys, platform import pyyjj from kungfu.yijinjing.time import * LOG_MSG_FORMAT = '[%(nanotime)s] [%(loglevel)s] [%(process)6d/%(tid)-6d] [%(pathname)s:%(lineno)d#%(funcName)s] %(message)s' LOG_FILE_DATEEXT_FORMAT = '%Y-%m-%d' LOG_LEVELS = { 'trace': logging.DEBUG, 'debug': logging.DEB...
# Unit test configuration file for MessageLogger service # Tests the hardwired defaults # Does not include MessageLogger.cfi nor explicitly mention MessageLogger # or MessageService at all. # Not suitable for unit test because the time stamps will not be disabled import FWCore.ParameterSet.Config as cms process = cms...
from os.path import exists from typing import Optional from yaml import safe_load, safe_dump from .model import GameSettings, GameConfig from .typing import ISettingManager, IPathProvider from .events import publish_game_event, SETTINGS_CHANGED class YamlSettingsManager(ISettingManager): def get_settings(self) ...
# # # from __future__ import absolute_import, division, print_function, \ unicode_literals from os.path import dirname, join from six import text_type from suds import WebFault from unittest import TestCase from octodns.provider.transip import TransipProvider from octodns.provider.yaml import YamlProvider from...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import, print_function from future.utils import iteritems """ Provides a service to store ROS message objects in a mongodb database in JSON. """ import genpy import rospy import pymongo from pymongo import GEO2D import json from bson import ...
import json import uuid from unittest.mock import Mock, patch import pytest from polaris.tests.helpers import mock_check_auth_success from polaris.models import Transaction, Asset endpoint = "/sep6/transactions/" @pytest.mark.django_db @patch("polaris.sep10.utils.check_auth", mock_check_auth_success) @patch("polar...
""" What you should know about browser: * (Browser() << KonIQ) + (Browser() << CLIVE) -- close the first one will close all * sync mode: show results of different methods. (qmap comparison, or one showing qmap, one showing the results, very flexible) # Browser(methods=['PaQ2PiQ-BM', 'PaQ2PiQ-RM']) << KonIQ # Browser...
"""Test suite for Params object""" from copy import deepcopy from pycgp import Params from pycgp.params import FUNSET def test_arities_table(): def dummy_sin(x): return x funset = deepcopy(FUNSET) funset[4] = dummy_sin params = Params(3, 1, funset=funset) assert params....
import logging import time from pathlib import Path from fastapi import APIRouter, HTTPException from riskout.textrank import KeywordSummarizer from rest_api.schema import DocumentRequest from rest_api.controller.utils import nouns router = APIRouter() @router.post("/keywords") async def keywords(doc: DocumentReq...
import numpy as np def null(sim, x, y, y_psb, rtrv, y_hat, y_lrn, x_ex, y_ex, n_x, n_y, ex_seen_yet, ex_counts, n_ex, sim_pars): ''' Don't update attention (it remains constant). ''' return 0 null.par_names = [] def gradient_ngsec(sim, x, y, y_psb, rtrv, y_hat, y_lrn, x_ex, y_ex, n_x, n_y, ex_seen_yet...
""" 整个 command 模块都参考了scrapy 的 commands模块 这里引用了scrapy 中的代码:https://github.com/scrapy/scrapy/blob/master/scrapy/commands/__init__.py """ import os import re from optparse import OptionGroup from os.path import join from shutil import ignore_patterns, copy2, copystat import bspider IGNORE = ignore_patterns('*.pyc', '.sv...
# Authors: # Trevor Perrin # Dave Baggett (Arcode Corporation) - MD5 support for MAC_SSL # Yngve Pettersen (ported by Paul Sokolovsky) - TLS 1.2 # Hubert Kario - SHA384 PRF # # See the LICENSE file for legal information regarding use of this file. """Miscellaneous helper functions.""" from .utils.compat impo...
from future import standard_library standard_library.install_aliases() # noqa: E402 import hashlib import json import re import requests import urllib.parse import xbmc from resources.lib.models.playlist import Playlist from resources.lib.models.track import Track from resources.lib.models.selection import Selection...
from libtuto.position import Position from libtuto.zone import Zone from libtuto.size import Size from libtuto.config_file_data import ConfigFileData TUTORIAL_VERSION = 0 class TutorialStep: def __init__(self, title, description, actionZone, descriptionPosition=None, previousStepClick = None): ...
# Logistic Regression # Importing the libraries import numpy as np import matplotlib.pyplot as plt import pandas as pd # Importing the dataset dataset = pd.read_csv('../Datasets/advertising.csv') ind = dataset.iloc[:, [0, 2]].values #independent variables(daily time spent on the site and income) dep = dataset.iloc[:...
#!/usr/bin/env python3 import subprocess import os, re, socket from os.path import join """ Setup Charlesreid1.com User Tasks #krash This sets up the directory structure for various charlesreid1 domains and their static content. Each domain has a folder under `/www`: /www/ example.blue example....
# -*- coding: utf-8 -*- # Copyright 2019 Cohesity Inc. class EnvironmentBackupRunEnum(object): """Implementation of the 'Environment_BackupRun' enum. Specifies the environment type that the task is protecting. Supported environment types such as 'kView', 'kSQL', 'kVMware', etc. NOTE: 'kPuppeteer' ref...
"""Integration providing core pieces of infrastructure.""" import asyncio import itertools as it import logging import voluptuous as vol from homeassistant.auth.permissions.const import CAT_ENTITIES, POLICY_CONTROL from homeassistant.components import persistent_notification import homeassistant.config as conf_util f...
from OpenGL.GL import * from OpenGL.GLUT import * from OpenGL.GLU import * import time window = 0 counter = 0 posX = 10 posY = 10 flag =0 width, height = 500, 400 def draw_rect(x,y,width,height): time.sleep(0.01) glBegin(GL_QUADS) glVertex2f(x, y) glVertex2f(x+width, y) glVertex2f(x+w...
numbers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] print('liste de nombres :', numbers) numbers.reverse() print('liste de nombres après reverse() :', numbers) print('\n##############\n') numbers = list(range(10)) print('liste de nombres :', numbers) reversed(numbers) print('liste de nombres après avoir appliqué reversed dessus...
import numpy import logging from ..utils import probability_of_successful_attack, sigmoid from ..utils import possible_attacks from dicewars.client.ai_driver import BattleCommand, EndTurnCommand class AI: """Agent using Win Probability Maximization (WPM) using logarithms of player scores and dice This ...
import meshio from dualGPy.Mesh import Mesh2D from dualGPy.Graph import Graph2D import numpy as np points = [] cells_test = [] n=5 for i in range(n): for j in range(n): points.append([j,i]) for k,element in enumerate(points): if (k+1)%n!=0 and (k < (len(points)-n)) : cells_test.append([k,k+1,n+k+1,n+k]) print(...
""" Core mail sender""" from django.template.loader import render_to_string from django.core.mail import EmailMessage class SendMail: """ Send email to user """ def __init__(self, template_name, context, to, subject="Awesome Blog API", request=None): self.template_name = template_name self.co...
# Developed by Redjumpman for Redbot # This cog requires no library installs # If you have issues contact Redjumpman#2375 on Discord import uuid import os import random import asyncio from .utils import checks from discord.ext import commands from .utils.dataIO import dataIO from __main__ import send_cmd_help...
from .confirmacionMensaje import ConfirmacionMensaje from .mensajeEnviado import MensajeEnviado from .estadoMensaje import EstadoMensaje class MensajeParcialmenteEnviado(EstadoMensaje): #Colaboradores externos #confirmaciones: Conjunto<ConfirmacionMensaje> #msg: Mensaje def __init__(self, unMensaje, unConjDeConfi...
import hmac import random import string import hashlib import pymongo import time import sys print sys.path print "something" from mClassDAO import mClasses import json # The Data Access Object handles all interactions with the Data collection. class DataDAO: def __init__(self, db): self.db = db ...
# This code is part of Qiskit. # # (C) Copyright IBM 2017, 2020. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivat...
import logging import os import subprocess from collections import OrderedDict import html_checker from html_checker.exceptions import (HtmlCheckerUnexpectedException, ValidatorError) from html_checker.reporter import ReportStore from html_checker.utils import is_local_ressource, ...
import random from typing import Optional, Tuple import numpy as np from ..definitions import InteractionMatrix from ._util_cpp import (okapi_BM_25_weight, remove_diagonal, rowwise_train_test_split_d, rowwise_train_test_split_f, rowwise_train_test_split_i, sparse_mm_thr...
# nuScenes dev-kit. # Code written by Oscar Beijbom, 2019. import json from typing import Dict, Tuple import numpy as np import tqdm from pyquaternion import Quaternion from nuscenes import NuScenes from nuscenes.eval.common.data_classes import EvalBoxes from nuscenes.eval.detection.data_classes import DetectionBox ...
''' Created on Oct16, 2011 @author: wegrata ''' from service_template import ServiceTemplate from setup_utils import getInput, PublishDoc, isBoolean, YES, isInt import pystache, uuid import json def install(server, dbname, setupInfo): custom_opts = {} active = getInput("Enable SWORD Service?", "T", isBoolea...
# Copyright 2017 Google Inc. 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 law or ag...
from rest_framework.views import APIView from rest_framework.response import Response from rest_framework.permissions import IsAuthenticated class HedgeHogView(APIView): permission_classes = (IsAuthenticated,) def get(self, request): content = {'message': 'harimo!'} return Response(content)
from __future__ import absolute_import from __future__ import unicode_literals from django.test import TestCase, SimpleTestCase from corehq.apps.domain.shortcuts import create_domain from corehq.apps.locations.models import LocationType from corehq.apps.locations.tests.util import make_loc from corehq.apps.users.models...
# ------------------------------------------------------------- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you unde...
import json import re from collections.abc import Mapping, Sequence from flask.testing import FlaskClient from .utils import UNDEFINED # ----------------------------------------------------------------------------- class ApiClient(FlaskClient): """A `flask.testing.FlaskClient` with a few conveniences: * P...
import config from install_package import InstallPackage import os import shutil import utils VERSION = "4.8.1" BASENAME = "qt" if os.name == "nt": ARCHIVE_BASENAME = "%s-everywhere-opensource-src-%s" % (BASENAME, VERSION) ARCHIVE_NAME = "%s.zip" % (ARCHIVE_BASENAME,) else: ARCHIVE_BASENAME =...
import asyncio import contextlib import enum import inspect import io import logging import re from datetime import datetime from typing import Any, Optional, Union from starlette.background import BackgroundTask from starlette.concurrency import iterate_in_threadpool, run_until_first_complete from starlette.responses...
#!/usr/bin/env python # -*- coding:utf-8 -*- """ @Project : movies @FileName : userAgent.py @Time : 2020/8/4 11:07 下午 @Author : william.sv@icloud.com """ import random user_agents = [ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/...
try: # Python2 import Tkinter as tk except ImportError: # Python3 import tkinter # needs Python25 or higher from functools import partial from signalTeste import * import matplotlib.pyplot as plt #matplotlib.use('TkAgg') num ='12' sig = signalMeu() def numero(): global num, sig def on_key_pres...
import traceback from typing import Dict, List, Optional, Union import dateparser import demistomock as demisto # noqa: F401 import requests from CommonServerPython import * # noqa: F401 # Disable insecure warnings requests.packages.urllib3.disable_warnings() ''' CONSTANTS ''' DATE_FORMAT = '%Y-%m-%dT%H:%M:%SZ'...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'Visualization.ui' # # Created by: PyQt5 UI code generator 5.11.3 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_Visualization(object): def setupUi(self, Visualiza...
import re def parse_price(price_text): price_list = re.findall(r"\d{1,3}(?:[.,]\d{3})*(?:[.,]\d{2})", price_text) if len(price_list) > 0: price_str = price_list[0] else: return None return float(price_str.replace(",", ""))
# !/usr/bin/env python # -*-coding:utf-8 -*- # Warning :The Hard Way Is Easier """ ================================================================================= 【按索引范围翻转文章片段】【重要】 ================================================================================= """ def Solution(s: str, start: int, end: int): ...
#!/usr/bin/env python3 import argparse import os from os import path import sys import json import paramiko CONFIG_PATH = path.join(path.dirname(path.realpath(__file__)), '..', '..','config') SUBMITTY_CONFIG_PATH = path.join(CONFIG_PATH, 'submitty.json') AUTOGRADING_WORKERS_PATH = path.join(CONFIG_PATH, 'autograding_...
from tornado import web from jupyterlab_server.server import APIHandler from .config import OmniSciConfig class OmniSciSessionHandler(APIHandler): """ A tornado request handler to get OmniSci session data from the server. The implementation of the session manager is configurable, with the default pr...
expected_output = { "switch": { "1": { "fan": { "1": { "state": "ok", "direction": "front to back" }, "2": { "...
#!/usr/bin/env python import os import json LAST_VERSION = '1.0.0.0' CUR_VERSION = '1.0.0.2b' publish_timeout = 3 def patch_apikey(path): try: with open(path, 'r') as f: json.load(f) print ' API.key file already good.' except ValueError: with open(path, 'r') as f: ...
from flask import request, send_file from flask_login import login_user, logout_user, current_user, login_required from flask_restplus import Resource, reqparse, fields, marshal_with, marshal from sqlalchemy.exc import IntegrityError from sqlalchemy.orm.exc import NoResultFound from io import BytesIO import json from ...
# Copyright 1997 - 2018 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, merge, p...
from .config import Config from .json import CamelCaseSchema, Serializable from .types import *
import json import multiprocessing import os from django.http import HttpResponse from dateutil.relativedelta import relativedelta from django.utils import timezone from rest_framework import status from rest_framework.response import Response from rest_framework.views import APIView from presqt.api_v1.utilities impo...
from sqlalchemy import Column, Integer, String from user_handler.database import Base class User(Base): __tablename__ = 'users' id = Column(Integer, primary_key=True, index=True) username = Column(String, unique=True, index=True) password = Column(String)
import os import time import datetime import re from concurrent.futures import ThreadPoolExecutor from pandaharvester.harvestercore import core_utils from pandaharvester.harvestercore.work_spec import WorkSpec from pandaharvester.harvestercore.plugin_base import PluginBase from pandaharvester.harvestermisc.k8s_utils ...
""" .. _model_evaluation: Evaluating Performance ====================== The Green's functions based interpolations in Verde are all linear regressions under the hood. This means that we can use some of the same tactics from :mod:`sklearn.model_selection` to evaluate our interpolator's performance. Once we have a quan...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** 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, overload from .. import...
from __future__ import absolute_import, print_function, division from firedrake import * from firedrake.petsc import PETSc from incflow import * import pytest N = 20 mesh = UnitSquareMesh(N, N) V = VectorFunctionSpace(mesh, 'CG', 2) u1 = Function(V).interpolate(as_vector([0.0, 0.0])) eneq = EnergyEq(mesh) eneq.dt =...
provinces = [ # ["nunavut", 2], # ["yukon", 4], # ["Northwest%20Territories",2], # ["Prince%20Edward%20Island", 6], # ["Newfoundland%20and%20Labrador", 12], # ["New%20Brunswick", 28], # ["Nova%20Scotia", 36], # ["Saskatchewan", 34], # ["Manitoba", 40], # ["Alberta", 167], # [...
# Copyright (c) 2018 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
import os import pymongo from pymongo import MongoClient from dotenv import load_dotenv from pprint import pprint load_dotenv() CONNECT_URL = os.getenv("CONNECT_URL") cluster = MongoClient(CONNECT_URL) ''' db = cluster.ctox serverStatusResult = db.command("serverStatus") pprint(serverStatusResult) ''' db = cluster["...
# 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 may ...