text
stringlengths
1
927k
# Copyright 2021 sinek-dev # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. #...
# -*-python-*- # # Copyright (C) 1999-2015 The ViewCVS Group. All Rights Reserved. # # By using this file, you agree to the terms and conditions set forth in # the LICENSE.html file which can be found at the top level of the ViewVC # distribution or at http://viewvc.org/license-1.html. # # For more information, visit h...
import asyncio import pytest from mint.simulator.simulator_protocol import FarmNewBlockProtocol from mint.types.peer_info import PeerInfo from mint.util.ints import uint16, uint32, uint64 from tests.setup_nodes import setup_simulators_and_wallets from mint.wallet.did_wallet.did_wallet import DIDWallet from mint.types.b...
#!/usr/bin/env python # coding: utf-8 """Matching raw log messages and its templates that is generated by external tools.""" import re from collections import defaultdict # shortest match REPLACER_REGEX_ESCAPED = re.compile(r"\\\*[A-Z]*?\\\*") def add_esc_external(tpl): """Add escape sequence for imported exte...
# -*- coding: utf-8 -*- """ Created on Mon Nov 25 14:45:49 2013 @author: Alan Yorinks Copyright (c) 2013-14 Alan Yorinks All right reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; ei...
# -*- coding: utf-8 -*- import os import sys import pytest # Add current directory to path so we can import the example.py file. sys.path.insert(0, os.path.abspath(__file__)) pytest_plugins = "sphinx.testing.fixtures" @pytest.mark.sphinx( "html", srcdir=os.path.join(os.path.dirname(__file__), "examples"), ...
#========================================================================== # # Copyright NumFOCUS # # 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/l...
import numpy as np from numpy.testing import assert_equal, assert_raises from pandas import Series import pytest from statsmodels.graphics.factorplots import _recode, interaction_plot try: import matplotlib.pyplot as plt except ImportError: pass class TestInteractionPlot: @classmethod def setup_cla...
from PIL import Image import os import util import numpy as np import matplotlib import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec def show_images(images, save_name, hard=False): print images.shape dim = images.shape[0] if hard: images = np.array( map(lambda image...
# -*- coding: utf-8 -*- # Copyright (c) 2021, Artyk Basarov and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe # import erpnext_furniture_to_go.erpnext_furniture_to_go.doctype.furniture_to_go_settings.furniture_to_go_methods as f2g from frappe.model...
""" Tests the coalescence tree object. """ import os import random import shutil import sqlite3 import sys import unittest import numpy as np import pandas as pd from pandas.testing import assert_frame_equal from setup_tests import setUpAll, tearDownAll, skipLongTest from pycoalescence import Simulation from pycoales...
# coding: utf-8 """ Strava API v3 The [Swagger Playground](https://developers.strava.com/playground) is the easiest way to familiarize yourself with the Strava API by submitting HTTP requests and observing the responses before you write any client code. It will show what a response will look like with differe...
# 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...
# %% from pmlb import fetch_data from sklearn.preprocessing import StandardScaler from sklearn.model_selection import cross_val_predict, KFold from sklearn.metrics import mean_squared_error, roc_auc_score from tqdm import tqdm import pandas as pd import numpy as np from collections import defaultdict import warnings im...
#! /usr/bin/env udb-automate import sys import textwrap from undodb.udb_launcher import ( REDIRECTION_COLLECT, UdbLauncher, ) def main(argv): # Get the arguments from the command line. try: recording, func_name = argv[1:] except ValueError: # Wrong number of arguments. pr...
#!/usr/bin/env python # -*- coding: utf-8 -*- ### THIS FILE WAS GENERATED BY generate_classes.py - DO NOT EDIT ### ### (Generated on 2018-11-01 23:48:48.307368) ### from . import base_classes class SourceOrderChanged(base_classes.Baseevents): """Scene items have been reordered. :Returns: *name* ...
from flask import Flask app = Flask(__name__) @app.route('/') def display00(): return 'Heya! </br> This is the first page! </br> Others are at: /01 /02' @app.route('/01') def display01(): return 'And now: The second page!' @app.route('/02') def display02(): return 'Woah! The last page!' if __name__ == ...
# Copyright 2020- Robot Framework Foundation # # 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 ag...
import numpy as np from prml.feature_extractions.pca import PCA from sklearn.cluster import KMeans, MiniBatchKMeans from sklearn.preprocessing import StandardScaler class BayesianPCA_DR(PCA): def _clusteringError(self, X, kmeans): sum = 0 for i in range(0, kmeans.cluster_centers_.shape[0]): ...
from ipaddress import IPv4Network, IPv6Network from typing import Optional from pydantic import validator from pycfmodel.constants import IPV4_ZERO_VALUE, IPV6_ZERO_VALUE from pycfmodel.model.resources.properties.property import Property from pycfmodel.model.types import ( ResolvableInt, ResolvableIntOrStr, ...
print open("readfilec.py").read()
from rest_framework import serializers class DescriptionAssessmentResponseSerializer(serializers.Serializer): priority = serializers.ListField(child=serializers.CharField()) resolution = serializers.ListField(child=serializers.CharField()) areas_of_testing = serializers.ListField(child=serializers.CharFie...
#!/usr/bin/python3 import sys import numpy as np from math import floor if len(sys.argv) <= 3: print("gen_xvec_lbl.py <segments_file> <frame_size> <stride>") print("You need to enter the segments file") print("generated by generate_segments.py") print("Second and third parameter need to be") print...
import unittest from transformers import AutoTokenizer, is_torch_available from transformers.testing_utils import require_torch, slow if is_torch_available(): import torch from transformers import ( DataCollatorForLanguageModeling, DataCollatorForNextSentencePrediction, DataCollatorF...
import tensorflow as tf model = tf.keras.models.Sequential([ # YOUR CODE HERE tf.keras.layers.BatchNormalization(input_shape=(32, 32, 3)), tf.keras.layers.Conv2D(filters=64, kernel_size=(3, 3), activation="relu"), tf.keras.layers.MaxPool2D(2, 2), tf.keras.layers.Conv2D(filters=6...
"""(Non-central) F distribution.""" import numpy from scipy import special from ..baseclass import Dist from ..operators.addition import Add class f(Dist): """F distribution.""" def __init__(self, dfn, dfd, nc): Dist.__init__(self, dfn=dfn, dfd=dfd, nc=nc) def _pdf(self, x, dfn, dfd, nc): ...
# Copyright (C) 2011 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
__all__ = ["config", "message"]
from pydocmd.preprocessors.rst import Preprocessor as RSTPreprocessor from pydocmd.preprocessors.google import Preprocessor as GooglePreprocessor class Preprocessor(object): """ This class implements the preprocessor for restructured text and google. """ def __init__(self, config=None): self.c...
"""This module contains the general information for SwAccessDomain ManagedObject.""" from ...ucsmo import ManagedObject from ...ucscoremeta import MoPropertyMeta, MoMeta from ...ucsmeta import VersionMeta class SwAccessDomainConsts: FSM_PREV_DEPLOY_BEGIN = "DeployBegin" FSM_PREV_DEPLOY_FAIL = "DeployFail" ...
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
# -*- coding: utf8 -*- # Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. 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...
from unittest.mock import Mock, call, patch from pytest import fixture, mark, fail from pyviews.core import XmlAttr from wxviews.core import pipes, WxRenderingContext from wxviews.core.pipes import apply_attributes, add_to_sizer from wxviews.widgets import WxNode class TestControl: def __init__(self): s...
#******************************************************************************* # Copyright 2014-2020 Intel Corporation # All Rights Reserved. # # This software is licensed under the Apache License, Version 2.0 (the # "License"), the following terms apply: # # You may not use this file except in compliance with the Li...
# -*- coding: utf-8 -*- # Copyright (c) 2015, Vispy Development Team. # Distributed under the (new) BSD License. See LICENSE.txt for more info. """ Utilities related to data reading, writing, fetching, and generation. """ from os import path as _op from .datasets import (load_iris, load_crate, load_data_file, # noq...
import logging import os import pprint from googleads import ad_manager from dfp.client import get_client logger = logging.getLogger(__name__) def create_creatives(creatives): """ Creates creatives in DFP. Args: creatives (arr): an array of objects, each a creative configuration Returns: an array:...
for a in range(10): for b in range(10): for c in range(10): for d in range(10): for e in range(10): for f in range(10): for g in range(10): for h in range(10): print("{}{}{}{}{...
import heapq import random def merge(lists): heapq.heapify(lists) m = [] while len(lists) > 0: l = heapq.heappop(lists) if len(l) == 0: continue m.append(l.pop(0)) heapq.heappush(lists, l) return m def test(n, k): lists = [[] for _ in xrange(k)] fo...
from __pyjamas__ import get_main_frame, JS def create_xml_doc(text): return None
from ...ir_ast.instructions import IrInstExtractElement, IrInstInsertElement, IrInstShuffleVector from be_typing import TYPE_CHECKING def p_ir_opcode_vector_extract(p): # type: (YaccProduction) -> None """ ir-opcode : ir-instruction-assignment EXTRACTELEMENT ir-value COMMA ir-value ir-instruction-atta...
[ ## this file was manually modified by jt { 'functor' : { 'description' : ['Returns True<result_type>() or False<result_type>() according a0 is zero or not.'], 'module' : 'boost', 'arity' : '1', 'call_types' : [], 'ret_arity' : '0', 'rturn' : { ...
# Licensed to the StackStorm, Inc ('StackStorm') 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 use th...
# encoding=utf-8 from flask import Blueprint, make_response, render_template, current_app, session, jsonify, g from flask import session, request import math from info.utils.response_code import RET from info.models import * from info import constants from info.utils.common import LoginUser, RankList blue = Blueprin...
""" GFF3 parser unit tests. """ from __future__ import division from __future__ import print_function from __future__ import unicode_literals import ga4gh.server.gff3 as gff3 import unittest _testDataDir = "tests/data/datasets/dataset1/sequenceAnnotations/" class TestGff3ParserOnTypicalFile(unittest.TestCase): ...
"""NLP Dataset""" import os import re from typing import List, Union, Dict, Tuple import nltk import unicodedata import numpy as np from dlex.configs import ModuleConfigs from dlex.utils.logging import logger # nltk.download('punkt') # Turn a Unicode string to plain ASCII, thanks to # https://stackoverflow.com/a/5...
#! python3 from __future__ import print_function import SimpleITK as sitk import ImageRegistration as reg import numpy as np import sys import os outputPath = "D:\\Martin\\Personal\\UNSAM\\CursoNeuroimagenes\\TrabajosFinales\\NicolasFuentes\\ADNI\\002_S_5018\\RegisteredData\\" if not os.path.exists(outputPath): o...
# pylint: disable=no-self-use,invalid-name from collections import defaultdict import pytest import numpy from allennlp.common.checks import ConfigurationError from allennlp.common.testing import AllenNlpTestCase from allennlp.data import Token, Vocabulary from allennlp.data.fields import TextField, SequenceLabelFiel...
from setuptools import setup setup( name="bplot", version="0.2", description="Functional plotting.", url="http://github.com/roualdes/bplot", author="Edward A. Roualdes", author_email="eroualdes@csuchico.edu", license="BSD (3-clause)", install_requires=[ "matplotlib>=3.0.0", ...
class ImapToolsError(Exception): """Base lib error""" class MailboxFolderStatusValueError(ImapToolsError): """Wrong folder status value error""" class UnexpectedCommandStatusError(ImapToolsError): """Unexpected status in IMAP command response""" def __init__(self, command_result: tuple, expected: s...
#!/usr/bin/env python3 def api(environ, start_response): """Simplest possible application object""" data = b'{"code": 200}\n' status = '200 OK' response_headers = [ ('Content-type', 'application/json'), ('Content-Length', str(len(data))) ] start_response(status, response_headers...
# (c) Copyright 2014 Cisco Systems 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 # # Unl...
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2018, Mikhail Yohman (@FragmentedPacket) <mikhail.yohman@gmail.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type DOCUMENTATI...
#!/usr/bin/env python # -*- coding: utf-8 -*- # File: ilsvrc.py # Author: Yuxin Wu <ppwwyyxxc@gmail.com> import os import tarfile import cv2 import numpy as np from six.moves import range import xml.etree.ElementTree as ET from ...utils import logger, get_rng, get_dataset_path from ...utils.loadcaffe import get_caffe_...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Jun 18 18:54:48 2020 @author: dylanroyston """ # -*- coding: utf-8 -*- # import packages #import dash_player import dash import dash_table import dash_core_components as dcc import dash_html_components as html from dash.dependencies import Input, Out...
import discord from discord.ext import commands import aiohttp hug = ["https://c.tenor.com/bFZKN-tlQP4AAAAC/love-you-my-best-friend.gif", "https://c.tenor.com/KlkE8vt8gOIAAAAM/love-is-the-answer-to-everything-hug.gif", "https://c.tenor.com/OkpKo5iPu-8AAAAM/huge-hug.gif", "https://c.tenor.com/BW8ZMOHHrgMAAAAM/friends-jo...
# =============================================================================== # Copyright 2017 ross # # 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/LICE...
from django.shortcuts import render from django import template register = template.Library() from django.contrib.auth.decorators import login_required import json from django.core.serializers.json import DjangoJSONEncoder from django.forms.models import model_to_dict from overview.models import AddItem from overview....
""" Imag ==== This example shows how to use the :py:class:`pylops.basicoperators.Imag` operator. This operator returns the imaginary part of the data as a real value in forward mode, and the real part of the model as an imaginary value in adjoint mode (with zero real part). """ import numpy as np import matplotlib.pyp...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ __title__ = 'pytorch-YOLOv4' __author__ = 'deagle' __date__ = '11/23/2020 11:30' # code is far away from bugs with the god animal protecting I love animals. They taste delicious. """ import datetime from tensorboardX import SummaryWriter def main(): from tenso...
# coding=utf-8 import os import enCount.gtfs as gtfs import enCount.db as db import enCount.queues as queue from enCount.config import genomes_root import datetime import unittest import time # Mock system calls from mock import Mock gtfs.rnastar.sp_call = Mock(return_value=0) gtfs.get_version_before = Mock(return_va...
from sqlalchemy import ( Column, String, ForeignKey, Float, Integer, Boolean ) from sqlalchemy.orm import relationship from sqlalchemy.dialects import postgresql from libs.database import Base, Stateful class Model(Stateful): '''Model table''' __tablename__ = 'models' id = Column...
# SPDX-FileCopyrightText: 2020 Splunk Inc. # # SPDX-License-Identifier: Apache-2.0 from builtins import object import os.path as op import traceback from splunktalib.common import log class FileMonitor(object): def __init__(self, callback, files): """ :files: files to be monidtored with full pat...
from rest_framework.viewsets import ModelViewSet from .models import Profile, Group from .serializers import ProfileSerializers, GroupSerializers from rest_framework.response import Response from rest_framework.decorators import action from itertools import chain class ProfileViewSet(ModelViewSet): serializer_cla...
# 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...
from .sqlite import SqlitePresenceStorageEngine
# coding=utf-8 # Copyright 2022 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...
# Copyright (c) 2021 The Regents of the University of California # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: redistributions of source code must retain the above copyright # notice, this lis...
# Copyright 2021 The MT3 Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
from js2py.base import * #todo Double check everything is OK @Js def Object(): val = arguments.get('0') if val.is_null() or val.is_undefined(): return PyJsObject(prototype=ObjectPrototype) return val.to_object() @Js def object_constructor(): if len(arguments): val = arguments.get('0'...
# -*- coding: utf-8 -*- from __future__ import absolute_import from datetime import date, datetime # noqa: F401 from typing import List, Dict # noqa: F401 from fuji_server.models.base_model_ import Model from fuji_server import util class LicenseOutputInner(Model): """NOTE: This class is auto generated by th...
class NumArray: def __init__(self, nums: List[int]): self.n = list(accumulate(nums)) def sumRange(self, left: int, right: int) -> int: return self.n[right]- (self.n[left-1] if left>0 else 0)
# nxt.motcont module -- Interface to Linus Atorf's MotorControl NXC # Copyright (C) 2011 Marcus Wanner # # This program 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 # (a...
import pandas as pd import numpy as np import streamlit as st import plotly.express as px import ipywidgets as widgets from ipywidgets import fixed import seaborn as sns import matplotlib.pyplot as plt sns.set_style('whitegrid') st.set_page_config(layout='wide') @st.cache(allow_output_mutation=True) def get_data(path...
import argparse import datetime import sys import requests from os import makedirs from os.path import dirname, exists from re import search, sub, escape import xmltodict # Setup the CLI arguments parser parser = argparse.ArgumentParser() parser.add_argument('auth', help='User API auth key.', type=str) parser.add_arg...
# -*- coding: utf-8 -*- from trytond.pool import PoolMeta from trytond.model import fields, ModelSQL, ModelView from trytond.transaction import Transaction __metaclass__ = PoolMeta __all__ = ['MagentoPaymentGateway', 'Payment'] class MagentoPaymentGateway(ModelSQL, ModelView): """ This model maps the availab...
# Copyright 2014 OpenStack Foundation # # 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 ...
import pytest from nidm.experiment import Project, Session, AssessmentAcquisition, AssessmentObject, Acquisition, AcquisitionObject, Query from nidm.core import Constants from rdflib import Namespace,URIRef import prov.model as pm from os import remove import pprint from prov.model import ProvDocument, QualifiedName f...
import csv import random from pzd_constants import DATE_FORMAT from datetime import datetime, timedelta date = None price = 0 with open('stock_data/aapl.csv', mode="r") as f: reader = csv.reader(f, delimiter=',') for row in reader: date = datetime.strptime(row[0], DATE_FORMAT) price = float(ro...
# uncompyle6 version 3.2.0 # Python bytecode 2.4 (62061) # Decompiled from: Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:19:30) [MSC v.1500 32 bit (Intel)] # Embedded file name: pirates.minigame.Distributed7StudTable from pirates.minigame import PlayingCardGlobals from pirates.minigame import DistributedPokerTabl...
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_parse_qs, compat_urllib_parse_urlparse, ) from ..utils import ( determine_ext, dict_get, int_or_none, try_get, urljoin, compat_str, ) class SVTBaseIE(Info...
# # With this customization the ClusterMCsplitStrips module will be substituted # for the standard clusterizer. If a cluster is matched to more than one simTrack # it will be split into the corresponding true clusters. # import FWCore.ParameterSet.Config as cms def splitMCmerged(process): process.siStripClustersU...
""" Remarks: https://github.com/cmusphinx/cmudict is newer than 0.7b! It has for example 'declarative' but is has unfortunately no MIT-license. """ import string from logging import getLogger from typing import Callable, Dict, List, Optional, Tuple, Union PUNCTUATION_AND_LINEBREAK = f"{string.punctuation}\n" IPA_CAC...
import sys import socket sys.path.append('../') import common.define BUF_SIZE = 2048 class ReptilesServerSocket(): def __init__(self, sock=None): if sock is None: self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) else: self.sock = sock def setsocket(self...
# -*- coding=utf-8 -*- import socket import psutil import json # 创建链接 # 生成一个socket对象 sk = socket.socket(socket.AF_INET, socket.SOCK_STREAM) host = socket.gethostname() port = 8888 # 请求连接服务端 sk.connect((host, port)) #获取信息 #获取主机名 hostname = socket.getfqdn(socket.gethostname()) #获取主机IP地址 host_ip = socket.gethostbyname...
""" Django settings for helloworld project. Generated by 'django-admin startproject' using Django 3.0.8. For more information on this file, see https://docs.djangoproject.com/en/3.0/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.0/ref/settings/ """ import os...
import datetime import pytest from base.client_base import TestcaseBase from common import common_func as cf from common import common_type as ct from common.common_type import CaseLabel from utils.util_log import test_log as log from pymilvus_orm import utility rounds = 100 per_nb = 100000 default_field_name = ct.d...
def leiaInt(msg): ok = False valor = 0 while True: n = str(input(msg)) if n.isnumeric(): valor = int(n) ok = True else: print('ERRO!') if ok: break return valor n = leiaInt('Digite um número: ')
# Generated by Django 3.2.7 on 2021-10-27 09:42 from django.db import migrations, models import django.db.models.deletion import phonenumber_field.modelfields class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='C...
# -*- coding: utf-8 -*- # Generated by Django 1.9.2 on 2016-02-27 15:28 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.Creat...
import pytest from celery.result import EagerResult from university_dost.users.tasks import get_users_count from university_dost.users.tests.factories import UserFactory pytestmark = pytest.mark.django_db def test_user_count(settings): """A basic test to execute the get_users_count Celery task.""" UserFacto...
temperaturaF = input ("Qual temperatura desejada? ") K = float(temperaturaF) temperarturaC = 5*(K - 32)/9 print ('A temepratura celsius é ',temperarturaC)
kwh_used = 1000 out = 0 if(kwh_used < 500): out += 500 * 0.45 elif(kwh_used >= 500 and kwh_used < 1500): out += 500 * 0.45 + ((kwh_used - 500) * 0.74) elif(kwh_used >= 1500 and kwh_used < 2500): out += 500 * 0.45 + ((kwh_used - 500) * 0.74) + ((kwh_used - 1500) * 1.25) elif(kwh_used >= 2500): out += 50...
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # --------------------------------------------------------------------------------------...
import debug import device # Status command to use when sending commands between scripts INTER_SCRIPT_STATUS_BYTE = 0x00 INTER_SCRIPT_DATA1_BTN_DOWN_CMD = 0x01 # Data2 contains the id of the button INTER_SCRIPT_DATA1_BTN_UP_CMD = 0x02 # Data2 contains the id of the button INTER_SCRIPT_DATA1_UPDATE_STATE = 0x...
from flask import current_app from notifications_utils.s3 import S3ObjectNotFound from notifications_utils.s3 import s3download as utils_s3download from sqlalchemy.orm.exc import NoResultFound from app import create_random_identifier from app.dao.notifications_dao import _update_notification_status from app.dao.servic...
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: send_message_with_appendix_request.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _messa...
from Crypto.Cipher import Blowfish def encode_dataset_user(trans, dataset, user): # encode dataset id as usual # encode user id using the dataset create time as the key dataset_hash = trans.security.encode_id(dataset.id) if user is None: user_hash = 'None' else: user_hash = str(use...
""" Script to generate xml for running phosim jobs with the SLAC workflow engine. """ from __future__ import absolute_import, print_function import os import desc.workflow_engine.workflow_engine as engine pipeline = engine.Pipeline('JC_phoSim_pipeline', '0.1') main_task = pipeline.main_task main_task.notation = 'PhoS...
import numpy as np import os import six.moves.urllib as urllib import sys import tarfile import tensorflow as tf import zipfile from collections import defaultdict from io import StringIO from matplotlib import pyplot as plt from PIL import Image import cv2 from webcamvideostream import * videoUrl = 1 videoUrl = "/...
from functools import lru_cache from pathlib import Path import os from pprint import pprint import re import sys from textwrap import indent import pyparsing as pp from pyparsing import ( Suppress, Word, alphas, alphanums, nums, Optional, Group, ZeroOrMore, empty, restOfLine, Keyword, cStyleComment, Empty, Li...