text
stringlengths
2
999k
# This file is MACHINE GENERATED! Do not edit. # Generated by: tensorflow/python/tools/api/generator/create_python_api.py script. """Public API for tf.experimental namespace. """ from __future__ import print_function as _print_function import sys as _sys from tensorflow.python.eager.context import function_executor_...
import json import os from tempfile import mkdtemp from galaxy import model from galaxy.model import store from galaxy.tools.imp_exp import unpack_tar_gz_archive from .tools.test_history_imp_exp import _create_datasets, _mock_app, Dummy def test_import_export_history(): """Test a simple job import/export after d...
import RPi.GPIO as GPIO from AlphaBot2 import AlphaBot2 from adafruit_servokit import ServoKit kit = ServoKit(channels=16) import time TRIG = 22 ECHO = 27 PWM = 50 DR = 16 DL = 19 Ab = AlphaBot2() GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) GPIO.setup(TRIG,GPIO.OUT,initial=GPIO.LOW) GPIO.setup(ECHO,GPIO.IN) GPIO....
# MIT LICENSE # # Copyright 1997 - 2020 by IXIA Keysight # # 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,...
import os import sys import warnings from datetime import datetime import numpy as np from sklearn.model_selection import train_test_split from sklearn.metrics import mean_absolute_error from sklearn.metrics import accuracy_score from sklearn.metrics import log_loss from sklearn.utils.validation import check_X...
#!/usr/bin/env python3 if __name__ == "__main__" and __package__ == None: __package__ = "allostery-wordom" print(__package__) #import __main__ #__main__.pymol_argv = [ 'pymol' ] #import pymol2 import pymol from pymol import cmd from .interface.pymol import (bond_connections, color_selections, ...
# coding: utf-8 """ Memsource REST API Welcome to Memsource's API documentation. To view our legacy APIs please [visit our documentation](https://wiki.memsource.com/wiki/Memsource_API) and for more information about our new APIs, [visit our blog](https://www.memsource.com/blog/2017/10/24/introducing-rest-apis...
# coding: utf-8 from datetime import datetime from sqlalchemy import BigInteger, Column, Date, DateTime, Float, ForeignKey, Index, Integer, String, TIMESTAMP, Text, text from sqlalchemy.dialects.mysql import TEXT, TINYINT, VARCHAR from sqlalchemy.dialects.mysql.types import DECIMAL, TINYTEXT from sqlalchemy.orm import ...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
import os import time pid = os.fork() if pid: # parent while True: print(f"I'm the parent: pid={pid}") time.sleep(0.5) else: # child while True: print(f"I'm just a child: pid={pid}") time.sleep(0.5)
from securityheaders.models.cors import CORSDirective from securityheaders.models.annotations import requireddirectives @requireddirectives('true') class AccessControlAllowCredentialsDirective(CORSDirective): TRUE= 'true' @classmethod def isDirective(cls, directive): """ Checks whether a given str...
import torch import numpy as np import torchvision import torchvision.transforms as transforms from torch.utils.data.dataset import Dataset # ------------------------------------------------------------------------------------------------------- # DATASETS # -----------------------------------------------------------...
# 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 from __future__ import annotations # -- Path setup -----------------------------------...
# # Copyright European Organization for Nuclear Research (CERN) # National Research Centre "Kurchatov Institute" # Rutgers University # # 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 ...
import logging from unittest.mock import patch import pytest from evalml import AutoMLSearch from evalml.utils.logger import ( get_logger, log_subtitle, log_title, time_elapsed, ) TEST_LOGGER_NAME = "my_logger" @pytest.fixture() def logger_env_cleanup(monkeypatch): # need to clear out the logge...
"""Ultron Exceptions Module.""" class UltronBaseException(Exception): """ The root of the exception class hierarchy for all Ultron server exceptions. For exceptions raised by plug-ins, see UltronPluginException class. """ pass class UltronPluginException(UltronBaseExcep...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('asvsrequirement', '0002_auto_20151222_1609'), ('asvsannotation', '0010_annotationhelp_requirement_pk'), ] operations = [ ...
import os import sys import itertools import argparse import random import torch blank_token = '__' bos_token = 'SOS' eos_token = 'EOS' void_concept = 'null' slu_start_concept_mark = '_SOC_' slu_end_concept_mark = '_EOC_' blank_idx = 0 sos_idx = -1 eos_idx = -1 soc_idx = -1 eoc_idx = -1 null_idx = -1 parser = argp...
from django.db import models from django.utils.encoding import python_2_unicode_compatible from davidgram.users import models as user_models from taggit.managers import TaggableManager from django.contrib.humanize.templatetags.humanize import naturaltime # Create your models here. @python_2_unicode_compatible class Ti...
# Copyright 2019, Kay Hayen, mailto:kay.hayen@gmail.com # # Python test originally created or extracted from other peoples work. The # parts from me are licensed as below. It is at least Free Software where # it's copied from other people. In these cases, that will normally be # indicated. # # L...
#!/usr/bin/env python3 # # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Big number routines. This file is copied from python-bitcoinlib. """ import struct # generic big endian MPI format def bn_bytes(v, have_ext=False): ...
# Copyright (c) 2021, Chris and Contributors # See license.txt # import frappe import unittest class TestBudgetAdjustment(unittest.TestCase): pass
import cv2 import numpy as np import math import argparse def fishEye(imgName): oriImg=cv2.imread(imgName) size=oriImg.shape fromX=size[0] newImg=np.zeros([2*size[0],2*size[0],3]) for i in xrange(2*fromX): for j in xrange(2*fromX): newImg[i][j]=[255,255,255] for i in xrange...
from collections import deque import gym import numpy as np from gym_guppy import VariableStepGuppyEnv from gym_guppy.guppies import AdaptiveCouzinGuppy from gym_guppy.tools import Feedback from gym_guppy.tools.math import get_local_poses, transform_sin_cos, ray_casting_walls, compute_dist_bins, \ polar_coordinat...
"""Common utilities.""" import uuid import networkx_v1 as nx import numpy as np import scipy.stats as ss SCIPY_ALIASES = { 'normal': 'norm', 'exponential': 'expon', 'unif': 'uniform', 'bin': 'binom', 'binomial': 'binom' } def scipy_from_str(name): """Return the scipy.stats distribution corr...
# # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- from ty...
try: from ._version import version as __version__ except ImportError: __version__ = "unknown" from ._labeller import image_labeller __author__ = "Ian Hunt-Isaak" __email__ = "ianhuntisaak@gmail.com" __all__ = [ "__version__", "__author__", "__email__", "image_labeller", ]
from .segmenter import tools my_id = "test:read_fluorescence" __version__ = "0.1" def register(meta): meta.id = my_id meta.name = "Stack loop" meta.category = "Test" #meta.run_dep = "simple_stack_reader", "stack" meta.run_ret = "i_frame", "i_channel" loop_dependencies = ((my_id, ("_i_frame",...
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe from frappe import _ from frappe.utils import getdate, nowdate no_cache = 1 no_sitemap = 1 ROWS_PER_PAGE = 2 def get_context(context): if (frappe.session.user ==...
import pytest from eth_utils import ( is_integer, ) from web3.middleware import ( construct_error_generator_middleware, construct_result_generator_middleware, ) from web3.types import ( RPCEndpoint, ) @pytest.mark.parametrize( 'fee_history_rewards,expected_max_prio_calc', ( ( ...
# Copyright (c) 2021 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # -*- coding: utf-8 -*- # # Daml SDK documentation build configuration file, created by # sphinx-quickstart on Wed Jul 5 17:39:28 2017. # # This file is execfile()d with the current ...
# Copyright 2013-2022 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 RBackports(RPackage): """Reimplementations of Functions Introduced Since R-3.0.0 Func...
#!/usr/bin/python # coding: utf-8 -*- # (c) 2016, Mathieu Bultel <mbultel@redhat.com> # (c) 2016, Steve Baker <sbaker@redhat.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 ANSIBLE...
#!/usr/bin/env python3 # Copyright (c) 2015-2020 The Tokyocoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test BIP65 (CHECKLOCKTIMEVERIFY). Test that the CHECKLOCKTIMEVERIFY soft-fork activates at (regtest)...
import importlib import json import numpy as np import os import sys import time import uuid import copy from hypergan.discriminators import * from hypergan.distributions import * from hypergan.generators import * from hypergan.inputs import * from hypergan.samplers import * from hypergan.trainers import * import hyp...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2017-2021 Wes Moskal-Fitzpatrick # # 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...
# pylint: disable=missing-docstring from __future__ import absolute_import, division, print_function, unicode_literals from django.core.urlresolvers import reverse from django.test import TestCase from rest_framework.test import APIRequestFactory class CollectionResourceTest(TestCase): def setUp(self): ...
from pylutron.entities.lutron_entity import LutronEntity from pylutron.logger import _LOGGER class KeypadComponent(LutronEntity): """Base class for a keypad component such as a button, or an LED.""" def __init__(self, lutron, keypad, name, num, component_num, uuid): """Initializes the base keypad com...
# Copyright (C) 2018-2022 Intel Corporation # SPDX-License-Identifier: Apache-2.0 # # exp paddle model generator # import numpy as np from save_model import saveModel import sys def exp(name: str, x): import paddle paddle.enable_static() with paddle.static.program_guard(paddle.static.Program(), paddle.s...
from .Fmri import Fmri
import os import subprocess from model.config import Config from model.data_utils import CoNLLDataset, get_vocabs, UNK, NUM, \ get_word_vec_vocab, write_vocab, load_vocab, get_char_vocab, \ export_trimmed_word_vectors, get_processing_word def main(): """Procedure to build data You MUST RUN this proce...
import subprocess WAIT_TIMEOUT = 3 def test_single_message(): subscriber = subprocess.Popen(['zepusu', 'sub'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) publish = subprocess.Popen(['zepusu', 'pub', 'hello', 'world'], ...
# -*- coding: utf-8 -*- # Generated by Django 1.10.2 on 2019-05-03 13:47 from __future__ import unicode_literals from django.db import migrations def remove(apps, schema_editor): apps.get_model("linguistics", "Template").objects.filter(key__in=(240000, 240001)).delete() class Migration(migrations.Migration): ...
#!/usr/bin/env python import os import sys import django from django.conf import settings from django.test.utils import get_runner def runtests(): os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.test_settings' django.setup() TestRunner = get_runner(settings) test_runner = TestRunner() failures = te...
import asyncio import os.path import time import sys import platform import queue import traceback import os import webbrowser from decimal import Decimal from functools import partial, lru_cache from typing import (NamedTuple, Callable, Optional, TYPE_CHECKING, Union, List, Dict, Any, Sequence, Ite...
import statistics import enum from datetime import datetime def GetVersion(project, versionStr, exactMatch, jira): if not exactMatch: versions = jira.project_versions(project) allVersions = [] for version in versions: if versionStr in str(version): allVersions.a...
import sys from .metadata import Metadata from ..exceptions import SlashInternalError class RunnableTestFactory(object): def __init__(self, param=None): super(RunnableTestFactory, self).__init__() self._param = param self._factory_name = self._filename = self._module_name = None def...
# Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file ex...
# Copyright (C) 2012 The Android Open Source Project # Copyright (C) 2014 The CyanogenMod Project # # 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/LICEN...
from Module import AbstractModule class Module(AbstractModule): def __init__(self): AbstractModule.__init__(self) def run( self, network, in_data, out_attributes, user_options, num_cores, outfile): import shutil import arrayio from genomicode import filelib ...
#!/usr/bin/python3 from flask import Flask, g, session, request, render_template, make_response, send_from_directory from core.protected import protected from core.models.user import User from core.models.session import Session from core.routes.user import app as user from core.routes.access import app as access from ...
from ._base_model import BaseModel from app import db class Quiz(db.Model, BaseModel): id = db.Column(db.Integer, primary_key=True) sentences = db.relationship('Sentence', backref='quiz') name = db.Column(db.String(32)) users = db.relationship('User', backref='quiz') scores = db.relationship('Scor...
# coding=utf-8 # Copyright 2018 The Tensor2Tensor 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...
from typing import Optional import numpy as np import pandas as pd from pandas import DatetimeIndex from stateful.representable import Representable from stateful.storage.tree import DateTree from stateful.utils import list_of_instance, cast_output from pandas.api.types import infer_dtype class Stream(Representable)...
# 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...
"""Torch backend distributions""" def get_TorchDeterministic(): from numbers import Number import torch from torch.distributions import constraints from torch.distributions.kl import register_kl from torch.distributions.utils import broadcast_all class TorchDeterministic(torch.distributions...
from starlette.requests import Request from starlette.responses import Response from aioprometheus import REGISTRY, render async def metrics(request: Request) -> Response: """Render metrics into format specified by 'accept' header. This function first attempts to retrieve the metrics Registry from ``req...
""" Copyright (c) 2019 Intel 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 writin...
# Copyright 2015 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...
""" Current FlexGet version. This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by release scripts in continuous integration. Should (almost) never be set manually. The version should always be set to the <next release version>.dev The jenkins release job wi...
import sqlite3 from db import db class UserModel(db.Model): __tablename__ = 'users' id = db.Column(db.Integer, primary_key = True) username = db.Column(db.String(100)) password = db.Column(db.String(100)) def __init__(self, username, password): self.username = username self.password = password def save_to...
import flair import numpy as np import spacy import tensorflow_hub as hub import torch from flair.data import Sentence from flair.models import SequenceTagger from nltk.tokenize.treebank import TreebankWordDetokenizer from sklearn.metrics.pairwise import cosine_similarity from string import punctuation from transformer...
import os, sys from pathlib import Path import sqlite3 import csv from .log_helpers import log_message from .file_helpers import compute_file_rows_no from .db_helpers import drop_and_recreate_table, fetch_column_names, add_table_indexes class DB_Table_CSV_Importer: def __init__(self, db_path: Path, table_name: st...
class PowerException(Exception): """ An error occurred talking the the DLI Power switch """ pass
""" ================================================== Explicit feature map approximation for RBF kernels ================================================== An example illustrating the approximation of the feature map of an RBF kernel. .. currentmodule:: sklearn.kernel_approximation It shows how to use :class:`RBFSa...
# Copyright (c) 2017 lululemon athletica Canada 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 o...
#!/usr/bin/env python from copy import deepcopy import json import os import math import traceback import click import numpy as np import rastervision as rv from integration_tests.chip_classification_tests.experiment \ import ChipClassificationIntegrationTest from integration_tests.object_detection_tests.experi...
import input_data import tensorflow as tf mnist = input_data.read_data_sets("MNIST_data/", one_hot=True) x = tf.placeholder("float", [None, 784]) W = tf.Variable(tf.zeros([784, 10])) b = tf.Variable(tf.zeros([10])) matm = tf.matmul(x, W) y = tf.nn.softmax(tf.matmul(x, W) + b) y_ = tf.placeholder("float", [None, 10]) ...
""" Copyright (c) Facebook, Inc. and its affiliates. """ if __name__ == "__main__": import argparse import pickle import os from tqdm import tqdm from build_scene import * from block_data import COLOR_BID_MAP BLOCK_DATA = pickle.load( open("/private/home/aszlam/minecraft_specs/block...
# -*- coding: utf-8 -*- """ Created on Tue Jan 12 17:18:16 2016 @author: winpython """ import os from flask import Flask, request, send_file, send_from_directory, session from werkzeug import secure_filename # belows include self-define libs and func from AWWW_wav_to_spectro import wav2sep from AWWW_wav_to_STT import ...
# Copyright 2018 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...
class Item: def __init__(self, body: dict = None): if body is None: return self.id = body['id'] if 'id' in body else None self.boxId = body['boxId'] if 'boxId' in body else None self.name = body['name'] if 'name' in body else None id: int = None boxId: int = Non...
""" Copyright (c) 2021 Intel 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 writin...
# See LICENSE for licensing information. # # Copyright (c) 2016-2019 Regents of the University of California and The Board # of Regents for the Oklahoma Agricultural and Mechanical College # (acting for and on behalf of Oklahoma State University) # All rights reserved. # import design import debug import utils from tec...
# -*- coding: utf-8 -*- """ A driver to control the Keysight VNA P9374A using pyVISA and qcodes @author: Hatlab: Ryan Kaufman; UIUC: Wolfgang Pfaff """ import logging from typing import Any, Union, Dict, List, Tuple import numpy as np from qcodes import (VisaInstrument, Parameter, ParameterWithSetpoints, Instrument...
import json from app import app, db from app.models import Game gameid = '' admin_id = None def test_endpoint_route(): client = app.test_client() url = '/' response = client.get(url) assert response.status_code == 200 assert b'Tele-Schocken Beta' in response.data def test_endpoint_game(): #...
import asyncio import enum import functools import gzip import hashlib import html import http import http.cookies import importlib.util import inspect import io import json import math import os import re import stat import sys import tempfile import traceback import typing from collections import namedtuple from col...
# # ovirt-engine-setup -- ovirt engine setup # Copyright (C) 2013-2015 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://www.apache.org/licenses/LICENSE-2.0 # # Unl...
# Ce script enregistre les notes en CSV # coding: utf-8 import csv, os.path import yaml def createcsv(data, user): num1 = data.find('Moyenne') num2 = data.find('Gestion des absences') data = data[num1:num2-15] #UE|CodeModule|Module|Evaluation|Note|(Min/Max)|Coef data = data.replace("| ", "|") data = data.repla...
# -*- coding: utf-8 -*- # # Copyright (C) 2020 CERN. # # invenio-app-ils is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. """Test ILL borrowing requests actions.""" import json from datetime import timedelta import arrow from flask im...
# -*- coding: utf-8 -*- from __future__ import absolute_import from twisted.internet import reactor, error from twisted.internet.defer import Deferred, DeferredList, maybeDeferred from twisted.python import failure from twisted.trial import unittest from scrapy.downloadermiddlewares.robotstxt import (RobotsTxtMiddlewar...
# oscillator.py # # This file is part of scqubits: a Python package for superconducting qubits, # arXiv:2107.08552 (2021). https://arxiv.org/abs/2107.08552 # # Copyright (c) 2019 and later, Jens Koch and Peter Groszkowski # All rights reserved. # # This source code is licensed under the BSD-style license found...
#!/usr/local/bin/python3 __author__ = "Varada Kolhatkar" import argparse import pandas as pd import numpy as np from collections import Counter SOCC_PATH = '/Users/vkolhatk/Data/SOCC/raw/' TEMP_DATA_PATH = '/Users/vkolhatk/Data/tmp/' def get_arguments(): parser = argparse.ArgumentParser(description='Create a...
import django from django.core import checks from django.db.models import CharField, IntegerField, Lookup, TextField from django.utils.translation import ugettext_lazy as _ from django_mysql.forms import SimpleListField from django_mysql.models.lookups import SetContains, SetIContains from django_mysql.models.transfor...
"""Universe configuration builder.""" import logging import os import re import sys from galaxy.util import string_as_bool log = logging.getLogger(__name__) def resolve_path(path, root): """If 'path' is relative make absolute by prepending 'root'""" if not(os.path.isabs(path)): path = os.path.join(r...
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
# -*- coding: utf-8 -*- """ Created on Wed Jun 27 11:07:59 2018 @author: Thomas Schatz & Marianne Duyck Repeated white noise stimuli creation For a second ERP test. Create 16-bit (signed) 44.1kHz no header mono wavefiles same design as Andrillon et al. 2015 for one block 3 trial types: RefRN, RN and noise, separate...
from datetime import datetime import pytest from ..testing_utils import make_ecommerce_entityset from featuretools import Timedelta from featuretools.computational_backends.pandas_backend import PandasBackend from featuretools.primitives import ( And, Count, DirectFeature, Equals, GreaterThan, ...
import sys from cx_Freeze import setup, Executable setup( name = "OpenSSH Auditor", version = "0.1", description = "Audits a directory for potential instances of SSH private keys, reports if encrypted or unencrypted", executables = [Executable("AuditSSHKeys.py", base = "Win32GUI")])
from plugin import plugin @plugin() def helloworld(jarvis, s): """Prints \"hello world!\"""" jarvis.say("Hello World!") @plugin() def repeat(jarvis, s): """Repeats what you type""" jarvis.say(s)
import inspect import pytest from prefect.core import Flow, Task from prefect.engine.flow_runner import FlowRunner from prefect.engine.signals import PAUSE from prefect.engine.state import Paused, Resume from prefect.utilities import tasks class TestTaskDecorator: def test_task_decorator_can_be_used_without_cal...
from setuptools import setup, find_packages with open("README.md", "r") as fh: long_description = fh.read() setup( name = "candl-lexer", version = "0.0.1", author = "Bruce Collie", author_email = "brucec...
import re pattern = "(\w+)\s?(\w+): (\d)+-(\d+) or (\d)+-(\d+)" lines = [line.strip() for line in open('input.txt', 'r') if re.match(pattern, line)] conds = sum([re.findall("(\d+-\d+)", line) for line in lines], []) tickets = open('input.txt', 'r').readlines()[25:] def in_range_n(n): def inner(cond): bou...
from can import * bus = interface.Bus(bustype="socketcan", channel="vcan0") while True: try: msg = bus.recv() print(type(msg.data.hex(' ',2))) except CanError: raise exit(0)
n = int(input()) P = [] #pares I = [] #ímpares V = [] #Vetor principal t = 0 for i in range (n): V.append(int(input())) for i in range(len(V)): #dividindo o vetor em 2 vetores menores (Par e Impar) if V[i]%2==0: P.append(V[i]) #dividindo para par else: I.append(V[i]) #dividindo para impar ...
def internal_rule(string): i = string.split(' if ') t = i[1].split(' then ') r = i[0].split('rule ') return {'rule': r[1].strip(), 'if':internal(t[0]), 'then':internal(t[1])} def external_rule(rule): return ('rule ' + rule['rule'] + ' if ' + external(rule['if']) + ...
#!/usr/bin/env python # -*- coding: UTF-8 -*- """ Construct and visualize phylogenetic trees from: 1. MCSCAN output 2. CDS sequences in FASTA format Options are provided for each step: 1. sequence alignment: ClustalW2 or MUSCLE (wrapped on Biopython) 2. alignment editting: GBlocks (optional) 3. build tre...
# Copyright (c) Microsoft. All rights reserved. # Licensed under the MIT license. See LICENSE.md file in the project root for full license information. # <code> import azure.cognitiveservices.speech as speechsdk # Creates an instance of a speech config with specified subscription key and service region. # Replace wit...
import os import json from ftplib import FTP def recurse_delete_folder(ftp, path, root): wd = ftp.pwd() try: names = ftp.nlst(path) except Exception as e: # some FTP servers complain when you try and list non-existent paths print('recurse_delete_folder: Could not remove {0}: {1}'....
import logging class Dispatcher(object): def __init__(self, bot): super(Dispatcher, self).__init__() self.log = logging.getLogger(__name__) self.bot = bot self.handlers = [] def add_handler(self, handler): self.handlers.append(handler) def remove_handler(self, h...