text
stringlengths
1
927k
from distutils.core import setup try: with open("README.md","r") as fh: long_description = fh.read() except: long_description = 'Taxation7% by UncleMedia' setup( name = 'phasiakon', # How you named your package folder (MyLib) packages = ['phasiakon'], # Chose the same as "name" version = '0.1'...
""" Takes as input a binarized dialogue corpus, splits the examples by a certain token and shuffles it Example run: python split-examples-by-token.py Training.dialogues.pkl 2 Training_SplitByDialogues.dialogues --join_last_two_examples @author Iulian Vlad Serban """ import collections import numpy import math im...
from agavepy.agave import AgaveError from tapis_cli.display import Verbosity from tapis_cli.clients.services.mixins import ServiceIdentifier, Username from . import API_NAME, SERVICE_VERSION from .models import SystemRole from .formatters import SystemsFormatOne __all__ = ['SystemsRolesShow'] class SystemsRolesShow...
from handball.core.test import TestCase from handball.users.factories import UserFactory class TestExample(TestCase): def test_example(self): UserFactory() resp = self.client.get('/') self.assertEqual(resp.status_code, 200)
# coding: utf-8 """ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ ...
import pyaf.tests.model_control.test_ozone_custom_models_enabled as testmod testmod.build_model( ['Quantization'] , ['LinearTrend'] , ['Seasonal_Hour'] , ['SVR'] );
""" >>> DRAFT "py_merge"! <<< Builtin "sorted()" function, but using all CPU cores available for speedup! It supports all kwargs of "sorted()": "cmp", "key" and "reverse", however items of "iterable" and all of these kwargs should be picklable: https://docs.python.org/2/library/pickle.html#what-can-be-pickled-and-unp...
import unittest import networkx as nx import numpy as np from typing import List, Tuple from cassiopeia.data.CassiopeiaTree import CassiopeiaTree from cassiopeia.mixins import TreeSimulatorError from cassiopeia.simulator.BirthDeathFitnessSimulator import ( BirthDeathFitnessSimulator, ) import cassiopeia.data.u...
#!/usr/bin/env jython #*****************************************************************************# #* Copyright (c) 2004-2008, SRI International. *# #* All rights reserved. *# #* ...
#!/usr/bin/env python3 # 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. """ Catch all for a number of "other" scripts. """ import os import unittest import parlai.utils.testing as testing_uti...
""" MIT License Copyright (c) 2017 int3ll3ct.ly@gmail.com 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,...
"""Test the Abode camera class.""" import os import unittest import requests_mock import abodepy import abodepy.helpers.constants as CONST import tests.mock as MOCK import tests.mock.devices.ir_camera as IRCAMERA import tests.mock.login as LOGIN import tests.mock.oauth_claims as OAUTH_CLAIMS import tests.mock.logout ...
# coding=utf-8 # Copyright (c) 2021, Arm Limited and Contributors. # SPDX-License-Identifier: Apache-2.0 # Copyright 2021 The Google Research 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 Lic...
#!/usr/bin/env python3 # Copyright (c) 2015-2017 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test multiple RPC users.""" from test_framework.test_framework import BitcoinTestFramework from test_f...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from flask import Flask from flask_mail import Mail from flask_mail import Message import os #测试成功,部分参数作用不明 app = Flask(__name__) app.config['MAIL_SERVER'] = 'smtp.163.com' app.config['MAIL_PORT'] = 25 app.config['MAIL_USE_TLS'] = True app.config['MAIL_USERNAME'] = 'pengl...
# -*- coding: utf-8 -*- # @Time : 2019/3/19 0019 16:25 # @Author : __Yanfeng # @Site : # @File : search_indexes.py # @Software: PyCharm from haystack import indexes from .models import Post class PostIndex(indexes.SearchIndex, indexes.Indexable): text = indexes.CharField(document=True, use_template=Tru...
default_app_config = ( "rest_framework_security.deny_repeat_password.apps.DenyRepeatPasswordAppConfig" )
#!/usr/bin/env python # Copyright 2019 Pascal Audet & Helen Janiszewski # # This file is part of OBStools. # # 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 wi...
import unittest import rlbench.backend.task as task import os from rlbench.backend.utils import task_file_to_task_class from pyrep import PyRep from pyrep.robots.arms.panda import Panda from pyrep.robots.end_effectors.panda_gripper import PandaGripper from rlbench.backend.const import TTT_FILE from tools.task_validator...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 OpenStack Foundation. # Copyright 2012, Red Hat, 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:/...
from GHC2018.input import Input from GHC2018.models.Car import Car from GHC2018.models.Route import Route from GHC2018.models.ride import calculate_distance from tqdm import tqdm class Process: def __init__(self, input_data, debug=True): self.input_data = input_data self.debug = debug sel...
# Generated by Django 3.0.7 on 2020-06-18 21:50 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ('auth', '0011_update_proxy_permissions'), ] operations = [ migrations.CreateModel( name='User', f...
#!/usr/bin/env python # # Copyright (C) 2014 Google Inc. # # This file is part of YouCompleteMe. # # YouCompleteMe 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 # (at you...
# Copyright 2020 The TEMPO Collaboration # # 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...
import setuptools setuptools.setup( name="Moo_NLP_Game_of_Life", version="1.0.0", author="Stephen Moo-Young", author_email="mooyoung12@gmail.com", description="Game of Life for the take home coding challenge", url="https://github.com/Moomoo-pls/NLP_Game_of_Life", packages=setuptools.find_pa...
from __future__ import print_function import keras from keras.datasets import cifar10 from keras.preprocessing.image import ImageDataGenerator from keras.models import Sequential from keras.layers import Dense, Dropout, Activation, Flatten from keras.layers import Conv2D, MaxPooling2D, BatchNormalization from keras imp...
from maze.extra_framework_maker import ExtraFrameworkMaker, ExtraFrameworkAnalyzer from maze.io_zeolite import read_vasp from maze.zeolite import PerfectZeolite, Zeolite from ase.neighborlist import natural_cutoffs, NeighborList import os from pathlib import Path from ase.io import write, read, gromacs, proteindatabank...
# -*- coding: utf-8 -*- # PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN: # https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code from ccxt.async_support.base.exchange import Exchange # ----------------------------------------------------------------------------- try...
# -*- coding: utf-8 -*- """Recurrent layers and their base classes. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import warnings from .. import backend as K from .. import activations from .. import initializers from .. import regu...
from scapy.all import * ''' This module contains some scapy definitions for communicating with a BTLEJack device. ''' BTLEJACK_PACKETS_TYPES = { 0x1 : "command", 0x2 : "response", 0x4 : "notification" } BTLEJACK_PACKETS_OPCODES = { 0x1 : "version", 0x2 : "reset", 0x3 : "scan_access_address...
from django.db import models from django.contrib.auth.models import User import re from math import sqrt, pi # Path to default image DEFAULT_IMAGE = '../media/app_logo.png' DEFAULT_PROFILE_IMG = 1 DEFAULT_MEETING_IMG = 2 MEDIA_URL = '/media/' # Unique email for each user User._meta.local_fields[7].__dict__['_unique'] ...
# pylint: disable=C0103,R0902,R0904,R0914 """ All dynamic control cards are defined in this file. This includes: * FREQ * FREQ1 * FREQ2 (not implemented) * FREQ3 * FREQ4 * FREQ5 (not implemented) * NLPCI * NLPARM * TSTEP * TSTEPNL All cards are BaseCard objects. """ from math import log, exp, ceil import ...
from django.contrib import admin from .models import Choice, Question class ChoiceInline(admin.TabularInline): model = Choice extra = 3 list_display = ('question_text', 'pub_date') class QuestionAdmin(admin.ModelAdmin): list_display = ('question_text', 'pub_date', 'was_published_recently') field...
# Definition for singly-linked list. # class ListNode: # def __init__(self, val=0, next=None): # self.val = val # self.next = next class Solution: def addTwoNumbers(self, l1: Optional[ListNode], l2: Optional[ListNode]) -> Optional[ListNode]: n = cur = ListNode(-1) carry ...
"""A scene suitable for rendering three-dimensional objects and animations.""" __all__ = ["ThreeDScene", "SpecialThreeDScene"] from typing import Iterable, Optional, Sequence, Union import numpy as np from .. import config from ..animation.animation import Animation from ..animation.transform import ApplyMethod fr...
import logging from django.conf.urls import include, url from django.core.exceptions import ImproperlyConfigured from corehq.apps.reports.standard.forms.reports import ReprocessXFormErrorView from corehq.apps.userreports.reports.view import ( ConfigurableReportView, CustomConfigurableReportDispatcher, ) from ...
# -*- coding: utf-8 -*- """ Created on Fri Oct 22 10:13:37 2021 @author: palme """ import oving_8_b as o8b test = o8b.Quiz("Hvor mange bein har en hest", [1, 2, 3, 4],4) print(test) dude = int(input("Svar: ")) svar1 = test.svaret(dude) if svar1: print("Svaret er rett") else: print("Svaret er feil") print...
from __future__ import absolute_import import time import logging from pyramid.tweens import INGRESS from pyramid.settings import aslist from zipkin import local from zipkin.api import stack_trace from zipkin.models import Trace, Annotation from zipkin.util import int_or_none from zipkin.client import log as zipkin_l...
#!/usr/bin/python # # Copyright 2018-2021 Polyaxon, 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 ...
from .predict import predict import argparse import sys, multiprocessing import torch def _parse_args(): parser=argparse.ArgumentParser(description="Run SolTranNet aqueous solubility predictor") parser.add_argument('input',nargs='?',type=argparse.FileType('r'),default=sys.stdin,help='PATH to the file containi...
"""Utility functions used by PyTorch algorithms.""" import torch import torch.nn.functional as F class _Default: # pylint: disable=too-few-public-methods """A wrapper class to represent default arguments. Args: val (object): Argument value. """ def __init__(self, val): self.val = v...
import json import os from pathlib import Path from sphinx_testing import with_app @with_app(buildername="needs", srcdir="doc_test/doc_export_id") def test_export_id(app, status, warning): app.build() content = Path(app.outdir, "needs.json").read_text() assert "filters" in content content_obj = json...
import numpy as np from wavedata.wavedata.tools.core import geometry_utils class VoxelGrid2D(object): """ Voxel grids represent occupancy info. The voxelize_2d method projects a point cloud onto a plane, while saving height and point density information for each voxel. """ # Class Constants ...
""" This is a script to reset the admin account in a live system. On production this should be run once, and never again, as it removes the old account and builds a new one in its place. This means no historical data will be kept from the before time. """ from octopus.core import add_configuration, app from servic...
# Generated by Django 3.1.1 on 2021-01-03 22:21 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('game_data', '0002_auto_20201220_2025'), ] operations = [ migrations.RemoveField( model_name='gamedata', name='pin', ...
# (hack) Global configs conf_cache_disk = True conf_cache_memory = True conf_cache_fails = False ignoredAssets = []
#!/usr/bin/env python # # Copyright 2016 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 requir...
from pybox.inject import Inject, InjectLazy from pybox.service import IService, ServiceMode class SingletonService(IService): def who_am_i(self): print(f'Singleton {id(self)}') class FactoryService(IService): singleton = Inject(SingletonService) @classmethod def service_mode(self): ...
from .node import Node from .stack import Stack class Stack_Queue: def __init__(self): self.stack_front = Stack() self.stack_back = Stack() self._size = 0 def enqueue(self, val): """This will add a node the back of the queue and increment the ._size""" try: ...
import discord import asyncio from datetime import datetime class Discord: _instance = None client = None def __new__(class_, *args, **kwargs): if not isinstance(class_._instance, class_): class_._instance = object.__new__(class_, *args, **kwargs) return class_._instance d...
import os import requests import json from flask import request, make_response from app import app from app import route_handler as rt_handle """ This module handles the "intake" of requests to the server. The requests are then passed off the route_handler.py where arguments are then parsed and passed off to other pa...
#GUI con TKinter #Autor: Javier Arturo Hernández Sosa #Fecha: 20/Sep/2017 #Descripcion: Curso Python FES Acatlán from tkinter import * #Definición de funciones def suma(): r.set(x.get() + y.get()) def multi(): r.set(x.get() * y.get()) def resta(): r.set(x.get() - y.get()) def dividir(): r.set(x.get() / y.get...
import torch from torch.utils.data import Dataset, DataLoader import numpy as np from PIL import Image Image.MAX_IMAGE_PIXELS = None from data import get_train_transform, get_test_transform class CustomDataset(Dataset): img_aug = True imgs = [] transform = None def __init__(self, label_file, image_s...
import csv name = input('Enter your name: ') email = input('Enter your email: ') phone = input('Enter your phone: ') githublink = input('Enter your githublink: ') save = input('Save to CSV? ') if save == 'yes': file = open('results.csv', 'a') csv_writer = csv.writer(file) csv_writer.writerow([name, githublin...
import subprocess import argparse import json import pprint from sys import exit import uuid import ast import numpy as np import netCDF4 as nc import os # python parameter_sweep.py case_name def main(): parser = argparse.ArgumentParser(prog='Paramlist Generator') parser.add_argument('case_name') args = pa...
# ------------------------------------ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # ------------------------------------ from functools import partial from azure.core.tracing.decorator import distributed_trace from ._shared import KeyVaultClientBase from ._shared.exceptions import error_m...
import uuid import pytest from pyramid.interfaces import IAuthenticationPolicy from webob import Request from zope.interface.verify import verifyObject from pyramid_jwt.policy import JWTCookieAuthenticationPolicy @pytest.fixture(scope="module") def principal(): return str(uuid.uuid4()) def test_interface(): ...
import sys import importer module1 = importer.import_('module1', 'module1_source.py', '.')
""" 35 - Faça um programa que some os números impares contidos em um intervalo definido pelo usuário. O usuário define o valor inicial do intervalo e o valor final deste intervalo e o programa deve somar todos os números ímpares contidos neste intervalo (começando por um valor maior que o valor final) deve ser escrito ...
import click from strava.commands import get_activity, get_constrain_activity, get_weekly_activity, get_lap_activity @click.group(name='activity', help='[GROUP] Get the summary of one or multiple activities.') def cli_activity(): pass cli_activity.add_command(get_activity) cli_activity.add_command(get_constrai...
# -*- coding: utf-8 -*- # Description: cpuidle netdata python.d module # Author: Steven Noonan (tycho) import glob import os import platform import time from base import SimpleService import ctypes syscall = ctypes.CDLL('libc.so.6').syscall # default module values (can be overridden per job in `config`) # update_eve...
def print_picnic(itemsDict, leftWidth, rightWidth): print('PICNIC ITEMS'.center(leftWidth + rightWidth, '-')) for k, v in itemsDict.items(): print(k.ljust(leftWidth, '.') + str(v).rjust(rightWidth)) picnic_items = {'sandwiches': 4, 'apples': 12, 'cups': 4, 'cookies': 8000} print_picnic(picnic_items, 12,...
import sys def run(): stop = False while not stop: line = sys.stdin.readline().strip() if len(line) == 0: stop = True else: print line + "!?!?" sys.stdout.flush() run()
green = geopandas.read_file("data/gent/vector/parken-gent.geojson") green.head()
from typing import Any, BinaryIO from kale.util.struct_stream import StructStream class int8(StructStream): PACK = "!b" class uint8(StructStream): PACK = "!B" class int16(StructStream): PACK = "!h" class uint16(StructStream): PACK = "!H" class int32(StructStream): PACK = "!l" class uint...
from django.contrib import admin from .models import Upload,VendorData class UploadAdmin(admin.ModelAdmin): list_display = ('id','uploaded_file','uploaded_date') class VendordataAdmin(admin.ModelAdmin): list_display = ('id','sub_id','first_name','last_name','status') admin.site.site_header = "Subscription Fu...
from django.contrib import admin from .models import Person # Register your models here. @admin.register(Person) class PersonModel(admin.ModelAdmin): list_display = ['first_name','last_name','email','phone','date_of_birth']
# encoding: utf-8 from __future__ import annotations import logging from typing import Any, Union, cast, List from flask import Blueprint from flask.views import MethodView from flask.wrappers import Response import ckan.lib.app_globals as app_globals import ckan.lib.base as base import ckan.lib.helpers as h import ...
# # Copyright (c) 2009-2016, Jack Poulson # All rights reserved. # # This file is part of Elemental and is under the BSD 2-Clause License, # which can be found in the LICENSE file in the root directory, or at # http://opensource.org/licenses/BSD-2-Clause # import El n0 = 50 n1 = 50 display = False worldRank = E...
#!/usr/bin/env python # # Copyright (c) 2001 - 2016 The SCons Foundation # # 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 us...
import logging from abc import ABC, abstractmethod from collections import defaultdict from dataclasses import dataclass, field from typing import ( Callable, Dict, Iterable, List, NamedTuple, Optional, Sequence, Set, Tuple, TypeVar, Union ) from sciencebeam_trainer_delft.se...
class MyClass: x = 1 class MyClass1(Parent1): y = 1 class MyClass2(Parent1, Parent2): z = 1 class MyClass3(Parent1): a = 1 class MyClass4(Parent1, Parent2): b = 1
from django.urls import path from django.conf.urls import url from project_first_app.views import * urlpatterns = [ path('',main,name='main'), path('createowner/',createowner,name='createowner'), path('login/',log_in,name='login'), path(r'<int:ho_id>',review,name='detail') ] #path(r'getowners/<int:ow_i...
# -*- coding: ISO-8859-15 -*- # ============================================================================= # Copyright (c) 2009 Tom Kralidis # # Authors : Tom Kralidis <tomkralidis@gmail.com> # Angelos Tzotsos <tzotsos@gmail.com> # # Contact email: tomkralidis@gmail.com # ================================...
import discord import constants as c from discord.ext import commands import random as r urls=['https://cdn.discordapp.com/attachments/433007901800398858/433047585121501194/maxresdefault.jpg','https://cdn.discordapp.com/attachments/442868510776098818/442879211296915466/9bt3n9w40bp01.jpg','https://cdn.discordapp.com/att...
# Copyright 2019 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...
"""We want to export the field to some data files. """ from root.config.main import * from screws.freeze.main import FrozenOnly from screws.miscellaneous.timer import check_filename, check_no_splcharacter from scipy.io import savemat class _3dCSC_SF_Export_Field(FrozenOnly): """""" def __init__(self, sf): ...
from easydict import EasyDict as edict # from pathlib import Path import torch import os from torchvision import transforms as trans from utils.constants import * list_model = ['wget https://www.dropbox.com/s/akktsgxp0n8cwn2/model_mobilefacenet.pth?dl=0 -O model_mobilefacenet.pth', 'wget https://www.dropbox.com/s/kzo52...
# Copyright 2019 Graphcore Ltd. from statistics import mean import numpy as np import os import re import subprocess import sys import time """Library of utility functions common between frameworks""" def parse_results_for_speed(output, iter_tolerance, speed_tolerance): """Look for <iter number> sec/itr. <speed...
# -*- coding: utf-8 -*- from __future__ import annotations import requests from validators.url import URL from abc import ABC, abstractmethod from requests.adapters import HTTPAdapter from typing import Text, NoReturn, Callable, Dict from requests.packages.urllib3.util.retry import Retry class RequestResponse: de...
# Copyright 2019 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...
# Libraries from sqlalchemy import Column, Float, ForeignKey, Integer, String # Taskobra from taskobra.orm.components import Component class CPU(Component): __tablename__ = "CPU" unique_id = Column(Integer, ForeignKey("Component.unique_id"), primary_key=True) manufacturer = Column(String) model = Colu...
from __future__ import unicode_literals from django.db import models, migrations def set_sources(apps, schema_editor): # We can't import the Person model directly as it may be a newer # version than this migration expects. We use the historical version. Source = apps.get_model("music", "Source") Temp...
# -*- coding: utf-8 -*- from __future__ import absolute_import, division import itertools import numpy as np from sklearn_crfsuite.metrics import flat_accuracy_score from formasaurus.fieldtype_model import ( train, _PRECISE_C1_C2, _REALISTIC_C1_C2, get_Xy, ) def test_training(storage, capsys): a...
# Copyright 2015 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 a...
import glob import os from xml.dom import minidom import xml.etree.ElementTree as ET path = r"C:\Users\shamb\Desktop\dita_demo" valid_path = r"C:\Users\shamb\Desktop\dita_demo_scrubbed" wildcard = "*.xml" full_path = os.path.join(path, wildcard) os.makedirs(valid_path, exist_ok=True) file_list = glob.glob(full_path...
""" OpenAPI definition No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 The version of the OpenAPI document: v0 Contact: support@gooddata.com Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sy...
from distutils.core import setup setup( name='cyberdynedyndnscli', version='0.1.0', packages=['cyberdynedyndnscli'], url='https://github.com/droberin/cyberdynedyndnscli', license='MIT', author='DRoBeR', author_email='drober+software@gmail.com', description='Cyberdyne.es Dynamic DNS clie...
# -*- coding: utf-8 -*- """ pyspecific.py ~~~~~~~~~~~~~ Sphinx extension with Python doc-specific markup. :copyright: 2008-2014 by Georg Brandl. :license: Python license. """ import re import codecs from os import path from time import asctime from pprint import pformat from docutils.io import St...
# # 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...
# 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...
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. import os import pytest try: from recommenders.models.deeprec.deeprec_utils import download_deeprec_resources from recommenders.models.newsrec.newsrec_utils import prepare_hparams, load_yaml except ImportError: p...
#importing some useful packages import matplotlib.pyplot as plt import matplotlib.image as mpimg import numpy as np import cv2 #reading in an image image = mpimg.imread('test_images/solidWhiteRight.jpg'); #printing out some stats and plotting print('This image is:', type(image), 'with dimesions:', image.shape) plt.im...
import random from emoji import emojize from time import sleep itens = ('PEDRA', 'PAPEL', 'TESOURA') print (emojize('''Suas opções: [0] PEDRA :punch: [1] PAPEL :hand: [2] TESOURA :v:''',use_aliases=True)) escolha = int(input('Qual sua escolha? ')) computador = random.randint(0,2) print('JO') sleep(1) print('KEN') sleep...
class TestFail(Exception): """ Exception raised when test has failed. """
import esphome.codegen as cg from esphome.core import coroutine_with_priority json_ns = cg.esphome_ns.namespace('json') @coroutine_with_priority(1.0) def to_code(config): cg.add_library('ArduinoJson-esphomelib', '5.13.3') cg.add_define('USE_JSON') cg.add_global(json_ns.using)
EXCEL_FILE_TYPE = (("Excel 2007 files","*.xlsx"),)
""" I use Nox here to reformat the code. """ import nox files = ["noxfile.py", "main.py", "setup.py"] @nox.session(name="keep-codebase-clean") def keep_codebase_clean(session): "Run formatters." session.install("-r", "test-requirements.txt") session.run("isort", *files) session.run("black", *files) ...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # Copyright (c) 2010 Citrix Systems, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you m...
from pprint import pformat from aiohttp import web from servicelib.aiohttp.rest_responses import unwrap_envelope async def assert_status( response: web.Response, expected_cls: web.HTTPException, expected_msg: str = None ): data, error = unwrap_envelope(await response.json()) assert ( response.st...