content stringlengths 4 20k |
|---|
import logging
import newrelic.agent
from django.conf import settings
from treeherder.autoclassify.tasks import autoclassify
from treeherder.log_parser.crossreference import crossreference_job
from treeherder.log_parser.utils import post_log_artifacts
from treeherder.model.models import (Job,
... |
"""
Unit tests for the plugin framework
"""
from __future__ import absolute_import
from __future__ import print_function
import re
import mock
from twisted.trial import unittest
from zope.interface import implementer
import buildbot.plugins.db
from buildbot.errors import PluginDBError
from buildbot.interfaces impo... |
import wx
import sys
import time
import threading
from os import path, getenv
# if PAPARAZZI_SRC not set, then assume the tree containing this
# file is a reasonable substitute
PPRZ_SRC = getenv("PAPARAZZI_SRC", path.normpath(path.join(path.dirname(path.abspath(__file__)), '../../../../')))
sys.path.append(PPRZ_SRC ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import unittest
import re
from libs.mock import *
from runner.sensei import Sensei
from runner.writeln_decorator import WritelnDecorator
from runner.mockable_test_result import MockableTestResult
from runner import path_to_enlightenment
class AboutParrots:
... |
# -*- coding: utf-8 -*-
'''
Mepinta
Copyright (c) 2011-2012, Joaquin G. Duo
This file is part of Mepinta.
Mepinta 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 opti... |
"""unittest compatible JUnit XML output."""
import datetime
import re
import time
import unittest
# same format as sys.version_info: "A tuple containing the five components of
# the version number: major, minor, micro, releaselevel, and serial. All
# values except releaselevel are integers; the release level is 'alp... |
"""File IO methods that wrap the C++ FileSystem API.
The C++ FileSystem API is SWIG wrapped in file_io.i. These functions call those
to accomplish basic File IO operations.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import binascii
import os
import... |
from openerp import SUPERUSER_ID
from openerp.osv import fields, osv
from openerp.tools import DEFAULT_SERVER_DATE_FORMAT as DF
from openerp.tools.translate import _
from datetime import date
import logging
from openerp.exceptions import UserError
_logger = logging.getLogger(__name__)
class gamification_badge_user(o... |
from __future__ import absolute_import
from astropy.io import fits
from unittest import TestCase, skip
from ccdproc import CCDData
from ...core import NightDataContainer
from ..image_processor import ImageProcessor
from ..goodman_ccd import get_args
import numpy as np
class ImageProcessorTest(TestCase):
def s... |
"""
The methods in PodService deal primarily with groups of Feed
"""
from dto import Feed, Episode
from dao import FeedDao, EpisodeDao, init_database
import pd_util
class PodService(object):
@classmethod
def setup(cls):
pd_util.init_dirs()
init_database()
@classmethod
d... |
from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin
class Squid(Plugin):
"""Squid caching proxy
"""
plugin_name = 'squid'
profiles = ('webserver', 'services', 'sysmgmt')
class RedHatSquid(Squid, RedHatPlugin):
files = ('/etc/squid/squid.conf',)
packages = ('squid',)
... |
from . import test_survey
checks = [
test_survey
] |
#!/usr/bin/env kross
"""
Python script that provides additional formula-functions
to KSpread.
The script could be used in two ways;
1. Embedded in KSpread by execution via the "Tools=>Scripts"
menu or from the "Tools=>Script Manager". The functions.py
script may not be visible if not installed. So,... |
#!/usr/bin/env python
'''
This is a tool for that makes it easy to understand what a given KojiPkgSpec
syntax will expand to.
The main use case is making sure the packages specified in a KojiInstaller
will match the packages you intended to install.
'''
import sys, optparse
import common
from virttest import utils_k... |
# pylint: skip-file
# flake8: noqa
# pylint: disable=too-many-instance-attributes
class ServiceConfig(object):
''' Handle service options '''
# pylint: disable=too-many-arguments
def __init__(self,
sname,
namespace,
ports,
annotations=Non... |
"""
Store database-specific configuration parameters
"""
import uuid
import datetime
from openerp import SUPERUSER_ID
from openerp.osv import osv, fields
from openerp.tools import misc, config
"""
A dictionary holding some configuration parameters to be initialized when the database is created.
"""
_default_paramete... |
from msrest.serialization import Model
class ResourceGroup(Model):
"""Resource group information.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar id: The ID of the resource group.
:vartype id: str
:param name: The name of the resource group.
... |
"""Implement Roulette Wheel selection on a population.
This implements Roulette Wheel selection in which individuals are
selected from a population randomly, with their proportion of selection
based on their relative fitness in the population.
"""
# standard modules
import random
import copy
# local modules
from .Abs... |
import logging
import os
import sys
import threading
import time
chroma_logger = logging.getLogger("test")
chroma_logger.setLevel(logging.DEBUG)
try:
import nose
nose_installed = True
except ImportError:
nose_installed = False
if nose_installed:
# Monkey patch TextTestResult to print errors as t... |
# -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsZonalStatistics.
.. note:: 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 2 of the License, or
(at your option) any later version.
""... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
import pytest
from ansible.module_utils.common.network import is_mac
testcase_is_valid_mac_addr = [
('A4-23-8D-F8-C9-E5', True),
('35:71:F4:11:0B:D8', True),
('b3-bd-20-59-0c-cf', True),
('32:61:ca:65:f1:f4', True)... |
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
dataset = pd.read_csv("dataset.csv")
X = dataset.iloc[:, 3:13].values
y = dataset.iloc[:, 13].values
from sklearn.preprocessing import LabelEncoder, OneHotEncoder
labelencoder_X_1 = LabelEncoder()
X[:, 1] = labelencoder_X_1.fit_transform(X[:, 1])... |
from __future__ import division, absolute_import, print_function
import sys
import re
import os
if sys.version_info[0] < 3:
from ConfigParser import RawConfigParser, NoOptionError
else:
from configparser import RawConfigParser, NoOptionError
__all__ = ['FormatError', 'PkgNotFound', 'LibraryInfo', 'VariableSe... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Badit (BuildAndDebugIT) is a program to to simplify the process of deployment
and updating an android project
copyright: 2012, (c) tuenti.com
author: Nick Flink <<EMAIL>>
"""
import sys
import getopt
import os
import subprocess
# import getpass
import logging
impor... |
import sys
import argparse
import pylab
import numpy as np
import matplotlib.pyplot as plt
from heatmapcluster import heatmapcluster
def parseArgument():
# Parse the input
parser=argparse.ArgumentParser(description=\
"Make a clustergram of a matrix")
parser.add_argument("--matFileName", required=True,\
help='... |
from builtins import str
from past.builtins import basestring
from datetime import datetime
from contextlib import closing
import sys
from typing import Optional
from sqlalchemy import create_engine
from airflow.hooks.base_hook import BaseHook
from airflow.exceptions import AirflowException
class DbApiHook(BaseHook... |
#!python manage.py shell_plus <
import pandas as pd
np = pd.np
np.norm = np.linalg.norm
import sklearn
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction.text import TfidfTransformer, TfidfVectorizer
from sklearn.linear_model import SGDClassifier
from sklearn.grid_search import... |
from py2neo import Node, Relationship, cast_node, remote, RemoteEntity
from test.compat import long
from test.util import GraphTestCase
from py2neo.packages.httpstream import ClientError
class DodgyClientError(ClientError):
status_code = 499
class NodeTestCase(GraphTestCase):
def test_can_create_local_node... |
#!/usr/bin/env python3
from .token import *
from .expr import *
from .code import *
def skip_eol(ctx):
res = ctx.raw_context()
token = ctx.peek_token()
while token == Token('eol', ''):
ctx.token()
res = ctx.raw_context()
token = ctx.peek_token()
return res
def pseudo_code_ele... |
""" Tools and functions to calculate interpolate waveforms using multi-banding
"""
import numpy
from pycbc.types import TimeSeries, zeros
def multiband_fd_waveform(bands=None, lengths=None, overlap=0, **p):
""" Generate a fourier domain waveform using multibanding
Speed up generation of a fouerier domain wa... |
"""Python 3 functional programing experiments."""
import collections
import itertools
import inspect
import opcode
import types
__all__ = ["Let", "Expression", "Raise", "Where"]
def _make_closure_cell(value):
"""The types.FunctionType class ned a cell variable in the
closure argument. This function create... |
import unittest
from .length_feet_and_inches_to_metric import feet_inches_to_metric
class FeetInchesTestCase(unittest.TestCase):
def test_feet_to_cm(self):
text = '''His height is 5'10" today
His height is 5'10 today
His height is 5' 10 today
His height is ... |
"""
Test the partitions and partitions service
"""
import json
from django.conf import settings
import django.test
from mock import patch
from nose.plugins.attrib import attr
from unittest import skipUnless
from courseware.masquerade import handle_ajax, setup_masquerade
from courseware.tests.test_masquerade import S... |
from yowsup.layers.interface import YowInterfaceLayer, ProtocolEntityCallback
from yowsup.layers.protocol_contacts.protocolentities import GetSyncIqProtocolEntity, ResultSyncIqProtocolEntity
from yowsup.layers.protocol_iq.protocolentities import ErrorIqProtocolEntity
import threading
import l... |
"""Tests for graph_compute_order module."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.contrib import slim
from tensorflow.contrib.receptive_field import receptive_field_api as receptive_field
from tensorflow.python.framework import dty... |
import ConfigParser
import getpass
import logging
import os
import pkg_resources
from openfisca_survey_manager.scripts.surv import add_survey_to_collection, create_data_file_by_format
from openfisca_survey_manager.survey_collections import SurveyCollection
openfisca_france_data_location = pkg_resources.get_distributio... |
# coding: utf-8
RESOURCE_MAPPING = {
'user': {
'resource': 'users/{id}',
'docs': 'https://instagram.com/developer/endpoints/users/#get_users',
'methods': ['GET']
},
'self_feed': {
'resource': 'users/self/feed',
'docs': 'https://instagram.com/developer/endpoints/users... |
from openerp.osv import fields, osv
from openerp.tools.translate import _
class sale_make_invoice(osv.osv_memory):
_name = "sale.make.invoice"
_description = "Sales Make Invoice"
_columns = {
'grouped': fields.boolean('Group the invoices', help='Check the box to group the invoices for the same cust... |
#!/usr/bin/env python
#
# Test to ensure initalization of InstanceGroup object emits appropriate errors
# if bidprice is not specified, but allows float, int, Decimal.
from decimal import Decimal
from tests.compat import unittest
from boto.emr.instance_group import InstanceGroup
class TestInstanceGroupArgs(unittest... |
#!/usr/bin/env python
import glob
import os
import logging
import requests
import yaml
logging.basicConfig(level=logging.DEBUG)
BLACKLIST = ('blog', '_site',)
def get_github(username):
response = requests.get('https://api.github.com/users/' + username)
response_json = response.json()
if 'avatar_url' in... |
import os
from datetime import datetime
from ...utils.mimetypes import guess_type
def meta_info_to_oeb_metadata(mi, m, override_input_metadata=False):
from ..base import OPF
if not mi.is_null('title'):
m.clear('title')
m.add('title', mi.title)
if mi.title_sort:
if not m.title:
... |
import os
from wedc.domain.entities.post import Post
# from wedc.domain.core.data.loaders import es_loader
from wedc.domain.core.data import cleaner
mapping = None
def load_input(input):
# data from intermediate data
# data[0]: source id
# data[1]: content, original content of data, \t\n\r should be rem... |
from collections import OrderedDict
from test.test_json import PyTest, CTest
CASES = [
('/\\"\ucafe\ubabe\uab98\ufcde\ubcda\uef4a\x08\x0c\n\r\t`1~!@#$%^&*()_+-=[]{}|;:\',./<>?', '"/\\\\\\"\\ucafe\\ubabe\\uab98\\ufcde\\ubcda\\uef4a\\b\\f\\n\\r\\t`1~!@#$%^&*()_+-=[]{}|;:\',./<>?"'),
('\u0123\u4567\u89ab\ucdef\u... |
from __future__ import unicode_literals
import re
from .common import InfoExtractor
class ExfmIE(InfoExtractor):
IE_NAME = 'exfm'
IE_DESC = 'ex.fm'
_VALID_URL = r'https?://(?:www\.)?ex\.fm/song/(?P<id>[^/]+)'
_SOUNDCLOUD_URL = r'http://(?:www\.)?api\.soundcloud\.com/tracks/([^/]+)/stream'
_TESTS... |
"""
The gntp.config module is provided as an extended GrowlNotifier object that takes
advantage of the ConfigParser module to allow us to setup some default values
(such as hostname, password, and port) in a more global way to be shared among
programs using gntp
"""
import logging
import os
from . import notifier
from... |
"""
Test functions for models.tools
"""
from statsmodels.compat.python import lrange, range
import numpy as np
from numpy.random import standard_normal
from numpy.testing import (assert_equal, assert_array_equal,
assert_almost_equal, assert_string_equal, TestCase)
from nose.tools import (asse... |
"""Constants/functions for interpreting results of os.stat() and os.lstat().
Suggested usage: from stat import *
"""
# Indices for stat struct members in the tuple returned by os.stat()
ST_MODE = 0
ST_INO = 1
ST_DEV = 2
ST_NLINK = 3
ST_UID = 4
ST_GID = 5
ST_SIZE = 6
ST_ATIME = 7
ST_MTIME = 8
ST_CTIME = 9
... |
from __future__ import unicode_literals
from oauthlib.oauth2 import WebApplicationClient, InsecureTransportError
from oauthlib.oauth2 import is_secure_transport
class OAuth2(object):
"""Adds proof of authorization (OAuth2 token) to the request."""
def __init__(self, client_id=None, client=None, token=None):
... |
from __future__ import absolute_import, division, print_function, unicode_literals
from guessit.plugins.transformers import Transformer
from guessit.matcher import GuessFinder
from guessit.patterns import sep
from guessit.containers import PropertiesContainer, WeakValidator, NoValidator
from guessit.patterns.numeral i... |
import os
def fullsplit(path, result=None):
'''Split a pathname into components (the opposite of os.path.join)
in a platform-neutral way.
'''
if result is None:
result = []
head, tail = os.path.split(path)
if head == '':
return [tail] + result
if head == path:
retur... |
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
# cloudscaper+alfa_assistant
# ------------------------------------------------------------------------------
import sys
PY3 = False
if sys.version_info[0] >= 3: PY3 = True; unicode = str; unichr = chr; long = int
... |
from addons.base.serializer import OAuthAddonSerializer
from addons.dataverse import client
from addons.dataverse.settings import DEFAULT_HOSTS
from website.util import api_url_for, web_url_for
class DataverseSerializer(OAuthAddonSerializer):
addon_short_name = 'dataverse'
REQUIRED_URLS = []
# Include ... |
# -*- coding: utf-8 -*-
"""
werkzeug.security
~~~~~~~~~~~~~~~~~
Security related helpers such as secure password hashing tools.
:copyright: 2007 Pallets
:license: BSD-3-Clause
"""
import codecs
import hashlib
import hmac
import os
import posixpath
from random import SystemRandom
from struct import... |
# coding: utf-8
from __future__ import unicode_literals
import base64
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse,
compat_ord,
)
from ..utils import (
ExtractorError,
sanitized_Request,
)
class YoukuIE(InfoExtractor):
IE_NAME = 'youku'
IE_DESC = '优酷'
_VAL... |
ANSIBLE_METADATA = {'status': ['preview'],
'supported_by': 'community',
'version': '1.0'}
import fnmatch
import traceback
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.ovirt import (
check_sdk,
create_connection,
get_dict_of_struct,
... |
import bpy, os, sys, configparser
from bpy.props import *
class SubMeshProperties(bpy.types.PropertyGroup):
# Flag to tell if this submesh should use shared vertices.
useSharedVertices = BoolProperty(
name = "Use Shared Vertices",
description = "Use shared vertices with other submeshes.",
default = True,
opt... |
import sys, os
from Overc.utils import Process
class Package(object):
def __init__(self):
pass
def _smartpm(self, args, chroot=None):
cmd = []
if chroot != None:
cmd.append("chroot")
cmd.append(chroot)
cmd.append("/usr/bin/smart")
cmd.append(ar... |
"""Get All Controls Test
**What is checked**
This test does no actual testing it just returns each control.
**How is it checked**
A loop over all the controls in the dialog is made and each control added to
the list of bugs
**When is a bug reported**
For each control.
**Bug Extra Information**
There i... |
import social as S, percolation as P, os
import importlib
importlib.reload(P.rdf)
importlib.reload(S.fb)
importlib.reload(S.fb.gdf2rdf)
importlib.reload(S.fb.gdf2rdf)
c=P.utils.check
fnames_=[
("RenatoFabbri19112014.gdf",None,"781909429","renato.fabbri"),
("PedroPauloRocha10032013.gdf",None,"836944624"... |
import sys
import decimal
from unittest import TestCase
import simplejson as json
import simplejson.decoder
class TestScanString(TestCase):
def test_py_scanstring(self):
self._test_scanstring(simplejson.decoder.py_scanstring)
def test_c_scanstring(self):
if not simplejson.decoder.c_scanstring... |
import os
from snapshot import *
f = open(snapshotfile)
date = None
rev = None
platform = None
snap = None
i = 0
for line in f.readlines():
i += 1
parsed = parse_line(i, line)
if not parsed:
continue
if parsed["type"] == "snapshot":
date = parsed["date"]
rev = parsed["rev"]
... |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'FeedData.feed_classifier_counts'
db.add_column('rss_feeds_feeddata', 'feed_classifier_coun... |
"""
Filename globbing utility. Mostly a copy of `glob` from Python 3.5.
Changes include:
* `yield from` and PEP3102 `*` removed.
* `bytes` changed to `six.binary_type`.
* Hidden files are not ignored.
"""
import os
import re
import fnmatch
from setuptools.extern.six import binary_type
__all__ = ["glob", "iglob", ... |
import unittest
from array_view import ArrayView
from array_view import get_array_view_or_slice
import numpy
class ArrayViewTest(unittest.TestCase):
def test_is_view(self):
"""Make sure that a view is really a view: e.g. that changes to it are
reflected in the base array and vice versa."""
... |
from .utils import merge_dict, strip_blank, strip_none, extract, perform_request
from .utils import CommentClientRequestError
import models
import settings
class Thread(models.Model):
accessible_fields = [
'id', 'title', 'body', 'anonymous', 'anonymous_to_peers', 'course_id',
'closed', 'tags', 'v... |
#!/usr/bin/python
# coding=utf-8
###############################################################################
from test import CollectorTestCase
from test import get_collector_config
from test import unittest
from test import run_only
from mock import Mock
from mock import patch
from diamond.collector import Colle... |
import math
import numpy as np
import pickle
from os.path import join
import PIL.Image as pimg
def _shuffle_data(data):
idx = np.arange(data[0].shape[0])
np.random.shuffle(idx)
shuffled_data = []
for d in data:
if type(d) == np.ndarray:
d = d[idx]
else:
d = [d[i] for i in idx]
shuffled... |
from search import registry
from models import Type, Corporation, Alliance
registry.register(Corporation, 'corp', 'name')
registry.register(Alliance, 'alliance', 'name')
registry.register(Type, 'item', 'name',
Type.objects.filter(published=1).all())
registry.register(Type, 'tower', 'name',
Type.objects... |
import os
import apt
import gettext
t = gettext.translation('rhn-client-tools', fallback=True)
_ = t.ugettext
# FIXME: After Debian bug 187019 is resolved
def verifyPackages(packages):
cache = apt.Cache()
missing_packages = []
for package in packages:
pkg = cache[package[0]]
if pkg == None... |
from django.conf import settings
def pytest_configure():
import sys
try:
import django # NOQA
except ImportError:
print("Error: missing test dependency:")
print(" django library is needed to run test suite")
print(" you can install it with 'pip install django'")
... |
"""
This object provides quoting for GEOS geometries into PostgreSQL/PostGIS.
"""
from __future__ import unicode_literals
from psycopg2 import Binary
from psycopg2.extensions import ISQLQuote
class PostGISAdapter(object):
def __init__(self, geom, geography=False):
"Initializes on the geometry."
... |
"""
Use this module to get and run all tk tests.
tkinter tests should live in a package inside the directory where this file
lives, like test_tkinter.
Extensions also should live in packages following the same rule as above.
"""
import os
import sys
import unittest
import importlib
import test.support
this_dir_path ... |
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
import traceback
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.ovirt import (
check_sdk,
create_connection,
get_dict_of_struct,
o... |
"""Platform for the Aladdin Connect cover component."""
import logging
from aladdin_connect import AladdinConnectClient
import voluptuous as vol
from homeassistant.components.cover import (
PLATFORM_SCHEMA,
SUPPORT_CLOSE,
SUPPORT_OPEN,
CoverDevice,
)
from homeassistant.const import (
CONF_PASSWORD... |
from sickbeard.common import showLanguages
ep_regexes = [
('season only_year',
# Show.Name.2010.S01.Source.Quality.Etc-Group
'''
^((?P<series_name>.+?)[. _-]+)? # Show_Name and separator
(?P<air_... |
import unittest
import colander
from cornice_swagger.converters import convert_schema as convert
from cornice_swagger.converters import TypeConversionDispatcher
from cornice_swagger.converters.exceptions import NoSuchConverter
from ..support import AnyType, AnyTypeConverter
class ConversionTest(unittest.TestCase):... |
import argparse
from contextlib import closing
import logging
from StringIO import StringIO
from lib.utility import misc
from lib.elasticbeanstalk.model import EnvironmentTier
from scli.resources import CLISwitch, CLISwitchMsg, EBSCliAttr
from scli.constants import CommandType, ServiceDefault, ServiceRegionId, \
P... |
"""distutils.pypirc
Provides the PyPIRCCommand class, the base class for the command classes
that uses .pypirc in the distutils.command package.
"""
import os
from ConfigParser import ConfigParser
from distutils.cmd import Command
DEFAULT_PYPIRC = """\
[distutils]
index-servers =
pypi
[pypi]
use... |
# general purpose 'tooltip' routines - currently unused in idlefork
# (although the 'calltips' extension is partly based on this code)
# may be useful for some purposes in (or almost in ;) the current project scope
# Ideas gleaned from PySol
from Tkinter import *
class ToolTipBase:
def __init__(self, button):
... |
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_urllib_parse_unquote
from ..utils import (
ExtractorError,
HEADRequest,
str_to_int,
)
class MixcloudIE(InfoExtractor):
_VALID_URL = r'^(?:https?://)?(?:www\.)?mixcloud\.com/([^/]+)/([^/]+)... |
from __future__ import absolute_import, unicode_literals
import logging
import time
import unittest
from mach.logging import StructuredHumanFormatter
from mozunit import main
class DummyLogger(logging.Logger):
def __init__(self, cb):
logging.Logger.__init__(self, 'test')
self._cb = cb
def... |
'''
Copyright (c) 2015, Salesforce.com, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the foll... |
from otp.speedchat import SpeedChatGlobals
from direct.directnotify import DirectNotifyGlobal
from direct.distributed import DistributedObject
from direct.interval.IntervalGlobal import *
class DistributedWinterCarolingTarget(DistributedObject.DistributedObject):
notify = DirectNotifyGlobal.directNotify.newCategor... |
import unittest
import os
from test import test_support
import struct
MacOS = test_support.import_module('MacOS')
# The following should exist if MacOS does.
import applesingle
AS_MAGIC=0x00051600
AS_VERSION=0x00020000
dataforkdata = 'hello\r\0world\n'
resourceforkdata = 'goodbye\ncruel\0world\r'
applesingledata = s... |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
db.add_column('packages', 'pgp_signature', self.gf('django.db.models.fields.TextField')(null=True, blank=True), keep_defaul... |
#!/usr/bin/env python
""" pyURDME model file for the polarization 1D example. """
import os
import sys
import pyurdme
import dolfin
import math
import matplotlib.pyplot as plt
import numpy
# Sub domain for Periodic boundary condition
class PeriodicBoundary1D(dolfin.SubDomain):
def __init__(self, a=0.0, b=1.0):
... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
import json
from ansible.module_utils.basic import AnsibleModule
class RabbitMqPolicy(obj... |
import pytest
from flex.validation.request import (
validate_request,
)
from flex.error_messages import MESSAGES
from flex.exceptions import ValidationError
from flex.constants import (
INTEGER,
HEADER,
ARRAY,
CSV,
SSV,
TSV,
PIPES,
)
from tests.factories import (
SchemaFactory,
... |
# coding=utf-8
"""Date/time related constants."""
import datetime as dt
from tempo.utils import Enum
# Minimum and maximum points of time within which
# the library is able to operate
MIN = dt.datetime(year=1, month=1, day=1)
MAX = dt.datetime(year=9999, month=12, day=31,
hour=23, minute=59, second=... |
ANSIBLE_METADATA = {'metadata_version': '1.0',
'status': ['preview'],
'supported_by': 'community'}
import json
from ansible.module_utils.api import basic_auth_argument_spec
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.pycompat24 import get_ex... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
import re
from ansible.module_utils.six import iteritems
from ansible.module_utils.basic imp... |
# -*- encoding: utf-8 -*-
import collections
import types
from abjad.tools.topleveltools import iterate
class Selection(object):
r'''A selection of components.
'''
### CLASS VARIABLES ###
__slots__ = (
'_music',
)
### INITIALIZER ###
def __init__(self, music=None):
... |
from . import BaseCommand
from termcolor import colored
import urllib.parse
import traceback
import json
class AssignCommand(BaseCommand):
def run(self, fqdn, process_name, process_environment, **kwargs):
try:
data = {
"op": "add",
"path": "/assignments",
... |
# -*- coding: utf-8 -*-
"""
sleekxmpp.util
~~~~~~~~~~~~~~
Part of SleekXMPP: The Sleek XMPP Library
:copyright: (c) 2012 Nathanael C. Fritz, Lance J.T. Stout
:license: MIT, see LICENSE for more details
"""
from sleekxmpp.util.misc_ops import bytes, unicode, hashes, hash, \
... |
#!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2018 Fortinet, Inc.
#
# 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 Lic... |
from units.compat import unittest, mock
from hpe_test_utils import OneViewBaseTestCase
from oneview_module_loader import NetworkSetModule
FAKE_MSG_ERROR = 'Fake message error'
NETWORK_SET = dict(
name='OneViewSDK Test Network Set',
networkUris=['/rest/ethernet-networks/aaa-bbb-ccc']
)
NETWORK_SET_WITH_NEW_NA... |
data = (
'k', # 0x00
'kh', # 0x01
'g', # 0x02
'gh', # 0x03
'ng', # 0x04
'c', # 0x05
'ch', # 0x06
'j', # 0x07
'jh', # 0x08
'ny', # 0x09
'nny', # 0x0a
'tt', # 0x0b
'tth', # 0x0c
'dd', # 0x0d
'ddh', # 0x0e
'nn', # 0x0f
'tt', # 0x10
'th', # 0x11
'd', # 0x12
'dh', ... |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Info_email'
db.create_table('blogs_info_email', (
('id', self.gf('django.db.mode... |
# -*- encoding: utf-8 -*-
from abjad import *
def test_pitchtools_NamedInterval___repr___01():
interval = pitchtools.NamedInterval('perfect', 1)
repr = interval.__repr__()
assert repr == "NamedInterval('P1')"
interval = pitchtools.NamedInterval('augmented', 1)
repr = interval.__repr__()
ass... |
import sys
import subprocess
from Tkinter import *
import tkFileDialog
import FileDialog
class PyInstallerGUI:
def make_checkbutton(self, frame, text):
var = IntVar()
widget = Checkbutton(frame, text=text, variable=var)
widget.grid(sticky="NW")
return var
def __init__(self):
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.