content stringlengths 4 20k |
|---|
"""A simple tool to go through histograms.xml and print out the owners for
histograms.
"""
import xml.etree.ElementTree
DUMMY_OWNER = "Please list the metric's owners. Add more owner tags as needed."
def main():
tree = xml.etree.ElementTree.parse('histograms.xml')
root = tree.getroot()
assert root.tag == 'hist... |
import math
from flexlay.gui.editor_map_component import EditorMapComponent
from flexlay.math import Point, Pointf
class WorkspaceMoveTool:
def __init__(self):
self.scrolling = False
self.click_pos = Point(0, 0)
self.old_trans_offset = Pointf(0, 0)
def on_mouse_down(self, event):
... |
from rest_framework import serializers
from base.models.learning_component_year import LearningComponentYear
class LearningUnitComponentSerializer(serializers.ModelSerializer):
type_text = serializers.CharField(source='get_type_display', read_only=True)
hourly_volume_total_annual_computed = serializers.Seria... |
"""
Repoze what x509 plugin. It contains support for client certificate predicates.
"""
from zope.interface import implements as zope_implements
from .predicates import *
__all__ = ['is_issuer', 'is_subject'] |
from typing import Any
import pytest
from _pytest import runner
from _pytest._code import getfslineno
class TestOEJSKITSpecials:
def test_funcarg_non_pycollectobj(
self, testdir, recwarn
) -> None: # rough jstests usage
testdir.makeconftest(
"""
import pytest
... |
"""
Wrapper class that takes a list of template loaders as an argument and attempts
to load templates from them in order, caching the result.
"""
import hashlib
from django.core.exceptions import ImproperlyConfigured
from django.template.base import TemplateDoesNotExist
from django.template.loader import BaseLoader, g... |
# -*- coding: utf-8 -*-
import os
import pkgutil
from importlib import import_module
from threading import local
DATABASE_ENGINES = {
'postgres': '',
'mysql': '',
'sqlite': '',
'msserver': '',
'oracle': ''
}
class Error(Exception):
pass
class InterfaceError(Error):
pass
class Database... |
from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union
import warnings
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pi... |
"""
Tests for the CORS CSRF middleware
"""
from mock import patch, Mock
import ddt
from django.test import TestCase
from django.test.utils import override_settings
from django.core.exceptions import MiddlewareNotUsed, ImproperlyConfigured
from django.http import HttpResponse
from django.middleware.csrf import CsrfVie... |
import numpy as np
import pytest
import pandas as pd
import pandas.util.testing as tm
from .base import BaseExtensionTests
class BaseMissingTests(BaseExtensionTests):
def test_isna(self, data_missing):
expected = np.array([True, False])
result = pd.isna(data_missing)
tm.assert_numpy_arr... |
#!/usr/bin/env python
"""
This class will evalatuate a cluster as a stretch cluster and create a report that will
link in known issues with links to resolution.
@author : Shane Bradley
@contact : <EMAIL>
@version : 2.17
@copyright : GPLv2
"""
import re
import os.path
import logging
import textwrap
import s... |
# -*- coding: utf-8 -*-
import re
import time
from module.plugins.internal.Account import Account
from module.plugins.internal.Plugin import set_cookie
class Keep2ShareCc(Account):
__name__ = "Keep2ShareCc"
__type__ = "account"
__version__ = "0.08"
__status__ = "testing"
__description__ ... |
# vim: et ts=4 sw=4
from django.contrib import admin
from mptt.admin import MPTTModelAdmin
from reader.models import Feed, Posting, Enclosure, PostMark, Category
class FeedAdmin(admin.ModelAdmin):
list_display = ['title', 'url', 'category']
list_filter = ['category']
pass
class EnclosureInlineAdmin(admin... |
from msrest.pipeline import ClientRawResponse
from msrestazure.azure_exceptions import CloudError
import uuid
class HttpSuccessOperations(object):
def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserial... |
import pytest
from datadog_checks.ambari import AmbariCheck
@pytest.mark.skip(reason="Cannot be automated due to network restrictions")
def test_check(aggregator):
ambari_ip = "localhost"
init_config = {"collect_host_metrics": True, "collect_service_metrics": True, "collect_service_status": True}
instanc... |
from collections import defaultdict, namedtuple
from math import floor, log10
from bitcoin import sha256, COIN, TYPE_ADDRESS
from transaction import Transaction
from util import NotEnoughFunds, PrintError, profiler
# A simple deterministic PRNG. Used to deterministically shuffle a
# set of coins - the same set of co... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
Module to set up run time parameters for Clawpack.
The values set in the function setrun are then written out to data files
that will be read in by the Fortran code.
"""
import os
import numpy
import clawpack.geoclaw.dtopotools as dtopo
#-------------------------... |
ANSIBLE_METADATA = {'status': ['preview'],
'supported_by': 'community',
'version': '1.0'}
import traceback
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.ovirt import (
check_sdk,
create_connection,
get_dict_of_struct,
ovirt_facts... |
import requests
from allauth.socialaccount.providers.oauth2.views import (OAuth2Adapter,
OAuth2LoginView,
OAuth2CallbackView)
from .provider import LinkedInOAuth2Provider
class LinkedInOAuth2Adapter(OA... |
#!/usr/bin/python
"""
Ansible module to manage the ssh known_hosts file.
Copyright(c) 2014, Matthew Vernon <<EMAIL>>
This module 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, o... |
from test_framework.test_framework import ComparisonTestFramework
from test_framework.util import *
from test_framework.comptool import TestManager, TestInstance, RejectResult
from test_framework.blocktools import *
import copy
import time
'''
In this test we connect to one node over p2p, and test block requests:
1) ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
prefs plugin
Plugin read by omero.cli.Cli during initialization. The method(s)
defined here will be added to the Cli class for later use.
The pref plugin makes use of prefs.class from the common component.
Copyright 2007-2013 Glencoe Software, Inc. All... |
'''Folgender Code stammt aus: https://gist.github.com/macieksk/9743413
und wurde dort am 29.11.2012 vom User: Maciek Sykulski (https://gist.github.com/macieksk) veröffentlicht.
Er wurde meinerseits nur leicht für Python3 modifiziert.'''
from queue import PriorityQueue
import heapq
class UniquePriorityQueueWithReplace... |
from . import pdu_controller
class PduControllerFactory(object):
"""Factory that creates PDU controllers."""
def create_pdu_controller(self, _type):
if _type == 'NORDIC_BOARD_PDU_CONTOLLER':
return pdu_controller.NordicBoardPduController()
elif _type == 'APC_PDU_CONTROLLER':
... |
"""Miscellaneous network utility code."""
from __future__ import absolute_import, division, print_function, with_statement
import errno
import os
import socket
import ssl
import stat
from tornado.concurrent import dummy_executor, run_on_executor
from tornado.ioloop import IOLoop
from tornado.platform.auto import set... |
import gettext
_ = lambda m: gettext.dgettext(message=m, domain='ovirt-engine-setup')
from otopi import util
from otopi import plugin
from ovirt_engine_setup import constants as osetupcons
from ovirt_engine_setup.engine import constants as oenginecons
@util.export
class Plugin(plugin.PluginBase):
def __init_... |
# -*- coding: utf-8 -*-
try:
import json # try stdlib (Python 2.6)
except ImportError:
try:
import simplejson as json # try external module
except:
import gluon.contrib.simplejson as json # fallback to pure-Python module
from gluon import current
from gluon.html import *
from gluon.storage... |
# coding=utf-8
from django.contrib.auth import get_user_model
from django.core.exceptions import ValidationError
from django.test import TestCase
from . import models
class TestProfileModel(TestCase):
def test_profile_creation(self):
User = get_user_model()
# New user created
user = Us... |
"""Defines TestPackageExecutable to help run stand-alone executables."""
import logging
import os
import posixpath
import sys
import tempfile
from pylib import cmd_helper
from pylib import constants
from pylib import pexpect
from pylib.device import device_errors
from pylib.gtest import gtest_test_instance
from pylib... |
# TODO:
# move this to QtCore -- QStringListModel is part of QtGui and there is no
# simple model class appropriate for this test in QtCore.
import unittest
from PySide.QtCore import *
from PySide.QtGui import *
class TestBugPYSIDE41(unittest.TestCase):
def testIt(self):
# list of single-character str... |
# NFS RPC client -- RFC 1094
# XXX This is not yet complete.
# XXX Only GETATTR, SETTTR, LOOKUP and READDIR are supported.
# (See mountclient.py for some hints on how to write RPC clients in
# Python in general)
import rpc
from rpc import UDPClient, TCPClient
from mountclient import FHSIZE, MountPacker, MountUnpacke... |
from contextlib import contextmanager
import warnings
from django.contrib.auth.models import User
from django.utils import six
# We need to make sure that we're using the same unittest library that Django uses internally
# Otherwise, we get issues with the "SkipTest" and "ExpectedFailure" exceptions being recognised ... |
try:
from ompl import util as ou
from ompl import base as ob
from ompl import geometric as og
except:
# if the ompl module is not in the PYTHONPATH assume it is installed in a
# subdirectory of the parent directory called "py-bindings."
from os.path import abspath, dirname, join
import sys
... |
'''
@author: Pedram Amini
@license: GNU General Public License 2.0 or later
@contact: <EMAIL>
@organization: www.openrce.org
'''
class edge (object):
'''
'''
id = None
src = None
dst = None
# general graph attributes.
color = 0x000000
label = ""
# gml relev... |
import os
from six import StringIO
import time
import unittest
from getpass import getuser
import logging
from test.unit import tmpfile
import mock
import signal
from contextlib import contextmanager
import itertools
from collections import defaultdict
import errno
from swift.common import daemon, utils
from test.unit... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from edu.umd.cs.dmonner.tweater.util import SentimentAnalyzer
import pickle
import re
import os
import sys
import time
import traceback
import nltk
from nltk.corpus import stopwords
class SentimentAnalyzerP(SentimentAnalyzer, object):
''' Sentiment Analyzer Utility '''
d... |
"""
Tests for TypedPropertyCollection class.
"""
__version__='''$Id: test_widgetbase_tpc.py 3288 2008-09-15 11:03:17Z rgbecker $'''
from reportlab.lib.testutils import setOutDir,makeSuiteForClasses, printLocation
setOutDir(__name__)
import os, sys, copy
from os.path import join, basename, splitext
import unittest
from ... |
#!/usr/bin/env python
import numpy as np
import chainer
import chainer.functions as F
import chainer.links as L
import chainer.datasets.image_dataset as ImageDataset
import six
import os
from PIL import Image
from chainer import cuda, optimizers, serializers, Variable
from chainer import training
from chainer.trainin... |
""" Utility for prompting users
"""
from DIRAC import S_OK, S_ERROR
def promptUser( message, choices = [], default = 'n', logger = None ):
""" Prompting users with message, choices by default are 'y', 'n'
"""
if logger is None:
from DIRAC import gLogger
logger = gLogger
if not choices:
choices = ... |
import pytest
from openshift_checks.etcd_traffic import EtcdTraffic
@pytest.mark.parametrize('group_names,version,is_active', [
(['oo_masters_to_config'], "3.5", False),
(['oo_masters_to_config'], "3.6", False),
(['oo_nodes_to_config'], "3.4", False),
(['oo_etcd_to_config'], "3.4", True),
(['oo_e... |
from __future__ import absolute_import
import unittest
import mock
from telemetry.core import exceptions
from telemetry import decorators
from telemetry.internal.actions import action_runner as action_runner_module
from telemetry.internal.actions import page_action
from telemetry.testing import tab_test_case
from tel... |
import unittest
import Gaffer
import GafferTest
class BlockedConnectionTest( GafferTest.TestCase ) :
def test( self ) :
self.numCalls = 0
def f() :
self.numCalls += 1
s = Gaffer.Signal0()
c = s.connect( f )
s()
self.assertEqual( self.numCalls, 1 )
with Gaffer.BlockedConnection( c ) :
s()
... |
import numpy as np
import math
import bpy
from bpy.props import EnumProperty, FloatProperty, BoolProperty
from sverchok.node_tree import SverchCustomTreeNode
from sverchok.data_structure import updateNode, dataCorrect, repeat_last
# spline function modifed from
# from looptools 4.5.2 done by Bart Crouch
# calculat... |
"""
An example of using shards directly to construct the MagnaDoodle component,
using the PygameComponentShard as a base.
Generated code is in MagnaDoodle.py
"""
from PygameComponentShard import pygameComponentShard
# import shards and inline shards from these files
from ExampleMagnaShards import __INIT__
from Examp... |
# -*-coding:utf8;-*-
# war_pat_p
from timeit import default_timer as timer
import numpy as np
import os
import sqlite3
import pickle
from multiprocessing import Pool
# import pandasDataAnalysis
# import cProfile
class Battle:
def __init__(self):
self.nb_trick = 0
self.escarmoucheDep... |
"""GSSAPI linebased client/server protocol.
#
# Usage:
#
# Server:
#
# class Echo(gssapiprotocol.GSSAPILineServer):
# def got_line(self, line):
# self.write('echo: ' + line)
#
# class EchoFactory(protocol.Factory):
# def buildProtocol(self, addr): # pylint: disable=C0103
# ... |
import os
import platform
from pyprint.ConsolePrinter import ConsolePrinter
from coalib import VERSION
from coalib.misc.Exceptions import get_exitcode
from coalib.output.Interactions import fail_acquire_settings
from coalib.output.printers.LogPrinter import LogPrinter
from coalib.output.printers.LOG_LEVEL import LOG_... |
from setuptools import setup, find_packages
import os
import subprocess
import sys
print("PBR pipeline will now be setup for your system.")
print("If you would like to compile the C++ addon please follow these instructions before continuing:")
print("https://github.com/tobspr/RenderPipeline/wiki/Building-the-CP... |
from sqlalchemy import *
from sqlalchemy.orm import *
from app.db_model.base import Base
from flask.ext.login import UserMixin
from werkzeug.security import generate_password_hash, \
check_password_hash
ROLE_USER = 0
ROLE_ADMIN = 1
class User(UserMixin, Base):
__tablename__ = 'users'
id = Column(Integer,... |
print "executable = syph_env.sh"
plantilla = """
arguments = pubmed_graph_for_year.py \
--start_year {start_year} \
--thru_year {thru_year} \
--mode {mode} \
--top {top} \
--ignore syphilis_ignore.txt \
--groups syphilis_groups.json \
--pickle {pickle} \
--medlin... |
# -*- coding: utf-8 -*-
import pytest
import sys
from .test_base_class import TestBaseClass
aerospike = pytest.importorskip("aerospike")
try:
import aerospike
except:
print("Please install aerospike python client.")
sys.exit(1)
class TestCalcDigest(object):
@pytest.mark.parametrize("ns, set, key", ... |
import subprocess
import os
import sys
import time
import json
import datetime
import pickle
import MySQLdb
import copy
from struct import *
from subprocess import Popen, PIPE, STDOUT
from kafka import KafkaConsumer
from kafka import KafkaProducer
from kafka import TopicPartition
from os.path import isfile, join
from o... |
"""
websocket - WebSocket client library for Python
Copyright (C) 2010 Hiroki Ohtani(liris)
This library 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 2.1 of the License, ... |
from sgmllib import SGMLParser
import htmlentitydefs, time
class Annotation(SGMLParser):
def __init__(self, chain, replacement):
self.pieces = []
self.chain = chain
self.replacement = replacement
self.annotate = False
SGMLParser.reset(self)
def unknown_starttag(self, tag, attrs):
if tag=="head" or tag==... |
from collections import defaultdict
from functools import partial
import itertools
import os
import os.path
from pprofile_ext import handlers
from pprofile_ext import util
from pprofile_ext.html import file
from pprofile_ext.html import summary
def get_reverse_dict(pdict):
"""
Build the reverse call informat... |
# -*- coding: utf-8 -*-
#------------------------------------------------------------
# streamondemand - XBMC Plugin
# Conector para vidzi
# http://www.mimediacenter.info/foro/viewforum.php?f=36
#------------------------------------------------------------
import re
from core import jsunpack
from core import logger
f... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
from os.path import dirname, join as join_path
from setuptools import setup, find_packages
def _read(file_name):
sock = open(file_name)
text = sock.read()
sock.close()
return text
requirements = [
"pyramid_tm",
"pyramid",
"reques... |
# Testing time module
import sys
import UnitTest
import re
#from __pyjamas__ import debugger
class ReModuleTest(UnitTest.UnitTest):
def matchTest(self, msg, pat, flags, string, groups, span):
r = re.compile(pat, flags)
m = r.match(string)
if groups is None:
self.assertTrue(m ... |
# coding: utf-8
import json
import logging
import uuid
from lingobarter.core.models.config import Config, Lingobarter
from lingobarter.core.models.custom_values import CustomValue
from lingobarter.modules.accounts.models import User, Role, Language, LanguageItem, Location
from mongoengine import DoesNotExist
from .dat... |
import ast
from .base import BaseAnalyzer, Result
DESCRIPTION = """
``{name}`` function has been deprecated in Django 1.2 and removed in 1.4. Use
``{propose}`` class instead.
"""
class TemplateLoadersVisitor(ast.NodeVisitor):
def __init__(self):
self.found = []
removed_items = {
'django.te... |
#!/usr/bin/env python3
from reporting.category import Category
class UrbanCodeDeployApplication:
def __init__(self, session, json_dict):
self.session = session
self.id = json_dict['id']
self.name = json_dict['name']
self.active = json_dict['active']
self.tags = json_dict['t... |
#!/usr/bin/env python
# coding=utf-8
# Read data and read tree fuctions for INFORMS data
# attributes ['age', 'workcalss', 'final_weight', 'education', 'education_num',
# 'marital_status', 'occupation', 'relationship', 'race', 'sex', 'capital_gain',
# 'capital_loss', 'hours_per_week', 'native_country', 'class']
# QID ... |
import copy
import mock
import pytest
from osf_tests.factories import (
ApiOAuth2PersonalTokenFactory,
AuthUserFactory,
)
from website.util import api_v2_url
from osf.utils import sanitize
@pytest.mark.django_db
class TestTokenList:
@pytest.fixture()
def user_one(self):
return AuthUserFactor... |
import os
import sys
from .base import * # noqa
if os.getenv('TRAVIS', False):
from .travis import * # noqa
elif os.getenv('JENKINS_HOME', False):
from .jenkins import * # noqa
else:
if os.getenv('C9_USER'):
from .c9 import * # noqa
try:
from .local import * # noqa
except Im... |
"""
Unit test cases.
"""
from __future__ import unicode_literals
import unittest
import os
import io
import logging
import logging.config
from simpletal import simpleTAL, simpleTALES
if (os.path.exists("logging.ini")):
logging.config.fileConfig("logging.ini")
else:
logging.basicConfig()
def simpl... |
import json
import os
import shutil
import subprocess
import sys
import tarfile
import tempfile
__all__ = (
'Sink',
)
BOTS = os.path.join(os.path.dirname(__file__), "..")
class Sink(object):
def __init__(self, host, identifier, status=None):
self.attachments = tempfile.mkdtemp(prefix="attachments.", ... |
class Progression:
def __init__(self, start, stop):
self._current = start
self._end = stop
def next(self):
# 1. save current value to temp
tmp = self._current
# 2. advance
if self._current is not None:
self._advance()
# 3. check if you need t... |
# coding=utf-8
"""**Module for 1D interpolation**
This module:
* provides piecewise constant (nearest neighbour) and bilinear interpolation
* is fast (based on numpy vector operations)
* depends only on numpy
* guarantees that interpolated values never exceed the two nearest neighbours
* handles missing values in dom... |
import sys
import unittest
from libcloud.common.types import LibcloudError
from libcloud.storage.base import Container, Object
from libcloud.storage.drivers.digitalocean_spaces import (
DigitalOceanSpacesStorageDriver,
DOSpacesConnectionAWS4,
DOSpacesConnectionAWS2)
from libcloud.test import LibcloudTest... |
# Django settings for dds_tests project.
import os.path
import sys
sys.path.insert(0, '..')
DEBUG = True
TEMPLATE_DEBUG = DEBUG
PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))
ADMINS = (
# ('Your Name', '<EMAIL>'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backen... |
#-*- coding: utf-8 -*-
"""
Python CDL parsing library
"""
__version__ = '0.5.5'
__author__ = 'simon'
import sys
import logging
import json
import os
import re
from xml.dom import minidom
import traceback
allow_edls = False
try:
import edl
allow_edls = True
except Exception as e:
allow_edls = False
clas... |
"""
4 demo class components (subframes) on one window;
there are 5 Quitter buttons on this one window too, and each kills entire gui;
GUIs can be reused as frames in container, independent windows, or processes;
"""
from tkinter import *
from quitter import Quitter
demoModules = ['demoDlg', 'demoCheck', 'demoR... |
"""Install ddsp."""
import os
import sys
import setuptools
# To enable importing version.py directly, we add its path to sys.path.
version_path = os.path.join(os.path.dirname(__file__), 'ddsp')
sys.path.append(version_path)
from version import __version__ # pylint: disable=g-import-not-at-top
setuptools.setup(
... |
from django.db import connection
from django.test import modify_settings
from . import PostgreSQLTestCase
from .models import CharFieldModel, TextFieldModel
@modify_settings(INSTALLED_APPS={'append': 'django.contrib.postgres'})
class UnaccentTest(PostgreSQLTestCase):
Model = CharFieldModel
@classmethod
... |
"""Model script to test TF-TensorRT integration."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import numpy as np
from tensorflow.python.compiler.tensorrt.test import tf_trt_integration_test_base as trt_test
from tensorflow.python.framework... |
from wtforms import Form, TextField, SelectField, TextAreaField, FileField, HiddenField
from lib.Element import *
import pprint
class PageCreateForm( Form):
to_create = TextField( 'Page Name')
def listToPair( list):
to_ret = []
for page in list:
to_ret += [ ( page, page.split( '/', 1)[-1].title())]
return to_re... |
import random
import time
import unittest
from silk.config import wpan_constants as wpan
from silk.node.wpan_node import WpanCredentials
from silk.tools.wpan_util import (verify, verify_within, is_associated, check_neighbor_table)
from silk.utils import process_cleanup
import silk.hw.hw_resource as hwr
import silk.nod... |
"""
Common components for all commandline utilities
"""
from __future__ import unicode_literals
from os import linesep
from .. import settings
#/* ======================================================================= */#
#/* Global variables
#/* ===============================================================... |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from contextlib import contextmanager
from pants.backend.core.tasks.roots import ListRoots
from pants.base.build_environment import get_buildroot
from pants... |
"""
test configuration settings
"""
import rez.vendor.unittest2 as unittest
from rez.tests.util import TestBase
from rez.exceptions import ConfigurationError
from rez.config import Config, get_module_root_config
from rez.system import system
from rez.utils.data_utils import RO_AttrDictWrapper
from rez.packages_ import ... |
from MaKaC.webinterface.rh import conferenceModif, trackModif
from indico.web.flask.blueprints.event.management import event_mgmt
# Tracks
event_mgmt.add_url_rule('/program/', 'confModifProgram', conferenceModif.RHConfModifProgram)
event_mgmt.add_url_rule('/program/tracks/add', 'confModifProgram-addTrack', conference... |
"""The tests for the sun automation."""
from datetime import datetime
import unittest
from unittest.mock import patch
from homeassistant.core import callback
from homeassistant.bootstrap import setup_component
from homeassistant.components import sun
import homeassistant.components.automation as automation
import hom... |
__author__ = "Simone Campagna"
__all__ = [
'RubikTestSuite',
]
import unittest
import tempfile
import shutil
import fnmatch
import sys
import os
from rubik.application.tempdir import chtempdir
from .rubik_test_conf import RUBIK_TEST_CONF
class RubikTestSuite(unittest.TestSuite):
def __init... |
# coding: utf-8
# imports
import os
# django imports
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
# settings for django-tinymce
try:
import tinymce.settings
DEFAULT_URL_TINYMCE = tinymce.settings.JS_BASE_URL + '/'
DEFAULT_PATH_TINYMCE = tinymce.settings.JS_ROOT... |
"""Python layer for set_ops."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.contrib.framework.python.framework import tensor_util
from tensorflow.contrib.util import loader
from tensorflow.python.framework import common_shapes
from tenso... |
import unittest
import config
import thread_cert
from pktverify.packet_verifier import PacketVerifier
CH1 = 11
CH2 = 22
PBBR1 = 1
ROUTER1 = 2
PBBR2 = 3
ROUTER2 = 4
HOST = 5
MA1 = 'ff05::1234:777a:1'
MA2 = 'ff05::1234:777a:2'
BBR_REGISTRATION_JITTER = 1
WAIT_REDUNDANCE = 3
class TestMlr(thread_cert.TestCase):
... |
#!/usr/bin/env python3
"""Generate an author list for a new paper or abstract."""
import sys
from pathlib import Path
import json
from update_zenodo import get_git_lines, sort_contributors
# These authors should go last
AUTHORS_LAST = ['Gorgolewski, Krzysztof J.', 'Poldrack, Russell A.', 'Esteban, Oscar']
def _asli... |
from typing import Any, Callable, Dict, Generic, Optional, TypeVar
import warnings
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import AsyncHttpRe... |
"""Setup configuration."""
import platform
try:
import setuptools
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
import setuptools
# Configure the required packages and scripts to install, depending on
# Python version and OS.
REQUIRED_PACKAGES = [
'httplib2>=0.8',
'... |
"""
PPA Reference Model Sample File
Note: The Census Tract in the testdata is not the actual Census Tract,
it is only intended to be used for testing purpose.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import json
import logging
import os
import... |
from beyonic.api_client import ApiClient
from beyonic.resources import GenericObject
from beyonic.errors import BeyonicError
class AbstractAPI(GenericObject):
"""
AbtractApi class, all the other api class extends it
"""
@classmethod
def get_client(cls, client=None):
url = cls.ge... |
from openerp import models, api
class AccountInvoiceLine(models.Model):
_inherit = "account.invoice.line"
@api.multi
def product_id_change(
self, product, uom_id, qty=0, name='', type='out_invoice',
partner_id=False, fposition_id=False, price_unit=False,
currency_id=Fa... |
# -*- coding: utf-8 -*-
import base64
from openerp.addons.web import http
from openerp.addons.web.http import request
from openerp import SUPERUSER_ID
import werkzeug.urls
class contactus(http.Controller):
def generate_google_map_url(self, street, city, city_zip, country_name):
url = "http://maps.googl... |
"""
Mixins for JWT auth tests.
"""
from time import time
from django.conf import settings
import jwt
JWT_AUTH = 'JWT_AUTH'
class JwtMixin(object):
""" Mixin with JWT-related helper functions. """
JWT_SECRET_KEY = getattr(settings, JWT_AUTH)['JWT_SECRET_KEY'] if hasattr(settings, JWT_AUTH) else ''
JWT... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Some Morse code functions
Copyright (C) 2015 by
Sébastien Celles <<EMAIL>>
All rights reserved.
"""
from enum import Enum
import morse_talk as mtalk
from morse_talk.encoding import (_split_message, _encode_binary, _encode_to_binary_string)
WORD = 'PARIS' # Refere... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.six import it... |
# -*- coding: utf-8 -*-
"""djangoflash.decorators test cases.
"""
from unittest import TestCase
from django.http import HttpRequest
from djangoflash.decorators import keep_messages
from djangoflash.models import FlashScope
# Only exports test cases
__all__ = ['KeepMessagesDecoratorTestCase']
def view_method(req... |
import json
import ast
import threading
import os
from util import user_dir, print_error
class SimpleConfig:
"""
The SimpleConfig class is responsible for handling operations involving
configuration files. The constructor reads and stores the system and
user configurations from electrum.conf into separate dic... |
#!/usr/bin/env python
# -*- coding: utf8 -*-
import os, sys, re, collections, gnuplot, getopt
import cpistack_data, cpistack_items, cpistack_results
try:
collections.defaultdict()
except AttributeError, e:
print sys.argv[0], "Error: This script requires Python version 2.5 or greater"
sys.exit()
# New-style fu... |
import gettext
import json
import os
import shutil
import sys
import traceback
from gi.repository import GdkPixbuf
from gi.repository import Gtk
import kuwo
from kuwo.log import logger
if __file__.startswith('/usr/local/'):
PREF = '/usr/local/share'
elif __file__.startswith('/usr/'):
PREF = '/usr/share'
else... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.