content
string
#!/usr/bin/env python """ This program generates a pkl file containing a list of dictionaries. Each dictionary in the list represents a condensedlet. The dictionaries have the structure: {'core': array of ints of core points, 'condensed': array of ints of condensed points, 'plume': array of ints of plume points, 'u_con...
import weakref from PySide import QtGui, QtCore from resources import HEX_COLOUR_NONE, HEX_COLOUR_RED, HEX_COLOUR_GREEN, HEX_COLOUR_BLUE class BaseKey(QtGui.QPushButton): KEY_TYPE = "default" KEY_CLICKED = QtCore.Signal(weakref.ReferenceType) BG_COLOUR = HEX_COLOUR_NONE def __init__(self, *args, **kw...
__author__ = 'Plateforme bioinformatique Toulouse / Sigenae Jouy en Josas' __copyright__ = 'Copyright (C) 2016 INRA' __license__ = 'GNU General Public License' __version__ = '1.0.0' __email__ = '<EMAIL>' __status__ = 'prod' import re import sys import argparse import warnings from frogsBiom import BiomIO ###########...
import functools import itertools import numpy import dask import dask.array from . import _compat from . import _pycompat def _broadcast_uv(u, v): U = _compat._atleast_2d(u) V = _compat._atleast_2d(v) if U.ndim != 2: raise ValueError("u must be a 1-D or 2-D array.") if V.ndim != 2: ...
# -*- coding: utf-8 -*- """ Simple transfomer: handle OpenID elements. Ie: an openid namespace is added and the usual 'link' elements for openid are exchanged against a namespaced version. @summary: OpenID transformer module. @requires: U{RDFLib package<http://rdflib.net>} @organization: U{World Wide Web Consortium<ht...
# -*- coding: UTF-8 -*- """ This is a HTTP/REST client library, primarily designed for use as a `Robot Framework <http://robotframework.org/>`_ test library. It provides keywords for calling REST-style services and inspecting the response. Copyright (c) 2008 Niklas Lindström <<EMAIL>>, all rights reserved. """ __auth...
import shutil import unittest import os import tg import mock from pylons import tmpl_context as c from paste.deploy.converters import asbool from alluratest.controller import setup_basic_test from allura import model as M from allura.lib import helpers as h from allura.tasks import repo_tasks from forgesvn.tests i...
from django.db.models.fields import NOT_PROVIDED from django.utils.functional import cached_property from .base import Operation class FieldOperation(Operation): def __init__(self, model_name, name): self.model_name = model_name self.name = name @cached_property def model_name_lower(self...
import logging import datetime logger = logging.getLogger(__name__) def getDateTime(timeString): return datetime.datetime.strptime(timeString, "%Y-%m-%d %H:%M:%S") def formatPercentFraction(value): """ Formats a fraction as a percentage for display """ value = value * 100 if value < 1: valu...
import WebIDL def WebIDLTest(parser, harness): parser.parse(""" interface TestMethods { void basic(); static void basicStatic(); void basicWithSimpleArgs(boolean arg1, byte arg2, unsigned long arg3); boolean basicBoolean(); static boolean basicStaticBoolean...
#!/usr/bin/env python #-*- coding:utf-8 -*- """ disable highlight focused widget Tested environment: Mac OS X 10.6.8 http://stackoverflow.com/questions/1987546/qt4-stylesheets-and-focus-rect """ import sys try: from PySide import QtCore from PySide import QtGui except ImportError: from PyQt4 import Q...
import os, time import zmq from message_pb2 import Container from types_pb2 import * from optparse import OptionParser parser = OptionParser() parser.add_option("-c", "--cmd", dest="cmduri", default="tcp://127.0.0.1:5571", help="command URI") parser.add_option("-r", "--response", dest="responseuri"...
import subprocess, sys # gets the first link on any webpage def get_next_target(page): copy = page repl = ['= ', ' =', ' = '] for i in range(0, len(repl)): copy = copy.replace(repl[i], "=") first_link_start = copy.find("<a") if (first_link_start == -1): return None else: ...
# =========================================== # Stackdriver module specific support methods. # try: import json except ImportError: import simplejson as json def send_deploy_event(module, key, revision_id, deployed_by='Ansible', deployed_to=None, repository=None): """Send a deploy event to Stackdriver""" d...
import argparse import collections import os import sys # https://pypi.python.org/pypi/serfclient from serfclient import SerfClient, EnvironmentConfig try: import json except ImportError: import simplejson as json _key = 'serf' def _serf_client(): env = EnvironmentConfig() return SerfClient(host=en...
from ConfigParser import ConfigParser # Private def _localize(option, locale): if locale: option = option + '[%s]' % locale return option def _tobool(s): if s == 'true': return True return False def _frombool(s): if s: return 'true' return 'false' class DesktopParser...
from openerp import SUPERUSER_ID from openerp.addons.web import http from openerp.addons.web.http import request class WebsiteMail(http.Controller): @http.route(['/website_mail/follow'], type='json', auth="public", website=True) def website_message_subscribe(self, id=0, object=None, message_is_follower="on",...
""" Query subclasses which provide extra functionality beyond simple data retrieval. """ from django.core.exceptions import FieldError from django.db.models.fields import DateField, FieldDoesNotExist from django.db.models.sql.constants import * from django.db.models.sql.datastructures import Date from django.db.models...
from confluent_kafka import avro from confluent_kafka.avro import AvroProducer from lipsum import generate_words import os import random SCHEMA_REGISTRY_URL = 'http://172.17.0.5:8081' BOOTSTRAP_SERVERS = '172.17.0.4' AVSC_DIR = os.path.dirname(os.path.realpath(__file__)) KEY_SCHEMA = avro.load(os.path.join(AVSC_DIR, ...
""" Verifies building a target and a subsidiary dependent target from a .gyp file in a subdirectory, without specifying an explicit output build directory, and using the generated solution or project file at the top of the tree as the entry point. The configuration sets the Xcode SYMRO...
from __future__ import absolute_import from __future__ import with_statement import socket from celery import events from celery.app import app_or_default from celery.tests.utils import unittest class MockProducer(object): raise_on_publish = False def __init__(self, *args, **kwargs): self.sent = []...
# -*- coding: utf-8 -*- """The operating system path specification resolver helper implementation.""" from dfvfs.file_io import os_file_io from dfvfs.lib import definitions from dfvfs.resolver_helpers import manager from dfvfs.resolver_helpers import resolver_helper from dfvfs.vfs import os_file_system class OSResol...
import sys import gridfs sys.path[0:0] = [""] from mongo_connector.gridfs_file import GridFSFile from mongo_connector import errors from tests import unittest from tests.setup_cluster import ReplicaSet class MockGridFSFile: def __init__(self, doc, data): self._id = doc['_id'] self.filename = do...
"""CTypes bindings for the Gumbo HTML5 parser. This exports the raw interface of the library as a set of very thin ctypes wrappers. It's intended to be wrapped by other libraries to provide a more Pythonic API. """ __author__ = '<EMAIL> (Jonathan Tang)' import contextlib import ctypes try: _dll = ctypes.cdll.Lo...
''' Functions providing a convenient virtual filesystem. Among other things, this is how themes and mods will be implemented. Note that B{all} VFS functions use slash-delimited paths, relieving other code of the need to C{os.path.join()}. All VFS paths must also be absolute (i.e. start with a slash) and may not conta...
import sys import os """ For this script to work you need the jack.mesh from /media/models in /data/assets You will have to manually put your txml file name down in the __main__ func to: --> fileName = "putFileNameHere.txml" <-- 1. Run this script on your tundra 1.x txml 2. This will create a...
import sys, datetime from amara.writers.struct import * from amara.namespaces import * tags = [u"xml", u"python", u"atom"] w = structwriter(indent=u"yes") w.feed( ROOT( E((ATOM_NAMESPACE, u'feed'), {(XML_NAMESPACE, u'xml:lang'): u'en'}, E(u'id', u'urn:bogus:myfeed'), E(u'title', u'MyFeed'), ...
import logging import os import sys # Program name to use for log messages. PROGRAM_NAME = os.path.basename(sys.argv[0]) def _build_logger(): """Instantiates a global logger for the program. Returns: Logger. The logger instance to use for the application. """ handler = logging.StreamHandler...
from __future__ import absolute_import, division, unicode_literals from six import text_type from ..constants import scopingElements, tableInsertModeElements, namespaces # The scope markers are inserted when entering object elements, # marquees, table cells, and table captions, and are used to prevent formatting # fr...
''' Code by Richard Jones, released into the public domain. Beginnings of something like http://en.wikipedia.org/wiki/Thrust_(video_game) ''' import sys import math import euclid import primitives import pyglet from pyglet.window import key from pyglet.gl import * window = pyglet.window.Window(fullscreen='-fs' in ...
""" Verifies that missing 'sources' files are treated as fatal errors when the the generator flag 'msvs_error_on_missing_sources' is set. """ import TestGyp import os import sys if sys.platform == 'win32': test = TestGyp.TestGyp(formats=['msvs', 'ninja'], workdir='workarea_all') # With the flag not set test.ru...
"""Tests for the experimental input pipeline ops.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from tensorflow.python.data.ops import dataset_ops from tensorflow.python.framework import dtypes from tensorflow.python.framework import...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['deprecated'], 'supported_by': 'community'} import traceback from ansible.module_utils.basic import AnsibleModule from ansible.modu...
import WebIDL def WebIDLTest(parser, harness): parser.parse(""" interface TestArrayBuffer { attribute ArrayBuffer bufferAttr; void bufferMethod(ArrayBuffer arg1, ArrayBuffer? arg2, ArrayBuffer[] arg3, sequence<ArrayBuffer> arg4); attribute ArrayBufferView viewAttr; ...
from functools import wraps from django.conf import settings from django.contrib.auth import REDIRECT_FIELD_NAME from django.core.exceptions import PermissionDenied from django.shortcuts import resolve_url from django.utils import six from django.utils.decorators import available_attrs from django.utils.six.moves.urll...
from spack import * class XorgSgmlDoctools(AutotoolsPackage): """This package provides a common set of SGML entities and XML/CSS style sheets used in building/formatting the documentation provided in other X.Org packages.""" homepage = "http://cgit.freedesktop.org/xorg/doc/xorg-sgml-doctools" url...
HTTP_RESPONSE_NO_CONTENT = 204 class HTTPError(Exception): ''' HTTP Exception when response status code >= 300 ''' def __init__(self, status, message, respheader, respbody): '''Creates a new HTTPError with the specified status, message, response headers and body''' self.status = stat...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import re import time import glob from ansible.plugins.action.eos import ActionModule as _ActionModule from ansible.module_utils._text import to_text from ansible.module_utils.six.moves.urllib.parse import urlsplit from ...
from gi.repository import Gtk import data class RemoveItem(Gtk.MessageDialog): ''' Message dialog displayed to confirm removal of item. ''' def __init__(self, item, value): if value == "": value = "item" Gtk.MessageDialog.__init__(self) self.set_transient_for(data...
""" Starts a service to scan in intervals for new devices. Will emit EVENT_PLATFORM_DISCOVERED whenever a new service has been discovered. Knows which components handle certain types, will make sure they are loaded before the EVENT_PLATFORM_DISCOVERED is fired. """ import json from datetime import timedelta import lo...
from django.apps import AppConfig from django.core.checks import register from weblate.gitexport.utils import find_git_http_backend from weblate.utils.checks import weblate_check class GitExportConfig(AppConfig): name = "weblate.gitexport" label = "gitexport" verbose_name = "Git Exporter" def ready(...
"""Supports checking WebKit style in Python files.""" import re from StringIO import StringIO from webkitpy.common.system.filesystem import FileSystem from webkitpy.common.webkit_finder import WebKitFinder from webkitpy.thirdparty.autoinstalled import pep8 from webkitpy.thirdparty.autoinstalled.pylint import lint fro...
""" SALTS XBMC Addon Copyright (C) 2014 tknorris This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. T...
from __future__ import (nested_scopes, generators, division, absolute_import, with_statement, print_function, unicode_literals) import pytest from pants.base.address import SyntheticAddress from pants.base.exceptions import TargetDefinitionException from pants.backend.python.targets.python_bin...
""" Example intercepting uncaught exceptions using Sanic's error handler framework. This may be useful for developers wishing to use Sentry, Airbrake, etc. or a custom system to log and monitor unexpected errors in production. First we create our own class inheriting from Handler in sanic.exceptions, and pass in an i...
# -*- coding: utf-8 import re from HTMLParser import HTMLParser from difflib import unified_diff class FortuneHTMLParser(HTMLParser): body = [] valid = '''<!doctype html><html> <head><title>Fortunes</title></head> <body><table> <tr><th>id</th><th>message</th></tr> <tr><td>11</td><td>&lt;script&gt;alert(&quot;This...
from temboo.core.choreography import Choreography from temboo.core.choreography import InputSet from temboo.core.choreography import ResultSet from temboo.core.choreography import ChoreographyExecution import json class ExportIncrementalTickets(Choreography): def __init__(self, temboo_session): """ ...
import os import sys import numpy as np import math def findBinIndexFor(aFloatValue, binsList): #print "findBinIndexFor: %s" % aFloatValue returnIndex = -1 for i in range(len(binsList)): thisBin = binsList[i] if (aFloatValue >= thisBin[0]) and (aFloatValue < thisBin[1]): returnIndex = i break return r...
NET_STATUS_ACTIVE = 'ACTIVE' NET_STATUS_BUILD = 'BUILD' NET_STATUS_DOWN = 'DOWN' NET_STATUS_ERROR = 'ERROR' PORT_STATUS_ACTIVE = 'ACTIVE' PORT_STATUS_BUILD = 'BUILD' PORT_STATUS_DOWN = 'DOWN' PORT_STATUS_ERROR = 'ERROR' FLOATINGIP_STATUS_ACTIVE = 'ACTIVE' FLOATINGIP_STATUS_DOWN = 'DOWN' FLOATINGIP_STATUS_ERROR = 'ERR...
import unittest from conans.test.tools import TestClient from conans.paths import CONANFILE from conans.util.files import load import os class OrderLibsTest(unittest.TestCase): def setUp(self): self.client = TestClient() def _export(self, name, deps=None, export=True): def _libs(): ...
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_stdout_re = [ re.compile(br"[\r\n]?[\w+\-\.:\/\[...
"""Models / Schema of pgur.in""" from google.appengine.ext import ndb class Accounts(ndb.Model): """Stores registration information.""" playstore_url = ndb.StringProperty() appstore_url = ndb.StringProperty() winstore_url = ndb.StringProperty() default_url = ndb.StringProperty() title = ndb....
from __future__ import unicode_literals import collections from importlib import import_module import os import pkgutil import sys import django from django.apps import apps from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.core.management.base import (BaseCommand, C...
#!/usr/bin/env python """ Utilities related to parsing files """ from collections import OrderedDict import sys PY3 = sys.version_info[0] == 3 __all__ = [ 'FixedLengthError', 'FixedLengthUnknownRecordTypeError', 'FixedLengthSeparatorError', 'FixedLengthJustificationError', 'FixedLengthFieldParser...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'certified'} DOCUMENTATION = r''' --- module: ucs_vhba_template short_description: Configures vHBA templat...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} import json import logging try: import urlparse except ImportError: import urllib.p...
"""Invenio module for organizing metadata into collections.""" from __future__ import absolute_import, print_function import six from invenio_records import signals from sqlalchemy.event import contains, listen, remove from werkzeug.utils import cached_property, import_string from . import config class _AppState(o...
import unittest from Util import Util class TestUtil(unittest.TestCase): def testConvertTupleListToMap(self): tupleList=[] tupleList.append((0,0)) tupleList.append((0,1)) tupleList.append((1,0)) tupleList.append((1,2)) tupleList.append((2,2)) wiringMap=Util.c...
from a10sdk.common.A10BaseClass import A10BaseClass class EntryCfg(A10BaseClass): """This class does not support CRUD Operations please use parent. :param distance: {"minimum": 1, "type": "number", "maximum": 255, "format": "number"} :param protocol: {"enum": ["any", "static", "dynamic"], "type": "s...
__all__ = ["StreamingListener"] class StreamingListener(object): def __init__(self): pass def onStreamingStarted(self, streamingStarted): """ Called when the streaming has been started. """ pass def onReceiverStarted(self, receiverStarted): """ Ca...
from datetime import datetime from rest_framework import generics, viewsets from rest_framework.exceptions import ParseError from rest_framework.response import Response from .models import Project, Task, TaskType from .serializers import ProjectSerializer, TaskSerializer, TaskTypeSerializer class TaskViewSet(views...
from django import forms from django.contrib import admin from django.contrib.flatpages.models import FlatPage from django.utils.translation import ugettext_lazy as _ class FlatpageForm(forms.ModelForm): url = forms.RegexField(label=_("URL"), max_length=100, regex=r'^[-\w/]+$', help_text = _("Example: '/a...
""" NOTE: Anytime a `key` is passed into a function here, we assume it's a raw byte string. It should *not* be a string representation of a hex value. In other words, passing the `str` value of `"32fe72aaf2abb44de9e161131b5435c8d37cbdb6f5df242ae860b283115f2dae"` is bad. You want to pass in the result of calling .decode...
""" Extracts the version of the PostgreSQL server. """ import re # This reg-exp is intentionally fairly flexible here. # Needs to be able to handle stuff like: # PostgreSQL #.#.# # EnterpriseDB #.# # PostgreSQL #.# beta# # PostgreSQL #.#beta# VERSION_RE = re.compile(r'\S+ (\d+)\.(\d+)\.?(\d+)?') def _parse_...
#!/edx/app/edxapp/venvs/edxapp/bin/python # pylint: skip-file from __future__ import print_function from argparse import ArgumentParser from datetime import datetime, timedelta import gzip import os import re import sys import django from django.utils import timezone from six.moves.configparser import ConfigParser ...
import sale_report import invoice_report # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
from msrest.pipeline import ClientRawResponse from .. import models class HttpServerFailure(object): """HttpServerFailure operations. :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An...
"""zk2 specific configuration.""" import server class Zk2TopoServer(server.TopoServer): """Implementation of TopoServer for zk2.""" def __init__(self): self.ports_assigned = False def assign_ports(self): """Assign ports if not already assigned.""" if self.ports_assigned: return from e...
{ 'name': 'Marketing Campaign - Demo', 'version': '1.0', 'depends': ['marketing_campaign', 'crm', ], 'author': 'OpenERP SA', 'category': 'Marketing', 'description': """ Demo data for the module marketing_campaign. ============================================ Creates demo da...
""" Script to fix easyconfigs that broke due to support for deprecated functionality being dropped in EasyBuild 2.0 :author: Kenneth Hoste (Ghent University) """ import os import re import sys from vsc.utils import fancylogger from vsc.utils.generaloption import SimpleOption from easybuild.framework.easyconfig.easyco...
from __future__ import absolute_import import logging import os import warnings from ..exceptions import ( HTTPError, HTTPWarning, MaxRetryError, ProtocolError, TimeoutError, SSLError ) from ..packages.six import BytesIO from ..request import RequestMethods from ..response import HTTPResponse ...
from builtins import zip from builtins import str from airflow.exceptions import AirflowException from airflow.hooks.base_hook import BaseHook from airflow.models import BaseOperator from airflow.utils.decorators import apply_defaults class CheckOperator(BaseOperator): """ Performs checks against a db. The `...
"""Support code for CI environments.""" from __future__ import (absolute_import, division, print_function) __metaclass__ = type import abc import base64 import json import os import tempfile from .. import types as t from ..encoding import ( to_bytes, to_text, ) from ..io import ( read_text_file, w...
# -*- coding: utf-8 -*- from bda.plone.payment.interfaces import IPayment from bda.plone.payment.interfaces import IPaymentEvent from bda.plone.payment.interfaces import IPaymentFailedEvent from bda.plone.payment.interfaces import IPaymentSettings from bda.plone.payment.interfaces import IPaymentSuccessEvent from zope....
from __future__ import print_function # $example on$ from pyspark.ml.feature import QuantileDiscretizer # $example off$ from pyspark.sql import SparkSession if __name__ == "__main__": spark = SparkSession\ .builder\ .appName("QuantileDiscretizerExample")\ .getOrCreate() # $example on$...
import textwrap SEPARATOR = "-" * 70 indent = lambda s: textwrap.fill(textwrap.dedent(s)) class CondaBuildException(Exception): pass class YamlParsingError(CondaBuildException): pass class UnableToParse(YamlParsingError): def __init__(self, original, *args, **kwargs): super(UnableToParse, sel...
from __future__ import unicode_literals from django import forms from django.conf import settings from guardian.compat import url, patterns from django.contrib import admin from django.contrib import messages from django.contrib.admin.widgets import FilteredSelectMultiple from django.core.urlresolvers import reverse f...
"""Tests for slim.nets.resnet_v2.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from tensorflow.contrib import layers from tensorflow.contrib.framework.python.ops import arg_scope from tensorflow.contrib.layers.python.layers import ...
''' Created on 2017/1/13 :author: hubo ''' from configlist import list_config from listmodules import list_modules, list_proxy import jinja2 import os import os.path import shutil from pkgutil import walk_packages from vlcp.event import Event def _merge_all(func): def _func(): result = func('vlcp') ...
import sys import unittest from libcloud.common.types import LazyList class TestLazyList(unittest.TestCase): def setUp(self): super(TestLazyList, self).setUp self._get_more_counter = 0 def tearDown(self): super(TestLazyList, self).tearDown def test_init(self): data = [1,...
from django.core.urlresolvers import NoReverseMatch # noqa from django.core.urlresolvers import reverse from django.http import HttpResponse # noqa from django.template import defaultfilters as filters from django.utils import html from django.utils.http import urlencode from django.utils import safestring from djang...
from Screens.Wizard import Wizard from Components.Label import Label from Components.Language import language from os import system class WizardLanguage(Wizard): def __init__(self, session, showSteps = True, showStepSlider = True, showList = True, showConfig = True): Wizard.__init__(self, session, showSteps, showSt...
# # euc_jisx0213.py: Python Unicode Codec for EUC_JISX0213 # # Written by Hye-Shik Chang <<EMAIL>> # import _codecs_jp, codecs import _multibytecodec as mbc codec = _codecs_jp.getcodec('euc_jisx0213') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class IncrementalEncoder(mbc.Multiby...
""" homeassistant.components.switch ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Component to interface with various switches that can be controlled remotely. """ from datetime import timedelta import logging import os from homeassistant.config import load_yaml_config_file from homeassistant.helpers.entity_component import EntityC...
import pytest from _helper import consume, tick, count_tasks notimplemented = xfail = pytest.mark.xfail beforeEach = pytest.mark.usefixtures import datetime from waterf import queue, task, snake messages = [] @pytest.fixture def clear_messages(): while messages: messages.pop() def P(message='P'): ...
# Adapted from test_file.py by Daniel Stutzbach from __future__ import unicode_literals import sys import os import errno import unittest from array import array from weakref import proxy from functools import wraps from UserList import UserList from test.test_support import TESTFN, check_warnings, run_unittest, mak...
__author__ = '<EMAIL> (Jeff Scudder)' import unittest import gdata.spreadsheets.client import gdata.gauth import gdata.client import atom.http_core import atom.mock_http_core import atom.core import gdata.data import gdata.test_config as conf conf.options.register_option(conf.SPREADSHEET_ID_OPTION) class Spreadsh...
''' Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. The MIT License (MIT) 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 limitati...
from openerp import models, fields from openerp import tools class report_event_registration(models.Model): """Events Analysis""" _name = "report.event.registration" _order = 'event_date desc' _auto = False event_date = fields.Datetime('Event Date', readonly=True) event_id = fields.Many2one('...
import wizard_price # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
from ctypes import * import maya.cmds as cmds import Calibration as C import unittest class SixAxis(object): def __init__(self, device, channels, name, load = True): """ Maps a single six-axis sensor to a Maya transform Device: An instance of PAIO.AIODevice() Channels: The channel indicies for the sensor in th...
""" .. _ref_geometric_example: Geometric Objects ~~~~~~~~~~~~~~~~~ The "Hello, world!" of VTK """ import pyvista as pv ############################################################################### # This runs through several of the available geomoetric objects available in # VTK which PyVista provides simple conve...
""" """ import logging import os import sys from datetime import timedelta try: # pragma: nocover from ConfigParser import ConfigParser config = ConfigParser() except ImportError: # pragma: nocover from configparser import ConfigParser config = ConfigParser(strict=False) from wheezy.caching.logging...
from django.utils.cache import ( cc_delim_re, get_conditional_response, set_response_etag, ) from django.utils.deprecation import MiddlewareMixin from django.utils.http import parse_http_date_safe class ConditionalGetMiddleware(MiddlewareMixin): """ Handle conditional GET operations. If the response has a...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os # used to set lang and for backwards compat get_config from ast import literal_eval from jinja2 import Template from string import ascii_letters, digits from ansible.module_utils._text import to_text from ansible.modul...
######################################################################## # $HeadURL$ # File : WatchdogFactory.py ######################################################################## """ The Watchdog Factory instantiates a given Watchdog based on a quick determination of the local operating system. """ fro...
from base_studio_test import ContainerBase from ...fixtures.course import XBlockFixtureDesc from ...pages.studio.utils import verify_ordering class BadComponentTest(ContainerBase): """ Tests that components with bad content do not break the Unit page. """ __test__ = False def get_bad_html_content...
import pygame, StringIO, sys, socket, os from gmusicapi import Webclient, exceptions class UrlGetter: def __init__(self, sck_path, user, passwd): pygame.init() pygame.mixer.init() self.sck_path = sck_path self.webapi = Webclient() self.socket = socket.socket(socket.AF...
#!/usr/bin/python try: import serial except: print('You do not have pySerial installed, which is needed to control the serial port.') print('Information on pySerial is at:\nhttp://pyserial.wiki.sourceforge.net/pySerial') import reprap, time, sys #reprap.snap.printOutgoingPackets = True #reprap.snap.printIncomingPa...
"""Test OpenBabel executables from Python Note: Python bindings not used On Windows or Linux, you can run these tests at the commandline in the build folder with: "C:\Program Files\CMake 2.6\bin\ctest.exe" -C CTestTestfile.cmake -R pytest -VV You could also "chdir" into bui...