text
stringlengths
1
927k
#!/usr/bin/env python from distutils.version import LooseVersion import os import pip from setuptools import find_packages from setuptools import setup import sys if LooseVersion(sys.version) < LooseVersion('3.6'): raise RuntimeError( 'ESPnet requires Python>=3.6, ' 'but your Python is {}'.format(...
# Generated by Django 3.0.6 on 2021-03-01 09:57 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("backend", "0004_pointsgained_comment"), ] operations = [ migrations.AddField( model_name="community", name="colour",...
import copy import io import itertools import os import shutil import unittest import tempfile import pkg_resources import pyhmmer from pyhmmer.errors import EaselError, AlphabetMismatch from pyhmmer.easel import Alphabet, SequenceFile from pyhmmer.plan7 import HMM, HMMFile, Profile, Background class TestProfile(uni...
from django.urls import path from . import views urlpatterns = [ path('', views.index_view, name='index'), ]
import pytest import allure from api_requests.preconditions import Preconditions @allure.severity(allure.severity_level.NORMAL) @pytest.mark.account @pytest.mark.delete def test_delete_account(app): app.global_header.navigate_to_object('Account', 'Account') app.list_view_page.open_list_view('All Accounts') ...
import debile.master.utils as utils import unittest import mock class MasterUtilsTestCase(unittest.TestCase): def test_init_config(self): config = utils._init_config('tests/resources/master.yaml') self.assertEquals(config['database'], 'sqlite:////srv/debile/debile.db') self.assertIsNotNo...
import ok from fpga import FPGA import numpy as np import time import matplotlib.pyplot as plot import struct from collections import namedtuple BLOCK_SIZE = (16384) WRITE_SIZE=(8*1024*1024) READ_SIZE = (8*1024*1024) g_nMemSize = (8*1024*1024) sample_size = (524288) ep = namedtuple('ep', 'addr bits type') control = ...
import psycopg2 from database.config import config from database.postgresql_tables import Tables import logging logger = logging.getLogger(__name__) class PostgresqlUtils(): INSERT_COMMAND = 'INSERT INTO {} ({}) VALUES({}) RETURNING {}' SELECT_COMMAND_CONDITION = 'SELECT {} FROM {} {}' WHERE_CLAUSE = 'W...
# Copyright 2017 Google LLC # # 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 writing, ...
# @Time : 2020/12/17 # @Author : Chen Yang # @Email : 254170321@qq.com """ recbole.data.xgboost_dataset ########################## """ from recbole.data.dataset import Dataset from recbole.utils import FeatureType class XgboostDataset(Dataset): """:class:`XgboostDataset` is based on :class:`~recbole.data.dat...
#BEGIN_HEADER # The header block is where all import statments should live import sys import traceback import uuid from pprint import pprint, pformat from biokbase.workspace.client import Workspace as workspaceService #END_HEADER class SneddonContigFilter2: ''' Module Name: SneddonContigFilter2 Module...
#!/usr/bin/env python # -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # (C) British Crown Copyright 2017-2019 Met Office. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the ...
import logging from sqlalchemy import create_engine import pandas as pd from numpy import testing import numpy as np from dev import strategy_store, events from pluto import examples from pluto.utils import stream from pluto.control.loop import simulation_loop from pluto.control.processes import processes from ...
# -*- coding: utf-8 -*- import os, sys, pdb import argparse import torch import numpy as np FILE_PATH = os.path.abspath(__file__) PRJ_PATH = os.path.dirname(os.path.dirname(FILE_PATH)) sys.path.append(PRJ_PATH) from utils.loader import data_load # from utils.model import resnet from utils.model import cls_model fro...
from pymemcache.client.hash import HashClient from pymemcache.client.base import Client, PooledClient from pymemcache.exceptions import MemcacheError, MemcacheUnknownError from pymemcache import pool from .test_client import ClientTestMixin, MockSocket import unittest import os import pytest from unittest import mock ...
# Copyright (c) 2016 Huawei Technologies Co., Ltd. # 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 # # ...
from ib_insync import * from os import listdir, remove from time import sleep import pickle import pandas as pd from helper_functions import * # Define your variables here ########################################################################################### sampling_rate = 1 # How often, in seconds, to check for...
#!/usr/bin/env python import os from fabric.api import * # noqa from fabric.colors import green, yellow from fabric.contrib.console import confirm from prettyprint import pp import re VERSION_PATTERN = r'^v\d+(\.\d+)+?$' env.releases_directory = "release" env.root_dir = os.path.abspath(os.path.dirname(__file__)) en...
#!/usr/bin/python # -*- encoding: utf-8; py-indent-offset: 4 -*- # +------------------------------------------------------------------+ # | ____ _ _ __ __ _ __ | # | / ___| |__ ___ ___| | __ | \/ | |/ / | # | | | | '_ \ / _ \/ __| |/ /...
from pyopteryx.factories.loop_action_factories.abstract_loop_action_factory import AbstractLoopActionFactory from pyopteryx.utils.builder_utils import add_activity_to_task, add_reply_entry class StopLoopActionFactory(AbstractLoopActionFactory): def __init__(self, action, xml_cache, input_data, processor, mapping_...
import time import traceback from datetime import datetime from App.controllers.BaseController import BaseController from App.jobs import get_job_pool from App.jobs.JobMultipleHandler import job_multiple_handler from App.jobs.JobQueuePutter import JobSuccessQueuePutter, JobStartedQueuePutter, JobRunningQueuePutter, \...
# coding: utf-8 """ OpsGenie REST API OpsGenie OpenAPI Specification # noqa: E501 OpenAPI spec version: 2.0.0 Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F401 import six class Filter(object): """NOTE: This class is auto generate...
#!/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 ...
# coding: utf-8 """ OpenALPR Cloud API No descripton provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: 2.0.1 Generated by: https://github.com/swagger-api/swagger-codegen.git Licensed under the Apache License, Version 2.0 (the "Licen...
from __future__ import print_function, unicode_literals import logging from traceplus.common.functional import LazyObjectProxy __all__ = [ 'Tracer', 'NoopTracer', 'tracer' ] class Tracer(object): """The basic Trace++ client. """ logger = logging.getLogger('traceplus.tracer') def __init_...
# coding: utf-8 """ EVE Swagger Interface An OpenAPI for EVE Online # noqa: E501 OpenAPI spec version: 0.8.0 Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F401 import six class GetAlliancesNames200Ok(object): """NOTE: This class i...
import cloudfiles import optparse from cumulus import settings from django.core.management.base import BaseCommand, CommandError class Command(BaseCommand): args = "[container_name container_name ...]" help = "Display info for cloud files containers" option_list = BaseCommand.option_list + ( opt...
import os import re import shutil import time from others import pyrouge REMAP = {"-lrb-": "(", "-rrb-": ")", "-lcb-": "{", "-rcb-": "}", "-lsb-": "[", "-rsb-": "]", "``": '"', "''": '"'} def clean(x): return re.sub( r"-lrb-|-rrb-|-lcb-|-rcb-|-lsb-|-rsb-|``|''", lambda m: REMAP.get(m.gr...
#! /usr/bin/env python # Copyright (c) 2016 Zielezinski A, combio.pl import argparse import sys from alfpy import graphdna from alfpy.utils import distmatrix from alfpy.utils import seqrecords from alfpy.version import __version__ def get_parser(): parser = argparse.ArgumentParser( description='''Calcu...
#!/usr/bin/env python class Appointment(object): def __init__(self, name, start, end): self.name = name self.start = start self.end = end def __lt__(self, other): return self.start < other.start def __str__(self): return self.name def __repr__(self): r...
#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * class AboutClasses(Koan): class Dog(object): "Dogs need regular walkies. Never, ever let them drive." def test_instances_of_classes_can_be_created_adding_parentheses(self): fido = self.Dog() self.assertEqual(Abou...
from ..package import MYPReader def addScript(name: str, command: str, description: str = ""): myp = MYPReader() myp.add_script( name=name, command=command, description=description, ) myp.write() print('Script added successfully.') def removeScript(name: str): myp = MY...
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import argparse from typing import Callable, List, Optional import torch from fairseq import utils from fairseq.data.indexed_dataset import g...
#!/usr/bin/python3 import os import sys import json import zipfile import shutil from urllib.request import urlretrieve cur_dir = os.path.dirname(os.path.realpath(__file__)) app_dir = os.path.join(cur_dir, 'opt/dist/app') gluu_app_dir = os.path.join(cur_dir, 'opt/dist/gluu') target = 'el7' if '-el8' in sys.argv: ...
#------------------------------------------------------------------------------ # Copyright (c) 2013, Nucleic Development Team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE, distributed with this software. #-----------------------------------------------------...
def __bootstrap__(): global __bootstrap__, __loader__, __file__ import sys, pkg_resources, imp __file__ = pkg_resources.resource_filename(__name__,'ft2font.so') __loader__ = None; del __bootstrap__, __loader__ imp.load_dynamic(__name__,__file__) __bootstrap__()
""" This script is to generate """ import os import torch from pathlib import Path from dataclasses import dataclass from utils import save_as_json from utils.logging import logging from models.tokenizer import BertTokenizerWithHLAns from utils.data.datasets.squad import QnGenHLCtxtDataset from utils.eval import clean_...
from django.urls import path from accounts.views.api_views import (LoginViewSet, CustomerRegistrationViewSet, RefreshViewSet, VerifyEmail, RequestPasswordResetEmail, Pa...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ File: panel_group.py Description: Group Panel for Python SDK sample. """ import os import wx import wx.lib.scrolledpanel as scrolled import util import model from view import base class GroupPanel(base.MyPanel): """Group Panel.""" def __init__(self, parent...
import json from copy import copy from stat_utils import * with open('time_trimmed.json', 'r') as infile: data = json.loads(infile.read()) subject_stats = {} inr_fields = [ 'inr_im_lborres', ] chem_fields = [ 'alt_im_lborres', 'ast_im_lborres', 'dbil_im_lborres', 'tbil_im_lborres', ] inr_dat...
"""Rules for writing tests with JUnit""" load("@bazel_skylib//lib:dicts.bzl", _dicts = "dicts") load( "@io_bazel_rules_scala//scala/private:common_attributes.bzl", "common_attrs", "implicit_deps", "launcher_template", ) load("@io_bazel_rules_scala//scala/private:common_outputs.bzl", "common_outputs") l...
from django.http import HttpResponseNotFound, HttpResponseServerError def test_404(request): return HttpResponseNotFound() def test_500(request): return HttpResponseServerError()
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2011 Justin Santa Barbara # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance wi...
import pygame, time, sys class VirtualButton(object): def __init__(self, key, x, y): self.key = key self.down = False self.x = x self.y = y left = VirtualButton(pygame.K_LEFT, 0, 1) up = VirtualButton(pygame.K_UP, 1, 0) right = VirtualButton(pygame.K_RIGHT, 2, 1) down = VirtualButt...
from . import ( Async, Sync )
from __future__ import print_function, division import scipy from keras.datasets import mnist from instanceNormalization import InstanceNormalization from keras.layers import Input, Dense, Reshape, Flatten, Dropout, Concatenate, GRU, CuDNNGRU, Bidirectional, Lambda from keras.layers import BatchNormalization, Activati...
# Copyright 2018 Google LLC # # 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 writing, ...
############################################################################## # Copyright (c) 2017 Huawei Technologies Co.,Ltd and others. # # All rights reserved. This program and the accompanying materials # are made available under the terms of the Apache License, Version 2.0 # which accompanies this distribution, ...
#!/usr/bin/env python # normalDate.py - version 1.0 - 20000717 #hacked by Robin Becker 10/Apr/2001 #major changes include # using Types instead of type(0) etc # BusinessDate class # __radd__, __rsub__ methods # formatMS stuff # derived from an original version created # by Jeff Bauer of Rubicon Research and us...
# coding: utf-8 """ Pdf4me No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 OpenAPI spec version: v1 Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F401 import six class...
from typing import List from livestyled.models.fulfilment_point import FulfilmentPoint class ProductVariant: def __init__( self, id, price, stocks, external_id, translations, product, tax=None, tax_rate=No...
from discord.ext import commands import discord import sys from pathlib import Path import motor.motor_asyncio from config import token, extension_dir from utils.context import UnnamedContext from utils.help import PaginatedHelpCommand class UnnamedBot(commands.Bot): def __init__(self, command_prefix, **options):...
""" Implementation of the Brute from "Revisiting the Arcade Learning Environment: Evaluation Protocols and Open Problems for General Agents" by Machado et al. https://arxiv.org/abs/1709.06009 This is an agent that uses the determinism of the environment in order to do pretty well at a number of retro games. It does n...
# coding: utf-8 """ Cisco Intersight Cisco Intersight is a management platform delivered as a service with embedded analytics for your Cisco and 3rd party IT infrastructure. This platform offers an intelligent level of management that enables IT organizations to analyze, simplify, and automate their environmen...
from astropy.io import fits from coords import nsew_of_constant_dec,Molonglo,hadec_to_nsew from scipy.ndimage import filters import ephem as e import numpy as np import copy SEC_TO_SID = 0.9972685185185185 # convert seconds to siderial "seconds" EW_R = np.radians(2.0) # EW beam HWHM NS_R = np.radians(1.0) # NS beam HW...
import time import random import datetime from bs4 import BeautifulSoup as bs import pandas as pd import os import json import requests month=['01','02','03','04','05','06','07','08','09','10','11','12'] year=['2015','2016','2017','2018','2019','2020'] date=[] movies=[] def craw(startdate,enddate): url = 'https:...
# # PySNMP MIB module SUPERMICRO-SMI (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/SUPERMICRO-SMI # Produced by pysmi-0.3.4 at Mon Apr 29 21:04:30 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2...
from django.test import TestCase from django.contrib.auth import get_user_model from core import models def sample_user(email='test@ceratopsdev.com', password='testPass'): """Create a sample user""" return get_user_model().objects.create_user(email, password) class ModelTests(TestCase): def test_create_...
"""Playing with plots for galletta""" import os import matplotlib matplotlib.use("Agg") import matplotlib.pyplot as plt import pandas as pd import seaborn as sns from scipy.stats import ttest_ind from larval_gonad.plotting.stats import pval_to_string def main(): plt.style.use(["2c", "science_base"]) fig, ...
import re import pyperclip def remove(string: str): return re.sub(r'\s+', ' ', string) # return re.sub(r' {2,}', ' ', re.sub(r'\s+', ' ', string)) if __name__ == '__main__': pyperclip.copy(remove(pyperclip.paste()))
import os from schema import Or from testplan.common.config import ConfigOption from ..base import ProcessRunnerTest, ProcessRunnerTestConfig from ...importers.cppunit import CPPUnitResultImporter, CPPUnitImportedResult class CppunitConfig(ProcessRunnerTestConfig): """ Configuration object for :py:class:`~...
from __future__ import absolute_import from __future__ import print_function import math import veriloggen.core.vtypes as vtypes import veriloggen.seq.seq as seq t_Input = 'Input' t_Output = 'Output' t_Wire = 'Wire' t_Reg = 'Reg' t_OutputReg = 'OutputReg' def swap_type(cls): return cls._O, cls._I def make_po...
from django.urls import path from django.conf.urls import url from .views import ( PostListView, PostDetailView, PostCreateView, PostUpdateView, PostDeleteView, ) from . import views urlpatterns = [ path('', PostListView.as_view(), name='timeapp-home'), path('post/<int:pk>/', PostDetailVie...
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals import frappe, frappe.utils, frappe.utils.scheduler import unittest test_records = frappe.get_test_records('Email Alert') class TestEmailAlert(unittest.TestCase): def setUp(self): frappe....
""" This platform provides support for sensor data from RainMachine. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.rainmachine/ """ import logging from homeassistant.components.rainmachine import ( DATA_RAINMACHINE, SENSOR_UPDATE_TOPIC, SENS...
#-*- coding:utf-8 _*- """ @author:charlesXu @file: data.py @desc: 构建字向量、词向量 @time: 2018/08/08 """ import sys, pickle, os, random import numpy as np import pdb ## tags, BIO 标注策略 标签矩阵 tag2label = {"O": 0, "B-PER": 1, "I-PER": 2, "B-LOC": 3, "I-LOC": 4, "B-ORG": 5, "I-ORG": 6, ...
from .api import forecasts, observations
# Copyright 2021 UW-IT, University of Washington # SPDX-License-Identifier: Apache-2.0 from endorsement.test.support import SupportApiTest class TestSupportNotifications(SupportApiTest): @property def reverse_id(self): return 'endorsee_notifications' def test_statistics(self): self._test_...
import discord.ext.commands as dec import database.song from commands.common import * class Song: """Song insertion, querying and manipulation""" def __init__(self, bot): self._bot = bot self._db = database.song.SongInterface(bot.loop) _help_messages = { 'group': 'Song informatio...
# -*- coding: utf-8 -*- # Generated by Django 1.9 on 2017-08-15 12:13 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.CreateM...
import sys import importlib import logging from . import __version__ from .args import HelpfulArgumentParser # List of all subcommands. A module of the given name must exist and define # add_arguments() and main() functions. Documentation is taken from the first # line of the module’s docstring. COMMANDS = [ 'phase'...
from transitions import Transition from transitions.extensions.markup import MarkupMachine from transitions.core import listify import warnings import logging from functools import partial _LOGGER = logging.getLogger(__name__) _LOGGER.addHandler(logging.NullHandler()) # make deprecation warnings of transition visibl...
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2015 Thomas Voegtlin # # 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...
# coding=utf-8 # Copyright 2022 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 License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
"""本模块实现事件响应器的创建与运行,并提供一些快捷方法来帮助用户更好的与机器人进行对话。 FrontMatter: sidebar_position: 3 description: nonebot.matcher 模块 """ from nonebot.internal.matcher import Matcher as Matcher from nonebot.internal.matcher import matchers as matchers from nonebot.internal.matcher import current_bot as current_bot from nonebot.int...
import torch.nn as nn __author__ = "Sachin Mehta" __version__ = "1.0.1" __maintainer__ = "Sachin Mehta" class CBR(nn.Module): ''' This class defines the convolution layer with batch normalization and PReLU activation ''' def __init__(self, nIn, nOut, kSize, stride=1, groups=1): ''' :...
# -*- coding:utf-8 -*- # Author: hankcs # Date: 2020-06-08 12:10 from elit.common.dataset import TransformableDataset from elit.utils.io_util import get_resource, generate_words_tags_from_tsv _RESUME_NER_HOME = 'https://github.com/jiesutd/LatticeLSTM/archive/master.zip#' RESUME_NER_TRAIN = _RESUME_NER_HOME + 'Resume...
# -*- coding: utf-8 -*- """ Prints out a simple summary of the courses extracted from the school catalogs. Created on Mon Jun 8 11:51:22 2020 @author: Francisco Vazquez """ import os import pandas as pd n_colleges=0 n_courses = 0 for filename in os.listdir('../courses'): # if current file is the one for all s...
def launch(): print('This is the launch method!')
# Copyright (C) 2005-2007 California Institute of Technology, All rights reserved # Author: Andrew D. Straw import math, sys import numpy import scipy import scipy.sparse import scipy.signal as signal import ashelf # NOTE: my coordinate system in phi is flipped from Lindemann's. In my # system, phi increases to the le...
import os import click import scphylo as scp @click.command(short_help="Run PhISCS (CSP version).") @click.argument( "genotype_file", required=True, type=click.Path( exists=True, file_okay=True, dir_okay=False, readable=True, resolve_path=True ), ) @click.argument( "alpha", required=...
# -*- coding: utf-8 -*- """ maya.compat ~~~~~~~~~~~~~~~ This module handles import compatibility issues between Python 2 and Python 3. """ import sys # ------- # Pythons # ------- # Syntax sugar. _ver = sys.version_info # : Python 2.x? is_py2 = _ver[0] == 2 # : Python 3.x? is_py3 = _ver[0] == 3 # --------- # Specific...
# Copyright 2008 by Peter Cock. All rights reserved. # This code is part of the Biopython distribution and governed by its # license. Please see the LICENSE file that should have been included # as part of this package. """Tests for AlignIO module.""" import unittest import warnings from io import StringIO from ...
# Generated by Django 2.0.1 on 2018-11-01 11:49 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('classroom', '0007_auto_20181101_1145'), ] operations = [ migrations.AlterField( model_name='quiz', name='report', ...
"""MinimumSpanningTree.py Kruskal's algorithm for minimum spanning trees. D. Eppstein, April 2006. """ from UnionFind import UnionFind def MinimumSpanningTree(G): """ Return the minimum spanning tree of an undirected graph G. G should be represented in such a way that G[u][v] gives the length of edge...
import logging from abc import ABC, abstractmethod from importlib import import_module from django.apps import AppConfig logger = logging.getLogger(__name__) class AiravataAppConfig(AppConfig, ABC): """Custom AppConfig for Django Airavata apps.""" @property def url_app_name(self): """Return the...
# -*- coding: utf-8 -*- # Copyright 2018 New Vector Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
import logging import os import jsons from flask import Flask from flask_cors import CORS from flask_restful import Api from flask_socketio import SocketIO from flaskr import db from flaskr.api.vasps import Vasps from flaskr.models.user_wallet import UserWallet from flaskr.models.vasp_details import VaspDetails from ...
import numpy as np import pickle def ps_suppression_8param(theta, emul, return_std=False): log10Mc, mu, thej, gamma, delta, eta, deta, fb = theta # fb = 0.1612 mins = [11, 0.0, 2, 1, 3, 0.2, 0.2, 0.10] maxs = [15, 2.0, 8, 4, 11, 0.4, 0.4, 0.25] assert mins[0]<=log10Mc<=maxs[0] assert mins[1]<...
import re import click import logging from pathlib import Path from dotenv import find_dotenv, load_dotenv import importlib import torch import torch.autograd from torch.utils.data import dataset import torch.utils.data.dataloader import ignite.utils import ignite.handlers.early_stopping import ignite.engine import ...
# 10. Programe un método recursivo que invierta los números de un arreglo de enteros. def invertir(numArray): if (len(numArray) == 0): return [] else: return ([numArray[-1]] + invertir(numArray[:-1])) numeros = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] print(invertir(numeros))
from urllib.parse import urlparse import classyjson as cj import asyncio import discord import math import time from util.code import format_exception from util.ipc import PacketType def strip_command(ctx): # returns message.clean_content excluding the command used length = len(ctx.prefix) + len(ctx.invoked_wit...
from recipe_scrapers.epicurious import Epicurious from tests import ScraperTest class TestEpicurious(ScraperTest): scraper_class = Epicurious def test_host(self): self.assertEqual("epicurious.com", self.harvester_class.host()) def test_canonical_url(self): self.assertEqual( ...
from collections import defaultdict, namedtuple AclPermission = namedtuple('AclPermission', 'app, action') # Null rule. Only useful in tests really as no access group should have this. NONE = AclPermission('None', 'None') # A special wildcard permission to use when checking if someone has access to # any admin, or...
import sys test_cases = open(sys.argv[1], 'r') # open file and read test file for test in test_cases: # read one line at a time test = test.split( ) # split the string into a list (space as the default delimiter and removing /n newlines) test.reverse() # reverse the order of the list items tes...
# -*- coding: utf-8 -*- ''' Module for handling OpenStack Heat calls .. versionadded:: 2017.7.0 :depends: - heatclient Python module :configuration: This module is not usable until the user, password, tenant, and auth URL are specified either in a pillar or in the minion's config file. For example:: ...
def logger_util(t_sol, x_sol, u_sol, tinit, xinit, uinit): x_labels = ["r: ", "alpha: ", "beta: ", "Vx: ", "Vy: ", "Vz: ", "m: ", "phi: ", "psi: "] u_labels = ["T: ", "w_phi: ", "w_psi: "] with open("save_solution_variables.txt", mode='w') as F: F.write("LOGGING S...
# -*- coding: utf-8 -*- from __future__ import division from __future__ import print_function import os import sys import unittest from sklearn.utils.testing import assert_equal # noinspection PyProtectedMember from sklearn.utils.testing import assert_allclose from sklearn.utils.testing import assert_raises from skl...
from __future__ import absolute_import, print_function, division from pony.py23compat import PY2, izip, imap, itervalues, basestring, unicode, buffer, int_types from operator import attrgetter from decimal import Decimal from datetime import date, datetime, timedelta from binascii import hexlify from pony import opti...
import os import sys from time import time sys.path.insert(0, os.getcwd()) import tensorflow as tf os.environ["CUDA_VISIBLE_DEVICES"] = "1" config = tf.ConfigProto() config.gpu_options.allow_growth = True session = tf.Session(config=config) from configs.vip import ParsingRCNNModelConfig from configs.vip import VIPDa...