content string |
|---|
from essentia_test import *
class TestUnaryOperator(TestCase):
testInput = [1,2,3,4,3.4,-5.0008, 100034]
def testEmpty(self):
self.assertEqualVector(UnaryOperator()([]), [])
def testOne(self):
self.assertEqualVector(UnaryOperator(type="identity")([101]), [101])
def testAbs(self):
... |
#!/usr/bin/env python
'''
Script to generate skeleton files for a new MarSystem.
Usage:
createMarSystem.py NameOfNewMarSystem
This will create the files NameOfNewMarSystem.h and NameOfNewMarSystem.cpp
if the current directory.
'''
import os
import sys
def create_from_template(template_file, template_name, tar... |
# coding=utf-8
"""
Collects data from one or more Redis Servers
#### Dependencies
* redis
#### Notes
The collector is named an odd redisstat because of an import issue with
having the python library called redis and this collector's module being called
redis, so we use an odd name for this collector. This doesn't... |
month = int(input("Please enter your birthday month"))
day = int(input("Please enter your birthday day"))
if month == 1:
if day < 20:
print("Capricorn")
else:
print("Aquarius")
if month == 2:
if day < 20:
print("Aquarius")
else:
print("Pisces")
if month == 3:
if day <... |
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'network'}
import re
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.six import iteritems
from ansible.module_utils.network.vyos.vyos import run_commands
from a... |
import unittest
from girder.utility import path
strings = [
('abcd', 'abcd'),
('/', '\/'),
('\\', '\\\\'),
('/\\', '\/\\\\'),
('\\//\\', '\\\\\/\/\\\\'),
('a\\\\b//c\\d', 'a\\\\\\\\b\/\/c\\\\d')
]
paths = [
('abcd', ['abcd']),
('/abcd', ['', 'abcd']),
('/ab/cd/ef/gh', ['', 'ab', 'c... |
import logging
from django.conf import settings
from django.http import HttpResponseRedirect, HttpResponse
from django.template.response import TemplateResponse
from django.utils.http import is_safe_url
from django.shortcuts import resolve_url
from django.views.decorators.debug import sensitive_post_parameters
from dj... |
"""Fichier définissant les unittest de talents de guilde."""
import unittest
from test.primaires.joueur.static.joueur import ManipulationJoueur
class TestTalent(ManipulationJoueur, unittest.TestCase):
"""Unittest des talents de guilde."""
def test_creation(self):
"""Test l'ajout de talents à des gu... |
from __future__ import with_statement
import collections
import errno
import filecmp
import os.path
import re
import tempfile
import sys
# A minimal memoizing decorator. It'll blow up if the args aren't immutable,
# among other "problems".
class memoize(object):
def __init__(self, func):
self.func = func
s... |
"""
# Name: check_answer_api/utilities/answer_formatter.py
# Description:
# Created by: Martinus Alexander
# Date Created: Nov 30, 2016
# Last Modified: Dec 21, 2016
# Modified by: Martinus Alexander
"""
import re
'''
Splitting a sequence of character into a list of terms.
Used improve trigonometri... |
"""Tests for BatchNorm Bijector."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.contrib import distributions
from tensorflow.contrib.distributions.python.ops import test_util
from tensorflow.contrib.distributions.pyth... |
from m5.objects import *
from arm_generic import *
import switcheroo
root = LinuxArmFSSwitcheroo(
mem_class=SimpleMemory,
cpu_classes=(AtomicSimpleCPU, AtomicSimpleCPU)
).create_root()
# Setup a custom test method that uses the switcheroo tester that
# switches between CPU models.
run_test = switcheroo.ru... |
import os
import re
import six
import subprocess
from tempest.tests import base
class TestTestList(base.TestCase):
def test_testr_list_tests_no_errors(self):
# Remove unit test discover path from env to test tempest tests
test_env = os.environ.copy()
test_env.pop('OS_TEST_PATH')
... |
"""
Implementation the CyberSource credit card processor.
IMPORTANT: CyberSource will deprecate this version of the API ("Hosted Order Page") in September 2014.
We are keeping this implementation in the code-base for now, but we should
eventually replace this module with the newer implementation (in `CyberSource2.py`)... |
"""Count strings and words for supported localization files.
These include: XLIFF, TMX, Gettex PO and MO, Qt .ts and .qm, Wordfast TM, etc
See: http://docs.translatehouse.org/projects/translate-toolkit/en/latest/commands/pocount.html
for examples and usage instructions.
"""
from __future__ import print_function
imp... |
import sys, os
if os.path.isfile("/usr/lib/enigma2/python/enigma.zip"):
sys.path.append("/usr/lib/enigma2/python/enigma.zip")
from Tools.Profile import profile, profile_final
profile("PYTHON_START")
import Tools.RedirectOutput
import enigma
import eConsoleImpl
import eBaseImpl
enigma.eTimer = eBaseImpl.eTimer
enigma... |
from __future__ import (absolute_import, division, print_function)
import copy
import pytest
from ansible.compat.tests.mock import MagicMock, Mock, patch
from ansible.module_utils import basic
from units.modules.utils import set_module_args
boto3 = pytest.importorskip("boto3")
# lambda is a keyword so we have to h... |
import numpy, glumpy
import OpenGL.GL as gl
class Mesh(object):
def __init__(self, n=64):
self.indices = numpy.zeros((n-1,n-1,4), dtype=numpy.float32)
self.vertices = numpy.zeros((n,n,3), dtype=numpy.float32)
self.texcoords= numpy.zeros((n,n,2), dtype=numpy.float32)
for xi in range... |
from twisted.trial import unittest
from twisted.words.protocols.jabber.xmpp_stringprep import nodeprep, resourceprep, nameprep, crippled
class XMPPStringPrepTest(unittest.TestCase):
"""
The nodeprep stringprep profile is similar to the resourceprep profile,
but does an extra mapping of characters (table ... |
# -*- coding: utf-8 -*-
"""
%store magic for lightweight persistence.
Stores variables, aliases and macros in IPython's database.
To automatically restore stored variables at startup, add this to your
:file:`ipython_config.py` file::
c.StoreMagics.autorestore = True
"""
from __future__ import print_function
#-----... |
import unittest, sys, time
sys.path.extend(['.','..','../..','py'])
import h2o, h2o_cmd, h2o_import as h2i, h2o_glm, h2o_common, h2o_exec as h2e
import h2o_print
DO_GLM = True
LOG_MACHINE_STATS = False
# fails during exec env push ..second import has to do a key delete (the first)
DO_DOUBLE_IMPORT = False
print "Ass... |
"""
Bootstrapper for nose/pytest plugins.
The entire rationale for this system is to get the modules in plugin/
imported without importing all of the supporting library, so that we can
set up things for testing before coverage starts.
The rationale for all of plugin/ being *in* the supporting library in the
first pla... |
from __future__ import unicode_literals
import datetime
import decimal
from django.contrib.auth import get_permission_codename
from django.db import models
from django.db.models.constants import LOOKUP_SEP
from django.db.models.deletion import Collector
from django.forms.forms import pretty_name
from django.utils imp... |
# -*- coding: utf-8 -*-
"""
flask.signals
~~~~~~~~~~~~~
Implements signals based on blinker if available, otherwise
falls silently back to a noop.
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
signals_available = False
try:
from blinker import Nam... |
__author__ = 'zhaoyang.szy'
import os,sys
import response
parentdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0,parentdir)
import aliyunExtensionCliHandler
class ConfigCmd:
showConfig = 'showConfig'
importConfig = 'importConfig'
exportConfig = 'exportConfig'
name = '... |
"""BibFormat element - Prints full-text URLs
"""
__revision__ = "$Id$"
def format_element(bfo, style, separator='; '):
"""
This is the default format for formatting full-text URLs.
@param separator: the separator between urls.
@param style: CSS class of the link
"""
urls_u = bfo.fields("8564_u... |
import glob
import optparse
import os
import shutil
import subprocess
import sys
def reorder_imports(input_dir, output_dir, architecture):
"""Run swapimports.exe on the initial chrome.exe, and write to the output
directory. Also copy over any related files that might be needed
(pdbs, manifests etc.).
"""
in... |
"""Helper script for PPAPI's PRESUBMIT.py to detect if additions or removals of
PPAPI interfaces have been propagated to the Native Client libraries (.dsc
files).
For example, if a user adds "ppapi/c/foo.h", we check that the interface has
been added to "native_client_sdk/src/libraries/ppapi/library.dsc".
"""
import ... |
import logging
import dogstats_wrapper as dog_stats_api
from .grading_service_module import GradingService
from opaque_keys.edx.keys import UsageKey
log = logging.getLogger(__name__)
class PeerGradingService(GradingService):
"""
Interface with the grading controller for peer grading
"""
METRIC_NAME... |
# Exceptions
class StripeError(Exception):
def __init__(self, message=None, http_body=None, http_status=None,
json_body=None):
super(StripeError, self).__init__(message)
if http_body and hasattr(http_body, 'decode'):
try:
http_body = http_body.decode('u... |
import base64
import io
import hashlib
import hmac
import random
from .stream import Stream
from .wrappers import StreamIOThreadWrapper, StreamIOIterWrapper
from ..buffers import Buffer
from ..compat import str, bytes, urlparse
from ..exceptions import StreamError
from ..utils import swfdecompress
from ..packages.fl... |
#!/usr/bin/env python
"""
Compare capillary vs. lobSTR calls
This script is part of lobSTR_validation_suite.sh and
is not mean to be called directly.
"""
import argparse
import numpy as np
import pandas as pd
import sys
from scipy.stats import pearsonr
def ConvertSample(x):
"""
Convert HGDP samples numbers t... |
from __future__ import print_function
import mxnet as mx
import argparse
import time
def parse_args():
parser = argparse.ArgumentParser(description='Set network parameters for benchmark test.')
parser.add_argument('--profile_filename', type=str, default='profile_matmul_20iter.json')
parser.add_argument('-... |
{
'name': 'Sales and MRP Management',
'version': '1.0',
'category': 'Hidden',
'description': """
This module provides facility to the user to install mrp and sales modulesat a time.
====================================================================================
It is basically used when we want to... |
import os
import logging
import shutil
import vmdk_utils
import vsan_info
import volume_kv as kv
import vsan_info
ERROR_NO_VSAN_DATASTORE = 'Error: VSAN datastore does not exist'
def create(name, content):
"""
Create a new storage policy and save it as dockvols/policies/name in
the VSAN datastore. If ther... |
# -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para watchfreeinhd
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os
from core... |
import doctest
import pickle
import six
import warnings
from helpers import unittest, LuigiTestCase
from datetime import datetime, timedelta
import luigi
import luigi.task
import luigi.util
import collections
from luigi.task_register import load_task
class DummyTask(luigi.Task):
param = luigi.Parameter()
b... |
"""DNS Opcodes."""
import dns.exception
QUERY = 0
IQUERY = 1
STATUS = 2
NOTIFY = 4
UPDATE = 5
_by_text = {
'QUERY' : QUERY,
'IQUERY' : IQUERY,
'STATUS' : STATUS,
'NOTIFY' : NOTIFY,
'UPDATE' : UPDATE
}
# We construct the inverse mapping programmatically to ensure that we
# cannot make any mistake... |
from __future__ import absolute_import
import six
ERR_OK = 0
ERR_BAD_PARAMS = 21
ERR_BAD_ADDR = 22
ERR_BAD_NIC = 23
ERR_USED_NIC = 24
ERR_BAD_BONDING = 25
ERR_BAD_VLAN = 26
ERR_BAD_BRIDGE = 27
ERR_USED_BRIDGE = 28
ERR_FAILED_IFUP = 29
ERR_FAILED_IFDOWN = 30
ERR_USED_BOND = 31
ERR_LOST_CONNECTION = 10 # noConPeer
E... |
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""
Test file created by XlsxWriter against a file created by Excel.
"""
def setUp(self):
self.maxDiff = None
filename = 'rich_string07.xlsx'
... |
import os
import sys
from metadata import MetadataUpdateRunner
from sync import SyncFromUpstreamRunner
from tree import GitTree, HgTree, NoVCSTree
from .. import environment as env
from base import Step, StepRunner, exit_clean, exit_unclean
from state import State
def setup_paths(sync_path):
sys.path.insert(0, o... |
__all__ = ['synchronized', 'lazy_property']
from functools import wraps
from inspect import getsourcefile
class lazy_property(object):
""" Decorator for a lazy property of an object, i.e., an object attribute
that is determined by the result of a method call evaluated once. To
reevaluate the prop... |
# -*- coding: utf-8 -*-
"""
oauthlib.utils
~~~~~~~~~~~~~~
This module contains utility methods used by various parts of the OAuth
spec.
"""
import string
import urllib2
from oauthlib.common import quote, unquote
UNICODE_ASCII_CHARACTER_SET = (string.ascii_letters.decode('ascii') +
string.digits.decode('ascii')... |
"""Abstract Base Classes (ABCs) for collections, according to PEP 3119.
Unit tests are in test_collections.
"""
from abc import ABCMeta, abstractmethod
import sys
__all__ = ["Hashable", "Iterable", "Iterator",
"Sized", "Container", "Callable",
"Set", "MutableSet",
"Mapping", "Mutable... |
""" Module baseWobjects
Defines the mix class for orientable wobjects.
"""
import numpy as np
from visvis.core import misc
from visvis.pypoints import Point, is_Point
# todo: is this the best way to allow users to orient their objects,
# or might there be other ways?
class OrientationForWobjects_mixClass(object):
... |
from newspaper import Article, Config
from bs4 import BeautifulSoup
from urllib2 import urlopen
import datetime
import re
from collections import OrderedDict
import pytz
from pytz import timezone
from dateutil.parser import parse
nba_url = "http://www.nba.com"
espn_url = "http://espn.go.com"
#lxml didn't work for es... |
from __future__ import unicode_literals
import six
import requests
from django.conf import settings
from django.core.mail.backends.base import BaseEmailBackend
from django.core.mail.message import sanitize_address
from requests.packages.urllib3.filepost import encode_multipart_formdata
__version__ = '0.7.1'
version ... |
import inspect
import logging
from importlib import import_module
from jinja2 import Markup
from udata import assets, entrypoints
from .markdown import UdataCleaner, init_app as init_markdown
log = logging.getLogger(__name__)
class SafeMarkup(Markup):
'''Markup object bypasses Jinja's escaping. This override... |
#
# iso2022_jp_2.py: Python Unicode Codec for ISO2022_JP_2
#
# Written by Hye-Shik Chang <<EMAIL>>
#
import _codecs_iso2022, codecs
import _multibytecodec as mbc
codec = _codecs_iso2022.getcodec('iso2022_jp_2')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class IncrementalEncoder(m... |
"""
Small app demonstrating a dynamic UI
Author: ZenCODE
Date: 22/10/2013
"""
from kivy.lang import Builder
from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy.factory import Factory
class DataSource(object):
"""
This class would be an abstraction of your data source:
the MySQLdb... |
"""
This file contains receivers of course publication signals.
"""
import logging
from django.dispatch import receiver
from django.utils import timezone
from opaque_keys.edx.keys import CourseKey
from openedx.core.djangoapps.signals.signals import COURSE_GRADE_CHANGED
log = logging.getLogger(__name__)
def on_cou... |
from test_framework import BitcoinTestFramework
from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException
from decimal import Decimal
from util import *
import os
import shutil
class TxnMallTest(BitcoinTestFramework):
def add_options(self, parser):
parser.add_option("--mineblock", dest="mine_blo... |
import pytest
import decimal
import numpy as np
import pandas as pd
from pandas import to_numeric, _np_version_under1p9
from pandas.util import testing as tm
from numpy import iinfo
class TestToNumeric(object):
def test_empty(self):
# see gh-16302
s = pd.Series([], dtype=object)
res = ... |
#!/usr/bin/python
""" PN CLI trunk-create/trunk-delete/trunk-modify """
#
# This file is part of Ansible
#
# Ansible 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 y... |
from PathFilter import PathFilter
## A PathFilter which filters based on an item from Path.info() and an
# arbitrary match function.
class InfoPathFilter( PathFilter ) :
def __init__( self, infoKey, matcher, leafOnly=True, userData={} ) :
PathFilter.__init__( self, userData )
self.__infoKey = infoKey
self.... |
from __future__ import unicode_literals
# TODO add tests for all of these
EQ_FUNCTION = lambda item_value, test_value: item_value == test_value # flake8: noqa
NE_FUNCTION = lambda item_value, test_value: item_value != test_value # flake8: noqa
LE_FUNCTION = lambda item_value, test_value: item_value <= test_value # ... |
'''
Test for deleting vm iso check vm all operations and expunge vm check change os.
@author: SyZhao
'''
import os
import apibinding.inventory as inventory
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_state as test_state
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecke... |
# -*- coding: iso-8859-1 -*-
from Components.Language import language
from Components.ActionMap import ActionMap
from Components.Label import Label
from Components.Pixmap import Pixmap
from Components.MenuList import MenuList
from Components.MultiContent import MultiContentEntryText, MultiContentEntryPixmapAlphaTest
fr... |
"""Test using SlipStream with an unbuffered file"""
from sliplib import encode, SlipStream
from .test_data import data, BaseFileTest
class TestUnbufferedFileAccess(BaseFileTest):
"""Test unbuffered SLIP file access."""
def test_reading_slip_file(self):
"""Test reading SLIP-encoded message"""
... |
"""Abstract Base Classes (ABCs) according to PEP 3119."""
import types
from _weakrefset import WeakSet
# Instance of old-style class
class _C: pass
_InstanceType = type(_C())
def abstractmethod(funcobj):
"""A decorator indicating abstract methods.
Requires that the metaclass is ABCMeta or derived from it.... |
# -*- encoding: utf-8 -*-
from __future__ import unicode_literals
import codecs
import os
import shutil
import tempfile
from django.conf import settings
from django.core.management import call_command
from django.template import Context, Template
from django.test import SimpleTestCase, override_settings
from django.u... |
from tkinter import Tk
from canvas3d import Canvas3D, Frame3D, roty
from scene import Thing3D as dot
root = Tk()
root.title("Rotating Cube Demo")
c = Canvas3D(root)
c.pack(expand=1, fill='both')
# Zoom out a little.
c.frame.T.z += -300.0
# Create a dot at world origin (0, 0, 0).
origin = dot(c, width=4)
c.frame.t... |
from django.core.management.base import BaseCommand, make_option, CommandError
from time import time
import path
from django.db import transaction
class Command(BaseCommand):
help = "From Tweet Parser results, extract words and connect with messages for a dataset."
args = '<dataset_id> <parsed_filename> [...]'... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
"""
oauthlib.oauth1.rfc5849.signature
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module represents a direct implementation of `section 3.4`_ of the spec.
Terminology:
* Client: software interfacing with an OAuth API
* Server: the API provider
* Resource Ow... |
import unittest
import textwrap
import antlr3
import antlr3.tree
import testbase
class T(testbase.ANTLRTest):
def walkerClass(self, base):
class TWalker(base):
def __init__(self, *args, **kwargs):
base.__init__(self, *args, **kwargs)
self.traces = []
... |
import gio
from mutagen import File as MutagenFile
from mutagen.asf import ASF
from mutagen.apev2 import APEv2File
from mutagen.flac import FLAC
from mutagen.id3 import ID3FileType
from mutagen.oggflac import OggFLAC
from mutagen.oggspeex import OggSpeex
from mutagen.oggtheora import OggTheora
from mutagen.oggvorbis i... |
NETWORK = 'network'
SUBNET = 'subnet'
PORT = 'port'
SECURITY_GROUP = 'security_group'
L2POPULATION = 'l2population'
DVR = 'dvr'
CREATE = 'create'
DELETE = 'delete'
UPDATE = 'update'
AGENT = 'q-agent-notifier'
PLUGIN = 'q-plugin'
L3PLUGIN = 'q-l3-plugin'
DHCP = 'q-dhcp-notifer'
FIREWALL_PLUGIN = 'q-firewall-plugin'
ME... |
import gobject
import subprocess
import signal
import sys
import dbus.service
import threading
import re
# Logging
import logging
logger = logging.getLogger(__name__)
NAME = "GameWrap"
VERSION = "0.1"
BUS_NAME = "org.gnome15.GameWrap"
OBJECT_PATH = "/org/gnome15/GameWrap"
IF_NAME = "org.gnome15.GameWrap"
class R... |
"""
Ax_Metrics - MDefL Metric Definition Language Parser
------------------------------------------------------------------------------
Author: Dan Kamins <dos at axonchisel dot net>
Copyright (c) 2014 Dan Kamins, AxonChisel.net
"""
# ----------------------------------------------------------------------------
imp... |
try:
import json
except ImportError:
import simplejson as json
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.ec2 import ec2_argument_spec, connect_to_aws, get_aws_connection_info
from ansible.module_utils.pycompat24 import get_exception
try:
import boto
import boto.ec2... |
import datetime
import posixpath
from django import forms
from django.core import checks
from django.core.files.base import File
from django.core.files.images import ImageFile
from django.core.files.storage import default_storage
from django.db.models import signals
from django.db.models.fields import Field
from djang... |
from __future__ import print_function
"""
ROS msg library for Python
Implements: U{http://ros.org/wiki/msg}
"""
import os
import sys
from . base import InvalidMsgSpec, EXT_MSG, MSG_DIR, SEP, log
from . names import is_legal_resource_name, is_legal_resource_base_name, package_resource_name, resource_name
#TODOXXX: ... |
import sys
from django.db.backends.base.creation import BaseDatabaseCreation
class DatabaseCreation(BaseDatabaseCreation):
def _quote_name(self, name):
return self.connection.ops.quote_name(name)
def _get_database_create_suffix(self, encoding=None, template=None):
suffix = ""
if enc... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
fastq_get_pairs
Description: Retrieve paired and singleton reads from a single fastq file
fastq_get_pairs.py -i input.fq
-----------------------------------------------------------------------
Author: This software is written and maintained by Pierre Pericard
(<... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from coursewarehistoryextended.fields import UnsignedBigIntOneToOneField
class Migration(migrations.Migration):
dependencies = [
('grades', '0012_computegradessetting'),
]
operations = [
... |
import unittest2 as unittest
from webkitpy.common.system.outputcapture import OutputCapture
from webkitpy.tool.mocktool import MockOptions, MockTool
from webkitpy.tool.steps.applywatchlist import ApplyWatchList
class ApplyWatchListTest(unittest.TestCase):
def test_apply_watch_list_local(self):
capture = ... |
from datetime import datetime, timedelta
from dateutil import rrule
from indico.modules.scheduler.tasks.periodic import PeriodicTask, TaskOccurrence
from indico.tests.python.unit.util import IndicoTestCase
class TestPeriodicTask(IndicoTestCase):
def testPeriodicTaskFrequency(self):
dt = datetime(2010, 1... |
from django import template
from django.apps import apps
from private_sharing.models import project_membership_visible
from public_data.models import is_public
register = template.Library()
@register.simple_tag
def source_is_connected(source, user):
"""
Return True if the given source is connected (has the ... |
from __future__ import division, absolute_import, print_function
import warnings
import numpy as np
from numpy.testing import (assert_, TestCase, assert_array_equal,
assert_allclose, run_module_suite)
from numpy.compat import sixu
rlevel = 1
class TestRegression(TestCase):
def test_m... |
import hr_timesheet_invoice_create
import hr_timesheet_analytic_profit
import hr_timesheet_final_invoice_create
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
import re
import pyauto_functional
import pyauto
class MultiprofileTest(pyauto.PyUITest):
"""Tests for Multi-Profile / Multi-users"""
_RESTORE_STARTUP_URL_VALUE = 4
_RESTORE_LASTOPEN_URL_VALUE = 1
_RESTORE_DEFAULT_URL_VALUE = 0
def Debug(self):
"""Test method for experimentation.
This method wil... |
import warnings
from django.conf import settings
from django.template import Context, Template
from django.template.loader import render_to_string
from django.utils.html import conditional_escape
from crispy_forms.compatibility import string_types, text_type
from crispy_forms.utils import render_field, flatatt
TEMPL... |
import os, os.path, gobject, re, gtk
import tempfile
from gdebug import debug
from OptionParser import args
from util import windows
tmpdir = tempfile.gettempdir()
if args.gourmetdir:
gourmetdir = args.gourmetdir
debug("User specified gourmetdir %s"%gourmetdir,0)
else:
if os.name =='nt':
# Under W... |
from __future__ import print_function
# $example on$
from pyspark.ml.feature import OneHotEncoder
# $example off$
from pyspark.sql import SparkSession
if __name__ == "__main__":
spark = SparkSession\
.builder\
.appName("OneHotEncoderExample")\
.getOrCreate()
# Note: categorical featur... |
#!/usr/bin/env python
from pyomxplayer import OMXPlayer
import RPi.GPIO as GPIO
import pprint
import random
import socket
import struct
import sys
import time
import traceback
DRAWERS = 9
MCAST_GRP = '224.19.79.1'
MCAST_PORT = 9999
MOVIE_PATH = '/usr/share/lumiere/media'
MOVIE_SUFFIX = 'mp4'
MOVIE_LIST = [ '%s/%d.%s... |
# -*- coding: utf-8 -*-
"""
***************************************************************************
PointSelectionPanel.py
---------------------
Date : February 2016
Copyright : (C) 2016 by Alexander Bruy
Email : alexander dot bruy at gmail dot com
****... |
#!/usr/bin/python
import tweepy, sys, os
from collections import Counter
import re
import argparse # requires 2.7
import time
class TweepyHelper:
def __init__(self,keyfile):
f = open(keyfile)
lines = f.readlines()
f.close()
consumerkey = lines[0].split("#")[0]
consumersecre... |
"""
Template file used by the OPF Experiment Generator to generate the actual
description.py file by replacing $XXXXXXXX tokens with desired values.
This description.py file was generated by:
'~/nta/eng/lib/python2.6/site-packages/nupic/frameworks/opf/expGenerator/ExpGenerator.py'
"""
from nupic.frameworks.opf.expdes... |
from shutil import rmtree
from datacats.environment import Environment, DatacatsError
from datacats.cli.util import y_or_n_prompt
from datacats.error import DatacatsError
from datacats.task import get_format_version
def purge(opts):
"""Purge environment database and uploaded files
Usage:
datacats purge [-s NA... |
#!/bin/bash
"""
makenpz.py DIRECTORY
Build a npz containing all data files in the directory.
"""
import os
import numpy as np
from optparse import OptionParser
def main():
p = OptionParser()
options, args = p.parse_args()
if len(args) != 1:
p.error("no valid directory given")
inp = args[0]
... |
import time
from report import report_sxw
class buyer_form_report(report_sxw.rml_parse):
count=0
c=0
def __init__(self, cr, uid, name, context):
super(buyer_form_report, self).__init__(cr, uid, name, context=context)
self.localcontext.update({
'time': time,
'sum_taxe... |
# (c) 2012-2014, Michael DeHaan <<EMAIL>>
# (c) 2015 Toshio Kuratomi <<EMAIL>>
# (c) 2017, Peter Sprygada <<EMAIL>>
# (c) 2017 Ansible Project
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import fcntl
import os
import shlex
from abc import abstractmethod, abstractproperty
fr... |
# Wrapper module for _socket, providing some additional facilities
# implemented in Python.
"""\
This module provides socket operations and some related functions.
On Unix, it supports IP (Internet Protocol) and Unix domain sockets.
On other systems, it only supports IP. Functions specific for a
socket are available a... |
import os, cherrypy, urllib
from cherrypy.lib.static import serve_file
from mako.template import Template
from mako.lookup import TemplateLookup
from mako import exceptions
import threading, time
import lazylibrarian
from lazylibrarian import logger, importer, database, postprocess, formatter
from lazylibrarian.sear... |
from oslo_log import log as logging
from sqlalchemy import Index, MetaData, Table
from nova.i18n import _LI
LOG = logging.getLogger(__name__)
def _get_deleted_expire_index(table):
members = sorted(['deleted', 'expire'])
for idx in table.indexes:
if sorted(idx.columns.keys()) == members:
... |
# -*- coding: utf-8 -*-
"""
Created on Wed Feb 15 12:40:19 2017
@author: Andrew Ruba
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
(a... |
import time
import logging
from pyasn1.compat.octets import octs2ints
from pyasn1 import error
from pyasn1 import __version__
flagNone = 0x0000
flagEncoder = 0x0001
flagDecoder = 0x0002
flagAll = 0xffff
flagMap = {
'encoder': flagEncoder,
'decoder': flagDecoder,
'all': flagAll
}
class Prin... |
"""
This module provides the Movie class, used to store information about
a given movie.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
from copy import deepcopy
from imdb import linguistics
from imdb.utils import _Container
from imdb.utils import analyze_title, build_title, c... |
import time
from openerp.osv import fields, osv
import openerp.addons.decimal_precision as dp
from openerp.tools.translate import _
class account_bank_statement(osv.osv):
_inherit = 'account.bank.statement'
def write(self, cr, uid, ids, vals, context=None):
if context is None:
context = {}... |
data = (
'[?]', # 0x00
'N', # 0x01
'N', # 0x02
'H', # 0x03
'[?]', # 0x04
'a', # 0x05
'aa', # 0x06
'i', # 0x07
'ii', # 0x08
'u', # 0x09
'uu', # 0x0a
'R', # 0x0b
'L', # 0x0c
'[?]', # 0x0d
'e', # 0x0e
'ee', # 0x0f
'ai', # 0x10
'[?]', # 0x11
'o', # 0x12
'oo', # 0x... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.