src stringlengths 721 1.04M |
|---|
import httplib
from django.core.urlresolvers import reverse
from oscar.test.testcases import WebTestCase
from oscar.test.factories import create_product
from oscar.apps.catalogue.views import ProductListView
class TestProductDetailView(WebTestCase):
def test_enforces_canonical_url(self):
p = create_pro... |
from json import loads
import tornado.web
from schema import Use
from tornado.testing import AsyncHTTPTestCase
from tests.support import AsyncHTTPClientMixin, assert_response_code
from tapioca import TornadoRESTful, ResourceHandler, validate, optional
class ProjectsResource(ResourceHandler):
@validate(queryst... |
__source__ = 'https://leetcode.com/problems/subarray-product-less-than-k/'
# Time: O(N)
# Space: O(1)
#
# Description: Leetcode # 713. Subarray Product Less Than K
#
# Your are given an array of positive integers nums.
#
# Count and print the number of (contiguous) subarrays
# where the product of all the elements in ... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-05-02 10:06
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migration... |
#!/usr/bin/python3
# encoding: utf-8
"""
Read the file "README.md" first...
What this program is about...
* Spatial spectrum of an image, direct and inverse spatial Fourier transform
* RMS value, STD (standard deviation), contrast, sharpness, RMS gradient
* Azimuthal average of the spectrum, for studying radial prof... |
# -*- coding: utf-8 -*-
#
# Class for deal with Analytic Signal
# Universidade Estadual do Norte Fluminense - UENF
# Laboratório de Engenharia de Petróleo - LENEP
# Grupo de Inferência em Reservatório - GIR
# Adriano Paulo Laes de Santana
# September 12th, 2017
#
# The following code is based on
# http://docs.scipy.or... |
import logging
from pyvisdk.exceptions import InvalidArgumentError
########################################
# Automatically generated, do not edit.
########################################
log = logging.getLogger(__name__)
def ToolsConfigInfoToolsLastInstallInfo(vim, *args, **kwargs):
'''Describes status of las... |
from django.core.exceptions import ImproperlyConfigured
from django.shortcuts import redirect, Http404
from django.views.generic import DetailView, ListView, TemplateView
from django.views.generic.edit import ProcessFormView, FormMixin
from traffic_stops.utils import get_chunks
from collections import defaultdict
cla... |
# 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 applicable law or agreed to in... |
#!/usr/bin/env python3
# Copyright (c) 2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Class for bitcoind node under test"""
import decimal
import errno
import http.client
import json
import log... |
# -*- coding: utf-8 -*-
import os
import re
from collections import OrderedDict
from functools import wraps
from classytags.utils import flatten_context
from cms.models import CMSPlugin
from django.core.files.storage import get_storage_class
from django.template.defaultfilters import force_escape
from django.template.... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import logging
import sleekxmpp
# Python versions before 3.0 do not use UTF-8 encoding
# by default. To ensure that Unicode is handled properly
# throughout SleekXMPP, we will set the default encoding
# ourselves to UTF-8.
if sys.version_info < (3, 0):
from... |
#! /usr/bin/env python3
import os
import sys
import re
import threading
import pickle
import ssl
import time
import irc.client
from telegram import Telegram
from photostore import Imgur, VimCN
from config import config
help_txt = {
'all' : 'current avaliable commands are: .nick, .help, .join, .list',
'help'... |
# Copyright (c) 2017, Daniele Venzano
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... |
from random import randint
def compare1toN(str1, strl):
return any([compare(str1, a) for a in strl])
def compare(str1, str2):
return compare_const2(str1, str2)
def compare_const2(str1, str2):
if len(str1) != len(str2):
return False
result = 0
for x, y in zip(str1, str2):
result |... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Fri Jan 27 16:23:07 2017
@author: user
"""
## FOUND HERE http://www.nltk.org/howto/sentiment.html
## Source code http://www.nltk.org/_modules/nltk/sentiment/vader.html
## http://www.nltk.org/api/nltk.sentiment.html
## Hutto, C.J. & Gilbert, E.E. (2014). VAD... |
##
# Copyright (c) 2010-2015 Apple 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 by applicab... |
#! /usr/bin/python3
"""
Transaction 1: rps (Open the game)
source: address used to play the game
wager: amount to bet
move_random_hash: sha256(sha256(move + random)) (stored as bytes, 16 bytes random)
possible_moves: arbitrary odd number >= 3
expiration: how many blocks the game is valid
Matching conditions:
- tx0_po... |
from panda3d.core import *
from panda3d.direct import *
from toontown.toontowngui import TTDialog
from toontown.toonbase import TTLocalizer
class HealthForceAcknowledge:
def __init__(self, doneEvent):
self.doneEvent = doneEvent
self.dialog = None
return
def enter(self, hpLevel):
... |
from orangecontrib.comsyl.util.CompactAFReader import CompactAFReader
# from CompactAFReader import CompactAFReader
import numpy
from srxraylib.plot.gol import plot_image, plot
# from plot_color import plot_with_transparency_one
import pylab as plt
from matplotlib.colors import Normalize, ListedColormap
import ma... |
# Copyright 2017 Kevin Reid and the ShinySDR contributors
#
# This file is part of ShinySDR.
#
# ShinySDR 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 Software Foundation, either version 3 of the License, or
# (at your option... |
import sys
import xbmc, xbmcaddon
import json
ADDON = xbmcaddon.Addon()
ADDONID = ADDON.getAddonInfo('id')
ADDONVERSION = ADDON.getAddonInfo('version')
def log(txt):
if isinstance (txt,str):
txt = txt.decode("utf-8")
message = u'%s: %s' % (ADDONID, txt)
xbmc.log(msg=message.encode("utf... |
# Django settings for myproject project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@domain.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
... |
# -*- coding: utf-8 -*-
#-------------------------------------------------------------------------
# drawElements Quality Program utilities
# --------------------------------------
#
# Copyright 2015 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use t... |
# -*- coding: utf8 -*-
from pycraft.service.const import EntityType
from pycraft.service.primitive.geometry import Size
from .base import MobEntity
from .player import PlayerEntity
class MonsterEntity(MobEntity):
def has_hostile(self, entity):
return isinstance(entity, PlayerEntity)
class Zombie(M... |
# Made by disKret
import sys
from net.sf.l2j.gameserver.model.quest import State
from net.sf.l2j.gameserver.model.quest import QuestState
from net.sf.l2j.gameserver.model.quest.jython import QuestJython as JQuest
MYSTERIOUS_CLOTH = 7076
JEWEL_BOX = 7077
SEWING_KIT = 7078
DRESS_SHOES_BOX = 7113
FORMAL_WEAR = 6408
SIGNE... |
# Copyright (c) 2014 Alcatel-Lucent Enterprise
# 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
#
# Un... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# drain documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 2013.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autog... |
"""Transition kernel class.
A transition kernel allows us to estimate the (full-resolution)
transition operator in milestoning.
The main goal of this class is to keep track of the transitions and
obtain:
1. the stationary flux vector,
2. an approximation of the stationary distribution, and
3. the estimated mean fi... |
import os
import os.path as op
import sys
import warnings
import numpy as np
from nose.tools import assert_true, assert_equal, assert_raises
from numpy.testing import assert_allclose
from mne import (read_dipole, read_forward_solution,
convert_forward_solution, read_evokeds, read_cov,
... |
import concurrent.futures
import time
from concurrent.futures import ThreadPoolExecutor
import zmq
from pylm.clients import Client
from pylm.parts.core import zmq_context
from pylm.parts.messages_pb2 import PalmMessage
def fake_server(messages=1):
db_socket = zmq_context.socket(zmq.REP)
db_socket.bind('inpr... |
import base64
import unittest
from datetime import timedelta
from unittest.mock import Mock, MagicMock
from ingenico.connect.sdk.connection import Connection
from ingenico.connect.sdk.defaultimpl.default_marshaller import DefaultMarshaller
from ingenico.connect.sdk.factory import Factory
from ingenico.connect.sdk.poo... |
# This file is part of Buildbot. Buildbot 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 Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
crawler/database.py
~~~~~~~~~~~~~~~~~~~
provide some convenient ways to get data and communicate with
the redis server
"""
from __future__ import absolute_import
from datetime import datetime
from crawler import config
class Database(object):
... |
<<<<<<< HEAD
<<<<<<< HEAD
#!K:\ArcherVMPeridot\htdocs\Scripts\python.exe
# $Id: rstpep2html.py 4564 2006-05-21 20:44:42Z wiemann $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
A minimal front end to the Docutils Publisher, producing HTML from PEP
(Pyt... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from numpy import pi, cos, sin, ravel, unravel_index
try:
from scipy.spatial import cKDTree
except ImportError:
print('The kdtree_fast method requires the scipy.spatial module.')
print('Ignore this warning when using the tunnel_fast method.')
__author__ = 'km... |
#!/usr/bin/env python3
# Copyright (c) 2016 The Zcash developers
# Copyright (c) 2020 The PIVX developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
from test_framework.test_framework import PivxTestFramework
from test_fram... |
#!/usr/bin/env python
import argparse
import sys
import MySQLdb
import pandas as pd
import twitter
def publish_to_twitter(df, prefix='MF', api=None, **kwargs):
if api is None:
api = twitter.Api(**kwargs)
msg = ' '.join(['$%s' % s for s in df.T.index])
msg = '%s: %s' % (prefix, msg)
if len(... |
#!/usr/bin/env python
import fiona
import numpy as np
import numpy.ma as ma
import rasterio
import rasterio.features
import rasterio.mask
import pandas as pd
import sys
import pdb
shp_file = '/Users/ricardog/src/eec/data/from-adriana/tropicalforests.shp'
shp_file = '/Users/ricardog/src/eec/predicts/playground/tmp/to... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
import os, sys
def iterDic(dic, pythonTwo):
"""
Return a python 2/3 compatible iterable
:param dic:
:param pythonTwo:
:return:
"""
if pythonTwo:
return dic.viewitems()
els... |
import os
import gtfs.models
import analysis.models
import numpy as np
from scipy import spatial
import shelve
try:
import matplotlib.pyplot as plt
except ImportError:
pass
import simplekml
import config
import itertools
import datetime
def enum(**enums):
return type('Enum', (), enums)
def get_XY_pos(rela... |
""" A computing element class that attempts to use glexec if available then
defaults to the standard InProcess Computing Element behaviour.
"""
__RCSID__ = "$Id$"
import os
import stat
import distutils.spawn
import DIRAC
from DIRAC import S_OK, S_ERROR
from DIRA... |
from distutils.core import setup
from setuptools import find_packages
if __name__ == '__main__':
setup(
name = "gnegar",
version = "0.1.1",
author = "Ramin Najjarbashi",
author_email = "Ramin.Najarbashi@gmail.com",
#packages = find_packages() + ['lib'],
package_di... |
import sys
if sys.version_info[0] == 2:
from PyQt4.QtCore import Qt
else:
from PyQt5.QtCore import Qt
from ert_gui.ide.wizards import TreeItem, TreeModel
from tests import ErtTest
class TreeStructureTest(ErtTest):
def test_tree_item(self):
root = TreeItem("Root")
self.assertIsNone(root.p... |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
""" OpenERP core library."""
#----------------------------------------------------------
# Running mode flags (gevent, prefork)
#----------------------------------------------------------
# Is the server running with ge... |
# -*- coding: utf-8 -*-
import re
from django.core.validators import validate_email
from django.core.exceptions import ValidationError
class MinValue(object):
"""
最小长度验证
"""
def __init__(self, name, length):
self.name = name
self.length = length
def __call__(self, value, *args, ... |
import api
import utils
import xbmc
from storage import storage
class PlaySong:
def __init__(self):
self.api = api.Api()
def play(self, params):
song_id = params.pop('song_id')
if song_id[0] == 't': song_id = song_id.capitalize()
params = self.__getSongStreamUrl(song_id, par... |
# Data preprocessor for speech recognition
# Arguably the most important part of our infrastructure
# WARNING -- Disgustingly long class
# (c) Adrian deWynter, 2017, where applicable
from __future__ import print_function
from six.moves import urllib,xrange
from random import shuffle
from enum import Enum
import os,re... |
# Classify partited data
# sentences description type(desc_type):action(0), speech(1), description(2)
# Character Personality type(personality):
# [impulsive(1)/calm(0),Extrovert(1)/Introvert(0),
# Optimistic(1)/pessimistic(0)]
import glob
import json
import io
# Data Structures
# {word:[probability of 3 ... |
#! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
from waflib import TaskGen,Task,Utils
from waflib.Tools import c_preproc
from waflib.Tools.ccroot import link_task,stlink_task
@TaskGen.extension('.cpp','.cc','.cxx','.C','.c++')
def cxx_hook(self,no... |
import os
from whoosh.qparser import MultifieldParser
from whoosh import scoring
from .whoosh_multi_field_spelling_correction import MultiFieldQueryCorrector
import pagination_helper
def index_directory_path(base_path, zim_name):
"""Returns the directory where a ZIM file's index should be located, given
a ba... |
import prefix
import types
import json
#import pprint
from graphviz import Digraph
from SPARQLWrapper import SPARQLWrapper, XML, N3, JSONLD, JSON, POST, GET, SELECT, CONSTRUCT, ASK, DESCRIBE
from SPARQLWrapper.Wrapper import _SPARQL_DEFAULT, _SPARQL_XML, _SPARQL_JSON, _SPARQL_POSSIBLE, _RDF_XML, _RDF_N3, _RDF_JSONLD,... |
##############################################################################
# For copyright and license notices, see __manifest__.py file in module root
# directory
##############################################################################
from odoo import models, fields, api, _
from odoo.exceptions import Valid... |
#!/usr/bin/env python
#============================================================================
# P Y I B E X
# File : test_Separators.cpp
# Author : Benoit Desrochers
# Copyright : Benoit Desrochersss
# License : See the LICENSE file
# Created : Dec 28, 2014
#==... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# aiodjango documentation build configuration file, created by
# sphinx-quickstart on Tue Dec 22 08:33:47 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# ... |
# -*- coding: utf-8 -*-
# Copyright 2014 Camptocamp SA - Yannick Vaucher
# Copyright 2017 Eficent Business and IT Consulting Services S.L.
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo.tests.common import TransactionCase
class TestSaleIsDelivered(TransactionCase):
"""Check the _g... |
# This function uses the dynamic programming concept, where it stores previously computed values rather
# computing it every time like in normal recursion.
import time
# This version of fibonacci uses dynamic programming concept.
# First check the normal fibonacci.py for better understanding
def fibo_dp(n: int): # ... |
import paddle.fluid as fluid
def loss(x, y, clip_value=10.0):
"""Calculate the sigmoid cross entropy with logits for input(x).
Args:
x: Variable with shape with shape [batch, dim]
y: Input label
Returns:
loss: cross entropy
logits: prediction
"""
logits = fluid.l... |
# -*- coding: utf-8 -*-
import numpy as np
import re
import sys
import theano
import theano.tensor as T
from nltk import corpus
from sklearn.metrics import accuracy_score, classification_report
from sklearn.cross_validation import train_test_split
from sklearn.datasets import fetch_20newsgroups
from sklearn.feature_e... |
from datetime import date, timedelta, datetime
import os
from django.db import models
from django.db.models.signals import pre_save, post_save
from django.contrib.auth.models import User
from django.conf import settings
from managers import JSDependencyManager, JSLibraryManager, PastieManager, ShellManager
def ne... |
from geopytool.ImportDependence import *
from geopytool.CustomClass import *
class Clastic(AppForm, Tool):
_df = pd.DataFrame()
_changed = False
xlabel = r''
ylabel = r''
Tags = []
Label = [u'Clay', u'Sand', u'Silt']
LabelPosition = [(45, 50 * np.sqrt(3) + 2),
(-1... |
# Copyright 2015 The TensorFlow 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 applica... |
'''
common XBMC Module
Copyright (C) 2011 t0mm0
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 Software Foundation, either version 3 of the License, or
(at your option) any later version.
Th... |
# -*- coding: utf-8 -*-
import time
import uuid
import StringIO
from PIL import Image
from selenium.webdriver.common.action_chains import ActionChains
class BaseGeetestCrack(object):
"""验证码破解基础类"""
def __init__(self, driver):
self.driver = driver
self.driver.maximize_window()
def inpu... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import Queue
import threading
import time
import zmq
class ZMQPublisher(object):
def __init__(self):
self._worker_thread = threading.Thread(target=self._run)
self._do_work = threading.Event()
self._queue = Queue.Queue()
def start(self):
... |
# Copyright 2019 Sergio Teruel <sergio.teruel@tecnativa.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import fields, models
class WizStockBarcodesNewLot(models.TransientModel):
_inherit = 'barcodes.barcode_events_mixin'
_name = 'wiz.stock.barcodes.new.lot'
_descriptio... |
# -*- coding: utf-8 -*-
"""
***************************************************************************
edgebundlingProviderPlugin.py
---------------------
Date : January 2018
Copyright : (C) 2018 by Anita Graser
Email : anitagraser@gmx.at
*****************... |
"""
Test the various password reset flows
"""
import json
import re
import unicodedata
import unittest
import ddt
from django.conf import settings
from django.contrib.auth.hashers import UNUSABLE_PASSWORD_PREFIX, make_password
from django.contrib.auth.models import AnonymousUser, User
from django.contrib.auth.tokens... |
"""Compile samples that are infeasible or difficult by svg compilation.
"""
import datetime
from pathlib import Path
from fontTools import fontBuilder
from fontTools import ttLib
from fontTools.colorLib import builder as colorBuilder
from fontTools.pens.ttGlyphPen import TTGlyphPen
from fontTools.ttLib.tables._g_l_y_f... |
# -*- coding: utf-8 -*-
#KeySchedule
from Rijndael.SubBytes import *
from Rijndael.Tables import RijndaelRcon
import math
def RotWord(Spalte):
#Verschiebe die Plaetze im Array
output = list()
output.append(Spalte[1])
output.append(Spalte[2])
output.append(Spalte[3])
output.append(Spalte[0])
... |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import division, unicode_literals, print_function
<<<<<<< HEAD
"""
Module implementing classes and functions to use Zeo++.
Zeo++ can be obtained from http://www.maciejharanczyk.info/Zeopp/
"""
... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.contrib.postgres.fields
class Migration(migrations.Migration):
dependencies = [
('api', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Clie... |
"""Algorithms for computing symbolic roots of polynomials. """
from sympy.core.symbol import Dummy
from sympy.core.add import Add
from sympy.core.mul import Mul
from sympy.core import S, I, Basic
from sympy.core.sympify import sympify
from sympy.core.numbers import Rational, igcd
from sympy.ntheory import divisors, i... |
#------------------------------------------------------------------------------#
# Copyright 2016-2017 Golden Sierra Game Development Class #
# This file is part of Verloren (GSHS_RPG). #
# ... |
"""pygame module for loading and rendering fonts (freetype alternative)"""
__all__ = ['Font', 'init', 'quit', 'get_default_font', 'get_init', 'SysFont']
from pygame._freetype import init, Font as _Font, get_default_resolution
from pygame._freetype import quit, get_default_font, get_init as _get_init
from pygame._free... |
"""
Copyright (C) 2014, 申瑞珉 (Ruimin Shen)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed i... |
from searx import settings, autocomplete
from searx.languages import language_codes as languages
COOKIE_MAX_AGE = 60 * 60 * 24 * 365 * 5 # 5 years
LANGUAGE_CODES = [l[0] for l in languages]
LANGUAGE_CODES.append('all')
DISABLED = 0
ENABLED = 1
class MissingArgumentException(Exception):
pass
class ValidationE... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
'''
Copyright © 2016 Daniel Müllner <http://danifold.net>
All changes from 2017-12-27 on: Copyright © Google Inc. <http://google.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License ... |
'''merge_doi_maps.py
Copyright 2018 Garth Griffin
Distributed under the GNU GPL v3. For full terms see the file LICENSE.
This file is part of PetitionsDataverse.
PetitionsDataverse 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 So... |
from . import integ_test_base
class TestDeployAndEvaluateModelAuthOn(integ_test_base.IntegTestBase):
def _get_config_file_name(self) -> str:
return "./tests/integration/resources/deploy_and_evaluate_model_auth.conf"
def _get_port(self) -> str:
return "9009"
def test_deploy_and_evaluate_m... |
# -*- coding: utf-8 -*-
from django.db.models import get_model
from django.http import HttpResponseRedirect, HttpResponseForbidden
from django.shortcuts import render_to_response
from django.template.context import RequestContext
from django.template.defaultfilters import mark_safe
from django.utils.translation import... |
from __future__ import print_function
import string
from matplotlib import inspect
class FormatDict(dict):
"""Adapted from http://stackoverflow.com/questions/11283961/partial-string-formatting"""
def __missing__(self, key):
return "{" + key + "}"
class DocReplacer(object):
"""Decorator object... |
# Copyright 2012 OpenStack Foundation
#
# 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 ... |
# python3
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# python3
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"... |
import datetime
from django.test import TestCase
from django.test.client import Client
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django_messages.models import Message
from django_messages.utils import format_subject, format_quote
class SendTestCase(TestCase):
de... |
# The MIT License (MIT)
#
# Copyright (c) 2016 Maciej Borzecki
#
# 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, m... |
import copy
from docker.errors import create_unexpected_kwargs_error
from docker.types import TaskTemplate, ContainerSpec
from .resource import Model, Collection
class Service(Model):
"""A service."""
id_attribute = 'ID'
@property
def name(self):
"""The service's name."""
return self.... |
from django.utils.translation import ugettext_noop
from corehq.apps.products.models import Product, SQLProduct
from corehq.apps.programs.models import Program
from corehq.apps.reports.filters.base import BaseDrilldownOptionFilter, BaseSingleOptionFilter
from corehq.apps.reports.filters.fixtures import AsyncLocationFilt... |
# Copyright 2017 The TensorFlow 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 applica... |
__author__ = 'Marco De Nadai'
__license__ = "MIT"
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import math
import datetime
import csv
from collections import namedtuple
from collections import defaultdict
import fiona
from shapely.geometry import shape, Polygon
# Import the CDRs of MILANO
d... |
# coding=gbk
'''
Created on 2014-3-27
@author: Hali
'''
import sys
import os
import Image
from PlistParser import Frame
def printUsage():
print "Usage: ImageUtils.py [-s input=srcImgPath outSize=[(width,heigh)|(x,y,width,heigt)] outPath=outPath]"
print " [-c input=srcImgPath srcRect=(x,y,... |
# -*- coding: utf-8 -*-
from tests.functional_tests import isolate, run_tuttle_file
from cStringIO import StringIO
from tuttle.log_follower import LogTracer, LogsFollower
import logging
import sys
class CaptureOutputs(object):
"""
Captures stdin and stdout
"""
def __init__(self):
self._oldout... |
# -*- coding: utf-8 -*-
from zerver.lib.test_classes import WebhookTestCase
class GrooveHookTests(WebhookTestCase):
STREAM_NAME = 'groove'
URL_TEMPLATE = '/api/v1/external/groove?stream={stream}&api_key={api_key}'
FIXTURE_DIR_NAME = 'groove'
# This test simulates the condition when a new ticket comes... |
# Authors:
# Jason Gerard DeRose <jderose@redhat.com>
#
# Copyright (C) 2008 Red Hat
# see file 'COPYING' for use and warranty information
#
# 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 Software Foundation, ei... |
""" Cisco_IOS_XR_drivers_media_eth_oper
This module contains a collection of YANG definitions
for Cisco IOS\-XR drivers\-media\-eth package operational data.
This module contains definitions
for the following management objects\:
ethernet\-interface\: Ethernet operational data
Copyright (c) 2013\-2015 by Cisco Sy... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""Tests for the RAW storage media image path specification implementation."""
import unittest
from dfvfs.path import raw_path_spec
from tests.path import test_lib
class RawPathSpecTest(test_lib.PathSpecTestCase):
"""Tests for the RAW storage media image path specificati... |
# Generated by Django 2.0.2 on 2018-07-06 00:47
from django.db import migrations, models
import news.models
import wagtail.core.blocks
import wagtail.core.fields
import wagtail.documents.blocks
import wagtail.embeds.blocks
import wagtail.images.blocks
class Migration(migrations.Migration):
dependencies = [
... |
from __future__ import annotations
from typing import TypeVar, Union
from uuid import UUID
from coaster.sqlalchemy import Query
from . import db
__all__ = ['ReorderMixin']
# Use of TypeVar for subclasses of ReorderMixin as defined in this mypy ticket:
# https://github.com/python/mypy/issues/1212
Reorderable = Typ... |
# 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 ... |
from __future__ import absolute_import
from logging import warning
import dramatis
from dramatis.actor.name import Name as _Name
from dramatis import Runtime
import dramatis.runtime as runtime
from dramatis.actor.interface import Interface as _Interface
class Metaclass(type):
def __init__(cls,name,bases,dic... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.