content
stringlengths
4
20k
import openerp from openerp.report.interface import report_int import openerp.tools as tools from openerp.report import render from lxml import etree import time, os class report_printscreen_list(report_int): def __init__(self, name): report_int.__init__(self, name) def _parse_node(self, root_node)...
"""Model of cron job. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import logging from treadmill import plugin_manager _LOGGER = logging.getLogger(__name__) def create(scheduler, job_id, event, resource, ex...
"""Cocoa frontend implementation for namebench.""" __author__ = '<EMAIL> (Thomas Stromberg)' import os import sys import traceback from Foundation import * from AppKit import * from objc import IBAction, IBOutlet from libnamebench import addr_util from libnamebench import base_ui from libnamebench import config fro...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file './console/template.ui' # # by: pyside-uic 0.2.13 running on PySide 1.1.0 # # WARNING! All changes made in this file will be lost! from PySide import QtCore, QtGui class Ui_Form(object): def setupUi(self, Form): Form.setObj...
#!/usr/bin/env python """ rebuildmo.py script. This script builds the .mo files, from the .po files. Copyright 2009 H. Turgut Uyar <<EMAIL>> 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 v...
from datetime import datetime from django.forms import ( CharField, Form, MultipleChoiceField, MultiValueField, MultiWidget, SelectMultiple, SplitDateTimeField, SplitDateTimeWidget, TextInput, ValidationError, ) from django.test import SimpleTestCase beatles = (('J', 'John'), ('P', 'Paul'), ('G', 'George'...
from symbol.builder import FasterRcnn as Detector from symbol.builder import ResNetV1bFPN as Backbone from symbol.builder import add_anchor_to_arg from models.FPN.builder import FPNNeck as Neck from models.FPN.builder import FPNRpnHead as RpnHead from models.FPN.builder import FPNRoiAlign as RoiExtractor from models.FP...
"""Payment and verification pages""" import re from bok_choy.page_object import PageObject from bok_choy.promise import Promise from . import BASE_URL from .dashboard import DashboardPage class PaymentAndVerificationFlow(PageObject): """Interact with the split payment and verification flow. The flow can be...
__author__ = 'Martin' import pandas as pd import numpy as np from scipy import stats from sklearn import cross_validation from sklearn import ensemble def is_transformer(cls): return hasattr(cls, '__dageva_type') and cls.__dageva_type == 'transformer' def is_predictor(cls): return hasattr(cls, '__dageva_type...
from pysnmp.entity.rfc3413.oneliner import ntforg from pysnmp.proto import rfc1902 from pysnmp.entity import engine """ SNMP TRAP Sender """ class SNMPTrapSender(): """ Send SNMP TRAP Message """ def __init__(self, host, port = 162): self.host = host self.port = port self.auth...
# -*- 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): # Changing field 'UserProfile.meta' db.alter_column('auth_userprofile', 'meta', self.gf('django.db.models.f...
""" mbed SDK Copyright (c) 2011-2013 ARM Limited 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 License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in wr...
ANSIBLE_METADATA = {'status': ['preview'], 'supported_by': 'community', 'version': '1.0'} OPS = ( '=', '-', '+' ) # ============================================================== import os import tempfile import re class CapabilitiesModule(object): platform = 'Linux' ...
""" Import related utilities and helper functions. """ import sys import traceback def import_class(import_str): """Returns a class from a string including module and class.""" mod_str, _sep, class_str = import_str.rpartition('.') __import__(mod_str) try: return getattr(sys.modules[mod_str], ...
from ddt import ddt, unpack, data from tests.integration.base_test import PollBaseTest, DEFAULT_POLL_NAMES, DEFAULT_SURVEY_NAMES scenarios_infinite = ( ('Survey Max Submissions Infinite', DEFAULT_SURVEY_NAMES), ('Poll Max Submissions Infinite', DEFAULT_POLL_NAMES), ) scenarios_max = ( ('Survey Max Submiss...
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( get_element_by_attribute, int_or_none, limit_length, lowercase_escape, ) class InstagramIE(InfoExtractor): _VALID_URL = r'(?P<url>https?://(?:www\.)?instagram\.com/p/(?P<id>[^/?#&]+))' _...
"""Server-side implementation of the WebSocket protocol. `WebSocket <http://en.wikipedia.org/wiki/WebSocket>`_ is a web technology providing full-duplex communications channels over a single TCP connection. For more information, check out the `WebSocket demos <https://github.com/fiorix/cyclone/tree/master/demos/webs...
"""print_model_analysis test.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from google.protobuf import text_format from tensorflow.python.client import session from tensorflow.python.framework import dtypes from tensorflow.python.framework import ops...
import struct from packet_utils import * from packet_exceptions import * from array import * from packet_base import packet_base class llc(packet_base): "llc packet struct" LEN = 3; # A "type" field value of less than 0x0600 indicates that this # frame should be interpreted as an LLC packet,...
#======================================================================= # # Python Lexical Analyser # # Actions for use in token specifications # #======================================================================= class Action(object): def perform(self, token_stream, text): pass # abstract ...
import sys import getopt import os from gettext import gettext as _ import logging from jarabe import config _RESTART = 1 _same_option_warning = _('sugar-control-panel: WARNING, found more than one' ' option with the same name: %s module: %r') _no_option_error = _('sugar-control-panel: key=...
"""A copy of Django 1.3.0's stock loaddata.py, adapted so that, instead of loading any data, it returns the tables referenced by a set of fixtures so we can truncate them (and no others) quickly after we're finished with them.""" import os import gzip import zipfile from itertools import product from django.conf impo...
import json import os import time from threading import Thread from libmproxy import controller, proxy from netlib import http_auth from testfixtures import LogCapture from twisted.internet import defer from twisted.trial.unittest import TestCase from scrapy.utils.test import get_crawler from scrapy.http import Reque...
"""SigmoidCentered bijector.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function # go/tf-wildcard-import # pylint: disable=wildcard-import from tensorflow.contrib.distributions.python.ops.bijectors.sigmoid_centered_impl import * # pylint: enable=wildcard-imp...
#!/usr/bin/env python """ MC6809 - 6809 CPU emulator in Python ======================================= 6809 is Big-Endian Links: http://dragondata.worldofdragon.org/Publications/inside-dragon.htm http://www.burgins.com/m6809.html http://koti.mbnet.fi/~atjs/mc6809/ :copyle...
import os from contextlib import contextmanager from unittest import TestSuite, TextTestRunner, defaultTestLoader from django.test import TestCase from django.test.runner import DiscoverRunner @contextmanager def change_cwd(directory): current_dir = os.path.abspath(os.path.dirname(__file__)) new_dir = os.pat...
#!/usr/bin/env python #Author velociraptor Genjix <<EMAIL>> from PySide.QtGui import * from PySide.QtCore import * class MovementTransition(QEventTransition): def __init__(self, window): super(MovementTransition, self).__init__(window, QEvent.KeyPress) self.window = window def eventT...
#!/usr/bin/env python import json import logging from optparse import OptionParser from service_old.models import Instance import django django.setup() def export_instance_tags(): instance_tags = [] instances = Instance.objects.all() added = 0 for i in instances: if i.instance_tags: ...
#!/usr/bin/env python3 import argparse import os import sys def get_args(): parser = argparse.ArgumentParser( description='Create keystroke from text.') parser.add_argument('input', metavar='input', type=str, nargs=1, help='Input Chinese text file') parser.add_argument('output', metavar='o...
"""Script to test out suitableForGpuRasterization (via gpuveto)""" import argparse import glob import os import re import subprocess import sys # Set the PYTHONPATH to include the tools directory. sys.path.append( os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir)) import find_run_binary def li...
from __future__ import unicode_literals """ Utilities for using modules """ import frappe, os import frappe.utils from frappe import _ lower_case_files_for = ['DocType', 'Page', 'Report', "Workflow", 'Module Def', 'Desktop Item', 'Workflow State', 'Workflow Action', 'Print Format'] def scrub(txt): return frappe.sc...
# -*- coding: utf-8 -*- """" ProjectName: liv-api Repo: https://github.com/chrisenytc/liv-api Copyright (c) 2014 Christopher EnyTC Licensed under the MIT license. """ # Dependencies from datetime import timedelta from flask import make_response, request, current_app from functools import update_wrapper def cors(ori...
#! /usr/bin/env python3 # Check that all ".pyc" files exist and are up-to-date # Uses module 'os' import sys import os from stat import ST_MTIME import imp # PEP 3147 compatibility (PYC Repository Directories) cache_from_source = (imp.cache_from_source if hasattr(imp, 'get_tag') else lambda path:...
""" Display code blocks in collapsible sections when outputting to HTML. This directive takes a heading to use for the collapsible code block:: .. collapsible-code-block:: python :heading: Some Code from __future__ import print_function print("Hello, Bokeh!") This directive is identical...
# pylint: disable=missing-docstring from unittest import TestCase import ddt from track import contexts @ddt.ddt class TestContexts(TestCase): COURSE_ID = 'test/course_name/course_run' SPLIT_COURSE_ID = 'course-v1:test+course_name+course_run' ORG_ID = 'test' @ddt.data( (COURSE_ID, ''), ...
"""Compatibility support for python 2 and 3.""" __metaclass__ = type __all__ = [ '_b', '_u', 'advance_iterator', 'str_is_unicode', 'StringIO', 'BytesIO', 'unicode_output_stream', ] import codecs import linecache import locale import os import re import sys import traceback from testto...
#!/usr/bin/env python # -*- coding: utf-8 -*- # The path to enlightenment starts with the following: import unittest from koans.about_asserts import AboutAsserts from koans.about_strings import AboutStrings from koans.about_none import AboutNone from koans.about_lists import AboutLists from koans.about_list_assignme...
from __future__ import absolute_import import unittest import hamcrest as hc import apache_beam.runners.dataflow.internal.clients.dataflow as dataflow from apache_beam.internal.gcp.json_value import to_json_value from apache_beam.runners.dataflow.internal.clients.dataflow import message_matchers # Protect against e...
from __future__ import unicode_literals import os from django.contrib.auth.models import User from django.contrib.auth.password_validation import ( CommonPasswordValidator, MinimumLengthValidator, NumericPasswordValidator, UserAttributeSimilarityValidator, get_default_password_validators, get_password_val...
"""Self-test for the Crypto.Util.randpool.RandomPool wrapper class""" __revision__ = "$Id$" import sys import unittest class SimpleTest(unittest.TestCase): def runTest(self): """Crypto.Util.randpool.RandomPool""" # Import the winrandom module and try to use it from Crypto.Util.randpool im...
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..compat import compat_urlparse from ..utils import ( int_or_none, orderedSet, parse_duration, qualities, unified_strdate, xpath_text ) class EuropaIE(InfoExtractor): _VALID_URL = r'https?://ec\...
from __future__ import absolute_import __all__ = ["Cache"] class Cache(object): def __init__(self, *keys, **kwargs): """ Simple cache class that is aware of changes in the state class. *Arguments* *keys ([:class:`string`]) Names of state attributes to be monitored. **kwargs ...
""" Verifies that GC objc settings are handled correctly. """ import TestGyp import TestMac import sys if sys.platform == 'darwin': # set |match| to ignore build stderr output. test = TestGyp.TestGyp(formats=['ninja', 'make', 'xcode'], match = lambda a, b: True) # Xcode 5.1 removed su...
from django.template.defaultfilters import linenumbers from django.test import SimpleTestCase from django.utils.safestring import mark_safe from ..utils import setup class LinenumbersTests(SimpleTestCase): """ The contents of "linenumbers" is escaped according to the current autoescape setting. """ ...
def vtf_pid_map(system, types='all'): """ Generates a VTF particle index map to ESPResSo ``id``. This fills the gap for particle ID's as required by VMD Parameters ---------- system: espressomd.System() object types : :obj:`str` Specifies the particle types. The id mapping depen...
# FlexibleTerminalReporter is imported for backward compatibility; # it should be imported from pytest_store from cfme.fixtures.pytest_store import store from cfme.utils import diaper from cfme.utils.log import logger def reporter(config=None): """Return a py.test terminal reporter that will write to the console ...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import re import os import pty import subprocess from ansible.module_utils._text import to_bytes, to_text from ansible.module_utils.six.moves import cPickle HAVE_SALTSTACK = False try: import salt.client as sc HAVE_SALTST...
#!/usr/bin/env python import os import shutil import subprocess import json from PIL import Image, ImageDraw, ImageFont class MissingGlyphError(Exception): pass def color_font(name, code_point): in_name = 'bitmaps/strike1/uni{}.png'.format(code_point) out_name = 'out/unicode/{}.png'.format(code_point) ...
class InvalidUserException(Exception): pass class User(object): """ This class represents a User, whether your own or someone else's. It is created knowing only its ID. To reduce API accesses, load information using User.update_index_data() or User.update_user_data only as needed. """ def __ini...
""" Module for handling the parsing of skeletal animation data. """ import math import mathutils from bpy import data, context from .. import constants, logger def pose_animation(armature, options): """Query armature animation using pose bones :param armature: :param options: :returns: list dictiona...
#!/usr/bin/env python # coding: utf-8 from __future__ import unicode_literals # Allow direct execution import os import sys import unittest sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from test.helper import get_params, try_rm import io import xml.etree.ElementTree import youtu...
from ejson import serializers from mock import Mock, call, patch from datetime import datetime from eventlib import exceptions, conf, core, tasks def test_parse_event_name(): core.parse_event_name('app.Event').should.be.equal( ('app.events', 'Event')) core.parse_event_name.when.called_with('stuff')....
''' Tex: Compressed texture ''' __all__ = ('ImageLoaderTex', ) import json from struct import unpack from kivy.logger import Logger from kivy.core.image import ImageLoaderBase, ImageData, ImageLoader class ImageLoaderTex(ImageLoaderBase): @staticmethod def extensions(): return ('tex', ) def lo...
import datetime from django.utils import timezone from django.test import TestCase from .models import Question # Create your tests here. class QuestionMethodTests(TestCase): def test_was_published_recently_with_future_question(self): """ was_published_recently() should return False for question...
from django.db import models from django.utils.encoding import python_2_unicode_compatible from django.utils.timezone import now from django.utils.translation import ugettext_lazy as _ from django.utils.translation import pgettext_lazy from oscar.apps.partner.exceptions import InvalidStockAdjustment from oscar.core.co...
""" This module contains helper functions for controlling caching. It does so by managing the "Vary" header of responses. It includes functions to patch the header of response objects directly and decorators that change functions to do that header-patching themselves. For information on the Vary header, see: http...
""" Utilities related to caching. """ import collections import cPickle as pickle import functools import zlib from xblock.core import XBlock def memoize_in_request_cache(request_cache_attr_name=None): """ Memoize a method call's results in the request_cache if there's one. Creates the cache key by joini...
"""PanduitTemperatureSensorMap Gathers Temperature Sensors from Panduit Environmental Monitoring Devices """ from Products.DataCollector.plugins.CollectorPlugin import (SnmpPlugin, GetTableMap) class PanduitTemperatureSensorMap(SnmpPlugin): relname = 'panduitTemperatureSensors' modname = 'ZenPacks.community....
import BoostBuild t = BoostBuild.Tester(use_test_config=False) # The point of this test is to have exe "main" which uses library "b", which # uses library "a". When "main" is built with <hardcode-dll-paths>true, paths # to both libraries should be present as values of <dll-path> feature. We # create a special ...
from superdesk.commands.data_updates import BaseDataUpdate class DataUpdate(BaseDataUpdate): resource = "roles" privileges = [ "publisher_dashboard", "planning_assignments_view", "monitoring_view", "spike_read", "highlights_read", "use_global_saved_searches", ...
""" Implementation of the RESTful endpoints for the Course About API. """ from rest_framework.throttling import UserRateThrottle from rest_framework.views import APIView from course_about import api from rest_framework import status from rest_framework.response import Response from course_about.errors import CourseNot...
""" viscount unittests contains a basic unit test class that can be used for all instances """ from unittest import TestCase from viscount.core import db from .factories import UserFactory from .utils import FlaskTestCaseMixin class ViscountTestCase(TestCase): pass class ViscountAppTestCase(FlaskTestCaseMixin,...
# -*- coding: utf-8 -*- from django.utils._threading_local import local def make_tls_property(default=None): """Creates a class-wide instance property with a thread-specific value.""" class TLSProperty(object): def __init__(self): self.local = local() def __get__(self, instance, cl...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} try: import boto from boto.elasticache import connect_to_region from boto.excep...
"""Functional test for moving_averages.py.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf from tensorflow.python.ops import gen_state_ops from tensorflow.python.training import moving_averages class MovingAveragesTest(tf.test.Te...
"""Tests for google.protobuf.message_factory.""" __author__ = '<EMAIL> (Matt Toia)' import unittest from google.protobuf import descriptor_pb2 from google.protobuf.internal import factory_test1_pb2 from google.protobuf.internal import factory_test2_pb2 from google.protobuf import descriptor_database from google.proto...
"""Tests for session_bundle.gc.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import re from six.moves import xrange # pylint: disable=redefined-builtin import tensorflow as tf from tensorflow.contrib.session_bundle import gc from tensor...
""" Tests for adjusters. """ __authors__ = "Nicu Tofan" __copyright__ = "Copyright 2015, Nicu Tofan" __credits__ = ["Nicu Tofan"] __license__ = "3-clause BSD" __maintainer__ = "Nicu Tofan" __email__ = "<EMAIL>" import functools import unittest from pyl2extra.datasets.img_dataset.generators import (InlineGen, ...
# -*- coding: utf-8 -*- import servicemanager import win32api import win32process import win32service import win32serviceutil import subprocess import sys from os.path import dirname, join, split execfile(join(dirname(__file__), '..', 'server', 'openerp', 'release.py')) class OdooService(win32serviceutil.ServiceF...
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2019 Fortinet, Inc. # # 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 Lic...
#._cv_part guppy.heapy.View class Horizon: def __init__(self, mod): self.mod = mod self._hiding_tag_ = mod._hiding_tag_ # Make preallocations of things that will be needed for news() self.retset = self.mod.retset self.hv = mod.hv self.exc_info = self.mod._root.sys.exc_info self.iso = self.mod.iso str(self....
"""add_timestamp_to_base_resources Revision ID: 3894bccad37f Revises: 2f9e956e7532 Create Date: 2016-03-01 04:19:58.852612 """ # revision identifiers, used by Alembic. revision = '3894bccad37f' down_revision = '2f9e956e7532' from alembic import op import sqlalchemy as sa def upgrade(): for column_name in ['cr...
import account_report_common import account_report_common_partner import account_report_common_journal import account_report_common_account import account_automatic_reconcile import account_move_line_reconcile_select import account_move_line_unreconcile_select import account_reconcile_partner_process import account_re...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type from ansible import constants as C from ansible.release import __version__ as ansible_version from ansible.errors import AnsibleError, AnsibleAssertionError from ansible.module_utils.six import string_types from ansible.module_util...
#!/opt/local/bin/python #-*- Encoding: UTF-8 -*- import numpy as np import matplotlib.pyplot as plt from misc.correlate import correlate from sys import exit """ Correlate timeseries of two pixels. Trigger on large amplitudes. Try estimating radial blob velocity from this. """ shotnr = 1120711010 frame0 = 20000 nf...
"""This code example gets all child ad units of the effective root ad unit. To create ad units, run create_ad_units.py The LoadFromStorage method is pulling credentials and properties from a "googleads.yaml" file. By default, it looks for this file in your home directory. For more information, see the "Caching authen...
import argparse import glob import os import subprocess import sys def run_test(test_base_name, cmd, reset_results): """Run a test case. Args: test_base_name: The name for the test C++ source file without the extension. cmd: The actual command to run for the test. reset_results: True if the results s...
from xierpa3.adapters.adapter import Adapter #from xierpa3.toolbox.database.dynamodb.dynamodbconnector import Connector class Connector(): # @@@ Under development pass class DynamoDBAdapter(Adapter): u""" Wrapper around the DynamoDB Connector, using: - Connector.getItem(id) - Connector.save...
r""" ******************************* espressopp.FixedTripleAngleList ******************************* .. function:: espressopp.FixedTripleAngleList(storage) :param storage: :type storage: .. function:: espressopp.FixedTripleAngleList.add(pid1, pid2, pid3) :param pid1:...
from datetime import timedelta import pytest from django.utils import timezone from timed_auth_token.models import TimedAuthToken from users.models import CustomUser pytestmark = pytest.mark.django_db @pytest.fixture def token(): return TimedAuthToken(user=CustomUser.objects.create(identifier='blah')) def...
from __future__ import absolute_import, division, print_function, with_statement import contextlib import glob import logging import os import re import subprocess import sys import tempfile import warnings from tornado.escape import utf8 from tornado.log import LogFormatter, define_logging_options, enable_pretty_log...
"""SCons tool for 7zip.""" import os import shutil import subprocess import tempfile import SCons.Script def SevenZipGetFiles(env, source): """SCons emitter for 7zip extract. Examines the source 7z archive to determine the list of files which will be created by extract/unzip operation. Args: env: The S...
from . import account_invoice from . import partner from . import report
"""Class to represent an Ali Virtual Machine object. All VM specifics are self-contained and the class provides methods to operate on the VM: boot, shutdown, etc. """ import json import threading import logging from perfkitbenchmarker import flags from perfkitbenchmarker import virtual_machine from perfkitbenchmarke...
from setuptools import setup, find_packages, os import json with open('package.json') as packageFile: version = json.load(packageFile)['version'] setup( name="jasmine-core", version=version, url="http://pivotal.github.io/jasmine/", author="Pivotal Labs", author_email="<EMAIL>", description=(...
#!/usr/bin/env # # Lina Faller, April 2016 # # Usage: python annotate.py -r REF_FILE -i FASTA -o OUTFILE -l LOG # # This script reads in a reference file with two columns. The first column contains an ID # and the second column contains a short fragment of nucleotide sequence that uniquely # identifies this specific re...
""" Websocket proxy that is compatible with OpenStack Nova SPICE HTML5 consoles. Leverages websockify.py by Joel Martin """ import os import sys from oslo.config import cfg from nova import config from nova.console import websocketproxy opts = [ cfg.StrOpt('spicehtml5proxy_host', default='0.0.0.0...
from pandac.PandaModules import VBase4 CCNormal = 0 CCNoChat = 1 CCNonPlayer = 2 CCSuit = 3 CCToonBuilding = 4 CCSuitBuilding = 5 CCHouseBuilding = 6 CCSpeedChat = 7 CCFreeChat = 8 CHAT = 0 SPEEDCHAT = 1 CHAT_BALLOON = 0 THOUGHT_BALLOON = 1 cardModel = None arrowModel = None chatBalloon3dModel = None chatBalloon3d...
""" BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehension """ import logging import torch import torch.nn as nn from fairseq import utils from fairseq.models import ( register_model, register_model_architecture, ) from fairseq.models.transformer imp...
# generate twigs based on selected curves # automaticly layout uvs # rebuild curve to the certain length of one segment # set root/tip size # chridren twigs root/tip scale down relatively # UI # | [get curves] [rebuild] <unit> | # | -------------------------------------- | # | root size:<2.5> tip si...
# -*- coding: utf-8 -*- from openerp import tools from openerp.osv import osv, fields class TestMassMailing(osv.TransientModel): _name = 'mail.mass_mailing.test' _description = 'Sample Mail Wizard' _columns = { 'email_to': fields.char('Recipients', required=True, help='Comma-separate...
import time from oslo.config import cfg import requests from neutron.common import exceptions as n_exc from neutron.common import utils from neutron.extensions import portbindings from neutron.openstack.common import excutils from neutron.openstack.common import jsonutils from neutron.openstack.common import log from...
"""Test a Fast R-CNN network on an imdb (image database).""" from fast_rcnn.config import cfg, get_output_dir import argparse from utils.timer import Timer import numpy as np import cv2 import caffe from utils.cython_nms import nms import cPickle import heapq from utils.blob import im_list_to_blob import os def _get_...
import sys, time if sys.platform == 'win32': ## on windows, we need to use the following reactor for serial support ## http://twistedmatrix.com/trac/ticket/3802 ## from twisted.internet import win32eventreactor win32eventreactor.install() from twisted.internet import reactor print "Using Twisted reacto...
import imp import logging import os _shared_objs = {} def _get_one(name): global _shared_objs # Build path here = os.path.dirname(os.path.abspath(__file__)) plugins_dir = os.path.join(here, "plugins") filepath = os.path.join(plugins_dir, '%s.py' % name) # Load plug-in with open(filepath...
# -*- coding: utf-8 -*- __license__ = 'GPL 3' __copyright__ = '2009, John Schember <<EMAIL>>' __docformat__ = 'restructuredtext en' ''' Transform OEB content into RTF markup ''' import os import re import cStringIO from lxml import etree from calibre.ebooks.metadata import authors_to_string from calibre.utils.img ...
from openerp import models, api, _ class PurchaseOrderLine(models.Model): _inherit = 'purchase.order.line' @api.multi def button_save_data(self): return True @api.multi def button_details(self): context = self.env.context.copy() view_id = self.env.ref( 'purcha...
import re from bisect import bisect from django.conf import settings from django.db.models.related import RelatedObject from django.db.models.fields.related import ManyToManyRel from django.db.models.fields import AutoField, FieldDoesNotExist from django.db.models.fields.proxy import OrderWrt from django.db.models.loa...
# # Using the propagator to find the steady state of a driven system. # from qutip import * from pylab import * def run(): # # configure the parameters # delta = 0.075 * 2 * pi # qubit sigma_x coefficient eps0 = 0.0 * 2 * pi # qubit sigma_z coefficient A = 2.0 * 2 * pi # sweep rat...
"""Script to download the RSR files from internet """ import logging import argparse from pyspectral.utils import logging_on, logging_off from pyspectral.rsr_reader import check_and_download LOG = logging.getLogger(__name__) if __name__ == "__main__": parser = argparse.ArgumentParser( description='Down...