content
stringlengths
4
20k
#!/usr/bin/env python from setuptools import setup # version_tuple = __import__('xadmin.version').VERSION # version = ".".join([str(v) for v in version_tuple]) setup( name='django-xadmin', version='0.5.0', description='Drop-in replacement of Django admin comes with lots of goodies, fully extensible with p...
# -*- 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 field 'UserProfile.geo_country' db.add_column('profile', 'geo_country', self....
"""Utilities for building L{PB<twisted.spread.pb>} clients with L{Tkinter}. """ from Tkinter import ( ACTIVE, Button, Canvas, E, END, Entry, Frame, Label, LEFT, Listbox, mainloop, N, S, StringVar, Toplevel, Tk, W) from tkSimpleDialog import _QueryString from tkFileDialog import _Dialog from twisted.spread impor...
from flask import jsonify from flask_restx import inputs from flexget import plugin from flexget.api import APIResource, api from flexget.api.app import BadRequest, NotFoundError, etag tmdb_api = api.namespace('tmdb', description='TMDB lookup endpoint') class ObjectsContainer: poster_object = { 'type': ...
"""Ops for training linear models. ## This package provides optimizers to train linear models. @@SdcaModel @@SparseFeatureColumn @@SDCAOptimizer """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.contrib.linear_optimizer.python.ops.sdca_op...
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.basic import AnsibleModule def get_bundler_executable(module): ...
import bitcoin.script from .varlen import varlenDecode, varlenEncode from util import dblsha from struct import pack, unpack _nullprev = b'\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0' class Txn: def __init__(self, data=None): if data: self.data = data self.idhash() @classmethod def n...
from django.db.models.constants import LOOKUP_SEP from django.db.models.fields import FieldDoesNotExist from django.db.models.sql.expressions import SQLEvaluator from django.db.models.sql.where import Constraint, WhereNode from django.contrib.gis.db.models.fields import GeometryField class GeoConstraint(Constraint): ...
from glanceclient.v1 import images from openstack_dashboard.test.test_data import utils def data(TEST): TEST.images = utils.TestDataContainer() TEST.snapshots = utils.TestDataContainer() # Snapshots snapshot_dict = {'name': u'snapshot', 'container_format': u'ami', ...
import datetime import hashlib import urllib from django.contrib import auth from django.contrib.auth.signals import user_logged_in from django.core.exceptions import ImproperlyConfigured from django.db import models from django.db.models.manager import EmptyManager from django.contrib.contenttypes.models import Conte...
from __future__ import absolute_import, division, print_function __metaclass__ = type from ansible.module_utils.urls import generic_urlparse from ansible.module_utils.six.moves.urllib.parse import urlparse, urlunparse def test_generic_urlparse(): url = 'https://ansible.com/blog' parts = urlparse(url) gen...
from msrest.serialization import Model class ServiceTypeHealthPolicy(Model): """Represents the health policy used to evaluate the health of services belonging to a service type. . :param max_percent_unhealthy_partitions_per_service: The maximum allowed percentage of unhealthy partitions per serv...
import unittest import sys from .support import LoggingResult, TestEquality ### Support code for Test_TestSuite ################################################################ class Test(object): class Foo(unittest.TestCase): def test_1(self): pass def test_2(self): pass def test_3(self...
"""Unit test for the gtest_xml_output module.""" __author__ = "<EMAIL> (Keith Ray)" import os from xml.dom import minidom, Node import gtest_test_utils import gtest_xml_test_utils GTEST_OUTPUT_SUBDIR = "xml_outfiles" GTEST_OUTPUT_1_TEST = "gtest_xml_outfile1_test_" GTEST_OUTPUT_2_TEST = "gtest_xml_outfile2_test_" ...
ANSIBLE_METADATA = {'status': ['preview'], 'supported_by': 'community', 'version': '1.0'} # ======================================= # sendgrid module support methods # import urllib try: import sendgrid HAS_SENDGRID = True except ImportError: HAS_SENDGRID = False d...
""" Form Widget classes specific to the Django admin site. """ from __future__ import unicode_literals import copy from django import forms from django.contrib.admin.templatetags.admin_static import static from django.core.urlresolvers import reverse from django.db.models.deletion import CASCADE from django.forms.uti...
import os import sys import pafy import time import Queue import logging import threading import ConfigParser import pychromecast import paho.mqtt.client as mqtt class Chromecast(threading.Thread): def _readConfig(self): update = False if not os.path.isdir(self._homeDir): print ...
def read_checksum(filehandle): # We expect the comment to be at the beginning of the file. data = filehandle.read(2048) comment_key = 'tEXtchecksum\x00' comment_pos = data.find(comment_key) if comment_pos == -1: return checksum_pos = comment_pos + len(comment_key) return data[checks...
import sys import syslog import configparser import pycurl import pypad from io import BytesIO def eprint(*args,**kwargs): print(*args,file=sys.stderr,**kwargs) def ProcessPad(update): n=1 section='Station'+str(n) while(update.config().has_section(section)): if update.shouldBeProcessed(section...
import os import socket import atexit import re import functools from setuptools.extern.six.moves import urllib, http_client, map, filter from pkg_resources import ResolutionError, ExtractionError try: import ssl except ImportError: ssl = None __all__ = [ 'VerifyingHTTPSHandler', 'find_ca_bundle', 'is_a...
# -*- coding: utf-8 -*- """ *************************************************************************** PredicatePanel.py --------------------- Date : January 2015 Copyright : (C) 2015 by Arnaud Morvan Email : arnaud dot morvan at camptocamp dot com Con...
import unittest from webkitpy.common.system.filesystem import FileSystem from webkitpy.common.system.logtesting import LoggingTestCase from webkitpy.style.checker import ProcessorBase from webkitpy.style.filereader import TextFileReader class TextFileReaderTest(LoggingTestCase): class MockProcessor(ProcessorBas...
from units.compat import unittest from ansible.module_utils.common.dict_transformations import _camel_to_snake, _snake_to_camel, camel_dict_to_snake_dict, dict_merge EXPECTED_SNAKIFICATION = { 'alllower': 'alllower', 'TwoWords': 'two_words', 'AllUpperAtEND': 'all_upper_at_end', 'AllUpperButPLURALs': 'a...
import random from django.shortcuts import get_object_or_404, render from django.views.generic.edit import CreateView from django.core.urlresolvers import reverse_lazy from painindex_app.models import PainSource from painindex_app.forms import PainReportForm from django.http import HttpResponse def homepage(request):...
#!python3 """ Script Wrapper for uploading firmware to LPC Expresso boards via LPCLink-1 """ import sys, logging, argparse from lpc_settings import LPCSettings from pylib.logwrapper import LogWrapper from pylib.process import Process from os.path import abspath, dirname, join try: # Setup logging LogWrapper...
from aubio.task import task from aubio.aubioclass import * class tasknotes(task): def __init__(self,input,output=None,params=None): task.__init__(self,input,params=params) self.opick = onsetpick(self.params.bufsize, self.params.hopsize, self.channels, self.myvec, self.params.threshold, mode=self.pa...
import importlib from importlib import machinery from .. import abc from .. import util from . import util as builtin_util import sys import types import unittest class LoaderTests(abc.LoaderTests): """Test load_module() for built-in modules.""" verification = {'__name__': 'errno', '__packag...
import contextlib import shutil import tempfile import numpy # import classes and functions from chainer.utils.array import sum_to # NOQA from chainer.utils.conv import get_conv_outsize # NOQA from chainer.utils.conv import get_deconv_outsize # NOQA from chainer.utils.experimental import experimental # NOQA from ...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = { 'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'core' }
#!/usr/bin/python """Test of Orca's presentation of a combo box.""" from macaroon.playback import * import utils sequence = MacroSequence() sequence.append(PauseAction(3000)) sequence.append(TypeAction("This is a test.")) sequence.append(KeyComboAction("Left")) sequence.append(KeyComboAction("<Control><Shift>Left")...
import os, sys, subprocess, hashlib import subprocess def check_output(*popenargs, **kwargs): r"""Run command with arguments and return its output as a byte string. Backported from Python 2.7 as it's implemented as pure python on stdlib. >>> check_output(['/usr/bin/python', '--version']) Python 2.6....
# -*- coding: utf-8 -*- """ *************************************************************************** MatrixModelerWidget.py --------------------- Date : May 2018 Copyright : (C) 2018 by Alexander Bruy Email : alexander dot bruy at gmail dot com *********...
#!/usr/bin/env python import vtk from vtk.test import Testing from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() # This example shows how to visualise the variation in shape in a set of objects using # vtkPCAAnalysisFilter. # # We make three ellipsoids by distorting and translating a sphere and ...
"""Generic output formatting. Formatter objects transform an abstract flow of formatting events into specific output events on writer objects. Formatters manage several stack structures to allow various properties of a writer object to be changed and restored; writers need not be able to handle relative changes nor an...
from shinken_test import * class TestFreshness(ShinkenTest): def setUp(self): self.setup_with_file('etc/shinken_freshness.cfg') # Check if the check_freshnes is doing it's job def test_check_freshness(self): self.print_header() # We want an eventhandelr (the perfdata command) to ...
# pylint: disable=import-error,no-name-in-module from distutils.version import StrictVersion import unittest import re import os import pkg_resources from sphinx import __version__ as __sphinx_version__ from sphinx.builders.html import StandaloneHTMLBuilder from lxml import etree try: from StringIO import StringIO...
""" This script performs an out of core groupby operation for different datasets. The datasets to be processed are normally in CSV files and the key and value to be used for the grouping are defined programatically via small functions (see toy_stream() and statsmodel_stream() for examples). Those datasets included in...
""" Test continuity of polynomial basis and its gradients along an edge on :math:`y` line (2D) or on a face in :math:`x`-:math:`y` plane (3D) between two elements aligned with the coordinate system, stack one on top of the other. The evaluation occurs in several points shifted by a very small amount from the boundary b...
class grid: w = 0 h = 0 grid = None def __init__(self): rows = grid_array() rows.onAdd = self._add_width cols = grid_array() cols.onAdd = self._add_height self.grid = rows self.grid.append(cols) def __getitem__(self, x): return self.grid[x] def __setitem__(self, x, value): self.grid[x] = value ...
from openerp.osv import fields,osv from openerp import tools class purchase_report(osv.osv): _name = "purchase.report" _description = "Purchases Orders" _auto = False _columns = { 'date': fields.datetime('Order Date', readonly=True, help="Date on which this document has been created"), # TDE F...
import collections import json import uuid from rally.common import db from rally.common.i18n import _LE from rally import consts from rally import exceptions from rally.task.processing import charts OUTPUT_SCHEMA = { "type": "object", "properties": { "additive": { "type": "array", ...
"""Map new event context values to old top-level field values. Ensures events can be parsed by legacy parsers.""" import json import logging from opaque_keys import InvalidKeyError from opaque_keys.edx.keys import UsageKey log = logging.getLogger(__name__) CONTEXT_FIELDS_TO_INCLUDE = [ 'username', 'session...
# coding=utf-8 import time import math import multiprocessing import os import random import sys import signal try: from setproctitle import getproctitle, setproctitle except ImportError: setproctitle = None from diamond.utils.signals import signal_to_exception from diamond.utils.signals import SIGALRMExcept...
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...
from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'd F Y' # 25 Ottobre 2006 TIME_FORMAT = 'H:i' # 14:30 DATETIME_FORMAT = 'l d F Y H:i' # Mercoledì 25 Ottobre 2006 14:30 YEAR_MONTH_F...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import re from units.compat.mock import patch from units.modules.utils import set_module_args from ansible.modules.network.slxos import slxos_lldp from .slxos_module import TestSlxosModule, load_fixture class TestSlxosLldpModule...
""" Classes providing more user-friendly interfaces to the doxygen xml docs than the generated classes provide. """ import os from generated import index from base import Base from text import description class DoxyIndex(Base): """ Parses a doxygen xml directory. """ __module__ = "gnuradio.utils.dox...
""" DataTypes for mapping some TVB DataTypes to a Connectivity (regions). .. moduleauthor:: Lia Domide <<EMAIL>> .. moduleauthor:: Mihai Andrei <<EMAIL>> """ import numpy import tvb.basic.traits.exceptions as exceptions from tvb.basic.logger.builder import get_logger from tvb.datatypes.region_mapping_data import Regi...
microcode = ''' # # Regular moves # def macroop MOV_R_MI { limm t1, imm, dataSize=asz ld reg, seg, [1, t0, t1] }; def macroop MOV_MI_R { limm t1, imm, dataSize=asz st reg, seg, [1, t0, t1] }; def macroop MOV_R_R { mov reg, reg, regm }; def macroop MOV_M_R { st reg, seg, sib, disp }; def ma...
import requests from django.conf import settings def get_request(params): if settings.DEBUG: api_key = {'api_key': settings.MHN_DEV_KEY} else: api_key = {'api_key': settings.MHN_API_KEY} base_url = settings.MHN_URL if not params: request = api_key else: request = {...
from django import forms from . import models class AccountForm(forms.ModelForm): class Meta: model = models.User exclude = ('first_name', 'last_name', 'password', 'is_staff', 'is_active', 'is_superuser', 'last_login', 'date_joined', 'groups', 'user_permissi...
import json import django.db from student.tests.factories import UserFactory, RegistrationFactory, PendingEmailChangeFactory from student.views import reactivation_email_for_user, change_email_request, confirm_email_change from student.models import UserProfile, PendingEmailChange from django.contrib.auth.models impor...
import unittest from test import test_support import textwrap class ComplexArgsTestCase(unittest.TestCase): def check(self, func, expected, *args): self.assertEqual(func(*args), expected) # These functions are tested below as lambdas too. If you add a # function test, also add a similar lambda t...
""" # popup keyboard for use with touchscreen applications # used by pyngcgui.py # based on work of John Thornton's Buglump Optional __init__() args: glade_file (default = 'popupkeyboard.ui') dialog_name (default = 'dialog') Main window num_entry_name (default = 'num_entry') Entry for dis...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Checker for file headers ~~~~~~~~~~~~~~~~~~~~~~~~ Make sure each Python file has a correct file header including copyright and license information. :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE fo...
"""Fichier contenant le paramètre 'montrer' de la commande 'pavillon'.""" from primaires.interpreteur.masque.parametre import Parametre class PrmMontrer(Parametre): """Commande 'pavillon montrer'. """ def __init__(self): """Constructeur du paramètre""" Parametre.__init__(self, "montrer"...
from collections import namedtuple from ..exceptions import LocationParseError url_attrs = ['scheme', 'auth', 'host', 'port', 'path', 'query', 'fragment'] class Url(namedtuple('Url', url_attrs)): """ Datastructure for representing an HTTP URL. Used as a return value for :func:`parse_url`. """ s...
""" Speed tests of Jedi. To prove that certain things don't take longer than they should. """ import time import functools from .helpers import TestCase, cwd_at import jedi class TestSpeed(TestCase): def _check_speed(time_per_run, number=4, run_warm=True): """ Speed checks should typically be very tolera...
try: from distutils.version import LooseVersion HAS_LOOSE_VERSION = True except: HAS_LOOSE_VERSION = False AWS_REGIONS = ['ap-northeast-1', 'ap-southeast-1', 'ap-southeast-2', 'eu-west-1', 'sa-east-1', 'us-east-1', 'u...
import string from random import choice from datetime import datetime from sqlalchemy import UniqueConstraint, func from mhn import db from mhn.api import APIModel from mhn.auth.models import User from mhn.common.clio import Clio class Sensor(db.Model, APIModel): # Defines some properties on the fields: # ...
""" Tests for class dashboard (Metrics tab in instructor dashboard) """ import json from django.core.urlresolvers import reverse from django.test.client import RequestFactory from mock import patch from capa.tests.response_xml_factory import StringResponseXMLFactory from courseware.tests.factories import StudentModu...
import string # pylint: disable=deprecated-module from pyanaconda.core.i18n import N_ from enum import Enum # Use -1 to indicate that the selinux configuration is unset SELINUX_DEFAULT = -1 # where to look for 3rd party addons ADDON_PATHS = ["/usr/share/anaconda/addons"] # common string needs to be easy to change f...
# -*- coding: utf-8 -*- """ *************************************************************************** dinftranslimaccum2.py --------------------- Date : October 2012 Copyright : (C) 2012 by Alexander Bruy Email : alexander dot bruy at gmail dot com ******...
from openerp.osv import osv from openerp.tools.translate import _ class base_module_configuration(osv.osv_memory): _name = "base.module.configuration" def start(self, cr, uid, ids, context=None): todo_ids = self.pool.get('ir.actions.todo').search(cr, uid, ['|', ('type','=','recurring'), (...
from neutron.plugins.ml2.drivers.openvswitch.agent.common import constants from neutron.plugins.ml2.drivers.openvswitch.agent.openflow.native \ import br_dvr_process from neutron.plugins.ml2.drivers.openvswitch.agent.openflow.native \ import ovs_bridge class OVSPhysicalBridge(ovs_bridge.OVSAgentBridge, ...
"""Module to enforce different constraints on flags. A validator represents an invariant, enforced over a one or more flags. See 'FLAGS VALIDATORS' in gflags.py's docstring for a usage manual. """ __author__ = '<EMAIL> (Olexiy Oryeshko)' class Error(Exception): """Thrown If validator constraint is not satisfied."...
import rent_make_group import rent_check_invoicing # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
import logging from dataclasses import dataclass # pylint: disable=wrong-import-order from enum import Enum from typing import List, Optional, Set from urllib import parse import sqlparse from sqlparse.sql import ( Identifier, IdentifierList, Parenthesis, remove_quotes, Token, TokenList, ) fro...
class UdOpcodeTables: TableInfo = { 'opctbl' : { 'name' : 'UD_TAB__OPC_TABLE', 'size' : 256 }, '/sse' : { 'name' : 'UD_TAB__OPC_SSE', 'size' : 4 }, '/reg' : { 'name' : 'UD_TAB__OPC_REG', 'size' : 8 }, '/rm' : { 'name' : 'UD_TAB__OPC_RM', 'size' : 8 ...
import vstruct from vstruct.primitives import * HEAD_TYPE_MARKER = 0x72 #marker block HEAD_TYPE_ARCHIVE = 0x73 #archive header HEAD_TYPE_FILE_HDR = 0x74 #file header HEAD_TYPE_OLD_COMMENT = 0x75 #old style comment header HEAD_TYPE_OLD_AUTH = 0x76 #o...
"""Utilities for dealing with the python unittest module.""" import fnmatch import sys import unittest class _TextTestResult(unittest._TextTestResult): """A test result class that can print formatted text results to a stream. Results printed in conformance with gtest output format, like: [ RUN ] autofi...
#!/usr/bin/env python from __future__ import division, absolute_import, print_function # A simple script to test the installed version of numpy by calling # 'numpy.test()'. Key features: # -- convenient command-line syntax # -- sets exit status appropriately, useful for automated test environments # It would be b...
from twisted.internet.task import react from twisted.internet.defer import inlineCallbacks as coroutine from autobahn.twisted.connection import Connection def main(reactor, connection): @coroutine def on_join(session, details): print("on_join: {}".format(details)) try: print(sessi...
"""Integration tests for the new-run-webkit-httpd and new-run-webkit-websocketserver scripts""" # FIXME: Rename this file to something more descriptive. import errno import os import socket import subprocess import sys import tempfile import unittest2 as unittest class BaseTest(unittest.TestCase): """Basic fram...
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.basic import AnsibleModule, env_fallback from ansible.module_utils.network.fortimanager.forti...
"Database cache backend." from django.core.cache.backends.base import BaseCache from django.db import connection, transaction, DatabaseError import base64, time from datetime import datetime try: import cPickle as pickle except ImportError: import pickle class CacheClass(BaseCache): def __init__(self, tab...
"""Tests for workflow object exports.""" from os.path import abspath, dirname, join from flask.json import dumps from ggrc.app import app from ggrc_workflows.models import Workflow from integration.ggrc import TestCase from integration.ggrc_workflows.generator import WorkflowsGenerator THIS_ABS_PATH = abspath(dirnam...
import os import re import sys import subprocess import platform import versioneer from setuptools import setup, Extension from setuptools.command.build_ext import build_ext from distutils.version import LooseVersion class CMakeExtension(Extension): def __init__(self, name, sourcedir=''): Extension.__ini...
from time import sleep # from datetime import datetime import bike_agent as model from router import refine, Router import argparse import random parser = argparse.ArgumentParser(description='grab adscriptions from medline') parser.add_argument('--init', type=int, default=50, help="set to 0 to resu...
{ "name" : 'CLEARCORP Product Cost Group', "version" : '2.0', "author" : 'CLEARCORP S.A.', #easy, normal, expert 'complexity': 'normal', "description": """ Creates group to show/hide costs of products, customizes product views """, "category": 'Sales', "sequence": 4, "we...
"""Support code for working with Shippable.""" from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import re import time from .. import types as t from ..config import ( CommonConfig, TestConfig, ) from ..git import ( Git, ) from ..http import ( HttpCli...
import numpy as np import pandas as pd def normalize_address(raw_address): for c in ["'", ",", "°", "•", "`", '"', "‘", "-"]: raw_address = raw_address.replace(c, "") raw_address = raw_address.lower() if "<" in raw_address: prefix = raw_address[:raw_address.index("<")].strip() if ...
''' Run this script every time you change one of the png files. Using pngcrush, it will optimize the png files, remove various color profiles, remove ancillary chunks (alla) and text chunks (text). #pngcrush -brute -ow -rem gAMA -rem cHRM -rem iCCP -rem sRGB -rem alla -rem text ''' import os import sys import subproces...
""" Support for BLIS as toolchain linear algebra library. :author: Kenneth Hoste (Ghent University) :author: Bart Oldeman (McGill University, Calcul Quebec, Compute Canada) """ from easybuild.tools.toolchain.linalg import LinAlg TC_CONSTANT_BLIS = 'BLIS' class Blis(LinAlg): """ Trivial class, provides BLI...
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'WmsServer.js_popup_class' db.add_column('lizard_workspace_wmsserver', 'js_popup_class', se...
from unittest import TestCase from Data_Production.sem_extract_pipeline import SemPipeline, ParamTester from collections import Counter import re import os import shutil import numpy as np __author__ = 'matt' class TestInit(TestCase): def test_sim_algo_reset(self): """ Tests whether an incorrect value fo...
""" This module contains general purpose URL functions not found in the standard library. Some of the functions that used to be imported from this module have been moved to the w3lib.url module. Always import those from there instead. """ import posixpath from six.moves.urllib.parse import (ParseResult, urlunparse, ur...
import unittest from django.test import TestCase from operating_system.public import OperatingSystem from remote_host.public import RemoteHost from ..operating_system_support import OperatingSystemRelations, AbstractedRemoteHostOperator RELATION_MOCK = { '1': { '2': { '3': { ...
from spack import * class Dri3proto(AutotoolsPackage): """Direct Rendering Infrastructure 3 Extension. This extension defines a protocol to securely allow user applications to access the video hardware without requiring data to be passed through the X server.""" homepage = "https://cgit.freedesk...
import sys import unittest from django.db import connection from django.test import TestCase from django.test.runner import DiscoverRunner from django.utils import six from django.utils.encoding import force_text from .models import Person @unittest.skipUnless(connection.vendor == 'sqlite', 'Only run on sqlite so w...
"""Sets up Spark Context""" import os import shutil import atexit from pyspark import SparkContext, SparkConf from zip import zip_sparktk from arguments import require_type LIB_DIR="dependencies" SPARK_ASSEMBLY_SEARCH="**/spark-assembly*.jar" CORE_TARGET="sparktk-core/target" import logging logger = logging.getLogger...
"""This package contains code for creating environment modules, which can include dotkits, TCL non-hierarchical modules, LUA hierarchical modules, and others. """ from __future__ import absolute_import from .dotkit import DotkitModulefileWriter from .tcl import TclModulefileWriter from .lmod import LmodModulefileWrit...
from __future__ import print_function from .segments import reg_helpersegment, decoratorsegment from .types import parse_parameters from .beewrapper import beewrapper, reg_beehelper import inspect import libcontext import functools from . import emptyclass, mytype from .event import exception from .resolve import reso...
from django import template, templatetags from django.template import RequestContext from django.conf import settings from django.contrib.admin.views.decorators import staff_member_required from django.db import models from django.shortcuts import render_to_response from django.core.exceptions import ImproperlyConfigur...
try: import unittest2 as ut assert ut # Suppress pyflakes warning about redefinition of unused ut except ImportError: import unittest as ut from builders import arange_spikes from numpy.testing import assert_array_equal, assert_array_almost_equal from spykeutils import tools import neo import neo.io.tools...
import pygame import numpy import opencv #this is important for capturing/displaying images from opencv import highgui def list_cameras(): """ """ # -1 for opencv means get any of them. return [-1] def init(): pass def quit(): pass class Camera: def __init__(self, device =0, size = ...
"""Fix UserDict. Incomplete! TODO: base this on fix_urllib perhaps? """ # Local imports from lib2to3 import fixer_base from lib2to3.fixer_util import Name, attr_chain from lib2to3.fixes.fix_imports import alternates, build_pattern, FixImports MAPPING = {'UserDict': 'collections', } # def alternates(members): # ...
from openerp.http import request from openerp.addons.website_product_configurator.controllers.main import ( WebsiteProductConfig ) class WebsiteProductConfigMrp(WebsiteProductConfig): def cart_update(self, product, post): if post.get('assembly') == 'kit': attr_products = product.attribut...
"""Test the wallet implicit segwit feature.""" import test_framework.address as address from test_framework.test_framework import BitcoinTestFramework # TODO: Might be nice to test p2pk here too address_types = ('legacy', 'bech32', 'p2sh-segwit') def key_to_address(key, address_type): if address_type == 'legacy'...
import os import sys sys.path.append(os.environ['PERF_EXEC_PATH'] + \ '/scripts/python/Perf-Trace-Util/lib/Perf/Trace') from perf_trace_context import * from Core import * from Util import * usage = "perf script -s syscall-counts-by-pid.py [comm|pid]\n"; for_comm = None for_pid = None if len(sys.argv) > 2: sys.e...