content
stringlengths
4
20k
import logging import click from regparser.diff.tree import changes_between from regparser.index import dependency, entry logger = logging.getLogger(__name__) @click.command() @click.argument('cfr_title', type=int) @click.argument('cfr_part', type=int) def diffs(cfr_title, cfr_part): """Construct diffs between...
# -*- coding: utf-8 -*- #------------------------------------------------------------ # pelisalacarta - XBMC Plugin # Conector para bitshare # http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/ #------------------------------------------------------------ import urlparse,urllib2,urllib,re import os from core imp...
""" Template of product pulled flow object """ from openerp.osv.orm import Model from openerp.addons.stock_orderpoint_creator.base_product_config_template import BaseProductConfigTemplate class ProductPulledFlow(BaseProductConfigTemplate, Model): _name = 'product.pulled.flow.template' _inherit = 'product.pu...
# -*- coding: utf-8 -*- """Persistence layer for the google drive addon. """ import os import urllib from modularodm import fields from framework.auth import Auth from framework.exceptions import HTTPError from website.oauth.models import ExternalProvider from website.addons.base import exceptions from website.addon...
from matplotlib.collections import LineCollection import matplotlib.pyplot as plt import numpy as np from bokeh import mpl from bokeh.plotting import output_file, show def make_segments(x, y): ''' Create list of line segments from x and y coordinates. ''' points = np.array([x, y]).T.reshape(-1, 1, 2...
#!/usr/bin/env python2 # # RunLength decoder (Adobe version) implementation based on PDF Reference # version 1.4 section 3.3.4. # # * public domain * # import sys def rldecode(data): """ RunLength decoder (Adobe version) implementation based on PDF Reference version 1.4 section 3.3.4: The RunLeng...
import re from nova.openstack.common.gettextutils import _ from nova.openstack.common import log as logging from nova.openstack.common import processutils from nova import utils from nova.volume.encryptors import cryptsetup LOG = logging.getLogger(__name__) class LuksEncryptor(cryptsetup.CryptsetupEncryptor): ...
import argparse import ast import os import sys from collections import OrderedDict from distutils.spawn import find_executable import config def abs_path(path): return os.path.abspath(os.path.expanduser(path)) def url_or_path(path): import urlparse parsed = urlparse.urlparse(path) if len(parsed.s...
from dvc.cli import parse_args from dvc.command.params import CmdParamsDiff def test_params_diff(dvc, mocker): cli_args = parse_args( [ "params", "diff", "HEAD~10", "HEAD~1", "--targets", "target", "--all", "--...
from __future__ import nested_scopes from pydevd_constants import * # @UnusedWildImport import stackless # @UnresolvedImport from pydevd_tracing import SetTrace from pydevd_custom_frames import updateCustomFrame, removeCustomFrame, addCustomFrame from pydevd_comm import GetGlobalDebugger import weakref from pydevd_fi...
ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'core'} DOCUMENTATION = r''' module: win_disk_image short_description: Manage ISO/VHD/VHDX mounts on Windows hosts version_added: '2.3' description: - Manages mount behavior for a specifie...
"""Multivariate Normal distribution classes.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.contrib import linalg from tensorflow.contrib.distributions.python.ops import distribution_util from tensorflow.contrib.distributions.python.ops ...
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models from oscar.core.compat import AUTH_USER_MODEL, AUTH_USER_MODEL_NAME class Migration(SchemaMigration): def forwards(self, orm): # Removing unique constraint on 'Partner', field...
# -*- coding: utf-8 -*- import datetime import decimal try: import pyodbc except ImportError: pass from PyQt5 import QtCore, QtGui from OpenNumismat.Collection.Import import _Import, _DatabaseServerError class ImportNumizmatik_RuPredefined(_Import): Columns = { 'title': None, 'value': ...
from django.conf import settings from django.test import TestCase from cradmin_legacy import cradmin_testhelpers from cradmin_legacy import crinstance from model_bakery import baker from devilry.apps.core.models import Subject from devilry.devilry_admin.views.dashboard import createsubject class TestCreateView(TestC...
"""Inception Resnet v2 Faster R-CNN implementation. See "Inception-v4, Inception-ResNet and the Impact of Residual Connections on Learning" by Szegedy et al. (https://arxiv.org/abs/1602.07261) as well as "Speed/accuracy trade-offs for modern convolutional object detectors" by Huang et al. (https://arxiv.org/abs/1611.1...
#!/usr/bin/env python """ datcomXMLLoader 加载XML的基础类 """ import logging from xml.etree import ElementTree as ET from PyDatcomLab.Core import datcomTools as dtTool class datcomXMLLoader(object): """ datcomXMLLoader 负责加载、写入XML文件 """ def __init__(self, path = None): """ 初始化 """ ...
import subprocess from . import base class ViewProtobuf(base.View): """Human friendly view of protocol buffers The view uses the protoc compiler to decode the binary """ name = "Protocol Buffer" prompt = ("protobuf", "p") content_types = [ "application/x-protobuf", "applicati...
# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals. # Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the Li...
from __future__ import print_function __author__ = 'schmatz' from configuration import Configuration import sys if sys.version_info.major < 3: import urllib else: import urllib.request as urllib from dependency import Dependency class Downloader: def __init__(self,dependency): assert isinstance(depe...
import pytest import time import logging from cassandra import ConsistencyLevel from thrift.protocol import TBinaryProtocol from thrift.transport import TSocket, TTransport from dtest_setup_overrides import DTestSetupOverrides from dtest import Tester, create_ks, create_cf from tools.data import (create_c1c2_table, ...
try: import shade HAS_SHADE = True except ImportError: HAS_SHADE = False import jsonpatch def _parse_properties(module): p = module.params['properties'] props = dict( cpu_arch=p.get('cpu_arch') if p.get('cpu_arch') else 'x86_64', cpus=p.get('cpus') if p.get('cpus') else 1, m...
import marketing_campaign import report # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'certified'} import traceback import ansible.module_utils.netapp as netapp_utils from ansible.module_ut...
from distutils.core import setup import pages setup( name='djaodjin-pages', version=pages.__version__, author='The DjaoDjin Team', author_email='<EMAIL>', packages=[ 'pages', 'pages.api', 'pages.urls'], package_data={'pages': [ 'static/vendor/css/*', 'static/vend...
# This Python file uses the following encoding: utf-8 # # CONDSAMISISTEMAS # This script will log in the samisistemas customer system and check if a condominium bill existed, notifying the user by email import requests import smtplib import sqlite3 from email.mime.multipart import MIMEMultipart from email.mime.text i...
# Note this implementation is more strict than necessary to demonstrate # minimum restrictions on types allowed in dictionaries. def dump(data): if type(data) is long or type(data) is int: out = str(data) return '%d:%s#' % (len(out), out) elif type(data) is float: out = '%f' % data ...
from nose.tools import assert_raises import gevent from zerorpc import zmq import zerorpc from testutils import teardown, random_ipc_endpoint def test_close_server_hbchan(): endpoint = random_ipc_endpoint() server_events = zerorpc.Events(zmq.XREP) server_events.bind(endpoint) server = zerorpc.Channel...
from fabric.api import env from fabric.operations import run, put, sudo,local #env.use_ssh_config = True # CHANGE ME (change the PEM file) env.user = 'root' env.key_filename = '~/.ssh/digitalocean_rsa' # Populate host names with open('tomcat-host.txt') as f: env.hosts = f.readlines() def check_bash(): run...
import unittest from autothreadharness.harness_case import HarnessCase class Leader_9_2_5(HarnessCase): role = HarnessCase.ROLE_LEADER case = '9 2 5' golden_devices_required = 1 def on_dialog(self, dialog, title): pass if __name__ == '__main__': unittest.main()
from setuptools import setup, find_packages from hueversion import VERSION setup( name = "liboauth", version = VERSION, url = 'http://github.com/cloudera/hue', description = "OAuth Libraries", packages = find_packages('src'), package_dir = {'': 'src' }, install_requires = ['se...
"""Decorators for use with the webgateway application.""" import omero import omeroweb.decorators import logging import traceback from django.http import JsonResponse from functools import update_wrapper from api_exceptions import NotFoundError, BadRequestError, CreatedObject logger = logging.getLogger(__name__) c...
"""Some helper functions and definitions for the OCA product reader and image generator """ import numpy as np from mpop.imageo import palettes SCENE_TYPE_LAYERS = {111: 'Single Layer Water Cloud', 112: 'Single Layer Ice Cloud', 113: 'Multi Layer Cloud'} OCA_FIELDS = [{'Pix...
""" Checks that primitive values are not used in an iterating/mapping context. """ # pylint: disable=missing-docstring,invalid-name,too-few-public-methods,no-init,no-self-use,import-error,unused-argument,bad-mcs-method-argument,wrong-import-position from __future__ import print_function # primitives numbers = [1, 2, 3...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'style.ui' # # by: PyQt4 UI code generator 4.5.4 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui class Ui_Form(object): def setupUi(self, Form): Form.setObjectName("Form") F...
# -*- coding: utf-8 -*- """ jinja2.loaders ~~~~~~~~~~~~~~ Jinja loader classes. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import os import sys import weakref from types import ModuleType from os import path try: from hashlib import sha1 except Imp...
#!/usr/bin/env python from nose.tools import * from nose import SkipTest import networkx as nx from base_test import BaseTestAttributeMixing,BaseTestDegreeMixing class TestDegreeMixingDict(BaseTestDegreeMixing): def test_degree_mixing_dict_undirected(self): d=nx.degree_mixing_dict(self.P4) d_res...
import json import os from ctypes import addressof, byref, c_double, c_void_p from django.contrib.gis.gdal.base import GDALBase from django.contrib.gis.gdal.driver import Driver from django.contrib.gis.gdal.error import GDALException from django.contrib.gis.gdal.prototypes import raster as capi from django.contrib.gis...
# pylint: disable=import-error """Basic CRUD Controller""" import Security from . import ClientErrorException from .Security import require_role class Controller(object): """Generic CRUD Controller""" def __init__(self, user, factory): self.user = user self.factory = factory @require_ro...
from ROOT import TFile,TIter,TObject,gDirectory,gROOT from PWGJE.EMCALJetTasks.Tracks.analysis.base.DataSet import DataSet from PWGJE.EMCALJetTasks.Tracks.analysis.base.FileResults import ResultData from PWGJE.EMCALJetTasks.Tracks.analysis.base.struct.ParticleTHnSparse import ParticleTHnSparse from PWGJE.EMCALJetTasks....
import praw from .helper import BJOTest from bernard import actors from bernard.helpers import deserialize_thing_id class TestRule(BJOTest): def setUp(self): super().setUp() notifier = actors.Notifier("A notifcation", self.subreddit) self.actor = actors.Rule( commands=["foo"], ...
#! /usr/bin/env python # encoding: UTF-8 # Petar Forai # Thomas Nagy 2008 import re import Task, Utils, Logs from TaskGen import extension from Configure import conf import preproc SWIG_EXTS = ['.swig', '.i'] swig_str = '${SWIG} ${SWIGFLAGS} ${SRC}' cls = Task.simple_task_type('swig', swig_str, color='BLUE', before=...
ANSIBLE_METADATA = {'metadata_version': '1.0', 'status': ['preview'], 'supported_by': 'community'} __version__ = '${version}' import os from distutils.version import LooseVersion try: import requests except ImportError: REQUESTS_FOUND = False else: REQUESTS_FOUND...
# -*- coding: utf-8 -*- """ oauthlib.oauth2.rfc6749 ~~~~~~~~~~~~~~~~~~~~~~~ This module is an implementation of various logic needed for consuming and providing OAuth 2.0 RFC6749. """ from __future__ import absolute_import, unicode_literals import logging from oauthlib.common import Request from .base import BaseEn...
# -*- coding: utf-8 -*- from nose.tools import * # flake8: noqa from tests.base import ApiTestCase from tests.factories import AuthUserFactory from api.base.settings.defaults import API_BASE class TestExceptionFormatting(ApiTestCase): def setUp(self): super(TestExceptionFormatting, self).setUp() ...
#!/usr/bin/python3 import sys import os import kdb base_key = "/sw/org/kdbdummy/#0/current" spec_base_key = "spec:" + base_key spec = kdb.KeySet(10, kdb.Key(spec_base_key, kdb.KEY_META, "command", ""), kdb.Key(spec_base_key + "/printversion", kdb.KEY_META, "description", "print version information and exit ...
""" LightCurve is a generic LightCurve class from which all other LightCurve classes inherit from. """ from __future__ import absolute_import import os.path import shutil import warnings from datetime import datetime from collections import OrderedDict import numpy as np import matplotlib.pyplot as plt import pandas ...
import urllib2,zipfile import nID import os import download as get import sys def get_fields_from_repo(repository_nid, field): list_of_all=[] a=nID.parse(repository_nid,"all_url") text=download(a) try: split=text.split("\n")#split the downloaded data except: print("Could not parse do...
#!/usr/bin/env python """A shuffle vector fuzz tester. This is a python program to fuzz test the LLVM shufflevector instruction. It generates a function with a random sequnece of shufflevectors, maintaining the element mapping accumulated across the function. It then generates a main function which calls it with a di...
# -*- coding: utf-8 -*- from __future__ import absolute_import import os import code import warnings import string import argparse from flask import _request_ctx_stack from .cli import prompt, prompt_pass, prompt_bool, prompt_choices class InvalidCommand(Exception): pass class Group(object): """ Sto...
from __future__ import unicode_literals from django.apps.registry import Apps from django.db import models from django.utils.encoding import python_2_unicode_compatible from django.utils.timezone import now class MigrationRecorder(object): """ Deals with storing migration records in the database. Becaus...
from rezgui.qt import QtGui from rezgui.widgets.BrowsePackageWidget import BrowsePackageWidget from rezgui.widgets.ContextSettingsWidget import ContextSettingsWidget from rezgui.mixins.ContextViewMixin import ContextViewMixin from rezgui.util import get_icon class BrowsePackagePane(QtGui.QTabWidget, ContextViewMixin)...
from django import template from django.template import defaultfilters from django.utils.encoding import force_text from django.utils.translation import ugettext_lazy as _ from horizon import exceptions from horizon import forms from horizon import messages from openstack_dashboard.contrib.sahara.api import sahara as...
from __future__ import (absolute_import, division, print_function) import copy import json import pytest from ansible.compat.tests.mock import MagicMock, Mock, patch from ansible.module_utils import basic from ansible.module_utils._text import to_bytes boto3 = pytest.importorskip("boto3") # lambda is a keyword so ...
import unittest from mock import patch from mock import MagicMock from common import SQS_MESSAGE_2 from common import SQS_MESSAGE_3 from c7n_mailer.datadog_delivery import DataDogDelivery DATADOG_APPLICATION_KEY = 'datadog_application_key' DATADOG_API_KEY = 'datadog_api_key' MESSAGE_ANSWER = [[ 'Attachments:[]...
"""A module to analyze test expectations for Webkit layout tests.""" import urllib2 from webkitpy.layout_tests.models.test_expectations import * # Default location for chromium test expectation file. # TODO(imasaki): support multiple test expectations files. DEFAULT_TEST_EXPECTATIONS_LOCATION = ( 'http://src.chr...
from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import from future import standard_library standard_library.install_aliases() from builtins import str from builtins import * import unittest import uuid import geojson as gj imp...
"""Sample test for vttest framework. This sample test demonstrates how to setup and teardown a test database with the associated Vitess processes. It is meant to be used as a template for unit tests, by developers writing applications on top of Vitess. The recommended workflow is to have the schema for the database ch...
import sys import hashlib import os import collections import string def hashfile(fname, onlyhead): f = open(fname, 'rb') h = hashlib.sha256() bs = 4096 if onlyhead else 1048576 while True: b = f.read(bs) if b <= 0 or onlyhead: break h.update(b) f.close() ret...
import os import sys from stopwords_video import vid_stopwords from stop_words import stopword import nltk import re from nltk import stem stemmer = stem.PorterStemmer() from operator import itemgetter import math def remove_hyphen(g): if g.count("-")>0: temp=g.split("-") l=len(temp) word="...
from __future__ import unicode_literals import frappe from frappe import _ from frappe.model.document import Document from frappe.utils.csvutils import getlink class Guardian(Document): def __setup__(self): self.onload() def onload(self): """Load Students for quick view""" self.load_students() def load_stud...
""" Directives for figures and simple images. """ __docformat__ = 'reStructuredText' import sys import urllib.request, urllib.parse, urllib.error from docutils import nodes, utils from docutils.parsers.rst import Directive from docutils.parsers.rst import directives, states from docutils.nodes import fully_normalize...
from telemetry.core import exceptions from telemetry.internal.actions import media_action from telemetry.internal.actions import page_action from telemetry.internal.actions import utils class LoadMediaAction(media_action.MediaAction): """ For calling load() on media elements and waiting for an event to fire. """ ...
""" Django settings for base ndohyep. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ from os.path import abspath, dirname, join from django.conf import global_set...
from tulip import * import tulipplugins import tulippaths as tp from FileOutputPlugin import FileOutputPlugin class BidirectionalSynapseCleanup(FileOutputPlugin): def __init__(self, context): FileOutputPlugin.__init__(self, context) self._edgeTypeLabel = "Edge type" self.addStringParamete...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import datetime import os import pwd import time from ansible import constants as C from ansible.errors import AnsibleError from ansible.module_utils.six import string_types from ansible.module_utils._text import to_bytes, to_nati...
"""Parser for command line options. This module helps scripts to parse the command line arguments in sys.argv. It supports the same conventions as the Unix getopt() function (including the special meanings of arguments of the form `-' and `--'). Long options similar to those supported by GNU software may be used as ...
"""This file provides the opening handshake processor for the WebSocket protocol (RFC 6455). Specification: http://tools.ietf.org/html/rfc6455 """ # Note: request.connection.write is used in this module, even though mod_python # document says that it should be used only in connection handlers. # Unfortunately, we ha...
""" Copyright 2013 Steven Diamond This file is part of CVXPY. CVXPY 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 option) any later version. CVXPY is distributed i...
""" Test the lms/survey views. """ import json import logging from django.http import HttpResponseNotAllowed, Http404 from django.test import TestCase from django.test.client import RequestFactory from student.tests.factories import UserFactory from survey.models import SurveySubmission from survey.tests.factories i...
from html2html import parseString #.apidoc title: HTML to HTML engine # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
import asyncio import pytest @pytest.mark.asyncio async def test_kv_smartscope(kivy_app, KvEventWaiter): from vidhubcontrol.backends import SmartViewDummyBackend, SmartScopeDummyBackend kv_waiter = KvEventWaiter() config = kivy_app.vidhub_config smartscope = await SmartScopeDummyBackend.create_async(...
import logging import pytest from io import StringIO from flask import url_for from udata.frontend import csv from udata.tests.helpers import assert200 from udata.core.dataset.factories import DatasetFactory from udata.core.reuse.factories import ReuseFactory from udata.core.tags.models import Tag from udata.core.ta...
import sys from paravistest import datadir, pictureext, get_picture_dir from presentations import CreatePrsForFile, PrsTypeEnum import pvserver as paravis # Create presentations myParavis = paravis.myParavis # Directory for saving snapshots picturedir = get_picture_dir("CutPlanes/F6") file = datadir + "maill.0.med...
import sys import random from esvm.experiment import svm_cv, svm_pred, svm_poim, svm_eval, svm_modelsel if __name__ == '__main__': if len(sys.argv)<2: sys.stderr.write("usage: %s [cv|pred|modelsel|eval|poim] parameters\n" % sys.argv[0]) sys.exit(-1) random.seed() topmode = sys.argv[1] ...
# -*- coding: utf-8 -*- """ timer2 ~~~~~~ Scheduler for Python functions. """ from __future__ import absolute_import from __future__ import with_statement import atexit import heapq import os import sys import threading from datetime import datetime from functools import wraps from itertools import coun...
categories = ["integer", "floating_point"] microcode = ''' # 64 bit multimedia instructions ''' for category in categories: exec "import %s as cat" % category microcode += cat.microcode
# -*- coding: utf-8 -*- import vim SCOPE_ALL = 1 # for all vim-orgmode buffers SCOPE_GLOBAL = 2 # just for the current buffer - has priority before the global settings SCOPE_BUFFER = 4 VARIABLE_LEADER = {SCOPE_GLOBAL: u'g', SCOPE_BUFFER: u'b'} u""" Evaluate and store settings """ def get(setting, default=None, s...
import datetime import threading import logging import time import queue from django.core.management import call_command from django.core.management.base import BaseCommand, CommandError from django.utils import timezone from teslarent.models import Rental, VehicleData from teslarent.teslaapi import teslaapi from tes...
from django.test import TestCase from django.db.migrations.graph import MigrationGraph, CircularDependencyError class GraphTests(TestCase): """ Tests the digraph structure. """ def test_simple_graph(self): """ Tests a basic dependency graph: app_a: 0001 <-- 0002 <--- 0003 <-...
#!/usr/bin/python # # Script to implement crude fake controller using VRidge-API and SDL2 # # (c) Simon Wood, 19 June 2017 # Note: uses Construct 2.8 # https://construct.readthedocs.io/en/latest/ from construct import * # http://zeromq.org # ZeroMQ-4.0.4-miru1.0-x86.exe # # https://www.nico-maas.de/?p=...
""" Content rendering functionality Note that this module is designed to imitate the front end behavior as implemented in Markdown.Sanitizer.js. """ import re import markdown # These patterns could be more flexible about things like attributes and # whitespace, but this is imitating Markdown.Sanitizer.js, so it uses...
import os, pprint, re, time from hodlib.Common.threads import simpleCommand from hodlib.Common.util import args_to_string from hodlib.Common.logger import hodDummyLogger reQstatLine = re.compile("^\s*(\w+)\s*=\s*(.*)\s*$") class torqueInterface: def __init__(self, torqueDir, environment, log=None): self.__qsub...
#!/usr/bin/env python """ Setuptools bootstrapping installer. Maintained at https://github.com/pypa/setuptools/tree/bootstrap. Run this script to install or upgrade setuptools. """ import os import shutil import sys import tempfile import zipfile import optparse import subprocess import platform import textwrap imp...
import tools import base64 from tempfile import TemporaryFile from osv import osv, fields class base_language_import(osv.osv_memory): """ Language Import """ _name = "base.language.import" _description = "Language Import" _inherit = "ir.wizard.screen" _columns = { 'name': fields.char('Lan...
from novaclient.v1_1 import hosts from novaclient.tests.v1_1 import fakes from novaclient.tests import utils cs = fakes.FakeClient() class HostsTest(utils.TestCase): def test_describe_resource(self): hs = cs.hosts.get('host') cs.assert_called('GET', '/os-hosts/host') [self.assertTrue(is...
# -*- coding: utf-8 -*- import sys from typing import ( # NOQA Dict, Set, Type, ) import six from django.test import TestCase from django_extensions.management.commands import shell_plus class AutomaticShellPlusImportsTestCase(TestCase): def setUp(self): super(AutomaticShellPlusImportsTestC...
""" System-level utilities and helper functions. """ import logging as stdlib_logging import os import random import shlex import signal from eventlet.green import subprocess from eventlet import greenthread from nova.openstack.common.gettextutils import _ # noqa from nova.openstack.common import log as logging L...
if __name__ == "__main__": import sys, rpy2.rinterface sys.stdout.write("rpy2 version: %s\n" % rpy2.__version__) sys.stdout.write("built against R version: %s\n" % '-'.join(str(x) for x in rpy2.rinterface.R_VERSION_BUILD)) sys.stdout.flush() import unittest import rpy2.robjects.tests import rpy2.rinte...
""" Tests for ErrorModule and NonStaffErrorModule """ import unittest from xmodule.tests import get_test_system from xmodule.error_module import ErrorDescriptor, ErrorModule, NonStaffErrorDescriptor from xmodule.modulestore.xml import CourseLocationGenerator from xmodule.modulestore.locations import SlashSeparatedCours...
from test.test_support import verbose, TESTFN import random import os # From SF bug #422121: Insecurities in dict comparison. # Safety of code doing comparisons has been an historical Python weak spot. # The problem is that comparison of structures written in C *naturally* # wants to hold on to things like the size ...
import urlparse import os, sys tools_dir = os.environ.get('TOOLSDIR') lib_path = os.path.abspath(tools_dir) sys.path.append(lib_path) from msc_apps import * import tempfile data_dir_root = os.environ.get('DATADIR') def offers_response(response_dict): expected_fields=['type','currencyType'] for field in expect...
import struct from .constants import ER class MySQLError(Exception): """Exception related to operation with MySQL.""" class Warning(Warning, MySQLError): """Exception raised for important warnings like data truncations while inserting, etc.""" class Error(MySQLError): """Exception that is the bas...
# -*- coding: utf-8 -*- """ *************************************************************************** EditScriptAction.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com **********************...
""" =================================================== Segmenting the picture of a raccoon face in regions =================================================== This example uses :ref:`spectral_clustering` on a graph created from voxel-to-voxel difference on an image to break this image into multiple partly-homogeneous...
from tendrl.commons import objects class BlockDevice(objects.BaseObject): def __init__(self, device_name=None, device_kernel_name=None, parent_name=None, major_to_minor_no=None, fstype=None, mount_point=None, label=None, fsuuid=None, read_ahead=None, read_only=No...
# -*- coding: utf-8 -*- """ pyspecific.py ~~~~~~~~~~~~~ Sphinx extension with Python doc-specific markup. :copyright: 2008-2014 by Georg Brandl. :license: Python license. """ ISSUE_URI = 'http://bugs.python.org/issue%s' SOURCE_URI = 'https://hg.python.org/cpython/file/3.4/%s' from docutils impor...
from __future__ import unicode_literals import frappe from frappe import _ from frappe.utils import flt, cint, getdate def execute(filters=None): if not filters: filters = {} float_precision = cint(frappe.db.get_default("float_precision")) or 3 columns = get_columns(filters) item_map = get_item_details(filters) ...
import logging import os import android_commands from chrome_test_server_spawner import SpawningServer from flag_changer import FlagChanger import lighttpd_server import run_tests_helper FORWARDER_PATH = '/data/local/tmp/forwarder' # These ports must match up with the constants in net/test/test_server.cc TEST_SERVER_...
""" EasyBuild support for iiqmpi compiler toolchain (includes Intel compilers, QLogicMPI). :author: Kenneth Hoste (Ghent University) """ from easybuild.toolchains.iccifort import IccIfort from easybuild.toolchains.mpi.qlogicmpi import QLogicMPI class Iiqmpi(IccIfort, QLogicMPI): """Compiler toolchain with Intel...