content string |
|---|
from openerp.osv import osv
import time
from openerp.report import report_sxw
def titlize(journal_name):
words = journal_name.split()
while words.pop() != 'journal':
continue
return ' '.join(words)
class order(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
super(order, self)... |
import itch.tank_scratch
import nose.plugins
class TankScratchNosePlugin(nose.plugins.Plugin):
"""
Adds Tank scratch setup and teardown capability to tests.
.. versionadded:: 0.6.0
"""
name = 'tank-scratch'
score = 1 # run early
def __init__(self):
"""
.. vers... |
"""util.py - General utilities for running, loading, and processing benchmarks
"""
import json
import os
import tempfile
import subprocess
import sys
# Input file type enumeration
IT_Invalid = 0
IT_JSON = 1
IT_Executable = 2
_num_magic_bytes = 2 if sys.platform.startswith('win') else 4
def is_executable_file... |
import os
import boto
from boto.utils import get_instance_metadata, get_instance_userdata
from boto.pyami.config import Config, BotoConfigPath
from boto.pyami.scriptbase import ScriptBase
import time
class Bootstrap(ScriptBase):
"""
The Bootstrap class is instantiated and run as part of the PyAMI
instance ... |
#!/usr/bin/env python
from selenium import webdriver
import os
import traceback
import time
from selenium import webdriver
from platform import platform
import socket
from sys import argv
port = 13013
if len(argv) >= 2:
port = int(argv[1])
path = os.path
dirname = path.abspath(path.dirname(__file__))
chromedriv... |
import os, sys
sys.path.append(os.environ['PERF_EXEC_PATH'] + '/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
from Util import *
process_names = {}
thread_thislock = {}
thread_blocktime = {}
lock_waits = {} # long-lived stats on (tid,lock) blockage elapsed time
process_names = {} # long-lived pid-to-execname mappin... |
"""Registration facilities for DOM. This module should not be used
directly. Instead, the functions getDOMImplementation and
registerDOMImplementation should be imported from xml.dom."""
from xml.dom.minicompat import * # isinstance, StringTypes
# This is a list of well-known implementations. Well-known names
# sho... |
from __future__ import print_function
from multiprocessing import Pool
from functools import partial
import multiprocessing
import os
import sys
import glob
import warnings
import dlib
import skimage
import argparse
import itertools
import traceback
import uuid
# Now let's use the detector as you would in a normal... |
#!/usr/bin/env python
import linuxcnc_util
import hal
import time
import sys
import os
# this is how long we wait for linuxcnc to do our bidding
timeout = 5.0
# unbuffer stdout
sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0)
def wait_for_pin_value(pin_name, value, timeout=5.0):
start_time = time.time()
... |
{
'name': 'HR Holidays Extension',
'version': '1.0',
'category': 'Generic Modules/Human Resources',
'description': """
Extended Capabilities for HR Holidays (Leaves)
==============================================
* When calculating the number of leave days take into account the
employee's sch... |
from __future__ import absolute_import, print_function, unicode_literals, division
from jormungandr.parking_space_availability.abstract_provider_manager import AbstractProviderManager
POI_TYPE_ID = 'poi_type:amenity:parking'
class CarParkingProviderManager(AbstractProviderManager):
def __init__(self, car_park_pr... |
"""
unixccompiler - can handle very long argument lists for ar.
"""
from __future__ import division, absolute_import, print_function
import os
from distutils.errors import DistutilsExecError, CompileError
from distutils.unixccompiler import *
from numpy.distutils.ccompiler import replace_method
from numpy.distutils.... |
from __future__ import absolute_import
import sys
from django.core.exceptions import PermissionDenied, SuspiciousOperation
from django.core.urlresolvers import get_resolver
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render_to_response, render
from django.template import Co... |
_GENERATED_ON = '2014-05-23'
_MYSQL_VERSION = (5, 7, 4)
"""This module contains the MySQL Server Character Sets"""
MYSQL_CHARACTER_SETS = [
# (character set name, collation, default)
None,
("big5", "big5_chinese_ci", True), # 1
("latin2", "latin2_czech_cs", False), # 2
("dec8", "dec8_swedish_ci"... |
# -*- coding: UTF-8 -*-
__kupfer_name__ = _("VirtualBox")
__kupfer_sources__ = ("VBoxMachinesSource", )
__description__ = _("Control VirtualBox Virtual Machines. "
"Supports both Sun VirtualBox and Open Source Edition.")
__version__ = "0.4"
__author__ = "Karol Będkowski <<EMAIL>>"
from kupfer.obje... |
from django.conf import settings
from django.template.base import Lexer, Parser, tag_re, NodeList, VariableNode, TemplateSyntaxError
from django.utils.encoding import force_unicode
from django.utils.html import escape
from django.utils.safestring import SafeData, EscapeData
from django.utils.formats import localize
cl... |
from ctypes import byref, c_int
from datetime import date, datetime, time
from django.contrib.gis.gdal.base import GDALBase
from django.contrib.gis.gdal.error import GDALException
from django.contrib.gis.gdal.prototypes import ds as capi
from django.utils.encoding import force_text
# For more information, see the OG... |
import logging
from django.core.management.base import BaseCommand
from ngw.core import perms
from ngw.core.models import GROUP_EVERYBODY, Contact
class Command(BaseCommand):
help = 'Recover lost contacts'
def handle(self, *args, **options):
logger = logging.getLogger('contactrecover')
hand... |
"""
Hebrew-language mappings for language-dependent features of Docutils.
"""
__docformat__ = 'reStructuredText'
labels = {
# fixed: language-dependent
'author': u'\u05de\u05d7\u05d1\u05e8',
'authors': u'\u05de\u05d7\u05d1\u05e8\u05d9',
'organization': u'\u05d0\u05e8\u05d2\u05d5\u05df',
... |
"""
Estimator Transformer Param Example.
"""
from __future__ import print_function
# $example on$
from pyspark.ml.linalg import Vectors
from pyspark.ml.classification import LogisticRegression
# $example off$
from pyspark.sql import SparkSession
if __name__ == "__main__":
spark = SparkSession\
.builder\
... |
__kupfer_name__ = _("Epiphany Bookmarks")
__kupfer_sources__ = ("EpiphanySource", )
__description__ = _("Index of Epiphany bookmarks")
__version__ = ""
__author__ = "Ulrik Sverdrup <<EMAIL>>"
import os
from kupfer.objects import Source
from kupfer.objects import UrlLeaf
from kupfer.obj.apps import AppLeafContentMixin... |
import unittest
import tkinter
from tkinter import ttk
from test.support import requires, run_unittest
import tkinter.test.support as support
requires('gui')
class StyleTest(unittest.TestCase):
def setUp(self):
self.style = ttk.Style()
def test_configure(self):
style = self.style
s... |
import unittest
from cStringIO import StringIO
from ..backends import static
# There aren't many tests here because it turns out to be way more convenient to
# use test_serializer for the majority of cases
class TestStatic(unittest.TestCase):
def parse(self, input_str):
return self.parser.parse(StringI... |
from django.core.exceptions import ImproperlyConfigured
from django.utils import lru_cache, six
from django.utils.functional import cached_property
from django.utils.module_loading import import_string
from .base import Context, Template
from .context import _builtin_context_processors
from .exceptions import Template... |
"""
Amazon OAuth2 backend, docs at:
https://python-social-auth.readthedocs.io/en/latest/backends/amazon.html
"""
import ssl
from .oauth import BaseOAuth2
class AmazonOAuth2(BaseOAuth2):
name = 'amazon'
ID_KEY = 'user_id'
AUTHORIZATION_URL = 'https://www.amazon.com/ap/oa'
ACCESS_TOKEN_URL = 'https... |
from openerp.osv import fields, osv
class account_common_journal_report(osv.osv_memory):
_name = 'account.common.journal.report'
_description = 'Account Common Journal Report'
_inherit = "account.common.report"
_columns = {
'amount_currency': fields.boolean("With Currency", help="Print Report w... |
#!/usr/bin/env python
__author__ = 'Andrew Dunai <<EMAIL>>'
import sys
import json
import argparse
import re
from collections import namedtuple
try:
from PyQt4 import QtGui
import argparseui
except ImportError:
CAN_GUI = False
else:
CAN_GUI = True
range_regexp = re.compile(r'^([\w\d]+)\=([\d]+)\.\.([... |
'''Experimenting with the new JSON-RPC Server
'''
import sys
import datetime
import logging
from environment import settings, local_dir
from siro.core.api import siro_api
from djpcms import http
from django.core.handlers import wsgi
from gevent.wsgi import WSGIServer
class WSGIHandler(wsgi.WSGIHandler)... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import re
from ansible.plugins.terminal import TerminalBase
from ansible.errors import AnsibleConnectionFailure
class TerminalModule(TerminalBase):
terminal_prompts_re = [
re.compile(r"[\r\n]?[\w+\-\.:\/\[... |
import io
import json
import os
import html5lib
import pytest
from selenium import webdriver
from wptserver import WPTServer
ENC = 'utf8'
HERE = os.path.dirname(os.path.abspath(__file__))
WPT_ROOT = os.path.normpath(os.path.join(HERE, '..', '..'))
HARNESS = os.path.join(HERE, 'harness.html')
def pytest_addoption(pa... |
# #!/usr/bin/env python
# # -*- coding: utf-8 -*-
# import os
# import math
# import mapnik
# import sys
# from utilities import execution_path, run_all
# from nose.tools import *
# def setup():
# # All of the paths used are relative, if we run the tests
# # from another directory we need to chdir()
# os.... |
from __future__ import absolute_import
import numpy as nm
from sfepy.base.base import output, assert_, get_default, Struct
from sfepy.homogenization.coefs_base import CorrSolution, \
TCorrectorsViaPressureEVP, CorrMiniApp
from sfepy.solvers.ts import TimeStepper
from six.moves import range
class PressureRHSVecto... |
from django.template import TemplateSyntaxError
from django.test import SimpleTestCase
from ..utils import setup
class FirstOfTagTests(SimpleTestCase):
@setup({'firstof01': '{% firstof a b c %}'})
def test_firstof01(self):
output = self.engine.render_to_string('firstof01', {'a': 0, 'c': 0, 'b': 0})
... |
import sys
import time
import unittest2 as unittest
from webkitpy.port.factory import PortFactory
from webkitpy.port import server_process
from webkitpy.common.system.systemhost import SystemHost
from webkitpy.common.system.systemhost_mock import MockSystemHost
from webkitpy.common.system.outputcapture import OutputCa... |
import time
from openerp.report import report_sxw
from openerp.tools.translate import _
from openerp.osv import orm
class print_vat_period_end_statement(report_sxw.rml_parse):
_name = 'parser.vat.period.end.statement'
def _build_codes_dict(self, tax_code, res={}, context=None):
if context is None... |
import math
import random
from FreeCAD import Vector, Rotation, Matrix, Placement
import Part
import Units
import FreeCAD as App
import FreeCADGui as Gui
from PySide import QtGui, QtCore
import Instance
from shipUtils import Math
import shipUtils.Units as USys
DENS = Units.parseQuantity("1025 kg/m^3") #... |
import os
import sys
import sqlite3
import decimal
import math
import datetime
import ast
import csv
def adapt_decimal(d):
return str(d)
def convert_decimal(s):
return decimal.Decimal(s)
def question_marks(st):
question_marks = '?'
for i in range(0, len(st.split(','))-1):
question_marks = question_marks + ",?"... |
import requests
import httputil
import traceback
from datetime import datetime, timedelta
def get_symbol_to_quotes(symbols):
if len(symbols) == 0:
return {}
symbol_to_quote = {}
try:
quotes = httputil.get_json_object_from_url("https://api.robinhood.com/quotes/?symbols={}".format(",".join(s... |
"""
Helper classes for parsers.
"""
from __future__ import unicode_literals
import datetime
import decimal
import json
import uuid
from django.db.models.query import QuerySet
from django.utils import six, timezone
from django.utils.encoding import force_text
from django.utils.functional import Promise
from rest_fram... |
"""Test compiler changes for unary ops (+, -, ~) introduced in Python 2.2"""
import unittest
from test.support import run_unittest
class UnaryOpTestCase(unittest.TestCase):
def test_negative(self):
self.assertTrue(-2 == 0 - 2)
self.assertEqual(-0, 0)
self.assertEqual(--2, 2)
self.... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
Copyright (c) 2014, Kersten Doering <<EMAIL>>, Christian Senger <<EMAIL>>
"""
#Kersten HowTo:
#"python RunXapian.py -x" for indexing and searching
#"python RunXapian.py -f" for indexing
#"python RunXapian.py" for searching
#"python RunXapian.py -h" for help
import... |
from logbook import Logger
from collections import defaultdict
from copy import copy
from six import iteritems
from zipline.assets import Equity, Future, Asset
from zipline.finance.order import Order
from zipline.finance.slippage import (
DEFAULT_FUTURE_VOLUME_SLIPPAGE_BAR_LIMIT,
VolatilityVolumeShare,
Vo... |
"""A tool to generate symbols for a binary suitable for breakpad.
Currently, the tool only supports Linux, Android, and Mac. Support for other
platforms is planned.
"""
import errno
import optparse
import os
import Queue
import re
import shutil
import subprocess
import sys
import threading
CONCURRENT_TASKS=4
def ... |
import ldap
import logging
from ldap.filter import filter_format
import openerp.exceptions
from openerp import tools
from openerp.osv import fields, osv
from openerp import SUPERUSER_ID
from openerp.modules.registry import RegistryManager
_logger = logging.getLogger(__name__)
class CompanyLDAP(osv.osv):
_name = '... |
import pytest
from pages.firefox.all import FirefoxAllPage
@pytest.mark.smoke
@pytest.mark.nondestructive
def test_firefox_release(base_url, selenium):
page = FirefoxAllPage(selenium, base_url).open()
product = page.select_product('Firefox')
product.select_platform('Windows 64-bit')
product.select_la... |
import os
import re
import requests
from urlparse import urlparse
from time import time
from httmock import urlmatch, HTTMock
from django.test import RequestFactory
from django.core.urlresolvers import reverse
from django.core.validators import URLValidator
from django.conf import settings
from django.contrib.auth.mo... |
from item import Item, Items
from shinken.property import StringProp, ListProp
from shinken.util import strip_and_uniq
from shinken.log import logger
class Module(Item):
id = 1 # zero is always special in database, so we do not take risk here
my_type = 'module'
properties = Item.properties.copy()
p... |
import re
try:
from scrapy.selector import Selector, XPathSelectorList
except ImportError: # scrapy < 0.20
from scrapy.selector import XPathSelector as Selector, XPathSelectorList
_UNSUPPORTED_XPATH_ENDING = re.compile(r'.*/((@)?([^/()]+)(\(\))?)$')
class WebdriverXPathSelector(Selector):
"""Scrapy sel... |
#!/usr/bin/env python
"""Implement access to the windows registry."""
import ctypes
import ctypes.wintypes
import exceptions
import os
import stat
import StringIO
import _winreg
from grr.client import vfs
from grr.lib import rdfvalue
from grr.lib import utils
# Difference between 1 Jan 1601 and 1 Jan 1970.
WIN_UNI... |
"""Test the SimplePooledPg module.
Note:
We don't test performance here, so the test does not predicate
whether SimplePooledPg actually will help in improving performance or not.
Copyright and credit info:
* This test was contributed by Christoph Zwerschke
"""
import sys
import unittest
__version__ = '1.2'
# Th... |
from __future__ import unicode_literals
import json
import requests
from six.moves.urllib.parse import urlencode
import frappe
from frappe.model.document import Document
from frappe import _
from frappe.utils import get_url, call_hook_method, cint, flt, cstr
from frappe.integrations.utils import create_request_log, cr... |
from __future__ import absolute_import, print_function
from datetime import timedelta
from django.conf import settings
from django.db import models
from django.utils import timezone
from jsonfield import JSONField
from sentry.db.models import FlexibleForeignKey, Model, sane_repr
class AuthIdentity(Model):
user ... |
import os
from nupic.frameworks.opf.expdescriptionhelpers import importBaseDescription
# the sub-experiment configuration
config = \
{
'dataSource': 'file://' + os.path.join(os.path.dirname(__file__),
'../datasets/simple_0.csv'),
'modelParams': { 'clParams': { },
... |
"""Enumerates the BoringSSL source in src/ and generates two gypi files:
boringssl.gypi and boringssl_tests.gypi."""
import os
import subprocess
import sys
# OS_ARCH_COMBOS maps from OS and platform to the OpenSSL assembly "style" for
# that platform and the extension used by asm files.
OS_ARCH_COMBOS = [
('li... |
##[Example scripts]=group
##Input_raster=raster
##Input_vector=vector
##Transform_vector_to_raster_CRS=boolean
##Output_table=output table
import os
from osgeo import gdal, ogr, osr
from processing.core.TableWriter import TableWriter
from processing.core.GeoAlgorithmExecutionException import \
GeoAlgorithmExec... |
"""
dyld emulation
"""
import os
from ctypes.macholib.framework import framework_info
from ctypes.macholib.dylib import dylib_info
from itertools import *
__all__ = [
'dyld_find', 'framework_find',
'framework_info', 'dylib_info',
]
# These are the defaults as per man dyld(1)
#
DEFAULT_FRAMEWORK_FALLBACK = [
... |
from multiprocessing import freeze_support
from multiprocessing.managers import BaseManager, BaseProxy
import operator
##
class Foo:
def f(self):
print('you called Foo.f()')
def g(self):
print('you called Foo.g()')
def _h(self):
print('you called Foo._h()')
# A simple generator fu... |
import os
from cobbler import autoinstallgen
from cobbler import clogger
from cobbler import utils
from cobbler.cexceptions import CX
TEMPLATING_ERROR = 1
KICKSTART_ERROR = 2
class AutoInstallationManager:
"""
Manage automatic installation templates, snippets and final files
"""
def __init__(self, ... |
# Downloading Kepler light curves
import os
import pandas as pd
import kplr
import kepler_data as kd
def get_lc(id, KPLR_DIR="/Users/ruthangus/.kplr/data/lightcurves"):
"""
Downloads the kplr light curve and loads x, y and yerr.
"""
kid = str(int(id)).zfill(9)
path = os.path.join(KPLR_DIR, "{}... |
"""
============================================
Scalability of Approximate Nearest Neighbors
============================================
This example studies the scalability profile of approximate 10-neighbors
queries using the LSHForest with ``n_estimators=20`` and ``n_candidates=200``
when varying the number of sa... |
#!/usr/bin/env python
'''
Description:
This is the handler for the Social Engineering Toolkit (SET) trying to overcome the limitations of set-automate
'''
from framework.dependency_management.dependency_resolver import BaseComponent
from framework.lib.general import *
import time
SCRIPT_DELAY = 2
class SpearPhishing... |
ANSIBLE_METADATA = {'status': ['preview'],
'supported_by': 'community',
'version': '1.0'}
import sys
try:
import boto3
from botocore.exceptions import ClientError, ParamValidationError, MissingParametersError
HAS_BOTO3 = True
except ImportError:
HAS_BOTO3 = Fals... |
from .base import PairCountBase, verify_input_sources
import numpy
import logging
class SurveyDataPairCount(PairCountBase):
r"""
Count (weighted) pairs of objects from a survey data catalog
as a function of :math:`r`, :math:`(r,\mu)`, :math:`(r_p, \pi)`, or
:math:`\theta` using the :mod:`Corrfunc` pac... |
import btk
import unittest
import _TDDConfigure
class AcquisitionUnitConverterTest(unittest.TestCase):
def test_NoInputNoConversion(self):
uc = btk.btkAcquisitionUnitConverter()
uc.Update()
output = uc.GetOutput()
self.assertEqual(output.GetPointUnit(btk.btkPoint.Marker), 'mm')
... |
from behave import when, then
from code_generation import cd
import fsm_designer.cli
import os
HERE = os.path.dirname(__file__)
@given(u'two empty fsm designs')
def step_impl(context):
context.designA = os.path.join(HERE, 'X')
context.designB = os.path.join(HERE, 'Y')
@given(u'two simple fsm designs')
def s... |
"""Module that sanitizes source files with specified modifiers."""
import commands
import os
import sys
_FILE_EXTENSIONS_TO_SANITIZE = ['cpp', 'h', 'c', 'gyp', 'gypi']
_SUBDIRS_TO_IGNORE = ['.git', '.svn', 'third_party']
def SanitizeFilesWithModifiers(directory, file_modifiers, line_modifiers):
"""Sanitizes so... |
import time
try:
import boto
import boto.ec2
import boto.ec2.autoscale
import boto.ec2.elb
from boto.regioninfo import RegionInfo
HAS_BOTO = True
except ImportError:
HAS_BOTO = False
class ElbManager:
"""Handles EC2 instance ELB registration and de-registration"""
def __init__(se... |
# -*- coding: iso-8859-1 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para videoweed
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import re, urlparse, urllib, urllib2
import os
from ... |
# -*- coding: utf-8 -*-
"""
werkzeug.testsuite.cache
~~~~~~~~~~~~~~~~~~~~~~~~
Tests the cache system
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import os
import time
import unittest
import tempfile
import shutil
from werkzeug.testsuite import Werkzeug... |
from .utils import NamespacedClient, query_params, _make_path, SKIP_IN_PATH
class CatClient(NamespacedClient):
@query_params('h', 'help', 'local', 'master_timeout', 'v')
def aliases(self, name=None, params=None):
"""
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-alias.ht... |
"""Convert Gettext PO localization files back to Windows Resource (.rc) files.
See: http://docs.translatehouse.org/projects/translate-toolkit/en/latest/commands/rc2po.html
for examples and usage instructions.
"""
from translate.convert import convert
from translate.storage import po, rc
class rerc:
def __init_... |
# -*- 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 'WombatToken'
db.create_table('wombat_authenticator_wombattoken', (
('id', self.g... |
from django.contrib.auth import (
authenticate,
get_user_model,
login,
logout,
)
from django.shortcuts import render, redirect
from .forms import UserLoginForm, UserRegisterForm
def login_view(request):
print(request.user.is_authenticated())
next = request.GET.get('next')
title = "Log... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
# Note, sha1 is the only hash algorithm compatible with python2.4 and with
# FIPS-140 mode (as of 11-2014)
try:
from hashlib import sha1
except ImportError:
from sha import sha as sha1
# Backwards compat only
tr... |
"""
Copyright (c) 2009, Alexey Smirnov
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 f... |
# Class decorator factory: apply any decorator to all methods of a class
from types import FunctionType
from decotools import tracer, timer
def decorateAll(decorator):
def DecoDecorate(aClass):
for attr, attrval in aClass.__dict__.items():
if type(attrval) is FunctionType:
... |
"""Garbage collection thread for representing zmq refcount of Python objects
used in zero-copy sends.
"""
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
import atexit
import struct
from os import getpid
from collections import namedtuple
from threading import Thread, Eve... |
from heat.engine import properties
from heat.engine import resource
from heat.openstack.common.gettextutils import _
from heat.openstack.common import log as logging
logger = logging.getLogger(__name__)
DOCKER_INSTALLED = False
# conditionally import so tests can work without having the dependency
# satisfied
try:
... |
from selenium import webdriver
import time
import os
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.action_chains import ActionChains
password = os.getenv('USERPWD')
chrome_options = webdriver.ChromeOptions()
#chrome_options.add_argument('--headless')
#chrome_options.add_ar... |
# Check the various features of the ShTest format.
#
# RUN: not %{lit} -j 1 -v %{inputs}/shtest-format > %t.out
# RUN: FileCheck < %t.out %s
#
# END.
# CHECK: -- Testing:
# CHECK: FAIL: shtest-format :: external_shell/fail.txt
# CHECK-NEXT: *** TEST 'shtest-format :: external_shell/fail.txt' FAILED ***
# CHECK: Comma... |
from django.conf.urls import patterns
from django.conf.urls import url
from openstack_dashboard.dashboards.project.access_and_security.\
security_groups import views
urlpatterns = patterns(
'',
url(r'^create/$', views.CreateView.as_view(), name='create'),
url(r'^(?P<security_group_id>[^/]+)/$',
... |
# -*- coding: utf-8 -*-
"""
werkzeug._internal
~~~~~~~~~~~~~~~~~~
This module provides internally used helpers and constants.
:copyright: (c) 2013 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import re
import string
import inspect
from weakre... |
"""Helper to provide extensibility for pickle/cPickle.
This is only useful to add pickle support for extension types defined in
C, not for instances of user-defined classes.
"""
from types import ClassType as _ClassType
__all__ = ["pickle", "constructor",
"add_extension", "remove_extension", "clear_extens... |
from django.conf import settings
from django.db import DEFAULT_DB_ALIAS
# function that will pass a test.
def pass_test(*args): return
def no_backend(test_func, backend):
"Use this decorator to disable test on specified backend."
if settings.DATABASES[DEFAULT_DB_ALIAS]['ENGINE'].rsplit('.')[-1] == backend:
... |
import logging
import sys
import os
import openerp
from openerp import tools
from openerp.modules import module
_logger = logging.getLogger(__name__)
commands = {}
class CommandType(type):
def __init__(cls, name, bases, attrs):
super(CommandType, cls).__init__(name, bases, attrs)
name = getattr(... |
from __future__ import absolute_import, division, print_function
import numpy as np
from skbio.tree import DuplicateNodeError, MissingNodeError
def _validate_counts_vector(counts, suppress_cast=False):
"""Validate and convert input to an acceptable counts vector type.
Note: may not always return a copy of ... |
"""
Common API for all public keys.
"""
import base64
from binascii import hexlify, unhexlify
import os
from hashlib import md5
from Crypto.Cipher import DES3, AES
from paramiko import util
from paramiko.common import o600, zero_byte
from paramiko.py3compat import u, encodebytes, decodebytes, b
from pa... |
from merge import DataBag
import CsHelper
class CsGuestNetwork:
def __init__(self, device, config):
self.data = {}
self.guest = True
db = DataBag()
db.setKey("guestnetwork")
db.load()
dbag = db.getDataBag()
self.config = config
if device in dbag.keys... |
from yowsup.structs import ProtocolEntity, ProtocolTreeNode
from .presence import PresenceProtocolEntity
class UnsubscribePresenceProtocolEntity(PresenceProtocolEntity):
'''
<presence type="unsubscribe" to="jid"></presence>
'''
def __init__(self, jid):
super(UnsubscribePresenceProtocolEntity, ... |
"""
Asynchronous event notifications from virtualization drivers.
This module defines a set of classes representing data for
various asynchronous events that can occur in a virtualization
driver.
"""
import time
from nova.i18n import _
EVENT_LIFECYCLE_STARTED = 0
EVENT_LIFECYCLE_STOPPED = 1
EVENT_LIFECYCLE_PAUSED =... |
"""Read and write Ogg Vorbis comments.
This module handles Vorbis files wrapped in an Ogg bitstream. The
first Vorbis stream found is used.
Read more about Ogg Vorbis at http://vorbis.com/. This module is based
on the specification at http://www.xiph.org/vorbis/doc/Vorbis_I_spec.html.
"""
__all__ = ["OggVorbis", "Op... |
import json
from mock import patch
from django.test import TestCase
from django.test.utils import override_settings
from django.core.urlresolvers import reverse
from django.core.management import call_command
from django.contrib.auth.models import Group
from django.contrib.auth import get_user_model
from model_mommy ... |
import agents as ag
import envgui as gui
# change this line ONLY to refer to your project
import submissions.aardvark.vacuum2 as v2
# ______________________________________________________________________________
# Vacuum environment
class Dirt(ag.Thing):
pass
class VacuumEnvironment(ag.XYEnvironment):
"""T... |
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.azure_rm_common import AzureRMModuleBase
try:
from msrestazur... |
"""
OpenStack Client interface. Handles the REST calls and responses.
"""
# E0202: An attribute inherited from %s hide this method
# pylint: disable=E0202
import logging
import time
try:
import simplejson as json
except ImportError:
import json
from oslo_utils import importutils
import requests
from manila... |
# encoding: utf-8
"""
Image part objects, including Image
"""
import hashlib
import os
import posixpath
try:
from PIL import Image as PIL_Image
except ImportError:
import Image as PIL_Image
from StringIO import StringIO
from pptx.opc.package import Part
from pptx.opc.packuri import PackURI
from pptx.opc.sp... |
import numpy as np
from scipy import constants
from scipy.integrate import simps, cumtrapz
from hyperspy._signals.complex_signal1d import (ComplexSignal1D,
LazyComplexSignal1D)
from hyperspy.misc.eels.tools import eels_constant
class DielectricFunction_mixin:
_sig... |
{
'name': 'Employee Contracts Name',
'version': '1.0',
'url': 'http://launchpad.net/openerp-ccorp-addons',
'author': 'ClearCorp S.A.',
'website': 'http://clearcorp.co.cr',
'category': 'Human Resources',
'complexity': 'easy',
'description': """This module adds a sequence to the name.
... |
import unittest
from telemetry.unittest import simple_mock
from telemetry.core.backends.chrome import inspector_websocket
from telemetry.core.backends.chrome import websocket
class FakeSocket(object):
""" A fake socket that:
+ Receives first package of data after 10 second in the first recv().
+ Re... |
import unittest
from ...compatibility import StringIO
from ..helperfunctions import _xml_to_list
from ...worksheet import Worksheet
class TestAssembleWorksheet(unittest.TestCase):
"""
Test assembling a complete Worksheet file.
"""
def test_assemble_xml_file(self):
"""Test writing a worksheet ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.