text
stringlengths
2
999k
"""Tests for the Asset Inventory API.""" import json from datetime import datetime from helpers import compare_unsorted_list from graph_asset_inventory_api.api import ParentOfReq def test_get_assets_id_parents(flask_cli, init_api_parents): """Tests the API endpoint ``GET /v1/assets/{id}/parents``.""" for ...
r""" Hypergraph generators At the moment this module only implement one method, which calls Brendan McKay's Nauty (`<http://cs.anu.edu.au/~bdm/nauty/>`_) to enumerate hypergraphs up to isomorphism. """ class HypergraphGenerators(): r""" A class consisting of constructors for common hypergraphs. """ d...
# -*- coding:utf-8 -*- # Author: hankcs # Date: 2021-05-11 19:50 import os from collections import defaultdict import matplotlib.pyplot as plt prop_cycle = plt.rcParams['axes.prop_cycle'] plt.rcParams["figure.figsize"] = (4, 3) plt.rcParams.update({'font.size': 8}) def main(): table = ''' static single pos ner ...
""" Test for various numpy_interface modules. Main goal is to test parallel algorithms in vtk.numpy_interface.algorithms.""" from __future__ import print_function import sys try: import numpy except ImportError: print("Numpy (http://numpy.scipy.org) not found.", end=' ') print("This test requires numpy!")...
# author: Bartlomiej "furas" Burek (https://blog.furas.pl) # date: 2022.06.08 # [web scraping - How to find only filtered postings and not "similar searches" elements when using Python and BeautifulSoup in Zillow - Stack Overflow](https://stackoverflow.com/questions/72538706/how-to-find-only-filtered-postings-and-not-s...
#!/usr/bin/env python3 # Play a video with opencv modules # This script works with python2 or python3 import math import sys import cv2 def play_video(video_filename, rate_multiplier): cap = cv2.VideoCapture(video_filename) rate = cap.get(cv2.CAP_PROP_FPS) print("video frame rate {} in file".format(rate)...
"""Support for AVM FRITZ!SmartHome switch devices.""" from __future__ import annotations from typing import Any from homeassistant.components.switch import SwitchEntity from homeassistant.config_entries import ConfigEntry from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform import A...
# Copyright 2015 OpenStack Foundation # 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 requ...
from .flask_frontend import FlaskFrontend # noqa
""" Threat models for Membership Inference Attacks. """ # Type checking stuff from __future__ import annotations from typing import TYPE_CHECKING if TYPE_CHECKING: from ..attacks import Attack # for typing from ..datasets import Dataset # for typing from ..generators import Generator # for typing # Real i...
from rest_framework_jwt.settings import api_settings from django.contrib.auth.models import User from django.contrib.auth import authenticate from django.db import transaction JWT_PAYLOAD_HANDLER = api_settings.JWT_PAYLOAD_HANDLER JWT_ENCODE_HANDLER = api_settings.JWT_ENCODE_HANDLER def get_token(): """Create u...
from topfarm import TopFarm from topfarm.tests.test_files import xy3tb from topfarm.cost_models.dummy import DummyCost from topfarm.tests import npt def testTopFarm(): tf = TopFarm(xy3tb.initial, DummyCost(xy3tb.desired, ['x', 'y']), min_spacing=2, boundary=xy3tb...
import numpy as np from process import load_names, merge_datasets from scanorama import process_data, find_alignments_table from time_align import time_align_correlate, time_align_visualize NAMESPACE = 'fly_brain' data_names = [ 'data/fly_brain/DGRP-551_0d_rep1', 'data/fly_brain/DGRP-551_0d_rep2', 'data/...
shopping_list = [] def show_help(): print("What should we pick up at the store?") print(""" Enter 'DONE' to stop adding itemsself. Enter 'HELP' for this help Eneter 'SHOW' to see your current list """) def add_to_list(item): shopping_list.append(item) print("Added! List has {} items".format(len(shop...
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Mgis(CMakePackage): """ The MFrontGenericInterfaceSupport project (MGIS) provides help...
# -*- coding: utf-8 -*- """ Created on Sun Dec 6 11:56:42 2015 @author: davidangeles Script for analysis of Mihoko's linker cell data """ import pandas as pd import numpy as np import matplotlib.pyplot as plt from scipy import stats #log of the fold change of ratios that will be considered n= -1 df= pd.read_cs...
import time import os import random
""" @File : config.py @Description : 系统配置 @Time : 2019/11/19 0:57 @Author : DexterLien @Email : lpwm@qq.com @Software : PyCharm """ import os DEBUG = True TEMPLATE_DEBUG = True # 操作session会话需要用到的密钥 SECRET_KEY = os.urandom(24) # Flask jsonify返回中文不转码 JSON_AS_ASCII = False # 数据库配置 # HOSTNAM...
from django.db import models ### configuration groups class Group(models.Model): name = models.CharField(max_length=50) interval_hours = models.PositiveIntegerField(default=24) publish = models.BooleanField(default=True) ignore_name_mismatch = models.BooleanField(default=False) def __str__(self): ...
class Solution(object): def intToRoman(self, num): """ :type num: int :rtype: str """ values = [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1] symbols = ["M", "CM", "D", "CD", "C", "XC", "L", "XL", ...
# Reminder: Look for the original creator of the self.extensions code: import os class Discover: def __init__(self): # Define types: self.extensions = [ # System Files #'exe', 'dll', 'so', 'deb', 'img', 'msi', # Images...
"""Control IoT device by reading sensor values and writing data to disk.""" from __future__ import annotations import os import asyncio from datetime import datetime from bairy.device.validate import DeviceConfigs from bairy.device.configs import DATA_PATH, load_device from bairy.log_configs import DATE_FORMAT from ba...
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. """Aboveground Live Woody Biomass Density dataset.""" import glob import json import os from typing import Any, Callable, Dict, Optional import matplotlib.pyplot as plt from rasterio.crs import CRS from .geo import RasterD...
import operator import uuid from unittest import mock, skipIf from django import forms from django.core import serializers from django.core.exceptions import ValidationError from django.core.serializers.json import DjangoJSONEncoder from django.db import ( DataError, IntegrityError, NotSupportedError, OperationalE...
# coding=utf-8 # Copyright 2020 The TensorFlow GAN 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 applicabl...
# coding: utf-8 """ Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.14.4 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import os import sys i...
# coding=utf-8 # Copyright 2022 DataLab Authors and the current dataset script contributor. # # 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 ...
#!/usr/bin/python3 import argparse, logging, os, sys, time from utils.setup import * from utils.dataset import DepSpaceDataset def parse_arguments(): arg_parser = argparse.ArgumentParser(description='Probe Training') arg_parser.add_argument('ud_path', help='path to Universal Dependencies directory') arg_parser.a...
import sys import os from win32com.shell import shellcon, shell # Should be programdata files folder ROOT_FOLDER = os.path.join( shell.SHGetFolderPath(0, shellcon.CSIDL_COMMON_APPDATA, None, 0), "ope") TMP_FOLDER = os.path.join(ROOT_FOLDER, "tmp") LOG_FOLDER = os.path.join(TMP_FOLDER, "log") SCREEN_SHOTS_FOLD...
from distutils.core import setup setup( name='tolaat', version='0.0.1', description='tolat hamishpat\'s website', url='https://github.com/tolaat-com/tolaatcom', download_url='https://github.com/tolaat/tolaatcom/archive/refs/tags/0.0.1.tar.gz', author='Andy Worms', author_email='andyworms@g...
# Generated by Django 2.0 on 2018-01-08 12:44 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('betterhealth', '0001_initial'), ] operations = [ migrations.AlterField( model_name='product', name='slug...
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.FileItem import FileItem from alipay.aop.api.constant.ParamConstants import * class AlipayOpenAgentCommonSignRequest(object): def __init__(self, biz_model=None): self._biz_model = biz_model self._alipay_life_name = N...
#!/usr/bin/env python from codecs import open from setuptools import setup def readme(): with open("README.md", "r") as infile: return infile.read() classifiers = [ # Pick your license as you wish (should match "license" above) "License :: OSI Approved :: MIT License", "Framework :: Django"...
import unittest import hypothesis.strategies as st from hypothesis import given, assume import numpy as np import time import os from caffe2.proto import caffe2_pb2 from caffe2.python import core, workspace, muji, dyndep import caffe2.python.hypothesis_test_util as hu np.random.seed(1) dyndep.In...
import unittest from pyalink.alink import * import numpy as np import pandas as pd class TestGmmTrainBatchOp(unittest.TestCase): def test_gmmtrainbatchop(self): df_data = pd.DataFrame([ ["-0.6264538 0.1836433"], ["-0.8356286 1.5952808"], ["0.3295078 -0.8204684"], ...
#!/usr/bin/env python # Copyright 2018 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
from manimlib import * def x_shift(mobject): return LEFT*mobject.get_center()[0] def y_shift(mobject): return DOWN*mobject.get_center()[1]
# Copyright 2018 The Cirq Developers # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
"""distutils.command.build Implements the Distutils 'build' command.""" # This module should be kept compatible with Python 2.1. __revision__ = "$Id: build.py,v 1.1.1.1 2006/05/30 06:04:36 hhzhou Exp $" import sys, os from distutils.core import Command from distutils.util import get_platform def show_compilers ()...
"""Sub-classes and wrappers for vtk.vtkPointSet.""" import pathlib import logging import os import warnings import numpy as np import vtk from vtk import (VTK_HEXAHEDRON, VTK_PYRAMID, VTK_QUAD, VTK_QUADRATIC_HEXAHEDRON, VTK_QUADRATIC_PYRAMID, VTK_QUADRATIC_QUAD, VTK_QUADRATIC_TETRA, ...
import os import pytest import pickle from tokenizers import SentencePieceUnigramTokenizer from ..utils import data_dir, train_files class TestUnigram: @pytest.mark.slow def test_train(self, train_files): tokenizer = SentencePieceUnigramTokenizer() tokenizer.train(train_files["big"], show_pro...
#burn_drive.py #reformat drive import win32api, os, binascii, random, math from subprocess import Popen, PIPE from man_time import getPercentAndRemainProgress from timeit import default_timer as timer start_time = 0 cur_pass = 0 max_pass = 1 def setContents(block_size, val_pool, **item_opt): rand_cont = "" if le...
from .crud_user import user from .crud_question_option import question_option from .crud_question_option_open import question_option_open from .crud_question import question from .crud_survey import survey from .crud_answer_option import answer_option from .crud_answer_option_open import answer_option_open from .crud_p...
from __future__ import unicode_literals import itertools import logging from six.moves import urllib from mopidy import backend, models from mopidy_spotify import translator import pylast from . import util log = logging.getLogger(__name__) util.enable_logger(__name__) log_decorator = util.build_log_decorator(log)...
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import http, _ from odoo.addons.portal.controllers.portal import CustomerPortal, pager as portal_pager from odoo.exceptions import AccessError, MissingError from odoo.http import request class PortalAccount(C...
"""Config flow for wiffi component. Used by UI to setup a wiffi integration. """ import errno import voluptuous as vol from wiffi import WiffiTcpServer from homeassistant import config_entries from homeassistant.const import CONF_PORT, CONF_TIMEOUT from homeassistant.core import callback from .const import DEFAULT_...
# This file is part of the Indico plugins. # Copyright (C) 2002 - 2022 CERN # # The Indico plugins are free software; you can redistribute # them and/or modify them under the terms of the MIT License; # see the LICENSE file for more details. from unittest.mock import MagicMock import pytest from indico_livesync.base...
from datetime import datetime from typing import Dict, List, Callable from types import ModuleType from vnpy.trader.object import ContractData, TickData, TradeData from vnpy.trader.constant import Exchange, OptionType, Direction, Offset from vnpy.trader.converter import PositionHolding from .time import calculate_day...
# import src.VAE # # src.VAE.train() # import src.train import numpy as np from src.data import get_drum from src.models import get_model model = get_model('src/rnn_10_classes.h5') for i in range(1, 100): try: data = get_drum('datasets/quantized_rythm_dataset/0/random_' + str(i) + '.mid') predic...
import tmxlib objmatch = { 'switch' :'OBJECT_SWITCH', 'door' :'OBJECT_DOOR', 'box_door' :'OBJECT_DOOR_DESTROY', 'box_floor' :'OBJECT_DOOR_DESTROY', 'box_jar' : 'OBJECT_JAR', 'wall' :'OBJECT_FLOOR_DESTROY', 'box_left' :'OBJECT_BOX_LEFT', 'box_right' :'OBJEC...
from collections import namedtuple from enum import Enum from dagster import check from dagster.core.definitions import Materialization, SolidHandle from dagster.core.definitions.events import EventMetadataEntry from dagster.core.types.dagster_type import DagsterType from dagster.serdes import whitelist_for_serdes fro...
from firedrake import * import numpy as np from firedrake.petsc import PETSc from firedrake import COMM_WORLD import convergence.exact_solution as exact_solution from convergence.model_parameters import * try: import matplotlib.pyplot as plt plt.rcParams["contour.corner_mask"] = False plt.close("all") exc...
import sys sys.path.append('.') import threading from time import localtime import time import torch import torch._utils STOPWORDS_ATEN = frozenset(['device','use','KE6900','ke6940','ke8950','ke8952','ke69xx','ke89xx','work','purpose','cannot','problem']) try: torch._utils._rebuild_tensor_v2 except AttributeEr...
##################################################################################################### ## Deze code werd geschreven in het kader van de masterproef van Pieter Huycke # ## De code werd geschreven in PsychoPy, en is daardoor misschien niet volledig executable in Python # ##############...
""" :mod:`fastf1.livetiming` - Live Timing Client ===================================================== This module can be used to save live timing data during a session. It is **not** possible to do real-time processing of the data. There are two ways to interact with this module. - From a python script by cre...
# Copyright (c) 2019-2020, 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...
# This file helps to compute a version number in source trees obtained from # git-archive tarball (such as those provided by githubs download-from-tag # feature). Distribution tarballs (built by setup.py sdist) and build # directories (produced by setup.py build) will contain a much shorter file # that just contains th...
""" Deep Reinforcement Learning: Deep Q-network (DQN) This example is based on https://github.com/PacktPublishing/Deep-Reinforcement-Learning-Hands-On- Second-Edition/blob/master/Chapter06/02_dqn_pong.py The template illustrates using Lightning for Reinforcement Learning. The example builds a basic DQN using the classi...
################################################################################ # Code from # https://github.com/pytorch/vision/blob/master/torchvision/datasets/folder.py # Modified the original code so that it also loads images from the current # directory as well as the subdirectories ###########################...
from __future__ import absolute_import, division, print_function name = 'observation' from .observation import *
import os import unittest class ProjectTests(unittest.TestCase): # ./.env_sample def test_env(self): self.assertTrue(os.path.isfile('./.env_sample')) # ./.gitignore def test_gitignore(self): self.assertTrue(os.path.isfile('./.gitignore')) # ./.travis.yml def test_travis(self)...
""" MIT License Copyright (c) 2022 Alpha Zero 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, publish, di...
from django.utils.translation import ugettext_lazy as _ from django.contrib import messages from django.contrib.auth import logout as logout_user from django.contrib.auth.decorators import login_required from django.contrib.sites.models import Site from django.shortcuts import render, redirect, get_object_or_404 from ...
from django.conf.urls import url, include from django.contrib import admin from django.contrib.auth import views as auth_views from mysite.core import views as core_views urlpatterns = [ url(r'^$', core_views.home, name='home'), url(r'^login/$', auth_views.login, name='login'), url(r'^logout/$', auth_view...
import psycopg2 from psycopg2.extensions import AsIs import datetime from xml.etree import ElementTree as ETree import math import random import simplejson as json from cStringIO import StringIO import struct import binascii from pgpointcloud_utils import PcRunTimeException, PcInvalidArgException # mapping between...
# Why does this file exist, and why not put this in `__main__`? # # You might be tempted to import things from `__main__` later, # but that will cause problems: the code will get executed twice: # # - When you run `python -m pytkdocs` python will execute # `__main__.py` as a script. That means there won't be any # ...
#Practical 4: Program to find area of triangle #Formulae AreaOfTriangle: 1/2 b * h; import math breadth = input("Enter breadth") height = input("Enter height") result = 0.5 * breadth * height print(result)
#!/usr/bin/env python import sys, os from optparse import OptionParser from django.core import management option_parser = OptionParser(usage=''' %prog [options] GRAPHITE_ROOT ''') option_parser.add_option('--port', default=8080, action='store', type=int, help='Port to listen on') option_parser.add_option('--interfac...
from sqlalchemy import Boolean, Column, DateTime, Integer, String from datetime import datetime from bitglitter.config.config import engine, SqlBaseClass class Preset(SqlBaseClass): __tablename__ = 'presets' __abstract__ = False nickname = Column(String, unique=True, nullable=False) datetime_create...
from mrjob.job import MRJob from mrjob.step import MRStep import os class MRProcessSP(MRJob): def steps(self): return [ MRStep(mapper=self.mapper_main), MRStep(reducer=self.reducer_main) ] def mapper_main(self, key, line): temp = line.split(" ") tem...
#!/usr/bin/env python # -*- coding: utf-8 -*- # --------------------------------------------------------------------- # Copyright (c) Merchise Autrement [~º/~] and Contributors # All rights reserved. # # This is free software; you can do what the LICENCE file allows you to. # { "name": "test_enumeration", "aut...
import math import sys import os from lux.game import Game from lux.game_map import Cell, RESOURCE_TYPES from lux.constants import Constants from lux.game_constants import GAME_CONSTANTS from lux import annotate from lux.game_objects import City DIRECTIONS = Constants.DIRECTIONS game_state = None def get_resource_ti...
import pytest import starlette.routing from xpresso import App, FromFile, FromJson, Operation, Path from xpresso.testclient import TestClient async def endpoint_1() -> None: ... async def endpoint_2() -> None: ... def test_url_path_for_with_path_parameters() -> None: operation = Operation(endpoint_1,...
#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * # You need to finish implementing triangle() in the file 'triangle.py' from .triangle import * class AboutTriangleProject2(Koan): # The first assignment did not talk about how to handle errors. # Let's handle that part now. def test_...
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "webchat.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 ...
import os import itertools import collections import json import pickle from collections import defaultdict import numpy as np import torch from torchtext.vocab import Vocab, Vectors from embedding.avg import AVG from embedding.cxtebd import CXTEBD from embedding.wordebd import WORDEBD import dataset.lo...
import datetime import logging as std_logging import operator import unittest from contextlib import contextmanager from decimal import Decimal import elasticsearch from django.apps import apps from django.conf import settings from django.test import TestCase from django.test.utils import override_settings from hayst...
from functools import partial from typing import Any from typing import Callable from typing import Dict from typing import Iterator from typing import List from typing import Optional from typing import Tuple from typing import Union import numpy as np from sklearn.base import BaseEstimator from recommender_metrics....
from locust import HttpLocust, TaskSet, task, between import random class WebsiteTasks(TaskSet): def setup(self): self.client.get("/signup") username = 'username00' password = 'password000' name = 'name' sex = 'FEMALE' tel = '13000000000' self.client.post("...
import torch from torch.utils.data import Sampler from torch_geometric.data import NeighborSampler from typing import List, Tuple, NamedTuple from torch import Tensor class StatefulSampler(Sampler): """A random sampler that ensures instances share the same permutation. Instances are passed to PyTorch Geomet...
#!/usr/bin/env python """ Run all the examples and collect the timings and results. SUT: Invocation Area: Examples run Class: Functional Type: System test """ import argparse import os.path import re import subprocess import sys import time here = os.path.dirname(__file__) class Result(object): """ ...
from .api import Api # noqa from .error import * # noqa from .models import * # noqa from .utils.constants import TOPICS # noqa
# -*- coding: utf-8 -*- # # Copyright (c) 2017, the cclib development team # # This file is part of cclib (http://cclib.github.io) and is distributed under # the terms of the BSD 3-Clause License. """Löwdin population analysis.""" import random import numpy from cclib.method.population import Populatio...
# coding=utf-8 """AdaBoost multiclass classification.""" from sklearn import datasets, model_selection, metrics, ensemble if __name__ == "__main__": print("Loading data...") X, y = datasets.load_iris(return_X_y=True) X_train, X_test, y_train, y_test = model_selection.train_test_split(X, y) print("Fit...
# -*- coding: utf-8 -*- import json import re import scrapy from locations.items import GeojsonPointItem SCRIPT_JSON = 'normalize-space(//script[@type="application/ld+json"]/text())' class VitaminShoppe(scrapy.Spider): name = 'vitamin-shoppe' download_delay = 0.2 allowed_domains = ('locations.vitamins...
""" Copyright (c) 2017, Arm Limited and affiliates. SPDX-License-Identifier: Apache-2.0 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 Unl...
from rllab.misc.console import colorize import inspect # pylint: disable=redefined-builtin # pylint: disable=protected-access def arg(name, type=None, help=None, nargs=None, mapper=None, choices=None, prefix=True): def wrap(fn): assert fn.__name__ == '__init__' if not hasattr(fn, '_autoarg...
import re USERNAME_REGEX = re.compile(r'^[a-zA-Z0-9_-]{3,20}$') PASSWORD_REGEX = re.compile(r'^.{3,20}$') EMAIL_REGEX = re.compile(r'^[\S]+@[\S]+.[\S]+$') def are_params_invalid(username, password, email): if not USERNAME_REGEX.match(username): return 'Invalid Username' if not PASSWORD_REGEX.match(pa...
class Scene(object): def enter(self): pass class Engine(object): def __init__(self, scene_map): pass def play(self): pass class Death(Scene): def entet(self): pass class CentralCorridor(Senne): def enter(self): pass class LaserWeaponArmory(Scene): def enter(self): pass class T...
# Copyright 2017 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 applicab...
cont = 0 soma = 0 for c in range(1,501,2): if c % 3 == 0: soma = soma + c cont = cont + 1 print(f'A soma final é de {soma}') print(f'Total de números: {cont}')
def is_isogram(string): if not isinstance(string, str): raise Exception("ValueError: string should be of type str") if string == "": return True string = string.lower() for letter in [c for c in string.lower() if c.isalpha()]: if string.count(letter) > 1: return Fa...
print('{:=^40}'.format('LOJAS GUANABARA')) preco_de_compra = float(input('Preço das compras:R$')) print('''FORMAS DE PAGAMENTO [1] à vista dinheiro ou cheque [2] à vista no cartão [3] 2x cartão [4] 3x ou mais no cartão''') opcao = int(input('Digite a opção: ')) if opcao == 1: total = preco_de_compra - (preco_de_com...
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2016, John McNamara, jmcnamara@cpan.org # from ..excel_comparsion_test import ExcelComparisonTest from ...workbook import Workbook class TestCompareXLSXFiles(ExcelComparisonTest): """...
# Copyright 2017 Mycroft AI Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.FileItem import FileItem from alipay.aop.api.constant.ParamConstants import * from alipay.aop.api.domain.AlipayEbppIndustryJobSyncModel import AlipayEbppIndustryJobSyncModel class AlipayEbppIndustryJobSyncRequest(object): def __init...
# coding: utf-8 """ Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.7.1 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import os import sys im...
#!/usr/local/bin/python3 """A transpilation and minification tool for KerboScript (Extended)""" # https://stackoverflow.com/questions/952914/how-to-make-a-flat-list-out-of-list-of-lists flatten = lambda l: [item for sublist in l for item in sublist] class ImportFileNotFoundError(FileNotFoundError): """Raised whe...
# -*- coding: UTF-8 -*- # 作者仓库:https://github.com/spiritLHL/qinglong_auto_tools # 觉得不错麻烦点个star谢谢 # 频道:https://t.me/qinglong_auto_tools ''' cron: 0 new Env('修复脚本依赖文件'); ''' import os, requests import os.path import time # from os import popen # 感谢spiritLHL大佬的脚本! # 只修复依赖文件(jdCookie.js那种)!!不修复环境依赖(p...
# -*- coding: utf-8 -*- LOCAL_T_MAX = 5 # repeat step size RMSP_ALPHA = 0.99 # decay parameter for RMSProp RMSP_EPSILON = 0.1 # epsilon parameter for RMSProp CHECKPOINT_DIR = 'checkpoints' LOG_FILE = '/volume/a3c_log' INITIAL_ALPHA_LOW = 1e-2 # log_uniform low limit for learning rate INITIAL_ALPHA_HIGH = 1e-2 # l...