text
stringlengths
1
927k
"""gRPC service specific tests""" import os import pytest from ansys.mapdl.core import examples PATH = os.path.dirname(os.path.abspath(__file__)) # skip entire module unless HAS_GRPC pytestmark = pytest.mark.skip_grpc def test_clear_nostart(mapdl): resp = mapdl._send_command('FINISH') resp = mapdl._send_c...
try: # Assume we're a sub-module in a package. from functions.basic_functions import ( partial, const, defined, is_none, not_none, nonzero, equal, not_equal, at_least, more_than, safe_more_than, less_than, between, not_between, is_ordered, apply_dict, ) from functions.cast_functions...
import SimpleHTTPServer import SocketServer import webbrowser PORT = 8000 def start(): HttpHandler = SimpleHTTPServer.SimpleHTTPRequestHandler httpd = SocketServer.TCPServer(("", PORT), HttpHandler) print("Starting server at port 8000") webbrowser.open('http://localhost:8000') # open in a new tab httpd.serve_for...
from __future__ import print_function, absolute_import, division import tensorflow as tf # from keras.backend.tensorflow_backend import set_session # config = tf.ConfigProto() # config.gpu_options.per_process_gpu_memory_fraction = 0.9 # set_session(tf.Session(config=config)) import numpy as np from collections import C...
import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) GPIO.setup(4, GPIO.IN, pull_up_down=GPIO.PUD_UP) firstinput = False; def write_status(status): if(status == False): print("False"); else: print("True"); input_state = GPIO.input(4); firstinput = input_state; write_status(firstinput...
#!/usr/bin/env python from os.path import ( join, realpath, ) import sys; sys.path.insert(0, realpath(join(__file__, "../../"))) import unittest from hummingbot.strategy.pure_market_making.data_types import InventorySkewBidAskRatios from hummingbot.strategy.pure_market_making.inventory_skew_calculator import ...
from tkinter import * import mysql.connector root = Tk() root.title("Doidera") root.geometry("400x400+200+200") # Conectar ao banco my_db = mysql.connector.connect( host="localhost", user="root", passwd="YourPassword", database="doidera" ) # Criar um cursor e inicializa-lo my_cursor = my_db.cursor() ...
from .buckets import *
# Created By: Virgil Dupras # Created On: 2006/11/18 # Copyright 2010 Hardcoded Software (http://www.hardcoded.net) # # This software is licensed under the "BSD" License as described in the "LICENSE" file, # which should be included with this package. The terms are also available at # http://www.hardcoded.net/licens...
import matplotlib.pyplot as plt import numpy as np import matplotlib as mpl import pandas as pd import sys sys.path.append("..") sys.path.append("../technical-analysis_python/") mpl.use('tkagg') # issues with Big Sur # technical analysis from strategy.macd_crossover import macdCrossover from backtest import Backtest...
import os os.environ["OMP_NUM_THREADS"] = "1" import argparse import numpy as np import numpy.random as npr import mimo from mimo.distributions import NormalWishart from mimo.distributions import GaussianWithNormalWishart from mimo.distributions import MatrixNormalWishart from mimo.distributions import LinearGauss...
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "type16.settings") try: from django.core.management import execute_from_command_line except ImportError: # The above import may fail for some other reason. Ensure that the ...
from pandac.PandaModules import * from direct.task import Task from DistributedNodeAI import DistributedNodeAI from CartesianGridBase import CartesianGridBase class DistributedCartesianGridAI(DistributedNodeAI, CartesianGridBase): notify = directNotify.newCategory("DistributedCartesianGridAI") RuleSeparator ...
from typing import Any, Callable, Dict, List, Tuple from django.conf import settings from django.db.models.query import Prefetch from django.utils import timezone from sentry_sdk.api import capture_exception from ee.clickhouse.client import sync_execute from ee.clickhouse.queries.trends.breakdown import ClickhouseTre...
from django.test import TestCase class HomeTest(TestCase): def setUp(self): self.response = self.client.get('/') def test_get(self): """ GET / must return status code 200 """ self.assertEqual(200, self.response.status_code) def test_template_get(self): """ Must use index.html """ self.assertTemplateUse...
"""Support for locks which integrates with other components.""" from __future__ import annotations import voluptuous as vol from homeassistant.components.lock import ( PLATFORM_SCHEMA, STATE_JAMMED, STATE_LOCKING, STATE_UNLOCKING, LockEntity, ) from homeassistant.const import ( CONF_NAME, ...
# Licensed to Elasticsearch B.V. under one or more contributor # license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright # ownership. Elasticsearch B.V. licenses this file to you under # the Apache License, Version 2.0 (the "License"); you may # not use this f...
#!/usr/bin/python3 import sys import re from hashlib import sha256 Libs = { } CurrentLib = None CurrentFunction = None def hash_lib_fn_asm(lib, fn): return "0x" + ", 0x".join(re.findall('..', sha256((lib + ":" + fn).encode('utf-8')).hexdigest())) def hash_lib_fn_c(lib, fn): return "\\x" + "\\x".join(re.finda...
#!usr/bin/env python3 import argparse from RtmTester.Rtm import Rtm from RtmTester.TimingTester import TimingTester def get_args(): """ Parse and return the inputs arguments. """ parser = argparse.ArgumentParser( description='LCLS2 MPS RTM Test Application') parser.add_argument( ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Author: Bertrand256 # Created on: 2017-10 import os import sqlite3 import logging import threading from typing import List import thread_utils log = logging.getLogger('dmt.db_intf') class DBCache(object): """Purpose: coordinating access to a database cache (sqli...
#! /usr/bin/env python """This module implements test to check against the IMSCC Profile 1.1 specification defined by IMS GLC""" from types import StringTypes import string import pyslet.xml.namespace as xmlns import pyslet.xml.xsdatatypes as xsi import pyslet.imscpv1p2 as imscp import pyslet.imscc_profilev1p0 as v1p...
import tensorflow as tf from . import regularization from .print_object import print_obj class Discriminator(object): """Discriminator that takes image input and outputs logits. Fields: name: str, name of `Discriminator`. kernel_regularizer: `l1_l2_regularizer` object, regularizar for kernel...
#!/usr/bin/env python2 # # Copyright Notice: # Copyright 2016-2019 DMTF. All rights reserved. # License: BSD 3-Clause License. For full text see link: https://github.com/DMTF/Redfish-Interface-Emulator/blob/master/LICENSE.md # Python unittests for the Redfish Interface Emulator import argparse import unittest import ...
# Created by: Aditya Dua # 25 July, 2017 """ This module contains all common helpful methods used in testing toolbox functionality """ import numpy as np import numpy.testing as npt def matrix_mismatch_string_builder(rec_mat, exp_mat): expected_mat_str = np.array2string(np.asarray(exp_mat)) received_mat_str =...
# 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 logging import os import os.path import urllib from edge.writer.solrtemplateresponsewriter import SolrTemplateResponseWriter from edge.response.solrjsontemplateresponse import SolrJsonTemplateResponse class Writer(SolrTemplateResponseWriter): def __init__(self, configFilePath): super(Writer, self)....
# Copyright (c) 2015 Shotgun Software Inc. # # CONFIDENTIAL AND PROPRIETARY # # This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit # Source Code License included in this distribution package. See LICENSE. # By accessing, using, copying or modifying this work you indicate your # agreement to the S...
from django import forms from jobsapp.models import Job, Applicant class CreateJobForm(forms.ModelForm): class Meta: model = Job exclude = ('user', 'created_at',) labels = { "last_date": "Last Date", "company_name": "Company Name", "company_description"...
import argparse import distutils.util import github import requests from colorama import Fore, Style from classroom_tools import github_utils from classroom_tools.verifications import repo_is_template parser = argparse.ArgumentParser('Create test repositories') parser.add_argument( '--token', required=True, ...
# Copyright (c) 2015 # # All rights reserved. # # This file is distributed under the Clear BSD license. # The full text can be found in LICENSE in the root directory. import re import rootfs_boot import ipv6_setup import lib from lib import streamboost, installers from devices import board, wan, lan, wlan, prompt # ...
from .segments import active_task, context, next_task, pending_tasks_count, taskwarrior
#!/usr/bin/env python import os import subprocess import shlex import sys print("Python version: " + sys.version) def env(env_name): return os.environ[env_name] def env_or_none(env_name): return os.environ.get(env_name) def env_or_empty(env_name): result = env_or_none(env_name) if result is None...
from django.conf.urls import url from django.contrib.auth import views from homes.views import areaslist,houses urlpatterns = [ url(r'^areas$',areaslist.AreasListView.as_view(),name='areas'), url(r'^houses$',houses.HousesView.as_view(),name='houses'), ]
# Copyright 2014 IBM Corp # (C) Copyright 2015,2016 Hewlett Packard Enterprise Development LP # Copyright 2017 Fujitsu LIMITED # # 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.a...
#!/usr/bin/python # ex:ts=4:sw=4:sts=4:et # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- # The unittest framwork doesn't play nice with pylint: # pylint: disable-msg=C0103 from __future__ import absolute_import import unittest import svtplay_dl.output from mock import patch # FIXME: use mock fra...
from .test_base import BaseTestCase class MainHandlerTest(BaseTestCase): def testFormSubmit(self): data = self.queue.get() ...
import sys, os, random, pygame sys.path.append(os.path.join("objects")) import SudokuSquare from utils import * from GameResources import * def play(values, result, history): assignments = reconstruct(result, history) pygame.init() size = width, height = 700, 700 screen = pygame.display.set_mode(size...
import textwrap from StringIO import StringIO from pykit.p3json.test import PyTest class TestIndent(object): def test_indent(self): h = [['blorpie'], ['whoops'], [], 'd-shtaeou', 'd-nthiouh', 'i-vhbjkhnth', {'nifty': 87}, {'field': 'yes', 'morefield': False} ] expect = textwrap.deden...
# Copyright (c) Facebook, Inc. and its affiliates. import os from os.path import join from os import listdir from cv2 import FONT_HERSHEY_COMPLEX # import json import numpy as np import cv2 import pickle import torch # from smplx import SMPL from eft.models import SMPL_19 from eft.utils.imutils import crop, crop_bbo...
# coding: utf-8 import re import datetime from django.conf import settings from django.core.files import temp as tempfile from django.contrib.auth import admin # Register auth models with the admin. from django.contrib.auth.models import User, Permission, UNUSABLE_PASSWORD from django.contrib.contenttypes.models impor...
import sys def main(filepath): with open(filepath, 'r') as f: for line in f.readlines(): if line: line = line.strip() print number_in_words(int(line)) + 'Dollars' def number_in_words(number): # set the word lists numbers = ['Zero', 'One', 'Two', '...
""" This module implements the plot_missing(df) function's calculating intermediate part """ from typing import Optional, Tuple, Union, List import dask import dask.array as da import dask.dataframe as dd import numpy as np import pandas as pd from scipy.stats import rv_histogram from ...errors import Unreach...
# Portions copyright (c) Facebook, Inc. and its affiliates. (http://www.facebook.com) # pyre-unsafe """A flow graph representation for Python bytecode""" from __future__ import annotations import sys from contextlib import contextmanager from types import CodeType from typing import Generator, List, Optional from . i...
# Generated by Django 3.1.4 on 2021-01-02 05:36 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("group", "0003_auto_20201210_2050"), ] operations = [ migrations.AlterField( model_name="group", name="description", ...
# -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the #...
"“”General viwes.“”" from .csrf import * from .user import *
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import math import torch.nn.functional as F from fairseq import utils import torch from torch import Tensor from . import FairseqCriterion, ...
import pylab def rgb2gray(rgb_image): "Based on http://stackoverflow.com/questions/12201577" # [0.299, 0.587, 0.144] normalized gives [0.29, 0.57, 0.14] return pylab.dot(rgb_image[:, :, :3], [0.29, 0.57, 0.14]) def initialize(usegpu): return 1 def describe(image): return rgb2gray(image).reshap...
import glob from itertools import cycle from os import path import numpy as np import pandas as pd import plotly.express as px import plotly.graph_objs as go import streamlit as st from gensim.models import KeyedVectors, Word2Vec from sklearn.cluster import KMeans from sklearn.decomposition import PCA from sklearn.man...
""" Library to fetch and parse the public Princeton SEAS Faculty directory as a Python dictionary or JSON data source. """ __version__ = '1.0.0' __author__ = "Jérémie Lumbroso <lumbroso@cs.princeton.edu>" __all__ = [ "CosPersonType", "CosPersonInformation", "fetch_cos_people_directory", ] from princeto...
# -*- coding: utf-8 -*- from setuptools import setup setup(name='compatstudy', url='http://github.com/rogalski/python-compat-libs-study', author='Łukasz Rogalski', author_email='rogalski.91@gmail.com', license='MIT', packages=['compatstudy'] )
MOUNT_PATH = "" # in case you are mounting data storage externally SPLIT = 'mini_val' KITTI_WORK_DIR = MOUNT_PATH + "" KITTI_DATA_DIR = MOUNT_PATH + "" #NUSCENES_WORK_DIR = MOUNT_PATH + "/storage/slurm/kimal/eagermot_workspace/nuscenes" #NUSCENES_DATA_DIR = MOUNT_PATH + "/storage/slurm/kimal/datasets_original/nuscen...
#!/usr/bin/env python3 from testUtils import Utils import testUtils import time from Cluster import Cluster from WalletMgr import WalletMgr from Node import BlockType from Node import Node import signal from TestHelper import AppArgs from TestHelper import TestHelper import decimal import math import re ############...
from unittest import mock from django.test import TestCase, override_settings from wagtail.images import get_image_model from wagtail.images.tests.utils import get_test_image_file from wagtail_factories import ImageFactory from wagtailaltgenerator.providers import DescriptionResult from wagtailaltgenerator.providers....
# Licensed under the MIT license # http://opensource.org/licenses/mit-license.php # # Copyright (C) 2006 Fluendo, S.A. (www.fluendo.com). # Copyright 2006, Frank Scholz <coherence@beebits.net> import socket import time from twisted.internet.protocol import DatagramProtocol from twisted.internet import reactor from tw...
import graphene from ...tests.utils import assert_no_permission, get_graphql_content PRIVATE_KEY = "private_key" PRIVATE_VALUE = "private_vale" PUBLIC_KEY = "key" PUBLIC_VALUE = "value" QUERY_SELF_PUBLIC_META = """ { me{ metadata{ key value } ...
import LevelBuilder from sprites import * def render(name,bg): lb = LevelBuilder.LevelBuilder(name+".plist",background=bg) lb.addObject(Beam.BeamSprite(x=240, y=166,width=60,height=10,angle='0',restitution=0.2,static='false',friction=0.5,density=10 ).setName('Beam4')) lb.addObject(Beam.BeamSprite(x=445, y=222,width=...
from app import db class Player(db.Model): __tablename__ = "players" id = db.Column(db.Integer, primary_key=True, autoincrement=True) name = db.Column(db.String(128)) # TODO maybe make uid and provider TOGETHER be unique # UniqueConstraint('col2', 'col3', name='uix_1') uid = db.Column(db...
#! /usr/bin/env python # ______________________________________________________________________ '''test_fbcorr Test the fbcorr() example .... ''' # ______________________________________________________________________ import numpy as np import numba from numba.decorators import jit nd4type = numba.double[:,:,:,:] ...
# Copyright (C) 2020-2022 Intel Corporation # SPDX-License-Identifier: Apache-2.0 import sys from datetime import datetime import os from pathlib import Path from openvino.tools.pot.app.argparser import get_common_argument_parser, check_dependencies from openvino.tools.pot.configs.config import Config from openvino....
# flake8: noqa # @TODO: code formatting issue for 20.07 release from typing import Any, Dict, List, Optional, Tuple import configparser import logging import os from catalyst.tools.frozen_class import FrozenClass logger = logging.getLogger(__name__) class Settings(FrozenClass): def __init__( self, ...
from setuptools import find_packages, setup setup( name='src', packages=find_packages(), version='0.1.0', description='software carpentry inflammation project', author='Emmanuel Akano', license='MIT', )
# 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, overload from ... import _utilities fro...
#! /usr/bin/python3 import os import sys import argparse import time import signal from ivy.std_api import * import logging PPRZ_HOME = os.getenv("PAPARAZZI_HOME", os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(__file__)), '../../../'))) sys.path.append(PPRZ_HOME + "/var/lib/python") from pprzlink.iv...
import logging from django import template from apps.streamnote.models import StreamNote register = template.Library() logger = logging.getLogger(__name__) @register.filter def notes(obj): qs = StreamNote.objects.object_notes_qs(obj) return qs
# %% [markdown] # ## Text Classification with LM-BFF. # In this tutorial, we do sentiment analysis with automatic template and verbalizer generation. We use SST-2 as an example. # %% [markdown] # ### 1. load dataset # %% # import argparse # parser = argparse.ArgumentParser("") # parser.add_argument("--lr", type=float...
#!/usr/bin/env python # # See the accompanying LICENSE file. # import urllib2 import hashlib import re sqlitevers=( '3250200', '3250100', '3250000', '3240000', '3230100', '3230000', '3220000', '3210000', '3200100', '3200000', '3190300', '3190200', '3190100', '319...
#!/usr/bin/env python from shutil import rmtree from mosi.common import ModelStatus, NoValue from mosi.lp import Model, FloatVariable # noinspection PyPackageRequirements,PyUnresolvedReferences from init import ( CBC_LP_SOLVER, CBC_MPS_SOLVER, CPLEX_LP_SOLVER, CPLEX_MPS_SOLVER, GLPK_LP_SOLVER, GLPK_MPS_SOLVER...
# Copyright (c) OpenMMLab. All rights reserved. import json import math import os.path as osp import tempfile import pytest from mmocr.datasets.ocr_seg_dataset import OCRSegDataset def _create_dummy_ann_file(ann_file): ann_info1 = { 'file_name': 'sample1.png', 'annotations': [{ ...
#!/usr/bin/env python # -*- encoding: utf-8 -*- from __future__ import unicode_literals import bindings as bi import sys PY3 = sys.version_info[0] == 3 str_type = str if PY3 else (str, unicode) # ---------------------------------------------------------------------------------------------------------------------- # ...
# individual nan corrected # Final nan matches highest probable label (optional) import pandas as pd import numpy as np from tqdm import tqdm import matplotlib.pyplot as plt SAMPLE = '../input/sample_submission.csv' label_names = { 0: "Nucleoplasm", 1: "Nuclear membrane", 2: "Nucleoli", ...
from types import GeneratorType import numpy as np from numpy import linalg from scipy.sparse import dok_matrix, csr_matrix, issparse from scipy.spatial.distance import cosine, cityblock, minkowski, wminkowski from scipy.spatial.distance import cdist, pdist, squareform import pytest from sklearn import config_conte...
# coding: utf-8 import argparse import os import sys from django.conf import settings from django.template import Context, Template class Command(object): """Base command class. A valid administrative command must inherit from this class. """ help = "No help available." def __init__(self, com...
from __future__ import absolute_import import os import unittest from jep import jarray, JINT_ID, JBYTE_ID class TestArray(unittest.TestCase): def test_initialization(self): ar = jarray(1, JINT_ID, 7) self.assertEqual(ar[0], 7) def test_setitem(self): ar = jarray(1, JINT_ID, 0) ...
#!/usr/bin/python3 import sys, dpkt, datetime, glob, os, operator, subprocess, csv import socket import matplotlib from collections import deque import copy from itertools import permutations from dtw import dtw from fastdtw import fastdtw from math import log from sklearn.preprocessing import OneHotEncoder from sklea...
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. from .coco import COCODataset from .voc import PascalVOCDataset from .concat_dataset import ConcatDataset from .abstract import AbstractDataset from .cityscapes import CityScapesDataset from .msize import MSIZEDataset __all__ = [ "COCODataset...
import secrets import typing import json from sha3 import keccak_256 from coincurve import PublicKey, PrivateKey from jwcrypto import jwk class Ethereum: def __init__(self): # Ethereum private keys are 32 bytes long. self._private_key = keccak_256(secrets.token_bytes(32)).digest() # Et...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import django.utils.timezone import django.core.validators import django.contrib.auth.models class Migration(migrations.Migration): dependencies = [ ('auth', '0006_require_contenttypes_0002'), ] ...
# This scripts is copied from # https://github.com/activitynet/ActivityNet/blob/master/Crawler/Kinetics/download.py # noqa: E501 # The code is licensed under the MIT licence. import os import ssl import subprocess import mmcv from joblib import Parallel, delayed ssl._create_default_https_context = ssl._create_unveri...
# -*- coding: utf-8 -*- # # This class was auto-generated from the API references found at # https://epayments-api.developer-ingenico.com/s2sapi/v1/ # from ingenico.connect.sdk.data_object import DataObject from ingenico.connect.sdk.domain.definitions.amount_of_money import AmountOfMoney class PaymentContext(DataObje...
import unittest from sntools.interaction_channels import o16e from ._crosssectiontest import CrossSectionTest class O16ETest(CrossSectionTest): c = o16e # ensure we can access interaction channel module as self.c # iterable with tuples (eNu, eE, dSigma_dE(eNu, eE)) test_dSigma_dE_values = ( (25...
"""Unit tests for repository_utils.bzl.""" load("@bazel_skylib//lib:unittest.bzl", "asserts", "unittest") # buildifier: disable=bzl-visibility load("//rust/private:repository_utils.bzl", "produce_tool_path", "produce_tool_suburl") def _produce_tool_suburl_test_impl(ctx): env = unittest.begin(ctx) asserts.equ...
#BANQUE DE FONCTIONS DE NETTOYAGE DE DATAFRAME - Vincent Salas # import des librairies dont nous aurons besoin import pandas as pd import numpy as np #------------------------------------------------------------------------------------------------------------------------- #NaN DATAFRAME #-----------------------------...
#!/usr/bin/env python # Copyright 2018 National Technology & Engineering Solutions of Sandia, LLC # (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S. # Government retains certain rights in this software. def platform_expr( expr ): ''' Evaluates the given word expression against the curre...
import configparser import copy import logging import os import re import subprocess import sys import threading import time import traceback import pytest import cassandra from subprocess import CalledProcessError from flaky import flaky from cassandra import ConsistencyLevel, OperationTimedOut from cassandra.auth ...
# noqa """Common ML and ML-adjacent algorithms implemented in NumPy""" from . import utils from . import preprocessing from . import gmm from . import hmm from . import lda from . import linear_models from . import neural_nets from . import ngram from . import nonparametric from . import rl_models from . import trees...
import os from requests_oauthlib import OAuth1Session consumer_key = '' # Add your API key here consumer_secret = '' # Add your API secret key here params = {"ids": "1138505981460193280", "tweet.fields": "created_at"} # Get request token request_token_url = "https://api.twitter.com/oauth/request_token" oauth = OAu...
# _*_ coding: utf-8 _*_ """ Created by Allen7D on 2018/12/4. """ __author__ = 'Allen7D' ''' "type": "array" 时 - 可以使用 items "type": 'object'时 -可以使用 properties ''' place_order = { "parameters": [ { "name": "body", "in": "body", "description": "订单中商品信息列表(商品ID&数量)", "require": "true", "schema": { ...
class UnpackException(Exception): pass class BufferFull(UnpackException): pass class OutOfData(UnpackException): pass class UnpackValueError(UnpackException, ValueError): pass class ExtraData(ValueError): def __init__(self, unpacked, extra): self.unpacked = unpacked self.extr...
#! /usr/bin/env python3 import os import sys import json import h5py import time import numpy as np from collections import OrderedDict from pprint import pprint import argparse from pygama import __version__ as pygama_version from pygama.dsp.ProcessingChain import ProcessingChain from pygama.dsp.units import * from ...
# -*- coding: utf-8 -*- # Generated by Django 1.9.5 on 2016-07-05 16:50 from __future__ import unicode_literals import datetime from django.db import migrations, models from django.utils.timezone import utc class Migration(migrations.Migration): dependencies = [ ('pyday_social_network', '0006_auto_20160...
# coding: utf-8 from __future__ import unicode_literals import os import re import sys from .common import InfoExtractor from ..compat import ( compat_etree_fromstring, compat_str, compat_urllib_parse_unquote, compat_urlparse, compat_xml_parse_error, ) from ..utils import ( determine_ext, ...
from collections import OrderedDict import torch from robustbench.model_zoo.architectures.dm_wide_resnet import CIFAR100_MEAN, CIFAR100_STD, \ DMWideResNet, Swish from robustbench.model_zoo.architectures.resnet import PreActBlock, PreActResNet from robustbench.model_zoo.architectures.resnext import CifarResNeXt, ...
import unittest import pkg_resources from nativedroid.analyses.nativedroid_analysis import * native_ss_file = pkg_resources.resource_filename('nativedroid.data', 'sourceAndSinks/NativeSourcesAndSinks.txt') java_ss_file = pkg_resources.resource_filename('nativedroid.data', 'sourceAndSinks/TaintSourcesAndSinks.txt') c...
# Escaneador de puertos import socket import sys #Solicitamos y validamos la IP ip = input("Introduce IP : ") validateIP = ip.split('.') validIP = True for bit in validateIP: if int(bit) > 256 or int(bit) < 0: validIP = False if validIP == False: print("Introduce una IP válida") else: ...
# 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, overload from ... import _utilities fro...
# -*- coding: utf-8 -*- from openerp.osv import osv from openerp.osv import fields import time class notes_evaluation(osv.osv): """ Evaluation """ _name = 'notes.evaluation' _description = 'Student evaluation' _columns = { 'note': fields.float('Note', required=True), 'session': fields.selecti...
from time import time import os import pandas as pd from datetime import datetime import csv from potentiostat import Potentiostat def read_pots(): devlist = os.listdir('/dev') coms = [c for c in devlist if c.startswith('ttyACM')] pots = {} for c in coms: p = Potentiostat('/dev/{}'.format(c)...
from __future__ import unicode_literals from django.contrib.auth.models import Group from django.utils.translation import pgettext_lazy from django_filters import ( CharFilter, ModelMultipleChoiceFilter, OrderingFilter) from ...core.filters import SortedFilterSet from ...core.permissions import get_permissions S...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from ripozo.exceptions import RestException class MissingModelException(RestException): """ Raised when a a model_name on a model class does not exist in th...