content
stringlengths
4
20k
#!/usr/bin/env python """ C to C++ Translator Convert a C program or whole project to C++ Copyright (C) 2001-2009 Denis Sureau 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 F...
""" [desc] """ # define authorship information __authors__ = ['Eric Hulser'] __author__ = ','.join(__authors__) __credits__ = [] __copyright__ = 'Copyright (c) 2011, Projex Software' __license__ = 'LGPL' import random from projexui.qt.QtCore import Qt, QRectF from p...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} try: import pyrax HAS_PYRAX = True except ImportError: HAS_PYRAX = False from ...
import numpy as np import scipy.sparse as sp from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_less from sklearn.utils.testing import assert_true from sklearn.utils.t...
import tests from pyVim import connect from pyVmomi import vim class ContainerViewTests(tests.VCRTestBase): @tests.VCRTestBase.my_vcr.use_cassette('basic_container_view.yaml', cassette_library_dir=tests.fixtures_path, record_mode='once') def test_basic_container_v...
""" handle Hatanka CRINEX files NOTE: This is a candidate for importlib.resources in Python >= 3.7 """ import subprocess import shutil from pathlib import Path from typing.io import TextIO from .build import build def crxexe(path: Path = Path(__file__).parent / "rnxcmp") -> str: """ Determines if CRINEX co...
from __future__ import division, print_function from timeit import default_timer class Timer(object): """ Utility class used for monitoring code execution time. This class offers two usage patterns - as a context manager or as a regular object. """ def __init__(self, start=False): """ Initial...
""" Yandex OpenID and OAuth2 support. This contribution adds support for Yandex.ru OpenID service in the form openid.yandex.ru/user. Username is retrieved from the identity url. If username is not specified, OpenID 2.0 url used for authentication. """ from social.p3 import urlsplit from social.backends.open_id import...
from __future__ import unicode_literals import frappe from frappe.utils import cstr, cint from frappe import throw, _ from frappe.model.document import Document class Account(Document): nsm_parent_field = 'parent_account' def onload(self): frozen_accounts_modifier = frappe.db.get_value("Accounts Settings", "Accou...
"""A PEP 517 interface to setuptools Previously, when a user or a command line tool (let's call it a "frontend") needed to make a request of setuptools to take a certain action, for example, generating a list of installation requirements, the frontend would would call "setup.py egg_info" or "setup.py bdist_wheel" on t...
"Build alignments and profiles in a directory tree of sequence sets." import itertools import logging import os import subprocess from glob import glob from os.path import basename, isdir, isfile, join from Bio import SeqIO from Bio import AlignIO from Bio.Seq import Seq from Bio.SeqRecord import SeqRecord from bioc...
# -*- coding: utf-8 -*- """ werkzeug.debug.repr ~~~~~~~~~~~~~~~~~~~ This module implements object representations for debugging purposes. Unlike the default repr these reprs expose a lot more information and produce HTML instead of ASCII. Together with the CSS and JavaScript files of the debug...
# Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: http://doc.scrapy.org/topics/item-pipeline.html #from scrapy import log from twisted.enterprise import adbapi import datetime import time from scrapy.exceptions import DropItem class DuplicatesPipeline(object):...
from tests.providers.google.cloud.utils.gcp_authenticator import GCP_FUNCTION_KEY from tests.test_utils.gcp_system_helpers import CLOUD_DAG_FOLDER, provide_gcp_context, skip_gcp_system from tests.test_utils.system_tests_class import SystemTest @skip_gcp_system(GCP_FUNCTION_KEY, require_local_executor=True) class GcpF...
"""Product controller.""" import json import uuid from oslo_db.exception import DBReferenceError from oslo_log import log import pecan from pecan.secure import secure import six from refstack.api import constants as const from refstack.api.controllers import validation from refstack.api import utils as api_utils fro...
import os from setuptools import setup, find_packages here = os.path.abspath(os.path.dirname(__file__)) requires = ['pyramid', 'WebError', 'pyramid_couchauth', 'py_bcrypt'] setup(name='pyramid_couchauth_example', version='0.1', description='Working pyramid_couchauth example.', long_des...
from django.conf.urls import url from django.contrib import admin from django.contrib.auth.admin import UserAdmin from django.contrib.auth.models import User from django.db import connections from django.test import TestCase, mock, override_settings from django.urls import reverse class Router(object): target_db ...
import unittest import sys from ecdsa.util import number_to_string from lib.bitcoin import ( generator_secp256k1, point_to_ser, public_key_to_bc_address, EC_KEY, bip32_root, bip32_public_derivation, bip32_private_derivation, pw_encode, pw_decode, Hash, public_key_from_private_key, address_from_private_key,...
import os import sys import re import importlib import collections import logging import moosetree import mooseutils import MooseDocs from ..base import Extension, components from ..base.readers import MarkdownReader from ..common import exceptions from ..tree import tokens from . import command, appsyntax LOG = loggi...
"""astroid packaging information""" distname = 'astroid' modname = 'astroid' numversion = (1, 2, 1) version = '.'.join([str(num) for num in numversion]) install_requires = ['logilab-common >= 0.60.0'] license = 'LGPL' author = 'Logilab' author_email = '<EMAIL>' mailinglist = "mailto://%s" % author_email web = 'ht...
from openerp import models, fields, api, exceptions, _ class PaymentLine(models.Model): _inherit = 'payment.line' mandate_id = fields.Many2one( comodel_name='account.banking.mandate', string='Direct Debit Mandate', domain=[('state', '=', 'valid')]) @api.model def create(self, vals=No...
import logging import sys from rbtools.utils.process import die # The clients are lazy loaded via load_scmclients() SCMCLIENTS = None class SCMClient(object): """ A base representation of an SCM tool for fetching repository information and generating diffs. """ def __init__(self, user_config=N...
from __future__ import print_function, division # import sys,os os.environ['KMP_DUPLICATE_LIB_OK']='True' # uncomment this line if omp error occurs on OSX for python 3 os.environ['OMP_NUM_THREADS']='1' # set number of OpenMP threads to run in parallel os.environ['MKL_NUM_THREADS']='1' # set number of MKL threads to run...
""" Maze generation using the binary tree algorithm MIT License Copyright (c) 2017 Gaurav Mathur Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation...
from jsonrpc import ServiceProxy import sys import string # ===== BEGIN USER SETTINGS ===== # if you do not set these you will be prompted for a password for every command rpcuser = "" rpcpass = "" # ====== END USER SETTINGS ====== if rpcpass == "": access = ServiceProxy("http://127.0.0.1:8332") else: access = Ser...
import sys try: import consul from requests.exceptions import ConnectionError python_consul_installed = True except ImportError, e: python_consul_installed = False try: import hcl pyhcl_installed = True except ImportError: pyhcl_installed = False from requests.exceptions import Connection...
# import numpy as np from hmm import posterior_decoding, prob_data, compare_statepath, max_and_index ''' 3 state HMM Notes In each emission matrix, the emissions for A,C, and G should be the same. It is the emissions for T, T1, and T2 that change. In the unlabeled state, it is predominantly T...
from django.shortcuts import render from django.http import HttpResponse, HttpResponseRedirect from django.contrib.auth.forms import UserCreationForm from django.template import loader, RequestContext from name_gen_app.models import NGram import pickle import name_generator # Load with open('ngrams/unigram_counts.pic...
import sys from oslo.config import cfg import webob from neutron.api import extensions from neutron.api.v2.attributes import convert_to_int from neutron.api.v2 import base from neutron.api.v2 import resource from neutron.common import exceptions as n_exc from neutron.manager import NeutronManager from neutron.opensta...
from datetime import datetime from twisted.web import resource, static from twisted.application.service import IServiceCollection from scrapy.utils.misc import load_object from .interfaces import IPoller, IEggStorage, ISpiderScheduler from . import webservice class Root(resource.Resource): def __init__(self, ...
"""Constants and membership tests for ASCII characters""" NUL = 0x00 # ^@ SOH = 0x01 # ^A STX = 0x02 # ^B ETX = 0x03 # ^C EOT = 0x04 # ^D ENQ = 0x05 # ^E ACK = 0x06 # ^F BEL = 0x07 # ^G BS = 0x08 # ^H TAB = 0x09 # ^I HT = 0x09 # ^I LF = 0x0a #...
import logging from tastypie.authorization import DjangoAuthorization , Authorization from tastypie.exceptions import Unauthorized from guardian.shortcuts import get_objects_for_user from guardian.core import ObjectPermissionChecker logger = logging.getLogger(__name__) class GuardianAuthorization(Authorization): ...
from ceilometer.openstack.common import test from ceilometer.volume import notifications NOTIFICATION_VOLUME_EXISTS = { u'_context_roles': [u'admin'], u'_context_request_id': u'req-7ef29a5d-adeb-48a8-b104-59c05361aa27', u'_context_quota_class': None, u'event_type': u'volume.exists', u'timestamp': u...
{ 'name': 'Memos pad', 'version': '0.1', 'category': 'Tools', 'description': """ This module update memos inside OpenERP for using an external pad ================================================================= Use for update your text memo in real time with the following user that you invite. """, ...
#!/usr/bin/python # -*- coding: utf-8 -*- """ Tests for configuration data. """ from __future__ import unicode_literals import unittest import os import sys DIR = os.path.dirname(__file__) sys.path.insert(0, os.path.join(DIR, "..")) from releng_sop.common import Environment, Release, ConfigError # noqa: E402 REL...
from i18n import _ from node import hex import match as matchmod import cmdutil import scmutil, util, encoding import cStringIO, os, tarfile, time, zipfile import zlib, gzip import struct import error # from unzip source code: _UNX_IFREG = 0x8000 _UNX_IFLNK = 0xa000 def tidyprefix(dest, kind, prefix): '''choose p...
from __future__ import unicode_literals import sickbeard from sickbeard.event_queue import Events class Restart(object): def __init__(self): pass @staticmethod def restart(pid): if str(pid) != str(sickbeard.PID): return False sickbeard.events.put(Events.SystemEvent.R...
import re import subprocess from nagios.errorlevels import NagiosOk # Plugin configuration import config #------------------------------------------------------------------------------- # Exceptions #------------------------------------------------------------------------------- class LstcStatusError(Exception): ...
#!/usr/bin/env python # -*- encoding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals import collections import io from absl.testing import absltest from typing import Text from grr_response_core.lib.util.compat import yaml # pylint: disable=...
import os import sys import traceback from ansible import constants as C from ansible.errors import AnsibleError, AnsibleOptionsError from ansible.parsing.vault import VaultEditor from ansible.cli import CLI from ansible.utils.display import Display class VaultCLI(CLI): """ Vault command line class """ VALID...
class RequestHeader: """ A single request header. Immutable. """ def __init__(self, name, value): if name is None or not name.strip(): raise ValueError("name is required") self.__name = name self.__value = value @property def name(self): """ ...
from twisted.application.reactors import Reactor default = Reactor( 'default', 'twisted.internet.default', 'The best reactor for the current platform.') select = Reactor( 'select', 'twisted.internet.selectreactor', 'select(2)-based reactor.') wx = Reactor( 'wx', 'twisted.internet.wxreactor', 'wxPython...
""" This test tests that i18n extraction (`paver i18n_extract -v`) works properly. """ from datetime import datetime, timedelta import os import random import re import sys import string import subprocess from unittest import TestCase from mock import patch from polib import pofile from pytz import UTC from i18n impo...
{ 'name': 'Just In Time Scheduling with Stock', 'version': '1.0', 'category': 'Base', 'description': """ If you install this module, it can make sure that not only the ship of pick-pack-ship will be created in batch, but the pick and the pack also. (which will dramatically improve performan...
''' Created on 30-08-2011 @author: Ankhazam Based on find_obj.py OpenCV2 sample ''' import numpy as np import cv2 from common import anorm class SURFFlannMatcher(object): ''' Main recognition and training module. ''' FLANN_INDEX_KDTREE = 1 # OpenCV bug: flann enums are missing flann_params = d...
from gnuradio import gr, gr_unittest import sys import random def make_random_complex_tuple(L): result = [] for x in range(L): result.append(complex(random.uniform(-1000,1000), random.uniform(-1000,1000))) return tuple(result) def make_random_float_tuple(L): resul...
""" ModelEventsForm.py This file ... """ from .ModelParentForm import ModelParentForm from signetsim.managers.models import renameSbmlIdInModelDependencies class ModelEventsForm(ModelParentForm): def __init__(self, parent): ModelParentForm.__init__(self, parent) self.name = None self.sbmlId = None sel...
import wsme from oslo_config import cfg from watcher.api.controllers.v1 import utils from watcher.tests import base CONF = cfg.CONF class TestApiUtils(base.TestCase): def test_validate_limit(self): limit = utils.validate_limit(10) self.assertEqual(10, 10) # max limit limit = u...
from ggrc import db from ggrc.models.mixins import Base class Event(Base, db.Model): __tablename__ = 'events' action = db.Column( db.Enum(u'POST', u'PUT', u'DELETE', u'BULK', u'GET'), nullable=False, ) resource_id = db.Column(db.Integer) resource_type = db.Column(db.String) revisions = db.re...
#!/usr/bin/env python from flexbe_core import EventState, Logger from flexbe_core.proxy import ProxyActionClient from actionlib_msgs.msg import GoalStatus from move_base_msgs.msg import * from geometry_msgs.msg import Pose, Point, Quaternion, Pose2D from tf import transformations """ Created on 11/19/2015 @author: ...
import osv from datetime import date import time import pooler import xmlrpclib import re import tools import threading from osv import osv, fields class RPCProxyOne(object): def __init__(self, server, ressource): self.server = server local_url = 'http://%s:%d/xmlrpc/common'%(server.server_url,serv...
from __future__ import absolute_import, division, print_function, unicode_literals from .common import BaseTest class EKS(BaseTest): def test_query_with_subnet_sg_filter(self): factory = self.replay_flight_data("test_eks_query") p = self.load_policy( { "name": "eks",...
# -*- coding: utf-8 -*- """ requests.api ~~~~~~~~~~~~ This module implements the Requests API. :copyright: (c) 2012 by Kenneth Reitz. :license: Apache2, see LICENSE for more details. """ from . import sessions def request(method, url, **kwargs): """Constructs and sends a :class:`Request <Request>`. :par...
from pylayers.antprop.antenna import * from pylayers.antprop.antvsh import * import matplotlib.pylab as plt from numpy import * import pdb """ This test : 1 : loads a measured antenna 2 : applies an electrical delay obtained from data with getdelay method 3 : evaluate the antenna vsh coefficient with a dow...
""" =================================================== Label Propagation digits: Demonstrating performance =================================================== This example demonstrates the power of semisupervised learning by training a Label Spreading model to classify handwritten digits with sets of very few labels....
#! /usr/bin/env python import sys, re _libraries = [] # (X,Y,Z): from Y import X as Z _input_names = [] _input_types = [] _return_names = [] _return_types = [] _run_func_content = '' _init_func_content = '' _ext_name = '' # Add a library (should be installed on machines within GP) # Sample Usage: # import_lib(X,...
from __future__ import unicode_literals import json from datetime import time import jsonschema from flask import session from wtforms.fields import StringField, TextAreaField, BooleanField, IntegerField, SelectField from wtforms.fields.html5 import EmailField, DecimalField from wtforms.validators import DataRequired...
#!/usr/bin/env python # example progressbar.py import pygtk pygtk.require('2.0') import gtk # Update the value of the progress bar so that we get # some movement def progress_timeout(pbobj): if pbobj.activity_check.get_active(): pbobj.pbar.pulse() else: # Calculate the value of the progress b...
import os import sys import json from functools import partial from operator import attrgetter from random import randint import bleach from tg import expose, TGController, AppConfig from jinja2 import Environment, PackageLoader from sqlalchemy.orm import scoped_session, sessionmaker from sqlalchemy import create_e...
#!/usr/bin/env python import cv2 import numpy as np class ColourDetection(object): #HSV 180-255-255 max values openCV (recalculate from GIMP) #these need adjusting BOUNDARIES = { 'red1': ([0, 50, 50], [20, 255, 255]), 'red2': ([160, 50, 50], [179, 255, 255]), 'blue': ([110, 50, 50], [130, ...
"""Feeds for Gstudio""" from urlparse import urljoin from BeautifulSoup import BeautifulSoup from django.contrib.auth.models import User from django.contrib.sites.models import Site from django.core.urlresolvers import reverse from django.shortcuts import get_object_or_404 from django.utils.feedgenerator import Atom1F...
import avango from _registry import _register_field class MFStringDescriptor(object): 'Simple stream support for MFString' key = "MFString" def write(self, field, hout): if field.value: hout.write('\x00') hout.write('\x00'.join(field.value)) def read(self, line): ...
import io import logging import os import tempfile from south.tests import unittest import sys from django.conf import settings from django.db import connection, models from south.db import db from south.logger import close_logger class TestLogger(unittest.TestCase): """ Tests if the logging is working reas...
# This code was originally contributed by Jeffrey Harris. import datetime import struct import _winreg __author__ = "Jeffrey Harris & Gustavo Niemeyer <<EMAIL>>" __all__ = ["tzwin", "tzwinlocal"] ONEWEEK = datetime.timedelta(7) TZKEYNAMENT = r"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones" TZKEYNAME9X = r...
from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) from pants.backend.jvm.targets.exportable_jvm_library import ExportableJvmLibrary class JavaLibrary(ExportableJvmLibrary): """A collection of Java code. Normall...
""" Device description XML generator. """ from xml.etree.cElementTree import ElementTree, Element, SubElement from brisa.upnp.upnp_defaults import UPnPDefaults class DeviceXMLBuilder(object): def __init__(self, device): self.device = device self.url_base = device.location def get_element(s...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} import re import os from fnmatch import fnmatch from copy import deepcopy from ansible.module...
from django.conf.urls import patterns, url from django.contrib.admindocs import views urlpatterns = patterns('', url('^$', views.doc_index, name='django-admindocs-docroot' ), url('^bookmarklets/$', views.bookmarklets, name='django-admindocs-bookmarklets' ), url('^tag...
from sqlalchemy.orm import exc import neutron.db.api as db from neutron.openstack.common.db import exception as db_exc from neutron.openstack.common import excutils from neutron.openstack.common import log as logging from neutron.plugins.vmware.dbexts import models from neutron.plugins.vmware.dbexts import networkgw_d...
"""This test checks for correct wait3() behavior. """ import os import time import unittest from test.fork_wait import ForkWait from test.test_support import run_unittest, reap_children try: os.fork except AttributeError: raise unittest.SkipTest, "os.fork not defined -- skipping test_wait3" try: os.wait3...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} import json from datetime import datetime as dt, timedelta from time import sleep from ans...
""" Provide the class doxygen comment. It checks if there is doxygen sytle comment in front of each class definition. == Violation == class A { <== Violation. No doxygen comment. }; /* <== Violation. It's not a doxygen comment * */ class B { }; == Good == /** * blar bl...
""" Line visual implementing Agg- and GL-based drawing modes. """ from __future__ import division import numpy as np from ... import gloo, glsl from ...color import Color, ColorArray, get_colormap from ...ext.six import string_types from ..shaders import Function from ..visual import Visual, CompoundVisual from ...u...
# -*- coding: utf-8 -*- """ *************************************************************************** r_li_richness_ascii.py ---------------------- Date : February 2016 Copyright : (C) 2016 by Médéric Ribreux Email : medspx at medspx dot fr **************...
# -*- coding: utf-8 -*- """ /*************************************************************************** Name : DB Manager Description : Database manager plugin for QGIS Date : Oct 13, 2011 copyright : (C) 2011 by Giuseppe Sucameli email : <EMAIL> The...
""" Helper functions for bok_choy test tasks """ import sys import os import time import httplib import subprocess from paver.easy import sh from pavelib.utils.envs import Env from pavelib.utils.process import run_background_process try: from pygments.console import colorize except ImportError: colorize = lamb...
import pytest openshiftdynamic = pytest.importorskip("openshift.dynamic") from units.modules.utils import set_module_args from units.utils.kubevirt_fixtures import base_fixture, RESOURCE_DEFAULT_ARGS, AnsibleExitJson from ansible.module_utils.kubevirt import KubeVirtRawModule from ansible.modules.cloud.kubevirt impo...
import os import sys import glob import yaml os.chdir(os.path.dirname(sys.argv[0]) + '/../..') out = {} out['libs'] = [{ 'name': 'benchmark', 'build': 'private', 'language': 'c++', 'secure': False, 'defaults': 'benchmark', 'src': sorted(glob.glo...
import numpy as np def orthomax(A, gamma=1, reltol=1.4901e-07, maxit=256): # ORTHOMAX Orthogonal rotation of FA or PCA loadings. # Taken from metpy d, m = A.shape B = np.copy(A) T = np.eye(m) converged = False if (0 <= gamma) & (gamma <= 1): while converged is False: ...
""" Models for configuring waffle utils. """ from django.db.models import CharField from django.utils.translation import ugettext_lazy as _ from model_utils import Choices from opaque_keys.edx.django.models import CourseKeyField from six import text_type from config_models.models import ConfigurationModel from openedx...
from pulp.server.webservices.serialization.link import link_obj def task_result_href(task): if task.get('task_id'): return {'_href': '/pulp/api/v2/tasks/%s/' % task['task_id']} return {} def task_href(call_report): if call_report.call_request_id is None: return {} return {'_href': '/...
"""Unit tests for core.domain.beam_job_domain.""" from __future__ import absolute_import # pylint: disable=import-only-modules from __future__ import unicode_literals # pylint: disable=import-only-modules import datetime from core.domain import beam_job_domain from core.platform import models from core.tests impor...
from __future__ import division, print_function, absolute_import import numpy as np from scipy.sparse.sparsetools import cs_graph_components as _cs_graph_components from scipy.sparse.csr import csr_matrix from scipy.sparse.base import isspmatrix _msg0 = 'x must be a symmetric square matrix!' _msg1 = _msg0 + '(has s...
from django.conf.urls import include # noqa from django.conf.urls import patterns from django.conf.urls import url from openstack_dashboard.dashboards.admin.networks.agents \ import views as agent_views from openstack_dashboard.dashboards.admin.networks.ports \ import urls as port_urls from openstack_dashboar...
"""Provides managed registration services on behalf of :func:`.listen` arguments. By "managed registration", we mean that event listening functions and other objects can be added to various collections in such a way that their membership in all those collections can be revoked at once, based on an equivalent :class:`....
# encoding:utf-8 __author__ = 'Hope6537' class Userinfo(object): def __init__(self, username, password): self._username = username self._password = password __slots__ = ('_username', '_password', "_score") # 用tuple定义允许绑定的属性名称 # 使用__slots__要注意,__slots__定义的属性仅对当前类起作用,对继承的子类是不起作用的 ...
import os import os.path import tempfile import shutil import subprocess import imp from nose.tools import eq_ class BaseRewriteScript(object): def __init__(self): info = imp.find_module('runner', ['lib/build_pack_utils']) self.run = imp.load_module('runner', *info) def setUp(self): s...
"""Benchmarks of Lasso regularization path computation using Lars and CD The input data is mostly low rank but is a fat infinite tail. """ from __future__ import print_function from collections import defaultdict import gc import sys from time import time import numpy as np from sklearn.linear_model import lars_pat...
import sys import os import json import logging import re import datetime as dt from os import access, R_OK, walk, remove from os.path import join, sep from itertools import chain from subprocess import Popen from pysyspol.util import get_script_name import timeman MODE_UPDATE = 'update' MODE_RETRIEVE = 'retrieve' d...
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse_lazy from django.utils.datastructures import SortedDict from django.utils.translation import ugettext_lazy as _ from horizon import exceptions from horizon import forms from horizon import tables from horizon.utils import memoize...
"""Finds desktop browsers that can be controlled by telemetry.""" import logging import os import subprocess import sys from telemetry.core import exceptions from telemetry.core import platform as platform_module from telemetry.internal.backends.chrome import desktop_browser_backend from telemetry.internal.browser im...
import mock from django.conf import settings from openstack_dashboard import api from openstack_dashboard.api.rest import nova from openstack_dashboard.test import helpers as test class NovaRestTestCase(test.TestCase): # # Keypairs # @mock.patch.object(nova.api, 'nova') def test_keypair_get(self...
from testbase import * import pgasync from twisted.internet.defer import waitForDeferred as waitD, deferredGenerator class TestNone(TestCase): schema = 'id int, nil varchar(1)' @deferredGenerator def testnull(self): id = getId() i = None yield waitD(self.pool.runOperation( 'insert into t_tbl VALUES(%d, ...
""" Show diagnostic information """ import Common import locale import os import platform import sys if 'nt' == os.name: from win32com.shell import shell def diagnostic_info(): """Return diagnostic information as a string""" s = "BleachBit version %s" % Common.APP_VERSION try: import gtk ...
import abc from framework.auth.decorators import collect_auth from website.util import api_url_for, web_url_for class AddonSerializer(object): __metaclass__ = abc.ABCMeta # TODO take addon_node_settings, addon_user_settings def __init__(self, node_settings=None, user_settings=None): self.node_se...
import os from os.path import sep, join, exists from itertools import groupby from xml.etree.ElementTree import Element, tostring import ntpath import re import json from tools.arm_pack_manager import Cache from tools.targets import TARGET_MAP from tools.export.exporters import Exporter, TargetNotSupportedException c...
import re import subprocess def get_git_status(): has_pending_commits = True has_untracked_files = False has_changed_files = False origin_position = "" output = subprocess.Popen(['git', 'status', '--ignore-submodules'], env={"LANG": "C", "HOME": os.getenv("HOME")}, stdout=subprocess.PIP...
from spack import * class Minife(MakefilePackage): """Proxy Application. MiniFE is an proxy application for unstructured implicit finite element codes. """ homepage = "https://mantevo.org/" url = "https://github.com/Mantevo/miniFE/archive/v2.1.0.tar.gz" tags = ['proxy-app', 'ecp-prox...
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Removing unique constraint on 'VerificationCheckpoint', fields ['course_id', 'c...
""" This is the core labeltool module. """ import os import sys from PyQt4.QtGui import * from PyQt4.QtCore import * from sloth.annotations.model import * from sloth.annotations.container import AnnotationContainerFactory, AnnotationContainer from sloth.conf import config from sloth.core.cli import LaxOptionParser, Bas...