text
stringlengths
2
999k
from __future__ import unicode_literals import json import re from .common import InfoExtractor from ..utils import ( int_or_none, parse_iso8601, ) class DRBonanzaIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?dr\.dk/bonanza/(?:[^/]+/)+(?:[^/])+?(?:assetId=(?P<id>\d+))?(?:[#&]|$)' _TESTS = [{...
import random f = open('file3.txt', 'w') char = [' ',' ',' ',' ', '*'] for item in range(50): for item in range(50): random_char = random.choice(char) f.write(random_char) f.write("\n") f.close()
from django.apps import AppConfig class ProductConfig(AppConfig): name = 'apps.product'
from __future__ import unicode_literals from django.conf import settings from django.contrib.contenttypes.models import ContentType from django.core.urlresolvers import reverse from django.db import models from django.db.models.signals import pre_save from django.utils import timezone from django.utils.safestring impo...
# coding: utf-8 """ Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.8.2 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import os import sys im...
from rest_framework import serializers from quotedb.models import Quote class QuoteSerializer(serializers.ModelSerializer): owner = serializers.ReadOnlyField(source='owner.username') class Meta: model = Quote fields = ('id', 'body', 'owner', 'created', 'approved') read_only = ('id',)
import random import sys print("ROCK, PAPER, SCISSORS") wins, losses, ties = 0, 0, 0 # Main Loop while True: print(f" {wins} Wins, {losses} Losses, and {ties} Ties") # Input Loop while True: print("Enter your move: (r)ock (p)aper (s)cissors or (q)uit") playerMove = input() if playe...
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
# Copyright European Organization for Nuclear Research (CERN) # # 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 # # Authors: # - Vincent Garonne, <vin...
# class Meta(type): # def __call__(cls, *args, **kwargs): # print('CALL é executado') # return super().__call__(*args, **kwargs) # class Pessoa(metaclass=Meta): # def __new__(cls, *args, **kwargs): # print('NEW é executado') # return super().__new__(cls) # def __init__(sel...
from aiohttp.test_utils import unittest_run_loop from tests.utils import CitizensApiTestCase class TestImport(CitizensApiTestCase): @unittest_run_loop async def test_save_import(self): citizens = [ { "citizen_id": 1, "town": "Москва", "stree...
from torch.utils.tensorboard import SummaryWriter class TensorboardLogger(): def __init__(self, path): assert path != None, "path is None" self.writer = SummaryWriter(log_dir=path) def update_loss(self, phase, value, step): self.writer.add_scalar(f'{phase}/loss', value, step) def...
#!/usr/bin/python # -*- coding: utf-8 -*- # # usbmux.py - usbmux client library for Python # # Copyright (C) 2009 Hector Martin "marcan" <hector@marcansoft.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Soft...
import spacy from spacy.matcher import PhraseMatcher from app.utils import pdf2text nlp = spacy.load('en_core_web_sm') def model_rank(filename, requirements): requirements = ['management', 'business'] # print('WOI PANTEK "{}" == "uploads/c8106a5d9eb786b8048d6c9ade0368fff6612d67.pdf"'.format(filename)) # p...
from __future__ import print_function, unicode_literals import json import os import sys from wptserve import sslutils import environment as env import products import testloader import wptcommandline import wptlogging import wpttest from font import FontInstaller from testrunner import ManagerGroup from browsers.ba...
# source https://github.com/HenningBuhl/VQ-VAE_Keras_Implementation/blob/master/VQ_VAE_Keras_MNIST_Example.ipynb # VQ layer. from keras.layers import Input, Layer, Activation, Dense, Flatten, Dropout, Lambda, Conv2D, MaxPooling2D, UpSampling2D, Conv2DTranspose, SpatialDropout2D from keras import backend as K from keras...
import numpy as np from numpy.testing import assert_array_equal import pytest from sklearn.feature_extraction import FeatureHasher from sklearn.feature_extraction._hashing_fast import transform as _hashing_transform def test_feature_hasher_dicts(): feature_hasher = FeatureHasher(n_features=16) assert "dict" ...
""" """ from util import get_ccs_dist, plot_replicate_ccs_dists, two_peak_fit # raw files rf1 = 'D:/DMIM_HT/data/20200127/DHR20200127_p723_L21_pos.raw' rf2 = 'D:/DMIM_HT/data/20191209/DHR20191209_p723_L21_pos.raw' rf3 = 'D:/DMIM_HT/data/20191210/DHR20191210_p723_L21_pos.raw' # ccs calibration files cf1 = 'D:/DMIM_...
# Puzzle2.py from Puzzle import Puzzle, CutRegion from math2d_affine_transform import AffineTransform from math2d_vector import Vector class Puzzle2(Puzzle): def __init__(self): super().__init__() cut_region = CutRegion() cut_region.GenerateRegularPolygon(4, 3.0) self.cut_region_l...
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) import os import os.path import copy import spack.util.environment class Cp2k(MakefilePackage, CudaPackage): """CP2...
""" Test cases for Voronoi Diagram creation. Overall, I'm trying less to test the correctness of the result and more to cover input cases and behavior, making sure that we return a sane result without error or raise a useful one. """ import pytest from shapely.geos import geos_version from shapely.geometry import Mu...
from decimal import Decimal from unittest.mock import patch import pytest from django.urls import reverse from prices import Money, TaxedMoney from saleor.account import events as account_events from saleor.account.models import User from saleor.checkout.utils import create_order, prepare_order_data from saleor.core....
#!/usr/bin/env python3 from os.path import dirname, realpath, split,\ join, isdir, exists from os import remove, system, mkdir from logging import getLogger, basicConfig,\ DEBUG, INFO, ERROR from argparse import ArgumentParser from atexit import register from shutil import rmtree from jinja2 import Environmen...
# -*- coding: utf-8 -*- """Fake Windows Registry objects implementation.""" import collections import os from dfdatetime import filetime as dfdatetime_filetime from dfdatetime import semantic_time as dfdatetime_semantic_time from dtfabric.runtime import fabric as dtfabric_fabric from dfwinreg import definitions fro...
''' Created on 2010-02-18 @author: malem303 ''' import scipy as sp from scipy import interpolate import math from imugrabber.algorithms import io #from cgkit import cgtypes from imugrabber.algorithms import scipy_utils import matplotlib.pyplot as plt def extract_targets_from_hal_logs_abvt(shiftToZero = True): ...
from dagster_graphql.test.utils import execute_dagster_graphql from dagster import repository from dagster.core.host_representation import external_repository_data_from_def from dagster.seven import mock from .graphql_context_test_suite import GraphQLContextVariant, make_graphql_context_test_suite # import dagster.a...
# -*- coding: utf-8 -*- """Tests for `mq_metrics_client`.""" import os import sys import unittest import argparse from unittest.mock import patch from mq_metrics_client import ( get_mq_metrics, put_metric_to_gateway, static_content, parse_commandline_args, PrometheusBadResponse) sys.path.append(os.g...
ROBOT_LIBRARY_VERSION='1.2.4' print ('init6') class TestClassParams(object): def __init__(self, **params): self.cp1 = params.get('cp1', 'not provided') def test_class_keyword_params(self, param1): """ Test class documentation """ return "Res: %s, %s" % (param1, self.cp1...
''' Functions that are used while a Generation is being Evaluated ''' import os import random import multiprocessing from rdkit import Chem import numpy as np from random import randrange import discriminator as D import evolution_functions as evo from SAS_calculator.sascorer import calculateScore manager ...
# Copyright 2020 The PyMC Developers # # 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 ag...
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * from spack.pkg.builtin.boost import Boost class Gplates(CMakePackage): """GPlates is desktop sof...
""" Django settings for pastebin project. Generated by 'django-admin startproject' using Django 3.2.12. For more information on this file, see https://docs.djangoproject.com/en/3.2/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.2/ref/settings/ """ from pathl...
from __future__ import annotations import pytest from poetry.core.packages.specification import PackageSpecification @pytest.mark.parametrize( "spec1, spec2, expected", [ (PackageSpecification("a"), PackageSpecification("a"), True), (PackageSpecification("a", "type1"), PackageSpecification("...
#!/usr/bin/env python3 """Prepare the weather file(s) specified in the YAML configuration to be used by the pipeline. CLI arguments match those defined by ``main()``. """ import logging import pandas as pd import typer import yaml import config # Get a log handler logging.basicConfig(level=logging.INFO) logger = lo...
import json import glob import argparse def merge_dicts(list_dicts): merged_dict = list_dicts[0].copy() for i in range(1, len(list_dicts)): merged_dict.update(list_dicts[i]) return merged_dict def save_json_pretty(data, file_path): """save formatted json, use this one for some json config fi...
import os import random import torch import torchvision.transforms as transforms import torchvision.datasets as datasets from torch.utils.data import Subset from codebase.core.arch_representation.ofa import OFAArchitecture from codebase.third_party.ofa import OFAMobileNetV3 from codebase.third_party.spos_ofa import ...
# -*- coding: utf-8 -*- # # Copyright (C) 2019-2021 CERN. # Copyright (C) 2019-2021 Northwestern University. # Copyright (C) 2021 TU Wien. # # Invenio App RDM is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. """JS/CSS Webpack bundl...
# https://docs.python.org/2/library/collections.html#collections.defaultdict from collections import defaultdict s = "mississippi" d = defaultdict(int) for k in s: d[k] += 1 print(d.items())
# Recursive function to return gcd of a and b def gcd(a,b): if (b == 0): return a return gcd(b, a%b) def lcm(a,b): # lcm*hcf=a*b return a*b/gcd(a,b) a = int(input()) b = int(input()) hcf=gcd(a, b) if(hcf): print('GCD of', a, 'and', b, 'is', hcf) a = int(input()) b = int(input()) lcm=lc...
import requests import datetime from lxml import html headers = {"User-Agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:89.0) Gecko/20100101 Firefox/89.0"} class EFG(): def __init__(self): self.data = requests.get( "https://store-site-backend-static.ak.epicgames.com/freeGamesPromotions" ...
#credits to @mrconfused from telethon import events, errors, functions, types import inspect import traceback import asyncio import sys import io from userbot.utils import admin_cmd from userbot import CMD_HELP @borg.on(admin_cmd(pattern="calc")) async def _(event): if event.fwd_from or event.via_bot_id: ...
# Python 3 Spelling Corrector # # Copyright 2014 Jonas McCallum. # Updated for Python 3, based on Peter Norvig's # 2007 version: http://norvig.com/spell-correct.html """ Word based methods and functions Author: Jonas McCallum https://github.com/foobarmus/autocorrect Optimized by: Filip Sondej https://gith...
import random from ProxyLog.logger import ProxyLogger from proxy.db_redis import RedisClient from proxy.api_proxy import Crawler import sys class Getter(): def __init__(self): self.redis = RedisClient() self.crawler = Crawler() def is_over_threshold(self): """ 判断是否达到了代理池限制 ...
# -*- coding: utf-8 -*- #BEGIN_HEADER import logging import os from installed_clients.KBaseReportClient import KBaseReport #END_HEADER class ReadMapping: ''' Module Name: ReadMapping Module Description: A KBase module: ReadMapping ''' ######## WARNING FOR GEVENT USERS ####### noqa #...
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT license. from __future__ import print_function import sys import os import numpy as np from edgeml_pytorch.trainer.protoNNTrainer import ProtoNNTrainer from edgeml_pytorch.graph.protoNN import ProtoNN import edgeml_pytorch.utils as ut...
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack.package import * class RDygraphs(RPackage): """Interface to 'Dygraphs' Interactive Time Series Charting L...
import pandas as pd from visions.core.implementations import visions_complete_set from visions.core.functional import type_cast_frame, type_inference_frame from visions.application.summaries.summary import CompleteSummary from visions.core.model.dtypes.bool_fix.visions_bool import visions_boolean # Load dataset df = ...
#!/usr/bin/env python # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "L...
import os import io import sys os.environ.setdefault( 'DJANGO_SETTINGS_MODULE', 'FinnDic.settings') import django django.setup() from dictionary.models import Word from openpyxl import load_workbook wb = load_workbook('FinnishWords.xlsx', read_only=True) ws = wb['Sheet1'] sys.stdout = io.TextIOWrapper(sys.stdout...
"""Wrapper for mod_fastcgi, for use as a CherryPy HTTP server when testing. To autostart fastcgi, the "apache" executable or script must be on your system path, or you must override the global APACHE_PATH. On some platforms, "apache" may be called "apachectl", "apache2ctl", or "httpd"--create a symlink to them if need...
""" This module is used to auto-detect the type of a device in order to automatically create a Netmiko connection. The will avoid to hard coding the 'device_type' when using the ConnectHandler factory function from Netmiko. Example: ------------------ from netmiko.snmp_autodetect import SNMPDetect my_snmp = SNMPDete...
# Copyright 2014 PerfKitBenchmarker Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
"""The Flux LED/MagicLight integration.""" from __future__ import annotations from datetime import timedelta import logging from typing import Any, Final, cast from flux_led import DeviceType from flux_led.aio import AIOWifiLedBulb from flux_led.const import ATTR_ID from homeassistant.config_entries import ConfigEnt...
import random import base64 import requests import wikipedia import re from textblob import TextBlob from nltk.tokenize import sent_tokenize from flask import Flask, render_template, url_for, request, redirect app = Flask(__name__) def identify(img_path, thresh=0.3): your_api_key = "rLGVjfad2327BNuznXIHsIttJzt1...
n = 5 x = "{} hello, {}".format(n, "world") x = "{} non-str {}".format(n, True) x = "{} with quote {}".format(n, '"x"') x = "hello, {}".format("world") x = "with quote {}".format('"x"')
# -*- coding: utf-8 -*- # Copyright (c) 2020, sharmila and contributors # For license information, please see license.txt from __future__ import unicode_literals # import frappe from frappe.model.document import Document class JobApplication(Document): pass
"""create seed_routers table Revision ID: 17edc14f5f2 Revises: e1955a32f1 Create Date: 2015-10-25 14:21:59.829937 """ # revision identifiers, used by Alembic. revision = '17edc14f5f2' down_revision = 'e1955a32f1' branch_labels = None depends_on = None from sqlalchemy.dialects import postgresql from alembic import o...
import komand from .schema import ImportHashReportInput, ImportHashReportOutput, Input, Output from komand_threatminer.util import utils # Custom imports below import requests class ImportHashReport(komand.Action): API_URL = 'https://www.threatminer.org/imphash.php?api=True&rt=2' def __init__(self): ...
import pytest from django.conf import settings from django.contrib import messages from django.contrib.auth.models import AnonymousUser from django.contrib.messages.middleware import MessageMiddleware from django.contrib.sessions.middleware import SessionMiddleware from django.test import RequestFactory from django.url...
""" WSGI config for ncvoter project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application from raven.contrib.django.raven_com...
# coding: utf-8 from febraban.cnab240.itau.sispag import ChargePayment, File from febraban.cnab240.libs.barCode import BarCode from febraban.cnab240.user import User, UserAddress, UserBank sender = User( name="YOUR COMPANY NAME HERE", identifier="12345678901234", bank=UserBank( bankId="341", ...
from __future__ import print_function from tensorflow.keras import backend as K import tensorflow as tf import numpy as np # from cleverhans.cleverhans_v3.1.0.attacks_tf import _project_perturbation, UnrolledAdam # from cleverhans.attacks import Attack from distutils.version import LooseVersion import logging ...
#!/usr/bin/python # Copyright (c) 2018 Intel Corporation # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify...
# coding=utf-8 # Copyright 2018 The TensorFlow Datasets 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 appl...
from urllib.parse import urlencode import requests from requests.exceptions import RequestException centrifugo = "58c2400b-831d-411d-8fe8-31b6e337738b" PLUGIN_ID = "616991e5ef1c19335a2869f4" ORG_ID = "614679ee1a5607b13c00bcb7" class DataStorage: def __init__(self, request=None): self.read_api = ( ...
import ffmpeg class Mixer: @staticmethod def join_audio_video(video_path, audio_path, duration, output_path): input_video = ffmpeg.input(video_path).filter('trim', duration=duration) input_audio = ffmpeg.input(audio_path).filter('atrim', duration=duration) ffmpeg.concat(input_video, ...
# Copyright (c) 2011-2019, Manfred Moitzi # License: MIT License import pytest import ezdxf from ezdxf.sections.tables import TablesSection @pytest.fixture(scope="module") def tables(): doc = ezdxf.new() return doc.tables def test_constructor(tables): assert tables.layers is not None assert tables.l...
#!/usr/bin/env python # coding: utf-8 """ The Clear BSD License Copyright (c) – 2016, NetApp, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below) provided that the following conditions...
# -*- coding: utf-8 -*- class UnionFind(object): """Represents a data structure that tracks a set of elements partitioned into a number of disjoint (non-overlapping) subsets. Landau notation: O(α(n)), where α(n) is the inverse Ackermann function. See: https://www.youtube.com/watch?v=zV3Ul2pA2Fw...
""" Views associated with our stocking application. """ from django.conf import settings from django.contrib.auth.decorators import login_required from django.db.models import Count, Q, Min, Max, F from django.http import HttpResponseRedirect from django.shortcuts import redirect, render, get_object_or_404 from djang...
import numpy as np import glob import random import cv2 fishface=cv2.face.FisherFaceRecognizer_create() data={} def update(emotions): run_recognizer(emotions) print("Saving model...") fishface.save("model.xml") print("Model saved!!") def make_sets(emotions): training_data=[] training_label=[]...
import numpy as np import os import pandas as pd from catboost import CatBoostRegressor from sklearn.metrics import mean_absolute_error from sklearn.decomposition import NMF from helpers import MultiColumnLabelEncoder import lightgbm as lgb import itertools ''' Steps to add a new feature: (1) add your function de...
# -*- coding: utf-8 -*- from datetime import datetime from generated import manifest from ..utils.validation import validate_party def create_broker_service_manifest(external_service_code, external_service_edition_code, senders_reference, reportee, files=None, properties=None): ...
#!/usr/bin/env python # encoding: utf-8 """ File name: application.py Function Des: ... ~~~~~~~~~~ author: 1_x7 <lixuanqi1995@gmail.com> <http://lixuanqi.github.io> """ from flask_restful import Resource, marshal_with from app.handler.application import get_all_applications, create_application, get...
#!/usr/bin/env python # coding: utf-8 from argparse import Namespace import os import sys import unittest import responses pkg_root = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "..", "..")) # noqa sys.path.insert(0, pkg_root) # noqa from test import CapturingIO from test.integration.uploa...
#!/usr/bin/env python # Philipp Bender, 2012 # Matt Clarkson, 2012 import os import re from waflib import Context from waflib import Errors from waflib.Task import Task from waflib.TaskGen import extension """ A simple tool to integrate protocol buffers into your build system. Example for C++: def configure(con...
from mpl_toolkits import mplot3d from matplotlib.ticker import MaxNLocator import matplotlib.pyplot as plt import matplotlib.colors import matplotlib.animation as animation import numpy as np import pandas as pd import sys from tools.my_setup import * # from pubplot import Document # from pubplot.document_classes impo...
# -*- coding: utf-8 -*- from django.conf.urls import patterns, url from .views import PacientesCreateView, PacientesListView, PacientesUpdateView, PacientesDeleteView, PacientesDetailView urlpatterns = patterns('', url(r'^$', PacientesListView.as_view(), name='list'), url(r'^create$', PacientesCreateView.as_vi...
import collections import numpy as np class QCAspect(collections.namedtuple('QCAspect', 'lbl units data comment doi glossary')): """Facilitates the storage of quantum chemical results by labeling them with basic metadata. Attributes ---------- lbl : str Official label for `data`, often qcvar....
import bpy from math import pi, sin, cos, ceil from mathutils import Vector, Quaternion import colorsys from random import TWOPI def vecrotate(angle, axis, vin, vout): xsq = axis.x * axis.x ysq = axis.y * axis.y zsq = axis.z * axis.z cosa = cos(angle) sina = sin(angle) complcos = 1.0 - cosa...
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Font(_BaseTraceHierarchyType): # color # ----- @property def color(self): """ The 'color' property is a color and may be specified as: - A hex string (e.g. '#ff0000'...
# SPDX-License-Identifier: Apache-2.0 # Licensed to the Ed-Fi Alliance under one or more agreements. # The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0. # See the LICENSE and NOTICES files in the project root for more information. from edfi_performance.tasks.pipeclean.composite impor...
class ExposedMethod(object): def __init__(self, name, callable_): self.name = name self.callable = callable_ def call_with_params(self, params): if isinstance(params, (list, tuple)): return self.callable(*params) elif isinstance(params, dict): return self...
# -------------------------------------------------------------------------- # # Copyright (c) Microsoft Corporation. All rights reserved. # # The MIT License (MIT) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the ""Software""), ...
import logging from terra import util_terra from terra.execute_type import ( _execute_type, EXECUTE_TYPE_SWAP, ) from .borrow import ( handle_deposit_borrow, handle_repay_withdraw, ) def handle(exporter, elem, txinfo, index): execute_msg = util_terra._execute_msg(elem, index) if "execute_order...
from . import arm
# -*- coding: utf-8 -*- """ Training an image classifier We will do the following steps in order: 1. Load and normalizing the CIFAR10 training and test datasets using ``torchvision`` 2. Define a Convolution Neural Network 3. Define a loss function 4. Train the network on the training data 5. Test the network on the ...
# Copyright (c) 2019, CMCC Technologies Co., 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 law or agreed t...
# ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2008 Alex Holkner # Copyright (c) 2008-2020 pyglet contributors # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the follo...
from django.core.urlresolvers import reverse from django.core.urlresolvers import NoReverseMatch from django.test import TestCase from builds.constants import LATEST import core.views class SubdomainUrlTests(TestCase): def test_sub_index(self): url = reverse(core.views.redirect_project_slug, ...
import tensorflow as tf import time """ In single-process TensorFlow, multiple sessions do not share any state, even if they reuse the same graph (each session would have its own copy of every variable). In distributed TensorFlow, variable state is stored on the servers, not in the sessions, so multiple sessions ...
from twisted.web.template import Element, renderer, XMLFile class ExampleElement(Element): loader = XMLFile('template-1.xml') @renderer def header(self, request, tag): return tag('<<<Header>>>!') @renderer def footer(self, request, tag): return tag('>>>"Footer!"<<<', id='<"fun">')...
# Copyright 2013: Mirantis Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
from chatterbot import ChatBot from chatterbot.trainers import ChatterBotCorpusTrainer # Uncomment the following line to enable verbose logging # import logging # logging.basicConfig(level=logging.INFO) # Create a new instance of a ChatBot bot = ChatBot( "Terminal", storage_adapter="chatterbot.storage.SQLSto...
import sys n, a = map(int, sys.stdin.read().split()) def main(): return "Yes" if a >= n % 500 else "No" if __name__ == "__main__": ans = main() print(ans)
from . import utils from requests_oauthlib import OAuth1 import requests import json ############################################################################ def get_strike_prices(self,symbol=""): """return list of float strike prices for specific symbol""" # Safety first! if not utils.check(sy...
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
# -*- coding: utf-8 -*- """ DU task for segmenting text in cols using the conjugate graph after the SW re-engineering by JLM Copyright NAVER(C) 2019 Jean-Luc Meunier Developed for the EU project READ. The READ project has received funding from the European Union's Horizon 2020 r...
''' Common utilities for transient bubble calculation. ''' from numpy import ( append, arange, array, copy, hstack, ix_, ones, prod, shape, sum, unique, where, zeros) from numpy import int64 as my_int from scipy.sparse import csc_matrix as sparse from scipy.special import factorial from scipy.stats import multi...
"""Tests for Codecov API interface.""" from agithub import base as agithub_base import unittest from unittest import mock import env from apis import codecov class TestCodecovApi(unittest.TestCase): def setUp(self): super(TestCodecovApi, self).setUp() mock.patch.object( env, 'get', side_effect={...