text
stringlengths
1
927k
#!/usr/bin/env python from shutil import copyfile import sqlite3 from datetime import datetime, date import dateutil.relativedelta now = date.today() date2 = now + dateutil.relativedelta.relativedelta(months=-1) copyfile("/home/pi/database/centralheating.db", "/home/pi/database/archive/centralheating-%s.db" % date2) c...
from setuptools import setup, find_packages setup( name="dsaps", version="1.0.0", description="", packages=find_packages(exclude=["tests"]), author="Eric Hanson", author_email="ehanson@mit.edu", install_requires=[ "requests", "structlog", "attrs", "click", ...
#!/usr/bin/python # Cuckoo Sandbox - Automated Malware Analysis # Copyright (C) 2010-2011 Claudio "nex" Guarnieri (nex@cuckoobox.org) # http://www.cuckoobox.org # # This file is part of Cuckoo. # # Cuckoo is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as ...
# Copyright 2016 The TensorFlow 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 applica...
from .Pipe import Pipe import gc class GarbageCollector(Pipe): ''' Probably should be merged with the Dataset handler (?). ''' def __init__(self): gc.enable() def after_epoch(self): gc.collect()
# -*- coding: utf-8 -*- # # Configuration file for the Sphinx documentation builder. # # This file does only contain a selection of the most common options. For a # full list see the documentation: # http://www.sphinx-doc.org/en/master/config # -- Path setup ------------------------------------------------------------...
#!/usr/bin/env python # coding: utf-8 import sagemaker import boto3 import sys import os import glob import re import subprocess from IPython.display import Markdown from time import gmtime, strftime sys.path.append("common") from misc import get_execution_role, wait_for_s3_object from sagemaker.rl import RLEstimator...
#https://github.com/openai/universe-starter-agent/blob/master/envs.py import gym import universe import socketio import eventlet.wsgi from PIL import Image from flask import Flask from io import BytesIO from TORCH_DQN import DQN from enum import Enum import torchvision.transforms as T import ast import torch from env ...
#imports (non-3rd Party) import re import csv import operator from math import sqrt from collections import defaultdict, Counter #Data Structures ##Hashtables for Operations hashMerchant = defaultdict(list) hashStore = defaultdict(list) hashVisitors = defaultdict(list) minA = Counter() maxA = Counter() #Question 1 ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # By Lilian Besson (Naereen) # https://github.com/Naereen/gym-nes-mario-bros # MIT License https://lbesson.mit-license.org/ # from __future__ import division, print_function # Python 2 compatibility import os import sys from collections import deque from time import sleep...
""" Variational encoder model, used as a visual model for our model of the world. """ import torch import torch.nn as nn import torch.nn.functional as F class Decoder(nn.Module): """ VAE decoder """ def __init__(self, img_channels, latent_size): super(Decoder, self).__init__() self.latent_size ...
#!/usr/bin/env python # encoding: utf-8 ''' @author: caroline @license: (C) Copyright 2019-2022, Node Supply Chain Manager Corporation Limited. @contact: caroline.fang.cc@gmail.com @software: pycharm @file: account_createAccount.py @time: 2020/1/8 5:38 下午 @desc: ''' from stake_last_all_api.API import request_Api '''2...
# This Python file uses the following encoding: utf-8 from panflute import * import pandoc_codeblock_include def conversion(markdown, format='markdown'): doc = convert_text(markdown, standalone = True) doc.format = format pandoc_codeblock_include.main(doc) return doc def verify_conversion(markdown, ...
#!/usr/bin/env python ############################################################################### # $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test SRTMHGT support. # Author: Even Rouault < even dot rouault @ mines-paris dot org > # #########################################################################...
# 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 ...
from pathlib import Path import shutil import os import sys def convert_repo_to_fork(path2repo): path_fork = path2repo.parent / "yolov5-icevision" # path of our fork if path_fork.is_dir(): shutil.rmtree(path_fork) path_fork.mkdir(exist_ok=True) _ = shutil.copytree(path2repo, path_fork, dir...
''' Function: 2048小游戏 Author: Charles 微信公众号: Charles的皮卡丘 ''' import cfg import sys import pygame from modules.utils import * from modules.Game2048 import * from modules.endInterface import * '''主程序''' def main(cfg): # 游戏初始化 pygame.init() screen = pygame.display.set_mode(cfg.SCREENSIZE) pygame.display.set_capti...
from .events import EventRelatedObjectPermission class ContentPermission(EventRelatedObjectPermission): allow_delete = False
from Tkinter import * import tkMessageBox root = Tk() def callback(): print 'called the callback!' # code here filename = 'x' try: fp = open(filename) except: tkMessageBox.showwarning( 'Open file', 'Cannot open this file\n(%s)' % filename ) # return if tkMessageBox.askye...
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
""" Creates iCGM Sensors given a trueBG trace The Dexcom G6 Specifications in this file are publicly available from: “EVALUATION OF AUTOMATIC CLASS III DESIGNATION FOR Dexcom G6 Continuous Glucose Monitoring System.” n.d. https://www.accessdata.fda.gov/cdrh_docs/reviews/DEN170088.pdf. """ # %% Libraries ...
from __future__ import absolute_import, division, print_function from cctbx import crystal import cctbx.crystal.coordination_sequences from cctbx import sgtbx, xray import cctbx.crystal.direct_space_asu from cctbx import uctbx from cctbx.array_family import flex from scitbx import matrix from libtbx.test_utils import E...
""" Miscellaneous non-bitcoin-related tools used throughout this package. """ ################################################################################ # source: http://stackoverflow.com/a/22729414 class classproperty(object): """ @classmethod+@property """ def __init__(self, f): self.f = class...
"""Visualization of how data are distributed, split or colored by a categorical variable.""" import copy import warnings import numpy as np import pandas as pd import colorcet import bokeh.models import bokeh.plotting from . import utils def ecdf( data=None, q=None, cats=None, q_axis="x", pal...
#!/usr/bin/python # coding: utf-8 -*- # (c) 2017 Dag Wieers <dag@wieers.com> # # 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 # ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Feb 2 18:34:05 2020 @author: leemshari """ # I wanted to create an n cubed icon #My goal was to get this to get this to print with & or @ signs but I was unable to #get this array to look decent with anything but integers. #I changed the dtype to str ...
# stdlib from typing import Dict as TypeDict from typing import List as TypeList from typing import Optional from typing import Type # third party from nacl.signing import VerifyKey # relative from ......logger import traceback_and_raise # type: ignore from .....adp.data_subject_ledger import DataSubjectLedger # ty...
import init_order init_order.initialized = True print('first')
#!/usr/bin/env python3 import unittest import test_elements import test_accelerator import test_tracking import test_lattice import test_optics suite_list = [] suite_list.append(test_elements.get_suite()) suite_list.append(test_accelerator.get_suite()) suite_list.append(test_lattice.get_suite()) suite_list.append(te...
#!/usr/bin/env python3 # # Copyright 2021 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
import numpy as np import pytest import pandas as pd from pandas import DataFrame import pandas._testing as tm class TestDataFrameFilter: def test_filter(self, float_frame, float_string_frame): # Items filtered = float_frame.filter(["A", "B", "E"]) assert len(filtered.columns) == 2 ...
from argparse import Namespace, ArgumentParser from spotty.commands.abstract_config_command import AbstractConfigCommand from spotty.commands.writers.abstract_output_writrer import AbstractOutputWriter from spotty.providers.abstract_instance_manager import AbstractInstanceManager class StartCommand(AbstractConfigComm...
from django.urls import path,include from rest_framework.routers import DefaultRouter from profiles_api import views router = DefaultRouter() router.register('hello-viewset',views.HelloViewSet,base_name='hello-viewset') router.register('profile',views.UserProfileViewSet) router.register('feed',views.UserProfileFeedVie...
""" Translation main class """ from __future__ import unicode_literals, print_function import torch from onmt.inputters.text_dataset import TextMultiField class TranslationBuilder(object): """ Build a word-based translation from the batch output of translator and the underlying dictionaries. Replace...
# single source of truth for package version, # see https://packaging.python.org/en/latest/single_source_version/ __version__ = "0.2.3" VERSION = __version__ # app name to send as part of requests app_name = "funcX Endpoint v{}".format(__version__)
ACHIEVEMENTS = [ ("old", { "name": "Олды здесь", "description": "Почётный ранний член Клуба", "image": "https://i.vas3k.club/3bl.png", "style": "color: #FFF; background-color: #65c3ba;", }), ("investor_1000", { "name": "Ёрли Инвестор", "description": "Человек,...
# -*- coding: utf-8 -*- from __future__ import print_function import pytest def test_200_success(petstore): result = petstore.user.deleteUser(username='bozo').result() assert result is None @pytest.mark.xfail(reason="Can't get this to 404") def test_404_user_not_found(petstore): result = petstore.user....
from django.views import generic from .forms import * from django.shortcuts import render, redirect, get_object_or_404 from .forms import PostForm from .models import Post, Blog from django.views.generic import ListView, DetailView from django.contrib.auth.models import User, auth from django.contrib import messages ...
"""Module for ir registry.""" from __future__ import absolute_import IR_REGISTRY = {}
#!/usr/bin/env python # encoding: utf-8 """ Plot distributions of difference pixels. """ import os import numpy as np import astropy.io.fits from matplotlib.figure import Figure from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas import matplotlib.gridspec as gridspec def plot_diffs(mosaic_d...
#!/usr/bin/env python3 from hypothesis import given, settings import hypothesis.strategies as st from multiprocessing import Process import numpy as np import tempfile import shutil import caffe2.python.hypothesis_test_util as hu import unittest op_engine = 'GLOO' class TemporaryDirectory: def __enter__(s...
# -*- coding: utf-8 -*- # Generated by Django 1.10.8 on 2018-06-23 12:14 from __future__ import unicode_literals import django.contrib.postgres.fields from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('inventory', '0037_aut...
from StructuralAnalysis.Node import Node from math import sqrt import numpy as np from abc import abstractmethod, ABC from StructuralAnalysis.DegreeOfFreedom import DegreeOfFreedom from StructuralAnalysis.Section import Section from StructuralAnalysis.Material import Material class Element(ABC): """ This clas...
def ceulcius(x): return (x - 32)/1.8 x = int(input('Digite uma temperatura em (F°): ')) print(f'A temperatura digitada em {x}F°, é igual a {ceulcius(x):.1f}C°')
from django.contrib import admin from django.urls import path from mapserverapp import views urlpatterns = [ path('', views.home,name="home"), ]
from django.contrib import admin from django.contrib.contenttypes import generic from django.db.models import Q from models import Member, Membership, MemberAltname from models import CoalitionMembership, Correlation, Party, \ Award, AwardType, Knesset from links.models import Link from video.models import Video f...
# -*- coding: utf-8 -*- # @Date : 2021-01-07 # @Author : AaronJny # @LastEditTime : 2021-01-28 # @FilePath : /app/luwu/core/models/classifier/kerastuner/__init__.py # @Desc : """ 这是还在规划中的功能,里面的代码目前都是无用的。 TODO:增加KerasTuner相关功能 """
############################################################################### # PyDial: Multi-domain Statistical Spoken Dialogue System Software ############################################################################### # # Copyright 2015 - 2019 # Cambridge University Engineering Department Dialogue Systems Grou...
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.response.AlipayResponse import AlipayResponse class AlipayUserElectronicidOutermerchantbarcodeCreateResponse(AlipayResponse): def __init__(self): super(AlipayUserElectronicidOutermerchantbarcodeCreateResponse, self).__init__()...
# coding: utf-8 """ LUSID API FINBOURNE Technology # noqa: E501 The version of the OpenAPI document: 0.11.3725 Contact: info@finbourne.com Generated by: https://openapi-generator.tech """ try: from inspect import getfullargspec except ImportError: from inspect import getargspec as getf...
from .resource import Resource from .resource_item import ResourceItem from .location_item import LocationItem from .location import Location from .worker_item import WorkerItem from .worker import Worker from .schedulable import Schedulable from .event_item import EventItem from .event import Event from .resource_allo...
import itertools from typing_extensions import Protocol import warnings import torch from ..parameter import is_lazy class _LazyProtocol(Protocol): """This is to avoid errors with mypy checks for The attributes in a mixin: https://mypy.readthedocs.io/en/latest/more_types.html#mixin-classes """ de...
import json import logging import os import requests import sys from requests_toolbelt.multipart.encoder import MultipartEncoder logging.basicConfig(format='%(asctime)s %(levelname)s: %(message)s', level=logging.INFO, stream=sys.stdout) TTNMAPPER_URL = "https://www.ttnmapper.o...
# coding: utf-8 """ Kubernetes No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 The version of the OpenAPI document: v1.16.14 Generated by: https://openapi-generator.tech """ import pprint import re # noqa: F401 import six f...
#!/usr/bin/env python3 import os from enum import Enum import numpy as np import scipy.sparse as sps from sklearn.preprocessing import LabelEncoder from tqdm import tqdm, trange from cython_modules.leave_one_out import train_test_loo_split as __train_test_loo_split_cython from csv_utils import load_csv, export_csv fro...
from pathlib import Path def broadcast_arguments(**arguments): """Broadcast arguments. All passed keyword arguments are broadcasted to the argument with the most elements. If `n` is the maximum number of elements per keyword arguments, single elements are duplicated `n`-times. Arguments with `n` ele...
# This file is part of the Python aiocoap library project. # # Copyright (c) 2012-2014 Maciej Wasilak <http://sixpinetrees.blogspot.com/>, # 2013-2014 Christian Amsüss <c.amsuess@energyharvesting.at> # # aiocoap is free software, this file is published under the MIT license as # described in the accompany...
import scipy.io as sio import numpy as np import os import mne import gigadata import matplotlib.pyplot as plt from sklearn.discriminant_analysis import LinearDiscriminantAnalysis from sklearn.model_selection import ShuffleSplit, cross_val_score from pyriemann.estimation import Covariances from mne import Epochs, p...
from rest_framework.views import APIView from rest_framework.response import Response from rest_framework import status from . import models, serializers from django.db.models import Q class ListAllChatRooms(APIView): def get(self, request, format=None): user = request.query_params.get('username', None) ...
#!/usr/bin/env python3 # SPDX-License-Identifier: GPL-2.0 # # Copyright (C) Google LLC, 2020 # # Author: Nathan Huckleberry <nhuck@google.com> # """A helper routine run clang-tidy and the clang static-analyzer on compile_commands.json. """ import argparse import json import multiprocessing import os import subprocess ...
""" .. _intermediate_using_spark_tasks: Creating spark tasks as part of your workflow OR running spark jobs ------------------------------------------------------------------------ This example shows how flytekit simplifies usage of pyspark in a users code. The task ``hello_spark`` runs a new spark cluster, which whe...
# Copyright (c) Contributors to the aswf-docker Project. All rights reserved. # SPDX-License-Identifier: Apache-2.0 """ Tests for the build command """ import os import unittest import logging import tempfile from click.testing import CliRunner from aswfdocker import builder, aswfinfo, index, constants, groupinfo fr...
import jwt import datetime from jwt import exceptions def createToken(payload, timeout=20) -> str: """ :param payload: 例如:{'user_id':1,'username':'whw'}用户信息 :param timeout: token的过期时间,默认20分钟 :return: """ headers = { 'typ': 'jwt', 'alg': 'HS256' } payload['exp'] = datet...
#!/usr/bin/env python3 """Generates Nvim :help docs from C/Lua docstrings, using Doxygen. Also generates *.mpack files. To inspect the *.mpack structure: :new | put=v:lua.vim.inspect(msgpackparse(readfile('runtime/doc/api.mpack'))) Flow: main extract_from_xml fmt_node_as_vimhelp \ ...
from .base import Operator, Job, ReadOnlyJob from .object_store import ObjectFragment, FileSystemObjectStore, ZipObjectStore
# -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2017-10-11 19:52 from __future__ import unicode_literals from django.db import migrations from ..hashers import PBKDF2WrappedSHA1PasswordHasher def forwards_func(apps, schema_editor): User = apps.get_model('account', 'User') users = User.objects.filter...
#!/usr/bin/python #+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ #|R|a|s|p|b|e|r|r|y|P|i|.|c|o|m|.|t|w| #+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ # Copyright (c) 2014, raspberrypi.com.tw # All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # # Author : sosorr...
from zeroconf import ServiceBrowser, Zeroconf class MyListener: def remove_service(self, zeroconf, type, name): print("Service %s removed" % (name,)) def add_service(self, zeroconf, type, name): info = zeroconf.get_service_info(type, name) print("Service %s added, service info: %s" %...
import re from typing import List, Dict from pytorch_sound.data.eng_handler import cleaners from pytorch_sound.data.eng_handler.symbols import symbols # Mappings from symbol to numeric ID and vice versa: _symbol_to_id: Dict[str, int] = {s: i for i, s in enumerate(symbols)} _id_to_symbol: Dict[int, str] = {i: s for i,...
''' Created on May 24, 2018 @author: fan To have a better grid denser at the beginning ''' import time as time import numpy as np from numba import jit import logging logger = logging.getLogger(__name__) # @vectorize([float64(float64, float64, float64, float64, float64, float64, float64, float64)]) def grid_to_...
from quarkchain.utils import sha3_256 from quarkchain.evm import utils """ Blooms are the 3-point, 2048-bit (11-bits/point) Bloom filter of each component (except data) of each log entry of each transaction. We set the bits of a 2048-bit value whose indices are given by the low order 11-bits of the first three double...
# coding=utf-8 # Copyright 2021 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...
# model settings norm_cfg = dict(type='BN', requires_grad=False) model = dict( type='RFCN', pretrained='open-mmlab://resnet101_caffe', backbone=dict( type='ResNet', depth=101, num_stages=4, out_indices=(2, 3), frozen_stages=1, dilations=(1, 1, 1, 2), s...
"""This module contains the general information for DupeIntRequestor ManagedObject.""" from ...ucscmo import ManagedObject from ...ucsccoremeta import UcscVersion, MoPropertyMeta, MoMeta from ...ucscmeta import VersionMeta class DupeIntRequestorConsts(): pass class DupeIntRequestor(ManagedObject): """This ...
# -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, division import os import numpy as np import tensorflow as tf import niftynet.utilities.histogram_standardisation as hs from niftynet.layer.base_layer import DataDependentLayer from niftynet.layer.base_layer import Invertible from niftyn...
# -*- coding: utf-8 -*- # Generated by Django 1.10 on 2016-09-16 17:24 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('plataforma', '0009_auto_20160914_1632'), ] operations = [ migrations.AlterFie...
import json import os import re import subprocess # Get a diff between master and current. try: commit_range = os.environ["TRAVIS_COMMIT_RANGE"] changed_files = subprocess.check_output(["git", "diff", "--name-only", commit_range]) except KeyError: print("🔥 This should be run on Travis. Otherwise make sure...
import unittest class KerrMotorTestCase(unittest.TestCase): def test_something(self): self.assertEqual(True, False) def test_float_to_hexstr(self): pass if __name__ == '__main__': unittest.main()
__author__ = 'joon' from pascaltools.process import get_pascal_classes, get_pascal_classes_bg from pascaltools.io import get_pascal_indexlist, load_pascal_annotation, load_pascal_conf from seedtools.heatmap import heatmap2segconf from densecrftools.densecrf import CRF
from pyramid.scripting import prepare from pyramid.scripts.common import get_config_loader def setup_logging(config_uri, global_conf=None): """ Set up Python logging with the filename specified via ``config_uri`` (a string in the form ``filename#sectionname``). Extra defaults can optionally be specifi...
# Copyright 2021 NVIDIA 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 in wr...
import random import sys # Ascii art - made of ascii characters ALL_CLOSED = """ +------+ +------+ +------+ | | | | | | | 1 | | 2 | | 3 | | | | | | | | | | | | | | | | | | | +------+ +------+ +------+""" FIRST_GOAT = """ +------+ +-...
import logging log = logging.getLogger(__name__) import pickle as pickle from copy import deepcopy import numpy as np from atom.api import Typed, Bool, Str, observe, Property from enaml.application import deferred_call from enaml.layout.api import InsertItem, InsertTab from enaml.workbench.plugin import Plugin from...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Software License Agreement (BSD License) # # Copyright (c) 2017 Svenzva Robotics, 2010-2011, Antons Rebguns. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following condition...
from rest_framework import permissions, serializers, viewsets from ....models import FailedToParseScheduleException, Schedule, parse_schedule_trigger from .shared import ADMIN_RENDERER_CLASSES class ScheduleSerializer(serializers.HyperlinkedModelSerializer): plugin_id = serializers.IntegerField() kwargs = se...
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
import os import re import traceback from enum import Enum from typing import Iterable, List, Optional import click import urllib3 from pygitguardian import GGClient from pygitguardian.models import Match from requests import Session from .text_utils import Line, LineCategory REGEX_PATCH_HEADER = re.compile( r"...
import sys import os import unittest import platform import subprocess from test import test_support class PlatformTest(unittest.TestCase): def test_architecture(self): res = platform.architecture() if hasattr(os, "symlink"): def test_architecture_via_symlink(self): # issue3762 de...
#!/usr/bin/env python NAME = 'Wallarm' def is_waf(self): return self.matchheader(('server', "nginx-wallarm"))
import textwrap import re from .format_commit_text import format_commit_text RE_DESCRIPTION_DELIMITER = r"(?![\w\d])\.\s+" def format_commit_description(description): text = " ".join([ format_commit_text(x) for x in re.split(RE_DESCRIPTION_DELIMITER, description) if len(x) ]) ret...
# Copyright 2016 The TensorFlow 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 applica...
# coding: utf-8 """ RadioManager RadioManager # noqa: E501 OpenAPI spec version: 2.0 Contact: support@pluxbox.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import unittest import radiomanager_sdk from radiomanager_sdk.models.b...
import numpy as np from flask import Flask, request, jsonify, render_template import pickle app = Flask(__name__) model = pickle.load(open('model.pkl', 'rb')) @app.route('/') def home(): return render_template('index.html') @app.route('/predict', methods=['GET', 'POST']) def predict(): ''' For renderin...
#!/usr/bin/env python3 # Copyright (c) 2015-2016 The Bitsend Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """ This module contains utilities for doing coverage analysis on the RPC interface. It provides a way t...
description = 'Monochromator slit devices' pvmcu = 'SQ:CAMEA:mcu2:' devices = dict( mst = device('nicos_ess.devices.epics.motor.EpicsMotor', description = 'Monochromator slit top', motorpv = pvmcu + 'mst', errormsgpv = pvmcu + 'mst-MsgTxt', precision = 0.02, ), msb = device...
# -*- coding: utf-8 -*- """ jinja2.lexer ~~~~~~~~~~~~ This module implements a Jinja / Python combination lexer. The `Lexer` class provided by this module is used to do some preprocessing for Jinja. On the one hand it filters out invalid operators like the bitshift operators we don't allow...
import FWCore.ParameterSet.Config as cms from DQMServices.Core.DQMEDHarvester import DQMEDHarvester triggerSynchTest = DQMEDHarvester("DTLocalTriggerSynchTest", # prescale factor (in luminosity blocks) to perform client analysis diagnosticPrescale = cms.untracked.int32(1), # run in online environment r...
from ...abc import Expression from ..value.valueexpr import VALUE class STARTSWITH(Expression): Attributes = { "What": ["str"], "Prefix": ["str"], } Category = "String" def __init__(self, app, *, arg_what, arg_prefix): super().__init__(app) if isinstance(arg_what, Expression): self.What = arg_what...
# -*- coding: utf-8 -*- # Scrapy settings for spider project # # For simplicity, this file contains only settings considered important or # commonly used. You can find more settings consulting the documentation: # # http://doc.scrapy.org/en/latest/topics/settings.html # http://scrapy.readthedocs.org/en/latest/...
from django.conf import settings from pipeline import manifest class StaticManifest(manifest.PipelineManifest): def cache(self): if getattr(settings, "PIPELINE_ENABLED", None) or not settings.DEBUG: for package in self.packages: if self.pcs: filename = self...