content string |
|---|
#!/usr/bin/env python
#
# Test cases for tournament.py
from tournament_extra import *
import os
def clearScreen():
os.system('cls' if os.name == 'nt' else 'clear')
def testDeleteTournaments():
deleteMatches()
print "1. Tournaments can be deleted."
def testDeleteMatches():
deleteMatches()
prin... |
import datetime
import errno
import os
import os.path
import re
import subprocess
import sys
import time
def mkdir_p(directory):
"""Make the directory, and all its ancestors as required. Any of the
directories are allowed to already exist."""
if directory == "":
# We're being asked to make the c... |
from optparse import make_option
import os
from django.core.management.base import CommandError
from django.core.management.templates import TemplateCommand
from django.utils.importlib import import_module
import horizon
class Command(TemplateCommand):
template = os.path.join(horizon.__path__[0], "conf", "dash_... |
#!/usr/bin/python
#coding=utf-8
import unittest
import redis
from multiprocessing import Pool
import os, time, random, sys
class RedisPool:
def Redis_Pool(self,ClientHost="localhost",ClientPort=sys.argv[1],ClientDb=0):
pool=redis.ConnectionPool(host=ClientHost,port=ClientPort,db=ClientDb)
return re... |
# -*- coding: utf-8 -*-
"""
Created on Mon Sep 12 10:51:18 2016
Modified on Sun Sep 18 08:42:55 2016
@author: Fausto Biazzi de Sousa
programa = "Cético"
versão = "Alpha 0.0.0.5"
"""
import shutil
import platform
import os
from thirdparty.illuminants.sourcecode.extractGGEMaps import extractNewGrayWorldMaps
from thirdp... |
"""This plugin allows rules to contain regular expression tags."""
import re
import oa.errors
import oa.plugins.base
from oa.regex import Regex
# This splits value in the corresponding tags
SPLIT_TAGS = Regex(r"(<[^<>]+>)")
class ReplaceTags(oa.plugins.base.BasePlugin):
"""Replace tags in various rules."""
... |
import argparse
import scraperwiki
import lxml.etree
import re
import pprint
import json
import string
class InterestScraper(object):
def __init__(self, args):
self.input = args.input
self.output = args.output
self.year = args.year
self.source = args.source
def strip_bold(self... |
#!/usr/bin/python
import os
import logging
import logging.handlers
import ConfigParser
from datetime import datetime
from flask import Flask
from flask import send_from_directory, request, redirect, make_response
from service.security.api_auth import auth_required, AuthStore
# This method is patch of datetime JSON se... |
"""
.. todo::
WRITEME
"""
import theano
T = theano.tensor
def identity(x):
"""
.. todo::
WRITEME properly
Importable identity function. Created for the purposes of pickling.
"""
return x
def relu(x):
"""
.. todo::
WRITEME properly
Rectified linear activation
... |
#!/usr/bin/env python
#####################################################################
# This script presents how to run deterministic episodes by setting
# seed. After setting the seed every episode will look the same (if
# agent will behave deterministicly of course).
# Configuration is loaded from "../../examp... |
import unittest
from unittest import mock
from mantidqt.widgets.workspacecalculator.presenter import WorkspaceCalculator
from qtpy.QtCore import Qt
from qtpy.QtTest import QTest
from mantidqt.utils.qt.testing import start_qapplication
from mantid.simpleapi import CreateSingleValuedWorkspace
@start_qapplication
class... |
import cPickle
import numpy
from pylearn.algorithms.mcRBM import mcRBM, mcRBMTrainer
from pylearn.dataset_ops import image_patches
import pylearn.datasets.cifar10
import theano
from theano import tensor
def l2(X):
return numpy.sqrt((X ** 2).sum())
def _default_rbm_alloc(n_I, n_K=256, n_J=100):
return mcR... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Tests for the MRUList Windows Registry plugin."""
import unittest
from dfdatetime import filetime as dfdatetime_filetime
from dfwinreg import definitions as dfwinreg_definitions
from dfwinreg import fake as dfwinreg_fake
from plaso.parsers.winreg_plugins import mruli... |
import unittest
from conans.test.tools import TestClient
from conans.model.ref import ConanFileReference, PackageReference
import os
from conans.paths import CONANFILE
from conans.util.files import save
class PackageCommandTest(unittest.TestCase):
def package_errors_test(self):
client = TestClient()
... |
from unittest import mock
from distributed.protocol.serialize import serialize
from django.core.exceptions import ValidationError
from tethys_sdk.testing import TethysTestCase
from tethys_compute.models.dask.dask_field import DaskSerializedField
class DaskSerializedFieldTests(TethysTestCase):
def set_up(self):
... |
import urllib
import urllib2
import cookielib
import re
#bugurl = r"https://bugzilla.kernel.org/show_bug.cgi?id=%d"
#fixedurl = r'https://bugzilla.kernel.org/show_activity.cgi?id=%d'
bugurl = r'https://bz.apache.org/bugzilla/show_bug.cgi?id=%d'
fixedurl = r'https://bz.apache.org/bugzilla/show_activity.cgi?id=%d'
titl... |
import testtools
import uuid
from openstack.network.v2 import qos_dscp_marking_rule
EXAMPLE = {
'id': 'IDENTIFIER',
'qos_policy_id': 'qos-policy-' + uuid.uuid4().hex,
'dscp_mark': 40,
}
class TestQoSDSCPMarkingRule(testtools.TestCase):
def test_basic(self):
sot = qos_dscp_marking_rule.QoSDS... |
import pytest
from django.urls import reverse
from config.models import SiteConfig
from config.utils import get_active_event
from tests.factories import TicketFactory, PaperApplicationFactory, EventFactory, CallForPaperFactory
from voting.models import CommunityVote
def enable_voting():
config = SiteConfig.load... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Simple fanfiction retrieval tool
Useful for generating personal archives or preparing fics to be converted to
ePub/BeBB/OEB/PDF/lit/MobiPocket/etc. for your portable eBook reader.
Features:
- Autodetects story metadata. Requires only the URL for input.
- Strips site ... |
import time
import os
import sys
import hashlib
import gc
import shutil
import platform
import errno
import logging
try:
import cPickle as pickle
except:
import pickle
from parso._compatibility import FileNotFoundError
LOG = logging.getLogger(__name__)
_PICKLE_VERSION = 31
"""
Version number (integer) for ... |
# -*- coding: utf-8 -*-
"""
Modulo di gestione del forum.
"""
#http://docs.python.org/library/sqlite3.html
#http://www.vbulletin.it/forum.php?s=472ca7c8ddfd23457d7ff51b6cd06c32
#immagine avatar: 180 * 260 * 15kb direi che potrebbe andare bene
#= IMPORT ===============================================================... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from numpy.testing import assert_allclose
import abel
# Curve A, Table 2, Fig 3. Abel transform pair Hansen&Law JOSA A2 510 (1985)
def f(r):
return 1-2*r**2 if np.all(r) <= 0.5 else 2*... |
"""
CA installer module
"""
from __future__ import print_function
import enum
import logging
import os.path
import six
from ipalib.constants import IPA_CA_CN
from ipalib.install import certstore
from ipalib.install.service import enroll_only, master_install_only, replica_install_only
from ipaserver.install import s... |
import torch
import torch.nn as nn
import numpy as np
class TransformerNet(torch.nn.Module):
def __init__(self):
super(TransformerNet, self).__init__()
# Initial convolution layers
self.conv1 = ConvLayer(3, 32, kernel_size=9, stride=1)
self.in1 = InstanceNormalization(32)
... |
# coding=utf-8
"""
Copyright 2012 Ali Ok (aliokATapacheDOTorg)
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 ... |
import socket
import string
import os, sys
import logging, coloredlogs
from threading import Thread
from random import choice
from time import sleep
from modules.commandmanager import CommandManager
from modules.command import Command
from modules.timer import Timer
from modules.config import *
from modules.commandtex... |
from aquilon.worker.broker import BrokerCommand # pylint: disable=W0611
from aquilon.worker.commands.bind_feature import CommandBindFeature
from aquilon.aqdb.model import FeatureLink
from aquilon.worker.dbwrappers.parameter import del_all_feature_parameter
class CommandUnBindFeature(CommandBindFeature):
require... |
"""Implementation of compile_html for IRC logs."""
from __future__ import unicode_literals
import os
import io
import re
import pygments
import pygments.lexers
from nikola.plugin_categories import PageCompiler
from nikola.utils import makedirs, NikolaPygmentsHTML
lexer = pygments.lexers.get_lexer_by_name('irc')
c... |
#!/usr/bin/env python3
from setuptools import setup
setup(
name='todoman',
description='A simple CalDav-based todo manager.',
author='Hugo Osvaldo Barrera',
author_email='<EMAIL>',
url='https://github.com/pimutils/todoman',
license='MIT',
packages=['todoman'],
include_package_data=True... |
""" Test refcounting and behavior of SCXX.
"""
import sys
from numpy.testing import *
from scipy.weave import inline_tools
class TestDictConstruct(TestCase):
#------------------------------------------------------------------------
# Check that construction from basic types is allowed and have correct
... |
"""
Diofant statistics module
Introduces a random variable type into the Diofant language.
Random variables may be declared using prebuilt functions such as
Normal, Exponential, Coin, Die, etc... or built with functions like FiniteRV.
Queries on random expressions can be made using the functions
==================... |
# flake8: noqa
import os
import subprocess
import tempfile
import aiohttp.web
import repour.repo
class TemporaryGitDirectory(tempfile.TemporaryDirectory):
def __init__(self, bare=False, origin=None, ro_url=None, ref=None):
super().__init__()
self.bare = bare
self.origin = origin
s... |
# 811. Subdomain Visit Count
# Easy
#
# Share
# A website domain like "discuss.leetcode.com" consists of various subdomains. At the top level, we have "com", at the next level, we have "leetcode.com", and at the lowest level, "discuss.leetcode.com". When we visit a domain like "discuss.leetcode.com", we will also visi... |
# -*- coding: utf-8 -*-
"""
***************************************************************************
help.py
---------------------
Date : March 2013
Copyright : (C) 2013 by Victor Olaya
Email : volayaf at gmail dot com
***********************************... |
"""Tools for importing X-ray microscopy frames in formats produced by
Xradia instruments."""
import datetime as dt
from collections import namedtuple
import struct
import os
import re
import warnings
import olefile
import numpy as np
import pytz
import exceptions
from utilities import shape, Pixel
# Some of the by... |
"""
Django settings for orea project.
Generated by 'django-admin startproject' using Django 1.8.3.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build paths i... |
import re
import os.path
from io import open
from setuptools import find_packages, setup
# Change the PACKAGE_NAME only to change folder and different name
PACKAGE_NAME = "azure-mgmt-healthbot"
PACKAGE_PPRINT_NAME = "Health Bot Management"
# a-b-c => a/b/c
package_folder_path = PACKAGE_NAME.replace('-', '/')
# a-b-c ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
import os
import sys
from setuptools import setup
name = 'drf-jsonapi'
package = 'rest_framework_jsonapi'
description = 'Django Rest Framework tools which are compliant with ' \
'the JSONAPI 1.0 specification'
url = 'https://github.com/Naeka/django... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import backend
import re
class PyBackend(backend.Backend):
"""This is the backend class to deal with python files."""
def get_blocksequence_of_xpath(self, file_content_list, xpath):
""" Returns (int, list of strings)
Get the block sequence of the... |
"""Scripting utilities.
_____ _ _____ _____ _____
| | |___| | | | __|
| | . | | | | | | |__ |
|__|__|___|_|_|_|_|_____|_____|
In order to provide a flexible and versatile method to analyze images, the
HoloView applications makes use of the python language itself to let the user
choose what ha... |
"""Implements `Cross` Layer, the cross layer in Deep & Cross Network (DCN)."""
from typing import Union, Text, Optional
import tensorflow as tf
@tf.keras.utils.register_keras_serializable()
class Cross(tf.keras.layers.Layer):
"""Cross Layer in Deep & Cross Network to learn explicit feature interactions.
A la... |
import os
import sys
import warnings
from itertools import chain
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
wlauto_dir = os.path.join(os.path.dirname(__file__), 'wlauto')
sys.path.insert(0, os.path.join(wlauto_dir, 'core'))
from version import get_wa_version
# ha... |
from msrest.serialization import Model
class EffectiveNetworkSecurityRule(Model):
"""Effective network security rules.
:param name: The name of the security rule specified by the user (if
created by the user).
:type name: str
:param protocol: The network protocol this rule applies to. Possible
... |
import json
from django.contrib.sites.models import Site
from django.core.exceptions import ValidationError, PermissionDenied
from django.core.urlresolvers import reverse
from django.core.validators import validate_email
from django.http import HttpResponse
from django.template.context import RequestContext
from django... |
from haystack import indexes
from django.conf import settings
from oscar.core.loading import get_model, get_class
# Load default strategy (without a user/request)
Selector = get_class('partner.strategy', 'Selector')
strategy = Selector().strategy()
class ProductIndex(indexes.SearchIndex, indexes.Indexable):
# S... |
import unittest
import sys
import string
import random
import urllib
from ..restconfListInstance import RestconfListInstance
class RestconfListInstanceTest(unittest.TestCase):
"""
Process the list-instance portion of an api-identifier where:
list-instance = api-identifier "=" key-value ["," key-value... |
import attr
from base.ddd.utils.business_validator import BusinessValidator
from base.models.enums.quadrimesters import DerogationQuadrimester
from ddd.logic.learning_unit.domain.validator.exceptions import DerogationQuadrimesterInvalidChoiceException
MINIMUM_VALUE = 1
@attr.s(frozen=True, slots=True)
class ShouldD... |
"""Invenio-Accounts utility functions for tests and testing purposes.
.. warning:: DO NOT USE IN A PRODUCTION ENVIRONMENT.
Functions within accessing the datastore will throw an error if called outside
of an application context. If pytest-flask is installed you don't have to worry
about this.
"""
from __future__ imp... |
# -*- coding: utf-8 -*-
u"""
Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U.
This file is part of Toolium.
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/lic... |
from django.db import models
from django.utils.translation import gettext_lazy as _
from django.utils import timezone
from django.core.exceptions import ValidationError
from danceschool.core.models import (
Customer, ClassDescription, DanceTypeLevel, DanceRole,
Registration, EventRegistration
)
class Require... |
"""The user Map fror the Image table."""
import sqlalchemy
from sqlalchemy import orm
from asciipic.db.oracle import base
class Image(base.META_BASE):
"""User Map for the Images table."""
__tablename__ = 'images'
# pylint:disable=invalid-name, bad-whitespace
id = sqlalchemy.Column(sqlalchemy.Integer,... |
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Unselected(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "barpolar"
_path_str = "barpolar.unselected"
_valid_props = {"marker", "textfont"}
#... |
'''
Created on 19.11.2015
@author: oliver
'''
from bayeos.cli import SimpleClient
import pandas as pd
from pytz import timezone
import datetime
class FrameClient(SimpleClient):
'''
A bayeos-server frame client
'''
def read_toa5(self,url,tz):
"""
Reads a campbell scien... |
import codecs
import re
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with codecs.open('holidays/__init__.py', 'r', 'utf-8') as fd:
version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]',
fd.read(), re.MULTILINE).group(1)
if not vers... |
import unittest as ut
import espressomd
import numpy as np
from espressomd.interactions import FeneBond
class ParticleProperties(ut.TestCase):
# Particle id to work on
pid = 17
# Error tolerance when comparing arrays/tuples...
tol = 1E-9
# Handle for espresso system
es = espressomd.System()... |
"""
This module provides classes and functions that can be used to calculate
the value and derivative of an equation, using standard Python notation.
It is used by the PyB Device.
Classes:
Variable -- Defines a variable used in an equation.
Result -- Result of an equation based on Variables
Functions:
These functions... |
"""
sentry.runner.commands.devserver
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2016 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import, print_function
import click
import six
from six.moves.urllib.parse import urlparse
from... |
"""This module is deprecated. Please use `airflow.operators.bigquery_to_bigquery`."""
import warnings
# pylint: disable=unused-import
from airflow.operators.bigquery_to_bigquery import BigQueryToBigQueryOperator # noqa
warnings.warn(
"This module is deprecated. Please use `airflow.operators.bigquery_to_bigquery... |
#
# Contain syntax and grammar specifications
#
import sys
import ast, tool.lex, tool.yacc
#------------------------------------------------
__start_line_no = 1
#------------------------------------------------
# reserved words
reserved = ['IF', 'ELSE', 'FOR', 'TRANSFORM']
tokens = reserved + [
# literals (id... |
import os.path
import cv2
import numpy as np
class DistanceMeter:
def __init__(self, filename='distance.dat'):
self._a=0
self._b=0
self._filename=filename
if(os.path.isfile(filename)):
with open(filename, 'r') as f:
self._a=float(f.readline())
self._b=float(f.readline())
def train(self, dist1=15... |
import numpy as np
from scipy.linalg import eigvals
from pyamg.gallery.laplacian import poisson, gauge_laplacian
from numpy.testing import TestCase, assert_equal, assert_almost_equal
class TestPoisson(TestCase):
def test_poisson(self):
cases = []
# 1D
cases.append(((1,), np.array([[2]]))... |
# -*- coding: utf-8 -*-
# @Date : Jan 25, 2013
# @Author : Ram Prakash, Sharath Puranik
# @Version : 1
import sys
import math
class CARTWord(object):
__slots__= ['word', 'focus', 'classID', 'count']
def __init__(self, w, f, cID=u'\u0000', freq=1):
self.word = w
self.focus = f... |
INTERNAL_SERVER_ERROR_CODE = 'internal_server_error'
class ManagerException(Exception):
def __init__(self, http_code, error_code, *args, **kwargs):
super(ManagerException, self).__init__(*args, **kwargs)
self.http_code = http_code
self.error_code = error_code
class InsufficientMemoryErro... |
import datetime
from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.models import Site
from django.urls import reverse
from django.utils import timezone
from django_comments.models import Comment
from openach.forms import EvidenceForm
from openach.models import (
URL_MAX_LENGTH,
... |
#-----------------------------------------------------------------------
# this file is part of the cx-oracle-demo package.
# http://code.google.com/p/cx-oracle-demos
#-----------------------------------------------------------------------
desc="""calling a stored procedure"""
setup="""
"""
cleanup="""
"""
notes=""... |
import functools
import itertools
import numpy as np
import operator
from ...tests.helper import pytest
from .. import (Time, TimeDelta, OperandTypeError, ScaleValueError,
TIME_SCALES, TIME_DELTA_SCALES)
from ... import units as u
allclose_jd = functools.partial(np.allclose, rtol=2. ** -52, atol=0)
al... |
'''
Entrena un MLP.
LLega al 98.49% de precision con 20 epocas
'''
from __future__ import print_function
import numpy as np
np.random.seed(1337) # Para volver a reproducirlo
from keras.datasets import mnist
from keras.models import Sequential
from keras.layers.core import Dense, Dropout, Activation
from keras.opti... |
"""
Fox IMU attitude computation
"""
import sys
import os
import argparse
import numpy as np
import sensbiotk.calib.calib as calib
from sensbiotk.algorithms import martin_ahrs
from sensbiotk.algorithms.basic import find_static_periods
from sensbiotk.io.iofox import load_foxcsvfile
from sensbiotk.io.ahrs import save_ahr... |
"""
==========================
Display images for MEG
==========================
"""
import numpy as np
from expyfun import visual, ExperimentController
from expyfun.io import write_hdf5
import time
from PIL import Image
import os
from os import path as op
import glob
# background color
testing = False
test_trig = [15... |
import six
from restalchemy.dm import models
from restalchemy.dm import properties
from restalchemy.dm import relationships
from restalchemy.dm import types
from restalchemy.storage.sql import engines
from restalchemy.storage.sql import filters
from restalchemy.storage.sql import orm
# CREATE TABLE `foos` (
# `... |
# Ben Jones
# Fall 2013
# HTPT Pluggable Transport
import unittest
from htpt import constants
from htpt import frame
class TestFrame(unittest.TestCase):
"""Test the validity of the framing module in htpt"""
def setUp(self):
self.callback= self.recvData
self.frame = frame.Framer(self.callback)
self.u... |
from util.matrix import Matrix
from math import cos, sin
def translation(x, y):
return Matrix([
[1, 0, x],
[0, 1, y],
[0, 0, 1]
])
def rotation(phi, psi=None):
if psi is None:
c = cos(phi)
s = sin(phi)
return Matrix([
[c, -s, 0],
[s... |
from __future__ import unicode_literals
import os
import shutil
import sys
import tempfile
import unittest
from django.conf import settings
from django.contrib.staticfiles import finders, storage
from django.contrib.staticfiles.management.commands import collectstatic
from django.contrib.staticfiles.management.comman... |
# MP2 - Driver
# Brian T. Bailey
import planets.planet_utils
# Parse Planet Data Files into Planet Objects, Store in SolarSystem Dictionary
datalist = ['data/mercury.txt', 'data/venus.txt', 'data/earth.txt',
'data/mars.txt', 'data/jupiter.txt', 'data/saturn.txt',
'data/uranus.txt', 'data/nep... |
from scipy.stats import randint
import matplotlib.pyplot as plt
fig, ax = plt.subplots(1, 1)
# Calculate a few first moments:
low, high = 7, 31
mean, var, skew, kurt = randint.stats(low, high, moments='mvsk')
# Display the probability mass function (``pmf``):
x = np.arange(randint.ppf(0.01, low, high),
... |
"""Tests for ORCID library."""
import simplejson as json
import pytest
import re
from orcid import MemberAPI, PublicAPI
from .helpers import httpretty
from .helpers import body_all, body_none, body_single_work
from .helpers import authorization_code, search_result
from .helpers import token_json, token_response
WORK... |
from util import dlinkedlist
class Playable:
"""
A Playable is a message and a player
The player must be able to send the message of the event
"""
def __init__(self,mess,player):
self.mess=mess
self.player=player
def fire(self,beat):
self.player.play(self.m... |
from django.conf import settings
from django.db import models
from django.db.models import ForeignKey
from wagtail.contrib.settings.models import BaseSetting, register_setting
from wagtail.admin.edit_handlers import FieldPanel, StreamFieldPanel
from wagtail.core.fields import StreamField
from wagtail.core.models import... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
#
# Tests for conversion of hgvs tags
#
import os
import unittest
import hgvs.variantmapper as variantmapper
import hgvs.parser
import framework.mock_input_source as mock_input_data_source
class TestHgvsCToP(u... |
from datetime import datetime
import random
from pprint import pformat
from dream.plugins import plugin
from dream.plugins.TimeSupport import TimeSupportMixin
import datetime
from copy import copy
'''outputs the Operator Schedules in tabular format'''
class JSOperatorTabSchedule(plugin.OutputPreparationPlugin, TimeSu... |
from __future__ import unicode_literals
from sqlalchemy import DDL
from sqlalchemy.dialects.postgresql import ARRAY
from sqlalchemy.event import listens_for
from sqlalchemy.ext.declarative import declared_attr
from sqlalchemy.orm import mapper
from sqlalchemy.orm.base import NEVER_SET, NO_VALUE
from indico.core.db im... |
"""gcloud dns record-sets command group."""
from googlecloudsdk.calliope import base
class RecordSets(base.Group):
"""Manage the record-sets within your managed-zones."""
detailed_help = {
'DESCRIPTION': '{description}',
'EXAMPLES': """\
To import record-sets from a BIND zone file, run:
... |
import logging
try:
import wx
if wx.VERSION < (4,):
raise ImportError()
except:
logging.error(_("WX >= 4 is not installed. This program requires WX >= 4 to run."))
raise
from printrun.utils import install_locale
install_locale('pronterface')
from .controls import ControlsSizer, add_extra_cont... |
import json
from urllib import parse
from typing import Any, Dict, List # noqa
from tests import fake_servers
class FakeSnapdRequestHandler(fake_servers.BaseHTTPRequestHandler):
snaps_result = [] # type: List[Dict[str, Any]]
snap_details_func = None
find_result = [] # type: List[Dict[str, Any]]
f... |
"""Implementation of gcloud dataflow jobs show command.
"""
from googlecloudsdk.calliope import base
from googlecloudsdk.dataflow import commands
from googlecloudsdk.dataflow.lib import job_display
from googlecloudsdk.dataflow.lib import job_utils
from googlecloudsdk.dataflow.lib import step_json
class Show(base.Com... |
from __future__ import division
import numpy as np
from pySDC.Problem import ptype
from pySDC.datatype_classes.particles import particles, fields, acceleration
class planewave_single(ptype):
"""
Example implementing a single particle in a penning trap
Attributes:
nparts: number of particles (need... |
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import float_or_none
class SpiegeltvIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?spiegel\.tv/(?:#/)?filme/(?P<id>[\-a-z0-9]+)'
_TESTS = [{
'url': 'http://www.spiegel.tv/filme/flug-mh370/',
... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Billing',
fields=[
('id', models.AutoField(verb... |
from . import ras41
class ControllerDeprecated(object):
"""Methods present in RAS500 but not in next version."""
pass
class ControllerAdded(object):
"""Methods present in RAS500 but not in RAS410."""
def Compute_Complete(self):
"""
Returns a True value once computations have complet... |
"""
Tests for Course Blocks serializers
"""
from mock import MagicMock
from openedx.core.djangoapps.content.block_structure.transformers import BlockStructureTransformers
from student.tests.factories import UserFactory
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.tests.django_utils import S... |
"""
Copyright (c) 2015-2020 Raj Patel(<EMAIL>), StopStalk
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, c... |
<<<<<<< HEAD
<<<<<<< HEAD
"""Do a minimal test of all the modules that aren't otherwise tested."""
import importlib
import sys
from test import support
import unittest
class TestUntestedModules(unittest.TestCase):
def test_untested_modules_can_be_imported(self):
untested = ('bdb', 'encodings', 'formatter',... |
import os
import math
from rootpy.plotting import Hist, Hist2D
from rootpy.io import root_open
from rootpy.stats import histfactory
from rootpy.utils.path import mkdir_p
from statstools.histfactory import (
to_uniform_binning, apply_remove_window, is_signal)
from . import log; log = log[__name__]
from . import C... |
import os.path
from nova.api.openstack import common
from nova import utils
class ViewBuilder(common.ViewBuilder):
_collection_name = "images"
def basic(self, request, image):
"""Return a dictionary with basic image attributes."""
return {
"image": {
"id": image.... |
from .gui import ElectrumGui |
from .utils import Point, Singleton
from six import add_metaclass
ENTITIES_IDS = {
0: "void",
1: "spark",
2: "arrowup",
3: "arrowdown",
4: "arrowright",
5: "arrowleft",
6: "livingcell",
7: "deadcell",
8: "monoone",
9: "monozero"
}
ENTITIES_NAMES = dict([(value, key) for key, va... |
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import fnmatch
import glob
import importlib
import inspect
import logging
import operator
import os
import sys
import traceback
import libdnf
import dnf.logging
import dnf.pycomp
import dnf.util
from d... |
"""Record general information."""
# pylint: disable=C0301
from apiary.tasks import BaseApiaryTask
import requests
import logging
LOGGER = logging.getLogger()
class RecordGeneralTask(BaseApiaryTask):
def run(self, site_id, sitename, api_url):
LOGGER.info("Retrieve record_general for %d" % site_id)
... |
"""
Unit tests for ErrorParser.
Part of Hvergelmir, a tree based Valgrind output viewer - https://github.com/ibbles/Hvergelmir
See LICENSE for licensing information.
"""
import sys
sys.path.append("../../source")
from operations.ErrorParser import ErrorParser
valgrindLogFileName = "../valgrind.errors"
try:
with... |
from __future__ import absolute_import
from __future__ import print_function
from .BlockScan import BlockScan
from amitools.fs.FSString import FSString
from amitools.fs.FileName import FileName
from amitools.fs.validate.Log import Log
import amitools.fs.DosType as DosType
class FileData:
def __init__(self, bi):
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.