content
stringlengths
5
1.05M
from services import UserService as USER_SERVICE from services import AccountService as ACCOUNT_SERVICE class ExtendedUserKnot(object): def __init__(self, user_id): self.user_id = user_id self._cached_user = None self._cached_accounts = None @property def user(self): if s...
"""An example DAG demonstrating simple Apache Airflow operators.""" # [START composer_simple] from __future__ import print_function # [START composer_simple_define_dag] import datetime import random from airflow import models # [END composer_simple_define_dag] # [START composer_simple_operators] from airflow.operato...
# ------------------------------------------------------------------------------ # Copyright (c) Microsoft # Licensed under the MIT License. # Written by Ke Sun (sunk@mail.ustc.edu.cn) # ------------------------------------------------------------------------------ from __future__ import absolute_import from __future...
from typing import List def longestCommonPrefix(strs: List[str]) -> str: if not strs: return '' prefix, count = strs[0], len(strs) for i in range(1, count): idx = 0 length = min(len(prefix), len(strs[i])) while idx < length and prefix[idx] == strs[i][idx]: idx ...
# Generated by Django 4.0 on 2021-12-24 19:10 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('usuarios', '0003_alter_usuario_segmentos'), ] operations = [ migrations.AlterField( model_name='usuario', name='foto',...
import math import pathlib from typing import List, Dict import requests from models import Instrument from pkg.config import Config from pkg.gcs_stream_upload import GCSObjectStreamUpload from pkg.google_storage import GoogleStorage from pkg.sftp import SFTP from util.service_logging import log class CaseMover: ...
# import pandas, matplotlib, and statsmodels import pandas as pd import numpy as np pd.set_option('display.width', 200) pd.set_option('display.max_columns', 35) pd.set_option('display.max_rows', 200) pd.options.display.float_format = '{:,.2f}'.format nls97 = pd.read_pickle("data/nls97b.pkl") # show some descriptive st...
""" day 6 lecture """ demo_str = 'this is my string' #for each_string in demo_str: # print(each_string) #for each_word in demo_str.split(): #.split creates list # print(each_word.upper()) # print(each_word.title()) #for each_word in demo_str.split(): # if each_word == 'my': # print(each_word...
from prestans.http import STATUS from prestans.rest import RequestHandler import pytest import unittest class NoContentHandler(RequestHandler): def get(self): self.response.status = STATUS.NO_CONTENT def test_app(): from webtest import TestApp from prestans.rest import RequestRouter api =...
#! /usr/bin/env python # -*- coding: utf-8 -*- """Creates aRT-ratio comparison figures (ECDF) and convergence figures for the comparison of 2 algorithms. Scale up figures for two algorithms can be done with compall/ppfigs.py """ from __future__ import absolute_import import os import matplotlib.pyplot as plt from ...
'''Trains a simple convnet on the sample video feed data ''' from __future__ import print_function import keras import time import numpy as np import skimage.io import skimage.color from os import listdir from os.path import isfile, join import matplotlib.pyplot as plt from keras.datasets import mnist from keras.model...
# Copyright 2021-2022 The Kubeflow 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 applicable law or agreed ...
from os import walk, mkdir from PIL import Image from shutil import copyfile, rmtree GENERATED_WARNING = "/** \n * This file was auto-generated with object-generator.py \n */\n\n" def capitalizeName(name): if ("zother" in name): name = name[1:] names = name.split('-') result = "" for n in na...
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: POGOProtos/Map/Fort/FortSponsor.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.proto...
import multiprocessing def do_calculation(data): return data * 2 def start_process(): print('Starting', multiprocessing.current_process().name) if __name__ == '__main__': inputs = list(range(10)) print('Input :', inputs) builtin_outputs = map(do_calculation, inputs) print('Built-in:', b...
#!/usr/bin/env python import argparse import sys import os import cv2 import pickle import numpy as np from matplotlib.image import imread from os.path import isdir, join, exists, splitext from os import listdir from pathlib import Path # -d /media/miro/WD/jetbot_obstacle_avoidance/data # -d /media/miro/WD/L-CAS/LCAS...
import string import time import os import argparse from pathlib import Path import json import matplotlib.pyplot as plt import seaborn as sns from distutils import dir_util from pprint import pprint import pickle import pandas as pd import random import pprint import numpy as np import datetime # BayesCMD packages fr...
import t class b07(t.Test): class TestResource(t.Resource): def forbidden(self, req, rsp): return req.cookies.get('id') != 'foo' def to_html(self, req, rsp): return "nom nom" def test_ok(self): self.req.headers['cookie'] = 'id=foo' sel...
import app from waitress import serve from paste.translogger import TransLogger serve(TransLogger(app.app, setup_console_handler=False), port=3005, host="0.0.0.0")
# SPDX-License-Identifier: Apache-2.0 # # Copyright (C) 2021, ARM Limited and contributors. # # 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 # # ...
import pytest from _mock_data.xpath.method_2 import exception_handling_for_methods_with_3_arguments_or_more from browserist import Browser from browserist.browser.click.button import click_button from browserist.browser.click.button_if_contains_text import click_button_if_contains_text from browserist.constant import ...
# Model Paramters: 206,607 # Peak GPU memory usage: 1.57 G # RevGNN with 7 layers and 160 channels reaches around 0.8200 test accuracy. # Final Train: 0.9373, Highest Val: 0.9230, Final Test: 0.8200. # Training longer should produces better results. import os.path as osp import torch import torch.nn.functional as F f...
###ANSI escape sequenci \033[style;text;background m ### NÃO FUNCIONA NO WINDOWS (NO PYCHARM É POSSIVEL) print ('\033[4;31;43mOla mundo\033[m')
""" 75. Sort Colors https://leetcode.com/problems/sort-colors/ Time complexity: O() Space complexity: O() """ from typing import List class Solution: def sortColors(self, nums: List[int]) -> None: """ Do not return anything, modify nums in-place instead. """ p0 = curr...
# -*- coding: utf-8 -*- """ Created on Wed Sep 2 16:49:23 2020 @author: truthless """ from LAUG.nlu.gpt.utils import seq2dict from LAUG.nlu.milu_new.dai_f1_measure import DialogActItemF1Measure def normalize(data): string = str(data) digit2word = { '0': 'zero', '1': 'one', '2': 'two', '3': 'thr...
from specusticc.configs_init.config_loader import ConfigLoader from specusticc.configs_init.model.agent_config import AgentConfig from specusticc.configs_init.model.configs_wrapper import ConfigsWrapper from specusticc.configs_init.model.loader_config import LoaderConfig from specusticc.configs_init.model.market_config...
def create_server(spec_dir, port=8080, debug=False, sync=True, request_context_name=None): import connexion import os import yaml from parrot_api.core.common import get_subpackage_paths if sync: app = connexion.FlaskApp( __name__, port=port, specification_dir=spec_di...
# -*- coding: utf-8 -*- """ MIT License Copyright (c) 2019-2020 Terbau 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, ...
""" Good morning! Here's your coding interview problem for today. This problem was asked by Facebook. Given an N by N matrix, rotate it by 90 degrees clockwise. For example, given the following matrix: [[1, 2, 3], [4, 5, 6], [7, 8, 9]] you should return: [[7, 4, 1], [8, 5, 2], [9, 6, 3]...
#!/usr/bin/env python ''' Setup script. To build qutest install: [sudo] python setup.py sdist bdist_wheel ''' from setuptools import setup setup( name="qutest", version="6.9.3", author="Quantum Leaps", author_email="info@state-machine.com", description="QUTest Python scripting support", long_d...
import logging from onegov.translator_directory.app import TranslatorDirectoryApp log = logging.getLogger('onegov.translator_directory') # noqa log.addHandler(logging.NullHandler()) # noqa from translationstring import TranslationStringFactory # noqa _ = TranslationStringFactory('onegov.translator_directory') # ...
from flask import render_template, request, redirect, url_for, jsonify from flask_login import login_required from app.api.classes.observation.models import Observation from app.api.classes.observationperiod.models import Observationperiod from app.api.classes.observation.services import parseCountString, addObservat...
from .SnipeIT import SnipeIT
import requests, threading from discord.ext import commands client = commands.Bot(command_prefix=".", self_bot= True) token = "token.YXvmcw.yuh-qvd6bsDfyb4gY" users = ['811042929040687177','903621585053835275','791835116980666418','903244322181361755'] #users aka the victims gcs = ['904174831707250750','9041748326...
# -*- coding: utf-8 -*- # Copyright (c) 2016-2017 by University of Kassel and Fraunhofer Institute for Wind Energy and # Energy System Technology (IWES), Kassel. All rights reserved. Use of this source code is governed # by a BSD-style license that can be found in the LICENSE file. import numpy as np import pytest i...
from binascii import hexlify from pkg_resources import resource_stream from usb.core import find from usb.util import find_descriptor, claim_interface from nitrolib.util import partition from nitrolib.device import NitroDevice, DeviceNotFound from nitrolib.emulator.enums import WriteCommandType, MemoryRegion, ReadCo...
from unittest.mock import MagicMock, call import pytest from injectable import InjectionContainer, Injectable from injectable.constants import DEFAULT_NAMESPACE from injectable.container.namespace import Namespace from injectable.testing import register_injectables class TestRegisterInjectables: def test__regis...
from autogoal.kb import ( Document, Sentence, Seq, Stem, Word, build_pipeline_graph, algorithm, AlgorithmBase, ) from autogoal.search import RandomSearch class TextAlgorithm(AlgorithmBase): def run(self, input: Sentence) -> Document: pass class StemWithDependanceAlgorithm...
################### Imports ###################### # General imports import numpy as np ; np.random.seed(1) # for reproducibility import pandas as pd import pathlib pd.options.mode.chained_assignment = None import numpy as np ; np.random.seed(1) # for reproducibility import os import joblib # TensorFlow import tensor...
# # # ================================================================= # ================================================================= """Overrides the Conductor Manager for additional PowerVC DB Access: 1. Query HMC Information for a given Host 2. Add/Update/Deleted/Query VIOS Information 3. Add/Upda...
# -*- coding: utf-8 -*- """ Created on Tue Oct 30 13:50:41 2018 @author: Caio Hamamura It generates the radar-boxplot """ import matplotlib.pyplot as plt import math import numpy as np def radarboxplot(x, y, colNames, plotMedian=False, **kwargs): nrows = kwargs.get("nrows") ncols = kwargs.get("ncols") ...
from flask import request from app import api from app.main.service.log_service import LogService from app.main.service.user_group_service import UserGroupService from app.main.util.auth_utils import Auth from app.main.util.constants import Constants from app.main.util.response_utils import ResponseUtils _logger = Lo...
import despymisc.miscutils as miscutils def get_config_vals(archive_info, config, keylist): """Search given dicts for specific values. """ info = {} for k, stat in list(keylist.items()): if archive_info is not None and k in archive_info: info[k] = archive_info[k] elif confi...
# search vulnerabilities by dock import sys from urllib2 import HTTPError, URLError from lib import bing from lib import google from lib import yahoo bingsearch = bing.Bing() yahoosearch = yahoo.Yahoo() class Search: """basic search class that can be inherited by other search agents like Google, Yandex""" p...
#!/usr/bin/python3 """This module define the conection of DB mysql""" from os import getenv from sqlalchemy import create_engine from sqlalchemy.orm import scoped_session from sqlalchemy.orm import sessionmaker from models.base_model import Base from models.user import User from models.place import Place from models.st...
"""This is a module for extracting data from simtelarray files and calculate image parameters of the events: Hillas parameters, timing parameters. They can be stored in HDF5 file. The option of saving the full camera image is also available. Usage: "import calib_dl0_to_dl1" """ import os import logging import numpy ...
import sys import time from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWebEngineWidgets import * from PyQt5.QtWidgets import * import likeyoubot_license import likeyoubot_win import time def mouseOverOnLink(web, url): print('mouse over: ', url) if ( ('adclick' in url) or ('googleads' in url) o...
import numpy as np import matplotlib.pyplot as plt import utils.utils_filt as utils_filt import pandas as pd from tqdm import tqdm # plt.rc('text', usetex=True) plt.rc('font', size=11) plt.rc('font', family='serif') plt.rc('lines', linewidth=1) plt.rc('axes', linewidth=1, labelsize=10) plt.rc('legend', fontsize=10) ##...
import random import pytest import cattle import common from common import dev # NOQA from common import SIZE, read_dev, write_dev def test_basic_rw(dev): # NOQA for i in range(0, 10): offset = random.randint(0, SIZE - 256) length = random.randint(0, 256) data = common.random_string(le...
import json import logging log = logging.getLogger(__name__) class Translator: def __init__(self, bot, langs): self.bot = bot self._langs = dict() self._lang_cache = dict() for l in langs: with open(f"src/i18n/{l}.json", "r", encoding="utf8", errors="ignore") as f: ...
# Contributed by Peter Burgers # The matplotlib.numerix package sneaks these imports in under the radar: hiddenimports = [ 'fft', 'linear_algebra', 'random_array', 'ma', 'mlab', ]
from argparse import ArgumentParser from logging import getLogger from multiprocessing import Process from crosscompute.exceptions import ( CrossComputeConfigurationError, CrossComputeError) from crosscompute.routines.automation import Automation from crosscompute.routines.log import ( configure_argument_p...
import numpy as np from tensorflow.keras.layers import Layer, Add, Conv2D, Dropout from tensorflow.keras.layers import Activation, ELU, LeakyReLU, ReLU from tensorflow.keras.layers import AveragePooling2D from tensorflow.keras.layers import BatchNormalization, TimeDistributed from tensorflow.keras.layers import LayerNo...
from django.apps import AppConfig class RecordsConfig(AppConfig): name = "phandler.records" def ready(self): try: import phandler.records.signals # noqa F401 except ImportError: pass
__author__ = 'Gunawan Ariyanto' data_barang = { '111':['Es Krim Walls E', 4500], '222':['Gelas Mug', 5000], '333':['Sandal Jepit',7500], '444':['Kopi Tora Bika Mocca Spesial Grande 700g ', 1500], '555':['D500 Dispenser Air Sanken', 299900...
from data_science_layer.preprocessing.abstract_pre_processor import AbstractPreProcessor from sklearn.preprocessing import PolynomialFeatures class PolynomialFeaturesTransformation(AbstractPreProcessor): _polynomial_features = None degree = 2 interaction_only = False include_bias = True def fit_...
"""Creates some common widgets""" from tkinter import Event, Grid, Listbox, Misc, Pack, Place, StringVar, Text, Canvas, Tk, Toplevel, Variable, Widget, X, VERTICAL, HORIZONTAL, LEFT, BOTTOM, RIGHT, Y, BOTH, END from tkinter.constants import ACTIVE, ALL, E, GROOVE, INSERT, N, NW, RIDGE, S, SE, SINGLE, W from tkinter.ttk...
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import time from gaiatest import GaiaTestCase from gaiatest.mocks.mock_contact import MockContact from marionette.erro...
import ply.lex as lex from qsyasm.error import ParseError class QsyASMLexer: tokens = ( 'INTEGER', 'FLOAT', 'IDENT', 'COMMA', 'LBRACKET', 'RBRACKET', 'LPAREN', 'RPAREN', 'PLUS', 'MIN', 'DIV', 'POW', 'MUL', ...
import sys from flaskApp import db from flaskApp.models import User from flaskApp.error.error_handlers import * from sqlalchemy import text import string class DbSearchOptionUtils(object): def get_top_results_coursename(param, semester): #cursor = db.get_db().cursor() query = " select distinct CNu...
#-*- coding: utf-8 -*- import os import pickle import logging import HtmlXmlTestRunner_pkg.nosexunit import HtmlXmlTestRunner_pkg.nosexunit.const as nconst import HtmlXmlTestRunner_pkg.nosexunit.excepts as nexcepts # Get a logger logger = logging.getLogger('%s.%s' % (nconst.LOGGER, __name__)) class Singleton(object...
# -*- coding: utf-8 -*- # Generated by Django 1.11.3 on 2017-12-04 04:26 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('agency', '0005_auto_20171127_0139'), ] operations = [ migrations.RemoveField( ...
import re def default_authority(request): """ Return the value of the h.authority config settings. Falls back on returning request.domain if h.authority isn't set. """ return request.registry.settings.get("h.authority", request.domain) def client_authority(request): """ Return the autho...
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from .youtube import YoutubeIE from ..utils import ( determine_ext, int_or_none, parse_iso8601, xpath_text, ) class HeiseIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?heise\.de/(?:[^/]+/)+[^/]+-(?P<id...
import os import torch from torch import nn from torch.utils.data.dataloader import DataLoader from src.data_process.dataset import LMDataset from src.train.eval import eval from src.utils.constants import PAD_INDEX from src.utils.logger import Logger def test(args): os.environ['CUDA_VISIBLE_DEVICES'] = str(args.g...
import os import time from prompt_toolkit.formatted_text import FormattedText from iredis import renders from iredis.config import config from iredis.completers import IRedisCompleter def strip_formatted_text(formatted_text): return "".join(text[1] for text in formatted_text) def test_render_simple_string_raw_u...
#! -*- coding: UTF-8 -*- """ Authentication module created by ma0 at contraslash.com """
""" fit motor circle task with external data (not simulated) """ import sys, os import numpy as np import pandas as pd import stan import arviz as az import seaborn as sns sys.path.append('.') from simulations.sim_generalise_gs import generalise_gs_preprocess_func from data_fit.fit_bandit3arm_combined import comp_hdi...
# # PySNMP MIB module LC-PHYSICAL-ENTITIES-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/LC-PHYSICAL-ENTITIES-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 19:55:35 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7....
""" Setup script for installation. """ import os from distutils.core import setup # Utility function to read files. Used for the long_description. def read(fname): """ Reads the description of the package from the README.md file. """ return open(os.path.join(os.path.dirname(__file__), fname)).read() def get_...
from src.Stack.stack_linked_list import Stack def is_balanced(brackets): brackets=brackets.strip() if brackets=='': raise Exception("The string is empty") if '(' not in brackets and ')' not in brackets: raise Exception("This string without brackets") stack=Stack() for bracket in ...
from .goodlogging import *
from joblib import register_parallel_backend def register_cloudbutton(): """ Register Cloudbutton Backend to be called with joblib.parallel_backend("cloudbutton") """ try: from cloudbutton.util.joblib.cloudbutton_backend import CloudbuttonBackend register_parallel_backend("cloudbutton",...
from flask import Blueprint, jsonify import time import logging from ..model import WebUser, WatchedUser, WatchedVideo, Task, TaskStatus,\ ItemOnline, ItemVideoStat, ItemUpStat, ItemRegionActivity,\ TaskFailed,TotalWatchedUser,TotalWatchedVideo,TotalEnabledTask,\ WorkerSt...
import logging from poet_distributed.niches.box2d.cppn import CppnEnvParams from poet_distributed.niches.box2d.model import Model, simulate from poet_distributed.niches.box2d.env import bipedhard_custom, Env_config from inspection_tools.file_utilities import get_model_file_iterator, get_latest_cppn_file logging.basicC...
# django imports from django.contrib import admin # lfs imports from lfs.export.models import CategoryOption from lfs.export.models import Export from lfs.export.models import Script admin.site.register(CategoryOption) admin.site.register(Export) admin.site.register(Script)
from sqlalchemy import Column, String, Text from model.base import Base class JG(Base): __tablename__ = 'jg' class_name = '机构' import_handle_file = ['president', 'vice_president', 'executive_vice_president', 'chairman', 'secretary_general', 'deputy_secretary_general', 'directo...
import rq from basic_test import wait from multi_rq.multi_rq import MultiRQ import numpy as np mrq = MultiRQ() nums = [[(i,j)] for i,j in zip(range(0,20,2),range(11,21))] assert mrq.apply_async(np.mean,nums) == [5.5, 7.0, 8.5, 10.0, 11.5, 13.0, 14.5, 16.0, 17.5, 19.0] assert mrq.apply_async print('multi-rq: all test...
# -*- coding: utf-8 -*- from django.conf import settings from django.contrib.auth.models import User from .models import UploadFileModel, User from django.http import JsonResponse, Http404 from django.http import HttpResponse, HttpResponseRedirect from .models ...
""" DataMeta DataMeta # noqa: E501 The version of the OpenAPI document: 1.4.0 Contact: leon.kuchenbecker@uni-tuebingen.de Generated by: https://openapi-generator.tech """ import unittest import datameta_client_lib from datameta_client_lib.api.files_api import FilesApi # noqa: E501 class Tes...
# -*- coding: utf-8 -*- """ Created on Wed Oct 8 14:45:02 2014. @author: mje """ %reset -f import mne import sys from mne.io import Raw from mne.preprocessing import ICA, create_eog_epochs import matplotlib matplotlib.use('Agg') #from my_settings import * data_path = '/home/mje/mnt/hyades/scratch2/MINDLAB2011...
import logging import os import keyring from getpass import getpass from pathlib import Path from string import Template from decouple import config from .cert_generator import run as generate_cert from .constants import Constants def init_user(user: str): try: __config_current_user_path(user) __co...
import shutil import subprocess from pathlib import Path LOG_PATH = 'logs' HPC_PLATFORM = 'torque' HPC_FILE_NAME = None TEMPLATE_BASE = None TEMPLATE_HPC_CODE = None PYTHON_CLEANUP_CODE_TEMPLATE = None queue_parameters_default = { 'queue_name': 'compute', 'job_name': 'job', 'env': 'base', 'n_nodes': ...
# -*- coding: utf-8 -*- # ====================================================================================================================== # Copyright (©) 2015-2022 LCS - Laboratoire Catalyse et Spectrochimie, Caen, France. = # CeCILL-B FREE SOFTWARE LICENSE AGREEMENT - See ful...
# coding: utf-8 from frontend.root import * if __name__ == '__main__': # Inicia en la pantalla de inicio de sesión. thread1 = Root(icono="frontend/recursos/icon.ico") thread1.mainloop()
__all__=['AsymSphere', 'MultiPeaks', 'MultiSphereAtInterface', 'Parratt', 'Parratt_Biphasic', 'Parratt_New', 'SphereAtInterface', 'SymSphere', 'trialSphere']
# Functions for plotting the data from .configuration_constants import variables_x, variables_y, convective_zone_types, overshoot_directions from shared.plot import set_axes_limits, layout_plot, invert_axes, set_axes_labels as shared_set_axes_labels import matplotlib.lines as mlines def plot(arguments, models, plt): ...
import matplotlib.pyplot as plt import numpy as np def plot_density_cut(rho, rmax=0, plane=2, height=0, *args, **kwargs): """Take a quick look at the loaded data in a particular plane Parameters ---------- rmin,rmax: (3) list; upper and lower cutoffs plane = {0: yz-plane, 1: xz-pl...
import numpy as np from .FillGaps import FillGaps from .InterpGaps import InterpGaps from .InsertGaps import InsertGaps def ResampleTimeSeries(xi,yi,xr,MaxGap,UseSpline=True,AddGaps=False): x = np.copy(xi) y = np.copy(yi) if AddGaps: x,y = InsertGaps(x,y,MaxGap) if MaxGap == None: yn = np.copy(y) else: ...
""" tests.test_extension ==================== Tests for extension """ import json from flask import Flask from flask_swag import Swag def test_extension(): """Basic test for flask extension.""" app = Flask(__name__) app.config['SWAG_TITLE'] = "Test application." app.config['SWAG_API_VERSION'] = '1....
from timeit import default_timer as timer from termcolor import colored from Problem.Problem import Problem from Problem.Problem import ProblemType from Problem.ProblemReport import ProblemReport class ProunciationProblem(Problem): def __init__(self, question, correct_answer): super(ProunciationProblem,...
# coding: utf-8 ### # @file median.py # @author Sébastien Rouault <sebastien.rouault@alumni.epfl.ch> # # @section LICENSE # # Copyright © 2018-2020 École Polytechnique Fédérale de Lausanne (EPFL). # All rights reserved. # # @section DESCRIPTION # # NaN-resilient, coordinate-wise median GAR. ### import too...
import typing from anchorpy.error import ProgramError class SomeError(ProgramError): def __init__(self) -> None: super().__init__(6000, "Example error.") code = 6000 name = "SomeError" msg = "Example error." class OtherError(ProgramError): def __init__(self) -> None: super().__i...
from flask import Blueprint error_blueprint = Blueprint('error_blueprint',__name__) from app.errors import handlers # Doing this import so that the error handlers in it are registered with the blueprint
import types import numpy as np SMALL_GRID = np.array([[0.5581934, -0.82923452, 0.02811105], [0.85314824, -0.15111695, 0.49930127], [0.33363164, 0.92444637, 0.18463162], [-0.79055406, -0.61207313, -0.0197677], [0.54115503, -0.6...
from Models.Application import Application import sqlite3 import os.path class ApplicationRepository: def __init__(self): BASE_DIR = os.path.dirname(os.path.abspath(__file__)) db_path = os.path.join(BASE_DIR, "../database.db") self.connection = sqlite3.connect(db_path) self.cursor ...
from src.domain.pipeline_steps.question_response_evaluator.or_question_response_evaluator import \ ORQuestionResponseEvaluator from src.domain.pipeline_steps.question_response_evaluator.wh_question_response_evaluator import \ WHQuestionResponseEvaluator from src.domain.pipeline_steps.question_response_evaluator...
import argparse import itertools import shlex import unittest2 as unittest class FabricioTestCase(unittest.TestCase): def command_checker(self, args_parsers=(), expected_args_set=(), side_effects=()): def check_command_args(command, **kwargs): try: command_parser = next(args_...
from django.shortcuts import render from django.http import HttpResponse # Create your views here. def index(requet): return HttpResponse("<h1>Hello Veronica</h1>") def working(requet): return HttpResponse("<h1>Working Veronica</h1>")
"""Instance operations and instances.""" import copy import json import logging import requests from objectrocket import bases from objectrocket import util from objectrocket.instances.mongodb import MongodbInstance from objectrocket.instances.elasticsearch import ESInstance from objectrocket.instances.redis import R...