text
stringlengths
28
881k
from app.business.blog.views import blog # noqaNEWLINE
import sysNEWLINEimport pytestNEWLINENEWLINENEWLINEfrom cachecontrol import CacheControlNEWLINEfrom cachecontrol.caches.file_cache import FileCacheNEWLINEfrom cachecontrol.filewrapper import CallbackFileWrapperNEWLINEfrom requests import SessionNEWLINENEWLINENEWLINEclass Test39(object):NEWLINENEWLINE @pytest.mark.sk...
"""NEWLINEPRACTICE Exam 3.NEWLINENEWLINEThis problem provides practice at:NEWLINE *** FOR and WHILE loops. ***NEWLINENEWLINEAuthors: David Mutchler, Vibha Alangar, Matt Boutell, Dave Fisher,NEWLINE Mark Hays, Amanda Stouder, Aaron Wilkin, their colleagues,NEWLINE and Marcus Hughes-Oliver.NEWLINE""" ...
from .models import Sentences,WordOptions,WordsinsentenceNEWLINEfrom table import TableNEWLINEfrom table.columns import ColumnNEWLINENEWLINE#this has been defined for the datatables on the siteNEWLINENEWLINE#WordOptionsTable holds required data displayed when clicked on the collapsible in the nav barNEWLINEclass WordOp...
#!/usr/bin/env python3NEWLINE# Copyright 2020-present NAVER Corp. Under BSD 3-clause licenseNEWLINENEWLINEimport argparseNEWLINEimport osNEWLINEimport loggingNEWLINEimport pathlibNEWLINENEWLINEimport path_to_kapture_localization # noqa: F401NEWLINEimport kapture_localization.utils.loggingNEWLINEfrom kapture_localizati...
NEWLINENEWLINE# Set plugin = TrueNEWLINEplugin = TrueNEWLINEplugin_dir = 'plugin/radar/'NEWLINENEWLINENEWLINE#model = dict(NEWLINE# type='UNet',NEWLINE# in_channels=3,NEWLINE# out_channels=1,NEWLINE# base_channels=16,NEWLINE# num_stages=5,NEWLINE# strides=(1, 1, 1, 1, 1),NEWLINE# enc_num_convs=(2, ...
import importlibNEWLINEimport inspectNEWLINEimport osNEWLINEimport pathlibNEWLINENEWLINEimport pkg_resourcesNEWLINEfrom clvm_tools.clvmc import compile_clvm as compile_clvm_pyNEWLINEfrom flax.types.blockchain_format.program import Program, SerializedProgramNEWLINENEWLINEcompile_clvm = compile_clvm_pyNEWLINENEWLINE# Han...
# (C) Datadog, Inc. 2018-presentNEWLINE# All rights reservedNEWLINE# Licensed under Simplified BSD License (see LICENSE)NEWLINENEWLINEimport copyNEWLINEimport loggingNEWLINEimport osNEWLINENEWLINEfrom datadog_checks.base.stubs.aggregator import AggregatorStubNEWLINEfrom datadog_checks.base.utils.common import get_docke...
#!/usr/bin/env python3NEWLINE# Copyright (c) Facebook, Inc. and its affiliates. All Rights ReservedNEWLINENEWLINEimport reNEWLINEimport stringNEWLINEfrom collections import CounterNEWLINEfrom typing import Dict, ListNEWLINENEWLINEfrom pytext.common.constants import RawExampleFieldName, StageNEWLINEfrom pytext.metric_re...
from django.core.management.base import BaseCommand, CommandErrorNEWLINEfrom ._offences import OffenceScraperNEWLINEfrom ....api import modelsNEWLINEimport pprintNEWLINENEWLINEclass Command(BaseCommand):NEWLINE help = 'Scrapes offences'NEWLINENEWLINE def add_arguments(self, parser):NEWLINE passNEWLINENEWLI...
import os, timeNEWLINEimport numpy as npNEWLINEimport pybullet as pNEWLINEimport gymNEWLINEfrom gym import error,spaces,utilsNEWLINEfrom gym.utils import seedingNEWLINENEWLINEfrom .util import UtilNEWLINEimport pybullet_dataNEWLINEimport mathNEWLINENEWLINEimport randomNEWLINENEWLINEclass Demo2Env(gym.Env):NEWLINE de...
"""Gets the next song in the playlistNEWLINENEWLINERun with --help for more info.NEWLINE"""NEWLINENEWLINEfrom nextsong.cli import nextsongNEWLINENEWLINEnextsong()NEWLINE
'''NEWLINECreated on Apr 06, 2012NEWLINENEWLINE@author: Michael Kraus (michael.kraus@ipp.mpg.de)NEWLINE'''NEWLINENEWLINEimport argparseNEWLINEimport matplotlibNEWLINENEWLINEfrom vorticity.diagnostics import DiagnosticsNEWLINENEWLINENEWLINEclass replay(object):NEWLINE '''NEWLINE NEWLINE '''NEWLINENEWLINE...
class NoSuchRequestMethod(Exception):NEWLINE def __init__(self,method_name : str):NEWLINE super().__init__(self)NEWLINE self.method_name = method_nameNEWLINENEWLINE def __str__(self):NEWLINE return '无效请求方法"%s",合理的请求方法为: "get","post","delete","put","options","patch","head".' % self.method_nameNEWLINENEWLINEclass NotA...
MILLION = 1000000.0NEWLINEEXP18 = 10 ** 18NEWLINEEXCHANGE_OSMOSIS = "osmosis_blockchain"NEWLINECUR_OSMO = "OSMO"NEWLINECUR_CRO = "CRO"NEWLINENEWLINEMSG_TYPE_ACKNOWLEDGMENT = "MsgAcknowledgement"NEWLINEMSG_TYPE_BEGIN_UNLOCKING = "MsgBeginUnlocking"NEWLINEMSG_TYPE_DELEGATE = "MsgDelegate"NEWLINEMSG_TYPE_DEPOSIT = "MsgDep...
#!/usr/bin/python3NEWLINENEWLINE"""Project setup file for the f8a jobs."""NEWLINENEWLINEimport osNEWLINEfrom setuptools import setup, find_packagesNEWLINENEWLINENEWLINEdef get_requirements():NEWLINE """Parse all packages mentioned in the 'requirements.txt' file."""NEWLINE requirements_txt = os.path.join(os.path.d...
import unittestNEWLINENEWLINEfrom wpilib_ws import WPILibWsServerNEWLINENEWLINENEWLINEclass TestData(unittest.TestCase):NEWLINE def setUp(self):NEWLINE self.server = WPILibWsServer()NEWLINENEWLINE def test_verify_data(self):NEWLINE """NEWLINE As per the WPILib protocol, the server should igno...
#!/usr/bin/env python2NEWLINE#NEWLINE# Distributed under the MIT/X11 software license, see the accompanyingNEWLINE# file COPYING or http://www.opensource.org/licenses/mit-license.php.NEWLINE#NEWLINENEWLINEfrom test_framework.mininode import *NEWLINEfrom test_framework.test_framework import BitcoinTestFrameworkNEWLINEfr...
from asyncio import FutureNEWLINEfrom math import ceilNEWLINEfrom unittest.mock import MagicMockNEWLINEfrom typing import Sequence, Dict, Optional, TypeNEWLINENEWLINEimport pytestNEWLINEfrom _pytest.monkeypatch import MonkeyPatchNEWLINEfrom marshmallow_jsonapi import fieldsNEWLINEfrom starlette.applications import Star...
# -*- coding: utf-8 -*-NEWLINE"""NEWLINECreated on Sat Jan 16 13:04:06 2016NEWLINENEWLINE@author: lilianNEWLINE"""NEWLINENEWLINE#from onvif import ONVIFCameraNEWLINEfrom cameraUtils import IPCameraNEWLINEimport urllibNEWLINEimport loggingNEWLINEimport timeNEWLINENEWLINEclass PTZCamera(IPCamera):NEWLINENEWLINE def __...
from __future__ import unicode_literalsNEWLINENEWLINEfrom django.conf import settingsNEWLINEfrom django import templateNEWLINEfrom django.contrib.humanize.templatetags.humanize import intcommaNEWLINEfrom django.template.defaultfilters import stringfilterNEWLINENEWLINEfrom wagtail.wagtailcore import hooksNEWLINEfrom wag...
# -*- coding: utf-8 -*-NEWLINE# Copyright 2020 Green Valley Belgium NVNEWLINE#NEWLINE# Licensed under the Apache License, Version 2.0 (the "License");NEWLINE# you may not use this file except in compliance with the License.NEWLINE# You may obtain a copy of the License atNEWLINE#NEWLINE# http://www.apache.org/licens...
NEWLINEfrom e2cnn.kernels import KernelBasis, EmptyBasisExceptionNEWLINEfrom e2cnn.gspaces import *NEWLINEfrom e2cnn.nn import FieldTypeNEWLINEfrom .. import utilsNEWLINENEWLINEfrom .basisexpansion import BasisExpansionNEWLINEfrom .basisexpansion_singleblock import block_basisexpansionNEWLINENEWLINEfrom collections imp...
#!/usr/bin/pythonNEWLINE# -*- coding: utf8 -*-NEWLINENEWLINE# This code is based on: T.Davidson, F.Kloosterman, M.Wilson "Hippocampal replay of extended experience",NEWLINE# in Neuron, vol. 63, pp. 497-507, 2009NEWLINE# difference: \tau_i(x) (rate parameters) are known (from poisson_proc.py and generate_spike_train.py)...
from discord.errors import ForbiddenNEWLINENEWLINENEWLINEclass RequestLocalStartTime:NEWLINE def __init__(NEWLINE self,NEWLINE scoped_session,NEWLINE format_date_time,NEWLINE time_zone_input,NEWLINE time_zone_embed,NEWLINE start_time_embed,NEWLINE ):NEWLINE self.sc...
'''NEWLINECreated on May 1, 2015NEWLINENEWLINE@author: zwickerNEWLINE'''NEWLINENEWLINEfrom __future__ import division, absolute_importNEWLINENEWLINEimport numpy as npNEWLINEfrom six.moves import rangeNEWLINENEWLINEfrom .lib_exp_base import LibraryExponentialBaseNEWLINEfrom ..library_numeric_base import LibraryNumericMi...
#crie uma matrix 3x3 inputa numa lista e msotra no final 9 valoresNEWLINElista = list()NEWLINEdado = list()NEWLINEfor m in range(1, 10):NEWLINE dado.append(int(input(f'Digite o {m}o Valor: ')))NEWLINE lista.append(dado[:])NEWLINE dado.clear()NEWLINEprint(f'{lista[0]}{lista[1]}{lista[2]}')NEWLINEprint(f'{lista[...
# pylint: disable=redefined-builtin, wildcard-importNEWLINE"""x86 specific declaration and schedules."""NEWLINEfrom __future__ import absolute_import as _absNEWLINENEWLINEfrom .conv2d import schedule_conv2d, schedule_conv2d_nhwcNEWLINEfrom .binarize_pack import schedule_binarize_packNEWLINEfrom .binary_dense import sch...
"""NEWLINEDjango settings for mysite project.NEWLINENEWLINEGenerated by 'django-admin startproject' using Django 3.2.4.NEWLINENEWLINEFor more information on this file, seeNEWLINEhttps://docs.djangoproject.com/en/3.2/topics/settings/NEWLINENEWLINEFor the full list of settings and their values, seeNEWLINEhttps://docs.dja...
#!/usr/bin/env python3NEWLINENEWLINEfrom auto.build import Builder, BuildOpts, LLVMBuilderNEWLINEfrom auto.config import DIR, RV32_LINUX, SBTNEWLINEfrom auto.utils import cat, chsuf, mkdir_if_needed, path, shellNEWLINENEWLINEimport argparseNEWLINENEWLINEclass Translator:NEWLINE def __init__(self, opts):NEWLINE ...
from unittest import TestCaseNEWLINEimport numpy as npNEWLINEimport osNEWLINEimport pickleNEWLINEimport loggingNEWLINENEWLINEfrom qcodes.data.data_array import DataArrayNEWLINEfrom qcodes.data.io import DiskIONEWLINEfrom qcodes.data.data_set import load_data, new_data, DataSetNEWLINEfrom qcodes.utils.helpers import Log...
"""Tests the plotting function developed as part of 2E"""NEWLINENEWLINE# ImportsNEWLINEfrom floodsystem.plot import plot_water_levelsNEWLINEfrom floodsystem.datafetcher import fetch_measure_levelsNEWLINEimport datetimeNEWLINEfrom floodsystem.station import MonitoringStationNEWLINENEWLINEfictional_station = MonitoringSt...
from decimal import DecimalNEWLINENEWLINEprice = 100 * Decimal(input('Enter a price ($): '))NEWLINEbills = 100 * Decimal(input('Enter amount of money ($): '))NEWLINEchange = bills - priceNEWLINENEWLINENEWLINEquarters = change // 25NEWLINEdimes = (change % 25) // 10NEWLINEpennies = ((change % 25) % 10) // 1NEWLINENEWLIN...
# -*- coding: utf-8 -*-NEWLINE# BioSTEAM: The Biorefinery Simulation and Techno-Economic Analysis ModulesNEWLINE# Copyright (C) 2020, Yoel Cortes-Pena <yoelcortes@gmail.com>NEWLINE# NEWLINE# This module is under the UIUC open-source license. See NEWLINE# github.com/BioSTEAMDevelopmentGroup/biosteam/blob/master/LICENSE....
import operatorNEWLINEimport reNEWLINEfrom functools import reduceNEWLINENEWLINEfrom aocd import get_dataNEWLINENEWLINENEWLINEdef rotate_once(data):NEWLINE return [''.join(r) for r in zip(*data[::-1])]NEWLINENEWLINENEWLINEdef rotate(data, rotation):NEWLINE if rotation >= 4:NEWLINE data = [r[::-1] for r in ...
import loggingNEWLINEimport tempfileNEWLINENEWLINEimport numpy as npNEWLINEimport pytestNEWLINEimport torchNEWLINEfrom torch import nnNEWLINENEWLINEimport pfrlNEWLINEfrom pfrl.envs.abc import ABCNEWLINEfrom pfrl.experiments.evaluator import run_evaluation_episodesNEWLINEfrom pfrl.policies import (NEWLINE GaussianHea...
__all__ = [NEWLINE 'dates',NEWLINE 'dictionary',NEWLINE 'greetings',NEWLINE 'ircbot',NEWLINE 'js',NEWLINE 'listcommands',NEWLINE 'locator',NEWLINE 'pip',NEWLINE 'repeats',NEWLINE 'scheme',NEWLINE 'storedresponses',NEWLINE]NEWLINE
"""NEWLINE Copyright 2016 Andrea McIntoshNEWLINENEWLINE Licensed under the Apache License, Version 2.0 (the "License");NEWLINE you may not use this file except in compliance with the License.NEWLINE You may obtain a copy of the License atNEWLINENEWLINE http://www.apache.org/licenses/LICENSE-2.0NEWLINENEWL...
from __future__ import print_functionNEWLINEfrom __future__ import divisionNEWLINEfrom __future__ import absolute_importNEWLINEfrom __future__ import unicode_literalsNEWLINEfrom django.contrib import adminNEWLINENEWLINEfrom .models import ZipCodeNEWLINENEWLINENEWLINEclass ZipCodeAdmin(admin.ModelAdmin):NEWLINE list_...
# Copyright: 2019, NLnet Labs and the Internet.nl contributorsNEWLINE# SPDX-License-Identifier: Apache-2.0NEWLINEfrom datetime import timedeltaNEWLINEimport randomNEWLINEfrom timeit import default_timer as timerNEWLINENEWLINEfrom internetnl.celery import appNEWLINEfrom celery.utils.log import get_task_loggerNEWLINEfrom...
import torchNEWLINEimport torch.nn as nnNEWLINEfrom torch.distributions import NormalNEWLINENEWLINEfrom examples.nvae.common import DecoderResidualBlockNEWLINEfrom examples.nvae.common import ResidualBlockNEWLINEfrom examples.nvae.common import SwishNEWLINEfrom examples.nvae.losses import kl_2NEWLINEfrom examples impor...
NEWLINE## https://www.hackster.io/ben-eagan/raspberry-pi-automated-plant-watering-with-website-8af2dcNEWLINE## https://gist.github.com/benrules2/6f490f3a0e082ae6592a630bd7abe588NEWLINENEWLINE## https://towardsdatascience.com/python-webserver-with-flask-and-raspberry-pi-398423cc6f5dNEWLINENEWLINE# https://randomnerdtut...
#coding:utf-8NEWLINEfrom django.shortcuts import renderNEWLINEfrom django.http import HttpResponseNEWLINENEWLINEdef home(request):NEWLINE string = u"我在自强学堂学习Django,用它来建网站"NEWLINE TutorialList = ["HTML", "CSS", "jQuery", "Python", "Django"]NEWLINE info_dict = {'site': u'自强学堂', 'content': u'各种IT技术教程'}NEWLINE ...
# model settingsNEWLINEmodel = dict(NEWLINE type="RPN",NEWLINE pretrained="open-mmlab://resnet50_caffe",NEWLINE backbone=dict(NEWLINE type="ResNet",NEWLINE depth=50,NEWLINE num_stages=4,NEWLINE out_indices=(0, 1, 2, 3),NEWLINE frozen_stages=1,NEWLINE norm_cfg=dict(type...
# coding: utf-8NEWLINENEWLINE# Copyright 2018 IBM All Rights Reserved.NEWLINE#NEWLINE# Licensed under the Apache License, Version 2.0 (the "License");NEWLINE# you may not use this file except in compliance with the License.NEWLINE# You may obtain a copy of the License atNEWLINE#NEWLINE# http://www.apache.org/licen...
#!/usr/bin/pythonNEWLINE# -*- coding: utf-8 -*-NEWLINE##############################################################################NEWLINE# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. #NEWLINE# #NEWLINE# Licensed...
# uncompyle6 version 3.3.1NEWLINE# Python bytecode 3.6 (3379)NEWLINE# Decompiled from: Python 3.6.2 (v3.6.2:5fd33b5926, Jul 16 2017, 20:11:06) NEWLINE# [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)]NEWLINE# Embedded file name: ../../shared/problems/CR/problem1050_CR.pyNEWLINE# Compiled at: 2019-03-12 17:52:21NEWLINE# Size...
# -*- coding: utf-8 -*-NEWLINEfrom hashlib import sha256NEWLINENEWLINEfrom .sha1 import SHA1NEWLINENEWLINENEWLINEdef hmac(key, message, hash_class):NEWLINE block_size = hash_class().block_sizeNEWLINENEWLINE if len(key) > block_size:NEWLINE key = hash_class(key).digest()NEWLINE key = key.ljust(block_size...
import sysNEWLINEimport numpy as npNEWLINEfrom acd.util import tiling_2d as tilingNEWLINEfrom acd.scores.cd import cd, cd_textNEWLINEfrom skimage import measure # for connected componentsNEWLINEfrom math import ceilNEWLINEfrom scipy.signal import convolve2dNEWLINEfrom copy import deepcopyNEWLINEfrom acd.scores import ...
"""NEWLINECode from https://github.com/ray-project/ray/blob/ray-0.8.7/rllib/agents/dqn/learner_thread.pyNEWLINEand https://github.com/ray-project/ray/blob/ray-0.8.7/rllib/utils/window_stat.pyNEWLINE"""NEWLINEfrom __future__ import annotationsNEWLINENEWLINEimport queueNEWLINEimport threadingNEWLINENEWLINEfrom ray.util.t...
import osNEWLINEimport ycm_coreNEWLINENEWLINEflags = [NEWLINE'-D__IPHONE_OS_VERSION_MIN_REQUIRED=70000',NEWLINE'-resource-dir',NEWLINE'/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/7.0.0',NEWLINE'-mios-simulator-version-min=7.0',NEWLINE'-arch i386',NEWLINE'-fblocks'...
# -*- coding: utf-8 -*-NEWLINE"""NEWLINEPreprocessors.NEWLINE"""NEWLINEimport reNEWLINENEWLINEimport numpy as npNEWLINEfrom allennlp.modules.elmo import Elmo, batch_to_idsNEWLINEfrom sklearn.base import BaseEstimator, TransformerMixinNEWLINEfrom sklearn.externals import joblibNEWLINEfrom keras.utils.np_utils import to_...
# Copyright 2021 NVIDIA CorporationNEWLINE#NEWLINE# Licensed under the Apache License, Version 2.0 (the "License");NEWLINE# you may not use this file except in compliance with the License.NEWLINE# You may obtain a copy of the License atNEWLINE#NEWLINE# http://www.apache.org/licenses/LICENSE-2.0NEWLINE#NEWLINE# Unle...
import clickNEWLINEfrom collections import CounterNEWLINEfrom typing import List, TupleNEWLINENEWLINEfrom .utils import assertCommitsNEWLINENEWLINENEWLINEclass EmailRedactParamType(click.ParamType):NEWLINE name = 'emailredact'NEWLINENEWLINE def convert(self, value, param, ctx) -> Tuple[str, str, str]:NEWLINE ...
import randomNEWLINEimport streambarNEWLINEimport tempfileNEWLINEimport pandas as pdNEWLINEimport osNEWLINEimport torchNEWLINEimport bar_utils as buNEWLINEfrom torch.utils.data import DatasetNEWLINEimport numpy as npNEWLINEfrom collections import defaultdictNEWLINEfrom statsmodels.tsa.stattools import adfullerNEWLINENE...
"""NEWLINEPRACTICE Exam 3.NEWLINENEWLINEThis problem provides practice at:NEWLINE *** FOR and WHILE loops. ***NEWLINENEWLINEAuthors: David Mutchler, Vibha Alangar, Matt Boutell, Dave Fisher,NEWLINE Mark Hays, Amanda Stouder, Aaron Wilkin, their colleagues,NEWLINE and Marcus Hughes-Oliver.NEWLINE""" ...
#!/usr/bin/env pythonNEWLINENEWLINE"""NEWLINEFill the "Player" table with info from this and past seasonss FPLNEWLINE"""NEWLINEimport osNEWLINENEWLINEimport jsonNEWLINENEWLINEfrom airsenal.framework.mappings import positionsNEWLINEfrom airsenal.framework.schema import PlayerAttributes, session_scope, sessionNEWLINENEWL...
#!/usr/bin/env python3NEWLINENEWLINE# Copyright 2019 Nina Marie Wahl and Charlotte Heggem.NEWLINE# Copyright 2019 Norwegian University of Science and Technology.NEWLINE#NEWLINE# Licensed under the Apache License, Version 2.0 (the "License");NEWLINE# you may not use this file except in compliance with the License.NEWLIN...
from __future__ import absolute_importNEWLINEimport os.path as ospNEWLINEimport torchNEWLINENEWLINEfrom PIL import ImageNEWLINENEWLINENEWLINENEWLINENEWLINENEWLINEclass SeqPreprocessor(object):NEWLINE def __init__(self, seqset, dataset, transform=None):NEWLINE super(SeqPreprocessor, self).__init__()NEWLINE ...
from nose.tools import set_traceNEWLINENEWLINEfrom api.opds import CirculationManagerAnnotatorNEWLINEfrom core.lane import Facets, PaginationNEWLINEfrom core.model import (NEWLINE BaseMaterializedWork,NEWLINE LicensePool,NEWLINE Session,NEWLINE)NEWLINEfrom core.opds import AcquisitionFeedNEWLINENEWLINEclass Ad...
# -*- coding: utf-8 -*-NEWLINE"""NEWLINECreated on Mon Jun 08 10:17:32 2015NEWLINENEWLINE@author: PacoNEWLINE"""NEWLINENEWLINEfrom api import APINEWLINENEWLINEclass Soundcloud(API):NEWLINENEWLINE _class_name = 'Soundcloud'NEWLINE _category = 'Music'NEWLINE _help_url = 'https://developers.soundcloud.com/docs/ap...
"""NEWLINE# https://code.google.com/p/promisedata/source/browse/#svn%2Ftrunk%2Feffort%2FalbrechtNEWLINENEWLINEStandard header:NEWLINENEWLINE"""NEWLINEfrom __future__ import division,print_functionNEWLINEimport sysNEWLINEsys.dont_write_bytecode = TrueNEWLINEfrom lib import *NEWLINENEWLINE"""NEWLINE@attribute Language n...
from pomagma.reducer.syntax import ABS, APP, BOT, IVAR, JOIN, NVAR, TOPNEWLINEfrom pomagma.reducer.systems import (System, try_compute_step,NEWLINE try_decide_equal, unfold)NEWLINEfrom pomagma.util.testing import for_eachNEWLINENEWLINEx = NVAR('x')NEWLINEy = NVAR('y')NEWLINEz = NVAR(...
import loggingNEWLINEimport mathNEWLINEimport osNEWLINEimport pickleNEWLINEimport sysNEWLINEimport timeNEWLINENEWLINEimport psutilNEWLINENEWLINEfrom .catboost_utils import construct_custom_catboost_metricNEWLINEfrom .hyperparameters.parameters import get_param_baselineNEWLINEfrom .hyperparameters.searchspaces import ge...
"""Objects, functions and constants relating to OCP bounds.NEWLINENEWLINEAttributesNEWLINE----------NEWLINEDEFAULT_ASSUME_INF_BOUNDS : boolNEWLINE Default as to whether Pycollo should treat unspecified bounds as beingNEWLINE numerically infinite.NEWLINEDEFAULT_INF_VALUE : floatNEWLINE Default numerical value f...
# Copyright (c) 2015 OpenStack FoundationNEWLINE# All Rights Reserved.NEWLINE#NEWLINE# Licensed under the Apache License, Version 2.0 (the "License"); you mayNEWLINE# not use this file except in compliance with the License. You may obtainNEWLINE# a copy of the License atNEWLINE#NEWLINE# http://www.apac...
from django.core.management.base import BaseCommandNEWLINEfrom mainapp.models import Category, ProductsNEWLINEfrom authapp.models import UserNEWLINENEWLINEimport json, osNEWLINENEWLINEJSON_PATH = 'mainapp/json'NEWLINENEWLINEdef load_from_json(file_name):NEWLINE with open(os.path.join(JSON_PATH, file_name + '.json'),...
"""Logging helper functions."""NEWLINEfrom __future__ import absolute_importNEWLINENEWLINEimport loggingNEWLINENEWLINENEWLINEclass Logger:NEWLINE """Helper class for logging."""NEWLINENEWLINE def __init__(self, level=None):NEWLINE """Set up logging instance and set log level."""NEWLINE self.logger =...
# Copyright 2019 Huawei Technologies Co., LtdNEWLINE#NEWLINE# Licensed under the Apache License, Version 2.0 (the "License");NEWLINE# you may not use this file except in compliance with the License.NEWLINE# You may obtain a copy of the License atNEWLINE#NEWLINE# http://www.apache.org/licenses/LICENSE-2.0NEWLINE#NEWLINE...
#NEWLINE# Copyright 2019 The FATE Authors. All Rights Reserved.NEWLINE#NEWLINE# Licensed under the Apache License, Version 2.0 (the "License");NEWLINE# you may not use this file except in compliance with the License.NEWLINE# You may obtain a copy of the License atNEWLINE#NEWLINE# http://www.apache.org/licenses...
# Copyright 2019 kubeflow.org.NEWLINE#NEWLINE# Licensed under the Apache License, Version 2.0 (the "License");NEWLINE# you may not use this file except in compliance with the License.NEWLINE# You may obtain a copy of the License atNEWLINE#NEWLINE# http://www.apache.org/licenses/LICENSE-2.0NEWLINE#NEWLINE# Unless req...
# -*- coding: utf-8 -*-NEWLINE"""Writer for MacOS script files."""NEWLINENEWLINEfrom __future__ import unicode_literalsNEWLINENEWLINEimport osNEWLINENEWLINEfrom l2tdevtools.dependency_writers import interfaceNEWLINENEWLINENEWLINEclass MacOSInstallScriptWriter(interface.DependencyFileWriter):NEWLINE """MacOS installati...
# This trainer is based on the trainer as forked from version of transformers in hash 935e346959e81aa96a772c11d05734ea652932d1NEWLINE# And changed the training process to include discrete adversarial trainingNEWLINE# TODO - perhaps shoould copy the trainer code here as well?NEWLINENEWLINEimport collectionsNEWLINEfrom d...
# terrascript/errorcheck/r.pyNEWLINE# Automatically generated by tools/makecode.py ()NEWLINENEWLINEimport warningsNEWLINENEWLINEwarnings.warn(NEWLINE "using the 'legacy layout' is deprecated", DeprecationWarning, stacklevel=2NEWLINE)NEWLINEimport terrascriptNEWLINENEWLINENEWLINEclass errorcheck_is_valid(terrascript....
from abc import abstractclassmethod;NEWLINENEWLINEfrom vizier.vapi import *NEWLINENEWLINEclass OptimizerClient:NEWLINE def __init__(self):NEWLINE passNEWLINENEWLINE @abstractclassmethodNEWLINE def create_study(self, study: Study, concurrency: int):NEWLINE passNEWLINE NEWLINE @abstractclassm...
# UniBorg (telegram userbot)NEWLINE# Copyright (C) 2020 The AuthorsNEWLINENEWLINE# This program is free software: you can redistribute it and/or modifyNEWLINE# it under the terms of the GNU Affero General Public License as published byNEWLINE# the Free Software Foundation, either version 3 of the License...
import botometer, constantsNEWLINEfrom botometer import NoTimelineErrorNEWLINEfrom requests import ConnectionError, HTTPError, TimeoutNEWLINEfrom urllib3.exceptions import ReadTimeoutError, ProtocolError, SSLErrorNEWLINEimport tweepyNEWLINEimport sysNEWLINEimport osNEWLINEimport globNEWLINEimport csvNEWLINEimport panda...
QUERY = """NEWLINEquery searchByQuery($query:SearchQueryJson!$testListings:Boolean!$smartHide:Boolean$recentHides:[ListingId!])@debug(testListings:$testListings){rentSearch(query:$query smartHide:$smartHide recentHides:$recentHides){...RentResultsMetaData resolvedQuery{...SearchMetadata ...ResultsHeading ...SeoFooterLi...
from bs4 import BeautifulSoupNEWLINEfrom black_list.items import BlEuconsolidatedlistItemNEWLINEfrom scrapy import SpiderNEWLINEimport osNEWLINENEWLINENEWLINEclass BleuconsolidatedlistSpider(Spider):NEWLINE name = 'BL_EUConsolidatedList'NEWLINE allowed_domains = ['ec.europa.eu']NEWLINE start_urls = ['http://ec...
from flask import *NEWLINEimport hashlibNEWLINEfrom pymongo import *NEWLINEimport stringNEWLINEimport datetimeNEWLINEimport reNEWLINEfrom flask_cors import *NEWLINENEWLINEapp = Flask(__name__)NEWLINEcors = CORS(app)NEWLINENEWLINENEWLINE@app.errorhandler(404)NEWLINEdef page_not_found(e):NEWLINE return "error",404NEWL...
# https://wiki.freecadweb.org/Scripting_examplesNEWLINE# https://wiki.freecadweb.org/Scripted_objects_saving_attributesNEWLINENEWLINE# various_states.pyNEWLINEclass VariousStates:NEWLINE def __init__(self, obj):NEWLINE obj.addProperty("App::PropertyLength", "Length")NEWLINE obj.addProperty("App::Proper...
"""NEWLINEAbstract agent for the gym-idsgame environmentNEWLINE"""NEWLINEfrom abc import ABCNEWLINE#from gym_idsgame.envs.dao.game_config import GameConfigNEWLINENEWLINEclass Agent(ABC):NEWLINE """NEWLINE Abstract class representing an agentNEWLINE """NEWLINENEWLINE def __init__(self, game_config):NEWLINE ...
#!/usr/bin/env pythonNEWLINE# -*- coding: utf8 -*-NEWLINENEWLINE"""Initialize userNEWLINE"""NEWLINENEWLINEimport sysNEWLINEsys.path.insert(0, '../')NEWLINENEWLINEfrom app.models import UserNEWLINEfrom app.models import dbNEWLINENEWLINE_admin0 = {'name': 'uadmin', 'hash': '$6$rounds=656000$BGPNku.GTxUFp5/m$z2VoGUbOzZfjE...
import numpy as npNEWLINENEWLINEfrom yt.funcs import mylogNEWLINEfrom yt.utilities.io_handler import BaseIOHandlerNEWLINENEWLINEfrom .data_structures import chk23NEWLINENEWLINEfloat_size = {"float": np.dtype(">f4").itemsize, "double": np.dtype(">f8").itemsize}NEWLINENEWLINEaxis_list = ["_x", "_y", "_z"]NEWLINENEWLINENE...
'''cron function.NEWLINENEWLINEScans the user table and, for each user, invokes one lambda checker.NEWLINEIf the check generates an alert, invokes mailer lambda to notify the user.'''NEWLINEfrom sslnotifyme import (lambda_db, lambda_checker, lambda_main_wrapper, LOGGER)NEWLINENEWLINENEWLINEclass Cron(object):NEWLINE ...
#Ben KotrcNEWLINE#1/26/2016NEWLINE#https://github.com/kotrc/GTFS-route-shapesNEWLINE#This script takes an expanded GTFS file and generates a new file,NEWLINE#route_shapes.json, that contains one geojson MultiLineString for eachNEWLINE#entry in the GTFS routes.txt table. This represents the map shape forNEWLINE#each rou...
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.NEWLINE#NEWLINE# Licensed under the Apache License, Version 2.0 (the "License");NEWLINE# you may not use this file except in compliance with the License.NEWLINE# You may obtain a copy of the License atNEWLINE#NEWLINE# http://www.apache.org/licenses/LICENS...
#!/usr/bin/env python3NEWLINE# Copyright (c) Meta Platforms, Inc. and affiliates.NEWLINE# All rights reserved.NEWLINE#NEWLINE# This source code is licensed under the BSD-style license found in theNEWLINE# LICENSE file in the root directory of this source tree.NEWLINENEWLINEfrom typing import List, OptionalNEWLINENEWLIN...
from dataclasses import dataclassNEWLINEfrom math import asin, cos, radians, sin, sqrtNEWLINENEWLINENEWLINE@dataclassNEWLINEclass Position:NEWLINE name: strNEWLINE lon: float = 0.0NEWLINE lat: float = 0.0NEWLINENEWLINE def distance_to(self, other):NEWLINE r = 6371 # Earth radius in kilometersNEWLINE ...
from django.contrib.contenttypes.models import ContentTypeNEWLINEfrom django.core.exceptions import (ObjectDoesNotExist, PermissionDenied,NEWLINE ImproperlyConfigured)NEWLINEfrom django.shortcuts import get_object_or_404NEWLINEfrom django.http import Http404NEWLINEfrom django.conf imp...
"""NEWLINE Copyright (c) 2015-2019 Ad Schellevis <ad@opnsense.org>NEWLINE All rights reserved.NEWLINENEWLINE Redistribution and use in source and binary forms, with or withoutNEWLINE modification, are permitted provided that the following conditions are met:NEWLINENEWLINE 1. Redistributions of source cod...
# -*- coding: utf-8 -*-NEWLINE#----------------------------------------------------------------------------NEWLINE# Name: art_msw.pyNEWLINE# Purpose:NEWLINE#NEWLINE# Author: Andrea Gavana <andrea.gavana@gmail.com>NEWLINE#NEWLINE# Created:NEWLINE# Version:NEWLINE# Date:NEWLINE# Licence: wxWindows lice...
# -*- coding:utf-8 -*-NEWLINE"""NEWLINE合肥工业大学教务系统学生端接口以及方便开发者开发围绕学生数据的一些工具.NEWLINE"""NEWLINEfrom __future__ import unicode_literalsNEWLINENEWLINEfrom . import util, parserNEWLINEfrom .exception import *NEWLINEfrom .log import *NEWLINEfrom .shortcut import *NEWLINEfrom .value import *NEWLINENEWLINE__title__ = 'hfut'NEWL...
import reNEWLINEimport unittestNEWLINEimport markdownNEWLINEfrom biovis_media_extension.extension import BioVisPluginExtensionNEWLINENEWLINEclass TestUtils(unittest.TestCase):NEWLINE plugin = BioVisPluginExtension(configs={})NEWLINENEWLINE def test_invalid_plugin(self):NEWLINE text = """NEWLINE @inv...
#!/usr/bin/env pythonNEWLINEfrom __future__ import division, print_function, absolute_importNEWLINENEWLINEimport numpy as npNEWLINEfrom numpy.testing import (run_module_suite, assert_allclose, assert_,NEWLINE assert_raises)NEWLINENEWLINEimport pywtNEWLINENEWLINENEWLINEdef test_dwt_idwt_basic()...
#!/usr/bin/env pythonNEWLINENEWLINE# Copyright (c) 2015 Google Inc. All rights reserved.NEWLINE# Use of this source code is governed by a BSD-style license that can beNEWLINE# found in the LICENSE file.NEWLINENEWLINE"""NEWLINEMake sure that we cause downstream modules to get built when we depend on theNEWLINEparent tar...
genero = ''NEWLINEwhile genero != 'F' and genero != 'M':NEWLINE genero = str(input('Gênero [M/F]: ')).upper()NEWLINE if genero == 'F':NEWLINE print('Seu gênero é FEMININO!')NEWLINE if genero == 'M':NEWLINE print('Seu gênero é MASCULINO!')NEWLINEprint('FIM')
#!/usr/bin/env python2NEWLINEimport numpy as npNEWLINEimport path_parserNEWLINEfrom mpl_toolkits.mplot3d import Axes3DNEWLINEimport matplotlib.pyplot as pltNEWLINEfrom matplotlib import cmNEWLINEfrom matplotlib.ticker import LinearLocator, FormatStrFormatterNEWLINEfrom scipy.spatial import KDTreeNEWLINE#ruta='sample_ma...
#!C:\Users\sara8\PycharmProjects\card_test\venv\Scripts\python.exeNEWLINE# EASY-INSTALL-ENTRY-SCRIPT: 'pip==19.0.3','console_scripts','pip3.7'NEWLINE__requires__ = 'pip==19.0.3'NEWLINEimport reNEWLINEimport sysNEWLINEfrom pkg_resources import load_entry_pointNEWLINENEWLINEif __name__ == '__main__':NEWLINE sys.argv[0...
import jsonNEWLINEfrom controller.client import ClientNEWLINENEWLINENEWLINEdef offerview(user, offer, taking):NEWLINE isvalid = _offer(user, offer, taking)NEWLINE if isvalid:NEWLINE print('A troca foi anunciada')NEWLINE return isvalidNEWLINE else:NEWLINE print('Lamentamos, mas não alguma c...