text
stringlengths
28
881k
'''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...
"""NEWLINESelenium maintains a library of wait conditions under the support module.NEWLINEHowever, custom wait conditions can be created when none of the convenience methodsNEWLINEfit. A custom wait condition can be created using a class with a __call__ method which reutrns FalseNEWLINEwhen the condition does not match...
#NEWLINE# Licensed to the Apache Software Foundation (ASF) under one or moreNEWLINE# contributor license agreements. See the NOTICE file distributed withNEWLINE# this work for additional information regarding copyright ownership.NEWLINE# The ASF licenses this file to You under the Apache License, Version 2.0NEWLINE# (...
class Position:NEWLINE def topLeft(self):NEWLINE """NEWLINE :rtype: (int, int)NEWLINE """NEWLINE raise NotImplementedError()NEWLINENEWLINE def width(self):NEWLINE """NEWLINE :rtype: int | NoneNEWLINE """NEWLINE raise NotImplementedError()NEWLINENEWLINE de...
import datetimeNEWLINEimport jsonNEWLINEimport loggingNEWLINEimport osNEWLINEfrom dataclasses import dataclassNEWLINEfrom json import JSONDecodeErrorNEWLINEfrom typing import Iterator, OptionalNEWLINENEWLINEimport requestsNEWLINENEWLINENEWLINE@dataclassNEWLINEclass se_object:NEWLINE """Class to deal with StackExchag...
from django.contrib import adminNEWLINENEWLINEfrom guardian.admin import GuardedModelAdminNEWLINEfrom userena.utils import get_profile_modelNEWLINENEWLINEtry:NEWLINE admin.site.unregister(get_profile_model())NEWLINEexcept admin.sites.NotRegistered:NEWLINE passNEWLINENEWLINEadmin.site.register(get_profile_model(),...
import pytestNEWLINENEWLINEimport stkNEWLINENEWLINEfrom ....case_data import CaseDataNEWLINEfrom .utilities import get_centroid, get_closest_point, get_edgesNEWLINENEWLINENEWLINE@pytest.fixtureNEWLINEdef tail_1(position, flip, building_block_1):NEWLINE point1, point2 = points = (NEWLINE position + [-10, 0, 0]...
"""NEWLINESimple recurrent model - either with LSTM or GRU cells.NEWLINE"""NEWLINEfrom copy import copyNEWLINEfrom typing import Dict, List, Tuple, UnionNEWLINENEWLINEimport numpy as npNEWLINEimport torchNEWLINEimport torch.nn as nnNEWLINENEWLINEfrom pytorch_forecasting.data.encoders import MultiNormalizer, NaNLabelEnc...
# -*- coding: utf-8 -*-NEWLINE"""NEWLINE.. _ex-read-neo:NEWLINENEWLINE===============================================NEWLINEHow to use data in neural ensemble (NEO) formatNEWLINE===============================================NEWLINENEWLINEThis example shows how to create an MNE-Python `~mne.io.Raw` object from dataNEWL...
import botometer, constantsNEWLINEfrom botometer import NoTimelineErrorNEWLINEfrom requests import ConnectionError, HTTPError, TimeoutNEWLINEfrom urllib3.exceptions import ReadTimeoutError, ProtocolError, SSLErrorNEWLINEimport tweepyNEWLINEimport sysNEWLINEimport osNEWLINEimport globNEWLINEimport csvNEWLINEimport panda...
"""NEWLINE==============================NEWLINEWFIRST Instruments (pre-alpha)NEWLINE==============================NEWLINENEWLINEWARNING: This model has not yet been validated against other PSFNEWLINE simulations, and uses several approximations (e.g. forNEWLINE mirror polishing errors, which are taken f...
'''NEWLINENotice:NEWLINE ConstantOP only supports CPU.NEWLINE For supporting cross-device, please use ConstantOP2NEWLINE'''NEWLINEimport sysNEWLINEsys.path.append('../') # Add MobulaOP pathNEWLINEimport mobulaNEWLINEimport numpy as npNEWLINENEWLINE# ConstantOP only supports CPU.NEWLINENEWLINENEWLINE@mobula.op.re...
from mogua.protocols import full_node_protocol, introducer_protocol, wallet_protocolNEWLINEfrom mogua.server.outbound_message import NodeTypeNEWLINEfrom mogua.server.ws_connection import WSMoGuaConnectionNEWLINEfrom mogua.types.mempool_inclusion_status import MempoolInclusionStatusNEWLINEfrom mogua.util.api_decorators ...
import osNEWLINEimport sysNEWLINEimport pytestNEWLINEfrom fastapi.testclient import TestClientNEWLINEfrom typer.testing import CliRunnerNEWLINEfrom sqlalchemy.exc import IntegrityErrorNEWLINENEWLINE# This next line ensures tests uses its own database and settings environmentNEWLINEos.environ["FORCE_ENV_FOR_DYNACONF"] =...
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...
from app import socketioNEWLINEfrom config import *NEWLINEfrom .spi import *NEWLINEfrom ..socketio_queue import EmitQueueNEWLINENEWLINEfrom flask_socketio import NamespaceNEWLINENEWLINEimport loggingNEWLINENEWLINElogger = logging.getLogger("SIO_Server")NEWLINENEWLINENEWLINEclass XApiNamespace(Namespace):NEWLINE md =...
from __future__ import absolute_import, division #makes KratosMultiphysics backward compatible with python 2.6 and 2.7NEWLINENEWLINE# Importing the Kratos LibraryNEWLINEimport KratosMultiphysicsNEWLINENEWLINE# Import applicationsNEWLINEimport KratosMultiphysics.ConvectionDiffusionApplication as KratosConvDiffNEWLINEimp...
"""NEWLINECreate SQL statements for QuerySets.NEWLINENEWLINEThe code in here encapsulates all of the SQL construction so that QuerySetsNEWLINEthemselves do not have to (and could be backed by things other than SQLNEWLINEdatabases). The abstraction barrier only works one way: this module has to knowNEWLINEall about the ...
from django import formsNEWLINEfrom django.conf import settingsNEWLINEfrom django.contrib.auth.hashers import check_passwordNEWLINEfrom django.core.exceptions import ValidationErrorNEWLINEfrom django.core.validators import RegexValidatorNEWLINEfrom django.db.models import QNEWLINEfrom django.forms import formset_factor...
#!/usr/bin/env python3NEWLINENEWLINEimport argparseNEWLINENEWLINEfrom utils import (NEWLINE load_yaml, load_wordset, sorted_items, get_morphgnt, parse_verse_ranges)NEWLINENEWLINEargparser = argparse.ArgumentParser()NEWLINEargparser.add_argument("verses", help="verses to cover (e.g. 'John 18:1-11')")NEWLINEargparser....
from business_register.models import (NEWLINE company_models,NEWLINE fop_models,NEWLINE kved_models,NEWLINE pep_models,NEWLINE sanction_models,NEWLINE declaration_models,NEWLINE)NEWLINE
# -------------------------------------------------------------------------NEWLINE# Copyright (c) Microsoft Corporation. All rights reserved.NEWLINE# Licensed under the MIT License. See License.txt in the project root forNEWLINE# license information.NEWLINE# -------------------------------------------------------------...
from .test_auth import enable_ad, load_setup_data, enable_openldap, \NEWLINE OPENLDAP_AUTH_USER_PASSWORD, enable_freeipa, FREEIPA_AUTH_USER_PASSWORDNEWLINEfrom .common import * # NOQANEWLINEimport astNEWLINENEWLINEAGENT_REG_CMD = os.environ.get('RANCHER_AGENT_REG_CMD', "")NEWLINEHOST_COUNT = int(os.environ.get('RAN...
###############################################################################NEWLINE# Copyright Kitware Inc. and ContributorsNEWLINE# Distributed under the Apache License, 2.0 (apache.org/licenses/LICENSE-2.0)NEWLINE# See accompanying Copyright.txt and LICENSE files for detailsNEWLINE#################################...
import cursesNEWLINEimport collectionsNEWLINEimport sysNEWLINEimport osNEWLINEfrom time import sleepNEWLINENEWLINE# File syntaxNEWLINE#NEWLINE# When there's not enough space for all elements UI will go into scroll modeNEWLINE#NEWLINE# Syntax:NEWLINE# script.py ui_example.txtNEWLINE#NEWLINE# an object is one line, split...
#!/usr/bin/env python3NEWLINENEWLINE"""NEWLINEusage: steps.py [-h] [--after AFTER] [--before BEFORE] [--tz TZ]NEWLINE [--output OUTPUT] [--account ACCOUNT] [--password PASSWORD]NEWLINE [--subaccount SUBACCOUNT]NEWLINE FLOWNEWLINENEWLINECreates a CSV file of steps within enga...
# Copyright 2021 UW-IT, University of WashingtonNEWLINE# SPDX-License-Identifier: Apache-2.0NEWLINENEWLINEfrom .utils import MOCK_SETTINGS, get_mock_manifest, generate_mocksNEWLINEfrom webpack_bridge.templatetags.webpack_bridge import render_webpack_entryNEWLINENEWLINEfrom django.test import TestCaseNEWLINEfrom django....
#!/usr/bin/env pythonNEWLINENEWLINE# for non-list/dict, CHANGE_TO -> variables replace previous valuesNEWLINE# for 'list' , ADD_TO -> append to listNEWLINE# EXCLUDE_FROM -> remove element from listNEWLINE# for 'dict' , REPLACE_WITH -> replace matching keys NEWLINE# ...
"""users tableNEWLINENEWLINERevision ID: bd2fc65f4c5eNEWLINERevises: NEWLINECreate Date: 2020-03-09 14:33:46.107957NEWLINENEWLINE"""NEWLINEfrom alembic import opNEWLINEimport sqlalchemy as saNEWLINENEWLINENEWLINE# revision identifiers, used by Alembic.NEWLINErevision = 'bd2fc65f4c5e'NEWLINEdown_revision = NoneNEWLINEbr...
"""NEWLINEWSGI config for DjangoECom project.NEWLINENEWLINEIt exposes the WSGI callable as a module-level variable named ``application``.NEWLINENEWLINEFor more information on this file, seeNEWLINEhttps://docs.djangoproject.com/en/3.1/howto/deployment/wsgi/NEWLINE"""NEWLINENEWLINEimport osNEWLINENEWLINEfrom django.core....
#ABC089eNEWLINEimport sysNEWLINEinput = sys.stdin.readlineNEWLINEsys.setrecursionlimit(10**6)NEWLINE
#!/usr/bin/env pythonNEWLINE# Licensed under a 3-clause BSD style license - see LICENSE.rstNEWLINENEWLINEimport globNEWLINEimport osNEWLINEimport sysNEWLINENEWLINEimport ah_bootstrapNEWLINEfrom setuptools import setupNEWLINENEWLINE#A dirty hack to get around some early import/configurations ambiguitiesNEWLINEif sys.ver...
"""NEWLINECode to automatically generate inputs for switch.NEWLINENEWLINEDevelopers:NEWLINE Pedro Andres Sanchez PerezNEWLINE Sergio Castellanos RodriguezNEWLINE And other I do not know.NEWLINE"""NEWLINEimport osNEWLINEimport sysNEWLINEimport yamlNEWLINEimport numpy as npNEWLINEimport pandas as pdNEWLINEfrom c...
# -*- coding:utf-8 -*-NEWLINE# @Time: 2021/1/18 8:49NEWLINE# @Author: Zhanyi HouNEWLINE# @Email: 1295752786@qq.comNEWLINE# @File: syntaxana.pyNEWLINE# -*- coding: utf-8 -*-NEWLINE'''NEWLINEpowered by NovalIDENEWLINE来自NovalIDE的词法分析模块NEWLINE作者:侯展意NEWLINE词法分析模块的重要组成单元、NEWLINE依靠各种正则表达式进行特征的提取。NEWLINENEWLINE'''NEWLINEfrom t...
"""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...
#!/usr/bin/env python3NEWLINENEWLINEimport reNEWLINENEWLINENEWLINEdef parse(line):NEWLINE m = re.match(r'(.*) (\d+),(\d+) through (\d+),(\d+)', line)NEWLINE if m:NEWLINE op = m.group(1)NEWLINE p0 = [int(m.group(2)), int(m.group(3))]NEWLINE p1 = [int(m.group(4)), int(m.group(5))]NEWLINENEWLINE...
# -*- coding: utf-8 -*-NEWLINE# Copyright (c) 2012-2015, Philip Xu <pyx@xrefactor.com>NEWLINE# License: BSD New, see LICENSE for details.NEWLINEimport pytestNEWLINENEWLINEfrom monad.actions import firstNEWLINEfrom monad.decorators import maybeNEWLINEfrom monad.exceptions import ExtractErrorNEWLINEfrom monad.types impor...
#!/usr/bin/python3NEWLINE# -*- coding: utf-8 -*-NEWLINENEWLINE#NEWLINE# Copyright (C) 2017 Kévin MathieuNEWLINE#NEWLINE# This software may be modified and distributed under the termsNEWLINE# of the MIT license. See the LICENSE file for details.NEWLINE#NEWLINENEWLINEimport requestsNEWLINENEWLINENEWLINEclass URL:NEWLINE...
""""NEWLINEОсновной файл ботаNEWLINE"""NEWLINENEWLINEimport osNEWLINEimport platformNEWLINEimport randomNEWLINENEWLINEimport discordNEWLINEfrom discord.ext import commands, tasksNEWLINEfrom discord.ext.commands import BotNEWLINEfrom discord_slash import SlashCommand, SlashContext # Importing the newly installed librar...
#!/usr/bin/env python3NEWLINE# Copyright (c) 2020 Bitcoin AssociationNEWLINE# Distributed under the Open BSV software license, see the accompanying file LICENSE.NEWLINENEWLINE# Test mempool eviction based on transaction feeNEWLINENEWLINE# 1. Fill 90% of the mempool with transactions with a high feeNEWLINE# 2. Fill 10% ...
# Copyright 2017 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 pythonNEWLINE# Licensed under a 3-clause BSD style license - see LICENSE.rstNEWLINENEWLINEimport globNEWLINEimport osNEWLINEimport sysNEWLINENEWLINEimport ah_bootstrapNEWLINEfrom setuptools import setupNEWLINENEWLINE#A dirty hack to get around some early import/configurations ambiguitiesNEWLINEif sys.ver...
_base_ = [NEWLINE '../_base_/models/cascade_mask_rcnn_swin_fpn.py',NEWLINE '../_base_/datasets/coco_instance.py',NEWLINE '../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py'NEWLINE]NEWLINENEWLINEmodel = dict(NEWLINE backbone=dict(NEWLINE embed_dim=96,NEWLINE depths=[2, 2, 18, 2...
# ------------------------------------------------------------NEWLINE# Copyright (c) All rights reservedNEWLINE# SiLab, Institute of Physics, University of BonnNEWLINE# ------------------------------------------------------------NEWLINE#NEWLINENEWLINEimport unittestNEWLINEimport osNEWLINEimport yamlNEWLINENEWLINEimport...
def read():NEWLINE numbers = []NEWLINE with open('./docs/numbers.txt', 'r', encoding='utf-8') as f:NEWLINE for line in f:NEWLINE numbers.append(int(line))NEWLINE print(numbers)NEWLINENEWLINEdef write():NEWLINE names = ['Jesús', 'Facundo', 'Miguel', 'Christian', 'Adal', 'Karol', 'Nicolás']NEWLINE with open(...
"""NEWLINEThe 'daal4py.sklearn.ensemble' module implements daal4py-based NEWLINERandomForestClassifier and RandomForestRegressor classes.NEWLINE"""NEWLINEfrom daal4py.sklearn._utils import daal_check_versionNEWLINEif daal_check_version((2020,'P', 3)):NEWLINE from .forest import (RandomForestClassifier, RandomForestR...
NEWLINEimport numpy as npNEWLINEfrom numpy import linalg as laNEWLINEimport pdbNEWLINEimport copyNEWLINEimport itertoolsNEWLINENEWLINENEWLINEclass LMPC(object):NEWLINE """Learning Model Predictive Controller (LMPC)NEWLINE Inputs:NEWLINE - ftocp: Finite Time Optimal Control Prolem object used to compute the predicted...
#!/usr/bin/env pythonNEWLINEfrom setuptools import setupNEWLINENEWLINENEWLINEwith open('README.rst', 'r') as f:NEWLINE long_description = f.read()NEWLINENEWLINEsetup(NEWLINE name='githubstars',NEWLINE version='0.0.6',NEWLINE description='List repository stars and info through Gituhb v4 GraphQL API',NEWLINE ...
import unittestNEWLINENEWLINEfrom cubes.sql.mapper import StarSchemaMapper, distill_namingNEWLINEfrom cubes.model import AttributeNEWLINENEWLINEfrom ..common import CubesTestCaseBase, create_providerNEWLINENEWLINEclass MapperTestCase(CubesTestCaseBase):NEWLINE def setUp(self):NEWLINE super(MapperTestCase, sel...
"""NEWLINEProblem StatementNEWLINENEWLINEAborigines of a mysterious island love to play the Boomerang Game.NEWLINENEWLINEThe game involves n aborigines (n>=2) numbered with consecutive integers fromNEWLINE1 to n. Before the game starts, all participants form a ring so their numbersNEWLINEin a clockwise order match cons...
"""NEWLINEFunctions for generating vectorized spark UDFsNEWLINEto distribute the prediction of sklearn model predictionsNEWLINEwith PySpark DataFramesNEWLINE"""NEWLINENEWLINEimport pandas as pdNEWLINEimport numpy as npNEWLINENEWLINENEWLINEclass PysparkRequired(ImportError):NEWLINE passNEWLINENEWLINENEWLINEclass Pyar...
from __future__ import divisionNEWLINEfrom __future__ import print_functionNEWLINENEWLINE__author__ = "Michael T. Lash, PhD"NEWLINE__copyright__ = "Copyright 2019, Michael T. Lash"NEWLINE__credits__ = [None]NEWLINE__license__ = "MIT"NEWLINE__version__ = "1.0.1"NEWLINE__maintainer__ = "Michael T. Lash"NEWLINE__email__ =...
#!/usr/bin/env pythonNEWLINE# -*- coding: utf-8 -*-NEWLINENEWLINE#The MIT License (MIT)NEWLINENEWLINE#Copyright (c) 2015 Sondre EngebraatenNEWLINENEWLINE#Permission is hereby granted, free of charge, to any person obtaining a copyNEWLINE#of this software and associated documentation files (the "Software"), to dealNEWLI...
from __future__ import absolute_import, division, print_functionNEWLINENEWLINEimport base64NEWLINEfrom collections import defaultdictNEWLINEimport contextlibNEWLINEimport fnmatchNEWLINEfrom glob2 import globNEWLINEimport jsonNEWLINEfrom locale import getpreferredencodingNEWLINEimport loggingNEWLINEimport logging.config...
import itertools as itNEWLINEimport osNEWLINEfrom typing import UnionNEWLINENEWLINEimport pandas as pdNEWLINEfrom memory_profiler import profileNEWLINEfrom opyenxes.data_out.XesXmlSerializer import XesXmlSerializerNEWLINEfrom opyenxes.extension.std.XLifecycleExtension import XLifecycleExtension as xlcNEWLINEfrom opyenx...
import wxNEWLINENEWLINEfrom meerk40t.gui.scene.sceneconst import (NEWLINE RESPONSE_ABORT,NEWLINE RESPONSE_CHAIN,NEWLINE RESPONSE_CONSUME,NEWLINE)NEWLINEfrom meerk40t.gui.toolwidgets.toolwidget import ToolWidgetNEWLINEfrom meerk40t.svgelements import Ellipse, PathNEWLINENEWLINENEWLINEclass EllipseTool(ToolWidge...
#!/usr/bin/env python3NEWLINENEWLINEfrom setuptools import setupNEWLINENEWLINEimport sysNEWLINEimport osNEWLINENEWLINEif not sys.version[0] == "3":NEWLINE raise Exception("This Program is for Python **VERSION 3** only!")NEWLINENEWLINE__version__ = '0.1.4'NEWLINEhere = os.path.abspath(os.path.dirname(__file__))NEWLI...
# Copyright (C) 2018-2021 Intel CorporationNEWLINE# SPDX-License-Identifier: Apache-2.0NEWLINENEWLINEimport numpy as npNEWLINENEWLINEfrom openvino.tools.mo.ops.splice import SpliceNEWLINEfrom openvino.tools.mo.front.common.partial_infer.utils import int64_arrayNEWLINEfrom openvino.tools.mo.graph.graph import Graph, Nod...
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...
"""numpy.distutils.fcompilerNEWLINENEWLINEContains FCompiler, an abstract base class that defines the interfaceNEWLINEfor the numpy.distutils Fortran compiler abstraction model.NEWLINENEWLINETerminology:NEWLINENEWLINETo be consistent, where the term 'executable' is used, it means the singleNEWLINEfile, like 'gcc', that...
#!/usr/bin/python3NEWLINE# -*- coding: utf-8 -*-NEWLINE# #%LNEWLINE# %%NEWLINE# Copyright (C) 2021 BMW Car IT GmbHNEWLINE# %%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 atNE...
"""NEWLINEtorch.multiprocessing is a wrapper around the native :mod:`multiprocessing`NEWLINEmodule. It registers custom reducers, that use shared memory to provide sharedNEWLINEviews on the same data in different processes. Once the tensor/storage is movedNEWLINEto shared_memory (see :func:`~torch.Tensor.share_memory_`...
print("Hello world")NEWLINENEWLINENEWLINE# ### IntegerNEWLINEinteger_variable = 1NEWLINEprint(integer_variable)NEWLINE# print('Integer')NEWLINE# print(integer_variable, type(integer_variable), id(integer_variable))NEWLINEfloat_variable = 3.4NEWLINEprint(float_variable)NEWLINE# ### StringNEWLINEstring_variable_5 = """NE...
from blocktopus.blocks.declarations import machine_declarationNEWLINENEWLINEclass machine_startech_powerremotecontrol (machine_declaration):NEWLINE def getMachineClass (self):NEWLINE from octopus.manufacturer import startechNEWLINE return startech.PowerRemoteControl
import os.pathNEWLINENEWLINEimport torchNEWLINEimport seaborn as snsNEWLINEfrom pandas import DataFrameNEWLINEfrom torch.utils.data import DataLoaderNEWLINEfrom transformers import RobertaTokenizerNEWLINENEWLINEfrom bond.data import DatasetName, DatasetType, SubTokenDataset, load_dataset, load_tags_dictNEWLINEfrom bond...
# Copyright (C) 2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved.NEWLINE#NEWLINE# This work is made available under the Nvidia Source Code License-NC.NEWLINE# To view a copy of this license, check out LICENSE.mdNEWLINE# import torchNEWLINEimport mathNEWLINENEWLINEfrom torch.optim.optimizer import Optimizer, r...
"""NEWLINE OpenVINO DL WorkbenchNEWLINE Script to check internet connectionNEWLINENEWLINE Copyright (c) 2020 Intel CorporationNEWLINENEWLINE 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...
from fastapi import FastAPINEWLINEfrom fastapi.middleware.cors import CORSMiddlewareNEWLINEimport uvicornNEWLINENEWLINEfrom app.api import predict, viz, us_map, us_bar, us_demo_pie, us_pie_vic, us_non_lethal, us_non_lethat_line, top_x_listNEWLINENEWLINEapp = FastAPI(NEWLINE title='HRF-TEAM-D-Lab28 DS API',NEWLINE ...
"""netflixclone URL ConfigurationNEWLINENEWLINEThe `urlpatterns` list routes URLs to views. For more information please see:NEWLINE https://docs.djangoproject.com/en/1.11/topics/http/urls/NEWLINEExamples:NEWLINEFunction viewsNEWLINE 1. Add an import: from my_app import viewsNEWLINE 2. Add a URL to urlpatterns...
from py_asciimath import PROJECT_ROOTNEWLINEfrom py_asciimath.translator.translator import (NEWLINE ASCIIMath2MathML,NEWLINE ASCIIMath2Tex,NEWLINE MathML2Tex,NEWLINE)NEWLINENEWLINENEWLINEif __name__ == "__main__":NEWLINE print("ASCIIMath to MathML")NEWLINE asciimath2mathml = ASCIIMath2MathML(log=False, i...
# TestSwiftUnknownReference.pyNEWLINE#NEWLINE# This source file is part of the Swift.org open source projectNEWLINE#NEWLINE# Copyright (c) 2014 - 2018 Apple Inc. and the Swift project authorsNEWLINE# Licensed under Apache License v2.0 with Runtime Library ExceptionNEWLINE#NEWLINE# See https://swift.org/LICENSE.txt for ...
import pytestNEWLINEimport uqbar.stringsNEWLINENEWLINEimport supriyaNEWLINENEWLINENEWLINEdef test_1():NEWLINE group_a = supriya.realtime.Group()NEWLINE group_b = supriya.realtime.Group()NEWLINE group_c = supriya.realtime.Group()NEWLINE assert group_a.node_id is NoneNEWLINE assert group_b.node_id is NoneN...
import rlkit.misc.hyperparameter as hypNEWLINEfrom rlkit.demos.source.dict_to_mdp_path_loader import EncoderDictToMDPPathLoaderNEWLINEfrom rlkit.launchers.experiments.ashvin.awac_rig import awac_rig_experimentNEWLINEfrom rlkit.launchers.launcher_util import run_experimentNEWLINEfrom rlkit.launchers.arglauncher import r...
from typing import Any, DictNEWLINENEWLINEfrom flask import FlaskNEWLINEfrom flask_marshmallow import MarshmallowNEWLINEfrom marshmallow import fields, post_loadNEWLINENEWLINEfrom .model import UserNEWLINENEWLINE__all__ = ["org_schema", "user_schema", "workspace_schema", "new_user_schema",NEWLINE "orgs_schema...
from typing import Any, Iterable, Mapping, MutableMappingNEWLINENEWLINEfrom ghaudit.query.sub_query import SubQuery, ValidValueTypeNEWLINEfrom ghaudit.query.utils import PageInfo, jinja_envNEWLINENEWLINENEWLINEclass SubQueryCommon(SubQuery):NEWLINE def __init__(NEWLINE self,NEWLINE fragments: Iterable[...
import numpy as npNEWLINENEWLINEfrom collections import deque, IterableNEWLINEimport sigvisa.infer.optimize.optim_utils as optim_utilsNEWLINENEWLINEclass CyclicGraphError(Exception):NEWLINE passNEWLINENEWLINENEWLINEclass DAG(object):NEWLINENEWLINE """NEWLINE Represents a directed acyclic graph.NEWLINENEWLINE ...
__author__ = 'Steven Summers'NEWLINE__version__ = ''NEWLINENEWLINEimport argparseNEWLINE# import builtinsNEWLINEimport difflibNEWLINEimport importlib.utilNEWLINEimport inspectNEWLINEimport ioNEWLINEimport jsonNEWLINEimport reNEWLINEimport sysNEWLINEimport textwrapNEWLINEimport threadingNEWLINEimport timeNEWLINEimport t...
n = int(input())NEWLINEfor j in range(n):NEWLINE word = input()NEWLINE if len(word) <= 10:NEWLINE print(word)NEWLINE else:NEWLINE print(word[0] + str(len(word)-2) + word[-1])NEWLINE
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...
# -*- coding: utf-8 -*-NEWLINE# Author:w kNEWLINENEWLINEimport nonebot as rcnbNEWLINEimport asyncioNEWLINEfrom gadget.untils.aiorequests import Aiorequests as requestsNEWLINENEWLINERCNBOT = rcnb.get_bot()NEWLINENEWLINENEWLINE### 百度NEWLINENEWLINE# 获取百度语音合成的tokenNEWLINE@rcnb.scheduler.scheduled_job('interval', days=10)NE...
import warningsNEWLINEfrom unittest.mock import MagicMockNEWLINENEWLINEfrom joblibspark.backend import SparkDistributedBackendNEWLINENEWLINENEWLINEdef test_effective_n_jobs():NEWLINENEWLINE backend = SparkDistributedBackend()NEWLINE max_num_concurrent_tasks = 8NEWLINE backend._get_max_num_concurrent_tasks = Ma...
'''Remove "地" & "得" from output lable file.NEWLINE'''NEWLINENEWLINEimport argparseNEWLINEfrom os import pardirNEWLINEimport reNEWLINENEWLINENEWLINEdef remove_de(input_path, output_path):NEWLINE with open(input_path) as f:NEWLINE data = f.read()NEWLINENEWLINE data = re.sub(r'\d+, 地(, )?', '', data)NEWLINE ...
class RadixSort:NEWLINE def __init__(self, arr):NEWLINE self.arr = arrNEWLINENEWLINE def _count_sort(self, exp):NEWLINE n = len(self.arr)NEWLINE sorted_arr = [0] * (n)NEWLINE count_arr = [0] * (10)NEWLINE for i in range(n):NEWLINE index = int(self.arr[i]/exp)NEWLINE ...
# -*- coding: utf-8 -*-NEWLINE#NEWLINE# Copyright: (c) 2011 by the Serge S. Koval, see AUTHORS for more details.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...
from django.contrib.sites.models import SiteNEWLINEfrom django.db import modelsNEWLINEfrom django.urls import NoReverseMatch, get_script_prefix, reverseNEWLINEfrom django.utils.encoding import iri_to_uriNEWLINEfrom django.utils.translation import gettext_lazy as _NEWLINENEWLINENEWLINEclass FlatPage(models.Model):NEWLIN...
# -*- 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...
"""remove post authorNEWLINENEWLINERevision ID: ba46e93ec9c9NEWLINERevises: 03414fac27d3NEWLINECreate Date: 2022-03-13 19:57:04.386858NEWLINENEWLINE"""NEWLINEfrom alembic import opNEWLINEimport sqlalchemy as saNEWLINENEWLINENEWLINE# revision identifiers, used by Alembic.NEWLINErevision = 'ba46e93ec9c9'NEWLINEdown_revis...
from nose.tools import raisesNEWLINEfrom mhcnames import normalize_allele_name, AlleleParseErrorNEWLINENEWLINE@raises(AlleleParseError)NEWLINEdef test_extra_text_after_allele():NEWLINE normalize_allele_name("HLA-A*02:01 zipper")
from rest_framework import routersNEWLINENEWLINEfrom api.transaction.viewsets import TransactionViewSetNEWLINENEWLINErouter = routers.SimpleRouter(trailing_slash=False)NEWLINENEWLINErouter.register('', TransactionViewSet, basename='transactions')NEWLINENEWLINEurlpatterns = [NEWLINE *router.urls,NEWLINE]NEWLINE
#!/usr/bin/env pythonNEWLINENEWLINE#github:strike-afkNEWLINE#Youtube:STRİKENEWLINE#Codded by/StrikeNEWLINEimport os NEWLINEimport sysNEWLINEimport timeNEWLINE#STRİKE BURADA ☾★NEWLINENEWLINE#BANNERNEWLINEprint("Yükleniyor..")NEWLINEos.system("sleep 3")NEWLINEprint()NEWLINEprint()NEWLINEprint()NEWLINEprint()NEWLINEprint...
from lxml import etreeNEWLINEimport requestsNEWLINEimport pandas as pdNEWLINEimport timeNEWLINENEWLINE'''NEWLINE获取AAAI近几年主页的所有论文的URLNEWLINE'''NEWLINEurl_home17 = 'https://aaai.org/ocs/index.php/AAAI/AAAI17/schedConf/presentations'NEWLINEurl_home16 = 'https://aaai.org/ocs/index.php/AAAI/AAAI16/schedConf/presentations'NE...
# 실수 1개 입력받아 변환하여 출력하기NEWLINEprint(float(input()))
from xml.dom import minidomNEWLINEimport osNEWLINENEWLINENEWLINEdef parse_voc(xmls_folder):NEWLINE xmls_filename = os.listdir(xmls_folder)NEWLINENEWLINE annos = []NEWLINENEWLINE for xml_filename in xmls_filename:NEWLINENEWLINE anno_dict = {}NEWLINENEWLINE xml_fullpath = os.path.join(xmls_folder, ...
import loggingNEWLINEfrom pathlib import PathNEWLINEfrom typing import DictNEWLINENEWLINEimport colorlogNEWLINEfrom concurrent_log_handler import ConcurrentRotatingFileHandlerNEWLINEfrom logging.handlers import SysLogHandlerNEWLINENEWLINEfrom mogua.util.path import mkdir, path_from_rootNEWLINENEWLINENEWLINEdef initiali...
#!/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)...
N = int(input())NEWLINEp = [int(input()) for i in range(N)]NEWLINEprint(sum(p)-max(p)//2)NEWLINE
# Twitter AUTH:NEWLINEAPP_KEY = 'APP_KEY_HERE' NEWLINEAPP_SECRET = 'APP_SECRET_HERE' NEWLINEOAUTH_TOKEN = 'TOKEN_HERE'NEWLINEOAUTH_TOKEN_SECRET = 'TOKEN_SECRET_HERE'NEWLINENEWLINE# Telegram options:NEWLINETELEGRAM_CHANNEL = 'CHANNEL_NAME_HERE'NEWLINETELEGRAM_TOKEN = 'TOKEN_HERE'NEWLINENEWLINE# Misc:NEWLINETWITTER_USER_...
NEWLINEfrom .client import NetworkTableClientNEWLINEfrom .server import NetworkTableServerNEWLINEfrom .socketstream import SocketStreamFactory, SocketServerStreamProviderNEWLINEfrom .type import BooleanArray, NumberArray, StringArray, DefaultEntryTypesNEWLINE
from django.conf.urls import patterns, urlNEWLINEfrom . import viewsNEWLINENEWLINEurlpatterns = patterns('',NEWLINE url(r'^$', views.newsletter),NEWLINE url(r'^subscribe_default/$', views.subscribe_default),NEWLINE url(r'^subscribe_specific/$', views.subscribe_specific),NEWLINE)NEWLINE
# MIT LicenseNEWLINE#NEWLINE# Copyright (C) IBM Corporation 2018NEWLINE#NEWLINE# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associatedNEWLINE# documentation files (the "Software"), to deal in the Software without restriction, including without limitation theNEWLINE...