text
stringlengths
28
881k
from ..base.event import BaseEventNEWLINENEWLINENEWLINEclass ItemPurchase(BaseEvent):NEWLINE amount: floatNEWLINE username: strNEWLINE item_id: strNEWLINE
r"""NEWLINEModule for some integrators.NEWLINENEWLINE - IRK3: Implicit third order Runge-KuttaNEWLINE - RK4: Runge-Kutta fourth orderNEWLINE - ETD: Exponential time differencing Euler methodNEWLINE - ETDRK4: Exponential time differencing Runge-Kutta fourth orderNEWLINENEWLINESee, e.g.,NEWLIN...
import osNEWLINENEWLINEfrom aiogram import Bot, DispatcherNEWLINEfrom aiogram.contrib.fsm_storage.memory import MemoryStorageNEWLINENEWLINEAPI_TOKEN = os.getenv('API_TOKEN')NEWLINETIMEOUT = int(os.getenv('TIMEOUT'))NEWLINEDATABASE_URI = os.getenv('DATABASE_URI')NEWLINENEWLINEbot = Bot(token=API_TOKEN)NEWLINEstorage = M...
#NEWLINE# PySNMP MIB module DES-1210-28MEbx (http://snmplabs.com/pysmi)NEWLINE# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/DES-1210-28MEbxNEWLINE# Produced by pysmi-0.3.4 at Wed May 1 12:38:52 2019NEWLINE# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4NEWLINE# Using Python ...
## This file is part of ScapyNEWLINE## See http://www.secdev.org/projects/scapy for more informationsNEWLINE## Copyright (C) Philippe Biondi <phil@secdev.org>NEWLINE## Copyright (C) Gabriel Potter <gabriel@potter.fr>NEWLINE## This program is published under a GPLv2 licenseNEWLINENEWLINE"""NEWLINEPython 2 and 3 link cla...
# 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...
import ioNEWLINEimport jsonNEWLINEimport unittestNEWLINEimport tempfileNEWLINEfrom base64 import b64encodeNEWLINENEWLINEfrom ukbrest import appNEWLINEimport pandas as pdNEWLINENEWLINEfrom tests.settings import POSTGRESQL_ENGINENEWLINEfrom tests.utils import get_repository_path, DBTestNEWLINEfrom ukbrest.common.pheno2sq...
from unittest import TestCaseNEWLINENEWLINEclass TestArmLexer(TestCase):
from .get_script import get_script # noqaNEWLINEfrom scripts import custom # noqaNEWLINE
from datetime import dateNEWLINEfrom datetime import datetimeNEWLINEfrom datetime import timedelta as deltaNEWLINENEWLINEimport sysNEWLINEimport numpy as npNEWLINEimport xarray as xrNEWLINENEWLINEfrom parcels.grid import GridCodeNEWLINEfrom parcels.grid import CurvilinearGridNEWLINEfrom parcels.kernel import KernelNEWL...
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"] =...
# 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...
"""NEWLINEThe script is for creating a new graphml including nodes and edges NEWLINEbased on the subset geopackage created by "sv_createSubsetData.py".NEWLINEThis can reduce the volume of graphml, which can reduce the usage of memory in pc and NEWLINEimprove performace.NEWLINENEWLINE"""NEWLINEimport osmnx as oxNEWLINEi...
#!/usr/bin/env pythonNEWLINE#NEWLINE# ontoviz documentation build configuration file, created byNEWLINE# sphinx-quickstart on Fri Jun 9 13:47:02 2017.NEWLINE#NEWLINE# This file is execfile()d with the current directory set to itsNEWLINE# containing dir.NEWLINE#NEWLINE# Note that not all possible configuration values a...
import asyncioNEWLINENEWLINEfrom unittest.mock import patch, MagicMockNEWLINENEWLINEfrom icap import ICAPRequest, HeadersDict, handlerNEWLINEfrom icap.session import make_session_id, should_finalize_session, get_session, SessionStorageNEWLINEfrom icap.criteria import _HANDLERSNEWLINENEWLINENEWLINEdef test_make_session_...
# Licensed to the Apache Software Foundation (ASF) under oneNEWLINE# or more contributor license agreements. See the NOTICE fileNEWLINE# distributed with this work for additional informationNEWLINE# regarding copyright ownership. The ASF licenses this fileNEWLINE# to you under the Apache License, Version 2.0 (theNEWL...
import osNEWLINEimport shutilNEWLINENEWLINEimport mathNEWLINEimport sysNEWLINENEWLINEANSI_ESCAPE_SEQUENCE_START = '\x1b'NEWLINEANSI_ESCAPE_SEQUENCE_END = 'm'NEWLINENEWLINENEWLINEdef get_terminal_width():NEWLINE # when piping stdout linux is executing commands in separate process (terminal-less), that's why shutil wo...
from django.core.cache import get_cacheNEWLINEfrom avocado.conf import settingsNEWLINEfrom .model import instance_cache_key, NEVER_EXPIRENEWLINENEWLINENEWLINEdef post_save_cache(sender, instance, **kwargs):NEWLINE """General post-save handler for caching model instances. NOTE: This mustNEWLINE be used in conjunct...
NEWLINEimport sys, jsonNEWLINEimport cv2NEWLINEimport torchNEWLINENEWLINEPATH_EL = "../entity-linking/"NEWLINEsys.path.insert(0, PATH_EL)NEWLINENEWLINEimport clickNEWLINEimport tqdmNEWLINEfrom pycorenlp import StanfordCoreNLPNEWLINENEWLINEfrom entitylinking import core as ELNEWLINEfrom entitylinking.core.sentence impor...
# Copyright 2021 Arbaaz LaskarNEWLINENEWLINE# 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.0NEWLINENEWLINE# Unless require...
# 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...
# 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 required by applicable law or agreed to in wri...
NEWLINEimport loggingNEWLINEfrom deep_lyric_visualizer.helpers import setup_logger, _extract_name_from_pathNEWLINEfrom deep_lyric_visualizer.generator.generation_environment import (GenerationEnvironment,NEWLINE WikipediaBigGANGenerationEnviornment)NEWL...
from storages.backends.s3boto3 import S3Boto3StorageNEWLINENEWLINEStatRootS3BotoStorage = lambda: S3Boto3Storage(location='static')NEWLINENEWLINEMediaRootS3BotoStorage = lambda: S3Boto3Storage(location='media')NEWLINE
from django.conf import settingsNEWLINEfrom hashids import HashidsNEWLINENEWLINENEWLINEdef get_hashids():NEWLINE return Hashids(NEWLINE salt=settings.SECRET_KEY, min_length=4, alphabet="abcdefghijklmnopqrstuvwxyz"NEWLINE )NEWLINENEWLINENEWLINEdef decode_hashid(hashid):NEWLINE hashids = get_hashids()NEWL...
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 ...
import FWCore.ParameterSet.Config as cmsNEWLINENEWLINEpixelPluginsPhase1=cms.VPSet()NEWLINENEWLINENEWLINE#=====================================================================================NEWLINE#--- Phase 1 Pixel BarrelNEWLINE#NEWLINE# Layer Template Cluster file Resolution histogramsNEW...
# coding=utf-8NEWLINE# *** WARNING: this file was generated by crd2pulumi. ***NEWLINE# *** Do not edit by hand unless you're certain you know what you are doing! ***NEWLINENEWLINESNAKE_TO_CAMEL_CASE_TABLE = {NEWLINE "active_directory": "activeDirectory",NEWLINE "api_version": "apiVersion",NEWLINE "augmented_ac...
import mathNEWLINENEWLINEr= float(input("Radius:"))NEWLINEri=int(r)NEWLINEwhile r>ri:NEWLINE ri=ri+1NEWLINEx= float(input("x-coordinate:"))NEWLINEwhile x>r or x<-r:NEWLINE print ("x-coordinate cannot be larger than radius")NEWLINE x= float(input("x-coordinate:"))NEWLINEy= float(input("y-coordinate:"))NEWLINEwh...
from .jkgat import JKGATNEWLINENEWLINE__all__ = ['JKGAT']NEWLINE
# -*- coding: utf-8 -*-NEWLINE# Copyright 2020 Google LLCNEWLINE#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....
# -*- coding: utf-8 -*-NEWLINE#NEWLINE# dengueAI documentation build configuration file, created byNEWLINE# sphinx-quickstart.NEWLINE#NEWLINE# This file is execfile()d with the current directory set to its containing dir.NEWLINE#NEWLINE# Note that not all possible configuration values are present in thisNEWLINE# autoge...
# 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# (the "Lic...
# Time: O(n)NEWLINE# Space: O(k)NEWLINENEWLINEclass Solution:NEWLINE def lengthOfLongestSubstringKDistinct(self, s: str, k: int) -> int:NEWLINE """NEWLINE modified sliding window, using a mapNEWLINE """NEWLINENEWLINE if not s or not k:NEWLINE return 0NEWLINENEWLINE left ...
import unittestNEWLINEimport osNEWLINEfrom ...BaseTestCase import BaseTestCaseNEWLINEfrom kombi.Task import TaskNEWLINEfrom kombi.Crawler.Fs import FsCrawlerNEWLINENEWLINEclass ResizeImageTaskTest(BaseTestCase):NEWLINE """Test ResizeImage task."""NEWLINENEWLINE __sourcePath = os.path.join(BaseTestCase.dataTestsDi...
# Generated from SMTLIBv2.g4 by ANTLR 4.9.2NEWLINEfrom antlr4 import *NEWLINEfrom io import StringIONEWLINEimport sysNEWLINEif sys.version_info[1] > 5:NEWLINE from typing import TextIONEWLINEelse:NEWLINE from typing.io import TextIONEWLINENEWLINENEWLINENEWLINEdef serializedATN():NEWLINE with StringIO() as buf:...
"""JSON Web Encryption utilities."""NEWLINENEWLINEimport binasciiNEWLINEimport jsonNEWLINENEWLINEfrom collections import OrderedDictNEWLINEfrom typing import Any, Dict, Iterable, List, Mapping, Optional, UnionNEWLINENEWLINEfrom marshmallow import fields, Schema, ValidationErrorNEWLINENEWLINEfrom ..wallet.util import b6...
# generated by datamodel-codegen:NEWLINE# filename: schema/api/services/updateDatabaseService.jsonNEWLINE# timestamp: 2021-10-01T19:50:55+00:00NEWLINENEWLINEfrom __future__ import annotationsNEWLINENEWLINEfrom typing import OptionalNEWLINENEWLINEfrom pydantic import BaseModel, FieldNEWLINENEWLINEfrom ...type impor...
class ServerFlushed:NEWLINE def __init__(self, request):NEWLINE self.request = requestNEWLINE
_base_ = [NEWLINE 'r50_sz224_4xb64_head1_lr0_1_step_ep20.py',NEWLINE]NEWLINENEWLINE# optimizerNEWLINEoptimizer = dict(paramwise_options={'\\Ahead.': dict(lr_mult=100)})NEWLINE
NEWLINEimport reNEWLINENEWLINENEWLINEclass RegexValidator(object):NEWLINE def __init__(self, pattern, excludes):NEWLINE if not pattern or pattern == '':NEWLINE pattern = '.*' # match anythingNEWLINE if not excludes or excludes == '':NEWLINE excludes = 'a^' # match nothingNEWLINE...
# -*- coding: utf-8 -*-NEWLINEfrom __future__ import absolute_import, division, print_function, unicode_literalsNEWLINENEWLINEfrom copy import deepcopyNEWLINENEWLINEfrom django.test.testcases import TestCaseNEWLINENEWLINEfrom djstripe.models import CouponNEWLINENEWLINEfrom . import FAKE_COUPONNEWLINENEWLINENEWLINEclass...
# (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...
formatter = "%r %r %r %r"NEWLINEprint (formatter % (1 ,2 ,3 , 4))NEWLINEprint (formatter % ("one","two","three","four"))NEWLINEprint (formatter % (True, False, False, True))NEWLINEprint (formatter % (formatter ,formatter, formatter, formatter))NEWLINEprint (formatter % NEWLINE ("I had this thing.",NEWLINE ...
#!/usr/bin/pythonNEWLINE# Copyright 2012 William YuNEWLINE# wyu@ateneo.eduNEWLINE#NEWLINE# This file is part of POX.NEWLINE#NEWLINE# POX is free software: you can redistribute it and/or modifyNEWLINE# it under the terms of the GNU General Public License as published byNEWLINE# the Free Software Foundation, either versi...
import pickleNEWLINEimport sysNEWLINEimport warningsNEWLINEfrom copy import copy, deepcopyNEWLINEfrom io import StringIONEWLINEfrom textwrap import dedentNEWLINENEWLINEimport numpy as npNEWLINEimport pandas as pdNEWLINEimport pytestNEWLINENEWLINEimport xarray as xrNEWLINEfrom xarray import (NEWLINE DataArray,NEWLINE...
import osNEWLINEimport reNEWLINEimport timeNEWLINENEWLINEimport pytestNEWLINEfrom helpers.cluster import ClickHouseClusterNEWLINEfrom helpers.test_tools import assert_eq_with_retry, TSVNEWLINENEWLINEcluster = ClickHouseCluster(__file__)NEWLINEnode = cluster.add_instance('node', main_configs=["configs/config.d/remote_se...
NEWLINEimport osNEWLINEimport timeNEWLINEimport signalNEWLINEimport socketNEWLINEimport loggingNEWLINEimport unittestNEWLINEimport BaseHTTPServerNEWLINENEWLINEimport redisNEWLINEimport requestsNEWLINENEWLINENEWLINElogger = logging.getLogger(__name__)NEWLINElogging.basicConfig(format='%(asctime)s %(levelname)s %(message...
from __future__ import print_functionNEWLINE# Copyright (c) 2012 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.NEWLINENEWLINEimport filecmpNEWLINEimport gyp.commonNEWLINEimport gyp.xcodeproj_fileNEWLINEimport gyp.xcode_n...
import sysNEWLINEimport osNEWLINEimport filecmpNEWLINEimport importlibNEWLINEimport datetimeNEWLINEimport commonNEWLINENEWLINEpath = os.path.abspath('.')NEWLINEsys.path.append(path)NEWLINENEWLINEdomain = 'maaseuduntulevaisuus'NEWLINEurl = 'http://www.maaseuduntulevaisuus.fi/maatalous/eu-s%C3%A4%C3%A4st%C3%A4%C3%A4-suor...
# PyYAML libraryNEWLINE__license__ = 'MIT'NEWLINE__author__ = 'Kirill Simonov'NEWLINE__copyright__ = """NEWLINE Copyright (c) 2017-2020 Ingy döt NetNEWLINE Copyright (c) 2006-2016 Kirill SimonovNEWLINE """NEWLINENEWLINE# For changes regarding this port for Ignition usage, please contact:NEWLINE__maintainer__ = 'Andrew ...
import requestsNEWLINENEWLINE#sresponse = requests.get()
from selenium.webdriver.common.keys import KeysNEWLINEimport timeNEWLINEimport randomNEWLINENEWLINEfrom selenium_ui.base_page import BasePageNEWLINEfrom selenium_ui.jira.pages.selectors import UrlManager, LoginPageLocators, DashboardLocators, PopupLocators, \NEWLINE IssueLocators, ProjectLocators, SearchLocators, Bo...
"""NEWLINETests for navtagsNEWLINE"""NEWLINENEWLINEimport pytestNEWLINEassert pytestNEWLINENEWLINEfrom django.http import HttpRequestNEWLINENEWLINEfrom hm_web.templatetags import navtagsNEWLINENEWLINENEWLINEdef build_request(path):NEWLINE """NEWLINE Build an HttpRequest object with the given pathNEWLINE """NEW...
from IPython import get_ipythonNEWLINEfrom IPython.core.magic import (magics_class, line_magic)NEWLINEfrom IPython.core.magics.osm import OSMagicsNEWLINEfrom johnstarich.ipython.shell import find_varNEWLINEimport keywordNEWLINEimport shutilNEWLINENEWLINENEWLINE@magics_classNEWLINEclass Bashisms(OSMagics):NEWLINE @pr...
import numpy as npNEWLINEfrom wacky_rl import layersNEWLINEfrom collections import dequeNEWLINENEWLINEclass AgentCore:NEWLINENEWLINE def __init__(self, obs_seq_lenght = 6):NEWLINE self.approx_contin = FalseNEWLINE self.obs_seq_lenght = obs_seq_lenghtNEWLINE self.obs_mem = deque(maxlen=obs_seq_le...
"""NEWLINEModule related to the argument parsingNEWLINENEWLINEThere is a fallback to the deprecated optparse if argparse is not foundNEWLINE"""NEWLINEfrom pathlib import PathNEWLINEfrom argparse import ArgumentParser, SUPPRESSNEWLINENEWLINENEWLINEdef parse_args(CONFIG_PATH: Path):NEWLINE """NEWLINE Parse the argu...
#-----------------------------------------------------------------------------NEWLINE# Copyright (c) 2005-2016, PyInstaller Development Team.NEWLINE#NEWLINE# Distributed under the terms of the GNU General Public License with exceptionNEWLINE# for distributing bootloader.NEWLINE#NEWLINE# The full license is in the file ...
"""Given an algorithm object, run the algorithm."""NEWLINEfrom __future__ import division, print_functionNEWLINENEWLINEimport signalNEWLINEimport sysNEWLINEimport multiprocessing as mpNEWLINEimport osNEWLINEimport textwrapNEWLINEimport jsonNEWLINENEWLINEimport requestsNEWLINEimport sixNEWLINEimport codejailNEWLINEfrom ...
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...
"""Resnet v1 model variants.NEWLINECode branched out from slim/nets/resnet_v1.py, and please refer to it forNEWLINEmore details.NEWLINEThe original version ResNets-v1 were proposed by:NEWLINE[1] Kaiming He, Xiangyu Zhang, Shaoqing Ren, Jian SunNEWLINE Deep Residual Learning for Image Recognition. arXiv:1512.03385NEW...
import jsonNEWLINEimport osNEWLINENEWLINEimport requestsNEWLINENEWLINENEWLINEclass _SdcCommon(object):NEWLINE '''Interact with the Sysdig Monitor/Secure API.NEWLINENEWLINE **Arguments**NEWLINE - **token**: A Sysdig Monitor/Secure API token from the *Sysdig Cloud API* section of the Settings page for `monit...
# Generated by Django 3.2.4 on 2021-06-06 05:11NEWLINENEWLINEfrom django.conf import settingsNEWLINEfrom django.db import migrations, modelsNEWLINEimport django.db.models.deletionNEWLINENEWLINENEWLINEclass Migration(migrations.Migration):NEWLINENEWLINE initial = TrueNEWLINENEWLINE dependencies = [NEWLINE (...
# iterator objects implement __iter__ and __next__ methodsNEWLINENEWLINEl = [3, 54,32, 'name']NEWLINEl_iterator = iter(l)NEWLINENEWLINE#print(l_iterator)NEWLINE#print(next(l_iterator))NEWLINE#print(next(l_iterator))NEWLINE#print(next(l_iterator))NEWLINE#print(next(l_iterator))NEWLINE#print(next(l_iterator))NEWLINENEWLI...
'''NEWLINEFile name: common_utils.pyNEWLINEProgrammed by: Mike BernardNEWLINEDate: 2019-11-08NEWLINENEWLINECommon helper functions used in multiple scripts.NEWLINE'''NEWLINENEWLINEfrom nav.utils.constants import PASSNEWLINENEWLINENEWLINEdef weighted_avg(values, weights):NEWLINE '''NEWLINE Takes a list of values a...
#!/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...
# -*- coding: utf-8 -*-NEWLINENEWLINEimport pymysqlNEWLINEimport structNEWLINENEWLINEfrom pymysql.constants.COMMAND import COM_BINLOG_DUMP, COM_REGISTER_SLAVENEWLINEfrom pymysql.cursors import DictCursorNEWLINEfrom pymysql.util import int2byteNEWLINENEWLINEfrom .packet import BinLogPacketWrapperNEWLINEfrom .constants.B...
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...
#!/usr/bin/env pythonNEWLINENEWLINE'''NEWLINEEC2 external inventory scriptNEWLINE=================================NEWLINENEWLINEGenerates inventory that Ansible can understand by making API request toNEWLINEAWS EC2 using the Boto library.NEWLINENEWLINENOTE: This script assumes Ansible is being executed where the enviro...
#NEWLINE# Copyright (c) 2016-2021 JEP AUTHORS.NEWLINE#NEWLINE# This file is licensed under the the zlib/libpng License.NEWLINE#NEWLINE# This software is provided 'as-is', without any express or impliedNEWLINE# warranty. In no event will the authors be held liable for anyNEWLINE# damages arising from the use of this sof...
#!/usr/bin/env pythonNEWLINE#NEWLINE# Copyright 2015-2016 Rafael Ferreira da SilvaNEWLINE# http://www.rafaelsilva.com/toolsNEWLINE#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 Lice...
"""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...
import pandas as pdNEWLINEfrom sklearn.metrics import mean_squared_errorNEWLINEfrom sklearn.model_selection import train_test_splitNEWLINEfrom sklearn.preprocessing import LabelEncoderNEWLINENEWLINEfrom deepctr.models import DeepFMNEWLINEfrom deepctr.feature_column import SparseFeat,get_feature_namesNEWLINENEWLINEif __...
"""NEWLINENEWLINE208. Implement Trie (Prefix Tree)NEWLINEMediumNEWLINENEWLINE5115NEWLINENEWLINE77NEWLINENEWLINEAdd to ListNEWLINENEWLINEShareNEWLINEA trie (pronounced as "try") or prefix tree is a tree data structure used to efficiently store and retrieve keys in a dataset of strings. There are various applications of ...
# NEED THIS INIT FOR PYTEST --COV TO GENERATE A PROPER REPORTNEWLINENEWLINENEWLINE# Found the answer:NEWLINE#NEWLINE# DO NOT put a __init__.py file in a folder containing TESTS ifNEWLINE# you plan on using pytest. I had one such file, deleting itNEWLINE# solved the problem.NEWLINE#NEWLINE# This was actually buried in t...
import numpy as npNEWLINEimport torchNEWLINEimport torch.nn as nnNEWLINENEWLINEfrom mmcv.cnn import constant_init, normal_initNEWLINEfrom mmdet.models.anchor_heads.ssd_head import SSDHeadNEWLINEfrom mmdet.models.registry import HEADSNEWLINENEWLINEfrom .operations import conv_dw_headNEWLINENEWLINENEWLINE@HEADS.register_...
# coding: utf-8NEWLINE# Copyright (c) Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) DepartmentNEWLINE# Distributed under the terms of "New BSD License", see the LICENSE file.NEWLINENEWLINEfrom __future__ import print_function, unicode_literalsNEWLINEimport numpy as npNEWLINEimport os...
import osNEWLINEimport shlexNEWLINEimport subprocessNEWLINEimport reNEWLINEfrom typing import Dict, NoReturnNEWLINENEWLINEdef run_shell_command(command: str): -> NoReturnNEWLINE subprocess.run(shlex.split(command))NEWLINENEWLINENEWLINEdef get_git_info(git_repo_address: str) -> Dict:NEWLINE """Returns the various ...
from player import PlayerNEWLINEfrom Card import CardNEWLINEimport timeNEWLINEimport uuid,randomNEWLINEclass Game:NEWLINE id = 0NEWLINE last_action_time = 0NEWLINE turn = 0NEWLINE cards = []NEWLINE players = []NEWLINE action = ""NEWLINE reaction_card = ""NEWLINE reacting_player = ""NEWLINE ch...
# Copyright 2018 Open Source Robotics Foundation, Inc.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.0NE...
from django.db import modelsNEWLINENEWLINE# Create your models here.NEWLINEclass Grade(models.Model):NEWLINE gno=models.CharField(max_length=20,primary_key=True)NEWLINE gname=models.CharField(max_length=20,unique=True)NEWLINE class Meta():NEWLINE db_table = 'grade'NEWLINENEWLINEclass Course(models.Model...
import lossesNEWLINEimport torchNEWLINENEWLINENEWLINEdef build_loss(cfg):NEWLINE args = cfg.copy()NEWLINE name = args.pop('type')NEWLINE if hasattr(torch.nn, name):NEWLINE criterion = getattr(torch.nn, name)(**args)NEWLINE else:NEWLINE criterion = losses.__dict__[name](**args)NEWLINE return...
"""NEWLINEPyTorch policy class used for SAC.NEWLINE"""NEWLINENEWLINEimport gymNEWLINEfrom gym.spaces import DiscreteNEWLINEimport loggingNEWLINEfrom typing import Dict, List, Optional, Tuple, Type, UnionNEWLINENEWLINEimport rayNEWLINEimport ray.experimental.tf_utilsNEWLINEfrom ray.rllib.agents.sac.sac_tf_policy import ...
# Generated by Django 3.2.5 on 2021-07-18 23:06NEWLINENEWLINEfrom django.db import migrations, modelsNEWLINENEWLINENEWLINEclass Migration(migrations.Migration):NEWLINENEWLINE dependencies = [NEWLINE ('login', '0001_initial'),NEWLINE ]NEWLINENEWLINE operations = [NEWLINE migrations.AlterField(NEWL...
#!/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...
from django.db import modelsNEWLINENEWLINE# Create your models here.NEWLINEclass Grade(models.Model):NEWLINE gno=models.CharField(max_length=20,primary_key=True)NEWLINE gname=models.CharField(max_length=20,unique=True)NEWLINE class Meta():NEWLINE db_table = 'grade'NEWLINENEWLINEclass Course(models.Model...
from app.business.blog.views import blog # noqaNEWLINE
from time import timeNEWLINEfrom base64 import b16encodeNEWLINEfrom functools import partialNEWLINEfrom operator import __eq__, __ne__, __lt__, __le__, __gt__, __ge__NEWLINENEWLINEfrom six import (NEWLINE integer_types as _integer_types,NEWLINE text_type as _text_type)NEWLINENEWLINEfrom OpenSSL._util import (NEWL...
from game.combat.effects.moveeffect.basemoveeffect import BaseMoveEffectNEWLINEfrom game.combat.effects.partialeffect.applystatuseffect import ApplyStatusNEWLINEfrom game.combat.effects import statuseffectNEWLINENEWLINENEWLINEclass Confusion(BaseMoveEffect):NEWLINE def after_action(self):NEWLINE if self.scene...
NEWLINE# This file helps to compute a version number in source trees obtained fromNEWLINE# git-archive tarball (such as those provided by githubs download-from-tagNEWLINE# feature). Distribution tarballs (built by setup.py sdist) and buildNEWLINE# directories (produced by setup.py build) will contain a much shorter fil...
# coding=utf-8NEWLINE# --------------------------------------------------------------------------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#NEWLINE# Code generated by Microsoft (R)...
import torchNEWLINENEWLINE#from tinydfa import DFA, DFALayer, FeedbackPointsHandlingNEWLINEfrom tinydfa.light_dfa import DFA, DFALayerNEWLINENEWLINENEWLINEclass VeryTinyNeRFModel(torch.nn.Module):NEWLINE r"""Define a "very tiny" NeRF model comprising three fully connected layers.NEWLINE """NEWLINENEWLINE def _...
# -*- 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...
# Copyright 2019 The Vitess Authors.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# ...
# -*- coding: utf-8 -*-NEWLINENEWLINE# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:NEWLINE# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-codeNEWLINENEWLINEfrom ccxt.async_support.base.exchange import ExchangeNEWLINEimport base64NEWLINEfrom ccxt.base.errors import ...
#! /usr/bin/python3NEWLINENEWLINE"""Create and parse 'send'-type messages."""NEWLINENEWLINEimport structNEWLINEimport jsonNEWLINEimport loggingNEWLINElogger = logging.getLogger(__name__)NEWLINENEWLINEfrom ... import (config, exceptions, util, message_type)NEWLINENEWLINEFORMAT = '>QQ'NEWLINELENGTH = 8 + 8NEWLINEID = 0NE...
from neo.Prompt.Commands.Invoke import InvokeContract, InvokeWithTokenVerificationScriptNEWLINEfrom neo.Core.Fixed8 import Fixed8NEWLINEfrom neo.Core.UInt160 import UInt160NEWLINEfrom neo.Network.common import blocking_prompt as promptNEWLINEfrom decimal import DecimalNEWLINEfrom neo.Core.TX.TransactionAttribute import...
#!/usr/bin/env python3NEWLINE"""NEWLINEpixivNEWLINENEWLINEUsage:NEWLINE pixiv.pyNEWLINE pixiv.py <id>...NEWLINE pixiv.py -r [-d | --date=<date>]NEWLINE pixiv.py -uNEWLINENEWLINEArguments:NEWLINE <id> user_idsNEWLINENEWLINEOptions:NEWLINE -r ...
import argparseNEWLINENEWLINEimport torchNEWLINEfrom torch_geometric.nn import Node2VecNEWLINEfrom torch_geometric.utils import to_undirectedNEWLINENEWLINEfrom ogb.nodeproppred import PygNodePropPredDatasetNEWLINENEWLINENEWLINEdef save_embedding(model):NEWLINE torch.save(model.embedding.weight.data.cpu(), 'embedding...
# coding=utf-8NEWLINE# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.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 atNEWLI...